codexapp 0.1.15 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,48 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();/**
2
+ * @vue/shared v3.5.28
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/function Bo(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const lt={},mr=[],dn=()=>{},Qa=()=>!1,xs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Fo=e=>e.startsWith("onUpdate:"),kt=Object.assign,Ho=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},su=Object.prototype.hasOwnProperty,tt=(e,t)=>su.call(e,t),Pe=Array.isArray,gr=e=>Xr(e)==="[object Map]",Xa=e=>Xr(e)==="[object Set]",ki=e=>Xr(e)==="[object Date]",Be=e=>typeof e=="function",gt=e=>typeof e=="string",en=e=>typeof e=="symbol",nt=e=>e!==null&&typeof e=="object",Za=e=>(nt(e)||Be(e))&&Be(e.then)&&Be(e.catch),el=Object.prototype.toString,Xr=e=>el.call(e),ou=e=>Xr(e).slice(8,-1),tl=e=>Xr(e)==="[object Object]",Uo=e=>gt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Or=Bo(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Cs=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},iu=/-\w/g,Yt=Cs(e=>e.replace(iu,t=>t.slice(1).toUpperCase())),au=/\B([A-Z])/g,Fn=Cs(e=>e.replace(au,"-$1").toLowerCase()),As=Cs(e=>e.charAt(0).toUpperCase()+e.slice(1)),Us=Cs(e=>e?`on${As(e)}`:""),jn=(e,t)=>!Object.is(e,t),ds=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},nl=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Vo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},lu=e=>{const t=gt(e)?Number(e):NaN;return isNaN(t)?e:t};let Ti;const Es=()=>Ti||(Ti=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function rr(e){if(Pe(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=gt(r)?fu(r):rr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(gt(e)||nt(e))return e}const cu=/;(?![^(]*\))/g,uu=/:([^]+)/,du=/\/\*[^]*?\*\//g;function fu(e){const t={};return e.replace(du,"").split(cu).forEach(n=>{if(n){const r=n.split(uu);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ut(e){let t="";if(gt(e))t=e;else if(Pe(e))for(let n=0;n<e.length;n++){const r=ut(e[n]);r&&(t+=r+" ")}else if(nt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const hu="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",pu=Bo(hu);function rl(e){return!!e||e===""}function mu(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=qo(e[r],t[r]);return n}function qo(e,t){if(e===t)return!0;let n=ki(e),r=ki(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=en(e),r=en(t),n||r)return e===t;if(n=Pe(e),r=Pe(t),n||r)return n&&r?mu(e,t):!1;if(n=nt(e),r=nt(t),n||r){if(!n||!r)return!1;const s=Object.keys(e).length,o=Object.keys(t).length;if(s!==o)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!qo(e[i],t[i]))return!1}}return String(e)===String(t)}const sl=e=>!!(e&&e.__v_isRef===!0),_e=e=>gt(e)?e:e==null?"":Pe(e)||nt(e)&&(e.toString===el||!Be(e.toString))?sl(e)?_e(e.value):JSON.stringify(e,ol,2):String(e),ol=(e,t)=>sl(t)?ol(e,t.value):gr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[Vs(r,o)+" =>"]=s,n),{})}:Xa(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Vs(n))}:en(t)?Vs(t):nt(t)&&!Pe(t)&&!tl(t)?String(t):t,Vs=(e,t="")=>{var n;return en(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
+ * @vue/reactivity v3.5.28
7
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
+ * @license MIT
9
+ **/let Dt;class gu{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Dt,!t&&Dt&&(this.index=(Dt.scopes||(Dt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=Dt;try{return Dt=this,t()}finally{Dt=n}}}on(){++this._on===1&&(this.prevScope=Dt,Dt=this)}off(){this._on>0&&--this._on===0&&(Dt=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function vu(){return Dt}let ct;const qs=new WeakSet;class il{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Dt&&Dt.active&&Dt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,qs.has(this)&&(qs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ll(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Si(this),cl(this);const t=ct,n=Xt;ct=this,Xt=!0;try{return this.fn()}finally{ul(this),ct=t,Xt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Go(t);this.deps=this.depsTail=void 0,Si(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?qs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){go(this)&&this.run()}get dirty(){return go(this)}}let al=0,jr,Lr;function ll(e,t=!1){if(e.flags|=8,t){e.next=Lr,Lr=e;return}e.next=jr,jr=e}function Wo(){al++}function Ko(){if(--al>0)return;if(Lr){let t=Lr;for(Lr=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;jr;){let t=jr;for(jr=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function cl(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ul(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Go(r),yu(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function go(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(dl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function dl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Vr)||(e.globalVersion=Vr,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!go(e))))return;e.flags|=2;const t=e.dep,n=ct,r=Xt;ct=e,Xt=!0;try{cl(e);const s=e.fn(e._value);(t.version===0||jn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{ct=n,Xt=r,ul(e),e.flags&=-3}}function Go(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)Go(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function yu(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Xt=!0;const fl=[];function Tn(){fl.push(Xt),Xt=!1}function Sn(){const e=fl.pop();Xt=e===void 0?!0:e}function Si(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ct;ct=void 0;try{t()}finally{ct=n}}}let Vr=0;class wu{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class zo{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ct||!Xt||ct===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ct)n=this.activeLink=new wu(ct,this),ct.deps?(n.prevDep=ct.depsTail,ct.depsTail.nextDep=n,ct.depsTail=n):ct.deps=ct.depsTail=n,hl(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=ct.depsTail,n.nextDep=void 0,ct.depsTail.nextDep=n,ct.depsTail=n,ct.deps===n&&(ct.deps=r)}return n}trigger(t){this.version++,Vr++,this.notify(t)}notify(t){Wo();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ko()}}}function hl(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)hl(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const vo=new WeakMap,tr=Symbol(""),yo=Symbol(""),qr=Symbol("");function Rt(e,t,n){if(Xt&&ct){let r=vo.get(e);r||vo.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new zo),s.map=r,s.key=n),s.track()}}function bn(e,t,n,r,s,o){const i=vo.get(e);if(!i){Vr++;return}const a=l=>{l&&l.trigger()};if(Wo(),t==="clear")i.forEach(a);else{const l=Pe(e),d=l&&Uo(n);if(l&&n==="length"){const u=Number(r);i.forEach((f,g)=>{(g==="length"||g===qr||!en(g)&&g>=u)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(qr)),t){case"add":l?d&&a(i.get("length")):(a(i.get(tr)),gr(e)&&a(i.get(yo)));break;case"delete":l||(a(i.get(tr)),gr(e)&&a(i.get(yo)));break;case"set":gr(e)&&a(i.get(tr));break}}Ko()}function ur(e){const t=Je(e);return t===e?t:(Rt(t,"iterate",qr),Gt(e)?t:t.map(tn))}function Is(e){return Rt(e=Je(e),"iterate",qr),e}function Mn(e,t){return xn(e)?br(nr(e)?tn(t):t):tn(t)}const bu={__proto__:null,[Symbol.iterator](){return Ws(this,Symbol.iterator,e=>Mn(this,e))},concat(...e){return ur(this).concat(...e.map(t=>Pe(t)?ur(t):t))},entries(){return Ws(this,"entries",e=>(e[1]=Mn(this,e[1]),e))},every(e,t){return mn(this,"every",e,t,void 0,arguments)},filter(e,t){return mn(this,"filter",e,t,n=>n.map(r=>Mn(this,r)),arguments)},find(e,t){return mn(this,"find",e,t,n=>Mn(this,n),arguments)},findIndex(e,t){return mn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return mn(this,"findLast",e,t,n=>Mn(this,n),arguments)},findLastIndex(e,t){return mn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return mn(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ks(this,"includes",e)},indexOf(...e){return Ks(this,"indexOf",e)},join(e){return ur(this).join(e)},lastIndexOf(...e){return Ks(this,"lastIndexOf",e)},map(e,t){return mn(this,"map",e,t,void 0,arguments)},pop(){return Er(this,"pop")},push(...e){return Er(this,"push",e)},reduce(e,...t){return xi(this,"reduce",e,t)},reduceRight(e,...t){return xi(this,"reduceRight",e,t)},shift(){return Er(this,"shift")},some(e,t){return mn(this,"some",e,t,void 0,arguments)},splice(...e){return Er(this,"splice",e)},toReversed(){return ur(this).toReversed()},toSorted(e){return ur(this).toSorted(e)},toSpliced(...e){return ur(this).toSpliced(...e)},unshift(...e){return Er(this,"unshift",e)},values(){return Ws(this,"values",e=>Mn(this,e))}};function Ws(e,t,n){const r=Is(e),s=r[t]();return r!==e&&!Gt(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const _u=Array.prototype;function mn(e,t,n,r,s,o){const i=Is(e),a=i!==e&&!Gt(e),l=i[t];if(l!==_u[t]){const f=l.apply(e,o);return a?tn(f):f}let d=n;i!==e&&(a?d=function(f,g){return n.call(this,Mn(e,f),g,e)}:n.length>2&&(d=function(f,g){return n.call(this,f,g,e)}));const u=l.call(i,d,r);return a&&s?s(u):u}function xi(e,t,n,r){const s=Is(e);let o=n;return s!==e&&(Gt(e)?n.length>3&&(o=function(i,a,l){return n.call(this,i,a,l,e)}):o=function(i,a,l){return n.call(this,i,Mn(e,a),l,e)}),s[t](o,...r)}function Ks(e,t,n){const r=Je(e);Rt(r,"iterate",qr);const s=r[t](...n);return(s===-1||s===!1)&&Qo(n[0])?(n[0]=Je(n[0]),r[t](...n)):s}function Er(e,t,n=[]){Tn(),Wo();const r=Je(e)[t].apply(e,n);return Ko(),Sn(),r}const ku=Bo("__proto__,__v_isRef,__isVue"),pl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(en));function Tu(e){en(e)||(e=String(e));const t=Je(this);return Rt(t,"has",e),t.hasOwnProperty(e)}class ml{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?Pu:wl:o?yl:vl).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Pe(t);if(!s){let l;if(i&&(l=bu[n]))return l;if(n==="hasOwnProperty")return Tu}const a=Reflect.get(t,n,Pt(t)?t:r);if((en(n)?pl.has(n):ku(n))||(s||Rt(t,"get",n),o))return a;if(Pt(a)){const l=i&&Uo(n)?a:a.value;return s&&nt(l)?bo(l):l}return nt(a)?s?bo(a):Rs(a):a}}class gl extends ml{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Pe(t)&&Uo(n);if(!this._isShallow){const d=xn(o);if(!Gt(r)&&!xn(r)&&(o=Je(o),r=Je(r)),!i&&Pt(o)&&!Pt(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:tt(t,n),l=Reflect.set(t,n,r,Pt(t)?t:s);return t===Je(s)&&(a?jn(r,o)&&bn(t,"set",n,r):bn(t,"add",n,r)),l}deleteProperty(t,n){const r=tt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&bn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!en(n)||!pl.has(n))&&Rt(t,"has",n),r}ownKeys(t){return Rt(t,"iterate",Pe(t)?"length":tr),Reflect.ownKeys(t)}}class Su extends ml{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const xu=new gl,Cu=new Su,Au=new gl(!0);const wo=e=>e,rs=e=>Reflect.getPrototypeOf(e);function Eu(e,t,n){return function(...r){const s=this.__v_raw,o=Je(s),i=gr(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),u=n?wo:t?br:tn;return!t&&Rt(o,"iterate",l?yo:tr),kt(Object.create(d),{next(){const{value:f,done:g}=d.next();return g?{value:f,done:g}:{value:a?[u(f[0]),u(f[1])]:u(f),done:g}}})}}function ss(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Iu(e,t){const n={get(s){const o=this.__v_raw,i=Je(o),a=Je(s);e||(jn(s,a)&&Rt(i,"get",s),Rt(i,"get",a));const{has:l}=rs(i),d=t?wo:e?br:tn;if(l.call(i,s))return d(o.get(s));if(l.call(i,a))return d(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Rt(Je(s),"iterate",tr),s.size},has(s){const o=this.__v_raw,i=Je(o),a=Je(s);return e||(jn(s,a)&&Rt(i,"has",s),Rt(i,"has",a)),s===a?o.has(s):o.has(s)||o.has(a)},forEach(s,o){const i=this,a=i.__v_raw,l=Je(a),d=t?wo:e?br:tn;return!e&&Rt(l,"iterate",tr),a.forEach((u,f)=>s.call(o,d(u),d(f),i))}};return kt(n,e?{add:ss("add"),set:ss("set"),delete:ss("delete"),clear:ss("clear")}:{add(s){!t&&!Gt(s)&&!xn(s)&&(s=Je(s));const o=Je(this);return rs(o).has.call(o,s)||(o.add(s),bn(o,"add",s,s)),this},set(s,o){!t&&!Gt(o)&&!xn(o)&&(o=Je(o));const i=Je(this),{has:a,get:l}=rs(i);let d=a.call(i,s);d||(s=Je(s),d=a.call(i,s));const u=l.call(i,s);return i.set(s,o),d?jn(o,u)&&bn(i,"set",s,o):bn(i,"add",s,o),this},delete(s){const o=Je(this),{has:i,get:a}=rs(o);let l=i.call(o,s);l||(s=Je(s),l=i.call(o,s)),a&&a.call(o,s);const d=o.delete(s);return l&&bn(o,"delete",s,void 0),d},clear(){const s=Je(this),o=s.size!==0,i=s.clear();return o&&bn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Eu(s,e,t)}),n}function Yo(e,t){const n=Iu(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(tt(n,s)&&s in r?n:r,s,o)}const Ru={get:Yo(!1,!1)},$u={get:Yo(!1,!0)},Mu={get:Yo(!0,!1)};const vl=new WeakMap,yl=new WeakMap,wl=new WeakMap,Pu=new WeakMap;function Nu(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ou(e){return e.__v_skip||!Object.isExtensible(e)?0:Nu(ou(e))}function Rs(e){return xn(e)?e:Jo(e,!1,xu,Ru,vl)}function bl(e){return Jo(e,!1,Au,$u,yl)}function bo(e){return Jo(e,!0,Cu,Mu,wl)}function Jo(e,t,n,r,s){if(!nt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Ou(e);if(o===0)return e;const i=s.get(e);if(i)return i;const a=new Proxy(e,o===2?r:n);return s.set(e,a),a}function nr(e){return xn(e)?nr(e.__v_raw):!!(e&&e.__v_isReactive)}function xn(e){return!!(e&&e.__v_isReadonly)}function Gt(e){return!!(e&&e.__v_isShallow)}function Qo(e){return e?!!e.__v_raw:!1}function Je(e){const t=e&&e.__v_raw;return t?Je(t):e}function ju(e){return!tt(e,"__v_skip")&&Object.isExtensible(e)&&nl(e,"__v_skip",!0),e}const tn=e=>nt(e)?Rs(e):e,br=e=>nt(e)?bo(e):e;function Pt(e){return e?e.__v_isRef===!0:!1}function D(e){return _l(e,!1)}function Lu(e){return _l(e,!0)}function _l(e,t){return Pt(e)?e:new Du(e,t)}class Du{constructor(t,n){this.dep=new zo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Je(t),this._value=n?t:tn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Gt(t)||xn(t);t=r?t:Je(t),jn(t,n)&&(this._rawValue=t,this._value=r?t:tn(t),this.dep.trigger())}}function Me(e){return Pt(e)?e.value:e}const Bu={get:(e,t,n)=>t==="__v_raw"?e:Me(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Pt(s)&&!Pt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function kl(e){return nr(e)?e:new Proxy(e,Bu)}class Fu{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new zo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Vr-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ct!==this)return ll(this,!0),!0}get value(){const t=this.dep.track();return dl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Hu(e,t,n=!1){let r,s;return Be(e)?r=e:(r=e.get,s=e.set),new Fu(r,s,n)}const os={},gs=new WeakMap;let Qn;function Uu(e,t=!1,n=Qn){if(n){let r=gs.get(n);r||gs.set(n,r=[]),r.push(e)}}function Vu(e,t,n=lt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=F=>s?F:Gt(F)||s===!1||s===0?_n(F,1):_n(F);let u,f,g,b,$=!1,E=!1;if(Pt(e)?(f=()=>e.value,$=Gt(e)):nr(e)?(f=()=>d(e),$=!0):Pe(e)?(E=!0,$=e.some(F=>nr(F)||Gt(F)),f=()=>e.map(F=>{if(Pt(F))return F.value;if(nr(F))return d(F);if(Be(F))return l?l(F,2):F()})):Be(e)?t?f=l?()=>l(e,2):e:f=()=>{if(g){Tn();try{g()}finally{Sn()}}const F=Qn;Qn=u;try{return l?l(e,3,[b]):e(b)}finally{Qn=F}}:f=dn,t&&s){const F=f,ae=s===!0?1/0:s;f=()=>_n(F(),ae)}const B=vu(),W=()=>{u.stop(),B&&B.active&&Ho(B.effects,u)};if(o&&t){const F=t;t=(...ae)=>{F(...ae),W()}}let M=E?new Array(e.length).fill(os):os;const U=F=>{if(!(!(u.flags&1)||!u.dirty&&!F))if(t){const ae=u.run();if(s||$||(E?ae.some((ie,le)=>jn(ie,M[le])):jn(ae,M))){g&&g();const ie=Qn;Qn=u;try{const le=[ae,M===os?void 0:E&&M[0]===os?[]:M,b];M=ae,l?l(t,3,le):t(...le)}finally{Qn=ie}}}else u.run()};return a&&a(U),u=new il(f),u.scheduler=i?()=>i(U,!1):U,b=F=>Uu(F,!1,u),g=u.onStop=()=>{const F=gs.get(u);if(F){if(l)l(F,4);else for(const ae of F)ae();gs.delete(u)}},t?r?U(!0):M=u.run():i?i(U.bind(null,!0),!0):u.run(),W.pause=u.pause.bind(u),W.resume=u.resume.bind(u),W.stop=W,W}function _n(e,t=1/0,n){if(t<=0||!nt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Pt(e))_n(e.value,t,n);else if(Pe(e))for(let r=0;r<e.length;r++)_n(e[r],t,n);else if(Xa(e)||gr(e))e.forEach(r=>{_n(r,t,n)});else if(tl(e)){for(const r in e)_n(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&_n(e[r],t,n)}return e}/**
10
+ * @vue/runtime-core v3.5.28
11
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
+ * @license MIT
13
+ **/function Zr(e,t,n,r){try{return r?e(...r):e()}catch(s){$s(s,t,n)}}function nn(e,t,n,r){if(Be(e)){const s=Zr(e,t,n,r);return s&&Za(s)&&s.catch(o=>{$s(o,t,n)}),s}if(Pe(e)){const s=[];for(let o=0;o<e.length;o++)s.push(nn(e[o],t,n,r));return s}}function $s(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||lt;if(t){let a=t.parent;const l=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let f=0;f<u.length;f++)if(u[f](e,l,d)===!1)return}a=a.parent}if(o){Tn(),Zr(o,null,10,[e,l,d]),Sn();return}}qu(e,n,s,r,i)}function qu(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const jt=[];let an=-1;const vr=[];let Pn=null,fr=0;const Tl=Promise.resolve();let vs=null;function zt(e){const t=vs||Tl;return e?t.then(this?e.bind(this):e):t}function Wu(e){let t=an+1,n=jt.length;for(;t<n;){const r=t+n>>>1,s=jt[r],o=Wr(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function Xo(e){if(!(e.flags&1)){const t=Wr(e),n=jt[jt.length-1];!n||!(e.flags&2)&&t>=Wr(n)?jt.push(e):jt.splice(Wu(t),0,e),e.flags|=1,Sl()}}function Sl(){vs||(vs=Tl.then(Cl))}function Ku(e){Pe(e)?vr.push(...e):Pn&&e.id===-1?Pn.splice(fr+1,0,e):e.flags&1||(vr.push(e),e.flags|=1),Sl()}function Ci(e,t,n=an+1){for(;n<jt.length;n++){const r=jt[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;jt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function xl(e){if(vr.length){const t=[...new Set(vr)].sort((n,r)=>Wr(n)-Wr(r));if(vr.length=0,Pn){Pn.push(...t);return}for(Pn=t,fr=0;fr<Pn.length;fr++){const n=Pn[fr];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Pn=null,fr=0}}const Wr=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Cl(e){try{for(an=0;an<jt.length;an++){const t=jt[an];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Zr(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;an<jt.length;an++){const t=jt[an];t&&(t.flags&=-2)}an=-1,jt.length=0,xl(),vs=null,(jt.length||vr.length)&&Cl()}}let xt=null,Al=null;function ys(e){const t=xt;return xt=e,Al=e&&e.type.__scopeId||null,t}function ot(e,t=xt,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&_s(-1);const o=ys(t);let i;try{i=e(...s)}finally{ys(o),r._d&&_s(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Ln(e,t){if(xt===null)return e;const n=Ls(xt),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=lt]=t[s];o&&(Be(o)&&(o={mounted:o,updated:o}),o.deep&&_n(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Kn(e,t,n,r){const s=e.dirs,o=t&&t.dirs;for(let i=0;i<s.length;i++){const a=s[i];o&&(a.oldValue=o[i].value);let l=a.dir[r];l&&(Tn(),nn(l,n,8,[e.el,a,e,t]),Sn())}}function fs(e,t){if(Mt){let n=Mt.provides;const r=Mt.parent&&Mt.parent.provides;r===n&&(n=Mt.provides=Object.create(r)),n[e]=t}}function Zt(e,t,n=!1){const r=ri();if(r||wr){let s=wr?wr._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Be(t)?t.call(r&&r.proxy):t}}const Gu=Symbol.for("v-scx"),zu=()=>Zt(Gu);function pt(e,t,n){return El(e,t,n)}function El(e,t,n=lt){const{immediate:r,deep:s,flush:o,once:i}=n,a=kt({},n),l=t&&r||!t&&o!=="post";let d;if(Yr){if(o==="sync"){const b=zu();d=b.__watcherHandles||(b.__watcherHandles=[])}else if(!l){const b=()=>{};return b.stop=dn,b.resume=dn,b.pause=dn,b}}const u=Mt;a.call=(b,$,E)=>nn(b,u,$,E);let f=!1;o==="post"?a.scheduler=b=>{It(b,u&&u.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(b,$)=>{$?b():Xo(b)}),a.augmentJob=b=>{t&&(b.flags|=4),f&&(b.flags|=2,u&&(b.id=u.uid,b.i=u))};const g=Vu(e,t,a);return Yr&&(d?d.push(g):l&&g()),g}function Yu(e,t,n){const r=this.proxy,s=gt(e)?e.includes(".")?Il(r,e):()=>r[e]:e.bind(r,r);let o;Be(t)?o=t:(o=t.handler,n=t);const i=es(this),a=El(s,o.bind(r),n);return i(),a}function Il(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}const Rl=Symbol("_vte"),$l=e=>e.__isTeleport,Dr=e=>e&&(e.disabled||e.disabled===""),Ai=e=>e&&(e.defer||e.defer===""),Ei=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Ii=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,_o=(e,t)=>{const n=e&&e.to;return gt(n)?t?t(n):null:n},Ml={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,d){const{mc:u,pc:f,pbc:g,o:{insert:b,querySelector:$,createText:E,createComment:B}}=d,W=Dr(t.props);let{shapeFlag:M,children:U,dynamicChildren:F}=t;if(e==null){const ae=t.el=E(""),ie=t.anchor=E("");b(ae,n,r),b(ie,n,r);const le=(oe,Z)=>{M&16&&u(U,oe,Z,s,o,i,a,l)},fe=()=>{const oe=t.target=_o(t.props,$),Z=ko(oe,t,E,b);oe&&(i!=="svg"&&Ei(oe)?i="svg":i!=="mathml"&&Ii(oe)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(oe),W||(le(oe,Z),hs(t,!1)))};W&&(le(n,ie),hs(t,!0)),Ai(t.props)?(t.el.__isMounted=!1,It(()=>{fe(),delete t.el.__isMounted},o)):fe()}else{if(Ai(t.props)&&e.el.__isMounted===!1){It(()=>{Ml.process(e,t,n,r,s,o,i,a,l,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const ae=t.anchor=e.anchor,ie=t.target=e.target,le=t.targetAnchor=e.targetAnchor,fe=Dr(e.props),oe=fe?n:ie,Z=fe?ae:le;if(i==="svg"||Ei(ie)?i="svg":(i==="mathml"||Ii(ie))&&(i="mathml"),F?(g(e.dynamicChildren,F,oe,s,o,i,a),ti(e,t,!0)):l||f(e,t,oe,Z,s,o,i,a,!1),W)fe?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):is(t,n,ae,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const he=t.target=_o(t.props,$);he&&is(t,he,null,d,0)}else fe&&is(t,ie,le,d,1);hs(t,W)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:d,targetAnchor:u,target:f,props:g}=e;if(f&&(s(d),s(u)),o&&s(l),i&16){const b=o||!Dr(g);for(let $=0;$<a.length;$++){const E=a[$];r(E,t,n,b,!!E.dynamicChildren)}}},move:is,hydrate:Ju};function is(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:d,props:u}=e,f=o===2;if(f&&r(i,t,n),(!f||Dr(u))&&l&16)for(let g=0;g<d.length;g++)s(d[g],t,n,2);f&&r(a,t,n)}function Ju(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:u}},f){function g(B,W){let M=W;for(;M;){if(M&&M.nodeType===8){if(M.data==="teleport start anchor")t.targetStart=M;else if(M.data==="teleport anchor"){t.targetAnchor=M,B._lpa=t.targetAnchor&&i(t.targetAnchor);break}}M=i(M)}}function b(B,W){W.anchor=f(i(B),W,a(B),n,r,s,o)}const $=t.target=_o(t.props,l),E=Dr(t.props);if($){const B=$._lpa||$.firstChild;t.shapeFlag&16&&(E?(b(e,t),g($,B),t.targetAnchor||ko($,t,u,d,a(e)===$?e:null)):(t.anchor=i(e),g($,B),t.targetAnchor||ko($,t,u,d),f(B&&i(B),t,$,n,r,s,o))),hs(t,E)}else E&&t.shapeFlag&16&&(b(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Pl=Ml;function hs(e,t){const n=e.ctx;if(n&&n.ut){let r,s;for(t?(r=e.el,s=e.anchor):(r=e.targetStart,s=e.targetAnchor);r&&r!==s;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function ko(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Rl]=i,e&&(r(o,e,s),r(i,e,s)),i}const ln=Symbol("_leaveCb"),Ir=Symbol("_enterCb");function Qu(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Hn(()=>{e.isMounted=!0}),Un(()=>{e.isUnmounting=!0}),e}const Wt=[Function,Array],Nl={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Wt,onEnter:Wt,onAfterEnter:Wt,onEnterCancelled:Wt,onBeforeLeave:Wt,onLeave:Wt,onAfterLeave:Wt,onLeaveCancelled:Wt,onBeforeAppear:Wt,onAppear:Wt,onAfterAppear:Wt,onAppearCancelled:Wt},Ol=e=>{const t=e.subTree;return t.component?Ol(t.component):t},Xu={name:"BaseTransition",props:Nl,setup(e,{slots:t}){const n=ri(),r=Qu();return()=>{const s=t.default&&Dl(t.default(),!0);if(!s||!s.length)return;const o=jl(s),i=Je(e),{mode:a}=i;if(r.isLeaving)return Gs(o);const l=Ri(o);if(!l)return Gs(o);let d=To(l,i,r,n,f=>d=f);l.type!==$t&&Kr(l,d);let u=n.subTree&&Ri(n.subTree);if(u&&u.type!==$t&&!Xn(u,l)&&Ol(n).type!==$t){let f=To(u,i,r,n);if(Kr(u,f),a==="out-in"&&l.type!==$t)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,u=void 0},Gs(o);a==="in-out"&&l.type!==$t?f.delayLeave=(g,b,$)=>{const E=Ll(r,u);E[String(u.key)]=u,g[ln]=()=>{b(),g[ln]=void 0,delete d.delayedLeave,u=void 0},d.delayedLeave=()=>{$(),delete d.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function jl(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==$t){t=n;break}}return t}const Zu=Xu;function Ll(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function To(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:g,onLeave:b,onAfterLeave:$,onLeaveCancelled:E,onBeforeAppear:B,onAppear:W,onAfterAppear:M,onAppearCancelled:U}=t,F=String(e.key),ae=Ll(n,e),ie=(oe,Z)=>{oe&&nn(oe,r,9,Z)},le=(oe,Z)=>{const he=Z[1];ie(oe,Z),Pe(oe)?oe.every(ee=>ee.length<=1)&&he():oe.length<=1&&he()},fe={mode:i,persisted:a,beforeEnter(oe){let Z=l;if(!n.isMounted)if(o)Z=B||l;else return;oe[ln]&&oe[ln](!0);const he=ae[F];he&&Xn(e,he)&&he.el[ln]&&he.el[ln](),ie(Z,[oe])},enter(oe){let Z=d,he=u,ee=f;if(!n.isMounted)if(o)Z=W||d,he=M||u,ee=U||f;else return;let Oe=!1;oe[Ir]=rt=>{Oe||(Oe=!0,rt?ie(ee,[oe]):ie(he,[oe]),fe.delayedLeave&&fe.delayedLeave(),oe[Ir]=void 0)};const qe=oe[Ir].bind(null,!1);Z?le(Z,[oe,qe]):qe()},leave(oe,Z){const he=String(e.key);if(oe[Ir]&&oe[Ir](!0),n.isUnmounting)return Z();ie(g,[oe]);let ee=!1;oe[ln]=qe=>{ee||(ee=!0,Z(),qe?ie(E,[oe]):ie($,[oe]),oe[ln]=void 0,ae[he]===e&&delete ae[he])};const Oe=oe[ln].bind(null,!1);ae[he]=e,b?le(b,[oe,Oe]):Oe()},clone(oe){const Z=To(oe,t,n,r,s);return s&&s(Z),Z}};return fe}function Gs(e){if(Ms(e))return e=Dn(e),e.children=null,e}function Ri(e){if(!Ms(e))return $l(e.type)&&e.children?jl(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Be(n.default))return n.default()}}function Kr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Kr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Dl(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===De?(i.patchFlag&128&&s++,r=r.concat(Dl(i.children,t,a))):(t||i.type!==$t)&&r.push(a!=null?Dn(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Ct(e,t){return Be(e)?kt({name:e.name},t,{setup:e}):e}function Bl(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function $i(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const ws=new WeakMap;function Br(e,t,n,r,s=!1){if(Pe(e)){e.forEach((E,B)=>Br(E,t&&(Pe(t)?t[B]:t),n,r,s));return}if(yr(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Br(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?Ls(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,u=a.refs===lt?a.refs={}:a.refs,f=a.setupState,g=Je(f),b=f===lt?Qa:E=>$i(u,E)?!1:tt(g,E),$=(E,B)=>!(B&&$i(u,B));if(d!=null&&d!==l){if(Mi(t),gt(d))u[d]=null,b(d)&&(f[d]=null);else if(Pt(d)){const E=t;$(d,E.k)&&(d.value=null),E.k&&(u[E.k]=null)}}if(Be(l))Zr(l,a,12,[i,u]);else{const E=gt(l),B=Pt(l);if(E||B){const W=()=>{if(e.f){const M=E?b(l)?f[l]:u[l]:$()||!e.k?l.value:u[e.k];if(s)Pe(M)&&Ho(M,o);else if(Pe(M))M.includes(o)||M.push(o);else if(E)u[l]=[o],b(l)&&(f[l]=u[l]);else{const U=[o];$(l,e.k)&&(l.value=U),e.k&&(u[e.k]=U)}}else E?(u[l]=i,b(l)&&(f[l]=i)):B&&($(l,e.k)&&(l.value=i),e.k&&(u[e.k]=i))};if(i){const M=()=>{W(),ws.delete(e)};M.id=-1,ws.set(e,M),It(M,n)}else Mi(e),W()}}}function Mi(e){const t=ws.get(e);t&&(t.flags|=8,ws.delete(e))}Es().requestIdleCallback;Es().cancelIdleCallback;const yr=e=>!!e.type.__asyncLoader,Ms=e=>e.type.__isKeepAlive;function ed(e,t){Fl(e,"a",t)}function td(e,t){Fl(e,"da",t)}function Fl(e,t,n=Mt){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Ps(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Ms(s.parent.vnode)&&nd(r,t,n,s),s=s.parent}}function nd(e,t,n,r){const s=Ps(t,e,r,!0);Ns(()=>{Ho(r[t],s)},n)}function Ps(e,t,n=Mt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Tn();const a=es(n),l=nn(t,n,e,i);return a(),Sn(),l});return r?s.unshift(o):s.push(o),o}}const Cn=e=>(t,n=Mt)=>{(!Yr||e==="sp")&&Ps(e,(...r)=>t(...r),n)},rd=Cn("bm"),Hn=Cn("m"),sd=Cn("bu"),od=Cn("u"),Un=Cn("bum"),Ns=Cn("um"),id=Cn("sp"),ad=Cn("rtg"),ld=Cn("rtc");function cd(e,t=Mt){Ps("ec",e,t)}const ud="components",Hl=Symbol.for("v-ndc");function dd(e){return gt(e)?fd(ud,e,!1)||e:e||Hl}function fd(e,t,n=!0,r=!1){const s=xt||Mt;if(s){const o=s.type;{const a=Qd(o,!1);if(a&&(a===t||a===Yt(t)||a===As(Yt(t))))return o}const i=Pi(s[e]||o[e],t)||Pi(s.appContext[e],t);return!i&&r?o:i}}function Pi(e,t){return e&&(e[t]||e[Yt(t)]||e[As(Yt(t))])}function mt(e,t,n,r){let s;const o=n,i=Pe(e);if(i||gt(e)){const a=i&&nr(e);let l=!1,d=!1;a&&(l=!Gt(e),d=xn(e),e=Is(e)),s=new Array(e.length);for(let u=0,f=e.length;u<f;u++)s[u]=t(l?d?br(tn(e[u])):tn(e[u]):e[u],u,void 0,o)}else if(typeof e=="number"){s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,o)}else if(nt(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,d=a.length;l<d;l++){const u=a[l];s[l]=t(e[u],u,l,o)}}else s=[];return s}function un(e,t,n={},r,s){if(xt.ce||xt.parent&&yr(xt.parent)&&xt.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),_(),at(De,null,[Ie("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),_();const i=o&&Ul(o(n)),a=n.key||i&&i.key,l=at(De,{key:(a&&!en(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function Ul(e){return e.some(t=>zr(t)?!(t.type===$t||t.type===De&&!Ul(t.children)):!0)?e:null}const So=e=>e?lc(e)?Ls(e):So(e.parent):null,Fr=kt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>So(e.parent),$root:e=>So(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ql(e),$forceUpdate:e=>e.f||(e.f=()=>{Xo(e.update)}),$nextTick:e=>e.n||(e.n=zt.bind(e.proxy)),$watch:e=>Yu.bind(e)}),zs=(e,t)=>e!==lt&&!e.__isScriptSetup&&tt(e,t),hd={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:o,accessCache:i,type:a,appContext:l}=e;if(t[0]!=="$"){const g=i[t];if(g!==void 0)switch(g){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(zs(r,t))return i[t]=1,r[t];if(s!==lt&&tt(s,t))return i[t]=2,s[t];if(tt(o,t))return i[t]=3,o[t];if(n!==lt&&tt(n,t))return i[t]=4,n[t];xo&&(i[t]=0)}}const d=Fr[t];let u,f;if(d)return t==="$attrs"&&Rt(e.attrs,"get",""),d(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==lt&&tt(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,tt(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return zs(s,t)?(s[t]=n,!0):r!==lt&&tt(r,t)?(r[t]=n,!0):tt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,props:o,type:i}},a){let l;return!!(n[a]||e!==lt&&a[0]!=="$"&&tt(e,a)||zs(t,a)||tt(o,a)||tt(r,a)||tt(Fr,a)||tt(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:tt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function pd(){return md().slots}function md(e){const t=ri();return t.setupContext||(t.setupContext=uc(t))}function Ni(e){return Pe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let xo=!0;function gd(e){const t=ql(e),n=e.proxy,r=e.ctx;xo=!1,t.beforeCreate&&Oi(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:d,created:u,beforeMount:f,mounted:g,beforeUpdate:b,updated:$,activated:E,deactivated:B,beforeDestroy:W,beforeUnmount:M,destroyed:U,unmounted:F,render:ae,renderTracked:ie,renderTriggered:le,errorCaptured:fe,serverPrefetch:oe,expose:Z,inheritAttrs:he,components:ee,directives:Oe,filters:qe}=t;if(d&&vd(d,r,null),i)for(const Te in i){const Ae=i[Te];Be(Ae)&&(r[Te]=Ae.bind(n))}if(s){const Te=s.call(n,n);nt(Te)&&(e.data=Rs(Te))}if(xo=!0,o)for(const Te in o){const Ae=o[Te],ht=Be(Ae)?Ae.bind(n,n):Be(Ae.get)?Ae.get.bind(n,n):dn,it=!Be(Ae)&&Be(Ae.set)?Ae.set.bind(n):dn,Qe=ce({get:ht,set:it});Object.defineProperty(r,Te,{enumerable:!0,configurable:!0,get:()=>Qe.value,set:Ye=>Qe.value=Ye})}if(a)for(const Te in a)Vl(a[Te],r,n,Te);if(l){const Te=Be(l)?l.call(n):l;Reflect.ownKeys(Te).forEach(Ae=>{fs(Ae,Te[Ae])})}u&&Oi(u,e,"c");function Ne(Te,Ae){Pe(Ae)?Ae.forEach(ht=>Te(ht.bind(n))):Ae&&Te(Ae.bind(n))}if(Ne(rd,f),Ne(Hn,g),Ne(sd,b),Ne(od,$),Ne(ed,E),Ne(td,B),Ne(cd,fe),Ne(ld,ie),Ne(ad,le),Ne(Un,M),Ne(Ns,F),Ne(id,oe),Pe(Z))if(Z.length){const Te=e.exposed||(e.exposed={});Z.forEach(Ae=>{Object.defineProperty(Te,Ae,{get:()=>n[Ae],set:ht=>n[Ae]=ht,enumerable:!0})})}else e.exposed||(e.exposed={});ae&&e.render===dn&&(e.render=ae),he!=null&&(e.inheritAttrs=he),ee&&(e.components=ee),Oe&&(e.directives=Oe),oe&&Bl(e)}function vd(e,t,n=dn){Pe(e)&&(e=Co(e));for(const r in e){const s=e[r];let o;nt(s)?"default"in s?o=Zt(s.from||r,s.default,!0):o=Zt(s.from||r):o=Zt(s),Pt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function Oi(e,t,n){nn(Pe(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Vl(e,t,n,r){let s=r.includes(".")?Il(n,r):()=>n[r];if(gt(e)){const o=t[e];Be(o)&&pt(s,o)}else if(Be(e))pt(s,e.bind(n));else if(nt(e))if(Pe(e))e.forEach(o=>Vl(o,t,n,r));else{const o=Be(e.handler)?e.handler.bind(n):t[e.handler];Be(o)&&pt(s,o,e)}}function ql(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,a=o.get(t);let l;return a?l=a:!s.length&&!n&&!r?l=t:(l={},s.length&&s.forEach(d=>bs(l,d,i,!0)),bs(l,t,i)),nt(t)&&o.set(t,l),l}function bs(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&bs(e,o,n,!0),s&&s.forEach(i=>bs(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=yd[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const yd={data:ji,props:Li,emits:Li,methods:Nr,computed:Nr,beforeCreate:Nt,created:Nt,beforeMount:Nt,mounted:Nt,beforeUpdate:Nt,updated:Nt,beforeDestroy:Nt,beforeUnmount:Nt,destroyed:Nt,unmounted:Nt,activated:Nt,deactivated:Nt,errorCaptured:Nt,serverPrefetch:Nt,components:Nr,directives:Nr,watch:bd,provide:ji,inject:wd};function ji(e,t){return t?e?function(){return kt(Be(e)?e.call(this,this):e,Be(t)?t.call(this,this):t)}:t:e}function wd(e,t){return Nr(Co(e),Co(t))}function Co(e){if(Pe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Nt(e,t){return e?[...new Set([].concat(e,t))]:t}function Nr(e,t){return e?kt(Object.create(null),e,t):t}function Li(e,t){return e?Pe(e)&&Pe(t)?[...new Set([...e,...t])]:kt(Object.create(null),Ni(e),Ni(t??{})):t}function bd(e,t){if(!e)return t;if(!t)return e;const n=kt(Object.create(null),e);for(const r in t)n[r]=Nt(e[r],t[r]);return n}function Wl(){return{app:null,config:{isNativeTag:Qa,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 _d=0;function kd(e,t){return function(r,s=null){Be(r)||(r=kt({},r)),s!=null&&!nt(s)&&(s=null);const o=Wl(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:_d++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:Zd,get config(){return o.config},set config(u){},use(u,...f){return i.has(u)||(u&&Be(u.install)?(i.add(u),u.install(d,...f)):Be(u)&&(i.add(u),u(d,...f))),d},mixin(u){return o.mixins.includes(u)||o.mixins.push(u),d},component(u,f){return f?(o.components[u]=f,d):o.components[u]},directive(u,f){return f?(o.directives[u]=f,d):o.directives[u]},mount(u,f,g){if(!l){const b=d._ceVNode||Ie(r,s);return b.appContext=o,g===!0?g="svg":g===!1&&(g=void 0),e(b,u,g),l=!0,d._container=u,u.__vue_app__=d,Ls(b.component)}},onUnmount(u){a.push(u)},unmount(){l&&(nn(a,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(u,f){return o.provides[u]=f,d},runWithContext(u){const f=wr;wr=d;try{return u()}finally{wr=f}}};return d}}let wr=null;const Td=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Yt(t)}Modifiers`]||e[`${Fn(t)}Modifiers`];function Sd(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||lt;let s=n;const o=t.startsWith("update:"),i=o&&Td(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>gt(u)?u.trim():u)),i.number&&(s=n.map(Vo)));let a,l=r[a=Us(t)]||r[a=Us(Yt(t))];!l&&o&&(l=r[a=Us(Fn(t))]),l&&nn(l,e,6,s);const d=r[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,nn(d,e,6,s)}}const xd=new WeakMap;function Kl(e,t,n=!1){const r=n?xd:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Be(e)){const l=d=>{const u=Kl(d,t,!0);u&&(a=!0,kt(i,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(nt(e)&&r.set(e,null),null):(Pe(o)?o.forEach(l=>i[l]=null):kt(i,o),nt(e)&&r.set(e,i),i)}function Os(e,t){return!e||!xs(t)?!1:(t=t.slice(2).replace(/Once$/,""),tt(e,t[0].toLowerCase()+t.slice(1))||tt(e,Fn(t))||tt(e,t))}function Di(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:d,renderCache:u,props:f,data:g,setupState:b,ctx:$,inheritAttrs:E}=e,B=ys(e);let W,M;try{if(n.shapeFlag&4){const F=s||r,ae=F;W=cn(d.call(ae,F,u,f,b,g,$)),M=a}else{const F=t;W=cn(F.length>1?F(f,{attrs:a,slots:i,emit:l}):F(f,null)),M=t.props?a:Cd(a)}}catch(F){Hr.length=0,$s(F,e,1),W=Ie($t)}let U=W;if(M&&E!==!1){const F=Object.keys(M),{shapeFlag:ae}=U;F.length&&ae&7&&(o&&F.some(Fo)&&(M=Ad(M,o)),U=Dn(U,M,!1,!0))}return n.dirs&&(U=Dn(U,null,!1,!0),U.dirs=U.dirs?U.dirs.concat(n.dirs):n.dirs),n.transition&&Kr(U,n.transition),W=U,ys(B),W}const Cd=e=>{let t;for(const n in e)(n==="class"||n==="style"||xs(n))&&((t||(t={}))[n]=e[n]);return t},Ad=(e,t)=>{const n={};for(const r in e)(!Fo(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Ed(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Bi(r,i,d):!!i;if(l&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const g=u[f];if(Gl(i,r,g)&&!Os(d,g))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Bi(r,i,d):!0:!!i;return!1}function Bi(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let s=0;s<r.length;s++){const o=r[s];if(Gl(t,e,o)&&!Os(n,o))return!0}return!1}function Gl(e,t,n){const r=e[n],s=t[n];return n==="style"&&nt(r)&&nt(s)?!qo(r,s):r!==s}function Id({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const zl={},Yl=()=>Object.create(zl),Jl=e=>Object.getPrototypeOf(e)===zl;function Rd(e,t,n,r=!1){const s={},o=Yl();e.propsDefaults=Object.create(null),Ql(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:bl(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function $d(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=Je(s),[l]=e.propsOptions;let d=!1;if((r||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let f=0;f<u.length;f++){let g=u[f];if(Os(e.emitsOptions,g))continue;const b=t[g];if(l)if(tt(o,g))b!==o[g]&&(o[g]=b,d=!0);else{const $=Yt(g);s[$]=Ao(l,a,$,b,e,!1)}else b!==o[g]&&(o[g]=b,d=!0)}}}else{Ql(e,t,s,o)&&(d=!0);let u;for(const f in a)(!t||!tt(t,f)&&((u=Fn(f))===f||!tt(t,u)))&&(l?n&&(n[f]!==void 0||n[u]!==void 0)&&(s[f]=Ao(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!tt(t,f))&&(delete o[f],d=!0)}d&&bn(e.attrs,"set","")}function Ql(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Or(l))continue;const d=t[l];let u;s&&tt(s,u=Yt(l))?!o||!o.includes(u)?n[u]=d:(a||(a={}))[u]=d:Os(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=Je(n),d=a||lt;for(let u=0;u<o.length;u++){const f=o[u];n[f]=Ao(s,l,f,d[f],e,!tt(d,f))}}return i}function Ao(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=tt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&Be(l)){const{propsDefaults:d}=s;if(n in d)r=d[n];else{const u=es(s);r=d[n]=l.call(null,t),u()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===Fn(n))&&(r=!0))}return r}const Md=new WeakMap;function Xl(e,t,n=!1){const r=n?Md:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Be(e)){const u=f=>{l=!0;const[g,b]=Xl(f,t,!0);kt(i,g),b&&a.push(...b)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!o&&!l)return nt(e)&&r.set(e,mr),mr;if(Pe(o))for(let u=0;u<o.length;u++){const f=Yt(o[u]);Fi(f)&&(i[f]=lt)}else if(o)for(const u in o){const f=Yt(u);if(Fi(f)){const g=o[u],b=i[f]=Pe(g)||Be(g)?{type:g}:kt({},g),$=b.type;let E=!1,B=!0;if(Pe($))for(let W=0;W<$.length;++W){const M=$[W],U=Be(M)&&M.name;if(U==="Boolean"){E=!0;break}else U==="String"&&(B=!1)}else E=Be($)&&$.name==="Boolean";b[0]=E,b[1]=B,(E||tt(b,"default"))&&a.push(f)}}const d=[i,a];return nt(e)&&r.set(e,d),d}function Fi(e){return e[0]!=="$"&&!Or(e)}const Zo=e=>e==="_"||e==="_ctx"||e==="$stable",ei=e=>Pe(e)?e.map(cn):[cn(e)],Pd=(e,t,n)=>{if(t._n)return t;const r=ot((...s)=>ei(t(...s)),n);return r._c=!1,r},Zl=(e,t,n)=>{const r=e._ctx;for(const s in e){if(Zo(s))continue;const o=e[s];if(Be(o))t[s]=Pd(s,o,r);else if(o!=null){const i=ei(o);t[s]=()=>i}}},ec=(e,t)=>{const n=ei(t);e.slots.default=()=>n},tc=(e,t,n)=>{for(const r in t)(n||!Zo(r))&&(e[r]=t[r])},Nd=(e,t,n)=>{const r=e.slots=Yl();if(e.vnode.shapeFlag&32){const s=t._;s?(tc(r,t,n),n&&nl(r,"_",s,!0)):Zl(t,r)}else t&&ec(e,t)},Od=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=lt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:tc(s,t,n):(o=!t.$stable,Zl(t,s)),i=t}else t&&(ec(e,t),i={default:1});if(o)for(const a in s)!Zo(a)&&i[a]==null&&delete s[a]},It=Fd;function jd(e){return Ld(e)}function Ld(e,t){const n=Es();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:d,setElementText:u,parentNode:f,nextSibling:g,setScopeId:b=dn,insertStaticContent:$}=e,E=(p,y,x,O=null,H=null,N=null,ne=void 0,te=null,Y=!!y.dynamicChildren)=>{if(p===y)return;p&&!Xn(p,y)&&(O=A(p),Ye(p,H,N,!0),p=null),y.patchFlag===-2&&(Y=!1,y.dynamicChildren=null);const{type:V,ref:me,shapeFlag:re}=y;switch(V){case js:B(p,y,x,O);break;case $t:W(p,y,x,O);break;case Js:p==null&&M(y,x,O,ne);break;case De:ee(p,y,x,O,H,N,ne,te,Y);break;default:re&1?ae(p,y,x,O,H,N,ne,te,Y):re&6?Oe(p,y,x,O,H,N,ne,te,Y):(re&64||re&128)&&V.process(p,y,x,O,H,N,ne,te,Y,pe)}me!=null&&H?Br(me,p&&p.ref,N,y||p,!y):me==null&&p&&p.ref!=null&&Br(p.ref,null,N,p,!0)},B=(p,y,x,O)=>{if(p==null)r(y.el=a(y.children),x,O);else{const H=y.el=p.el;y.children!==p.children&&d(H,y.children)}},W=(p,y,x,O)=>{p==null?r(y.el=l(y.children||""),x,O):y.el=p.el},M=(p,y,x,O)=>{[p.el,p.anchor]=$(p.children,y,x,O,p.el,p.anchor)},U=({el:p,anchor:y},x,O)=>{let H;for(;p&&p!==y;)H=g(p),r(p,x,O),p=H;r(y,x,O)},F=({el:p,anchor:y})=>{let x;for(;p&&p!==y;)x=g(p),s(p),p=x;s(y)},ae=(p,y,x,O,H,N,ne,te,Y)=>{if(y.type==="svg"?ne="svg":y.type==="math"&&(ne="mathml"),p==null)ie(y,x,O,H,N,ne,te,Y);else{const V=p.el&&p.el._isVueCE?p.el:null;try{V&&V._beginPatch(),oe(p,y,H,N,ne,te,Y)}finally{V&&V._endPatch()}}},ie=(p,y,x,O,H,N,ne,te)=>{let Y,V;const{props:me,shapeFlag:re,transition:be,dirs:xe}=p;if(Y=p.el=i(p.type,N,me&&me.is,me),re&8?u(Y,p.children):re&16&&fe(p.children,Y,null,O,H,Ys(p,N),ne,te),xe&&Kn(p,null,O,"created"),le(Y,p,p.scopeId,ne,O),me){for(const Ve in me)Ve!=="value"&&!Or(Ve)&&o(Y,Ve,null,me[Ve],N,O);"value"in me&&o(Y,"value",null,me.value,N),(V=me.onVnodeBeforeMount)&&on(V,O,p)}xe&&Kn(p,null,O,"beforeMount");const je=Dd(H,be);je&&be.beforeEnter(Y),r(Y,y,x),((V=me&&me.onVnodeMounted)||je||xe)&&It(()=>{V&&on(V,O,p),je&&be.enter(Y),xe&&Kn(p,null,O,"mounted")},H)},le=(p,y,x,O,H)=>{if(x&&b(p,x),O)for(let N=0;N<O.length;N++)b(p,O[N]);if(H){let N=H.subTree;if(y===N||sc(N.type)&&(N.ssContent===y||N.ssFallback===y)){const ne=H.vnode;le(p,ne,ne.scopeId,ne.slotScopeIds,H.parent)}}},fe=(p,y,x,O,H,N,ne,te,Y=0)=>{for(let V=Y;V<p.length;V++){const me=p[V]=te?wn(p[V]):cn(p[V]);E(null,me,y,x,O,H,N,ne,te)}},oe=(p,y,x,O,H,N,ne)=>{const te=y.el=p.el;let{patchFlag:Y,dynamicChildren:V,dirs:me}=y;Y|=p.patchFlag&16;const re=p.props||lt,be=y.props||lt;let xe;if(x&&Gn(x,!1),(xe=be.onVnodeBeforeUpdate)&&on(xe,x,y,p),me&&Kn(y,p,x,"beforeUpdate"),x&&Gn(x,!0),(re.innerHTML&&be.innerHTML==null||re.textContent&&be.textContent==null)&&u(te,""),V?Z(p.dynamicChildren,V,te,x,O,Ys(y,H),N):ne||Ae(p,y,te,null,x,O,Ys(y,H),N,!1),Y>0){if(Y&16)he(te,re,be,x,H);else if(Y&2&&re.class!==be.class&&o(te,"class",null,be.class,H),Y&4&&o(te,"style",re.style,be.style,H),Y&8){const je=y.dynamicProps;for(let Ve=0;Ve<je.length;Ve++){const $e=je[Ve],st=re[$e],L=be[$e];(L!==st||$e==="value")&&o(te,$e,st,L,H,x)}}Y&1&&p.children!==y.children&&u(te,y.children)}else!ne&&V==null&&he(te,re,be,x,H);((xe=be.onVnodeUpdated)||me)&&It(()=>{xe&&on(xe,x,y,p),me&&Kn(y,p,x,"updated")},O)},Z=(p,y,x,O,H,N,ne)=>{for(let te=0;te<y.length;te++){const Y=p[te],V=y[te],me=Y.el&&(Y.type===De||!Xn(Y,V)||Y.shapeFlag&198)?f(Y.el):x;E(Y,V,me,null,O,H,N,ne,!0)}},he=(p,y,x,O,H)=>{if(y!==x){if(y!==lt)for(const N in y)!Or(N)&&!(N in x)&&o(p,N,y[N],null,H,O);for(const N in x){if(Or(N))continue;const ne=x[N],te=y[N];ne!==te&&N!=="value"&&o(p,N,te,ne,H,O)}"value"in x&&o(p,"value",y.value,x.value,H)}},ee=(p,y,x,O,H,N,ne,te,Y)=>{const V=y.el=p?p.el:a(""),me=y.anchor=p?p.anchor:a("");let{patchFlag:re,dynamicChildren:be,slotScopeIds:xe}=y;xe&&(te=te?te.concat(xe):xe),p==null?(r(V,x,O),r(me,x,O),fe(y.children||[],x,me,H,N,ne,te,Y)):re>0&&re&64&&be&&p.dynamicChildren&&p.dynamicChildren.length===be.length?(Z(p.dynamicChildren,be,x,H,N,ne,te),(y.key!=null||H&&y===H.subTree)&&ti(p,y,!0)):Ae(p,y,x,me,H,N,ne,te,Y)},Oe=(p,y,x,O,H,N,ne,te,Y)=>{y.slotScopeIds=te,p==null?y.shapeFlag&512?H.ctx.activate(y,x,O,ne,Y):qe(y,x,O,H,N,ne,Y):rt(p,y,Y)},qe=(p,y,x,O,H,N,ne)=>{const te=p.component=Gd(p,O,H);if(Ms(p)&&(te.ctx.renderer=pe),zd(te,!1,ne),te.asyncDep){if(H&&H.registerDep(te,Ne,ne),!p.el){const Y=te.subTree=Ie($t);W(null,Y,y,x),p.placeholder=Y.el}}else Ne(te,p,y,x,H,N,ne)},rt=(p,y,x)=>{const O=y.component=p.component;if(Ed(p,y,x))if(O.asyncDep&&!O.asyncResolved){Te(O,y,x);return}else O.next=y,O.update();else y.el=p.el,O.vnode=y},Ne=(p,y,x,O,H,N,ne)=>{const te=()=>{if(p.isMounted){let{next:re,bu:be,u:xe,parent:je,vnode:Ve}=p;{const m=nc(p);if(m){re&&(re.el=Ve.el,Te(p,re,ne)),m.asyncDep.then(()=>{It(()=>{p.isUnmounted||V()},H)});return}}let $e=re,st;Gn(p,!1),re?(re.el=Ve.el,Te(p,re,ne)):re=Ve,be&&ds(be),(st=re.props&&re.props.onVnodeBeforeUpdate)&&on(st,je,re,Ve),Gn(p,!0);const L=Di(p),z=p.subTree;p.subTree=L,E(z,L,f(z.el),A(z),p,H,N),re.el=L.el,$e===null&&Id(p,L.el),xe&&It(xe,H),(st=re.props&&re.props.onVnodeUpdated)&&It(()=>on(st,je,re,Ve),H)}else{let re;const{el:be,props:xe}=y,{bm:je,m:Ve,parent:$e,root:st,type:L}=p,z=yr(y);Gn(p,!1),je&&ds(je),!z&&(re=xe&&xe.onVnodeBeforeMount)&&on(re,$e,y),Gn(p,!0);{st.ce&&st.ce._hasShadowRoot()&&st.ce._injectChildStyle(L);const m=p.subTree=Di(p);E(null,m,x,O,p,H,N),y.el=m.el}if(Ve&&It(Ve,H),!z&&(re=xe&&xe.onVnodeMounted)){const m=y;It(()=>on(re,$e,m),H)}(y.shapeFlag&256||$e&&yr($e.vnode)&&$e.vnode.shapeFlag&256)&&p.a&&It(p.a,H),p.isMounted=!0,y=x=O=null}};p.scope.on();const Y=p.effect=new il(te);p.scope.off();const V=p.update=Y.run.bind(Y),me=p.job=Y.runIfDirty.bind(Y);me.i=p,me.id=p.uid,Y.scheduler=()=>Xo(me),Gn(p,!0),V()},Te=(p,y,x)=>{y.component=p;const O=p.vnode.props;p.vnode=y,p.next=null,$d(p,y.props,O,x),Od(p,y.children,x),Tn(),Ci(p),Sn()},Ae=(p,y,x,O,H,N,ne,te,Y=!1)=>{const V=p&&p.children,me=p?p.shapeFlag:0,re=y.children,{patchFlag:be,shapeFlag:xe}=y;if(be>0){if(be&128){it(V,re,x,O,H,N,ne,te,Y);return}else if(be&256){ht(V,re,x,O,H,N,ne,te,Y);return}}xe&8?(me&16&&de(V,H,N),re!==V&&u(x,re)):me&16?xe&16?it(V,re,x,O,H,N,ne,te,Y):de(V,H,N,!0):(me&8&&u(x,""),xe&16&&fe(re,x,O,H,N,ne,te,Y))},ht=(p,y,x,O,H,N,ne,te,Y)=>{p=p||mr,y=y||mr;const V=p.length,me=y.length,re=Math.min(V,me);let be;for(be=0;be<re;be++){const xe=y[be]=Y?wn(y[be]):cn(y[be]);E(p[be],xe,x,null,H,N,ne,te,Y)}V>me?de(p,H,N,!0,!1,re):fe(y,x,O,H,N,ne,te,Y,re)},it=(p,y,x,O,H,N,ne,te,Y)=>{let V=0;const me=y.length;let re=p.length-1,be=me-1;for(;V<=re&&V<=be;){const xe=p[V],je=y[V]=Y?wn(y[V]):cn(y[V]);if(Xn(xe,je))E(xe,je,x,null,H,N,ne,te,Y);else break;V++}for(;V<=re&&V<=be;){const xe=p[re],je=y[be]=Y?wn(y[be]):cn(y[be]);if(Xn(xe,je))E(xe,je,x,null,H,N,ne,te,Y);else break;re--,be--}if(V>re){if(V<=be){const xe=be+1,je=xe<me?y[xe].el:O;for(;V<=be;)E(null,y[V]=Y?wn(y[V]):cn(y[V]),x,je,H,N,ne,te,Y),V++}}else if(V>be)for(;V<=re;)Ye(p[V],H,N,!0),V++;else{const xe=V,je=V,Ve=new Map;for(V=je;V<=be;V++){const G=y[V]=Y?wn(y[V]):cn(y[V]);G.key!=null&&Ve.set(G.key,V)}let $e,st=0;const L=be-je+1;let z=!1,m=0;const C=new Array(L);for(V=0;V<L;V++)C[V]=0;for(V=xe;V<=re;V++){const G=p[V];if(st>=L){Ye(G,H,N,!0);continue}let se;if(G.key!=null)se=Ve.get(G.key);else for($e=je;$e<=be;$e++)if(C[$e-je]===0&&Xn(G,y[$e])){se=$e;break}se===void 0?Ye(G,H,N,!0):(C[se-je]=V+1,se>=m?m=se:z=!0,E(G,y[se],x,null,H,N,ne,te,Y),st++)}const I=z?Bd(C):mr;for($e=I.length-1,V=L-1;V>=0;V--){const G=je+V,se=y[G],Ce=y[G+1],Xe=G+1<me?Ce.el||rc(Ce):O;C[V]===0?E(null,se,x,Xe,H,N,ne,te,Y):z&&($e<0||V!==I[$e]?Qe(se,x,Xe,2):$e--)}}},Qe=(p,y,x,O,H=null)=>{const{el:N,type:ne,transition:te,children:Y,shapeFlag:V}=p;if(V&6){Qe(p.component.subTree,y,x,O);return}if(V&128){p.suspense.move(y,x,O);return}if(V&64){ne.move(p,y,x,pe);return}if(ne===De){r(N,y,x);for(let re=0;re<Y.length;re++)Qe(Y[re],y,x,O);r(p.anchor,y,x);return}if(ne===Js){U(p,y,x);return}if(O!==2&&V&1&&te)if(O===0)te.beforeEnter(N),r(N,y,x),It(()=>te.enter(N),H);else{const{leave:re,delayLeave:be,afterLeave:xe}=te,je=()=>{p.ctx.isUnmounted?s(N):r(N,y,x)},Ve=()=>{N._isLeaving&&N[ln](!0),re(N,()=>{je(),xe&&xe()})};be?be(N,je,Ve):Ve()}else r(N,y,x)},Ye=(p,y,x,O=!1,H=!1)=>{const{type:N,props:ne,ref:te,children:Y,dynamicChildren:V,shapeFlag:me,patchFlag:re,dirs:be,cacheIndex:xe}=p;if(re===-2&&(H=!1),te!=null&&(Tn(),Br(te,null,x,p,!0),Sn()),xe!=null&&(y.renderCache[xe]=void 0),me&256){y.ctx.deactivate(p);return}const je=me&1&&be,Ve=!yr(p);let $e;if(Ve&&($e=ne&&ne.onVnodeBeforeUnmount)&&on($e,y,p),me&6)Se(p.component,x,O);else{if(me&128){p.suspense.unmount(x,O);return}je&&Kn(p,null,y,"beforeUnmount"),me&64?p.type.remove(p,y,x,pe,O):V&&!V.hasOnce&&(N!==De||re>0&&re&64)?de(V,y,x,!1,!0):(N===De&&re&384||!H&&me&16)&&de(Y,y,x),O&&Ge(p)}(Ve&&($e=ne&&ne.onVnodeUnmounted)||je)&&It(()=>{$e&&on($e,y,p),je&&Kn(p,null,y,"unmounted")},x)},Ge=p=>{const{type:y,el:x,anchor:O,transition:H}=p;if(y===De){ue(x,O);return}if(y===Js){F(p);return}const N=()=>{s(x),H&&!H.persisted&&H.afterLeave&&H.afterLeave()};if(p.shapeFlag&1&&H&&!H.persisted){const{leave:ne,delayLeave:te}=H,Y=()=>ne(x,N);te?te(p.el,N,Y):Y()}else N()},ue=(p,y)=>{let x;for(;p!==y;)x=g(p),s(p),p=x;s(y)},Se=(p,y,x)=>{const{bum:O,scope:H,job:N,subTree:ne,um:te,m:Y,a:V}=p;Hi(Y),Hi(V),O&&ds(O),H.stop(),N&&(N.flags|=8,Ye(ne,p,y,x)),te&&It(te,y),It(()=>{p.isUnmounted=!0},y)},de=(p,y,x,O=!1,H=!1,N=0)=>{for(let ne=N;ne<p.length;ne++)Ye(p[ne],y,x,O,H)},A=p=>{if(p.shapeFlag&6)return A(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const y=g(p.anchor||p.el),x=y&&y[Rl];return x?g(x):y};let X=!1;const Q=(p,y,x)=>{let O;p==null?y._vnode&&(Ye(y._vnode,null,null,!0),O=y._vnode.component):E(y._vnode||null,p,y,null,null,null,x),y._vnode=p,X||(X=!0,Ci(O),xl(),X=!1)},pe={p:E,um:Ye,m:Qe,r:Ge,mt:qe,mc:fe,pc:Ae,pbc:Z,n:A,o:e};return{render:Q,hydrate:void 0,createApp:kd(Q)}}function Ys({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Gn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Dd(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ti(e,t,n=!1){const r=e.children,s=t.children;if(Pe(r)&&Pe(s))for(let o=0;o<r.length;o++){const i=r[o];let a=s[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[o]=wn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&ti(i,a)),a.type===js&&(a.patchFlag===-1&&(a=s[o]=wn(a)),a.el=i.el),a.type===$t&&!a.el&&(a.el=i.el)}}function Bd(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const d=e[r];if(d!==0){if(s=n[n.length-1],e[s]<d){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<d?o=a+1:i=a;d<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function nc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:nc(t)}function Hi(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function rc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?rc(t.subTree):null}const sc=e=>e.__isSuspense;function Fd(e,t){t&&t.pendingBranch?Pe(e)?t.effects.push(...e):t.effects.push(e):Ku(e)}const De=Symbol.for("v-fgt"),js=Symbol.for("v-txt"),$t=Symbol.for("v-cmt"),Js=Symbol.for("v-stc"),Hr=[];let Ht=null;function _(e=!1){Hr.push(Ht=e?null:[])}function Hd(){Hr.pop(),Ht=Hr[Hr.length-1]||null}let Gr=1;function _s(e,t=!1){Gr+=e,e<0&&Ht&&t&&(Ht.hasOnce=!0)}function oc(e){return e.dynamicChildren=Gr>0?Ht||mr:null,Hd(),Gr>0&&Ht&&Ht.push(e),e}function S(e,t,n,r,s,o){return oc(w(e,t,n,r,s,o,!0))}function at(e,t,n,r,s){return oc(Ie(e,t,n,r,s,!0))}function zr(e){return e?e.__v_isVNode===!0:!1}function Xn(e,t){return e.type===t.type&&e.key===t.key}const ic=({key:e})=>e??null,ps=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?gt(e)||Pt(e)||Be(e)?{i:xt,r:e,k:t,f:!!n}:e:null);function w(e,t=null,n=null,r=0,s=null,o=e===De?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ic(t),ref:t&&ps(t),scopeId:Al,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:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:xt};return a?(ni(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=gt(n)?8:16),Gr>0&&!i&&Ht&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Ht.push(l),l}const Ie=Ud;function Ud(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===Hl)&&(e=$t),zr(e)){const a=Dn(e,t,!0);return n&&ni(a,n),Gr>0&&!o&&Ht&&(a.shapeFlag&6?Ht[Ht.indexOf(e)]=a:Ht.push(a)),a.patchFlag=-2,a}if(Xd(e)&&(e=e.__vccOpts),t){t=Vd(t);let{class:a,style:l}=t;a&&!gt(a)&&(t.class=ut(a)),nt(l)&&(Qo(l)&&!Pe(l)&&(l=kt({},l)),t.style=rr(l))}const i=gt(e)?1:sc(e)?128:$l(e)?64:nt(e)?4:Be(e)?2:0;return w(e,t,n,r,s,i,o,!0)}function Vd(e){return e?Qo(e)||Jl(e)?kt({},e):e:null}function Dn(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?ac(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&ic(d),ref:t&&t.ref?n&&o?Pe(o)?o.concat(ps(t)):[o,ps(t)]:ps(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==De?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Dn(e.ssContent),ssFallback:e.ssFallback&&Dn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Kr(u,l.clone(u)),u}function qd(e=" ",t=0){return Ie(js,null,e,t)}function ve(e="",t=!1){return t?(_(),at($t,null,e)):Ie($t,null,e)}function cn(e){return e==null||typeof e=="boolean"?Ie($t):Pe(e)?Ie(De,null,e.slice()):zr(e)?wn(e):Ie(js,null,String(e))}function wn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Dn(e)}function ni(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Pe(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),ni(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Jl(t)?t._ctx=xt:s===3&&xt&&(xt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Be(t)?(t={default:t,_ctx:xt},n=32):(t=String(t),r&64?(n=16,t=[qd(t)]):n=8);e.children=t,e.shapeFlag|=n}function ac(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const s in r)if(s==="class")t.class!==r.class&&(t.class=ut([t.class,r.class]));else if(s==="style")t.style=rr([t.style,r.style]);else if(xs(s)){const o=t[s],i=r[s];i&&o!==i&&!(Pe(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function on(e,t,n,r=null){nn(e,t,7,[n,r])}const Wd=Wl();let Kd=0;function Gd(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Wd,o={uid:Kd++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new gu(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Xl(r,s),emitsOptions:Kl(r,s),emit:null,emitted:null,propsDefaults:lt,inheritAttrs:r.inheritAttrs,ctx:lt,data:lt,props:lt,attrs:lt,slots:lt,refs:lt,setupState:lt,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 o.ctx={_:o},o.root=t?t.root:o,o.emit=Sd.bind(null,o),e.ce&&e.ce(o),o}let Mt=null;const ri=()=>Mt||xt;let ks,Eo;{const e=Es(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};ks=t("__VUE_INSTANCE_SETTERS__",n=>Mt=n),Eo=t("__VUE_SSR_SETTERS__",n=>Yr=n)}const es=e=>{const t=Mt;return ks(e),e.scope.on(),()=>{e.scope.off(),ks(t)}},Ui=()=>{Mt&&Mt.scope.off(),ks(null)};function lc(e){return e.vnode.shapeFlag&4}let Yr=!1;function zd(e,t=!1,n=!1){t&&Eo(t);const{props:r,children:s}=e.vnode,o=lc(e);Rd(e,r,o,t),Nd(e,s,n||t);const i=o?Yd(e,t):void 0;return t&&Eo(!1),i}function Yd(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,hd);const{setup:r}=n;if(r){Tn();const s=e.setupContext=r.length>1?uc(e):null,o=es(e),i=Zr(r,e,0,[e.props,s]),a=Za(i);if(Sn(),o(),(a||e.sp)&&!yr(e)&&Bl(e),a){if(i.then(Ui,Ui),t)return i.then(l=>{Vi(e,l)}).catch(l=>{$s(l,e,0)});e.asyncDep=i}else Vi(e,i)}else cc(e)}function Vi(e,t,n){Be(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:nt(t)&&(e.setupState=kl(t)),cc(e)}function cc(e,t,n){const r=e.type;e.render||(e.render=r.render||dn);{const s=es(e);Tn();try{gd(e)}finally{Sn(),s()}}}const Jd={get(e,t){return Rt(e,"get",""),e[t]}};function uc(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Jd),slots:e.slots,emit:e.emit,expose:t}}function Ls(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(kl(ju(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Fr)return Fr[n](e)},has(t,n){return n in t||n in Fr}})):e.proxy}function Qd(e,t=!0){return Be(e)?e.displayName||e.name:e.name||t&&e.__name}function Xd(e){return Be(e)&&"__vccOpts"in e}const ce=(e,t)=>Hu(e,t,Yr);function si(e,t,n){try{_s(-1);const r=arguments.length;return r===2?nt(t)&&!Pe(t)?zr(t)?Ie(e,null,[t]):Ie(e,t):Ie(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&zr(n)&&(n=[n]),Ie(e,t,n))}finally{_s(1)}}const Zd="3.5.28";/**
14
+ * @vue/runtime-dom v3.5.28
15
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
+ * @license MIT
17
+ **/let Io;const qi=typeof window<"u"&&window.trustedTypes;if(qi)try{Io=qi.createPolicy("vue",{createHTML:e=>e})}catch{}const dc=Io?e=>Io.createHTML(e):e=>e,ef="http://www.w3.org/2000/svg",tf="http://www.w3.org/1998/Math/MathML",yn=typeof document<"u"?document:null,Wi=yn&&yn.createElement("template"),nf={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?yn.createElementNS(ef,e):t==="mathml"?yn.createElementNS(tf,e):n?yn.createElement(e,{is:n}):yn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>yn.createTextNode(e),createComment:e=>yn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>yn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,o){const i=n?n.previousSibling:t.lastChild;if(s&&(s===o||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{Wi.innerHTML=dc(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Wi.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},In="transition",Rr="animation",Jr=Symbol("_vtc"),fc={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},rf=kt({},Nl,fc),sf=e=>(e.displayName="Transition",e.props=rf,e),of=sf((e,{slots:t})=>si(Zu,af(e),t)),zn=(e,t=[])=>{Pe(e)?e.forEach(n=>n(...t)):e&&e(...t)},Ki=e=>e?Pe(e)?e.some(t=>t.length>1):e.length>1:!1;function af(e){const t={};for(const ee in e)ee in fc||(t[ee]=e[ee]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:d=i,appearToClass:u=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:g=`${n}-leave-active`,leaveToClass:b=`${n}-leave-to`}=e,$=lf(s),E=$&&$[0],B=$&&$[1],{onBeforeEnter:W,onEnter:M,onEnterCancelled:U,onLeave:F,onLeaveCancelled:ae,onBeforeAppear:ie=W,onAppear:le=M,onAppearCancelled:fe=U}=t,oe=(ee,Oe,qe,rt)=>{ee._enterCancelled=rt,Yn(ee,Oe?u:a),Yn(ee,Oe?d:i),qe&&qe()},Z=(ee,Oe)=>{ee._isLeaving=!1,Yn(ee,f),Yn(ee,b),Yn(ee,g),Oe&&Oe()},he=ee=>(Oe,qe)=>{const rt=ee?le:M,Ne=()=>oe(Oe,ee,qe);zn(rt,[Oe,Ne]),Gi(()=>{Yn(Oe,ee?l:o),gn(Oe,ee?u:a),Ki(rt)||zi(Oe,r,E,Ne)})};return kt(t,{onBeforeEnter(ee){zn(W,[ee]),gn(ee,o),gn(ee,i)},onBeforeAppear(ee){zn(ie,[ee]),gn(ee,l),gn(ee,d)},onEnter:he(!1),onAppear:he(!0),onLeave(ee,Oe){ee._isLeaving=!0;const qe=()=>Z(ee,Oe);gn(ee,f),ee._enterCancelled?(gn(ee,g),Qi(ee)):(Qi(ee),gn(ee,g)),Gi(()=>{ee._isLeaving&&(Yn(ee,f),gn(ee,b),Ki(F)||zi(ee,r,B,qe))}),zn(F,[ee,qe])},onEnterCancelled(ee){oe(ee,!1,void 0,!0),zn(U,[ee])},onAppearCancelled(ee){oe(ee,!0,void 0,!0),zn(fe,[ee])},onLeaveCancelled(ee){Z(ee),zn(ae,[ee])}})}function lf(e){if(e==null)return null;if(nt(e))return[Qs(e.enter),Qs(e.leave)];{const t=Qs(e);return[t,t]}}function Qs(e){return lu(e)}function gn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Jr]||(e[Jr]=new Set)).add(t)}function Yn(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Jr];n&&(n.delete(t),n.size||(e[Jr]=void 0))}function Gi(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let cf=0;function zi(e,t,n,r){const s=e._endId=++cf,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=uf(e,t);if(!i)return r();const d=i+"end";let u=0;const f=()=>{e.removeEventListener(d,g),o()},g=b=>{b.target===e&&++u>=l&&f()};setTimeout(()=>{u<l&&f()},a+1),e.addEventListener(d,g)}function uf(e,t){const n=window.getComputedStyle(e),r=$=>(n[$]||"").split(", "),s=r(`${In}Delay`),o=r(`${In}Duration`),i=Yi(s,o),a=r(`${Rr}Delay`),l=r(`${Rr}Duration`),d=Yi(a,l);let u=null,f=0,g=0;t===In?i>0&&(u=In,f=i,g=o.length):t===Rr?d>0&&(u=Rr,f=d,g=l.length):(f=Math.max(i,d),u=f>0?i>d?In:Rr:null,g=u?u===In?o.length:l.length:0);const b=u===In&&/\b(?:transform|all)(?:,|$)/.test(r(`${In}Property`).toString());return{type:u,timeout:f,propCount:g,hasTransform:b}}function Yi(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Ji(n)+Ji(e[r])))}function Ji(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Qi(e){return(e?e.ownerDocument:document).body.offsetHeight}function df(e,t,n){const r=e[Jr];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Xi=Symbol("_vod"),ff=Symbol("_vsh"),hf=Symbol(""),pf=/(?:^|;)\s*display\s*:/;function mf(e,t,n){const r=e.style,s=gt(n);let o=!1;if(n&&!s){if(t)if(gt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&ms(r,a,"")}else for(const i in t)n[i]==null&&ms(r,i,"");for(const i in n)i==="display"&&(o=!0),ms(r,i,n[i])}else if(s){if(t!==n){const i=r[hf];i&&(n+=";"+i),r.cssText=n,o=pf.test(n)}}else t&&e.removeAttribute("style");Xi in e&&(e[Xi]=o?r.display:"",e[ff]&&(r.display="none"))}const Zi=/\s*!important$/;function ms(e,t,n){if(Pe(n))n.forEach(r=>ms(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=gf(e,t);Zi.test(n)?e.setProperty(Fn(r),n.replace(Zi,""),"important"):e[r]=n}}const ea=["Webkit","Moz","ms"],Xs={};function gf(e,t){const n=Xs[t];if(n)return n;let r=Yt(t);if(r!=="filter"&&r in e)return Xs[t]=r;r=As(r);for(let s=0;s<ea.length;s++){const o=ea[s]+r;if(o in e)return Xs[t]=o}return t}const ta="http://www.w3.org/1999/xlink";function na(e,t,n,r,s,o=pu(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ta,t.slice(6,t.length)):e.setAttributeNS(ta,t,n):n==null||o&&!rl(n)?e.removeAttribute(t):e.setAttribute(t,o?"":en(n)?String(n):n)}function ra(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?dc(n):n);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const a=o==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=rl(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(s||t)}function hr(e,t,n,r){e.addEventListener(t,n,r)}function vf(e,t,n,r){e.removeEventListener(t,n,r)}const sa=Symbol("_vei");function yf(e,t,n,r,s=null){const o=e[sa]||(e[sa]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=wf(t);if(r){const d=o[t]=kf(r,s);hr(e,a,d,l)}else i&&(vf(e,a,i,l),o[t]=void 0)}}const oa=/(?:Once|Passive|Capture)$/;function wf(e){let t;if(oa.test(e)){t={};let r;for(;r=e.match(oa);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Fn(e.slice(2)),t]}let Zs=0;const bf=Promise.resolve(),_f=()=>Zs||(bf.then(()=>Zs=0),Zs=Date.now());function kf(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;nn(Tf(r,n.value),t,5,[r])};return n.value=e,n.attached=_f(),n}function Tf(e,t){if(Pe(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>s=>!s._stopped&&r&&r(s))}else return t}const ia=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Sf=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?df(e,r,i):t==="style"?mf(e,n,r):xs(t)?Fo(t)||yf(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):xf(e,t,r,i))?(ra(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&na(e,t,r,i,o,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!gt(r))?ra(e,Yt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),na(e,t,r,i))};function xf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&ia(t)&&Be(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return ia(t)&&gt(n)?!1:t in e}const aa=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Pe(t)?n=>ds(t,n):t};function Cf(e){e.target.composing=!0}function la(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const eo=Symbol("_assign");function ca(e,t,n){return t&&(e=e.trim()),n&&(e=Vo(e)),e}const Bn={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[eo]=aa(s);const o=r||s.props&&s.props.type==="number";hr(e,t?"change":"input",i=>{i.target.composing||e[eo](ca(e.value,n,o))}),(n||o)&&hr(e,"change",()=>{e.value=ca(e.value,n,o)}),t||(hr(e,"compositionstart",Cf),hr(e,"compositionend",la),hr(e,"change",la))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[eo]=aa(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Vo(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===l)||(e.value=l))}},Af=["ctrl","shift","alt","meta"],Ef={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Af.some(n=>e[`${n}Key`]&&!t.includes(n))},dt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i<t.length;i++){const a=Ef[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},If={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ut=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Fn(s.key);if(t.some(i=>i===o||If[i]===o))return e(s)}))},Rf=kt({patchProp:Sf},nf);let ua;function $f(){return ua||(ua=jd(Rf))}const Mf=((...e)=>{const t=$f().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Nf(r);if(!s)return;const o=t._component;!Be(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Pf(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Pf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Nf(e){return gt(e)?document.querySelector(e):e}/*!
18
+ * vue-router v4.6.4
19
+ * (c) 2025 Eduardo San Martin Morote
20
+ * @license MIT
21
+ */const pr=typeof document<"u";function hc(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Of(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&hc(e.default)}const et=Object.assign;function to(e,t){const n={};for(const r in t){const s=t[r];n[r]=rn(s)?s.map(e):e(s)}return n}const Ur=()=>{},rn=Array.isArray;function da(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const pc=/#/g,jf=/&/g,Lf=/\//g,Df=/=/g,Bf=/\?/g,mc=/\+/g,Ff=/%5B/g,Hf=/%5D/g,gc=/%5E/g,Uf=/%60/g,vc=/%7B/g,Vf=/%7C/g,yc=/%7D/g,qf=/%20/g;function oi(e){return e==null?"":encodeURI(""+e).replace(Vf,"|").replace(Ff,"[").replace(Hf,"]")}function Wf(e){return oi(e).replace(vc,"{").replace(yc,"}").replace(gc,"^")}function Ro(e){return oi(e).replace(mc,"%2B").replace(qf,"+").replace(pc,"%23").replace(jf,"%26").replace(Uf,"`").replace(vc,"{").replace(yc,"}").replace(gc,"^")}function Kf(e){return Ro(e).replace(Df,"%3D")}function Gf(e){return oi(e).replace(pc,"%23").replace(Bf,"%3F")}function zf(e){return Gf(e).replace(Lf,"%2F")}function Qr(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Yf=/\/$/,Jf=e=>e.replace(Yf,"");function no(e,t,n="/"){let r,s={},o="",i="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=t.slice(0,l),o=t.slice(l,a>0?a:t.length),s=e(o.slice(1))),a>=0&&(r=r||t.slice(0,a),i=t.slice(a,t.length)),r=eh(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:Qr(i)}}function Qf(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function fa(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Xf(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&_r(t.matched[r],n.matched[s])&&wc(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function _r(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function wc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Zf(e[n],t[n]))return!1;return!0}function Zf(e,t){return rn(e)?ha(e,t):rn(t)?ha(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function ha(e,t){return rn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function eh(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let o=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i).join("/")}const Rn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let $o=(function(e){return e.pop="pop",e.push="push",e})({}),ro=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function th(e){if(!e)if(pr){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Jf(e)}const nh=/^[^#]+#/;function rh(e,t){return e.replace(nh,"#")+t}function sh(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const Ds=()=>({left:window.scrollX,top:window.scrollY});function oh(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=sh(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function pa(e,t){return(history.state?history.state.position-t:-1)+e}const Mo=new Map;function ih(e,t){Mo.set(e,t)}function ah(e){const t=Mo.get(e);return Mo.delete(e),t}function lh(e){return typeof e=="string"||e&&typeof e=="object"}function bc(e){return typeof e=="string"||typeof e=="symbol"}let yt=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const _c=Symbol("");yt.MATCHER_NOT_FOUND+"",yt.NAVIGATION_GUARD_REDIRECT+"",yt.NAVIGATION_ABORTED+"",yt.NAVIGATION_CANCELLED+"",yt.NAVIGATION_DUPLICATED+"";function kr(e,t){return et(new Error,{type:e,[_c]:!0},t)}function vn(e,t){return e instanceof Error&&_c in e&&(t==null||!!(e.type&t))}const ch=["params","query","hash"];function uh(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of ch)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function dh(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){const s=n[r].replace(mc," "),o=s.indexOf("="),i=Qr(o<0?s:s.slice(0,o)),a=o<0?null:Qr(s.slice(o+1));if(i in t){let l=t[i];rn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function ma(e){let t="";for(let n in e){const r=e[n];if(n=Kf(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(rn(r)?r.map(s=>s&&Ro(s)):[r&&Ro(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function fh(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=rn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const hh=Symbol(""),ga=Symbol(""),Bs=Symbol(""),ii=Symbol(""),Po=Symbol("");function $r(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Nn(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const d=g=>{g===!1?l(kr(yt.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?l(g):lh(g)?l(kr(yt.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(i&&r.enterCallbacks[s]===i&&typeof g=="function"&&i.push(g),a())},u=o(()=>e.call(r&&r.instances[s],t,n,d));let f=Promise.resolve(u);e.length<3&&(f=f.then(d)),f.catch(g=>l(g))})}function so(e,t,n,r,s=o=>o()){const o=[];for(const i of e)for(const a in i.components){let l=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(hc(l)){const d=(l.__vccOpts||l)[t];d&&o.push(Nn(d,n,r,i,a,s))}else{let d=l();o.push(()=>d.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Of(u)?u.default:u;i.mods[a]=u,i.components[a]=f;const g=(f.__vccOpts||f)[t];return g&&Nn(g,n,r,i,a,s)()}))}}return o}function ph(e,t){const n=[],r=[],s=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;i<o;i++){const a=t.matched[i];a&&(e.matched.find(d=>_r(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>_r(d,l))||s.push(l))}return[n,r,s]}/*!
22
+ * vue-router v4.6.4
23
+ * (c) 2025 Eduardo San Martin Morote
24
+ * @license MIT
25
+ */let mh=()=>location.protocol+"//"+location.host;function kc(e,t){const{pathname:n,search:r,hash:s}=t,o=e.indexOf("#");if(o>-1){let i=s.includes(e.slice(o))?e.slice(o).length:1,a=s.slice(i);return a[0]!=="/"&&(a="/"+a),fa(a,"")}return fa(n,e)+r+s}function gh(e,t,n,r){let s=[],o=[],i=null;const a=({state:g})=>{const b=kc(e,location),$=n.value,E=t.value;let B=0;if(g){if(n.value=b,t.value=g,i&&i===$){i=null;return}B=E?g.position-E.position:0}else r(b);s.forEach(W=>{W(n.value,$,{delta:B,type:$o.pop,direction:B?B>0?ro.forward:ro.back:ro.unknown})})};function l(){i=n.value}function d(g){s.push(g);const b=()=>{const $=s.indexOf(g);$>-1&&s.splice($,1)};return o.push(b),b}function u(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(et({},g.state,{scroll:Ds()}),"")}}function f(){for(const g of o)g();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:d,destroy:f}}function va(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?Ds():null}}function vh(e){const{history:t,location:n}=window,r={value:kc(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(l,d,u){const f=e.indexOf("#"),g=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:mh()+e+l;try{t[u?"replaceState":"pushState"](d,"",g),s.value=d}catch(b){console.error(b),n[u?"replace":"assign"](g)}}function i(l,d){o(l,et({},t.state,va(s.value.back,l,s.value.forward,!0),d,{position:s.value.position}),!0),r.value=l}function a(l,d){const u=et({},s.value,t.state,{forward:l,scroll:Ds()});o(u.current,u,!0),o(l,et({},va(r.value,l,null),{position:u.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function yh(e){e=th(e);const t=vh(e),n=gh(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=et({location:"",base:e,go:r,createHref:rh.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}function wh(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),yh(e)}let er=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var _t=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(_t||{});const bh={type:er.Static,value:""},_h=/[a-zA-Z0-9_]/;function kh(e){if(!e)return[[]];if(e==="/")return[[bh]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(b){throw new Error(`ERR (${n})/"${d}": ${b}`)}let n=_t.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",u="";function f(){d&&(n===_t.Static?o.push({type:er.Static,value:d}):n===_t.Param||n===_t.ParamRegExp||n===_t.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:er.Param,value:d,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),d="")}function g(){d+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==_t.ParamRegExp){r=n,n=_t.EscapeNext;continue}switch(n){case _t.Static:l==="/"?(d&&f(),i()):l===":"?(f(),n=_t.Param):g();break;case _t.EscapeNext:g(),n=r;break;case _t.Param:l==="("?n=_t.ParamRegExp:_h.test(l)?g():(f(),n=_t.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case _t.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=_t.ParamRegExpEnd:u+=l;break;case _t.ParamRegExpEnd:f(),n=_t.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===_t.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),f(),i(),s}const ya="[^/]+?",Th={sensitive:!1,strict:!1,start:!0,end:!0};var Ot=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(Ot||{});const Sh=/[.+*?^${}()[\]/\\]/g;function xh(e,t){const n=et({},Th,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const u=d.length?[]:[Ot.Root];n.strict&&!d.length&&(s+="/");for(let f=0;f<d.length;f++){const g=d[f];let b=Ot.Segment+(n.sensitive?Ot.BonusCaseSensitive:0);if(g.type===er.Static)f||(s+="/"),s+=g.value.replace(Sh,"\\$&"),b+=Ot.Static;else if(g.type===er.Param){const{value:$,repeatable:E,optional:B,regexp:W}=g;o.push({name:$,repeatable:E,optional:B});const M=W||ya;if(M!==ya){b+=Ot.BonusCustomRegExp;try{`${M}`}catch(F){throw new Error(`Invalid custom RegExp for param "${$}" (${M}): `+F.message)}}let U=E?`((?:${M})(?:/(?:${M}))*)`:`(${M})`;f||(U=B&&d.length<2?`(?:/${U})`:"/"+U),B&&(U+="?"),s+=U,b+=Ot.Dynamic,B&&(b+=Ot.BonusOptional),E&&(b+=Ot.BonusRepeatable),M===".*"&&(b+=Ot.BonusWildcard)}u.push(b)}r.push(u)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=Ot.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(d){const u=d.match(i),f={};if(!u)return null;for(let g=1;g<u.length;g++){const b=u[g]||"",$=o[g-1];f[$.name]=b&&$.repeatable?b.split("/"):b}return f}function l(d){let u="",f=!1;for(const g of e){(!f||!u.endsWith("/"))&&(u+="/"),f=!1;for(const b of g)if(b.type===er.Static)u+=b.value;else if(b.type===er.Param){const{value:$,repeatable:E,optional:B}=b,W=$ in d?d[$]:"";if(rn(W)&&!E)throw new Error(`Provided param "${$}" is an array but it is not repeatable (* or + modifiers)`);const M=rn(W)?W.join("/"):W;if(!M)if(B)g.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${$}"`);u+=M}}return u||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function Ch(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===Ot.Static+Ot.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Ot.Static+Ot.Segment?1:-1:0}function Tc(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=Ch(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(wa(r))return 1;if(wa(s))return-1}return s.length-r.length}function wa(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Ah={strict:!1,end:!0,sensitive:!1};function Eh(e,t,n){const r=xh(kh(e.path),n),s=et(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Ih(e,t){const n=[],r=new Map;t=da(Ah,t);function s(f){return r.get(f)}function o(f,g,b){const $=!b,E=_a(f);E.aliasOf=b&&b.record;const B=da(t,f),W=[E];if("alias"in f){const F=typeof f.alias=="string"?[f.alias]:f.alias;for(const ae of F)W.push(_a(et({},E,{components:b?b.record.components:E.components,path:ae,aliasOf:b?b.record:E})))}let M,U;for(const F of W){const{path:ae}=F;if(g&&ae[0]!=="/"){const ie=g.record.path,le=ie[ie.length-1]==="/"?"":"/";F.path=g.record.path+(ae&&le+ae)}if(M=Eh(F,g,B),b?b.alias.push(M):(U=U||M,U!==M&&U.alias.push(M),$&&f.name&&!ka(M)&&i(f.name)),Sc(M)&&l(M),E.children){const ie=E.children;for(let le=0;le<ie.length;le++)o(ie[le],M,b&&b.children[le])}b=b||M}return U?()=>{i(U)}:Ur}function i(f){if(bc(f)){const g=r.get(f);g&&(r.delete(f),n.splice(n.indexOf(g),1),g.children.forEach(i),g.alias.forEach(i))}else{const g=n.indexOf(f);g>-1&&(n.splice(g,1),f.record.name&&r.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function a(){return n}function l(f){const g=Mh(f,n);n.splice(g,0,f),f.record.name&&!ka(f)&&r.set(f.record.name,f)}function d(f,g){let b,$={},E,B;if("name"in f&&f.name){if(b=r.get(f.name),!b)throw kr(yt.MATCHER_NOT_FOUND,{location:f});B=b.record.name,$=et(ba(g.params,b.keys.filter(U=>!U.optional).concat(b.parent?b.parent.keys.filter(U=>U.optional):[]).map(U=>U.name)),f.params&&ba(f.params,b.keys.map(U=>U.name))),E=b.stringify($)}else if(f.path!=null)E=f.path,b=n.find(U=>U.re.test(E)),b&&($=b.parse(E),B=b.record.name);else{if(b=g.name?r.get(g.name):n.find(U=>U.re.test(g.path)),!b)throw kr(yt.MATCHER_NOT_FOUND,{location:f,currentLocation:g});B=b.record.name,$=et({},g.params,f.params),E=b.stringify($)}const W=[];let M=b;for(;M;)W.unshift(M.record),M=M.parent;return{name:B,path:E,params:$,matched:W,meta:$h(W)}}e.forEach(f=>o(f));function u(){n.length=0,r.clear()}return{addRoute:o,resolve:d,removeRoute:i,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function ba(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function _a(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Rh(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Rh(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function ka(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function $h(e){return e.reduce((t,n)=>et(t,n.meta),{})}function Mh(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Tc(e,t[o])<0?r=o:n=o+1}const s=Ph(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Ph(e){let t=e;for(;t=t.parent;)if(Sc(t)&&Tc(e,t)===0)return t}function Sc({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ta(e){const t=Zt(Bs),n=Zt(ii),r=ce(()=>{const l=Me(e.to);return t.resolve(l)}),s=ce(()=>{const{matched:l}=r.value,{length:d}=l,u=l[d-1],f=n.matched;if(!u||!f.length)return-1;const g=f.findIndex(_r.bind(null,u));if(g>-1)return g;const b=Sa(l[d-2]);return d>1&&Sa(u)===b&&f[f.length-1].path!==b?f.findIndex(_r.bind(null,l[d-2])):g}),o=ce(()=>s.value>-1&&Dh(n.params,r.value.params)),i=ce(()=>s.value>-1&&s.value===n.matched.length-1&&wc(n.params,r.value.params));function a(l={}){if(Lh(l)){const d=t[Me(e.replace)?"replace":"push"](Me(e.to)).catch(Ur);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:r,href:ce(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Nh(e){return e.length===1?e[0]:e}const Oh=Ct({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Ta,setup(e,{slots:t}){const n=Rs(Ta(e)),{options:r}=Zt(Bs),s=ce(()=>({[xa(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[xa(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Nh(t.default(n));return e.custom?o:si("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),jh=Oh;function Lh(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Dh(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!rn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Sa(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const xa=(e,t,n)=>e??t??n,Bh=Ct({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Zt(Po),s=ce(()=>e.route||r.value),o=Zt(ga,0),i=ce(()=>{let d=Me(o);const{matched:u}=s.value;let f;for(;(f=u[d])&&!f.components;)d++;return d}),a=ce(()=>s.value.matched[i.value]);fs(ga,ce(()=>i.value+1)),fs(hh,a),fs(Po,s);const l=D();return pt(()=>[l.value,a.value,e.name],([d,u,f],[g,b,$])=>{u&&(u.instances[f]=d,b&&b!==u&&d&&d===g&&(u.leaveGuards.size||(u.leaveGuards=b.leaveGuards),u.updateGuards.size||(u.updateGuards=b.updateGuards))),d&&u&&(!b||!_r(u,b)||!g)&&(u.enterCallbacks[f]||[]).forEach(E=>E(d))},{flush:"post"}),()=>{const d=s.value,u=e.name,f=a.value,g=f&&f.components[u];if(!g)return Ca(n.default,{Component:g,route:d});const b=f.props[u],$=b?b===!0?d.params:typeof b=="function"?b(d):b:null,B=si(g,et({},$,t,{onVnodeUnmounted:W=>{W.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Ca(n.default,{Component:B,route:d})||B}}});function Ca(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Fh=Bh;function Hh(e){const t=Ih(e.routes,e),n=e.parseQuery||dh,r=e.stringifyQuery||ma,s=e.history,o=$r(),i=$r(),a=$r(),l=Lu(Rn);let d=Rn;pr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=to.bind(null,A=>""+A),f=to.bind(null,zf),g=to.bind(null,Qr);function b(A,X){let Q,pe;return bc(A)?(Q=t.getRecordMatcher(A),pe=X):pe=A,t.addRoute(pe,Q)}function $(A){const X=t.getRecordMatcher(A);X&&t.removeRoute(X)}function E(){return t.getRoutes().map(A=>A.record)}function B(A){return!!t.getRecordMatcher(A)}function W(A,X){if(X=et({},X||l.value),typeof A=="string"){const x=no(n,A,X.path),O=t.resolve({path:x.path},X),H=s.createHref(x.fullPath);return et(x,O,{params:g(O.params),hash:Qr(x.hash),redirectedFrom:void 0,href:H})}let Q;if(A.path!=null)Q=et({},A,{path:no(n,A.path,X.path).path});else{const x=et({},A.params);for(const O in x)x[O]==null&&delete x[O];Q=et({},A,{params:f(x)}),X.params=f(X.params)}const pe=t.resolve(Q,X),ke=A.hash||"";pe.params=u(g(pe.params));const p=Qf(r,et({},A,{hash:Wf(ke),path:pe.path})),y=s.createHref(p);return et({fullPath:p,hash:ke,query:r===ma?fh(A.query):A.query||{}},pe,{redirectedFrom:void 0,href:y})}function M(A){return typeof A=="string"?no(n,A,l.value.path):et({},A)}function U(A,X){if(d!==A)return kr(yt.NAVIGATION_CANCELLED,{from:X,to:A})}function F(A){return le(A)}function ae(A){return F(et(M(A),{replace:!0}))}function ie(A,X){const Q=A.matched[A.matched.length-1];if(Q&&Q.redirect){const{redirect:pe}=Q;let ke=typeof pe=="function"?pe(A,X):pe;return typeof ke=="string"&&(ke=ke.includes("?")||ke.includes("#")?ke=M(ke):{path:ke},ke.params={}),et({query:A.query,hash:A.hash,params:ke.path!=null?{}:A.params},ke)}}function le(A,X){const Q=d=W(A),pe=l.value,ke=A.state,p=A.force,y=A.replace===!0,x=ie(Q,pe);if(x)return le(et(M(x),{state:typeof x=="object"?et({},ke,x.state):ke,force:p,replace:y}),X||Q);const O=Q;O.redirectedFrom=X;let H;return!p&&Xf(r,pe,Q)&&(H=kr(yt.NAVIGATION_DUPLICATED,{to:O,from:pe}),Qe(pe,pe,!0,!1)),(H?Promise.resolve(H):Z(O,pe)).catch(N=>vn(N)?vn(N,yt.NAVIGATION_GUARD_REDIRECT)?N:it(N):Ae(N,O,pe)).then(N=>{if(N){if(vn(N,yt.NAVIGATION_GUARD_REDIRECT))return le(et({replace:y},M(N.to),{state:typeof N.to=="object"?et({},ke,N.to.state):ke,force:p}),X||O)}else N=ee(O,pe,!0,y,ke);return he(O,pe,N),N})}function fe(A,X){const Q=U(A,X);return Q?Promise.reject(Q):Promise.resolve()}function oe(A){const X=ue.values().next().value;return X&&typeof X.runWithContext=="function"?X.runWithContext(A):A()}function Z(A,X){let Q;const[pe,ke,p]=ph(A,X);Q=so(pe.reverse(),"beforeRouteLeave",A,X);for(const x of pe)x.leaveGuards.forEach(O=>{Q.push(Nn(O,A,X))});const y=fe.bind(null,A,X);return Q.push(y),de(Q).then(()=>{Q=[];for(const x of o.list())Q.push(Nn(x,A,X));return Q.push(y),de(Q)}).then(()=>{Q=so(ke,"beforeRouteUpdate",A,X);for(const x of ke)x.updateGuards.forEach(O=>{Q.push(Nn(O,A,X))});return Q.push(y),de(Q)}).then(()=>{Q=[];for(const x of p)if(x.beforeEnter)if(rn(x.beforeEnter))for(const O of x.beforeEnter)Q.push(Nn(O,A,X));else Q.push(Nn(x.beforeEnter,A,X));return Q.push(y),de(Q)}).then(()=>(A.matched.forEach(x=>x.enterCallbacks={}),Q=so(p,"beforeRouteEnter",A,X,oe),Q.push(y),de(Q))).then(()=>{Q=[];for(const x of i.list())Q.push(Nn(x,A,X));return Q.push(y),de(Q)}).catch(x=>vn(x,yt.NAVIGATION_CANCELLED)?x:Promise.reject(x))}function he(A,X,Q){a.list().forEach(pe=>oe(()=>pe(A,X,Q)))}function ee(A,X,Q,pe,ke){const p=U(A,X);if(p)return p;const y=X===Rn,x=pr?history.state:{};Q&&(pe||y?s.replace(A.fullPath,et({scroll:y&&x&&x.scroll},ke)):s.push(A.fullPath,ke)),l.value=A,Qe(A,X,Q,y),it()}let Oe;function qe(){Oe||(Oe=s.listen((A,X,Q)=>{if(!Se.listening)return;const pe=W(A),ke=ie(pe,Se.currentRoute.value);if(ke){le(et(ke,{replace:!0,force:!0}),pe).catch(Ur);return}d=pe;const p=l.value;pr&&ih(pa(p.fullPath,Q.delta),Ds()),Z(pe,p).catch(y=>vn(y,yt.NAVIGATION_ABORTED|yt.NAVIGATION_CANCELLED)?y:vn(y,yt.NAVIGATION_GUARD_REDIRECT)?(le(et(M(y.to),{force:!0}),pe).then(x=>{vn(x,yt.NAVIGATION_ABORTED|yt.NAVIGATION_DUPLICATED)&&!Q.delta&&Q.type===$o.pop&&s.go(-1,!1)}).catch(Ur),Promise.reject()):(Q.delta&&s.go(-Q.delta,!1),Ae(y,pe,p))).then(y=>{y=y||ee(pe,p,!1),y&&(Q.delta&&!vn(y,yt.NAVIGATION_CANCELLED)?s.go(-Q.delta,!1):Q.type===$o.pop&&vn(y,yt.NAVIGATION_ABORTED|yt.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),he(pe,p,y)}).catch(Ur)}))}let rt=$r(),Ne=$r(),Te;function Ae(A,X,Q){it(A);const pe=Ne.list();return pe.length?pe.forEach(ke=>ke(A,X,Q)):console.error(A),Promise.reject(A)}function ht(){return Te&&l.value!==Rn?Promise.resolve():new Promise((A,X)=>{rt.add([A,X])})}function it(A){return Te||(Te=!A,qe(),rt.list().forEach(([X,Q])=>A?Q(A):X()),rt.reset()),A}function Qe(A,X,Q,pe){const{scrollBehavior:ke}=e;if(!pr||!ke)return Promise.resolve();const p=!Q&&ah(pa(A.fullPath,0))||(pe||!Q)&&history.state&&history.state.scroll||null;return zt().then(()=>ke(A,X,p)).then(y=>y&&oh(y)).catch(y=>Ae(y,A,X))}const Ye=A=>s.go(A);let Ge;const ue=new Set,Se={currentRoute:l,listening:!0,addRoute:b,removeRoute:$,clearRoutes:t.clearRoutes,hasRoute:B,getRoutes:E,resolve:W,options:e,push:F,replace:ae,go:Ye,back:()=>Ye(-1),forward:()=>Ye(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Ne.add,isReady:ht,install(A){A.component("RouterLink",jh),A.component("RouterView",Fh),A.config.globalProperties.$router=Se,Object.defineProperty(A.config.globalProperties,"$route",{enumerable:!0,get:()=>Me(l)}),pr&&!Ge&&l.value===Rn&&(Ge=!0,F(s.location).catch(pe=>{}));const X={};for(const pe in Rn)Object.defineProperty(X,pe,{get:()=>l.value[pe],enumerable:!0});A.provide(Bs,Se),A.provide(ii,bl(X)),A.provide(Po,l);const Q=A.unmount;ue.add(A),A.unmount=function(){ue.delete(A),ue.size<1&&(d=Rn,Oe&&Oe(),Oe=null,l.value=Rn,Ge=!1,Te=!1),Q()}}};function de(A){return A.reduce((X,Q)=>X.then(()=>oe(Q)),Promise.resolve())}return Se}function Uh(){return Zt(Bs)}function Vh(e){return Zt(ii)}const Aa=768;function xc(){const e=D(typeof window<"u"?window.innerWidth<Aa:!1);let t=null;function n(r){e.value=r.matches}return Hn(()=>{t=window.matchMedia(`(max-width: ${Aa-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),Ns(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const qh={key:0,class:"desktop-sidebar"},Wh={class:"desktop-main"},Ea="codex-web-local.sidebar-width.v1",Kh=260,Gh=620,Ia=320,zh=Ct({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=xc();function r(d){return Math.min(Gh,Math.max(Kh,d))}function s(){if(typeof window>"u")return Ia;const d=window.localStorage.getItem(Ea),u=Number(d);return Number.isFinite(u)?r(u):Ia}const o=D(s()),i=ce(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${o.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(d){typeof window>"u"||window.localStorage.setItem(Ea,String(d))}function l(d){d.preventDefault();const u=d.clientX,f=o.value,g=$=>{const E=$.clientX-u;o.value=r(f+E)},b=()=>{a(o.value),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",b)};window.addEventListener("mousemove",g),window.addEventListener("mouseup",b)}return(d,u)=>(_(),S("div",{class:ut(["desktop-layout",{"is-mobile":Me(n)}]),style:rr(i.value)},[Me(n)?(_(),at(Pl,{key:0,to:"body"},[Ie(of,{name:"drawer"},{default:ot(()=>[e.isSidebarCollapsed?ve("",!0):(_(),S("div",{key:0,class:"mobile-drawer-backdrop",onClick:u[1]||(u[1]=f=>d.$emit("close-sidebar"))},[w("aside",{class:"mobile-drawer",onClick:u[0]||(u[0]=dt(()=>{},["stop"]))},[un(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ve("",!0),Me(n)?ve("",!0):(_(),S(De,{key:1},[e.isSidebarCollapsed?ve("",!0):(_(),S("aside",qh,[un(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?ve("",!0):(_(),S("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),w("section",Wh,[un(d.$slots,"content",{},void 0)])],6))}}),Ke=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Yh=Ke(zh,[["__scopeId","data-v-2039d51b"]]),Jh={},Qh={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Xh(e,t){return _(),S("svg",Qh,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2m2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8m-9 4h4"},null,-1)])])}const oo=Ke(Jh,[["render",Xh]]),Zh={},ep={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function tp(e,t){return _(),S("svg",ep,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const ai=Ke(Zh,[["render",tp]]),np={},rp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function sp(e,t){return _(),S("svg",rp,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const Cc=Ke(np,[["render",sp]]),op={},ip={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ap(e,t){return _(),S("svg",ip,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const Ra=Ke(op,[["render",ap]]),lp={},cp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function up(e,t){return _(),S("svg",cp,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16zm9.5-13.5l4 4"},null,-1)])])}const Ts=Ke(lp,[["render",up]]),dp={},fp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function hp(e,t){return _(),S("svg",fp,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2"},null,-1)])])}const pp=Ke(dp,[["render",hp]]),mp={},gp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function vp(e,t){return _(),S("svg",gp,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const yp=Ke(mp,[["render",vp]]),wp={},bp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function _p(e,t){return _(),S("svg",bp,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 18v-6m0 0a4 4 0 0 1 4-4h2m-6 4a4 4 0 0 0-4-4H6m0-4a2 2 0 1 0 0 4a2 2 0 0 0 0-4m12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4m-6 14a2 2 0 1 0 0 4a2 2 0 0 0 0-4"},null,-1)])])}const io=Ke(wp,[["render",_p]]),kp={},Tp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Sp(e,t){return _(),S("svg",Tp,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 4.5l-4 4L7 10l-1.5 1.5l7 7L14 17l1.5-4l4-4M9 15l-4.5 4.5M14.5 4L20 9.5"},null,-1)])])}const ao=Ke(kp,[["render",Sp]]),xp={key:0,class:"sidebar-menu-row-left"},Cp={class:"sidebar-menu-row-main"},Ap={key:1,class:"sidebar-menu-row-right"},Ep={key:0,class:"sidebar-menu-row-right-default"},Ip={key:1,class:"sidebar-menu-row-right-hover"},Rp=Ct({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=pd(),r=ce(()=>!!n.left),s=ce(()=>!!n.right),o=ce(()=>!!n["right-hover"]),i=ce(()=>s.value||o.value);return(a,l)=>(_(),at(dd(t.as),ac({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:ot(()=>[r.value?(_(),S("span",xp,[un(a.$slots,"left",{},void 0,!0)])):ve("",!0),w("span",Cp,[un(a.$slots,"default",{},void 0,!0)]),i.value?(_(),S("span",Ap,[s.value?(_(),S("span",Ep,[un(a.$slots,"right",{},void 0,!0)])):ve("",!0),o.value?(_(),S("span",Ip,[un(a.$slots,"right-hover",{},void 0,!0)])):ve("",!0)])):ve("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Jn=Ke(Rp,[["__scopeId","data-v-daeca4df"]]),$p={class:"thread-tree-root"},Mp={key:0,class:"pinned-section"},Pp={class:"thread-list"},Np={class:"thread-left-stack"},Op=["data-state"],jp=["onClick"],Lp=["onClick"],Dp={class:"thread-row-title-wrap"},Bp={class:"thread-row-title"},Fp={class:"thread-row-time"},Hp=["data-confirm","onClick"],Up={key:0},Vp=["aria-expanded"],qp=["data-active"],Wp={key:0},Kp=["data-active"],Gp={key:0},zp={key:1,class:"thread-tree-no-results"},Yp={key:2,class:"thread-tree-loading"},Jp={key:3,class:"thread-list thread-list-global"},Qp={class:"thread-left-stack"},Xp=["data-state"],Zp=["onClick"],em=["onClick"],tm={class:"thread-row-title-wrap"},nm={class:"thread-row-title"},rm={class:"thread-row-time"},sm=["data-confirm","onClick"],om={key:0},im=["data-project-name","data-expanded","data-dragging"],am={class:"project-icon-stack"},lm={class:"project-icon-folder"},cm={class:"project-icon-chevron"},um=["data-dragging-handle","onMousedown"],dm={class:"project-title"},fm={class:"project-hover-controls"},hm=["onClick"],pm=["onClick"],mm=["onClick"],gm=["onInput"],vm=["aria-label","title","onClick"],ym={key:0,class:"thread-list"},wm={class:"thread-left-stack"},bm=["data-state"],_m=["onClick"],km=["onClick"],Tm={class:"thread-row-title-wrap"},Sm={class:"thread-row-title"},xm={class:"thread-row-time"},Cm=["data-confirm","onClick"],Am={key:0},Em=["onClick"],Im=4,$a=6,Ma="codex-web-local.thread-view-mode.v1",Pa="codex-web-local.collapsed-projects.v1",Rm=Ct({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{}},emits:["select","archive","start-new-thread","rename-project","remove-project","reorder-project"],setup(e,{emit:t}){const n=e,r=t,s=D({}),o=D({}),i=D([]),a=D(""),l=D(""),d=D("actions"),u=D(""),f=D(null),g=D(null),b=D(null);let $=null,E=null;const B=D(""),W=D({}),M=new Map,U=new Map,F=new WeakMap,ae=D(null),ie=D(!1),le=D(Z()),fe=typeof window<"u"?new ResizeObserver(T=>{for(const R of T){const P=R.target,J=F.get(P);J&&C(J,P)}}):null;function oe(){if(typeof window>"u")return{};try{const T=window.localStorage.getItem(Pa);if(!T)return{};const R=JSON.parse(T);return!R||typeof R!="object"||Array.isArray(R)?{}:R}catch{return{}}}function Z(){return typeof window>"u"?"project":window.localStorage.getItem(Ma)==="chronological"?"chronological":"project"}o.value=oe(),pt(o,T=>{typeof window>"u"||window.localStorage.setItem(Pa,JSON.stringify(T))},{deep:!0}),pt(le,T=>{typeof window>"u"||window.localStorage.setItem(Ma,T)});const he=ce(()=>n.searchQuery.trim().toLowerCase()),ee=ce(()=>he.value.length>0);function Oe(T){if(!ee.value)return!0;const R=he.value;return T.title.toLowerCase().includes(R)||T.preview.toLowerCase().includes(R)}const qe=ce(()=>ee.value?n.groups.map(T=>({...T,threads:T.threads.filter(Oe)})).filter(T=>T.threads.length>0):n.groups),rt=ce(()=>le.value==="chronological"),Ne=ce(()=>{const T=qe.value,R=[];for(const P of T)for(const J of P.threads)ue(J.id)||R.push(J);return R.sort((P,J)=>{const Ue=new Date(P.updatedAtIso||P.createdAtIso).getTime();return new Date(J.updatedAtIso||J.createdAtIso).getTime()-Ue})}),Te=ce(()=>{const T=new Map;for(const R of n.groups)for(const P of R.threads)T.set(P.id,P);return T}),Ae=ce(()=>i.value.map(T=>Te.value.get(T)??null).filter(T=>T!==null).filter(Oe)),ht=ce(()=>{const T=b.value;if(!T||T.dropTargetIndexFull===null||n.groups.length===0)return null;const R=Math.max(0,Math.min(T.dropTargetIndexFull,n.groups.length)),P=R>T.fromIndex?R-1:R,J=Math.max(0,Math.min(P,n.groups.length-1));return J===T.fromIndex?null:J}),it=ce(()=>{const R=(ee.value?qe.value:n.groups).map(Bt=>Bt.projectName),P=b.value,J=ht.value;if(!P||J===null)return R;const Ue=[...R],[wt]=Ue.splice(P.fromIndex,1);return wt?(Ue.splice(J,0,wt),Ue):R}),Qe=ce(()=>{const T={};let R=0;for(const P of it.value)T[P]=R,R+=xe(P);return T}),Ye=ce(()=>{let T=0;for(const R of it.value)T+=xe(R);return{height:`${Math.max(0,T)}px`}});function Ge(T){const R=new Date(T).getTime();if(Number.isNaN(R))return"n/a";const P=Math.abs(Date.now()-R);if(P<6e4)return"now";const J=Math.floor(P/6e4);if(J<60)return`${J}m`;const Ue=Math.floor(J/60);return Ue<24?`${Ue}h`:`${Math.floor(Ue/24)}d`}function ue(T){return i.value.includes(T)}function Se(T){if(ue(T)){i.value=i.value.filter(R=>R!==T);return}i.value=[T,...i.value]}function de(T){r("select",T)}function A(T){if(a.value!==T){a.value=T;return}a.value="",i.value=i.value.filter(R=>R!==T),r("archive",T)}function X(T){return`start new thread ${ke(T)}`}function Q(T){r("start-new-thread",T)}function pe(T){a.value===T&&(a.value="")}function ke(T){return n.projectDisplayNameById[T]??T}function p(T){return l.value===T}function y(){l.value="",d.value="actions",u.value=""}function x(){ie.value=!ie.value}function O(T){le.value=T,ie.value=!1}function H(T){if(l.value===T){y();return}l.value=T,d.value="actions",u.value=ke(T)}function N(T){l.value=T,d.value="rename",u.value=ke(T)}function ne(T){r("rename-project",{projectName:T,displayName:u.value})}function te(T){r("remove-project",T),y()}function Y(T,R){if(!T.altKey||T.key!=="ArrowUp"&&T.key!=="ArrowDown")return;const P=n.groups.findIndex(wt=>wt.projectName===R);if(P<0)return;const J=T.key==="ArrowUp"?-1:1,Ue=Math.max(0,Math.min(P+J,n.groups.length-1));Ue!==P&&(T.preventDefault(),r("reorder-project",{projectName:R,toIndex:Ue}))}function V(T){return s.value[T]===!0}function me(T){return o.value[T]===!0}function re(T){s.value={...s.value,[T]:!V(T)}}function be(T){if(B.value===T){B.value="";return}o.value={...o.value,[T]:!me(T)}}function xe(T){const R=W.value[T]??0,P=b.value,Ue=((P==null?void 0:P.projectName)===T?P.groupHeight:null)??R,wt=me(T)?0:$a;return Math.max(0,Ue+wt)}function je(T,R){const P=R instanceof HTMLElement?R:R&&"$el"in R&&R.$el instanceof HTMLElement?R.$el:null;if(P){U.set(T,P);return}U.delete(T)}function Ve(T){const R=l.value;if(!R)return!1;const P=U.get(R);if(!P)return!1;if((typeof T.composedPath=="function"?T.composedPath():[]).includes(P))return!0;const Ue=T.target;return Ue instanceof Node?P.contains(Ue):!1}function $e(T){if(ie.value){const R=ae.value,P=typeof T.composedPath=="function"?T.composedPath():[];!!R&&(P.includes(R)||T.target instanceof Node&&R.contains(T.target))||(ie.value=!1)}l.value&&(Ve(T)||y())}function st(T){l.value&&(Ve(T)||y())}function L(){ie.value&&(ie.value=!1),l.value&&y()}function z(){window.addEventListener("pointerdown",$e,{capture:!0}),window.addEventListener("focusin",st,{capture:!0}),window.addEventListener("blur",L)}function m(){window.removeEventListener("pointerdown",$e,{capture:!0}),window.removeEventListener("focusin",st,{capture:!0}),window.removeEventListener("blur",L)}function C(T,R){const P=R.getBoundingClientRect().height;if(!Number.isFinite(P)||P<=0)return;const J=W.value[T];J!==void 0&&Math.abs(J-P)<.5||(W.value={...W.value,[T]:P})}function I(T,R){const P=M.get(T);P&&P!==R&&fe&&fe.unobserve(P);const J=R instanceof HTMLElement?R:R&&"$el"in R&&R.$el instanceof HTMLElement?R.$el:null;if(J){M.set(T,J),F.set(J,T),C(T,J),fe==null||fe.observe(J);return}P&&(fe==null||fe.unobserve(P)),M.delete(T)}function G(T,R){if(T.button!==0||g.value||b.value)return;const P=n.groups.findIndex(Bt=>Bt.projectName===R),J=M.get(R);if(P<0||!J)return;const Ue=J.getBoundingClientRect(),wt=me(R)?0:$a;g.value={projectName:R,fromIndex:P,startClientX:T.clientX,startClientY:T.clientY,pointerOffsetY:T.clientY-Ue.top,groupLeft:Ue.left,groupWidth:Ue.width,groupHeight:Ue.height,groupOuterHeight:Ue.height+wt},T.preventDefault(),se()}function se(){window.addEventListener("mousemove",Xe),window.addEventListener("mouseup",ze),window.addEventListener("keydown",Ze)}function Ce(){window.removeEventListener("mousemove",Xe),window.removeEventListener("mouseup",ze),window.removeEventListener("keydown",Ze)}function Xe(T){$={clientX:T.clientX,clientY:T.clientY},Lt()}function ze(T){Jt({clientX:T.clientX,clientY:T.clientY});const R=b.value;if(R&&ht.value!==null){const P=n.groups.findIndex(J=>J.projectName===R.projectName);if(P>=0){const J=ht.value;J!==P&&r("reorder-project",{projectName:R.projectName,toIndex:J})}}ft()}function Ze(T){T.key==="Escape"&&(!g.value&&!b.value||(T.preventDefault(),ft()))}function ft(){E!==null&&(window.cancelAnimationFrame(E),E=null),$=null,g.value=null,b.value=null,B.value="",Ce()}function Lt(){E===null&&(E=window.requestAnimationFrame(()=>{if(E=null,!$)return;const T=$;$=null,Jt(T)}))}function Jt(T){const R=g.value;if(!b.value&&R){const P=T.clientX-R.startClientX,J=T.clientY-R.startClientY;if(Math.hypot(P,J)<Im)return;y(),B.value=R.projectName,b.value={projectName:R.projectName,fromIndex:R.fromIndex,pointerOffsetY:R.pointerOffsetY,groupLeft:R.groupLeft,groupWidth:R.groupWidth,groupHeight:R.groupHeight,groupOuterHeight:R.groupOuterHeight,ghostTop:T.clientY-R.pointerOffsetY,dropTargetIndexFull:null}}b.value&&Tt(T)}function Tt(T){const R=b.value;if(!R)return;if(R.ghostTop=T.clientY-R.pointerOffsetY,!Le(T)){R.dropTargetIndexFull=null;return}const P=T.clientY,J=f.value;if(!J){R.dropTargetIndexFull=null;return}const Ue=J.getBoundingClientRect(),wt=new Map(n.groups.map((qt,An)=>[qt.projectName,An])),Bt=n.groups.map(qt=>qt.projectName).filter(qt=>qt!==R.projectName);let ir=0,ar=n.groups.length;for(const qt of Bt){const An=wt.get(qt);if(An===void 0)continue;const Vn=xe(qt),Cr=Ue.top+ir+Vn/2;if(P<Cr){ar=An;break}ir+=Vn}R.dropTargetIndexFull=ar}function Le(T){const R=f.value;if(!R)return!1;const P=R.getBoundingClientRect(),J=T.clientX>=P.left&&T.clientX<=P.right,Ue=T.clientY>=P.top-32&&T.clientY<=P.bottom+32;return J&&Ue}function Re(T){var R;return((R=b.value)==null?void 0:R.projectName)===T}function sr(T){const R=b.value,P=Qe.value[T]??0,J=l.value===T;return!R||R.projectName!==T?{position:"absolute",top:"0",left:"0",right:"0",zIndex:J?"40":"1",transform:`translate3d(0, ${P}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${R.groupLeft}px`,width:`${R.groupWidth}px`,height:`${R.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${R.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function At(T){return T.threads.filter(R=>!ue(R.id))}function Sr(T){if(ee.value)return At(T);if(me(T.projectName))return[];const R=At(T);return V(T.projectName)?R:R.slice(0,10)}function xr(T){return ee.value?!1:!me(T.projectName)&&At(T).length>10}function fn(T){return At(T).length>0}function hn(T){return T.inProgress?"working":T.unread?"unread":"idle"}pt(()=>n.groups.map(T=>T.projectName),T=>{var Ue,wt;const R=((Ue=b.value)==null?void 0:Ue.projectName)??((wt=g.value)==null?void 0:wt.projectName)??"";R&&!n.groups.some(Bt=>Bt.projectName===R)&&ft();const P=new Set(T),J=Object.fromEntries(Object.entries(W.value).filter(([Bt])=>P.has(Bt)));Object.keys(J).length!==Object.keys(W.value).length&&(W.value=J)});const or=ce(()=>ie.value||l.value!=="");return pt(or,T=>{if(T){z();return}m()}),Un(()=>{for(const T of M.values())fe==null||fe.unobserve(T);M.clear(),U.clear(),m(),ft()}),(T,R)=>(_(),S("section",$p,[Ae.value.length>0?(_(),S("section",Mp,[w("ul",Pp,[(_(!0),S(De,null,mt(Ae.value,P=>(_(),S("li",{key:P.id,class:"thread-row-item"},[Ie(Jn,{class:"thread-row","data-active":P.id===e.selectedThreadId,"data-pinned":ue(P.id),onMouseleave:J=>pe(P.id)},{left:ot(()=>[w("span",Np,[P.inProgress||P.unread?(_(),S("span",{key:0,class:"thread-status-indicator","data-state":hn(P)},null,8,Op)):ve("",!0),w("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>Se(P.id)},[Ie(ao,{class:"thread-icon"})],8,jp)])]),right:ot(()=>[w("span",Fp,_e(Ge(P.createdAtIso||P.updatedAtIso)),1)]),"right-hover":ot(()=>[w("button",{class:"thread-archive-button","data-confirm":a.value===P.id,type:"button",title:"archive_thread",onClick:J=>A(P.id)},[a.value===P.id?(_(),S("span",Up,"confirm")):(_(),at(oo,{key:1,class:"thread-icon"}))],8,Hp)]),default:ot(()=>[w("button",{class:"thread-main-button",type:"button",onClick:J=>de(P.id)},[w("span",Dp,[w("span",Bp,_e(P.title),1),P.hasWorktree?(_(),at(io,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ve("",!0)])],8,Lp)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):ve("",!0),Ie(Jn,{as:"header",class:"thread-tree-header-row"},{right:ot(()=>[w("div",{ref_key:"organizeMenuWrapRef",ref:ae,class:"organize-menu-wrap"},[w("button",{class:"organize-menu-trigger",type:"button","aria-expanded":ie.value,"aria-label":"Organize threads",title:"Organize threads",onClick:x},[Ie(Ra,{class:"thread-icon"})],8,Vp),ie.value?(_(),S("div",{key:0,class:"organize-menu-panel",onClick:R[2]||(R[2]=dt(()=>{},["stop"]))},[R[7]||(R[7]=w("p",{class:"organize-menu-title"},"Organize",-1)),w("button",{class:"organize-menu-item","data-active":le.value==="project",type:"button",onClick:R[0]||(R[0]=P=>O("project"))},[R[5]||(R[5]=w("span",null,"By project",-1)),le.value==="project"?(_(),S("span",Wp,"✓")):ve("",!0)],8,qp),w("button",{class:"organize-menu-item","data-active":le.value==="chronological",type:"button",onClick:R[1]||(R[1]=P=>O("chronological"))},[R[6]||(R[6]=w("span",null,"Chronological list",-1)),le.value==="chronological"?(_(),S("span",Gp,"✓")):ve("",!0)],8,Kp)])):ve("",!0)],512)]),default:ot(()=>[R[8]||(R[8]=w("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),ee.value&&qe.value.length===0?(_(),S("p",zp,"No matching threads")):e.isLoading&&e.groups.length===0?(_(),S("p",Yp,"Loading threads...")):rt.value?(_(),S("ul",Jp,[(_(!0),S(De,null,mt(Ne.value,P=>(_(),S("li",{key:P.id,class:"thread-row-item"},[Ie(Jn,{class:"thread-row","data-active":P.id===e.selectedThreadId,"data-pinned":ue(P.id),onMouseleave:J=>pe(P.id)},{left:ot(()=>[w("span",Qp,[P.inProgress||P.unread?(_(),S("span",{key:0,class:"thread-status-indicator","data-state":hn(P)},null,8,Xp)):ve("",!0),w("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>Se(P.id)},[Ie(ao,{class:"thread-icon"})],8,Zp)])]),right:ot(()=>[w("span",rm,_e(Ge(P.createdAtIso||P.updatedAtIso)),1)]),"right-hover":ot(()=>[w("button",{class:"thread-archive-button","data-confirm":a.value===P.id,type:"button",title:"archive_thread",onClick:J=>A(P.id)},[a.value===P.id?(_(),S("span",om,"confirm")):(_(),at(oo,{key:1,class:"thread-icon"}))],8,sm)]),default:ot(()=>[w("button",{class:"thread-main-button",type:"button",onClick:J=>de(P.id)},[w("span",tm,[w("span",nm,_e(P.title),1),P.hasWorktree?(_(),at(io,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ve("",!0)])],8,em)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(_(),S("div",{key:4,ref_key:"groupsContainerRef",ref:f,class:"thread-tree-groups",style:rr(Ye.value)},[(_(!0),S(De,null,mt(qe.value,P=>(_(),S("article",{key:P.projectName,ref_for:!0,ref:J=>I(P.projectName,J),class:"project-group","data-project-name":P.projectName,"data-expanded":!me(P.projectName),"data-dragging":Re(P.projectName),style:rr(sr(P.projectName))},[Ie(Jn,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:J=>be(P.projectName),onKeydown:[J=>Y(J,P.projectName),Ut(dt(J=>be(P.projectName),["prevent"]),["enter"]),Ut(dt(J=>be(P.projectName),["prevent"]),["space"])]},{left:ot(()=>[w("span",am,[w("span",lm,[me(P.projectName)?(_(),at(pp,{key:0,class:"thread-icon"})):(_(),at(yp,{key:1,class:"thread-icon"}))]),w("span",cm,[me(P.projectName)?(_(),at(Cc,{key:0,class:"thread-icon"})):(_(),at(ai,{key:1,class:"thread-icon"}))])])]),right:ot(()=>[w("div",fm,[w("div",{ref_for:!0,ref:J=>je(P.projectName,J),class:"project-menu-wrap"},[w("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:dt(J=>H(P.projectName),["stop"])},[Ie(Ra,{class:"thread-icon"})],8,hm),p(P.projectName)?(_(),S("div",{key:0,class:"project-menu-panel",onClick:R[4]||(R[4]=dt(()=>{},["stop"]))},[d.value==="actions"?(_(),S(De,{key:0},[w("button",{class:"project-menu-item",type:"button",onClick:J=>N(P.projectName)}," Edit name ",8,pm),w("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:J=>te(P.projectName)}," Remove ",8,mm)],64)):(_(),S(De,{key:1},[R[9]||(R[9]=w("label",{class:"project-menu-label"},"Project name",-1)),Ln(w("input",{"onUpdate:modelValue":R[3]||(R[3]=J=>u.value=J),class:"project-menu-input",type:"text",onInput:J=>ne(P.projectName)},null,40,gm),[[Bn,u.value]])],64))])):ve("",!0)],512),w("button",{class:"thread-start-button",type:"button","aria-label":X(P.projectName),title:X(P.projectName),onClick:dt(J=>Q(P.projectName),["stop"])},[Ie(Ts,{class:"thread-icon"})],8,vm)])]),default:ot(()=>[w("span",{class:"project-main-button","data-dragging-handle":Re(P.projectName),onMousedown:dt(J=>G(J,P.projectName),["left"])},[w("span",dm,_e(ke(P.projectName)),1)],40,um)]),_:2},1032,["onClick","onKeydown"]),fn(P)?(_(),S("ul",ym,[(_(!0),S(De,null,mt(Sr(P),J=>(_(),S("li",{key:J.id,class:"thread-row-item"},[Ie(Jn,{class:"thread-row","data-active":J.id===e.selectedThreadId,"data-pinned":ue(J.id),onMouseleave:Ue=>pe(J.id)},{left:ot(()=>[w("span",wm,[J.inProgress||J.unread?(_(),S("span",{key:0,class:"thread-status-indicator","data-state":hn(J)},null,8,bm)):ve("",!0),w("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Ue=>Se(J.id)},[Ie(ao,{class:"thread-icon"})],8,_m)])]),right:ot(()=>[w("span",xm,_e(Ge(J.createdAtIso||J.updatedAtIso)),1)]),"right-hover":ot(()=>[w("button",{class:"thread-archive-button","data-confirm":a.value===J.id,type:"button",title:"archive_thread",onClick:Ue=>A(J.id)},[a.value===J.id?(_(),S("span",Am,"confirm")):(_(),at(oo,{key:1,class:"thread-icon"}))],8,Cm)]),default:ot(()=>[w("button",{class:"thread-main-button",type:"button",onClick:Ue=>de(J.id)},[w("span",Tm,[w("span",Sm,_e(J.title),1),J.hasWorktree?(_(),at(io,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ve("",!0)])],8,km)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(_(),at(Jn,{key:1,as:"p",class:"project-empty-row"},{left:ot(()=>[...R[10]||(R[10]=[w("span",{class:"project-empty-spacer"},null,-1)])]),default:ot(()=>[R[11]||(R[11]=w("span",{class:"project-empty"},"No threads",-1))]),_:1})),xr(P)?(_(),at(Jn,{key:2,class:"thread-show-more-row"},{left:ot(()=>[...R[12]||(R[12]=[w("span",{class:"thread-show-more-spacer"},null,-1)])]),default:ot(()=>[w("button",{class:"thread-show-more-button",type:"button",onClick:J=>re(P.projectName)},_e(V(P.projectName)?"Show less":"Show more"),9,Em)]),_:2},1024)):ve("",!0)],12,im))),128))],4))]))}}),$m=Ke(Rm,[["__scopeId","data-v-5bbc0cb5"]]),Mm={class:"content-header"},Pm={class:"content-leading"},Nm={class:"content-title"},Om={class:"content-actions"},jm=Ct({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(_(),S("header",Mm,[w("div",Pm,[un(t.$slots,"leading",{},void 0)]),w("h1",Nm,_e(e.title),1),w("div",Om,[un(t.$slots,"actions",{},void 0)])]))}}),Lm=Ke(jm,[["__scopeId","data-v-66ee223c"]]),Dm={},Bm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Fm(e,t){return _(),S("svg",Bm,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const li=Ke(Dm,[["render",Fm]]),Hm={},Um={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Vm(e,t){return _(),S("svg",Um,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const qm=Ke(Hm,[["render",Vm]]),Wm={class:"conversation-root"},Km={key:0,class:"conversation-loading"},Gm={key:1,class:"conversation-empty"},zm={class:"message-row"},Ym={class:"message-stack"},Jm={class:"request-card"},Qm={class:"request-title"},Xm={class:"request-meta"},Zm={key:0,class:"request-reason"},eg={key:1,class:"request-actions"},tg=["onClick"],ng=["onClick"],rg=["onClick"],sg=["onClick"],og={key:2,class:"request-actions"},ig=["onClick"],ag=["onClick"],lg=["onClick"],cg=["onClick"],ug={key:3,class:"request-user-input"},dg={class:"request-question-title"},fg={key:0,class:"request-question-text"},hg=["value","onChange"],pg=["value"],mg=["value","onInput"],gg=["onClick"],vg={key:4,class:"request-actions"},yg=["onClick"],wg=["onClick"],bg={key:5,class:"request-actions"},_g=["onClick"],kg=["onClick"],Tg=["data-role","data-message-type"],Sg={key:0,class:"message-row","data-role":"system"},xg={class:"message-stack","data-role":"system"},Cg=["onClick"],Ag={class:"cmd-label"},Eg={class:"cmd-status"},Ig={class:"cmd-output-inner"},Rg={class:"cmd-output"},$g=["data-role","data-message-type"],Mg=["data-role"],Pg=["data-role"],Ng=["data-role"],Og=["onClick"],jg=["src"],Lg={key:1,class:"message-file-attachments"},Dg=["title"],Bg=["data-role"],Fg={key:0,class:"worked-separator-wrap","aria-live":"polite"},Hg=["onClick"],Ug={class:"worked-separator-text"},Vg={key:0,class:"worked-details"},qg=["onClick"],Wg={class:"cmd-label"},Kg={class:"cmd-status"},Gg={class:"cmd-output-inner"},zg={class:"cmd-output"},Yg={key:1,class:"message-text-flow"},Jg={key:0,class:"message-text"},Qg={key:0},Xg={key:2,class:"message-inline-code"},Zg={key:1,class:"message-text"},ev=["onClick"],tv=["src","alt","onError"],nv=["onClick"],rv={key:0,class:"conversation-item conversation-item-overlay"},sv={class:"message-row"},ov={class:"message-stack"},iv={class:"live-overlay-inline","aria-live":"polite"},av={class:"live-overlay-label"},lv={key:0,class:"live-overlay-reasoning"},cv={key:1,class:"live-overlay-error"},uv=["src"],dv=16,fv=Ct({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=D(new Set),r=D(new Set),s=D(new Set),o=D({});function i(m){return m.messageType==="commandExecution"&&!!m.commandExecution}function a(m){var C;return((C=m.commandExecution)==null?void 0:C.status)==="inProgress"||r.value.has(m.id)?!0:n.value.has(m.id)}function l(m){return r.value.has(m.id)}function d(m){var I;if(((I=m.commandExecution)==null?void 0:I.status)==="inProgress")return;const C=new Set(n.value);C.has(m.id)?C.delete(m.id):C.add(m.id),n.value=C}function u(m){const C=new Set(s.value);C.has(m.id)?C.delete(m.id):C.add(m.id),s.value=C}function f(m){return s.value.has(m.id)}function g(m){const C=m.commandExecution;if(!C)return"";switch(C.status){case"inProgress":return"⟳ Running";case"completed":return C.exitCode===0?"✓ Completed":`✗ Exit ${C.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function b(m){var I,G;const C=(I=m.commandExecution)==null?void 0:I.status;return C==="inProgress"?"cmd-status-running":C==="completed"&&((G=m.commandExecution)==null?void 0:G.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function $(m){const C=new Set(r.value);C.add(m),r.value=C,setTimeout(()=>{const I=new Set(r.value);I.delete(m),r.value=I},1e3)}function E(m,C){const I=[];for(let G=C-1;G>=0;G--){const se=m[G];if(se.messageType==="commandExecution")I.unshift(se);else if(se.role==="user"||se.messageType==="worked")break}return I}const B=e,W=t,M=D(null),U=D(null),F=D(""),ae=D({}),ie=D({});let le=0,fe=0,oe=0;const Z=new WeakSet,he=D(new Set);function ee(m){if(!m||/\s/u.test(m)||m.endsWith("/")||m.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(m))return!1;const C=m.startsWith("/"),I=/^[A-Za-z]:[\\/]/u.test(m),G=m.startsWith("./")||m.startsWith("../")||m.startsWith("~/"),se=m.includes("/")||m.includes("\\");return C||I||G||se}function Oe(m){return m.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||m}function qe(m){if(!m)return null;let C=m,I=null;const G=C.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(G)C=G[1],I=Number(G[2]);else{const se=C.match(/^(.*):(\d+)(?::\d+)?$/u);se&&(C=se[1],I=Number(se[2]))}return ee(C)?{path:C,line:I}:null}function rt(m){if(!m.includes("`"))return[{kind:"text",value:m}];const C=[];let I=0,G=0;for(;I<m.length;){if(m[I]!=="`"){I+=1;continue}let se=1;for(;I+se<m.length&&m[I+se]==="`";)se+=1;const Ce="`".repeat(se);let Xe=I+se,ze=-1;for(;Xe<m.length;){const ft=m.indexOf(Ce,Xe);if(ft<0)break;const Lt=ft>0&&m[ft-1]==="`",Jt=ft+se<m.length&&m[ft+se]==="`",Tt=m.slice(I+se,ft).includes(`
26
+ `);if(!Lt&&!Jt&&!Tt){ze=ft;break}Xe=ft+1}if(ze<0){I+=se;continue}I>G&&C.push({kind:"text",value:m.slice(G,I)});const Ze=m.slice(I+se,ze);if(Ze.length>0){const ft=qe(Ze);if(ft){const Lt=Oe(ft.path),Jt=ft.line?`${Lt} (line ${String(ft.line)})`:Lt;C.push({kind:"file",value:Ze,displayName:Jt})}else C.push({kind:"code",value:Ze})}else C.push({kind:"text",value:`${Ce}${Ce}`});I=ze+se,G=I}return G<m.length&&C.push({kind:"text",value:m.slice(G)}),C}function Ne(m){const C=m.trim();if(!C)return"";if(C.startsWith("data:")||C.startsWith("blob:")||C.startsWith("http://")||C.startsWith("https://")||C.startsWith("/codex-local-image?"))return C;if(C.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(C)}`;const I=C.startsWith("/"),G=/^[A-Za-z]:[\\/]/u.test(C);return I||G?`/codex-local-image?path=${encodeURIComponent(C)}`:C}function Te(m){if(!m.includes("![")||!m.includes("]("))return[{kind:"text",value:m}];const C=[],I=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let G=0;for(const se of m.matchAll(I)){const[Ce,Xe,ze]=se;if(typeof se.index!="number")continue;const Ze=se.index,ft=Ze+Ce.length,Lt=Ne(ze.trim());Lt&&(Ze>G&&C.push({kind:"text",value:m.slice(G,Ze)}),C.push({kind:"image",url:Lt,alt:Xe.trim(),markdown:Ce}),G=ft)}return G<m.length&&C.push({kind:"text",value:m.slice(G)}),C.length>0?C:[{kind:"text",value:m}]}function Ae(m){return m!==null&&typeof m=="object"&&!Array.isArray(m)?m:null}function ht(m){const C=new Date(m);return Number.isNaN(C.getTime())?m:C.toLocaleTimeString()}function it(m){const C=Ae(m.params),I=C==null?void 0:C.reason;return typeof I=="string"?I.trim():""}function Qe(m,C){return`${String(m)}:${C}`}function Ye(m){const C=Ae(m.params),I=Array.isArray(C==null?void 0:C.questions)?C.questions:[],G=[];for(const se of I){const Ce=Ae(se);if(!Ce)continue;const Xe=typeof Ce.id=="string"?Ce.id:"";if(!Xe)continue;const ze=Array.isArray(Ce.options)?Ce.options.map(Ze=>Ae(Ze)).map(Ze=>Ze==null?void 0:Ze.label).filter(Ze=>typeof Ze=="string"&&Ze.length>0):[];G.push({id:Xe,header:typeof Ce.header=="string"?Ce.header:"",question:typeof Ce.question=="string"?Ce.question:"",isOther:Ce.isOther===!0,options:ze})}return G}function Ge(m,C,I){const G=Qe(m,C),se=ae.value[G];return typeof se=="string"&&se.length>0?se:I}function ue(m,C){const I=Qe(m,C);return ie.value[I]??""}function Se(m,C,I){const G=I.target;if(!(G instanceof HTMLSelectElement))return;const se=Qe(m,C);ae.value={...ae.value,[se]:G.value}}function de(m,C,I){const G=I.target;if(!(G instanceof HTMLInputElement))return;const se=Qe(m,C);ie.value={...ie.value,[se]:G.value}}function A(m,C){W("respondServerRequest",{id:m,result:{decision:C}})}function X(m){const C=Ye(m),I={};for(const G of C){const se=Ge(m.id,G.id,G.options[0]||""),Ce=ue(m.id,G.id).trim(),Xe=[se,Ce].map(ze=>ze.trim()).filter(ze=>ze.length>0);I[G.id]={answers:Xe}}W("respondServerRequest",{id:m.id,result:{answers:I}})}function Q(m){W("respondServerRequest",{id:m,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function pe(m){W("respondServerRequest",{id:m,result:{success:!0,contentItems:[]}})}function ke(m){W("respondServerRequest",{id:m,result:{}})}function p(m){W("respondServerRequest",{id:m,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function y(m){return!(m.role!=="user"&&m.role!=="assistant"||typeof m.turnIndex!="number"||B.isTurnInProgress||B.isRollingBack)}function x(m){y(m)&&W("rollback",{turnIndex:m.turnIndex})}function O(){const m=M.value,C=U.value;!m||!C||(m.scrollTop=m.scrollHeight,C.scrollIntoView({block:"end"}))}function H(m){return m.scrollHeight-(m.scrollTop+m.clientHeight)<=dv}function N(m){if(!B.activeThreadId)return;const C=Math.max(m.scrollHeight-m.clientHeight,0),I=C>0?Math.min(Math.max(m.scrollTop/C,0),1):1;W("updateScrollState",{threadId:B.activeThreadId,state:{scrollTop:m.scrollTop,isAtBottom:H(m),scrollRatio:I}})}function ne(){const m=M.value;if(!m)return;const C=B.scrollState;if(!C||C.isAtBottom){te();return}const I=Math.max(m.scrollHeight-m.clientHeight,0),G=typeof C.scrollRatio=="number"?C.scrollRatio*I:C.scrollTop;m.scrollTop=Math.min(Math.max(G,0),I),N(m)}function te(){const m=M.value;m&&(O(),N(m))}function Y(){const m=B.scrollState;return!m||m.isAtBottom===!0}function V(){if(!Y()){oe=0,fe=0;return}if(te(),oe-=1,oe<=0){fe=0;return}fe=requestAnimationFrame(V)}function me(m=6){Y()&&(fe&&(cancelAnimationFrame(fe),fe=0),oe=Math.max(m,1),fe=requestAnimationFrame(V))}function re(){me(3)}function be(){if(!Y())return;const m=M.value;if(!m)return;const C=m.querySelectorAll("img.message-image-preview");for(const I of C)I.complete||Z.has(I)||(Z.add(I),I.addEventListener("load",re,{once:!0}),I.addEventListener("error",re,{once:!0}))}async function xe(){await zt(),le&&cancelAnimationFrame(le),le=requestAnimationFrame(()=>{le=0,ne(),be(),me()})}pt(()=>B.messages,async m=>{if(!B.isLoading){for(const C of m){if(C.messageType!=="commandExecution"||!C.commandExecution)continue;const I=o.value[C.id],G=C.commandExecution.status;I==="inProgress"&&G!=="inProgress"&&$(C.id),o.value[C.id]=G}await xe()}}),pt(()=>B.liveOverlay,async m=>{m&&(await zt(),te(),me(8))},{deep:!0}),pt(()=>B.isLoading,async m=>{m||await xe()}),pt(()=>B.activeThreadId,()=>{F.value="",he.value=new Set},{flush:"post"});function je(){const m=M.value;!m||B.isLoading||N(m)}function Ve(m){F.value=Ne(m)}function $e(m,C){return`${m}:${String(C)}`}function st(m,C){const I=new Set(he.value);I.add($e(m,C)),he.value=I}function L(m,C){return he.value.has($e(m,C))}function z(){F.value=""}return Un(()=>{le&&cancelAnimationFrame(le),fe&&cancelAnimationFrame(fe)}),(m,C)=>(_(),S("section",Wm,[e.isLoading?(_(),S("p",Km,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(_(),S("p",Gm," No messages in this thread yet. ")):(_(),S("ul",{key:2,ref_key:"conversationListRef",ref:M,class:"conversation-list",onScroll:je},[(_(!0),S(De,null,mt(e.pendingRequests,I=>(_(),S("li",{key:`server-request:${I.id}`,class:"conversation-item conversation-item-request"},[w("div",zm,[w("div",Ym,[w("article",Jm,[w("p",Qm,_e(I.method),1),w("p",Xm,"Request #"+_e(I.id)+" · "+_e(ht(I.receivedAtIso)),1),it(I)?(_(),S("p",Zm,_e(it(I)),1)):ve("",!0),I.method==="item/commandExecution/requestApproval"?(_(),S("section",eg,[w("button",{type:"button",class:"request-button request-button-primary",onClick:G=>A(I.id,"accept")},"Accept",8,tg),w("button",{type:"button",class:"request-button",onClick:G=>A(I.id,"acceptForSession")},"Accept for Session",8,ng),w("button",{type:"button",class:"request-button",onClick:G=>A(I.id,"decline")},"Decline",8,rg),w("button",{type:"button",class:"request-button",onClick:G=>A(I.id,"cancel")},"Cancel",8,sg)])):I.method==="item/fileChange/requestApproval"?(_(),S("section",og,[w("button",{type:"button",class:"request-button request-button-primary",onClick:G=>A(I.id,"accept")},"Accept",8,ig),w("button",{type:"button",class:"request-button",onClick:G=>A(I.id,"acceptForSession")},"Accept for Session",8,ag),w("button",{type:"button",class:"request-button",onClick:G=>A(I.id,"decline")},"Decline",8,lg),w("button",{type:"button",class:"request-button",onClick:G=>A(I.id,"cancel")},"Cancel",8,cg)])):I.method==="item/tool/requestUserInput"?(_(),S("section",ug,[(_(!0),S(De,null,mt(Ye(I),G=>(_(),S("div",{key:`${I.id}:${G.id}`,class:"request-question"},[w("p",dg,_e(G.header||G.question),1),G.header&&G.question?(_(),S("p",fg,_e(G.question),1)):ve("",!0),w("select",{class:"request-select",value:Ge(I.id,G.id,G.options[0]||""),onChange:se=>Se(I.id,G.id,se)},[(_(!0),S(De,null,mt(G.options,se=>(_(),S("option",{key:`${I.id}:${G.id}:${se}`,value:se},_e(se),9,pg))),128))],40,hg),G.isOther?(_(),S("input",{key:1,class:"request-input",type:"text",value:ue(I.id,G.id),placeholder:"Other answer",onInput:se=>de(I.id,G.id,se)},null,40,mg)):ve("",!0)]))),128)),w("button",{type:"button",class:"request-button request-button-primary",onClick:G=>X(I)}," Submit Answers ",8,gg)])):I.method==="item/tool/call"?(_(),S("section",vg,[w("button",{type:"button",class:"request-button request-button-primary",onClick:G=>Q(I.id)},"Fail Tool Call",8,yg),w("button",{type:"button",class:"request-button",onClick:G=>pe(I.id)},"Success (Empty)",8,wg)])):(_(),S("section",bg,[w("button",{type:"button",class:"request-button request-button-primary",onClick:G=>ke(I.id)},"Return Empty Result",8,_g),w("button",{type:"button",class:"request-button",onClick:G=>p(I.id)},"Reject Request",8,kg)]))])])])]))),128)),(_(!0),S(De,null,mt(e.messages,I=>{var G,se;return _(),S("li",{key:I.id,class:ut(["conversation-item",{"conversation-item-rollbackable":y(I)}]),"data-role":I.role,"data-message-type":I.messageType||""},[i(I)?(_(),S("div",Sg,[w("div",xg,[w("button",{type:"button",class:ut(["cmd-row",[b(I),{"cmd-expanded":a(I)}]]),onClick:Ce=>d(I)},[w("span",{class:ut(["cmd-chevron",{"cmd-chevron-open":a(I)}])},"▶",2),w("code",Ag,_e(((G=I.commandExecution)==null?void 0:G.command)||"(command)"),1),w("span",Eg,_e(g(I)),1)],10,Cg),w("div",{class:ut(["cmd-output-wrap",{"cmd-output-visible":a(I),"cmd-output-collapsing":l(I)}])},[w("div",Ig,[w("pre",Rg,_e(((se=I.commandExecution)==null?void 0:se.aggregatedOutput)||"(no output)"),1)])],2)])])):(_(),S("div",{key:1,class:"message-row","data-role":I.role,"data-message-type":I.messageType||""},[w("div",{class:"message-stack","data-role":I.role},[w("article",{class:"message-body","data-role":I.role},[I.images&&I.images.length>0?(_(),S("ul",{key:0,class:"message-image-list","data-role":I.role},[(_(!0),S(De,null,mt(I.images,Ce=>(_(),S("li",{key:Ce,class:"message-image-item"},[w("button",{class:"message-image-button",type:"button",onClick:Xe=>Ve(Ce)},[w("img",{class:"message-image-preview",src:Ne(Ce),alt:"Message image preview",loading:"lazy"},null,8,jg)],8,Og)]))),128))],8,Ng)):ve("",!0),I.fileAttachments&&I.fileAttachments.length>0?(_(),S("div",Lg,[(_(!0),S(De,null,mt(I.fileAttachments,Ce=>(_(),S("span",{key:Ce.path,class:"message-file-chip"},[C[2]||(C[2]=w("span",{class:"message-file-chip-icon"},"📄",-1)),w("span",{class:"message-file-chip-name",title:Ce.path},_e(Ce.label),9,Dg)]))),128))])):ve("",!0),I.text.length>0?(_(),S("article",{key:2,class:"message-card","data-role":I.role},[I.messageType==="worked"?(_(),S("div",Fg,[w("button",{type:"button",class:"worked-separator",onClick:Ce=>u(I)},[C[3]||(C[3]=w("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),w("span",{class:ut(["worked-chevron",{"worked-chevron-open":f(I)}])},"▶",2),w("p",Ug,_e(I.text),1),C[4]||(C[4]=w("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Hg),f(I)?(_(),S("div",Vg,[(_(!0),S(De,null,mt(E(e.messages,e.messages.indexOf(I)),Ce=>{var Xe,ze;return _(),S("div",{key:`worked-cmd-${Ce.id}`,class:"worked-cmd-item"},[w("button",{type:"button",class:ut(["cmd-row",[b(Ce),{"cmd-expanded":a(Ce)}]]),onClick:Ze=>d(Ce)},[w("span",{class:ut(["cmd-chevron",{"cmd-chevron-open":a(Ce)}])},"▶",2),w("code",Wg,_e(((Xe=Ce.commandExecution)==null?void 0:Xe.command)||"(command)"),1),w("span",Kg,_e(g(Ce)),1)],10,qg),w("div",{class:ut(["cmd-output-wrap",{"cmd-output-visible":a(Ce),"cmd-output-collapsing":l(Ce)}])},[w("div",Gg,[w("pre",zg,_e(((ze=Ce.commandExecution)==null?void 0:ze.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):ve("",!0)])):(_(),S("div",Yg,[(_(!0),S(De,null,mt(Te(I.text),(Ce,Xe)=>(_(),S(De,{key:`block-${Xe}`},[Ce.kind==="text"?(_(),S("p",Jg,[(_(!0),S(De,null,mt(rt(Ce.value),(ze,Ze)=>(_(),S(De,{key:`seg-${Xe}-${Ze}`},[ze.kind==="text"?(_(),S("span",Qg,_e(ze.value),1)):ze.kind==="file"?(_(),S("a",{key:1,class:"message-file-link",href:"#",onClick:C[0]||(C[0]=dt(()=>{},["prevent"]))},_e(ze.displayName),1)):(_(),S("code",Xg,_e(ze.value),1))],64))),128))])):L(I.id,Xe)?(_(),S("p",Zg,_e(Ce.markdown),1)):(_(),S("button",{key:2,class:"message-image-button",type:"button",onClick:ze=>Ve(Ce.url)},[w("img",{class:"message-image-preview message-markdown-image",src:Ce.url,alt:Ce.alt||"Embedded message image",loading:"lazy",onError:ze=>st(I.id,Xe)},null,40,tv)],8,ev))],64))),128))]))],8,Bg)):ve("",!0)],8,Pg),y(I)?(_(),S("button",{key:0,class:"rollback-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:Ce=>x(I)},[Ie(qm,{class:"rollback-icon"}),C[5]||(C[5]=w("span",{class:"rollback-label"},"Rollback",-1))],8,nv)):ve("",!0)],8,Mg)],8,$g))],10,Tg)}),128)),e.liveOverlay?(_(),S("li",rv,[w("div",sv,[w("div",ov,[w("article",iv,[w("p",av,_e(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(_(),S("p",lv,_e(e.liveOverlay.reasoningText),1)):ve("",!0),e.liveOverlay.errorText?(_(),S("p",cv,_e(e.liveOverlay.errorText),1)):ve("",!0)])])])])):ve("",!0),w("li",{ref_key:"bottomAnchorRef",ref:U,class:"conversation-bottom-anchor"},null,512)],544)),F.value.length>0?(_(),S("div",{key:3,class:"image-modal-backdrop",onClick:z},[w("div",{class:"image-modal-content",onClick:C[1]||(C[1]=dt(()=>{},["stop"]))},[w("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:z},[Ie(li,{class:"icon-svg"})]),w("img",{class:"image-modal-image",src:F.value,alt:"Expanded message image"},null,8,uv)])])):ve("",!0)]))}}),hv=Ke(fv,[["__scopeId","data-v-857238be"]]);function pv(e){var u;const t=D("idle"),n=D(typeof navigator<"u"&&!!((u=navigator.mediaDevices)!=null&&u.getUserMedia));let r=null,s=null,o=[];async function i(){var f;if(!(t.value!=="idle"||!n.value))try{s=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),o=[],r=new MediaRecorder(s),r.ondataavailable=g=>{g.data.size>0&&o.push(g.data)},r.onstop=()=>{var $;const g=o,b=(r==null?void 0:r.mimeType)||(($=g[0])==null?void 0:$.type)||"audio/webm";d(),t.value="idle",l(g,b)},r.start(),t.value="recording"}catch(g){d(),(f=e.onError)==null||f.call(e,g)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,g){var $;if(f.length===0)return;const b=new Blob(f,{type:g});try{const E=g.split(/[/;]/)[1]??"webm",B=`----codex-transcribe-${crypto.randomUUID()}`,W=new Uint8Array(await b.arrayBuffer()),M=new TextEncoder,U=[];U.push(M.encode(`--${B}\r
27
+ `)),U.push(M.encode(`Content-Disposition: form-data; name="file"; filename="codex.${E}"\r
28
+ `)),U.push(M.encode(`Content-Type: ${g}\r
29
+ \r
30
+ `)),U.push(W),U.push(M.encode(`\r
31
+ --${B}--\r
32
+ `));let F=0;for(const Z of U)F+=Z.byteLength;const ae=new Uint8Array(F);let ie=0;for(const Z of U)ae.set(Z,ie),ie+=Z.byteLength;const le=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${B}`},body:ae});if(!le.ok)throw new Error(`Transcription failed: ${le.status}`);const oe=((await le.json()).text??"").trim();oe.length>0&&e.onTranscript(oe)}catch(E){($=e.onError)==null||$.call(e,E)}finally{t.value!=="recording"&&(t.value="idle")}}function d(){r&&(r.ondataavailable=null,r.onstop=null,r=null),s&&(s.getTracks().forEach(f=>f.stop()),s=null),o=[]}return Un(d),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Na(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class kn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function ci(e,t){const n=Na(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Na(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function Tr(e,t,n){return e instanceof kn?e:e instanceof Error?new kn(e.message||t,{code:"unknown_error",method:n}):new kn(t,{code:"unknown_error",method:n})}function Ac(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function mv(e,t){const n={method:e,params:t??null};let r;try{r=await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(i){throw new kn(i instanceof Error?i.message:`RPC ${e} failed before request was sent`,{code:"network_error",method:e})}let s=null;try{s=await r.json()}catch{s=null}if(!r.ok)throw new kn(ci(s,`RPC ${e} failed with HTTP ${r.status}`),{code:"http_error",method:e,status:r.status});const o=s;if(!o||typeof o!="object"||!("result"in o))throw new kn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Oa(e){const t=Ac(e);if(!t||typeof t.method!="string"||t.method.length===0)return null;const n=typeof t.atIso=="string"&&t.atIso.length>0?t.atIso:new Date().toISOString();return{method:t.method,params:t.params??null,atIso:n}}function gv(e){if(typeof window>"u")return()=>{};let t=null,n=!1;const r=()=>{if(typeof EventSource>"u"||n)return;const s=new EventSource("/codex-api/events");s.onmessage=o=>{try{const i=JSON.parse(o.data),a=Oa(i);a&&e(a)}catch{}},t=()=>s.close()};if(typeof WebSocket<"u"){const s=window.location.protocol==="https:"?"wss:":"ws:",o=new WebSocket(`${s}//${window.location.host}/codex-api/ws`);let i=!1,a=window.setTimeout(()=>{i||n||(o.close(),r())},2500);o.onopen=()=>{i=!0,a!==null&&(window.clearTimeout(a),a=null)},o.onmessage=l=>{try{const d=JSON.parse(String(l.data)),u=Oa(d);u&&e(u)}catch{}},o.onerror=()=>{!i&&!n&&r()},o.onclose=()=>{a!==null&&(window.clearTimeout(a),a=null),!i&&!n&&r()},t=()=>o.close()}else r();return()=>{n=!0,t==null||t()}}async function vv(e){let t;try{t=await fetch("/codex-api/server-requests/respond",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(r){throw new kn(r instanceof Error?r.message:"Failed to reply to server request",{code:"network_error",method:"server-requests/respond"})}let n=null;try{n=await t.json()}catch{n=null}if(!t.ok)throw new kn(ci(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function yv(){const e=await fetch("/codex-api/server-requests/pending");let t=null;try{t=await e.json()}catch{t=null}if(!e.ok)throw new kn(ci(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Ac(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function ja(e){return new Date(e*1e3).toISOString()}function wv(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function bv(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const _v=/^##\s+(.+?):\s+(.+?)\s*$/,kv=/^#\s*files mentioned by the user\s*:?\s*$/i;function Tv(e){var s,o;const t=e.split(`
33
+ `).findIndex(i=>kv.test(i.trim()));if(t<0)return[];const n=e.split(`
34
+ `).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(_v);if(!l)break;const d=(s=l[1])==null?void 0:s.trim(),u=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");d&&u&&r.push({label:d,path:u})}return r}function Sv(e){const t=/(?:^|\n)\s{0,3}#{0,6}\s*my request for codex\s*:?\s*/giu,n=Array.from(e.matchAll(t));if(n.length===0)return e.trim();const r=n.at(-1);if(!r||typeof r.index!="number")return e.trim();const s=r.index+r[0].length;return e.slice(s).trim()}function xv(e,t){if(!Array.isArray(t))return{text:"",images:[],fileAttachments:[],rawBlocks:[]};const n=[],r=[],s=[];for(const[a,l]of t.entries())l.type==="text"&&typeof l.text=="string"&&l.text.length>0&&n.push(l.text),l.type==="image"&&typeof l.url=="string"&&l.url.trim().length>0&&r.push(l.url.trim()),l.type!=="text"&&l.type!=="image"&&s.push({id:`${e}:user-content:${a}`,role:"user",text:"",messageType:`userContent.${l.type}`,rawPayload:bv(l),isUnhandled:!0});const o=n.join(`
35
+ `),i=Tv(o);return{text:Sv(o),images:r,fileAttachments:i,rawBlocks:s}}function Cv(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=xv(e.id,e.content),n=[];return(t.text.length>0||t.images.length>0||t.fileAttachments.length>0)&&n.push({id:e.id,role:"user",text:t.text,images:t.images,fileAttachments:t.fileAttachments.length>0?t.fileAttachments:void 0,messageType:e.type}),n.push(...t.rawBlocks),n.length===0?[]:n}if(e.type==="reasoning")return[];if(e.type==="commandExecution"){const t=e,n=Av(t.status),r=typeof t.command=="string"?t.command:"",s=typeof t.cwd=="string"?t.cwd:null,o=typeof t.aggregatedOutput=="string"?t.aggregatedOutput:"",i=typeof t.exitCode=="number"?t.exitCode:null;return[{id:e.id,role:"system",text:r,messageType:"commandExecution",commandExecution:{command:r,cwd:s,status:n,aggregatedOutput:o,exitCode:i}}]}return[]}function Av(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Ev(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Iv(e){const t=Ev(e);return t.length>0?t:"Untitled thread"}function Rv(e){const t=e,n=typeof t.cwd=="string"?t.cwd:e.cwd,r=t.isWorktree===!0||t.worktree===!0||t.worktreeId!==void 0||t.worktreePath!==void 0||n.includes("/.codex/worktrees/")||n.includes("/.git/worktrees/");return{id:e.id,title:Iv(e),projectName:wv(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:ja(e.createdAt),updatedAtIso:ja(e.updatedAt),preview:e.preview,unread:!1,inProgress:!1}}function $v(e){const t=new Map;for(const n of e){const r=t.get(n.projectName);r?r.push(n):t.set(n.projectName,[n])}return Array.from(t.entries()).map(([n,r])=>({projectName:n,threads:r.sort((s,o)=>new Date(o.updatedAtIso).getTime()-new Date(s.updatedAtIso).getTime())})).sort((n,r)=>{var i,a;const s=new Date(((i=n.threads[0])==null?void 0:i.updatedAtIso)??0).getTime();return new Date(((a=r.threads[0])==null?void 0:a.updatedAtIso)??0).getTime()-s})}function Mv(e){const t=e.data.map(Rv);return $v(t)}function Ec(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const s=t[r],o=Array.isArray(s.items)?s.items:[];for(const i of o)for(const a of Cv(i))n.push({...a,turnIndex:r})}return n}async function Vt(e,t){try{return await mv(e,t)}catch(n){throw Tr(n,`RPC ${e} failed`,e)}}function Pv(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Nv(){const e=await Vt("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return Mv(e)}async function Ov(e){const t=await Vt("thread/read",{threadId:e,includeTurns:!0});return Ec(t)}async function jv(){try{return await Nv()}catch(e){throw Tr(e,"Failed to load thread groups","thread/list")}}async function Lv(e){try{return await Ov(e)}catch(t){throw Tr(t,`Failed to load thread ${e}`,"thread/read")}}function Dv(e){return gv(e)}async function Bv(e,t){await vv({id:e,...t})}async function Fv(){return yv()}async function lo(e){await Vt("thread/resume",{threadId:e})}async function Hv(e){await Vt("thread/archive",{threadId:e})}async function La(e,t){const n=await Vt("thread/rollback",{threadId:e,numTurns:t});return Ec(n)}function Uv(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const r=n.id;if(typeof r=="string"&&r.length>0)return r}return""}async function Da(e,t){try{const n={};typeof e=="string"&&e.trim().length>0&&(n.cwd=e.trim()),typeof t=="string"&&t.trim().length>0&&(n.model=t.trim());const r=await Vt("thread/start",n),s=Uv(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw Tr(n,"Failed to start a new thread","thread/start")}}function Vv(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
36
+ `;for(const r of t)n+=`
37
+ ## ${r.label}: ${r.path}
38
+ `;return`${n}
39
+ ## My request for Codex:
40
+
41
+ ${e}
42
+ `}async function co(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:Vv(t,i)}];for(const f of n){const g=f.trim();g&&l.push({type:"image",url:g,image_url:g})}if(o)for(const f of o)l.push({type:"skill",name:f.name,path:f.path});const d=i.map(f=>({label:f.label,path:f.path,fsPath:f.fsPath})),u={threadId:e,input:l};d.length>0&&(u.attachments=d),typeof r=="string"&&r.length>0&&(u.model=r),typeof s=="string"&&s.length>0&&(u.effort=s),await Vt("turn/start",u)}catch(a){throw Tr(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function qv(e,t){const n=e.trim(),r=(t==null?void 0:t.trim())||"";if(n)try{if(!r)throw new Error("turn/interrupt requires turnId");await Vt("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw Tr(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function Wv(e){await Vt("setDefaultModel",{model:e})}async function Kv(){const e=await Vt("model/list",{}),t=[];for(const n of e.data){const r=n.id||n.model;!r||t.includes(r)||t.push(r)}return t}async function Gv(){const e=await Vt("config/read",{}),t=e.config.model??"",n=Pv(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function zv(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=o=>{if(!Array.isArray(o))return[];const i=[];for(const a of o)typeof a=="string"&&a.length>0&&!i.includes(a)&&i.push(a);return i},r=t.labels,s={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[o,i]of Object.entries(r))typeof o=="string"&&o.length>0&&typeof i=="string"&&(s[o]=i);return{order:n(t.order),labels:s,active:n(t.active)}}async function Ba(){const e=await fetch("/codex-api/workspace-roots-state"),t=await e.json();if(!e.ok)throw new Error("Failed to load workspace roots state");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return zv(n.data)}async function Fa(){const e=await fetch("/codex-api/home-directory"),t=await e.json();if(!e.ok)throw new Error("Failed to load home directory");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return typeof r.path=="string"?r.path.trim():""}async function Yv(e){if(!(await fetch("/codex-api/workspace-roots-state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save workspace roots state")}async function Jv(e,t){const n=await fetch("/codex-api/project-root",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,createIfMissing:(t==null?void 0:t.createIfMissing)===!0,label:(t==null?void 0:t.label)??""})}),r=await n.json();if(!n.ok){const a=ui(r,"Failed to open project root");throw new Error(a)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return typeof o.path=="string"?o.path.trim():""}async function Qv(e){const t=new URLSearchParams({basePath:e}),n=await fetch(`/codex-api/project-root-suggestion?${t.toString()}`),r=await n.json();if(!n.ok){const i=ui(r,"Failed to suggest project name");throw new Error(i)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return{name:typeof o.name=="string"?o.name.trim():"",path:typeof o.path=="string"?o.path.trim():""}}async function Xv(e,t,n=20){const r=e.trim();if(!r)return[];const s=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:t.trim(),limit:n})}),o=await s.json();if(!s.ok){const d=ui(o,"Failed to search files");throw new Error(d)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const d of a){if(!d||typeof d!="object"||Array.isArray(d))continue;const f=d.path,g=typeof f=="string"?f.trim():"";g&&l.push({path:g})}return l}function ui(e,t){const r=(e&&typeof e=="object"&&!Array.isArray(e)?e:{}).error;return typeof r=="string"&&r.trim().length>0?r:t}async function Zv(){try{const e=await fetch("/codex-api/thread-titles");return e.ok?(await e.json()).data??{titles:{},order:[]}:{titles:{},order:[]}}catch{return{titles:{},order:[]}}}async function Ha(e,t){try{await fetch("/codex-api/thread-titles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,title:t})})}catch{}}async function ey(e,t){var n;try{return((n=(await Vt("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function ty(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await Vt("skills/list",t),r=[],s=new Set;for(const o of n.data)for(const i of o.skills)!i.name||s.has(i.path)||(s.add(i.path),r.push({name:i.name,description:i.shortDescription||i.description||"",path:i.path,scope:i.scope,enabled:i.enabled}));return r}catch{return[]}}async function ny(e){try{const t=new FormData;t.append("file",e);const n=await fetch("/codex-api/upload-file",{method:"POST",body:t});return n.ok?(await n.json()).path??null:null}catch{return null}}const ry={},sy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function oy(e,t){return _(),S("svg",sy,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 5l0 14m-6-8l6-6l6 6"},null,-1)])])}const iy=Ke(ry,[["render",oy]]),ay={},ly={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function cy(e,t){return _(),S("svg",ly,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 2m0 3a3 3 0 0 1 3-3h0a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h0a3 3 0 0 1-3-3zM5 10a7 7 0 0 0 14 0M8 21h8M12 17v4"},null,-1)])])}const uy=Ke(ay,[["render",cy]]),dy={},fy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function hy(e,t){return _(),S("svg",fy,[...t[0]||(t[0]=[w("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),w("path",{fill:"currentColor",d:"M8 5a3 3 0 0 0 -3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3 -3v-8a3 3 0 0 0 -3 -3h-8z"},null,-1)])])}const py=Ke(dy,[["render",hy]]),my=["disabled"],gy={class:"composer-dropdown-value"},vy={class:"composer-dropdown-menu"},yy={key:0,class:"composer-dropdown-search-wrap"},wy=["placeholder","onKeydown"],by={class:"composer-dropdown-options",role:"listbox"},_y=["onClick"],ky={key:0,class:"composer-dropdown-empty"},Ty={key:1,class:"composer-dropdown-add-wrap"},Sy=["placeholder","onKeydown"],xy=Ct({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(null),a=D(!1),l=D(""),d=D(!1),u=D(""),f=ce(()=>{var he;const Z=n.options.find(ee=>ee.value===n.modelValue);return Z?Z.label:((he=n.placeholder)==null?void 0:he.trim())||""}),g=ce(()=>n.openDirection??"down"),b=ce(()=>n.enableSearch===!0),$=ce(()=>n.showAddAction===!0),E=ce(()=>{var Z;return((Z=n.searchPlaceholder)==null?void 0:Z.trim())||"Quick search projects"}),B=ce(()=>{var Z;return((Z=n.addActionLabel)==null?void 0:Z.trim())||"Add new project"}),W=ce(()=>{var Z;return((Z=n.addPlaceholder)==null?void 0:Z.trim())||"Project name or absolute path"}),M=ce(()=>{const Z=l.value.trim().toLowerCase();return Z?n.options.filter(he=>he.label.toLowerCase().includes(Z)||he.value.toLowerCase().includes(Z)):n.options});function U(){n.disabled||(a.value=!a.value)}function F(Z){r("update:modelValue",Z),a.value=!1,l.value=""}function ae(){var Z;d.value=!0,u.value=((Z=n.defaultAddValue)==null?void 0:Z.trim())||"",zt(()=>{var he;return(he=i.value)==null?void 0:he.focus()})}function ie(){if(l.value.length>0){l.value="";return}a.value=!1}function le(){const Z=u.value.trim();Z&&(r("add",Z),d.value=!1,u.value="",a.value=!1,l.value="")}function fe(){d.value=!1,u.value="",zt(()=>{var Z;return(Z=o.value)==null?void 0:Z.focus()})}function oe(Z){if(!a.value)return;const he=s.value;if(!he)return;const ee=Z.target;ee instanceof Node&&(he.contains(ee)||(a.value=!1,l.value="",d.value=!1,u.value=""))}return pt(a,Z=>{if(!Z){d.value=!1,u.value="";return}b.value&&zt(()=>{var he;return(he=o.value)==null?void 0:he.focus()})}),Hn(()=>{window.addEventListener("pointerdown",oe)}),Un(()=>{window.removeEventListener("pointerdown",oe)}),(Z,he)=>(_(),S("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[w("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:U},[w("span",gy,_e(f.value),1),Ie(ai,{class:"composer-dropdown-chevron"})],8,my),a.value?(_(),S("div",{key:0,class:ut(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":g.value==="up","composer-dropdown-menu-wrap-down":g.value==="down"}])},[w("div",vy,[b.value?(_(),S("div",yy,[Ln(w("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":he[0]||(he[0]=ee=>l.value=ee),class:"composer-dropdown-search-input",type:"text",placeholder:E.value,onKeydown:Ut(dt(ie,["prevent"]),["esc"])},null,40,wy),[[Bn,l.value]])])):ve("",!0),w("ul",by,[(_(!0),S(De,null,mt(M.value,ee=>(_(),S("li",{key:ee.value},[w("button",{class:ut(["composer-dropdown-option",{"is-selected":ee.value===e.modelValue}]),type:"button",onClick:Oe=>F(ee.value)},_e(ee.label),11,_y)]))),128)),M.value.length===0?(_(),S("li",ky," No matching projects ")):ve("",!0)]),$.value?(_(),S("div",Ty,[d.value?(_(),S(De,{key:0},[Ln(w("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":he[1]||(he[1]=ee=>u.value=ee),class:"composer-dropdown-add-input",type:"text",placeholder:W.value,onKeydown:[Ut(dt(le,["prevent"]),["enter"]),Ut(dt(fe,["prevent"]),["esc"])]},null,40,Sy),[[Bn,u.value]]),w("div",{class:"composer-dropdown-add-actions"},[w("button",{type:"button",class:"composer-dropdown-add-btn",onClick:le},"Open"),w("button",{type:"button",class:"composer-dropdown-add-btn",onClick:fe},"Cancel")])],64)):(_(),S("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ae},_e(B.value),1))])):ve("",!0)])],2)):ve("",!0)],512))}}),No=Ke(xy,[["__scopeId","data-v-8fdced75"]]),Cy=["disabled"],Ay={class:"search-dropdown-value"},Ey={class:"search-dropdown-search-wrap"},Iy=["placeholder","onKeydown"],Ry={key:0,class:"search-dropdown-list",role:"listbox"},$y=["onClick","onPointerenter"],My={class:"search-dropdown-option-check"},Py={class:"search-dropdown-option-label"},Ny={key:0,class:"search-dropdown-option-desc"},Oy={key:1,class:"search-dropdown-empty"},jy=Ct({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(!1),a=D(""),l=D(0),d=ce(()=>n.openDirection??"down"),u=ce(()=>new Set(n.selectedValues)),f=ce(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const M=n.options.find(U=>U.value===n.selectedValues[0]);return(M==null?void 0:M.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),g=ce(()=>{const M=a.value.toLowerCase().trim();return M?n.options.filter(U=>{var F;return U.label.toLowerCase().includes(M)||(((F=U.description)==null?void 0:F.toLowerCase().includes(M))??!1)}):n.options});function b(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,zt(()=>{var M;return(M=o.value)==null?void 0:M.focus()})))}function $(M){r("toggle",M.value,!u.value.has(M.value))}function E(M){g.value.length!==0&&(l.value=(l.value+M+g.value.length)%g.value.length)}function B(){const M=g.value[l.value];M&&$(M)}function W(M){if(!i.value)return;const U=s.value;if(!U)return;const F=M.target;F instanceof Node&&(U.contains(F)||(i.value=!1))}return pt(a,()=>{l.value=0}),Hn(()=>window.addEventListener("pointerdown",W)),Un(()=>window.removeEventListener("pointerdown",W)),(M,U)=>(_(),S("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[w("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:b},[w("span",Ay,_e(f.value),1),Ie(ai,{class:"search-dropdown-chevron"})],8,Cy),i.value?(_(),S("div",{key:0,class:ut(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[w("div",Ey,[Ln(w("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":U[0]||(U[0]=F=>a.value=F),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[U[1]||(U[1]=Ut(dt(F=>i.value=!1,["prevent"]),["escape"])),Ut(dt(B,["prevent"]),["enter"]),U[2]||(U[2]=Ut(dt(F=>E(1),["prevent"]),["arrow-down"])),U[3]||(U[3]=Ut(dt(F=>E(-1),["prevent"]),["arrow-up"]))]},null,40,Iy),[[Bn,a.value]])]),g.value.length>0?(_(),S("ul",Ry,[(_(!0),S(De,null,mt(g.value,(F,ae)=>(_(),S("li",{key:F.value},[w("button",{class:ut(["search-dropdown-option",{"is-selected":u.value.has(F.value),"is-highlighted":ae===l.value}]),type:"button",onClick:ie=>$(F),onPointerenter:ie=>l.value=ae},[w("span",My,_e(u.value.has(F.value)?"✓":""),1),w("span",Py,_e(F.label),1),F.description?(_(),S("span",Ny,_e(F.description),1)):ve("",!0)],42,$y)]))),128))])):(_(),S("div",Oy,"No results"))],2)):ve("",!0)],512))}}),Ly=Ke(jy,[["__scopeId","data-v-4d3f2c83"]]),Dy={class:"skill-picker-header"},By=["onKeydown"],Fy={key:0,class:"skill-picker-list",role:"listbox"},Hy=["onClick","onPointerenter"],Uy={class:"skill-picker-name"},Vy={key:0,class:"skill-picker-desc"},qy={key:1,class:"skill-picker-empty"},Wy=Ct({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(""),a=D(0),l=ce(()=>{const g=i.value.toLowerCase().trim();return g?n.skills.filter(b=>b.name.toLowerCase().includes(g)||b.description.toLowerCase().includes(g)):n.skills}),d=ce(()=>{const g={};return n.anchorBottom!=null&&(g.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(g.left=`${n.anchorLeft}px`),g});function u(g){l.value.length!==0&&(a.value=(a.value+g+l.value.length)%l.value.length)}function f(){const g=l.value[a.value];g&&r("select",g)}return pt(()=>n.visible,g=>{g&&(i.value="",a.value=0,zt(()=>{var b;return(b=o.value)==null?void 0:b.focus()}))}),pt(i,()=>{a.value=0}),(g,b)=>e.visible?(_(),S("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:rr(d.value)},[w("div",Dy,[Ln(w("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":b[0]||(b[0]=$=>i.value=$),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[b[1]||(b[1]=Ut(dt($=>g.$emit("close"),["prevent"]),["escape"])),Ut(dt(f,["prevent"]),["enter"]),b[2]||(b[2]=Ut(dt($=>u(1),["prevent"]),["arrow-down"])),b[3]||(b[3]=Ut(dt($=>u(-1),["prevent"]),["arrow-up"]))]},null,40,By),[[Bn,i.value]])]),l.value.length>0?(_(),S("ul",Fy,[(_(!0),S(De,null,mt(l.value,($,E)=>(_(),S("li",{key:$.path},[w("button",{class:ut(["skill-picker-item",{"is-highlighted":E===a.value}]),type:"button",onClick:B=>g.$emit("select",$),onPointerenter:B=>a.value=E},[w("span",Uy,_e($.name),1),$.description?(_(),S("span",Vy,_e($.description),1)):ve("",!0)],42,Hy)]))),128))])):(_(),S("div",qy,"No skills found"))],4)):ve("",!0)}}),Ky=Ke(Wy,[["__scopeId","data-v-d6a08788"]]),Gy={key:0,class:"thread-composer-attachments"},zy=["src","alt"],Yy=["aria-label","disabled","onClick"],Jy={key:1,class:"thread-composer-file-chips"},Qy=["title"],Xy=["aria-label","disabled","onClick"],Zy={key:2,class:"thread-composer-skill-chips"},ew={class:"thread-composer-skill-chip-name"},tw=["aria-label","onClick"],nw={class:"thread-composer-input-wrap"},rw={key:0,class:"thread-composer-file-mentions"},sw=["onMousedown"],ow={key:1,class:"thread-composer-file-mention-icon-markdown"},iw={class:"thread-composer-file-mention-text"},aw={class:"thread-composer-file-mention-name"},lw={key:0,class:"thread-composer-file-mention-dir"},cw={key:1,class:"thread-composer-file-mention-empty"},uw=["placeholder","disabled"],dw={class:"thread-composer-controls"},fw=["disabled"],hw={key:0,class:"thread-composer-attach-menu"},pw=["disabled"],mw=["disabled"],gw={class:"thread-composer-actions"},vw=["aria-label","title","disabled"],yw=["disabled"],ww=["aria-label","title","disabled"],bw=["disabled"],_w=["disabled"],kw=Ct({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=D(""),o=D([]),i=D([]),a=D([]),{state:l,isSupported:d,startRecording:u,stopRecording:f}=pv({onTranscript:L=>{s.value=s.value?`${s.value}
43
+ ${L}`:L}}),g=D(null),b=D(null),$=D(null),E=D(null),B=D(!1),W=D(!1),M=D(null),U=D(""),F=D([]),ae=D(!1),ie=D(0);let le=0,fe=null;const oe=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),Z=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],he=ce(()=>n.models.map(L=>({value:L,label:L}))),ee=ce(()=>n.skills??[]),Oe=ce(()=>i.value.map(L=>L.path)),qe=ce(()=>(n.skills??[]).map(L=>({value:L.path,label:L.name,description:L.description}))),rt=ce(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Ne=ce(()=>n.disabled||!n.activeThreadId),Te=ce(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function Ae(L="steer"){var m;const z=s.value.trim();if(rt.value){if(r("submit",{text:z,imageUrls:o.value.map(C=>C.url),fileAttachments:[...a.value],skills:i.value.map(C=>({name:C.name,path:C.path})),mode:L}),s.value="",o.value=[],i.value=[],a.value=[],B.value=!1,W.value=!1,N(),oe){(m=E.value)==null||m.blur();return}zt(()=>{var C;return(C=E.value)==null?void 0:C.focus()})}}function ht(){r("interrupt")}function it(L){r("update:selected-model",L)}function Qe(L){r("update:selected-reasoning-effort",L)}function Ye(){Ne.value||(B.value=!B.value)}function Ge(){var L;(L=b.value)==null||L.click()}function ue(){var L;(L=$.value)==null||L.click()}function Se(L){o.value=o.value.filter(z=>z.id!==L)}function de(L){i.value=i.value.filter(z=>z.path!==L)}function A(L){a.value=a.value.filter(z=>z.fsPath!==L)}function X(L){const z=L.replace(/\\/g,"/");if(a.value.some(I=>I.fsPath===z))return;const m=z.split("/").filter(Boolean),C=m[m.length-1]??z;a.value=[...a.value,{label:C,path:z,fsPath:z}]}function Q(L){return L.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(L.name)}function pe(L){if(!(!L||L.length===0))for(const z of Array.from(L))if(Q(z)){const m=new FileReader;m.onload=()=>{typeof m.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:z.name,url:m.result})},m.readAsDataURL(z)}else ny(z).then(m=>{m&&X(m)}).catch(()=>{})}function ke(L){L&&(L.value="")}function p(L){const z=L.target;pe((z==null?void 0:z.files)??null),ke(z),B.value=!1}function y(L){const z=L.target;pe((z==null?void 0:z.files)??null),ke(z),B.value=!1}function x(){const L=s.value;L==="/"?W.value=!0:W.value&&!L.startsWith("/")&&(W.value=!1),ne()}function O(L){if(ae.value){if(L.key==="Escape"){L.preventDefault(),N();return}if(L.key==="ArrowDown"){L.preventDefault(),F.value.length>0&&(ie.value=(ie.value+1)%F.value.length);return}if(L.key==="ArrowUp"){if(L.preventDefault(),F.value.length>0){const z=F.value.length;ie.value=(ie.value+z-1)%z}return}if(L.key==="Enter"||L.key==="Tab"){L.preventDefault();const z=F.value[ie.value];z?Y(z):N();return}}if(L.key==="Enter"&&!L.shiftKey){L.preventDefault(),Ae("steer");return}if(W.value){if(L.key==="Escape"){L.preventDefault(),H();return}if(L.key==="ArrowDown"||L.key==="ArrowUp"){L.preventDefault();return}}}function H(){var L;W.value=!1,(L=E.value)==null||L.focus()}function N(){ae.value=!1,M.value=null,U.value="",F.value=[],ie.value=0}function ne(){const L=E.value;if(!L){N();return}const z=L.selectionStart??s.value.length,C=s.value.slice(0,z).match(/(^|\s)(@[^\s@]*)$/);if(!C){N();return}const I=C[2]??"",G=I.length,se=z-G;M.value=se,U.value=I.slice(1),ae.value=!0,te()}async function te(){if(!ae.value)return;const L=(n.cwd??"").trim();if(!L){F.value=[];return}fe&&clearTimeout(fe);const z=++le;fe=setTimeout(async()=>{try{const m=await Xv(L,U.value,20);if(!ae.value||z!==le)return;F.value=m,ie.value=0}catch{if(!ae.value||z!==le)return;F.value=[]}},120)}function Y(L){const z=E.value,m=M.value;if(m!==null&&z){const C=z.selectionStart??s.value.length;s.value=`${s.value.slice(0,m)}${s.value.slice(C)}`.trimEnd()}X(L.path),N(),zt(()=>z==null?void 0:z.focus())}function V(L){const z=L.lastIndexOf("/");return z<0?L:L.slice(z+1)}function me(L){const z=L.lastIndexOf("/");return z<=0?"":L.slice(0,z)}function re(L){const z=V(L),m=z.lastIndexOf(".");return m<=0?"":z.slice(m+1).toLowerCase()}function be(L){const z=re(L);return z==="ts"?"TS":z==="tsx"?"TSX":z==="js"?"JS":z==="jsx"?"JSX":z==="json"?"{}":""}function xe(L){const z=re(L);return z.startsWith("ts")?"ts":z.startsWith("js")?"js":z==="json"?"json":"default"}function je(L){const z=re(L);return z==="md"||z==="mdx"}function Ve(L){var z;i.value.some(m=>m.path===L.path)||(i.value=[...i.value,L]),s.value=s.value.startsWith("/")?"":s.value,W.value=!1,(z=E.value)==null||z.focus()}function $e(L,z){if(z){const m=(n.skills??[]).find(C=>C.path===L);m&&!i.value.some(C=>C.path===L)&&(i.value=[...i.value,m])}else i.value=i.value.filter(m=>m.path!==L)}function st(L){if(!B.value)return;const z=g.value;if(!z)return;const m=L.target;!m||z.contains(m)||(B.value=!1)}return Hn(()=>{document.addEventListener("click",st)}),Un(()=>{document.removeEventListener("click",st),fe&&clearTimeout(fe)}),pt(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],B.value=!1,W.value=!1,N()}),pt(()=>n.cwd,()=>{ae.value&&te()}),(L,z)=>(_(),S("form",{class:"thread-composer",onSubmit:z[7]||(z[7]=dt(m=>Ae("steer"),["prevent"]))},[w("div",{class:ut(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(_(),S("div",Gy,[(_(!0),S(De,null,mt(o.value,m=>(_(),S("div",{key:m.id,class:"thread-composer-attachment"},[w("img",{class:"thread-composer-attachment-image",src:m.url,alt:m.name||"Selected image"},null,8,zy),w("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${m.name||"image"}`,disabled:Ne.value,onClick:C=>Se(m.id)}," x ",8,Yy)]))),128))])):ve("",!0),a.value.length>0?(_(),S("div",Jy,[(_(!0),S(De,null,mt(a.value,m=>(_(),S("span",{key:m.fsPath,class:"thread-composer-file-chip"},[Ie(Ts,{class:"thread-composer-file-chip-icon"}),w("span",{class:"thread-composer-file-chip-name",title:m.fsPath},_e(m.label),9,Qy),w("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${m.label}`,disabled:Ne.value,onClick:C=>A(m.fsPath)},"×",8,Xy)]))),128))])):ve("",!0),i.value.length>0?(_(),S("div",Zy,[(_(!0),S(De,null,mt(i.value,m=>(_(),S("span",{key:m.path,class:"thread-composer-skill-chip"},[w("span",ew,_e(m.name),1),w("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${m.name}`,onClick:C=>de(m.path)},"×",8,tw)]))),128))])):ve("",!0),w("div",nw,[ae.value?(_(),S("div",rw,[F.value.length>0?(_(!0),S(De,{key:0},mt(F.value,(m,C)=>(_(),S("button",{key:m.path,class:ut(["thread-composer-file-mention-row",{"is-active":C===ie.value}]),type:"button",onMousedown:dt(I=>Y(m),["prevent"])},[be(m.path)?(_(),S("span",{key:0,class:ut(["thread-composer-file-mention-icon-badge",`is-${xe(m.path)}`])},_e(be(m.path)),3)):je(m.path)?(_(),S("span",ow,"↓")):(_(),at(Ts,{key:2,class:"thread-composer-file-mention-icon-file"})),w("span",iw,[w("span",aw,_e(V(m.path)),1),me(m.path)?(_(),S("span",lw,_e(me(m.path)),1)):ve("",!0)])],42,sw))),128)):(_(),S("div",cw,"No matching files"))])):ve("",!0),Ln(w("textarea",{ref_key:"inputRef",ref:E,"onUpdate:modelValue":z[0]||(z[0]=m=>s.value=m),class:"thread-composer-input",placeholder:Te.value,disabled:Ne.value,onInput:x,onKeydown:O},null,40,uw),[[Bn,s.value]]),Ie(Ky,{skills:ee.value,visible:W.value,"anchor-bottom":44,"anchor-left":0,onSelect:Ve,onClose:H},null,8,["skills","visible"])]),w("div",dw,[w("div",{ref_key:"attachMenuRootRef",ref:g,class:"thread-composer-attach"},[w("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Ne.value,onClick:Ye}," + ",8,fw),B.value?(_(),S("div",hw,[w("button",{class:"thread-composer-attach-item",type:"button",disabled:Ne.value,onClick:Ge}," Add photos & files ",8,pw),w("button",{class:"thread-composer-attach-item",type:"button",disabled:Ne.value,onClick:ue}," Take photo ",8,mw)])):ve("",!0)],512),Ie(No,{class:"thread-composer-control","model-value":e.selectedModel,options:he.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":it},null,8,["model-value","options","disabled"]),Ie(Ly,{class:"thread-composer-control",options:qe.value,"selected-values":Oe.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress||(e.skills??[]).length===0,onToggle:$e},null,8,["options","selected-values","disabled"]),Ie(No,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:Z,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":Qe},null,8,["model-value","disabled"]),w("div",gw,[Me(d)&&!e.isTurnInProgress?(_(),S("button",{key:0,class:ut(["thread-composer-mic",{"thread-composer-mic--active":Me(l)!=="idle"}]),type:"button","aria-label":Me(l)==="recording"?"Stop dictation":"Hold to dictate",title:Me(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Ne.value,onMousedown:z[1]||(z[1]=dt((...m)=>Me(u)&&Me(u)(...m),["prevent"])),onMouseup:z[2]||(z[2]=(...m)=>Me(f)&&Me(f)(...m)),onMouseleave:z[3]||(z[3]=m=>Me(l)==="recording"&&Me(f)()),onTouchstart:z[4]||(z[4]=dt((...m)=>Me(u)&&Me(u)(...m),["prevent"])),onTouchend:z[5]||(z[5]=(...m)=>Me(f)&&Me(f)(...m))},[Ie(uy,{class:"thread-composer-mic-icon"})],42,vw)):ve("",!0),e.isTurnInProgress?(_(),S("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:ht},[Ie(py,{class:"thread-composer-stop-icon"})],8,yw)):ve("",!0),w("button",{class:ut(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress}]),type:"button","aria-label":e.isTurnInProgress?"Queue message":"Send message",title:e.isTurnInProgress?"Queue (button) · Enter to steer":"Send",disabled:!rt.value,onClick:z[6]||(z[6]=m=>Ae(e.isTurnInProgress?"queue":"steer"))},[Ie(iy,{class:"thread-composer-submit-icon"})],10,ww)])])],2),w("input",{ref_key:"photoLibraryInputRef",ref:b,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Ne.value,onChange:p},null,40,bw),w("input",{ref_key:"cameraCaptureInputRef",ref:$,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Ne.value,onChange:y},null,40,_w)],32))}}),Ua=Ke(kw,[["__scopeId","data-v-544bb546"]]),Tw={key:0,class:"queued-messages"},Sw={class:"queued-messages-inner"},xw={class:"queued-row-text"},Cw={class:"queued-row-actions"},Aw=["onClick"],Ew=["onClick"],Iw=Ct({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(_(),S("div",Tw,[w("div",Sw,[(_(!0),S(De,null,mt(e.messages,r=>(_(),S("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=w("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),w("span",xw,_e(r.text),1),w("div",Cw,[w("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Aw),w("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:s=>t.$emit("delete",r.id)},[...n[0]||(n[0]=[w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,Ew)])]))),128))])])):ve("",!0)}}),Rw=Ke(Iw,[["__scopeId","data-v-ea583733"]]),$w={},Mw={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Pw(e,t){return _(),S("svg",Mw,[...t[0]||(t[0]=[w("circle",{cx:"11",cy:"11",r:"8"},null,-1),w("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const Oo=Ke($w,[["render",Pw]]),Nw={class:"skill-card-top"},Ow=["src","alt"],jw={key:1,class:"skill-card-avatar-fallback"},Lw={class:"skill-card-info"},Dw={class:"skill-card-header"},Bw={class:"skill-card-name"},Fw={key:0,class:"skill-card-badge-disabled"},Hw={key:1,class:"skill-card-badge"},Uw={class:"skill-card-owner"},Vw={key:0,class:"skill-card-desc"},qw={key:1,class:"skill-card-date"},Ww=Ct({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=ce(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function r(s){const o=s.target;o.style.display="none"}return(s,o)=>(_(),S("button",{class:ut(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[w("div",Nw,[e.skill.avatarUrl?(_(),S("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,Ow)):(_(),S("div",jw,_e(e.skill.owner.charAt(0)),1)),w("div",Lw,[w("div",Dw,[w("span",Bw,_e(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(_(),S("span",Fw,"Disabled")):e.skill.installed?(_(),S("span",Hw,"Installed")):ve("",!0)]),w("span",Uw,_e(e.skill.owner),1)])]),e.skill.description?(_(),S("p",Vw,_e(e.skill.description),1)):ve("",!0),n.value?(_(),S("span",qw,_e(n.value),1)):ve("",!0)],2))}}),Va=Ke(Ww,[["__scopeId","data-v-2a1e8196"]]),Kw={class:"sdm-panel"},Gw={class:"sdm-header"},zw={class:"sdm-title-area"},Yw=["src","alt"],Jw={class:"sdm-title-col"},Qw={class:"sdm-title-row"},Xw={class:"sdm-title"},Zw={key:0,class:"sdm-badge-disabled"},eb={class:"sdm-owner"},tb={class:"sdm-body"},nb={key:0,class:"sdm-desc"},rb={key:1,class:"sdm-readme-loading"},sb=["innerHTML"],ob=["href"],ib={class:"sdm-footer"},ab={class:"sdm-footer-actions"},lb=["disabled"],cb=["disabled"],ub=["disabled"],db=Ct({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(""),i=D(!1),a=ce(()=>s.value??n.skill.enabled??!0),l=ce(()=>n.isInstalling===!0||n.isUninstalling===!0),d=ce(()=>{const E=o.value;if(!E)return"";const B=E.replace(/^---[\s\S]*?---\s*/,"");return u(B)});function u(E){return E.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function f(){if(!(!n.skill.owner||!n.skill.name)){i.value=!0,o.value="";try{const E=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),B=await fetch(`/codex-api/skills-hub/readme?${E}`);if(!B.ok)return;const W=await B.json();o.value=W.content??""}catch{}finally{i.value=!1}}}pt(()=>n.visible,E=>{E&&(s.value=null,o.value="",f())});function g(){r("install",n.skill)}function b(){r("uninstall",n.skill)}function $(){const E=!a.value;s.value=E,r("toggle-enabled",n.skill,E)}return(E,B)=>(_(),at(Pl,{to:"body"},[e.visible?(_(),S("div",{key:0,class:"sdm-overlay",onClick:B[1]||(B[1]=dt(W=>E.$emit("close"),["self"]))},[w("div",Kw,[w("div",Gw,[w("div",zw,[e.skill.avatarUrl?(_(),S("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,Yw)):ve("",!0),w("div",Jw,[w("div",Qw,[w("h3",Xw,_e(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(_(),S("span",Zw,"Disabled")):ve("",!0)]),w("span",eb,_e(e.skill.owner),1)])]),w("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:B[0]||(B[0]=W=>E.$emit("close"))},[Ie(li,{class:"sdm-close-icon"})])]),w("div",tb,[e.skill.description?(_(),S("p",nb,_e(e.skill.description),1)):ve("",!0),i.value?(_(),S("div",rb,"Loading skill contents...")):o.value?(_(),S("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,sb)):ve("",!0),w("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,ob)]),w("div",ib,[w("div",ab,[e.skill.installed?(_(),S("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:b},_e(n.isUninstalling?"Uninstalling...":"Uninstall"),9,lb)):(_(),S("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:g},_e(n.isInstalling?"Installing...":"Install"),9,cb)),e.skill.installed?(_(),S("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:$},_e(a.value?"Disable":"Enable"),9,ub)):ve("",!0)])])])])):ve("",!0)]))}}),fb=Ke(db,[["__scopeId","data-v-19a385ca"]]),hb={class:"skills-hub"},pb={class:"skills-hub-toolbar"},mb={class:"skills-hub-search-wrap"},gb={key:0,class:"skills-hub-count"},vb={key:1,class:"skills-hub-section"},yb={class:"skills-hub-section-title"},wb={key:0,class:"skills-hub-grid"},bb={class:"skills-hub-section"},_b={key:0,class:"skills-hub-loading"},kb={key:1,class:"skills-hub-error"},Tb={key:0,class:"skills-hub-grid"},Sb={key:1,class:"skills-hub-empty"},as="codex-web-local.skills-hub.cache.v1",xb=Ct({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=D(null),s=D(""),o=D("date"),i=D([]),a=D([]),l=D(0),d=D(!1),u=D(""),f=D(!0),g=D(!1),b=D(n),$=D(null),E=D(""),B=D(!1),W=D(!1);let M=null,U=null;const F=t,ae=ce(()=>o.value==="date"?"Newest":"A-Z"),ie=ce(()=>{var ue;return((ue=$.value)==null?void 0:ue.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),le=ce(()=>`${b.value.owner}/${b.value.name}`),fe=ce(()=>B.value&&E.value===le.value),oe=ce(()=>W.value&&E.value===le.value),Z=ce(()=>{const ue=s.value.toLowerCase().trim();return ue?a.value.filter(Se=>Se.name.toLowerCase().includes(ue)||Se.owner.toLowerCase().includes(ue)||(Se.displayName??"").toLowerCase().includes(ue)):a.value});function he(ue,Se="success"){$.value={text:ue,type:Se},U&&clearTimeout(U),U=setTimeout(()=>{$.value=null},3e3)}function ee(){o.value=o.value==="date"?"name":"date",Ae(s.value)}function Oe(ue){return`${o.value}::${ue.trim().toLowerCase()}`}function qe(ue){var Se;if(typeof window>"u")return null;try{const de=window.localStorage.getItem(as);return de?((Se=JSON.parse(de).byKey)==null?void 0:Se[ue])??null:null}catch{return null}}function rt(ue,Se){if(!(typeof window>"u"))try{const de=window.localStorage.getItem(as),X=(de?JSON.parse(de):{}).byKey??{};X[ue]=Se,window.localStorage.setItem(as,JSON.stringify({byKey:X}))}catch{}}function Ne(){if(!(typeof window>"u"))try{window.localStorage.removeItem(as)}catch{}}function Te(ue){const Se=ue.installed??[];a.value=Se;const de=new Set(Se.map(A=>A.name));i.value=ue.data.map(A=>{if(A.installed||de.has(A.name)){const X=Se.find(Q=>Q.name===A.name);return{...A,installed:!0,path:(X==null?void 0:X.path)??A.path,enabled:(X==null?void 0:X.enabled)??A.enabled}}return A}).filter(A=>!A.installed),l.value=ue.total}async function Ae(ue){const Se=Oe(ue),de=qe(Se);de&&Te(de),d.value=!de,u.value="";try{const A=new URLSearchParams;ue.trim()&&A.set("q",ue.trim()),A.set("limit","100"),A.set("sort",o.value);const X=await fetch(`/codex-api/skills-hub?${A}`);if(!X.ok)throw new Error(`HTTP ${X.status}`);const Q=await X.json();Te(Q),rt(Se,Q)}catch(A){u.value=A instanceof Error?A.message:"Failed to load skills"}finally{d.value=!1}}function ht(){M&&clearTimeout(M),M=setTimeout(()=>Ae(s.value),300)}function it(ue){b.value=ue,g.value=!0}async function Qe(ue){E.value=`${ue.owner}/${ue.name}`,B.value=!0;try{const de=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:ue.owner,name:ue.name})})).json();if(!de.ok)throw new Error(de.error||"Install failed");const A={...ue,installed:!0,path:de.path,enabled:!0};a.value=[...a.value,A],i.value=i.value.filter(X=>X.name!==ue.name),b.value=A,he(`${ue.displayName||ue.name} skill installed`),g.value=!1,Ne(),F("skills-changed")}catch(Se){he(Se instanceof Error?Se.message:"Failed to install skill","error")}finally{B.value=!1}}async function Ye(ue){E.value=`${ue.owner}/${ue.name}`,W.value=!0;try{const de=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ue.name,path:ue.path})})).json();if(!de.ok)throw new Error(de.error||"Uninstall failed");a.value=a.value.filter(A=>A.name!==ue.name),ue.owner!=="local"&&(i.value=[...i.value,{...ue,installed:!1,path:void 0,enabled:void 0}]),he(`${ue.displayName||ue.name} skill uninstalled`),g.value=!1,Ne(),F("skills-changed")}catch(Se){he(Se instanceof Error?Se.message:"Failed to uninstall skill","error")}finally{W.value=!1}}async function Ge(ue,Se){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:ue.path,enabled:Se}})})).ok)throw new Error("Failed to update skill");he(`${ue.displayName||ue.name} skill ${Se?"enabled":"disabled"}`),await Ae(s.value)}catch(de){he(de instanceof Error?de.message:"Failed to update skill","error")}}return Hn(()=>{Ae("")}),(ue,Se)=>(_(),S("div",hb,[Se[3]||(Se[3]=w("div",{class:"skills-hub-header"},[w("h2",{class:"skills-hub-title"},"Skills Hub"),w("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),w("div",pb,[w("div",mb,[Ie(Oo,{class:"skills-hub-search-icon"}),Ln(w("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":Se[0]||(Se[0]=de=>s.value=de),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:ht},null,544),[[Bn,s.value]]),l.value>0?(_(),S("span",gb,_e(l.value)+" skills",1)):ve("",!0)]),w("button",{class:"skills-hub-sort",type:"button",onClick:ee},_e(ae.value),1)]),$.value?(_(),S("div",{key:0,class:ut(["skills-hub-toast",ie.value])},_e($.value.text),3)):ve("",!0),Z.value.length>0?(_(),S("div",vb,[w("button",{class:"skills-hub-section-toggle",type:"button",onClick:Se[1]||(Se[1]=de=>f.value=!f.value)},[w("span",yb,"Installed ("+_e(Z.value.length)+")",1),Ie(Cc,{class:ut(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(_(),S("div",wb,[(_(!0),S(De,null,mt(Z.value,de=>(_(),at(Va,{key:de.name,skill:de,onSelect:A=>it(A)},null,8,["skill","onSelect"]))),128))])):ve("",!0)])):ve("",!0),w("div",bb,[d.value?(_(),S("div",_b,"Loading skills...")):u.value?(_(),S("div",kb,_e(u.value),1)):(_(),S(De,{key:2},[i.value.length>0?(_(),S("div",Tb,[(_(!0),S(De,null,mt(i.value,de=>(_(),at(Va,{key:de.url,skill:de,onSelect:A=>it(A)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(_(),S("div",Sb,'No skills found for "'+_e(s.value)+'"',1)):ve("",!0)],64))]),Ie(fb,{skill:b.value,visible:g.value,"is-installing":fe.value,"is-uninstalling":oe.value,onClose:Se[2]||(Se[2]=de=>g.value=!1),onInstall:Qe,onUninstall:Ye,onToggleEnabled:Ge},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),Cb=Ke(xb,[["__scopeId","data-v-1967b404"]]),Ab={},Eb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Ib(e,t){return _(),S("svg",Eb,[...t[0]||(t[0]=[w("path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"},null,-1),w("path",{d:"M9 4l0 16"},null,-1)])])}const Rb=Ke(Ab,[["render",Ib]]),$b={},Mb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function Pb(e,t){return _(),S("svg",Mb,[...t[0]||(t[0]=[w("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm12 -16h-8v14h8a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1"},null,-1)])])}const Nb=Ke($b,[["render",Pb]]),Ob={},jb={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Lb(e,t){return _(),S("svg",jb,[...t[0]||(t[0]=[w("path",{d:"M20 11a8.1 8.1 0 0 0-15.5-2m-.5-4v4h4"},null,-1),w("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const Db=Ke(Ob,[["render",Lb]]),Bb={class:"sidebar-thread-controls"},Fb=["aria-label","title"],Hb=["aria-pressed","aria-label","title"],Ub=Ct({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},isAutoRefreshEnabled:{type:Boolean},autoRefreshButtonLabel:{},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","toggle-auto-refresh","start-new-thread"],setup(e){return(t,n)=>(_(),S("div",Bb,[w("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(_(),at(Nb,{key:0,class:"sidebar-thread-controls-icon"})):(_(),at(Rb,{key:1,class:"sidebar-thread-controls-icon"}))],8,Fb),w("button",{class:"sidebar-thread-controls-button",type:"button","aria-pressed":e.isAutoRefreshEnabled,"aria-label":e.autoRefreshButtonLabel,title:e.autoRefreshButtonLabel,onClick:n[1]||(n[1]=r=>t.$emit("toggle-auto-refresh"))},[Ie(Db,{class:"sidebar-thread-controls-icon"})],8,Hb),un(t.$slots,"default",{},void 0),e.showNewThreadButton?(_(),S("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[2]||(n[2]=r=>t.$emit("start-new-thread"))},[Ie(Ts,{class:"sidebar-thread-controls-icon"})])):ve("",!0)]))}}),qa=Ke(Ub,[["__scopeId","data-v-57866500"]]);function On(e){return e.flatMap(t=>t.threads)}const Ic="codex-web-local.thread-read-state.v1",Rc="codex-web-local.thread-scroll-state.v1",jo="codex-web-local.selected-thread-id.v1",$c="codex-web-local.project-order.v1",Mc="codex-web-local.project-display-name.v1",Pc="codex-web-local.auto-refresh-enabled.v1",uo=220,Mr=4e3,Wa=["none","minimal","low","medium","high","xhigh"],Pr="__global__",Kt="gpt-5.2-codex";function Vb(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Ic);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function Ka(e){typeof window>"u"||window.localStorage.setItem(Ic,JSON.stringify(e))}function qb(){return typeof window>"u"?!1:window.localStorage.getItem(Pc)==="1"}function Ga(e){typeof window>"u"||window.localStorage.setItem(Pc,e?"1":"0")}function Nc(e,t,n){return Math.min(Math.max(e,t),n)}function Wb(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(typeof t.scrollTop!="number"||!Number.isFinite(t.scrollTop)||typeof t.isAtBottom!="boolean")return null;const n={scrollTop:Math.max(0,t.scrollTop),isAtBottom:t.isAtBottom};return typeof t.scrollRatio=="number"&&Number.isFinite(t.scrollRatio)&&(n.scrollRatio=Nc(t.scrollRatio,0,1)),n}function Kb(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Rc);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t)){if(!r)continue;const o=Wb(s);o&&(n[r]=o)}return n}catch{return{}}}function za(e){typeof window>"u"||window.localStorage.setItem(Rc,JSON.stringify(e))}function Gb(){return typeof window>"u"?"":window.localStorage.getItem(jo)??""}function zb(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(jo);return}window.localStorage.setItem(jo,e)}}function Yb(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem($c);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t)typeof r=="string"&&r.length>0&&!n.includes(r)&&n.push(r);return n}catch{return[]}}function dr(e){typeof window>"u"||window.localStorage.setItem($c,JSON.stringify(e))}function Jb(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Mc);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t))typeof r=="string"&&r.length>0&&typeof s=="string"&&(n[r]=s);return n}catch{return{}}}function fo(e){typeof window>"u"||window.localStorage.setItem(Mc,JSON.stringify(e))}function ls(e,t){const n=[];for(const r of e)n.includes(r)||n.push(r);for(const r of t)n.includes(r.projectName)||n.push(r.projectName);return Zn(e,n)?e:n}function ho(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>n.get(s)??{projectName:s,threads:[]});for(const s of e)t.includes(s.projectName)||r.push(s);return r}function Zn(e,t){const n=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(n.length!==r.length)return!1;for(let s=0;s<n.length;s+=1)if(n[s]!==r[s])return!1;return!0}function Qb(e,t,n){if(t<0||t>=e.length||n<0||n>=e.length||t===n)return e;const r=[...e],[s]=r.splice(t,1);return r.splice(n,0,s),r}function Xb(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function cs(e){if(!(e instanceof Error))return!1;const t=e.message.toLowerCase();return t.includes("not supported when using codex with a chatgpt account")||t.includes("model is not supported")}function Lo(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Zn(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&Xb(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Ss(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Zb(e,t,n={}){const r=new Map(e.map(u=>[u.id,u])),s=new Map(t.map(u=>[u.id,u])),o=t.map(u=>{const f=r.get(u.id);return f&&Lo(f,u)?f:u});if(n.preserveMissing!==!0)return Ss(e,o)?e:o;const i=e.map(u=>{const f=s.get(u.id);return!f||Lo(u,f)?u:f}),a=new Set(e.map(u=>u.id)),l=o.filter(u=>!a.has(u.id)),d=[...i,...l];return Ss(e,d)?e:d}function Do(e){return e.replace(/\s+/gu," ").trim()}function e0(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Do(s.text)).filter(s=>s.length>0));if(n.size===0)return e;const r=e.filter(s=>{if(s.messageType!=="agentMessage.live")return!0;const o=Do(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function Ya(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Lo(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const Oc="worked";function $n(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function t0(e){if(!Number.isFinite(e)||e<=0)return"<1s";const t=Math.max(1,Math.round(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60,o=[];n>0&&o.push(`${n}h`),(r>0||n>0)&&o.push(`${r}m`);const i=s>0||o.length===0?s:0;return o.push(`${i}s`),o.join(" ")}function n0(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function r0(e,t){if(!e&&!t)return!0;if(!e||!t||e.label!==t.label||e.details.length!==t.details.length)return!1;for(let n=0;n<e.details.length;n+=1)if(e.details[n]!==t.details[n])return!1;return!0}function s0(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${t0(e.durationMs)}`,messageType:Oc}}function o0(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function i0(e,t){const n=s0(t),r=e.filter(i=>i.messageType!==Oc),s=o0(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function St(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function a0(e,t){return e.id===t.id&&e.title===t.title&&e.projectName===t.projectName&&e.cwd===t.cwd&&e.createdAtIso===t.createdAtIso&&e.updatedAtIso===t.updatedAtIso&&e.preview===t.preview&&e.unread===t.unread&&e.inProgress===t.inProgress}function l0(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function c0(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Et(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function us(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>{const o=n.get(s.projectName),i=new Map((o==null?void 0:o.threads.map(l=>[l.id,l]))??[]),a=s.threads.map(l=>{const d=i.get(l.id);return d&&a0(d,l)?d:l});return o&&o.projectName===s.projectName&&l0(o.threads,a)?o:{projectName:s.projectName,threads:a}});return c0(e,r)?e:r}function u0(e,t,n){const r=new Set(On(t).map(a=>a.id)),s=On(e).filter(a=>n[a.id]===!0&&!r.has(a.id));if(s.length===0)return t;const o=new Map(t.map(a=>[a.projectName,a])),i=t.map(a=>({projectName:a.projectName,threads:[...a.threads]}));for(const a of s){if(o.get(a.projectName)){const d=i.findIndex(u=>u.projectName===a.projectName);d>=0&&(i[d]={projectName:i[d].projectName,threads:[a,...i[d].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function d0(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function po(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function f0(e){const t=e.split(`
44
+ `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function h0(){const e=D([]),t=D([]),n=D(Gb()),r=D({}),s=D({}),o=D({}),i=D({}),a=D({}),l=D({}),d=D({}),u=D([]),f=D(""),g=D("medium"),b=D(Vb()),$=D(Kb()),E=D(Yb()),B=D(Jb()),W=D({}),M=D({}),U=D({}),F=D({}),ae=D({}),ie=D({}),le=D({}),fe=D({}),oe=D({}),Z=D({}),he=D([]),ee=D(!1),Oe=D(!1),qe=D(!1),rt=D(!1),Ne=D(!1),Te=D(""),Ae=D(!1),ht=D(!1),it=D(qb()),Qe=D(Math.floor(Mr/1e3));let Ye=null,Ge=null,ue=null,Se=null,de=!1;const A=new Set;let X=!1,Q=!1;const pe=new Map,ke=new Set,p=ce(()=>On(e.value)),y=ce(()=>p.value.find(c=>c.id===n.value)??null),x=ce(()=>$.value[n.value]??null),O=ce(()=>{const c=[],h=n.value;return h&&Array.isArray(fe.value[h])&&c.push(...fe.value[h]),Array.isArray(fe.value[Pr])&&c.push(...fe.value[Pr]),c.sort((v,k)=>v.receivedAtIso.localeCompare(k.receivedAtIso))}),H=ce(()=>{var K;const c=n.value;if(!c)return null;const h=ae.value[c],v=(o.value[c]??"").trim(),k=(((K=ie.value[c])==null?void 0:K.message)??"").trim();return!h&&!v&&!k?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:v,errorText:k}}),N=ce(()=>{const c=n.value;if(!c)return[];const h=r.value[c]??[],v=s.value[c]??[],k=i.value[c]??[],K=[...h,...k,...v],q=F.value[c];return q?i0(K,q):K});function ne(c){n.value!==c&&(n.value=c,zb(c),Q=!1)}function te(c){f.value=c.trim()}async function Y(){f.value=Kt,u.value.includes(Kt)||(u.value=[...u.value,Kt]);try{await Wv(Kt)}catch{}}function V(c,h){oe.value={...oe.value,[c]:h}}function me(c){oe.value[c]&&(oe.value=St(oe.value,c))}async function re(c){if(ke.has(c))return;const h=oe.value[c];if(!(!h||h.fallbackRetried)){ke.add(c),V(c,{...h,fallbackRetried:!0});try{await Y();try{const v=await La(c,1);ze(c,v),Ze(c,[]),Tt(c),i.value[c]&&(i.value=St(i.value,c))}catch{}se(c,null),Te.value="",m(c,null),G(c,{label:"Thinking",details:xe(Kt,h.effort)}),C(c,!0),U.value[c]!==!0&&await lo(c),await co(c,h.text,h.imageUrls,Kt,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),U.value={...U.value,[c]:!0},A.add(c),de=!0,await qn()}catch(v){const k=v instanceof Error?v.message:"Unknown application error";se(c,k),Te.value=k,C(c,!1),G(c,null)}finally{ke.delete(c)}}}function be(c){c&&!Wa.includes(c)||(g.value=c)}function xe(c,h){const v=c.trim()||"default",k=h||"default";return[`Model: ${v}`,`Thinking: ${k}`]}async function je(){try{const[c,h]=await Promise.all([Kv(),Gv()]);u.value=c,f.value.length>0&&c.includes(f.value)||(h.model&&c.includes(h.model)?f.value=h.model:c.length>0?f.value=c[0]:f.value=""),h.reasoningEffort&&Wa.includes(h.reasoningEffort)&&(g.value=h.reasoningEffort)}catch{}}function Ve(c){const h=Z.value;return Object.keys(h).length===0?c:c.map(v=>({projectName:v.projectName,threads:v.threads.map(k=>{const K=h[k.id];return K?{...k,title:K}:k})}))}function $e(){const h=Ve(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(k=>{const K=a.value[k.id]===!0,q=n.value===k.id,we=b.value[k.id],Ee=d.value[k.id]===!0,ge=!q&&!K&&(Ee||we!==k.updatedAtIso);return{...k,inProgress:K,unread:ge}})}));e.value=us(e.value,h)}function st(c,h,v){const k=new Date().toISOString(),K=h.trim(),q=d0(K),we={id:c,title:f0(v),projectName:q,cwd:K,hasWorktree:K.includes("/.codex/worktrees/")||K.includes("/.git/worktrees/"),createdAtIso:k,updatedAtIso:k,preview:v,unread:!1,inProgress:!1},Ee=t.value.findIndex(We=>We.projectName===q);if(Ee>=0){const vt=t.value[Ee].threads.filter(En=>En.id!==c),cr={projectName:q,threads:[we,...vt]},pn=[...t.value];pn.splice(Ee,1,cr),t.value=pn}else t.value=[{projectName:q,threads:[we]},...t.value];const ge=ls(E.value,t.value);Zn(E.value,ge)||(E.value=ge,dr(E.value)),$e()}function L(c){const h=new Set(c.map(q=>q.id)),v=Et(b.value,h);v!==b.value&&(b.value=v,Ka(v));const k=Et($.value,h);k!==$.value&&($.value=k,za(k)),M.value=Et(M.value,h),W.value=Et(W.value,h),U.value=Et(U.value,h),r.value=Et(r.value,h),s.value=Et(s.value,h),o.value=Et(o.value,h),i.value=Et(i.value,h),F.value=Et(F.value,h),ae.value=Et(ae.value,h),ie.value=Et(ie.value,h),le.value=Et(le.value,h),d.value=Et(d.value,h),a.value=Et(a.value,h);const K={};for(const[q,we]of Object.entries(fe.value))(q===Pr||h.has(q))&&(K[q]=we);fe.value=K}function z(c){const h=On(t.value).find(v=>v.id===c);h&&(b.value={...b.value,[c]:h.updatedAtIso},Ka(b.value),d.value[c]&&(d.value=St(d.value,c)),$e())}function m(c,h){if(!c)return;const v=F.value[c];if(h){if(n0(v,h))return;F.value={...F.value,[c]:h}}else v&&(F.value=St(F.value,c))}function C(c,h){!c||a.value[c]===!0===h||(h?a.value={...a.value,[c]:!0}:a.value=St(a.value,c),$e())}function I(c){c&&c!==n.value&&d.value[c]!==!0&&(d.value={...d.value,[c]:!0},$e())}function G(c,h){if(!c)return;const v=ae.value[c];if(!h){v&&(ae.value=St(ae.value,c));return}const k=R(h.label)||"Thinking",K=h.details.map(Ee=>R(Ee)).filter(Ee=>Ee.length>0&&Ee!==k),q=Array.from(new Set([...(v==null?void 0:v.details)??[],...K])).slice(-3),we={label:k,details:q};r0(v,we)||(ae.value={...ae.value,[c]:we})}function se(c,h){if(!c)return;const v=ie.value[c],k=h?Do(h):"";if(!k){v&&(ie.value=St(ie.value,c));return}(v==null?void 0:v.message)!==k&&(ie.value={...ie.value,[c]:{message:k}})}function Ce(c){const h=On(t.value).find(v=>v.id===c);return(h==null?void 0:h.updatedAtIso)??""}function Xe(c,h){if(!c)return;const v={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(v.scrollRatio=Nc(h.scrollRatio,0,1));const k=$.value[c];k&&k.scrollTop===v.scrollTop&&k.isAtBottom===v.isAtBottom&&k.scrollRatio===v.scrollRatio||($.value={...$.value,[c]:v},za($.value))}function ze(c,h){const v=r.value[c]??[];Ss(v,h)||(r.value={...r.value,[c]:h})}function Ze(c,h){const v=s.value[c]??[];Ss(v,h)||(s.value={...s.value,[c]:h})}function ft(c,h){const v=s.value[c]??[],k=Ya(v,h);Ze(c,k)}function Lt(c,h){if(!c)return;const v=h.trim(),k=o.value[c]??"";if(v.length===0){if(!k)return;o.value=St(o.value,c);return}k!==v&&(o.value={...o.value,[c]:v})}function Jt(c,h){if(!c)return;const v=o.value[c]??"";Lt(c,`${v}${h}`)}function Tt(c){c&&c in o.value&&(o.value=St(o.value,c))}function Le(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function Re(c){return typeof c=="string"?c:""}function sr(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function At(c){const h=Le(c.params);if(!h)return"";const v=Re(h.threadId);if(v)return v;const k=Re(h.thread_id);if(k)return k;const K=Re(h.conversationId);if(K)return K;const q=Re(h.conversation_id);if(q)return q;const we=Le(h.thread),Ee=Re(we==null?void 0:we.id);if(Ee)return Ee;const ge=Le(h.turn),We=Re(ge==null?void 0:ge.threadId);if(We)return We;const vt=Re(ge==null?void 0:ge.thread_id);return vt||""}function Sr(c){if(c.method!=="turn/completed")return"";const h=Le(c.params),v=Le(h==null?void 0:h.turn);if(!v||v.status!=="failed")return"";const k=Le(v.error);return Re(k==null?void 0:k.message)}function xr(c){var v;if(c.method!=="error")return"";const h=Le(c.params);return Re(h==null?void 0:h.message)||Re((v=Le(h==null?void 0:h.error))==null?void 0:v.message)}function fn(c){const h=Le(c);if(!h)return null;const v=h.id,k=Re(h.method),K=h.params;if(typeof v!="number"||!Number.isInteger(v)||!k)return null;const q=Le(K),we=Re(q==null?void 0:q.threadId)||Pr,Ee=Re(q==null?void 0:q.turnId),ge=Re(q==null?void 0:q.itemId),We=Re(h.receivedAtIso)||new Date().toISOString();return{id:v,method:k,threadId:we,turnId:Ee,itemId:ge,receivedAtIso:We,params:K??null}}function hn(c){const h=c.threadId||Pr,v=fe.value[h]??[],k=v.findIndex(q=>q.id===c.id),K=[...v];k>=0?K.splice(k,1,c):K.push(c),fe.value={...fe.value,[h]:K.sort((q,we)=>q.receivedAtIso.localeCompare(we.receivedAtIso))}}function or(c){const h={};for(const[v,k]of Object.entries(fe.value)){const K=k.filter(q=>q.id!==c);K.length>0&&(h[v]=K)}fe.value=h}function T(c){if(c.method==="server/request"){const h=fn(c.params);return h&&hn(h),!0}if(c.method==="server/request/resolved"){const h=Le(c.params),v=h==null?void 0:h.id;return typeof v=="number"&&Number.isInteger(v)&&or(v),!0}return!1}function R(c){return c.replace(/\s+/gu," ").trim()}function P(c){const h=At(c);if(!h)return null;if(c.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const v=Le(c.params),k=Le(v==null?void 0:v.item),K=Re(k==null?void 0:k.type).toLowerCase();if(K==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(K==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(K==="commandexecution"){const q=Re(k==null?void 0:k.command);return{threadId:h,activity:{label:"Running command",details:q?[q]:[]}}}}return c.method==="item/commandExecution/outputDelta"?{threadId:h,activity:{label:"Running command",details:[]}}:c.method==="item/reasoning/summaryTextDelta"||c.method==="item/reasoning/summaryPartAdded"?{threadId:h,activity:{label:"Thinking",details:[]}}:c.method==="item/agentMessage/delta"?{threadId:h,activity:{label:"Writing response",details:[]}}:null}function J(c){if(c.method!=="turn/started")return null;const h=Le(c.params);if(!h)return null;const v=At(c);if(!v)return null;const k=Le(h.turn),K=Re(k==null?void 0:k.id)||Re(h.turnId)||`${v}:unknown`;if(!K)return null;const q=$n(Re(k==null?void 0:k.startedAt))??$n(Re(h.startedAt))??$n(c.atIso)??Date.now();return{threadId:v,turnId:K,startedAtMs:q}}function Ue(c){if(c.method!=="turn/completed")return null;const h=Le(c.params);if(!h)return null;const v=At(c);if(!v)return null;const k=Le(h.turn),K=Re(k==null?void 0:k.id)||Re(h.turnId)||`${v}:unknown`;if(!K)return null;const q=$n(Re(k==null?void 0:k.completedAt))??$n(Re(h.completedAt))??$n(c.atIso)??Date.now(),we=$n(Re(k==null?void 0:k.startedAt))??$n(Re(h.startedAt))??void 0;return{threadId:v,turnId:K,completedAtMs:q,startedAtMs:we}}function wt(c){return`${c}:live-reasoning`}function Bt(c){const h=Le(c.params);if(!h)return"";if(c.method==="item/started"){const v=Le(h.item);return!v||v.type!=="reasoning"?"":Re(v.id)}return""}function ir(c){const h=Le(c.params);if(!h)return null;if(c.method==="item/reasoning/summaryTextDelta"){const v=Re(h.itemId),k=Re(h.delta);return!v||!k?null:{messageId:wt(v),delta:k}}return null}function ar(c){const h=Le(c.params);if(!h)return"";if(c.method==="item/reasoning/summaryPartAdded"){const v=Re(h.itemId);return v?wt(v):""}return""}function qt(c){const h=Le(c.params);if(!h)return"";if(c.method==="item/completed"){const v=Le(h.item);return!v||v.type!=="reasoning"?"":wt(Re(v.id))}return""}function An(c){const h=Le(c.params);if(!h)return"";if(c.method==="item/started"){const v=Le(h.item);return!v||v.type!=="agentMessage"?"":Re(v.id)}return""}function Vn(c){const h=Le(c.params);if(!h)return null;if(c.method==="item/agentMessage/delta"){const v=Re(h.itemId),k=Re(h.delta);return!v||!k?null:{messageId:v,delta:k}}return null}function Cr(c){const h=Le(c.params);if(!h)return null;if(c.method==="item/completed"){const v=Le(h.item);if(!v||v.type!=="agentMessage")return null;const k=Re(v.id),K=Re(v.text);return!k||!K?null:{id:k,role:"assistant",text:K,messageType:"agentMessage.live"}}return null}function j(c){if(c.method!=="item/started")return null;const h=Le(c.params),v=Le(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const k=Re(v.id),K=Re(v.command);if(!k)return null;const q=typeof v.cwd=="string"?v.cwd:null;return{id:k,role:"system",text:K,messageType:"commandExecution",commandExecution:{command:K,cwd:q,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function ye(c){if(c.method!=="item/commandExecution/outputDelta")return null;const h=Le(c.params);if(!h)return null;const v=Re(h.itemId),k=Re(h.delta);return!v||!k?null:{itemId:v,delta:k}}function Fe(c){if(c.method!=="item/completed")return null;const h=Le(c.params),v=Le(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const k=Re(v.id),K=Re(v.command);if(!k)return null;const q=typeof v.cwd=="string"?v.cwd:null,we=Re(v.status),Ee=we==="failed"?"failed":we==="declined"?"declined":we==="interrupted"?"interrupted":"completed",ge=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",We=typeof v.exitCode=="number"?v.exitCode:null;return{id:k,role:"system",text:K,messageType:"commandExecution",commandExecution:{command:K,cwd:q,status:Ee,aggregatedOutput:ge,exitCode:We}}}function bt(c,h){const v=i.value[c]??[],k=Ya(v,h);k!==v&&(i.value={...i.value,[c]:k})}function Ft(c,h){const v=i.value[c];if(!v||v.length===0)return;const k=new Set(h.map(q=>q.id)),K=v.filter(q=>!k.has(q.id));K.length!==v.length&&(K.length===0?i.value=St(i.value,c):i.value={...i.value,[c]:K})}function Qt(c){if(c.method==="item/agentMessage/delta")return!0;const h=Le(c.params);if(!h)return!1;if(c.method==="item/completed"){const v=Le(h.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function lr(c){var yi,wi,bi,_i;if(T(c))return;if(c.method==="thread/name/updated"){const He=Le(c.params),sn=Re(He==null?void 0:He.threadId),Wn=Re(He==null?void 0:He.threadName);sn&&Wn&&(Z.value={...Z.value,[sn]:Wn},$e(),Ha(sn,Wn))}const h=P(c);h&&G(h.threadId,h.activity);const v=J(c);v&&(pe.set(v.turnId,v),le.value={...le.value,[v.threadId]:v.turnId},m(v.threadId,null),se(v.threadId,null),C(v.threadId,!0),d.value[v.threadId]&&(d.value=St(d.value,v.threadId)));const k=Ue(c),K=Sr(c),we=!!((k==null?void 0:k.threadId)??At(c))&&!!K&&f.value!==Kt&&cs(new Error(K));if(k){const He=pe.get(k.turnId);He&&pe.delete(k.turnId);const sn=sr((yi=Le(c.params))==null?void 0:yi.durationMs)??sr((bi=Le((wi=Le(c.params))==null?void 0:wi.turn))==null?void 0:bi.durationMs)??(typeof k.startedAtMs=="number"?k.completedAtMs-k.startedAtMs:null)??(He?k.completedAtMs-He.startedAtMs:null),Wn=typeof sn=="number"?Math.max(0,sn):0;m(k.threadId,{turnId:k.turnId,durationMs:Wn}),le.value[k.threadId]&&(le.value=St(le.value,k.threadId)),C(k.threadId,!1),G(k.threadId,null),I(k.threadId),we||(me(k.threadId),hi(k.threadId))}if(K){const He=(k==null?void 0:k.threadId)||At(c);He&&se(He,K),Te.value=K,He&&we&&re(He)}else k&&se(k.threadId,null);const Ee=xr(c);if(Ee){const He=At(c);He&&se(He,Ee),Te.value=Ee,f.value!==Kt&&cs(new Error(Ee))&&(He?re(He):Y())}const ge=At(c);if(!ge||ge!==n.value)return;An(c);const We=Vn(c);if(We){const He=(s.value[ge]??[]).find(Wn=>Wn.id===We.messageId),sn=`${(He==null?void 0:He.text)??""}${We.delta}`;ft(ge,{id:We.messageId,role:"assistant",text:sn,messageType:"agentMessage.live"})}const vt=Cr(c);vt&&ft(ge,vt),Bt(c);const cr=ir(c);if(cr&&Jt(ge,cr.delta),ar(c)){const He=o.value[ge]??"";He.trim().length>0&&!He.endsWith(`
45
+
46
+ `)&&Lt(ge,`${He}
47
+
48
+ `)}qt(c);const En=j(c);En&&(bt(ge,En),G(ge,{label:"Running command",details:[((_i=En.commandExecution)==null?void 0:_i.command)??""]}));const Hs=ye(c);if(Hs){const He=(i.value[ge]??[]).find(sn=>sn.id===Hs.itemId);He!=null&&He.commandExecution&&bt(ge,{...He,commandExecution:{...He.commandExecution,aggregatedOutput:`${He.commandExecution.aggregatedOutput}${Hs.delta}`}})}const vi=Fe(c);if(vi&&bt(ge,vi),Qt(c)&&(Q&&n.value&&Xe(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),Tt(ge)),c.method==="turn/completed"){Q=!1,Tt(ge),i.value[ge]&&(i.value=St(i.value,ge));const He=At(c);He&&(C(He,!1),G(He,null),I(He),we||(me(He),hi(He)))}}function jc(c){const h=At(c);h&&A.add(h);const v=c.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(de=!0),!(Ge!==null||typeof window>"u")&&(Ge=window.setTimeout(()=>{Ge=null,qn()},uo))}async function Lc(c){if(!X){X=!0;try{const h=await Ba(),v=[];for(const k of h.order){const K=po(k);v.includes(K)||v.push(K)}if(v.length>0){const k=ls(v,c);Zn(E.value,k)||(E.value=k,dr(E.value))}if(Object.keys(h.labels).length>0){const k={...B.value};let K=!1;for(const[q,we]of Object.entries(h.labels)){const Ee=po(q);k[Ee]!==we&&(k[Ee]=we,K=!0)}K&&(B.value=k,fo(k))}}catch{}}}async function Dc(){if(!(Object.keys(Z.value).length>0))try{const c=await Zv();Object.keys(c.titles).length>0&&(Z.value=c.titles)}catch{}}async function Bc(c,h,v){if(Z.value[c])return;const k=h.trim();if(!k)return;const K=k.length>300?k.slice(0,300):k;try{const q=await ey(K,v);if(!q||Z.value[c])return;Z.value={...Z.value,[c]:q},$e(),Ha(c,q)}catch{}}async function ts(){var c;ht.value||(ee.value=!0);try{const[h]=await Promise.all([jv(),Dc()]);await Lc(h);const v=ls(E.value,h);Zn(E.value,v)||(E.value=v,dr(E.value));const k=ho(h,E.value),K=u0(t.value,k,a.value);t.value=us(t.value,K),a.value=Et(a.value,new Set(On(t.value).map(Ee=>Ee.id))),$e(),ht.value=!0;const q=On(e.value);L(q),q.some(Ee=>Ee.id===n.value)||ne(((c=q[0])==null?void 0:c.id)??"")}finally{ee.value=!1}}async function Ar(c,h={}){if(!c)return;const v=M.value[c]===!0,k=h.silent!==!0&&!v;k&&(Oe.value=!0);try{U.value[c]!==!0&&(await lo(c),U.value={...U.value,[c]:!0});const K=await Lv(c),q=r.value[c]??[],we=Zb(q,K,{preserveMissing:h.silent===!0});ze(c,we);const Ee=s.value[c]??[],ge=e0(Ee,K);Ze(c,ge),Ft(c,K),M.value={...M.value,[c]:!0};const We=Ce(c);We&&(W.value={...W.value,[c]:We}),z(c)}finally{k&&(Oe.value=!1)}}async function di(){try{const c=t.value.flatMap(h=>h.threads.map(v=>v.cwd)).filter(Boolean);he.value=await ty(c.length>0?[...new Set(c)]:void 0)}catch{}}async function Fc(){Te.value="";try{await ts(),await Promise.all([je(),di()]),await Ar(n.value)}catch(c){Te.value=c instanceof Error?c.message:"Unknown application error"}}async function Hc(c){ne(c);try{await Ar(c)}catch(h){Te.value=h instanceof Error?h.message:"Unknown application error"}}async function Uc(c){try{await Hv(c),await ts(),n.value===c&&await Ar(n.value)}catch(h){Te.value=h instanceof Error?h.message:"Unknown application error"}}async function fi(c,h=[],v=[],k="steer",K=[]){const q=n.value,we=c.trim();if(!q||!we&&h.length===0&&K.length===0)return;const Ee=a.value[q]===!0;if(Ee&&k==="queue"){const ge=l.value[q]??[],We=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[q]:[...ge,{id:We,text:we,imageUrls:h,skills:v,fileAttachments:K}]};return}if(Ee){Q=!0,ns(q,we,h,v,K).catch(ge=>{const We=ge instanceof Error?ge.message:"Unknown application error";se(q,We),Te.value=We});return}Te.value="",Q=!0,m(q,null),G(q,{label:"Thinking",details:xe(f.value,g.value)}),se(q,null),C(q,!0);try{await ns(q,we,h,v,K)}catch(ge){Q=!1,C(q,!1),G(q,null);const We=ge instanceof Error?ge.message:"Unknown application error";throw se(q,We),Te.value=We,ge}}async function Vc(c,h,v=[],k=[],K=[]){const q=c.trim(),we=h.trim(),Ee=f.value.trim();if(!q&&v.length===0&&K.length===0)return"";qe.value=!0,Te.value="";let ge="";try{try{ge=await Da(we||void 0,Ee||void 0)}catch(pn){if(Ee&&Ee!==Kt&&cs(pn))await Y(),ge=await Da(we||void 0,Kt);else throw pn}if(!ge)return"";st(ge,we,q||"[Image]"),U.value={...U.value,[ge]:!0},ne(ge),Q=!0,m(ge,null),G(ge,{label:"Thinking",details:xe(f.value,g.value)}),se(ge,null),C(ge,!0);const We=ge,vt=we||null,cr=q;return ns(ge,q,v,k,K).catch(pn=>{Q=!1,C(ge,!1),G(ge,null);const En=pn instanceof Error?pn.message:"Unknown application error";se(ge,En),Te.value=En}).finally(()=>{qe.value=!1}),Bc(We,cr,vt),ge}catch(We){Q=!1,ge&&(C(ge,!1),G(ge,null));const vt=We instanceof Error?We.message:"Unknown application error";throw ge&&se(ge,vt),Te.value=vt,qe.value=!1,We}}async function ns(c,h,v=[],k=[],K=[]){const q=f.value.trim(),we=g.value,Ee=h.trim(),ge=k.map(vt=>({name:vt.name,path:vt.path})),We=K.map(vt=>({...vt}));V(c,{text:Ee,imageUrls:[...v],skills:ge,fileAttachments:We,effort:we,fallbackRetried:!1});try{U.value[c]!==!0&&await lo(c);try{await co(c,h,v,q||void 0,we||void 0,k.length>0?k:void 0,K)}catch(vt){if(q&&q!==Kt&&cs(vt))await Y(),V(c,{text:Ee,imageUrls:[...v],skills:ge,fileAttachments:We,effort:we,fallbackRetried:!0}),await co(c,h,v,Kt,we||void 0,k.length>0?k:void 0,K);else throw vt}U.value={...U.value,[c]:!0},A.add(c),de=!0,await qn()}catch(vt){throw vt}}async function hi(c){const h=l.value[c];if(!h||h.length===0)return;const[v,...k]=h;l.value=k.length>0?{...l.value,[c]:k}:St(l.value,c),qe.value=!0,Te.value="",Q=!0,m(c,null),G(c,{label:"Thinking",details:xe(f.value,g.value)}),se(c,null),C(c,!0);try{await ns(c,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{C(c,!1),G(c,null)}finally{qe.value=!1}}async function qc(){const c=n.value;if(!c||a.value[c]!==!0)return;const h=le.value[c];rt.value=!0,Te.value="";try{await qv(c,h),C(c,!1),G(c,null),se(c,null),le.value[c]&&(le.value=St(le.value,c)),A.add(c),de=!0,await qn()}catch(v){const k=v instanceof Error?v.message:"Failed to interrupt active turn";se(c,k),Te.value=k}finally{rt.value=!1}}async function Wc(c){const h=n.value;if(!h||Ne.value)return;const k=(r.value[h]??[]).reduce((q,we)=>typeof we.turnIndex=="number"&&we.turnIndex>q?we.turnIndex:q,-1);if(k<0||c>k)return;const K=k-c+1;if(!(K<1)){Ne.value=!0,Te.value="";try{const q=await La(h,K);ze(h,q),Ze(h,[]),Tt(h),i.value[h]&&(i.value=St(i.value,h)),m(h,null),G(h,null),se(h,null),de=!0,await qn()}catch(q){Te.value=q instanceof Error?q.message:"Failed to rollback thread"}finally{Ne.value=!1}}}function Kc(c,h){c.length===0||(B.value[c]??"")===h||(B.value={...B.value,[c]:h},fo(B.value))}function Gc(c){var K;if(c.length===0)return;const h=E.value.filter(q=>q!==c);if(Zn(E.value,h)||(E.value=h,dr(E.value)),t.value=t.value.filter(q=>q.projectName!==c),B.value[c]!==void 0){const q={...B.value};delete q[c],B.value=q,fo(q)}$e();const v=On(e.value);L(v),v.some(q=>q.id===n.value)||ne(((K=v[0])==null?void 0:K.id)??""),Fs()}function zc(c,h){if(c.length===0||t.value.length===0)return;const v=t.value.map(ge=>ge.projectName),k=v.indexOf(c);if(k===-1)return;const K=Math.max(0,Math.min(h,v.length-1)),q=Qb(v,k,K);if(q===v)return;const we=ls(q,t.value);E.value=we,dr(E.value);const Ee=ho(t.value,E.value);t.value=us(t.value,Ee),$e(),Fs()}function Yc(c){const h=c.trim();if(!h)return;const v=[h,...E.value.filter(K=>K!==h)];if(Zn(E.value,v))return;E.value=v,dr(E.value);const k=ho(t.value,E.value);t.value=us(t.value,k),$e(),Fs()}async function Fs(){var c,h;try{const v=await Ba(),k=new Map;for(const we of v.order){const Ee=po(we);k.has(Ee)||k.set(Ee,we)}for(const we of t.value){const Ee=((h=(c=we.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";Ee&&k.set(we.projectName,Ee)}const K=[];for(const we of E.value){const Ee=k.get(we);Ee&&!K.includes(Ee)&&K.push(Ee)}for(const we of v.order)K.includes(we)||K.push(we);const q=v.active.filter(we=>K.includes(we));q.length===0&&K.length>0&&q.push(K[0]),await Yv({order:K,labels:v.labels,active:q})}catch{}}async function Jc(){if(!Ae.value){Ae.value=!0;try{if(await ts(),!n.value)return;const c=n.value,h=Ce(c),v=W.value[c]??"",k=h.length>0&&h!==v;(a.value[c]===!0||k)&&await Ar(c,{silent:!0})}catch{}finally{Ae.value=!1}}}async function qn(){if(Ae.value){typeof window<"u"&&Ge===null&&(Ge=window.setTimeout(()=>{Ge=null,qn()},uo));return}Ae.value=!0;const c=de,h=new Set(A);de=!1,A.clear();try{c&&await ts();const v=n.value;if(!v)return;const k=h.has(v),K=a.value[v]===!0,q=Ce(v),we=W.value[v]??"",Ee=q.length>0&&q!==we;(k||K||Ee||c)&&await Ar(v,{silent:!0})}catch{}finally{Ae.value=!1,(de||A.size>0)&&typeof window<"u"&&Ge===null&&(Ge=window.setTimeout(()=>{Ge=null,qn()},uo))}}function Qc(){typeof window>"u"||Ye||(it.value&&mi(),Xc(),Ye=Dv(c=>{lr(c),jc(c)}))}async function Xc(){try{const c=await Fv();for(const h of c){const v=fn(h);v&&hn(v)}}catch{}}async function Zc(c){try{await Bv(c.id,{result:c.result,error:c.error}),or(c.id)}catch(h){Te.value=h instanceof Error?h.message:"Failed to reply to server request"}}function pi(c={}){const h=c.updatePreference??!0;ue!==null&&typeof window<"u"&&(window.clearInterval(ue),ue=null),Se!==null&&typeof window<"u"&&(window.clearInterval(Se),Se=null),h&&(it.value=!1,Ga(!1)),Qe.value=Math.floor(Mr/1e3)}function mi(){typeof window>"u"||ue!==null||Se!==null||(it.value=!0,Ga(!0),Qe.value=Math.floor(Mr/1e3),ue=window.setInterval(()=>{Qe.value=Math.floor(Mr/1e3),Jc()},Mr),Se=window.setInterval(()=>{Qe.value=Math.max(0,Qe.value-1)},1e3))}function eu(){if(it.value){pi();return}mi()}function tu(){pi({updatePreference:!1}),Ye&&(Ye(),Ye=null),de=!1,A.clear(),pe.clear(),Ge!==null&&typeof window<"u"&&(window.clearTimeout(Ge),Ge=null),Q=!1,r.value={},s.value={},o.value={},i.value={},ae.value={},F.value={},ie.value={},le.value={},l.value={}}const nu=ce(()=>{const c=n.value;return c?l.value[c]??[]:[]});function gi(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const k=v.filter(K=>K.id!==c);l.value=k.length>0?{...l.value,[h]:k}:St(l.value,h)}function ru(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const k=v.find(K=>K.id===c);k&&(gi(c),fi(k.text,k.imageUrls,k.skills,"steer",k.fileAttachments))}return{projectGroups:e,projectDisplayNameById:B,selectedThread:y,selectedThreadScrollState:x,selectedThreadServerRequests:O,selectedLiveOverlay:H,selectedThreadId:n,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:g,installedSkills:he,messages:N,isLoadingThreads:ee,isLoadingMessages:Oe,isSendingMessage:qe,isInterruptingTurn:rt,isAutoRefreshEnabled:it,autoRefreshSecondsLeft:Qe,error:Te,refreshAll:Fc,refreshSkills:di,selectThread:Hc,setThreadScrollState:Xe,archiveThreadById:Uc,sendMessageToSelectedThread:fi,sendMessageToNewThread:Vc,interruptSelectedThreadTurn:qc,rollbackSelectedThread:Wc,isRollingBack:Ne,selectedThreadQueuedMessages:nu,removeQueuedMessage:gi,steerQueuedMessage:ru,setSelectedModelId:te,setSelectedReasoningEffort:be,respondToPendingServerRequest:Zc,renameProject:Kc,removeProject:Gc,reorderProject:zc,pinProjectToTop:Yc,toggleAutoRefreshTimer:eu,startPolling:Qc,stopPolling:tu}}const p0={class:"sidebar-root"},m0=["aria-pressed"],g0={key:1,class:"sidebar-search-bar"},v0={class:"content-root"},y0={class:"content-body"},w0={key:1,class:"content-grid"},b0={class:"new-thread-empty"},_0={key:2,class:"content-grid"},k0={class:"content-thread"},T0={class:"composer-with-queue"},S0={class:"build-badge","aria-label":"Worktree name"},Ja="codex-web-local.sidebar-collapsed.v1",x0=Ct({__name:"App",setup(e){const t="codex-web-local",{projectGroups:n,projectDisplayNameById:r,selectedThread:s,selectedThreadScrollState:o,selectedThreadServerRequests:i,selectedLiveOverlay:a,selectedThreadId:l,availableModelIds:d,selectedModelId:u,selectedReasoningEffort:f,installedSkills:g,messages:b,isLoadingThreads:$,isLoadingMessages:E,isInterruptingTurn:B,isAutoRefreshEnabled:W,autoRefreshSecondsLeft:M,refreshAll:U,refreshSkills:F,selectThread:ae,setThreadScrollState:ie,archiveThreadById:le,sendMessageToSelectedThread:fe,sendMessageToNewThread:oe,interruptSelectedThreadTurn:Z,rollbackSelectedThread:he,isRollingBack:ee,selectedThreadQueuedMessages:Oe,removeQueuedMessage:qe,steerQueuedMessage:rt,setSelectedModelId:Ne,setSelectedReasoningEffort:Te,respondToPendingServerRequest:Ae,renameProject:ht,removeProject:it,reorderProject:Qe,pinProjectToTop:Ye,toggleAutoRefreshTimer:Ge,startPolling:ue,stopPolling:Se}=h0(),de=Vh(),A=Uh(),{isMobile:X}=xc(),Q=D(!1),pe=D(!1),ke=D(""),p=D(ir()),y=D(""),x=D(!1),O=D(null),H=D("New Project (1)"),N=D(""),ne=ce(()=>{const j=de.params.threadId;return typeof j=="string"?j:""}),te=ce(()=>{const j=new Set;for(const ye of n.value)for(const Fe of ye.threads)j.add(Fe.id);return j}),Y=ce(()=>de.name==="home"),V=ce(()=>de.name==="skills"),me=ce(()=>{var j;return V.value?"Skills":Y.value?"New thread":((j=s.value)==null?void 0:j.title)??"Choose a thread"}),re=ce(()=>W.value?`Auto refresh in ${String(M.value)}s`:"Enable 4s refresh"),be=ce(()=>b.value.filter(j=>{const ye=qt(j.messageType,j.role);return ye==="worked"?!0:!(ye==="turnActivity.live"||ye==="turnError.live"||ye==="agentReasoning.live")})),xe=ce(()=>a.value),je=ce(()=>Y.value?"__new-thread__":l.value),Ve=ce(()=>{var j,ye;return Y.value?ke.value.trim():((ye=(j=s.value)==null?void 0:j.cwd)==null?void 0:ye.trim())??""}),$e=ce(()=>{var j;return!Y.value&&((j=s.value)==null?void 0:j.inProgress)===!0}),st=ce(()=>{var bt,Ft;const j=[],ye=new Set;for(const Qt of n.value){const lr=((Ft=(bt=Qt.threads[0])==null?void 0:bt.cwd)==null?void 0:Ft.trim())??"";!lr||ye.has(lr)||(ye.add(lr),j.push({value:lr,label:r.value[Qt.projectName]??Qt.projectName}))}const Fe=ke.value.trim();return Fe&&!ye.has(Fe)&&j.unshift({value:Fe,label:R(Fe)}),j});Hn(()=>{window.addEventListener("keydown",Le),An(),or(),fn()}),Ns(()=>{window.removeEventListener("keydown",Le),Se()});function L(){F()}function z(){x.value=!x.value,x.value?zt(()=>{var j;return(j=O.value)==null?void 0:j.focus()}):y.value=""}function m(){var j;y.value="",(j=O.value)==null||j.focus()}function C(j){j.key==="Escape"&&(x.value=!1,y.value="")}function I(j){j&&(de.name==="thread"&&ne.value===j||(A.push({name:"thread",params:{threadId:j}}),X.value&&Tt(!0)))}function G(j){le(j)}function se(j){var bt,Ft;const ye=n.value.find(Qt=>Qt.projectName===j),Fe=((Ft=(bt=ye==null?void 0:ye.threads[0])==null?void 0:bt.cwd)==null?void 0:Ft.trim())??"";Fe&&(ke.value=Fe),X.value&&Tt(!0),!Y.value&&A.push({name:"home"})}function Ce(){var ye,Fe;const j=((Fe=(ye=s.value)==null?void 0:ye.cwd)==null?void 0:Fe.trim())??"";j&&(ke.value=j),X.value&&Tt(!0),!Y.value&&A.push({name:"home"})}function Xe(j){ht(j.projectName,j.displayName)}function ze(j){it(j)}function Ze(j){Qe(j.projectName,j.toIndex)}function ft(j){ie(j.threadId,j.state)}function Lt(j){Ae(j)}function Jt(){Ge()}function Tt(j){p.value!==j&&(p.value=j,ar(j))}function Le(j){j.defaultPrevented||!j.ctrlKey&&!j.metaKey||j.shiftKey||j.altKey||j.key.toLowerCase()==="b"&&(j.preventDefault(),Tt(!p.value))}function Re(j){const ye=j.text;if(Y.value){Cr(ye,j.imageUrls,j.skills,j.fileAttachments);return}fe(ye,j.imageUrls,j.skills,j.mode,j.fileAttachments)}function sr(j){ke.value=j.trim()}async function At(j){const ye=j.trim();if(!ye)return;const Fe=xr(ye),bt=await Sr(),Ft=Fe?ye:P(bt,ye);if(Ft)try{const Qt=await Jv(Ft,{createIfMissing:!Fe,label:Fe?"":ye});Qt&&(ke.value=Qt,Ye(R(Qt)),fn())}catch{}}async function Sr(){const j=hn();if(j)return j;try{const ye=await Fa();if(ye)return N.value=ye,ye}catch{}return""}function xr(j){return j?j.startsWith("~/")||j.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(j):!1}async function fn(){const j=hn();if(!j){H.value="New Project (1)";return}try{const ye=await Qv(j);H.value=ye.name||"New Project (1)"}catch{H.value="New Project (1)"}}function hn(){var Fe,bt;const j=ke.value.trim();if(j)return T(j);const ye=((bt=(Fe=st.value[0])==null?void 0:Fe.value)==null?void 0:bt.trim())??"";return ye?T(ye):N.value.trim()}async function or(){try{N.value=await Fa()}catch{N.value=""}}function T(j){const ye=j.trim().replace(/\/+$/,"");if(!ye)return"";const Fe=ye.lastIndexOf("/");return Fe<=0?"":ye.slice(0,Fe)}function R(j){const ye=j.trim().replace(/\/+$/,"");if(!ye)return"";const Fe=ye.lastIndexOf("/");return Fe<0?ye:ye.slice(Fe+1)}function P(j,ye){const Fe=j.trim().replace(/\/+$/,""),bt=ye.trim().replace(/^\/+/,"");return!Fe||!bt?"":`${Fe}/${bt}`}function J(j){Ne(j)}function Ue(j){Te(j)}function wt(){Z()}function Bt(j){he(j.turnIndex)}function ir(){return typeof window>"u"?!1:window.localStorage.getItem(Ja)==="1"}function ar(j){typeof window>"u"||window.localStorage.setItem(Ja,j?"1":"0")}function qt(j,ye){const Fe=(j??"").trim();return Fe.length>0?Fe:ye.trim()||"message"}async function An(){await U(),pe.value=!0,await Vn(),ue()}async function Vn(){if(!Q.value){Q.value=!0;try{if(de.name==="home"||de.name==="skills"){l.value!==""&&await ae("");return}if(de.name==="thread"){const j=ne.value;if(!j)return;if(!te.value.has(j)){await A.replace({name:"home"});return}l.value!==j&&await ae(j);return}}finally{Q.value=!1}}}pt(()=>[de.name,ne.value,$.value,te.value.has(ne.value),l.value],async()=>{pe.value&&await Vn()}),pt(()=>l.value,async j=>{if(pe.value&&!Q.value&&!(Y.value||V.value)){if(!j){de.name!=="home"&&await A.replace({name:"home"});return}de.name==="thread"&&ne.value===j||await A.replace({name:"thread",params:{threadId:j}})}}),pt(()=>st.value,j=>{if(j.length===0){ke.value="";return}j.some(Fe=>Fe.value===ke.value)||(ke.value=j[0].value),fn()},{immediate:!0}),pt(()=>ke.value,()=>{fn()}),pt(X,j=>{j&&!p.value&&Tt(!0)});async function Cr(j,ye=[],Fe=[],bt=[]){try{const Ft=await oe(j,ke.value,ye,Fe,bt);if(!Ft)return;await A.replace({name:"thread",params:{threadId:Ft}})}catch{}}return(j,ye)=>(_(),S(De,null,[Ie(Yh,{"is-sidebar-collapsed":p.value,onCloseSidebar:ye[4]||(ye[4]=Fe=>Tt(!0))},{sidebar:ot(()=>[w("section",p0,[p.value?ve("",!0):(_(),at(qa,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":p.value,"is-auto-refresh-enabled":Me(W),"auto-refresh-button-label":re.value,"show-new-thread-button":!0,onToggleSidebar:ye[0]||(ye[0]=Fe=>Tt(!p.value)),onToggleAutoRefresh:Jt,onStartNewThread:Ce},{default:ot(()=>[w("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":x.value,"aria-label":"Search threads",title:"Search threads",onClick:z},[Ie(Oo,{class:"sidebar-search-toggle-icon"})],8,m0)]),_:1},8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])),!p.value&&x.value?(_(),S("div",g0,[Ie(Oo,{class:"sidebar-search-bar-icon"}),Ln(w("input",{ref_key:"sidebarSearchInputRef",ref:O,"onUpdate:modelValue":ye[1]||(ye[1]=Fe=>y.value=Fe),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:C},null,544),[[Bn,y.value]]),y.value.length>0?(_(),S("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:m},[Ie(li,{class:"sidebar-search-clear-icon"})])):ve("",!0)])):ve("",!0),p.value?ve("",!0):(_(),S("button",{key:2,class:ut(["sidebar-skills-link",{"is-active":V.value}]),type:"button",onClick:ye[2]||(ye[2]=Fe=>{Me(A).push({name:"skills"}),Me(X)&&Tt(!0)})}," Skills Hub ",2)),p.value?ve("",!0):(_(),at($m,{key:3,groups:Me(n),"project-display-name-by-id":Me(r),"selected-thread-id":Me(l),"is-loading":Me($),"search-query":y.value,onSelect:I,onArchive:G,onStartNewThread:se,onRenameProject:Xe,onRemoveProject:ze,onReorderProject:Ze},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query"]))])]),content:ot(()=>[w("section",v0,[Ie(Lm,{title:me.value},{leading:ot(()=>[p.value||Me(X)?(_(),at(qa,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":p.value,"is-auto-refresh-enabled":Me(W),"auto-refresh-button-label":re.value,"show-new-thread-button":!0,onToggleSidebar:ye[3]||(ye[3]=Fe=>Tt(!p.value)),onToggleAutoRefresh:Jt,onStartNewThread:Ce},null,8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])):ve("",!0)]),_:1},8,["title"]),w("section",y0,[V.value?(_(),at(Cb,{key:0,onSkillsChanged:L})):Y.value?(_(),S("div",w0,[w("div",b0,[ye[5]||(ye[5]=w("p",{class:"new-thread-hero"},"Let's build",-1)),Ie(No,{class:"new-thread-folder-dropdown","model-value":ke.value,options:st.value,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project","show-add-action":!0,"add-action-label":"+ Add new project","default-add-value":H.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":sr,onAdd:At},null,8,["model-value","options","default-add-value"])]),Ie(Ua,{"active-thread-id":je.value,cwd:Ve.value,models:Me(d),"selected-model":Me(u),"selected-reasoning-effort":Me(f),skills:Me(g),"is-turn-in-progress":!1,"is-interrupting-turn":!1,onSubmit:Re,"onUpdate:selectedModel":J,"onUpdate:selectedReasoningEffort":Ue},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills"])])):(_(),S("div",_0,[w("div",k0,[Ie(hv,{messages:be.value,"is-loading":Me(E),"active-thread-id":je.value,"scroll-state":Me(o),"live-overlay":xe.value,"pending-requests":Me(i),"is-turn-in-progress":$e.value,"is-rolling-back":Me(ee),onUpdateScrollState:ft,onRespondServerRequest:Lt,onRollback:Bt},null,8,["messages","is-loading","active-thread-id","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),w("div",T0,[Ie(Rw,{messages:Me(Oe),onSteer:Me(rt),onDelete:Me(qe)},null,8,["messages","onSteer","onDelete"]),Ie(Ua,{"active-thread-id":je.value,cwd:Ve.value,models:Me(d),"selected-model":Me(u),"selected-reasoning-effort":Me(f),skills:Me(g),"is-turn-in-progress":$e.value,"is-interrupting-turn":Me(B),"has-queue-above":Me(Oe).length>0,onSubmit:Re,"onUpdate:selectedModel":J,"onUpdate:selectedReasoningEffort":Ue,onInterrupt:wt},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),w("div",S0," WT "+_e(Me(t)),1)],64))}}),C0=Ke(x0,[["__scopeId","data-v-a165fa31"]]),mo={render:()=>null},A0=Hh({history:wh(),routes:[{path:"/",name:"home",component:mo},{path:"/thread/:threadId",name:"thread",component:mo},{path:"/skills",name:"skills",component:mo},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns/codexui");Mf(C0).use(A0).mount("#app");