codexapp 0.1.31 → 0.1.32

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.
@@ -1,48 +0,0 @@
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 li(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const mt={},Mr=[],hn=()=>{},gl=()=>!1,Gs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ci=e=>e.startsWith("onUpdate:"),xt=Object.assign,ui=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},du=Object.prototype.hasOwnProperty,ot=(e,t)=>du.call(e,t),Be=Array.isArray,Pr=e=>ws(e)==="[object Map]",vl=e=>ws(e)==="[object Set]",Hi=e=>ws(e)==="[object Date]",Ve=e=>typeof e=="function",_t=e=>typeof e=="string",nn=e=>typeof e=="symbol",it=e=>e!==null&&typeof e=="object",yl=e=>(it(e)||Ve(e))&&Ve(e.then)&&Ve(e.catch),wl=Object.prototype.toString,ws=e=>wl.call(e),fu=e=>ws(e).slice(8,-1),bl=e=>ws(e)==="[object Object]",di=e=>_t(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ns=li(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),zs=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},hu=/-\w/g,Zt=zs(e=>e.replace(hu,t=>t.slice(1).toUpperCase())),pu=/\B([A-Z])/g,Jn=zs(e=>e.replace(pu,"-$1").toLowerCase()),Ys=zs(e=>e.charAt(0).toUpperCase()+e.slice(1)),uo=zs(e=>e?`on${Ys(e)}`:""),zn=(e,t)=>!Object.is(e,t),$s=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},_l=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},fi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},mu=e=>{const t=_t(e)?Number(e):NaN;return isNaN(t)?e:t};let Ui;const Js=()=>Ui||(Ui=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function vr(e){if(Be(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=_t(r)?wu(r):vr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(_t(e)||it(e))return e}const gu=/;(?![^(]*\))/g,vu=/:([^]+)/,yu=/\/\*[^]*?\*\//g;function wu(e){const t={};return e.replace(yu,"").split(gu).forEach(n=>{if(n){const r=n.split(vu);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ut(e){let t="";if(_t(e))t=e;else if(Be(e))for(let n=0;n<e.length;n++){const r=ut(e[n]);r&&(t+=r+" ")}else if(it(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const bu="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",_u=li(bu);function kl(e){return!!e||e===""}function ku(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=hi(e[r],t[r]);return n}function hi(e,t){if(e===t)return!0;let n=Hi(e),r=Hi(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=nn(e),r=nn(t),n||r)return e===t;if(n=Be(e),r=Be(t),n||r)return n&&r?ku(e,t):!1;if(n=it(e),r=it(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||!hi(e[i],t[i]))return!1}}return String(e)===String(t)}const Tl=e=>!!(e&&e.__v_isRef===!0),de=e=>_t(e)?e:e==null?"":Be(e)||it(e)&&(e.toString===wl||!Ve(e.toString))?Tl(e)?de(e.value):JSON.stringify(e,Sl,2):String(e),Sl=(e,t)=>Tl(t)?Sl(e,t.value):Pr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[fo(r,o)+" =>"]=s,n),{})}:vl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>fo(n))}:nn(t)?fo(t):it(t)&&!Be(t)&&!bl(t)?String(t):t,fo=(e,t="")=>{var n;return nn(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 qt;class Tu{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=qt,!t&&qt&&(this.index=(qt.scopes||(qt.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=qt;try{return qt=this,t()}finally{qt=n}}}on(){++this._on===1&&(this.prevScope=qt,qt=this)}off(){this._on>0&&--this._on===0&&(qt=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 Su(){return qt}let gt;const ho=new WeakSet;class xl{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,qt&&qt.active&&qt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ho.has(this)&&(ho.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||El(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Vi(this),Al(this);const t=gt,n=en;gt=this,en=!0;try{return this.fn()}finally{Il(this),gt=t,en=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)gi(t);this.deps=this.depsTail=void 0,Vi(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ho.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Do(this)&&this.run()}get dirty(){return Do(this)}}let Cl=0,rs,ss;function El(e,t=!1){if(e.flags|=8,t){e.next=ss,ss=e;return}e.next=rs,rs=e}function pi(){Cl++}function mi(){if(--Cl>0)return;if(ss){let t=ss;for(ss=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;rs;){let t=rs;for(rs=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 Al(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Il(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),gi(r),xu(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Do(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Rl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Rl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===us)||(e.globalVersion=us,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Do(e))))return;e.flags|=2;const t=e.dep,n=gt,r=en;gt=e,en=!0;try{Al(e);const s=e.fn(e._value);(t.version===0||zn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{gt=n,en=r,Il(e),e.flags&=-3}}function gi(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)gi(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function xu(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let en=!0;const $l=[];function An(){$l.push(en),en=!1}function In(){const e=$l.pop();en=e===void 0?!0:e}function Vi(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=gt;gt=void 0;try{t()}finally{gt=n}}}let us=0;class Cu{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 vi{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(!gt||!en||gt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==gt)n=this.activeLink=new Cu(gt,this),gt.deps?(n.prevDep=gt.depsTail,gt.depsTail.nextDep=n,gt.depsTail=n):gt.deps=gt.depsTail=n,Ml(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=gt.depsTail,n.nextDep=void 0,gt.depsTail.nextDep=n,gt.depsTail=n,gt.deps===n&&(gt.deps=r)}return n}trigger(t){this.version++,us++,this.notify(t)}notify(t){pi();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{mi()}}}function Ml(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)Ml(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Lo=new WeakMap,mr=Symbol(""),Bo=Symbol(""),ds=Symbol("");function Ot(e,t,n){if(en&&gt){let r=Lo.get(e);r||Lo.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new vi),s.map=r,s.key=n),s.track()}}function xn(e,t,n,r,s,o){const i=Lo.get(e);if(!i){us++;return}const a=l=>{l&&l.trigger()};if(pi(),t==="clear")i.forEach(a);else{const l=Be(e),d=l&&di(n);if(l&&n==="length"){const u=Number(r);i.forEach((f,m)=>{(m==="length"||m===ds||!nn(m)&&m>=u)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(ds)),t){case"add":l?d&&a(i.get("length")):(a(i.get(mr)),Pr(e)&&a(i.get(Bo)));break;case"delete":l||(a(i.get(mr)),Pr(e)&&a(i.get(Bo)));break;case"set":Pr(e)&&a(i.get(mr));break}}mi()}function Er(e){const t=rt(e);return t===e?t:(Ot(t,"iterate",ds),Xt(e)?t:t.map(rn))}function Qs(e){return Ot(e=rt(e),"iterate",ds),e}function Wn(e,t){return Rn(e)?Dr(gr(e)?rn(t):t):rn(t)}const Eu={__proto__:null,[Symbol.iterator](){return po(this,Symbol.iterator,e=>Wn(this,e))},concat(...e){return Er(this).concat(...e.map(t=>Be(t)?Er(t):t))},entries(){return po(this,"entries",e=>(e[1]=Wn(this,e[1]),e))},every(e,t){return bn(this,"every",e,t,void 0,arguments)},filter(e,t){return bn(this,"filter",e,t,n=>n.map(r=>Wn(this,r)),arguments)},find(e,t){return bn(this,"find",e,t,n=>Wn(this,n),arguments)},findIndex(e,t){return bn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return bn(this,"findLast",e,t,n=>Wn(this,n),arguments)},findLastIndex(e,t){return bn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return bn(this,"forEach",e,t,void 0,arguments)},includes(...e){return mo(this,"includes",e)},indexOf(...e){return mo(this,"indexOf",e)},join(e){return Er(this).join(e)},lastIndexOf(...e){return mo(this,"lastIndexOf",e)},map(e,t){return bn(this,"map",e,t,void 0,arguments)},pop(){return zr(this,"pop")},push(...e){return zr(this,"push",e)},reduce(e,...t){return Wi(this,"reduce",e,t)},reduceRight(e,...t){return Wi(this,"reduceRight",e,t)},shift(){return zr(this,"shift")},some(e,t){return bn(this,"some",e,t,void 0,arguments)},splice(...e){return zr(this,"splice",e)},toReversed(){return Er(this).toReversed()},toSorted(e){return Er(this).toSorted(e)},toSpliced(...e){return Er(this).toSpliced(...e)},unshift(...e){return zr(this,"unshift",e)},values(){return po(this,"values",e=>Wn(this,e))}};function po(e,t,n){const r=Qs(e),s=r[t]();return r!==e&&!Xt(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const Au=Array.prototype;function bn(e,t,n,r,s,o){const i=Qs(e),a=i!==e&&!Xt(e),l=i[t];if(l!==Au[t]){const f=l.apply(e,o);return a?rn(f):f}let d=n;i!==e&&(a?d=function(f,m){return n.call(this,Wn(e,f),m,e)}:n.length>2&&(d=function(f,m){return n.call(this,f,m,e)}));const u=l.call(i,d,r);return a&&s?s(u):u}function Wi(e,t,n,r){const s=Qs(e);let o=n;return s!==e&&(Xt(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,Wn(e,a),l,e)}),s[t](o,...r)}function mo(e,t,n){const r=rt(e);Ot(r,"iterate",ds);const s=r[t](...n);return(s===-1||s===!1)&&bi(n[0])?(n[0]=rt(n[0]),r[t](...n)):s}function zr(e,t,n=[]){An(),pi();const r=rt(e)[t].apply(e,n);return mi(),In(),r}const Iu=li("__proto__,__v_isRef,__isVue"),Pl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(nn));function Ru(e){nn(e)||(e=String(e));const t=rt(this);return Ot(t,"has",e),t.hasOwnProperty(e)}class Ol{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?Fu:Ll:o?Dl:jl).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Be(t);if(!s){let l;if(i&&(l=Eu[n]))return l;if(n==="hasOwnProperty")return Ru}const a=Reflect.get(t,n,Dt(t)?t:r);if((nn(n)?Pl.has(n):Iu(n))||(s||Ot(t,"get",n),o))return a;if(Dt(a)){const l=i&&di(n)?a:a.value;return s&&it(l)?Ho(l):l}return it(a)?s?Ho(a):Xs(a):a}}class Nl extends Ol{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Be(t)&&di(n);if(!this._isShallow){const d=Rn(o);if(!Xt(r)&&!Rn(r)&&(o=rt(o),r=rt(r)),!i&&Dt(o)&&!Dt(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:ot(t,n),l=Reflect.set(t,n,r,Dt(t)?t:s);return t===rt(s)&&(a?zn(r,o)&&xn(t,"set",n,r):xn(t,"add",n,r)),l}deleteProperty(t,n){const r=ot(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&xn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!nn(n)||!Pl.has(n))&&Ot(t,"has",n),r}ownKeys(t){return Ot(t,"iterate",Be(t)?"length":mr),Reflect.ownKeys(t)}}class $u extends Ol{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Mu=new Nl,Pu=new $u,Ou=new Nl(!0);const Fo=e=>e,Ts=e=>Reflect.getPrototypeOf(e);function Nu(e,t,n){return function(...r){const s=this.__v_raw,o=rt(s),i=Pr(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),u=n?Fo:t?Dr:rn;return!t&&Ot(o,"iterate",l?Bo:mr),xt(Object.create(d),{next(){const{value:f,done:m}=d.next();return m?{value:f,done:m}:{value:a?[u(f[0]),u(f[1])]:u(f),done:m}}})}}function Ss(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ju(e,t){const n={get(s){const o=this.__v_raw,i=rt(o),a=rt(s);e||(zn(s,a)&&Ot(i,"get",s),Ot(i,"get",a));const{has:l}=Ts(i),d=t?Fo:e?Dr:rn;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&&Ot(rt(s),"iterate",mr),s.size},has(s){const o=this.__v_raw,i=rt(o),a=rt(s);return e||(zn(s,a)&&Ot(i,"has",s),Ot(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=rt(a),d=t?Fo:e?Dr:rn;return!e&&Ot(l,"iterate",mr),a.forEach((u,f)=>s.call(o,d(u),d(f),i))}};return xt(n,e?{add:Ss("add"),set:Ss("set"),delete:Ss("delete"),clear:Ss("clear")}:{add(s){!t&&!Xt(s)&&!Rn(s)&&(s=rt(s));const o=rt(this);return Ts(o).has.call(o,s)||(o.add(s),xn(o,"add",s,s)),this},set(s,o){!t&&!Xt(o)&&!Rn(o)&&(o=rt(o));const i=rt(this),{has:a,get:l}=Ts(i);let d=a.call(i,s);d||(s=rt(s),d=a.call(i,s));const u=l.call(i,s);return i.set(s,o),d?zn(o,u)&&xn(i,"set",s,o):xn(i,"add",s,o),this},delete(s){const o=rt(this),{has:i,get:a}=Ts(o);let l=i.call(o,s);l||(s=rt(s),l=i.call(o,s)),a&&a.call(o,s);const d=o.delete(s);return l&&xn(o,"delete",s,void 0),d},clear(){const s=rt(this),o=s.size!==0,i=s.clear();return o&&xn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Nu(s,e,t)}),n}function yi(e,t){const n=ju(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(ot(n,s)&&s in r?n:r,s,o)}const Du={get:yi(!1,!1)},Lu={get:yi(!1,!0)},Bu={get:yi(!0,!1)};const jl=new WeakMap,Dl=new WeakMap,Ll=new WeakMap,Fu=new WeakMap;function Hu(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Uu(e){return e.__v_skip||!Object.isExtensible(e)?0:Hu(fu(e))}function Xs(e){return Rn(e)?e:wi(e,!1,Mu,Du,jl)}function Bl(e){return wi(e,!1,Ou,Lu,Dl)}function Ho(e){return wi(e,!0,Pu,Bu,Ll)}function wi(e,t,n,r,s){if(!it(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Uu(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 gr(e){return Rn(e)?gr(e.__v_raw):!!(e&&e.__v_isReactive)}function Rn(e){return!!(e&&e.__v_isReadonly)}function Xt(e){return!!(e&&e.__v_isShallow)}function bi(e){return e?!!e.__v_raw:!1}function rt(e){const t=e&&e.__v_raw;return t?rt(t):e}function Vu(e){return!ot(e,"__v_skip")&&Object.isExtensible(e)&&_l(e,"__v_skip",!0),e}const rn=e=>it(e)?Xs(e):e,Dr=e=>it(e)?Ho(e):e;function Dt(e){return e?e.__v_isRef===!0:!1}function P(e){return Fl(e,!1)}function Wu(e){return Fl(e,!0)}function Fl(e,t){return Dt(e)?e:new qu(e,t)}class qu{constructor(t,n){this.dep=new vi,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:rt(t),this._value=n?t:rn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Xt(t)||Rn(t);t=r?t:rt(t),zn(t,n)&&(this._rawValue=t,this._value=r?t:rn(t),this.dep.trigger())}}function je(e){return Dt(e)?e.value:e}const Ku={get:(e,t,n)=>t==="__v_raw"?e:je(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Dt(s)&&!Dt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Hl(e){return gr(e)?e:new Proxy(e,Ku)}class Gu{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new vi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=us-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&gt!==this)return El(this,!0),!0}get value(){const t=this.dep.track();return Rl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function zu(e,t,n=!1){let r,s;return Ve(e)?r=e:(r=e.get,s=e.set),new Gu(r,s,n)}const xs={},Ds=new WeakMap;let dr;function Yu(e,t=!1,n=dr){if(n){let r=Ds.get(n);r||Ds.set(n,r=[]),r.push(e)}}function Ju(e,t,n=mt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=D=>s?D:Xt(D)||s===!1||s===0?Cn(D,1):Cn(D);let u,f,m,_,N=!1,E=!1;if(Dt(e)?(f=()=>e.value,N=Xt(e)):gr(e)?(f=()=>d(e),N=!0):Be(e)?(E=!0,N=e.some(D=>gr(D)||Xt(D)),f=()=>e.map(D=>{if(Dt(D))return D.value;if(gr(D))return d(D);if(Ve(D))return l?l(D,2):D()})):Ve(e)?t?f=l?()=>l(e,2):e:f=()=>{if(m){An();try{m()}finally{In()}}const D=dr;dr=u;try{return l?l(e,3,[_]):e(_)}finally{dr=D}}:f=hn,t&&s){const D=f,ae=s===!0?1/0:s;f=()=>Cn(D(),ae)}const H=Su(),Y=()=>{u.stop(),H&&H.active&&ui(H.effects,u)};if(o&&t){const D=t;t=(...ae)=>{D(...ae),Y()}}let O=E?new Array(e.length).fill(xs):xs;const U=D=>{if(!(!(u.flags&1)||!u.dirty&&!D))if(t){const ae=u.run();if(s||N||(E?ae.some((ue,fe)=>zn(ue,O[fe])):zn(ae,O))){m&&m();const ue=dr;dr=u;try{const fe=[ae,O===xs?void 0:E&&O[0]===xs?[]:O,_];O=ae,l?l(t,3,fe):t(...fe)}finally{dr=ue}}}else u.run()};return a&&a(U),u=new xl(f),u.scheduler=i?()=>i(U,!1):U,_=D=>Yu(D,!1,u),m=u.onStop=()=>{const D=Ds.get(u);if(D){if(l)l(D,4);else for(const ae of D)ae();Ds.delete(u)}},t?r?U(!0):O=u.run():i?i(U.bind(null,!0),!0):u.run(),Y.pause=u.pause.bind(u),Y.resume=u.resume.bind(u),Y.stop=Y,Y}function Cn(e,t=1/0,n){if(t<=0||!it(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Dt(e))Cn(e.value,t,n);else if(Be(e))for(let r=0;r<e.length;r++)Cn(e[r],t,n);else if(vl(e)||Pr(e))e.forEach(r=>{Cn(r,t,n)});else if(bl(e)){for(const r in e)Cn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Cn(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 bs(e,t,n,r){try{return r?e(...r):e()}catch(s){Zs(s,t,n)}}function sn(e,t,n,r){if(Ve(e)){const s=bs(e,t,n,r);return s&&yl(s)&&s.catch(o=>{Zs(o,t,n)}),s}if(Be(e)){const s=[];for(let o=0;o<e.length;o++)s.push(sn(e[o],t,n,r));return s}}function Zs(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||mt;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){An(),bs(o,null,10,[e,l,d]),In();return}}Qu(e,n,s,r,i)}function Qu(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Ft=[];let cn=-1;const Or=[];let qn=null,Ir=0;const Ul=Promise.resolve();let Ls=null;function zt(e){const t=Ls||Ul;return e?t.then(this?e.bind(this):e):t}function Xu(e){let t=cn+1,n=Ft.length;for(;t<n;){const r=t+n>>>1,s=Ft[r],o=fs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function _i(e){if(!(e.flags&1)){const t=fs(e),n=Ft[Ft.length-1];!n||!(e.flags&2)&&t>=fs(n)?Ft.push(e):Ft.splice(Xu(t),0,e),e.flags|=1,Vl()}}function Vl(){Ls||(Ls=Ul.then(ql))}function Zu(e){Be(e)?Or.push(...e):qn&&e.id===-1?qn.splice(Ir+1,0,e):e.flags&1||(Or.push(e),e.flags|=1),Vl()}function qi(e,t,n=cn+1){for(;n<Ft.length;n++){const r=Ft[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Ft.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Wl(e){if(Or.length){const t=[...new Set(Or)].sort((n,r)=>fs(n)-fs(r));if(Or.length=0,qn){qn.push(...t);return}for(qn=t,Ir=0;Ir<qn.length;Ir++){const n=qn[Ir];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}qn=null,Ir=0}}const fs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ql(e){try{for(cn=0;cn<Ft.length;cn++){const t=Ft[cn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),bs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;cn<Ft.length;cn++){const t=Ft[cn];t&&(t.flags&=-2)}cn=-1,Ft.length=0,Wl(),Ls=null,(Ft.length||Or.length)&&ql()}}let Rt=null,Kl=null;function Bs(e){const t=Rt;return Rt=e,Kl=e&&e.type.__scopeId||null,t}function lt(e,t=Rt,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Vs(-1);const o=Bs(t);let i;try{i=e(...s)}finally{Bs(o),r._d&&Vs(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function $n(e,t){if(Rt===null)return e;const n=oo(Rt),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=mt]=t[s];o&&(Ve(o)&&(o={mounted:o,updated:o}),o.deep&&Cn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function ir(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&&(An(),sn(l,n,8,[e.el,a,e,t]),In())}}function Ms(e,t){if(jt){let n=jt.provides;const r=jt.parent&&jt.parent.provides;r===n&&(n=jt.provides=Object.create(r)),n[e]=t}}function tn(e,t,n=!1){const r=Ci();if(r||jr){let s=jr?jr._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&&Ve(t)?t.call(r&&r.proxy):t}}const ed=Symbol.for("v-scx"),td=()=>tn(ed);function ct(e,t,n){return Gl(e,t,n)}function Gl(e,t,n=mt){const{immediate:r,deep:s,flush:o,once:i}=n,a=xt({},n),l=t&&r||!t&&o!=="post";let d;if(gs){if(o==="sync"){const _=td();d=_.__watcherHandles||(_.__watcherHandles=[])}else if(!l){const _=()=>{};return _.stop=hn,_.resume=hn,_.pause=hn,_}}const u=jt;a.call=(_,N,E)=>sn(_,u,N,E);let f=!1;o==="post"?a.scheduler=_=>{Pt(_,u&&u.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(_,N)=>{N?_():_i(_)}),a.augmentJob=_=>{t&&(_.flags|=4),f&&(_.flags|=2,u&&(_.id=u.uid,_.i=u))};const m=Ju(e,t,a);return gs&&(d?d.push(m):l&&m()),m}function nd(e,t,n){const r=this.proxy,s=_t(e)?e.includes(".")?zl(r,e):()=>r[e]:e.bind(r,r);let o;Ve(t)?o=t:(o=t.handler,n=t);const i=_s(this),a=Gl(s,o.bind(r),n);return i(),a}function zl(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 Yl=Symbol("_vte"),Jl=e=>e.__isTeleport,os=e=>e&&(e.disabled||e.disabled===""),Ki=e=>e&&(e.defer||e.defer===""),Gi=e=>typeof SVGElement<"u"&&e instanceof SVGElement,zi=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Uo=(e,t)=>{const n=e&&e.to;return _t(n)?t?t(n):null:n},Ql={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,d){const{mc:u,pc:f,pbc:m,o:{insert:_,querySelector:N,createText:E,createComment:H}}=d,Y=os(t.props);let{shapeFlag:O,children:U,dynamicChildren:D}=t;if(e==null){const ae=t.el=E(""),ue=t.anchor=E("");_(ae,n,r),_(ue,n,r);const fe=(oe,ee)=>{O&16&&u(U,oe,ee,s,o,i,a,l)},ke=()=>{const oe=t.target=Uo(t.props,N),ee=Vo(oe,t,E,_);oe&&(i!=="svg"&&Gi(oe)?i="svg":i!=="mathml"&&zi(oe)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(oe),Y||(fe(oe,ee),Ps(t,!1)))};Y&&(fe(n,ue),Ps(t,!0)),Ki(t.props)?(t.el.__isMounted=!1,Pt(()=>{ke(),delete t.el.__isMounted},o)):ke()}else{if(Ki(t.props)&&e.el.__isMounted===!1){Pt(()=>{Ql.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,ue=t.target=e.target,fe=t.targetAnchor=e.targetAnchor,ke=os(e.props),oe=ke?n:ue,ee=ke?ae:fe;if(i==="svg"||Gi(ue)?i="svg":(i==="mathml"||zi(ue))&&(i="mathml"),D?(m(e.dynamicChildren,D,oe,s,o,i,a),Si(e,t,!0)):l||f(e,t,oe,ee,s,o,i,a,!1),Y)ke?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Cs(t,n,ae,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ye=t.target=Uo(t.props,N);ye&&Cs(t,ye,null,d,0)}else ke&&Cs(t,ue,fe,d,1);Ps(t,Y)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:d,targetAnchor:u,target:f,props:m}=e;if(f&&(s(d),s(u)),o&&s(l),i&16){const _=o||!os(m);for(let N=0;N<a.length;N++){const E=a[N];r(E,t,n,_,!!E.dynamicChildren)}}},move:Cs,hydrate:rd};function Cs(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||os(u))&&l&16)for(let m=0;m<d.length;m++)s(d[m],t,n,2);f&&r(a,t,n)}function rd(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:u}},f){function m(H,Y){let O=Y;for(;O;){if(O&&O.nodeType===8){if(O.data==="teleport start anchor")t.targetStart=O;else if(O.data==="teleport anchor"){t.targetAnchor=O,H._lpa=t.targetAnchor&&i(t.targetAnchor);break}}O=i(O)}}function _(H,Y){Y.anchor=f(i(H),Y,a(H),n,r,s,o)}const N=t.target=Uo(t.props,l),E=os(t.props);if(N){const H=N._lpa||N.firstChild;t.shapeFlag&16&&(E?(_(e,t),m(N,H),t.targetAnchor||Vo(N,t,u,d,a(e)===N?e:null)):(t.anchor=i(e),m(N,H),t.targetAnchor||Vo(N,t,u,d),f(H&&i(H),t,N,n,r,s,o))),Ps(t,E)}else E&&t.shapeFlag&16&&(_(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Fs=Ql;function Ps(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 Vo(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Yl]=i,e&&(r(o,e,s),r(i,e,s)),i}const un=Symbol("_leaveCb"),Yr=Symbol("_enterCb");function sd(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return On(()=>{e.isMounted=!0}),Nn(()=>{e.isUnmounting=!0}),e}const Jt=[Function,Array],Xl={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Jt,onEnter:Jt,onAfterEnter:Jt,onEnterCancelled:Jt,onBeforeLeave:Jt,onLeave:Jt,onAfterLeave:Jt,onLeaveCancelled:Jt,onBeforeAppear:Jt,onAppear:Jt,onAfterAppear:Jt,onAppearCancelled:Jt},Zl=e=>{const t=e.subTree;return t.component?Zl(t.component):t},od={name:"BaseTransition",props:Xl,setup(e,{slots:t}){const n=Ci(),r=sd();return()=>{const s=t.default&&nc(t.default(),!0);if(!s||!s.length)return;const o=ec(s),i=rt(e),{mode:a}=i;if(r.isLeaving)return go(o);const l=Yi(o);if(!l)return go(o);let d=Wo(l,i,r,n,f=>d=f);l.type!==Nt&&hs(l,d);let u=n.subTree&&Yi(n.subTree);if(u&&u.type!==Nt&&!fr(u,l)&&Zl(n).type!==Nt){let f=Wo(u,i,r,n);if(hs(u,f),a==="out-in"&&l.type!==Nt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,u=void 0},go(o);a==="in-out"&&l.type!==Nt?f.delayLeave=(m,_,N)=>{const E=tc(r,u);E[String(u.key)]=u,m[un]=()=>{_(),m[un]=void 0,delete d.delayedLeave,u=void 0},d.delayedLeave=()=>{N(),delete d.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function ec(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Nt){t=n;break}}return t}const id=od;function tc(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 Wo(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:m,onLeave:_,onAfterLeave:N,onLeaveCancelled:E,onBeforeAppear:H,onAppear:Y,onAfterAppear:O,onAppearCancelled:U}=t,D=String(e.key),ae=tc(n,e),ue=(oe,ee)=>{oe&&sn(oe,r,9,ee)},fe=(oe,ee)=>{const ye=ee[1];ue(oe,ee),Be(oe)?oe.every(ne=>ne.length<=1)&&ye():oe.length<=1&&ye()},ke={mode:i,persisted:a,beforeEnter(oe){let ee=l;if(!n.isMounted)if(o)ee=H||l;else return;oe[un]&&oe[un](!0);const ye=ae[D];ye&&fr(e,ye)&&ye.el[un]&&ye.el[un](),ue(ee,[oe])},enter(oe){let ee=d,ye=u,ne=f;if(!n.isMounted)if(o)ee=Y||d,ye=O||u,ne=U||f;else return;let Fe=!1;oe[Yr]=Ke=>{Fe||(Fe=!0,Ke?ue(ne,[oe]):ue(ye,[oe]),ke.delayedLeave&&ke.delayedLeave(),oe[Yr]=void 0)};const Ue=oe[Yr].bind(null,!1);ee?fe(ee,[oe,Ue]):Ue()},leave(oe,ee){const ye=String(e.key);if(oe[Yr]&&oe[Yr](!0),n.isUnmounting)return ee();ue(m,[oe]);let ne=!1;oe[un]=Ue=>{ne||(ne=!0,ee(),Ue?ue(E,[oe]):ue(N,[oe]),oe[un]=void 0,ae[ye]===e&&delete ae[ye])};const Fe=oe[un].bind(null,!1);ae[ye]=e,_?fe(_,[oe,Fe]):Fe()},clone(oe){const ee=Wo(oe,t,n,r,s);return s&&s(ee),ee}};return ke}function go(e){if(eo(e))return e=Yn(e),e.children=null,e}function Yi(e){if(!eo(e))return Jl(e.type)&&e.children?ec(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&&Ve(n.default))return n.default()}}function hs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,hs(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 nc(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===He?(i.patchFlag&128&&s++,r=r.concat(nc(i.children,t,a))):(t||i.type!==Nt)&&r.push(a!=null?Yn(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function At(e,t){return Ve(e)?xt({name:e.name},t,{setup:e}):e}function rc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ji(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Hs=new WeakMap;function is(e,t,n,r,s=!1){if(Be(e)){e.forEach((E,H)=>is(E,t&&(Be(t)?t[H]:t),n,r,s));return}if(Nr(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&is(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?oo(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,u=a.refs===mt?a.refs={}:a.refs,f=a.setupState,m=rt(f),_=f===mt?gl:E=>Ji(u,E)?!1:ot(m,E),N=(E,H)=>!(H&&Ji(u,H));if(d!=null&&d!==l){if(Qi(t),_t(d))u[d]=null,_(d)&&(f[d]=null);else if(Dt(d)){const E=t;N(d,E.k)&&(d.value=null),E.k&&(u[E.k]=null)}}if(Ve(l))bs(l,a,12,[i,u]);else{const E=_t(l),H=Dt(l);if(E||H){const Y=()=>{if(e.f){const O=E?_(l)?f[l]:u[l]:N()||!e.k?l.value:u[e.k];if(s)Be(O)&&ui(O,o);else if(Be(O))O.includes(o)||O.push(o);else if(E)u[l]=[o],_(l)&&(f[l]=u[l]);else{const U=[o];N(l,e.k)&&(l.value=U),e.k&&(u[e.k]=U)}}else E?(u[l]=i,_(l)&&(f[l]=i)):H&&(N(l,e.k)&&(l.value=i),e.k&&(u[e.k]=i))};if(i){const O=()=>{Y(),Hs.delete(e)};O.id=-1,Hs.set(e,O),Pt(O,n)}else Qi(e),Y()}}}function Qi(e){const t=Hs.get(e);t&&(t.flags|=8,Hs.delete(e))}Js().requestIdleCallback;Js().cancelIdleCallback;const Nr=e=>!!e.type.__asyncLoader,eo=e=>e.type.__isKeepAlive;function ad(e,t){sc(e,"a",t)}function ld(e,t){sc(e,"da",t)}function sc(e,t,n=jt){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(to(t,r,n),n){let s=n.parent;for(;s&&s.parent;)eo(s.parent.vnode)&&cd(r,t,n,s),s=s.parent}}function cd(e,t,n,r){const s=to(t,e,r,!0);no(()=>{ui(r[t],s)},n)}function to(e,t,n=jt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{An();const a=_s(n),l=sn(t,n,e,i);return a(),In(),l});return r?s.unshift(o):s.push(o),o}}const Pn=e=>(t,n=jt)=>{(!gs||e==="sp")&&to(e,(...r)=>t(...r),n)},ud=Pn("bm"),On=Pn("m"),dd=Pn("bu"),fd=Pn("u"),Nn=Pn("bum"),no=Pn("um"),hd=Pn("sp"),pd=Pn("rtg"),md=Pn("rtc");function gd(e,t=jt){to("ec",e,t)}const vd="components",oc=Symbol.for("v-ndc");function qo(e){return _t(e)?yd(vd,e,!1)||e:e||oc}function yd(e,t,n=!0,r=!1){const s=Rt||jt;if(s){const o=s.type;{const a=rf(o,!1);if(a&&(a===t||a===Zt(t)||a===Ys(Zt(t))))return o}const i=Xi(s[e]||o[e],t)||Xi(s.appContext[e],t);return!i&&r?o:i}}function Xi(e,t){return e&&(e[t]||e[Zt(t)]||e[Ys(Zt(t))])}function wt(e,t,n,r){let s;const o=n,i=Be(e);if(i||_t(e)){const a=i&&gr(e);let l=!1,d=!1;a&&(l=!Xt(e),d=Rn(e),e=Qs(e)),s=new Array(e.length);for(let u=0,f=e.length;u<f;u++)s[u]=t(l?d?Dr(rn(e[u])):rn(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(it(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 fn(e,t,n={},r,s){if(Rt.ce||Rt.parent&&Nr(Rt.parent)&&Rt.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),ht(He,null,[Ce("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&ic(o(n)),a=n.key||i&&i.key,l=ht(He,{key:(a&&!nn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function ic(e){return e.some(t=>ms(t)?!(t.type===Nt||t.type===He&&!ic(t.children)):!0)?e:null}const Ko=e=>e?Cc(e)?oo(e):Ko(e.parent):null,as=xt(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=>Ko(e.parent),$root:e=>Ko(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>lc(e),$forceUpdate:e=>e.f||(e.f=()=>{_i(e.update)}),$nextTick:e=>e.n||(e.n=zt.bind(e.proxy)),$watch:e=>nd.bind(e)}),vo=(e,t)=>e!==mt&&!e.__isScriptSetup&&ot(e,t),wd={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 m=i[t];if(m!==void 0)switch(m){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(vo(r,t))return i[t]=1,r[t];if(s!==mt&&ot(s,t))return i[t]=2,s[t];if(ot(o,t))return i[t]=3,o[t];if(n!==mt&&ot(n,t))return i[t]=4,n[t];Go&&(i[t]=0)}}const d=as[t];let u,f;if(d)return t==="$attrs"&&Ot(e.attrs,"get",""),d(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==mt&&ot(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,ot(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return vo(s,t)?(s[t]=n,!0):r!==mt&&ot(r,t)?(r[t]=n,!0):ot(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!==mt&&a[0]!=="$"&&ot(e,a)||vo(t,a)||ot(o,a)||ot(r,a)||ot(as,a)||ot(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ot(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function bd(){return _d().slots}function _d(e){const t=Ci();return t.setupContext||(t.setupContext=Ac(t))}function Zi(e){return Be(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Go=!0;function kd(e){const t=lc(e),n=e.proxy,r=e.ctx;Go=!1,t.beforeCreate&&ea(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:d,created:u,beforeMount:f,mounted:m,beforeUpdate:_,updated:N,activated:E,deactivated:H,beforeDestroy:Y,beforeUnmount:O,destroyed:U,unmounted:D,render:ae,renderTracked:ue,renderTriggered:fe,errorCaptured:ke,serverPrefetch:oe,expose:ee,inheritAttrs:ye,components:ne,directives:Fe,filters:Ue}=t;if(d&&Td(d,r,null),i)for(const be in i){const Oe=i[be];Ve(Oe)&&(r[be]=Oe.bind(n))}if(s){const be=s.call(n,n);it(be)&&(e.data=Xs(be))}if(Go=!0,o)for(const be in o){const Oe=o[be],vt=Ve(Oe)?Oe.bind(n,n):Ve(Oe.get)?Oe.get.bind(n,n):hn,Ze=!Ve(Oe)&&Ve(Oe.set)?Oe.set.bind(n):hn,dt=ce({get:vt,set:Ze});Object.defineProperty(r,be,{enumerable:!0,configurable:!0,get:()=>dt.value,set:tt=>dt.value=tt})}if(a)for(const be in a)ac(a[be],r,n,be);if(l){const be=Ve(l)?l.call(n):l;Reflect.ownKeys(be).forEach(Oe=>{Ms(Oe,be[Oe])})}u&&ea(u,e,"c");function Ie(be,Oe){Be(Oe)?Oe.forEach(vt=>be(vt.bind(n))):Oe&&be(Oe.bind(n))}if(Ie(ud,f),Ie(On,m),Ie(dd,_),Ie(fd,N),Ie(ad,E),Ie(ld,H),Ie(gd,ke),Ie(md,ue),Ie(pd,fe),Ie(Nn,O),Ie(no,D),Ie(hd,oe),Be(ee))if(ee.length){const be=e.exposed||(e.exposed={});ee.forEach(Oe=>{Object.defineProperty(be,Oe,{get:()=>n[Oe],set:vt=>n[Oe]=vt,enumerable:!0})})}else e.exposed||(e.exposed={});ae&&e.render===hn&&(e.render=ae),ye!=null&&(e.inheritAttrs=ye),ne&&(e.components=ne),Fe&&(e.directives=Fe),oe&&rc(e)}function Td(e,t,n=hn){Be(e)&&(e=zo(e));for(const r in e){const s=e[r];let o;it(s)?"default"in s?o=tn(s.from||r,s.default,!0):o=tn(s.from||r):o=tn(s),Dt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function ea(e,t,n){sn(Be(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function ac(e,t,n,r){let s=r.includes(".")?zl(n,r):()=>n[r];if(_t(e)){const o=t[e];Ve(o)&&ct(s,o)}else if(Ve(e))ct(s,e.bind(n));else if(it(e))if(Be(e))e.forEach(o=>ac(o,t,n,r));else{const o=Ve(e.handler)?e.handler.bind(n):t[e.handler];Ve(o)&&ct(s,o,e)}}function lc(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=>Us(l,d,i,!0)),Us(l,t,i)),it(t)&&o.set(t,l),l}function Us(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Us(e,o,n,!0),s&&s.forEach(i=>Us(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=Sd[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const Sd={data:ta,props:na,emits:na,methods:ts,computed:ts,beforeCreate:Lt,created:Lt,beforeMount:Lt,mounted:Lt,beforeUpdate:Lt,updated:Lt,beforeDestroy:Lt,beforeUnmount:Lt,destroyed:Lt,unmounted:Lt,activated:Lt,deactivated:Lt,errorCaptured:Lt,serverPrefetch:Lt,components:ts,directives:ts,watch:Cd,provide:ta,inject:xd};function ta(e,t){return t?e?function(){return xt(Ve(e)?e.call(this,this):e,Ve(t)?t.call(this,this):t)}:t:e}function xd(e,t){return ts(zo(e),zo(t))}function zo(e){if(Be(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Lt(e,t){return e?[...new Set([].concat(e,t))]:t}function ts(e,t){return e?xt(Object.create(null),e,t):t}function na(e,t){return e?Be(e)&&Be(t)?[...new Set([...e,...t])]:xt(Object.create(null),Zi(e),Zi(t??{})):t}function Cd(e,t){if(!e)return t;if(!t)return e;const n=xt(Object.create(null),e);for(const r in t)n[r]=Lt(e[r],t[r]);return n}function cc(){return{app:null,config:{isNativeTag:gl,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 Ed=0;function Ad(e,t){return function(r,s=null){Ve(r)||(r=xt({},r)),s!=null&&!it(s)&&(s=null);const o=cc(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:Ed++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:of,get config(){return o.config},set config(u){},use(u,...f){return i.has(u)||(u&&Ve(u.install)?(i.add(u),u.install(d,...f)):Ve(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,m){if(!l){const _=d._ceVNode||Ce(r,s);return _.appContext=o,m===!0?m="svg":m===!1&&(m=void 0),e(_,u,m),l=!0,d._container=u,u.__vue_app__=d,oo(_.component)}},onUnmount(u){a.push(u)},unmount(){l&&(sn(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=jr;jr=d;try{return u()}finally{jr=f}}};return d}}let jr=null;const Id=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Zt(t)}Modifiers`]||e[`${Jn(t)}Modifiers`];function Rd(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||mt;let s=n;const o=t.startsWith("update:"),i=o&&Id(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>_t(u)?u.trim():u)),i.number&&(s=n.map(fi)));let a,l=r[a=uo(t)]||r[a=uo(Zt(t))];!l&&o&&(l=r[a=uo(Jn(t))]),l&&sn(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,sn(d,e,6,s)}}const $d=new WeakMap;function uc(e,t,n=!1){const r=n?$d:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Ve(e)){const l=d=>{const u=uc(d,t,!0);u&&(a=!0,xt(i,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(it(e)&&r.set(e,null),null):(Be(o)?o.forEach(l=>i[l]=null):xt(i,o),it(e)&&r.set(e,i),i)}function ro(e,t){return!e||!Gs(t)?!1:(t=t.slice(2).replace(/Once$/,""),ot(e,t[0].toLowerCase()+t.slice(1))||ot(e,Jn(t))||ot(e,t))}function ra(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:m,setupState:_,ctx:N,inheritAttrs:E}=e,H=Bs(e);let Y,O;try{if(n.shapeFlag&4){const D=s||r,ae=D;Y=dn(d.call(ae,D,u,f,_,m,N)),O=a}else{const D=t;Y=dn(D.length>1?D(f,{attrs:a,slots:i,emit:l}):D(f,null)),O=t.props?a:Md(a)}}catch(D){ls.length=0,Zs(D,e,1),Y=Ce(Nt)}let U=Y;if(O&&E!==!1){const D=Object.keys(O),{shapeFlag:ae}=U;D.length&&ae&7&&(o&&D.some(ci)&&(O=Pd(O,o)),U=Yn(U,O,!1,!0))}return n.dirs&&(U=Yn(U,null,!1,!0),U.dirs=U.dirs?U.dirs.concat(n.dirs):n.dirs),n.transition&&hs(U,n.transition),Y=U,Bs(H),Y}const Md=e=>{let t;for(const n in e)(n==="class"||n==="style"||Gs(n))&&((t||(t={}))[n]=e[n]);return t},Pd=(e,t)=>{const n={};for(const r in e)(!ci(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Od(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?sa(r,i,d):!!i;if(l&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const m=u[f];if(dc(i,r,m)&&!ro(d,m))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?sa(r,i,d):!0:!!i;return!1}function sa(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(dc(t,e,o)&&!ro(n,o))return!0}return!1}function dc(e,t,n){const r=e[n],s=t[n];return n==="style"&&it(r)&&it(s)?!hi(r,s):r!==s}function Nd({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 fc={},hc=()=>Object.create(fc),pc=e=>Object.getPrototypeOf(e)===fc;function jd(e,t,n,r=!1){const s={},o=hc();e.propsDefaults=Object.create(null),mc(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 Dd(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=rt(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 m=u[f];if(ro(e.emitsOptions,m))continue;const _=t[m];if(l)if(ot(o,m))_!==o[m]&&(o[m]=_,d=!0);else{const N=Zt(m);s[N]=Yo(l,a,N,_,e,!1)}else _!==o[m]&&(o[m]=_,d=!0)}}}else{mc(e,t,s,o)&&(d=!0);let u;for(const f in a)(!t||!ot(t,f)&&((u=Jn(f))===f||!ot(t,u)))&&(l?n&&(n[f]!==void 0||n[u]!==void 0)&&(s[f]=Yo(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!ot(t,f))&&(delete o[f],d=!0)}d&&xn(e.attrs,"set","")}function mc(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(ns(l))continue;const d=t[l];let u;s&&ot(s,u=Zt(l))?!o||!o.includes(u)?n[u]=d:(a||(a={}))[u]=d:ro(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=rt(n),d=a||mt;for(let u=0;u<o.length;u++){const f=o[u];n[f]=Yo(s,l,f,d[f],e,!ot(d,f))}}return i}function Yo(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=ot(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&Ve(l)){const{propsDefaults:d}=s;if(n in d)r=d[n];else{const u=_s(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===Jn(n))&&(r=!0))}return r}const Ld=new WeakMap;function gc(e,t,n=!1){const r=n?Ld:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Ve(e)){const u=f=>{l=!0;const[m,_]=gc(f,t,!0);xt(i,m),_&&a.push(..._)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!o&&!l)return it(e)&&r.set(e,Mr),Mr;if(Be(o))for(let u=0;u<o.length;u++){const f=Zt(o[u]);oa(f)&&(i[f]=mt)}else if(o)for(const u in o){const f=Zt(u);if(oa(f)){const m=o[u],_=i[f]=Be(m)||Ve(m)?{type:m}:xt({},m),N=_.type;let E=!1,H=!0;if(Be(N))for(let Y=0;Y<N.length;++Y){const O=N[Y],U=Ve(O)&&O.name;if(U==="Boolean"){E=!0;break}else U==="String"&&(H=!1)}else E=Ve(N)&&N.name==="Boolean";_[0]=E,_[1]=H,(E||ot(_,"default"))&&a.push(f)}}const d=[i,a];return it(e)&&r.set(e,d),d}function oa(e){return e[0]!=="$"&&!ns(e)}const ki=e=>e==="_"||e==="_ctx"||e==="$stable",Ti=e=>Be(e)?e.map(dn):[dn(e)],Bd=(e,t,n)=>{if(t._n)return t;const r=lt((...s)=>Ti(t(...s)),n);return r._c=!1,r},vc=(e,t,n)=>{const r=e._ctx;for(const s in e){if(ki(s))continue;const o=e[s];if(Ve(o))t[s]=Bd(s,o,r);else if(o!=null){const i=Ti(o);t[s]=()=>i}}},yc=(e,t)=>{const n=Ti(t);e.slots.default=()=>n},wc=(e,t,n)=>{for(const r in t)(n||!ki(r))&&(e[r]=t[r])},Fd=(e,t,n)=>{const r=e.slots=hc();if(e.vnode.shapeFlag&32){const s=t._;s?(wc(r,t,n),n&&_l(r,"_",s,!0)):vc(t,r)}else t&&yc(e,t)},Hd=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=mt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:wc(s,t,n):(o=!t.$stable,vc(t,s)),i=t}else t&&(yc(e,t),i={default:1});if(o)for(const a in s)!ki(a)&&i[a]==null&&delete s[a]},Pt=Kd;function Ud(e){return Vd(e)}function Vd(e,t){const n=Js();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:d,setElementText:u,parentNode:f,nextSibling:m,setScopeId:_=hn,insertStaticContent:N}=e,E=(g,y,x,L=null,F=null,j=null,X=void 0,re=null,Z=!!y.dynamicChildren)=>{if(g===y)return;g&&!fr(g,y)&&(L=I(g),tt(g,F,j,!0),g=null),y.patchFlag===-2&&(Z=!1,y.dynamicChildren=null);const{type:W,ref:he,shapeFlag:ie}=y;switch(W){case so:H(g,y,x,L);break;case Nt:Y(g,y,x,L);break;case wo:g==null&&O(y,x,L,X);break;case He:ne(g,y,x,L,F,j,X,re,Z);break;default:ie&1?ae(g,y,x,L,F,j,X,re,Z):ie&6?Fe(g,y,x,L,F,j,X,re,Z):(ie&64||ie&128)&&W.process(g,y,x,L,F,j,X,re,Z,me)}he!=null&&F?is(he,g&&g.ref,j,y||g,!y):he==null&&g&&g.ref!=null&&is(g.ref,null,j,g,!0)},H=(g,y,x,L)=>{if(g==null)r(y.el=a(y.children),x,L);else{const F=y.el=g.el;y.children!==g.children&&d(F,y.children)}},Y=(g,y,x,L)=>{g==null?r(y.el=l(y.children||""),x,L):y.el=g.el},O=(g,y,x,L)=>{[g.el,g.anchor]=N(g.children,y,x,L,g.el,g.anchor)},U=({el:g,anchor:y},x,L)=>{let F;for(;g&&g!==y;)F=m(g),r(g,x,L),g=F;r(y,x,L)},D=({el:g,anchor:y})=>{let x;for(;g&&g!==y;)x=m(g),s(g),g=x;s(y)},ae=(g,y,x,L,F,j,X,re,Z)=>{if(y.type==="svg"?X="svg":y.type==="math"&&(X="mathml"),g==null)ue(y,x,L,F,j,X,re,Z);else{const W=g.el&&g.el._isVueCE?g.el:null;try{W&&W._beginPatch(),oe(g,y,F,j,X,re,Z)}finally{W&&W._endPatch()}}},ue=(g,y,x,L,F,j,X,re)=>{let Z,W;const{props:he,shapeFlag:ie,transition:ge,dirs:Se}=g;if(Z=g.el=i(g.type,j,he&&he.is,he),ie&8?u(Z,g.children):ie&16&&ke(g.children,Z,null,L,F,yo(g,j),X,re),Se&&ir(g,null,L,"created"),fe(Z,g,g.scopeId,X,L),he){for(const We in he)We!=="value"&&!ns(We)&&o(Z,We,null,he[We],j,L);"value"in he&&o(Z,"value",null,he.value,j),(W=he.onVnodeBeforeMount)&&ln(W,L,g)}Se&&ir(g,null,L,"beforeMount");const Ne=Wd(F,ge);Ne&&ge.beforeEnter(Z),r(Z,y,x),((W=he&&he.onVnodeMounted)||Ne||Se)&&Pt(()=>{W&&ln(W,L,g),Ne&&ge.enter(Z),Se&&ir(g,null,L,"mounted")},F)},fe=(g,y,x,L,F)=>{if(x&&_(g,x),L)for(let j=0;j<L.length;j++)_(g,L[j]);if(F){let j=F.subTree;if(y===j||kc(j.type)&&(j.ssContent===y||j.ssFallback===y)){const X=F.vnode;fe(g,X,X.scopeId,X.slotScopeIds,F.parent)}}},ke=(g,y,x,L,F,j,X,re,Z=0)=>{for(let W=Z;W<g.length;W++){const he=g[W]=re?Sn(g[W]):dn(g[W]);E(null,he,y,x,L,F,j,X,re)}},oe=(g,y,x,L,F,j,X)=>{const re=y.el=g.el;let{patchFlag:Z,dynamicChildren:W,dirs:he}=y;Z|=g.patchFlag&16;const ie=g.props||mt,ge=y.props||mt;let Se;if(x&&ar(x,!1),(Se=ge.onVnodeBeforeUpdate)&&ln(Se,x,y,g),he&&ir(y,g,x,"beforeUpdate"),x&&ar(x,!0),(ie.innerHTML&&ge.innerHTML==null||ie.textContent&&ge.textContent==null)&&u(re,""),W?ee(g.dynamicChildren,W,re,x,L,yo(y,F),j):X||Oe(g,y,re,null,x,L,yo(y,F),j,!1),Z>0){if(Z&16)ye(re,ie,ge,x,F);else if(Z&2&&ie.class!==ge.class&&o(re,"class",null,ge.class,F),Z&4&&o(re,"style",ie.style,ge.style,F),Z&8){const Ne=y.dynamicProps;for(let We=0;We<Ne.length;We++){const Ae=Ne[We],at=ie[Ae],Je=ge[Ae];(Je!==at||Ae==="value")&&o(re,Ae,at,Je,F,x)}}Z&1&&g.children!==y.children&&u(re,y.children)}else!X&&W==null&&ye(re,ie,ge,x,F);((Se=ge.onVnodeUpdated)||he)&&Pt(()=>{Se&&ln(Se,x,y,g),he&&ir(y,g,x,"updated")},L)},ee=(g,y,x,L,F,j,X)=>{for(let re=0;re<y.length;re++){const Z=g[re],W=y[re],he=Z.el&&(Z.type===He||!fr(Z,W)||Z.shapeFlag&198)?f(Z.el):x;E(Z,W,he,null,L,F,j,X,!0)}},ye=(g,y,x,L,F)=>{if(y!==x){if(y!==mt)for(const j in y)!ns(j)&&!(j in x)&&o(g,j,y[j],null,F,L);for(const j in x){if(ns(j))continue;const X=x[j],re=y[j];X!==re&&j!=="value"&&o(g,j,re,X,F,L)}"value"in x&&o(g,"value",y.value,x.value,F)}},ne=(g,y,x,L,F,j,X,re,Z)=>{const W=y.el=g?g.el:a(""),he=y.anchor=g?g.anchor:a("");let{patchFlag:ie,dynamicChildren:ge,slotScopeIds:Se}=y;Se&&(re=re?re.concat(Se):Se),g==null?(r(W,x,L),r(he,x,L),ke(y.children||[],x,he,F,j,X,re,Z)):ie>0&&ie&64&&ge&&g.dynamicChildren&&g.dynamicChildren.length===ge.length?(ee(g.dynamicChildren,ge,x,F,j,X,re),(y.key!=null||F&&y===F.subTree)&&Si(g,y,!0)):Oe(g,y,x,he,F,j,X,re,Z)},Fe=(g,y,x,L,F,j,X,re,Z)=>{y.slotScopeIds=re,g==null?y.shapeFlag&512?F.ctx.activate(y,x,L,X,Z):Ue(y,x,L,F,j,X,Z):Ke(g,y,Z)},Ue=(g,y,x,L,F,j,X)=>{const re=g.component=Zd(g,L,F);if(eo(g)&&(re.ctx.renderer=me),ef(re,!1,X),re.asyncDep){if(F&&F.registerDep(re,Ie,X),!g.el){const Z=re.subTree=Ce(Nt);Y(null,Z,y,x),g.placeholder=Z.el}}else Ie(re,g,y,x,F,j,X)},Ke=(g,y,x)=>{const L=y.component=g.component;if(Od(g,y,x))if(L.asyncDep&&!L.asyncResolved){be(L,y,x);return}else L.next=y,L.update();else y.el=g.el,L.vnode=y},Ie=(g,y,x,L,F,j,X)=>{const re=()=>{if(g.isMounted){let{next:ie,bu:ge,u:Se,parent:Ne,vnode:We}=g;{const V=bc(g);if(V){ie&&(ie.el=We.el,be(g,ie,X)),V.asyncDep.then(()=>{Pt(()=>{g.isUnmounted||W()},F)});return}}let Ae=ie,at;ar(g,!1),ie?(ie.el=We.el,be(g,ie,X)):ie=We,ge&&$s(ge),(at=ie.props&&ie.props.onVnodeBeforeUpdate)&&ln(at,Ne,ie,We),ar(g,!0);const Je=ra(g),B=g.subTree;g.subTree=Je,E(B,Je,f(B.el),I(B),g,F,j),ie.el=Je.el,Ae===null&&Nd(g,Je.el),Se&&Pt(Se,F),(at=ie.props&&ie.props.onVnodeUpdated)&&Pt(()=>ln(at,Ne,ie,We),F)}else{let ie;const{el:ge,props:Se}=y,{bm:Ne,m:We,parent:Ae,root:at,type:Je}=g,B=Nr(y);ar(g,!1),Ne&&$s(Ne),!B&&(ie=Se&&Se.onVnodeBeforeMount)&&ln(ie,Ae,y),ar(g,!0);{at.ce&&at.ce._hasShadowRoot()&&at.ce._injectChildStyle(Je);const V=g.subTree=ra(g);E(null,V,x,L,g,F,j),y.el=V.el}if(We&&Pt(We,F),!B&&(ie=Se&&Se.onVnodeMounted)){const V=y;Pt(()=>ln(ie,Ae,V),F)}(y.shapeFlag&256||Ae&&Nr(Ae.vnode)&&Ae.vnode.shapeFlag&256)&&g.a&&Pt(g.a,F),g.isMounted=!0,y=x=L=null}};g.scope.on();const Z=g.effect=new xl(re);g.scope.off();const W=g.update=Z.run.bind(Z),he=g.job=Z.runIfDirty.bind(Z);he.i=g,he.id=g.uid,Z.scheduler=()=>_i(he),ar(g,!0),W()},be=(g,y,x)=>{y.component=g;const L=g.vnode.props;g.vnode=y,g.next=null,Dd(g,y.props,L,x),Hd(g,y.children,x),An(),qi(g),In()},Oe=(g,y,x,L,F,j,X,re,Z=!1)=>{const W=g&&g.children,he=g?g.shapeFlag:0,ie=y.children,{patchFlag:ge,shapeFlag:Se}=y;if(ge>0){if(ge&128){Ze(W,ie,x,L,F,j,X,re,Z);return}else if(ge&256){vt(W,ie,x,L,F,j,X,re,Z);return}}Se&8?(he&16&&Te(W,F,j),ie!==W&&u(x,ie)):he&16?Se&16?Ze(W,ie,x,L,F,j,X,re,Z):Te(W,F,j,!0):(he&8&&u(x,""),Se&16&&ke(ie,x,L,F,j,X,re,Z))},vt=(g,y,x,L,F,j,X,re,Z)=>{g=g||Mr,y=y||Mr;const W=g.length,he=y.length,ie=Math.min(W,he);let ge;for(ge=0;ge<ie;ge++){const Se=y[ge]=Z?Sn(y[ge]):dn(y[ge]);E(g[ge],Se,x,null,F,j,X,re,Z)}W>he?Te(g,F,j,!0,!1,ie):ke(y,x,L,F,j,X,re,Z,ie)},Ze=(g,y,x,L,F,j,X,re,Z)=>{let W=0;const he=y.length;let ie=g.length-1,ge=he-1;for(;W<=ie&&W<=ge;){const Se=g[W],Ne=y[W]=Z?Sn(y[W]):dn(y[W]);if(fr(Se,Ne))E(Se,Ne,x,null,F,j,X,re,Z);else break;W++}for(;W<=ie&&W<=ge;){const Se=g[ie],Ne=y[ge]=Z?Sn(y[ge]):dn(y[ge]);if(fr(Se,Ne))E(Se,Ne,x,null,F,j,X,re,Z);else break;ie--,ge--}if(W>ie){if(W<=ge){const Se=ge+1,Ne=Se<he?y[Se].el:L;for(;W<=ge;)E(null,y[W]=Z?Sn(y[W]):dn(y[W]),x,Ne,F,j,X,re,Z),W++}}else if(W>ge)for(;W<=ie;)tt(g[W],F,j,!0),W++;else{const Se=W,Ne=W,We=new Map;for(W=Ne;W<=ge;W++){const b=y[W]=Z?Sn(y[W]):dn(y[W]);b.key!=null&&We.set(b.key,W)}let Ae,at=0;const Je=ge-Ne+1;let B=!1,V=0;const J=new Array(Je);for(W=0;W<Je;W++)J[W]=0;for(W=Se;W<=ie;W++){const b=g[W];if(at>=Je){tt(b,F,j,!0);continue}let A;if(b.key!=null)A=We.get(b.key);else for(Ae=Ne;Ae<=ge;Ae++)if(J[Ae-Ne]===0&&fr(b,y[Ae])){A=Ae;break}A===void 0?tt(b,F,j,!0):(J[A-Ne]=W+1,A>=V?V=A:B=!0,E(b,y[A],x,null,F,j,X,re,Z),at++)}const Ge=B?qd(J):Mr;for(Ae=Ge.length-1,W=Je-1;W>=0;W--){const b=Ne+W,A=y[b],M=y[b+1],se=b+1<he?M.el||_c(M):L;J[W]===0?E(null,A,x,se,F,j,X,re,Z):B&&(Ae<0||W!==Ge[Ae]?dt(A,x,se,2):Ae--)}}},dt=(g,y,x,L,F=null)=>{const{el:j,type:X,transition:re,children:Z,shapeFlag:W}=g;if(W&6){dt(g.component.subTree,y,x,L);return}if(W&128){g.suspense.move(y,x,L);return}if(W&64){X.move(g,y,x,me);return}if(X===He){r(j,y,x);for(let ie=0;ie<Z.length;ie++)dt(Z[ie],y,x,L);r(g.anchor,y,x);return}if(X===wo){U(g,y,x);return}if(L!==2&&W&1&&re)if(L===0)re.beforeEnter(j),r(j,y,x),Pt(()=>re.enter(j),F);else{const{leave:ie,delayLeave:ge,afterLeave:Se}=re,Ne=()=>{g.ctx.isUnmounted?s(j):r(j,y,x)},We=()=>{j._isLeaving&&j[un](!0),ie(j,()=>{Ne(),Se&&Se()})};ge?ge(j,Ne,We):We()}else r(j,y,x)},tt=(g,y,x,L=!1,F=!1)=>{const{type:j,props:X,ref:re,children:Z,dynamicChildren:W,shapeFlag:he,patchFlag:ie,dirs:ge,cacheIndex:Se}=g;if(ie===-2&&(F=!1),re!=null&&(An(),is(re,null,x,g,!0),In()),Se!=null&&(y.renderCache[Se]=void 0),he&256){y.ctx.deactivate(g);return}const Ne=he&1&&ge,We=!Nr(g);let Ae;if(We&&(Ae=X&&X.onVnodeBeforeUnmount)&&ln(Ae,y,g),he&6)Ee(g.component,x,L);else{if(he&128){g.suspense.unmount(x,L);return}Ne&&ir(g,null,y,"beforeUnmount"),he&64?g.type.remove(g,y,x,me,L):W&&!W.hasOnce&&(j!==He||ie>0&&ie&64)?Te(W,y,x,!1,!0):(j===He&&ie&384||!F&&he&16)&&Te(Z,y,x),L&&ze(g)}(We&&(Ae=X&&X.onVnodeUnmounted)||Ne)&&Pt(()=>{Ae&&ln(Ae,y,g),Ne&&ir(g,null,y,"unmounted")},x)},ze=g=>{const{type:y,el:x,anchor:L,transition:F}=g;if(y===He){pe(x,L);return}if(y===wo){D(g);return}const j=()=>{s(x),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(g.shapeFlag&1&&F&&!F.persisted){const{leave:X,delayLeave:re}=F,Z=()=>X(x,j);re?re(g.el,j,Z):Z()}else j()},pe=(g,y)=>{let x;for(;g!==y;)x=m(g),s(g),g=x;s(y)},Ee=(g,y,x)=>{const{bum:L,scope:F,job:j,subTree:X,um:re,m:Z,a:W}=g;ia(Z),ia(W),L&&$s(L),F.stop(),j&&(j.flags|=8,tt(X,g,y,x)),re&&Pt(re,y),Pt(()=>{g.isUnmounted=!0},y)},Te=(g,y,x,L=!1,F=!1,j=0)=>{for(let X=j;X<g.length;X++)tt(g[X],y,x,L,F)},I=g=>{if(g.shapeFlag&6)return I(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const y=m(g.anchor||g.el),x=y&&y[Yl];return x?m(x):y};let Q=!1;const z=(g,y,x)=>{let L;g==null?y._vnode&&(tt(y._vnode,null,null,!0),L=y._vnode.component):E(y._vnode||null,g,y,null,null,null,x),y._vnode=g,Q||(Q=!0,qi(L),Wl(),Q=!1)},me={p:E,um:tt,m:dt,r:ze,mt:Ue,mc:ke,pc:Oe,pbc:ee,n:I,o:e};return{render:z,hydrate:void 0,createApp:Ad(z)}}function yo({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 ar({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Wd(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Si(e,t,n=!1){const r=e.children,s=t.children;if(Be(r)&&Be(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]=Sn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&Si(i,a)),a.type===so&&(a.patchFlag===-1&&(a=s[o]=Sn(a)),a.el=i.el),a.type===Nt&&!a.el&&(a.el=i.el)}}function qd(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 bc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:bc(t)}function ia(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function _c(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?_c(t.subTree):null}const kc=e=>e.__isSuspense;function Kd(e,t){t&&t.pendingBranch?Be(e)?t.effects.push(...e):t.effects.push(e):Zu(e)}const He=Symbol.for("v-fgt"),so=Symbol.for("v-txt"),Nt=Symbol.for("v-cmt"),wo=Symbol.for("v-stc"),ls=[];let Gt=null;function w(e=!1){ls.push(Gt=e?null:[])}function Gd(){ls.pop(),Gt=ls[ls.length-1]||null}let ps=1;function Vs(e,t=!1){ps+=e,e<0&&Gt&&t&&(Gt.hasOnce=!0)}function Tc(e){return e.dynamicChildren=ps>0?Gt||Mr:null,Gd(),ps>0&&Gt&&Gt.push(e),e}function S(e,t,n,r,s,o){return Tc(p(e,t,n,r,s,o,!0))}function ht(e,t,n,r,s){return Tc(Ce(e,t,n,r,s,!0))}function ms(e){return e?e.__v_isVNode===!0:!1}function fr(e,t){return e.type===t.type&&e.key===t.key}const Sc=({key:e})=>e??null,Os=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?_t(e)||Dt(e)||Ve(e)?{i:Rt,r:e,k:t,f:!!n}:e:null);function p(e,t=null,n=null,r=0,s=null,o=e===He?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Sc(t),ref:t&&Os(t),scopeId:Kl,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:Rt};return a?(xi(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=_t(n)?8:16),ps>0&&!i&&Gt&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Gt.push(l),l}const Ce=zd;function zd(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===oc)&&(e=Nt),ms(e)){const a=Yn(e,t,!0);return n&&xi(a,n),ps>0&&!o&&Gt&&(a.shapeFlag&6?Gt[Gt.indexOf(e)]=a:Gt.push(a)),a.patchFlag=-2,a}if(sf(e)&&(e=e.__vccOpts),t){t=Yd(t);let{class:a,style:l}=t;a&&!_t(a)&&(t.class=ut(a)),it(l)&&(bi(l)&&!Be(l)&&(l=xt({},l)),t.style=vr(l))}const i=_t(e)?1:kc(e)?128:Jl(e)?64:it(e)?4:Ve(e)?2:0;return p(e,t,n,r,s,i,o,!0)}function Yd(e){return e?bi(e)||pc(e)?xt({},e):e:null}function Yn(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?xc(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Sc(d),ref:t&&t.ref?n&&o?Be(o)?o.concat(Os(t)):[o,Os(t)]:Os(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!==He?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&&Yn(e.ssContent),ssFallback:e.ssFallback&&Yn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&hs(u,l.clone(u)),u}function Jd(e=" ",t=0){return Ce(so,null,e,t)}function le(e="",t=!1){return t?(w(),ht(Nt,null,e)):Ce(Nt,null,e)}function dn(e){return e==null||typeof e=="boolean"?Ce(Nt):Be(e)?Ce(He,null,e.slice()):ms(e)?Sn(e):Ce(so,null,String(e))}function Sn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Yn(e)}function xi(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Be(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),xi(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!pc(t)?t._ctx=Rt:s===3&&Rt&&(Rt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ve(t)?(t={default:t,_ctx:Rt},n=32):(t=String(t),r&64?(n=16,t=[Jd(t)]):n=8);e.children=t,e.shapeFlag|=n}function xc(...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=vr([t.style,r.style]);else if(Gs(s)){const o=t[s],i=r[s];i&&o!==i&&!(Be(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function ln(e,t,n,r=null){sn(e,t,7,[n,r])}const Qd=cc();let Xd=0;function Zd(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Qd,o={uid:Xd++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Tu(!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:gc(r,s),emitsOptions:uc(r,s),emit:null,emitted:null,propsDefaults:mt,inheritAttrs:r.inheritAttrs,ctx:mt,data:mt,props:mt,attrs:mt,slots:mt,refs:mt,setupState:mt,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=Rd.bind(null,o),e.ce&&e.ce(o),o}let jt=null;const Ci=()=>jt||Rt;let Ws,Jo;{const e=Js(),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)}};Ws=t("__VUE_INSTANCE_SETTERS__",n=>jt=n),Jo=t("__VUE_SSR_SETTERS__",n=>gs=n)}const _s=e=>{const t=jt;return Ws(e),e.scope.on(),()=>{e.scope.off(),Ws(t)}},aa=()=>{jt&&jt.scope.off(),Ws(null)};function Cc(e){return e.vnode.shapeFlag&4}let gs=!1;function ef(e,t=!1,n=!1){t&&Jo(t);const{props:r,children:s}=e.vnode,o=Cc(e);jd(e,r,o,t),Fd(e,s,n||t);const i=o?tf(e,t):void 0;return t&&Jo(!1),i}function tf(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wd);const{setup:r}=n;if(r){An();const s=e.setupContext=r.length>1?Ac(e):null,o=_s(e),i=bs(r,e,0,[e.props,s]),a=yl(i);if(In(),o(),(a||e.sp)&&!Nr(e)&&rc(e),a){if(i.then(aa,aa),t)return i.then(l=>{la(e,l)}).catch(l=>{Zs(l,e,0)});e.asyncDep=i}else la(e,i)}else Ec(e)}function la(e,t,n){Ve(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:it(t)&&(e.setupState=Hl(t)),Ec(e)}function Ec(e,t,n){const r=e.type;e.render||(e.render=r.render||hn);{const s=_s(e);An();try{kd(e)}finally{In(),s()}}}const nf={get(e,t){return Ot(e,"get",""),e[t]}};function Ac(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,nf),slots:e.slots,emit:e.emit,expose:t}}function oo(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Hl(Vu(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in as)return as[n](e)},has(t,n){return n in t||n in as}})):e.proxy}function rf(e,t=!0){return Ve(e)?e.displayName||e.name:e.name||t&&e.__name}function sf(e){return Ve(e)&&"__vccOpts"in e}const ce=(e,t)=>zu(e,t,gs);function Ei(e,t,n){try{Vs(-1);const r=arguments.length;return r===2?it(t)&&!Be(t)?ms(t)?Ce(e,null,[t]):Ce(e,t):Ce(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ms(n)&&(n=[n]),Ce(e,t,n))}finally{Vs(1)}}const of="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 Qo;const ca=typeof window<"u"&&window.trustedTypes;if(ca)try{Qo=ca.createPolicy("vue",{createHTML:e=>e})}catch{}const Ic=Qo?e=>Qo.createHTML(e):e=>e,af="http://www.w3.org/2000/svg",lf="http://www.w3.org/1998/Math/MathML",Tn=typeof document<"u"?document:null,ua=Tn&&Tn.createElement("template"),cf={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"?Tn.createElementNS(af,e):t==="mathml"?Tn.createElementNS(lf,e):n?Tn.createElement(e,{is:n}):Tn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Tn.createTextNode(e),createComment:e=>Tn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Tn.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{ua.innerHTML=Ic(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=ua.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]}},Hn="transition",Jr="animation",vs=Symbol("_vtc"),Rc={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},uf=xt({},Xl,Rc),df=e=>(e.displayName="Transition",e.props=uf,e),$c=df((e,{slots:t})=>Ei(id,ff(e),t)),lr=(e,t=[])=>{Be(e)?e.forEach(n=>n(...t)):e&&e(...t)},da=e=>e?Be(e)?e.some(t=>t.length>1):e.length>1:!1;function ff(e){const t={};for(const ne in e)ne in Rc||(t[ne]=e[ne]);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:m=`${n}-leave-active`,leaveToClass:_=`${n}-leave-to`}=e,N=hf(s),E=N&&N[0],H=N&&N[1],{onBeforeEnter:Y,onEnter:O,onEnterCancelled:U,onLeave:D,onLeaveCancelled:ae,onBeforeAppear:ue=Y,onAppear:fe=O,onAppearCancelled:ke=U}=t,oe=(ne,Fe,Ue,Ke)=>{ne._enterCancelled=Ke,cr(ne,Fe?u:a),cr(ne,Fe?d:i),Ue&&Ue()},ee=(ne,Fe)=>{ne._isLeaving=!1,cr(ne,f),cr(ne,_),cr(ne,m),Fe&&Fe()},ye=ne=>(Fe,Ue)=>{const Ke=ne?fe:O,Ie=()=>oe(Fe,ne,Ue);lr(Ke,[Fe,Ie]),fa(()=>{cr(Fe,ne?l:o),_n(Fe,ne?u:a),da(Ke)||ha(Fe,r,E,Ie)})};return xt(t,{onBeforeEnter(ne){lr(Y,[ne]),_n(ne,o),_n(ne,i)},onBeforeAppear(ne){lr(ue,[ne]),_n(ne,l),_n(ne,d)},onEnter:ye(!1),onAppear:ye(!0),onLeave(ne,Fe){ne._isLeaving=!0;const Ue=()=>ee(ne,Fe);_n(ne,f),ne._enterCancelled?(_n(ne,m),ga(ne)):(ga(ne),_n(ne,m)),fa(()=>{ne._isLeaving&&(cr(ne,f),_n(ne,_),da(D)||ha(ne,r,H,Ue))}),lr(D,[ne,Ue])},onEnterCancelled(ne){oe(ne,!1,void 0,!0),lr(U,[ne])},onAppearCancelled(ne){oe(ne,!0,void 0,!0),lr(ke,[ne])},onLeaveCancelled(ne){ee(ne),lr(ae,[ne])}})}function hf(e){if(e==null)return null;if(it(e))return[bo(e.enter),bo(e.leave)];{const t=bo(e);return[t,t]}}function bo(e){return mu(e)}function _n(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[vs]||(e[vs]=new Set)).add(t)}function cr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[vs];n&&(n.delete(t),n.size||(e[vs]=void 0))}function fa(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let pf=0;function ha(e,t,n,r){const s=e._endId=++pf,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=mf(e,t);if(!i)return r();const d=i+"end";let u=0;const f=()=>{e.removeEventListener(d,m),o()},m=_=>{_.target===e&&++u>=l&&f()};setTimeout(()=>{u<l&&f()},a+1),e.addEventListener(d,m)}function mf(e,t){const n=window.getComputedStyle(e),r=N=>(n[N]||"").split(", "),s=r(`${Hn}Delay`),o=r(`${Hn}Duration`),i=pa(s,o),a=r(`${Jr}Delay`),l=r(`${Jr}Duration`),d=pa(a,l);let u=null,f=0,m=0;t===Hn?i>0&&(u=Hn,f=i,m=o.length):t===Jr?d>0&&(u=Jr,f=d,m=l.length):(f=Math.max(i,d),u=f>0?i>d?Hn:Jr:null,m=u?u===Hn?o.length:l.length:0);const _=u===Hn&&/\b(?:transform|all)(?:,|$)/.test(r(`${Hn}Property`).toString());return{type:u,timeout:f,propCount:m,hasTransform:_}}function pa(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>ma(n)+ma(e[r])))}function ma(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ga(e){return(e?e.ownerDocument:document).body.offsetHeight}function gf(e,t,n){const r=e[vs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const va=Symbol("_vod"),vf=Symbol("_vsh"),yf=Symbol(""),wf=/(?:^|;)\s*display\s*:/;function bf(e,t,n){const r=e.style,s=_t(n);let o=!1;if(n&&!s){if(t)if(_t(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Ns(r,a,"")}else for(const i in t)n[i]==null&&Ns(r,i,"");for(const i in n)i==="display"&&(o=!0),Ns(r,i,n[i])}else if(s){if(t!==n){const i=r[yf];i&&(n+=";"+i),r.cssText=n,o=wf.test(n)}}else t&&e.removeAttribute("style");va in e&&(e[va]=o?r.display:"",e[vf]&&(r.display="none"))}const ya=/\s*!important$/;function Ns(e,t,n){if(Be(n))n.forEach(r=>Ns(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=_f(e,t);ya.test(n)?e.setProperty(Jn(r),n.replace(ya,""),"important"):e[r]=n}}const wa=["Webkit","Moz","ms"],_o={};function _f(e,t){const n=_o[t];if(n)return n;let r=Zt(t);if(r!=="filter"&&r in e)return _o[t]=r;r=Ys(r);for(let s=0;s<wa.length;s++){const o=wa[s]+r;if(o in e)return _o[t]=o}return t}const ba="http://www.w3.org/1999/xlink";function _a(e,t,n,r,s,o=_u(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ba,t.slice(6,t.length)):e.setAttributeNS(ba,t,n):n==null||o&&!kl(n)?e.removeAttribute(t):e.setAttribute(t,o?"":nn(n)?String(n):n)}function ka(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Ic(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=kl(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 Rr(e,t,n,r){e.addEventListener(t,n,r)}function kf(e,t,n,r){e.removeEventListener(t,n,r)}const Ta=Symbol("_vei");function Tf(e,t,n,r,s=null){const o=e[Ta]||(e[Ta]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=Sf(t);if(r){const d=o[t]=Ef(r,s);Rr(e,a,d,l)}else i&&(kf(e,a,i,l),o[t]=void 0)}}const Sa=/(?:Once|Passive|Capture)$/;function Sf(e){let t;if(Sa.test(e)){t={};let r;for(;r=e.match(Sa);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Jn(e.slice(2)),t]}let ko=0;const xf=Promise.resolve(),Cf=()=>ko||(xf.then(()=>ko=0),ko=Date.now());function Ef(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;sn(Af(r,n.value),t,5,[r])};return n.value=e,n.attached=Cf(),n}function Af(e,t){if(Be(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 xa=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,If=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?gf(e,r,i):t==="style"?bf(e,n,r):Gs(t)?ci(t)||Tf(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Rf(e,t,r,i))?(ka(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&_a(e,t,r,i,o,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!_t(r))?ka(e,Zt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),_a(e,t,r,i))};function Rf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&xa(t)&&Ve(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 xa(t)&&_t(n)?!1:t in e}const Ca=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Be(t)?n=>$s(t,n):t};function $f(e){e.target.composing=!0}function Ea(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const To=Symbol("_assign");function Aa(e,t,n){return t&&(e=e.trim()),n&&(e=fi(e)),e}const Mn={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[To]=Ca(s);const o=r||s.props&&s.props.type==="number";Rr(e,t?"change":"input",i=>{i.target.composing||e[To](Aa(e.value,n,o))}),(n||o)&&Rr(e,"change",()=>{e.value=Aa(e.value,n,o)}),t||(Rr(e,"compositionstart",$f),Rr(e,"compositionend",Ea),Rr(e,"change",Ea))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[To]=Ca(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?fi(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))}},Mf=["ctrl","shift","alt","meta"],Pf={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)=>Mf.some(n=>e[`${n}Key`]&&!t.includes(n))},Ye=(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=Pf[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Of={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ht=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Jn(s.key);if(t.some(i=>i===o||Of[i]===o))return e(s)}))},Nf=xt({patchProp:If},cf);let Ia;function jf(){return Ia||(Ia=Ud(Nf))}const Df=((...e)=>{const t=jf().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Bf(r);if(!s)return;const o=t._component;!Ve(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Lf(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Lf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Bf(e){return _t(e)?document.querySelector(e):e}/*!
18
- * vue-router v4.6.4
19
- * (c) 2025 Eduardo San Martin Morote
20
- * @license MIT
21
- */const $r=typeof document<"u";function Mc(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ff(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Mc(e.default)}const st=Object.assign;function So(e,t){const n={};for(const r in t){const s=t[r];n[r]=on(s)?s.map(e):e(s)}return n}const cs=()=>{},on=Array.isArray;function Ra(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Pc=/#/g,Hf=/&/g,Uf=/\//g,Vf=/=/g,Wf=/\?/g,Oc=/\+/g,qf=/%5B/g,Kf=/%5D/g,Nc=/%5E/g,Gf=/%60/g,jc=/%7B/g,zf=/%7C/g,Dc=/%7D/g,Yf=/%20/g;function Ai(e){return e==null?"":encodeURI(""+e).replace(zf,"|").replace(qf,"[").replace(Kf,"]")}function Jf(e){return Ai(e).replace(jc,"{").replace(Dc,"}").replace(Nc,"^")}function Xo(e){return Ai(e).replace(Oc,"%2B").replace(Yf,"+").replace(Pc,"%23").replace(Hf,"%26").replace(Gf,"`").replace(jc,"{").replace(Dc,"}").replace(Nc,"^")}function Qf(e){return Xo(e).replace(Vf,"%3D")}function Xf(e){return Ai(e).replace(Pc,"%23").replace(Wf,"%3F")}function Zf(e){return Xf(e).replace(Uf,"%2F")}function ys(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const eh=/\/$/,th=e=>e.replace(eh,"");function xo(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=oh(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:ys(i)}}function nh(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function $a(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function rh(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Lr(t.matched[r],n.matched[s])&&Lc(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Lr(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Lc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!sh(e[n],t[n]))return!1;return!0}function sh(e,t){return on(e)?Ma(e,t):on(t)?Ma(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Ma(e,t){return on(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function oh(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 Un={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Zo=(function(e){return e.pop="pop",e.push="push",e})({}),Co=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function ih(e){if(!e)if($r){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),th(e)}const ah=/^[^#]+#/;function lh(e,t){return e.replace(ah,"#")+t}function ch(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 io=()=>({left:window.scrollX,top:window.scrollY});function uh(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=ch(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 ei=new Map;function dh(e,t){ei.set(e,t)}function fh(e){const t=ei.get(e);return ei.delete(e),t}function hh(e){return typeof e=="string"||e&&typeof e=="object"}function Bc(e){return typeof e=="string"||typeof e=="symbol"}let kt=(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 Fc=Symbol("");kt.MATCHER_NOT_FOUND+"",kt.NAVIGATION_GUARD_REDIRECT+"",kt.NAVIGATION_ABORTED+"",kt.NAVIGATION_CANCELLED+"",kt.NAVIGATION_DUPLICATED+"";function Br(e,t){return st(new Error,{type:e,[Fc]:!0},t)}function kn(e,t){return e instanceof Error&&Fc in e&&(t==null||!!(e.type&t))}const ph=["params","query","hash"];function mh(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of ph)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function gh(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(Oc," "),o=s.indexOf("="),i=ys(o<0?s:s.slice(0,o)),a=o<0?null:ys(s.slice(o+1));if(i in t){let l=t[i];on(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function Oa(e){let t="";for(let n in e){const r=e[n];if(n=Qf(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(on(r)?r.map(s=>s&&Xo(s)):[r&&Xo(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function vh(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=on(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const yh=Symbol(""),Na=Symbol(""),ao=Symbol(""),Ii=Symbol(""),ti=Symbol("");function Qr(){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 Kn(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const d=m=>{m===!1?l(Br(kt.NAVIGATION_ABORTED,{from:n,to:t})):m instanceof Error?l(m):hh(m)?l(Br(kt.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(i&&r.enterCallbacks[s]===i&&typeof m=="function"&&i.push(m),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(m=>l(m))})}function Eo(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(Mc(l)){const d=(l.__vccOpts||l)[t];d&&o.push(Kn(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=Ff(u)?u.default:u;i.mods[a]=u,i.components[a]=f;const m=(f.__vccOpts||f)[t];return m&&Kn(m,n,r,i,a,s)()}))}}return o}function wh(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=>Lr(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>Lr(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 bh=()=>location.protocol+"//"+location.host;function Hc(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),$a(a,"")}return $a(n,e)+r+s}function _h(e,t,n,r){let s=[],o=[],i=null;const a=({state:m})=>{const _=Hc(e,location),N=n.value,E=t.value;let H=0;if(m){if(n.value=_,t.value=m,i&&i===N){i=null;return}H=E?m.position-E.position:0}else r(_);s.forEach(Y=>{Y(n.value,N,{delta:H,type:Zo.pop,direction:H?H>0?Co.forward:Co.back:Co.unknown})})};function l(){i=n.value}function d(m){s.push(m);const _=()=>{const N=s.indexOf(m);N>-1&&s.splice(N,1)};return o.push(_),_}function u(){if(document.visibilityState==="hidden"){const{history:m}=window;if(!m.state)return;m.replaceState(st({},m.state,{scroll:io()}),"")}}function f(){for(const m of o)m();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 ja(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?io():null}}function kh(e){const{history:t,location:n}=window,r={value:Hc(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("#"),m=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:bh()+e+l;try{t[u?"replaceState":"pushState"](d,"",m),s.value=d}catch(_){console.error(_),n[u?"replace":"assign"](m)}}function i(l,d){o(l,st({},t.state,ja(s.value.back,l,s.value.forward,!0),d,{position:s.value.position}),!0),r.value=l}function a(l,d){const u=st({},s.value,t.state,{forward:l,scroll:io()});o(u.current,u,!0),o(l,st({},ja(r.value,l,null),{position:u.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function Th(e){e=ih(e);const t=kh(e),n=_h(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=st({location:"",base:e,go:r,createHref:lh.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 Sh(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Th(e)}let pr=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var St=(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})(St||{});const xh={type:pr.Static,value:""},Ch=/[a-zA-Z0-9_]/;function Eh(e){if(!e)return[[]];if(e==="/")return[[xh]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${d}": ${_}`)}let n=St.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",u="";function f(){d&&(n===St.Static?o.push({type:pr.Static,value:d}):n===St.Param||n===St.ParamRegExp||n===St.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:pr.Param,value:d,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),d="")}function m(){d+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==St.ParamRegExp){r=n,n=St.EscapeNext;continue}switch(n){case St.Static:l==="/"?(d&&f(),i()):l===":"?(f(),n=St.Param):m();break;case St.EscapeNext:m(),n=r;break;case St.Param:l==="("?n=St.ParamRegExp:Ch.test(l)?m():(f(),n=St.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case St.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=St.ParamRegExpEnd:u+=l;break;case St.ParamRegExpEnd:f(),n=St.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===St.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),f(),i(),s}const Da="[^/]+?",Ah={sensitive:!1,strict:!1,start:!0,end:!0};var Bt=(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})(Bt||{});const Ih=/[.+*?^${}()[\]/\\]/g;function Rh(e,t){const n=st({},Ah,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const u=d.length?[]:[Bt.Root];n.strict&&!d.length&&(s+="/");for(let f=0;f<d.length;f++){const m=d[f];let _=Bt.Segment+(n.sensitive?Bt.BonusCaseSensitive:0);if(m.type===pr.Static)f||(s+="/"),s+=m.value.replace(Ih,"\\$&"),_+=Bt.Static;else if(m.type===pr.Param){const{value:N,repeatable:E,optional:H,regexp:Y}=m;o.push({name:N,repeatable:E,optional:H});const O=Y||Da;if(O!==Da){_+=Bt.BonusCustomRegExp;try{`${O}`}catch(D){throw new Error(`Invalid custom RegExp for param "${N}" (${O}): `+D.message)}}let U=E?`((?:${O})(?:/(?:${O}))*)`:`(${O})`;f||(U=H&&d.length<2?`(?:/${U})`:"/"+U),H&&(U+="?"),s+=U,_+=Bt.Dynamic,H&&(_+=Bt.BonusOptional),E&&(_+=Bt.BonusRepeatable),O===".*"&&(_+=Bt.BonusWildcard)}u.push(_)}r.push(u)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=Bt.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 m=1;m<u.length;m++){const _=u[m]||"",N=o[m-1];f[N.name]=_&&N.repeatable?_.split("/"):_}return f}function l(d){let u="",f=!1;for(const m of e){(!f||!u.endsWith("/"))&&(u+="/"),f=!1;for(const _ of m)if(_.type===pr.Static)u+=_.value;else if(_.type===pr.Param){const{value:N,repeatable:E,optional:H}=_,Y=N in d?d[N]:"";if(on(Y)&&!E)throw new Error(`Provided param "${N}" is an array but it is not repeatable (* or + modifiers)`);const O=on(Y)?Y.join("/"):Y;if(!O)if(H)m.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${N}"`);u+=O}}return u||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function $h(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]===Bt.Static+Bt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Bt.Static+Bt.Segment?1:-1:0}function Uc(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=$h(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(La(r))return 1;if(La(s))return-1}return s.length-r.length}function La(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Mh={strict:!1,end:!0,sensitive:!1};function Ph(e,t,n){const r=Rh(Eh(e.path),n),s=st(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Oh(e,t){const n=[],r=new Map;t=Ra(Mh,t);function s(f){return r.get(f)}function o(f,m,_){const N=!_,E=Fa(f);E.aliasOf=_&&_.record;const H=Ra(t,f),Y=[E];if("alias"in f){const D=typeof f.alias=="string"?[f.alias]:f.alias;for(const ae of D)Y.push(Fa(st({},E,{components:_?_.record.components:E.components,path:ae,aliasOf:_?_.record:E})))}let O,U;for(const D of Y){const{path:ae}=D;if(m&&ae[0]!=="/"){const ue=m.record.path,fe=ue[ue.length-1]==="/"?"":"/";D.path=m.record.path+(ae&&fe+ae)}if(O=Ph(D,m,H),_?_.alias.push(O):(U=U||O,U!==O&&U.alias.push(O),N&&f.name&&!Ha(O)&&i(f.name)),Vc(O)&&l(O),E.children){const ue=E.children;for(let fe=0;fe<ue.length;fe++)o(ue[fe],O,_&&_.children[fe])}_=_||O}return U?()=>{i(U)}:cs}function i(f){if(Bc(f)){const m=r.get(f);m&&(r.delete(f),n.splice(n.indexOf(m),1),m.children.forEach(i),m.alias.forEach(i))}else{const m=n.indexOf(f);m>-1&&(n.splice(m,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 m=Dh(f,n);n.splice(m,0,f),f.record.name&&!Ha(f)&&r.set(f.record.name,f)}function d(f,m){let _,N={},E,H;if("name"in f&&f.name){if(_=r.get(f.name),!_)throw Br(kt.MATCHER_NOT_FOUND,{location:f});H=_.record.name,N=st(Ba(m.params,_.keys.filter(U=>!U.optional).concat(_.parent?_.parent.keys.filter(U=>U.optional):[]).map(U=>U.name)),f.params&&Ba(f.params,_.keys.map(U=>U.name))),E=_.stringify(N)}else if(f.path!=null)E=f.path,_=n.find(U=>U.re.test(E)),_&&(N=_.parse(E),H=_.record.name);else{if(_=m.name?r.get(m.name):n.find(U=>U.re.test(m.path)),!_)throw Br(kt.MATCHER_NOT_FOUND,{location:f,currentLocation:m});H=_.record.name,N=st({},m.params,f.params),E=_.stringify(N)}const Y=[];let O=_;for(;O;)Y.unshift(O.record),O=O.parent;return{name:H,path:E,params:N,matched:Y,meta:jh(Y)}}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 Fa(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Nh(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 Nh(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 Ha(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function jh(e){return e.reduce((t,n)=>st(t,n.meta),{})}function Dh(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Uc(e,t[o])<0?r=o:n=o+1}const s=Lh(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Lh(e){let t=e;for(;t=t.parent;)if(Vc(t)&&Uc(e,t)===0)return t}function Vc({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ua(e){const t=tn(ao),n=tn(Ii),r=ce(()=>{const l=je(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 m=f.findIndex(Lr.bind(null,u));if(m>-1)return m;const _=Va(l[d-2]);return d>1&&Va(u)===_&&f[f.length-1].path!==_?f.findIndex(Lr.bind(null,l[d-2])):m}),o=ce(()=>s.value>-1&&Vh(n.params,r.value.params)),i=ce(()=>s.value>-1&&s.value===n.matched.length-1&&Lc(n.params,r.value.params));function a(l={}){if(Uh(l)){const d=t[je(e.replace)?"replace":"push"](je(e.to)).catch(cs);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 Bh(e){return e.length===1?e[0]:e}const Fh=At({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:Ua,setup(e,{slots:t}){const n=Xs(Ua(e)),{options:r}=tn(ao),s=ce(()=>({[Wa(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Wa(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Bh(t.default(n));return e.custom?o:Ei("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Hh=Fh;function Uh(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 Vh(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(!on(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Va(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Wa=(e,t,n)=>e??t??n,Wh=At({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=tn(ti),s=ce(()=>e.route||r.value),o=tn(Na,0),i=ce(()=>{let d=je(o);const{matched:u}=s.value;let f;for(;(f=u[d])&&!f.components;)d++;return d}),a=ce(()=>s.value.matched[i.value]);Ms(Na,ce(()=>i.value+1)),Ms(yh,a),Ms(ti,s);const l=P();return ct(()=>[l.value,a.value,e.name],([d,u,f],[m,_,N])=>{u&&(u.instances[f]=d,_&&_!==u&&d&&d===m&&(u.leaveGuards.size||(u.leaveGuards=_.leaveGuards),u.updateGuards.size||(u.updateGuards=_.updateGuards))),d&&u&&(!_||!Lr(u,_)||!m)&&(u.enterCallbacks[f]||[]).forEach(E=>E(d))},{flush:"post"}),()=>{const d=s.value,u=e.name,f=a.value,m=f&&f.components[u];if(!m)return qa(n.default,{Component:m,route:d});const _=f.props[u],N=_?_===!0?d.params:typeof _=="function"?_(d):_:null,H=Ei(m,st({},N,t,{onVnodeUnmounted:Y=>{Y.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return qa(n.default,{Component:H,route:d})||H}}});function qa(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const qh=Wh;function Kh(e){const t=Oh(e.routes,e),n=e.parseQuery||gh,r=e.stringifyQuery||Oa,s=e.history,o=Qr(),i=Qr(),a=Qr(),l=Wu(Un);let d=Un;$r&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=So.bind(null,I=>""+I),f=So.bind(null,Zf),m=So.bind(null,ys);function _(I,Q){let z,me;return Bc(I)?(z=t.getRecordMatcher(I),me=Q):me=I,t.addRoute(me,z)}function N(I){const Q=t.getRecordMatcher(I);Q&&t.removeRoute(Q)}function E(){return t.getRoutes().map(I=>I.record)}function H(I){return!!t.getRecordMatcher(I)}function Y(I,Q){if(Q=st({},Q||l.value),typeof I=="string"){const x=xo(n,I,Q.path),L=t.resolve({path:x.path},Q),F=s.createHref(x.fullPath);return st(x,L,{params:m(L.params),hash:ys(x.hash),redirectedFrom:void 0,href:F})}let z;if(I.path!=null)z=st({},I,{path:xo(n,I.path,Q.path).path});else{const x=st({},I.params);for(const L in x)x[L]==null&&delete x[L];z=st({},I,{params:f(x)}),Q.params=f(Q.params)}const me=t.resolve(z,Q),De=I.hash||"";me.params=u(m(me.params));const g=nh(r,st({},I,{hash:Jf(De),path:me.path})),y=s.createHref(g);return st({fullPath:g,hash:De,query:r===Oa?vh(I.query):I.query||{}},me,{redirectedFrom:void 0,href:y})}function O(I){return typeof I=="string"?xo(n,I,l.value.path):st({},I)}function U(I,Q){if(d!==I)return Br(kt.NAVIGATION_CANCELLED,{from:Q,to:I})}function D(I){return fe(I)}function ae(I){return D(st(O(I),{replace:!0}))}function ue(I,Q){const z=I.matched[I.matched.length-1];if(z&&z.redirect){const{redirect:me}=z;let De=typeof me=="function"?me(I,Q):me;return typeof De=="string"&&(De=De.includes("?")||De.includes("#")?De=O(De):{path:De},De.params={}),st({query:I.query,hash:I.hash,params:De.path!=null?{}:I.params},De)}}function fe(I,Q){const z=d=Y(I),me=l.value,De=I.state,g=I.force,y=I.replace===!0,x=ue(z,me);if(x)return fe(st(O(x),{state:typeof x=="object"?st({},De,x.state):De,force:g,replace:y}),Q||z);const L=z;L.redirectedFrom=Q;let F;return!g&&rh(r,me,z)&&(F=Br(kt.NAVIGATION_DUPLICATED,{to:L,from:me}),dt(me,me,!0,!1)),(F?Promise.resolve(F):ee(L,me)).catch(j=>kn(j)?kn(j,kt.NAVIGATION_GUARD_REDIRECT)?j:Ze(j):Oe(j,L,me)).then(j=>{if(j){if(kn(j,kt.NAVIGATION_GUARD_REDIRECT))return fe(st({replace:y},O(j.to),{state:typeof j.to=="object"?st({},De,j.to.state):De,force:g}),Q||L)}else j=ne(L,me,!0,y,De);return ye(L,me,j),j})}function ke(I,Q){const z=U(I,Q);return z?Promise.reject(z):Promise.resolve()}function oe(I){const Q=pe.values().next().value;return Q&&typeof Q.runWithContext=="function"?Q.runWithContext(I):I()}function ee(I,Q){let z;const[me,De,g]=wh(I,Q);z=Eo(me.reverse(),"beforeRouteLeave",I,Q);for(const x of me)x.leaveGuards.forEach(L=>{z.push(Kn(L,I,Q))});const y=ke.bind(null,I,Q);return z.push(y),Te(z).then(()=>{z=[];for(const x of o.list())z.push(Kn(x,I,Q));return z.push(y),Te(z)}).then(()=>{z=Eo(De,"beforeRouteUpdate",I,Q);for(const x of De)x.updateGuards.forEach(L=>{z.push(Kn(L,I,Q))});return z.push(y),Te(z)}).then(()=>{z=[];for(const x of g)if(x.beforeEnter)if(on(x.beforeEnter))for(const L of x.beforeEnter)z.push(Kn(L,I,Q));else z.push(Kn(x.beforeEnter,I,Q));return z.push(y),Te(z)}).then(()=>(I.matched.forEach(x=>x.enterCallbacks={}),z=Eo(g,"beforeRouteEnter",I,Q,oe),z.push(y),Te(z))).then(()=>{z=[];for(const x of i.list())z.push(Kn(x,I,Q));return z.push(y),Te(z)}).catch(x=>kn(x,kt.NAVIGATION_CANCELLED)?x:Promise.reject(x))}function ye(I,Q,z){a.list().forEach(me=>oe(()=>me(I,Q,z)))}function ne(I,Q,z,me,De){const g=U(I,Q);if(g)return g;const y=Q===Un,x=$r?history.state:{};z&&(me||y?s.replace(I.fullPath,st({scroll:y&&x&&x.scroll},De)):s.push(I.fullPath,De)),l.value=I,dt(I,Q,z,y),Ze()}let Fe;function Ue(){Fe||(Fe=s.listen((I,Q,z)=>{if(!Ee.listening)return;const me=Y(I),De=ue(me,Ee.currentRoute.value);if(De){fe(st(De,{replace:!0,force:!0}),me).catch(cs);return}d=me;const g=l.value;$r&&dh(Pa(g.fullPath,z.delta),io()),ee(me,g).catch(y=>kn(y,kt.NAVIGATION_ABORTED|kt.NAVIGATION_CANCELLED)?y:kn(y,kt.NAVIGATION_GUARD_REDIRECT)?(fe(st(O(y.to),{force:!0}),me).then(x=>{kn(x,kt.NAVIGATION_ABORTED|kt.NAVIGATION_DUPLICATED)&&!z.delta&&z.type===Zo.pop&&s.go(-1,!1)}).catch(cs),Promise.reject()):(z.delta&&s.go(-z.delta,!1),Oe(y,me,g))).then(y=>{y=y||ne(me,g,!1),y&&(z.delta&&!kn(y,kt.NAVIGATION_CANCELLED)?s.go(-z.delta,!1):z.type===Zo.pop&&kn(y,kt.NAVIGATION_ABORTED|kt.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ye(me,g,y)}).catch(cs)}))}let Ke=Qr(),Ie=Qr(),be;function Oe(I,Q,z){Ze(I);const me=Ie.list();return me.length?me.forEach(De=>De(I,Q,z)):console.error(I),Promise.reject(I)}function vt(){return be&&l.value!==Un?Promise.resolve():new Promise((I,Q)=>{Ke.add([I,Q])})}function Ze(I){return be||(be=!I,Ue(),Ke.list().forEach(([Q,z])=>I?z(I):Q()),Ke.reset()),I}function dt(I,Q,z,me){const{scrollBehavior:De}=e;if(!$r||!De)return Promise.resolve();const g=!z&&fh(Pa(I.fullPath,0))||(me||!z)&&history.state&&history.state.scroll||null;return zt().then(()=>De(I,Q,g)).then(y=>y&&uh(y)).catch(y=>Oe(y,I,Q))}const tt=I=>s.go(I);let ze;const pe=new Set,Ee={currentRoute:l,listening:!0,addRoute:_,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:H,getRoutes:E,resolve:Y,options:e,push:D,replace:ae,go:tt,back:()=>tt(-1),forward:()=>tt(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Ie.add,isReady:vt,install(I){I.component("RouterLink",Hh),I.component("RouterView",qh),I.config.globalProperties.$router=Ee,Object.defineProperty(I.config.globalProperties,"$route",{enumerable:!0,get:()=>je(l)}),$r&&!ze&&l.value===Un&&(ze=!0,D(s.location).catch(me=>{}));const Q={};for(const me in Un)Object.defineProperty(Q,me,{get:()=>l.value[me],enumerable:!0});I.provide(ao,Ee),I.provide(Ii,Bl(Q)),I.provide(ti,l);const z=I.unmount;pe.add(I),I.unmount=function(){pe.delete(I),pe.size<1&&(d=Un,Fe&&Fe(),Fe=null,l.value=Un,ze=!1,be=!1),z()}}};function Te(I){return I.reduce((Q,z)=>Q.then(()=>oe(z)),Promise.resolve())}return Ee}function Gh(){return tn(ao)}function zh(e){return tn(Ii)}const Ka=768;function Wc(){const e=P(typeof window<"u"?window.innerWidth<Ka:!1);let t=null;function n(r){e.value=r.matches}return On(()=>{t=window.matchMedia(`(max-width: ${Ka-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),no(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Yh={key:0,class:"desktop-sidebar"},Jh={class:"desktop-main"},Ga="codex-web-local.sidebar-width.v1",Qh=260,Xh=620,za=320,Zh=At({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Wc();function r(d){return Math.min(Xh,Math.max(Qh,d))}function s(){if(typeof window>"u")return za;const d=window.localStorage.getItem(Ga),u=Number(d);return Number.isFinite(u)?r(u):za}const o=P(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(Ga,String(d))}function l(d){d.preventDefault();const u=d.clientX,f=o.value,m=N=>{const E=N.clientX-u;o.value=r(f+E)},_=()=>{a(o.value),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",m),window.addEventListener("mouseup",_)}return(d,u)=>(w(),S("div",{class:ut(["desktop-layout",{"is-mobile":je(n)}]),style:vr(i.value)},[je(n)?(w(),ht(Fs,{key:0,to:"body"},[Ce($c,{name:"drawer"},{default:lt(()=>[e.isSidebarCollapsed?le("",!0):(w(),S("div",{key:0,class:"mobile-drawer-backdrop",onClick:u[1]||(u[1]=f=>d.$emit("close-sidebar"))},[p("aside",{class:"mobile-drawer",onClick:u[0]||(u[0]=Ye(()=>{},["stop"]))},[fn(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):le("",!0),je(n)?le("",!0):(w(),S(He,{key:1},[e.isSidebarCollapsed?le("",!0):(w(),S("aside",Yh,[fn(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?le("",!0):(w(),S("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),p("section",Jh,[fn(d.$slots,"content",{},void 0)])],6))}}),Xe=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},ep=Xe(Zh,[["__scopeId","data-v-df29c633"]]),tp={},np={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function rp(e,t){return w(),S("svg",np,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const lo=Xe(tp,[["render",rp]]),sp={},op={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ip(e,t){return w(),S("svg",op,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const qc=Xe(sp,[["render",ip]]),ap={},lp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function cp(e,t){return w(),S("svg",lp,[...t[0]||(t[0]=[p("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 Xr=Xe(ap,[["render",cp]]),up={},dp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function fp(e,t){return w(),S("svg",dp,[...t[0]||(t[0]=[p("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 qs=Xe(up,[["render",fp]]),hp={},pp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function mp(e,t){return w(),S("svg",pp,[...t[0]||(t[0]=[p("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 Kc=Xe(hp,[["render",mp]]),gp={},vp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function yp(e,t){return w(),S("svg",vp,[...t[0]||(t[0]=[p("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 wp=Xe(gp,[["render",yp]]),bp={},_p={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function kp(e,t){return w(),S("svg",_p,[...t[0]||(t[0]=[p("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 js=Xe(bp,[["render",kp]]),Tp={},Sp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function xp(e,t){return w(),S("svg",Sp,[...t[0]||(t[0]=[p("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=Xe(Tp,[["render",xp]]),Cp={key:0,class:"sidebar-menu-row-left"},Ep={class:"sidebar-menu-row-main"},Ap={key:1,class:"sidebar-menu-row-right"},Ip={key:0,class:"sidebar-menu-row-right-default"},Rp={key:1,class:"sidebar-menu-row-right-hover"},$p=At({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=bd(),r=ce(()=>!!n.left),s=ce(()=>!!n.right),o=ce(()=>!!n["right-hover"]),i=ce(()=>s.value||o.value);return(a,l)=>(w(),ht(qo(t.as),xc({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:lt(()=>[r.value?(w(),S("span",Cp,[fn(a.$slots,"left",{},void 0,!0)])):le("",!0),p("span",Ep,[fn(a.$slots,"default",{},void 0,!0)]),i.value?(w(),S("span",Ap,[s.value?(w(),S("span",Ip,[fn(a.$slots,"right",{},void 0,!0)])):le("",!0),o.value?(w(),S("span",Rp,[fn(a.$slots,"right-hover",{},void 0,!0)])):le("",!0)])):le("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),ur=Xe($p,[["__scopeId","data-v-daeca4df"]]),Mp={class:"thread-tree-root"},Pp={key:0,class:"pinned-section"},Op={class:"thread-list"},Np={class:"thread-left-stack"},jp=["data-state"],Dp=["onClick"],Lp=["onClick"],Bp={class:"thread-row-title-wrap"},Fp={class:"thread-row-title"},Hp={class:"thread-row-time"},Up=["onClick"],Vp=["onClick"],Wp=["onClick"],qp=["aria-expanded"],Kp=["data-active"],Gp={key:0},zp=["data-active"],Yp={key:0},Jp={key:1,class:"thread-tree-no-results"},Qp={key:2,class:"thread-tree-loading"},Xp={key:3,class:"thread-list thread-list-global"},Zp={class:"thread-left-stack"},em=["data-state"],tm=["onClick"],nm=["onClick"],rm={class:"thread-row-title-wrap"},sm={class:"thread-row-title"},om={class:"thread-row-time"},im=["onClick"],am=["onClick"],lm=["onClick"],cm=["data-project-name","data-expanded","data-dragging"],um={class:"project-icon-stack"},dm={class:"project-icon-folder"},fm={class:"project-icon-chevron"},hm=["data-dragging-handle","onMousedown"],pm={class:"project-title"},mm={class:"project-hover-controls"},gm=["onClick"],vm=["onClick"],ym=["onClick"],wm=["onClick"],bm=["onInput"],_m=["aria-label","title","onClick"],km={key:0,class:"thread-list"},Tm={class:"thread-left-stack"},Sm=["data-state"],xm=["onClick"],Cm=["onClick"],Em={class:"thread-row-title-wrap"},Am={class:"thread-row-title"},Im={class:"thread-row-time"},Rm=["onClick"],$m=["onClick"],Mm=["onClick"],Pm=["onClick"],Om={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Nm=["onKeydown"],jm={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},Dm={class:"rename-thread-subtitle"},Lm=4,Ya=6,Ja="codex-web-local.thread-view-mode.v1",Qa="codex-web-local.collapsed-projects.v1",Bm=At({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project"],setup(e,{emit:t}){const n=e,r=t,s=P({}),o=P({}),i=P([]),a=P(""),l=P(""),d=P("actions"),u=P(""),f=P(!1),m=P(""),_=P(""),N=P(null),E=P(!1),H=P(""),Y=P(""),O=P(null),U=P(null),D=P(null);let ae=null,ue=null;const fe=P(""),ke=P({}),oe=new Map,ee=new Map,ye=new Map,ne=new WeakMap,Fe=P(null),Ue=P(!1),Ke=P(Oe()),Ie=typeof window<"u"?new ResizeObserver(k=>{for(const C of k){const R=C.target,q=ne.get(R);q&&Zn(q,R)}}):null;function be(){if(typeof window>"u")return{};try{const k=window.localStorage.getItem(Qa);if(!k)return{};const C=JSON.parse(k);return!C||typeof C!="object"||Array.isArray(C)?{}:C}catch{return{}}}function Oe(){return typeof window>"u"?"project":window.localStorage.getItem(Ja)==="chronological"?"chronological":"project"}o.value=be(),ct(o,k=>{typeof window>"u"||window.localStorage.setItem(Qa,JSON.stringify(k))},{deep:!0}),ct(Ke,k=>{typeof window>"u"||window.localStorage.setItem(Ja,k)});const vt=ce(()=>n.searchQuery.trim().toLowerCase()),Ze=ce(()=>vt.value.length>0),dt=ce(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function tt(k){if(!Ze.value)return!0;if(dt.value)return dt.value.has(k.id);const C=vt.value;return k.title.toLowerCase().includes(C)||k.preview.toLowerCase().includes(C)}const ze=ce(()=>Ze.value?n.groups.map(k=>({...k,threads:k.threads.filter(tt)})).filter(k=>k.threads.length>0):n.groups),pe=ce(()=>Ke.value==="chronological"),Ee=ce(()=>{const k=ze.value,C=[];for(const R of k)for(const q of R.threads)y(q.id)||C.push(q);return C.sort((R,q)=>{const Le=new Date(R.updatedAtIso||R.createdAtIso).getTime();return new Date(q.updatedAtIso||q.createdAtIso).getTime()-Le})}),Te=ce(()=>{const k=new Map;for(const C of n.groups)for(const R of C.threads)k.set(R.id,R);return k}),I=ce(()=>i.value.map(k=>Te.value.get(k)??null).filter(k=>k!==null).filter(tt)),Q=ce(()=>{const k=D.value;if(!k||k.dropTargetIndexFull===null||n.groups.length===0)return null;const C=Math.max(0,Math.min(k.dropTargetIndexFull,n.groups.length)),R=C>k.fromIndex?C-1:C,q=Math.max(0,Math.min(R,n.groups.length-1));return q===k.fromIndex?null:q}),z=ce(()=>{const C=(Ze.value?ze.value:n.groups).map(Wt=>Wt.projectName),R=D.value,q=Q.value;if(!R||q===null)return C;const Le=[...C],[bt]=Le.splice(R.fromIndex,1);return bt?(Le.splice(q,0,bt),Le):C}),me=ce(()=>{const k={};let C=0;for(const R of z.value)k[R]=C,C+=ft(R);return k}),De=ce(()=>{let k=0;for(const C of z.value)k+=ft(C);return{height:`${Math.max(0,k)}px`}});function g(k){const C=new Date(k).getTime();if(Number.isNaN(C))return"n/a";const R=Math.abs(Date.now()-C);if(R<6e4)return"now";const q=Math.floor(R/6e4);if(q<60)return`${q}m`;const Le=Math.floor(q/60);return Le<24?`${Le}h`:`${Math.floor(Le/24)}d`}function y(k){return i.value.includes(k)}function x(k){if(y(k)){i.value=i.value.filter(C=>C!==k);return}i.value=[k,...i.value]}function L(k){r("select",k)}function F(k){return`start new thread ${Ae(k)}`}function j(k){r("start-new-thread",k)}function X(k){l.value===k&&Z()}function re(k){return l.value===k}function Z(){l.value=""}function W(k){if(l.value===k){Z();return}l.value=k}function he(k,C){m.value=k,_.value=C,f.value=!0,Z(),zt(()=>{var R,q;(R=N.value)==null||R.focus(),(q=N.value)==null||q.select()})}function ie(){f.value=!1,m.value="",_.value=""}function ge(){const k=m.value,C=_.value.trim();!k||!C||(r("rename-thread",{threadId:k,title:C}),ie())}function Se(k,C){H.value=k,Y.value=C,E.value=!0,Z()}function Ne(){E.value=!1,H.value="",Y.value=""}function We(){const k=H.value;k&&(i.value=i.value.filter(C=>C!==k),r("archive",k),Ne())}function Ae(k){return n.projectDisplayNameById[k]??k}function at(k){return a.value===k}function Je(){a.value="",d.value="actions",u.value=""}function B(){Ue.value=!Ue.value}function V(k){Ke.value=k,Ue.value=!1}function J(k){if(a.value===k){Je();return}a.value=k,d.value="actions",u.value=Ae(k)}function Ge(k){a.value=k,d.value="rename",u.value=Ae(k)}function b(k){r("rename-project",{projectName:k,displayName:u.value})}function A(k){r("remove-project",k),Je()}function M(k){r("browse-project-files",k),Je()}function se(k,C){if(!k.altKey||k.key!=="ArrowUp"&&k.key!=="ArrowDown")return;const R=n.groups.findIndex(bt=>bt.projectName===C);if(R<0)return;const q=k.key==="ArrowUp"?-1:1,Le=Math.max(0,Math.min(R+q,n.groups.length-1));Le!==R&&(k.preventDefault(),r("reorder-project",{projectName:C,toIndex:Le}))}function xe(k){return s.value[k]===!0}function _e(k){return o.value[k]===!0}function nt(k){s.value={...s.value,[k]:!xe(k)}}function Qe(k){if(fe.value===k){fe.value="";return}o.value={...o.value,[k]:!_e(k)}}function ft(k){const C=ke.value[k]??0,R=D.value,Le=((R==null?void 0:R.projectName)===k?R.groupHeight:null)??C,bt=_e(k)?0:Ya;return Math.max(0,Le+bt)}function pt(k,C){const R=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(R){ee.set(k,R);return}ee.delete(k)}function Pe(k,C){const R=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(R){ye.set(k,R);return}ye.delete(k)}function Me(k){const C=a.value;if(!C)return!1;const R=ee.get(C);if(!R)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(R))return!0;const Le=k.target;return Le instanceof Node?R.contains(Le):!1}function pn(k){const C=l.value;if(!C)return!1;const R=ye.get(C);if(!R)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(R))return!0;const Le=k.target;return Le instanceof Node?R.contains(Le):!1}function Ut(k){if(Ue.value){const C=Fe.value,R=typeof k.composedPath=="function"?k.composedPath():[];!!C&&(R.includes(C)||k.target instanceof Node&&C.contains(k.target))||(Ue.value=!1)}a.value&&(Me(k)||Je(),l.value&&(pn(k)||Z()))}function yr(k){a.value&&!Me(k)&&Je(),l.value&&!pn(k)&&Z()}function Qn(){Ue.value&&(Ue.value=!1),a.value&&Je(),l.value&&Z()}function wr(){window.addEventListener("pointerdown",Ut,{capture:!0}),window.addEventListener("focusin",yr,{capture:!0}),window.addEventListener("blur",Qn)}function Xn(){window.removeEventListener("pointerdown",Ut,{capture:!0}),window.removeEventListener("focusin",yr,{capture:!0}),window.removeEventListener("blur",Qn)}function Zn(k,C){const R=C.getBoundingClientRect().height;if(!Number.isFinite(R)||R<=0)return;const q=ke.value[k];q!==void 0&&Math.abs(q-R)<.5||(ke.value={...ke.value,[k]:R})}function Hr(k,C){const R=oe.get(k);R&&R!==C&&Ie&&Ie.unobserve(R);const q=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(q){oe.set(k,q),ne.set(q,k),Zn(k,q),Ie==null||Ie.observe(q);return}R&&(Ie==null||Ie.unobserve(R)),oe.delete(k)}function br(k,C){if(k.button!==0||U.value||D.value)return;const R=n.groups.findIndex(Wt=>Wt.projectName===C),q=oe.get(C);if(R<0||!q)return;const Le=q.getBoundingClientRect(),bt=_e(C)?0:Ya;U.value={projectName:C,fromIndex:R,startClientX:k.clientX,startClientY:k.clientY,pointerOffsetY:k.clientY-Le.top,groupLeft:Le.left,groupWidth:Le.width,groupHeight:Le.height,groupOuterHeight:Le.height+bt},k.preventDefault(),Ur()}function Ur(){window.addEventListener("mousemove",Vt),window.addEventListener("mouseup",mn),window.addEventListener("keydown",er)}function _r(){window.removeEventListener("mousemove",Vt),window.removeEventListener("mouseup",mn),window.removeEventListener("keydown",er)}function Vt(k){ae={clientX:k.clientX,clientY:k.clientY},Vr()}function mn(k){kr({clientX:k.clientX,clientY:k.clientY});const C=D.value;if(C&&Q.value!==null){const R=n.groups.findIndex(q=>q.projectName===C.projectName);if(R>=0){const q=Q.value;q!==R&&r("reorder-project",{projectName:C.projectName,toIndex:q})}}jn()}function er(k){k.key==="Escape"&&(!U.value&&!D.value||(k.preventDefault(),jn()))}function jn(){ue!==null&&(window.cancelAnimationFrame(ue),ue=null),ae=null,U.value=null,D.value=null,fe.value="",_r()}function Vr(){ue===null&&(ue=window.requestAnimationFrame(()=>{if(ue=null,!ae)return;const k=ae;ae=null,kr(k)}))}function kr(k){const C=U.value;if(!D.value&&C){const R=k.clientX-C.startClientX,q=k.clientY-C.startClientY;if(Math.hypot(R,q)<Lm)return;Je(),fe.value=C.projectName,D.value={projectName:C.projectName,fromIndex:C.fromIndex,pointerOffsetY:C.pointerOffsetY,groupLeft:C.groupLeft,groupWidth:C.groupWidth,groupHeight:C.groupHeight,groupOuterHeight:C.groupOuterHeight,ghostTop:k.clientY-C.pointerOffsetY,dropTargetIndexFull:null}}D.value&&Wr(k)}function Wr(k){const C=D.value;if(!C)return;if(C.ghostTop=k.clientY-C.pointerOffsetY,!Dn(k)){C.dropTargetIndexFull=null;return}const R=k.clientY,q=O.value;if(!q){C.dropTargetIndexFull=null;return}const Le=q.getBoundingClientRect(),bt=new Map(n.groups.map((Yt,Bn)=>[Yt.projectName,Bn])),Wt=n.groups.map(Yt=>Yt.projectName).filter(Yt=>Yt!==C.projectName);let xr=0,yn=n.groups.length;for(const Yt of Wt){const Bn=bt.get(Yt);if(Bn===void 0)continue;const nr=ft(Yt),Gr=Le.top+xr+nr/2;if(R<Gr){yn=Bn;break}xr+=nr}C.dropTargetIndexFull=yn}function Dn(k){const C=O.value;if(!C)return!1;const R=C.getBoundingClientRect(),q=k.clientX>=R.left&&k.clientX<=R.right,Le=k.clientY>=R.top-32&&k.clientY<=R.bottom+32;return q&&Le}function tr(k){var C;return((C=D.value)==null?void 0:C.projectName)===k}function qr(k){const C=D.value,R=me.value[k]??0,q=a.value===k;return!C||C.projectName!==k?{position:"absolute",top:"0",left:"0",right:"0",zIndex:q?"40":"1",transform:`translate3d(0, ${R}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${C.groupLeft}px`,width:`${C.groupWidth}px`,height:`${C.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${C.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function gn(k){return k.threads.filter(C=>!y(C.id))}function Tr(k){if(Ze.value)return gn(k);if(_e(k.projectName))return[];const C=gn(k);return xe(k.projectName)?C:C.slice(0,10)}function vn(k){return Ze.value?!1:!_e(k.projectName)&&gn(k).length>10}function Kr(k){return gn(k).length>0}function Ln(k){return k.inProgress?"working":k.unread?"unread":"idle"}ct(()=>n.groups.map(k=>k.projectName),k=>{var Le,bt;const C=((Le=D.value)==null?void 0:Le.projectName)??((bt=U.value)==null?void 0:bt.projectName)??"";C&&!n.groups.some(Wt=>Wt.projectName===C)&&jn();const R=new Set(k),q=Object.fromEntries(Object.entries(ke.value).filter(([Wt])=>R.has(Wt)));Object.keys(q).length!==Object.keys(ke.value).length&&(ke.value=q)});const Sr=ce(()=>Ue.value||a.value!=="");return ct(Sr,k=>{if(k){wr();return}Xn()}),Nn(()=>{for(const k of oe.values())Ie==null||Ie.unobserve(k);oe.clear(),ee.clear(),Xn(),jn()}),(k,C)=>(w(),S("section",Mp,[I.value.length>0?(w(),S("section",Pp,[p("ul",Op,[(w(!0),S(He,null,wt(I.value,R=>(w(),S("li",{key:R.id,class:"thread-row-item"},[Ce(ur,{class:"thread-row","data-active":R.id===e.selectedThreadId,"data-pinned":y(R.id),onMouseleave:q=>X(R.id)},{left:lt(()=>[p("span",Np,[R.inProgress||R.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":Ln(R)},null,8,jp)):le("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>x(R.id)},[Ce(Ao,{class:"thread-icon"})],8,Dp)])]),right:lt(()=>[p("span",Hp,de(g(R.createdAtIso||R.updatedAtIso)),1)]),"right-hover":lt(()=>[p("div",{ref_for:!0,ref:q=>Pe(R.id,q),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Ye(q=>W(R.id),["stop"])},[Ce(Xr,{class:"thread-icon"})],8,Up),re(R.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[0]||(C[0]=Ye(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:q=>he(R.id,R.title)}," Rename thread ",8,Vp),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>Se(R.id,R.title)}," Delete thread ",8,Wp)])):le("",!0)],512)]),default:lt(()=>[p("button",{class:"thread-main-button",type:"button",onClick:q=>L(R.id)},[p("span",Bp,[p("span",Fp,de(R.title),1),R.hasWorktree?(w(),ht(js,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,Lp)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):le("",!0),Ce(ur,{as:"header",class:"thread-tree-header-row"},{right:lt(()=>[p("div",{ref_key:"organizeMenuWrapRef",ref:Fe,class:"organize-menu-wrap"},[p("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Ue.value,"aria-label":"Organize threads",title:"Organize threads",onClick:B},[Ce(Xr,{class:"thread-icon"})],8,qp),Ue.value?(w(),S("div",{key:0,class:"organize-menu-panel",onClick:C[3]||(C[3]=Ye(()=>{},["stop"]))},[C[11]||(C[11]=p("p",{class:"organize-menu-title"},"Organize",-1)),p("button",{class:"organize-menu-item","data-active":Ke.value==="project",type:"button",onClick:C[1]||(C[1]=R=>V("project"))},[C[9]||(C[9]=p("span",null,"By project",-1)),Ke.value==="project"?(w(),S("span",Gp,"✓")):le("",!0)],8,Kp),p("button",{class:"organize-menu-item","data-active":Ke.value==="chronological",type:"button",onClick:C[2]||(C[2]=R=>V("chronological"))},[C[10]||(C[10]=p("span",null,"Chronological list",-1)),Ke.value==="chronological"?(w(),S("span",Yp,"✓")):le("",!0)],8,zp)])):le("",!0)],512)]),default:lt(()=>[C[12]||(C[12]=p("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Ze.value&&ze.value.length===0?(w(),S("p",Jp,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),S("p",Qp,"Loading threads...")):pe.value?(w(),S("ul",Xp,[(w(!0),S(He,null,wt(Ee.value,R=>(w(),S("li",{key:R.id,class:"thread-row-item"},[Ce(ur,{class:"thread-row","data-active":R.id===e.selectedThreadId,"data-pinned":y(R.id),onMouseleave:q=>X(R.id)},{left:lt(()=>[p("span",Zp,[R.inProgress||R.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":Ln(R)},null,8,em)):le("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>x(R.id)},[Ce(Ao,{class:"thread-icon"})],8,tm)])]),right:lt(()=>[p("span",om,de(g(R.createdAtIso||R.updatedAtIso)),1)]),"right-hover":lt(()=>[p("div",{ref_for:!0,ref:q=>Pe(R.id,q),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Ye(q=>W(R.id),["stop"])},[Ce(Xr,{class:"thread-icon"})],8,im),re(R.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[4]||(C[4]=Ye(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:q=>he(R.id,R.title)}," Rename thread ",8,am),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>Se(R.id,R.title)}," Delete thread ",8,lm)])):le("",!0)],512)]),default:lt(()=>[p("button",{class:"thread-main-button",type:"button",onClick:q=>L(R.id)},[p("span",rm,[p("span",sm,de(R.title),1),R.hasWorktree?(w(),ht(js,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,nm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),S("div",{key:4,ref_key:"groupsContainerRef",ref:O,class:"thread-tree-groups",style:vr(De.value)},[(w(!0),S(He,null,wt(ze.value,R=>(w(),S("article",{key:R.projectName,ref_for:!0,ref:q=>Hr(R.projectName,q),class:"project-group","data-project-name":R.projectName,"data-expanded":!_e(R.projectName),"data-dragging":tr(R.projectName),style:vr(qr(R.projectName))},[Ce(ur,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:q=>Qe(R.projectName),onKeydown:[q=>se(q,R.projectName),Ht(Ye(q=>Qe(R.projectName),["prevent"]),["enter"]),Ht(Ye(q=>Qe(R.projectName),["prevent"]),["space"])]},{left:lt(()=>[p("span",um,[p("span",dm,[_e(R.projectName)?(w(),ht(Kc,{key:0,class:"thread-icon"})):(w(),ht(wp,{key:1,class:"thread-icon"}))]),p("span",fm,[_e(R.projectName)?(w(),ht(qc,{key:0,class:"thread-icon"})):(w(),ht(lo,{key:1,class:"thread-icon"}))])])]),right:lt(()=>[p("div",mm,[p("div",{ref_for:!0,ref:q=>pt(R.projectName,q),class:"project-menu-wrap"},[p("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:Ye(q=>J(R.projectName),["stop"])},[Ce(Xr,{class:"thread-icon"})],8,gm),at(R.projectName)?(w(),S("div",{key:0,class:"project-menu-panel",onClick:C[6]||(C[6]=Ye(()=>{},["stop"]))},[d.value==="actions"?(w(),S(He,{key:0},[p("button",{class:"project-menu-item",type:"button",onClick:q=>M(R.projectName)}," Browse files ",8,vm),p("button",{class:"project-menu-item",type:"button",onClick:q=>Ge(R.projectName)}," Edit name ",8,ym),p("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:q=>A(R.projectName)}," Remove ",8,wm)],64)):(w(),S(He,{key:1},[C[13]||(C[13]=p("label",{class:"project-menu-label"},"Project name",-1)),$n(p("input",{"onUpdate:modelValue":C[5]||(C[5]=q=>u.value=q),class:"project-menu-input",type:"text",onInput:q=>b(R.projectName)},null,40,bm),[[Mn,u.value]])],64))])):le("",!0)],512),p("button",{class:"thread-start-button",type:"button","aria-label":F(R.projectName),title:F(R.projectName),onClick:Ye(q=>j(R.projectName),["stop"])},[Ce(qs,{class:"thread-icon"})],8,_m)])]),default:lt(()=>[p("span",{class:"project-main-button","data-dragging-handle":tr(R.projectName),onMousedown:Ye(q=>br(q,R.projectName),["left"])},[p("span",pm,de(Ae(R.projectName)),1)],40,hm)]),_:2},1032,["onClick","onKeydown"]),Kr(R)?(w(),S("ul",km,[(w(!0),S(He,null,wt(Tr(R),q=>(w(),S("li",{key:q.id,class:"thread-row-item"},[Ce(ur,{class:"thread-row","data-active":q.id===e.selectedThreadId,"data-pinned":y(q.id),onMouseleave:Le=>X(q.id)},{left:lt(()=>[p("span",Tm,[q.inProgress||q.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":Ln(q)},null,8,Sm)):le("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Le=>x(q.id)},[Ce(Ao,{class:"thread-icon"})],8,xm)])]),right:lt(()=>[p("span",Im,de(g(q.createdAtIso||q.updatedAtIso)),1)]),"right-hover":lt(()=>[p("div",{ref_for:!0,ref:Le=>Pe(q.id,Le),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Ye(Le=>W(q.id),["stop"])},[Ce(Xr,{class:"thread-icon"})],8,Rm),re(q.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[7]||(C[7]=Ye(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:Le=>he(q.id,q.title)}," Rename thread ",8,$m),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Le=>Se(q.id,q.title)}," Delete thread ",8,Mm)])):le("",!0)],512)]),default:lt(()=>[p("button",{class:"thread-main-button",type:"button",onClick:Le=>L(q.id)},[p("span",Em,[p("span",Am,de(q.title),1),q.hasWorktree?(w(),ht(js,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,Cm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),ht(ur,{key:1,as:"p",class:"project-empty-row"},{left:lt(()=>[...C[14]||(C[14]=[p("span",{class:"project-empty-spacer"},null,-1)])]),default:lt(()=>[C[15]||(C[15]=p("span",{class:"project-empty"},"No threads",-1))]),_:1})),vn(R)?(w(),ht(ur,{key:2,class:"thread-show-more-row"},{left:lt(()=>[...C[16]||(C[16]=[p("span",{class:"thread-show-more-spacer"},null,-1)])]),default:lt(()=>[p("button",{class:"thread-show-more-button",type:"button",onClick:q=>nt(R.projectName)},de(xe(R.projectName)?"Show less":"Show more"),9,Pm)]),_:2},1024)):le("",!0)],12,cm))),128))],4)),(w(),ht(Fs,{to:"body"},[f.value?(w(),S("div",{key:0,class:"rename-thread-overlay",onClick:Ye(ie,["self"])},[p("div",Om,[C[17]||(C[17]=p("h3",{class:"rename-thread-title"},"Rename thread",-1)),C[18]||(C[18]=p("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),$n(p("input",{ref_key:"renameThreadInputRef",ref:N,"onUpdate:modelValue":C[8]||(C[8]=R=>_.value=R),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Ht(Ye(ge,["prevent"]),["enter"]),Ht(Ye(ie,["prevent"]),["esc"])]},null,40,Nm),[[Mn,_.value]]),p("div",{class:"rename-thread-actions"},[p("button",{class:"rename-thread-button",type:"button",onClick:ie},"Cancel"),p("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:ge},"Save")])])])):le("",!0)])),(w(),ht(Fs,{to:"body"},[E.value?(w(),S("div",{key:0,class:"rename-thread-overlay",onClick:Ye(Ne,["self"])},[p("div",jm,[C[19]||(C[19]=p("h3",{class:"rename-thread-title"},"Delete thread?",-1)),p("p",Dm,' This will archive the thread "'+de(Y.value)+'". You can find it later in archived threads. ',1),p("div",{class:"rename-thread-actions"},[p("button",{class:"rename-thread-button",type:"button",onClick:Ne},"Cancel"),p("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:We},"Delete")])])])):le("",!0)]))]))}}),Fm=Xe(Bm,[["__scopeId","data-v-7c022821"]]),Hm={class:"content-header"},Um={class:"content-leading"},Vm={class:"content-title"},Wm={class:"content-actions"},qm=At({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),S("header",Hm,[p("div",Um,[fn(t.$slots,"leading",{},void 0)]),p("h1",Vm,de(e.title),1),p("div",Wm,[fn(t.$slots,"actions",{},void 0)])]))}}),Km=Xe(qm,[["__scopeId","data-v-66ee223c"]]),Gm={},zm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ym(e,t){return w(),S("svg",zm,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Ri=Xe(Gm,[["render",Ym]]),Jm={},Qm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Xm(e,t){return w(),S("svg",Qm,[...t[0]||(t[0]=[p("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 Zm=Xe(Jm,[["render",Xm]]),eg={class:"conversation-root"},tg={key:0,class:"conversation-loading"},ng={key:1,class:"conversation-empty"},rg={class:"message-row"},sg={class:"message-stack"},og={class:"request-card"},ig={class:"request-title"},ag={class:"request-meta"},lg={key:0,class:"request-reason"},cg={key:1,class:"request-actions"},ug=["onClick"],dg=["onClick"],fg=["onClick"],hg=["onClick"],pg={key:2,class:"request-actions"},mg=["onClick"],gg=["onClick"],vg=["onClick"],yg=["onClick"],wg={key:3,class:"request-user-input"},bg={class:"request-question-title"},_g={key:0,class:"request-question-text"},kg=["value","onChange"],Tg=["value"],Sg=["value","onInput"],xg=["onClick"],Cg={key:4,class:"request-actions"},Eg=["onClick"],Ag=["onClick"],Ig={key:5,class:"request-actions"},Rg=["onClick"],$g=["onClick"],Mg=["data-role","data-message-type"],Pg={key:0,class:"message-row","data-role":"system"},Og={class:"message-stack","data-role":"system"},Ng=["onClick"],jg={class:"cmd-label"},Dg={class:"cmd-status"},Lg={class:"cmd-output-inner"},Bg={class:"cmd-output"},Fg=["data-role","data-message-type"],Hg=["data-role"],Ug=["data-role"],Vg=["data-role"],Wg=["onClick"],qg=["src"],Kg={key:1,class:"message-file-attachments"},Gg=["href","title"],zg=["data-role"],Yg={key:0,class:"worked-separator-wrap","aria-live":"polite"},Jg=["onClick"],Qg={class:"worked-separator-text"},Xg={key:0,class:"worked-details"},Zg=["onClick"],ev={class:"cmd-label"},tv={class:"cmd-status"},nv={class:"cmd-output-inner"},rv={class:"cmd-output"},sv={key:1,class:"message-text-flow"},ov={key:0,class:"message-text"},iv={key:0},av=["href","title"],lv={key:2,class:"message-inline-code"},cv={key:1,class:"message-text"},uv=["onClick"],dv=["src","alt","onError"],fv=["onClick"],hv={key:0,class:"conversation-item conversation-item-overlay"},pv={class:"message-row"},mv={class:"message-stack"},gv={class:"live-overlay-inline","aria-live":"polite"},vv={class:"live-overlay-label"},yv={key:1,class:"live-overlay-error"},wv=["src"],bv=16,_v=At({__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=P(new Set),r=P(new Set),s=P(new Set),o=P({});function i(b){return b.messageType==="commandExecution"&&!!b.commandExecution}function a(b){var A;return((A=b.commandExecution)==null?void 0:A.status)==="inProgress"||r.value.has(b.id)?!0:n.value.has(b.id)}function l(b){return r.value.has(b.id)}function d(b){var M;if(((M=b.commandExecution)==null?void 0:M.status)==="inProgress")return;const A=new Set(n.value);A.has(b.id)?A.delete(b.id):A.add(b.id),n.value=A}function u(b){const A=new Set(s.value);A.has(b.id)?A.delete(b.id):A.add(b.id),s.value=A}function f(b){return s.value.has(b.id)}function m(b){const A=b.commandExecution;if(!A)return"";switch(A.status){case"inProgress":return"⟳ Running";case"completed":return A.exitCode===0?"✓ Completed":`✗ Exit ${A.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function _(b){var M,se;const A=(M=b.commandExecution)==null?void 0:M.status;return A==="inProgress"?"cmd-status-running":A==="completed"&&((se=b.commandExecution)==null?void 0:se.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function N(b){const A=new Set(r.value);A.add(b),r.value=A,setTimeout(()=>{const M=new Set(r.value);M.delete(b),r.value=M},1e3)}function E(b,A){const M=[];for(let se=A-1;se>=0;se--){const xe=b[se];if(xe.messageType==="commandExecution")M.unshift(xe);else if(xe.role==="user"||xe.messageType==="worked")break}return M}const H=e,Y=t,O=P(null),U=P(null),D=P(null),ae=P(""),ue=P({}),fe=P({});let ke=0,oe=0,ee=0;const ye=new WeakSet,ne=P(new Set);function Fe(b){if(!b||/\s/u.test(b)||b.endsWith("/")||b.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(b))return!1;const A=b.startsWith("/"),M=/^[A-Za-z]:[\\/]/u.test(b),se=b.startsWith("./")||b.startsWith("../")||b.startsWith("~/"),xe=b.includes("/")||b.includes("\\");return A||M||se||xe}function Ue(b){return b.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||b}function Ke(b){if(!b)return null;let A=b,M=null;const se=A.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(se)A=se[1],M=Number(se[2]);else{const xe=A.match(/^(.*):(\d+)(?::\d+)?$/u);xe&&(A=xe[1],M=Number(xe[2]))}return Fe(A)?{path:A,line:M}:null}function Ie(b){if(!b.includes("`"))return[{kind:"text",value:b}];const A=[];let M=0,se=0;for(;M<b.length;){if(b[M]!=="`"){M+=1;continue}let xe=1;for(;M+xe<b.length&&b[M+xe]==="`";)xe+=1;const _e="`".repeat(xe);let nt=M+xe,Qe=-1;for(;nt<b.length;){const pt=b.indexOf(_e,nt);if(pt<0)break;const Pe=pt>0&&b[pt-1]==="`",Me=pt+xe<b.length&&b[pt+xe]==="`",pn=b.slice(M+xe,pt).includes(`
26
- `);if(!Pe&&!Me&&!pn){Qe=pt;break}nt=pt+1}if(Qe<0){M+=xe;continue}M>se&&A.push({kind:"text",value:b.slice(se,M)});const ft=b.slice(M+xe,Qe);if(ft.length>0){const pt=Ke(ft);if(pt){const Pe=pt.line?`${pt.path}:${String(pt.line)}`:pt.path;A.push({kind:"file",value:ft,path:pt.path,displayPath:Pe,downloadName:Ue(pt.path)})}else A.push({kind:"code",value:ft})}else A.push({kind:"text",value:`${_e}${_e}`});M=Qe+xe,se=M}return se<b.length&&A.push({kind:"text",value:b.slice(se)}),A}function be(b){const A=b.trim();if(!A)return"";if(A.startsWith("data:")||A.startsWith("blob:")||A.startsWith("http://")||A.startsWith("https://")||A.startsWith("/codex-local-image?"))return A;if(A.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(A)}`;const M=A.startsWith("/"),se=/^[A-Za-z]:[\\/]/u.test(A);return M||se?`/codex-local-image?path=${encodeURIComponent(A)}`:A}function Oe(b){const A=b.trim();if(!A)return"#";const M=xe=>xe.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(xe),se=Ke(A);return se!=null&&se.path&&M(se.path)?`/codex-local-browse${encodeURI(se.path)}`:M(A)?`/codex-local-browse${encodeURI(A)}`:"#"}function vt(b){if(!b.includes("![")||!b.includes("]("))return[{kind:"text",value:b}];const A=[],M=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let se=0;for(const xe of b.matchAll(M)){const[_e,nt,Qe]=xe;if(typeof xe.index!="number")continue;const ft=xe.index,pt=ft+_e.length,Pe=be(Qe.trim());Pe&&(ft>se&&A.push({kind:"text",value:b.slice(se,ft)}),A.push({kind:"image",url:Pe,alt:nt.trim(),markdown:_e}),se=pt)}return se<b.length&&A.push({kind:"text",value:b.slice(se)}),A.length>0?A:[{kind:"text",value:b}]}function Ze(b){return b!==null&&typeof b=="object"&&!Array.isArray(b)?b:null}function dt(b){const A=new Date(b);return Number.isNaN(A.getTime())?b:A.toLocaleTimeString()}function tt(b){const A=Ze(b.params),M=A==null?void 0:A.reason;return typeof M=="string"?M.trim():""}function ze(b,A){return`${String(b)}:${A}`}function pe(b){const A=Ze(b.params),M=Array.isArray(A==null?void 0:A.questions)?A.questions:[],se=[];for(const xe of M){const _e=Ze(xe);if(!_e)continue;const nt=typeof _e.id=="string"?_e.id:"";if(!nt)continue;const Qe=Array.isArray(_e.options)?_e.options.map(ft=>Ze(ft)).map(ft=>ft==null?void 0:ft.label).filter(ft=>typeof ft=="string"&&ft.length>0):[];se.push({id:nt,header:typeof _e.header=="string"?_e.header:"",question:typeof _e.question=="string"?_e.question:"",isOther:_e.isOther===!0,options:Qe})}return se}function Ee(b,A,M){const se=ze(b,A),xe=ue.value[se];return typeof xe=="string"&&xe.length>0?xe:M}function Te(b,A){const M=ze(b,A);return fe.value[M]??""}function I(b,A,M){const se=M.target;if(!(se instanceof HTMLSelectElement))return;const xe=ze(b,A);ue.value={...ue.value,[xe]:se.value}}function Q(b,A,M){const se=M.target;if(!(se instanceof HTMLInputElement))return;const xe=ze(b,A);fe.value={...fe.value,[xe]:se.value}}function z(b,A){Y("respondServerRequest",{id:b,result:{decision:A}})}function me(b){const A=pe(b),M={};for(const se of A){const xe=Ee(b.id,se.id,se.options[0]||""),_e=Te(b.id,se.id).trim(),nt=[xe,_e].map(Qe=>Qe.trim()).filter(Qe=>Qe.length>0);M[se.id]={answers:nt}}Y("respondServerRequest",{id:b.id,result:{answers:M}})}function De(b){Y("respondServerRequest",{id:b,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function g(b){Y("respondServerRequest",{id:b,result:{success:!0,contentItems:[]}})}function y(b){Y("respondServerRequest",{id:b,result:{}})}function x(b){Y("respondServerRequest",{id:b,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function L(b){return!(b.role!=="user"&&b.role!=="assistant"||typeof b.turnIndex!="number"||H.isTurnInProgress||H.isRollingBack)}function F(b){L(b)&&Y("rollback",{turnIndex:b.turnIndex})}function j(){const b=O.value,A=U.value;!b||!A||(b.scrollTop=b.scrollHeight,A.scrollIntoView({block:"end"}))}function X(b){return b.scrollHeight-(b.scrollTop+b.clientHeight)<=bv}function re(b){if(!H.activeThreadId)return;const A=Math.max(b.scrollHeight-b.clientHeight,0),M=A>0?Math.min(Math.max(b.scrollTop/A,0),1):1;Y("updateScrollState",{threadId:H.activeThreadId,state:{scrollTop:b.scrollTop,isAtBottom:X(b),scrollRatio:M}})}function Z(){const b=O.value;if(!b)return;const A=H.scrollState;if(!A||A.isAtBottom){W();return}const M=Math.max(b.scrollHeight-b.clientHeight,0),se=typeof A.scrollRatio=="number"?A.scrollRatio*M:A.scrollTop;b.scrollTop=Math.min(Math.max(se,0),M),re(b)}function W(){const b=O.value;b&&(j(),re(b))}function he(){const b=H.scrollState;return!b||b.isAtBottom===!0}function ie(){if(!he()){ee=0,oe=0;return}if(W(),ee-=1,ee<=0){oe=0;return}oe=requestAnimationFrame(ie)}function ge(b=6){he()&&(oe&&(cancelAnimationFrame(oe),oe=0),ee=Math.max(b,1),oe=requestAnimationFrame(ie))}function Se(){ge(3)}function Ne(){if(!he())return;const b=O.value;if(!b)return;const A=b.querySelectorAll("img.message-image-preview");for(const M of A)M.complete||ye.has(M)||(ye.add(M),M.addEventListener("load",Se,{once:!0}),M.addEventListener("error",Se,{once:!0}))}async function We(){await zt(),ke&&cancelAnimationFrame(ke),ke=requestAnimationFrame(()=>{ke=0,Z(),Ne(),ge()})}ct(()=>H.messages,async b=>{if(!H.isLoading){for(const A of b){if(A.messageType!=="commandExecution"||!A.commandExecution)continue;const M=o.value[A.id],se=A.commandExecution.status;M==="inProgress"&&se!=="inProgress"&&N(A.id),o.value[A.id]=se}await We()}}),ct(()=>H.liveOverlay,async b=>{b&&(await zt(),W(),ge(8))},{deep:!0}),ct(()=>H.isLoading,async b=>{b||await We()}),ct(()=>H.activeThreadId,()=>{ae.value="",ne.value=new Set},{flush:"post"});function Ae(){const b=O.value;!b||H.isLoading||re(b)}function at(b){ae.value=be(b)}function Je(b,A){return`${b}:${String(A)}`}function B(b,A){const M=new Set(ne.value);M.add(Je(b,A)),ne.value=M}function V(b,A){return ne.value.has(Je(b,A))}function J(){ae.value=""}function Ge(){const b=D.value;b&&(b.scrollTop=b.scrollHeight)}return ct(()=>{var b;return(b=H.liveOverlay)==null?void 0:b.reasoningText},async b=>{b&&(await zt(),Ge())}),Nn(()=>{ke&&cancelAnimationFrame(ke),oe&&cancelAnimationFrame(oe)}),(b,A)=>(w(),S("section",eg,[e.isLoading?(w(),S("p",tg,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),S("p",ng," No messages in this thread yet. ")):(w(),S("ul",{key:2,ref_key:"conversationListRef",ref:O,class:"conversation-list",onScroll:Ae},[(w(!0),S(He,null,wt(e.pendingRequests,M=>(w(),S("li",{key:`server-request:${M.id}`,class:"conversation-item conversation-item-request"},[p("div",rg,[p("div",sg,[p("article",og,[p("p",ig,de(M.method),1),p("p",ag,"Request #"+de(M.id)+" · "+de(dt(M.receivedAtIso)),1),tt(M)?(w(),S("p",lg,de(tt(M)),1)):le("",!0),M.method==="item/commandExecution/requestApproval"?(w(),S("section",cg,[p("button",{type:"button",class:"request-button request-button-primary",onClick:se=>z(M.id,"accept")},"Accept",8,ug),p("button",{type:"button",class:"request-button",onClick:se=>z(M.id,"acceptForSession")},"Accept for Session",8,dg),p("button",{type:"button",class:"request-button",onClick:se=>z(M.id,"decline")},"Decline",8,fg),p("button",{type:"button",class:"request-button",onClick:se=>z(M.id,"cancel")},"Cancel",8,hg)])):M.method==="item/fileChange/requestApproval"?(w(),S("section",pg,[p("button",{type:"button",class:"request-button request-button-primary",onClick:se=>z(M.id,"accept")},"Accept",8,mg),p("button",{type:"button",class:"request-button",onClick:se=>z(M.id,"acceptForSession")},"Accept for Session",8,gg),p("button",{type:"button",class:"request-button",onClick:se=>z(M.id,"decline")},"Decline",8,vg),p("button",{type:"button",class:"request-button",onClick:se=>z(M.id,"cancel")},"Cancel",8,yg)])):M.method==="item/tool/requestUserInput"?(w(),S("section",wg,[(w(!0),S(He,null,wt(pe(M),se=>(w(),S("div",{key:`${M.id}:${se.id}`,class:"request-question"},[p("p",bg,de(se.header||se.question),1),se.header&&se.question?(w(),S("p",_g,de(se.question),1)):le("",!0),p("select",{class:"request-select",value:Ee(M.id,se.id,se.options[0]||""),onChange:xe=>I(M.id,se.id,xe)},[(w(!0),S(He,null,wt(se.options,xe=>(w(),S("option",{key:`${M.id}:${se.id}:${xe}`,value:xe},de(xe),9,Tg))),128))],40,kg),se.isOther?(w(),S("input",{key:1,class:"request-input",type:"text",value:Te(M.id,se.id),placeholder:"Other answer",onInput:xe=>Q(M.id,se.id,xe)},null,40,Sg)):le("",!0)]))),128)),p("button",{type:"button",class:"request-button request-button-primary",onClick:se=>me(M)}," Submit Answers ",8,xg)])):M.method==="item/tool/call"?(w(),S("section",Cg,[p("button",{type:"button",class:"request-button request-button-primary",onClick:se=>De(M.id)},"Fail Tool Call",8,Eg),p("button",{type:"button",class:"request-button",onClick:se=>g(M.id)},"Success (Empty)",8,Ag)])):(w(),S("section",Ig,[p("button",{type:"button",class:"request-button request-button-primary",onClick:se=>y(M.id)},"Return Empty Result",8,Rg),p("button",{type:"button",class:"request-button",onClick:se=>x(M.id)},"Reject Request",8,$g)]))])])])]))),128)),(w(!0),S(He,null,wt(e.messages,M=>{var se,xe;return w(),S("li",{key:M.id,class:ut(["conversation-item",{"conversation-item-rollbackable":L(M)}]),"data-role":M.role,"data-message-type":M.messageType||""},[i(M)?(w(),S("div",Pg,[p("div",Og,[p("button",{type:"button",class:ut(["cmd-row",[_(M),{"cmd-expanded":a(M)}]]),onClick:_e=>d(M)},[p("span",{class:ut(["cmd-chevron",{"cmd-chevron-open":a(M)}])},"▶",2),p("code",jg,de(((se=M.commandExecution)==null?void 0:se.command)||"(command)"),1),p("span",Dg,de(m(M)),1)],10,Ng),p("div",{class:ut(["cmd-output-wrap",{"cmd-output-visible":a(M),"cmd-output-collapsing":l(M)}])},[p("div",Lg,[p("pre",Bg,de(((xe=M.commandExecution)==null?void 0:xe.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),S("div",{key:1,class:"message-row","data-role":M.role,"data-message-type":M.messageType||""},[p("div",{class:"message-stack","data-role":M.role},[p("article",{class:"message-body","data-role":M.role},[M.images&&M.images.length>0?(w(),S("ul",{key:0,class:"message-image-list","data-role":M.role},[(w(!0),S(He,null,wt(M.images,_e=>(w(),S("li",{key:_e,class:"message-image-item"},[p("button",{class:"message-image-button",type:"button",onClick:nt=>at(_e)},[p("img",{class:"message-image-preview",src:be(_e),alt:"Message image preview",loading:"lazy"},null,8,qg)],8,Wg)]))),128))],8,Vg)):le("",!0),M.fileAttachments&&M.fileAttachments.length>0?(w(),S("div",Kg,[(w(!0),S(He,null,wt(M.fileAttachments,_e=>(w(),S("span",{key:_e.path,class:"message-file-chip"},[A[1]||(A[1]=p("span",{class:"message-file-chip-icon"},"📄",-1)),p("a",{class:"message-file-link message-file-chip-name",href:Oe(_e.path),target:"_blank",rel:"noopener noreferrer",title:_e.path},de(_e.path),9,Gg)]))),128))])):le("",!0),M.text.length>0?(w(),S("article",{key:2,class:"message-card","data-role":M.role},[M.messageType==="worked"?(w(),S("div",Yg,[p("button",{type:"button",class:"worked-separator",onClick:_e=>u(M)},[A[2]||(A[2]=p("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),p("span",{class:ut(["worked-chevron",{"worked-chevron-open":f(M)}])},"▶",2),p("p",Qg,de(M.text),1),A[3]||(A[3]=p("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Jg),f(M)?(w(),S("div",Xg,[(w(!0),S(He,null,wt(E(e.messages,e.messages.indexOf(M)),_e=>{var nt,Qe;return w(),S("div",{key:`worked-cmd-${_e.id}`,class:"worked-cmd-item"},[p("button",{type:"button",class:ut(["cmd-row",[_(_e),{"cmd-expanded":a(_e)}]]),onClick:ft=>d(_e)},[p("span",{class:ut(["cmd-chevron",{"cmd-chevron-open":a(_e)}])},"▶",2),p("code",ev,de(((nt=_e.commandExecution)==null?void 0:nt.command)||"(command)"),1),p("span",tv,de(m(_e)),1)],10,Zg),p("div",{class:ut(["cmd-output-wrap",{"cmd-output-visible":a(_e),"cmd-output-collapsing":l(_e)}])},[p("div",nv,[p("pre",rv,de(((Qe=_e.commandExecution)==null?void 0:Qe.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):le("",!0)])):(w(),S("div",sv,[(w(!0),S(He,null,wt(vt(M.text),(_e,nt)=>(w(),S(He,{key:`block-${nt}`},[_e.kind==="text"?(w(),S("p",ov,[(w(!0),S(He,null,wt(Ie(_e.value),(Qe,ft)=>(w(),S(He,{key:`seg-${nt}-${ft}`},[Qe.kind==="text"?(w(),S("span",iv,de(Qe.value),1)):Qe.kind==="file"?(w(),S("a",{key:1,class:"message-file-link",href:Oe(Qe.path),target:"_blank",rel:"noopener noreferrer",title:Qe.path},de(Qe.displayPath),9,av)):(w(),S("code",lv,de(Qe.value),1))],64))),128))])):V(M.id,nt)?(w(),S("p",cv,de(_e.markdown),1)):(w(),S("button",{key:2,class:"message-image-button",type:"button",onClick:Qe=>at(_e.url)},[p("img",{class:"message-image-preview message-markdown-image",src:_e.url,alt:_e.alt||"Embedded message image",loading:"lazy",onError:Qe=>B(M.id,nt)},null,40,dv)],8,uv))],64))),128))]))],8,zg)):le("",!0)],8,Ug),L(M)?(w(),S("button",{key:0,class:"rollback-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:_e=>F(M)},[Ce(Zm,{class:"rollback-icon"}),A[4]||(A[4]=p("span",{class:"rollback-label"},"Rollback",-1))],8,fv)):le("",!0)],8,Hg)],8,Fg))],10,Mg)}),128)),e.liveOverlay?(w(),S("li",hv,[p("div",pv,[p("div",mv,[p("article",gv,[p("p",vv,de(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),S("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:D},de(e.liveOverlay.reasoningText),513)):le("",!0),e.liveOverlay.errorText?(w(),S("p",yv,de(e.liveOverlay.errorText),1)):le("",!0)])])])])):le("",!0),p("li",{ref_key:"bottomAnchorRef",ref:U,class:"conversation-bottom-anchor"},null,512)],544)),ae.value.length>0?(w(),S("div",{key:3,class:"image-modal-backdrop",onClick:J},[p("div",{class:"image-modal-content",onClick:A[0]||(A[0]=Ye(()=>{},["stop"]))},[p("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:J},[Ce(Ri,{class:"icon-svg"})]),p("img",{class:"image-modal-image",src:ae.value,alt:"Expanded message image"},null,8,wv)])])):le("",!0)]))}}),kv=Xe(_v,[["__scopeId","data-v-454a8117"]]);function Tv(e){var u;const t=P("idle"),n=P(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=m=>{m.data.size>0&&o.push(m.data)},r.onstop=()=>{var N;const m=o,_=(r==null?void 0:r.mimeType)||((N=m[0])==null?void 0:N.type)||"audio/webm";d(),t.value="idle",l(m,_)},r.start(),t.value="recording"}catch(m){d(),(f=e.onError)==null||f.call(e,m)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,m){var N;if(f.length===0)return;const _=new Blob(f,{type:m});try{const E=m.split(/[/;]/)[1]??"webm",H=`----codex-transcribe-${crypto.randomUUID()}`,Y=new Uint8Array(await _.arrayBuffer()),O=new TextEncoder,U=[];U.push(O.encode(`--${H}\r
27
- `)),U.push(O.encode(`Content-Disposition: form-data; name="file"; filename="codex.${E}"\r
28
- `)),U.push(O.encode(`Content-Type: ${m}\r
29
- \r
30
- `)),U.push(Y),U.push(O.encode(`\r
31
- --${H}--\r
32
- `));let D=0;for(const ee of U)D+=ee.byteLength;const ae=new Uint8Array(D);let ue=0;for(const ee of U)ae.set(ee,ue),ue+=ee.byteLength;const fe=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${H}`},body:ae});if(!fe.ok)throw new Error(`Transcription failed: ${fe.status}`);const oe=((await fe.json()).text??"").trim();oe.length>0&&e.onTranscript(oe)}catch(E){(N=e.onError)==null||N.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 Nn(d),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Xa(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class En extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function $i(e,t){const n=Xa(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Xa(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function Fr(e,t,n){return e instanceof En?e:e instanceof Error?new En(e.message||t,{code:"unknown_error",method:n}):new En(t,{code:"unknown_error",method:n})}function Gc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function Sv(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 En(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 En($i(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 En(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Za(e){const t=Gc(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 xv(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=Za(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=Za(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 Cv(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 En(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 En($i(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Ev(){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 En($i(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Gc(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function el(e){return new Date(e*1e3).toISOString()}function Av(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Iv(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Rv=/^##\s+(.+?):\s+(.+?)\s*$/,$v=/^#\s*files mentioned by the user\s*:?\s*$/i;function Mv(e){var s,o;const t=e.split(`
33
- `).findIndex(i=>$v.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(Rv);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 Pv(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 Ov(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:Iv(l),isUnhandled:!0});const o=n.join(`
35
- `),i=Mv(o);return{text:Pv(o),images:r,fileAttachments:i,rawBlocks:s}}function Nv(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Ov(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=jv(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 jv(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Dv(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Lv(e){const t=Dv(e);return t.length>0?t:"Untitled thread"}function zc(e){return(e==null?void 0:e.status)==="inProgress"}function Bv(e){const t=e;if(t.inProgress===!0||t.status==="inProgress"||t.turnStatus==="inProgress")return!0;const r=(Array.isArray(e.turns)?e.turns:[]).at(-1);return zc(r)}function Fv(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:Lv(e),projectName:Av(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:el(e.createdAt),updatedAtIso:el(e.updatedAt),preview:e.preview,unread:!1,inProgress:Bv(e)}}function Hv(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 Uv(e){const t=e.data.map(Fv);return Hv(t)}function Yc(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 Nv(i))n.push({...a,turnIndex:r})}return n}function Vv(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return zc(t.at(-1))}async function Kt(e,t){try{return await Sv(e,t)}catch(n){throw Fr(n,`RPC ${e} failed`,e)}}function Wv(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function qv(){const e=await Kt("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return Uv(e)}async function Kv(e){const t=await Kt("thread/read",{threadId:e,includeTurns:!0});return{messages:Yc(t),inProgress:Vv(t)}}async function Gv(){try{return await qv()}catch(e){throw Fr(e,"Failed to load thread groups","thread/list")}}async function zv(e){try{return await Kv(e)}catch(t){throw Fr(t,`Failed to load thread ${e}`,"thread/read")}}function Yv(e){return xv(e)}async function Jv(e,t){await Cv({id:e,...t})}async function Qv(){return Ev()}async function Io(e){await Kt("thread/resume",{threadId:e})}async function Xv(e){await Kt("thread/archive",{threadId:e})}async function Zv(e,t){await Kt("thread/name/set",{threadId:e,name:t})}async function tl(e,t){const n=await Kt("thread/rollback",{threadId:e,numTurns:t});return Yc(n)}function ey(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 nl(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 Kt("thread/start",n),s=ey(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw Fr(n,"Failed to start a new thread","thread/start")}}function ty(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 Ro(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:ty(t,i)}];for(const f of n){const m=f.trim();m&&l.push({type:"image",url:m,image_url:m})}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 Kt("turn/start",u)}catch(a){throw Fr(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function ny(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 Kt("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw Fr(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function ry(e){await Kt("setDefaultModel",{model:e})}async function sy(){const e=await Kt("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 oy(){const e=await Kt("config/read",{}),t=e.config.model??"",n=Wv(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function iy(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 ni(){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 iy(n.data)}async function ay(e){const t=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e})}),n=await t.json();if(!t.ok||!n.data)throw new Error(n.error||"Failed to create worktree");return n.data}async function rl(){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 ly(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 cy(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=Mi(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 uy(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=Mi(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 dy(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=Mi(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,m=typeof f=="string"?f.trim():"";m&&l.push({path:m})}return l}async function fy(e,t=200){const n=await fetch("/codex-api/thread-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,limit:t})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to search threads");return r.data??{threadIds:[],indexedThreadCount:0}}function Mi(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 hy(){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 $o(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 py(e,t){var n;try{return((n=(await Kt("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function my(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await Kt("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 gy(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 vy={},yy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function wy(e,t){return w(),S("svg",yy,[...t[0]||(t[0]=[p("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 by=Xe(vy,[["render",wy]]),_y={},ky={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ty(e,t){return w(),S("svg",ky,[...t[0]||(t[0]=[p("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 Sy=Xe(_y,[["render",Ty]]),xy={},Cy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ey(e,t){return w(),S("svg",Cy,[...t[0]||(t[0]=[p("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),p("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 Ay=Xe(xy,[["render",Ey]]),Iy=["disabled"],Ry={class:"composer-dropdown-value"},$y={class:"composer-dropdown-menu"},My={key:0,class:"composer-dropdown-search-wrap"},Py=["placeholder","onKeydown"],Oy={class:"composer-dropdown-options",role:"listbox"},Ny=["onClick"],jy={key:0,class:"composer-dropdown-empty"},Dy={key:1,class:"composer-dropdown-add-wrap"},Ly=["placeholder","onKeydown"],By=At({__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=P(null),o=P(null),i=P(null),a=P(!1),l=P(""),d=P(!1),u=P(""),f=ce(()=>{var ye;const ee=n.options.find(ne=>ne.value===n.modelValue);return ee?ee.label:((ye=n.placeholder)==null?void 0:ye.trim())||""}),m=ce(()=>n.openDirection??"down"),_=ce(()=>n.enableSearch===!0),N=ce(()=>n.showAddAction===!0),E=ce(()=>{var ee;return((ee=n.searchPlaceholder)==null?void 0:ee.trim())||"Quick search projects"}),H=ce(()=>{var ee;return((ee=n.addActionLabel)==null?void 0:ee.trim())||"Add new project"}),Y=ce(()=>{var ee;return((ee=n.addPlaceholder)==null?void 0:ee.trim())||"Project name or absolute path"}),O=ce(()=>{const ee=l.value.trim().toLowerCase();return ee?n.options.filter(ye=>ye.label.toLowerCase().includes(ee)||ye.value.toLowerCase().includes(ee)):n.options});function U(){n.disabled||(a.value=!a.value)}function D(ee){r("update:modelValue",ee),a.value=!1,l.value=""}function ae(){var ee;d.value=!0,u.value=((ee=n.defaultAddValue)==null?void 0:ee.trim())||"",zt(()=>{var ye;return(ye=i.value)==null?void 0:ye.focus()})}function ue(){if(l.value.length>0){l.value="";return}a.value=!1}function fe(){const ee=u.value.trim();ee&&(r("add",ee),d.value=!1,u.value="",a.value=!1,l.value="")}function ke(){d.value=!1,u.value="",a.value=!1,l.value=""}function oe(ee){if(!a.value)return;const ye=s.value;if(!ye)return;const ne=ee.target;ne instanceof Node&&(ye.contains(ne)||(a.value=!1,l.value="",d.value=!1,u.value=""))}return ct(a,ee=>{if(!ee){d.value=!1,u.value="";return}_.value&&zt(()=>{var ye;return(ye=o.value)==null?void 0:ye.focus()})}),On(()=>{window.addEventListener("pointerdown",oe)}),Nn(()=>{window.removeEventListener("pointerdown",oe)}),(ee,ye)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[p("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:U},[p("span",Ry,de(f.value),1),Ce(lo,{class:"composer-dropdown-chevron"})],8,Iy),a.value?(w(),S("div",{key:0,class:ut(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":m.value==="up","composer-dropdown-menu-wrap-down":m.value==="down"}])},[p("div",$y,[_.value?(w(),S("div",My,[$n(p("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ye[0]||(ye[0]=ne=>l.value=ne),class:"composer-dropdown-search-input",type:"text",placeholder:E.value,onKeydown:Ht(Ye(ue,["prevent"]),["esc"])},null,40,Py),[[Mn,l.value]])])):le("",!0),p("ul",Oy,[(w(!0),S(He,null,wt(O.value,ne=>(w(),S("li",{key:ne.value},[p("button",{class:ut(["composer-dropdown-option",{"is-selected":ne.value===e.modelValue}]),type:"button",onClick:Fe=>D(ne.value)},de(ne.label),11,Ny)]))),128)),O.value.length===0?(w(),S("li",jy," No matching projects ")):le("",!0)]),N.value?(w(),S("div",Dy,[d.value?(w(),S(He,{key:0},[$n(p("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ye[1]||(ye[1]=ne=>u.value=ne),class:"composer-dropdown-add-input",type:"text",placeholder:Y.value,onKeydown:[Ht(Ye(fe,["prevent"]),["enter"]),Ht(Ye(ke,["prevent"]),["esc"])]},null,40,Ly),[[Mn,u.value]]),p("div",{class:"composer-dropdown-add-actions"},[p("button",{type:"button",class:"composer-dropdown-add-btn",onClick:fe},"Open"),p("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ke},"Cancel")])],64)):(w(),S("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ae},de(H.value),1))])):le("",!0)])],2)):le("",!0)],512))}}),ri=Xe(By,[["__scopeId","data-v-7cfa2012"]]),Fy=["disabled"],Hy={class:"search-dropdown-value"},Uy={class:"search-dropdown-search-wrap"},Vy=["placeholder","onKeydown"],Wy={key:0,class:"search-dropdown-list",role:"listbox"},qy=["onClick","onPointerenter"],Ky={class:"search-dropdown-option-check"},Gy={class:"search-dropdown-option-label"},zy={key:0,class:"search-dropdown-option-desc"},Yy={key:1,class:"search-dropdown-empty"},Jy=At({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(null),i=P(!1),a=P(""),l=P(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 O=n.options.find(U=>U.value===n.selectedValues[0]);return(O==null?void 0:O.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),m=ce(()=>{const O=a.value.toLowerCase().trim();return O?n.options.filter(U=>{var D;return U.label.toLowerCase().includes(O)||(((D=U.description)==null?void 0:D.toLowerCase().includes(O))??!1)}):n.options});function _(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,zt(()=>{var O;return(O=o.value)==null?void 0:O.focus()})))}function N(O){r("toggle",O.value,!u.value.has(O.value))}function E(O){m.value.length!==0&&(l.value=(l.value+O+m.value.length)%m.value.length)}function H(){const O=m.value[l.value];O&&N(O)}function Y(O){if(!i.value)return;const U=s.value;if(!U)return;const D=O.target;D instanceof Node&&(U.contains(D)||(i.value=!1))}return ct(a,()=>{l.value=0}),On(()=>window.addEventListener("pointerdown",Y)),Nn(()=>window.removeEventListener("pointerdown",Y)),(O,U)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[p("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:_},[p("span",Hy,de(f.value),1),Ce(lo,{class:"search-dropdown-chevron"})],8,Fy),i.value?(w(),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"}])},[p("div",Uy,[$n(p("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":U[0]||(U[0]=D=>a.value=D),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[U[1]||(U[1]=Ht(Ye(D=>i.value=!1,["prevent"]),["escape"])),Ht(Ye(H,["prevent"]),["enter"]),U[2]||(U[2]=Ht(Ye(D=>E(1),["prevent"]),["arrow-down"])),U[3]||(U[3]=Ht(Ye(D=>E(-1),["prevent"]),["arrow-up"]))]},null,40,Vy),[[Mn,a.value]])]),m.value.length>0?(w(),S("ul",Wy,[(w(!0),S(He,null,wt(m.value,(D,ae)=>(w(),S("li",{key:D.value},[p("button",{class:ut(["search-dropdown-option",{"is-selected":u.value.has(D.value),"is-highlighted":ae===l.value}]),type:"button",onClick:ue=>N(D),onPointerenter:ue=>l.value=ae},[p("span",Ky,de(u.value.has(D.value)?"✓":""),1),p("span",Gy,de(D.label),1),D.description?(w(),S("span",zy,de(D.description),1)):le("",!0)],42,qy)]))),128))])):(w(),S("div",Yy,"No results"))],2)):le("",!0)],512))}}),Qy=Xe(Jy,[["__scopeId","data-v-a0f2edd4"]]),Xy={class:"skill-picker-header"},Zy=["onKeydown"],ew={key:0,class:"skill-picker-list",role:"listbox"},tw=["onClick","onPointerenter"],nw={class:"skill-picker-name"},rw={key:0,class:"skill-picker-desc"},sw={key:1,class:"skill-picker-empty"},ow=At({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(null),i=P(""),a=P(0),l=ce(()=>{const m=i.value.toLowerCase().trim();return m?n.skills.filter(_=>_.name.toLowerCase().includes(m)||_.description.toLowerCase().includes(m)):n.skills}),d=ce(()=>{const m={};return n.anchorBottom!=null&&(m.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(m.left=`${n.anchorLeft}px`),m});function u(m){l.value.length!==0&&(a.value=(a.value+m+l.value.length)%l.value.length)}function f(){const m=l.value[a.value];m&&r("select",m)}return ct(()=>n.visible,m=>{m&&(i.value="",a.value=0,zt(()=>{var _;return(_=o.value)==null?void 0:_.focus()}))}),ct(i,()=>{a.value=0}),(m,_)=>e.visible?(w(),S("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:vr(d.value)},[p("div",Xy,[$n(p("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":_[0]||(_[0]=N=>i.value=N),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[_[1]||(_[1]=Ht(Ye(N=>m.$emit("close"),["prevent"]),["escape"])),Ht(Ye(f,["prevent"]),["enter"]),_[2]||(_[2]=Ht(Ye(N=>u(1),["prevent"]),["arrow-down"])),_[3]||(_[3]=Ht(Ye(N=>u(-1),["prevent"]),["arrow-up"]))]},null,40,Zy),[[Mn,i.value]])]),l.value.length>0?(w(),S("ul",ew,[(w(!0),S(He,null,wt(l.value,(N,E)=>(w(),S("li",{key:N.path},[p("button",{class:ut(["skill-picker-item",{"is-highlighted":E===a.value}]),type:"button",onClick:H=>m.$emit("select",N),onPointerenter:H=>a.value=E},[p("span",nw,de(N.name),1),N.description?(w(),S("span",rw,de(N.description),1)):le("",!0)],42,tw)]))),128))])):(w(),S("div",sw,"No skills found"))],4)):le("",!0)}}),iw=Xe(ow,[["__scopeId","data-v-d6a08788"]]),aw={key:0,class:"thread-composer-attachments"},lw=["src","alt"],cw=["aria-label","disabled","onClick"],uw={key:1,class:"thread-composer-file-chips"},dw=["title"],fw=["aria-label","disabled","onClick"],hw={key:2,class:"thread-composer-skill-chips"},pw={class:"thread-composer-skill-chip-name"},mw=["aria-label","onClick"],gw={class:"thread-composer-input-wrap"},vw={key:0,class:"thread-composer-file-mentions"},yw=["onMousedown"],ww={key:1,class:"thread-composer-file-mention-icon-markdown"},bw={class:"thread-composer-file-mention-text"},_w={class:"thread-composer-file-mention-name"},kw={key:0,class:"thread-composer-file-mention-dir"},Tw={key:1,class:"thread-composer-file-mention-empty"},Sw=["placeholder","disabled"],xw={class:"thread-composer-controls"},Cw=["disabled"],Ew={key:0,class:"thread-composer-attach-menu"},Aw=["disabled"],Iw=["disabled"],Rw={class:"thread-composer-actions"},$w=["aria-label","title","disabled"],Mw=["disabled"],Pw=["aria-label","title","disabled"],Ow=["disabled"],Nw=["disabled"],jw=At({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=P(""),o=P([]),i=P([]),a=P([]),{state:l,isSupported:d,startRecording:u,stopRecording:f}=Tv({onTranscript:B=>{s.value=s.value?`${s.value}
43
- ${B}`:B}}),m=P(null),_=P(null),N=P(null),E=P(null),H=P(!1),Y=P(!1),O=P(null),U=P(""),D=P([]),ae=P(!1),ue=P(0);let fe=0,ke=null;const oe=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),ee=[{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"}],ye=ce(()=>n.models.map(B=>({value:B,label:B}))),ne=ce(()=>n.skills??[]),Fe=ce(()=>i.value.map(B=>B.path)),Ue=ce(()=>(n.skills??[]).map(B=>({value:B.path,label:B.name,description:B.description}))),Ke=ce(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Ie=ce(()=>n.disabled||!n.activeThreadId),be=ce(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),Oe=ce(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function vt(B="steer"){var J;const V=s.value.trim();if(Ke.value){if(r("submit",{text:V,imageUrls:o.value.map(Ge=>Ge.url),fileAttachments:[...a.value],skills:i.value.map(Ge=>({name:Ge.name,path:Ge.path})),mode:B}),s.value="",o.value=[],i.value=[],a.value=[],H.value=!1,Y.value=!1,X(),oe){(J=E.value)==null||J.blur();return}zt(()=>{var Ge;return(Ge=E.value)==null?void 0:Ge.focus()})}}function Ze(){r("interrupt")}function dt(B){r("update:selected-model",B)}function tt(B){r("update:selected-reasoning-effort",B)}function ze(){Ie.value||(H.value=!H.value)}function pe(){var B;(B=_.value)==null||B.click()}function Ee(){var B;(B=N.value)==null||B.click()}function Te(B){o.value=o.value.filter(V=>V.id!==B)}function I(B){i.value=i.value.filter(V=>V.path!==B)}function Q(B){a.value=a.value.filter(V=>V.fsPath!==B)}function z(B){const V=B.replace(/\\/g,"/");if(a.value.some(b=>b.fsPath===V))return;const J=V.split("/").filter(Boolean),Ge=J[J.length-1]??V;a.value=[...a.value,{label:Ge,path:V,fsPath:V}]}function me(B){return B.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(B.name)}function De(B){if(!(!B||B.length===0))for(const V of Array.from(B))if(me(V)){const J=new FileReader;J.onload=()=>{typeof J.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:V.name,url:J.result})},J.readAsDataURL(V)}else gy(V).then(J=>{J&&z(J)}).catch(()=>{})}function g(B){B&&(B.value="")}function y(B){const V=B.target;De((V==null?void 0:V.files)??null),g(V),H.value=!1}function x(B){const V=B.target;De((V==null?void 0:V.files)??null),g(V),H.value=!1}function L(){const V=s.value.startsWith("/");V!==Y.value&&(Y.value=V),re()}function F(B){if(ae.value){if(B.key==="Escape"){B.preventDefault(),X();return}if(B.key==="ArrowDown"){B.preventDefault(),D.value.length>0&&(ue.value=(ue.value+1)%D.value.length);return}if(B.key==="ArrowUp"){if(B.preventDefault(),D.value.length>0){const J=D.value.length;ue.value=(ue.value+J-1)%J}return}if(B.key==="Enter"||B.key==="Tab"){B.preventDefault();const J=D.value[ue.value];J?W(J):X();return}}if(n.sendWithEnter!==!1?B.key==="Enter"&&!B.shiftKey:B.key==="Enter"&&(B.metaKey||B.ctrlKey)){B.preventDefault(),vt(n.isTurnInProgress?be.value:"steer");return}if(Y.value){if(B.key==="Escape"){B.preventDefault(),j();return}if(B.key==="ArrowDown"||B.key==="ArrowUp"){B.preventDefault();return}}}function j(){var B;Y.value=!1,(B=E.value)==null||B.focus()}function X(){ae.value=!1,O.value=null,U.value="",D.value=[],ue.value=0}function re(){const B=E.value;if(!B){X();return}const V=B.selectionStart??s.value.length,Ge=s.value.slice(0,V).match(/(^|\s)(@[^\s@]*)$/);if(!Ge){X();return}const b=Ge[2]??"",A=b.length,M=V-A;O.value=M,U.value=b.slice(1),ae.value=!0,Z()}async function Z(){if(!ae.value)return;const B=(n.cwd??"").trim();if(!B){D.value=[];return}ke&&clearTimeout(ke);const V=++fe;ke=setTimeout(async()=>{try{const J=await dy(B,U.value,20);if(!ae.value||V!==fe)return;D.value=J,ue.value=0}catch{if(!ae.value||V!==fe)return;D.value=[]}},120)}function W(B){const V=E.value,J=O.value;if(J!==null&&V){const Ge=V.selectionStart??s.value.length;s.value=`${s.value.slice(0,J)}${s.value.slice(Ge)}`.trimEnd()}z(B.path),X(),zt(()=>V==null?void 0:V.focus())}function he(B){const V=B.lastIndexOf("/");return V<0?B:B.slice(V+1)}function ie(B){const V=B.lastIndexOf("/");return V<=0?"":B.slice(0,V)}function ge(B){const V=he(B),J=V.lastIndexOf(".");return J<=0?"":V.slice(J+1).toLowerCase()}function Se(B){const V=ge(B);return V==="ts"?"TS":V==="tsx"?"TSX":V==="js"?"JS":V==="jsx"?"JSX":V==="json"?"{}":""}function Ne(B){const V=ge(B);return V.startsWith("ts")?"ts":V.startsWith("js")?"js":V==="json"?"json":"default"}function We(B){const V=ge(B);return V==="md"||V==="mdx"}function Ae(B){var V;i.value.some(J=>J.path===B.path)||(i.value=[...i.value,B]),s.value=s.value.startsWith("/")?"":s.value,Y.value=!1,(V=E.value)==null||V.focus()}function at(B,V){if(V){const J=(n.skills??[]).find(Ge=>Ge.path===B);J&&!i.value.some(Ge=>Ge.path===B)&&(i.value=[...i.value,J])}else i.value=i.value.filter(J=>J.path!==B)}function Je(B){if(!H.value)return;const V=m.value;if(!V)return;const J=B.target;!J||V.contains(J)||(H.value=!1)}return On(()=>{document.addEventListener("click",Je)}),Nn(()=>{document.removeEventListener("click",Je),ke&&clearTimeout(ke)}),ct(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],H.value=!1,Y.value=!1,X()}),ct(()=>n.cwd,()=>{ae.value&&Z()}),(B,V)=>(w(),S("form",{class:"thread-composer",onSubmit:V[7]||(V[7]=Ye(J=>vt("steer"),["prevent"]))},[p("div",{class:ut(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(w(),S("div",aw,[(w(!0),S(He,null,wt(o.value,J=>(w(),S("div",{key:J.id,class:"thread-composer-attachment"},[p("img",{class:"thread-composer-attachment-image",src:J.url,alt:J.name||"Selected image"},null,8,lw),p("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${J.name||"image"}`,disabled:Ie.value,onClick:Ge=>Te(J.id)}," x ",8,cw)]))),128))])):le("",!0),a.value.length>0?(w(),S("div",uw,[(w(!0),S(He,null,wt(a.value,J=>(w(),S("span",{key:J.fsPath,class:"thread-composer-file-chip"},[Ce(qs,{class:"thread-composer-file-chip-icon"}),p("span",{class:"thread-composer-file-chip-name",title:J.fsPath},de(J.label),9,dw),p("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${J.label}`,disabled:Ie.value,onClick:Ge=>Q(J.fsPath)},"×",8,fw)]))),128))])):le("",!0),i.value.length>0?(w(),S("div",hw,[(w(!0),S(He,null,wt(i.value,J=>(w(),S("span",{key:J.path,class:"thread-composer-skill-chip"},[p("span",pw,de(J.name),1),p("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${J.name}`,onClick:Ge=>I(J.path)},"×",8,mw)]))),128))])):le("",!0),p("div",gw,[ae.value?(w(),S("div",vw,[D.value.length>0?(w(!0),S(He,{key:0},wt(D.value,(J,Ge)=>(w(),S("button",{key:J.path,class:ut(["thread-composer-file-mention-row",{"is-active":Ge===ue.value}]),type:"button",onMousedown:Ye(b=>W(J),["prevent"])},[Se(J.path)?(w(),S("span",{key:0,class:ut(["thread-composer-file-mention-icon-badge",`is-${Ne(J.path)}`])},de(Se(J.path)),3)):We(J.path)?(w(),S("span",ww,"↓")):(w(),ht(qs,{key:2,class:"thread-composer-file-mention-icon-file"})),p("span",bw,[p("span",_w,de(he(J.path)),1),ie(J.path)?(w(),S("span",kw,de(ie(J.path)),1)):le("",!0)])],42,yw))),128)):(w(),S("div",Tw,"No matching files"))])):le("",!0),$n(p("textarea",{ref_key:"inputRef",ref:E,"onUpdate:modelValue":V[0]||(V[0]=J=>s.value=J),class:"thread-composer-input",placeholder:Oe.value,disabled:Ie.value,onInput:L,onKeydown:F},null,40,Sw),[[Mn,s.value]]),Ce(iw,{skills:ne.value,visible:Y.value,"anchor-bottom":44,"anchor-left":0,onSelect:Ae,onClose:j},null,8,["skills","visible"])]),p("div",xw,[p("div",{ref_key:"attachMenuRootRef",ref:m,class:"thread-composer-attach"},[p("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Ie.value,onClick:ze}," + ",8,Cw),H.value?(w(),S("div",Ew,[p("button",{class:"thread-composer-attach-item",type:"button",disabled:Ie.value,onClick:pe}," Add photos & files ",8,Aw),p("button",{class:"thread-composer-attach-item",type:"button",disabled:Ie.value,onClick:Ee}," Take photo ",8,Iw)])):le("",!0)],512),Ce(ri,{class:"thread-composer-control","model-value":e.selectedModel,options:ye.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":dt},null,8,["model-value","options","disabled"]),Ce(Qy,{class:"thread-composer-control",options:Ue.value,"selected-values":Fe.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:at},null,8,["options","selected-values","disabled"]),Ce(ri,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:ee,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":tt},null,8,["model-value","disabled"]),p("div",Rw,[je(d)&&!e.isTurnInProgress?(w(),S("button",{key:0,class:ut(["thread-composer-mic",{"thread-composer-mic--active":je(l)!=="idle"}]),type:"button","aria-label":je(l)==="recording"?"Stop dictation":"Hold to dictate",title:je(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Ie.value,onMousedown:V[1]||(V[1]=Ye((...J)=>je(u)&&je(u)(...J),["prevent"])),onMouseup:V[2]||(V[2]=(...J)=>je(f)&&je(f)(...J)),onMouseleave:V[3]||(V[3]=J=>je(l)==="recording"&&je(f)()),onTouchstart:V[4]||(V[4]=Ye((...J)=>je(u)&&je(u)(...J),["prevent"])),onTouchend:V[5]||(V[5]=(...J)=>je(f)&&je(f)(...J))},[Ce(Sy,{class:"thread-composer-mic-icon"})],42,$w)):le("",!0),e.isTurnInProgress?(w(),S("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:Ze},[Ce(Ay,{class:"thread-composer-stop-icon"})],8,Mw)):le("",!0),p("button",{class:ut(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&be.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&be.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${be.value}`:"Send",disabled:!Ke.value,onClick:V[6]||(V[6]=J=>vt(e.isTurnInProgress?be.value:"steer"))},[Ce(by,{class:"thread-composer-submit-icon"})],10,Pw)])])],2),p("input",{ref_key:"photoLibraryInputRef",ref:_,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Ie.value,onChange:y},null,40,Ow),p("input",{ref_key:"cameraCaptureInputRef",ref:N,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Ie.value,onChange:x},null,40,Nw)],32))}}),sl=Xe(jw,[["__scopeId","data-v-983e7906"]]),Dw={key:0,class:"queued-messages"},Lw={class:"queued-messages-inner"},Bw={class:"queued-row-text"},Fw={class:"queued-row-actions"},Hw=["onClick"],Uw=["onClick"],Vw=At({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(w(),S("div",Dw,[p("div",Lw,[(w(!0),S(He,null,wt(e.messages,r=>(w(),S("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=p("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[p("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)),p("span",Bw,de(r.text),1),p("div",Fw,[p("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Hw),p("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]=[p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[p("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,Uw)])]))),128))])])):le("",!0)}}),Ww=Xe(Vw,[["__scopeId","data-v-ea583733"]]),qw={class:"runtime-dropdown-trigger-label"},Kw={key:0,class:"runtime-dropdown-menu-wrap"},Gw={class:"runtime-dropdown-menu"},zw=["onClick"],Yw={class:"runtime-dropdown-option-label"},Jw={key:0,class:"runtime-dropdown-option-check"},Qw=At({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(!1),i=[{value:"local",label:"Local project",icon:Kc},{value:"worktree",label:"New worktree",icon:js}],a=ce(()=>i.find(u=>u.value===n.modelValue)??i[0]);function l(u){r("update:modelValue",u),o.value=!1}function d(u){if(!o.value)return;const f=s.value;if(!f)return;const m=u.target;m instanceof Node&&(f.contains(m)||(o.value=!1))}return On(()=>{window.addEventListener("pointerdown",d)}),Nn(()=>{window.removeEventListener("pointerdown",d)}),(u,f)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[p("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=m=>o.value=!o.value)},[(w(),ht(qo(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),p("span",qw,de(a.value.label),1),Ce(lo,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),S("div",Kw,[p("div",Gw,[f[1]||(f[1]=p("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),S(He,null,wt(i,m=>p("button",{key:m.value,class:ut(["runtime-dropdown-option",{"is-selected":e.modelValue===m.value}]),type:"button",onClick:_=>l(m.value)},[(w(),ht(qo(m.icon),{class:"runtime-dropdown-option-icon"})),p("span",Yw,de(m.label),1),e.modelValue===m.value?(w(),S("span",Jw,"✓")):le("",!0)],10,zw)),64))])])):le("",!0)],512))}}),Xw=Xe(Qw,[["__scopeId","data-v-9c9b71e5"]]),Zw={},eb={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function tb(e,t){return w(),S("svg",eb,[...t[0]||(t[0]=[p("circle",{cx:"11",cy:"11",r:"8"},null,-1),p("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const si=Xe(Zw,[["render",tb]]),nb={class:"skill-card-top"},rb=["src","alt"],sb={key:1,class:"skill-card-avatar-fallback"},ob={class:"skill-card-info"},ib={class:"skill-card-header"},ab={class:"skill-card-name"},lb={key:0,class:"skill-card-badge-disabled"},cb={key:1,class:"skill-card-badge"},ub={class:"skill-card-owner"},db={key:0,class:"skill-card-desc"},fb={key:1,class:"skill-card-date"},hb=At({__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)=>(w(),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))},[p("div",nb,[e.skill.avatarUrl?(w(),S("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,rb)):(w(),S("div",sb,de(e.skill.owner.charAt(0)),1)),p("div",ob,[p("div",ib,[p("span",ab,de(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),S("span",lb,"Disabled")):e.skill.installed?(w(),S("span",cb,"Installed")):le("",!0)]),p("span",ub,de(e.skill.owner),1)])]),e.skill.description?(w(),S("p",db,de(e.skill.description),1)):le("",!0),n.value?(w(),S("span",fb,de(n.value),1)):le("",!0)],2))}}),ol=Xe(hb,[["__scopeId","data-v-2a1e8196"]]),pb={class:"sdm-panel"},mb={class:"sdm-header"},gb={class:"sdm-title-area"},vb=["src","alt"],yb={class:"sdm-title-col"},wb={class:"sdm-title-row"},bb={class:"sdm-title"},_b={key:0,class:"sdm-badge-disabled"},kb={class:"sdm-owner"},Tb={class:"sdm-body"},Sb={key:0,class:"sdm-desc"},xb={key:1,class:"sdm-readme-loading"},Cb=["innerHTML"],Eb=["href"],Ab={class:"sdm-footer"},Ib={class:"sdm-footer-actions"},Rb=["disabled"],$b=["disabled"],Mb=["disabled"],Pb=At({__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=P(null),o=P(""),i=P(!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 H=E.replace(/^---[\s\S]*?---\s*/,"");return u(H)});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}),H=await fetch(`/codex-api/skills-hub/readme?${E}`);if(!H.ok)return;const Y=await H.json();o.value=Y.content??""}catch{}finally{i.value=!1}}}ct(()=>n.visible,E=>{E&&(s.value=null,o.value="",f())});function m(){r("install",n.skill)}function _(){r("uninstall",n.skill)}function N(){const E=!a.value;s.value=E,r("toggle-enabled",n.skill,E)}return(E,H)=>(w(),ht(Fs,{to:"body"},[e.visible?(w(),S("div",{key:0,class:"sdm-overlay",onClick:H[1]||(H[1]=Ye(Y=>E.$emit("close"),["self"]))},[p("div",pb,[p("div",mb,[p("div",gb,[e.skill.avatarUrl?(w(),S("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,vb)):le("",!0),p("div",yb,[p("div",wb,[p("h3",bb,de(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),S("span",_b,"Disabled")):le("",!0)]),p("span",kb,de(e.skill.owner),1)])]),p("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:H[0]||(H[0]=Y=>E.$emit("close"))},[Ce(Ri,{class:"sdm-close-icon"})])]),p("div",Tb,[e.skill.description?(w(),S("p",Sb,de(e.skill.description),1)):le("",!0),i.value?(w(),S("div",xb,"Loading skill contents...")):o.value?(w(),S("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,Cb)):le("",!0),p("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,Eb)]),p("div",Ab,[p("div",Ib,[e.skill.installed?(w(),S("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:_},de(n.isUninstalling?"Uninstalling...":"Uninstall"),9,Rb)):(w(),S("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:m},de(n.isInstalling?"Installing...":"Install"),9,$b)),e.skill.installed?(w(),S("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:N},de(a.value?"Disable":"Enable"),9,Mb)):le("",!0)])])])])):le("",!0)]))}}),Ob=Xe(Pb,[["__scopeId","data-v-19a385ca"]]),Nb={class:"skills-hub"},jb={class:"skills-hub-toolbar"},Db={class:"skills-hub-search-wrap"},Lb={key:0,class:"skills-hub-count"},Bb={key:1,class:"skills-hub-section"},Fb={class:"skills-hub-section-title"},Hb={key:0,class:"skills-hub-grid"},Ub={class:"skills-hub-section"},Vb={key:0,class:"skills-hub-loading"},Wb={key:1,class:"skills-hub-error"},qb={key:0,class:"skills-hub-grid"},Kb={key:1,class:"skills-hub-empty"},Es="codex-web-local.skills-hub.cache.v1",Gb=At({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=P(null),s=P(""),o=P("date"),i=P([]),a=P([]),l=P(0),d=P(!1),u=P(""),f=P(!0),m=P(!1),_=P(n),N=P(null),E=P(""),H=P(!1),Y=P(!1);let O=null,U=null;const D=t,ae=ce(()=>o.value==="date"?"Newest":"A-Z"),ue=ce(()=>{var pe;return((pe=N.value)==null?void 0:pe.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),fe=ce(()=>`${_.value.owner}/${_.value.name}`),ke=ce(()=>H.value&&E.value===fe.value),oe=ce(()=>Y.value&&E.value===fe.value),ee=ce(()=>{const pe=s.value.toLowerCase().trim();return pe?a.value.filter(Ee=>Ee.name.toLowerCase().includes(pe)||Ee.owner.toLowerCase().includes(pe)||(Ee.displayName??"").toLowerCase().includes(pe)):a.value});function ye(pe,Ee="success"){N.value={text:pe,type:Ee},U&&clearTimeout(U),U=setTimeout(()=>{N.value=null},3e3)}function ne(){o.value=o.value==="date"?"name":"date",Oe(s.value)}function Fe(pe){return`${o.value}::${pe.trim().toLowerCase()}`}function Ue(pe){var Ee;if(typeof window>"u")return null;try{const Te=window.localStorage.getItem(Es);return Te?((Ee=JSON.parse(Te).byKey)==null?void 0:Ee[pe])??null:null}catch{return null}}function Ke(pe,Ee){if(!(typeof window>"u"))try{const Te=window.localStorage.getItem(Es),Q=(Te?JSON.parse(Te):{}).byKey??{};Q[pe]=Ee,window.localStorage.setItem(Es,JSON.stringify({byKey:Q}))}catch{}}function Ie(){if(!(typeof window>"u"))try{window.localStorage.removeItem(Es)}catch{}}function be(pe){const Ee=pe.installed??[];a.value=Ee;const Te=new Set(Ee.map(I=>I.name));i.value=pe.data.map(I=>{if(I.installed||Te.has(I.name)){const Q=Ee.find(z=>z.name===I.name);return{...I,installed:!0,path:(Q==null?void 0:Q.path)??I.path,enabled:(Q==null?void 0:Q.enabled)??I.enabled}}return I}).filter(I=>!I.installed),l.value=pe.total}async function Oe(pe){const Ee=Fe(pe),Te=Ue(Ee);Te&&be(Te),d.value=!Te,u.value="";try{const I=new URLSearchParams;pe.trim()&&I.set("q",pe.trim()),I.set("limit","100"),I.set("sort",o.value);const Q=await fetch(`/codex-api/skills-hub?${I}`);if(!Q.ok)throw new Error(`HTTP ${Q.status}`);const z=await Q.json();be(z),Ke(Ee,z)}catch(I){u.value=I instanceof Error?I.message:"Failed to load skills"}finally{d.value=!1}}function vt(){O&&clearTimeout(O),O=setTimeout(()=>Oe(s.value),300)}function Ze(pe){_.value=pe,m.value=!0}async function dt(pe){E.value=`${pe.owner}/${pe.name}`,H.value=!0;try{const Te=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:pe.owner,name:pe.name})})).json();if(!Te.ok)throw new Error(Te.error||"Install failed");const I={...pe,installed:!0,path:Te.path,enabled:!0};a.value=[...a.value,I],i.value=i.value.filter(Q=>Q.name!==pe.name),_.value=I,ye(`${pe.displayName||pe.name} skill installed`),m.value=!1,Ie(),D("skills-changed")}catch(Ee){ye(Ee instanceof Error?Ee.message:"Failed to install skill","error")}finally{H.value=!1}}async function tt(pe){E.value=`${pe.owner}/${pe.name}`,Y.value=!0;try{const Te=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:pe.name,path:pe.path})})).json();if(!Te.ok)throw new Error(Te.error||"Uninstall failed");a.value=a.value.filter(I=>I.name!==pe.name),pe.owner!=="local"&&(i.value=[...i.value,{...pe,installed:!1,path:void 0,enabled:void 0}]),ye(`${pe.displayName||pe.name} skill uninstalled`),m.value=!1,Ie(),D("skills-changed")}catch(Ee){ye(Ee instanceof Error?Ee.message:"Failed to uninstall skill","error")}finally{Y.value=!1}}async function ze(pe,Ee){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:pe.path,enabled:Ee}})})).ok)throw new Error("Failed to update skill");ye(`${pe.displayName||pe.name} skill ${Ee?"enabled":"disabled"}`),await Oe(s.value)}catch(Te){ye(Te instanceof Error?Te.message:"Failed to update skill","error")}}return On(()=>{Oe("")}),(pe,Ee)=>(w(),S("div",Nb,[Ee[3]||(Ee[3]=p("div",{class:"skills-hub-header"},[p("h2",{class:"skills-hub-title"},"Skills Hub"),p("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),p("div",jb,[p("div",Db,[Ce(si,{class:"skills-hub-search-icon"}),$n(p("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":Ee[0]||(Ee[0]=Te=>s.value=Te),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:vt},null,544),[[Mn,s.value]]),l.value>0?(w(),S("span",Lb,de(l.value)+" skills",1)):le("",!0)]),p("button",{class:"skills-hub-sort",type:"button",onClick:ne},de(ae.value),1)]),N.value?(w(),S("div",{key:0,class:ut(["skills-hub-toast",ue.value])},de(N.value.text),3)):le("",!0),ee.value.length>0?(w(),S("div",Bb,[p("button",{class:"skills-hub-section-toggle",type:"button",onClick:Ee[1]||(Ee[1]=Te=>f.value=!f.value)},[p("span",Fb,"Installed ("+de(ee.value.length)+")",1),Ce(qc,{class:ut(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),S("div",Hb,[(w(!0),S(He,null,wt(ee.value,Te=>(w(),ht(ol,{key:Te.name,skill:Te,onSelect:I=>Ze(I)},null,8,["skill","onSelect"]))),128))])):le("",!0)])):le("",!0),p("div",Ub,[d.value?(w(),S("div",Vb,"Loading skills...")):u.value?(w(),S("div",Wb,de(u.value),1)):(w(),S(He,{key:2},[i.value.length>0?(w(),S("div",qb,[(w(!0),S(He,null,wt(i.value,Te=>(w(),ht(ol,{key:Te.url,skill:Te,onSelect:I=>Ze(I)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),S("div",Kb,'No skills found for "'+de(s.value)+'"',1)):le("",!0)],64))]),Ce(Ob,{skill:_.value,visible:m.value,"is-installing":ke.value,"is-uninstalling":oe.value,onClose:Ee[2]||(Ee[2]=Te=>m.value=!1),onInstall:dt,onUninstall:tt,onToggleEnabled:ze},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),zb=Xe(Gb,[["__scopeId","data-v-1967b404"]]),Yb={},Jb={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 Qb(e,t){return w(),S("svg",Jb,[...t[0]||(t[0]=[p("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),p("path",{d:"M9 4l0 16"},null,-1)])])}const Xb=Xe(Yb,[["render",Qb]]),Zb={},e0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function t0(e,t){return w(),S("svg",e0,[...t[0]||(t[0]=[p("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 n0=Xe(Zb,[["render",t0]]),r0={},s0={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function o0(e,t){return w(),S("svg",s0,[...t[0]||(t[0]=[p("path",{d:"M20 11a8.1 8.1 0 0 0-15.5-2m-.5-4v4h4"},null,-1),p("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const i0=Xe(r0,[["render",o0]]),a0={class:"sidebar-thread-controls"},l0=["aria-label","title"],c0=["aria-pressed","aria-label","title"],u0=At({__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)=>(w(),S("div",a0,[p("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?(w(),ht(n0,{key:0,class:"sidebar-thread-controls-icon"})):(w(),ht(Xb,{key:1,class:"sidebar-thread-controls-icon"}))],8,l0),p("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"))},[Ce(i0,{class:"sidebar-thread-controls-icon"})],8,c0),fn(t.$slots,"default",{},void 0),e.showNewThreadButton?(w(),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"))},[Ce(qs,{class:"sidebar-thread-controls-icon"})])):le("",!0)]))}}),il=Xe(u0,[["__scopeId","data-v-57866500"]]),d0={},f0={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function h0(e,t){return w(),S("svg",f0,[...t[0]||(t[0]=[p("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[p("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),p("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const p0=Xe(d0,[["render",h0]]);function Gn(e){return e.flatMap(t=>t.threads)}const Jc="codex-web-local.thread-read-state.v1",Qc="codex-web-local.thread-scroll-state.v1",oi="codex-web-local.selected-thread-id.v1",Xc="codex-web-local.project-order.v1",Zc="codex-web-local.project-display-name.v1",eu="codex-web-local.auto-refresh-enabled.v1",Mo=220,Zr=4e3,al=["none","minimal","low","medium","high","xhigh"],es="__global__",Qt="gpt-5.2-codex";function m0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Jc);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function ll(e){typeof window>"u"||window.localStorage.setItem(Jc,JSON.stringify(e))}function g0(){return typeof window>"u"?!1:window.localStorage.getItem(eu)==="1"}function cl(e){typeof window>"u"||window.localStorage.setItem(eu,e?"1":"0")}function tu(e,t,n){return Math.min(Math.max(e,t),n)}function v0(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=tu(t.scrollRatio,0,1)),n}function y0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Qc);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=v0(s);o&&(n[r]=o)}return n}catch{return{}}}function ul(e){typeof window>"u"||window.localStorage.setItem(Qc,JSON.stringify(e))}function w0(){return typeof window>"u"?"":window.localStorage.getItem(oi)??""}function b0(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(oi);return}window.localStorage.setItem(oi,e)}}function _0(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Xc);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 Ar(e){typeof window>"u"||window.localStorage.setItem(Xc,JSON.stringify(e))}function k0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Zc);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 Po(e){typeof window>"u"||window.localStorage.setItem(Zc,JSON.stringify(e))}function As(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 hr(e,n)?e:n}function Oo(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 hr(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 T0(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 S0(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function Is(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 ii(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&hr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&S0(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Ks(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 x0(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&&ii(f,u)?f:u});if(n.preserveMissing!==!0)return Ks(e,o)?e:o;const i=e.map(u=>{const f=s.get(u.id);return!f||ii(u,f)?u:f}),a=new Set(e.map(u=>u.id)),l=o.filter(u=>!a.has(u.id)),d=[...i,...l];return Ks(e,d)?e:d}function ai(e){return e.replace(/\s+/gu," ").trim()}function C0(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>ai(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=ai(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function dl(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(ii(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const nu="worked";function Vn(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function E0(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 A0(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function I0(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 R0(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${E0(e.durationMs)}`,messageType:nu}}function $0(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function M0(e,t){const n=R0(t),r=e.filter(i=>i.messageType!==nu),s=$0(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function It(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function P0(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 O0(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 N0(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 Mt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Rs(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&&P0(d,l)?d:l});return o&&o.projectName===s.projectName&&O0(o.threads,a)?o:{projectName:s.projectName,threads:a}});return N0(e,r)?e:r}function j0(e,t,n){const r=new Set(Gn(t).map(a=>a.id)),s=Gn(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 No(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function L0(e){const t=e.split(`
44
- `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function B0(){const e=P([]),t=P([]),n=P(w0()),r=P({}),s=P({}),o=P({}),i=P({}),a=P({}),l=P({}),d=P({}),u=P([]),f=P(""),m=P("medium"),_=P(m0()),N=P(y0()),E=P(_0()),H=P(k0()),Y=P({}),O=P({}),U=P({}),D=P({}),ae=P({}),ue=P({}),fe=P({}),ke=P({}),oe=P({}),ee=P({}),ye=P([]),ne=P(!1),Fe=P(!1),Ue=P(!1),Ke=P(!1),Ie=P(!1),be=P(""),Oe=P(!1),vt=P(!1),Ze=P(g0()),dt=P(Math.floor(Zr/1e3));let tt=null,ze=null,pe=null,Ee=null,Te=!1;const I=new Set;let Q=!1,z=!1;const me=new Map,De=new Set,g=ce(()=>Gn(e.value)),y=ce(()=>g.value.find(c=>c.id===n.value)??null),x=ce(()=>N.value[n.value]??null),L=ce(()=>{const c=[],h=n.value;return h&&Array.isArray(ke.value[h])&&c.push(...ke.value[h]),Array.isArray(ke.value[es])&&c.push(...ke.value[es]),c.sort((v,T)=>v.receivedAtIso.localeCompare(T.receivedAtIso))}),F=ce(()=>{var G;const c=n.value;if(!c)return null;const h=ae.value[c],v=(o.value[c]??"").trim(),T=(((G=ue.value[c])==null?void 0:G.message)??"").trim();return!h&&!v&&!T?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:v,errorText:T}}),j=ce(()=>{const c=n.value;if(!c)return[];const h=r.value[c]??[],v=s.value[c]??[],T=i.value[c]??[],G=[...h,...T,...v],K=D.value[c];return K?M0(G,K):G});function X(c){n.value!==c&&(n.value=c,b0(c),z=!1)}function re(c){f.value=c.trim()}async function Z(){f.value=Qt,u.value.includes(Qt)||(u.value=[...u.value,Qt]);try{await ry(Qt)}catch{}}function W(c,h){oe.value={...oe.value,[c]:h}}function he(c){oe.value[c]&&(oe.value=It(oe.value,c))}async function ie(c){if(De.has(c))return;const h=oe.value[c];if(!(!h||h.fallbackRetried)){De.add(c),W(c,{...h,fallbackRetried:!0});try{await Z();try{const v=await tl(c,1);xe(c,v),_e(c,[]),pt(c),i.value[c]&&(i.value=It(i.value,c))}catch{}A(c,null),be.value="",V(c,null),b(c,{label:"Thinking",details:Se(Qt,h.effort)}),J(c,!0),U.value[c]!==!0&&await Io(c),await Ro(c,h.text,h.imageUrls,Qt,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),U.value={...U.value,[c]:!0},I.add(c),Te=!0,await sr()}catch(v){const T=v instanceof Error?v.message:"Unknown application error";A(c,T),be.value=T,J(c,!1),b(c,null)}finally{De.delete(c)}}}function ge(c){c&&!al.includes(c)||(m.value=c)}function Se(c,h){const v=c.trim()||"default",T=h||"default";return[`Model: ${v}`,`Thinking: ${T}`]}async function Ne(){try{const[c,h]=await Promise.all([sy(),oy()]);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&&al.includes(h.reasoningEffort)&&(m.value=h.reasoningEffort)}catch{}}function We(c){const h=ee.value;return Object.keys(h).length===0?c:c.map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const G=h[T.id];return G?{...T,title:G}:T})}))}function Ae(){const h=We(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const G=a.value[T.id]===!0,K=n.value===T.id,we=_.value[T.id],Re=d.value[T.id]===!0,ve=!K&&!G&&(Re||we!==T.updatedAtIso);return{...T,inProgress:G,unread:ve}})}));e.value=Rs(e.value,h)}function at(c,h,v){const T=new Date().toISOString(),G=h.trim(),K=D0(G),we={id:c,title:L0(v),projectName:K,cwd:G,hasWorktree:G.includes("/.codex/worktrees/")||G.includes("/.git/worktrees/"),createdAtIso:T,updatedAtIso:T,preview:v,unread:!1,inProgress:!1},Re=t.value.findIndex(et=>et.projectName===K);if(Re>=0){const yt=t.value[Re].threads.filter(Fn=>Fn.id!==c),Cr={projectName:K,threads:[we,...yt]},wn=[...t.value];wn.splice(Re,1,Cr),t.value=wn}else t.value=[{projectName:K,threads:[we]},...t.value];const ve=As(E.value,t.value);hr(E.value,ve)||(E.value=ve,Ar(E.value)),Ae()}function Je(c){const h=new Set(c.map(K=>K.id)),v=Mt(_.value,h);v!==_.value&&(_.value=v,ll(v));const T=Mt(N.value,h);T!==N.value&&(N.value=T,ul(T)),O.value=Mt(O.value,h),Y.value=Mt(Y.value,h),U.value=Mt(U.value,h),r.value=Mt(r.value,h),s.value=Mt(s.value,h),o.value=Mt(o.value,h),i.value=Mt(i.value,h),D.value=Mt(D.value,h),ae.value=Mt(ae.value,h),ue.value=Mt(ue.value,h),fe.value=Mt(fe.value,h),d.value=Mt(d.value,h),a.value=Mt(a.value,h);const G={};for(const[K,we]of Object.entries(ke.value))(K===es||h.has(K))&&(G[K]=we);ke.value=G}function B(c){const h=Gn(t.value).find(v=>v.id===c);h&&(_.value={..._.value,[c]:h.updatedAtIso},ll(_.value),d.value[c]&&(d.value=It(d.value,c)),Ae())}function V(c,h){if(!c)return;const v=D.value[c];if(h){if(A0(v,h))return;D.value={...D.value,[c]:h}}else v&&(D.value=It(D.value,c))}function J(c,h){!c||a.value[c]===!0===h||(h?a.value={...a.value,[c]:!0}:a.value=It(a.value,c),Ae())}function Ge(c){c&&c!==n.value&&d.value[c]!==!0&&(d.value={...d.value,[c]:!0},Ae())}function b(c,h){if(!c)return;const v=ae.value[c];if(!h){v&&(ae.value=It(ae.value,c));return}const T=br(h.label)||"Thinking",G=h.details.map(Re=>br(Re)).filter(Re=>Re.length>0&&Re!==T),K=Array.from(new Set([...(v==null?void 0:v.details)??[],...G])).slice(-3),we={label:T,details:K};I0(v,we)||(ae.value={...ae.value,[c]:we})}function A(c,h){if(!c)return;const v=ue.value[c],T=h?ai(h):"";if(!T){v&&(ue.value=It(ue.value,c));return}(v==null?void 0:v.message)!==T&&(ue.value={...ue.value,[c]:{message:T}})}function M(c){const h=Gn(t.value).find(v=>v.id===c);return(h==null?void 0:h.updatedAtIso)??""}function se(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=tu(h.scrollRatio,0,1));const T=N.value[c];T&&T.scrollTop===v.scrollTop&&T.isAtBottom===v.isAtBottom&&T.scrollRatio===v.scrollRatio||(N.value={...N.value,[c]:v},ul(N.value))}function xe(c,h){const v=r.value[c]??[];Ks(v,h)||(r.value={...r.value,[c]:h})}function _e(c,h){const v=s.value[c]??[];Ks(v,h)||(s.value={...s.value,[c]:h})}function nt(c,h){const v=s.value[c]??[],T=dl(v,h);_e(c,T)}function Qe(c,h){if(!c)return;const v=h.trim(),T=o.value[c]??"";if(v.length===0){if(!T)return;o.value=It(o.value,c);return}T!==v&&(o.value={...o.value,[c]:v})}function ft(c,h){if(!c)return;const v=o.value[c]??"";Qe(c,`${v}${h}`)}function pt(c){c&&c in o.value&&(o.value=It(o.value,c))}function Pe(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function Me(c){return typeof c=="string"?c:""}function pn(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function Ut(c){const h=Pe(c.params);if(!h)return"";const v=Me(h.threadId);if(v)return v;const T=Me(h.thread_id);if(T)return T;const G=Me(h.conversationId);if(G)return G;const K=Me(h.conversation_id);if(K)return K;const we=Pe(h.thread),Re=Me(we==null?void 0:we.id);if(Re)return Re;const ve=Pe(h.turn),et=Me(ve==null?void 0:ve.threadId);if(et)return et;const yt=Me(ve==null?void 0:ve.thread_id);return yt||""}function yr(c){if(c.method!=="turn/completed")return"";const h=Pe(c.params),v=Pe(h==null?void 0:h.turn);if(!v||v.status!=="failed")return"";const T=Pe(v.error);return Me(T==null?void 0:T.message)}function Qn(c){var v;if(c.method!=="error")return"";const h=Pe(c.params);return Me(h==null?void 0:h.message)||Me((v=Pe(h==null?void 0:h.error))==null?void 0:v.message)}function wr(c){const h=Pe(c);if(!h)return null;const v=h.id,T=Me(h.method),G=h.params;if(typeof v!="number"||!Number.isInteger(v)||!T)return null;const K=Pe(G),we=Me(K==null?void 0:K.threadId)||es,Re=Me(K==null?void 0:K.turnId),ve=Me(K==null?void 0:K.itemId),et=Me(h.receivedAtIso)||new Date().toISOString();return{id:v,method:T,threadId:we,turnId:Re,itemId:ve,receivedAtIso:et,params:G??null}}function Xn(c){const h=c.threadId||es,v=ke.value[h]??[],T=v.findIndex(K=>K.id===c.id),G=[...v];T>=0?G.splice(T,1,c):G.push(c),ke.value={...ke.value,[h]:G.sort((K,we)=>K.receivedAtIso.localeCompare(we.receivedAtIso))}}function Zn(c){const h={};for(const[v,T]of Object.entries(ke.value)){const G=T.filter(K=>K.id!==c);G.length>0&&(h[v]=G)}ke.value=h}function Hr(c){if(c.method==="server/request"){const h=wr(c.params);return h&&Xn(h),!0}if(c.method==="server/request/resolved"){const h=Pe(c.params),v=h==null?void 0:h.id;return typeof v=="number"&&Number.isInteger(v)&&Zn(v),!0}return!1}function br(c){return c.replace(/\s+/gu," ").trim()}function Ur(c){const h=Ut(c);if(!h)return null;if(c.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const v=Pe(c.params),T=Pe(v==null?void 0:v.item),G=Me(T==null?void 0:T.type).toLowerCase();if(G==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(G==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(G==="commandexecution"){const K=Me(T==null?void 0:T.command);return{threadId:h,activity:{label:"Running command",details:K?[K]:[]}}}}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 _r(c){if(c.method!=="turn/started")return null;const h=Pe(c.params);if(!h)return null;const v=Ut(c);if(!v)return null;const T=Pe(h.turn),G=Me(T==null?void 0:T.id)||Me(h.turnId)||`${v}:unknown`;if(!G)return null;const K=Vn(Me(T==null?void 0:T.startedAt))??Vn(Me(h.startedAt))??Vn(c.atIso)??Date.now();return{threadId:v,turnId:G,startedAtMs:K}}function Vt(c){if(c.method!=="turn/completed")return null;const h=Pe(c.params);if(!h)return null;const v=Ut(c);if(!v)return null;const T=Pe(h.turn),G=Me(T==null?void 0:T.id)||Me(h.turnId)||`${v}:unknown`;if(!G)return null;const K=Vn(Me(T==null?void 0:T.completedAt))??Vn(Me(h.completedAt))??Vn(c.atIso)??Date.now(),we=Vn(Me(T==null?void 0:T.startedAt))??Vn(Me(h.startedAt))??void 0;return{threadId:v,turnId:G,completedAtMs:K,startedAtMs:we}}function mn(c){return`${c}:live-reasoning`}function er(c){const h=Pe(c.params);if(!h)return"";if(c.method==="item/started"){const v=Pe(h.item);return!v||v.type!=="reasoning"?"":Me(v.id)}return""}function jn(c){const h=Pe(c.params);if(!h)return null;if(c.method==="item/reasoning/summaryTextDelta"){const v=Me(h.itemId),T=Me(h.delta);return!v||!T?null:{messageId:mn(v),delta:T}}return null}function Vr(c){const h=Pe(c.params);if(!h)return"";if(c.method==="item/reasoning/summaryPartAdded"){const v=Me(h.itemId);return v?mn(v):""}return""}function kr(c){const h=Pe(c.params);if(!h)return"";if(c.method==="item/completed"){const v=Pe(h.item);return!v||v.type!=="reasoning"?"":mn(Me(v.id))}return""}function Wr(c){const h=Pe(c.params);if(!h)return"";if(c.method==="item/started"){const v=Pe(h.item);return!v||v.type!=="agentMessage"?"":Me(v.id)}return""}function Dn(c){const h=Pe(c.params);if(!h)return null;if(c.method==="item/agentMessage/delta"){const v=Me(h.itemId),T=Me(h.delta);return!v||!T?null:{messageId:v,delta:T}}return null}function tr(c){const h=Pe(c.params);if(!h)return null;if(c.method==="item/completed"){const v=Pe(h.item);if(!v||v.type!=="agentMessage")return null;const T=Me(v.id),G=Me(v.text);return!T||!G?null:{id:T,role:"assistant",text:G,messageType:"agentMessage.live"}}return null}function qr(c){if(c.method!=="item/started")return null;const h=Pe(c.params),v=Pe(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=Me(v.id),G=Me(v.command);if(!T)return null;const K=typeof v.cwd=="string"?v.cwd:null;return{id:T,role:"system",text:G,messageType:"commandExecution",commandExecution:{command:G,cwd:K,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function gn(c){if(c.method!=="item/commandExecution/outputDelta")return null;const h=Pe(c.params);if(!h)return null;const v=Me(h.itemId),T=Me(h.delta);return!v||!T?null:{itemId:v,delta:T}}function Tr(c){if(c.method!=="item/completed")return null;const h=Pe(c.params),v=Pe(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=Me(v.id),G=Me(v.command);if(!T)return null;const K=typeof v.cwd=="string"?v.cwd:null,we=Me(v.status),Re=we==="failed"?"failed":we==="declined"?"declined":we==="interrupted"?"interrupted":"completed",ve=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",et=typeof v.exitCode=="number"?v.exitCode:null;return{id:T,role:"system",text:G,messageType:"commandExecution",commandExecution:{command:G,cwd:K,status:Re,aggregatedOutput:ve,exitCode:et}}}function vn(c,h){const v=i.value[c]??[],T=dl(v,h);T!==v&&(i.value={...i.value,[c]:T})}function Kr(c,h){const v=i.value[c];if(!v||v.length===0)return;const T=new Set(h.map(K=>K.id)),G=v.filter(K=>!T.has(K.id));G.length!==v.length&&(G.length===0?i.value=It(i.value,c):i.value={...i.value,[c]:G})}function Ln(c){if(c.method==="item/agentMessage/delta")return!0;const h=Pe(c.params);if(!h)return!1;if(c.method==="item/completed"){const v=Pe(h.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function Sr(c){var Di,Li,Bi,Fi;if(Hr(c))return;if(c.method==="thread/name/updated"){const qe=Pe(c.params),an=Me(qe==null?void 0:qe.threadId),or=Me(qe==null?void 0:qe.threadName);an&&or&&(ee.value={...ee.value,[an]:or},Ae(),$o(an,or))}const h=Ur(c);h&&b(h.threadId,h.activity);const v=_r(c);v&&(me.set(v.turnId,v),fe.value={...fe.value,[v.threadId]:v.turnId},V(v.threadId,null),A(v.threadId,null),J(v.threadId,!0),d.value[v.threadId]&&(d.value=It(d.value,v.threadId)));const T=Vt(c),G=yr(c),we=!!((T==null?void 0:T.threadId)??Ut(c))&&!!G&&f.value!==Qt&&Is(new Error(G));if(T){const qe=me.get(T.turnId);qe&&me.delete(T.turnId);const an=pn((Di=Pe(c.params))==null?void 0:Di.durationMs)??pn((Bi=Pe((Li=Pe(c.params))==null?void 0:Li.turn))==null?void 0:Bi.durationMs)??(typeof T.startedAtMs=="number"?T.completedAtMs-T.startedAtMs:null)??(qe?T.completedAtMs-qe.startedAtMs:null),or=typeof an=="number"?Math.max(0,an):0;V(T.threadId,{turnId:T.turnId,durationMs:or}),fe.value[T.threadId]&&(fe.value=It(fe.value,T.threadId)),J(T.threadId,!1),b(T.threadId,null),Ge(T.threadId),we||(he(T.threadId),ks(T.threadId))}if(G){const qe=(T==null?void 0:T.threadId)||Ut(c);qe&&A(qe,G),be.value=G,qe&&we&&ie(qe)}else T&&A(T.threadId,null);const Re=Qn(c);if(Re){const qe=Ut(c);qe&&A(qe,Re),be.value=Re,f.value!==Qt&&Is(new Error(Re))&&(qe?ie(qe):Z())}const ve=Ut(c);if(!ve||ve!==n.value)return;Wr(c);const et=Dn(c);if(et){const qe=(s.value[ve]??[]).find(or=>or.id===et.messageId),an=`${(qe==null?void 0:qe.text)??""}${et.delta}`;nt(ve,{id:et.messageId,role:"assistant",text:an,messageType:"agentMessage.live"})}const yt=tr(c);yt&&nt(ve,yt),er(c);const Cr=jn(c);if(Cr&&ft(ve,Cr.delta),Vr(c)){const qe=o.value[ve]??"";qe.trim().length>0&&!qe.endsWith(`
45
-
46
- `)&&Qe(ve,`${qe}
47
-
48
- `)}kr(c);const Fn=qr(c);Fn&&(vn(ve,Fn),b(ve,{label:"Running command",details:[((Fi=Fn.commandExecution)==null?void 0:Fi.command)??""]}));const co=gn(c);if(co){const qe=(i.value[ve]??[]).find(an=>an.id===co.itemId);qe!=null&&qe.commandExecution&&vn(ve,{...qe,commandExecution:{...qe.commandExecution,aggregatedOutput:`${qe.commandExecution.aggregatedOutput}${co.delta}`}})}const ji=Tr(c);if(ji&&vn(ve,ji),Ln(c)&&(z&&n.value&&se(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),pt(ve)),c.method==="turn/completed"){z=!1,pt(ve),i.value[ve]&&(i.value=It(i.value,ve));const qe=Ut(c);qe&&(J(qe,!1),b(qe,null),Ge(qe),we||(he(qe),ks(qe)))}}function k(c){const h=Ut(c);h&&I.add(h);const v=c.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(Te=!0),!(ze!==null||typeof window>"u")&&(ze=window.setTimeout(()=>{ze=null,sr()},Mo))}async function C(c){if(!Q){Q=!0;try{const h=await ni(),v=[];for(const T of h.order){const G=No(T);v.includes(G)||v.push(G)}if(v.length>0){const T=As(v,c);hr(E.value,T)||(E.value=T,Ar(E.value))}if(Object.keys(h.labels).length>0){const T={...H.value};let G=!1;for(const[K,we]of Object.entries(h.labels)){const Re=No(K);T[Re]!==we&&(T[Re]=we,G=!0)}G&&(H.value=T,Po(T))}}catch{}}}async function R(){if(!(Object.keys(ee.value).length>0))try{const c=await hy();Object.keys(c.titles).length>0&&(ee.value=c.titles)}catch{}}async function q(c,h,v){if(ee.value[c])return;const T=h.trim();if(!T)return;const G=T.length>300?T.slice(0,300):T;try{const K=await py(G,v);if(!K||ee.value[c])return;ee.value={...ee.value,[c]:K},Ae(),$o(c,K)}catch{}}async function Le(){var c;vt.value||(ne.value=!0);try{const[h]=await Promise.all([Gv(),R()]);await C(h);const v=As(E.value,h);hr(E.value,v)||(E.value=v,Ar(E.value));const T=Oo(h,E.value),G=j0(t.value,T,a.value);t.value=Rs(t.value,G),a.value=Mt(a.value,new Set(Gn(t.value).map(Re=>Re.id))),Ae(),vt.value=!0;const K=Gn(e.value);Je(K),K.some(Re=>Re.id===n.value)||X(((c=K[0])==null?void 0:c.id)??"")}finally{ne.value=!1}}async function bt(c,h={}){if(!c)return;const v=O.value[c]===!0,T=h.silent!==!0&&!v;T&&(Fe.value=!0);try{U.value[c]!==!0&&(await Io(c),U.value={...U.value,[c]:!0});const{messages:G,inProgress:K}=await zv(c),we=r.value[c]??[],Re=x0(we,G,{preserveMissing:h.silent===!0});xe(c,Re);const ve=s.value[c]??[],et=C0(ve,G);_e(c,et),Kr(c,G),O.value={...O.value,[c]:!0};const yt=M(c);yt&&(Y.value={...Y.value,[c]:yt}),J(c,K),B(c)}finally{T&&(Fe.value=!1)}}async function Wt(){try{const c=t.value.flatMap(h=>h.threads.map(v=>v.cwd)).filter(Boolean);ye.value=await my(c.length>0?[...new Set(c)]:void 0)}catch{}}async function xr(){be.value="";try{await Le(),await Promise.all([Ne(),Wt()]),await bt(n.value)}catch(c){be.value=c instanceof Error?c.message:"Unknown application error"}}async function yn(c){X(c);try{await bt(c)}catch(h){be.value=h instanceof Error?h.message:"Unknown application error"}}async function Yt(c){try{await Xv(c),await Le(),n.value===c&&await bt(n.value)}catch(h){be.value=h instanceof Error?h.message:"Unknown application error"}}async function Bn(c,h){const v=h.trim();if(!(!c||!v))try{await Zv(c,v),ee.value={...ee.value,[c]:v},Ae(),$o(c,v)}catch(T){be.value=T instanceof Error?T.message:"Unknown application error"}}async function nr(c,h=[],v=[],T="steer",G=[]){const K=n.value,we=c.trim();if(!K||!we&&h.length===0&&G.length===0)return;const Re=a.value[K]===!0;if(Re&&T==="queue"){const ve=l.value[K]??[],et=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[K]:[...ve,{id:et,text:we,imageUrls:h,skills:v,fileAttachments:G}]};return}if(Re){z=!0,rr(K,we,h,v,G).catch(ve=>{const et=ve instanceof Error?ve.message:"Unknown application error";A(K,et),be.value=et});return}be.value="",z=!0,V(K,null),b(K,{label:"Thinking",details:Se(f.value,m.value)}),A(K,null),J(K,!0);try{await rr(K,we,h,v,G)}catch(ve){z=!1,J(K,!1),b(K,null);const et=ve instanceof Error?ve.message:"Unknown application error";throw A(K,et),be.value=et,ve}}async function Gr(c,h,v=[],T=[],G=[]){const K=c.trim(),we=h.trim(),Re=f.value.trim();if(!K&&v.length===0&&G.length===0)return"";Ue.value=!0,be.value="";let ve="";try{try{ve=await nl(we||void 0,Re||void 0)}catch(wn){if(Re&&Re!==Qt&&Is(wn))await Z(),ve=await nl(we||void 0,Qt);else throw wn}if(!ve)return"";at(ve,we,K||"[Image]"),U.value={...U.value,[ve]:!0},X(ve),z=!0,V(ve,null),b(ve,{label:"Thinking",details:Se(f.value,m.value)}),A(ve,null),J(ve,!0);const et=ve,yt=we||null,Cr=K;return rr(ve,K,v,T,G).catch(wn=>{z=!1,J(ve,!1),b(ve,null);const Fn=wn instanceof Error?wn.message:"Unknown application error";A(ve,Fn),be.value=Fn}).finally(()=>{Ue.value=!1}),q(et,Cr,yt),ve}catch(et){z=!1,ve&&(J(ve,!1),b(ve,null));const yt=et instanceof Error?et.message:"Unknown application error";throw ve&&A(ve,yt),be.value=yt,Ue.value=!1,et}}async function rr(c,h,v=[],T=[],G=[]){const K=f.value.trim(),we=m.value,Re=h.trim(),ve=T.map(yt=>({name:yt.name,path:yt.path})),et=G.map(yt=>({...yt}));W(c,{text:Re,imageUrls:[...v],skills:ve,fileAttachments:et,effort:we,fallbackRetried:!1});try{U.value[c]!==!0&&await Io(c);try{await Ro(c,h,v,K||void 0,we||void 0,T.length>0?T:void 0,G)}catch(yt){if(K&&K!==Qt&&Is(yt))await Z(),W(c,{text:Re,imageUrls:[...v],skills:ve,fileAttachments:et,effort:we,fallbackRetried:!0}),await Ro(c,h,v,Qt,we||void 0,T.length>0?T:void 0,G);else throw yt}U.value={...U.value,[c]:!0},I.add(c),Te=!0,await sr()}catch(yt){throw yt}}async function ks(c){const h=l.value[c];if(!h||h.length===0)return;const[v,...T]=h;l.value=T.length>0?{...l.value,[c]:T}:It(l.value,c),Ue.value=!0,be.value="",z=!0,V(c,null),b(c,{label:"Thinking",details:Se(f.value,m.value)}),A(c,null),J(c,!0);try{await rr(c,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{J(c,!1),b(c,null)}finally{Ue.value=!1}}async function $(){const c=n.value;if(!c||a.value[c]!==!0)return;const h=fe.value[c];Ke.value=!0,be.value="";try{await ny(c,h),J(c,!1),b(c,null),A(c,null),fe.value[c]&&(fe.value=It(fe.value,c)),I.add(c),Te=!0,await sr()}catch(v){const T=v instanceof Error?v.message:"Failed to interrupt active turn";A(c,T),be.value=T}finally{Ke.value=!1}}async function te(c){const h=n.value;if(!h||Ie.value)return;const T=(r.value[h]??[]).reduce((K,we)=>typeof we.turnIndex=="number"&&we.turnIndex>K?we.turnIndex:K,-1);if(T<0||c>T)return;const G=T-c+1;if(!(G<1)){Ie.value=!0,be.value="";try{const K=await tl(h,G);xe(h,K),_e(h,[]),pt(h),i.value[h]&&(i.value=It(i.value,h)),V(h,null),b(h,null),A(h,null),Te=!0,await sr()}catch(K){be.value=K instanceof Error?K.message:"Failed to rollback thread"}finally{Ie.value=!1}}}function $e(c,h){c.length===0||(H.value[c]??"")===h||(H.value={...H.value,[c]:h},Po(H.value))}function Tt(c){var G;if(c.length===0)return;const h=E.value.filter(K=>K!==c);if(hr(E.value,h)||(E.value=h,Ar(E.value)),t.value=t.value.filter(K=>K.projectName!==c),H.value[c]!==void 0){const K={...H.value};delete K[c],H.value=K,Po(K)}Ae();const v=Gn(e.value);Je(v),v.some(K=>K.id===n.value)||X(((G=v[0])==null?void 0:G.id)??""),Et()}function $t(c,h){if(c.length===0||t.value.length===0)return;const v=t.value.map(ve=>ve.projectName),T=v.indexOf(c);if(T===-1)return;const G=Math.max(0,Math.min(h,v.length-1)),K=T0(v,T,G);if(K===v)return;const we=As(K,t.value);E.value=we,Ar(E.value);const Re=Oo(t.value,E.value);t.value=Rs(t.value,Re),Ae(),Et()}function Ct(c){const h=c.trim();if(!h)return;const v=[h,...E.value.filter(G=>G!==h)];if(hr(E.value,v))return;E.value=v,Ar(E.value);const T=Oo(t.value,E.value);t.value=Rs(t.value,T),Ae(),Et()}async function Et(){var c,h;try{const v=await ni(),T=new Map;for(const we of v.order){const Re=No(we);T.has(Re)||T.set(Re,we)}for(const we of t.value){const Re=((h=(c=we.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";Re&&T.set(we.projectName,Re)}const G=[];for(const we of E.value){const Re=T.get(we);Re&&!G.includes(Re)&&G.push(Re)}for(const we of v.order)G.includes(we)||G.push(we);const K=v.active.filter(we=>G.includes(we));K.length===0&&G.length>0&&K.push(G[0]),await ly({order:G,labels:v.labels,active:K})}catch{}}async function ru(){if(!Oe.value){Oe.value=!0;try{if(await Le(),!n.value)return;const c=n.value,h=M(c),v=Y.value[c]??"",T=h.length>0&&h!==v;(a.value[c]===!0||T)&&await bt(c,{silent:!0})}catch{}finally{Oe.value=!1}}}async function sr(){if(Oe.value){typeof window<"u"&&ze===null&&(ze=window.setTimeout(()=>{ze=null,sr()},Mo));return}Oe.value=!0;const c=Te,h=new Set(I);Te=!1,I.clear();try{c&&await Le();const v=n.value;if(!v)return;const T=h.has(v),G=a.value[v]===!0,K=M(v),we=Y.value[v]??"",Re=K.length>0&&K!==we;(T||G||Re||c)&&await bt(v,{silent:!0})}catch{}finally{Oe.value=!1,(Te||I.size>0)&&typeof window<"u"&&ze===null&&(ze=window.setTimeout(()=>{ze=null,sr()},Mo))}}function su(){typeof window>"u"||tt||(Ze.value&&Oi(),ou(),tt=Yv(c=>{Sr(c),k(c)}))}async function ou(){try{const c=await Qv();for(const h of c){const v=wr(h);v&&Xn(v)}}catch{}}async function iu(c){try{await Jv(c.id,{result:c.result,error:c.error}),Zn(c.id)}catch(h){be.value=h instanceof Error?h.message:"Failed to reply to server request"}}function Pi(c={}){const h=c.updatePreference??!0;pe!==null&&typeof window<"u"&&(window.clearInterval(pe),pe=null),Ee!==null&&typeof window<"u"&&(window.clearInterval(Ee),Ee=null),h&&(Ze.value=!1,cl(!1)),dt.value=Math.floor(Zr/1e3)}function Oi(){typeof window>"u"||pe!==null||Ee!==null||(Ze.value=!0,cl(!0),dt.value=Math.floor(Zr/1e3),pe=window.setInterval(()=>{dt.value=Math.floor(Zr/1e3),ru()},Zr),Ee=window.setInterval(()=>{dt.value=Math.max(0,dt.value-1)},1e3))}function au(){if(Ze.value){Pi();return}Oi()}function lu(){Pi({updatePreference:!1}),tt&&(tt(),tt=null),Te=!1,I.clear(),me.clear(),ze!==null&&typeof window<"u"&&(window.clearTimeout(ze),ze=null),z=!1,r.value={},s.value={},o.value={},i.value={},ae.value={},D.value={},ue.value={},fe.value={},l.value={}}const cu=ce(()=>{const c=n.value;return c?l.value[c]??[]:[]});function Ni(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.filter(G=>G.id!==c);l.value=T.length>0?{...l.value,[h]:T}:It(l.value,h)}function uu(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.find(G=>G.id===c);T&&(Ni(c),nr(T.text,T.imageUrls,T.skills,"steer",T.fileAttachments))}return{projectGroups:e,projectDisplayNameById:H,selectedThread:y,selectedThreadScrollState:x,selectedThreadServerRequests:L,selectedLiveOverlay:F,selectedThreadId:n,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:m,installedSkills:ye,messages:j,isLoadingThreads:ne,isLoadingMessages:Fe,isSendingMessage:Ue,isInterruptingTurn:Ke,isAutoRefreshEnabled:Ze,autoRefreshSecondsLeft:dt,error:be,refreshAll:xr,refreshSkills:Wt,selectThread:yn,setThreadScrollState:se,archiveThreadById:Yt,renameThreadById:Bn,sendMessageToSelectedThread:nr,sendMessageToNewThread:Gr,interruptSelectedThreadTurn:$,rollbackSelectedThread:te,isRollingBack:Ie,selectedThreadQueuedMessages:cu,removeQueuedMessage:Ni,steerQueuedMessage:uu,setSelectedModelId:re,setSelectedReasoningEffort:ge,respondToPendingServerRequest:iu,renameProject:$e,removeProject:Tt,reorderProject:$t,pinProjectToTop:Ct,toggleAutoRefreshTimer:au,startPolling:su,stopPolling:lu}}const F0={class:"sidebar-root"},H0={class:"sidebar-scrollable"},U0=["aria-pressed"],V0={key:1,class:"sidebar-search-bar"},W0={key:0,class:"sidebar-settings-area"},q0={key:0,class:"sidebar-settings-panel"},K0={class:"sidebar-settings-value"},G0={class:"sidebar-settings-value"},z0={class:"content-root"},Y0={class:"content-body"},J0={key:1,class:"content-grid"},Q0={class:"new-thread-empty"},X0={class:"worktree-init-status-title"},Z0={class:"worktree-init-status-message"},e_={key:2,class:"content-grid"},t_={class:"content-thread"},n_={class:"composer-with-queue"},r_={class:"build-badge","aria-label":"Worktree name and version"},fl="codex-web-local.sidebar-collapsed.v1",hl="codex-web-local.send-with-enter.v1",pl="codex-web-local.in-progress-send-mode.v1",ml="codex-web-local.dark-mode.v1",s_=At({__name:"App",setup(e){const t="codex-web-local",n="0.1.31",{projectGroups:r,projectDisplayNameById:s,selectedThread:o,selectedThreadScrollState:i,selectedThreadServerRequests:a,selectedLiveOverlay:l,selectedThreadId:d,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:m,installedSkills:_,messages:N,isLoadingThreads:E,isLoadingMessages:H,isInterruptingTurn:Y,isAutoRefreshEnabled:O,autoRefreshSecondsLeft:U,refreshAll:D,refreshSkills:ae,selectThread:ue,setThreadScrollState:fe,archiveThreadById:ke,renameThreadById:oe,sendMessageToSelectedThread:ee,sendMessageToNewThread:ye,interruptSelectedThreadTurn:ne,rollbackSelectedThread:Fe,isRollingBack:Ue,selectedThreadQueuedMessages:Ke,removeQueuedMessage:Ie,steerQueuedMessage:be,setSelectedModelId:Oe,setSelectedReasoningEffort:vt,respondToPendingServerRequest:Ze,renameProject:dt,removeProject:tt,reorderProject:ze,pinProjectToTop:pe,toggleAutoRefreshTimer:Ee,startPolling:Te,stopPolling:I}=B0(),Q=zh(),z=Gh(),{isMobile:me}=Wc(),De=P(!1),g=P(!1),y=P(""),x=P("local"),L=P({order:[],labels:{}}),F=P({phase:"idle",title:"",message:""}),j=P(Yt()),X=P(""),re=P(!1),Z=P(null),W=P(null);let he=null;const ie=P("New Project (1)"),ge=P(""),Se=P(!1),Ne=P(R(hl,!0)),We=P(Le()),Ae=P(q()),at=ce(()=>{const $=Q.params.threadId;return typeof $=="string"?$:""}),Je=ce(()=>{const $=new Set;for(const te of r.value)for(const $e of te.threads)$.add($e.id);return $}),B=ce(()=>Q.name==="home"),V=ce(()=>Q.name==="skills"),J=ce(()=>{var $;return V.value?"Skills":B.value?"New thread":(($=o.value)==null?void 0:$.title)??"Choose a thread"}),Ge=ce(()=>O.value?`Auto refresh in ${String(U.value)}s`:"Enable 4s refresh"),b=ce(()=>N.value.filter($=>{const te=nr($.messageType,$.role);return te==="worked"?!0:!(te==="turnActivity.live"||te==="turnError.live"||te==="agentReasoning.live")})),A=ce(()=>l.value),M=ce(()=>B.value?"__new-thread__":d.value),se=ce(()=>{var $,te;return B.value?y.value.trim():((te=($=o.value)==null?void 0:$.cwd)==null?void 0:te.trim())??""}),xe=ce(()=>{var $;return!B.value&&(($=o.value)==null?void 0:$.inProgress)===!0}),_e=ce(()=>{var Tt,$t;const $=[],te=new Set;for(const Ct of L.value.order){const Et=Ct.trim();!Et||te.has(Et)||(te.add(Et),$.push({value:Et,label:L.value.labels[Et]||vn(Et)}))}for(const Ct of r.value){const Et=(($t=(Tt=Ct.threads[0])==null?void 0:Tt.cwd)==null?void 0:$t.trim())??"";!Et||te.has(Et)||(te.add(Et),$.push({value:Et,label:s.value[Ct.projectName]??Ct.projectName}))}const $e=y.value.trim();return $e&&!te.has($e)&&$.unshift({value:$e,label:vn($e)}),$}),nt=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;On(()=>{window.addEventListener("keydown",mn),yn(),nt==null||nt.addEventListener("change",yn),Gr(),qr(),gn(),Dn()}),no(()=>{window.removeEventListener("keydown",mn),nt==null||nt.removeEventListener("change",yn),he&&(clearTimeout(he),he=null),I()}),ct(X,$=>{const te=$.trim();if(he&&(clearTimeout(he),he=null),!te){W.value=null;return}he=setTimeout(()=>{fy(te,1e3).then($e=>{X.value.trim()===te&&(W.value=$e.threadIds)}).catch(()=>{X.value.trim()===te&&(W.value=null)})},220)});function Qe(){ae()}function ft(){re.value=!re.value,re.value?zt(()=>{var $;return($=Z.value)==null?void 0:$.focus()}):X.value=""}function pt(){var $;X.value="",($=Z.value)==null||$.focus()}function Pe($){$.key==="Escape"&&(re.value=!1,X.value="")}function Me($){$&&(Q.name==="thread"&&at.value===$||(z.push({name:"thread",params:{threadId:$}}),me.value&&Vt(!0)))}function pn($){ke($)}function Ut($){var Tt,$t;const te=r.value.find(Ct=>Ct.projectName===$),$e=(($t=(Tt=te==null?void 0:te.threads[0])==null?void 0:Tt.cwd)==null?void 0:$t.trim())??"";$e&&(y.value=$e),me.value&&Vt(!0),!B.value&&z.push({name:"home"})}function yr($){var Tt,$t;const te=r.value.find(Ct=>Ct.projectName===$),$e=(($t=(Tt=te==null?void 0:te.threads[0])==null?void 0:Tt.cwd)==null?void 0:$t.trim())??"";!$e||typeof window>"u"||window.open(`/codex-local-browse${encodeURI($e)}`,"_blank","noopener,noreferrer")}function Qn(){var te,$e;const $=(($e=(te=o.value)==null?void 0:te.cwd)==null?void 0:$e.trim())??"";$&&(y.value=$),me.value&&Vt(!0),!B.value&&z.push({name:"home"})}function wr($){dt($.projectName,$.displayName)}function Xn($){oe($.threadId,$.title)}function Zn($){tt($)}function Hr($){ze($.projectName,$.toIndex)}function br($){fe($.threadId,$.state)}function Ur($){Ze($)}function _r(){Ee()}function Vt($){j.value!==$&&(j.value=$,Bn($))}function mn($){$.defaultPrevented||!$.ctrlKey&&!$.metaKey||$.shiftKey||$.altKey||$.key.toLowerCase()==="b"&&($.preventDefault(),Vt(!j.value))}function er($){const te=$.text;if(B.value){ks(te,$.imageUrls,$.skills,$.fileAttachments);return}ee(te,$.imageUrls,$.skills,$.mode,$.fileAttachments)}function jn($){y.value=$.trim()}async function Vr($){const te=$.trim();if(!te)return;const $e=Wr(te),Tt=await kr(),$t=$e?te:Kr(Tt,te);if($t)try{const Ct=await cy($t,{createIfMissing:!$e,label:$e?"":te});Ct&&(y.value=Ct,pe(vn(Ct)),gn(),Dn())}catch{}}async function kr(){const $=tr();if($)return $;try{const te=await rl();if(te)return ge.value=te,te}catch{}return""}function Wr($){return $?$.startsWith("~/")||$.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test($):!1}async function Dn(){const $=tr();if(!$){ie.value="New Project (1)";return}try{const te=await uy($);ie.value=te.name||"New Project (1)"}catch{ie.value="New Project (1)"}}function tr(){var $e,Tt;const $=y.value.trim();if($)return Tr($);const te=((Tt=($e=_e.value[0])==null?void 0:$e.value)==null?void 0:Tt.trim())??"";return te?Tr(te):ge.value.trim()}async function qr(){try{ge.value=await rl()}catch{ge.value=""}}async function gn(){try{const $=await ni();L.value={order:[...$.order],labels:{...$.labels}}}catch{L.value={order:[],labels:{}}}}function Tr($){const te=$.trim().replace(/\/+$/,"");if(!te)return"";const $e=te.lastIndexOf("/");return $e<=0?"":te.slice(0,$e)}function vn($){const te=$.trim().replace(/\/+$/,"");if(!te)return"";const $e=te.lastIndexOf("/");return $e<0?te:te.slice($e+1)}function Kr($,te){const $e=$.trim().replace(/\/+$/,""),Tt=te.trim().replace(/^\/+/,"");return!$e||!Tt?"":`${$e}/${Tt}`}function Ln($){Oe($)}function Sr($){vt($)}function k(){ne()}function C($){Fe($.turnIndex)}function R($,te){if(typeof window>"u")return te;const $e=window.localStorage.getItem($);return $e===null?te:$e==="1"}function q(){if(typeof window>"u")return"system";const $=window.localStorage.getItem(ml);return $==="light"||$==="dark"?$:"system"}function Le(){return typeof window>"u"?"queue":window.localStorage.getItem(pl)==="steer"?"steer":"queue"}function bt(){Ne.value=!Ne.value,window.localStorage.setItem(hl,Ne.value?"1":"0")}function Wt(){We.value=We.value==="steer"?"queue":"steer",window.localStorage.setItem(pl,We.value)}function xr(){const $=["system","light","dark"],te=$.indexOf(Ae.value);Ae.value=$[(te+1)%$.length],window.localStorage.setItem(ml,Ae.value),yn()}function yn(){const $=document.documentElement;if(Ae.value==="dark")$.classList.add("dark");else if(Ae.value==="light")$.classList.remove("dark");else{const te=window.matchMedia("(prefers-color-scheme: dark)").matches;$.classList.toggle("dark",te)}}function Yt(){return typeof window>"u"?!1:window.localStorage.getItem(fl)==="1"}function Bn($){typeof window>"u"||window.localStorage.setItem(fl,$?"1":"0")}function nr($,te){const $e=($??"").trim();return $e.length>0?$e:te.trim()||"message"}async function Gr(){await D(),g.value=!0,await rr(),Te()}async function rr(){if(!De.value){De.value=!0;try{if(Q.name==="home"||Q.name==="skills"){d.value!==""&&await ue("");return}if(Q.name==="thread"){const $=at.value;if(!$)return;if(!Je.value.has($)){await z.replace({name:"home"});return}d.value!==$&&await ue($);return}}finally{De.value=!1}}}ct(()=>[Q.name,at.value,E.value,Je.value.has(at.value),d.value],async()=>{g.value&&await rr()}),ct(()=>d.value,async $=>{if(g.value&&!De.value&&!(B.value||V.value)){if(!$){Q.name!=="home"&&await z.replace({name:"home"});return}Q.name==="thread"&&at.value===$||await z.replace({name:"thread",params:{threadId:$}})}}),ct(()=>_e.value,$=>{if($.length===0){y.value="";return}$.some($e=>$e.value===y.value)||(y.value=$[0].value),Dn()},{immediate:!0}),ct(()=>y.value,()=>{F.value={phase:"idle",title:"",message:""},Dn()}),ct(()=>x.value,$=>{$==="local"&&(F.value={phase:"idle",title:"",message:""})}),ct(()=>Q.name,$=>{$!=="home"&&(F.value={phase:"idle",title:"",message:""})}),ct(()=>d.value,()=>{F.value={phase:"idle",title:"",message:""}}),ct(me,$=>{$&&!j.value&&Vt(!0)});async function ks($,te=[],$e=[],Tt=[]){try{F.value={phase:"idle",title:"",message:""};let $t=y.value;if(x.value==="worktree"){F.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const Et=await ay(y.value);$t=Et.cwd,y.value=Et.cwd,F.value={phase:"idle",title:"",message:""}}catch{F.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Ct=await ye($,$t,te,$e,Tt);if(!Ct)return;await z.replace({name:"thread",params:{threadId:Ct}})}catch{}}return($,te)=>(w(),S(He,null,[Ce(ep,{"is-sidebar-collapsed":j.value,onCloseSidebar:te[6]||(te[6]=$e=>Vt(!0))},{sidebar:lt(()=>[p("section",F0,[p("div",H0,[j.value?le("",!0):(w(),ht(il,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":j.value,"is-auto-refresh-enabled":je(O),"auto-refresh-button-label":Ge.value,"show-new-thread-button":!0,onToggleSidebar:te[0]||(te[0]=$e=>Vt(!j.value)),onToggleAutoRefresh:_r,onStartNewThread:Qn},{default:lt(()=>[p("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":re.value,"aria-label":"Search threads",title:"Search threads",onClick:ft},[Ce(si,{class:"sidebar-search-toggle-icon"})],8,U0)]),_:1},8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])),!j.value&&re.value?(w(),S("div",V0,[Ce(si,{class:"sidebar-search-bar-icon"}),$n(p("input",{ref_key:"sidebarSearchInputRef",ref:Z,"onUpdate:modelValue":te[1]||(te[1]=$e=>X.value=$e),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Pe},null,544),[[Mn,X.value]]),X.value.length>0?(w(),S("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:pt},[Ce(Ri,{class:"sidebar-search-clear-icon"})])):le("",!0)])):le("",!0),j.value?le("",!0):(w(),S("button",{key:2,class:ut(["sidebar-skills-link",{"is-active":V.value}]),type:"button",onClick:te[2]||(te[2]=$e=>{je(z).push({name:"skills"}),je(me)&&Vt(!0)})}," Skills Hub ",2)),j.value?le("",!0):(w(),ht(Fm,{key:3,groups:je(r),"project-display-name-by-id":je(s),"selected-thread-id":je(d),"is-loading":je(E),"search-query":X.value,"search-matched-thread-ids":W.value,onSelect:Me,onArchive:pn,onStartNewThread:Ut,onRenameProject:wr,onBrowseProjectFiles:yr,onRenameThread:Xn,onRemoveProject:Zn,onReorderProject:Hr},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),j.value?le("",!0):(w(),S("div",W0,[Ce($c,{name:"settings-panel"},{default:lt(()=>[Se.value?(w(),S("div",q0,[p("button",{class:"sidebar-settings-row",type:"button",onClick:bt},[te[7]||(te[7]=p("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),p("span",{class:ut(["sidebar-settings-toggle",{"is-on":!Ne.value}])},null,2)]),p("button",{class:"sidebar-settings-row",type:"button",onClick:Wt},[te[8]||(te[8]=p("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),p("span",K0,de(We.value==="steer"?"Steer":"Queue"),1)]),p("button",{class:"sidebar-settings-row",type:"button",onClick:xr},[te[9]||(te[9]=p("span",{class:"sidebar-settings-label"},"Appearance",-1)),p("span",G0,de(Ae.value==="system"?"System":Ae.value==="dark"?"Dark":"Light"),1)])])):le("",!0)]),_:1}),p("button",{class:"sidebar-settings-button",type:"button",onClick:te[3]||(te[3]=$e=>Se.value=!Se.value)},[Ce(p0,{class:"sidebar-settings-icon"}),te[10]||(te[10]=p("span",null,"Settings",-1))])]))])]),content:lt(()=>[p("section",z0,[Ce(Km,{title:J.value},{leading:lt(()=>[j.value||je(me)?(w(),ht(il,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":j.value,"is-auto-refresh-enabled":je(O),"auto-refresh-button-label":Ge.value,"show-new-thread-button":!0,onToggleSidebar:te[4]||(te[4]=$e=>Vt(!j.value)),onToggleAutoRefresh:_r,onStartNewThread:Qn},null,8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])):le("",!0)]),_:1},8,["title"]),p("section",Y0,[V.value?(w(),ht(zb,{key:0,onSkillsChanged:Qe})):B.value?(w(),S("div",J0,[p("div",Q0,[te[11]||(te[11]=p("p",{class:"new-thread-hero"},"Let's build",-1)),Ce(ri,{class:"new-thread-folder-dropdown","model-value":y.value,options:_e.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":ie.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":jn,onAdd:Vr},null,8,["model-value","options","default-add-value"]),Ce(Xw,{class:"new-thread-runtime-dropdown",modelValue:x.value,"onUpdate:modelValue":te[5]||(te[5]=$e=>x.value=$e)},null,8,["modelValue"]),F.value.phase!=="idle"?(w(),S("div",{key:0,class:ut(["worktree-init-status",{"is-running":F.value.phase==="running","is-error":F.value.phase==="error"}])},[p("strong",X0,de(F.value.title),1),p("span",Z0,de(F.value.message),1)],2)):le("",!0)]),Ce(sl,{"active-thread-id":M.value,cwd:se.value,models:je(u),"selected-model":je(f),"selected-reasoning-effort":je(m),skills:je(_),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":Ne.value,"in-progress-submit-mode":We.value,onSubmit:er,"onUpdate:selectedModel":Ln,"onUpdate:selectedReasoningEffort":Sr},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(w(),S("div",e_,[p("div",t_,[Ce(kv,{messages:b.value,"is-loading":je(H),"active-thread-id":M.value,"scroll-state":je(i),"live-overlay":A.value,"pending-requests":je(a),"is-turn-in-progress":xe.value,"is-rolling-back":je(Ue),onUpdateScrollState:br,onRespondServerRequest:Ur,onRollback:C},null,8,["messages","is-loading","active-thread-id","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),p("div",n_,[Ce(Ww,{messages:je(Ke),onSteer:je(be),onDelete:je(Ie)},null,8,["messages","onSteer","onDelete"]),Ce(sl,{"active-thread-id":M.value,cwd:se.value,models:je(u),"selected-model":je(f),"selected-reasoning-effort":je(m),skills:je(_),"is-turn-in-progress":xe.value,"is-interrupting-turn":je(Y),"has-queue-above":je(Ke).length>0,"send-with-enter":Ne.value,"in-progress-submit-mode":We.value,onSubmit:er,"onUpdate:selectedModel":Ln,"onUpdate:selectedReasoningEffort":Sr,onInterrupt:k},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),p("div",r_," WT "+de(je(t))+" · v"+de(je(n)),1)],64))}}),o_=Xe(s_,[["__scopeId","data-v-43d7d971"]]),jo={render:()=>null},i_=Kh({history:Sh(),routes:[{path:"/",name:"home",component:jo},{path:"/thread/:threadId",name:"thread",component:jo},{path:"/skills",name:"skills",component:jo},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Df(o_).use(i_).mount("#app");