scream-code 0.15.7 → 0.15.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{app-BWXezRMl.mjs → app-DQdNroOu.mjs} +138 -33
- package/dist/{dispatch-CPK1Lkxu.mjs → dispatch-CxGKRLcZ.mjs} +1 -1
- package/dist/{dispatch-BJ6GyqMS.mjs → dispatch-D8ot3OUd.mjs} +221 -73
- package/dist/main.mjs +1 -1
- package/dist/public/assets/index-DwX1jGaf.js +96 -0
- package/dist/public/assets/index-DwX1jGaf.js.map +1 -0
- package/dist/public/assets/index-zIKfLBMX.css +1 -0
- package/dist/public/index.html +2 -2
- package/dist/{text-input-dialog-MAm2GHmm.mjs → text-input-dialog-2cG5VK1G.mjs} +1 -1
- package/dist/{text-input-dialog-CnQM0DYj.mjs → text-input-dialog-Dx7LJTG6.mjs} +26 -22
- package/package.json +1 -1
- package/dist/public/assets/index-Bvn-ixUo.js +0 -96
- package/dist/public/assets/index-Bvn-ixUo.js.map +0 -1
- package/dist/public/assets/index-yCBo3yth.css +0 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var Ad=Object.defineProperty;var Rd=(t,e,n)=>e in t?Ad(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var U=(t,e,n)=>Rd(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
|
|
2
|
+
* @vue/shared v3.5.40
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/function yr(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Fe={},zn=[],Et=()=>{},Ka=()=>!1,Do=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),No=t=>t.startsWith("onUpdate:"),Je=Object.assign,br=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Pd=Object.prototype.hasOwnProperty,Re=(t,e)=>Pd.call(t,e),pe=Array.isArray,Hn=t=>Os(t)==="[object Map]",Bo=t=>Os(t)==="[object Set]",cl=t=>Os(t)==="[object Date]",_e=t=>typeof t=="function",Ue=t=>typeof t=="string",Ot=t=>typeof t=="symbol",Ee=t=>t!==null&&typeof t=="object",Ya=t=>(Ee(t)||_e(t))&&_e(t.then)&&_e(t.catch),Ja=Object.prototype.toString,Os=t=>Ja.call(t),Ed=t=>Os(t).slice(8,-1),Za=t=>Os(t)==="[object Object]",kr=t=>Ue(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,gs=yr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Go=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},Ld=/-\w/g,yt=Go(t=>t.replace(Ld,e=>e.slice(1).toUpperCase())),Od=/\B([A-Z])/g,bn=Go(t=>t.replace(Od,"-$1").toLowerCase()),Fo=Go(t=>t.charAt(0).toUpperCase()+t.slice(1)),ai=Go(t=>t?`on${Fo(t)}`:""),Rt=(t,e)=>!Object.is(t,e),Xs=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},Xa=(t,e,n,s=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:s,value:n})},jo=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Dd=t=>{const e=Ue(t)?Number(t):NaN;return isNaN(e)?t:e};let ul;const Uo=()=>ul||(ul=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function $t(t){if(pe(t)){const e={};for(let n=0;n<t.length;n++){const s=t[n],o=Ue(s)?Fd(s):$t(s);if(o)for(const i in o)e[i]=o[i]}return e}else if(Ue(t)||Ee(t))return t}const Nd=/;(?![^(]*\))/g,Bd=/:([^]+)/,Gd=/\/\*[^]*?\*\//g;function Fd(t){const e={};return t.replace(Gd,"").split(Nd).forEach(n=>{if(n){const s=n.split(Bd);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function le(t){let e="";if(Ue(t))e=t;else if(pe(t))for(let n=0;n<t.length;n++){const s=le(t[n]);s&&(e+=s+" ")}else if(Ee(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const jd="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ud=yr(jd);function Qa(t){return!!t||t===""}function zd(t,e){if(t.length!==e.length)return!1;let n=!0;for(let s=0;n&&s<t.length;s++)n=Ds(t[s],e[s]);return n}function Ds(t,e){if(t===e)return!0;let n=cl(t),s=cl(e);if(n||s)return n&&s?t.getTime()===e.getTime():!1;if(n=Ot(t),s=Ot(e),n||s)return t===e;if(n=pe(t),s=pe(e),n||s)return n&&s?zd(t,e):!1;if(n=Ee(t),s=Ee(e),n||s){if(!n||!s)return!1;const o=Object.keys(t).length,i=Object.keys(e).length;if(o!==i)return!1;for(const r in t){const l=t.hasOwnProperty(r),a=e.hasOwnProperty(r);if(l&&!a||!l&&a||!Ds(t[r],e[r]))return!1}}return String(t)===String(e)}function Hd(t,e){return t.findIndex(n=>Ds(n,e))}const ec=t=>!!(t&&t.__v_isRef===!0),M=t=>Ue(t)?t:t==null?"":pe(t)||Ee(t)&&(t.toString===Ja||!_e(t.toString))?ec(t)?M(t.value):JSON.stringify(t,tc,2):String(t),tc=(t,e)=>ec(e)?tc(t,e.value):Hn(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[s,o],i)=>(n[ci(s,i)+" =>"]=o,n),{})}:Bo(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>ci(n))}:Ot(e)?ci(e):Ee(e)&&!pe(e)&&!Za(e)?String(e):e,ci=(t,e="")=>{var n;return Ot(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};function qd(t){return t==null?"initial":typeof t=="string"?t===""?" ":t:String(t)}/**
|
|
6
|
+
* @vue/reactivity v3.5.40
|
|
7
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
+
* @license MIT
|
|
9
|
+
**/let it;class Wd{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&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 e,n;if(this.scopes){const s=this.scopes.slice();for(e=0,n=s.length;e<n;e++)s[e].pause()}for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes){const o=this.scopes.slice();for(e=0,n=o.length;e<n;e++)o[e].resume()}const s=this.effects.slice();for(e=0,n=s.length;e<n;e++)s[e].resume()}}run(e){if(this._active){const n=it;try{return it=this,e()}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 e=it;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){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&&!e){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function Vd(){return it}let je;const ui=new WeakSet;class nc{constructor(e){this.fn=e,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,ui.has(this)&&(ui.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||oc(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,dl(this),ic(this);const e=je,n=Lt;je=this,Lt=!0;try{return this.fn()}finally{rc(this),je=e,Lt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)_r(e);this.deps=this.depsTail=void 0,dl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ui.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Bi(this)&&this.run()}get dirty(){return Bi(this)}}let sc=0,ms,vs;function oc(t,e=!1){if(t.flags|=8,e){t.next=vs,vs=t;return}t.next=ms,ms=t}function wr(){sc++}function Sr(){if(--sc>0)return;if(vs){let e=vs;for(vs=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;ms;){let e=ms;for(ms=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){t||(t=s)}e=n}}if(t)throw t}function ic(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function rc(t){let e,n=t.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),_r(s),Kd(s)):e=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}t.deps=e,t.depsTail=n}function Bi(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(lc(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function lc(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Ss)||(t.globalVersion=Ss,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Bi(t))))return;t.flags|=2;const e=t.dep,n=je,s=Lt;je=t,Lt=!0;try{ic(t);const o=t.fn(t._value);(e.version===0||Rt(o,t._value))&&(t.flags|=128,t._value=o,e.version++)}catch(o){throw e.version++,o}finally{je=n,Lt=s,rc(t),t.flags&=-3}}function _r(t,e=!1){const{dep:n,prevSub:s,nextSub:o}=t;if(s&&(s.nextSub=o,t.prevSub=void 0),o&&(o.prevSub=s,t.nextSub=void 0),n.subs===t&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)_r(i,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function Kd(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let Lt=!0;const ac=[];function ln(){ac.push(Lt),Lt=!1}function an(){const t=ac.pop();Lt=t===void 0?!0:t}function dl(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=je;je=void 0;try{e()}finally{je=n}}}let Ss=0;class Yd{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class $r{constructor(e){this.computed=e,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(e){if(!je||!Lt||je===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==je)n=this.activeLink=new Yd(je,this),je.deps?(n.prevDep=je.depsTail,je.depsTail.nextDep=n,je.depsTail=n):je.deps=je.depsTail=n,cc(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=je.depsTail,n.nextDep=void 0,je.depsTail.nextDep=n,je.depsTail=n,je.deps===n&&(je.deps=s)}return n}trigger(e){this.version++,Ss++,this.notify(e)}notify(e){wr();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Sr()}}}function cc(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let s=e.deps;s;s=s.nextDep)cc(s)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Gi=new WeakMap,Rn=Symbol(""),Fi=Symbol(""),_s=Symbol("");function at(t,e,n){if(Lt&&je){let s=Gi.get(t);s||Gi.set(t,s=new Map);let o=s.get(n);o||(s.set(n,o=new $r),o.map=s,o.key=n),o.track()}}function Xt(t,e,n,s,o,i){const r=Gi.get(t);if(!r){Ss++;return}const l=a=>{a&&a.trigger()};if(wr(),e==="clear")r.forEach(l);else{const a=pe(t),c=a&&kr(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,h)=>{(h==="length"||h===_s||!Ot(h)&&h>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(_s)),e){case"add":a?c&&l(r.get("length")):(l(r.get(Rn)),Hn(t)&&l(r.get(Fi)));break;case"delete":a||(l(r.get(Rn)),Hn(t)&&l(r.get(Fi)));break;case"set":Hn(t)&&l(r.get(Rn));break}}Sr()}function Fn(t){const e=Me(t);return e===t?e:(at(e,"iterate",_s),Mt(t)?e:e.map(Dt))}function zo(t){return at(t=Me(t),"iterate",_s),t}function Wt(t,e){return cn(t)?Jn(Pn(t)?Dt(e):e):Dt(e)}const Jd={__proto__:null,[Symbol.iterator](){return di(this,Symbol.iterator,t=>Wt(this,t))},concat(...t){return Fn(this).concat(...t.map(e=>pe(e)?Fn(e):e))},entries(){return di(this,"entries",t=>(t[1]=Wt(this,t[1]),t))},every(t,e){return Kt(this,"every",t,e,void 0,arguments)},filter(t,e){return Kt(this,"filter",t,e,n=>n.map(s=>Wt(this,s)),arguments)},find(t,e){return Kt(this,"find",t,e,n=>Wt(this,n),arguments)},findIndex(t,e){return Kt(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Kt(this,"findLast",t,e,n=>Wt(this,n),arguments)},findLastIndex(t,e){return Kt(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Kt(this,"forEach",t,e,void 0,arguments)},includes(...t){return fi(this,"includes",t)},indexOf(...t){return fi(this,"indexOf",t)},join(t){return Fn(this).join(t)},lastIndexOf(...t){return fi(this,"lastIndexOf",t)},map(t,e){return Kt(this,"map",t,e,void 0,arguments)},pop(){return ss(this,"pop")},push(...t){return ss(this,"push",t)},reduce(t,...e){return fl(this,"reduce",t,e)},reduceRight(t,...e){return fl(this,"reduceRight",t,e)},shift(){return ss(this,"shift")},some(t,e){return Kt(this,"some",t,e,void 0,arguments)},splice(...t){return ss(this,"splice",t)},toReversed(){return Fn(this).toReversed()},toSorted(t){return Fn(this).toSorted(t)},toSpliced(...t){return Fn(this).toSpliced(...t)},unshift(...t){return ss(this,"unshift",t)},values(){return di(this,"values",t=>Wt(this,t))}};function di(t,e,n){const s=zo(t),o=s[e]();return s!==t&&!Mt(t)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const Zd=Array.prototype;function Kt(t,e,n,s,o,i){const r=zo(t),l=r!==t&&!Mt(t),a=r[e];if(a!==Zd[e]){const d=a.apply(t,i);return l?Dt(d):d}let c=n;r!==t&&(l?c=function(d,h){return n.call(this,Wt(t,d),h,t)}:n.length>2&&(c=function(d,h){return n.call(this,d,h,t)}));const u=a.call(r,c,s);return l&&o?o(u):u}function fl(t,e,n,s){const o=zo(t),i=o!==t&&!Mt(t);let r=n,l=!1;o!==t&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Wt(t,c)),n.call(this,c,Wt(t,u),d,t)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,t)}));const a=o[e](r,...s);return l?Wt(t,a):a}function fi(t,e,n){const s=Me(t);at(s,"iterate",_s);const o=s[e](...n);return(o===-1||o===!1)&&Tr(n[0])?(n[0]=Me(n[0]),s[e](...n)):o}function ss(t,e,n=[]){ln(),wr();const s=Me(t)[e].apply(t,n);return Sr(),an(),s}const Xd=yr("__proto__,__v_isRef,__isVue"),uc=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ot));function Qd(t){Ot(t)||(t=String(t));const e=Me(this);return at(e,"has",t),e.hasOwnProperty(t)}class dc{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,s){if(n==="__v_skip")return e.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?uf:gc:i?pc:hc).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const r=pe(e);if(!o){let a;if(r&&(a=Jd[n]))return a;if(n==="hasOwnProperty")return Qd}const l=Reflect.get(e,n,et(e)?e:s);if((Ot(n)?uc.has(n):Xd(n))||(o||at(e,"get",n),i))return l;if(et(l)){const a=r&&kr(n)?l:l.value;return o&&Ee(a)?Ui(a):a}return Ee(l)?o?Ui(l):vn(l):l}}class fc extends dc{constructor(e=!1){super(!1,e)}set(e,n,s,o){let i=e[n];const r=pe(e)&&kr(n);if(!this._isShallow){const c=cn(i);if(!Mt(s)&&!cn(s)&&(i=Me(i),s=Me(s)),!r&&et(i)&&!et(s))return c||(i.value=s),!0}const l=r?Number(n)<e.length:Re(e,n),a=Reflect.set(e,n,s,et(e)?e:o);return e===Me(o)&&a&&(l?Rt(s,i)&&Xt(e,"set",n,s):Xt(e,"add",n,s)),a}deleteProperty(e,n){const s=Re(e,n);e[n];const o=Reflect.deleteProperty(e,n);return o&&s&&Xt(e,"delete",n,void 0),o}has(e,n){const s=Reflect.has(e,n);return(!Ot(n)||!uc.has(n))&&at(e,"has",n),s}ownKeys(e){return at(e,"iterate",pe(e)?"length":Rn),Reflect.ownKeys(e)}}class ef extends dc{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const tf=new fc,nf=new ef,sf=new fc(!0);const ji=t=>t,Us=t=>Reflect.getPrototypeOf(t);function of(t,e,n){return function(...s){const o=this.__v_raw,i=Me(o),r=Hn(i),l=t==="entries"||t===Symbol.iterator&&r,a=t==="keys"&&r,c=o[t](...s),u=n?ji:e?Jn:Dt;return!e&&at(i,"iterate",a?Fi:Rn),Je(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 zs(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function rf(t,e){const n={get(o){const i=this.__v_raw,r=Me(i),l=Me(o);t||(Rt(o,l)&&at(r,"get",o),at(r,"get",l));const{has:a}=Us(r),c=e?ji:t?Jn:Dt;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!t&&at(Me(o),"iterate",Rn),o.size},has(o){const i=this.__v_raw,r=Me(i),l=Me(o);return t||(Rt(o,l)&&at(r,"has",o),at(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=Me(l),c=e?ji:t?Jn:Dt;return!t&&at(a,"iterate",Rn),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return Je(n,t?{add:zs("add"),set:zs("set"),delete:zs("delete"),clear:zs("clear")}:{add(o){const i=Me(this),r=Us(i),l=Me(o),a=!e&&!Mt(o)&&!cn(o)?l:o;return r.has.call(i,a)||Rt(o,a)&&r.has.call(i,o)||Rt(l,a)&&r.has.call(i,l)||(i.add(a),Xt(i,"add",a,a)),this},set(o,i){!e&&!Mt(i)&&!cn(i)&&(i=Me(i));const r=Me(this),{has:l,get:a}=Us(r);let c=l.call(r,o);c||(o=Me(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?Rt(i,u)&&Xt(r,"set",o,i):Xt(r,"add",o,i),this},delete(o){const i=Me(this),{has:r,get:l}=Us(i);let a=r.call(i,o);a||(o=Me(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&Xt(i,"delete",o,void 0),c},clear(){const o=Me(this),i=o.size!==0,r=o.clear();return i&&Xt(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=of(o,t,e)}),n}function xr(t,e){const n=rf(t,e);return(s,o,i)=>o==="__v_isReactive"?!t:o==="__v_isReadonly"?t:o==="__v_raw"?s:Reflect.get(Re(n,o)&&o in s?n:s,o,i)}const lf={get:xr(!1,!1)},af={get:xr(!1,!0)},cf={get:xr(!0,!1)};const hc=new WeakMap,pc=new WeakMap,gc=new WeakMap,uf=new WeakMap;function df(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function vn(t){return cn(t)?t:Cr(t,!1,tf,lf,hc)}function ff(t){return Cr(t,!1,sf,af,pc)}function Ui(t){return Cr(t,!0,nf,cf,gc)}function Cr(t,e,n,s,o){if(!Ee(t)||t.__v_raw&&!(e&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const i=o.get(t);if(i)return i;const r=df(Ed(t));if(r===0)return t;const l=new Proxy(t,r===2?s:n);return o.set(t,l),l}function Pn(t){return cn(t)?Pn(t.__v_raw):!!(t&&t.__v_isReactive)}function cn(t){return!!(t&&t.__v_isReadonly)}function Mt(t){return!!(t&&t.__v_isShallow)}function Tr(t){return t?!!t.__v_raw:!1}function Me(t){const e=t&&t.__v_raw;return e?Me(e):t}function hf(t){return!Re(t,"__v_skip")&&Object.isExtensible(t)&&Xa(t,"__v_skip",!0),t}const Dt=t=>Ee(t)?vn(t):t,Jn=t=>Ee(t)?Ui(t):t;function et(t){return t?t.__v_isRef===!0:!1}function O(t){return pf(t,!1)}function pf(t,e){return et(t)?t:new gf(t,e)}class gf{constructor(e,n){this.dep=new $r,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:Me(e),this._value=n?e:Dt(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,s=this.__v_isShallow||Mt(e)||cn(e);e=s?e:Me(e),Rt(e,n)&&(this._rawValue=e,this._value=s?e:Dt(e),this.dep.trigger())}}function L(t){return et(t)?t.value:t}const mf={get:(t,e,n)=>e==="__v_raw"?t:L(Reflect.get(t,e,n)),set:(t,e,n,s)=>{const o=t[e];return et(o)&&!et(n)?(o.value=n,!0):Reflect.set(t,e,n,s)}};function mc(t){return Pn(t)?t:new Proxy(t,mf)}class vf{constructor(e,n,s){this.fn=e,this.setter=n,this._value=void 0,this.dep=new $r(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ss-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&je!==this)return oc(this,!0),!0}get value(){const e=this.dep.track();return lc(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function yf(t,e,n=!1){let s,o;return _e(t)?s=t:(s=t.get,o=t.set),new vf(s,o,n)}const Hs={},co=new WeakMap;let $n;function bf(t,e=!1,n=$n){if(n){let s=co.get(n);s||co.set(n,s=[]),s.push(t)}}function kf(t,e,n=Fe){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=A=>o?A:Mt(A)||o===!1||o===0?Qt(A,1):Qt(A);let u,d,h,p,m=!1,y=!1;if(et(t)?(d=()=>t.value,m=Mt(t)):Pn(t)?(d=()=>c(t),m=!0):pe(t)?(y=!0,m=t.some(A=>Pn(A)||Mt(A)),d=()=>t.map(A=>{if(et(A))return A.value;if(Pn(A))return c(A);if(_e(A))return a?a(A,2):A()})):_e(t)?e?d=a?()=>a(t,2):t:d=()=>{if(h){ln();try{h()}finally{an()}}const A=$n;$n=u;try{return a?a(t,3,[p]):t(p)}finally{$n=A}}:d=Et,e&&o){const A=d,Y=o===!0?1/0:o;d=()=>Qt(A(),Y)}const b=Vd(),w=()=>{u.stop(),b&&b.active&&br(b.effects,u)};if(i&&e){const A=e;e=(...Y)=>{const G=A(...Y);return w(),G}}let S=y?new Array(t.length).fill(Hs):Hs;const _=A=>{if(!(!(u.flags&1)||!u.dirty&&!A))if(e){const Y=u.run();if(A||o||m||(y?Y.some((G,I)=>Rt(G,S[I])):Rt(Y,S))){h&&h();const G=$n;$n=u;try{const I=[Y,S===Hs?void 0:y&&S[0]===Hs?[]:S,p];S=Y,a?a(e,3,I):e(...I)}finally{$n=G}}}else u.run()};return l&&l(_),u=new nc(d),u.scheduler=r?()=>r(_,!1):_,p=A=>bf(A,!1,u),h=u.onStop=()=>{const A=co.get(u);if(A){if(a)a(A,4);else for(const Y of A)Y();co.delete(u)}},e?s?_(!0):S=u.run():r?r(_.bind(null,!0),!0):u.run(),w.pause=u.pause.bind(u),w.resume=u.resume.bind(u),w.stop=w,w}function Qt(t,e=1/0,n){if(e<=0||!Ee(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,et(t))Qt(t.value,e,n);else if(pe(t))for(let s=0;s<t.length;s++)Qt(t[s],e,n);else if(Bo(t)||Hn(t))t.forEach(s=>{Qt(s,e,n)});else if(Za(t)){for(const s in t)Qt(t[s],e,n);for(const s of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,s)&&Qt(t[s],e,n)}return t}/**
|
|
10
|
+
* @vue/runtime-core v3.5.40
|
|
11
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
+
* @license MIT
|
|
13
|
+
**/function Ns(t,e,n,s){try{return s?t(...s):t()}catch(o){Ho(o,e,n)}}function At(t,e,n,s){if(_e(t)){const o=Ns(t,e,n,s);return o&&Ya(o)&&o.catch(i=>{Ho(i,e,n)}),o}if(pe(t)){const o=[];for(let i=0;i<t.length;i++)o.push(At(t[i],e,n,s));return o}}function Ho(t,e,n,s=!0){const o=e?e.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=e&&e.appContext.config||Fe;if(e){let l=e.parent;const a=e.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](t,a,c)===!1)return}l=l.parent}if(i){ln(),Ns(i,null,10,[t,a,c]),an();return}}wf(t,n,o,s,r)}function wf(t,e,n,s=!0,o=!1){if(o)throw t;console.error(t)}const gt=[];let qt=-1;const qn=[];let pn=null,jn=0;const vc=Promise.resolve();let uo=null;function We(t){const e=uo||vc;return t?e.then(this?t.bind(this):t):e}function Sf(t){let e=qt+1,n=gt.length;for(;e<n;){const s=e+n>>>1,o=gt[s],i=$s(o);i<t||i===t&&o.flags&2?e=s+1:n=s}return e}function Ir(t){if(!(t.flags&1)){const e=$s(t),n=gt[gt.length-1];!n||!(t.flags&2)&&e>=$s(n)?gt.push(t):gt.splice(Sf(e),0,t),t.flags|=1,yc()}}function yc(){uo||(uo=vc.then(wc))}function bc(t){pe(t)?qn.push(...t):pn&&t.id===-1?pn.splice(jn+1,0,t):t.flags&1||(qn.push(t),t.flags|=1),yc()}function hl(t,e,n=qt+1){for(;n<gt.length;n++){const s=gt[n];if(s&&s.flags&2){if(t&&s.id!==t.uid)continue;gt.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function kc(t){if(qn.length){const e=[...new Set(qn)].sort((n,s)=>$s(n)-$s(s));if(qn.length=0,pn){pn.push(...e);return}for(pn=e,jn=0;jn<pn.length;jn++){const n=pn[jn];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}pn=null,jn=0}}const $s=t=>t.id==null?t.flags&2?-1:1/0:t.id;function wc(t){try{for(qt=0;qt<gt.length;qt++){const e=gt[qt];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Ns(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;qt<gt.length;qt++){const e=gt[qt];e&&(e.flags&=-2)}qt=-1,gt.length=0,kc(),uo=null,(gt.length||qn.length)&&wc()}}let rt=null,Sc=null;function fo(t){const e=rt;return rt=t,Sc=t&&t.type.__scopeId||null,e}function bt(t,e=rt,n){if(!e||t._n)return t;const s=(...o)=>{s._d&&go(-1);const i=fo(e),r=rn.length;let l;try{l=t(...o)}finally{for(let a=rn.length;a>r;a--)Lr();fo(i),s._d&&go(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function qe(t,e){if(rt===null)return t;const n=Zo(rt),s=t.dirs||(t.dirs=[]);for(let o=0;o<e.length;o++){let[i,r,l,a=Fe]=e[o];i&&(_e(i)&&(i={mounted:i,updated:i}),i.deep&&Qt(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return t}function kn(t,e,n,s){const o=t.dirs,i=e&&e.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&(ln(),At(a,n,8,[t.el,l,t,e]),an())}}function Qs(t,e){if(ut){let n=ut.provides;const s=ut.parent&&ut.parent.provides;s===n&&(n=ut.provides=Object.create(s)),n[t]=e}}function on(t,e,n=!1){const s=Jo();if(s||Vn){let o=Vn?Vn._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&t in o)return o[t];if(arguments.length>1)return n&&_e(e)?e.call(s&&s.proxy):e}}const _f=Symbol.for("v-scx"),$f=()=>on(_f);function xe(t,e,n){return _c(t,e,n)}function _c(t,e,n=Fe){const{immediate:s,deep:o,flush:i,once:r}=n,l=Je({},n),a=e&&s||!e&&i!=="post";let c;if(Ts){if(i==="sync"){const p=$f();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=Et,p.resume=Et,p.pause=Et,p}}const u=ut;l.call=(p,m,y)=>At(p,u,m,y);let d=!1;i==="post"?l.scheduler=p=>{pt(p,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(p,m)=>{m?p():Ir(p)}),l.augmentJob=p=>{e&&(p.flags|=4),d&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const h=kf(t,e,l);return Ts&&(c?c.push(h):a&&h()),h}function xf(t,e,n){const s=this.proxy,o=Ue(t)?t.includes(".")?$c(s,t):()=>s[t]:t.bind(s,s);let i;_e(e)?i=e:(i=e.handler,n=e);const r=Bs(this),l=_c(o,i.bind(s),n);return r(),l}function $c(t,e){const n=e.split(".");return()=>{let s=t;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const fn=new WeakMap,xc=Symbol("_vte"),Cc=t=>t.__isTeleport,Cn=t=>t&&(t.disabled||t.disabled===""),Cf=t=>t&&(t.defer||t.defer===""),pl=t=>typeof SVGElement<"u"&&t instanceof SVGElement,gl=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,zi=(t,e)=>{const n=t&&t.to;return Ue(n)?e?e(n):null:n},Tf={name:"Teleport",__isTeleport:!0,process(t,e,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:h,o:{insert:p,querySelector:m,createText:y,createComment:b,parentNode:w}}=c,S=Cn(e.props);let{dynamicChildren:_}=e;const A=(I,C,k)=>{I.shapeFlag&16&&u(I.children,C,k,o,i,r,l,a)},Y=(I=e)=>{const C=Cn(I.props),k=I.target=zi(I.props,m),T=Hi(k,I,y,p);k&&(r!=="svg"&&pl(k)?r="svg":r!=="mathml"&&gl(k)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(k),C||(A(I,k,T),ds(I,!1)))},G=I=>{const C=()=>{if(fn.get(I)===C){if(fn.delete(I),Cn(I.props)){const k=w(I.el)||n;A(I,k,I.anchor),ds(I,!0)}Y(I)}};fn.set(I,C),pt(C,i)};if(t==null){const I=e.el=y(""),C=e.anchor=y("");if(p(I,n,s),p(C,n,s),Cf(e.props)||i&&i.pendingBranch){G(e);return}S&&(A(e,n,C),ds(e,!0)),Y()}else{e.el=t.el;const I=e.anchor=t.anchor,C=fn.get(t);if(C){C.flags|=8,fn.delete(t),G(e);return}e.targetStart=t.targetStart;const k=e.target=t.target,T=e.targetAnchor=t.targetAnchor,P=Cn(t.props),N=P?n:k,re=P?I:T;if(r==="svg"||pl(k)?r="svg":(r==="mathml"||gl(k))&&(r="mathml"),_?(h(t.dynamicChildren,_,N,o,i,r,l),Er(t,e,!0)):a||d(t,e,N,re,o,i,r,l,!1),S)P?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):qs(e,n,I,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const F=zi(e.props,m);F&&(e.target=F,qs(e,F,null,c,0))}else P&&qs(e,k,T,c,1);ds(e,S)}},remove(t,e,n,{um:s,o:{remove:o}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:h}=t,p=Cn(h),m=i||!p,y=fn.get(t);if(y&&(y.flags|=8,fn.delete(t)),d&&(o(c),o(u)),i&&o(a),!y&&(p||d)&&r&16)for(let b=0;b<l.length;b++){const w=l[b];s(w,e,n,m,!!w.dynamicChildren)}},move:qs,hydrate:If};function qs(t,e,n,{o:{insert:s},m:o},i=2){i===0&&s(t.targetAnchor,e,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=t,d=i===2;if(d&&s(r,e,n),!fn.has(t)&&(!d||Cn(u))&&a&16)for(let h=0;h<c.length;h++)o(c[h],e,n,2);d&&s(l,e,n)}function If(t,e,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function h(b,w){let S=w;for(;S;){if(S&&S.nodeType===8){if(S.data==="teleport start anchor")e.targetStart=S;else if(S.data==="teleport anchor"){e.targetAnchor=S,b._lpa=e.targetAnchor&&r(e.targetAnchor);break}}S=r(S)}}function p(b,w){w.anchor=d(r(b),w,l(b),n,s,o,i)}const m=e.target=zi(e.props,a),y=Cn(e.props);if(m){const b=m._lpa||m.firstChild;e.shapeFlag&16&&(y?(p(t,e),h(m,b),e.targetAnchor||Hi(m,e,u,c,l(t)===m?t:null)):(e.anchor=r(t),h(m,b),e.targetAnchor||Hi(m,e,u,c),d(b&&r(b),e,m,n,s,o,i))),ds(e,y)}else y&&e.shapeFlag&16&&(p(t,e),e.targetStart=t,e.targetAnchor=r(t));return e.anchor&&r(e.anchor)}const Mr=Tf;function ds(t,e){const n=t.ctx;if(n&&n.ut){let s,o;for(e?(s=t.el,o=t.anchor):(s=t.targetStart,o=t.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Hi(t,e,n,s,o=null){const i=e.targetStart=n(""),r=e.targetAnchor=n("");return i[xc]=r,t&&(s(i,t,o),s(r,t,o)),r}const Tt=Symbol("_leaveCb"),os=Symbol("_enterCb");function Tc(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ze(()=>{t.isMounted=!0}),ft(()=>{t.isUnmounting=!0}),t}const xt=[Function,Array],Ic={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:xt,onEnter:xt,onAfterEnter:xt,onEnterCancelled:xt,onBeforeLeave:xt,onLeave:xt,onAfterLeave:xt,onLeaveCancelled:xt,onBeforeAppear:xt,onAppear:xt,onAfterAppear:xt,onAppearCancelled:xt},Mc=t=>{const e=t.subTree;return e.component?Mc(e.component):e},Mf={name:"BaseTransition",props:Ic,setup(t,{slots:e}){const n=Jo(),s=Tc();return()=>{const o=e.default&&Ar(e.default(),!0),i=o&&o.length?Ac(o):n.subTree?B():void 0;if(!i)return;const r=Me(t),{mode:l}=r;if(s.isLeaving)return hi(i);const a=ml(i);if(!a)return hi(i);let c=xs(a,r,s,n,d=>c=d);a.type!==ct&&On(a,c);let u=n.subTree&&ml(n.subTree);if(u&&u.type!==ct&&!Tn(u,a)&&Mc(n).type!==ct){let d=xs(u,r,s,n);if(On(u,d),l==="out-in"&&a.type!==ct)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},hi(i);l==="in-out"&&a.type!==ct?d.delayLeave=(h,p,m)=>{const y=Rc(s,u);y[String(u.key)]=u,h[Tt]=()=>{p(),h[Tt]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{m(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function Ac(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==ct){e=n;break}}return e}const Af=Mf;function Rc(t,e){const{leavingVNodes:n}=t;let s=n.get(e.type);return s||(s=Object.create(null),n.set(e.type,s)),s}function xs(t,e,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:h,onLeave:p,onAfterLeave:m,onLeaveCancelled:y,onBeforeAppear:b,onAppear:w,onAfterAppear:S,onAppearCancelled:_}=e,A=String(t.key),Y=Rc(n,t),G=(k,T)=>{k&&At(k,s,9,T)},I=(k,T)=>{const P=T[1];G(k,T),pe(k)?k.every(N=>N.length<=1)&&P():k.length<=1&&P()},C={mode:r,persisted:l,beforeEnter(k){let T=a;if(!n.isMounted)if(i)T=b||a;else return;k[Tt]&&k[Tt](!0);const P=Y[A];P&&Tn(t,P)&&P.el[Tt]&&P.el[Tt](),G(T,[k])},enter(k){if(Y[A]===t)return;let T=c,P=u,N=d;if(!n.isMounted)if(i)T=w||c,P=S||u,N=_||d;else return;let re=!1;k[os]=D=>{re||(re=!0,D?G(N,[k]):G(P,[k]),C.delayedLeave&&C.delayedLeave(),k[os]=void 0)};const F=k[os].bind(null,!1);T?I(T,[k,F]):F()},leave(k,T){const P=String(t.key);if(k[os]&&k[os](!0),n.isUnmounting)return T();G(h,[k]);let N=!1;k[Tt]=F=>{N||(N=!0,T(),F?G(y,[k]):G(m,[k]),k[Tt]=void 0,Y[P]===t&&delete Y[P])};const re=k[Tt].bind(null,!1);Y[P]=t,p?I(p,[k,re]):re()},clone(k){const T=xs(k,e,n,s,o);return o&&o(T),T}};return C}function hi(t){if(qo(t))return t=yn(t),t.children=null,t}function ml(t){if(!qo(t))return Cc(t.type)&&t.children?Ac(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&_e(n.default))return n.default()}}function On(t,e){t.shapeFlag&6&&t.component?(t.transition=e,On(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function Ar(t,e=!1,n){let s=[],o=0;for(let i=0;i<t.length;i++){let r=t[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===X?(r.patchFlag&128&&o++,s=s.concat(Ar(r.children,e,l))):(e||r.type!==ct)&&s.push(l!=null?yn(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function ke(t,e){return _e(t)?Je({name:t.name},e,{setup:t}):t}function Pc(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function vl(t,e){let n;return!!((n=Object.getOwnPropertyDescriptor(t,e))&&!n.configurable)}const ho=new WeakMap;function ys(t,e,n,s,o=!1){if(pe(t)){t.forEach((y,b)=>ys(y,e&&(pe(e)?e[b]:e),n,s,o));return}if(Wn(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&ys(t,e,n,s.component.subTree);return}const i=s.shapeFlag&4?Zo(s.component):s.el,r=o?null:i,{i:l,r:a}=t,c=e&&e.r,u=l.refs===Fe?l.refs={}:l.refs,d=l.setupState,h=Me(d),p=d===Fe?Ka:y=>vl(u,y)?!1:Re(h,y),m=(y,b)=>!(b&&vl(u,b));if(c!=null&&c!==a){if(yl(e),Ue(c))u[c]=null,p(c)&&(d[c]=null);else if(et(c)){const y=e;m(c,y.k)&&(c.value=null),y.k&&(u[y.k]=null)}}if(_e(a))Ns(a,l,12,[r,u]);else{const y=Ue(a),b=et(a);if(y||b){const w=()=>{if(t.f){const S=y?p(a)?d[a]:u[a]:m()||!t.k?a.value:u[t.k];if(o)pe(S)&&br(S,i);else if(pe(S))S.includes(i)||S.push(i);else if(y)u[a]=[i],p(a)&&(d[a]=u[a]);else{const _=[i];m(a,t.k)&&(a.value=_),t.k&&(u[t.k]=_)}}else y?(u[a]=r,p(a)&&(d[a]=r)):b&&(m(a,t.k)&&(a.value=r),t.k&&(u[t.k]=r))};if(r){const S=()=>{w(),ho.delete(t)};S.id=-1,ho.set(t,S),pt(S,n)}else yl(t),w()}}}function yl(t){const e=ho.get(t);e&&(e.flags|=8,ho.delete(t))}Uo().requestIdleCallback;Uo().cancelIdleCallback;const Wn=t=>!!t.type.__asyncLoader,qo=t=>t.type.__isKeepAlive;function Rf(t,e){Ec(t,"a",e)}function Pf(t,e){Ec(t,"da",e)}function Ec(t,e,n=ut){const s=t.__wdc||(t.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return t()});if(Wo(e,s,n),n){let o=n.parent;for(;o&&o.parent;)qo(o.parent.vnode)&&Ef(s,e,n,o),o=o.parent}}function Ef(t,e,n,s){const o=Wo(e,t,s,!0);Vo(()=>{br(s[e],o)},n)}function Wo(t,e,n=ut,s=!1){if(n){const o=n[t]||(n[t]=[]),i=e.__weh||(e.__weh=(...r)=>{ln();const l=Bs(n),a=At(e,n,t,r);return l(),an(),a});return s?o.unshift(i):o.push(i),i}}const un=t=>(e,n=ut)=>{(!Ts||t==="sp")&&Wo(t,(...s)=>e(...s),n)},Lf=un("bm"),Ze=un("m"),Lc=un("bu"),Oc=un("u"),ft=un("bum"),Vo=un("um"),Of=un("sp"),Df=un("rtg"),Nf=un("rtc");function Bf(t,e=ut){Wo("ec",t,e)}const Dc="components";function Gf(t,e){return Bc(Dc,t,!0,e)||t}const Nc=Symbol.for("v-ndc");function Ff(t){return Ue(t)?Bc(Dc,t,!1)||t:t||Nc}function Bc(t,e,n=!0,s=!1){const o=rt||ut;if(o){const i=o.type;{const l=_h(i,!1);if(l&&(l===e||l===yt(e)||l===Fo(yt(e))))return i}const r=bl(o[t]||i[t],e)||bl(o.appContext[t],e);return!r&&s?i:r}}function bl(t,e){return t&&(t[e]||t[yt(e)]||t[Fo(yt(e))])}function Ce(t,e,n,s){let o;const i=n&&n[s],r=pe(t);if(r||Ue(t)){const l=r&&Pn(t);let a=!1,c=!1;l&&(a=!Mt(t),c=cn(t),t=zo(t)),o=new Array(t.length);for(let u=0,d=t.length;u<d;u++)o[u]=e(a?c?Jn(Dt(t[u])):Dt(t[u]):t[u],u,void 0,i&&i[u])}else if(typeof t=="number"){o=new Array(t);for(let l=0;l<t;l++)o[l]=e(l+1,l,void 0,i&&i[l])}else if(Ee(t))if(t[Symbol.iterator])o=Array.from(t,(l,a)=>e(l,a,void 0,i&&i[a]));else{const l=Object.keys(t);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=e(t[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function eo(t,e,n={},s,o,i){if(rt.ce||rt.parent&&Wn(rt.parent)&&rt.parent.ce){const c=n,u=Object.keys(c).length>0;return e!=="default"&&(c.name=e),g(),Oe(X,null,[J("slot",c,s&&s())],u?-2:64)}let r=t[e];r&&r._c&&(r._d=!1);const l=rn.length;g();let a;try{const c=r&&Gc(r(n)),u=n.key||i||c&&c.key;a=Oe(X,{key:(u&&!Ot(u)?u:`_${e}`)+(!c&&s?"_fb":"")},c||(s?s():[]),c&&t._===1?64:-2)}catch(c){for(let u=rn.length;u>l;u--)Lr();throw c}finally{r&&r._c&&(r._d=!0)}return a}function Gc(t){return t.some(e=>Cs(e)?!(e.type===ct||e.type===X&&!Gc(e.children)):!0)?t:null}const qi=t=>t?ou(t)?Zo(t):qi(t.parent):null,bs=Je(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>qi(t.parent),$root:t=>qi(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>jc(t),$forceUpdate:t=>t.f||(t.f=()=>{Ir(t.update)}),$nextTick:t=>t.n||(t.n=We.bind(t.proxy)),$watch:t=>xf.bind(t)}),pi=(t,e)=>t!==Fe&&!t.__isScriptSetup&&Re(t,e),jf={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=t;if(e[0]!=="$"){const h=r[e];if(h!==void 0)switch(h){case 1:return s[e];case 2:return o[e];case 4:return n[e];case 3:return i[e]}else{if(pi(s,e))return r[e]=1,s[e];if(o!==Fe&&Re(o,e))return r[e]=2,o[e];if(Re(i,e))return r[e]=3,i[e];if(n!==Fe&&Re(n,e))return r[e]=4,n[e];Wi&&(r[e]=0)}}const c=bs[e];let u,d;if(c)return e==="$attrs"&&at(t.attrs,"get",""),c(t);if((u=l.__cssModules)&&(u=u[e]))return u;if(n!==Fe&&Re(n,e))return r[e]=4,n[e];if(d=a.config.globalProperties,Re(d,e))return d[e]},set({_:t},e,n){const{data:s,setupState:o,ctx:i}=t;return pi(o,e)?(o[e]=n,!0):s!==Fe&&Re(s,e)?(s[e]=n,!0):Re(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(i[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||t!==Fe&&l[0]!=="$"&&Re(t,l)||pi(e,l)||Re(i,l)||Re(s,l)||Re(bs,l)||Re(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Re(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function kl(t){return pe(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}let Wi=!0;function Uf(t){const e=jc(t),n=t.proxy,s=t.ctx;Wi=!1,e.beforeCreate&&wl(e.beforeCreate,t,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:p,updated:m,activated:y,deactivated:b,beforeDestroy:w,beforeUnmount:S,destroyed:_,unmounted:A,render:Y,renderTracked:G,renderTriggered:I,errorCaptured:C,serverPrefetch:k,expose:T,inheritAttrs:P,components:N,directives:re,filters:F}=e;if(c&&zf(c,s,null),r)for(const ue in r){const ge=r[ue];_e(ge)&&(s[ue]=ge.bind(n))}if(o){const ue=o.call(n,n);Ee(ue)&&(t.data=vn(ue))}if(Wi=!0,i)for(const ue in i){const ge=i[ue],Ne=_e(ge)?ge.bind(n,n):_e(ge.get)?ge.get.bind(n,n):Et,He=!_e(ge)&&_e(ge.set)?ge.set.bind(n):Et,ze=z({get:Ne,set:He});Object.defineProperty(s,ue,{enumerable:!0,configurable:!0,get:()=>ze.value,set:H=>ze.value=H})}if(l)for(const ue in l)Fc(l[ue],s,n,ue);if(a){const ue=_e(a)?a.call(n):a;Reflect.ownKeys(ue).forEach(ge=>{Qs(ge,ue[ge])})}u&&wl(u,t,"c");function ne(ue,ge){pe(ge)?ge.forEach(Ne=>ue(Ne.bind(n))):ge&&ue(ge.bind(n))}if(ne(Lf,d),ne(Ze,h),ne(Lc,p),ne(Oc,m),ne(Rf,y),ne(Pf,b),ne(Bf,C),ne(Nf,G),ne(Df,I),ne(ft,S),ne(Vo,A),ne(Of,k),pe(T))if(T.length){const ue=t.exposed||(t.exposed={});T.forEach(ge=>{Object.defineProperty(ue,ge,{get:()=>n[ge],set:Ne=>n[ge]=Ne,enumerable:!0})})}else t.exposed||(t.exposed={});Y&&t.render===Et&&(t.render=Y),P!=null&&(t.inheritAttrs=P),N&&(t.components=N),re&&(t.directives=re),k&&Pc(t)}function zf(t,e,n=Et){pe(t)&&(t=Vi(t));for(const s in t){const o=t[s];let i;Ee(o)?"default"in o?i=on(o.from||s,o.default,!0):i=on(o.from||s):i=on(o),et(i)?Object.defineProperty(e,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):e[s]=i}}function wl(t,e,n){At(pe(t)?t.map(s=>s.bind(e.proxy)):t.bind(e.proxy),e,n)}function Fc(t,e,n,s){let o=s.includes(".")?$c(n,s):()=>n[s];if(Ue(t)){const i=e[t];_e(i)&&xe(o,i)}else if(_e(t))xe(o,t.bind(n));else if(Ee(t))if(pe(t))t.forEach(i=>Fc(i,e,n,s));else{const i=_e(t.handler)?t.handler.bind(n):e[t.handler];_e(i)&&xe(o,i,t)}}function jc(t){const e=t.type,{mixins:n,extends:s}=e,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=t.appContext,l=i.get(e);let a;return l?a=l:!o.length&&!n&&!s?a=e:(a={},o.length&&o.forEach(c=>po(a,c,r,!0)),po(a,e,r)),Ee(e)&&i.set(e,a),a}function po(t,e,n,s=!1){const{mixins:o,extends:i}=e;i&&po(t,i,n,!0),o&&o.forEach(r=>po(t,r,n,!0));for(const r in e)if(!(s&&r==="expose")){const l=Hf[r]||n&&n[r];t[r]=l?l(t[r],e[r]):e[r]}return t}const Hf={data:Sl,props:_l,emits:_l,methods:fs,computed:fs,beforeCreate:ht,created:ht,beforeMount:ht,mounted:ht,beforeUpdate:ht,updated:ht,beforeDestroy:ht,beforeUnmount:ht,destroyed:ht,unmounted:ht,activated:ht,deactivated:ht,errorCaptured:ht,serverPrefetch:ht,components:fs,directives:fs,watch:Wf,provide:Sl,inject:qf};function Sl(t,e){return e?t?function(){return Je(_e(t)?t.call(this,this):t,_e(e)?e.call(this,this):e)}:e:t}function qf(t,e){return fs(Vi(t),Vi(e))}function Vi(t){if(pe(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function ht(t,e){return t?[...new Set([].concat(t,e))]:e}function fs(t,e){return t?Je(Object.create(null),t,e):e}function _l(t,e){return t?pe(t)&&pe(e)?[...new Set([...t,...e])]:Je(Object.create(null),kl(t),kl(e??{})):e}function Wf(t,e){if(!t)return e;if(!e)return t;const n=Je(Object.create(null),t);for(const s in e)n[s]=ht(t[s],e[s]);return n}function Uc(){return{app:null,config:{isNativeTag:Ka,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 Vf=0;function Kf(t,e){return function(s,o=null){_e(s)||(s=Je({},s)),o!=null&&!Ee(o)&&(o=null);const i=Uc(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:Vf++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:Ch,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&_e(u.install)?(r.add(u),u.install(c,...d)):_e(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,h){if(!a){const p=c._ceVNode||J(s,o);return p.appContext=i,h===!0?h="svg":h===!1&&(h=void 0),t(p,u,h),a=!0,c._container=u,u.__vue_app__=c,Zo(p.component)}},onUnmount(u){l.push(u)},unmount(){a&&(At(l,c._instance,16),t(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=Vn;Vn=c;try{return u()}finally{Vn=d}}};return c}}let Vn=null;const Yf=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${yt(e)}Modifiers`]||t[`${bn(e)}Modifiers`];function Jf(t,e,...n){if(t.isUnmounted)return;const s=t.vnode.props||Fe;let o=n;const i=e.startsWith("update:"),r=i&&Yf(s,e.slice(7));r&&(r.trim&&(o=n.map(u=>Ue(u)?u.trim():u)),r.number&&(o=n.map(jo)));let l,a=s[l=ai(e)]||s[l=ai(yt(e))];!a&&i&&(a=s[l=ai(bn(e))]),a&&At(a,t,6,o);const c=s[l+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[l])return;t.emitted[l]=!0,At(c,t,6,o)}}const Zf=new WeakMap;function zc(t,e,n=!1){const s=n?Zf:e.emitsCache,o=s.get(t);if(o!==void 0)return o;const i=t.emits;let r={},l=!1;if(!_e(t)){const a=c=>{const u=zc(c,e,!0);u&&(l=!0,Je(r,u))};!n&&e.mixins.length&&e.mixins.forEach(a),t.extends&&a(t.extends),t.mixins&&t.mixins.forEach(a)}return!i&&!l?(Ee(t)&&s.set(t,null),null):(pe(i)?i.forEach(a=>r[a]=null):Je(r,i),Ee(t)&&s.set(t,r),r)}function Ko(t,e){return!t||!Do(e)?!1:(e=e.slice(2),e=e==="Once"?e:e.replace(/Once$/,""),Re(t,e[0].toLowerCase()+e.slice(1))||Re(t,bn(e))||Re(t,e))}function $l(t){const{type:e,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:h,setupState:p,ctx:m,inheritAttrs:y}=t,b=fo(t);let w,S;try{if(n.shapeFlag&4){const A=o||s,Y=A;w=Vt(c.call(Y,A,u,d,p,h,m)),S=l}else{const A=e;w=Vt(A.length>1?A(d,{attrs:l,slots:r,emit:a}):A(d,null)),S=e.props?l:Xf(l)}}catch(A){rn.length=0,Ho(A,t,1),w=J(ct)}let _=w;if(S&&y!==!1){const A=Object.keys(S),{shapeFlag:Y}=_;A.length&&Y&7&&(i&&A.some(No)&&(S=Qf(S,i)),_=yn(_,S,!1,!0))}return n.dirs&&(_=yn(_,null,!1,!0),_.dirs=_.dirs?_.dirs.concat(n.dirs):n.dirs),n.transition&&On(_,n.transition),w=_,fo(b),w}const Xf=t=>{let e;for(const n in t)(n==="class"||n==="style"||Do(n))&&((e||(e={}))[n]=t[n]);return e},Qf=(t,e)=>{const n={};for(const s in t)(!No(s)||!(s.slice(9)in e))&&(n[s]=t[s]);return n};function eh(t,e,n){const{props:s,children:o,component:i}=t,{props:r,children:l,patchFlag:a}=e,c=i.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?xl(s,r,c):!!r;if(a&8){const u=e.dynamicProps;for(let d=0;d<u.length;d++){const h=u[d];if(Hc(r,s,h)&&!Ko(c,h))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?xl(s,r,c):!0:!!r;return!1}function xl(t,e,n){const s=Object.keys(e);if(s.length!==Object.keys(t).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(Hc(e,t,i)&&!Ko(n,i))return!0}return!1}function Hc(t,e,n){const s=t[n],o=e[n];return n==="style"&&Ee(s)&&Ee(o)?!Ds(s,o):s!==o}function th({vnode:t,parent:e,suspense:n},s){for(;e;){const o=e.subTree;if(o.suspense&&o.suspense.activeBranch===t&&(o.suspense.vnode.el=o.el=s,t=o),o===t)(t=e.vnode).el=s,e=e.parent;else break}n&&n.activeBranch===t&&(n.vnode.el=s)}const qc={},Wc=()=>Object.create(qc),Vc=t=>Object.getPrototypeOf(t)===qc;function nh(t,e,n,s=!1){const o={},i=Wc();t.propsDefaults=Object.create(null),Kc(t,e,o,i);for(const r in t.propsOptions[0])r in o||(o[r]=void 0);n?t.props=s?o:ff(o):t.type.props?t.props=o:t.props=i,t.attrs=i}function sh(t,e,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=t,l=Me(o),[a]=t.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=t.vnode.dynamicProps;for(let d=0;d<u.length;d++){let h=u[d];if(Ko(t.emitsOptions,h))continue;const p=e[h];if(a)if(Re(i,h))p!==i[h]&&(i[h]=p,c=!0);else{const m=yt(h);o[m]=Ki(a,l,m,p,t,!1)}else p!==i[h]&&(i[h]=p,c=!0)}}}else{Kc(t,e,o,i)&&(c=!0);let u;for(const d in l)(!e||!Re(e,d)&&((u=bn(d))===d||!Re(e,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=Ki(a,l,d,void 0,t,!0)):delete o[d]);if(i!==l)for(const d in i)(!e||!Re(e,d))&&(delete i[d],c=!0)}c&&Xt(t.attrs,"set","")}function Kc(t,e,n,s){const[o,i]=t.propsOptions;let r=!1,l;if(e)for(let a in e){if(gs(a))continue;const c=e[a];let u;o&&Re(o,u=yt(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:Ko(t.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=Me(n),c=l||Fe;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Ki(o,a,d,c[d],t,!Re(c,d))}}return r}function Ki(t,e,n,s,o,i){const r=t[n];if(r!=null){const l=Re(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&_e(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=Bs(o);s=c[n]=a.call(null,e),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===bn(n))&&(s=!0))}return s}const oh=new WeakMap;function Yc(t,e,n=!1){const s=n?oh:e.propsCache,o=s.get(t);if(o)return o;const i=t.props,r={},l=[];let a=!1;if(!_e(t)){const u=d=>{a=!0;const[h,p]=Yc(d,e,!0);Je(r,h),p&&l.push(...p)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!i&&!a)return Ee(t)&&s.set(t,zn),zn;if(pe(i))for(let u=0;u<i.length;u++){const d=yt(i[u]);Cl(d)&&(r[d]=Fe)}else if(i)for(const u in i){const d=yt(u);if(Cl(d)){const h=i[u],p=r[d]=pe(h)||_e(h)?{type:h}:Je({},h),m=p.type;let y=!1,b=!0;if(pe(m))for(let w=0;w<m.length;++w){const S=m[w],_=_e(S)&&S.name;if(_==="Boolean"){y=!0;break}else _==="String"&&(b=!1)}else y=_e(m)&&m.name==="Boolean";p[0]=y,p[1]=b,(y||Re(p,"default"))&&l.push(d)}}const c=[r,l];return Ee(t)&&s.set(t,c),c}function Cl(t){return t[0]!=="$"&&!gs(t)}const Rr=t=>t==="_"||t==="_ctx"||t==="$stable",Pr=t=>pe(t)?t.map(Vt):[Vt(t)],ih=(t,e,n)=>{if(e._n)return e;const s=bt((...o)=>Pr(e(...o)),n);return s._c=!1,s},Jc=(t,e,n)=>{const s=t._ctx;for(const o in t){if(Rr(o))continue;const i=t[o];if(_e(i))e[o]=ih(o,i,s);else if(i!=null){const r=Pr(i);e[o]=()=>r}}},Zc=(t,e)=>{const n=Pr(e);t.slots.default=()=>n},Xc=(t,e,n)=>{for(const s in e)(n||!Rr(s))&&(t[s]=e[s])},rh=(t,e,n)=>{const s=t.slots=Wc();if(t.vnode.shapeFlag&32){const o=e._;o?(Xc(s,e,n),n&&Xa(s,"_",o,!0)):Jc(e,s)}else e&&Zc(t,e)},lh=(t,e,n)=>{const{vnode:s,slots:o}=t;let i=!0,r=Fe;if(s.shapeFlag&32){const l=e._;l?n&&l===1?i=!1:Xc(o,e,n):(i=!e.$stable,Jc(e,o)),r=e}else e&&(Zc(t,e),r={default:1});if(i)for(const l in o)!Rr(l)&&r[l]==null&&delete o[l]},pt=fh;function ah(t){return ch(t)}function ch(t,e){const n=Uo();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:p=Et,insertStaticContent:m}=t,y=(x,R,W,te=null,ee=null,Q=null,Z=void 0,V=null,$=!!R.dynamicChildren)=>{if(x===R)return;x&&!Tn(x,R)&&(te=j(x),H(x,ee,Q,!0),x=null),R.patchFlag===-2&&($=!1,R.dynamicChildren=null);const{type:E,ref:ae,shapeFlag:ce}=R;switch(E){case Yo:b(x,R,W,te);break;case ct:w(x,R,W,te);break;case to:x==null&&S(R,W,te,Z);break;case X:N(x,R,W,te,ee,Q,Z,V,$);break;default:ce&1?Y(x,R,W,te,ee,Q,Z,V,$):ce&6?re(x,R,W,te,ee,Q,Z,V,$):(ce&64||ce&128)&&E.process(x,R,W,te,ee,Q,Z,V,$,ve)}ae!=null&&ee?ys(ae,x&&x.ref,Q,R||x,!R):ae==null&&x&&x.ref!=null&&ys(x.ref,null,Q,x,!0)},b=(x,R,W,te)=>{if(x==null)s(R.el=l(R.children),W,te);else{const ee=R.el=x.el;R.children!==x.children&&c(ee,R.children)}},w=(x,R,W,te)=>{x==null?s(R.el=a(R.children||""),W,te):R.el=x.el},S=(x,R,W,te)=>{[x.el,x.anchor]=m(x.children,R,W,te,x.el,x.anchor)},_=({el:x,anchor:R},W,te)=>{let ee;for(;x&&x!==R;)ee=h(x),s(x,W,te),x=ee;s(R,W,te)},A=({el:x,anchor:R})=>{let W;for(;x&&x!==R;)W=h(x),o(x),x=W;o(R)},Y=(x,R,W,te,ee,Q,Z,V,$)=>{if(R.type==="svg"?Z="svg":R.type==="math"&&(Z="mathml"),x==null)G(R,W,te,ee,Q,Z,V,$);else{const E=x.el&&x.el._isVueCE?x.el:null;try{E&&E._beginPatch(),k(x,R,ee,Q,Z,V,$)}finally{E&&E._endPatch()}}},G=(x,R,W,te,ee,Q,Z,V)=>{let $,E;const{props:ae,shapeFlag:ce,transition:he,dirs:me}=x;if($=x.el=r(x.type,Q,ae&&ae.is,ae),ce&8?u($,x.children):ce&16&&C(x.children,$,null,te,ee,gi(x,Q),Z,V),me&&kn(x,null,te,"created"),I($,x,x.scopeId,Z,te),ae){for(const Be in ae)Be!=="value"&&!gs(Be)&&i($,Be,null,ae[Be],Q,te);"value"in ae&&i($,"value",null,ae.value,Q),(E=ae.onVnodeBeforeMount)&&Ft(E,te,x)}me&&kn(x,null,te,"beforeMount");const Ie=uh(ee,he);Ie&&he.beforeEnter($),s($,R,W),((E=ae&&ae.onVnodeMounted)||Ie||me)&&pt(()=>{try{E&&Ft(E,te,x),Ie&&he.enter($),me&&kn(x,null,te,"mounted")}finally{}},ee)},I=(x,R,W,te,ee)=>{if(W&&p(x,W),te)for(let Q=0;Q<te.length;Q++)p(x,te[Q]);if(ee){let Q=ee.subTree;if(R===Q||tu(Q.type)&&(Q.ssContent===R||Q.ssFallback===R)){const Z=ee.vnode;I(x,Z,Z.scopeId,Z.slotScopeIds,ee.parent)}}},C=(x,R,W,te,ee,Q,Z,V,$=0)=>{for(let E=$;E<x.length;E++){const ae=x[E]=V?Jt(x[E]):Vt(x[E]);y(null,ae,R,W,te,ee,Q,Z,V)}},k=(x,R,W,te,ee,Q,Z)=>{const V=R.el=x.el;let{patchFlag:$,dynamicChildren:E,dirs:ae}=R;$|=x.patchFlag&16;const ce=x.props||Fe,he=R.props||Fe;let me;if(W&&wn(W,!1),(me=he.onVnodeBeforeUpdate)&&Ft(me,W,R,x),ae&&kn(R,x,W,"beforeUpdate"),W&&wn(W,!0),E&&(!x.dynamicChildren||x.dynamicChildren.length!==E.length)&&($=0,Z=!1,E=null),(ce.innerHTML&&he.innerHTML==null||ce.textContent&&he.textContent==null)&&u(V,""),E?T(x.dynamicChildren,E,V,W,te,gi(R,ee),Q):Z||ge(x,R,V,null,W,te,gi(R,ee),Q,!1),$>0){if($&16)P(V,ce,he,W,ee);else if($&2&&ce.class!==he.class&&i(V,"class",null,he.class,ee),$&4&&i(V,"style",ce.style,he.style,ee),$&8){const Ie=R.dynamicProps;for(let Be=0;Be<Ie.length;Be++){const De=Ie[Be],Ve=ce[De],ot=he[De];(ot!==Ve||De==="value")&&i(V,De,Ve,ot,ee,W)}}$&1&&x.children!==R.children&&u(V,R.children)}else!Z&&E==null&&P(V,ce,he,W,ee);((me=he.onVnodeUpdated)||ae)&&pt(()=>{me&&Ft(me,W,R,x),ae&&kn(R,x,W,"updated")},te)},T=(x,R,W,te,ee,Q,Z)=>{for(let V=0;V<R.length;V++){const $=x[V],E=R[V],ae=$.el&&($.type===X||!Tn($,E)||$.shapeFlag&198)?d($.el):W;y($,E,ae,null,te,ee,Q,Z,!0)}},P=(x,R,W,te,ee)=>{if(R!==W){if(R!==Fe)for(const Q in R)!gs(Q)&&!(Q in W)&&i(x,Q,R[Q],null,ee,te);for(const Q in W){if(gs(Q))continue;const Z=W[Q],V=R[Q];Z!==V&&Q!=="value"&&i(x,Q,V,Z,ee,te)}"value"in W&&i(x,"value",R.value,W.value,ee)}},N=(x,R,W,te,ee,Q,Z,V,$)=>{const E=R.el=x?x.el:l(""),ae=R.anchor=x?x.anchor:l("");let{patchFlag:ce,dynamicChildren:he,slotScopeIds:me}=R;me&&(V=V?V.concat(me):me),x==null?(s(E,W,te),s(ae,W,te),C(R.children||[],W,ae,ee,Q,Z,V,$)):ce>0&&ce&64&&he&&x.dynamicChildren&&x.dynamicChildren.length===he.length?(T(x.dynamicChildren,he,W,ee,Q,Z,V),(R.key!=null||ee&&R===ee.subTree)&&Er(x,R,!0)):ge(x,R,W,ae,ee,Q,Z,V,$)},re=(x,R,W,te,ee,Q,Z,V,$)=>{R.slotScopeIds=V,x==null?R.shapeFlag&512?ee.ctx.activate(R,W,te,Z,$):F(R,W,te,ee,Q,Z,$):D(x,R,$)},F=(x,R,W,te,ee,Q,Z)=>{const V=x.component=yh(x,te,ee);if(qo(x)&&(V.ctx.renderer=ve),bh(V,!1,Z),V.asyncDep){if(ee&&ee.registerDep(V,ne,Z),!x.el){const $=V.subTree=J(ct);w(null,$,R,W),x.placeholder=$.el}}else ne(V,x,R,W,ee,Q,Z)},D=(x,R,W)=>{const te=R.component=x.component;if(eh(x,R,W))if(te.asyncDep&&!te.asyncResolved){ue(te,R,W);return}else te.next=R,te.update();else R.el=x.el,te.vnode=R},ne=(x,R,W,te,ee,Q,Z)=>{const V=()=>{if(x.isMounted){let{next:ce,bu:he,u:me,parent:Ie,vnode:Be}=x;{const Bt=Qc(x);if(Bt){ce&&(ce.el=Be.el,ue(x,ce,Z)),Bt.asyncDep.then(()=>{pt(()=>{x.isUnmounted||E()},ee)});return}}let De=ce,Ve;wn(x,!1),ce?(ce.el=Be.el,ue(x,ce,Z)):ce=Be,he&&Xs(he),(Ve=ce.props&&ce.props.onVnodeBeforeUpdate)&&Ft(Ve,Ie,ce,Be),wn(x,!0);const ot=$l(x),Nt=x.subTree;x.subTree=ot,y(Nt,ot,d(Nt.el),j(Nt),x,ee,Q),ce.el=ot.el,De===null&&th(x,ot.el),me&&pt(me,ee),(Ve=ce.props&&ce.props.onVnodeUpdated)&&pt(()=>Ft(Ve,Ie,ce,Be),ee)}else{let ce;const{el:he,props:me}=R,{bm:Ie,m:Be,parent:De,root:Ve,type:ot}=x,Nt=Wn(R);wn(x,!1),Ie&&Xs(Ie),!Nt&&(ce=me&&me.onVnodeBeforeMount)&&Ft(ce,De,R),wn(x,!0);{Ve.ce&&Ve.ce._hasShadowRoot()&&Ve.ce._injectChildStyle(ot,x.parent?x.parent.type:void 0);const Bt=x.subTree=$l(x);y(null,Bt,W,te,x,ee,Q),R.el=Bt.el}if(Be&&pt(Be,ee),!Nt&&(ce=me&&me.onVnodeMounted)){const Bt=R;pt(()=>Ft(ce,De,Bt),ee)}(R.shapeFlag&256||De&&Wn(De.vnode)&&De.vnode.shapeFlag&256)&&x.a&&pt(x.a,ee),x.isMounted=!0,R=W=te=null}};x.scope.on();const $=x.effect=new nc(V);x.scope.off();const E=x.update=$.run.bind($),ae=x.job=$.runIfDirty.bind($);ae.i=x,ae.id=x.uid,$.scheduler=()=>Ir(ae),wn(x,!0),E()},ue=(x,R,W)=>{R.component=x;const te=x.vnode.props;x.vnode=R,x.next=null,sh(x,R.props,te,W),lh(x,R.children,W),ln(),hl(x),an()},ge=(x,R,W,te,ee,Q,Z,V,$=!1)=>{const E=x&&x.children,ae=x?x.shapeFlag:0,ce=R.children,{patchFlag:he,shapeFlag:me}=R;if(he>0){if(he&128){He(E,ce,W,te,ee,Q,Z,V,$);return}else if(he&256){Ne(E,ce,W,te,ee,Q,Z,V,$);return}}me&8?(ae&16&&oe(E,ee,Q),ce!==E&&u(W,ce)):ae&16?me&16?He(E,ce,W,te,ee,Q,Z,V,$):oe(E,ee,Q,!0):(ae&8&&u(W,""),me&16&&C(ce,W,te,ee,Q,Z,V,$))},Ne=(x,R,W,te,ee,Q,Z,V,$)=>{x=x||zn,R=R||zn;const E=x.length,ae=R.length,ce=Math.min(E,ae);let he;for(he=0;he<ce;he++){const me=R[he]=$?Jt(R[he]):Vt(R[he]);y(x[he],me,W,null,ee,Q,Z,V,$)}E>ae?oe(x,ee,Q,!0,!1,ce):C(R,W,te,ee,Q,Z,V,$,ce)},He=(x,R,W,te,ee,Q,Z,V,$)=>{let E=0;const ae=R.length;let ce=x.length-1,he=ae-1;for(;E<=ce&&E<=he;){const me=x[E],Ie=R[E]=$?Jt(R[E]):Vt(R[E]);if(Tn(me,Ie))y(me,Ie,W,null,ee,Q,Z,V,$);else break;E++}for(;E<=ce&&E<=he;){const me=x[ce],Ie=R[he]=$?Jt(R[he]):Vt(R[he]);if(Tn(me,Ie))y(me,Ie,W,null,ee,Q,Z,V,$);else break;ce--,he--}if(E>ce){if(E<=he){const me=he+1,Ie=me<ae?R[me].el:te;for(;E<=he;)y(null,R[E]=$?Jt(R[E]):Vt(R[E]),W,Ie,ee,Q,Z,V,$),E++}}else if(E>he)for(;E<=ce;)H(x[E],ee,Q,!0),E++;else{const me=E,Ie=E,Be=new Map;for(E=Ie;E<=he;E++){const St=R[E]=$?Jt(R[E]):Vt(R[E]);St.key!=null&&Be.set(St.key,E)}let De,Ve=0;const ot=he-Ie+1;let Nt=!1,Bt=0;const ns=new Array(ot);for(E=0;E<ot;E++)ns[E]=0;for(E=me;E<=ce;E++){const St=x[E];if(Ve>=ot){H(St,ee,Q,!0);continue}let Gt;if(St.key!=null)Gt=Be.get(St.key);else for(De=Ie;De<=he;De++)if(ns[De-Ie]===0&&Tn(St,R[De])){Gt=De;break}Gt===void 0?H(St,ee,Q,!0):(ns[Gt-Ie]=E+1,Gt>=Bt?Bt=Gt:Nt=!0,y(St,R[Gt],W,null,ee,Q,Z,V,$),Ve++)}const rl=Nt?dh(ns):zn;for(De=rl.length-1,E=ot-1;E>=0;E--){const St=Ie+E,Gt=R[St],ll=R[St+1],al=St+1<ae?ll.el||eu(ll):te;ns[E]===0?y(null,Gt,W,al,ee,Q,Z,V,$):Nt&&(De<0||E!==rl[De]?ze(Gt,W,al,2):De--)}}},ze=(x,R,W,te,ee=null)=>{const{el:Q,type:Z,transition:V,children:$,shapeFlag:E}=x;if(E&6){ze(x.component.subTree,R,W,te);return}if(E&128){x.suspense.move(R,W,te);return}if(E&64){Z.move(x,R,W,ve);return}if(Z===X){s(Q,R,W);for(let ce=0;ce<$.length;ce++)ze($[ce],R,W,te);s(x.anchor,R,W);return}if(Z===to){_(x,R,W);return}if(te!==2&&E&1&&V)if(te===0)V.persisted&&!Q[Tt]?s(Q,R,W):(V.beforeEnter(Q),s(Q,R,W),pt(()=>V.enter(Q),ee));else{const{leave:ce,delayLeave:he,afterLeave:me}=V,Ie=()=>{x.ctx.isUnmounted?o(Q):s(Q,R,W)},Be=()=>{const De=Q._isLeaving||!!Q[Tt];Q._isLeaving&&Q[Tt](!0),V.persisted&&!De?Ie():ce(Q,()=>{Ie(),me&&me()})};he?he(Q,Ie,Be):Be()}else s(Q,R,W)},H=(x,R,W,te=!1,ee=!1)=>{const{type:Q,props:Z,ref:V,children:$,dynamicChildren:E,shapeFlag:ae,patchFlag:ce,dirs:he,cacheIndex:me,memo:Ie}=x;if(ce===-2&&(ee=!1),V!=null&&(ln(),ys(V,null,W,x,!0),an()),me!=null&&(R.renderCache[me]=void 0),ae&256){R.ctx.deactivate(x);return}const Be=ae&1&&he,De=!Wn(x);let Ve;if(De&&(Ve=Z&&Z.onVnodeBeforeUnmount)&&Ft(Ve,R,x),ae&6)q(x.component,W,te);else{if(ae&128){x.suspense.unmount(W,te);return}Be&&kn(x,null,R,"beforeUnmount"),ae&64?x.type.remove(x,R,W,ve,te):E&&!E.hasOnce&&(Q!==X||ce>0&&ce&64)?oe(E,R,W,!1,!0):(Q===X&&ce&384||!ee&&ae&16)&&oe($,R,W),te&&K(x)}const ot=Ie!=null&&me==null;(De&&(Ve=Z&&Z.onVnodeUnmounted)||Be||ot)&&pt(()=>{Ve&&Ft(Ve,R,x),Be&&kn(x,null,R,"unmounted"),ot&&(x.el=null)},W)},K=x=>{const{type:R,el:W,anchor:te,transition:ee}=x;if(R===X){ie(W,te);return}if(R===to){A(x);return}const Q=()=>{o(W),ee&&!ee.persisted&&ee.afterLeave&&ee.afterLeave()};if(x.shapeFlag&1&&ee&&!ee.persisted){const{leave:Z,delayLeave:V}=ee,$=()=>Z(W,Q);V?V(x.el,Q,$):$()}else Q()},ie=(x,R)=>{let W;for(;x!==R;)W=h(x),o(x),x=W;o(R)},q=(x,R,W)=>{const{bum:te,scope:ee,job:Q,subTree:Z,um:V,m:$,a:E}=x;Tl($),Tl(E),te&&Xs(te),ee.stop(),Q&&(Q.flags|=8,H(Z,x,R,W)),V&&pt(V,R),pt(()=>{x.isUnmounted=!0},R)},oe=(x,R,W,te=!1,ee=!1,Q=0)=>{for(let Z=Q;Z<x.length;Z++)H(x[Z],R,W,te,ee)},j=x=>{if(x.shapeFlag&6)return j(x.component.subTree);if(x.shapeFlag&128)return x.suspense.next();const R=h(x.anchor||x.el),W=R&&R[xc];return W?h(W):R};let fe=!1;const Se=(x,R,W)=>{let te;x==null?R._vnode&&(H(R._vnode,null,null,!0),te=R._vnode.component):y(R._vnode||null,x,R,null,null,null,W),R._vnode=x,fe||(fe=!0,hl(te),kc(),fe=!1)},ve={p:y,um:H,m:ze,r:K,mt:F,mc:C,pc:ge,pbc:T,n:j,o:t};return{render:Se,hydrate:void 0,createApp:Kf(Se)}}function gi({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function wn({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function uh(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Er(t,e,n=!1){const s=t.children,o=e.children;if(pe(s)&&pe(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=Jt(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&Er(r,l)),l.type===Yo&&(l.patchFlag===-1&&(l=o[i]=Jt(l)),l.el=r.el),l.type===ct&&!l.el&&(l.el=r.el)}}function dh(t){const e=t.slice(),n=[0];let s,o,i,r,l;const a=t.length;for(s=0;s<a;s++){const c=t[s];if(c!==0){if(o=n[n.length-1],t[o]<c){e[s]=o,n.push(s);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,t[n[l]]<c?i=l+1:r=l;c<t[n[i]]&&(i>0&&(e[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=e[r];return n}function Qc(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Qc(e)}function Tl(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function eu(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?eu(e.subTree):null}const tu=t=>t.__isSuspense;function fh(t,e){e&&e.pendingBranch?pe(t)?e.effects.push(...t):e.effects.push(t):bc(t)}const X=Symbol.for("v-fgt"),Yo=Symbol.for("v-txt"),ct=Symbol.for("v-cmt"),to=Symbol.for("v-stc"),rn=[];let mt=null;function g(t=!1){rn.push(mt=t?null:[])}function Lr(){rn.pop(),mt=rn[rn.length-1]||null}let Zn=1;function go(t,e=!1){Zn+=t,t<0&&mt&&e&&(mt.hasOnce=!0)}function nu(t){return t.dynamicChildren=Zn>0?mt||zn:null,Lr(),Zn>0&&mt&&mt.push(t),t}function v(t,e,n,s,o,i){return nu(f(t,e,n,s,o,i,!0))}function Oe(t,e,n,s,o){return nu(J(t,e,n,s,o,!0))}function Cs(t){return t?t.__v_isVNode===!0:!1}function Tn(t,e){return t.type===e.type&&t.key===e.key}const su=({key:t})=>t??null,no=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?Ue(t)||et(t)||_e(t)?{i:rt,r:t,k:e,f:!!n}:t:null);function f(t,e=null,n=null,s=0,o=null,i=t===X?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&su(e),ref:e&&no(e),scopeId:Sc,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:rt};return l?(mo(a,n),i&128&&t.normalize(a)):n&&(a.shapeFlag|=Ue(n)?8:16),Zn>0&&!r&&mt&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&mt.push(a),a}const J=hh;function hh(t,e=null,n=null,s=0,o=null,i=!1){if((!t||t===Nc)&&(t=ct),Cs(t)){const l=yn(t,e,!0);return n&&mo(l,n),Zn>0&&!i&&mt&&(l.shapeFlag&6?mt[mt.indexOf(t)]=l:mt.push(l)),l.patchFlag=-2,l}if($h(t)&&(t=t.__vccOpts),e){e=ph(e);let{class:l,style:a}=e;l&&!Ue(l)&&(e.class=le(l)),Ee(a)&&(Tr(a)&&!pe(a)&&(a=Je({},a)),e.style=$t(a))}const r=Ue(t)?1:tu(t)?128:Cc(t)?64:Ee(t)?4:_e(t)?2:0;return f(t,e,n,s,o,r,i,!0)}function ph(t){return t?Tr(t)||Vc(t)?Je({},t):t:null}function yn(t,e,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=t,c=e?gh(o||{},e):o,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&su(c),ref:e&&e.ref?n&&i?pe(i)?i.concat(no(e)):[i,no(e)]:no(e):i,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:l,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==X?r===-1?16:r|16:r,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:a,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&yn(t.ssContent),ssFallback:t.ssFallback&&yn(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return a&&s&&On(u,a.clone(u)),u}function $e(t=" ",e=0){return J(Yo,null,t,e)}function B(t="",e=!1){return e?(g(),Oe(ct,null,t)):J(ct,null,t)}function Vt(t){return t==null||typeof t=="boolean"?J(ct):pe(t)?J(X,null,t.slice()):Cs(t)?Jt(t):J(Yo,null,String(t))}function Jt(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:yn(t)}function mo(t,e){let n=0;const{shapeFlag:s}=t;if(e==null)e=null;else if(pe(e))n=16;else if(typeof e=="object")if(s&65){const o=e.default;o&&(o._c&&(o._d=!1),mo(t,o()),o._c&&(o._d=!0));return}else{n=32;const o=e._;!o&&!Vc(e)?e._ctx=rt:o===3&&rt&&(rt.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else if(_e(e)){if(s&65){mo(t,{default:e});return}e={default:e,_ctx:rt},n=32}else e=String(e),s&64?(n=16,e=[$e(e)]):n=8;t.children=e,t.shapeFlag|=n}function gh(...t){const e={};for(let n=0;n<t.length;n++){const s=t[n];for(const o in s)if(o==="class")e.class!==s.class&&(e.class=le([e.class,s.class]));else if(o==="style")e.style=$t([e.style,s.style]);else if(Do(o)){const i=e[o],r=s[o];r&&i!==r&&!(pe(i)&&i.includes(r))?e[o]=i?[].concat(i,r):r:r==null&&i==null&&!No(o)&&(e[o]=r)}else o!==""&&(e[o]=s[o])}return e}function Ft(t,e,n,s=null){At(t,e,7,[n,s])}const mh=Uc();let vh=0;function yh(t,e,n){const s=t.type,o=(e?e.appContext:t.appContext)||mh,i={uid:vh++,vnode:t,type:s,parent:e,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Wd(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(o.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Yc(s,o),emitsOptions:zc(s,o),emit:null,emitted:null,propsDefaults:Fe,inheritAttrs:s.inheritAttrs,ctx:Fe,data:Fe,props:Fe,attrs:Fe,slots:Fe,refs:Fe,setupState:Fe,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=e?e.root:i,i.emit=Jf.bind(null,i),t.ce&&t.ce(i),i}let ut=null;const Jo=()=>ut||rt;let vo,Yi;{const t=Uo(),e=(n,s)=>{let o;return(o=t[n])||(o=t[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};vo=e("__VUE_INSTANCE_SETTERS__",n=>ut=n),Yi=e("__VUE_SSR_SETTERS__",n=>Ts=n)}const Bs=t=>{const e=ut;return vo(t),t.scope.on(),()=>{t.scope.off(),vo(e)}},Il=()=>{ut&&ut.scope.off(),vo(null)};function ou(t){return t.vnode.shapeFlag&4}let Ts=!1;function bh(t,e=!1,n=!1){e&&Yi(e);const{props:s,children:o}=t.vnode,i=ou(t);nh(t,s,i,e),rh(t,o,n||e);const r=i?kh(t,e):void 0;return e&&Yi(!1),r}function kh(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,jf);const{setup:s}=n;if(s){ln();const o=t.setupContext=s.length>1?Sh(t):null,i=Bs(t),r=Ns(s,t,0,[t.props,o]),l=Ya(r);if(an(),i(),(l||t.sp)&&!Wn(t)&&Pc(t),l){if(r.then(Il,Il),e)return r.then(a=>{Ml(t,a)}).catch(a=>{Ho(a,t,0)});t.asyncDep=r}else Ml(t,r)}else iu(t)}function Ml(t,e,n){_e(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Ee(e)&&(t.setupState=mc(e)),iu(t)}function iu(t,e,n){const s=t.type;t.render||(t.render=s.render||Et);{const o=Bs(t);ln();try{Uf(t)}finally{an(),o()}}}const wh={get(t,e){return at(t,"get",""),t[e]}};function Sh(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,wh),slots:t.slots,emit:t.emit,expose:e}}function Zo(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(mc(hf(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in bs)return bs[n](t)},has(e,n){return n in e||n in bs}})):t.proxy}function _h(t,e=!0){return _e(t)?t.displayName||t.name:t.name||e&&t.__name}function $h(t){return _e(t)&&"__vccOpts"in t}const z=(t,e)=>yf(t,e,Ts);function Ae(t,e,n){try{go(-1);const s=arguments.length;return s===2?Ee(e)&&!pe(e)?Cs(e)?J(t,null,[e]):J(t,e):J(t,null,e):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Cs(n)&&(n=[n]),J(t,e,n))}finally{go(1)}}function xh(t,e){const n=t.memo;if(n.length!=e.length)return!1;for(let s=0;s<n.length;s++)if(Rt(n[s],e[s]))return!1;return Zn>0&&mt&&mt.push(t),!0}const Ch="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 Ji;const Al=typeof window<"u"&&window.trustedTypes;if(Al)try{Ji=Al.createPolicy("vue",{createHTML:t=>t})}catch{}const ru=Ji?t=>Ji.createHTML(t):t=>t,Th="http://www.w3.org/2000/svg",Ih="http://www.w3.org/1998/Math/MathML",Yt=typeof document<"u"?document:null,Rl=Yt&&Yt.createElement("template"),Mh={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,s)=>{const o=e==="svg"?Yt.createElementNS(Th,t):e==="mathml"?Yt.createElementNS(Ih,t):n?Yt.createElement(t,{is:n}):Yt.createElement(t);return t==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:t=>Yt.createTextNode(t),createComment:t=>Yt.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Yt.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,s,o,i){const r=n?n.previousSibling:e.lastChild;if(o&&(o===i||o.nextSibling))for(;e.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{Rl.innerHTML=ru(s==="svg"?`<svg>${t}</svg>`:s==="mathml"?`<math>${t}</math>`:t);const l=Rl.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}e.insertBefore(l,n)}return[r?r.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},dn="transition",is="animation",Xn=Symbol("_vtc"),lu={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},au=Je({},Ic,lu),Ah=t=>(t.displayName="Transition",t.props=au,t),Xo=Ah((t,{slots:e})=>Ae(Af,cu(t),e)),Sn=(t,e=[])=>{pe(t)?t.forEach(n=>n(...e)):t&&t(...e)},Pl=t=>t?pe(t)?t.some(e=>e.length>1):t.length>1:!1;function cu(t){const e={};for(const N in t)N in lu||(e[N]=t[N]);if(t.css===!1)return e;const{name:n="v",type:s,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=t,m=Rh(o),y=m&&m[0],b=m&&m[1],{onBeforeEnter:w,onEnter:S,onEnterCancelled:_,onLeave:A,onLeaveCancelled:Y,onBeforeAppear:G=w,onAppear:I=S,onAppearCancelled:C=_}=e,k=(N,re,F,D)=>{N._enterCancelled=D,hn(N,re?u:l),hn(N,re?c:r),F&&F()},T=(N,re)=>{N._isLeaving=!1,hn(N,d),hn(N,p),hn(N,h),re&&re()},P=N=>(re,F)=>{const D=N?I:S,ne=()=>k(re,N,F);Sn(D,[re,ne]),El(()=>{hn(re,N?a:i),jt(re,N?u:l),Pl(D)||Ll(re,s,y,ne)})};return Je(e,{onBeforeEnter(N){Sn(w,[N]),jt(N,i),jt(N,r)},onBeforeAppear(N){Sn(G,[N]),jt(N,a),jt(N,c)},onEnter:P(!1),onAppear:P(!0),onLeave(N,re){N._isLeaving=!0;const F=()=>T(N,re);jt(N,d),N._enterCancelled?(jt(N,h),Zi(N)):(Zi(N),jt(N,h)),El(()=>{N._isLeaving&&(hn(N,d),jt(N,p),Pl(A)||Ll(N,s,b,F))}),Sn(A,[N,F])},onEnterCancelled(N){k(N,!1,void 0,!0),Sn(_,[N])},onAppearCancelled(N){k(N,!0,void 0,!0),Sn(C,[N])},onLeaveCancelled(N){T(N),Sn(Y,[N])}})}function Rh(t){if(t==null)return null;if(Ee(t))return[mi(t.enter),mi(t.leave)];{const e=mi(t);return[e,e]}}function mi(t){return Dd(t)}function jt(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[Xn]||(t[Xn]=new Set)).add(e)}function hn(t,e){e.split(/\s+/).forEach(s=>s&&t.classList.remove(s));const n=t[Xn];n&&(n.delete(e),n.size||(t[Xn]=void 0))}function El(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let Ph=0;function Ll(t,e,n,s){const o=t._endId=++Ph,i=()=>{o===t._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=uu(t,e);if(!r)return s();const c=r+"end";let u=0;const d=()=>{t.removeEventListener(c,h),i()},h=p=>{p.target===t&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),t.addEventListener(c,h)}function uu(t,e){const n=window.getComputedStyle(t),s=m=>(n[m]||"").split(", "),o=s(`${dn}Delay`),i=s(`${dn}Duration`),r=Ol(o,i),l=s(`${is}Delay`),a=s(`${is}Duration`),c=Ol(l,a);let u=null,d=0,h=0;e===dn?r>0&&(u=dn,d=r,h=i.length):e===is?c>0&&(u=is,d=c,h=a.length):(d=Math.max(r,c),u=d>0?r>c?dn:is:null,h=u?u===dn?i.length:a.length:0);const p=u===dn&&/\b(?:transform|all)(?:,|$)/.test(s(`${dn}Property`).toString());return{type:u,timeout:d,propCount:h,hasTransform:p}}function Ol(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,s)=>Dl(n)+Dl(t[s])))}function Dl(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Zi(t){return(t?t.ownerDocument:document).body.offsetHeight}function Eh(t,e,n){const s=t[Xn];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const yo=Symbol("_vod"),Or=Symbol("_vsh"),du={name:"show",beforeMount(t,{value:e},{transition:n}){t[yo]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):rs(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:s}){!e!=!n&&(s?e?(s.beforeEnter(t),rs(t,!0),s.enter(t)):s.leave(t,()=>{rs(t,!1)}):rs(t,e))},beforeUnmount(t,{value:e}){rs(t,e)}};function rs(t,e){t.style.display=e?t[yo]:"none",t[Or]=!e}const fu=Symbol("");function Lh(t){const e=Jo();if(!e)return;const n=e.ut=(o=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(i=>bo(i,o))},s=()=>{const o=t(e.proxy);e.ce?bo(e.ce,o):Xi(e.subTree,o),n(o)};Lc(()=>{bc(s)}),Ze(()=>{xe(s,Et,{flush:"post"});const o=new MutationObserver(s);o.observe(e.subTree.el.parentNode,{childList:!0}),Vo(()=>o.disconnect())})}function Xi(t,e){if(t.shapeFlag&128){const n=t.suspense;t=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Xi(n.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)bo(t.el,e);else if(t.type===X)t.children.forEach(n=>Xi(n,e));else if(t.type===to){let{el:n,anchor:s}=t;for(;n&&(bo(n,e),n!==s);)n=n.nextSibling}}function bo(t,e){if(t.nodeType===1){const n=t.style;let s="";for(const o in e){const i=qd(e[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[fu]=s}}const Oh=/(?:^|;)\s*display\s*:/;function Dh(t,e,n){const s=t.style,o=Ue(n);let i=!1;if(n&&!o){if(e)if(Ue(e))for(const r of e.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&hs(s,l,"")}else for(const r in e)n[r]==null&&hs(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?Bh(t,r,!Ue(e)&&e?e[r]:void 0,l)||hs(s,r,l):hs(s,r,"")}}else if(o){if(e!==n){const r=s[fu];r&&(n+=";"+r),s.cssText=n,i=Oh.test(n)}}else e&&t.removeAttribute("style");yo in t&&(t[yo]=i?s.display:"",t[Or]&&(s.display="none"))}const Nl=/\s*!important$/;function hs(t,e,n){if(pe(n))n.forEach(s=>hs(t,e,s));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const s=Nh(t,e);Nl.test(n)?t.setProperty(bn(s),n.replace(Nl,""),"important"):t[s]=n}}const Bl=["Webkit","Moz","ms"],vi={};function Nh(t,e){const n=vi[e];if(n)return n;let s=yt(e);if(s!=="filter"&&s in t)return vi[e]=s;s=Fo(s);for(let o=0;o<Bl.length;o++){const i=Bl[o]+s;if(i in t)return vi[e]=i}return e}function Bh(t,e,n,s){return t.tagName==="TEXTAREA"&&(e==="width"||e==="height")&&Ue(s)&&n===s}const Gl="http://www.w3.org/1999/xlink";function Fl(t,e,n,s,o,i=Ud(e)){s&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(Gl,e.slice(6,e.length)):t.setAttributeNS(Gl,e,n):n==null||i&&!Qa(n)?t.removeAttribute(e):t.setAttribute(e,i?"":Ot(n)?String(n):n)}function jl(t,e,n,s,o){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?ru(n):n);return}const i=t.tagName;if(e==="value"&&i!=="PROGRESS"&&!i.includes("-")){const l=i==="OPTION"?t.getAttribute("value")||"":t.value,a=n==null?t.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in t))&&(t.value=a),n==null&&t.removeAttribute(e),t._value=n;return}let r=!1;if(n===""||n==null){const l=typeof t[e];l==="boolean"?n=Qa(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{t[e]=n}catch{}r&&t.removeAttribute(o||e)}function In(t,e,n,s){t.addEventListener(e,n,s)}function Gh(t,e,n,s){t.removeEventListener(e,n,s)}const Ul=Symbol("_vei");function Fh(t,e,n,s,o=null){const i=t[Ul]||(t[Ul]={}),r=i[e];if(s&&r)r.value=s;else{const[l,a]=zh(e);if(s){const c=i[e]=Wh(s,o);In(t,l,c,a)}else r&&(Gh(t,l,r,a),i[e]=void 0)}}const jh=/(Once|Passive|Capture)$/,Uh=/^on:?(?:Once|Passive|Capture)$/;function zh(t){let e,n;for(;(n=t.match(jh))&&!Uh.test(t);)e||(e={}),t=t.slice(0,t.length-n[1].length),e[n[1].toLowerCase()]=!0;return[t[2]===":"?t.slice(3):bn(t.slice(2)),e]}let yi=0;const Hh=Promise.resolve(),qh=()=>yi||(Hh.then(()=>yi=0),yi=Date.now());function Wh(t,e){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 i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&At(c,e,5,l)}}else At(o,e,5,[s])};return n.value=t,n.attached=qh(),n}const zl=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Vh=(t,e,n,s,o,i)=>{const r=o==="svg";e==="class"?Eh(t,s,r):e==="style"?Dh(t,n,s):Do(e)?No(e)||Fh(t,e,n,s,i):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Kh(t,e,s,r))?(jl(t,e,s),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Fl(t,e,s,r,i,e!=="value")):t._isVueCE&&(Yh(t,e)||t._def.__asyncLoader&&(/[A-Z]/.test(e)||!Ue(s)))?jl(t,yt(e),s,i,e):(e==="true-value"?t._trueValue=s:e==="false-value"&&(t._falseValue=s),Fl(t,e,s,r))};function Kh(t,e,n,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in t&&zl(e)&&_e(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const o=t.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return zl(e)&&Ue(n)?!1:e in t}function Yh(t,e){const n=t._def.props;if(!n)return!1;const s=yt(e);return Array.isArray(n)?n.some(o=>yt(o)===s):Object.keys(n).some(o=>yt(o)===s)}const hu=new WeakMap,pu=new WeakMap,ko=Symbol("_moveCb"),Hl=Symbol("_enterCb"),Jh=t=>(delete t.props.mode,t),Zh=Jh({name:"TransitionGroup",props:Je({},au,{tag:String,moveClass:String}),setup(t,{slots:e}){const n=Jo(),s=Tc();let o,i;return Oc(()=>{if(!o.length)return;const r=t.moveClass||`${t.name||"v"}-move`;if(!np(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(Qh),o.forEach(ep);const l=o.filter(tp);Zi(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;jt(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[ko]=h=>{h&&h.target!==c||(!h||h.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[ko]=null,hn(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=Me(t),l=cu(r);let a=r.tag||X;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&!u.el[Or]&&(o.push(u),On(u,xs(u,l,s,n)),hu.set(u,gu(u.el)))}i=e.default?Ar(e.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&On(u,xs(u,l,s,n))}return J(a,null,i)}}}),Xh=Zh;function Qh(t){const e=t.el;e[ko]&&e[ko](),e[Hl]&&e[Hl]()}function ep(t){pu.set(t,gu(t.el))}function tp(t){const e=hu.get(t),n=pu.get(t),s=e.left-n.left,o=e.top-n.top;if(s||o){const i=t.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${s/a}px,${o/c}px)`,r.transitionDuration="0s",t}}function gu(t){const e=t.getBoundingClientRect();return{left:e.left,top:e.top}}function np(t,e,n){const s=t.cloneNode(),o=t[Xn];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const i=e.nodeType===1?e:e.parentNode;i.appendChild(s);const{hasTransform:r}=uu(s);return i.removeChild(s),r}const wo=t=>{const e=t.props["onUpdate:modelValue"]||!1;return pe(e)?n=>Xs(e,n):e};function sp(t){t.target.composing=!0}function ql(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Kn=Symbol("_assign");function Wl(t,e,n){return e&&(t=t.trim()),n&&(t=jo(t)),t}const Xe={created(t,{modifiers:{lazy:e,trim:n,number:s}},o){t[Kn]=wo(o);const i=s||o.props&&o.props.type==="number";In(t,e?"change":"input",r=>{r.target.composing||t[Kn](Wl(t.value,n,i))}),(n||i)&&In(t,"change",()=>{t.value=Wl(t.value,n,i)}),e||(In(t,"compositionstart",sp),In(t,"compositionend",ql),In(t,"change",ql))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(t[Kn]=wo(r),t.composing)return;const l=(i||t.type==="number")&&!/^0\d/.test(t.value)?jo(t.value):t.value,a=e??"";if(l===a)return;const c=t.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===t&&t.type!=="range"&&(s&&e===n||o&&t.value.trim()===a)||(t.value=a)}},Vl={deep:!0,created(t,{value:e,modifiers:{number:n}},s){t._modelValue=e,In(t,"change",()=>{const o=Array.prototype.filter.call(t.options,i=>i.selected).map(i=>n?jo(So(i)):So(i));t[Kn](t.multiple?Bo(t._modelValue)?new Set(o):o:o[0]),t._assigning=!0,We(()=>{t._assigning=!1})}),t[Kn]=wo(s)},mounted(t,{value:e}){Kl(t,e)},beforeUpdate(t,{value:e},n){t._modelValue=e,t[Kn]=wo(n)},updated(t,{value:e}){t._assigning||Kl(t,e)}};function Kl(t,e){const n=t.multiple,s=pe(e);if(!(n&&!s&&!Bo(e))){for(let o=0,i=t.options.length;o<i;o++){const r=t.options[o],l=So(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=e.some(c=>String(c)===String(l)):r.selected=Hd(e,l)>-1}else r.selected=e.has(l);else if(Ds(So(r),e)){t.selectedIndex!==o&&(t.selectedIndex=o);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function So(t){return"_value"in t?t._value:t.value}const op=["ctrl","shift","alt","meta"],ip={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>op.some(n=>t[`${n}Key`]&&!e.includes(n))},Ye=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),s=e.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<e.length;r++){const l=ip[e[r]];if(l&&l(o,e))return}return t(o,...i)}))},rp={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},En=(t,e)=>{const n=t._withKeys||(t._withKeys={}),s=e.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=bn(o.key);if(e.some(r=>r===i||rp[r]===i))return t(o)}))},lp=Je({patchProp:Vh},Mh);let Yl;function ap(){return Yl||(Yl=ah(lp))}const cp=((...t)=>{const e=ap().createApp(...t),{mount:n}=e;return e.mount=s=>{const o=dp(s);if(!o)return;const i=e._component;!_e(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,up(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},e});function up(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function dp(t){return Ue(t)?document.querySelector(t):t}const Is=O([]);let fp=0;function hp(t,e="info",n=3500){const s=`toast_${++fp}`;Is.value=[...Is.value,{id:s,type:e,message:t}],n>0&&window.setTimeout(()=>mu(s),n)}function mu(t){Is.value=Is.value.filter(e=>e.id!==t)}function Dr(){return{toasts:Is,showToast:hp,removeToast:mu}}const Te="/api/v1",pp=2*3e4,Jl=8;function Pt(t,e,n){t.wsHandlers.set(e,n)}function gp(){const t=O("connecting"),e=O([]),n=O(!1),s=O(void 0),o=O([]),i=O({busy:!1}),r=O(null),l=O([]),a=O(!1),c=O(null),u=O(!1),d=O(null),h=O(null),p=O(null),m=O([]),y=O(null),b=O(!1),w=z(()=>i.value.busy||u.value),S=z(()=>h.value!==null&&!b.value);return{connectionStatus:t,messages:e,olderAvailable:n,oldestSeq:s,pendingApprovals:o,status:i,goal:r,todos:l,goalRequestPending:a,goalRequestError:c,promptPending:u,error:d,sessionId:h,workDir:p,isBusy:w,sessions:m,currentSessionId:y,isArchived:S,gitStatus:O(null),models:O([]),like:O({}),sessionPlan:O(null),skills:O([]),plugins:O([]),pluginInfo:O(null),mcpServers:O([]),mcpStartupMetrics:O(null),backgroundTasks:O([]),backgroundTaskOutput:O(""),config:O(null),experimentalFlags:O(null),preflightOk:O(!1),sessionActive:b,ws:null,heartbeatTimer:null,reconnectTimer:null,snapshotRetryTimer:null,lastPongAt:Date.now(),seq:0,epoch:0,reconnectAttempt:0,sessionGeneration:0,connectionGeneration:0,promptGeneration:0,liveGeneration:0,sessionMutationGeneration:0,goalMutationGeneration:0,goalAwaitingMutation:null,goalRequestInFlight:!1,snapshotRetryGoalGeneration:null,pendingPromptAccepted:!1,disposed:!1,sentMessageIds:new Map,turnNumber:0,turnStartAt:0,turnFirstTokenAt:null,activeToolMs:0,streamDisposed:!1,pendingAssistantDelta:"",pendingThinkingDelta:"",pendingToolProgress:new Map,wsHandlers:new Map}}function mp(){const{showToast:t}=Dr();return{s:gp(),showToast:t}}function Zt(){return`msg_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function Zl(t,e){if(t!==null&&typeof t=="object"){const n=t.message;if(typeof n=="string")return n}return e}const Xl="scream-offline-prompt-queue",Ql="scream-recent-prompts";function vp(t){const{s:e}=t;let n=[];try{const u=localStorage.getItem(Xl);if(u){const d=JSON.parse(u);Array.isArray(d)&&(n=d.filter(h=>typeof h=="string"))}}catch{n=[]}function s(){try{localStorage.setItem(Xl,JSON.stringify(n.slice(0,20)))}catch{}}function o(){if(n.length===0)return;const u=n[0],d=`client_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,h=Zt();e.sentMessageIds.set(d,{messageId:h,connectionGeneration:e.connectionGeneration,queueText:u}),e.promptGeneration++,e.pendingPromptAccepted=!1,e.promptPending.value=!0,e.messages.value.push({id:h,role:"user",content:u,clientMessageId:d,tools:[],ts:Date.now()}),c(u),t.send({type:"prompt",text:u,clientMessageId:d})}function i(){n.length>0&&n.shift(),s(),o()}function r(u){n.push(u),s()}function l(u){const d=n.indexOf(u);d>=0&&(n.splice(d,1),s())}let a=[];try{const u=localStorage.getItem(Ql);if(u){const d=JSON.parse(u);Array.isArray(d)&&(a=d.filter(h=>typeof h=="string"))}}catch{a=[]}function c(u){const d=u.trim();if(d){a=[d,...a.filter(h=>h!==d)].slice(0,8);try{localStorage.setItem(Ql,JSON.stringify(a))}catch{}}}return t.flushQueue=o,t.flushQueueNext=i,t.enqueueOfflinePrompt=r,t.removeOfflineQueueItem=l,t.recordRecentPrompt=c,{enqueueOfflinePrompt:r,removeOfflineQueueItem:l,recordRecentPrompt:c,flushQueue:o,flushQueueNext:i}}function so(t,e,n,s){return t===n&&e===s}function yp(t){return t.currentSessionId===t.targetSessionId&&t.snapshot.sessionId===t.targetSessionId&&t.currentSessionGeneration===t.targetSessionGeneration&&t.currentConnectionGeneration===t.targetConnectionGeneration&&t.currentPromptGeneration===t.targetPromptGeneration&&t.currentLiveGeneration===t.targetLiveGeneration&&(t.currentEpoch===0||t.snapshot.epoch===t.currentEpoch)&&(t.snapshot.epoch!==t.currentEpoch||t.snapshot.seq>=t.currentSeq)}function bp(t){return{objective:t.objective,completionCriterion:t.completionCriterion,replace:t.replace,budgets:t.budgets}}function kp(t){return{objective:t.objective,budgets:t.budgets}}function wp(t,e,n){return t!==0&&n.epoch!==t?"resync":n.seq<=e?"duplicate":"apply"}function Sp(t,e){return e.type==="goal.updated"?{...t,goal:e.snapshot}:e.type==="todo.updated"?{...t,todos:e.todos}:t}function _p(t){const e=[],n=new Map;for(const s of t){const o=s.phase??null;let i=n.get(o);i===void 0&&(i=e.length,n.set(o,i),e.push({phase:o,items:[]})),e[i].items.push(s)}return e}const Ms=new Map;function $p(t){Ms.set(t,Date.now())}function xp(t){return Ms.get(t)}function Cp(t){const e=Ms.get(t);return e!==void 0&&Ms.delete(t),e}function Tp(){Ms.clear()}function bi(t){const e=t/1e3;return e<10?`${e.toFixed(1)}s`:e<60?`${Math.round(e)}s`:`${Math.floor(e/60)}m${String(Math.round(e%60)).padStart(2,"0")}s`}function Ip(t){let e=null;return{schedule:()=>{e===null&&(e=requestAnimationFrame(()=>{e=null,t()}))},flushNow:()=>{e!==null&&(cancelAnimationFrame(e),e=null),t()},dispose:()=>{e!==null&&(cancelAnimationFrame(e),e=null)}}}function Mp(t){const{s:e}=t;function n(){if(e.streamDisposed)return;const l=i();if(!l){e.pendingAssistantDelta="",e.pendingThinkingDelta="",e.pendingToolProgress.clear();return}if(e.pendingAssistantDelta&&(l.content+=e.pendingAssistantDelta,e.pendingAssistantDelta=""),e.pendingThinkingDelta){const a=l.tools.find(c=>c.name==="thinking");a?a.output=(a.output??"")+e.pendingThinkingDelta:l.tools.push({toolCallId:"thinking",name:"thinking",output:e.pendingThinkingDelta}),e.pendingThinkingDelta=""}if(e.pendingToolProgress.size>0){for(const[a,c]of e.pendingToolProgress){const u=l.tools.find(d=>d.toolCallId===a);u&&(u.progress=c)}e.pendingToolProgress.clear()}}const s=Ip(n);function o(l){var c;const a=Sp({goal:e.goal.value,todos:e.todos.value},l);switch(e.goal.value=a.goal,e.todos.value=a.todos,l.type==="goal.updated"&&e.goalAwaitingMutation!==null&&e.goalAwaitingMutation.generation===e.goalMutationGeneration&&(e.goalAwaitingMutation=null,e.snapshotRetryGoalGeneration=null,t.syncGoalRequestPending()),l.type){case"turn.started":{e.pendingPromptAccepted&&(e.promptPending.value=!1,e.pendingPromptAccepted=!1,e.sentMessageIds.clear()),s.flushNow(),e.status.value={...e.status.value,busy:!0},e.turnNumber+=1,e.turnStartAt=Date.now(),e.turnFirstTokenAt=null,e.activeToolMs=0,Tp(),e.messages.value.push({id:Zt(),role:"assistant",content:"",tools:[],ts:Date.now(),model:e.status.value.model,turnStats:{turn:e.turnNumber,step:0,status:"running",firstTokenMs:null,llmMs:0,toolMs:0,tokens:null,tokensPerSec:null}});break}case"assistant.delta":{e.turnFirstTokenAt===null&&(e.turnFirstTokenAt=Date.now()),e.pendingAssistantDelta+=String(l.delta),s.schedule();break}case"thinking.delta":{e.turnFirstTokenAt===null&&(e.turnFirstTokenAt=Date.now()),e.pendingThinkingDelta+=String(l.delta),s.schedule();break}case"tool.call.started":{const u=i();u&&(u.tools.push({toolCallId:String(l.toolCallId),name:String(l.name),args:l.args}),u.turnStats&&(u.turnStats.step+=1)),$p(String(l.toolCallId));break}case"tool.result":{e.pendingToolProgress.delete(String(l.toolCallId));const u=Cp(String(l.toolCallId));u!==void 0&&(e.activeToolMs+=Date.now()-u);const d=i();if(d){const h=d.tools.find(p=>p.toolCallId===l.toolCallId);h&&(h.output=String(l.output),h.isError=!!l.isError,h.progress=void 0,u!==void 0&&(h.durationMs=Date.now()-u))}break}case"tool.progress":{e.pendingToolProgress.set(String(l.toolCallId),String(l.message??l.output)),s.schedule();break}case"turn.ended":{if(s.flushNow(),e.status.value={...e.status.value,busy:!1},l.reason==="failed"){const m=i();m&&(m.isError=!0),e.error.value=Zl(l.error,"Turn failed")}const u=i(),d=Date.now()-e.turnStartAt,h=(c=e.status.value.usage)==null?void 0:c.currentTurn,p=h?h.inputOther+h.output+h.inputCacheRead+h.inputCacheCreation:null;u&&u.turnStats&&(u.turnStats.status="done",u.turnStats.llmMs=d,u.turnStats.toolMs=e.activeToolMs,u.turnStats.firstTokenMs=e.turnFirstTokenAt!==null?e.turnFirstTokenAt-e.turnStartAt:null,u.turnStats.tokens=p,u.turnStats.tokensPerSec=p!==null&&d>0?Math.round(p/d*1e3):null),t.fetchSessions(),t.fetchGitStatus();break}case"session.meta.updated":{const u={};l.model!==void 0&&(u.model=l.model),l.contextTokens!==void 0&&(u.contextTokens=l.contextTokens),l.maxContextTokens!==void 0&&(u.maxContextTokens=l.maxContextTokens),l.contextUsage!==void 0&&(u.contextUsage=l.contextUsage),e.status.value={...e.status.value,...u};break}case"agent.status.updated":{const u={};if(l.model!==void 0&&(u.model=l.model),l.thinkingLevel!==void 0&&(u.thinkingLevel=l.thinkingLevel),l.contextTokens!==void 0&&(u.contextTokens=l.contextTokens),l.maxContextTokens!==void 0&&(u.maxContextTokens=l.maxContextTokens),l.contextUsage!==void 0&&(u.contextUsage=l.contextUsage),l.usage!==void 0){u.usage=l.usage;const d=l.usage;if(d!=null&&d.currentTurn){const h=i(),p=d.currentTurn.inputOther+d.currentTurn.output+d.currentTurn.inputCacheRead+d.currentTurn.inputCacheCreation;h!=null&&h.turnStats&&h.turnStats.status==="done"&&h.turnStats.tokens===null&&(h.turnStats.tokens=p,h.turnStats.tokensPerSec=h.turnStats.llmMs?Math.round(p/h.turnStats.llmMs*1e3):null)}}e.status.value={...e.status.value,...u};break}case"error":{e.error.value=Zl(l.error,"Unknown error");break}}}function i(){for(let l=e.messages.value.length-1;l>=0;l--)if(e.messages.value[l].role==="assistant")return e.messages.value[l];return null}Pt(e,"event",l=>{const a=wp(e.epoch,e.seq,l);if(a==="resync"){e.epoch=l.epoch,e.seq=0,t.fetchSnapshot();return}a!=="duplicate"&&(e.seq=l.seq,e.epoch=l.epoch,e.liveGeneration++,o(l.payload))}),Pt(e,"resync_required",()=>{e.seq=0,t.fetchSnapshot()}),t.onEvent=o;function r(){e.streamDisposed=!0,s.dispose()}return{onEvent:o,disposeStreaming:r}}function Ap(t){const{s:e,showToast:n}=t;function s(){e.disposed||e.snapshotRetryTimer!==null||(e.snapshotRetryTimer=window.setTimeout(()=>{e.snapshotRetryTimer=null;const r=e.snapshotRetryGoalGeneration;e.snapshotRetryGoalGeneration=null,o(r??void 0)},250))}async function o(r){var p,m;const l=e.sessionId.value;if(!l)return;const a=e.messages.value.length===0?100:void 0,c=e.sessionGeneration,u=e.connectionGeneration,d=e.promptGeneration,h=e.liveGeneration;try{const y=await fetch(`${Te}/sessions/${l}/snapshot${a?`?tail=${a}`:""}`);if(!y.ok){r!==void 0&&((p=e.goalAwaitingMutation)==null?void 0:p.generation)===r&&(e.snapshotRetryGoalGeneration=r,s());return}const b=await y.json();if(!yp({snapshot:b,targetSessionId:l,currentSessionId:e.sessionId.value,targetSessionGeneration:c,currentSessionGeneration:e.sessionGeneration,targetConnectionGeneration:u,currentConnectionGeneration:e.connectionGeneration,targetPromptGeneration:d,currentPromptGeneration:e.promptGeneration,targetLiveGeneration:h,currentLiveGeneration:e.liveGeneration,currentEpoch:e.epoch,currentSeq:e.seq})){r!==void 0&&(e.snapshotRetryGoalGeneration=r),s();return}i(b,r)}catch{r!==void 0&&((m=e.goalAwaitingMutation)==null?void 0:m.generation)===r&&(e.snapshotRetryGoalGeneration=r,s())}}function i(r,l){var y;e.pendingAssistantDelta="",e.pendingThinkingDelta="",e.pendingToolProgress.clear();const a=e.messages.value.filter(b=>b.local),c=e.sentMessageIds.keys().next().value,u=c?e.sentMessageIds.get(c):void 0,d=u?e.messages.value.find(b=>b.id===u.messageId):void 0,h=!!(c&&r.messages.some(b=>b.clientMessageId===c)),p=!!(u&&!h&&u.connectionGeneration<e.connectionGeneration);p&&d&&(d.isError=!0);const m=d&&!h?[d]:[];e.messages.value=[...r.messages.map(b=>({...b,id:b.id??Zt()})),...a,...m];for(let b=e.messages.value.length-1;b>=0;b--){const w=(y=e.messages.value[b])==null?void 0:y.turnStats;if(w&&typeof w.turn=="number"&&w.turn>0){e.turnNumber=w.turn;break}}e.pendingApprovals.value=r.pendingApprovals,e.status.value={...r.status,busy:r.busy},e.olderAvailable.value=!!r.olderAvailable,e.oldestSeq.value=r.oldestSeq,e.goal.value=r.goal,e.todos.value=r.todos,l!==void 0&&e.goalAwaitingMutation!==null&&e.goalAwaitingMutation.generation===l&&e.goalMutationGeneration===l&&(e.goalAwaitingMutation=null,t.syncGoalRequestPending()),(h||p)&&(e.promptPending.value=!1,e.pendingPromptAccepted=!1,e.sentMessageIds.clear(),p&&n("消息未送达,已恢复连接。","error")),e.seq=r.seq,e.epoch=r.epoch,e.workDir.value=r.workDir}return t.fetchSnapshot=o,{fetchSnapshot:o}}function Rp(t){const{s:e,showToast:n}=t;function s(u){if(!u)return;if(e.connectionStatus.value==="idle"){n("暂无会话,请先新建会话。","warning");return}if(e.connectionStatus.value!=="connected"){t.enqueueOfflinePrompt(u),n("连接已断开,消息已排队,重连后自动发送。","warning"),t.connect();return}if(e.isBusy.value)return;const d=`client_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,h=Zt();e.sentMessageIds.set(d,{messageId:h,connectionGeneration:e.connectionGeneration}),e.promptGeneration++,e.pendingPromptAccepted=!1,e.promptPending.value=!0,e.messages.value.push({id:h,role:"user",content:u,clientMessageId:d,tools:[],ts:Date.now()}),t.recordRecentPrompt(u),t.send({type:"prompt",text:u,clientMessageId:d})}function o(u,d){if(e.connectionStatus.value==="idle"){n("暂无会话,请先新建会话。","warning");return}if(e.connectionStatus.value!=="connected"){n("连接已断开,命令未发送。","error"),t.connect();return}if(e.isBusy.value&&u!=="btw"){n(`会话忙碌中,无法执行 /${u},请稍后再试。`,"warning");return}const h=["compact","plan","auto","yes","fork","title"];let p=null;h.includes(u)&&(p=Zt(),e.messages.value.push({id:p,role:"system",content:`正在执行 /${u}${d?` ${d}`:""}...`,tools:[],pending:!0,ts:Date.now(),local:!0})),t.send({type:"command",command:u,...d?{args:d}:{},...p?{pendingMsgId:p}:{}})}function i(){e.messages.value=[],e.pendingApprovals.value=[]}function r(u){e.messages.value.push({id:Zt(),role:"system",content:u,tools:[],ts:Date.now(),local:!0})}function l(u,d,h,p){if(e.connectionStatus.value!=="connected"){n("连接已断开,审批结果未发送。","error"),t.connect();return}e.pendingApprovals.value=e.pendingApprovals.value.filter(m=>m.id!==u),t.send({type:"approval_response",id:u,decision:d,...h?{feedback:h}:{},...p?{scope:p}:{}})}function a(){t.send({type:"abort"})}async function c(){var h;const u=e.sessionId.value,d=e.oldestSeq.value;if(!u||d===void 0)return 0;try{const p=await fetch(`${Te}/sessions/${u}/messages?before=${d}&tail=50`);if(!p.ok)return 0;const m=await p.json();if(m.messages.length===0)return 0;const y=m.messages.map(b=>({...b,id:b.id??Zt()}));return e.messages.value=[...y,...e.messages.value],e.oldestSeq.value=((h=y[0])==null?void 0:h.seq)??d,e.olderAvailable.value=m.hasMore,y.length}catch{return 0}}return Pt(e,"user_message",u=>{var d;if(e.liveGeneration++,u.clientMessageId&&e.sentMessageIds.has(u.clientMessageId)){e.pendingPromptAccepted=!0,((d=e.sentMessageIds.get(u.clientMessageId))==null?void 0:d.queueText)!==void 0&&t.flushQueueNext();return}e.messages.value.push({id:Zt(),role:"user",content:u.text,clientMessageId:u.clientMessageId,tools:[],ts:Date.now()})}),Pt(e,"approval_request",u=>{e.liveGeneration++,e.pendingApprovals.value=[...e.pendingApprovals.value,{id:u.id,toolName:u.toolName,action:u.action,display:u.display}]}),Pt(e,"approval_resolved",u=>{e.liveGeneration++,e.pendingApprovals.value=e.pendingApprovals.value.filter(d=>d.id!==u.id)}),Pt(e,"command_result",u=>{const d=u.pendingMsgId?e.messages.value.findIndex(h=>h.id===u.pendingMsgId):-1;if(d>=0){const h=e.messages.value[d];e.messages.value[d]={...h,content:u.message,isError:!u.ok,pending:!1}}else e.messages.value.push({id:Zt(),role:"system",content:u.message,tools:[],isError:!u.ok,ts:Date.now(),local:!0});(u.command==="fork"||u.command==="title")&&t.fetchSessions(),u.ok&&u.command==="compact"&&t.fetchSnapshot()}),Pt(e,"error",u=>{if(e.error.value=u.message,u.clientMessageId){const d=e.sentMessageIds.get(u.clientMessageId);if(d){e.sentMessageIds.delete(u.clientMessageId),e.promptPending.value=!1,e.pendingPromptAccepted=!1;const h=e.messages.value.find(p=>p.id===d.messageId);h&&(h.isError=!0),n(`消息未发送:${u.message}`,"error"),d.queueText!==void 0&&t.removeOfflineQueueItem(d.queueText)}}}),t.appendSystemMessage=r,{sendPrompt:s,sendCommand:o,clearMessages:i,appendSystemMessage:r,abort:a,resolveApproval:l,loadOlderMessages:c}}function Pp(t){const{s:e,showToast:n}=t;async function s(){try{const u=await fetch(`${Te}/sessions`);if(!u.ok)return;e.sessions.value=await u.json()}catch{}}async function o(u){const d=e.sessionGeneration,h=e.connectionGeneration;try{return(await fetch(`${Te}/sessions/${u}/activate`,{method:"POST"})).ok&&e.connectionGeneration===h&&so(e.sessionId.value,e.sessionGeneration,u,d)}catch{return!1}}async function i(){try{const u=await fetch(`${Te}/git/status`);if(!u.ok)return;const d=await u.json();e.gitStatus.value=d.isRepo?d:null}catch{}}async function r(){try{const u=await fetch(`${Te}/sessions`,{method:"POST"});if(!u.ok){n(`新建会话失败(HTTP ${u.status})`,"error");return}const d=await u.json();e.sessions.value=[d,...e.sessions.value],await l(d.sessionId)}catch(u){n(`新建会话失败:${u instanceof Error?u.message:String(u)}`,"error")}}async function l(u){e.currentSessionId.value===u&&e.connectionStatus.value==="connected"||(e.currentSessionId.value=u,e.sessionId.value=u,e.sessionGeneration++,t.resetGoalRequestState(),e.seq=0,e.epoch=0,e.messages.value=[],e.pendingApprovals.value=[],e.status.value={busy:!1},e.goal.value=null,e.todos.value=[],e.sessionPlan.value=null,e.skills.value=[],e.plugins.value=[],e.pluginInfo.value=null,e.mcpServers.value=[],e.mcpStartupMetrics.value=null,e.backgroundTasks.value=[],e.backgroundTaskOutput.value="",e.sessionActive.value=!1,e.promptPending.value=!1,e.pendingPromptAccepted=!1,e.sentMessageIds.clear(),e.reconnectTimer!==null&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.snapshotRetryTimer!==null&&(clearTimeout(e.snapshotRetryTimer),e.snapshotRetryTimer=null),e.ws&&(e.ws.onclose=null,e.ws.close(),e.ws=null),t.stopHeartbeat(),t.connect())}async function a(u){try{const d=await fetch(`${Te}/sessions/${u}`,{method:"DELETE"});if(!d.ok){n(`删除会话失败(HTTP ${d.status})`,"error");return}if(e.sessions.value=e.sessions.value.filter(h=>h.sessionId!==u),e.currentSessionId.value===u){const h=e.sessions.value[0];h?await l(h.sessionId):(e.sessionGeneration++,t.resetGoalRequestState(),e.sessionId.value=null,e.currentSessionId.value=null,e.sessionActive.value=!1,e.seq=0,e.epoch=0,e.messages.value=[],e.pendingApprovals.value=[],e.status.value={busy:!1},e.goal.value=null,e.todos.value=[],e.sessionPlan.value=null,e.skills.value=[],e.plugins.value=[],e.pluginInfo.value=null,e.mcpServers.value=[],e.mcpStartupMetrics.value=null,e.backgroundTasks.value=[],e.backgroundTaskOutput.value="",e.promptPending.value=!1,e.pendingPromptAccepted=!1,e.sentMessageIds.clear(),e.ws&&(e.ws.onclose=null,e.ws.close(),e.ws=null),t.stopHeartbeat(),t.setConnectionStatus("idle"))}}catch(d){n(`删除会话失败:${d instanceof Error?d.message:String(d)}`,"error")}}async function c(u){try{const d=await fetch(`${Te}/sessions/${u}/export`);if(!d.ok){n(`导出会话失败(HTTP ${d.status})`,"error");return}const h=await d.blob(),p=URL.createObjectURL(h),m=document.createElement("a");m.href=p,m.download=`${u}.md`,m.click(),URL.revokeObjectURL(p)}catch(d){n(`导出会话失败:${d instanceof Error?d.message:String(d)}`,"error")}}return t.fetchSessions=s,t.fetchGitStatus=i,t.activateSession=o,{fetchSessions:s,fetchGitStatus:i,createSession:r,switchSession:l,deleteSession:a,exportSession:c}}function Ep(t){const{s:e,showToast:n}=t;async function s(){try{const c=await fetch(`${Te}/models`);if(!c.ok)return;const u=await c.json();e.models.value=u.models}catch{}}async function o(){try{const c=await fetch(`${Te}/like`);if(!c.ok)return;e.like.value=await c.json()}catch{}}async function i(c){try{return(await fetch(`${Te}/like`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).ok?(e.like.value=c,!0):!1}catch{return!1}}async function r(c,u,d){const h=e.sessionId.value;if(!h)return;const p=e.sessionGeneration,m=e.connectionGeneration,y=++e.sessionMutationGeneration;try{const b=await fetch(`${Te}/sessions/${h}/${c}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)}),w=await b.json();if(e.sessionId.value!==h||e.sessionGeneration!==p||e.connectionGeneration!==m||e.sessionMutationGeneration!==y)return;if(!b.ok){n(w.message??`请求失败(HTTP ${b.status})`,"error");return}w.status&&(e.status.value={...e.status.value,...w.status}),t.appendSystemMessage(d)}catch(b){if(e.sessionId.value!==h||e.sessionGeneration!==p||e.connectionGeneration!==m||e.sessionMutationGeneration!==y)return;n(`请求失败:${b instanceof Error?b.message:String(b)}`,"error")}}async function l(c){c!==e.status.value.model&&await r("model",{model:c},`已切换模型:${c}`)}async function a(c){c!==e.status.value.thinkingLevel&&await r("thinking",{level:c},`思考强度已切换为 ${c}`)}return Pt(e,"status",c=>{e.liveGeneration++,e.status.value={...e.status.value,...c.status}}),t.fetchModels=s,{fetchModels:s,fetchLike:o,updateLike:i,switchModel:l,switchThinking:a}}function Lp(t){const{s:e}=t;function n(){e.goalRequestPending.value=e.goalRequestInFlight||e.goalAwaitingMutation!==null}function s(){e.goalMutationGeneration++,e.goalAwaitingMutation=null,e.goalRequestInFlight=!1,e.snapshotRetryGoalGeneration=null,e.goalRequestPending.value=!1,e.goalRequestError.value=null}async function o(h,p,m,y){const b=e.sessionId.value;if(!b)return e.goalRequestError.value="暂无可操作的会话。",null;if(e.connectionStatus.value!=="connected")return e.goalRequestError.value="连接已断开,请等待重连后再试。",null;if(e.isArchived.value)return e.goalRequestError.value="当前会话已归档,无法修改 Goal。",null;if(e.goalRequestInFlight)return e.goalRequestError.value="正在处理上一个请求,请稍候。",null;e.goalAwaitingMutation!==null&&(e.goalAwaitingMutation=null,n());const w=e.sessionGeneration,S=++e.goalMutationGeneration;e.goalRequestInFlight=!0,n(),e.goalRequestError.value=null;try{const _=await fetch(`${Te}/sessions/${b}/goal${h}`,{method:p,headers:{"Content-Type":"application/json"},body:JSON.stringify(m)}),A=await _.json().catch(()=>({}));return!so(e.sessionId.value,e.sessionGeneration,b,w)||e.goalMutationGeneration!==S?null:_.ok?(y&&(e.goalAwaitingMutation={generation:S},e.snapshotRetryGoalGeneration=S),A):(e.goalRequestError.value=typeof A.message=="string"?A.message:`请求失败(HTTP ${_.status})`,null)}catch(_){return so(e.sessionId.value,e.sessionGeneration,b,w)&&e.goalMutationGeneration===S&&(e.goalRequestError.value=`请求失败:${_ instanceof Error?_.message:String(_)}`),null}finally{so(e.sessionId.value,e.sessionGeneration,b,w)&&e.goalMutationGeneration===S&&(e.goalRequestInFlight=!1,n())}}async function i(h){const p=await o("/refine","POST",{description:h},!1);return typeof(p==null?void 0:p.objective)=="string"?p.objective:null}async function r(h){return await o("","POST",bp(h),!0)===null?!1:(e.goalAwaitingMutation!==null&&t.fetchSnapshot(e.goalAwaitingMutation.generation),!0)}async function l(h){return await o("","PATCH",kp(h),!0)===null?!1:(e.goalAwaitingMutation!==null&&t.fetchSnapshot(e.goalAwaitingMutation.generation),!0)}async function a(h){return await o(h,"POST",{},!0)===null?!1:(e.goalAwaitingMutation!==null&&t.fetchSnapshot(e.goalAwaitingMutation.generation),!0)}function c(){return a("/pause")}function u(){return a("/resume")}function d(){return a("/cancel")}return t.resetGoalRequestState=s,t.syncGoalRequestPending=n,{refineGoal:i,createGoal:r,updateGoal:l,pauseGoal:c,resumeGoal:u,cancelGoal:d}}function Op(t){const{s:e,showToast:n}=t;async function s(){const y=e.sessionId.value;if(y)try{const b=await fetch(`${Te}/sessions/${y}/status`);if(!b.ok)return;const w=await b.json();e.status.value={...e.status.value,...w}}catch{}}async function o(){const y=e.sessionId.value;if(y)try{const b=await fetch(`${Te}/sessions/${y}/usage`);if(!b.ok)return;const w=await b.json();e.status.value={...e.status.value,usage:w}}catch{}}async function i(){const y=e.sessionId.value;if(y)try{const b=await fetch(`${Te}/sessions/${y}/context`);if(!b.ok)return;const w=await b.json();w.tokenCount!==void 0&&(e.status.value={...e.status.value,contextTokens:w.tokenCount})}catch{}}async function r(){const y=e.sessionId.value;if(y)try{const b=await fetch(`${Te}/sessions/${y}/plan`);if(!b.ok)return;e.sessionPlan.value=await b.json()}catch{}}async function l(){const y=e.sessionId.value;if(!y)return!1;try{return(await fetch(`${Te}/sessions/${y}/plan/clear`,{method:"POST"})).ok?(e.sessionPlan.value=null,!0):!1}catch{return!1}}async function a(y,b){const w=e.sessionId.value;if(!w)return!1;if(e.connectionStatus.value!=="connected")return n("连接已断开,操作未发送。","error"),t.connect(),!1;try{const S=await fetch(`${Te}/sessions/${w}/${y}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b??{})});if(!S.ok){const _=await S.json().catch(()=>({}));return n(_.message??`操作失败(HTTP ${S.status})`,"error"),!1}return!0}catch(S){return n(`操作失败:${S instanceof Error?S.message:String(S)}`,"error"),!1}}async function c(y){const b=await a("permission",{mode:y});return b&&await s(),b}async function u(y,b){const w=await a("plan",{enabled:y,...b?{strategy:b}:{}});return w&&await s(),w}async function d(y){const b=await a("wolfpack",{enabled:y});return b&&await s(),b}async function h(y,b){const w=await a("rlm",{enabled:y,...b!==void 0?{maxDepth:b}:{}});return w&&await s(),w}async function p(y=1){return a("undo",{count:y})}async function m(y){return a("compact",y?{instruction:y}:{})}return t.postSessionAction=a,{fetchSessionStatus:s,fetchSessionUsage:o,fetchSessionContext:i,fetchSessionPlan:r,clearPlan:l,switchPermission:c,switchPlanMode:u,switchWolfpack:d,switchRlm:h,undoHistory:p,compact:m}}function Dp(t){const{s:e}=t;async function n(){const y=e.sessionId.value;if(y)try{const b=await fetch(`${Te}/sessions/${y}/skills`);if(!b.ok)return;e.skills.value=await b.json()}catch{}}async function s(y,b){return t.postSessionAction(`skills/${encodeURIComponent(y)}/activate`,b?{args:b}:{})}async function o(y){const b=e.sessionId.value;if(!b)return!1;try{return(await fetch(`${Te}/sessions/${b}/skills/${encodeURIComponent(y)}`,{method:"DELETE"})).ok?(e.skills.value=e.skills.value.filter(S=>S.name!==y),!0):!1}catch{return!1}}async function i(){const y=e.sessionId.value;if(y)try{const b=await fetch(`${Te}/sessions/${y}/plugins`);if(!b.ok)return;e.plugins.value=await b.json()}catch{}}async function r(y){const b=e.sessionId.value;if(b)try{const w=await fetch(`${Te}/sessions/${b}/plugins/${encodeURIComponent(y)}`);if(!w.ok)return;e.pluginInfo.value=await w.json()}catch{}}async function l(y){const b=e.sessionId.value;if(!b)return null;try{const w=await fetch(`${Te}/sessions/${b}/plugins/install`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:y})});if(!w.ok)return null;const S=await w.json();return await i(),S}catch{return null}}async function a(y,b){return t.postSessionAction(`plugins/${encodeURIComponent(y)}/enable`,{enabled:b})}async function c(y,b,w){return t.postSessionAction(`plugins/${encodeURIComponent(y)}/mcp/${encodeURIComponent(b)}/enable`,{enabled:w})}async function u(y){const b=e.sessionId.value;if(!b)return!1;try{return(await fetch(`${Te}/sessions/${b}/plugins/${encodeURIComponent(y)}`,{method:"DELETE"})).ok?(e.plugins.value=e.plugins.value.filter(S=>S.id!==y),!0):!1}catch{return!1}}async function d(){const y=e.sessionId.value;if(!y)return null;try{const b=await fetch(`${Te}/sessions/${y}/plugins/reload`,{method:"POST"});if(!b.ok)return null;const w=await b.json();return await i(),w}catch{return null}}async function h(y){return t.postSessionAction(`plugins/${encodeURIComponent(y)}/activate`)}async function p(y){return t.postSessionAction(`plugins/${encodeURIComponent(y)}/deactivate`)}async function m(y){return t.postSessionAction(`plugins/${encodeURIComponent(y)}/inject`)}return{fetchSkills:n,activateSkill:s,removeSkill:o,fetchPlugins:i,fetchPluginInfo:r,installPlugin:l,setPluginEnabled:a,setPluginMcpServerEnabled:c,removePlugin:u,reloadPlugins:d,activatePlugin:h,deactivatePlugin:p,injectPlugin:m}}function Np(t){const{s:e}=t;async function n(){const d=e.sessionId.value;if(d)try{const h=await fetch(`${Te}/sessions/${d}/mcp`);if(!h.ok)return;e.mcpServers.value=await h.json()}catch{}}async function s(){const d=e.sessionId.value;if(d)try{const h=await fetch(`${Te}/sessions/${d}/mcp/startup-metrics`);if(!h.ok)return;e.mcpStartupMetrics.value=await h.json()}catch{}}async function o(d,h){return t.postSessionAction("mcp/add",{name:d,config:h})}async function i(d){return t.postSessionAction(`mcp/${encodeURIComponent(d)}/reconnect`)}async function r(d){return t.postSessionAction(`mcp/${encodeURIComponent(d)}/stop`)}async function l(d){const h=e.sessionId.value;if(!h)return!1;try{return(await fetch(`${Te}/sessions/${h}/mcp/${encodeURIComponent(d)}`,{method:"DELETE"})).ok?(e.mcpServers.value=e.mcpServers.value.filter(m=>m.name!==d),!0):!1}catch{return!1}}async function a(d,h){const p=e.sessionId.value;if(p)try{const m=new URLSearchParams;d!==void 0&&m.set("activeOnly",String(d)),h!==void 0&&m.set("limit",String(h));const y=m.toString(),b=await fetch(`${Te}/sessions/${p}/tasks${y?`?${y}`:""}`);if(!b.ok)return;e.backgroundTasks.value=await b.json()}catch{}}async function c(d,h){const p=e.sessionId.value;if(p)try{const m=h!==void 0?`?tail=${h}`:"",y=await fetch(`${Te}/sessions/${p}/tasks/${encodeURIComponent(d)}/output${m}`);if(!y.ok)return;const b=await y.json();e.backgroundTaskOutput.value=b.output}catch{}}async function u(d,h){return t.postSessionAction(`tasks/${encodeURIComponent(d)}/stop`,h?{reason:h}:{})}return{fetchMcpServers:n,fetchMcpStartupMetrics:s,addMcpServer:o,reconnectMcpServer:i,stopMcpServer:r,removeMcpServer:l,fetchBackgroundTasks:a,fetchBackgroundTaskOutput:c,stopBackgroundTask:u}}function Bp(t){const{s:e}=t;async function n(){try{const l=await fetch(`${Te}/config`);if(!l.ok)return;e.config.value=await l.json()}catch{}}async function s(l){try{const a=await fetch(`${Te}/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({patch:l})});return a.ok?(e.config.value=await a.json(),!0):!1}catch{return!1}}async function o(l){try{return(await fetch(`${Te}/config/providers/${encodeURIComponent(l)}`,{method:"DELETE"})).ok?(await n(),!0):!1}catch{return!1}}async function i(){try{const l=await fetch(`${Te}/experimental-flags`);if(!l.ok)return;e.experimentalFlags.value=await l.json()}catch{}}async function r(){try{if(!(await fetch(`${Te}/preflight`)).ok)return;e.preflightOk.value=!0}catch{}}return{fetchConfig:n,setConfig:s,removeProvider:o,fetchExperimentalFlags:i,preflight:r}}function Gp(t){const{s:e}=t;return function(s){var o;(o=e.wsHandlers.get(s.type))==null||o(s)}}function Fp(t){const{s:e,showToast:n}=t,s=Gp(t);function o(){const p=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws`;return e.currentSessionId.value?`${p}?sessionId=${encodeURIComponent(e.currentSessionId.value)}`:p}function i(h){e.connectionStatus.value=h}function r(h){var p;((p=e.ws)==null?void 0:p.readyState)===WebSocket.OPEN&&e.ws.send(JSON.stringify(h))}function l(h){a();const p=Number.isFinite(h)&&h>=1e3&&h<=12e4?h:15e3;e.lastPongAt=Date.now(),e.heartbeatTimer=window.setInterval(()=>{var m;if(Date.now()-e.lastPongAt>pp){(m=e.ws)==null||m.close();return}r({type:"ping"})},p)}function a(){e.heartbeatTimer!==null&&(clearInterval(e.heartbeatTimer),e.heartbeatTimer=null)}function c(){if(e.disposed||e.reconnectTimer!==null)return;if(e.reconnectAttempt>=Jl){i("disconnected"),e.error.value=`连接失败:自动重试已达上限(${Jl} 次),请手动重试`;return}i("reconnecting"),e.reconnectAttempt++;const h=Math.min(1e3*2**e.reconnectAttempt,3e4);e.reconnectTimer=window.setTimeout(()=>{e.reconnectTimer=null,d()},h)}function u(){if(!e.disposed){if(e.reconnectTimer!==null&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.ws!==null){try{e.ws.close()}catch{}e.ws=null}e.reconnectAttempt=0,d()}}function d(){if(e.disposed||e.ws&&(e.ws.readyState===WebSocket.CONNECTING||e.ws.readyState===WebSocket.OPEN))return;i("connecting"),e.error.value=null,t.resetGoalRequestState(),e.connectionGeneration++;const h=new WebSocket(o());e.ws=h,h.onclose=p=>{if(e.ws===h&&(e.ws=null,a(),e.connectionStatus.value!=="idle")){if(p.code===1008){e.sessionGeneration++,t.resetGoalRequestState(),e.sessionId.value=null,e.currentSessionId.value=null,e.sessionActive.value=!1,e.goal.value=null,e.todos.value=[],e.messages.value=[],e.error.value=null,e.promptPending.value=!1,e.sentMessageIds.clear(),i("idle"),p.reason!=="unauthorized"&&(n("会话不可用或已被删除","warning"),t.fetchSessions());return}i("disconnected"),c()}},h.onerror=()=>{e.ws===h&&i("reconnecting")},h.onmessage=p=>{if(e.ws!==h)return;e.lastPongAt=Date.now();let m;try{m=JSON.parse(p.data)}catch{return}s(m)}}return Pt(e,"server_hello",h=>{e.sessionId.value=h.sessionId,e.workDir.value=h.workDir,e.currentSessionId.value=h.sessionId,e.sessionActive.value=h.active;const p=e.epoch;e.epoch=h.epoch,l(h.heartbeat_ms),r({type:"client_hello",lastSeq:e.seq,epoch:p}),p!==0&&p!==h.epoch&&(e.seq=0),i("connected"),e.reconnectAttempt=0,t.flushQueue(),h.active?(t.fetchSnapshot(),t.fetchSessions(),t.fetchGitStatus()):t.activateSession(h.sessionId).then(m=>{m&&e.sessionId.value===h.sessionId&&(e.sessionActive.value=!0),t.fetchSnapshot(),t.fetchSessions(),t.fetchGitStatus()})}),Pt(e,"server_empty",()=>{i("idle")}),Pt(e,"pong",()=>{}),t.connect=d,t.send=r,t.stopHeartbeat=a,t.setConnectionStatus=i,{connect:d,send:r,reconnectNow:u,stopHeartbeat:a}}function jp(){const t=mp(),e=t.s;vp(t);const n=Mp(t),s=Ap(t),o=Rp(t),i=Pp(t),r=Ep(t),l=Lp(t),a=Op(t),c=Dp(t),u=Np(t),d=Bp(t),h=Fp(t);h.connect(),i.fetchSessions(),r.fetchModels();const p=()=>{h.connect()},m=()=>{!document.hidden&&e.connectionStatus.value!=="connected"&&h.connect()};return window.addEventListener("online",p),document.addEventListener("visibilitychange",m),ft(()=>{e.disposed=!0,n.disposeStreaming(),window.removeEventListener("online",p),document.removeEventListener("visibilitychange",m),h.stopHeartbeat(),e.reconnectTimer!==null&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.snapshotRetryTimer!==null&&(clearTimeout(e.snapshotRetryTimer),e.snapshotRetryTimer=null),e.ws&&(e.ws.onclose=null,e.ws.close(),e.ws=null)}),{connectionStatus:e.connectionStatus,messages:e.messages,pendingApprovals:e.pendingApprovals,status:e.status,goal:e.goal,todos:e.todos,goalRequestPending:e.goalRequestPending,goalRequestError:e.goalRequestError,error:e.error,sessionId:e.sessionId,workDir:e.workDir,isBusy:e.isBusy,isArchived:e.isArchived,sessions:e.sessions,currentSessionId:e.currentSessionId,gitStatus:e.gitStatus,models:e.models,like:e.like,fetchLike:r.fetchLike,updateLike:r.updateLike,sendPrompt:o.sendPrompt,sendCommand:o.sendCommand,clearMessages:o.clearMessages,appendSystemMessage:o.appendSystemMessage,abort:o.abort,resolveApproval:o.resolveApproval,fetchSessions:i.fetchSessions,fetchGitStatus:i.fetchGitStatus,fetchModels:r.fetchModels,reconnectNow:h.reconnectNow,olderAvailable:e.olderAvailable,oldestSeq:e.oldestSeq,loadOlderMessages:o.loadOlderMessages,switchModel:r.switchModel,switchThinking:r.switchThinking,refineGoal:l.refineGoal,createGoal:l.createGoal,updateGoal:l.updateGoal,pauseGoal:l.pauseGoal,resumeGoal:l.resumeGoal,cancelGoal:l.cancelGoal,createSession:i.createSession,switchSession:i.switchSession,deleteSession:i.deleteSession,exportSession:i.exportSession,fetchSnapshot:s.fetchSnapshot,fetchSessionStatus:a.fetchSessionStatus,fetchSessionUsage:a.fetchSessionUsage,fetchSessionContext:a.fetchSessionContext,fetchSessionPlan:a.fetchSessionPlan,sessionPlan:e.sessionPlan,clearPlan:a.clearPlan,switchPermission:a.switchPermission,switchPlanMode:a.switchPlanMode,switchWolfpack:a.switchWolfpack,switchRlm:a.switchRlm,undoHistory:a.undoHistory,compact:a.compact,skills:e.skills,fetchSkills:c.fetchSkills,activateSkill:c.activateSkill,removeSkill:c.removeSkill,plugins:e.plugins,pluginInfo:e.pluginInfo,fetchPlugins:c.fetchPlugins,fetchPluginInfo:c.fetchPluginInfo,installPlugin:c.installPlugin,setPluginEnabled:c.setPluginEnabled,setPluginMcpServerEnabled:c.setPluginMcpServerEnabled,removePlugin:c.removePlugin,reloadPlugins:c.reloadPlugins,activatePlugin:c.activatePlugin,deactivatePlugin:c.deactivatePlugin,injectPlugin:c.injectPlugin,mcpServers:e.mcpServers,mcpStartupMetrics:e.mcpStartupMetrics,fetchMcpServers:u.fetchMcpServers,fetchMcpStartupMetrics:u.fetchMcpStartupMetrics,addMcpServer:u.addMcpServer,reconnectMcpServer:u.reconnectMcpServer,stopMcpServer:u.stopMcpServer,removeMcpServer:u.removeMcpServer,backgroundTasks:e.backgroundTasks,backgroundTaskOutput:e.backgroundTaskOutput,fetchBackgroundTasks:u.fetchBackgroundTasks,fetchBackgroundTaskOutput:u.fetchBackgroundTaskOutput,stopBackgroundTask:u.stopBackgroundTask,config:e.config,fetchConfig:d.fetchConfig,setConfig:d.setConfig,removeProvider:d.removeProvider,experimentalFlags:e.experimentalFlags,fetchExperimentalFlags:d.fetchExperimentalFlags,preflightOk:e.preflightOk,preflight:d.preflight}}const Qo=[{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:"bot",description:"切换为 Bot 无人值守模式",target:"backend"},{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 Up(t){const e=t.toLowerCase();return Qo.filter(n=>{var s;return n.name.startsWith(e)||((s=n.aliases)==null?void 0:s.some(o=>o.startsWith(e)))})}function zp(t){const e=t.toLowerCase(),n=Qo.find(s=>{var o;return s.name===e||((o=s.aliases)==null?void 0:o.includes(e))});return(n==null?void 0:n.name)??e}function Hp(){return["可用命令:",...Qo.map(e=>{var s;return`${(s=e.aliases)!=null&&s.length?[e.name,...e.aliases].map(o=>`/${o}`).join(", "):`/${e.name}`} - ${e.description}`})].join(`
|
|
18
|
+
`)}const qp=["compact","auto","yes","plan","fork","title","btw"];function vu(t){async function e(n,s){var o,i,r;qp.includes(n)?(await((o=t.ensureSession)==null?void 0:o.call(t)),t.sendCommand(n,s)):n==="clear"?t.clearMessages():n==="new"?t.onNew():n==="help"?t.appendSystemMessage(Hp()):n==="model"?(i=t.openModelPicker)!=null&&i.call(t)||t.appendSystemMessage(`当前模型:${((r=t.currentModel)==null?void 0:r.call(t))??"unknown"}`):n==="status"||n==="usage"?t.showInfo?t.showInfo(n):t.appendSystemMessage("请在对话页查看会话详情"):t.appendSystemMessage(`未知命令:/${n}`)}return{onCommand:e}}const Wp=640,Nr=960,ea=480,Vp=300,ta=1200,Kp=320,yu=420;function xn(t,e,n){const s=Number.isFinite(t)?t:e,o=Math.max(e,n);return Math.round(Math.max(e,Math.min(o,s)))}function Yp(t){return xn(t*.42,360,640)}function Jp(t){const{viewportWidth:e,rightPanelOpen:n,rightPanelWidth:s}=t;if(e<=Wp)return ea;const o=e<Nr,i=o?Kp:yu,r=!o&&n?s:0;return Math.min(ea,e-i-r)}function Zp(t){const{viewportWidth:e,sidebarOpen:n,sidebarWidth:s}=t;if(e<Nr)return ta;const o=n?s:0;return Math.min(ta,e-yu-o)}function Qi(t){try{return localStorage.getItem(t)??void 0}catch{return}}function er(t,e){try{localStorage.setItem(t,e)}catch{}}function Xp(t){try{const e=localStorage.getItem(t);return e===null?void 0:JSON.parse(e)}catch{return}}function Qp(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function na(t){const{storageKey:e,minWidth:n,side:s}=t,o=_=>typeof _=="function"?_():_,i=()=>o(t.maxWidth);function r(){var A;const _=Xp(e);return typeof _=="number"&&Number.isFinite(_)&&_>=n&&(((A=t.acceptStoredWidth)==null?void 0:A.call(t,_))??!0)?Math.round(_):o(t.defaultWidth)}const l=O(r()),a=O(!1);let c=null;function u(){Qp(e,l.value)}function d(_){return s==="left"?_:window.innerWidth-_}function h(_){if(!(t.canDrag&&!t.canDrag())){_.preventDefault(),a.value=!0,c=_.pointerId;try{_.currentTarget.setPointerCapture(_.pointerId)}catch{}}}function p(_){!a.value||_.pointerId!==c||(l.value=xn(d(_.clientX),n,i()))}function m(_){!a.value||_.pointerId!==c||y()}function y(){a.value=!1,c=null,u()}function b(){l.value=xn(o(t.defaultWidth),n,i()),u()}function w(_){const A=_.shiftKey?32:12,Y=s==="left"?1:-1;if(_.key==="ArrowLeft")_.preventDefault(),l.value=xn(l.value-Y*A,n,i());else if(_.key==="ArrowRight")_.preventDefault(),l.value=xn(l.value+Y*A,n,i());else if(_.key==="Home")_.preventDefault(),l.value=n;else if(_.key==="End")_.preventDefault(),l.value=xn(i(),n,i());else if(_.key==="Enter")_.preventDefault(),b();else return;u()}const S=z(()=>xn(l.value,n,i()));return{width:l,effectiveWidth:S,resizing:a,onPointerDown:h,onPointerMove:p,onPointerUp:m,onKeydown:w,reset:b,release:y}}function eg(t,e){return(t==null?void 0:t.displayMode)??e??"source"}function tg(t,e){const n=t.find(i=>i.id===e.tabId);if(!n)return[...t,{id:e.tabId,label:e.fileName,filePath:e.filePath,sourceSessionId:e.sourceSessionId,initialDisplayMode:e.modeHint,viewerState:e.modeHint?{displayMode:e.modeHint,wrapLines:!1,scrollTop:0,scrollLeft:0}:void 0,viewerRevision:0}];const s=!!(e.sourceSessionId&&n.sourceSessionId!==e.sourceSessionId);return!s&&!e.modeHint?t:t.map(i=>{var l;if(i.id!==e.tabId)return i;const r={...i};return s&&(r.sourceSessionId=e.sourceSessionId),e.modeHint?(r.initialDisplayMode=e.modeHint,r.viewerState={displayMode:e.modeHint,wrapLines:((l=i.viewerState)==null?void 0:l.wrapLines)??!1,scrollTop:0,scrollLeft:0},r.viewerRevision=(i.viewerRevision??0)+1):s&&(r.viewerRevision=(i.viewerRevision??0)+1),r})}function ng(t,e,n,s){const o=t.findIndex(r=>r.id===e);if(o===-1||(t[o].viewerRevision??0)!==n)return t;const i=[...t];return i[o]={...i[o],viewerState:s},i}const bu="scream-file-tabs";function sg(){try{const t=localStorage.getItem(bu);return t?JSON.parse(t):{}}catch{return{}}}function ei(t){try{localStorage.setItem(bu,JSON.stringify(t))}catch{}}const As=sg(),ki=Array.isArray(As.tabs)?As.tabs:[],sa=typeof As.activeTabId=="string"?As.activeTabId:null;var Va;const be=vn({tabs:ki,activeTabId:ki.some(t=>t.id===sa)?sa:((Va=ki.at(-1))==null?void 0:Va.id)??null,panelOpen:As.panelOpen===!0});function og(){var t;if(be.tabs.length===0){be.activeTabId=null;return}be.tabs.some(e=>e.id===be.activeTabId)||(be.activeTabId=((t=be.tabs.at(-1))==null?void 0:t.id)??null)}function Dn(t,e={}){const n=t.split("/").pop()||t,s=t;return be.tabs=tg(be.tabs,{fileName:e.label??n,filePath:t,modeHint:e.modeHint,sourceSessionId:e.sessionId??null,tabId:s}),be.activeTabId=s,be.panelOpen=!0,ei(be),s}function ig(t){be.tabs.some(e=>e.id===t)&&(be.activeTabId=t,ei(be))}function oa(t){const e=be.tabs.findIndex(n=>n.id===t);if(e!==-1){if(be.tabs=be.tabs.filter(n=>n.id!==t),be.activeTabId===t){const n=be.tabs[e]??be.tabs[e-1]??null;be.activeTabId=n?n.id:null}be.tabs.length===0&&(be.panelOpen=!1,be.activeTabId=null),ei(be)}}function ku(t){be.panelOpen=t,t&&og(),ei(be)}function ia(){ku(!be.panelOpen)}const rg=()=>be.tabs.find(t=>t.id===be.activeTabId),lg=["type","disabled"],ag=ke({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},type:{default:"button"}},setup(t){return(e,n)=>(g(),v("button",{class:le(["ui-btn",[`ui-btn--${t.variant}`,`ui-btn--${t.size}`]]),type:t.type,disabled:t.disabled},[eo(e.$slots,"default",{},void 0)],10,lg))}}),we=(t,e)=>{const n=t.__vccOpts||t;for(const[s,o]of e)n[s]=o;return n},Mn=we(ag,[["__scopeId","data-v-f6df10d1"]]),cg={key:0,class:"approval-card"},ug={class:"approval-header"},dg={class:"approval-title"},fg={class:"tool-name"},hg={class:"action-summary"},pg={key:0,class:"approval-count"},gg={class:"approval-action"},mg={key:0,class:"feedback-area"},vg={class:"approval-buttons"},yg={key:0,class:"busy-indicator","aria-label":"处理中"},bg=ke({__name:"ApprovalCard",props:{approvals:{}},emits:["resolve"],setup(t,{emit:e}){const n=t,s=e,o=O(!1),i=O(!1),r=O(""),l=O(new Set),a=z(()=>n.approvals[0]);xe(()=>n.approvals.map(m=>m.id).join(","),()=>{i.value=!1,r.value="";const m=new Set(n.approvals.map(y=>y.id));l.value=new Set([...l.value].filter(y=>m.has(y)))});function c(m){return typeof m.display=="string"?m.display:m.display&&typeof m.display=="object"&&"description"in m.display?String(m.display.description??""):m.action??"执行该操作"}function u(m){return l.value.has(m)}function d(m,y,b){const w=a.value;!w||u(w.id)||(l.value=new Set([...l.value,w.id]),s("resolve",w.id,m,y,b))}function h(){const m=r.value.trim();m&&d("rejected",m)}function p(m){if(!a.value||o.value)return;const b=m.target;if(b&&(b.tagName==="TEXTAREA"||b.tagName==="INPUT")){i.value&&m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),h());return}switch(m.key){case"1":m.preventDefault(),d("approved",void 0,"once");break;case"2":m.preventDefault(),d("approved",void 0,"session");break;case"3":m.preventDefault(),d("rejected");break;case"4":m.preventDefault(),i.value=!i.value;break}}return Ze(()=>window.addEventListener("keydown",p)),ft(()=>window.removeEventListener("keydown",p)),(m,y)=>t.approvals.length?(g(),v("div",cg,[o.value?(g(),v("button",{key:0,class:"approval-minibar",onClick:y[0]||(y[0]=b=>o.value=!1)}," ⚠ "+M(t.approvals.length)+" 个待审批请求 — 点击展开 ",1)):a.value?(g(),v(X,{key:1},[f("div",ug,[y[7]||(y[7]=f("span",{class:"approval-icon"},"⚠",-1)),f("span",dg,[f("span",fg,M(a.value.toolName),1),f("span",hg,M(c(a.value)),1)]),t.approvals.length>1?(g(),v("span",pg,"+"+M(t.approvals.length-1),1)):B("",!0),f("button",{class:"icon-btn",title:"最小化","aria-label":"最小化",onClick:y[1]||(y[1]=b=>o.value=!0)},"—")]),f("pre",gg,M(c(a.value)),1),i.value?(g(),v("div",mg,[qe(f("textarea",{"onUpdate:modelValue":y[2]||(y[2]=b=>r.value=b),class:"feedback-input",rows:"2",name:"approval-feedback","aria-label":"拒绝反馈",placeholder:"输入反馈,Enter 提交(将作为拒绝原因反馈给 Agent)"},null,512),[[Xe,r.value]])])):B("",!0),f("div",vg,[J(Mn,{variant:"primary",disabled:u(a.value.id),onClick:y[3]||(y[3]=b=>d("approved",void 0,"once"))},{default:bt(()=>[...y[8]||(y[8]=[f("kbd",null,"1",-1),$e(" 批准 ",-1)])]),_:1},8,["disabled"]),J(Mn,{variant:"secondary",disabled:u(a.value.id),onClick:y[4]||(y[4]=b=>d("approved",void 0,"session"))},{default:bt(()=>[...y[9]||(y[9]=[f("kbd",null,"2",-1),$e(" 会话批准 ",-1)])]),_:1},8,["disabled"]),J(Mn,{variant:"danger",disabled:u(a.value.id),onClick:y[5]||(y[5]=b=>d("rejected"))},{default:bt(()=>[...y[10]||(y[10]=[f("kbd",null,"3",-1),$e(" 拒绝 ",-1)])]),_:1},8,["disabled"]),J(Mn,{variant:"secondary",class:le({"feedback-active":i.value}),disabled:u(a.value.id),onClick:y[6]||(y[6]=b=>i.value=!i.value)},{default:bt(()=>[...y[11]||(y[11]=[f("kbd",null,"4",-1),$e(" 反馈 ",-1)])]),_:1},8,["class","disabled"]),u(a.value.id)?(g(),v("span",yg,[...y[12]||(y[12]=[f("span",{class:"spinner"},null,-1),$e(" 处理中… ",-1)])])):B("",!0)])],64)):B("",!0)])):B("",!0)}}),kg=we(bg,[["__scopeId","data-v-fa5dc764"]]);function wg(t){const e=/(?:^|\s)@"([^"\n]*)$/.exec(t);if(e)return{start:t.length-(e[1].length+2),query:e[1],quoted:!0};const n=/(?:^|\s)@([^\s"]*)$/.exec(t);return n?{start:t.length-(n[1].length+1),query:n[1],quoted:!1}:null}function ra(t){let e=0;for(let n=0;n<t.length;n++)t[n]==="/"&&e++;return e}function la(t,e){if(!t)return!0;let n=0;for(let s=0;s<e.length&&n<t.length;s++)e[s]===t[n]&&n++;return n===t.length}function Sg(t,e){const n=t.path.toLowerCase();let s=0;if(e.includes("/"))n===e?s=100:n.startsWith(e)?s=80:n.includes(e)?s=50:la(e,n)&&(s=10);else{const o=n.lastIndexOf("/"),i=o===-1?n:n.slice(o+1);i===e?s=100:i.startsWith(e)?s=80:i.includes(e)?s=50:n.includes(e)?s=30:la(e,n)&&(s=10)}return t.isDir&&s>0&&(s+=10),s}const _g=20;function wu(t,e,n=_g){const s=e.toLowerCase();if(!s)return t.slice(0,n);const o=[];for(const i of t){const r=Sg(i,s);r>0&&o.push({entry:i,score:r})}return o.sort((i,r)=>r.score-i.score||ra(i.entry.path)-ra(r.entry.path)||i.entry.path.localeCompare(r.entry.path)),o.slice(0,n).map(i=>i.entry)}function $g(t,e){const n=e?`${t}/`:t,s=n.includes(" ");if(e){const i=s?`@"${n}"`:`@${n}`;return{text:i,cursorOffset:s?i.length-1:i.length}}const o=s?`@"${n}" `:`@${n} `;return{text:o,cursorOffset:o.length}}const xg="/api/v1/files",Cg=3e4,tr=new Map,oo=new Map;async function Su(t){const e=tr.get(t);if(e&&Date.now()-e.at<Cg)return e.entries;const n=oo.get(t);if(n)return n;const s=(async()=>{try{const o=await fetch(`${xg}/list?path=${encodeURIComponent(t)}`);if(!o.ok)return null;const i=await o.json();return i.entries&&tr.set(t,{entries:i.entries,at:Date.now()}),i.entries??null}catch{return null}finally{oo.delete(t)}})();return oo.set(t,s),s}function Tg(t){tr.delete(t),oo.delete(t)}function Ig(t,e){const n=t.replace(/\/+$/,""),s=n.split("/").filter(Boolean),o=[...s];for(const r of e.split("/"))if(!(!r||r===".")){if(r===".."){if(o.length<=s.length)return null;o.pop();continue}o.push(r)}const i=`/${o.join("/")}`;return i===n||i.startsWith(`${n}/`)?i:null}function Mg(t,e,n){const s=O(null),o=O([]),i=O(!1),r=O(!1),l=O(0),a=O(!1),c=O(null),u=O("");let d=null;function h(){d||(d=(async()=>{var C;try{const k=await fetch("/api/v1/files/root"),T=k.ok?await k.json():{};u.value=((C=T.roots)==null?void 0:C[0])??""}catch{u.value=""}_()})())}const p=z(()=>{const C=c.value;if(!C)return[];const k=C.query.lastIndexOf("/"),T=C.query.slice(k+1);return wu(o.value,T)}),m=z(()=>c.value!==null&&!a.value&&(i.value||p.value.length>0));function y(C){const k=C.lastIndexOf("/");return k===-1?{dirRel:"",tail:C}:{dirRel:C.slice(0,k),tail:C.slice(k+1)}}let b=!1,w=0;async function S(C,k){const T=++w;i.value=!0;try{const P=await Su(C);if(P===null)throw new Error("listing failed");if(T!==w)return;const N=k?`${k.replace(/\/+$/,"")}/`:"";o.value=P.map(re=>({path:`${N}${re.name}`,isDir:re.type==="dir"})),r.value=!1}catch{if(T!==w)return;o.value=[],r.value=!0,s.value=null}finally{T===w&&(i.value=!1)}}function _(){var D;if(b)return;const C=e.value;if(C&&C.value!==t.value){c.value=null;return}let k=(D=n.value)==null?void 0:D.trim();if(k||(h(),k=u.value),!C||!k){c.value=null;return}const T=C.selectionStart??C.value.length,P=wg(C.value.slice(0,T));if(!P){c.value=null,a.value=!1;return}const N=c.value;(!N||N.start!==P.start||N.query!==P.query)&&(a.value=!1),c.value=P,l.value=0;const{dirRel:re}=y(P.query),F=Ig(k,re);if(F===null){s.value=null,o.value=[],r.value=!0;return}s.value!==F&&(s.value=F,S(F,re))}function A(C){const k=p.value.length;k>0&&(l.value=(l.value+C+k)%k)}function Y(C){const k=c.value,T=C??p.value[l.value];if(!k||!T)return!1;const P=e.value;if(!P)return!1;const N=P.selectionStart??P.value.length,re=$g(T.path,T.isDir),F=t.value.slice(0,k.start),D=t.value.slice(N);t.value=F+re.text+D,b=!0;const ne=()=>{const ue=k.start+re.cursorOffset;P.focus(),P.setSelectionRange(ue,ue),b=!1,_()};return typeof requestAnimationFrame=="function"?requestAnimationFrame(ne):Promise.resolve().then(ne),!0}function G(){a.value=!0}function I(){c.value=null,a.value=!1,l.value=0}return{visible:m,suggestions:p,index:l,dirLoading:i,dirMissing:r,refresh:_,move:A,confirm:Y,dismiss:G,reset:I}}const _u=50;function Ag(t,e=_u){const n=new Set,s=[];for(let o=t.length-1;o>=0&&s.length<e;o-=1){const i=t[o];if(!i||i.role!=="user"||i.local)continue;const r=(i.content??"").trim();!r||n.has(r)||(n.add(r),s.push(r))}return s}function Rg(t,e,n=_u){const s=new Set,o=[],i=r=>{const l=r.trim();!l||s.has(l)||(s.add(l),o.push(l))};for(const r of e)i(r);for(let r=t.length-1;r>=0;r-=1){const l=t[r];l!==void 0&&i(l)}return o.slice(0,n).toReversed()}function Pg(){if(typeof navigator>"u")return"Ctrl";const t=`${navigator.platform??""} ${navigator.userAgent??""}`;return/Mac|iPhone|iPad|iPod/.test(t)?"⌘":"Ctrl"}const $u=Pg(),Eg=["width","height"],Lg={key:0,d:"M4 7h16M4 12h16M4 17h16"},Og={key:1,d:"M12 5v14M5 12h14"},Dg={key:5,d:"M4 6h16M7 12h10M10 18h4"},Ng={key:6,d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"},Bg={key:7,d:"M4 7h16M9 7V4h6v3m3 0-1 13H7L6 7m4 4v5m4-5v5"},Gg={key:8,d:"M3 12h4l2-7 4 14 2-7h6"},Fg={key:10,d:"m15 18-6-6 6-6"},jg={key:11,d:"m9 18 6-6-6-6"},Ug={key:12,d:"m6 9 6 6 6-6"},zg={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"},Hg={key:18,d:"M5 9a11 11 0 0 1 14 0M8.5 12.5a6 6 0 0 1 7 0M12 17h.01"},qg={key:19,d:"M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4Z"},Wg={key:20,d:"M12 16V4m0 0-4 4m4-4 4 4M5 20h14"},Vg={key:21,d:"m15 4 5 5M17.5 6.5 10 14m-2-2 4 4-3 4H3l1-6Z"},Kg={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"},Yg={key:24,d:"m22 2-7 20-4-9-9-4ZM22 2 11 13"},Jg={key:25,x:"6",y:"6",width:"12",height:"12",rx:"2"},Zg={key:26,d:"m8 3 4 4 4-4M8 21l4-4 4 4M12 7v10"},Xg={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"},Qg={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"},em={key:31,d:"M20 13 13 20l-9-9V4h7ZM8.5 8.5h.01"},tm={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"},nm={key:34,d:"M3 6h7l2 2h9v11H3Z"},sm={key:35,d:"m5 12 4 4L19 6"},om={key:39,d:"M21 12a9 9 0 1 1-2.6-6.4M21 3v6h-6"},im={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"},rm={key:47,d:"M12 19V5m0 0-6 6m6-6 6 6"},lm={key:48,d:"M18 6 6 18M6 6l12 12"},am={key:51,d:"M4 20V10M10 20V4M16 20v-7M21 20H3"},cm=ke({__name:"SvgIcon",props:{name:{},size:{default:20}},setup(t){return(e,n)=>(g(),v("svg",{class:"svg-icon",width:t.size,height:t.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[t.name==="menu"?(g(),v("path",Lg)):t.name==="plus"?(g(),v("path",Og)):t.name==="panel-left"?(g(),v(X,{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)):t.name==="panel-right"?(g(),v(X,{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)):t.name==="search"?(g(),v(X,{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)):t.name==="filter"?(g(),v("path",Dg)):t.name==="download"?(g(),v("path",Ng)):t.name==="trash"?(g(),v("path",Bg)):t.name==="activity"?(g(),v("path",Gg)):t.name==="help"?(g(),v(X,{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)):t.name==="chevron-left"?(g(),v("path",Fg)):t.name==="chevron-right"?(g(),v("path",jg)):t.name==="chevron-down"?(g(),v("path",Ug)):t.name==="bot"?(g(),v(X,{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)):t.name==="git-branch"?(g(),v(X,{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)):t.name==="sun"?(g(),v(X,{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)):t.name==="moon"?(g(),v("path",zg)):t.name==="monitor"?(g(),v(X,{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)):t.name==="wifi"?(g(),v("path",Hg)):t.name==="edit"?(g(),v("path",qg)):t.name==="upload"?(g(),v("path",Wg)):t.name==="broom"?(g(),v("path",Vg)):t.name==="command"?(g(),v("path",Kg)):t.name==="at"?(g(),v(X,{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)):t.name==="send"?(g(),v("path",Yg)):t.name==="stop"?(g(),v("rect",Jg)):t.name==="compact"?(g(),v("path",Zg)):t.name==="brain"?(g(),v("path",Xg)):t.name==="clipboard"?(g(),v(X,{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)):t.name==="fork"?(g(),v(X,{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)):t.name==="message-circle"?(g(),v("path",Qg)):t.name==="tag"?(g(),v("path",em)):t.name==="sparkles"?(g(),v("path",tm)):t.name==="terminal"?(g(),v(X,{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)):t.name==="folder"?(g(),v("path",nm)):t.name==="check"?(g(),v("path",sm)):t.name==="speaker"?(g(),v(X,{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)):t.name==="speaker-off"?(g(),v(X,{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)):t.name==="copy"?(g(),v(X,{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)):t.name==="refresh"?(g(),v("path",om)):t.name==="target"?(g(),v(X,{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)):t.name==="settings"?(g(),v(X,{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)):t.name==="home"?(g(),v(X,{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)):t.name==="bell"?(g(),v(X,{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)):t.name==="book"?(g(),v(X,{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)):t.name==="layers"?(g(),v(X,{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)):t.name==="wrench"?(g(),v("path",im)):t.name==="arrow-up"?(g(),v("path",rm)):t.name==="x"?(g(),v("path",lm)):t.name==="file"?(g(),v(X,{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)):t.name==="user"?(g(),v(X,{key:50},[n[50]||(n[50]=f("circle",{cx:"12",cy:"8",r:"3.5"},null,-1)),n[51]||(n[51]=f("path",{d:"M5 20a7 7 0 0 1 14 0"},null,-1))],64)):t.name==="bar-chart"?(g(),v("path",am)):B("",!0)],8,Eg))}}),de=we(cm,[["__scopeId","data-v-f1ddf340"]]),um={class:"at-menu",role:"listbox","aria-label":"文件提及"},dm={key:0,class:"at-status"},fm={key:1,class:"at-status"},hm=["data-active","aria-selected","onClick","onMousemove"],pm={class:"at-item-name"},gm={key:0,class:"at-item-dir"},mm={class:"at-hints"},vm={class:"at-hint"},ym=["title"],bm=ke({__name:"AtFileMenu",props:{suggestions:{},activeIndex:{},loading:{type:Boolean,default:!1},workDir:{default:""}},emits:["select","hover"],setup(t,{emit:e}){const n=t,s=e,o=O(null);xe(()=>n.activeIndex,async()=>{var c;await We();const a=(c=o.value)==null?void 0:c.querySelector('[data-active="true"]');a==null||a.scrollIntoView({block:"nearest"})});const i=a=>a.split("/").pop()||a;function r(a){return i(a.path)}function l(a){const c=a.path.lastIndexOf("/");return c===-1?"":a.path.slice(0,c)}return(a,c)=>{var u;return g(),v("div",um,[t.loading&&t.suggestions.length===0?(g(),v("div",dm,"加载文件列表…")):t.suggestions.length===0?(g(),v("div",fm,"无匹配文件")):(g(),v("ul",{key:2,ref_key:"listRef",ref:o,class:"at-list"},[(g(!0),v(X,null,Ce(t.suggestions,(d,h)=>(g(),v("li",{key:d.path},[f("button",{class:le(["at-item",{selected:h===t.activeIndex}]),"data-active":h===t.activeIndex?"true":void 0,role:"option","aria-selected":h===t.activeIndex,onClick:p=>s("select",d),onMousemove:p=>s("hover",h)},[f("span",{class:le(["at-item-icon",{"is-dir":d.isDir}])},[J(de,{name:d.isDir?"folder":"file",size:14},null,8,["name"])],2),f("span",pm,M(r(d)),1),l(d)?(g(),v("span",gm,M(l(d)),1)):B("",!0)],42,hm)]))),128))],512)),f("div",mm,[c[1]||(c[1]=f("span",{class:"at-hint"},[f("kbd",null,"↑↓"),$e("选择")],-1)),f("span",vm,[c[0]||(c[0]=f("kbd",null,"Tab/Enter",-1)),$e(M((u=t.suggestions[t.activeIndex])!=null&&u.isDir?"进入目录":"插入引用"),1)]),c[2]||(c[2]=f("span",{class:"at-hint"},[f("kbd",null,"Esc"),$e("关闭")],-1)),t.workDir?(g(),v("span",{key:0,class:"at-root",title:t.workDir},"根:"+M(i(t.workDir)),9,ym)):B("",!0)])])}}}),km=we(bm,[["__scopeId","data-v-c228c98f"]]),wm=["title","aria-label"],Sm=["width","height","viewBox"],_m=["cx","cy","r"],$m=["cx","cy","r","stroke-dasharray","stroke-dashoffset","transform"],wi=2,xm=ke({__name:"ContextRing",props:{usage:{default:void 0},size:{default:16}},setup(t){Lh(a=>({v1d95ffa8:l.value}));const e=t,n=z(()=>{if(e.usage===void 0||Number.isNaN(e.usage))return 0;const a=e.usage>1?e.usage/100:e.usage;return Math.min(1,Math.max(0,a))}),s=z(()=>Math.round(n.value*100)),o=z(()=>(e.size-wi)/2),i=z(()=>2*Math.PI*o.value),r=z(()=>i.value*(1-n.value)),l=z(()=>n.value>=.9?"var(--color-danger)":n.value>=.7?"var(--color-warning)":"var(--color-accent)");return(a,c)=>(g(),v("span",{class:"context-ring",role:"img",title:`上下文占用 ${s.value}%`,"aria-label":`上下文占用 ${s.value}%`},[(g(),v("svg",{width:t.size,height:t.size,viewBox:`0 0 ${t.size} ${t.size}`},[f("circle",{class:"ring-track",cx:t.size/2,cy:t.size/2,r:o.value,"stroke-width":wi,fill:"none"},null,8,_m),f("circle",{class:"ring-value",cx:t.size/2,cy:t.size/2,r:o.value,"stroke-width":wi,fill:"none","stroke-linecap":"round","stroke-dasharray":i.value,"stroke-dashoffset":r.value,transform:`rotate(-90 ${t.size/2} ${t.size/2})`},null,8,$m)],8,Sm))],8,wm))}}),xu=we(xm,[["__scopeId","data-v-3ffc343b"]]),Cm={class:"history-menu",role:"listbox","aria-label":"输入历史"},Tm={class:"history-header",title:"输入历史"},Im=["data-active","aria-selected","onClick","onMousemove"],Mm={class:"history-item-index"},Am={class:"history-item-text"},Rm=ke({__name:"HistoryMenu",props:{items:{},activeIndex:{}},emits:["apply","hover"],setup(t,{emit:e}){const n=t,s=e,o=O(null);return xe(()=>n.activeIndex,async()=>{var r;await We();const i=(r=o.value)==null?void 0:r.querySelector('[data-active="true"]');i==null||i.scrollIntoView({block:"nearest"})}),Ze(async()=>{var r;await We();const i=(r=o.value)==null?void 0:r.querySelector('[data-active="true"]');i==null||i.scrollIntoView({block:"nearest"})}),(i,r)=>(g(),v("div",Cm,[f("div",Tm,[J(de,{name:"refresh",size:14}),r[0]||(r[0]=f("span",{class:"history-hints"},[f("span",{class:"history-hint"},[f("kbd",null,"↑↓"),$e("选择")]),f("span",{class:"history-hint"},[f("kbd",null,"Tab/Enter"),$e("填入")]),f("span",{class:"history-hint"},[f("kbd",null,"Esc"),$e("关闭")])],-1))]),f("ul",{ref_key:"listRef",ref:o,class:"history-list"},[(g(!0),v(X,null,Ce(t.items,(l,a)=>(g(),v("li",{key:`${a}:${l}`},[f("button",{class:le(["history-item",{selected:a===t.activeIndex}]),"data-active":a===t.activeIndex?"true":void 0,role:"option","aria-selected":a===t.activeIndex,onClick:c=>s("apply",l),onMousemove:c=>s("hover",a)},[f("span",Mm,M(a+1),1),f("span",Am,M(l),1)],42,Im)]))),128))],512)]))}}),Pm=we(Rm,[["__scopeId","data-v-598dec8a"]]),Em=["onKeydown"],Lm={key:0,class:"picker-empty"},Om={class:"picker-group-title"},Dm=["onClick"],Nm={class:"row-main"},Bm={class:"row-name"},Gm={class:"row-alias"},Fm={class:"row-meta"},jm={key:0,class:"row-check"},Um={class:"picker-thinking"},zm={class:"thinking-options"},Hm=["onClick"],qm=ke({__name:"ModelPicker",props:{models:{},currentModel:{},currentThinking:{}},emits:["apply-model","apply-thinking","close"],setup(t,{emit:e}){const n=t,s=e,o=["off","low","medium","high"],i={off:"关闭",low:"低",medium:"中",high:"高",xhigh:"超高",max:"最大"},r=O(""),l=O(null);Ze(()=>{var I;(I=l.value)==null||I.focus()});const a=z(()=>{const I=r.value.trim().toLowerCase();return I?n.models.filter(C=>C.alias.toLowerCase().includes(I)||C.provider.toLowerCase().includes(I)||(C.displayName??"").toLowerCase().includes(I)):n.models}),c=z(()=>{const I=new Map;for(const C of a.value){const k=I.get(C.provider)??[];k.push(C),I.set(C.provider,k)}return[...I.entries()].map(([C,k])=>({provider:C,models:k}))}),u=z(()=>n.models.find(I=>I.alias===n.currentModel)),d=z(()=>{var I;return((I=u.value)==null?void 0:I.thinkingLevels)??o});function h(I){return i[I]??I}function p(I){return I>=1e3?`${Math.round(I/1e3)}k`:String(I)}function m(I){return I.displayName??I.model}const y=O(null);function b(I){y.value&&!y.value.contains(I.target)&&s("close")}Ze(()=>document.addEventListener("mousedown",b,!0)),ft(()=>document.removeEventListener("mousedown",b,!0));function w(I){I!==n.currentModel&&s("apply-model",I),s("close")}const S=O(null);function _(){const I=S.value;return I?Array.from(I.querySelectorAll(".picker-row")):[]}function A(){var I;(I=_()[0])==null||I.focus()}function Y(I){var T,P,N;if(I.key!=="ArrowDown"&&I.key!=="ArrowUp")return;const C=_();if(C.length===0)return;const k=C.indexOf(document.activeElement);I.preventDefault(),k===-1?(T=C[0])==null||T.focus():I.key==="ArrowDown"?(P=C[(k+1)%C.length])==null||P.focus():(N=C[(k-1+C.length)%C.length])==null||N.focus()}function G(I){I!==n.currentThinking&&s("apply-thinking",I)}return(I,C)=>(g(),v("div",{ref_key:"rootRef",ref:y,class:"model-picker",role:"dialog","aria-label":"模型选择",onKeydown:C[1]||(C[1]=En(Ye(k=>s("close"),["stop"]),["esc"]))},[qe(f("input",{ref_key:"searchRef",ref:l,"onUpdate:modelValue":C[0]||(C[0]=k=>r.value=k),class:"picker-search",type:"text",placeholder:"搜索模型…",id:"model-search-input",name:"model-search",autocomplete:"off",spellcheck:"false",onKeydown:En(Ye(A,["prevent"]),["arrow-down"])},null,40,Em),[[Xe,r.value]]),f("div",{ref_key:"listRef",ref:S,class:"picker-list",onKeydown:Y},[c.value.length===0?(g(),v("div",Lm,"无匹配模型")):B("",!0),(g(!0),v(X,null,Ce(c.value,k=>(g(),v("div",{key:k.provider,class:"picker-group"},[f("div",Om,M(k.provider),1),(g(!0),v(X,null,Ce(k.models,T=>(g(),v("button",{key:T.alias,class:le(["picker-row",{active:T.alias===t.currentModel}]),onClick:P=>w(T.alias)},[f("span",Nm,[f("span",Bm,M(m(T)),1),f("span",Gm,M(T.alias),1)]),f("span",Fm,M(p(T.maxContextSize)),1),T.alias===t.currentModel?(g(),v("span",jm,"✓")):B("",!0)],10,Dm))),128))]))),128))],544),f("div",Um,[C[2]||(C[2]=f("span",{class:"thinking-label"},"思考强度",-1)),f("div",zm,[(g(!0),v(X,null,Ce(d.value,k=>(g(),v("button",{key:k,class:le(["thinking-btn",{active:k===t.currentThinking}]),onClick:T=>G(k)},M(h(k)),11,Hm))),128))])])],544))}}),Wm=we(qm,[["__scopeId","data-v-438275ef"]]),Vm={class:"slash-menu",role:"listbox","aria-label":"斜杠命令"},Km=["aria-selected","onMousedown","onMouseenter"],Ym={class:"slash-name"},Jm={key:0,class:"slash-aliases"},Zm={class:"slash-desc"},Xm={key:0,class:"slash-badge slash-badge-input"},Qm={key:1,class:"slash-badge"},ev=ke({__name:"SlashMenu",props:{commands:{},activeIndex:{}},emits:["select","hover"],setup(t,{emit:e}){const n=e;return(s,o)=>(g(),v("div",Vm,[(g(!0),v(X,null,Ce(t.commands,(i,r)=>{var l;return g(),v("button",{key:i.name,class:le(["slash-item",{active:r===t.activeIndex}]),role:"option","aria-selected":r===t.activeIndex,onMousedown:Ye(a=>n("select",i),["prevent"]),onMouseenter:a=>n("hover",r)},[f("span",Ym,[$e("/"+M(i.name),1),(l=i.aliases)!=null&&l.length?(g(),v("span",Jm,M(i.aliases.map(a=>`/${a}`).join(" ")),1)):B("",!0)]),f("span",Zm,M(i.description),1),i.acceptsInput?(g(),v("span",Xm,"输入参数")):B("",!0),i.target==="backend"?(g(),v("span",Qm,"服务端")):B("",!0)],42,Km)}),128)),o[0]||(o[0]=f("div",{class:"slash-hint"},"↑↓ 选择 · Enter/Tab 执行 · Esc 关闭",-1))]))}}),tv=we(ev,[["__scopeId","data-v-6983799d"]]),nv=["placeholder"],sv={class:"composer-footer"},ov={class:"composer-quick-actions"},iv=["title"],rv={key:3,class:"queue-label",title:"运行结束后自动发送"},lv={class:"composer-actions"},av=["disabled","title"],cv={key:1,class:"context-label",title:"上下文使用率"},uv=["disabled"],aa=50,dv=ke({__name:"Composer",props:{busy:{type:Boolean},status:{default:void 0},sessionId:{default:null},models:{default:()=>[]},workDir:{default:""},variant:{default:"chat"},placeholder:{default:void 0},messages:{}},emits:["send","abort","command","switch-model","switch-thinking"],setup(t,{expose:e,emit:n}){const s=t,o=n,i=O(""),r=O(null),l=z(()=>s.workDir||void 0),a=Mg(i,r,l),c=O(0),u=O(!1),d=z(()=>{const $=i.value;return!$.startsWith("/")||$.includes(`
|
|
19
|
+
`)||/\s/.test($.slice(1))?null:$.slice(1)}),h=z(()=>d.value===null?[]:Up(d.value)),p=z(()=>d.value!==null&&h.value.length>0&&!u.value);xe(d,()=>{c.value=0,u.value=!1});function m($){const E=$??h.value[c.value];if(E){if(E.acceptsInput){i.value=`/${E.name} `,u.value=!0,We(()=>{var ae;(ae=r.value)==null||ae.focus(),re()});return}I(`/${E.name}`),ge(),o("command",E.name)}}const y=O([]);xe(()=>s.sessionId,()=>{y.value=[]}),xe(()=>s.busy,$=>{if(!$&&y.value.length>0){const[E,...ae]=y.value;y.value=ae,E&&o("send",E)}});let b=0;const w=O([]),S=z(()=>Rg(w.value,Ag(s.messages??[]),aa)),_=O(!1),A=O(0);function Y(){return`scream-history:${s.sessionId??"default"}`}function G(){try{const $=localStorage.getItem(Y());w.value=$?JSON.parse($):[]}catch{w.value=[]}}function I($){if(w.value.at(-1)!==$){w.value=[...w.value,$].slice(-aa);try{localStorage.setItem(Y(),JSON.stringify(w.value))}catch{}}}function C($){i.value=$,_.value=!1,We(()=>{const E=r.value;E&&(E.focus(),E.setSelectionRange(E.value.length,E.value.length),re(),a.reset())})}function k(){u.value=!0,a.dismiss(),A.value=Math.max(0,S.value.length-1),_.value=!0}function T($){const E=S.value.length;E!==0&&(A.value=Math.min(E-1,Math.max(0,A.value+$)))}xe(()=>S.value.length,()=>{A.value>=S.value.length&&(A.value=Math.max(0,S.value.length-1))});function P(){return`scream-draft:${s.sessionId??"default"}`}let N;xe(i,()=>{re(),_.value=!1,a.refresh(),clearTimeout(N),N=setTimeout(()=>{try{i.value?localStorage.setItem(P(),i.value):localStorage.removeItem(P())}catch{}},300)}),xe(()=>s.sessionId,()=>{clearTimeout(N),G(),_.value=!1,A.value=0;let $="";try{$=localStorage.getItem(P())??""}catch{$=""}i.value=$,We(re)},{immediate:!0});function re(){const $=r.value;if(!$)return;$.style.height="auto";const E=Math.round(window.innerHeight*.25);$.style.height=`${Math.min(Math.max($.scrollHeight,36),E)}px`}function F(){a.refresh()}const D=O(0);function ne(){const $=window.visualViewport;if(!$)return;const E=Math.round(window.innerHeight-$.height-$.offsetTop);D.value=E>120?E:0}"visualViewport"in window&&(Ze(()=>{var $;($=window.visualViewport)==null||$.addEventListener("resize",ne),ne()}),ft(()=>{var $;($=window.visualViewport)==null||$.removeEventListener("resize",ne),D.value=0}));function ue($){if(!_.value)return;const E=$.target;E instanceof Element&&(E.closest(".history-menu")||E.closest("#composer-input")||(_.value=!1))}Ze(()=>document.addEventListener("mousedown",ue)),ft(()=>document.removeEventListener("mousedown",ue));function ge(){i.value="",a.reset(),_.value=!1,We(()=>{r.value&&(r.value.style.height="auto")})}function Ne(){const $=i.value.trim();if($){if($.startsWith("/")){const E=$.indexOf(" "),ae=(E===-1?$.slice(1):$.slice(1,E)).toLowerCase(),ce=zp(ae),he=E===-1?"":$.slice(E+1).trim();I($),o("command",ce,he),ge();return}if(s.busy){He();return}I($),o("send",$),ge()}}function He(){const $=i.value.trim();$&&(I($),y.value=[...y.value,$],ge())}function ze($){if(a.visible.value){if($.key==="ArrowDown"){$.preventDefault(),a.move(1);return}if($.key==="ArrowUp"){$.preventDefault(),a.move(-1);return}if(($.key==="Tab"||$.key==="Enter"&&!$.shiftKey)&&($.isComposing||($.preventDefault(),a.dirLoading.value)||a.confirm()))return;if($.key==="Escape"){$.preventDefault(),a.dismiss();return}}if(p.value){if($.key==="ArrowUp"){$.preventDefault(),c.value=(c.value-1+h.value.length)%h.value.length;return}if($.key==="ArrowDown"){$.preventDefault(),c.value=(c.value+1)%h.value.length;return}if($.key==="Tab"||$.key==="Enter"&&!$.shiftKey){if($.key==="Enter"&&$.isComposing)return;$.preventDefault(),m();return}if($.key==="Escape"){$.preventDefault(),u.value=!0;return}}if(($.ctrlKey||$.metaKey)&&$.key.toLowerCase()==="s"){$.preventDefault(),s.busy?He():Ne();return}if(_.value&&!$.isComposing){if($.key==="ArrowDown"){$.preventDefault(),T(1);return}if($.key==="ArrowUp"){$.preventDefault(),T(-1);return}if($.key==="Escape"){$.preventDefault(),_.value=!1;return}if(($.key==="Tab"||$.key==="Enter"&&!$.shiftKey)&&S.value[A.value]!==void 0){$.preventDefault(),C(S.value[A.value]);return}}if($.key==="Enter"&&!$.shiftKey){if($.isComposing||Date.now()-b<100)return;$.preventDefault(),Ne();return}$.key==="ArrowUp"&&!$.isComposing&&!s.busy&&i.value.trim().length===0&&S.value.length>0&&($.preventDefault(),k())}function H(){y.value=[],o("abort")}function K($){i.value=$,_.value=!1,We(()=>{var E;re(),(E=r.value)==null||E.focus()})}function ie($){i.value+=$,We(()=>{var E;re(),(E=r.value)==null||E.focus()})}e({insertText:K,openModelPicker:W});const q=z(()=>{var $;return($=s.status)==null?void 0:$.model}),oe=z(()=>{var $;return($=s.status)==null?void 0:$.permission}),j=z(()=>{var $;return($=s.status)==null?void 0:$.contextUsage}),fe=z(()=>s.placeholder??(s.busy?`回合进行中:Enter/${$u}+S 排队消息,随下一轮注入`:"输入消息,@ 提及,/ 触发指令")),Se=O(!1),ve={off:"关闭",low:"低",medium:"中",high:"高",xhigh:"超高",max:"最大"},wt=z(()=>{var $;return($=s.status)==null?void 0:$.thinkingLevel}),x=z(()=>{const $=wt.value;return!$||$==="none"?"":ve[$]??$}),R=z(()=>s.models.length>0);function W(){return R.value?(Se.value=!0,!0):!1}function te(){R.value&&(Se.value=!Se.value)}function ee($){o("switch-model",$)}function Q($){o("switch-thinking",$)}const Z=z(()=>{switch(oe.value){case"auto":return"perm-auto";case"yolo":return"perm-yolo";default:return"perm-manual"}}),V=z(()=>{switch(oe.value){case"auto":return"自动";case"yolo":return"YOLO";default:return"手动"}});return($,E)=>(g(),v("div",{class:"composer",style:$t(D.value?{paddingBottom:D.value+"px"}:void 0)},[p.value?(g(),Oe(tv,{key:0,commands:h.value,"active-index":c.value,onSelect:m,onHover:E[0]||(E[0]=ae=>c.value=ae)},null,8,["commands","active-index"])):B("",!0),L(a).visible.value?(g(),Oe(km,{key:1,suggestions:L(a).suggestions.value,"active-index":L(a).index.value,loading:L(a).dirLoading.value,"work-dir":t.workDir,onSelect:E[1]||(E[1]=ae=>L(a).confirm(ae)),onHover:E[2]||(E[2]=ae=>L(a).index.value=ae)},null,8,["suggestions","active-index","loading","work-dir"])):B("",!0),_.value&&S.value.length>0?(g(),Oe(Pm,{key:2,items:S.value,"active-index":A.value,onApply:C,onHover:E[3]||(E[3]=ae=>A.value=ae)},null,8,["items","active-index"])):B("",!0),qe(f("textarea",{ref_key:"textareaRef",ref:r,"onUpdate:modelValue":E[4]||(E[4]=ae=>i.value=ae),id:"composer-input",name:"message",class:"composer-input",rows:"1",placeholder:fe.value,onKeydown:ze,onCompositionend:E[5]||(E[5]=ae=>et(b)?b.value=Date.now():b=Date.now()),onClick:F,onKeyup:F},null,40,nv),[[Xe,i.value]]),f("div",sv,[f("div",ov,[t.variant==="home"?(g(),v("button",{key:0,class:"quick-action",title:"插入 / 触发指令",onClick:E[6]||(E[6]=ae=>ie("/"))},[J(de,{name:"command",size:15}),E[10]||(E[10]=f("span",null,"技能",-1))])):(g(),v(X,{key:1},[f("button",{class:"quick-action",title:"插入 @ 提及",onClick:E[7]||(E[7]=ae=>ie("@"))},[J(de,{name:"at",size:15}),E[11]||(E[11]=f("span",null,"提及",-1))]),f("button",{class:"quick-action",title:"插入 / 触发指令",onClick:E[8]||(E[8]=ae=>ie("/"))},[J(de,{name:"command",size:15}),E[12]||(E[12]=f("span",null,"指令",-1))])],64)),oe.value?(g(),v("span",{key:2,class:le(["permission-label",Z.value]),title:`权限模式:${oe.value}`},M(V.value),11,iv)):B("",!0),y.value.length?(g(),v("span",rv,"已排队 "+M(y.value.length)+" 条",1)):B("",!0)]),f("div",lv,[q.value?(g(),v("button",{key:0,class:le(["model-select",{clickable:R.value}]),disabled:!R.value,title:t.variant==="home"?`当前模型:${q.value}`:`当前模型:${q.value}`,onClick:te},[J(de,{name:"brain",size:15}),f("span",null,M(t.variant==="home"?"通用智能体":q.value),1),t.variant!=="home"&&x.value?(g(),v(X,{key:0},[$e(" · "+M(x.value),1)],64)):B("",!0),R.value?(g(),Oe(de,{key:1,name:"chevron-down",size:12})):B("",!0)],10,av)):B("",!0),J(Xo,{name:"picker"},{default:bt(()=>[Se.value?(g(),Oe(Wm,{key:0,models:t.models,"current-model":q.value,"current-thinking":wt.value,onApplyModel:ee,onApplyThinking:Q,onClose:E[9]||(E[9]=ae=>Se.value=!1)},null,8,["models","current-model","current-thinking"])):B("",!0)]),_:1}),j.value!==void 0?(g(),v("span",cv,[J(xu,{usage:j.value,size:15},null,8,["usage"])])):B("",!0),t.busy?(g(),v("button",{key:2,class:"stop-btn",title:"停止当前回合",onClick:H},[J(de,{name:"stop",size:14}),E[13]||(E[13]=f("span",null,"停止",-1))])):(g(),v("button",{key:3,class:"send-btn",disabled:!i.value.trim(),title:"发送 (Enter)","aria-label":"发送",onClick:Ne},[J(de,{name:"arrow-up",size:16})],8,uv))])])],4))}}),Cu=we(dv,[["__scopeId","data-v-ffdf586f"]]),fv={class:"conv-bar"},hv={class:"conv-bar-left"},pv=["title"],gv=["title"],mv={key:1,class:"title-text"},vv={class:"conv-bar-right"},yv=["title","aria-label"],bv=["title","aria-label","aria-expanded"],kv={key:0,class:"stats-token mono"},wv=["title","aria-label"],Sv=ke({__name:"ConversationHeader",props:{title:{default:null},busy:{type:Boolean,default:!1},drawerOpen:{type:Boolean,default:!1},statsOpen:{type:Boolean,default:!1},turnTokens:{default:null}},emits:["home","rename","export","clear","toggle-drawer","toggle-stats"],setup(t,{emit:e}){const n=t,s=e;function o(d){return d===null||d<=0?"":d>=1e6?`${(d/1e6).toFixed(1)}M`:d>=1e3?`${(d/1e3).toFixed(1)}k`:String(d)}const i=O(!1),r=O("");function l(){r.value=n.title??"",i.value=!0}function a(){const d=r.value.trim();i.value=!1,d&&d!==n.title&&s("rename",d)}function c(d){d.key==="Enter"?(d.preventDefault(),a()):d.key==="Escape"&&(d.preventDefault(),i.value=!1)}const u=z(()=>n.busy?"运行中":"就绪");return(d,h)=>(g(),v("header",fv,[f("div",hv,[f("button",{class:"ghost-btn back-btn",title:"返回工作台","aria-label":"返回工作台",onClick:h[0]||(h[0]=p=>s("home"))},[J(de,{name:"chevron-left",size:20})]),f("span",{class:le(["status-dot",{busy:t.busy}]),title:u.value,"aria-hidden":"true"},null,10,pv),f("button",{class:"title-btn",title:i.value?"":"点击重命名",onClick:l},[i.value?qe((g(),v("input",{key:0,"onUpdate:modelValue":h[1]||(h[1]=p=>r.value=p),class:"title-input","aria-label":"会话标题",onKeydown:c,onBlur:a,onClick:h[2]||(h[2]=Ye(()=>{},["stop"]))},null,544)),[[Xe,r.value]]):(g(),v("span",mv,M(t.title||"新会话"),1))],8,gv)]),f("div",vv,[f("button",{class:"ghost-btn",title:"导出 Markdown","aria-label":"导出 Markdown",onClick:h[3]||(h[3]=p=>s("export"))},[J(de,{name:"download",size:18})]),f("button",{class:"ghost-btn",title:"清空本地消息","aria-label":"清空本地消息",onClick:h[4]||(h[4]=p=>s("clear"))},[J(de,{name:"broom",size:18})]),f("button",{class:le(["ghost-btn",{active:t.drawerOpen}]),title:t.drawerOpen?"收起详情":"会话详情","aria-label":t.drawerOpen?"收起详情":"会话详情",onClick:h[5]||(h[5]=p=>s("toggle-drawer"))},[J(de,{name:"panel-right",size:18})],10,yv),f("button",{class:le(["ghost-btn stats-btn",{active:t.statsOpen}]),title:t.statsOpen?"收起会话统计":"会话统计","aria-label":t.statsOpen?"收起会话统计":"会话统计","aria-expanded":t.statsOpen,onPointerdown:h[6]||(h[6]=Ye(()=>{},["stop"])),onClick:h[7]||(h[7]=p=>s("toggle-stats"))},[J(de,{name:"bar-chart",size:18}),o(t.turnTokens)?(g(),v("span",kv,M(o(t.turnTokens)),1)):B("",!0)],42,bv),f("button",{class:le(["ghost-btn",{active:L(be).panelOpen}]),title:L(be).panelOpen?"收起文件面板":"打开文件面板","aria-label":L(be).panelOpen?"收起文件面板":"打开文件面板",onClick:h[8]||(h[8]=(...p)=>L(ia)&&L(ia)(...p))},[J(de,{name:"file",size:18})],10,wv)])]))}}),_v=we(Sv,[["__scopeId","data-v-2090798b"]]),$v={key:0,class:"ui-dialog-header"},xv={class:"ui-dialog-title"},Cv={class:"ui-dialog-body"},Tv={key:1,class:"ui-dialog-footer"},Iv='a[href], button:not([disabled]), textarea, input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',Mv=ke({__name:"Dialog",props:{open:{type:Boolean},title:{default:void 0},closable:{type:Boolean,default:!0},maxWidth:{default:void 0}},emits:["close"],setup(t,{emit:e}){const n=t,s=e,o=O(null);let i=null;function r(){const a=o.value;return a?Array.from(a.querySelectorAll(Iv)).filter(c=>c.offsetParent!==null||c===document.activeElement):[]}function l(a){var p,m,y;if(!n.open)return;if(a.key==="Escape"&&n.closable!==!1){a.stopPropagation(),s("close");return}if(a.key!=="Tab")return;const c=r();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||!((m=o.value)!=null&&m.contains(h)))&&(a.preventDefault(),d.focus()):(h===d||!((y=o.value)!=null&&y.contains(h)))&&(a.preventDefault(),u.focus())}return xe(()=>n.open,a=>{a?(i=document.activeElement instanceof HTMLElement?document.activeElement:null,We(()=>{const c=r()[0]??o.value;c==null||c.focus()})):i&&(i.focus(),i=null)},{immediate:!1}),Ze(()=>window.addEventListener("keydown",l,!0)),ft(()=>window.removeEventListener("keydown",l,!0)),(a,c)=>(g(),Oe(Mr,{to:"body"},[J(Xo,{name:"dialog"},{default:bt(()=>[t.open?(g(),v("div",{key:0,class:"ui-dialog-overlay",onClick:c[1]||(c[1]=Ye(u=>t.closable!==!1&&s("close"),["self"]))},[f("div",{ref_key:"dialogRef",ref:o,class:"ui-dialog",style:$t(t.maxWidth?{maxWidth:t.maxWidth}:void 0),role:"dialog","aria-modal":"true",tabindex:"-1"},[t.title||a.$slots.header?(g(),v("div",$v,[eo(a.$slots,"header",{},()=>[f("span",xv,M(t.title),1)],!0),t.closable!==!1?(g(),v("button",{key:0,class:"ui-dialog-close","aria-label":"关闭",onClick:c[0]||(c[0]=u=>s("close"))},"✕")):B("",!0)])):B("",!0),f("div",Cv,[eo(a.$slots,"default",{},void 0,!0)]),a.$slots.footer?(g(),v("div",Tv,[eo(a.$slots,"footer",{},void 0,!0)])):B("",!0)],4)])):B("",!0)]),_:3})]))}}),Av=we(Mv,[["__scopeId","data-v-396acebf"]]),Rv={class:"info-row"},Pv={class:"info-val mono"},Ev={class:"info-row"},Lv={class:"info-val mono"},Ov={class:"info-row"},Dv={class:"info-val"},Nv={class:"info-row"},Bv={class:"info-val"},Gv={class:"info-row"},Fv={class:"info-val"},jv={class:"info-row"},Uv={class:"info-val"},zv={class:"info-row"},Hv={class:"info-val"},qv={class:"info-row"},Wv={class:"info-val"},Vv={class:"info-row"},Kv={class:"info-val"},Yv={class:"info-row"},Jv={class:"info-val"},Zv={key:0,class:"info-row"},Xv={class:"info-val"},Qv={key:1,class:"info-row"},ey={class:"info-val"},ty={class:"info-val mono"},ny={class:"info-val"},sy={key:3,class:"info-empty"},oy=ke({__name:"InfoPanel",props:{mode:{},status:{},sessionId:{},workDir:{}},emits:["close"],setup(t,{emit:e}){const n=t,s=e,o=z(()=>n.mode==="status"?"会话状态":"Token 用量");function i(p){switch(p){case"auto":return"自动 (auto)";case"yolo":return"YOLO";case"manual":return"手动 (manual)";default:return p??"-"}}function r(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(([m,y])=>({model:m,tokens:u(y),output:y.output,cacheRead:y.inputCacheRead})):[]}const h=z(()=>l(n.status.usage)||l(n.status.contextTokens));return(p,m)=>(g(),Oe(Av,{open:!0,title:o.value,onClose:m[0]||(m[0]=y=>s("close"))},{default:bt(()=>{var y,b;return[t.mode==="status"?(g(),v(X,{key:0},[f("div",Rv,[m[1]||(m[1]=f("span",{class:"info-key"},"会话 ID",-1)),f("span",Pv,M(t.sessionId??"-"),1)]),f("div",Ev,[m[2]||(m[2]=f("span",{class:"info-key"},"工作目录",-1)),f("span",Lv,M(t.workDir??"-"),1)]),f("div",Ov,[m[3]||(m[3]=f("span",{class:"info-key"},"模型",-1)),f("span",Dv,M(t.status.model??"-"),1)]),f("div",Nv,[m[4]||(m[4]=f("span",{class:"info-key"},"权限模式",-1)),f("span",Bv,M(i(t.status.permission)),1)]),f("div",Gv,[m[5]||(m[5]=f("span",{class:"info-key"},"思考级别",-1)),f("span",Fv,M(t.status.thinkingLevel??"-"),1)]),f("div",jv,[m[6]||(m[6]=f("span",{class:"info-key"},"计划模式",-1)),f("span",Uv,M(r(t.status.planMode)),1)]),f("div",zv,[m[7]||(m[7]=f("span",{class:"info-key"},"WolfPack 模式",-1)),f("span",Hv,M(r(t.status.wolfpackMode)),1)]),f("div",qv,[m[8]||(m[8]=f("span",{class:"info-key"},"上下文",-1)),f("span",Wv,M(a(t.status.contextTokens))+" / "+M(a(t.status.maxContextTokens))+" ("+M(c(t.status.contextUsage))+")",1)])],64)):(g(),v(X,{key:1},[f("div",Vv,[m[9]||(m[9]=f("span",{class:"info-key"},"上下文 Token",-1)),f("span",Kv,M(a(t.status.contextTokens))+" / "+M(a(t.status.maxContextTokens)),1)]),f("div",Yv,[m[10]||(m[10]=f("span",{class:"info-key"},"上下文占比",-1)),f("span",Jv,M(c(t.status.contextUsage)),1)]),(y=t.status.usage)!=null&&y.total?(g(),v("div",Zv,[m[11]||(m[11]=f("span",{class:"info-key"},"累计 Token",-1)),f("span",Xv,M(a(u(t.status.usage.total))),1)])):B("",!0),(b=t.status.usage)!=null&&b.currentTurn?(g(),v("div",Qv,[m[12]||(m[12]=f("span",{class:"info-key"},"当前回合",-1)),f("span",ey,M(a(u(t.status.usage.currentTurn))),1)])):B("",!0),d(t.status.usage).length?(g(),v(X,{key:2},[m[13]||(m[13]=f("div",{class:"info-subhead"},"按模型",-1)),(g(!0),v(X,null,Ce(d(t.status.usage),w=>(g(),v("div",{key:w.model,class:"info-row info-row-model"},[f("span",ty,M(w.model),1),f("span",ny,M(a(w.tokens))+"(输出 "+M(a(w.output))+" · 缓存读 "+M(a(w.cacheRead))+")",1)]))),128))],64)):B("",!0),h.value?B("",!0):(g(),v("div",sy,"暂无用量数据"))],64))]}),_:1},8,["title"]))}}),Tu=we(oy,[["__scopeId","data-v-1555711d"]]);function iy(t,e=Date.now()){const n=new Date(t),s=new Date(e),o=n.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()&&n.getDate()===s.getDate()?o:`${n.getFullYear()===s.getFullYear()?`${n.getMonth()+1}月${n.getDate()}日`:`${n.getFullYear()}年${n.getMonth()+1}月${n.getDate()}日`} ${o}`}function ry(t,e){const n=new Date(t),s=new Date(e);return n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()&&n.getDate()===s.getDate()}function ly(t,e=Date.now()){const n=new Date(t),s=new Date(e);return n.getFullYear()===s.getFullYear()?`${n.getMonth()+1}月${n.getDate()}日`:`${n.getFullYear()}年${n.getMonth()+1}月${n.getDate()}日`}const ay=new Set(["edit","str_replace","replace","write","multi_edit","create_file","edit_file","apply_patch"]);function Iu(t){return ay.has(t.toLowerCase())}function ti(t,e=!0){return t.suspended?"suspended":t.isError?"error":t.output===void 0?e?"running":"unknown":"ok"}function cy(t,e=!0){const n=new Set(t.map(s=>ti(s,e)));return n.has("running")?"running":n.has("error")?"error":n.has("suspended")?"suspended":n.has("unknown")?"unknown":"ok"}function uy(t){if(!t||typeof t!="object")return null;const e=t,n=e.file_path??e.path;return typeof n=="string"&&n.length>0?n:null}function Br(t,e){if(t.startsWith("/")||t.startsWith("~"))return t;let n=t;for(;n.startsWith("./");)n=n.slice(2);return e?`${e.replace(/\/+$/,"")}/${n}`:n}function dy(t,e){const n=new Set,s=[];for(const o of t.tools){if(!Iu(o.name)||ti(o,!1)!=="ok")continue;const i=uy(o.args);if(!i)continue;const r=Br(i,e);n.has(r)||(n.add(r),s.push({filePath:r,toolName:o.name}))}return s}function Gr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Bn=Gr();function Mu(t){Bn=t}var ks={exec:()=>null};function Le(t,e=""){let n=typeof t=="string"?t:t.source;const s={replace:(o,i)=>{let r=typeof i=="string"?i:i.source;return r=r.replace(vt.caret,"$1"),n=n.replace(o,r),s},getRegex:()=>new RegExp(n,e)};return s}var vt={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:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},fy=/^(?:[ \t]*(?:\n|$))+/,hy=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,py=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Gs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,gy=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Fr=/(?:[*+-]|\d{1,9}[.)])/,Au=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ru=Le(Au).replace(/bull/g,Fr).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(),my=Le(Au).replace(/bull/g,Fr).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(),jr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,vy=/^[^\n]+/,Ur=/(?!\s*\])(?:\\.|[^\[\]\\])+/,yy=Le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ur).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),by=Le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Fr).getRegex(),ni="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",zr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ky=Le("^ {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",zr).replace("tag",ni).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Pu=Le(jr).replace("hr",Gs).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",ni).getRegex(),wy=Le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Pu).getRegex(),Hr={blockquote:wy,code:hy,def:yy,fences:py,heading:gy,hr:Gs,html:ky,lheading:Ru,list:by,newline:fy,paragraph:Pu,table:ks,text:vy},ca=Le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Gs).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",ni).getRegex(),Sy={...Hr,lheading:my,table:ca,paragraph:Le(jr).replace("hr",Gs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ca).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",ni).getRegex()},_y={...Hr,html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zr).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:ks,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Le(jr).replace("hr",Gs).replace("heading",` *#{1,6} *[^
|
|
20
|
+
]`).replace("lheading",Ru).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},$y=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xy=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Eu=/^( {2,}|\\)\n(?!\s*$)/,Cy=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,si=/[\p{P}\p{S}]/u,qr=/[\s\p{P}\p{S}]/u,Lu=/[^\s\p{P}\p{S}]/u,Ty=Le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,qr).getRegex(),Ou=/(?!~)[\p{P}\p{S}]/u,Iy=/(?!~)[\s\p{P}\p{S}]/u,My=/(?:[^\s\p{P}\p{S}]|~)/u,Ay=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Du=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ry=Le(Du,"u").replace(/punct/g,si).getRegex(),Py=Le(Du,"u").replace(/punct/g,Ou).getRegex(),Nu="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ey=Le(Nu,"gu").replace(/notPunctSpace/g,Lu).replace(/punctSpace/g,qr).replace(/punct/g,si).getRegex(),Ly=Le(Nu,"gu").replace(/notPunctSpace/g,My).replace(/punctSpace/g,Iy).replace(/punct/g,Ou).getRegex(),Oy=Le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Lu).replace(/punctSpace/g,qr).replace(/punct/g,si).getRegex(),Dy=Le(/\\(punct)/,"gu").replace(/punct/g,si).getRegex(),Ny=Le(/^<(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(),By=Le(zr).replace("(?:-->|$)","-->").getRegex(),Gy=Le("^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",By).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_o=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Fy=Le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",_o).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Bu=Le(/^!?\[(label)\]\[(ref)\]/).replace("label",_o).replace("ref",Ur).getRegex(),Gu=Le(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ur).getRegex(),jy=Le("reflink|nolink(?!\\()","g").replace("reflink",Bu).replace("nolink",Gu).getRegex(),Wr={_backpedal:ks,anyPunctuation:Dy,autolink:Ny,blockSkip:Ay,br:Eu,code:xy,del:ks,emStrongLDelim:Ry,emStrongRDelimAst:Ey,emStrongRDelimUnd:Oy,escape:$y,link:Fy,nolink:Gu,punctuation:Ty,reflink:Bu,reflinkSearch:jy,tag:Gy,text:Cy,url:ks},Uy={...Wr,link:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",_o).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_o).getRegex()},nr={...Wr,emStrongRDelimAst:Ly,emStrongLDelim:Py,url:Le(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},zy={...nr,br:Le(Eu).replace("{2,}","*").getRegex(),text:Le(nr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ws={normal:Hr,gfm:Sy,pedantic:_y},ls={normal:Wr,gfm:nr,breaks:zy,pedantic:Uy},Hy={"&":"&","<":"<",">":">",'"':""","'":"'"},ua=t=>Hy[t];function Ut(t,e){if(e){if(vt.escapeTest.test(t))return t.replace(vt.escapeReplace,ua)}else if(vt.escapeTestNoEncode.test(t))return t.replace(vt.escapeReplaceNoEncode,ua);return t}function da(t){try{t=encodeURI(t).replace(vt.percentDecode,"%")}catch{return null}return t}function fa(t,e){var i;const n=t.replace(vt.findPipe,(r,l,a)=>{let c=!1,u=l;for(;--u>=0&&a[u]==="\\";)c=!c;return c?"|":" |"}),s=n.split(vt.splitPipe);let o=0;if(s[0].trim()||s.shift(),s.length>0&&!((i=s.at(-1))!=null&&i.trim())&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;o<s.length;o++)s[o]=s[o].trim().replace(vt.slashPipe,"|");return s}function as(t,e,n){const s=t.length;if(s===0)return"";let o=0;for(;o<s&&t.charAt(s-o-1)===e;)o++;return t.slice(0,s-o)}function qy(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function ha(t,e,n,s,o){const i=e.href,r=e.title||null,l=t[1].replace(o.other.outputLinkReplace,"$1");s.state.inLink=!0;const a={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:r,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,a}function Wy(t,e,n){const s=t.match(n.other.indentCodeCompensation);if(s===null)return e;const o=s[1];return e.split(`
|
|
21
|
+
`).map(i=>{const r=i.match(n.other.beginningSpace);if(r===null)return i;const[l]=r;return l.length>=o.length?i.slice(o.length):i}).join(`
|
|
22
|
+
`)}var $o=class{constructor(t){U(this,"options");U(this,"rules");U(this,"lexer");this.options=t||Bn}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:as(n,`
|
|
23
|
+
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],s=Wy(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){const s=as(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:as(e[0],`
|
|
24
|
+
`)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=as(e[0],`
|
|
25
|
+
`).split(`
|
|
26
|
+
`),s="",o="";const i=[];for(;n.length>0;){let r=!1;const l=[];let a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))l.push(n[a]),r=!0;else if(!r)l.push(n[a]);else break;n=n.slice(a);const c=l.join(`
|
|
27
|
+
`),u=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
28
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
29
|
+
${c}`:c,o=o?`${o}
|
|
30
|
+
${u}`:u;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=d,n.length===0)break;const h=i.at(-1);if((h==null?void 0:h.type)==="code")break;if((h==null?void 0:h.type)==="blockquote"){const p=h,m=p.raw+`
|
|
31
|
+
`+n.join(`
|
|
32
|
+
`),y=this.blockquote(m);i[i.length-1]=y,s=s.substring(0,s.length-p.raw.length)+y.raw,o=o.substring(0,o.length-p.text.length)+y.text;break}else if((h==null?void 0:h.type)==="list"){const p=h,m=p.raw+`
|
|
33
|
+
`+n.join(`
|
|
34
|
+
`),y=this.list(m);i[i.length-1]=y,s=s.substring(0,s.length-h.raw.length)+y.raw,o=o.substring(0,o.length-p.raw.length)+y.raw,n=m.substring(i.at(-1).raw.length).split(`
|
|
35
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:o}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[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 i=this.rules.other.listItemRegex(n);let r=!1;for(;t;){let a=!1,c="",u="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let d=e[2].split(`
|
|
36
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,w=>" ".repeat(3*w.length)),h=t.split(`
|
|
37
|
+
`,1)[0],p=!d.trim(),m=0;if(this.options.pedantic?(m=2,u=d.trimStart()):p?m=e[1].length+1:(m=e[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=d.slice(m),m+=e[1].length),p&&this.rules.other.blankLine.test(h)&&(c+=h+`
|
|
38
|
+
`,t=t.substring(h.length+1),a=!0),!a){const w=this.rules.other.nextBulletRegex(m),S=this.rules.other.hrRegex(m),_=this.rules.other.fencesBeginRegex(m),A=this.rules.other.headingBeginRegex(m),Y=this.rules.other.htmlBeginRegex(m);for(;t;){const G=t.split(`
|
|
39
|
+
`,1)[0];let I;if(h=G,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),I=h):I=h.replace(this.rules.other.tabCharGlobal," "),_.test(h)||A.test(h)||Y.test(h)||w.test(h)||S.test(h))break;if(I.search(this.rules.other.nonSpaceChar)>=m||!h.trim())u+=`
|
|
40
|
+
`+I.slice(m);else{if(p||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(d)||A.test(d)||S.test(d))break;u+=`
|
|
41
|
+
`+h}!p&&!h.trim()&&(p=!0),c+=G+`
|
|
42
|
+
`,t=t.substring(G.length+1),d=I.slice(m)}}o.loose||(r?o.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(r=!0));let y=null,b;this.options.gfm&&(y=this.rules.other.listIsTask.exec(u),y&&(b=y[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:c,task:!!y,checked:b,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(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:s,title:o}}}table(t){var r;const e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const n=fa(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(r=e[3])!=null&&r.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
43
|
+
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<n.length;l++)i.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:i.align[l]});for(const l of o)i.rows.push(fa(l,i.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[c]})));return i}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const n=e[1].charAt(e[1].length-1)===`
|
|
44
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const i=as(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=qy(e[2],"()");if(i===-2)return;if(i>-1){const l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let s=e[2],o="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],o=i[3])}else o=e[3]?e[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)),ha(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=e[s.toLowerCase()];if(!o){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return ha(n,o,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const i=[...s[0]].length-1;let r,l,a=i,c=0;const u=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+i);(s=u.exec(e))!=null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(l=[...r].length,s[3]||s[4]){a+=l;continue}else if((s[5]||s[6])&&i%3&&!((i+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=t.slice(0,i+s.index+d+l);if(Math.min(i,l)%2){const m=h.slice(1,-1);return{type:"em",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}const p=h.slice(2,-2);return{type:"strong",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let n=e[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:e[0],text:n}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let e;if(e=this.rules.inline.url.exec(t)){let s,o;if(e[2]==="@")s=e[0],o="mailto:"+s;else{let i;do i=e[0],e[0]=((n=this.rules.inline._backpedal.exec(e[0]))==null?void 0:n[0])??"";while(i!==e[0]);s=e[0],e[1]==="www."?o="http://"+e[0]:o=e[0]}return{type:"link",raw:e[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},tn=class sr{constructor(e){U(this,"tokens");U(this,"options");U(this,"state");U(this,"tokenizer");U(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Bn,this.options.tokenizer=this.options.tokenizer||new $o,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:vt,block:Ws.normal,inline:ls.normal};this.options.pedantic?(n.block=Ws.pedantic,n.inline=ls.pedantic):this.options.gfm&&(n.block=Ws.gfm,this.options.breaks?n.inline=ls.breaks:n.inline=ls.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ws,inline:ls}}static lex(e,n){return new sr(n).lex(e)}static lexInline(e,n){return new sr(n).inlineTokens(e)}lex(e){e=e.replace(vt.carriageReturn,`
|
|
45
|
+
`),this.blockTokens(e,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(e,n=[],s=!1){var o,i,r;for(this.options.pedantic&&(e=e.replace(vt.tabCharGlobal," ").replace(vt.spaceLine,""));e;){let l;if((i=(o=this.options.extensions)==null?void 0:o.block)!=null&&i.some(c=>(l=c.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);const c=n.at(-1);l.raw.length===1&&c!==void 0?c.raw+=`
|
|
46
|
+
`:n.push(l);continue}if(l=this.tokenizer.code(e)){e=e.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+=`
|
|
47
|
+
`+l.raw,c.text+=`
|
|
48
|
+
`+l.text,this.inlineQueue.at(-1).src=c.text):n.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.def(e)){e=e.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.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(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),n.push(l);continue}let a=e;if((r=this.options.extensions)!=null&&r.startBlock){let c=1/0;const u=e.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=e.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+=`
|
|
51
|
+
`+l.raw,c.text+=`
|
|
52
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(l),s=a.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);const c=n.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
53
|
+
`+l.raw,c.text+=`
|
|
54
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(l);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var l,a,c;let s=e,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 i=!1,r="";for(;e;){i||(r=""),i=!1;let u;if((a=(l=this.options.extensions)==null?void 0:l.inline)!=null&&a.some(h=>(u=h.call({lexer:this},e,n))?(e=e.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(e,this.tokens.links)){e=e.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(e,s,r)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(e)){e=e.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(e))){e=e.substring(u.raw.length),n.push(u);continue}let d=e;if((c=this.options.extensions)!=null&&c.startInline){let h=1/0;const p=e.slice(1);let m;this.options.extensions.startInline.forEach(y=>{m=y.call({lexer:this},p),typeof m=="number"&&m>=0&&(h=Math.min(h,m))}),h<1/0&&h>=0&&(d=e.substring(0,h+1))}if(u=this.tokenizer.inlineText(d)){e=e.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(r=u.raw.slice(-1)),i=!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(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}},xo=class{constructor(t){U(this,"options");U(this,"parser");this.options=t||Bn}space(t){return""}code({text:t,lang:e,escaped:n}){var i;const s=(i=(e||"").match(vt.notSpaceStart))==null?void 0:i[0],o=t.replace(vt.endingNewline,"")+`
|
|
55
|
+
`;return s?'<pre><code class="language-'+Ut(s)+'">'+(n?o:Ut(o,!0))+`</code></pre>
|
|
56
|
+
`:"<pre><code>"+(n?o:Ut(o,!0))+`</code></pre>
|
|
57
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
58
|
+
${this.parser.parse(t)}</blockquote>
|
|
59
|
+
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
60
|
+
`}hr(t){return`<hr>
|
|
61
|
+
`}list(t){const e=t.ordered,n=t.start;let s="";for(let r=0;r<t.items.length;r++){const l=t.items[r];s+=this.listitem(l)}const o=e?"ol":"ul",i=e&&n!==1?' start="'+n+'"':"";return"<"+o+i+`>
|
|
62
|
+
`+s+"</"+o+`>
|
|
63
|
+
`}listitem(t){var n;let e="";if(t.task){const s=this.checkbox({checked:!!t.checked});t.loose?((n=t.tokens[0])==null?void 0:n.type)==="paragraph"?(t.tokens[0].text=s+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=s+" "+Ut(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:s+" ",text:s+" ",escaped:!0}):e+=s+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
|
|
64
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
65
|
+
`}table(t){let e="",n="";for(let o=0;o<t.header.length;o++)n+=this.tablecell(t.header[o]);e+=this.tablerow({text:n});let s="";for(let o=0;o<t.rows.length;o++){const i=t.rows[o];n="";for(let r=0;r<i.length;r++)n+=this.tablecell(i[r]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
66
|
+
<thead>
|
|
67
|
+
`+e+`</thead>
|
|
68
|
+
`+s+`</table>
|
|
69
|
+
`}tablerow({text:t}){return`<tr>
|
|
70
|
+
${t}</tr>
|
|
71
|
+
`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
72
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ut(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n),o=da(t);if(o===null)return s;t=o;let i='<a href="'+t+'"';return e&&(i+=' title="'+Ut(e)+'"'),i+=">"+s+"</a>",i}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));const o=da(t);if(o===null)return Ut(n);t=o;let i=`<img src="${t}" alt="${n}"`;return e&&(i+=` title="${Ut(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ut(t.text)}},Vr=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},nn=class or{constructor(e){U(this,"options");U(this,"renderer");U(this,"textRenderer");this.options=e||Bn,this.options.renderer=this.options.renderer||new xo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Vr}static parse(e,n){return new or(n).parse(e)}static parseInline(e,n){return new or(n).parseInline(e)}parse(e,n=!0){var o,i;let s="";for(let r=0;r<e.length;r++){const l=e[r];if((i=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&i[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(;r+1<e.length&&e[r+1].type==="text";)c=e[++r],u+=`
|
|
73
|
+
`+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(e,n=this.renderer){var o,i;let s="";for(let r=0;r<e.length;r++){const l=e[r];if((i=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&i[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}},Ni,io=(Ni=class{constructor(t){U(this,"options");U(this,"block");this.options=t||Bn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?tn.lex:tn.lexInline}provideParser(){return this.block?nn.parse:nn.parseInline}},U(Ni,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Ni),Vy=class{constructor(...t){U(this,"defaults",Gr());U(this,"options",this.setOptions);U(this,"parse",this.parseMarkdown(!0));U(this,"parseInline",this.parseMarkdown(!1));U(this,"Parser",nn);U(this,"Renderer",xo);U(this,"TextRenderer",Vr);U(this,"Lexer",tn);U(this,"Tokenizer",$o);U(this,"Hooks",io);this.use(...t)}walkTokens(t,e){var s,o;let n=[];for(const i of t)switch(n=n.concat(e.call(this,i)),i.type){case"table":{const r=i;for(const l of r.header)n=n.concat(this.walkTokens(l.tokens,e));for(const l of r.rows)for(const a of l)n=n.concat(this.walkTokens(a.tokens,e));break}case"list":{const r=i;n=n.concat(this.walkTokens(r.items,e));break}default:{const r=i;(o=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&o[r.type]?this.defaults.extensions.childTokens[r.type].forEach(l=>{const a=r[l].flat(1/0);n=n.concat(this.walkTokens(a,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.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 i=e.renderers[o.name];i?e.renderers[o.name]=function(...r){let l=o.renderer.apply(this,r);return l===!1&&(l=i.apply(this,r)),l}:e.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 i=e[o.level];i?i.unshift(o.tokenizer):e[o.level]=[o.tokenizer],o.start&&(o.level==="block"?e.startBlock?e.startBlock.push(o.start):e.startBlock=[o.start]:o.level==="inline"&&(e.startInline?e.startInline.push(o.start):e.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(e.childTokens[o.name]=o.childTokens)}),s.extensions=e),n.renderer){const o=this.defaults.renderer||new xo(this.defaults);for(const i in n.renderer){if(!(i in o))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const r=i,l=n.renderer[r],a=o[r];o[r]=(...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 $o(this.defaults);for(const i in n.tokenizer){if(!(i in o))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const r=i,l=n.tokenizer[r],a=o[r];o[r]=(...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 io;for(const i in n.hooks){if(!(i in o))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const r=i,l=n.hooks[r],a=o[r];io.passThroughHooks.has(i)?o[r]=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[r]=(...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,i=n.walkTokens;s.walkTokens=function(r){let l=[];return l.push(i.call(this,r)),o&&(l=l.concat(o.call(this,r))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return tn.lex(t,e??this.defaults)}parser(t,e){return nn.parse(t,e??this.defaults)}parseMarkdown(t){return(n,s)=>{const o={...s},i={...this.defaults,...o},r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&o.async===!1)return r(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 r(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);const l=i.hooks?i.hooks.provideLexer():t?tn.lex:tn.lexInline,a=i.hooks?i.hooks.provideParser():t?nn.parse:nn.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(c=>l(c,i)).then(c=>i.hooks?i.hooks.processAllTokens(c):c).then(c=>i.walkTokens?Promise.all(this.walkTokens(c,i.walkTokens)).then(()=>c):c).then(c=>a(c,i)).then(c=>i.hooks?i.hooks.postprocess(c):c).catch(r);try{i.hooks&&(n=i.hooks.preprocess(n));let c=l(n,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let u=a(c,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(c){return r(c)}}}onError(t,e){return n=>{if(n.message+=`
|
|
74
|
+
Please report this to https://github.com/markedjs/marked.`,t){const s="<p>An error occurred:</p><pre>"+Ut(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Nn=new Vy;function Pe(t,e){return Nn.parse(t,e)}Pe.options=Pe.setOptions=function(t){return Nn.setOptions(t),Pe.defaults=Nn.defaults,Mu(Pe.defaults),Pe};Pe.getDefaults=Gr;Pe.defaults=Bn;Pe.use=function(...t){return Nn.use(...t),Pe.defaults=Nn.defaults,Mu(Pe.defaults),Pe};Pe.walkTokens=function(t,e){return Nn.walkTokens(t,e)};Pe.parseInline=Nn.parseInline;Pe.Parser=nn;Pe.parser=nn.parse;Pe.Renderer=xo;Pe.TextRenderer=Vr;Pe.Lexer=tn;Pe.lexer=tn.lex;Pe.Tokenizer=$o;Pe.Hooks=io;Pe.parse=Pe;Pe.options;Pe.setOptions;Pe.use;Pe.walkTokens;Pe.parseInline;nn.parse;tn.lex;const Ky="modulepreload",Yy=function(t,e){return new URL(t,e).href},pa={},Vs=function(e,n,s){let o=Promise.resolve();if(n&&n.length>0){let r=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=r(n.map(u=>{if(u=Yy(u,s),u in pa)return;pa[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!s)for(let y=l.length-1;y>=0;y--){const b=l[y];if(b.href===u&&(!d||b.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":Ky,d||(m.as="script"),m.crossOrigin="",m.href=u,c&&m.setAttribute("nonce",c),document.head.appendChild(m),d)return new Promise((y,b)=>{m.addEventListener("load",y),m.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})};let st=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Jy(t){return Kr(t)}function Kr(t){return Array.isArray(t)?Zy(t):t instanceof RegExp?t:typeof t=="object"?Xy(t):t}function Zy(t){let e=[];for(let n=0,s=t.length;n<s;n++)e[n]=Kr(t[n]);return e}function Xy(t){let e={};for(let n in t)e[n]=Kr(t[n]);return e}function Fu(t,...e){return e.forEach(n=>{for(let s in n)t[s]=n[s]}),t}function ju(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?ju(t.substring(0,t.length-1)):t.substr(~e+1)}var Si=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ks=class{static hasCaptures(t){return t===null?!1:(Si.lastIndex=0,Si.test(t))}static replaceCaptures(t,e,n){return t.replace(Si,(s,o,i,r)=>{let l=n[parseInt(o||i,10)];if(l){let a=e.substring(l.start,l.end);for(;a[0]===".";)a=a.substring(1);switch(r){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return s})}};function Uu(t,e){return t<e?-1:t>e?1:0}function zu(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,s=e.length;if(n===s){for(let o=0;o<n;o++){let i=Uu(t[o],e[o]);if(i!==0)return i}return 0}return n-s}function ga(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Hu(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var qu=class{constructor(t){U(this,"cache",new Map);this.fn=t}get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Co=class{constructor(t,e,n){U(this,"_cachedMatchRoot",new qu(t=>this._root.match(t)));this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(tb(t),e)}static createFromParsedTheme(t,e){return sb(t,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,s=this._cachedMatchRoot.get(e).find(o=>Qy(t.parent,o.parentScopes));return s?new Wu(s.fontStyle,s.foreground,s.background):null}},_i=class ro{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const s of n)e=new ro(e,s);return e}static from(...e){let n=null;for(let s=0;s<e.length;s++)n=new ro(n,e[s]);return n}push(e){return new ro(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let s=this;for(;s&&s!==e;)n.push(s.scopeName),s=s.parent;return s===e?n.reverse():void 0}};function Qy(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let s=e[n],o=!1;if(s===">"){if(n===e.length-1)return!1;s=e[++n],o=!0}for(;t&&!eb(t.scopeName,s);){if(o)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function eb(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Wu=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function tb(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],s=0;for(let o=0,i=e.length;o<i;o++){let r=e[o];if(!r.settings)continue;let l;if(typeof r.scope=="string"){let d=r.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),l=d.split(",")}else Array.isArray(r.scope)?l=r.scope:l=[""];let a=-1;if(typeof r.settings.fontStyle=="string"){a=0;let d=r.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 r.settings.foreground=="string"&&ga(r.settings.foreground)&&(c=r.settings.foreground);let u=null;typeof r.settings.background=="string"&&ga(r.settings.background)&&(u=r.settings.background);for(let d=0,h=l.length;d<h;d++){let m=l[d].trim().split(" "),y=m[m.length-1],b=null;m.length>1&&(b=m.slice(0,m.length-1),b.reverse()),n[s++]=new nb(y,b,o,a,c,u)}}return n}var nb=class{constructor(t,e,n,s,o,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=s,this.foreground=o,this.background=i}},dt=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(dt||{});function sb(t,e){t.sort((a,c)=>{let u=Uu(a.scope,c.scope);return u!==0||(u=zu(a.parentScopes,c.parentScopes),u!==0)?u:a.index-c.index});let n=0,s="#000000",o="#ffffff";for(;t.length>=1&&t[0].scope==="";){let a=t.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(s=a.foreground),a.background!==null&&(o=a.background)}let i=new ob(e),r=new Wu(n,i.getId(s),i.getId(o)),l=new rb(new ir(0,null,-1,0,0),[]);for(let a=0,c=t.length;a<c;a++){let u=t[a];l.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new Co(i,r,l)}var ob=class{constructor(t){U(this,"_isFrozen");U(this,"_lastColorId");U(this,"_id2color");U(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},ib=Object.freeze([]),ir=class Vu{constructor(e,n,s,o,i){U(this,"scopeDepth");U(this,"parentScopes");U(this,"fontStyle");U(this,"foreground");U(this,"background");this.scopeDepth=e,this.parentScopes=n||ib,this.fontStyle=s,this.foreground=o,this.background=i}clone(){return new Vu(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let s=0,o=e.length;s<o;s++)n[s]=e[s].clone();return n}acceptOverwrite(e,n,s,o){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),o!==0&&(this.background=o)}},rb=class rr{constructor(e,n=[],s={}){U(this,"_rulesWithParentScopes");this._mainRule=e,this._children=s,this._rulesWithParentScopes=n}static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let s=0,o=0;for(;e.parentScopes[s]===">"&&s++,n.parentScopes[o]===">"&&o++,!(s>=e.parentScopes.length||o>=n.parentScopes.length);){const i=n.parentScopes[o].length-e.parentScopes[s].length;if(i!==0)return i;s++,o++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let s=e.indexOf("."),o,i;if(s===-1?(o=e,i=""):(o=e.substring(0,s),i=e.substring(s+1)),this._children.hasOwnProperty(o))return this._children[o].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(rr._cmpBySpecificity),n}insert(e,n,s,o,i,r){if(n===""){this._doInsertHere(e,s,o,i,r);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 rr(this._mainRule.clone(),ir.cloneArr(this._rulesWithParentScopes)),this._children[a]=u),u.insert(e+1,c,s,o,i,r)}_doInsertHere(e,n,s,o,i){if(n===null){this._mainRule.acceptOverwrite(e,s,o,i);return}for(let r=0,l=this._rulesWithParentScopes.length;r<l;r++){let a=this._rulesWithParentScopes[r];if(zu(a.parentScopes,n)===0){a.acceptOverwrite(e,s,o,i);return}}s===-1&&(s=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new ir(e,n,s,o,i))}},Qn=class Ct{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=Ct.getLanguageId(e),s=Ct.getTokenType(e),o=Ct.getFontStyle(e),i=Ct.getForeground(e),r=Ct.getBackground(e);console.log({languageId:n,tokenType:s,fontStyle:o,foreground:i,background:r})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,s,o,i,r,l){let a=Ct.getLanguageId(e),c=Ct.getTokenType(e),u=Ct.containsBalancedBrackets(e)?1:0,d=Ct.getFontStyle(e),h=Ct.getForeground(e),p=Ct.getBackground(e);return n!==0&&(a=n),s!==8&&(c=s),o!==null&&(u=o?1:0),i!==-1&&(d=i),r!==0&&(h=r),l!==0&&(p=l),(a<<0|c<<8|u<<10|d<<11|h<<15|p<<24)>>>0}};function To(t,e){const n=[],s=lb(t);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=r();if(n.push({matcher:c,priority:a}),o!==",")break;o=s.next()}return n;function i(){if(o==="-"){o=s.next();const a=i();return c=>!!a&&!a(c)}if(o==="("){o=s.next();const a=l();return o===")"&&(o=s.next()),a}if(ma(o)){const a=[];do a.push(o),o=s.next();while(ma(o));return c=>e(a,c)}return null}function r(){const a=[];let c=i();for(;c;)a.push(c),c=i();return u=>a.every(d=>d(u))}function l(){const a=[];let c=r();for(;c&&(a.push(c),o==="|"||o===",");){do o=s.next();while(o==="|"||o===",");c=r()}return u=>a.some(d=>d(u))}}function ma(t){return!!t&&!!t.match(/[\w\.:]+/)}function lb(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const s=n[0];return n=e.exec(t),s}}}function Ku(t){typeof t.dispose=="function"&&t.dispose()}var Rs=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},ab=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},cb=class{constructor(){U(this,"_references",[]);U(this,"_seenReferenceKeys",new Set);U(this,"visitedRule",new Set)}get references(){return this._references}add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},ub=class{constructor(t,e){U(this,"seenFullScopeRequests",new Set);U(this,"seenPartialScopeRequests",new Set);U(this,"Q");this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Rs(this.initialScopeName)]}processQueue(){const t=this.Q;this.Q=[];const e=new cb;for(const n of t)db(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof Rs){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 db(t,e,n,s){const o=n.lookup(t.scopeName);if(!o){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof Rs?lo({baseGrammar:i,selfGrammar:o},s):lr(t.ruleName,{baseGrammar:i,selfGrammar:o,repository:o.repository},s);const r=n.injections(t.scopeName);if(r)for(const l of r)s.add(new Rs(l))}function lr(t,e,n){if(e.repository&&e.repository[t]){const s=e.repository[t];Io([s],e,n)}}function lo(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Io(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Io(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Io(t,e,n){for(const s of t){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const o=s.repository?Fu({},e.repository,s.repository):e.repository;Array.isArray(s.patterns)&&Io(s.patterns,{...e,repository:o},n);const i=s.include;if(!i)continue;const r=Yu(i);switch(r.kind){case 0:lo({...e,selfGrammar:e.baseGrammar},n);break;case 1:lo(e,n);break;case 2:lr(r.ruleName,{...e,repository:o},n);break;case 3:case 4:const l=r.scopeName===e.selfGrammar.scopeName?e.selfGrammar:r.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(l){const a={baseGrammar:e.baseGrammar,selfGrammar:l,repository:o};r.kind===4?lr(r.ruleName,a,n):lo(a,n)}else r.kind===4?n.add(new ab(r.scopeName,r.ruleName)):n.add(new Rs(r.scopeName));break}}}var fb=class{constructor(){U(this,"kind",0)}},hb=class{constructor(){U(this,"kind",1)}},pb=class{constructor(t){U(this,"kind",2);this.ruleName=t}},gb=class{constructor(t){U(this,"kind",3);this.scopeName=t}},mb=class{constructor(t,e){U(this,"kind",4);this.scopeName=t,this.ruleName=e}};function Yu(t){if(t==="$base")return new fb;if(t==="$self")return new hb;const e=t.indexOf("#");if(e===-1)return new gb(t);if(e===0)return new pb(t.substring(1));{const n=t.substring(0,e),s=t.substring(e+1);return new mb(n,s)}}var vb=/\\(\d+)/,va=/\\(\d+)/g,yb=-1,Ju=-2;var Fs=class{constructor(t,e,n,s){U(this,"$location");U(this,"id");U(this,"_nameIsCapturing");U(this,"_name");U(this,"_contentNameIsCapturing");U(this,"_contentName");this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=Ks.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=Ks.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${ju(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Ks.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ks.replaceCaptures(this._contentName,t,e)}},bb=class extends Fs{constructor(e,n,s,o,i){super(e,n,s,o);U(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,n){throw new Error("Not supported!")}compile(e,n){throw new Error("Not supported!")}compileAG(e,n,s,o){throw new Error("Not supported!")}},kb=class extends Fs{constructor(e,n,s,o,i){super(e,n,s,null);U(this,"_match");U(this,"captures");U(this,"_cachedCompiledPatterns");this._match=new Ps(o,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,n){n.push(this._match)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,s,o){return this._getCachedCompiledPatterns(e).compileAG(e,s,o)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Es,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ya=class extends Fs{constructor(e,n,s,o,i){super(e,n,s,o);U(this,"hasMissingPatterns");U(this,"patterns");U(this,"_cachedCompiledPatterns");this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,n){for(const s of this.patterns)e.getRule(s).collectPatterns(e,n)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,s,o){return this._getCachedCompiledPatterns(e).compileAG(e,s,o)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Es,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ar=class extends Fs{constructor(e,n,s,o,i,r,l,a,c,u){super(e,n,s,o);U(this,"_begin");U(this,"beginCaptures");U(this,"_end");U(this,"endHasBackReferences");U(this,"endCaptures");U(this,"applyEndPatternLast");U(this,"hasMissingPatterns");U(this,"patterns");U(this,"_cachedCompiledPatterns");this._begin=new Ps(i,this.id),this.beginCaptures=r,this._end=new Ps(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(e,n){return this._end.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e,n).compile(e)}compileAG(e,n,s,o){return this._getCachedCompiledPatterns(e,n).compileAG(e,s,o)}_getCachedCompiledPatterns(e,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Es;for(const s of this.patterns)e.getRule(s).collectPatterns(e,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}},Mo=class extends Fs{constructor(e,n,s,o,i,r,l,a,c){super(e,n,s,o);U(this,"_begin");U(this,"beginCaptures");U(this,"whileCaptures");U(this,"_while");U(this,"whileHasBackReferences");U(this,"hasMissingPatterns");U(this,"patterns");U(this,"_cachedCompiledPatterns");U(this,"_cachedCompiledWhilePatterns");this._begin=new Ps(i,this.id),this.beginCaptures=r,this.whileCaptures=a,this._while=new Ps(l,Ju),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(e,n){return this._while.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,s,o){return this._getCachedCompiledPatterns(e).compileAG(e,s,o)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Es;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,n){return this._getCachedCompiledWhilePatterns(e,n).compile(e)}compileWhileAG(e,n,s,o){return this._getCachedCompiledWhilePatterns(e,n).compileAG(e,s,o)}_getCachedCompiledWhilePatterns(e,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Es,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},Zu=class lt{static createCaptureRule(e,n,s,o,i){return e.registerRule(r=>new bb(n,r,s,o,i))}static getCompiledRuleId(e,n,s){return e.id||n.registerRule(o=>{if(e.id=o,e.match)return new kb(e.$vscodeTextmateLocation,e.id,e.name,e.match,lt._compileCaptures(e.captures,n,s));if(typeof e.begin>"u"){e.repository&&(s=Fu({},s,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new ya(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,lt._compilePatterns(i,n,s))}return e.while?new Mo(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,lt._compileCaptures(e.beginCaptures||e.captures,n,s),e.while,lt._compileCaptures(e.whileCaptures||e.captures,n,s),lt._compilePatterns(e.patterns,n,s)):new ar(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,lt._compileCaptures(e.beginCaptures||e.captures,n,s),e.end,lt._compileCaptures(e.endCaptures||e.captures,n,s),e.applyEndPatternLast,lt._compilePatterns(e.patterns,n,s))}),e.id}static _compileCaptures(e,n,s){let o=[];if(e){let i=0;for(const r in e){if(r==="$vscodeTextmateLocation")continue;const l=parseInt(r,10);l>i&&(i=l)}for(let r=0;r<=i;r++)o[r]=null;for(const r in e){if(r==="$vscodeTextmateLocation")continue;const l=parseInt(r,10);let a=0;e[r].patterns&&(a=lt.getCompiledRuleId(e[r],n,s)),o[l]=lt.createCaptureRule(n,e[r].$vscodeTextmateLocation,e[r].name,e[r].contentName,a)}}return o}static _compilePatterns(e,n,s){let o=[];if(e)for(let i=0,r=e.length;i<r;i++){const l=e[i];let a=-1;if(l.include){const c=Yu(l.include);switch(c.kind){case 0:case 1:a=lt.getCompiledRuleId(s[l.include],n,s);break;case 2:let u=s[c.ruleName];u&&(a=lt.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 m=p.repository[h];m&&(a=lt.getCompiledRuleId(m,n,p.repository))}else a=lt.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else a=lt.getCompiledRuleId(l,n,s);if(a!==-1){const c=n.getRule(a);let u=!1;if((c instanceof ya||c instanceof ar||c instanceof Mo)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;o.push(a)}}return{patterns:o,hasMissingPatterns:(e?e.length:0)!==o.length}}},Ps=class Xu{constructor(e,n){U(this,"source");U(this,"ruleId");U(this,"hasAnchor");U(this,"hasBackReferences");U(this,"_anchorCache");if(e&&typeof e=="string"){const s=e.length;let o=0,i=[],r=!1;for(let l=0;l<s;l++)if(e.charAt(l)==="\\"&&l+1<s){const c=e.charAt(l+1);c==="z"?(i.push(e.substring(o,l)),i.push("$(?!\\n)(?<!\\n)"),o=l+2):(c==="A"||c==="G")&&(r=!0),l++}this.hasAnchor=r,o===0?this.source=e:(i.push(e.substring(o,s)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=vb.test(this.source):this.hasBackReferences=!1}clone(){return new Xu(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,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=>e.substring(o.start,o.end));return va.lastIndex=0,this.source.replace(va,(o,i)=>Hu(s[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],s=[],o=[],i,r,l,a;for(i=0,r=this.source.length;i<r;i++)l=this.source.charAt(i),e[i]=l,n[i]=l,s[i]=l,o[i]=l,l==="\\"&&i+1<r&&(a=this.source.charAt(i+1),a==="A"?(e[i+1]="",n[i+1]="",s[i+1]="A",o[i+1]="A"):a==="G"?(e[i+1]="",n[i+1]="G",s[i+1]="",o[i+1]="G"):(e[i+1]=a,n[i+1]=a,s[i+1]=a,o[i+1]=a),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:o.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Es=class{constructor(){U(this,"_items");U(this,"_hasAnchors");U(this,"_cached");U(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(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new ba(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let s=this._items.map(o=>o.resolveAnchors(e,n));return new ba(t,s,this._items.map(o=>o.ruleId))}},ba=class{constructor(t,e,n){U(this,"scanner");this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
75
|
+
`)}findNextMatchSync(t,e,n){const s=this.scanner.findNextMatchSync(t,e,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},$i=class{constructor(t,e){this.languageId=t,this.tokenType=e}},en,wb=(en=class{constructor(e,n){U(this,"_defaultAttributes");U(this,"_embeddedLanguagesMatcher");U(this,"_getBasicScopeAttributes",new qu(e=>{const n=this._scopeToLanguage(e),s=this._toStandardTokenType(e);return new $i(n,s)}));this._defaultAttributes=new $i(e,8),this._embeddedLanguagesMatcher=new Sb(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?en._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(en.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!")}},U(en,"_NULL_SCOPE_METADATA",new $i(0,0)),U(en,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),en),Sb=class{constructor(t){U(this,"values");U(this,"scopesRegExp");if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,s])=>Hu(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},ka=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function Qu(t,e,n,s,o,i,r,l){const a=e.content.length;let c=!1,u=-1;if(r){const p=_b(t,e,n,s,o,i);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 ka(o,!0);h()}return new ka(o,!1);function h(){const p=$b(t,e,n,s,o,u);if(!p){i.produce(o,a),c=!0;return}const m=p.captureIndices,y=p.matchedRuleId,b=m&&m.length>0?m[0].end>s:!1;if(y===yb){const w=o.getRule(t);i.produce(o,m[0].start),o=o.withContentNameScopesList(o.nameScopesList),ps(t,e,n,o,i,w.endCaptures,m),i.produce(o,m[0].end);const S=o;if(o=o.parent,u=S.getAnchorPos(),!b&&S.getEnterPos()===s){o=S,i.produce(o,a),c=!0;return}}else{const w=t.getRule(y);i.produce(o,m[0].start);const S=o,_=w.getName(e.content,m),A=o.contentNameScopesList.pushAttributed(_,t);if(o=o.push(y,s,u,m[0].end===a,null,A,A),w instanceof ar){const Y=w;ps(t,e,n,o,i,Y.beginCaptures,m),i.produce(o,m[0].end),u=m[0].end;const G=Y.getContentName(e.content,m),I=A.pushAttributed(G,t);if(o=o.withContentNameScopesList(I),Y.endHasBackReferences&&(o=o.withEndRule(Y.getEndWithResolvedBackReferences(e.content,m))),!b&&S.hasSameRuleAs(o)){o=o.pop(),i.produce(o,a),c=!0;return}}else if(w instanceof Mo){const Y=w;ps(t,e,n,o,i,Y.beginCaptures,m),i.produce(o,m[0].end),u=m[0].end;const G=Y.getContentName(e.content,m),I=A.pushAttributed(G,t);if(o=o.withContentNameScopesList(I),Y.whileHasBackReferences&&(o=o.withEndRule(Y.getWhileWithResolvedBackReferences(e.content,m))),!b&&S.hasSameRuleAs(o)){o=o.pop(),i.produce(o,a),c=!0;return}}else if(ps(t,e,n,o,i,w.captures,m),i.produce(o,m[0].end),o=o.pop(),!b){o=o.safePop(),i.produce(o,a),c=!0;return}}m[0].end>s&&(s=m[0].end,n=!1)}}function _b(t,e,n,s,o,i){let r=o.beginRuleCapturedEOL?0:-1;const l=[];for(let a=o;a;a=a.pop()){const c=a.getRule(t);c instanceof Mo&&l.push({rule:c,stack:a})}for(let a=l.pop();a;a=l.pop()){const{ruleScanner:c,findOptions:u}=Tb(a.rule,t,a.stack.endRule,n,s===r),d=c.findNextMatchSync(e,s,u);if(d){if(d.ruleId!==Ju){o=a.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(i.produce(a.stack,d.captureIndices[0].start),ps(t,e,n,a.stack,i,a.rule.whileCaptures,d.captureIndices),i.produce(a.stack,d.captureIndices[0].end),r=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:r,isFirstLine:n}}function $b(t,e,n,s,o,i){const r=xb(t,e,n,s,o,i),l=t.getInjections();if(l.length===0)return r;const a=Cb(l,t,e,n,s,o,i);if(!a)return r;if(!r)return a;const c=r.captureIndices[0].start,u=a.captureIndices[0].start;return u<c||a.priorityMatch&&u===c?a:r}function xb(t,e,n,s,o,i){const r=o.getRule(t),{ruleScanner:l,findOptions:a}=ed(r,t,o.endRule,n,s===i),c=l.findNextMatchSync(e,s,a);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Cb(t,e,n,s,o,i,r){let l=Number.MAX_VALUE,a=null,c,u=0;const d=i.contentNameScopesList.getScopeNames();for(let h=0,p=t.length;h<p;h++){const m=t[h];if(!m.matcher(d))continue;const y=e.getRule(m.ruleId),{ruleScanner:b,findOptions:w}=ed(y,e,null,s,o===r),S=b.findNextMatchSync(n,o,w);if(!S)continue;const _=S.captureIndices[0].start;if(!(_>=l)&&(l=_,a=S.captureIndices,c=S.ruleId,u=m.priority,l===o))break}return a?{priorityMatch:u===-1,captureIndices:a,matchedRuleId:c}:null}function ed(t,e,n,s,o){return{ruleScanner:t.compileAG(e,n,s,o),findOptions:0}}function Tb(t,e,n,s,o){return{ruleScanner:t.compileWhileAG(e,n,s,o),findOptions:0}}function ps(t,e,n,s,o,i,r){if(i.length===0)return;const l=e.content,a=Math.min(i.length,r.length),c=[],u=r[0].end;for(let d=0;d<a;d++){const h=i[d];if(h===null)continue;const p=r[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 y=h.getName(l,r),b=s.contentNameScopesList.pushAttributed(y,t),w=h.getContentName(l,r),S=b.pushAttributed(w,t),_=s.push(h.retokenizeCapturedWithRuleId,p.start,-1,!1,null,b,S),A=t.createOnigString(l.substring(0,p.end));Qu(t,A,n&&p.start===0,p.start,_,o,!1,0),Ku(A);continue}const m=h.getName(l,r);if(m!==null){const b=(c.length>0?c[c.length-1].scopes:s.contentNameScopesList).pushAttributed(m,t);c.push(new Ib(b,p.end))}}for(;c.length>0;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Ib=class{constructor(t,e){U(this,"scopes");U(this,"endPos");this.scopes=t,this.endPos=e}};function Mb(t,e,n,s,o,i,r,l){return new Rb(t,e,n,s,o,i,r,l)}function wa(t,e,n,s,o){const i=To(e,Ao),r=Zu.getCompiledRuleId(n,s,o.repository);for(const l of i)t.push({debugSelector:e,matcher:l.matcher,ruleId:r,grammar:o,priority:l.priority})}function Ao(t,e){if(e.length<t.length)return!1;let n=0;return t.every(s=>{for(let o=n;o<e.length;o++)if(Ab(e[o],s))return n=o+1,!0;return!1})}function Ab(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var Rb=class{constructor(t,e,n,s,o,i,r,l){U(this,"_rootId");U(this,"_lastRuleId");U(this,"_ruleId2desc");U(this,"_includedGrammars");U(this,"_grammarRepository");U(this,"_grammar");U(this,"_injections");U(this,"_basicScopeAttributesProvider");U(this,"_tokenTypeMatchers");if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=l,this._basicScopeAttributesProvider=new wb(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=r,this._grammar=Sa(e,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const a of Object.keys(o)){const c=To(a,Ao);for(const u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:o[a]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},e=[],n=this._rootScopeName,s=t.lookup(n);if(s){const o=s.injections;if(o)for(let r in o)wa(e,r,o[r],this,s);const i=this._grammarRepository.injections(n);i&&i.forEach(r=>{const l=this.getExternalGrammar(r);if(l){const a=l.injectionSelector;a&&wa(e,a,l,this,l)}})}return e.sort((o,i)=>o.priority-i.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=Sa(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const s=this._tokenize(t,e,!1,n);return{tokens:s.lineTokens.getResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}tokenizeLine2(t,e,n=0){const s=this._tokenize(t,e,!0,n);return{tokens:s.lineTokens.getBinaryResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}_tokenize(t,e,n,s){this._rootId===-1&&(this._rootId=Zu.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!e||e===cr.NULL){o=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),d=Qn.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=ws.createRootAndLookUpScopeName(h,d,this):p=ws.createRoot("unknown",d),e=new cr(null,this._rootId,-1,-1,!1,null,p,p)}else o=!1,e.reset();t=t+`
|
|
76
|
+
`;const i=this.createOnigString(t),r=i.content.length,l=new Eb(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),a=Qu(this,i,o,0,e,l,!0,s);return Ku(i),{lineLength:r,lineTokens:l,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function Sa(t,e){return t=Jy(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var ws=class zt{constructor(e,n,s){this.parent=e,this.scopePath=n,this.tokenAttributes=s}static fromExtension(e,n){let s=e,o=(e==null?void 0:e.scopePath)??null;for(const i of n)o=_i.push(o,i.scopeNames),s=new zt(s,o,i.encodedTokenAttributes);return s}static createRoot(e,n){return new zt(null,new _i(null,e),n)}static createRootAndLookUpScopeName(e,n,s){const o=s.getMetadataForScope(e),i=new _i(null,e),r=s.themeProvider.themeMatch(i),l=zt.mergeAttributes(n,o,r);return new zt(null,i,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return zt.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,s){let o=-1,i=0,r=0;return s!==null&&(o=s.fontStyle,i=s.foregroundId,r=s.backgroundId),Qn.set(e,n.languageId,n.tokenType,null,o,i,r)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return zt._pushAttributed(this,e,n);const s=e.split(/ /g);let o=this;for(const i of s)o=zt._pushAttributed(o,i,n);return o}static _pushAttributed(e,n,s){const o=s.getMetadataForScope(n),i=e.scopePath.push(n),r=s.themeProvider.themeMatch(i),l=zt.mergeAttributes(e.tokenAttributes,o,r);return new zt(e,i,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){var o;const n=[];let s=this;for(;s&&s!==e;)n.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(((o=s.parent)==null?void 0:o.scopePath)??null)}),s=s.parent;return s===e?n.reverse():void 0}},It,cr=(It=class{constructor(e,n,s,o,i,r,l,a){U(this,"_stackElementBrand");U(this,"_enterPos");U(this,"_anchorPos");U(this,"depth");this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=r,this.nameScopesList=l,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=o}equals(e){return e===null?!1:It._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?ws.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){It._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,s,o,i,r,l){return new It(this,e,n,s,o,i,r,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){var s,o;return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${(s=this.nameScopesList)==null?void 0:s.toString()}, ${(o=this.contentNameScopesList)==null?void 0:o.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new It(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var e,n,s;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((e=this.parent)==null?void 0:e.nameScopesList)??null))??[],contentNameScopesList:((s=this.contentNameScopesList)==null?void 0:s.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,n){const s=ws.fromExtension((e==null?void 0:e.nameScopesList)??null,n.nameScopesList);return new It(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,ws.fromExtension(s,n.contentNameScopesList))}},U(It,"NULL",new It(null,0,0,0,!1,null,null,null)),It),Pb=class{constructor(t,e){U(this,"balancedBracketScopes");U(this,"unbalancedBracketScopes");U(this,"allowAny",!1);this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):To(n,Ao).map(s=>s.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>To(n,Ao).map(s=>s.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},Eb=class{constructor(t,e,n,s){U(this,"_emitBinaryTokens");U(this,"_lineText");U(this,"_tokens");U(this,"_binaryTokens");U(this,"_lastTokenEndIndex");U(this,"_tokenTypeOverrides");this.balancedBracketSelectors=s,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){var s;if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let o=(t==null?void 0:t.tokenAttributes)??0,i=!1;if((s=this.balancedBracketSelectors)!=null&&s.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const r=(t==null?void 0:t.getScopeNames())??[];for(const l of this._tokenTypeOverrides)l.matcher(r)&&(o=Qn.set(o,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(r))}if(i&&(o=Qn.set(o,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===o){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(o),this._lastTokenEndIndex=e;return}const n=(t==null?void 0:t.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),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}},Lb=class{constructor(t,e){U(this,"_grammars",new Map);U(this,"_rawGrammars",new Map);U(this,"_injectionGrammars",new Map);U(this,"_theme");this._onigLib=e,this._theme=t}dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,s,o){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,Mb(t,i,e,n,s,o,this,this._onigLib))}return this._grammars.get(t)}},Ob=class{constructor(e){U(this,"_options");U(this,"_syncRegistry");U(this,"_ensureGrammarCache");this._options=e,this._syncRegistry=new Lb(Co.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(Co.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,s){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:s})}loadGrammarWithConfiguration(e,n,s){return this._loadGrammar(e,n,s.embeddedLanguages,s.tokenTypes,new Pb(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,s,o,i){const r=new ub(this._syncRegistry,e);for(;r.Q.length>0;)r.Q.map(l=>this._loadSingleGrammar(l.scopeName)),r.processQueue();return this._grammarForScopeName(e,n,s,o,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const s=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,s)}}addGrammar(e,n=[],s=0,o=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,s,o)}_grammarForScopeName(e,n=0,s=null,o=null,i=null){return this._syncRegistry.grammarForScopeName(e,n,s,o,i)}},ur=cr.NULL;const Db=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class js{constructor(e,n,s){this.normal=n,this.property=e,s&&(this.space=s)}}js.prototype.normal={};js.prototype.property={};js.prototype.space=void 0;function td(t,e){const n={},s={};for(const o of t)Object.assign(n,o.property),Object.assign(s,o.normal);return new js(n,s,e)}function dr(t){return t.toLowerCase()}class kt{constructor(e,n){this.attribute=n,this.property=e}}kt.prototype.attribute="";kt.prototype.booleanish=!1;kt.prototype.boolean=!1;kt.prototype.commaOrSpaceSeparated=!1;kt.prototype.commaSeparated=!1;kt.prototype.defined=!1;kt.prototype.mustUseProperty=!1;kt.prototype.number=!1;kt.prototype.overloadedBoolean=!1;kt.prototype.property="";kt.prototype.spaceSeparated=!1;kt.prototype.space=void 0;let Nb=0;const ye=Gn(),Ke=Gn(),fr=Gn(),se=Gn(),Ge=Gn(),Ln=Gn(),_t=Gn();function Gn(){return 2**++Nb}const hr=Object.freeze(Object.defineProperty({__proto__:null,boolean:ye,booleanish:Ke,commaOrSpaceSeparated:_t,commaSeparated:Ln,number:se,overloadedBoolean:fr,spaceSeparated:Ge},Symbol.toStringTag,{value:"Module"})),xi=Object.keys(hr);class Yr extends kt{constructor(e,n,s,o){let i=-1;if(super(e,n),_a(this,"space",o),typeof s=="number")for(;++i<xi.length;){const r=xi[i];_a(this,xi[i],(s&hr[r])===hr[r])}}}Yr.prototype.defined=!0;function _a(t,e,n){n&&(t[e]=n)}function es(t){const e={},n={};for(const[s,o]of Object.entries(t.properties)){const i=new Yr(s,t.transform(t.attributes||{},s),o,t.space);t.mustUseProperty&&t.mustUseProperty.includes(s)&&(i.mustUseProperty=!0),e[s]=i,n[dr(s)]=s,n[dr(i.attribute)]=s}return new js(e,n,t.space)}const nd=es({properties:{ariaActiveDescendant:null,ariaAtomic:Ke,ariaAutoComplete:null,ariaBusy:Ke,ariaChecked:Ke,ariaColCount:se,ariaColIndex:se,ariaColSpan:se,ariaControls:Ge,ariaCurrent:null,ariaDescribedBy:Ge,ariaDetails:null,ariaDisabled:Ke,ariaDropEffect:Ge,ariaErrorMessage:null,ariaExpanded:Ke,ariaFlowTo:Ge,ariaGrabbed:Ke,ariaHasPopup:null,ariaHidden:Ke,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ge,ariaLevel:se,ariaLive:null,ariaModal:Ke,ariaMultiLine:Ke,ariaMultiSelectable:Ke,ariaOrientation:null,ariaOwns:Ge,ariaPlaceholder:null,ariaPosInSet:se,ariaPressed:Ke,ariaReadOnly:Ke,ariaRelevant:null,ariaRequired:Ke,ariaRoleDescription:Ge,ariaRowCount:se,ariaRowIndex:se,ariaRowSpan:se,ariaSelected:Ke,ariaSetSize:se,ariaSort:null,ariaValueMax:se,ariaValueMin:se,ariaValueNow:se,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function sd(t,e){return e in t?t[e]:e}function od(t,e){return sd(t,e.toLowerCase())}const Bb=es({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ln,acceptCharset:Ge,accessKey:Ge,action:null,allow:null,allowFullScreen:ye,allowPaymentRequest:ye,allowUserMedia:ye,alpha:ye,alt:null,as:null,async:ye,autoCapitalize:null,autoComplete:Ge,autoFocus:ye,autoPlay:ye,blocking:Ge,capture:null,charSet:null,checked:ye,cite:null,className:Ge,closedBy:null,colorSpace:null,cols:se,colSpan:se,command:null,commandFor:null,content:null,contentEditable:Ke,controls:ye,controlsList:Ge,coords:se|Ln,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ye,defer:ye,dir:null,dirName:null,disabled:ye,download:fr,draggable:Ke,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ye,formTarget:null,headers:Ge,height:se,hidden:fr,high:se,href:null,hrefLang:null,htmlFor:Ge,httpEquiv:Ge,id:null,imageSizes:null,imageSrcSet:null,inert:ye,inputMode:null,integrity:null,is:null,isMap:ye,itemId:null,itemProp:Ge,itemRef:Ge,itemScope:ye,itemType:Ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ye,low:se,manifest:null,max:null,maxLength:se,media:null,method:null,min:null,minLength:se,multiple:ye,muted:ye,name:null,nonce:null,noModule:ye,noValidate:ye,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:ye,optimum:se,pattern:null,ping:Ge,placeholder:null,playsInline:ye,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ye,referrerPolicy:null,rel:Ge,required:ye,reversed:ye,rows:se,rowSpan:se,sandbox:Ge,scope:null,scoped:ye,seamless:ye,selected:ye,shadowRootClonable:ye,shadowRootCustomElementRegistry:ye,shadowRootDelegatesFocus:ye,shadowRootMode:null,shadowRootSerializable:ye,shape:null,size:se,sizes:null,slot:null,span:se,spellCheck:Ke,src:null,srcDoc:null,srcLang:null,srcSet:null,start:se,step:null,style:null,tabIndex:se,target:null,title:null,translate:null,type:null,typeMustMatch:ye,useMap:null,value:Ke,width:se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ge,axis:null,background:null,bgColor:null,border:se,borderColor:null,bottomMargin:se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ye,declare:ye,event:null,face:null,frame:null,frameBorder:null,hSpace:se,leftMargin:se,link:null,longDesc:null,lowSrc:null,marginHeight:se,marginWidth:se,noResize:ye,noHref:ye,noShade:ye,noWrap:ye,object:null,profile:null,prompt:null,rev:null,rightMargin:se,rules:null,scheme:null,scrolling:Ke,standby:null,summary:null,text:null,topMargin:se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:se,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ye,disablePictureInPicture:ye,disableRemotePlayback:ye,exportParts:Ln,part:Ge,prefix:null,property:null,results:se,security:null,unselectable:null},space:"html",transform:od}),Gb=es({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:_t,accentHeight:se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:se,amplitude:se,arabicForm:null,ascent:se,attributeName:null,attributeType:null,azimuth:se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:se,by:null,calcMode:null,capHeight:se,className:Ge,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:se,diffuseConstant:se,direction:null,display:null,dur:null,divisor:se,dominantBaseline:null,download:ye,dx:null,dy:null,edgeMode:null,editable:null,elevation:se,enableBackground:null,end:null,event:null,exponent:se,externalResourcesRequired:null,fill:null,fillOpacity:se,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:Ln,g2:Ln,glyphName:Ln,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:se,horizOriginX:se,horizOriginY:se,id:null,ideographic:se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:se,k:se,k1:se,k2:se,k3:se,k4:se,kernelMatrix:_t,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:se,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:se,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:se,overlineThickness:se,paintOrder:null,panose1:null,path:null,pathLength:se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:se,pointsAtY:se,pointsAtZ:se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_t,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_t,rev:_t,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_t,requiredFeatures:_t,requiredFonts:_t,requiredFormats:_t,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:se,specularExponent:se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:se,strikethroughThickness:se,string:null,stroke:null,strokeDashArray:_t,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:se,strokeOpacity:se,strokeWidth:null,style:null,surfaceScale:se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_t,tabIndex:se,tableValues:null,target:null,targetX:se,targetY:se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_t,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:se,underlineThickness:se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:se,values:null,vAlphabetic:se,vMathematical:se,vectorEffect:null,vHanging:se,vIdeographic:se,version:null,vertAdvY:se,vertOriginX:se,vertOriginY:se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sd}),id=es({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),rd=es({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:od}),ld=es({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),Fb=/[A-Z]/g,$a=/-[a-z]/g,jb=/^data[-\w.:]+$/i;function Ub(t,e){const n=dr(e);let s=e,o=kt;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&jb.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace($a,Hb);s="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!$a.test(i)){let r=i.replace(Fb,zb);r.charAt(0)!=="-"&&(r="-"+r),e="data"+r}}o=Yr}return new o(s,e)}function zb(t){return"-"+t.toLowerCase()}function Hb(t){return t.charAt(1).toUpperCase()}const qb=td([nd,Bb,id,rd,ld],"html"),ad=td([nd,Gb,id,rd,ld],"svg"),xa={}.hasOwnProperty;function Wb(t,e){const n=e||{};function s(o,...i){let r=s.invalid;const l=s.handlers;if(o&&xa.call(o,t)){const a=String(o[t]);r=xa.call(l,a)?l[a]:s.unknown}if(r)return r.call(this,o,...i)}return s.handlers=n.handlers||{},s.invalid=n.invalid,s.unknown=n.unknown,s}const Vb=/["&'<>`]/g,Kb=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Yb=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Jb=/[|\\{}()[\]^$+*?.]/g,Ca=new WeakMap;function Zb(t,e){if(t=t.replace(e.subset?Xb(e.subset):Vb,s),e.subset||e.escapeOnly)return t;return t.replace(Kb,n).replace(Yb,s);function n(o,i,r){return e.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,r.charCodeAt(i+2),e)}function s(o,i,r){return e.format(o.charCodeAt(0),r.charCodeAt(i+1),e)}}function Xb(t){let e=Ca.get(t);return e||(e=Qb(t),Ca.set(t,e)),e}function Qb(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Jb,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const e1=/[\dA-Fa-f]/;function t1(t,e,n){const s="&#x"+t.toString(16).toUpperCase();return n&&e&&!e1.test(String.fromCharCode(e))?s:s+";"}const n1=/\d/;function s1(t,e,n){const s="&#"+String(t);return n&&e&&!n1.test(String.fromCharCode(e))?s:s+";"}const o1=["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"],Ci={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:"€"},i1=["cent","copy","divide","gt","lt","not","para","times"],cd={}.hasOwnProperty,pr={};let Ys;for(Ys in Ci)cd.call(Ci,Ys)&&(pr[Ci[Ys]]=Ys);const r1=/[^\dA-Za-z]/;function l1(t,e,n,s){const o=String.fromCharCode(t);if(cd.call(pr,o)){const i=pr[o],r="&"+i;return n&&o1.includes(i)&&!i1.includes(i)&&(!s||e&&e!==61&&r1.test(String.fromCharCode(e)))?r:r+";"}return""}function a1(t,e,n){let s=t1(t,e,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=l1(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const i=s1(t,e,n.omitOptionalSemicolons);i.length<s.length&&(s=i)}return o&&(!n.useShortestReferences||o.length<s.length)?o:s}function Yn(t,e){return Zb(t,Object.assign({format:a1},e))}const c1=/^>|^->|<!--|-->|--!>|<!-$/g,u1=[">"],d1=["<",">"];function f1(t,e,n,s){return s.settings.bogusComments?"<?"+Yn(t.value,Object.assign({},s.settings.characterReferences,{subset:u1}))+">":"<!--"+t.value.replace(c1,o)+"-->";function o(i){return Yn(i,Object.assign({},s.settings.characterReferences,{subset:d1}))}}function h1(t,e,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function Ta(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let s=0,o=n.indexOf(e);for(;o!==-1;)s++,o=n.indexOf(e,o+e.length);return s}function p1(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function g1(t){return t.join(" ").trim()}const m1=/[ \t\n\f\r]/g;function Jr(t){return typeof t=="object"?t.type==="text"?Ia(t.value):!1:Ia(t)}function Ia(t){return t.replace(m1,"")===""}const tt=dd(1),ud=dd(-1),v1=[];function dd(t){return e;function e(n,s,o){const i=n?n.children:v1;let r=(s||0)+t,l=i[r];if(!o)for(;l&&Jr(l);)r+=t,l=i[r];return l}}const y1={}.hasOwnProperty;function fd(t){return e;function e(n,s,o){return y1.call(t,n.tagName)&&t[n.tagName](n,s,o)}}const Zr=fd({body:k1,caption:Ti,colgroup:Ti,dd:$1,dt:_1,head:Ti,html:b1,li:S1,optgroup:x1,option:C1,p:w1,rp:Ma,rt:Ma,tbody:I1,td:Aa,tfoot:M1,th:Aa,thead:T1,tr:A1});function Ti(t,e,n){const s=tt(n,e,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&Jr(s.value.charAt(0)))}function b1(t,e,n){const s=tt(n,e);return!s||s.type!=="comment"}function k1(t,e,n){const s=tt(n,e);return!s||s.type!=="comment"}function w1(t,e,n){const s=tt(n,e);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 S1(t,e,n){const s=tt(n,e);return!s||s.type==="element"&&s.tagName==="li"}function _1(t,e,n){const s=tt(n,e);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function $1(t,e,n){const s=tt(n,e);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function Ma(t,e,n){const s=tt(n,e);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function x1(t,e,n){const s=tt(n,e);return!s||s.type==="element"&&s.tagName==="optgroup"}function C1(t,e,n){const s=tt(n,e);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function T1(t,e,n){const s=tt(n,e);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function I1(t,e,n){const s=tt(n,e);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function M1(t,e,n){return!tt(n,e)}function A1(t,e,n){const s=tt(n,e);return!s||s.type==="element"&&s.tagName==="tr"}function Aa(t,e,n){const s=tt(n,e);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const R1=fd({body:L1,colgroup:O1,head:E1,html:P1,tbody:D1});function P1(t){const e=tt(t,-1);return!e||e.type!=="comment"}function E1(t){const e=new Set;for(const s of t.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(e.has(s.tagName))return!1;e.add(s.tagName)}const n=t.children[0];return!n||n.type==="element"}function L1(t){const e=tt(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Jr(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function O1(t,e,n){const s=ud(n,e),o=tt(t,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&Zr(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function D1(t,e,n){const s=ud(n,e),o=tt(t,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&Zr(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const Js={name:[[`
|
|
77
|
+
\f\r &/=>`.split(""),`
|
|
78
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
79
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
80
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
81
|
+
\f\r &>`.split(""),`\0
|
|
82
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
83
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
84
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function N1(t,e,n,s){const o=s.schema,i=o.space==="svg"?!1:s.settings.omitOptionalTags;let r=o.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(t.tagName.toLowerCase());const l=[];let a;o.space==="html"&&t.tagName==="svg"&&(s.schema=ad);const c=B1(s,t.properties),u=s.all(o.space==="html"&&t.tagName==="template"?t.content:t);return s.schema=o,u&&(r=!1),(c||!i||!R1(t,e,n))&&(l.push("<",t.tagName,c?" "+c:""),r&&(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),!r&&(!i||!Zr(t,e,n))&&l.push("</"+t.tagName+">"),l.join("")}function B1(t,e){const n=[];let s=-1,o;if(e){for(o in e)if(e[o]!==null&&e[o]!==void 0){const i=G1(t,o,e[o]);i&&n.push(i)}}for(;++s<n.length;){const i=t.settings.tightAttributes?n[s].charAt(n[s].length-1):void 0;s!==n.length-1&&i!=='"'&&i!=="'"&&(n[s]+=" ")}return n.join("")}function G1(t,e,n){const s=Ub(t.schema,e),o=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,i=t.settings.allowDangerousCharacters?0:1;let r=t.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=Yn(s.attribute,Object.assign({},t.settings.characterReferences,{subset:Js.name[o][i]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?p1:g1)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?a:(t.settings.preferUnquoted&&(l=Yn(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:Js.unquoted[o][i]}))),l!==n&&(t.settings.quoteSmart&&Ta(n,r)>Ta(n,t.alternative)&&(r=t.alternative),l=r+Yn(n,Object.assign({},t.settings.characterReferences,{subset:(r==="'"?Js.single:Js.double)[o][i],attribute:!0}))+r),a+(l&&"="+l))}const F1=["<","&"];function hd(t,e,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:Yn(t.value,Object.assign({},s.settings.characterReferences,{subset:F1}))}function j1(t,e,n,s){return s.settings.allowDangerousHtml?t.value:hd(t,e,n,s)}function U1(t,e,n,s){return s.all(t)}const z1=Wb("type",{invalid:H1,unknown:q1,handlers:{comment:f1,doctype:h1,element:N1,raw:j1,root:U1,text:hd}});function H1(t){throw new Error("Expected node, not `"+t+"`")}function q1(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const W1={},V1={},K1=[];function Y1(t,e){const n=e||W1,s=n.quote||'"',o=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:J1,all:Z1,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||Db,characterReferences:n.characterReferences||V1,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?ad:qb,quote:s,alternative:o}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function J1(t,e,n){return z1(t,e,n,this)}function Z1(t){const e=[],n=t&&t.children||K1;let s=-1;for(;++s<n.length;)e[s]=this.one(n[s],s,t);return e.join("")}function Ro(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},s=typeof t=="string"?t:t.name;for(const[o,i]of Object.entries((e==null?void 0:e.colorReplacements)||{}))typeof i=="string"?n[o]=i:o===s&&Object.assign(n,i);return n}function mn(t,e){return t&&((e==null?void 0:e[t==null?void 0:t.toLowerCase()])||t)}function X1(t){return Array.isArray(t)?t:[t]}async function pd(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function Xr(t){return!t||["plaintext","txt","text","plain"].includes(t)}function Q1(t){return t==="ansi"||Xr(t)}function Qr(t){return t==="none"}function ek(t){return Qr(t)}function gd(t,e){var s;if(!e)return t;t.properties||(t.properties={}),(s=t.properties).class||(s.class=[]),typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(/\s+/g);for(const o of n)o&&!t.properties.class.includes(o)&&t.properties.class.push(o);return t}function oi(t,e=!1){var i;if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);let s=0;const o=[];for(let r=0;r<n.length;r+=2){const l=e?n[r]+(n[r+1]||""):n[r];o.push([l,s]),s+=n[r].length,s+=((i=n[r+1])==null?void 0:i.length)||0}return o}function tk(t){const e=oi(t,!0).map(([o])=>o);function n(o){if(o===t.length)return{line:e.length-1,character:e[e.length-1].length};let i=o,r=0;for(const l of e){if(i<l.length)break;i-=l.length,r++}return{line:r,character:i}}function s(o,i){let r=0;for(let l=0;l<o;l++)r+=e[l].length;return r+=i,r}return{lines:e,indexToPos:n,posToIndex:s}}const el="light-dark()",nk=["color","background-color"];function sk(t,e){let n=0;const s=[];for(const o of e)o>n&&s.push({...t,content:t.content.slice(n,o),offset:t.offset+n}),n=o;return n<t.content.length&&s.push({...t,content:t.content.slice(n),offset:t.offset+n}),s}function ok(t,e){const n=Array.from(e instanceof Set?e:new Set(e)).sort((s,o)=>s-o);return n.length?t.map(s=>s.flatMap(o=>{const i=n.filter(r=>o.offset<r&&r<o.offset+o.content.length).map(r=>r-o.offset).sort((r,l)=>r-l);return i.length?sk(o,i):o})):t}function ik(t,e,n,s,o="css-vars"){const i={content:t.content,explanation:t.explanation,offset:t.offset},r=e.map(u=>Po(t.variants[u])),l=new Set(r.flatMap(u=>Object.keys(u))),a={},c=(u,d)=>{const h=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+e[u]+(d==="color"?"":h)};return r.forEach((u,d)=>{for(const h of l){const p=u[h]||"inherit";if(d===0&&s&&nk.includes(h))if(s===el&&r.length>1){const m=e.findIndex(S=>S==="light"),y=e.findIndex(S=>S==="dark");if(m===-1||y===-1)throw new st('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=r[m][h]||"inherit",w=r[y][h]||"inherit";a[h]=`light-dark(${b}, ${w})`,o==="css-vars"&&(a[c(d,h)]=p)}else a[h]=p;else o==="css-vars"&&(a[c(d,h)]=p)}}),i.htmlStyle=a,i}function Po(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&dt.Italic&&(e["font-style"]="italic"),t.fontStyle&dt.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&dt.Underline&&n.push("underline"),t.fontStyle&dt.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function gr(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}const md=new WeakMap;function ii(t,e){md.set(t,e)}function Ls(t){return md.get(t)}class ts{constructor(...e){U(this,"_stacks",{});U(this,"lang");if(e.length===2){const[n,s]=e;this.lang=s,this._stacks=n}else{const[n,s,o]=e;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(e,n){return new ts(Object.fromEntries(X1(n).map(s=>[s,ur])),e)}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return rk(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function rk(t){const e=[],n=new Set;function s(o){var r;if(n.has(o))return;n.add(o);const i=(r=o==null?void 0:o.nameScopesList)==null?void 0:r.scopeName;i&&e.push(i),o.parent&&s(o.parent)}return s(t),e}function lk(t,e){if(!(t instanceof ts))throw new st("Invalid grammar state");return t.getInternalStack(e)}function ak(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let s=function(r){if(typeof r=="number"){if(r<0||r>n.source.length)throw new st(`Invalid decoration offset: ${r}. Code length: ${n.source.length}`);return{...o.indexToPos(r),offset:r}}else{const l=o.lines[r.line];if(l===void 0)throw new st(`Invalid decoration position ${JSON.stringify(r)}. Lines length: ${o.lines.length}`);let a=r.character;if(a<0&&(a=l.length+a),a<0||a>l.length)throw new st(`Invalid decoration position ${JSON.stringify(r)}. Line ${r.line} length: ${l.length}`);return{...r,character:a,offset:o.posToIndex(r.line,a)}}};const o=tk(n.source),i=(n.options.decorations||[]).map(r=>({...r,start:s(r.start),end:s(r.end)}));ck(i),t.set(n.meta,{decorations:i,converter:o,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){var r;if(!((r=this.options.decorations)!=null&&r.length))return;const o=e(this).decorations.flatMap(l=>[l.start.offset,l.end.offset]);return ok(n,o)},code(n){var u;if(!((u=this.options.decorations)!=null&&u.length))return;const s=e(this),o=Array.from(n.children).filter(d=>d.type==="element"&&d.tagName==="span");if(o.length!==s.converter.lines.length)throw new st(`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 i(d,h,p,m){const y=o[d];let b="",w=-1,S=-1;if(h===0&&(w=0),p===0&&(S=0),p===Number.POSITIVE_INFINITY&&(S=y.children.length),w===-1||S===-1)for(let A=0;A<y.children.length;A++)b+=vd(y.children[A]),w===-1&&b.length===h&&(w=A+1),S===-1&&b.length===p&&(S=A+1);if(w===-1)throw new st(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(S===-1)throw new st(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const _=y.children.slice(w,S);if(!m.alwaysWrap&&_.length===y.children.length)l(y,m,"line");else if(!m.alwaysWrap&&_.length===1&&_[0].type==="element")l(_[0],m,"token");else{const A={type:"element",tagName:"span",properties:{},children:_};l(A,m,"wrapper"),y.children.splice(w,_.length,A)}}function r(d,h){o[d]=l(o[d],h,"line")}function l(d,h,p){var b;const m=h.properties||{},y=h.transform||(w=>w);return d.tagName=h.tagName||"span",d.properties={...d.properties,...m,class:d.properties.class},(b=h.properties)!=null&&b.class&&gd(d,h.properties.class),d=y(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)i(h.line,h.character,p.character,d);else if(h.line<p.line){i(h.line,h.character,Number.POSITIVE_INFINITY,d);for(let m=h.line+1;m<p.line;m++)a.unshift(()=>r(m,d));i(p.line,0,p.character,d)}}a.forEach(d=>d())}}}function ck(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.start.offset>n.end.offset)throw new st(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let s=e+1;s<t.length;s++){const o=t[s],i=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,r=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(i||r||l||a){if(i&&r||l&&a||l&&n.start.offset===n.end.offset||r&&o.start.offset===o.end.offset)continue;throw new st(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function vd(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(vd).join(""):""}const uk=[ak()];function Eo(t){const e=dk(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...uk]}function dk(t){const e=[],n=[],s=[];for(const o of t)switch(o.enforce){case"pre":e.push(o);break;case"post":n.push(o);break;default:s.push(o)}return{pre:e,post:n,normal:s}}var An=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Ii={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function fk(t,e){const n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){const s=t.indexOf("m",n);if(s!==-1)return{sequence:t.substring(n+2,s).split(";"),startPosition:n,position:s+1}}return{position:t.length}}function Ra(t){const e=t.shift();if(e==="2"){const n=t.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(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function hk(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const s=Number.parseInt(n);if(!Number.isNaN(s))if(s===0)e.push({type:"resetAll"});else if(s<=9)Ii[s]&&e.push({type:"setDecoration",value:Ii[s]});else if(s<=29){const o=Ii[s-20];o&&(e.push({type:"resetDecoration",value:o}),o==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(s<=37)e.push({type:"setForegroundColor",value:{type:"named",name:An[s-30]}});else if(s===38){const o=Ra(t);o&&e.push({type:"setForegroundColor",value:o})}else if(s===39)e.push({type:"resetForegroundColor"});else if(s<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:An[s-40]}});else if(s===48){const o=Ra(t);o&&e.push({type:"setBackgroundColor",value:o})}else s===49?e.push({type:"resetBackgroundColor"}):s===53?e.push({type:"setDecoration",value:"overline"}):s===55?e.push({type:"resetDecoration",value:"overline"}):s>=90&&s<=97?e.push({type:"setForegroundColor",value:{type:"named",name:An[s-90+8]}}):s>=100&&s<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:An[s-100+8]}})}return e}function pk(){let t=null,e=null,n=new Set;return{parse(s){const o=[];let i=0;do{const r=fk(s,i),l=r.sequence?s.substring(i,r.startPosition):s.substring(i);if(l.length>0&&o.push({value:l,foreground:t,background:e,decorations:new Set(n)}),r.sequence){const a=hk(r.sequence);for(const c of a)c.type==="resetAll"?(t=null,e=null,n.clear()):c.type==="resetForegroundColor"?t=null:c.type==="resetBackgroundColor"?e=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of a)c.type==="setForegroundColor"?t=c.value:c.type==="setBackgroundColor"?e=c.value:c.type==="setDecoration"&&n.add(c.value)}i=r.position}while(i<s.length);return o}}}var gk={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 mk(t=gk){function e(l){return t[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<An.length;c++)s.push(e(An[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 i(l){return o()[l]}function r(l){switch(l.type){case"named":return e(l.name);case"rgb":return n(l.rgb);case"table":return i(l.index)}}return{value:r}}const vk={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 yk(t,e,n){const s=Ro(t,n),o=oi(e),i=Object.fromEntries(An.map(a=>{var d;const c=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`,u=(d=t.colors)==null?void 0:d[c];return[a,u||vk[a]]})),r=mk(i),l=pk();return o.map(a=>l.parse(a[0]).map(c=>{let u,d;c.decorations.has("reverse")?(u=c.background?r.value(c.background):t.bg,d=c.foreground?r.value(c.foreground):t.fg):(u=c.foreground?r.value(c.foreground):t.fg,d=c.background?r.value(c.background):void 0),u=mn(u,s),d=mn(d,s),c.decorations.has("dim")&&(u=bk(u));let h=dt.None;return c.decorations.has("bold")&&(h|=dt.Bold),c.decorations.has("italic")&&(h|=dt.Italic),c.decorations.has("underline")&&(h|=dt.Underline),c.decorations.has("strikethrough")&&(h|=dt.Strikethrough),{content:c.value,offset:a[1],color:u,bgColor:d,fontStyle:h}}))}function bk(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const s=e[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],i=s[1],r=s[2],l=s[3],a=Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${i}${i}${r}${r}${a}`}else if(s.length===3){const o=s[0],i=s[1],r=s[2];return`#${o}${o}${i}${i}${r}${r}80`}}}const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function tl(t,e,n={}){const{theme:s=t.getLoadedThemes()[0]}=n,o=t.resolveLangAlias(n.lang||"text");if(Xr(o)||Qr(s))return oi(e).map(a=>[{content:a[0],offset:a[1]}]);const{theme:i,colorMap:r}=t.setTheme(s);if(o==="ansi")return yk(i,e,n);const l=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==l.name)throw new st(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(i.name))throw new st(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return wk(e,l,i,r,n)}function kk(...t){if(t.length===2)return Ls(t[1]);const[e,n,s={}]=t,{lang:o="text",theme:i=e.getLoadedThemes()[0]}=s;if(Xr(o)||Qr(i))throw new st("Plain language does not have grammar state");if(o==="ansi")throw new st("ANSI language does not have grammar state");const{theme:r,colorMap:l}=e.setTheme(i),a=e.getLanguage(o);return new ts(nl(n,a,r,l,s).stateStack,a.name,r.name)}function wk(t,e,n,s,o){const i=nl(t,e,n,s,o),r=new ts(i.stateStack,e.name,n.name);return ii(i.tokens,r),i.tokens}function nl(t,e,n,s,o){const i=Ro(n,o),{tokenizeMaxLineLength:r=0,tokenizeTimeLimit:l=500}=o,a=oi(t);let c=o.grammarState?lk(o.grammarState,n.name)??ur:o.grammarContextCode!=null?nl(o.grammarContextCode,e,n,s,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:ur,u=[];const d=[];for(let h=0,p=a.length;h<p;h++){const[m,y]=a[h];if(m===""){u=[],d.push([]);continue}if(r>0&&m.length>=r){u=[],d.push([{content:m,offset:y,color:"",fontStyle:0}]);continue}let b,w,S;o.includeExplanation&&(b=e.tokenizeLine(m,c,l),w=b.tokens,S=0);const _=e.tokenizeLine2(m,c,l),A=_.tokens.length/2;for(let Y=0;Y<A;Y++){const G=_.tokens[2*Y],I=Y+1<A?_.tokens[2*Y+2]:m.length;if(G===I)continue;const C=_.tokens[2*Y+1],k=mn(s[Qn.getForeground(C)],i),T=Qn.getFontStyle(C),P={content:m.substring(G,I),offset:y+G,color:k,fontStyle:T};if(o.includeExplanation){const N=[];if(o.includeExplanation!=="scopeName")for(const F of n.settings){let D;switch(typeof F.scope){case"string":D=F.scope.split(/,/).map(ne=>ne.trim());break;case"object":D=F.scope;break;default:continue}N.push({settings:F,selectors:D.map(ne=>ne.split(/ /))})}P.explanation=[];let re=0;for(;G+re<I;){const F=w[S],D=m.substring(F.startIndex,F.endIndex);re+=D.length,P.explanation.push({content:D,scopes:o.includeExplanation==="scopeName"?Sk(F.scopes):_k(N,F.scopes)}),S+=1}}u.push(P)}d.push(u),u=[],c=_.ruleStack}return{tokens:d,stateStack:c}}function Sk(t){return t.map(e=>({scopeName:e}))}function _k(t,e){const n=[];for(let s=0,o=e.length;s<o;s++){const i=e[s];n[s]={scopeName:i,themeMatches:xk(t,i,e.slice(0,s))}}return n}function Pa(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function $k(t,e,n){if(!Pa(t[t.length-1],e))return!1;let s=t.length-2,o=n.length-1;for(;s>=0&&o>=0;)Pa(t[s],n[o])&&(s-=1),o-=1;return s===-1}function xk(t,e,n){const s=[];for(const{selectors:o,settings:i}of t)for(const r of o)if($k(r,e,n)){s.push(i);break}return s}function yd(t,e,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=tl(t,e,{...n,theme:a.theme}),u=Ls(c),d=typeof a.theme=="string"?a.theme:a.theme.name;return{tokens:c,state:u,theme:d}}),i=Ck(...o.map(a=>a.tokens)),r=i[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),i.forEach((p,m)=>{const{content:y,explanation:b,offset:w,...S}=p[c][d];h.variants[s[m].color]=S}),h})),l=o[0].state?new ts(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&&ii(r,l),r}function Ck(...t){const e=t.map(()=>[]),n=t.length;for(let s=0;s<t[0].length;s++){const o=t.map(a=>a[s]),i=e.map(()=>[]);e.forEach((a,c)=>a.push(i[c]));const r=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?(i[c].push(u),r[c]+=1,l[c]=o[c][r[c]]):(i[c].push({...u,content:u.content.slice(0,a)}),l[c]={...u,content:u.content.slice(a),offset:u.offset+a})}}}return e}function Lo(t,e,n){let s,o,i,r,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,S)=>w.color===c?-1:S.color===c?1:0);if(h.length===0)throw new st("`themes` option must not be empty");const p=yd(t,e,n);if(a=Ls(p),c&&el!==c&&!h.find(w=>w.color===c))throw new st(`\`themes\` option must contain the defaultColor key \`${c}\``);const m=h.map(w=>t.getTheme(w.theme)),y=h.map(w=>w.color);i=p.map(w=>w.map(S=>ik(S,y,u,c,d))),a&&ii(i,a);const b=h.map(w=>Ro(w.theme,n));o=Ea(h,m,b,u,c,"fg",d),s=Ea(h,m,b,u,c,"bg",d),r=`shiki-themes ${m.map(w=>w.name).join(" ")}`,l=c?void 0:[o,s].join(";")}else if("theme"in n){const c=Ro(n.theme,n);i=tl(t,e,n);const u=t.getTheme(n.theme);s=mn(u.bg,c),o=mn(u.fg,c),r=u.name,a=Ls(i)}else throw new st("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:o,bg:s,themeName:r,rootStyle:l,grammarState:a}}function Ea(t,e,n,s,o,i,r){return t.map((l,a)=>{const c=mn(e[a][i],n[a])||"inherit",u=`${s+l.color}${i==="bg"?"-bg":""}:${c}`;if(a===0&&o){if(o===el&&t.length>1){const d=t.findIndex(y=>y.color==="light"),h=t.findIndex(y=>y.color==="dark");if(d===-1||h===-1)throw new st('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const p=mn(e[d][i],n[d])||"inherit",m=mn(e[h][i],n[h])||"inherit";return`light-dark(${p}, ${m});${u}`}return c}return r==="css-vars"?u:null}).filter(l=>!!l).join(";")}function Oo(t,e,n,s={meta:{},options:n,codeToHast:(o,i)=>Oo(t,o,i),codeToTokens:(o,i)=>Lo(t,o,i)}){var m,y;let o=e;for(const b of Eo(n))o=((m=b.preprocess)==null?void 0:m.call(s,o,n))||o;let{tokens:i,fg:r,bg:l,themeName:a,rootStyle:c,grammarState:u}=Lo(t,o,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:h=!1}=n;d===!0?i=Ik(i):d==="never"&&(i=Mk(i)),h&&(i=Ak(i));const p={...s,get source(){return o}};for(const b of Eo(n))i=((y=b.tokens)==null?void 0:y.call(p,i))||i;return Tk(i,{...n,fg:r,bg:l,themeName:a,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},p,u)}function Tk(t,e,n,s=Ls(t)){var y,b,w,S;const o=Eo(e),i=[],r={type:"root",children:[]},{structure:l="classic",tabindex:a="0"}=e,c={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?c.style=e.rootStyle:c.style=`background-color:${e.bg};color:${e.fg}`),a!==!1&&a!=null&&(c.tabindex=a.toString());for(const[_,A]of Object.entries(e.meta||{}))_.startsWith("_")||(c[_]=A);let u={type:"element",tagName:"pre",properties:c,children:[],data:e.data},d={type:"element",tagName:"code",properties:{},children:i};const h=[],p={...n,structure:l,addClassToHast:gd,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return r},get pre(){return u},get code(){return d},get lines(){return h}};if(t.forEach((_,A)=>{var I,C;A&&(l==="inline"?r.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&i.push({type:"text",value:`
|
|
85
|
+
`}));let Y={type:"element",tagName:"span",properties:{class:"line"},children:[]},G=0;for(const k of _){let T={type:"element",tagName:"span",properties:{...k.htmlAttrs},children:[{type:"text",value:k.content}]};const P=gr(k.htmlStyle||Po(k));P&&(T.properties.style=P);for(const N of o)T=((I=N==null?void 0:N.span)==null?void 0:I.call(p,T,A+1,G,Y,k))||T;l==="inline"?r.children.push(T):l==="classic"&&Y.children.push(T),G+=k.content.length}if(l==="classic"){for(const k of o)Y=((C=k==null?void 0:k.line)==null?void 0:C.call(p,Y,A+1))||Y;h.push(Y),i.push(Y)}else l==="inline"&&h.push(Y)}),l==="classic"){for(const _ of o)d=((y=_==null?void 0:_.code)==null?void 0:y.call(p,d))||d;u.children.push(d);for(const _ of o)u=((b=_==null?void 0:_.pre)==null?void 0:b.call(p,u))||u;r.children.push(u)}else if(l==="inline"){const _=[];let A={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const I of r.children)I.type==="element"&&I.tagName==="br"?(_.push(A),A={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(I.type==="element"||I.type==="text")&&A.children.push(I);_.push(A);let G={type:"element",tagName:"code",properties:{},children:_};for(const I of o)G=((w=I==null?void 0:I.code)==null?void 0:w.call(p,G))||G;r.children=[];for(let I=0;I<G.children.length;I++){I>0&&r.children.push({type:"element",tagName:"br",properties:{},children:[]});const C=G.children[I];C.type==="element"&&r.children.push(...C.children)}}let m=r;for(const _ of o)m=((S=_==null?void 0:_.root)==null?void 0:S.call(p,m))||m;return s&&ii(m,s),m}function Ik(t){return t.map(e=>{const n=[];let s="",o;return e.forEach((i,r)=>{const a=!(i.fontStyle&&(i.fontStyle&dt.Underline||i.fontStyle&dt.Strikethrough));a&&i.content.match(/^\s+$/)&&e[r+1]?(o===void 0&&(o=i.offset),s+=i.content):s?(a?n.push({...i,offset:o,content:s+i.content}):n.push({content:s,offset:o},i),o=void 0,s=""):n.push(i)}),n})}function Mk(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const s=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!s)return n;const[,o,i,r]=s;if(!o&&!r)return n;const l=[{...n,offset:n.offset+o.length,content:i}];return o&&l.unshift({content:o,offset:n.offset}),r&&l.push({content:r,offset:n.offset+o.length+i.length}),l}))}function Ak(t){return t.map(e=>{const n=[];for(const s of e){if(n.length===0){n.push({...s});continue}const o=n[n.length-1],i=gr(o.htmlStyle||Po(o)),r=gr(s.htmlStyle||Po(s)),l=o.fontStyle&&(o.fontStyle&dt.Underline||o.fontStyle&dt.Strikethrough),a=s.fontStyle&&(s.fontStyle&dt.Underline||s.fontStyle&dt.Strikethrough);!l&&!a&&i===r?o.content+=s.content:n.push({...s})}return n})}const Rk=Y1;function Pk(t,e,n){var i;const s={meta:{},options:n,codeToHast:(r,l)=>Oo(t,r,l),codeToTokens:(r,l)=>Lo(t,r,l)};let o=Rk(Oo(t,e,n,s));for(const r of Eo(n))o=((i=r.postprocess)==null?void 0:i.call(s,o,n))||o;return o}const La={light:"#333333",dark:"#bbbbbb"},Oa={light:"#fffffe",dark:"#1e1e1e"},Da="__shiki_resolved";function sl(t){var l,a,c,u,d;if(t!=null&&t[Da])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||(e.type="dark"),e.colorReplacements={...e.colorReplacements},e.settings||(e.settings=[]);let{bg:n,fg:s}=e;if(!n||!s){const h=e.settings?e.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=e==null?void 0:e.colors)!=null&&c["editor.foreground"])&&(s=e.colors["editor.foreground"]),!n&&((u=e==null?void 0:e.colors)!=null&&u["editor.background"])&&(n=e.colors["editor.background"]),s||(s=e.type==="light"?La.light:La.dark),n||(n=e.type==="light"?Oa.light:Oa.dark),e.fg=s,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let o=0;const i=new Map;function r(h){var m;if(i.has(h))return i.get(h);o+=1;const p=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return(m=e.colorReplacements)!=null&&m[`#${p}`]?r(h):(i.set(h,p),p)}e.settings=e.settings.map(h=>{var b,w;const p=((b=h.settings)==null?void 0:b.foreground)&&!h.settings.foreground.startsWith("#"),m=((w=h.settings)==null?void 0:w.background)&&!h.settings.background.startsWith("#");if(!p&&!m)return h;const y={...h,settings:{...h.settings}};if(p){const S=r(h.settings.foreground);e.colorReplacements[S]=h.settings.foreground,y.settings.foreground=S}if(m){const S=r(h.settings.background);e.colorReplacements[S]=h.settings.background,y.settings.background=S}return y});for(const h of Object.keys(e.colors||{}))if((h==="editor.foreground"||h==="editor.background"||h.startsWith("terminal.ansi"))&&!((d=e.colors[h])!=null&&d.startsWith("#"))){const p=r(e.colors[h]);e.colorReplacements[p]=e.colors[h],e.colors[h]=p}return Object.defineProperty(e,Da,{enumerable:!1,writable:!1,value:!0}),e}async function bd(t){return Array.from(new Set((await Promise.all(t.filter(e=>!Q1(e)).map(async e=>await pd(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function kd(t){return(await Promise.all(t.map(async n=>ek(n)?null:sl(await pd(n))))).filter(n=>!!n)}let Ek=3;function Lk(t,e=3){e>Ek||console.trace(`[SHIKI DEPRECATE]: ${t}`)}let Un=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function wd(t,e){if(!e)return t;if(e[t]){const n=new Set([t]);for(;e[t];){if(t=e[t],n.has(t))throw new Un(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}class Ok extends Ob{constructor(n,s,o,i={}){super(n);U(this,"_resolvedThemes",new Map);U(this,"_resolvedGrammars",new Map);U(this,"_langMap",new Map);U(this,"_langGraph",new Map);U(this,"_textmateThemeCache",new WeakMap);U(this,"_loadedThemesCache",null);U(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=s,this._langs=o,this._alias=i,this._themes.map(r=>this.loadTheme(r)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const s=sl(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=Co.createFromRawTheme(n),this._textmateThemeCache.set(n,s)),this._syncRegistry.setTheme(s)}getGrammar(n){return n=wd(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var r,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 i=this.loadGrammarWithConfiguration(n.scopeName,1,o);if(i.name=n.name,this._resolvedGrammars.set(n.name,i),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=(r=this._syncRegistry)==null?void 0:r._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 i of n)this.resolveEmbeddedLanguages(i);const s=Array.from(this._langGraph.entries()),o=s.filter(([i,r])=>!r);if(o.length){const i=s.filter(([r,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(r=>!o.includes(r));throw new Un(`Missing languages ${o.map(([r])=>`\`${r}\``).join(", ")}, required by ${i.map(([r])=>`\`${r}\``).join(", ")}`)}for(const[i,r]of s)this._resolver.addLanguage(r);for(const[i,r]of s)this.loadLanguage(r)}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 Dk{constructor(e,n){U(this,"_langs",new Map);U(this,"_scopeToLang",new Map);U(this,"_injections",new Map);U(this,"_onigLib");this._onigLib={createOnigScanner:s=>e.createScanner(s),createOnigString:s=>e.createString(s)},n.forEach(s=>this.addLanguage(s))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(n=>{this._langs.set(n,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(e.scopeName)})}getInjections(e){const n=e.split(".");let s=[];for(let o=1;o<=n.length;o++){const i=n.slice(0,o).join(".");s=[...s,...this._injections.get(i)||[]]}return s}}let cs=0;function Nk(t){cs+=1,t.warnings!==!1&&cs>=10&&cs%10===0&&console.warn(`[Shiki] ${cs} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new Un("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),s=(t.themes||[]).flat(1).map(sl),o=new Dk(t.engine,n),i=new Ok(o,s,n,t.langAlias);let r;function l(_){return wd(_,t.langAlias)}function a(_){w();const A=i.getGrammar(typeof _=="string"?_:_.name);if(!A)throw new Un(`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=i.getTheme(_);if(!A)throw new Un(`Theme \`${_}\` not found, you may need to load it first`);return A}function u(_){w();const A=c(_);r!==_&&(i.setTheme(A),r=_);const Y=i.getColorMap();return{theme:A,colorMap:Y}}function d(){return w(),i.getLoadedThemes()}function h(){return w(),i.getLoadedLanguages()}function p(..._){w(),i.loadLanguages(_.flat(1))}async function m(..._){return p(await bd(_))}function y(..._){w();for(const A of _.flat(1))i.loadTheme(A)}async function b(..._){return w(),y(await kd(_))}function w(){if(e)throw new Un("Shiki instance has been disposed")}function S(){e||(e=!0,i.dispose(),cs-=1)}return{setTheme:u,getTheme:c,getLanguage:a,getLoadedThemes:d,getLoadedLanguages:h,resolveLangAlias:l,loadLanguage:m,loadLanguageSync:p,loadTheme:b,loadThemeSync:y,dispose:S,[Symbol.dispose]:S}}async function Bk(t){t.engine||Lk("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,s]=await Promise.all([kd(t.themes||[]),bd(t.langs||[]),t.engine]);return Nk({...t,themes:e,langs:n,engine:s})}async function Gk(t){const e=await Bk(t);return{getLastGrammarState:(...n)=>kk(e,...n),codeToTokensBase:(n,s)=>tl(e,n,s),codeToTokensWithThemes:(n,s)=>yd(e,n,s),codeToTokens:(n,s)=>Lo(e,n,s),codeToHast:(n,s)=>Oo(e,n,s),codeToHtml:(n,s)=>Pk(e,n,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}class ol extends Error{constructor(e){super(e),this.name="ShikiError"}}function Fk(){return 2147483648}function jk(){return typeof performance<"u"?performance.now():Date.now()}const Uk=(t,e)=>t+(e-t%e)%e;async function zk(t){let e,n;const s={};function o(p){n=p,s.HEAPU8=new Uint8Array(p),s.HEAPU32=new Uint32Array(p)}function i(p,m,y){s.HEAPU8.copyWithin(p,m,m+y)}function r(p){try{return e.grow(p-n.byteLength+65535>>>16),o(e.buffer),1}catch{}}function l(p){const m=s.HEAPU8.length;p=p>>>0;const y=Fk();if(p>y)return!1;for(let b=1;b<=4;b*=2){let w=m*(1+.2/b);w=Math.min(w,p+100663296);const S=Math.min(y,Uk(Math.max(p,w),65536));if(r(S))return!0}return!1}const a=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(p,m,y=1024){const b=m+y;let w=m;for(;p[w]&&!(w>=b);)++w;if(w-m>16&&p.buffer&&a)return a.decode(p.subarray(m,w));let S="";for(;m<w;){let _=p[m++];if(!(_&128)){S+=String.fromCharCode(_);continue}const A=p[m++]&63;if((_&224)===192){S+=String.fromCharCode((_&31)<<6|A);continue}const Y=p[m++]&63;if((_&240)===224?_=(_&15)<<12|A<<6|Y:_=(_&7)<<18|A<<12|Y<<6|p[m++]&63,_<65536)S+=String.fromCharCode(_);else{const G=_-65536;S+=String.fromCharCode(55296|G>>10,56320|G&1023)}}return S}function u(p,m){return p?c(s.HEAPU8,p,m):""}const d={emscripten_get_now:jk,emscripten_memcpy_big:i,emscripten_resize_heap:l,fd_write:()=>0};async function h(){const m=await t({env:d,wasi_snapshot_preview1:d});e=m.memory,o(e.buffer),Object.assign(s,m),s.UTF8ToString=u}return await h(),s}var Hk=Object.defineProperty,qk=(t,e,n)=>e in t?Hk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Qe=(t,e,n)=>qk(t,typeof e!="symbol"?e+"":e,n);let nt=null;function Wk(t){throw new ol(t.UTF8ToString(t.getLastOnigError()))}class ri{constructor(e){Qe(this,"utf16Length"),Qe(this,"utf8Length"),Qe(this,"utf16Value"),Qe(this,"utf8Value"),Qe(this,"utf16OffsetToUtf8"),Qe(this,"utf8OffsetToUtf16");const n=e.length,s=ri._utf8ByteLength(e),o=s!==n,i=o?new Uint32Array(n+1):null;o&&(i[n]=s);const r=o?new Uint32Array(s+1):null;o&&(r[s]=n);const l=new Uint8Array(s);let a=0;for(let c=0;c<n;c++){const u=e.charCodeAt(c);let d=u,h=!1;if(u>=55296&&u<=56319&&c+1<n){const p=e.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+65536|p-56320,h=!0)}o&&(i[c]=a,h&&(i[c+1]=a),d<=127?r[a+0]=c:d<=2047?(r[a+0]=c,r[a+1]=c):d<=65535?(r[a+0]=c,r[a+1]=c,r[a+2]=c):(r[a+0]=c,r[a+1]=c,r[a+2]=c,r[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=e,this.utf8Value=l,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=r}static _utf8ByteLength(e){let n=0;for(let s=0,o=e.length;s<o;s++){const i=e.charCodeAt(s);let r=i,l=!1;if(i>=55296&&i<=56319&&s+1<o){const a=e.charCodeAt(s+1);a>=56320&&a<=57343&&(r=(i-55296<<10)+65536|a-56320,l=!0)}r<=127?n+=1:r<=2047?n+=2:r<=65535?n+=3:n+=4,l&&s++}return n}createString(e){const n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}}const li=class Ht{constructor(e){if(Qe(this,"id",++Ht.LAST_ID),Qe(this,"_onigBinding"),Qe(this,"content"),Qe(this,"utf16Length"),Qe(this,"utf8Length"),Qe(this,"utf16OffsetToUtf8"),Qe(this,"utf8OffsetToUtf16"),Qe(this,"ptr"),!nt)throw new ol("Must invoke loadWasm first.");this._onigBinding=nt,this.content=e;const n=new ri(e);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Ht._sharedPtrInUse?(Ht._sharedPtr||(Ht._sharedPtr=nt.omalloc(1e4)),Ht._sharedPtrInUse=!0,nt.HEAPU8.set(n.utf8Value,Ht._sharedPtr),this.ptr=Ht._sharedPtr):this.ptr=n.createString(nt)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===Ht._sharedPtr?Ht._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Qe(li,"LAST_ID",0);Qe(li,"_sharedPtr",0);Qe(li,"_sharedPtrInUse",!1);let Sd=li;class Vk{constructor(e){if(Qe(this,"_onigBinding"),Qe(this,"_ptr"),!nt)throw new ol("Must invoke loadWasm first.");const n=[],s=[];for(let l=0,a=e.length;l<a;l++){const c=new ri(e[l]);n[l]=c.createString(nt),s[l]=c.utf8Length}const o=nt.omalloc(4*e.length);nt.HEAPU32.set(n,o/4);const i=nt.omalloc(4*e.length);nt.HEAPU32.set(s,i/4);const r=nt.createOnigScanner(o,i,e.length);for(let l=0,a=e.length;l<a;l++)nt.ofree(n[l]);nt.ofree(i),nt.ofree(o),r===0&&Wk(nt),this._onigBinding=nt,this._ptr=r}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,n,s){let o=0;if(typeof s=="number"&&(o=s),typeof e=="string"){e=new Sd(e);const i=this._findNextMatchSync(e,n,!1,o);return e.dispose(),i}return this._findNextMatchSync(e,n,!1,o)}_findNextMatchSync(e,n,s,o){const i=this._onigBinding,r=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(n),o);if(r===0)return null;const l=i.HEAPU32;let a=r/4;const c=l[a++],u=l[a++],d=[];for(let h=0;h<u;h++){const p=e.convertUtf8OffsetToUtf16(l[a++]),m=e.convertUtf8OffsetToUtf16(l[a++]);d[h]={start:p,end:m,length:m-p}}return{index:c,captureIndices:d}}}function Kk(t){return typeof t.instantiator=="function"}function Yk(t){return typeof t.default=="function"}function Jk(t){return typeof t.data<"u"}function Zk(t){return typeof Response<"u"&&t instanceof Response}function Xk(t){var e;return typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||ArrayBuffer.isView(t))||typeof Buffer<"u"&&((e=Buffer.isBuffer)==null?void 0:e.call(Buffer,t))||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&t instanceof Uint32Array}let Zs;function Qk(t){if(Zs)return Zs;async function e(){nt=await zk(async n=>{let s=t;return s=await s,typeof s=="function"&&(s=await s(n)),typeof s=="function"&&(s=await s(n)),Kk(s)?s=await s.instantiator(n):Yk(s)?s=await s.default(n):(Jk(s)&&(s=s.data),Zk(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await e0(s)(n):s=await t0(s)(n):Xk(s)?s=await Mi(s)(n):s instanceof WebAssembly.Module?s=await Mi(s)(n):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await Mi(s.default)(n))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return Zs=e(),Zs}function Mi(t){return e=>WebAssembly.instantiate(t,e)}function e0(t){return e=>WebAssembly.instantiateStreaming(t,e)}function t0(t){return async e=>{const n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}async function n0(t){return t&&await Qk(t),{createScanner(e){return new Vk(e.map(n=>typeof n=="string"?n:n.source))},createString(e){return new Sd(e)}}}const s0={class:"code-block"},o0={class:"code-header"},i0={class:"code-lang"},r0=["innerHTML"],l0=ke({__name:"CodeBlock",props:{code:{},lang:{},streaming:{type:Boolean}},setup(t){const e=t,n=on("effectiveTheme",O(typeof document<"u"&&document.documentElement.dataset.theme==="dark"?"dark":"light")),s=O(""),o=O(""),i=O(!1);let r=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(r)return r;const[b,w]=await Promise.all([Vs(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url),Vs(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url)]);return r=await Gk({themes:[b.default,w.default],langs:[],engine:n0(()=>Vs(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url))}),r}async function d(b){if(l.has(b))return!0;if(a.has(b))return await a.get(b),l.has(b);const w=(async()=>{try{const S=await u(),_=await Vs(()=>import(`shiki/langs/${b}.mjs`),[],import.meta.url);await S.loadLanguage(_.default),l.add(b)}catch{}})();return a.set(b,w),await w,a.delete(b),l.has(b)}function h(b){const w=b.toLowerCase();return c[w]??w}async function p(){var _;const b=((_=e.lang)==null?void 0:_.toLowerCase())??"text",w=h(b),S=n.value==="light"?"github-light":"github-dark";try{const A=await u();await d(w)?s.value=A.codeToHtml(e.code,{lang:w,theme:S}):s.value=`<pre class="shiki-fallback"><code>${m(e.code)}</code></pre>`}catch{s.value=`<pre class="shiki-fallback"><code>${m(e.code)}</code></pre>`}}function m(b){return b.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function y(){navigator.clipboard.writeText(e.code).then(()=>{i.value=!0,setTimeout(()=>i.value=!1,1500)})}return xe(()=>[e.code,e.lang,n.value],([b])=>{e.streaming?o.value=`<pre class="shiki-fallback"><code>${m(b)}</code></pre>`:p()},{immediate:!0}),xe(()=>e.streaming,(b,w)=>{w&&!b&&p()}),(b,w)=>(g(),v("div",s0,[f("div",o0,[f("span",i0,M(t.lang||"text"),1),f("button",{class:le(["code-copy",{copied:i.value}]),onClick:y},M(i.value?"已复制":"复制"),3)]),f("div",{class:"code-content",innerHTML:e.streaming?o.value:s.value||o.value},null,8,r0)]))}}),mr=we(l0,[["__scopeId","data-v-f94a1d0a"]]),gn=vn({open:!1,src:"",alt:""});function _d(t,e=""){t&&(gn.src=t,gn.alt=e,gn.open=!0)}function Ai(){gn.open=!1}Pe.setOptions({gfm:!0,breaks:!1});const a0=4e4,ao=6e3,c0=ke({props:{content:{type:String,required:!0},streaming:{type:Boolean,default:!1}},setup(t){const e=O(t.content);let n=null;const s=O(!1);let o=t.content;xe(()=>t.content,a=>{!a.startsWith(o)&&!o.startsWith(a)&&(s.value=!1),o=a});const i=z(()=>!t.streaming&&!s.value&&e.value.length>a0);xe(()=>t.content,a=>{if(!t.streaming){e.value=a;return}n===null&&(n=requestAnimationFrame(()=>{n=null,e.value=t.content}))}),xe(()=>t.streaming,(a,c)=>{c&&!a&&(n!==null&&(cancelAnimationFrame(n),n=null),e.value=t.content)});const r=z(()=>{const a=i.value?u0(e.value):e.value,c=d0(a);return Pe.lexer(c).flatMap(d=>vr(d,t.streaming))}),l=z(()=>e.value.length);return()=>{const a=r.value.slice();return i.value&&a.push(Ae("button",{class:"md-expand",type:"button",onClick:()=>{s.value=!0}},`展开全文(共 ${l.value.toLocaleString()} 字符,当前仅预览前 ${ao.toLocaleString()})`)),Ae("div",{class:"markdown-body"},a)}}});function u0(t){const e=t.lastIndexOf(`
|
|
86
|
+
`,ao);return(e>ao/2?t.slice(0,e):t.slice(0,ao))+`
|
|
87
|
+
…`}function d0(t){const e=/^(`{3,})/gm;let n=null,s=-1,o=0,i;for(;(i=e.exec(t))!==null;){const r=i[1];n===null?(n=r,s=i.index,o=r.length):r.length>=o&&(n=null)}return n!==null?t.substring(0,s).trimEnd():t}function vr(t,e=!1){const n=t;switch(n.type){case"paragraph":return[Ae("p",{class:"md-p"},sn(n.tokens??[]))];case"heading":return[Ae(`h${n.depth??2}`,{class:`md-h${n.depth??2}`},sn(n.tokens??[]))];case"code":return[Ae(mr,{code:n.text??"",lang:n.lang??"text",streaming:e})];case"blockquote":return[Ae("blockquote",{class:"md-blockquote"},(n.tokens??[]).flatMap(s=>vr(s,e)))];case"list":{const s=(n.items??[]).map(o=>{const i=[];return o.task&&i.push(Ae("input",{type:"checkbox",checked:o.checked,disabled:!0,class:"md-checkbox"})),i.push(...o.tokens.flatMap(r=>vr(r,e))),Ae("li",{class:["md-li",o.task?"md-task":""]},i)});return[Ae(n.ordered?"ol":"ul",{class:n.ordered?"md-ol":"md-ul"},s)]}case"hr":return[Ae("hr",{class:"md-hr"})];case"space":return[];case"html":return[Ae("pre",{class:"md-raw-html"},n.text??"")];case"table":return[Ae("div",{class:"md-table-wrap",style:"overflow-x:auto"},[f0(n)])];case"br":return[Ae("br")];case"text":return[Ae("span",{class:"md-text"},n.tokens?sn(n.tokens):n.text??"")];case"def":return[];default:return[Ae("p",{class:"md-p"},n.raw??"")]}}function f0(t){const e=(t.header??[]).map((s,o)=>{var l;const i=(l=t.align)==null?void 0:l[o],r=s;return Ae("th",{class:"md-th",style:i?`text-align:${i}`:""},r.tokens?sn(r.tokens):String(r.text??""))}),n=(t.rows??[]).map(s=>Ae("tr",{},s.map((o,i)=>{var a;const r=(a=t.align)==null?void 0:a[i],l=o;return Ae("td",{class:"md-td",style:r?`text-align:${r}`:""},l.tokens?sn(l.tokens):String(l.text??""))})));return Ae("table",{class:"md-table"},[Ae("thead",{},[Ae("tr",{},e)]),Ae("tbody",{},n)])}function sn(t){return t.map(e=>{const n=e;switch(n.type){case"text":return n.text??"";case"codespan":return Ae("code",{class:"md-code"},n.text??"");case"strong":return Ae("strong",{class:"md-strong"},sn(n.tokens??[]));case"em":return Ae("em",{class:"md-em"},sn(n.tokens??[]));case"del":return Ae("del",{class:"md-del"},sn(n.tokens??[]));case"link":{const s=n.href;return s&&!/^(https?:|mailto:|#|\/)/i.test(s)?n.raw??"":Ae("a",{class:"md-a",href:s,target:"_blank",rel:"noopener"},sn(n.tokens??[]))}case"image":{const s=n.href??"";return Ae("button",{type:"button",class:"md-img-btn",title:"点击图片放大预览","aria-label":n.text?`放大预览图片:${n.text}`:"放大预览图片",onClick:()=>_d(s,n.text??"")},[Ae("img",{class:"md-img",src:s,alt:n.text??"",loading:"lazy"})])}case"br":return Ae("br");case"html":return Ae("code",{class:"md-raw-inline"},n.text??"");case"escape":return n.text??"";default:return n.raw??""}})}const $d=we(c0,[["__scopeId","data-v-71ba5071"]]);function xd(t,e,n){const s=O("");let o;function i(){o!==void 0&&(clearInterval(o),o=void 0)}return xe(()=>[t.value.durationMs,e.value],()=>{i();const r=t.value.durationMs;if(r!==void 0){s.value=bi(r);return}if(s.value="",e.value!=="running"||!n())return;const l=xp(t.value.toolCallId);l!==void 0&&(s.value=bi(Date.now()-l),o=setInterval(()=>{s.value=bi(Date.now()-l)},1e3))},{immediate:!0}),ft(i),s}const h0=["onKeydown"],p0={class:"tool-name"},g0=["title"],m0=["title"],v0={class:"tool-collapse-inner"},y0={class:"tool-body"},b0={key:0,class:"tool-args"},k0={key:1,class:"tool-result"},w0={key:2,class:"tool-image-wrap"},S0=["src"],_0={key:3,class:"tool-output-actions"},$0={key:4,class:"tool-running-hint"},x0=ke({__name:"GenericToolCard",props:{tool:{},live:{type:Boolean,default:!0},workDir:{default:""},sessionId:{default:""}},setup(t){const e=t,n=z(()=>ti(e.tool,e.live)),s=z(()=>{switch(n.value){case"ok":return"✓";case"error":return"✗";default:return""}}),o=O(!1);let i=!1;xe(n,G=>{i||(o.value=G==="running")},{immediate:!0});function r(){i=!0,o.value=!o.value}const l=new Set(["path","file_path","filePath","file","filename"]),a=z(()=>{const G=e.tool.args;if(!G||typeof G!="object")return null;for(const[I,C]of Object.entries(G))if(l.has(I)&&typeof C=="string"&&C.length>0&&!C.includes(`
|
|
88
|
+
`))return C;return null});function c(){const G=a.value;G&&Dn(Br(G,e.workDir||void 0),{sessionId:e.sessionId||null})}const u=z(()=>{const G=e.tool.args;if(!G||typeof G!="object")return G===void 0?"":String(G);const I=[];for(const[C,k]of Object.entries(G)){if(a.value!==null&&l.has(C)&&k===a.value)continue;let T;if(typeof k=="string")T=k.length>40?`${k.slice(0,40)}…`:k;else{try{T=JSON.stringify(k)}catch{T=String(k)}T.length>40&&(T=`${T.slice(0,40)}…`)}if(I.push(`${C}=${T}`),I.length>=3)break}return I.join(" ")});function d(){if(!e.tool.args)return"";try{return JSON.stringify(e.tool.args,null,2)}catch{return String(e.tool.args)}}function h(G){return G??""}const p=z(()=>h(e.tool.output)),m=z(()=>p.value.length>8192),y=O(!1),b=z(()=>{const G=p.value;return m.value&&!y.value?`…${G.slice(-400)}`:G}),w=z(()=>{var C;const G=e.tool.progress;if(!G)return"";const I=G.split(`
|
|
89
|
+
`).filter(k=>k.trim());return((C=I[I.length-1])==null?void 0:C.slice(0,60))??""}),S=xd(z(()=>e.tool),n,()=>e.live);async function _(){var G;try{await((G=navigator.clipboard)==null?void 0:G.writeText(p.value))}catch{}}const A=z(()=>{const G=p.value.trim();return!/^[\w@./-]+\.(png|jpe?g|gif|webp|avif)$/i.test(G)||G.includes("..")||G.startsWith("/")||m.value?null:`/api/v1/files/raw?path=${encodeURIComponent(G)}`});function Y(){const G=A.value;G&&_d(G)}return(G,I)=>(g(),v("div",{class:le(["tool-card",`is-${n.value}`])},[f("div",{class:"tool-header",role:"button",tabindex:"0",onClick:r,onKeydown:En(Ye(r,["prevent"]),["enter"])},[f("span",{class:le(["status-dot",n.value])},[s.value?(g(),v(X,{key:0},[$e(M(s.value),1)],64)):B("",!0)],2),f("span",p0,M(t.tool.name),1),a.value?(g(),v("button",{key:0,class:"tool-pathlink",title:`在文件面板中打开 ${a.value}`,onClick:Ye(c,["stop"])},M(a.value),9,g0)):B("",!0),u.value?(g(),v("span",{key:1,class:"tool-params",title:u.value},M(u.value),9,m0)):B("",!0),L(S)?(g(),v("span",{key:2,class:le(["tool-duration",{live:t.tool.durationMs===void 0}])},M(L(S)),3)):B("",!0),f("span",{class:le(["tool-chevron",{open:o.value}])},"▸",2)],40,h0),f("div",{class:le(["tool-collapse",{open:o.value}])},[f("div",v0,[f("div",y0,[d()?(g(),v("pre",b0,[f("code",null,M(d()),1)])):B("",!0),t.tool.output!==void 0&&!A.value?(g(),v("pre",k0,[f("code",null,M(b.value||"(无输出)"),1)])):B("",!0),t.tool.output!==void 0&&A.value?(g(),v("div",w0,[f("button",{type:"button",class:"tool-image-btn",title:"点击图片放大预览","aria-label":"放大预览图片",onClick:Y},[f("img",{class:"tool-image",src:A.value,alt:"",loading:"lazy",onError:I[0]||(I[0]=C=>C.currentTarget.style.display="none")},null,40,S0)])])):B("",!0),m.value?(g(),v("div",_0,[f("button",{class:"tool-output-btn",onClick:I[1]||(I[1]=C=>y.value=!y.value)},M(y.value?"收起":"展开全文"),1),f("button",{class:"tool-output-btn",onClick:_},"复制")])):n.value==="running"?(g(),v("div",$0,M(w.value||"执行中…"),1)):B("",!0)])])],2)],2))}}),C0=we(x0,[["__scopeId","data-v-9bfab7a6"]]),T0=500;function I0(t,e){const n=t.length,s=e.length,o=Array.from({length:n+1},()=>new Array(s+1).fill(0));for(let i=1;i<=n;i++)for(let r=1;r<=s;r++)o[i][r]=t[i-1]===e[r-1]?o[i-1][r-1]+1:Math.max(o[i-1][r],o[i][r-1]);return o}function M0(t,e,n,s,o){const i=[];for(;s>0||o>0;)s>0&&o>0&&e[s-1]===n[o-1]?(i.unshift({type:"context",text:e[s-1],oldNo:s,newNo:o}),s--,o--):o>0&&(s===0||t[s][o-1]>=t[s-1][o])?(i.unshift({type:"add",text:n[o-1],newNo:o}),o--):(i.unshift({type:"del",text:e[s-1],oldNo:s}),s--);return i}function Cd(t){const e=[],n=t.replaceAll(`\r
|
|
90
|
+
`,`
|
|
91
|
+
`).split(`
|
|
92
|
+
`);let s=0,o=0;for(const i of n){if(i.startsWith("@@")){const r=/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);s=r?Number(r[1]):0,o=r?Number(r[2]):0;const l=i.startsWith("@@")?i.slice(i.indexOf("@@")+2,i.lastIndexOf("@@")||i.length):"";e.push({type:"context",text:l.trim()?`@@ hunk ${s},${o} @@`:i,oldNo:s,newNo:o});continue}if(i.startsWith("+++")||i.startsWith("---")){e.push({type:"context",text:i,oldNo:s,newNo:o});continue}i.startsWith("+")?(o+=1,e.push({type:"add",text:i.slice(1),newNo:o})):i.startsWith("-")?(s+=1,e.push({type:"del",text:i.slice(1),oldNo:s})):(s+=1,o+=1,e.push({type:"context",text:i,oldNo:s,newNo:o}))}return e}function A0(t,e){const n=t.split(`
|
|
93
|
+
`),s=e.split(`
|
|
94
|
+
`);if(n.length+s.length>T0){const i=[];return n.forEach((r,l)=>i.push({type:"del",text:r,oldNo:l+1})),s.forEach((r,l)=>i.push({type:"add",text:r,newNo:l+1})),i}const o=I0(n,s);return M0(o,n,s,n.length,s.length)}function R0(t){let e=0,n=0;for(const s of t)s.type==="add"?e++:s.type==="del"&&n++;return{added:e,removed:n}}const P0=["old_string","oldString","old_str","old_text","oldText","old","search"],E0=["new_string","newString","new_str","new_text","newText","new","replace","content"],L0=["path","file_path","filePath","file","filename"];function Ri(t,e){for(const n of e){const s=t[n];if(typeof s=="string"&&s.length>0)return s}}function O0(t){if(!t||typeof t!="object")return null;const e=t,n=Ri(e,L0),s=Ri(e,P0),o=Ri(e,E0);if(!o&&!s)return null;const i=A0(s??"",o??""),r=R0(i);return{path:n,diff:i,stats:r}}const D0={class:"diff-lines"},N0={class:"dl-gutter old"},B0={class:"dl-gutter new"},G0={class:"dl-sign"},F0={class:"dl-text"},j0=ke({__name:"DiffLines",props:{lines:{}},setup(t){return(e,n)=>(g(),v("div",D0,[(g(!0),v(X,null,Ce(t.lines,(s,o)=>(g(),v("div",{key:o,class:le(["dl",`dl-${s.type}`])},[f("span",N0,M(s.oldNo??""),1),f("span",B0,M(s.newNo??""),1),f("span",G0,M(s.type==="add"?"+":s.type==="del"?"−":" "),1),f("span",F0,M(s.text),1)],2))),128))]))}}),il=we(j0,[["__scopeId","data-v-e2e145aa"]]),U0=["onKeydown"],z0={class:"tool-name"},H0=["title"],q0={key:1,class:"diff-chip"},W0={class:"tool-collapse-inner"},V0={class:"tool-body"},K0={key:1,class:"tool-result"},Y0={key:2,class:"tool-running-hint"},J0=ke({__name:"EditToolCard",props:{tool:{},live:{type:Boolean,default:!0},workDir:{default:""},sessionId:{default:""}},setup(t){const e=t,n=z(()=>ti(e.tool,e.live)),s=z(()=>{switch(n.value){case"ok":return"✓";case"error":return"✗";default:return""}}),o=z(()=>O0(e.tool.args)),i=z(()=>{const y=o.value;if(!y||n.value==="error")return"";const{added:b,removed:w}=y.stats;return!b&&!w?"":`+${b} −${w}`}),r=z(()=>{var y;return(y=o.value)==null?void 0:y.path}),l=O(!1);let a=!1;xe(n,y=>{a||(l.value=y==="running")},{immediate:!0});function c(){a=!0,l.value=!l.value}const u=z(()=>{var y;return((y=o.value)==null?void 0:y.diff)??[]}),d=z(()=>u.value.length>0),h=xd(z(()=>e.tool),n,()=>e.live);function p(){const y=r.value;y&&Dn(Br(y,e.workDir||void 0),{modeHint:"diff",sessionId:e.sessionId||null})}const m=z(()=>{var w;const y=e.tool.progress;if(!y)return"";const b=y.split(`
|
|
95
|
+
`).filter(S=>S.trim());return((w=b[b.length-1])==null?void 0:w.slice(0,60))??""});return(y,b)=>(g(),v("div",{class:le(["tool-card",`is-${n.value}`,"edit-tool-card"])},[f("div",{class:"tool-header",role:"button",tabindex:"0",onClick:c,onKeydown:En(Ye(c,["prevent"]),["enter"])},[f("span",{class:le(["status-dot",n.value])},[s.value?(g(),v(X,{key:0},[$e(M(s.value),1)],64)):B("",!0)],2),f("span",z0,M(t.tool.name),1),r.value?(g(),v("button",{key:0,class:"tool-filepath",title:`在文件面板中打开(diff) ${r.value}`,onClick:Ye(p,["stop"])},M(r.value),9,H0)):B("",!0),i.value?(g(),v("span",q0,M(i.value),1)):B("",!0),L(h)?(g(),v("span",{key:2,class:le(["tool-duration",{live:t.tool.durationMs===void 0}])},M(L(h)),3)):B("",!0),f("span",{class:le(["tool-chevron",{open:l.value}])},"▸",2)],40,U0),f("div",{class:le(["tool-collapse",{open:l.value}])},[f("div",W0,[f("div",V0,[d.value?(g(),Oe(il,{key:0,lines:u.value},null,8,["lines"])):B("",!0),t.tool.output!==void 0?(g(),v("pre",K0,[f("code",null,M(t.tool.output||"(无输出)"),1)])):(g(),v("div",Y0,M(m.value||"执行中…"),1))])])],2)],2))}}),Z0=we(J0,[["__scopeId","data-v-eff4962d"]]),X0=["aria-expanded"],Q0={class:"process-label"},ew={class:"process-meta"},tw=["title"],nw={class:"process-collapse"},sw={class:"process-inner"},ow=ke({__name:"ToolGroup",props:{name:{},tools:{},live:{type:Boolean,default:!0},workDir:{default:""},sessionId:{default:""}},setup(t){const e=t,n=O(!1),s=z(()=>cy(e.tools,e.live)),o=z(()=>e.tools.filter(l=>l.output!==void 0&&!l.isError).length),i=z(()=>s.value==="running"?"执行中":s.value==="error"?"含失败调用":s.value==="suspended"?"含挂起等待":s.value==="unknown"?"结果未持久化":`已完成 ${o.value} 项`);function r(){n.value=!n.value}return(l,a)=>(g(),v("section",{class:le(["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:r},[J(de,{name:"chevron-down",size:12,class:"chevron"}),f("span",{class:le(["process-dot",s.value]),"aria-hidden":"true"},null,2),f("span",Q0,M(t.name),1),f("span",ew,M(i.value)+" · "+M(t.tools.length)+" 步",1),f("span",{class:"process-names",title:t.tools.map(c=>c.name).join("、")},M(t.tools.map(c=>c.name).join(" · ")),9,tw)],8,X0),f("div",nw,[f("div",sw,[(g(!0),v(X,null,Ce(e.tools,c=>(g(),Oe(Ff(L(Iu)(c.name)?Z0:C0),{key:c.toolCallId,tool:c,live:t.live,"work-dir":t.workDir,"session-id":t.sessionId},null,8,["tool","live","work-dir","session-id"]))),128))])])],2))}}),iw=we(ow,[["__scopeId","data-v-ca5b0e07"]]),rw={class:"thinking-block"},lw=["title"],aw={class:"teaser-text"},cw={class:"teaser-open"},uw={key:1,class:"thinking-stream"},dw={class:"thinking-panel",role:"dialog","aria-label":"思考过程"},fw={class:"panel-body"},hw=ke({__name:"ThinkingBlock",props:{tool:{},active:{type:Boolean,default:!1},sessionId:{default:""},msgSeq:{default:void 0}},setup(t){const e=t,n=O(!1),s=O(null),o=O(!1),i=O(!1),r=O(e.tool.output??"");xe(()=>e.tool.output,h=>{h!==void 0&&!o.value&&!i.value&&(r.value=h)});const l=z(()=>!!e.tool.truncated);async function a(){if(!(!l.value||i.value||o.value)&&!(!e.sessionId||e.msgSeq===void 0)){o.value=!0;try{const p=await(await fetch(`/api/v1/sessions/${e.sessionId}/messages?seq=${e.msgSeq}&tool=${encodeURIComponent(e.tool.toolCallId)}`)).json();typeof p.output=="string"&&p.output.length>0&&(r.value=p.output,i.value=!0)}catch{}finally{o.value=!1}}}const c=z(()=>r.value.split(/\n+/).map(p=>p.trim()).filter(Boolean).at(-1)??"");xe(r,()=>{e.active&&We(()=>{const h=s.value;h&&(h.scrollTop=h.scrollHeight)})});function u(){a(),n.value=!0}function d(){n.value=!1}return(h,p)=>(g(),v("div",rw,[t.active?(g(),v("div",uw,[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"},M(r.value),513)])):(g(),v("button",{key:0,class:"thinking-teaser",title:l.value?"思考较长,点击查看完整思考过程":"点击查看完整思考过程",onClick:u},[p[0]||(p[0]=f("span",{class:"teaser-icon"},"💭",-1)),f("span",aw,M(o.value?"加载完整思考…":c.value||"思考过程"),1),f("span",cw,M(l.value?"查看全文":"展开"),1)],8,lw)),(g(),Oe(Mr,{to:"body"},[n.value?(g(),v("div",{key:0,class:"thinking-overlay",onClick:Ye(d,["self"])},[f("aside",dw,[f("header",{class:"panel-header"},[p[2]||(p[2]=f("span",null,"💭 思考过程",-1)),f("button",{class:"panel-close","aria-label":"关闭",onClick:d},"✕")]),f("div",fw,M(r.value||"(空)"),1)])])):B("",!0)]))]))}}),pw=we(hw,[["__scopeId","data-v-436ab760"]]),gw={key:0,class:"clock"},mw={class:"stat"},vw={class:"stat"},yw={class:"stat"},bw={class:"stat"},kw={class:"stat"},ww={class:"stat"},Sw=ke({__name:"TurnStats",props:{stats:{}},setup(t){const e=t,n=O(null);let s=null;function o(){s!==null&&(clearInterval(s),s=null)}function i(){o();const a=e.stats.llmMs??0,c=Date.now();n.value=a,s=setInterval(()=>{n.value=a+(Date.now()-c)},300)}xe(()=>e.stats.status,a=>{a==="running"?i():o()},{immediate:!0}),ft(o);function r(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)=>(g(),v("div",{class:le(["turn-stats",`is-${t.stats.status}`]),"aria-live":"polite"},[t.stats.status==="running"?(g(),v(X,{key:0},[c[0]||(c[0]=f("span",{class:"badge-gradient"},"正在思考",-1)),n.value!==null?(g(),v("span",gw,M(r(n.value)),1)):B("",!0)],64)):(g(),v(X,{key:1},[f("span",mw,M(t.stats.turn)+" 轮 · "+M(t.stats.step)+" 步",1),c[10]||(c[10]=f("span",{class:"dot"},"·",-1)),f("span",vw,[c[1]||(c[1]=f("span",{class:"k"},"LLM",-1)),$e(" "+M(r(t.stats.llmMs)),1)]),t.stats.toolMs?(g(),v(X,{key:0},[c[3]||(c[3]=f("span",{class:"dot"},"·",-1)),f("span",yw,[c[2]||(c[2]=f("span",{class:"k"},"工具",-1)),$e(" "+M(r(t.stats.toolMs)),1)])],64)):B("",!0),t.stats.firstTokenMs!==null&&t.stats.firstTokenMs!==void 0?(g(),v(X,{key:1},[c[5]||(c[5]=f("span",{class:"dot"},"·",-1)),f("span",bw,[c[4]||(c[4]=f("span",{class:"k"},"首token",-1)),$e(" "+M(r(t.stats.firstTokenMs)),1)])],64)):B("",!0),t.stats.tokens!==null&&t.stats.tokens!==void 0?(g(),v(X,{key:2},[c[7]||(c[7]=f("span",{class:"dot"},"·",-1)),f("span",kw,[c[6]||(c[6]=f("span",{class:"k"},"tokens",-1)),$e(" "+M(l(t.stats.tokens)),1)])],64)):B("",!0),t.stats.tokensPerSec!==null&&t.stats.tokensPerSec!==void 0?(g(),v(X,{key:3},[c[9]||(c[9]=f("span",{class:"dot"},"·",-1)),f("span",ww,[c[8]||(c[8]=f("span",{class:"k"},"tok/s",-1)),$e(" "+M(t.stats.tokensPerSec),1)])],64)):B("",!0)],64))],2))}}),_w=we(Sw,[["__scopeId","data-v-95536a3e"]]),$w=["data-message-id","data-message-role"],xw={key:0,class:"user-wrap"},Cw={class:"user-head"},Tw={key:0,class:"meta-time"},Iw={class:"user-avatar","aria-hidden":"true"},Mw={class:"user-bubble"},Aw=["title","onClick"],Rw={key:0,class:"message-meta user-meta"},Pw={key:1,class:"assistant-wrap"},Ew={key:0,class:"assistant-brand"},Lw={key:0,class:"brand-model"},Ow={key:1,class:"brand-streaming"},Dw={key:2,class:"brand-time"},Nw={class:"assistant-body"},Bw={key:0,class:"degraded-note"},Gw={key:4,class:"streaming-cursor","aria-label":"正在生成"},Fw={key:6,class:"written-files",role:"group","aria-label":"本回合写入的文件"},jw=["title","onClick"],Uw={class:"written-file-name"},zw={key:7,class:"message-meta"},Hw=["title"],qw=["title"],Ww=ke({__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:""},workDir:{default:""}},emits:["edit","retry","fork"],setup(t,{emit:e}){const n=t,s=e,o=O(!1);let i=null;const r=z(()=>n.message.role==="user"),l=z(()=>n.message.role==="assistant"),a=z(()=>n.message.tools.filter(k=>k.name==="thinking")),c=z(()=>n.message.tools.filter(k=>k.name!=="thinking")),u=z(()=>n.message.ts!==void 0?iy(n.message.ts):""),d=z(()=>r.value&&n.isLatestUser&&n.idle),h=z(()=>l.value&&!n.streaming?dy(n.message,n.workDir||void 0):[]);function p(k){return k.split("/").pop()||k}function m(k){Dn(k,{sessionId:n.sessionId||void 0})}const y=/(^|\s)@("[^"\n]+"|[^\s"]+)/g;function b(k){if(!k||k.startsWith("/")||k.startsWith("~"))return k;const T=n.workDir.trim();if(!T)return k;let P=k;for(;P.startsWith("./");)P=P.slice(2);return`${T.replace(/\/+$/,"")}/${P}`}const w=z(()=>{const k=n.message.content;if(!r.value||!k||!k.includes("@"))return[];const T=[];let P=0;y.lastIndex=0;let N;for(;(N=y.exec(k))!==null;){const re=N.index+N[1].length;re>P&&T.push({text:k.slice(P,re),path:null});const F=N[2],D=F.startsWith('"')?F.slice(1,-1):F;T.push({text:k.slice(re,re+1+F.length),path:b(D)}),P=re+1+F.length}return P<k.length&&T.push({text:k.slice(P),path:null}),T});function S(k){Dn(k,{sessionId:n.sessionId||void 0})}const _=on("showThinking",O(!0)),A=on("showTools",O(!0)),Y=O(!1);let G=null;function I(){if(typeof window>"u"||!("speechSynthesis"in window))return;if(Y.value){window.speechSynthesis.cancel(),Y.value=!1,G=null;return}const k=n.message.content;if(!k)return;const T=new SpeechSynthesisUtterance(k);T.lang="zh-CN";const P=()=>{G===P&&(Y.value=!1,G=null)};G=P,T.addEventListener("end",P),T.addEventListener("error",P),window.speechSynthesis.cancel(),requestAnimationFrame(()=>{window.speechSynthesis.speak(T)}),Y.value=!0}ft(()=>{Y.value&&"speechSynthesis"in window&&window.speechSynthesis.cancel()});async function C(){try{await navigator.clipboard.writeText(n.message.content)}catch{const k=document.createElement("textarea");k.value=n.message.content,document.body.append(k),k.select(),document.execCommand("copy"),k.remove()}o.value=!0,i!==null&&clearTimeout(i),i=window.setTimeout(()=>{o.value=!1},1500)}return(k,T)=>(g(),v("article",{class:le(["message",t.message.role,{error:t.message.isError}]),"data-message-id":t.message.id,"data-message-role":t.message.role},[r.value?(g(),v("div",xw,[f("div",Cw,[u.value?(g(),v("span",Tw,M(u.value),1)):B("",!0),T[3]||(T[3]=f("span",{class:"head-name"},"你",-1)),f("span",Iw,[J(de,{name:"user",size:12})])]),f("div",Mw,[w.value.length?(g(!0),v(X,{key:0},Ce(w.value,(P,N)=>(g(),v(X,{key:N},[P.path!==null?(g(),v("button",{key:0,class:"at-link",title:`在文件面板中打开 ${P.path}`,onClick:re=>S(P.path??"")},M(P.text),9,Aw)):(g(),v(X,{key:1},[$e(M(P.text),1)],64))],64))),128)):(g(),v(X,{key:1},[$e(M(t.message.content),1)],64))]),d.value?(g(),v("div",Rw,[f("button",{title:"编辑并重新发送",onClick:T[0]||(T[0]=P=>s("edit",t.message.content))},[J(de,{name:"edit",size:12}),T[4]||(T[4]=$e("编辑重发",-1))])])):B("",!0)])):(g(),v("div",Pw,[l.value&&(t.message.model||t.streaming||t.showTimestamp&&u.value)?(g(),v("div",Ew,[t.message.model?(g(),v("span",Lw,M(t.message.model),1)):B("",!0),t.streaming?(g(),v("span",Ow,[...T[5]||(T[5]=[f("i",{"aria-hidden":"true"},null,-1),$e("生成中",-1)])])):B("",!0),t.showTimestamp&&u.value?(g(),v("time",Dw,M(u.value),1)):B("",!0)])):B("",!0),f("div",Nw,[t.message.degraded?(g(),v("p",Bw,"该回合早于持久化快照:正文与思考在服务重启后无法恢复(工具记录与消息结构已保留)。")):B("",!0),L(_)?(g(!0),v(X,{key:1},Ce(a.value,P=>(g(),Oe(pw,{key:P.toolCallId,tool:P,active:t.streaming,"session-id":t.sessionId,"msg-seq":t.message.seq},null,8,["tool","active","session-id","msg-seq"]))),128)):B("",!0),c.value.length&&L(A)?(g(),Oe(iw,{key:2,name:"工具调用过程",tools:c.value,live:t.streaming,"work-dir":t.workDir,"session-id":t.sessionId},null,8,["tools","live","work-dir","session-id"])):B("",!0),t.message.content?(g(),Oe($d,{key:3,class:"assistant-content",content:t.message.content,streaming:t.streaming},null,8,["content","streaming"])):t.streaming?(g(),v("span",Gw)):B("",!0),t.message.turnStats?(g(),Oe(_w,{key:5,stats:t.message.turnStats},null,8,["stats"])):B("",!0),h.value.length?(g(),v("div",Fw,[(g(!0),v(X,null,Ce(h.value,P=>(g(),v("button",{key:P.filePath,type:"button",class:"written-file",title:`在文件面板中打开 ${P.filePath}`,onClick:N=>m(P.filePath)},[J(de,{name:"file",size:12}),f("span",Uw,M(p(P.filePath)),1)],8,jw))),128))])):B("",!0),t.message.content||t.message.isError&&!t.streaming||t.canFork?(g(),v("div",zw,[t.message.content?(g(),v("button",{key:0,title:o.value?"已复制":"复制内容",onClick:C},[J(de,{name:o.value?"check":"copy",size:12},null,8,["name"]),$e(M(o.value?"已复制":"复制"),1)],8,Hw)):B("",!0),t.message.content?(g(),v("button",{key:1,title:Y.value?"停止朗读":"朗读",onClick:I},[J(de,{name:Y.value?"speaker-off":"speaker",size:12},null,8,["name"]),$e(M(Y.value?"停止":"朗读"),1)],8,qw)):B("",!0),t.message.isError&&!t.streaming?(g(),v("button",{key:2,class:"retry-btn",title:"重发最后一条消息",onClick:T[1]||(T[1]=P=>s("retry"))},[J(de,{name:"refresh",size:12}),T[6]||(T[6]=$e("重试",-1))])):B("",!0),l.value&&t.canFork&&!t.streaming?(g(),v("button",{key:3,title:"以当前对话为起点创建一个新会话",onClick:T[2]||(T[2]=P=>s("fork"))},[J(de,{name:"fork",size:12}),T[7]||(T[7]=$e("Fork",-1))])):B("",!0)])):B("",!0)])]))],10,$w))}}),Vw=we(Ww,[["__scopeId","data-v-b26b63b1"]]),Kw=""+new URL("../icon.ico",import.meta.url).href,Yw={class:"empty-state"},Jw={key:0,class:"recent","aria-label":"最近输入"},Zw={class:"recent-chips"},Xw=["title","onClick"],Qw=["title"],eS={class:"workdir-path"},tS={class:"empty-status","aria-label":"连接与模型状态"},nS={class:"status-item"},sS={class:"status-item"},oS={class:"status-item"},iS="scream-recent-prompts",rS=ke({__name:"EmptyState",props:{workDir:{default:null},model:{default:null},contextUsage:{default:null},connected:{type:Boolean,default:!1}},emits:["pick"],setup(t,{emit:e}){const n=e,s=O([]);Ze(()=>{try{const i=localStorage.getItem(iS);if(i){const r=JSON.parse(i);Array.isArray(r)&&(s.value=r.filter(l=>typeof l=="string").slice(0,4))}}catch{s.value=[]}});function o(i){if(i==null)return"—";const r=i<=1?Math.round(i*100):Math.round(i);return`${Math.min(r,100)}%`}return(i,r)=>(g(),v("div",Yw,[r[4]||(r[4]=f("div",{class:"empty-logo"},[f("img",{src:Kw,alt:"Scream",class:"logo-img"})],-1)),r[5]||(r[5]=f("h1",{class:"empty-title"},"Scream Web UI",-1)),r[6]||(r[6]=f("p",{class:"empty-subtitle"},"给 Scream 发消息,开始处理你的任务",-1)),s.value.length>0?(g(),v("div",Jw,[r[0]||(r[0]=f("span",{class:"recent-label"},"最近",-1)),f("div",Zw,[(g(!0),v(X,null,Ce(s.value,(l,a)=>(g(),v("button",{key:`${a}-${l}`,class:"recent-chip",title:l,onClick:c=>n("pick",l)},M(l),9,Xw))),128))])])):B("",!0),t.workDir?(g(),v("div",{key:1,class:"empty-workdir",title:t.workDir},[r[1]||(r[1]=f("span",{class:"workdir-label"},"工作目录",-1)),f("span",eS,M(t.workDir),1)],8,Qw)):B("",!0),f("div",tS,[f("span",{class:le(["status-dot",t.connected?"on":"off"])},null,2),f("span",nS,M(t.connected?"已连接":"未连接"),1),t.model?(g(),v(X,{key:0},[r[2]||(r[2]=f("span",{class:"status-sep"},"·",-1)),f("span",sS,"模型 "+M(t.model),1)],64)):B("",!0),t.contextUsage!==null&&t.contextUsage!==void 0?(g(),v(X,{key:1},[r[3]||(r[3]=f("span",{class:"status-sep"},"·",-1)),f("span",oS,"上下文 "+M(o(t.contextUsage)),1)],64)):B("",!0)])]))}}),lS=we(rS,[["__scopeId","data-v-c57aef65"]]),aS={key:0,class:"minimap",role:"navigation","aria-label":"消息地图"},cS={class:"minimap-track"},uS=["title","aria-label","onMouseenter","onClick"],dS={key:0,class:"minimap-tooltip"},fS="(min-width: 960px)",hS=ke({__name:"ChatMinimap",props:{messages:{},host:{},revision:{},revealMessage:{type:Function}},setup(t){const e=t,n=O(null),o=typeof window.matchMedia=="function"?window.matchMedia(fS):null,i=O((o==null?void 0:o.matches)??!1);function r(b){i.value=b.matches}Ze(()=>o==null?void 0:o.addEventListener("change",r)),ft(()=>o==null?void 0:o.removeEventListener("change",r));function l(b){var S;const w=((S=b.content)==null?void 0:S.length)??0;return w<=0?.2:.2+.8*(1-1/(1+w/200))}const a=z(()=>{let b=0;return e.messages.map((w,S)=>{const _=l(w),A={id:w.id??`seq-${S}`,seq:w.seq??S,role:w.role??"tool",ratio:_,offset:b};return b+=_,A})}),c=z(()=>a.value.reduce((b,w)=>b+w.ratio,0)||1),u=O(new Set);let d=null;const h=typeof window<"u"&&typeof IntersectionObserver=="function";function p(){d==null||d.disconnect();const b=e.host;if(!(!b||!i.value||!h)){d=new IntersectionObserver(w=>{const S=new Set(u.value);for(const _ of w){const A=_.target.dataset.messageId;A&&(_.isIntersecting?S.add(A):S.delete(A))}u.value=S},{root:b,threshold:0});for(const w of e.messages){if(!w.id)continue;const S=b.querySelector(`[data-message-id="${CSS.escape(w.id)}"]`);S&&d.observe(S)}if(u.value.size){const w=new Set;for(const S of u.value)b.querySelector(`[data-message-id="${CSS.escape(S)}"]`)&&w.add(S);w.size!==u.value.size&&(u.value=w)}}}xe([()=>e.messages.length,()=>e.host,()=>e.revision,i],()=>{We(p)}),Ze(()=>p()),ft(()=>d==null?void 0:d.disconnect());function m(b){var A;const w=e.host;if(!w)return;(A=e.revealMessage)==null||A.call(e,b);const S=`[data-message-id="${CSS.escape(b)}"]`,_=()=>{var Y;(Y=w.querySelector(S))==null||Y.scrollIntoView({behavior:"smooth",block:"start"})};w.querySelector(S)?_():We(_)}function y(b){const w=b.role==="user"?"用户":b.role==="assistant"?"助手":"工具";return`#${b.seq} ${w}`}return(b,w)=>i.value&&a.value.length>0?(g(),v("div",aS,[f("div",cS,[(g(!0),v(X,null,Ce(a.value,S=>(g(),v("button",{key:S.id,class:le(["minimap-block",[`role-${S.role}`,{"in-view":u.value.has(S.id)}]]),style:$t({top:`${S.offset/c.value*100}%`,height:`${Math.max(S.ratio/c.value*100,2)}%`}),title:y(S),"aria-label":y(S),onMouseenter:_=>n.value=S.seq,onMouseleave:w[0]||(w[0]=_=>n.value=null),onClick:_=>m(S.id)},[n.value===S.seq?(g(),v("span",dS,M(y(S)),1)):B("",!0)],46,uS))),128))])])):B("",!0)}}),pS=we(hS,[["__scopeId","data-v-45fa4a5f"]]);function Na(t,e){return t-e}function Ba(t,e){return Math.max(0,t-e)}const gS={class:"message-list-wrapper"},mS={key:0,class:"conn-banner",role:"status"},vS=["disabled"],yS={key:0,class:"day-divider",role:"separator"},bS={key:1,class:"turn-divider","aria-hidden":"true"},kS={key:2,class:"message-skeleton","aria-hidden":"true"},wS=["aria-label"],SS={key:0,class:"scroll-badge"},_S=80,$S=40,xS=8,CS=ke({__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(t,{emit:e}){const n=t,s=e,o=O(null),i=O(null);let r=null;const l=z(()=>{for(let H=n.messages.length-1;H>=0;H--)if(n.messages[H].role==="user")return n.messages[H].id;return null}),a=z(()=>{var H;return((H=n.messages.at(-1))==null?void 0:H.id)??null}),c=z(()=>{var H;return((H=[...n.messages].reverse().find(K=>K.role==="assistant"))==null?void 0:H.id)??null});function u(H){const K=n.messages[H];if(!K)return!1;if(K.role!=="assistant")return!0;const ie=n.messages[H+1];return!ie||ie.role!=="assistant"||K.ts!==void 0&&ie.ts!==void 0&&ie.ts-K.ts>300*1e3}function d(H){const K=n.messages[H];return!!K&&H>0&&K.role==="user"}function h(H){const K=n.messages[H],ie=H>0?n.messages[H-1]:void 0;return!K||!ie||K.ts===void 0||ie.ts===void 0||ry(ie.ts,K.ts)?null:ly(K.ts)}const p={streaming:!1,isLatestUser:!1,canFork:!1,showTimestamp:!1,idle:!0},m=z(()=>{const H=l.value,K=a.value,ie=c.value,q=[];return n.messages.forEach((oe,j)=>{const fe=h(j);fe!==null?q.push({kind:"day-divider",key:`${oe.id}-divider`,dividerText:fe,flags:p}):d(j)&&q.push({kind:"turn-divider",key:`${oe.id}-divider`,dividerText:null,flags:p}),q.push({kind:"message",key:oe.id,message:oe,dividerText:null,flags:{streaming:n.busy&&oe.id===K&&oe.role==="assistant",isLatestUser:oe.id===H,canFork:!n.busy&&oe.id===ie,showTimestamp:u(j),idle:!n.busy}})}),q});function y(H){return Math.max(0,H-_S)}const b=O(y(m.value.length)),w=z(()=>{const H=m.value.length,K=Math.min(Math.max(0,b.value),H);return m.value.slice(K)}),S=z(()=>b.value>0||n.olderAvailable);function _(H){const K=m.value;for(let ie=0;ie<K.length;ie++){const q=K[ie];if(q.kind==="message"&&q.message.id===H)return ie}return-1}function A(H){const K=_(H);return K<0?!1:(K>=b.value||Y(()=>{b.value=Math.max(0,K-xS)}),!0)}function Y(H){const K=o.value;if(!K){H();return}const ie=Na(K.scrollHeight,K.scrollTop);H(),We(()=>{const q=o.value;q&&(q.scrollTop=Ba(q.scrollHeight,ie))})}let G=!1;const I=z(()=>{var ie;const H=n.messages.at(-1);if(!H)return 0;let K=H.content.length;for(const q of H.tools)K+=((ie=q.output)==null?void 0:ie.length)??0;return K});let C=!1;const k=O(!1),T=O(0);function P(){const H=o.value;return H?H.scrollHeight-H.scrollTop-H.clientHeight<80:!0}function N(){return typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function re(H){b.value=y(m.value.length),requestAnimationFrame(()=>{const K=o.value;if(!K)return;const ie=N()?"auto":H;K.scrollTo({top:K.scrollHeight,behavior:ie})})}let F=null;function D(){const H=o.value,K=n.sessionId;!H||!K||F===null&&(F=requestAnimationFrame(()=>{F=null;try{localStorage.setItem(`scream-scroll:${K}`,String(H.scrollTop))}catch{}}))}function ne(){const H=o.value,K=n.sessionId;if(!H||!K)return;let ie=null;try{ie=localStorage.getItem(`scream-scroll:${K}`)}catch{}if(!ie)return;const q=Number(ie);if(q>0){if(q>H.scrollHeight-H.clientHeight&&b.value>0){b.value=0,We(()=>{H.scrollTop=q});return}H.scrollTop=q}}let ue=!1;xe(()=>{var H;return[((H=n.messages[0])==null?void 0:H.id)??null,n.messages.length,n.sessionId]},([H,K,ie],[q,oe,j])=>{const fe=K>0&&H!==null&&q!==null&&H!==q&&K>(oe??0)&&ie===j;if(ue=fe,!fe)return;G=!0;const Se=o.value;if(!Se)return;const ve=Na(Se.scrollHeight,Se.scrollTop);We(()=>{Se.scrollTop=Ba(Se.scrollHeight,ve)})}),xe(()=>m.value.length,(H,K)=>{const ie=K??0;if(G){G=!1;return}b.value===y(ie)&&!k.value?b.value=y(H):b.value>y(H)&&Y(()=>{b.value=y(H)})});function ge(){const H=o.value;if(!H)return;const K=H.scrollHeight-H.scrollTop-H.clientHeight>80;k.value=K,K||(T.value=0),K&&C&&(C=!1),n.busy||D()}let Ne="";xe(()=>n.sessionId,()=>{Ne="",T.value=0,ue=!1,b.value=y(m.value.length)}),xe(()=>[n.messages.length,I.value],([H],[K])=>{if(H!==K){const ie=ue;if(ue=!1,H>0&&Ne!==n.sessionId){Ne=n.sessionId,requestAnimationFrame(()=>requestAnimationFrame(ne));return}if(ie)return;if(!P()){T.value=Math.max(0,T.value+Math.max(0,H-(K??0)));return}C=!0,k.value=!1,re("smooth");return}!C&&!P()||re("auto")}),xe(()=>n.busy,H=>{H||(C=!1)});function He(){C=!0,k.value=!1,T.value=0,re("smooth")}const ze=z(()=>!n.busy||n.messages.length===0?!1:n.messages.at(-1).role==="user");return Ze(()=>{var H;(H=o.value)==null||H.addEventListener("scroll",ge,{passive:!0}),typeof IntersectionObserver<"u"&&(r=new IntersectionObserver(K=>{var ie;(ie=K[0])!=null&&ie.isIntersecting&&(b.value>0&&Y(()=>{b.value=Math.max(0,b.value-$S)}),b.value===0&&n.olderAvailable&&!n.olderLoading&&n.messages.length>0&&s("load-older"))},{root:o.value,rootMargin:"120px 0px 0px 0px"}),i.value&&r.observe(i.value)),requestAnimationFrame(()=>requestAnimationFrame(ne))}),Vo(()=>{var H;(H=o.value)==null||H.removeEventListener("scroll",ge),r==null||r.disconnect(),r=null,F!==null&&(cancelAnimationFrame(F),F=null)}),xe(i,H=>{r&&(r.disconnect(),H&&r.observe(H))}),(H,K)=>(g(),v("div",gS,[!t.connected&&t.messages.length>0?(g(),v("div",mS,[K[8]||(K[8]=f("span",{class:"conn-dot","aria-hidden":"true"},null,-1)),K[9]||(K[9]=f("span",null,"连接中断,自动恢复中…",-1)),f("button",{class:"conn-retry",onClick:K[0]||(K[0]=ie=>s("retry-connection"))},"立即重试")])):B("",!0),f("div",{ref_key:"listRef",ref:o,class:"message-list"},[S.value?(g(),v("div",{key:0,ref_key:"topSentinelRef",ref:i,class:"load-older-row"},[t.olderAvailable?(g(),v("button",{key:0,class:"load-older-btn",disabled:t.olderLoading,onClick:K[1]||(K[1]=ie=>s("load-older"))},M(t.olderLoading?"加载中…":"加载更早消息"),9,vS)):B("",!0)],512)):B("",!0),t.messages.length===0?(g(),Oe(lS,{key:1,"work-dir":t.workDir,model:t.model,"context-usage":t.contextUsage,connected:t.connected,onPick:K[2]||(K[2]=ie=>s("pick",ie))},null,8,["work-dir","model","context-usage","connected"])):B("",!0),(g(!0),v(X,null,Ce(w.value,(ie,q,oe,j)=>{const fe=[ie.message,ie.flags.streaming,ie.flags.isLatestUser,ie.flags.canFork,ie.flags.showTimestamp,ie.flags.idle,ie.dividerText,t.busy,t.sessionId,t.workDir];if(j&&j.el&&j.key===ie.key&&xh(j,fe))return j;const Se=(g(),v(X,{key:ie.key},[ie.kind==="day-divider"?(g(),v("div",yS,[f("span",null,M(ie.dividerText),1)])):ie.kind==="turn-divider"?(g(),v("div",bS)):(g(),Oe(Vw,{key:2,message:ie.message,"is-latest-user":ie.flags.isLatestUser,idle:ie.flags.idle,streaming:ie.flags.streaming,"session-id":t.sessionId,"can-fork":ie.flags.canFork,"show-timestamp":ie.flags.showTimestamp,"work-dir":t.workDir??void 0,onEdit:K[3]||(K[3]=ve=>s("edit",ve)),onRetry:K[4]||(K[4]=ve=>s("retry-message")),onFork:K[5]||(K[5]=ve=>s("fork"))},null,8,["message","is-latest-user","idle","streaming","session-id","can-fork","show-timestamp","work-dir"]))],64));return Se.memo=fe,Se},K,6),128)),ze.value?(g(),v("div",kS,[...K[10]||(K[10]=[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)])])):B("",!0)],512),J(pS,{messages:t.messages,host:o.value,revision:b.value,"reveal-message":A},null,8,["messages","host","revision"]),J(Xo,{name:"scroll-btn"},{default:bt(()=>[k.value?(g(),v("button",{key:0,class:le(["scroll-to-bottom",{streaming:t.busy}]),title:"滚动到最新消息","aria-label":T.value>0?`滚动到最新消息,${T.value} 条新消息`:"滚动到最新消息",onClick:He},[J(de,{name:"chevron-down",size:18}),T.value>0?(g(),v("span",SS,M(T.value>99?"99+":T.value),1)):B("",!0)],10,wS)):B("",!0)]),_:1})]))}}),TS=we(CS,[["__scopeId","data-v-87c7a948"]]),IS={class:"files-pane"},MS={class:"files-path"},AS={class:"crumbs"},RS=["onClick"],PS={key:0,class:"crumb-sep"},ES={class:"crumb-name"},LS={key:0,class:"files-error"},OS={key:1,class:"files-loading"},DS={class:"files-list"},NS=["onClick"],BS={class:"files-name"},GS={class:"files-meta"},FS={key:0,class:"files-empty"},Ga="/api/v1/files",jS=ke({__name:"FilesBrowser",props:{initialPath:{default:""}},setup(t){const e=t,n=O(""),s=O([]),o=O(!1),i=O(""),r=z(()=>{if(!n.value)return[];const d=n.value.split("/"),h=[];for(let p=0;p<d.length;p++){if(d[p]==="")continue;let m=d[p];p>1&&m==="Users"&&d[p-1]===""&&(m=m),h.push({label:m.slice(0,12),path:d.slice(0,p+1).join("/")||"/"})}return h.length>4?[{label:"…",path:"/"},...h.slice(h.length-3)]:h});async function l(d){o.value=!0,i.value="";try{const h=await fetch(`${Ga}/list?path=${encodeURIComponent(d)}`);if(!h.ok)throw new Error(`HTTP ${h.status}`);const p=await h.json();n.value=p.path||await a(),s.value=p.entries,n.value||(i.value="没有可访问的目录(尚无会话)")}catch(h){i.value=h instanceof Error?h.message:String(h)}finally{o.value=!1}}async function a(){try{return(await(await fetch(`${Ga}/root`)).json()).roots[0]??""}catch{return""}}async function c(d){if(d.type==="dir"){await l(d.path);return}Dn(d.path)}function u(d){return d<1024?`${d} B`:d<1024*1024?`${(d/1024).toFixed(1)} KB`:`${(d/(1024*1024)).toFixed(1)} MB`}return Ze(()=>{l(e.initialPath)}),xe(()=>e.initialPath,d=>{d&&l(d)}),(d,h)=>(g(),v("div",IS,[f("div",MS,[f("button",{class:"files-up",title:"上一级","aria-label":"上一级",onClick:h[0]||(h[0]=p=>l(n.value.split("/").slice(0,-1).join("/")||"/"))},[J(de,{name:"chevron-left",size:16})]),f("div",AS,[(g(!0),v(X,null,Ce(r.value,(p,m)=>(g(),v("span",{key:m,class:"crumb",onClick:y=>l(p.path)},[m>0?(g(),v("b",PS,"/")):B("",!0),f("span",ES,M(p.label),1)],8,RS))),128))])]),i.value?(g(),v("p",LS,M(i.value),1)):o.value?(g(),v("p",OS,"加载中…")):B("",!0),f("ul",DS,[(g(!0),v(X,null,Ce(s.value,p=>(g(),v("li",{key:p.path},[f("button",{class:le(["files-item",{dir:p.type==="dir"}]),onClick:m=>c(p)},[J(de,{name:p.type==="dir"?"folder":"file",size:16},null,8,["name"]),f("span",BS,M(p.name),1),f("span",GS,M(p.type==="dir"?"目录":u(p.size)),1)],10,NS)]))),128)),!o.value&&s.value.length===0?(g(),v("li",FS,"空目录")):B("",!0)])]))}}),US=we(jS,[["__scopeId","data-v-6a35b004"]]),zS=34;function Pi(t){const e=t.split("/"),n=e.at(-1)??t;return e.length<=2?{dir:e.length===2?`${e[0]}/`:"",base:n}:t.length<=zS?{dir:`${e.slice(0,-1).join("/")}/`,base:n}:{dir:`…/${e.at(-2)}/`,base:n}}const HS={class:"panel-head-row"},qS=["aria-expanded"],WS={class:"head-icon"},VS=["title"],KS={key:1,class:"head-hint"},YS={class:"head-tail"},JS={key:0,class:"head-count"},ZS={class:"panel-body"},XS={key:0,class:"git-files"},QS=["title","onClick"],e_={class:"git-file-name"},t_={key:0,class:"git-file-dir"},n_={class:"git-file-base"},s_={key:0,class:"git-file-stat"},o_={key:0,class:"add"},i_={key:1,class:"del"},r_={key:2,class:"diff-body"},l_={key:3,class:"diff-empty"},a_={key:1,class:"diff-empty"},c_=8,Fa="scream-panel-git-open",u_=ke({__name:"GitPanel",props:{gitStatus:{default:null}},emits:["refresh","diff"],setup(t,{emit:e}){const n=t,s=e,o={M:"M",A:"A",D:"D",R:"R",U:"U","??":"?","?":"?"},i={D:"danger",A:"success",R:"success",U:"danger","??":"warning","?":"warning"},r=O(!1),l=O(!0);try{l.value=localStorage.getItem(Fa)!=="0"}catch{}function a(){l.value=!l.value;try{localStorage.setItem(Fa,l.value?"1":"0")}catch{}}function c(){s("refresh")}const u=z(()=>{var m;const p=((m=n.gitStatus)==null?void 0:m.files)??[];return r.value?p:p.slice(0,c_)}),d=z(()=>{var p,m;return Math.max(0,(((m=(p=n.gitStatus)==null?void 0:p.files)==null?void 0:m.length)??0)-u.value.length)}),h=z(()=>{var b,w;const p=((b=n.gitStatus)==null?void 0:b.ahead)??0,m=((w=n.gitStatus)==null?void 0:w.behind)??0;if(!p&&!m)return"";const y=[];return p&&y.push(`↑${p}`),m&&y.push(`↓${m}`),` · ${y.join(" ")}`});return(p,m)=>{var y;return g(),v("section",{class:le(["panel-section","git-panel",{"is-open":l.value}])},[f("div",HS,[f("button",{class:"panel-head","aria-expanded":l.value,onClick:a},[f("span",WS,[J(de,{name:"git-branch",size:14})]),m[1]||(m[1]=f("span",{class:"head-title"},"Git 变更",-1)),t.gitStatus?(g(),v("span",{key:0,class:"head-hint",title:`${t.gitStatus.branch??"detached"}${h.value}`},M(t.gitStatus.branch??"detached")+M(h.value),9,VS)):(g(),v("span",KS,"状态不可用")),f("span",YS,[t.gitStatus?(g(),v("span",JS,M(t.gitStatus.changed),1)):B("",!0),J(de,{class:le(["chevron",{rotated:l.value}]),name:"chevron-down",size:14},null,8,["class"])])],8,qS),f("button",{class:"icon-btn",title:"刷新","aria-label":"刷新 Git 状态",onClick:c},[J(de,{name:"refresh",size:14})])]),qe(f("div",ZS,[t.gitStatus?(g(),v(X,{key:0},[u.value.length?(g(),v("ul",XS,[(g(!0),v(X,null,Ce(u.value,b=>(g(),v("li",{key:b.path},[f("button",{class:"git-file",title:`查看 ${b.displayPath??b.path} 的 diff`,onClick:w=>s("diff",{path:b.path,display:b.displayPath??b.path,adds:b.adds,dels:b.dels})},[f("span",{class:le(["git-file-status",i[b.status]??""])},M(o[b.status]??b.status),3),f("span",e_,[L(Pi)(b.displayPath??b.path).dir?(g(),v("span",t_,M(L(Pi)(b.displayPath??b.path).dir),1)):B("",!0),f("span",n_,M(L(Pi)(b.displayPath??b.path).base),1)]),b.adds!==void 0||b.dels!==void 0?(g(),v("span",s_,[b.adds?(g(),v("span",o_,"+"+M(b.adds),1)):B("",!0),b.dels?(g(),v("span",i_,"−"+M(b.dels),1)):B("",!0)])):B("",!0)],8,QS)]))),128))])):B("",!0),d.value?(g(),v("button",{key:1,class:"git-more",onClick:m[0]||(m[0]=b=>r.value=!r.value)},M(r.value?"收起列表":`显示全部 ${((y=t.gitStatus.files)==null?void 0:y.length)??0} 个文件`),1)):B("",!0),t.gitStatus.diffStat?(g(),v("pre",r_,M(t.gitStatus.diffStat),1)):u.value.length?B("",!0):(g(),v("div",l_,"工作区干净,没有变更。"))],64)):(g(),v("div",a_,"读取 Git 状态失败,点右上角刷新重试。"))],512),[[du,l.value]])],2)}}}),d_=we(u_,[["__scopeId","data-v-0ccd2eee"]]),f_={class:"goal-panel panel-section"},h_={class:"section-heading"},p_={class:"head-icon"},g_=["title"],m_={key:0,class:"head-tail"},v_={class:"panel-body"},y_={key:0,class:"empty-state"},b_=["disabled"],k_={class:"refine-row"},w_=["disabled"],S_={key:0},__=["disabled"],$_={class:"budget-grid"},x_=["disabled"],C_=["disabled"],T_={class:"time-budget"},I_=["disabled"],M_=["disabled"],A_=["disabled"],R_={key:0,class:"goal-summary"},P_={class:"objective"},E_={class:"criterion"},L_={key:0,class:"reason"},O_={class:"goal-metrics"},D_={class:"goal-metric"},N_={key:0,class:"bar"},B_={class:"goal-metric"},G_={key:0,class:"bar"},F_={class:"goal-metric"},j_={key:0,class:"bar"},U_={key:1,class:"budget-warning"},z_={key:2,class:"notes"},H_={class:"panel-actions"},q_=["disabled"],W_=["disabled"],V_=["disabled"],K_=["disabled"],Y_=["disabled"],J_={class:"budget-grid"},Z_=["disabled"],X_=["disabled"],Q_={class:"time-budget"},e$=["disabled"],t$=["disabled"],n$={class:"edit-actions"},s$=["disabled"],o$=["disabled"],i$={key:3,class:"form-error"},r$={key:4,class:"pending-copy"},l$=ke({__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(t){const e=t,n=O(""),s=O(""),o=O(""),i=O(""),r=O(""),l=O("minutes"),a=O(!1),c=O(null),u=O(!1),d=z(()=>e.connectionStatus==="connected"),h=z(()=>!e.sessionId||!d.value||e.archived||e.pending),p=z(()=>h.value),m=z(()=>{var F;return{active:"进行中",paused:"已暂停",blocked:"受阻",complete:"已完成"}[((F=e.goal)==null?void 0:F.status)??"active"]}),y=z(()=>e.sessionId?e.archived?"归档会话为只读状态":d.value?e.pending?"正在提交请求…":e.goal?"状态由核心事件实时同步":"创建后 Agent 将自动开始执行":"连接恢复后可继续管理":"选择或新建会话后即可配置");xe(()=>e.sessionId,()=>{a.value=!1,b()}),xe(()=>{var F;return(F=e.goal)==null?void 0:F.goalId},(F,D)=>{a.value=!1,F!==D&&b()});function b(){n.value="",s.value="",o.value="",i.value="",r.value="",l.value="minutes",u.value=!1,c.value=null}function w(F,D){const ne=F.trim();if(!ne)return null;const ue=Number(ne);if(!Number.isSafeInteger(ue)||ue<=0){c.value=`${D}必须是正整数。`;return}return ue}function S(){c.value=null;const F=w(o.value,"轮次预算");if(F===void 0)return null;const D=w(i.value,"Token 预算");if(D===void 0)return null;const ne=w(r.value,"时间预算");if(ne===void 0)return null;const ue=[];return F!==null&&ue.push({value:F,unit:"turns"}),D!==null&&ue.push({value:D,unit:"tokens"}),ne!==null&&ue.push({value:ne,unit:l.value}),ue}async function _(){const F=n.value.trim();if(!F){c.value="请先输入需要优化的目标描述。";return}c.value=null,u.value=!1;const D=await e.refineGoal(F);D!==null&&(n.value=D,u.value=!0)}async function A(){const F=n.value.trim();if(!F){c.value="目标内容不能为空。";return}const D=S();if(D===null)return;await e.createGoal({objective:F,completionCriterion:s.value.trim()||void 0,replace:!1,budgets:D})&&(u.value=!1)}function Y(F){F===null?(r.value="",l.value="minutes"):F%36e5===0?(r.value=String(F/36e5),l.value="hours"):F%6e4===0?(r.value=String(F/6e4),l.value="minutes"):F%1e3===0?(r.value=String(F/1e3),l.value="seconds"):(r.value=String(F),l.value="milliseconds")}function G(){const F=e.goal;F&&(n.value=F.objective,o.value=F.budget.turnBudget===null?"":String(F.budget.turnBudget),i.value=F.budget.tokenBudget===null?"":String(F.budget.tokenBudget),Y(F.budget.wallClockBudgetMs),c.value=null,a.value=!0)}function I(F,D){return D==="hours"?F*36e5:D==="minutes"?F*6e4:D==="seconds"?F*1e3:F}async function C(){const F=e.goal;if(!F)return;const D=n.value.trim();if(!D){c.value="目标内容不能为空。";return}const ne=S();if(ne===null)return;const ue=w(o.value,"轮次预算"),ge=w(i.value,"Token 预算"),Ne=w(r.value,"时间预算");if(ue===void 0||ge===void 0||Ne===void 0)return;if(F.budget.turnBudget!==null&&ue===null){c.value="当前协议不支持清除已有轮次预算,请填写新的正整数。";return}if(F.budget.tokenBudget!==null&&ge===null){c.value="当前协议不支持清除已有 Token 预算,请填写新的正整数。";return}if(F.budget.wallClockBudgetMs!==null&&Ne===null){c.value="当前协议不支持清除已有时间预算,请填写新的正整数。";return}const He=ne.filter(K=>K.unit==="turns"?K.value!==F.budget.turnBudget:K.unit==="tokens"?K.value!==F.budget.tokenBudget:I(K.value,K.unit)!==F.budget.wallClockBudgetMs),ze=D===F.objective?void 0:D;if(ze===void 0&&He.length===0){c.value="目标与预算没有变化。";return}await e.updateGoal({objective:ze,budgets:He})&&(a.value=!1)}async function k(F){c.value=null,!(F==="cancel"&&!window.confirm("确定取消当前 Goal?当前 Goal 状态将被清除。"))&&(F==="pause"?await e.pauseGoal():F==="resume"?await e.resumeGoal():await e.cancelGoal())}function T(F){return F.toLocaleString("zh-CN")}function P(F){if(F<1e3)return`${F} 毫秒`;const D=Math.floor(F/1e3);if(D<60)return`${D} 秒`;const ne=Math.floor(D/3600),ue=Math.floor(D%3600/60);return ne>0?`${ne} 小时 ${ue} 分钟`:`${ue} 分钟`}function N(F,D){return D===null||D<=0?0:Math.min(100,Math.round(F/D*100))}function re(F){return new Date(F).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}return(F,D)=>(g(),v("section",f_,[f("div",h_,[f("span",p_,[J(de,{name:"target",size:14})]),D[15]||(D[15]=f("span",{class:"head-title"},"Goal 管理",-1)),f("span",{class:"head-hint",title:y.value},M(y.value),9,g_),t.goal?(g(),v("span",m_,[f("span",{class:le(["status-pill",`is-${t.goal.status}`])},M(m.value),3)])):B("",!0)]),f("div",v_,[t.sessionId?t.goal?(g(),v(X,{key:2},[a.value?(g(),v("form",{key:1,class:"goal-form edit-form",onSubmit:Ye(C,["prevent"])},[f("label",null,[D[31]||(D[31]=f("span",null,"目标内容",-1)),qe(f("textarea",{"onUpdate:modelValue":D[9]||(D[9]=ne=>n.value=ne),rows:"3",maxlength:"4000",disabled:h.value||t.busy},null,8,Y_),[[Xe,n.value]])]),D[36]||(D[36]=f("div",{class:"budget-title"},[$e("更新预算 "),f("small",null,"仅提交发生变化的预算")],-1)),f("div",J_,[f("label",null,[D[32]||(D[32]=f("span",null,"轮次",-1)),qe(f("input",{"onUpdate:modelValue":D[10]||(D[10]=ne=>o.value=ne),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||t.busy},null,8,Z_),[[Xe,o.value]])]),f("label",null,[D[33]||(D[33]=f("span",null,"Token",-1)),qe(f("input",{"onUpdate:modelValue":D[11]||(D[11]=ne=>i.value=ne),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||t.busy},null,8,X_),[[Xe,i.value]])])]),f("div",Q_,[f("label",null,[D[34]||(D[34]=f("span",null,"时间",-1)),qe(f("input",{"onUpdate:modelValue":D[12]||(D[12]=ne=>r.value=ne),type:"number",min:"1",step:"1",placeholder:"不限",disabled:h.value||t.busy},null,8,e$),[[Xe,r.value]])]),qe(f("select",{"onUpdate:modelValue":D[13]||(D[13]=ne=>l.value=ne),"aria-label":"时间预算单位",disabled:h.value||t.busy},[...D[35]||(D[35]=[f("option",{value:"minutes"},"分钟",-1),f("option",{value:"hours"},"小时",-1),f("option",{value:"seconds"},"秒",-1),f("option",{value:"milliseconds"},"毫秒",-1)])],8,t$),[[Vl,l.value]])]),f("div",n$,[f("button",{type:"button",class:"secondary",disabled:t.pending,onClick:D[14]||(D[14]=ne=>a.value=!1)},"返回",8,s$),f("button",{class:"primary small",type:"submit",disabled:h.value||t.busy},"保存修改",8,o$)])],32)):(g(),v("div",R_,[f("div",P_,[D[24]||(D[24]=f("small",null,"目标",-1)),f("p",null,M(t.goal.objective),1)]),f("div",E_,[D[25]||(D[25]=f("small",null,"完成标准",-1)),f("p",null,M(t.goal.completionCriterion??"未设置,由 Agent 根据目标判断完成。"),1)]),t.goal.terminalReason?(g(),v("div",L_,[D[26]||(D[26]=f("strong",null,"状态原因",-1)),f("span",null,M(t.goal.terminalReason),1)])):B("",!0),f("dl",O_,[f("div",D_,[D[27]||(D[27]=f("dt",null,"轮次",-1)),f("dd",null,M(t.goal.turnsUsed)+" / "+M(t.goal.budget.turnBudget??"不限"),1),t.goal.budget.turnBudget!==null?(g(),v("i",N_,[f("i",{style:$t({width:`${N(t.goal.turnsUsed,t.goal.budget.turnBudget)}%`})},null,4)])):B("",!0)]),f("div",B_,[D[28]||(D[28]=f("dt",null,"Token",-1)),f("dd",null,M(T(t.goal.tokensUsed))+" / "+M(t.goal.budget.tokenBudget===null?"不限":T(t.goal.budget.tokenBudget)),1),t.goal.budget.tokenBudget!==null?(g(),v("i",G_,[f("i",{style:$t({width:`${N(t.goal.tokensUsed,t.goal.budget.tokenBudget)}%`})},null,4)])):B("",!0)]),f("div",F_,[D[29]||(D[29]=f("dt",null,"时间",-1)),f("dd",null,M(P(t.goal.wallClockMs))+" / "+M(t.goal.budget.wallClockBudgetMs===null?"不限":P(t.goal.budget.wallClockBudgetMs)),1),t.goal.budget.wallClockBudgetMs!==null?(g(),v("i",j_,[f("i",{style:$t({width:`${N(t.goal.wallClockMs,t.goal.budget.wallClockBudgetMs)}%`})},null,4)])):B("",!0)])]),t.goal.budget.overBudget?(g(),v("div",U_,"已达到或超过执行预算。")):B("",!0),t.goal.notes.length?(g(),v("details",z_,[f("summary",null,"工作记录("+M(t.goal.notes.length)+")",1),f("ol",null,[(g(!0),v(X,null,Ce(t.goal.notes,ne=>(g(),v("li",{key:`${ne.time}-${ne.content}`},[f("time",null,M(re(ne.time)),1),f("span",null,M(ne.content),1)]))),128))])])):B("",!0),f("div",H_,[t.goal.status!=="complete"?(g(),v("button",{key:0,class:"secondary",disabled:h.value||t.busy,onClick:G},[J(de,{name:"edit",size:14}),D[30]||(D[30]=$e("编辑",-1))],8,q_)):B("",!0),t.goal.status==="active"?(g(),v("button",{key:1,class:"secondary",disabled:h.value,onClick:D[6]||(D[6]=ne=>k("pause"))},"暂停",8,W_)):B("",!0),t.goal.status==="paused"||t.goal.status==="blocked"?(g(),v("button",{key:2,class:"primary small",disabled:h.value||t.busy,onClick:D[7]||(D[7]=ne=>k("resume"))},"继续",8,V_)):B("",!0),f("button",{class:"danger",disabled:h.value,onClick:D[8]||(D[8]=ne=>k("cancel"))},"取消 Goal",8,K_)])]))],64)):(g(),v("form",{key:1,class:"goal-form",onSubmit:Ye(A,["prevent"])},[f("label",null,[D[16]||(D[16]=f("span",null,"目标内容",-1)),qe(f("textarea",{"onUpdate:modelValue":D[0]||(D[0]=ne=>n.value=ne),rows:"3",maxlength:"4000",placeholder:"描述希望 Agent 持续完成的目标",disabled:p.value},null,8,b_),[[Xe,n.value]])]),f("div",k_,[f("button",{type:"button",class:"secondary",disabled:p.value||!n.value.trim(),onClick:_},[J(de,{name:"sparkles",size:15}),D[17]||(D[17]=$e(" AI 优化 ",-1))],8,w_),u.value?(g(),v("small",S_,"已优化,请确认或继续编辑后再创建。")):B("",!0)]),f("label",null,[D[18]||(D[18]=f("span",null,[$e("完成标准 "),f("small",null,"可选")],-1)),qe(f("textarea",{"onUpdate:modelValue":D[1]||(D[1]=ne=>s.value=ne),rows:"2",placeholder:"例如:聚焦测试、类型检查与 Web 构建全部通过",disabled:p.value},null,8,__),[[Xe,s.value]])]),D[23]||(D[23]=f("div",{class:"budget-title"},[$e("执行预算 "),f("small",null,"留空表示不限制")],-1)),f("div",$_,[f("label",null,[D[19]||(D[19]=f("span",null,"轮次",-1)),qe(f("input",{"onUpdate:modelValue":D[2]||(D[2]=ne=>o.value=ne),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,x_),[[Xe,o.value]])]),f("label",null,[D[20]||(D[20]=f("span",null,"Token",-1)),qe(f("input",{"onUpdate:modelValue":D[3]||(D[3]=ne=>i.value=ne),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,C_),[[Xe,i.value]])])]),f("div",T_,[f("label",null,[D[21]||(D[21]=f("span",null,"时间",-1)),qe(f("input",{"onUpdate:modelValue":D[4]||(D[4]=ne=>r.value=ne),type:"number",min:"1",step:"1",placeholder:"不限",disabled:p.value},null,8,I_),[[Xe,r.value]])]),qe(f("select",{"onUpdate:modelValue":D[5]||(D[5]=ne=>l.value=ne),"aria-label":"时间预算单位",disabled:p.value},[...D[22]||(D[22]=[f("option",{value:"minutes"},"分钟",-1),f("option",{value:"hours"},"小时",-1),f("option",{value:"seconds"},"秒",-1),f("option",{value:"milliseconds"},"毫秒",-1)])],8,M_),[[Vl,l.value]])]),f("button",{class:"primary",type:"submit",disabled:p.value||!n.value.trim()},M(t.pending?"正在创建…":"创建并开始执行"),9,A_)],32)):(g(),v("div",y_,"暂无会话,Goal 管理暂不可用。")),c.value||t.error?(g(),v("p",i$,M(c.value??t.error),1)):t.pending?(g(),v("p",r$,"请求处理中,状态将在核心事件到达后同步。")):B("",!0)])]))}}),a$=we(l$,[["__scopeId","data-v-2e8dbdc6"]]),c$={class:"panel-section like-section"},u$={class:"section-heading"},d$={class:"head-icon"},f$={class:"panel-body"},h$={class:"kv-rows"},p$={class:"dialog"},g$=["onUpdate:modelValue","placeholder"],m$={key:0,class:"dialog-error"},v$={class:"dialog-actions"},y$=["disabled"],b$=ke({__name:"LikePanel",props:{like:{},updateLike:{type:Function}},setup(t){const e=t,n=O(!1),s=O(!1),o=O(""),i=O({}),r=[{key:"nickname",label:"昵称",placeholder:"用户称呼,如:老板"},{key:"tone",label:"语气",placeholder:"AI 风格,如:专业不拖沓"},{key:"other",label:"偏好",placeholder:"其他用户偏好"},{key:"doNot",label:"禁止",placeholder:"用户明确不让做的事"}];function l(){i.value={...e.like},o.value="",n.value=!0}async function a(){s.value=!0,o.value="";const c=await e.updateLike(i.value);s.value=!1,c?n.value=!1:o.value="保存失败"}return(c,u)=>(g(),v("section",c$,[f("div",u$,[f("span",d$,[J(de,{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",f$,[f("dl",h$,[(g(),v(X,null,Ce(r,d=>f("div",{key:d.key,class:"kv-row"},[f("dt",null,M(d.label),1),f("dd",null,M((t.like[d.key]??"").trim()||"未设置"),1)])),64))]),f("div",{class:"panel-actions"},[f("button",{class:"like-edit",onClick:l},"编辑偏好")])]),n.value?(g(),v("div",{key:0,class:"dialog-overlay",onClick:u[1]||(u[1]=Ye(d=>n.value=!1,["self"]))},[f("div",p$,[u[4]||(u[4]=f("div",{class:"dialog-title"},"编辑用户偏好",-1)),(g(),v(X,null,Ce(r,d=>f("label",{key:d.key,class:"dialog-field"},[f("span",null,M(d.label),1),qe(f("input",{"onUpdate:modelValue":h=>i.value[d.key]=h,placeholder:d.placeholder},null,8,g$),[[Xe,i.value[d.key]]])])),64)),o.value?(g(),v("div",m$,M(o.value),1)):B("",!0),f("div",v$,[f("button",{onClick:u[0]||(u[0]=d=>n.value=!1)},"取消"),f("button",{disabled:s.value,onClick:a},M(s.value?"保存中…":"确认"),9,y$)])])])):B("",!0)]))}}),k$=we(b$,[["__scopeId","data-v-a7906d58"]]),w$=["aria-expanded"],S$={class:"head-icon"},_$={class:"head-hint"},$$={class:"head-tail"},x$=["title"],C$={class:"panel-body"},T$={class:"stat-grid"},I$={class:"stat"},M$={class:"stat"},A$=["title"],R$={key:1,class:"faint"},P$={class:"stat wide"},E$={class:"mono"},ja="scream-panel-runstatus-open",L$=ke({__name:"RunStatusPanel",props:{status:{},busy:{type:Boolean,default:!1},connectionStatus:{}},setup(t){const e=t,n=O(!0);try{n.value=localStorage.getItem(ja)!=="0"}catch{}function s(){n.value=!n.value;try{localStorage.setItem(ja,n.value?"1":"0")}catch{}}const o=z(()=>{const l=e.status.contextUsage;return l===void 0?null:Math.round((l>1?l/100:l)*100)}),i=z(()=>{var l,a;return`Tokens: ${((l=e.status.contextTokens)==null?void 0:l.toLocaleString())??"-"} / ${((a=e.status.maxContextTokens)==null?void 0:a.toLocaleString())??"-"}`}),r=z(()=>({connected:"已连接",connecting:"连接中",reconnecting:"重连中",disconnected:"已断开",idle:"空闲"})[e.connectionStatus]??"空闲");return xe(()=>e.busy,()=>{e.busy&&!n.value&&(n.value=!0)}),(l,a)=>{var c,u;return g(),v("section",{class:le(["panel-section","run-status",{"is-open":n.value}])},[f("button",{class:"panel-head","aria-expanded":n.value,onClick:s},[f("span",S$,[J(de,{name:"activity",size:14})]),a[0]||(a[0]=f("span",{class:"head-title"},"运行状态",-1)),f("span",_$,M(t.busy?"正在处理会话":"已就绪,等待任务"),1),f("span",$$,[f("span",{class:le(["head-dot",{busy:t.busy}]),title:t.busy?"Agent 正在处理":"空闲"},null,10,x$),J(de,{class:le(["chevron",{rotated:n.value}]),name:"chevron-down",size:14},null,8,["class"])])],8,w$),qe(f("div",C$,[f("dl",T$,[f("div",I$,[a[1]||(a[1]=f("dt",null,"连接",-1)),f("dd",null,[f("span",{class:le(["conn-dot",t.connectionStatus]),"aria-hidden":"true"},null,2),f("span",{class:le(["conn",t.connectionStatus])},M(r.value),3)])]),f("div",M$,[a[2]||(a[2]=f("dt",null,"上下文占用",-1)),o.value!==null?(g(),v("dd",{key:0,title:i.value},[J(xu,{usage:t.status.contextUsage,size:14},null,8,["usage"]),$e(M(o.value)+"% ",1)],8,A$)):(g(),v("dd",R$,"未知"))]),f("div",P$,[a[3]||(a[3]=f("dt",null,"Token(输入 / 上限)",-1)),f("dd",E$,M(((c=t.status.contextTokens)==null?void 0:c.toLocaleString())??"-")+" / "+M(((u=t.status.maxContextTokens)==null?void 0:u.toLocaleString())??"-"),1)])])],512),[[du,n.value]])],2)}}}),O$=we(L$,[["__scopeId","data-v-59b0c4e7"]]),D$={class:"todo-panel panel-section"},N$={class:"section-heading"},B$={class:"head-icon"},G$={class:"head-hint"},F$={class:"head-tail"},j$={class:"head-count"},U$={key:0,class:"panel-body"},z$={class:"empty-state"},H$={key:1,class:"panel-body"},q$={class:"progress-row"},W$={class:"bar","aria-hidden":"true"},V$={class:"progress-value"},K$=["title"],Y$={class:"todo-title"},J$=ke({__name:"TodoPanel",props:{todos:{}},setup(t){const e=t,n=z(()=>_p(e.todos)),s=z(()=>e.todos.filter(c=>c.status==="done").length),o=z(()=>e.todos.filter(c=>c.status==="in_progress").length),i=z(()=>e.todos.filter(c=>c.status==="pending").length),r=z(()=>e.todos.length?Math.round(s.value/e.todos.length*100):0),l=z(()=>{if(!e.todos.length)return"直接来自 Agent 核心状态";if(s.value===e.todos.length)return"全部完成";const c=[];return o.value&&c.push(`进行中 ${o.value}`),i.value&&c.push(`待处理 ${i.value}`),c.join(" · ")||"直接来自 Agent 核心状态"}),a={pending:{label:"待处理",symbol:"○"},in_progress:{label:"进行中",symbol:"●"},done:{label:"已完成",symbol:"✓"}};return(c,u)=>(g(),v("section",D$,[f("div",N$,[f("span",B$,[J(de,{name:"clipboard",size:14})]),u[0]||(u[0]=f("span",{class:"head-title"},"核心 Todo",-1)),f("span",G$,M(l.value),1),f("span",F$,[f("span",j$,M(s.value)+"/"+M(t.todos.length),1)])]),t.todos.length===0?(g(),v("div",U$,[f("div",z$,[J(de,{name:"check",size:18}),u[1]||(u[1]=f("span",null,"暂无 Todo",-1)),u[2]||(u[2]=f("small",null,"Agent 创建任务清单后会在这里实时显示。",-1))])])):(g(),v("div",H$,[f("div",q$,[f("i",W$,[f("i",{style:$t({width:`${r.value}%`})},null,4)]),f("span",V$,M(r.value)+"%",1)]),(g(!0),v(X,null,Ce(n.value,(d,h)=>(g(),v("section",{key:d.phase??`unphased-${h}`,class:"todo-group"},[f("h4",null,M(d.phase??"未分阶段"),1),f("ol",null,[(g(!0),v(X,null,Ce(d.items,(p,m)=>(g(),v("li",{key:`${h}-${m}-${p.title}`,class:le(`is-${p.status}`)},[f("span",{class:"status-symbol",title:a[p.status].label},M(a[p.status].symbol),9,K$),f("span",Y$,M(p.title),1),f("small",null,M(a[p.status].label),1)],2))),128))])]))),128))]))]))}}),Z$=we(J$,[["__scopeId","data-v-6a025f22"]]),X$={class:"drawer"},Q$={class:"drawer-toolbar"},ex={class:"drawer-tabs",role:"tablist","aria-label":"抽屉面板"},tx=["aria-selected"],nx=["aria-selected"],sx={class:"drawer-body"},ox={class:"git-diff-head"},ix=["title"],rx={class:"git-diff-tools"},lx={key:0,class:"git-diff-stat"},ax={key:0,class:"add"},cx={key:1,class:"del"},ux={key:0,class:"git-diff-body"},dx={key:1,class:"git-diff-empty"},fx=ke({__name:"SessionDrawer",props:{client:{}},emits:["refresh-git","close","insert"],setup(t){const e=t,n=O("detail"),s=O(null),o=O(null);async function i(I){var k,T,P;s.value={...I,lines:[],loading:!0};try{const re=await(await fetch(`/api/v1/git/diff?path=${encodeURIComponent(I.path)}`)).json(),F=Cd(re.patch??""),D=I.adds??(I.dels===void 0?F.filter(ne=>ne.type==="add").length:void 0);s.value={...I,adds:D,lines:F,loading:!1}}catch{s.value={...I,lines:[],loading:!1}}await We();const C=((T=(k=globalThis.window)==null?void 0:k.matchMedia)==null?void 0:T.call(k,"(prefers-reduced-motion: reduce)").matches)===!0;(P=o.value)==null||P.scrollIntoView({block:"start",behavior:C?"auto":"smooth"})}const{connectionStatus:r,status:l,sessionId:a,isBusy:c,isArchived:u,goal:d,todos:h,goalRequestPending:p,goalRequestError:m,like:y,gitStatus:b,refineGoal:w,createGoal:S,updateGoal:_,pauseGoal:A,resumeGoal:Y,cancelGoal:G}=e.client;return(I,C)=>{const k=Gf("SvgIcon");return g(),v("aside",X$,[f("div",Q$,[f("div",ex,[f("button",{role:"tab","aria-selected":n.value==="detail",class:le(["drawer-tab",{active:n.value==="detail"}]),onClick:C[0]||(C[0]=T=>n.value="detail")}," 详情 ",10,tx),f("button",{role:"tab","aria-selected":n.value==="files",class:le(["drawer-tab",{active:n.value==="files"}]),onClick:C[1]||(C[1]=T=>n.value="files")}," 文件 ",10,nx)]),f("button",{class:"drawer-close",title:"收起面板","aria-label":"收起详情",onClick:C[2]||(C[2]=T=>I.$emit("close"))},[J(k,{name:"panel-right",size:16})])]),f("div",sx,[n.value==="detail"?(g(),v(X,{key:0},[J(O$,{status:L(l),busy:L(c),"connection-status":L(r)},null,8,["status","busy","connection-status"]),J(d_,{"git-status":L(b),onRefresh:C[3]||(C[3]=T=>I.$emit("refresh-git")),onDiff:i},null,8,["git-status"]),s.value?(g(),v("div",{key:0,ref_key:"diffRef",ref:o,class:"git-diff-view"},[f("div",ox,[f("span",{class:"git-diff-title",title:s.value.path},M(s.value.loading?"加载中…":s.value.display),9,ix),f("span",rx,[!s.value.loading&&(s.value.adds||s.value.dels)?(g(),v("span",lx,[s.value.adds?(g(),v("span",ax,"+"+M(s.value.adds),1)):B("",!0),s.value.dels?(g(),v("span",cx,"−"+M(s.value.dels),1)):B("",!0)])):B("",!0),f("button",{class:"git-diff-close",title:"关闭 diff","aria-label":"关闭 diff",onClick:C[4]||(C[4]=T=>s.value=null)},"✕")])]),s.value.lines.length?(g(),v("div",ux,[J(il,{lines:s.value.lines},null,8,["lines"])])):s.value.loading?B("",!0):(g(),v("p",dx,"该文件无差异内容(可能是二进制文件或已被忽略)。"))],512)):B("",!0),J(Z$,{todos:L(h)},null,8,["todos"]),J(k$,{like:L(y),"update-like":e.client.updateLike},null,8,["like","update-like"]),J(a$,{goal:L(d),"session-id":L(a),"connection-status":L(r),busy:L(c),archived:L(u),pending:L(p),error:L(m),"refine-goal":L(w),"create-goal":L(S),"update-goal":L(_),"pause-goal":L(A),"resume-goal":L(Y),"cancel-goal":L(G)},null,8,["goal","session-id","connection-status","busy","archived","pending","error","refine-goal","create-goal","update-goal","pause-goal","resume-goal","cancel-goal"])],64)):(g(),Oe(US,{key:e.client.workDir.value||"none","initial-path":e.client.workDir.value||""},null,8,["initial-path"]))])])}}}),hx=we(fx,[["__scopeId","data-v-2d1f803d"]]),px={class:"stats-head"},gx={class:"stats-body"},mx={class:"stats-section"},vx={class:"stats-label-row"},yx={class:"stats-value mono"},bx=["aria-valuenow","aria-label"],kx={key:0,class:"stats-section"},wx={class:"stats-label-row"},Sx={class:"stats-value mono"},_x={class:"stats-section"},$x={class:"stats-label-row"},xx={class:"stats-value mono"},Cx={class:"stats-grid"},Tx={class:"stats-cell-label"},Ix={class:"stats-cell-value mono"},Mx={key:1,class:"stats-section"},Ax=["title"],Rx={class:"model-tokens mono"},Px={class:"model-dims mono"},Ex={key:1,class:"stats-empty"},Lx=ke({__name:"SessionStatsPanel",props:{status:{},fetchUsage:{type:Function},fetchContext:{type:Function}},emits:["close"],setup(t,{emit:e}){const n=t,s=e,o=O(null);Ze(()=>{n.fetchUsage(),n.fetchContext()});function i(S){const _=o.value;_&&!_.contains(S.target)&&s("close")}function r(S){S.key==="Escape"&&s("close")}Ze(()=>{document.addEventListener("pointerdown",i),window.addEventListener("keydown",r)}),ft(()=>{document.removeEventListener("pointerdown",i),window.removeEventListener("keydown",r)});function l(S){return S?S.inputOther+S.output+S.inputCacheRead+S.inputCacheCreation:0}function a(S){return typeof S!="number"?"-":S>=1e6?`${(S/1e6).toFixed(1)}M`:S>=1e3?`${(S/1e3).toFixed(1)}k`:String(S)}function c(S){return typeof S=="number"?S.toLocaleString():"-"}const u=z(()=>{const S=n.status.contextUsage;if(typeof S=="number"&&Number.isFinite(S)){const Y=S>1?S:S*100;return Math.max(0,Math.min(Y,100))}const _=n.status.contextTokens??0,A=n.status.maxContextTokens??0;return A<=0?0:Math.max(0,Math.min(_/A*100,100))}),d=z(()=>typeof n.status.contextTokens=="number"&&typeof n.status.maxContextTokens=="number"?`${c(n.status.contextTokens)} / ${c(n.status.maxContextTokens)}`:u.value>0?`${u.value.toFixed(1)}%`:"-"),h=z(()=>{var S;return(S=n.status.usage)==null?void 0:S.total}),p=z(()=>{var S;return(S=n.status.usage)==null?void 0:S.currentTurn}),m=z(()=>l(h.value)),y=z(()=>{var _;const S=(_=n.status.usage)==null?void 0:_.byModel;return S?Object.entries(S).map(([A,Y])=>({model:A,tokens:l(Y),input:Y.inputOther,output:Y.output,cacheRead:Y.inputCacheRead,cacheCreation:Y.inputCacheCreation})):[]}),b=z(()=>m.value>0||y.value.length>0||l(p.value)>0),w=z(()=>{var S,_,A,Y;return[{key:"input",label:"输入",value:(S=h.value)==null?void 0:S.inputOther},{key:"output",label:"输出",value:(_=h.value)==null?void 0:_.output},{key:"cacheRead",label:"缓存读",value:(A=h.value)==null?void 0:A.inputCacheRead},{key:"cacheCreation",label:"缓存写",value:(Y=h.value)==null?void 0:Y.inputCacheCreation}]});return(S,_)=>(g(),v("div",{ref_key:"rootRef",ref:o,class:"stats-panel",role:"dialog","aria-label":"会话统计"},[f("div",px,[_[1]||(_[1]=f("span",{class:"stats-title"},"会话统计",-1)),f("button",{class:"stats-close","aria-label":"关闭统计面板",onClick:_[0]||(_[0]=A=>s("close"))},[J(de,{name:"x",size:14})])]),f("div",gx,[f("div",mx,[f("div",vx,[_[2]||(_[2]=f("span",{class:"stats-label"},"上下文水位",-1)),f("span",yx,M(d.value),1)]),f("div",{class:"ctx-track",role:"progressbar","aria-valuenow":Math.round(u.value),"aria-valuemin":"0","aria-valuemax":"100","aria-label":`上下文 ${u.value.toFixed(1)}%`},[f("div",{class:"ctx-fill",style:$t({width:`${u.value}%`})},null,4)],8,bx)]),b.value?(g(),v(X,{key:0},[l(p.value)>0?(g(),v("div",kx,[f("div",wx,[_[3]||(_[3]=f("span",{class:"stats-label"},"当前回合",-1)),f("span",Sx,M(a(l(p.value)))+" tokens",1)])])):B("",!0),f("div",_x,[f("div",$x,[_[4]||(_[4]=f("span",{class:"stats-label"},"本会话累计",-1)),f("span",xx,M(a(m.value))+" tokens",1)]),f("div",Cx,[(g(!0),v(X,null,Ce(w.value,A=>(g(),v("div",{key:A.key,class:"stats-cell"},[f("span",Tx,M(A.label),1),f("span",Ix,M(c(A.value)),1)]))),128))])]),y.value.length>0?(g(),v("div",Mx,[_[5]||(_[5]=f("div",{class:"stats-label"},"按模型",-1)),(g(!0),v(X,null,Ce(y.value,A=>(g(),v("div",{key:A.model,class:"model-row"},[f("span",{class:"model-name",title:A.model},M(A.model),9,Ax),f("span",Rx,M(c(A.tokens)),1),f("span",Px," 入 "+M(c(A.input))+" · 出 "+M(c(A.output))+" · 缓存 "+M(c(A.cacheRead+A.cacheCreation)),1)]))),128))])):B("",!0)],64)):(g(),v("div",Ex,"暂无用量数据"))])],512))}}),Ox=we(Lx,[["__scopeId","data-v-d7ef23ee"]]),Dx={class:"conversation"},Nx={key:0,class:"stats-anchor"},Bx={class:"chat-stage"},Gx={class:"chat-column"},Fx={class:"composer-dock"},jx=ke({__name:"ConversationView",props:{client:{}},emits:["home"],setup(t,{emit:e}){const n=t,s=e,{connectionStatus:o,messages:i,pendingApprovals:r,status:l,sessionId:a,workDir:c,isBusy:u,models:d,sendPrompt:h,sendCommand:p,clearMessages:m,appendSystemMessage:y,abort:b,resolveApproval:w,exportSession:S,fetchSnapshot:_,switchModel:A,switchThinking:Y}=n.client,G=O(null),I=O(!1),C=O(!1),k=O(!1),T=O("status"),P=z(()=>{var ie;const H=(ie=l.value.usage)==null?void 0:ie.currentTurn;if(!H)return null;const K=H.inputOther+H.output+H.inputCacheRead+H.inputCacheCreation;return K>0?K:null}),N=z(()=>{const H=n.client.sessions.value.find(q=>q.sessionId===n.client.currentSessionId.value),K=H==null?void 0:H.title;if(K&&K!=="新会话"&&K!=="New Session")return K;const ie=i.value.find(q=>q.role==="user");if(ie){const q=ie.content.replace(/\s+/g," ").trim();if(q)return q.length>24?`${q.slice(0,24)}…`:q}return K??null});function re(H){var K;(K=G.value)==null||K.insertText(H)}function F(H){_(),T.value=H,k.value=!0}function D(){var H;return((H=G.value)==null?void 0:H.openModelPicker())??!1}const{onCommand:ne}=vu({sendCommand:p,clearMessages:m,appendSystemMessage:y,onNew:()=>s("home"),openModelPicker:D,showInfo:F,currentModel:()=>l.value.model});function ue(H){p("title",H)}function ge(){if(u.value||!o.value)return;const H=[...i.value].reverse().find(K=>K.role==="user");H&&h(H.content)}const Ne=O(!1);async function He(){Ne.value=!0,await n.client.loadOlderMessages(),Ne.value=!1}function ze(){u.value||(p("fork"),setTimeout(()=>{n.client.fetchSessions()},1200))}return(H,K)=>(g(),v("div",Dx,[J(_v,{title:N.value,busy:L(u),"drawer-open":I.value,"stats-open":C.value,"turn-tokens":P.value,onHome:K[0]||(K[0]=ie=>s("home")),onRename:ue,onExport:K[1]||(K[1]=ie=>L(a)&&L(S)(L(a))),onClear:L(m),onToggleDrawer:K[2]||(K[2]=ie=>I.value=!I.value),onToggleStats:K[3]||(K[3]=ie=>C.value=!C.value)},null,8,["title","busy","drawer-open","stats-open","turn-tokens","onClear"]),C.value?(g(),v("div",Nx,[J(Ox,{status:L(l),"fetch-usage":n.client.fetchSessionUsage,"fetch-context":n.client.fetchSessionContext,onClose:K[4]||(K[4]=ie=>C.value=!1)},null,8,["status","fetch-usage","fetch-context"])])):B("",!0),f("div",Bx,[f("div",Gx,[J(TS,{messages:L(i),busy:L(u),"work-dir":L(c),"session-id":L(a)??"",model:L(l).model??null,"context-usage":L(l).contextUsage??null,connected:L(o)==="connected","older-available":n.client.olderAvailable.value,"older-loading":Ne.value,onEdit:re,onPick:L(h),onRetryConnection:K[5]||(K[5]=ie=>n.client.reconnectNow()),onRetryMessage:ge,onLoadOlder:He,onFork:ze},null,8,["messages","busy","work-dir","session-id","model","context-usage","connected","older-available","older-loading","onPick"]),f("div",Fx,[J(kg,{approvals:L(r),onResolve:L(w)},null,8,["approvals","onResolve"]),J(Cu,{ref_key:"composerRef",ref:G,busy:L(u),status:L(l),"session-id":L(a),models:L(d),"work-dir":L(c)||"",messages:L(i),onSend:L(h),onAbort:L(b),onCommand:L(ne),onSwitchModel:L(A),onSwitchThinking:L(Y)},null,8,["busy","status","session-id","models","work-dir","messages","onSend","onAbort","onCommand","onSwitchModel","onSwitchThinking"])])]),J(Xo,{name:"drawer"},{default:bt(()=>[I.value?(g(),Oe(hx,{key:0,client:n.client,onRefreshGit:K[6]||(K[6]=ie=>n.client.fetchGitStatus()),onClose:K[7]||(K[7]=ie=>I.value=!1)},null,8,["client"])):B("",!0)]),_:1})]),k.value?(g(),Oe(Tu,{key:1,mode:T.value,status:L(l),"session-id":L(a),"work-dir":L(c),onClose:K[8]||(K[8]=ie=>k.value=!1)},null,8,["mode","status","session-id","work-dir"])):B("",!0)]))}}),Ux=we(jx,[["__scopeId","data-v-e990984d"]]),zx=new Set(["png","jpg","jpeg","gif","webp","svg","avif","ico"]),Hx=new Set(["mp3","wav","m4a","ogg"]),qx=new Set(["md","markdown"]);function Td(t){const e=t.split(/[\\/]/).pop()??t,n=e.lastIndexOf(".");return n>0?e.slice(n+1).toLowerCase():""}function Wx(t){const e=Td(t);return zx.has(e)?"image":Hx.has(e)?"audio":qx.has(e)?"markdown":e==="pdf"?"pdf":"source"}const Vx={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",mjs:"javascript",cjs:"javascript",py:"python",rs:"rust",go:"go",java:"java",c:"c",h:"c",cpp:"cpp",hpp:"cpp",cs:"csharp",rb:"ruby",php:"php",sh:"bash",bash:"bash",zsh:"bash",yml:"yaml",yaml:"yaml",json:"json",toml:"toml",ini:"ini",xml:"xml",html:"html",css:"css",scss:"scss",less:"less",sql:"sql",md:"markdown",markdown:"markdown",vue:"vue",svelte:"svelte",swift:"swift",kt:"kotlin",lua:"lua",r:"r",dart:"dart",graphql:"graphql",proto:"protobuf",txt:"text"};function Ua(t){const e=(t.split(/[\\/]/).pop()??"").toLowerCase();return e==="dockerfile"?"docker":e==="makefile"?"make":Vx[Td(t)]??"text"}const Kx={key:0,class:"file-viewer"},Yx={class:"fv-toolbar"},Jx=["title","aria-label"],Zx={class:"fv-path-text"},Xx={class:"fv-modes",role:"tablist","aria-label":"显示模式"},Qx=["aria-selected","title","onClick"],eC={class:"fv-body"},tC={key:0,class:"fv-status"},nC={key:1,class:"fv-status fv-error"},sC={class:"fv-error-name"},oC={class:"fv-error-msg"},iC={key:0,class:"fv-scroll"},rC={key:1,class:"fv-status"},lC={key:0,class:"fv-media"},aC=["src","alt"],cC={key:1,class:"fv-media"},uC=["src"],dC={key:2,class:"fv-media fv-pdf"},fC=["src","title"],hC={key:3,class:"fv-scroll fv-markdown"},pC={key:4,class:"fv-scroll"},gC={key:4,class:"fv-scroll"},mC={key:0,class:"fv-note"},vC={key:1,class:"fv-empty"},Ei="/api/v1",yC=ke({__name:"FileViewer",props:{client:{}},setup(t){const e=t,n=[{id:"source",label:"源码"},{id:"preview",label:"预览"},{id:"diff",label:"Diff"}],s=z(()=>rg()),o=z(()=>s.value?eg(s.value.viewerState,s.value.initialDisplayMode):"source"),i=z(()=>s.value?Wx(s.value.filePath):"source"),r=O(0),l=z(()=>{if(!s.value)return"";const k=r.value>0?`&t=${r.value}`:"";return`${Ei}/files/raw?path=${encodeURIComponent(s.value.filePath)}${k}`}),a=vn(new Map),c=vn(new Map);async function u(k){try{const T=await k.json();return T.message??T.error??`HTTP ${k.status}`}catch{return`HTTP ${k.status}`}}function d(k){var re,F;const T=(re=e.client)==null?void 0:re.gitStatus.value,P=((F=e.client)==null?void 0:F.workDir.value)??"";if(!(T!=null&&T.files)||T.files.length===0)return null;const N=P&&k.startsWith(`${P}/`)?k.slice(P.length+1):k.startsWith("/")?null:k;if(N){const D=T.files.find(ne=>(ne.displayPath??ne.path)===N);if(D)return D.path;for(const ne of T.files){const ue=ne.displayPath??ne.path;if(ue&&ne.path.endsWith(ue))return ne.path.slice(0,ne.path.length-ue.length)+N}}return null}function h(k){var re;const T=[],P=F=>{F&&F!==k&&!T.includes(F)&&T.push(F)};P(d(k)),T.push(k);const N=((re=e.client)==null?void 0:re.workDir.value)??"";return N&&k.startsWith(`${N}/`)&&P(k.slice(N.length+1)),T}async function p(){const k=s.value;if(!(!k||c.has(k.filePath)))try{for(const T of h(k.filePath)){const P=await fetch(`${Ei}/git/diff?path=${encodeURIComponent(T)}`);if(!P.ok){c.set(k.filePath,{status:"error",message:await u(P)});return}const N=await P.json();if((N.patch??"")!==""){c.set(k.filePath,{status:"ok",patch:N.patch??""});return}}c.set(k.filePath,{status:"ok",patch:""})}catch(T){c.set(k.filePath,{status:"error",message:T instanceof Error?T.message:String(T)})}}async function m(){const k=s.value;if(k){if(o.value==="diff"){await p();return}if(!(o.value==="preview"&&(i.value==="image"||i.value==="audio"||i.value==="pdf"))&&!a.has(k.filePath))try{const T=await fetch(`${Ei}/files/read?path=${encodeURIComponent(k.filePath)}`);if(!T.ok)a.set(k.filePath,{status:"error",message:await u(T)});else{const P=await T.json();a.set(k.filePath,{status:"ok",content:P.content,truncated:P.truncated===!0})}}catch(T){a.set(k.filePath,{status:"error",message:T instanceof Error?T.message:String(T)})}}}xe(()=>{var k;return[(k=s.value)==null?void 0:k.id,o.value]},()=>{m()},{immediate:!0});const y=z(()=>{const k=s.value;if(k)return o.value==="diff"?c.get(k.filePath):o.value==="preview"&&(i.value==="image"||i.value==="audio"||i.value==="pdf")?{status:"ok"}:a.get(k.filePath)}),b=z(()=>s.value!==void 0&&y.value===void 0),w=z(()=>{var k;return((k=y.value)==null?void 0:k.status)==="error"?y.value:null}),S=z(()=>{const k=s.value?a.get(s.value.filePath):void 0;return(k==null?void 0:k.status)==="ok"?k.content:""}),_=z(()=>{const k=s.value?a.get(s.value.filePath):void 0;return(k==null?void 0:k.status)==="ok"?k.truncated:!1}),A=z(()=>{const k=s.value?c.get(s.value.filePath):void 0;return(k==null?void 0:k.status)==="ok"&&k.patch.trim()!==""?Cd(k.patch):[]});function Y(k){var N,re,F;const T=s.value;if(!T||o.value===k)return;const P={displayMode:k,wrapLines:((N=T.viewerState)==null?void 0:N.wrapLines)??!1,scrollTop:((re=T.viewerState)==null?void 0:re.scrollTop)??0,scrollLeft:((F=T.viewerState)==null?void 0:F.scrollLeft)??0};be.tabs=ng(be.tabs,T.id,T.viewerRevision??0,P)}function G(){const k=s.value;if(k){if(o.value==="diff")c.delete(k.filePath);else if(o.value==="preview"&&(i.value==="image"||i.value==="audio"||i.value==="pdf")){r.value+=1;return}else a.delete(k.filePath);m()}}const I=O(!1);function C(){var T;const k=s.value;k&&((T=navigator.clipboard)==null||T.writeText(k.filePath).then(()=>{I.value=!0,setTimeout(()=>I.value=!1,1500)}).catch(()=>{}))}return(k,T)=>s.value?(g(),v("div",Kx,[f("div",Yx,[f("button",{class:"fv-path",title:I.value?"已复制路径":`复制路径:${s.value.filePath}`,"aria-label":`文件路径 ${s.value.filePath}`,onClick:C},[J(de,{name:"copy",size:12,class:"fv-path-icon"}),f("span",Zx,M(s.value.filePath),1)],8,Jx),f("div",Xx,[(g(),v(X,null,Ce(n,P=>f("button",{key:P.id,class:le(["fv-mode",{active:o.value===P.id}]),role:"tab","aria-selected":o.value===P.id,title:`${P.label}模式`,onClick:N=>Y(P.id)},M(P.label),11,Qx)),64))]),f("button",{class:"fv-icon-btn",title:"刷新","aria-label":"刷新",onClick:G},[J(de,{name:"refresh",size:14})])]),f("div",eC,[b.value?(g(),v("div",tC,[...T[0]||(T[0]=[f("span",{class:"fv-spinner","aria-hidden":"true"},null,-1),f("span",null,"加载中…",-1)])])):w.value?(g(),v("div",nC,[f("p",sC,M(s.value.label),1),f("p",oC,M(w.value.message),1),f("button",{class:"fv-retry",onClick:G},"重试")])):o.value==="diff"?(g(),v(X,{key:2},[A.value.length>0?(g(),v("div",iC,[J(il,{lines:A.value},null,8,["lines"])])):(g(),v("div",rC,"该文件没有未提交的改动。"))],64)):o.value==="preview"?(g(),v(X,{key:3},[i.value==="image"?(g(),v("div",lC,[f("img",{src:l.value,alt:s.value.label},null,8,aC)])):i.value==="audio"?(g(),v("div",cC,[f("audio",{class:"fv-audio",controls:"",src:l.value},null,8,uC)])):i.value==="pdf"?(g(),v("div",dC,[f("iframe",{class:"fv-pdf-frame",src:l.value,title:s.value.label},null,8,fC)])):i.value==="markdown"?(g(),v("div",hC,[J($d,{content:S.value},null,8,["content"])])):(g(),v("div",pC,[T[1]||(T[1]=f("p",{class:"fv-note"},"该类型暂不支持预览,显示源码内容。",-1)),J(mr,{code:S.value,lang:L(Ua)(s.value.filePath)},null,8,["code","lang"])]))],64)):(g(),v("div",gC,[_.value?(g(),v("p",mC,"文件较大,仅显示前 256KB。")):B("",!0),J(mr,{code:S.value,lang:L(Ua)(s.value.filePath)},null,8,["code","lang"])]))])])):(g(),v("div",vC,"从工具卡片、文件浏览或消息中选择文件打开"))}}),bC=we(yC,[["__scopeId","data-v-7756f288"]]),kC={class:"settings"},wC={class:"settings-layout"},SC={class:"rail","aria-label":"设置分区"},_C=["aria-current","onClick"],$C={class:"pane"},xC={key:0,class:"pane-section"},CC={class:"block"},TC={class:"theme-grid",role:"radiogroup","aria-label":"主题"},IC=["aria-checked","onClick"],MC={class:"block"},AC={class:"like-fields"},RC={class:"like-label"},PC=["onUpdate:modelValue","placeholder","aria-label"],EC={class:"like-actions"},LC={key:0,class:"saved-hint"},OC={key:1,class:"pane-section"},DC={key:0,class:"empty"},NC={key:1,class:"list"},BC={class:"row-main"},GC={class:"row-title"},FC={class:"row-sub"},jC=["disabled","onClick"],UC={key:2,class:"pane-section"},zC={key:0,class:"empty"},HC={key:1,class:"list"},qC={class:"row-main"},WC={class:"row-title"},VC={class:"row-sub"},KC={class:"row-actions"},YC=["disabled","onClick"],JC=["disabled","onClick"],ZC={key:3,class:"pane-section"},XC={class:"block"},QC={class:"inline-form"},eT={key:0,class:"hint"},tT={key:0,class:"empty"},nT={key:1,class:"list"},sT={class:"row-main"},oT={class:"row-title"},iT={key:0,class:"version"},rT={class:"row-sub"},lT=["disabled","onClick"],aT={key:4,class:"pane-section"},cT={key:0,class:"hint"},uT={key:1,class:"empty"},dT={key:2,class:"list"},fT={class:"row-main"},hT={class:"row-title"},pT={class:"row-sub"},gT={class:"row-actions"},mT=["disabled","onClick"],vT=["disabled","onClick"],yT=["disabled","onClick"],bT={key:5,class:"pane-section"},kT={key:0,class:"hint"},wT={key:1,class:"empty"},ST={key:2,class:"list"},_T={class:"row-main"},$T={class:"row-title"},xT={class:"row-sub"},CT={class:"row-actions"},TT=["disabled","onClick"],IT=["disabled","onClick"],MT=ke({__name:"SettingsView",props:{like:{default:()=>({})},client:{}},emits:["update-like"],setup(t,{emit:e}){const n=t,s=e;function o(q){return q!==null&&typeof q=="object"&&q.__v_isRef===!0?q.value:q}const i=[{id:"general",label:"通用",icon:"settings"},{id:"models",label:"模型",icon:"bot"},{id:"skills",label:"技能",icon:"sparkles"},{id:"plugins",label:"插件",icon:"layers"},{id:"mcp",label:"MCP 服务器",icon:"monitor"},{id:"tasks",label:"后台任务",icon:"activity"}],r=O("general"),l=z(()=>n.client),a=on("theme",O("system")),c=on("setTheme",()=>{}),u=[{id:"light",label:"浅色",icon:"sun"},{id:"dark",label:"深色",icon:"moon"},{id:"system",label:"跟随系统",icon:"monitor"}],d=O({...n.like}),h=O(!1);xe(()=>n.like,q=>{d.value={...q}});const p=[{key:"nickname",label:"称呼",hint:"AI 如何称呼你"},{key:"tone",label:"语气",hint:"回复的语气风格"},{key:"other",label:"偏好",hint:"其他偏好说明"},{key:"doNot",label:"禁止事项",hint:"明确禁止的行为"}];function m(){s("update-like",y()),h.value=!0,setTimeout(()=>h.value=!1,1500)}function y(){const q={};for(const oe of p){const j=d.value[oe.key];typeof j=="string"&&j.trim()&&(q[oe.key]=j.trim())}return q}const b=z(()=>{var q;return o((q=l.value)==null?void 0:q.models)??[]}),w=z(()=>{var q,oe;return((oe=o((q=l.value)==null?void 0:q.status))==null?void 0:oe.model)??""});function S(q){var oe,j;(j=(oe=l.value)==null?void 0:oe.switchModel)==null||j.call(oe,q)}const _=z(()=>{var q;return o((q=l.value)==null?void 0:q.skills)??[]}),A=O(!1);async function Y(q){var oe,j,fe,Se;A.value=!0;try{await((j=(oe=l.value)==null?void 0:oe.activateSkill)==null?void 0:j.call(oe,q))&&await((Se=(fe=l.value)==null?void 0:fe.fetchSkills)==null?void 0:Se.call(fe))}finally{A.value=!1}}async function G(q){var j,fe,Se,ve;if(!window.confirm(`移除技能「${q}」?`))return;await((fe=(j=l.value)==null?void 0:j.removeSkill)==null?void 0:fe.call(j,q))&&await((ve=(Se=l.value)==null?void 0:Se.fetchSkills)==null?void 0:ve.call(Se))}const I=z(()=>{var q;return o((q=l.value)==null?void 0:q.plugins)??[]}),C=O(!1);async function k(q,oe){var j,fe,Se,ve;C.value=!0;try{await((fe=(j=l.value)==null?void 0:j.setPluginEnabled)==null?void 0:fe.call(j,q,oe))&&await((ve=(Se=l.value)==null?void 0:Se.fetchPlugins)==null?void 0:ve.call(Se))}finally{C.value=!1}}const T=O(""),P=O(!1),N=O("");async function re(){var oe,j;const q=T.value.trim();if(q){P.value=!0,N.value="";try{const fe=await((j=(oe=l.value)==null?void 0:oe.installPlugin)==null?void 0:j.call(oe,q));N.value=fe?`已安装 ${fe.displayName}`:"安装失败",fe&&(T.value="")}finally{P.value=!1}}}const F=z(()=>{var q;return o((q=l.value)==null?void 0:q.mcpServers)??[]}),D=O(!1),ne=O("");async function ue(q,oe){var j,fe,Se,ve;D.value=!0,ne.value="";try{const wt=await((fe=(j=l.value)==null?void 0:j[q])==null?void 0:fe.call(j,oe));ne.value=wt?"操作成功":"操作失败",await((ve=(Se=l.value)==null?void 0:Se.fetchMcpServers)==null?void 0:ve.call(Se))}finally{D.value=!1}}const ge=z(()=>{var q;return o((q=l.value)==null?void 0:q.backgroundTasks)??[]}),Ne=O(""),He=O(!1),ze=O("");async function H(q){var oe,j,fe,Se;He.value=!0,ze.value="";try{const ve=await((j=(oe=l.value)==null?void 0:oe.stopBackgroundTask)==null?void 0:j.call(oe,q));ze.value=ve?"已停止":"取消失败",await((Se=(fe=l.value)==null?void 0:fe.fetchBackgroundTasks)==null?void 0:Se.call(fe))}finally{He.value=!1}}async function K(q){var oe,j,fe;He.value=!0,ze.value="";try{await((j=(oe=l.value)==null?void 0:oe.fetchBackgroundTaskOutput)==null?void 0:j.call(oe,q,200)),Ne.value=o((fe=l.value)==null?void 0:fe.backgroundTaskOutput)??""}finally{He.value=!1}}Ze(()=>{var oe,j,fe,Se,ve,wt;const q=l.value;(oe=q==null?void 0:q.fetchModels)==null||oe.call(q),(j=q==null?void 0:q.fetchConfig)==null||j.call(q),(fe=q==null?void 0:q.fetchSkills)==null||fe.call(q),(Se=q==null?void 0:q.fetchPlugins)==null||Se.call(q),(ve=q==null?void 0:q.fetchMcpServers)==null||ve.call(q),(wt=q==null?void 0:q.fetchBackgroundTasks)==null||wt.call(q)});function ie(q){return q==="connected"||q==="completed"?"ok":q==="failed"||q==="killed"?"bad":q==="running"||q==="pending"?"run":"muted"}return(q,oe)=>(g(),v("div",kC,[f("div",wC,[f("nav",SC,[(g(),v(X,null,Ce(i,j=>f("button",{key:j.id,class:le(["rail-tab",{active:r.value===j.id}]),"aria-current":r.value===j.id?"page":void 0,onClick:fe=>r.value=j.id},[J(de,{name:j.icon,size:16},null,8,["name"]),f("span",null,M(j.label),1)],10,_C)),64))]),f("div",$C,[r.value==="general"?(g(),v("section",xC,[oe[4]||(oe[4]=f("h1",{class:"settings-title"},"通用设置",-1)),f("div",CC,[oe[1]||(oe[1]=f("h2",{class:"block-title"},"外观",-1)),f("div",TC,[(g(),v(X,null,Ce(u,j=>f("button",{key:j.id,role:"radio","aria-checked":L(a)===j.id,class:le(["theme-option",{active:L(a)===j.id}]),onClick:fe=>L(c)(j.id)},[J(de,{name:j.icon,size:20},null,8,["name"]),f("span",null,M(j.label),1)],10,IC)),64))])]),f("div",MC,[oe[3]||(oe[3]=f("h2",{class:"block-title"},"偏好设置",-1)),f("div",AC,[(g(),v(X,null,Ce(p,j=>f("label",{key:j.key,class:"like-field"},[f("span",RC,M(j.label),1),qe(f("input",{"onUpdate:modelValue":fe=>d.value[j.key]=fe,class:"like-input",placeholder:j.hint,"aria-label":j.label},null,8,PC),[[Xe,d.value[j.key]]])])),64)),f("div",EC,[J(Mn,{variant:"primary",onClick:m},{default:bt(()=>[...oe[2]||(oe[2]=[$e("保存偏好",-1)])]),_:1}),h.value?(g(),v("span",LC,"已保存")):B("",!0)])])])])):r.value==="models"?(g(),v("section",OC,[oe[5]||(oe[5]=f("h1",{class:"settings-title"},"模型",-1)),b.value.length===0?(g(),v("p",DC,"没有可用的模型")):(g(),v("ul",NC,[(g(!0),v(X,null,Ce(b.value,j=>(g(),v("li",{key:j.alias,class:le(["list-row",{selected:j.alias===w.value}])},[f("div",BC,[f("span",GC,M(j.displayName||j.model),1),f("span",FC,M(j.provider)+" · "+M(j.alias)+" · "+M(j.maxContextSize),1)]),f("button",{class:"row-action",disabled:j.alias===w.value,onClick:fe=>S(j.alias)},M(j.alias===w.value?"使用中":"切换"),9,jC)],2))),128))]))])):r.value==="skills"?(g(),v("section",UC,[oe[6]||(oe[6]=f("h1",{class:"settings-title"},"技能",-1)),_.value.length===0?(g(),v("p",zC,"当前会话没有可用技能")):(g(),v("ul",HC,[(g(!0),v(X,null,Ce(_.value,j=>(g(),v("li",{key:j.name,class:"list-row"},[f("div",qC,[f("span",WC,M(j.name),1),f("span",VC,[$e(M(j.description||"—")+" ",1),j.pluginId?(g(),v(X,{key:0},[$e("· 来自插件 "+M(j.pluginId),1)],64)):B("",!0)])]),f("div",KC,[f("button",{class:"row-action",disabled:A.value,onClick:fe=>Y(j.name)}," 激活 ",8,YC),f("button",{class:"row-action danger",disabled:A.value,onClick:fe=>G(j.name)}," 移除 ",8,JC)])]))),128))]))])):r.value==="plugins"?(g(),v("section",ZC,[oe[9]||(oe[9]=f("h1",{class:"settings-title"},"插件",-1)),f("div",XC,[oe[8]||(oe[8]=f("h2",{class:"block-title"},"安装插件",-1)),f("div",QC,[qe(f("input",{"onUpdate:modelValue":oe[0]||(oe[0]=j=>T.value=j),class:"like-input",placeholder:"本地路径 / zip URL / GitHub 地址","aria-label":"插件来源",spellcheck:"false"},null,512),[[Xe,T.value]]),J(Mn,{variant:"primary",disabled:P.value||!T.value.trim(),onClick:re},{default:bt(()=>[...oe[7]||(oe[7]=[$e(" 安装 ",-1)])]),_:1},8,["disabled"])]),N.value?(g(),v("p",eT,M(N.value),1)):B("",!0)]),I.value.length===0?(g(),v("p",tT,"还没有安装插件")):(g(),v("ul",nT,[(g(!0),v(X,null,Ce(I.value,j=>(g(),v("li",{key:j.id,class:"list-row"},[f("div",sT,[f("span",oT,[$e(M(j.displayName)+" ",1),j.version?(g(),v("span",iT,"v"+M(j.version),1)):B("",!0)]),f("span",rT,M(j.skillCount)+" 技能 · "+M(j.enabledMcpServerCount)+"/"+M(j.mcpServerCount)+" MCP",1)]),f("button",{class:"row-action",disabled:C.value,onClick:fe=>k(j.id,!j.enabled)},M(j.enabled?"停用":"启用"),9,lT)]))),128))]))])):r.value==="mcp"?(g(),v("section",aT,[oe[10]||(oe[10]=f("h1",{class:"settings-title"},"MCP 服务器",-1)),ne.value?(g(),v("p",cT,M(ne.value),1)):B("",!0),F.value.length===0?(g(),v("p",uT,"没有配置 MCP 服务器")):(g(),v("ul",dT,[(g(!0),v(X,null,Ce(F.value,j=>(g(),v("li",{key:j.name,class:"list-row"},[f("div",fT,[f("span",hT,M(j.name),1),f("span",pT,M(j.transport)+" · "+M(j.toolCount)+" 工具",1),f("span",{class:le(["status-pill",ie(j.status)])},M(j.status),3)]),f("div",gT,[f("button",{class:"row-action",disabled:D.value,onClick:fe=>ue("reconnectMcpServer",j.name)},"重连",8,mT),f("button",{class:"row-action",disabled:D.value,onClick:fe=>ue("stopMcpServer",j.name)},"停止",8,vT),f("button",{class:"row-action danger",disabled:D.value,onClick:fe=>ue("removeMcpServer",j.name)},"移除",8,yT)])]))),128))]))])):r.value==="tasks"?(g(),v("section",bT,[oe[11]||(oe[11]=f("h1",{class:"settings-title"},"后台任务",-1)),ze.value?(g(),v("p",kT,M(ze.value),1)):B("",!0),ge.value.length===0?(g(),v("p",wT,"没有后台任务")):(g(),v("ul",ST,[(g(!0),v(X,null,Ce(ge.value,j=>(g(),v("li",{key:j.taskId,class:"list-row"},[f("div",_T,[f("span",$T,M(j.command),1),f("span",xT,M(j.description),1),f("span",{class:le(["status-pill",ie(j.status)])},M(j.status),3)]),f("div",CT,[f("button",{class:"row-action",disabled:He.value,onClick:fe=>K(j.taskId)},"输出",8,TT),j.status==="running"||j.status==="awaiting_approval"?(g(),v("button",{key:0,class:"row-action danger",disabled:He.value,onClick:fe=>H(j.taskId)}," 停止 ",8,IT)):B("",!0)])]))),128))]))])):B("",!0)])])]))}}),AT=we(MT,[["__scopeId","data-v-29ff2d65"]]),za=O(""),Li=O(new Set),RT=O("sessions");function PT(){function t(n){const s=new Set(Li.value);s.has(n)?s.delete(n):s.add(n),Li.value=s}function e(){za.value=""}return{query:za,collapsedSpaces:Li,section:RT,toggleSpace:t,clearSearch:e}}const Id="scream-file-tree-expanded",ET=O("");function LT(){try{const t=localStorage.getItem(Id);if(!t)return{};const e=JSON.parse(t);if(e&&typeof e=="object"&&!Array.isArray(e)){const n={};for(const[s,o]of Object.entries(e))Array.isArray(o)&&(n[s]=o.filter(i=>typeof i=="string"));return n}return{}}catch{return{}}}const _n=O(LT()),us=vn(new Map),Oi=O(null),Di=new Map;function OT(){function t(a){return a?new Set(_n.value[a]??[]):new Set}function e(a){if(!a)return;const c={..._n.value};c[a]=[...t(a)],_n.value=c;try{localStorage.setItem(Id,JSON.stringify(c))}catch{}}function n(a){Oi.value!==a&&(Oi.value=a)}function s(a,c){var u;return a?((u=_n.value[a])==null?void 0:u.includes(c))??!1:!1}function o(a,c){if(!a)return!1;const u=_n.value[a]??[],d=u.includes(c)?u.filter(h=>h!==c):[...u,c];return _n.value={..._n.value,[a]:d},e(a),!u.includes(c)}function i(a){return us.get(a)??[]}async function r(a){const c=(Di.get(a)??0)+1;Di.set(a,c);const u=await Su(a);return c!==(Di.get(a)??0)?us.get(a)??[]:(u!==null&&us.set(a,u),us.get(a)??[])}function l(a){us.delete(a)}return{activeWorkDir:Oi,query:ET,isExpanded:s,toggleExpand:o,loadedChildren:i,loadChildren:r,invalidate:l,setRoot:n}}const DT={class:"file-tree"},NT={key:0,class:"tree-toolbar"},BT={class:"tree-search"},GT={key:1,class:"tree-empty"},FT={key:2,class:"tree-empty"},jT={key:3,class:"tree-empty"},UT={key:4,class:"tree-empty"},zT=["aria-label"],HT=["aria-expanded","onClick"],qT=["title"],WT=["aria-expanded","onClick"],VT=["title"],KT=ke({__name:"FileTree",props:{workDir:{},gitStatus:{},refreshGit:{type:Function}},setup(t){const e=t,{query:n,isExpanded:s,toggleExpand:o,loadedChildren:i,loadChildren:r,invalidate:l,setRoot:a}=OT(),c=O(!1),u=O(!1);xe(()=>e.workDir,G=>{a(G),G&&d(G)},{immediate:!0});async function d(G){c.value=!0,u.value=!1;try{(await r(G)).length===0&&(u.value=!0)}finally{c.value=!1}}async function h(G){const I=e.workDir;if(!I)return;o(I,G)&&await r(G)}function p(G,I){return`${G.replace(/\/+$/,"")}/${I}`}function m(G){const I=e.workDir;if(!I)return G;const C=I.replace(/\/+$/,"");return G===C?"":G.startsWith(`${C}/`)?G.slice(C.length+1):G}function y(G){var T;const I=(T=e.gitStatus)==null?void 0:T.files;if(!I||I.length===0)return null;const C=m(G),k=I.find(P=>(P.displayPath??P.path)===C);return k?k.status.includes("?")?"?":k.status.includes("A")?"A":k.status.includes("M")?"M":null:null}const b=z(()=>{const G=e.workDir;if(!G)return[];const I=[],C=(k,T)=>{for(const P of i(k)){const N=p(k,P.name);I.push({abs:N,name:P.name,rel:m(N),isDir:P.type==="dir",depth:T,git:y(N)}),P.type==="dir"&&s(G,N)&&C(N,T+1)}};return C(G,0),I}),w=z(()=>b.value),S=z(()=>{const G=n.value.trim();if(!G)return[];const I=new Map(w.value.map(C=>[C.rel,C]));return wu(w.value.map(C=>({path:C.rel,isDir:C.isDir})),G,50).map(C=>I.get(C.path)).filter(C=>C!==void 0)}),_=z(()=>n.value.trim().length>0);function A(G){G.isDir?h(G.abs):Dn(G.abs)}function Y(){var I;const G=e.workDir;G&&(l(G),Tg(G),d(G),(I=e.refreshGit)==null||I.call(e))}return(G,I)=>(g(),v("div",DT,[t.workDir?(g(),v("div",NT,[f("label",BT,[J(de,{name:"search",size:13}),qe(f("input",{"onUpdate:modelValue":I[0]||(I[0]=C=>et(n)?n.value=C:null),type:"text",placeholder:"过滤文件…","aria-label":"过滤文件",spellcheck:"false"},null,512),[[Xe,L(n)]])]),f("button",{class:"tree-refresh",title:"刷新文件树与 Git 状态","aria-label":"刷新文件树与 Git 状态",onClick:Y},[J(de,{name:"refresh",size:13})])])):B("",!0),t.workDir?c.value&&b.value.length===0?(g(),v("div",FT,"加载中…")):u.value&&b.value.length===0?(g(),v("div",jT,"工作目录为空")):_.value&&S.value.length===0?(g(),v("div",UT,"没有匹配的文件")):(g(),v("div",{key:5,class:"tree-scroll",role:"tree","aria-label":"文件树 "+t.workDir},[_.value?(g(!0),v(X,{key:0},Ce(S.value,C=>(g(),v("button",{key:C.abs,class:le(["tree-row",{"is-dir":C.isDir}]),role:"treeitem","aria-expanded":C.isDir?L(s)(t.workDir,C.abs):void 0,onClick:k=>A(C)},[J(de,{name:C.isDir?"folder":"file",size:14,class:"row-icon"},null,8,["name"]),f("span",{class:"row-label mono",title:C.rel},M(C.rel),9,qT),C.git?(g(),v("span",{key:0,class:le(["row-git",`g-${C.git}`])},M(C.git),3)):B("",!0)],10,HT))),128)):(g(!0),v(X,{key:1},Ce(b.value,C=>(g(),v("button",{key:C.abs,class:le(["tree-row",{"is-dir":C.isDir}]),style:$t({paddingLeft:`${8+C.depth*14}px`}),role:"treeitem","aria-expanded":C.isDir?L(s)(t.workDir,C.abs):void 0,onClick:k=>A(C)},[J(de,{name:C.isDir?L(s)(t.workDir,C.abs)?"chevron-down":"chevron-right":"file",size:13,class:"row-caret"},null,8,["name"]),J(de,{name:C.isDir?"folder":"file",size:14,class:"row-icon"},null,8,["name"]),f("span",{class:le(["row-label",{mono:!C.isDir}]),title:C.rel},M(C.name),11,VT),C.git?(g(),v("span",{key:0,class:le(["row-git",`g-${C.git}`])},M(C.git),3)):B("",!0)],14,WT))),128))],8,zT)):(g(),v("div",GT,"当前会话没有工作目录"))]))}}),YT=we(KT,[["__scopeId","data-v-78dceb03"]]),Md=""+new URL("logo-v2-ChmPAIbI.svg",import.meta.url).href,JT={class:"sidebar-head"},ZT=["src"],XT=["title","aria-label","aria-expanded"],QT=["title"],eI={key:0},tI={key:0,class:"section-switch",role:"tablist","aria-label":"侧栏分区"},nI=["aria-selected"],sI=["aria-selected"],oI={key:0,class:"side-search"},iI=["placeholder"],rI={class:"spaces"},lI=["title"],aI=["title","onClick"],cI={class:"space-name"},uI={class:"space-count"},dI={key:0,class:"space-sessions"},fI=["title","onClick","onDblclick"],hI={key:0,class:"session-run","aria-hidden":"true"},pI={class:"session-text"},gI={key:0,class:"session-rename"},mI=["aria-label","onKeydown","onBlur"],vI={class:"session-title"},yI={class:"session-meta"},bI=["title","onClick","onKeydown"],kI={key:0,class:"spaces-empty"},wI={class:"sidebar-foot","aria-label":"功能区"},SI=["title"],_I={key:0},$I=["title"],xI={key:0},CI={class:"sidebar-identity"},TI={key:0,class:"identity-text"},II=ke({__name:"Sidebar",props:{view:{},sessions:{},currentSessionId:{default:null},workDir:{default:null},gitStatus:{default:null},refreshGit:{type:Function,default:void 0},collapsed:{type:Boolean,default:!1},showCollapseToggle:{type:Boolean,default:!0}},emits:["navigate","switch-session","delete-session","create-session","toggle-collapse","open-file","rename-session"],setup(t,{expose:e,emit:n}){const s=t,o=n,i=O(null),{query:r,collapsedSpaces:l,section:a,toggleSpace:c}=PT();function u(){var C,k;(C=i.value)==null||C.focus(),(k=i.value)==null||k.select()}e({focusSearch:u});const d=z(()=>{const C=r.value.trim().toLowerCase();return C?s.sessions.filter(k=>I(k).toLowerCase().includes(C)||k.workDir.toLowerCase().includes(C)):s.sessions}),h=z(()=>{var T;const C=new Map;for(const P of d.value){const N=P.workDir||"默认空间",re=N.split(/[\\/]/).filter(Boolean),F=re.length>0?re[re.length-1]:N,D=C.get(N);D?D.items.push(P):C.set(N,{key:N,name:F,items:[P]})}const k=(T=s.sessions.find(P=>P.sessionId===s.currentSessionId))==null?void 0:T.workDir;return[...C.values()].sort((P,N)=>{var re,F;return P.key===k?-1:N.key===k?1:(((re=N.items[0])==null?void 0:re.createdAt)??0)-(((F=P.items[0])==null?void 0:F.createdAt)??0)})});function p(C){o("switch-session",C)}function m(C,k){window.confirm(`删除会话「${k}」?此操作不可恢复。`)&&o("delete-session",C)}function y(C){o("open-file",C)}const b=O(null),w=O(null),S=O("");function _(C){w.value=C.sessionId,S.value=I(C),We(()=>{var k,T;(k=b.value)==null||k.focus(),(T=b.value)==null||T.select()})}function A(){w.value=null,S.value=""}function Y(C){const k=S.value.trim();if(w.value=null,S.value="",!k)return;const T=s.sessions.find(P=>P.sessionId===C);!T||k===I(T)||o("rename-session",C,k)}function G(C){if(!C)return"";const k=Date.now()-C;if(k<6e4)return"刚刚";if(k<36e5)return`${Math.floor(k/6e4)} 分钟前`;if(k<864e5)return`${Math.floor(k/36e5)} 小时前`;const T=new Date(C);return`${T.getMonth()+1}/${T.getDate()}`}function I(C){const k=(C.title||"").trim();return k&&k!=="新会话"&&k!=="New Session"?k:"未命名会话"}return(C,k)=>(g(),v("aside",{class:le(["sidebar",{"is-collapsed":t.collapsed}])},[f("div",JT,[f("button",{class:"sidebar-brand",title:"回到新对话",onClick:k[0]||(k[0]=T=>o("navigate","home"))},[f("img",{class:"brand-logo",src:L(Md),alt:"scream"},null,8,ZT)]),t.showCollapseToggle?(g(),v("button",{key:0,class:le(["collapse-btn",{rotated:t.collapsed}]),title:t.collapsed?"展开侧栏":"折叠侧栏","aria-label":t.collapsed?"展开侧栏":"折叠侧栏","aria-expanded":!t.collapsed,onClick:k[1]||(k[1]=T=>o("toggle-collapse"))},[J(de,{name:"panel-left",size:15})],10,XT)):B("",!0)]),f("button",{class:"new-chat-btn",title:t.collapsed?"新建对话":void 0,onClick:k[2]||(k[2]=T=>o("create-session"))},[J(de,{name:"plus",size:16}),t.collapsed?B("",!0):(g(),v("span",eI,"新建对话"))],8,QT),t.collapsed?B("",!0):(g(),v("div",tI,[f("button",{class:le(["section-tab",{active:L(a)==="sessions"}]),role:"tab","aria-selected":L(a)==="sessions",onClick:k[3]||(k[3]=T=>a.value="sessions")},[J(de,{name:"message-circle",size:13}),k[12]||(k[12]=f("span",null,"会话",-1))],10,nI),f("button",{class:le(["section-tab",{active:L(a)==="files"}]),role:"tab","aria-selected":L(a)==="files",onClick:k[4]||(k[4]=T=>a.value="files")},[J(de,{name:"folder",size:13}),k[13]||(k[13]=f("span",null,"文件",-1))],10,sI)])),!t.collapsed&&L(a)==="files"?(g(),Oe(YT,{key:1,"work-dir":t.workDir,"git-status":t.gitStatus,"refresh-git":t.refreshGit,onOpenFile:y},null,8,["work-dir","git-status","refresh-git"])):B("",!0),t.collapsed||L(a)==="sessions"?(g(),v(X,{key:2},[t.collapsed?B("",!0):(g(),v("label",oI,[J(de,{name:"search",size:15}),qe(f("input",{ref_key:"searchRef",ref:i,"onUpdate:modelValue":k[5]||(k[5]=T=>et(r)?r.value=T:null),type:"text",placeholder:`搜索会话… (${L($u)}K)`,"aria-label":"搜索会话",spellcheck:"false"},null,8,iI),[[Xe,L(r)]])])),f("div",rI,[(g(!0),v(X,null,Ce(h.value,T=>(g(),v("div",{key:T.key,class:"space-group"},[t.collapsed?(g(),v("button",{key:0,class:le(["space-dot",{active:T.items.some(P=>P.sessionId===t.currentSessionId)}]),title:T.name,onClick:k[6]||(k[6]=P=>o("toggle-collapse"))},M(T.name.slice(0,1).toUpperCase()),11,lI)):(g(),v(X,{key:1},[f("button",{class:"space-head",title:T.key,onClick:P=>L(c)(T.key)},[J(de,{name:L(l).has(T.key)?"chevron-right":"chevron-down",size:14},null,8,["name"]),f("span",cI,M(T.name),1),f("span",uI,M(T.items.length),1)],8,aI),L(l).has(T.key)?B("",!0):(g(),v("div",dI,[(g(!0),v(X,null,Ce(T.items,P=>(g(),v("div",{key:P.sessionId,class:"session-item-wrap"},[f("button",{class:le(["session-item",{active:P.sessionId===t.currentSessionId}]),title:I(P),onClick:N=>p(P.sessionId),onDblclick:N=>_(P)},[P.active?(g(),v("span",hI)):B("",!0),f("span",pI,[w.value===P.sessionId?(g(),v("span",gI,[qe(f("input",{ref_for:!0,ref_key:"renameInputRef",ref:b,"onUpdate:modelValue":k[7]||(k[7]=N=>S.value=N),class:"rename-input",spellcheck:"false","aria-label":`重命名会话 ${I(P)}`,onClick:k[8]||(k[8]=Ye(()=>{},["stop"])),onKeydown:[En(Ye(N=>Y(P.sessionId),["prevent"]),["enter"]),k[9]||(k[9]=En(Ye(N=>A(),["prevent"]),["esc"]))],onBlur:N=>Y(P.sessionId)},null,40,mI),[[Xe,S.value]])])):(g(),v(X,{key:1},[f("span",vI,M(I(P)),1),f("span",yI,[f("span",null,M(G(P.createdAt)),1),k[14]||(k[14]=f("span",{class:"meta-sep","aria-hidden":"true"},"·",-1)),f("span",null,M(P.messageCount)+" 条",1)])],64))]),f("span",{class:"session-delete",role:"button",tabindex:"0",title:`删除会话 ${I(P)}`,"aria-label":"删除会话",onClick:Ye(N=>m(P.sessionId,I(P)),["stop"]),onKeydown:En(Ye(N=>m(P.sessionId,I(P)),["stop","prevent"]),["enter"])},[J(de,{name:"trash",size:14})],40,bI)],42,fI)]))),128))]))],64))]))),128)),!t.collapsed&&h.value.length===0?(g(),v("p",kI,M(L(r)?"没有匹配的会话":"还没有会话,点击上方「新建对话」开始"),1)):B("",!0)])],64)):B("",!0),f("nav",wI,[f("button",{class:le(["foot-item",{active:t.view==="skills"}]),title:t.collapsed?"技能中心":void 0,onClick:k[10]||(k[10]=T=>o("navigate","skills"))},[J(de,{name:"sparkles",size:17}),t.collapsed?B("",!0):(g(),v("span",_I,"技能中心"))],10,SI),f("button",{class:le(["foot-item",{active:t.view==="settings"}]),title:t.collapsed?"设置":void 0,onClick:k[11]||(k[11]=T=>o("navigate","settings"))},[J(de,{name:"settings",size:17}),t.collapsed?B("",!0):(g(),v("span",xI,"设置"))],10,$I),f("div",CI,[k[15]||(k[15]=f("span",{class:"identity-dot","aria-hidden":"true"},null,-1)),t.collapsed?B("",!0):(g(),v("span",TI,"scream web"))])])],2))}}),Ha=we(II,[["__scopeId","data-v-4cf53693"]]),MI={class:"skills"},AI={class:"skills-head"},RI={class:"skills-grid"},PI={class:"skill-card-head"},EI={class:"skill-cmd"},LI={class:"skill-desc"},OI={key:0,class:"skill-aliases"},DI=ke({__name:"SkillsView",emits:["create"],setup(t,{emit:e}){const n=e,s={backend:"服务端",local:"本地"};return(o,i)=>(g(),v("div",MI,[f("div",AI,[i[2]||(i[2]=f("div",null,[f("h1",{class:"skills-title"},"技能中心"),f("p",{class:"skills-sub"},[$e("在输入框中输入 "),f("code",null,"/"),$e(" 即可触发以下命令")])],-1)),J(Mn,{variant:"primary",onClick:i[0]||(i[0]=r=>n("create"))},{default:bt(()=>[J(de,{name:"plus",size:16}),i[1]||(i[1]=$e(" 新建会话 ",-1))]),_:1})]),f("div",RI,[(g(!0),v(X,null,Ce(L(Qo),r=>{var l;return g(),v("article",{key:r.name,class:"skill-card"},[f("div",PI,[f("span",EI,"/"+M(r.name),1),f("span",{class:le(["skill-target",`target-${r.target}`])},M(s[r.target]),3)]),f("p",LI,M(r.description),1),(l=r.aliases)!=null&&l.length?(g(),v("p",OI," 别名:"+M(r.aliases.map(a=>`/${a}`).join(" ")),1)):B("",!0)])}),128))])]))}}),NI=we(DI,[["__scopeId","data-v-35313e25"]]),BI=["aria-selected","title","onClick","onAuxclick"],GI={class:"tab-label"},FI=["title","aria-label","onClick"],jI=ke({__name:"TabBar",setup(t){const e=O(null);xe(()=>be.activeTabId,async()=>{var o;await We();const s=(o=e.value)==null?void 0:o.querySelector(".tab-button.active");s==null||s.scrollIntoView({block:"nearest",inline:"nearest"})},{immediate:!0});function n(s,o){s.button===1&&(s.preventDefault(),s.stopPropagation(),oa(o))}return(s,o)=>L(be).tabs.length>0?(g(),v("div",{key:0,ref_key:"barRef",ref:e,class:"tab-bar",role:"tablist","aria-label":"文件标签"},[(g(!0),v(X,null,Ce(L(be).tabs,i=>(g(),v("div",{key:i.id,class:le(["tab-button",{active:i.id===L(be).activeTabId}]),role:"tab","aria-selected":i.id===L(be).activeTabId,title:i.filePath,onClick:r=>L(ig)(i.id),onMousedown:o[0]||(o[0]=r=>{r.button===1&&r.preventDefault()}),onAuxclick:r=>n(r,i.id)},[J(de,{name:"file",size:13,class:"tab-icon"}),f("span",GI,M(i.label),1),f("button",{class:"tab-close",title:`关闭 ${i.label}`,"aria-label":`关闭 ${i.label}`,onClick:Ye(r=>L(oa)(i.id),["stop"])},[J(de,{name:"x",size:11})],8,FI)],42,BI))),128))],512)):B("",!0)}}),UI=we(jI,[["__scopeId","data-v-cad2e90f"]]),zI={class:"mode-switch",role:"group","aria-label":"工作模式"},HI=["aria-pressed","onClick"],qI=ke({__name:"ModeSwitch",props:{modelValue:{default:"chat"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,s=[{id:"chat",label:"智能工作"},{id:"goal",label:"任务模式"}];return(o,i)=>(g(),v("div",zI,[(g(),v(X,null,Ce(s,r=>f("button",{key:r.id,class:le(["mode-pill",`is-${r.id}`,{active:t.modelValue===r.id}]),"aria-pressed":t.modelValue===r.id,onClick:l=>n("update:modelValue",r.id)},M(r.label),11,HI)),64))]))}}),WI=we(qI,[["__scopeId","data-v-c4ac7862"]]),VI={class:"workspace"},KI={class:"workspace-hero"},YI={class:"workspace-brand"},JI=["src"],ZI={class:"mode-hint"},XI={class:"workspace-composer"},QI=ke({__name:"WorkspaceHome",props:{models:{},status:{default:void 0},busy:{type:Boolean},mode:{default:"chat"}},emits:["send","command","switch-model","switch-thinking","update:mode"],setup(t,{emit:e}){const n=t,s=e,o=z(()=>n.mode==="goal"),i=z(()=>o.value?"任务模式:提交后将创建执行目标(Goal),Agent 持续执行到完成或预算耗尽;抽屉「Goal 管理」可查看与暂停。":"直接对话:提问后 Agent 按需调用工具完成你的请求。");return(r,l)=>(g(),v("div",VI,[f("section",KI,[f("h1",YI,[f("img",{class:"brand-logo",src:L(Md),alt:"scream"},null,8,JI)]),l[5]||(l[5]=f("p",{class:"workspace-tagline"},"你的智能协作伙伴",-1)),J(WI,{class:"workspace-mode","model-value":n.mode,"onUpdate:modelValue":l[0]||(l[0]=a=>s("update:mode",a))},null,8,["model-value"]),f("p",ZI,[(g(),v("span",{key:String(o.value),class:"hint-fade"},M(i.value),1))])]),f("section",XI,[J(Cu,{busy:t.busy,status:t.status,models:t.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"])])]))}}),eM=we(QI,[["__scopeId","data-v-2f5f04ab"]]),tM=["aria-valuenow"],nM={key:2,class:"sidebar-mobile"},sM={class:"canvas"},oM={class:"topbar mobile-only"},iM={class:"topbar-left"},rM={key:0,class:"topbar-running",title:"Agent 运行中"},lM={class:"canvas-body"},aM=["aria-valuenow"],cM={class:"right-panel-head"},uM={class:"right-panel-body"},qa="scream-sidebar-collapsed",dM=180,fM=480,hM=288,Wa="scream-workspace-mode",pM=ke({__name:"WebShell",setup(t){const e=jp(),{showToast:n}=Dr(),{connectionStatus:s,status:o,isBusy:i,sessions:r,currentSessionId:l,workDir:a,gitStatus:c,models:u,like:d,sendPrompt:h,sendCommand:p,appendSystemMessage:m,createSession:y,switchSession:b,deleteSession:w,switchModel:S,switchThinking:_,fetchLike:A,fetchGitStatus:Y,abort:G}=e,I=O("home"),C=O(!1),k=O(null);function T(Z=8e3){return s.value==="connected"?Promise.resolve(!0):new Promise(V=>{const $=Date.now(),E=window.setInterval(()=>{s.value==="connected"?(window.clearInterval(E),V(!0)):Date.now()-$>Z&&(window.clearInterval(E),V(!1))},80)})}function P(Z){Z==="chat"?l.value?I.value="chat":N():I.value=Z,C.value=!1}function N(){C.value=!1,I.value="chat",y()}async function re(Z,V){if(C.value=!1,l.value||await y(),!!await T())if(I.value="chat",V==="goal")try{await e.createGoal({objective:Z,budgets:[]})}catch(E){m(`Goal 创建失败:${F(E)}。已保留对话模式,可重新发送。`),h(Z);return}else h(Z)}function F(Z){return Z instanceof Error?Z.message:String(Z)}function D(Z){C.value=!1,I.value="chat",b(Z)}function ne(Z){Dn(Z)}function ue(Z,V){if(Z!==l.value){n("请先点击该会话,再双击重命名。","warning");return}p("title",V)}const ge=O(!1),Ne=O("status");function He(Z){e.fetchSnapshot(),Ne.value=Z,ge.value=!0}const{onCommand:ze}=vu({sendCommand:p,clearMessages:e.clearMessages,appendSystemMessage:m,ensureSession:async()=>{l.value||await y()},onNew:N,showInfo:He,currentModel:()=>o.value.model}),H=O(Qi(qa)==="1");function K(){H.value=!H.value,er(qa,H.value?"1":"0")}const ie=O(window.innerWidth),q=z(()=>ie.value>=Nr);function oe(){ie.value=window.innerWidth}const j=na({storageKey:"scream-sidebar-width",minWidth:dM,maxWidth:()=>Jp({viewportWidth:ie.value,rightPanelOpen:be.panelOpen,rightPanelWidth:R.value}),defaultWidth:hM,side:"left",canDrag:()=>!H.value,acceptStoredWidth:Z=>Z<=fM}),fe=j.width,Se=j.resizing,ve=na({storageKey:"scream-right-panel-width",minWidth:Vp,maxWidth:()=>Zp({viewportWidth:ie.value,sidebarOpen:!H.value,sidebarWidth:fe.value}),defaultWidth:()=>Yp(ie.value),side:"right"});ve.width;const wt=ve.resizing;function x(){ku(!1)}xe(q,()=>{wt.value&&ve.release()});const R=ve.effectiveWidth,W=z(()=>({"--sidebar-width":`${fe.value}px`,"--right-panel-width":`${R.value}px`})),te=O(Qi(Wa)==="goal"?"goal":"chat");function ee(Z){te.value=Z,er(Wa,Z)}function Q(Z){if((Z.metaKey||Z.ctrlKey)&&Z.key==="k")Z.preventDefault(),H.value&&K(),We(()=>{var V;return(V=k.value)==null?void 0:V.focusSearch()});else if((Z.metaKey||Z.ctrlKey)&&Z.key==="n")Z.preventDefault(),N();else if(Z.key==="Escape"&&i.value){const V=Z.target;V&&(V.tagName==="TEXTAREA"||V.tagName==="INPUT")||(Z.preventDefault(),G())}}return Ze(()=>{window.addEventListener("keydown",Q),window.addEventListener("resize",oe),A(),Y()}),ft(()=>{window.removeEventListener("keydown",Q),window.removeEventListener("resize",oe)}),(Z,V)=>(g(),v("div",{class:le(["shell",{"sidebar-collapsed":H.value,resizing:L(Se)||L(wt),"right-panel-open":L(be).panelOpen&&q.value}]),style:$t(W.value)},[J(Ha,{ref_key:"sidebarRef",ref:k,view:I.value,sessions:L(r),"current-session-id":L(l),"work-dir":L(a),"git-status":L(c),"refresh-git":L(Y),collapsed:H.value,onNavigate:P,onSwitchSession:D,onDeleteSession:L(w),onCreateSession:N,onToggleCollapse:K,onOpenFile:ne,onRenameSession:ue},null,8,["view","sessions","current-session-id","work-dir","git-status","refresh-git","collapsed","onDeleteSession"]),H.value?B("",!0):(g(),v("div",{key:0,class:le(["panel-resize-handle panel-resize-handle--left",{resizing:L(Se)}]),role:"separator","aria-orientation":"vertical","aria-label":"调整侧栏宽度","aria-valuenow":L(fe),"aria-valuemin":"180","aria-valuemax":"480",tabindex:"0",title:"拖拽调整宽度 · 双击复位",onPointerdown:V[0]||(V[0]=(...$)=>L(j).onPointerDown&&L(j).onPointerDown(...$)),onPointermove:V[1]||(V[1]=(...$)=>L(j).onPointerMove&&L(j).onPointerMove(...$)),onPointerup:V[2]||(V[2]=(...$)=>L(j).onPointerUp&&L(j).onPointerUp(...$)),onPointercancel:V[3]||(V[3]=(...$)=>L(j).onPointerUp&&L(j).onPointerUp(...$)),onDblclick:V[4]||(V[4]=(...$)=>L(j).reset&&L(j).reset(...$)),onKeydown:V[5]||(V[5]=(...$)=>L(j).onKeydown&&L(j).onKeydown(...$))},null,42,tM)),C.value?(g(),v("div",{key:1,class:"sidebar-backdrop","aria-hidden":"true",onClick:V[6]||(V[6]=$=>C.value=!1)})):B("",!0),C.value?(g(),v("div",nM,[J(Ha,{view:I.value,sessions:L(r),"current-session-id":L(l),"work-dir":L(a),"git-status":L(c),"refresh-git":L(Y),"show-collapse-toggle":!1,onNavigate:P,onSwitchSession:D,onDeleteSession:L(w),onCreateSession:N,onOpenFile:ne,onRenameSession:ue},null,8,["view","sessions","current-session-id","work-dir","git-status","refresh-git","onDeleteSession"])])):B("",!0),f("main",sM,[f("header",oM,[f("div",iM,[f("button",{class:"topbar-icon mobile-menu",title:"菜单","aria-label":"打开菜单",onClick:V[7]||(V[7]=$=>C.value=!0)},[J(de,{name:"menu",size:20})]),L(i)?(g(),v("span",rM,[...V[16]||(V[16]=[f("span",{class:"running-dot","aria-hidden":"true"},null,-1),f("span",{class:"running-text"},"运行中",-1)])])):B("",!0)])]),f("div",lM,[I.value==="home"?(g(),Oe(eM,{key:0,models:L(u),status:L(o),busy:L(i),mode:te.value,"onUpdate:mode":ee,onSend:re,onCommand:L(ze),onSwitchModel:L(S),onSwitchThinking:L(_)},null,8,["models","status","busy","mode","onCommand","onSwitchModel","onSwitchThinking"])):I.value==="chat"?(g(),Oe(Ux,{key:1,client:L(e),onHome:V[8]||(V[8]=$=>I.value="home")},null,8,["client"])):I.value==="skills"?(g(),Oe(NI,{key:2,onCreate:N})):I.value==="settings"?(g(),Oe(AT,{key:3,like:L(d),client:L(e),onUpdateLike:L(e).updateLike},null,8,["like","client","onUpdateLike"])):B("",!0)])]),L(be).panelOpen&&!q.value?(g(),v("div",{key:3,class:"right-panel-backdrop","aria-hidden":"true",onClick:x})):B("",!0),L(be).panelOpen&&q.value?(g(),v("div",{key:4,class:le(["panel-resize-handle panel-resize-handle--right",{resizing:L(wt)}]),role:"separator","aria-orientation":"vertical","aria-label":"调整文件面板宽度","aria-valuenow":L(R),tabindex:"0",title:"拖拽调整宽度 · 双击复位",onPointerdown:V[9]||(V[9]=(...$)=>L(ve).onPointerDown&&L(ve).onPointerDown(...$)),onPointermove:V[10]||(V[10]=(...$)=>L(ve).onPointerMove&&L(ve).onPointerMove(...$)),onPointerup:V[11]||(V[11]=(...$)=>L(ve).onPointerUp&&L(ve).onPointerUp(...$)),onPointercancel:V[12]||(V[12]=(...$)=>L(ve).onPointerUp&&L(ve).onPointerUp(...$)),onDblclick:V[13]||(V[13]=(...$)=>L(ve).reset&&L(ve).reset(...$)),onKeydown:V[14]||(V[14]=(...$)=>L(ve).onKeydown&&L(ve).onKeydown(...$))},null,42,aM)):B("",!0),L(be).panelOpen?(g(),v("aside",{key:5,class:le(["right-panel",{overlay:!q.value}]),"aria-label":"文件面板"},[f("div",cM,[J(UI),f("button",{class:"right-panel-close",title:"收起文件面板","aria-label":"收起文件面板",onClick:x},[J(de,{name:"chevron-right",size:16})])]),f("div",uM,[J(bC,{client:L(e)},null,8,["client"])])],2)):B("",!0),ge.value?(g(),Oe(Tu,{key:6,mode:Ne.value,status:L(o),"session-id":L(l),"work-dir":L(a),onClose:V[15]||(V[15]=$=>ge.value=!1)},null,8,["mode","status","session-id","work-dir"])):B("",!0)],6))}}),gM=we(pM,[["__scopeId","data-v-6363fed1"]]),mM=["src","alt"],vM={key:1,class:"lightbox-note",role:"alert"},yM=ke({__name:"ImageLightbox",setup(t){const e=O(null),n=O(!1);xe(()=>gn.open,i=>{const r=e.value;r&&(i?(n.value=!1,r.open||r.showModal()):r.open&&r.close())});function s(i){i.preventDefault(),Ai()}function o(i){i.target===e.value&&Ai()}return(i,r)=>(g(),v("dialog",{ref_key:"dialogRef",ref:e,class:"image-lightbox","aria-label":"图片预览",onCancel:s,onClick:o},[L(gn).open?(g(),v("img",{key:0,class:"lightbox-img",src:L(gn).src,alt:L(gn).alt||"图片预览",onError:r[0]||(r[0]=l=>n.value=!0)},null,40,mM)):B("",!0),n.value?(g(),v("p",vM,"图片加载失败")):B("",!0),f("button",{type:"button",class:"lightbox-close","aria-label":"关闭预览",title:"关闭(Esc)",onClick:r[1]||(r[1]=l=>L(Ai)())},[J(de,{name:"x",size:16})])],544))}}),bM=we(yM,[["__scopeId","data-v-7d7939d6"]]),kM={class:"toast-container"},wM=["onClick"],SM={class:"toast-icon"},_M={class:"toast-msg"},$M=ke({__name:"Toast",setup(t){const{toasts:e,removeToast:n}=Dr(),s={info:"ℹ",success:"✓",error:"✗",warning:"⚠"};return(o,i)=>(g(),Oe(Mr,{to:"body"},[f("div",kM,[J(Xh,{name:"toast"},{default:bt(()=>[(g(!0),v(X,null,Ce(L(e),r=>(g(),v("div",{key:r.id,class:le(["toast",`toast--${r.type}`]),onClick:l=>L(n)(r.id)},[f("span",SM,M(s[r.type]),1),f("span",_M,M(r.message),1)],10,wM))),128))]),_:1})])]))}}),xM=we($M,[["__scopeId","data-v-a432e638"]]),CM={class:"app"},TM=ke({__name:"App",setup(t){const e=O("system"),n=O("dark");Qs("effectiveTheme",n),Qs("theme",e);const s={light:"#ffffff",dark:"#101113"};function o(){const a=document.documentElement,c=window.matchMedia("(prefers-color-scheme: dark)").matches,u=e.value==="system"?c?"dark":"light":e.value;n.value=u,a.dataset.theme=u;const d=document.querySelector('meta[name="theme-color"]');d&&d.setAttribute("content",s[u])}let i=null;function r(a){const c=e.value;if(e.value=a,er("scream-theme",a),c===a)return;const u=document.documentElement,d=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,h=()=>{u.classList.add("theme-transition"),o(),i!==null&&clearTimeout(i),i=window.setTimeout(()=>u.classList.remove("theme-transition"),320)},p=document;if(typeof p.startViewTransition=="function"&&!d){p.startViewTransition(()=>{o()}).finished.then(()=>u.classList.remove("theme-transition"),()=>{u.classList.remove("theme-transition")});return}h()}Qs("setTheme",r),Ze(()=>{const a=Qi("scream-theme");(a==="light"||a==="dark"||a==="system")&&(e.value=a),o()}),xe(e,o);const l=window.matchMedia("(prefers-color-scheme: dark)");return l.addEventListener("change",o),ft(()=>{l.removeEventListener("change",o),i!==null&&clearTimeout(i),document.documentElement.classList.remove("theme-transition")}),(a,c)=>(g(),v("div",CM,[J(gM),J(bM),J(xM)]))}}),IM=we(TM,[["__scopeId","data-v-6c4eed55"]]);cp(IM).mount("#app");
|
|
96
|
+
//# sourceMappingURL=index-DwX1jGaf.js.map
|