codexapp 0.1.15 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.29
3
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
- * @license MIT
5
- **/function Ho(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const it={},mr=[],on=()=>{},Ga=()=>!1,As=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Uo=e=>e.startsWith("onUpdate:"),bt=Object.assign,Vo=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Vc=Object.prototype.hasOwnProperty,Qe=(e,t)=>Vc.call(e,t),Ne=Array.isArray,gr=e=>Xr(e)==="[object Map]",za=e=>Xr(e)==="[object Set]",wi=e=>Xr(e)==="[object Date]",De=e=>typeof e=="function",mt=e=>typeof e=="string",zt=e=>typeof e=="symbol",Xe=e=>e!==null&&typeof e=="object",Ya=e=>(Xe(e)||De(e))&&De(e.then)&&De(e.catch),Ja=Object.prototype.toString,Xr=e=>Ja.call(e),qc=e=>Xr(e).slice(8,-1),Qa=e=>Xr(e)==="[object Object]",qo=e=>mt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Or=Ho(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Cs=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Wc=/-\w/g,Vt=Cs(e=>e.replace(Wc,t=>t.slice(1).toUpperCase())),Kc=/\B([A-Z])/g,jn=Cs(e=>e.replace(Kc,"-$1").toLowerCase()),Es=Cs(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ks=Cs(e=>e?`on${Es(e)}`:""),Mn=(e,t)=>!Object.is(e,t),fs=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Xa=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Wo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Gc=e=>{const t=mt(e)?Number(e):NaN;return isNaN(t)?e:t};let bi;const Is=()=>bi||(bi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function rr(e){if(Ne(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=mt(r)?Qc(r):rr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(mt(e)||Xe(e))return e}const zc=/;(?![^(]*\))/g,Yc=/:([^]+)/,Jc=/\/\*[^]*?\*\//g;function Qc(e){const t={};return e.replace(Jc,"").split(zc).forEach(n=>{if(n){const r=n.split(Yc);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function lt(e){let t="";if(mt(e))t=e;else if(Ne(e))for(let n=0;n<e.length;n++){const r=lt(e[n]);r&&(t+=r+" ")}else if(Xe(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Xc="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Zc=Ho(Xc);function Za(e){return!!e||e===""}function eu(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Ko(e[r],t[r]);return n}function Ko(e,t){if(e===t)return!0;let n=wi(e),r=wi(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=zt(e),r=zt(t),n||r)return e===t;if(n=Ne(e),r=Ne(t),n||r)return n&&r?eu(e,t):!1;if(n=Xe(e),r=Xe(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||!Ko(e[i],t[i]))return!1}}return String(e)===String(t)}const el=e=>!!(e&&e.__v_isRef===!0),we=e=>mt(e)?e:e==null?"":Ne(e)||Xe(e)&&(e.toString===Ja||!De(e.toString))?el(e)?we(e.value):JSON.stringify(e,tl,2):String(e),tl=(e,t)=>el(t)?tl(e,t.value):gr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[Gs(r,o)+" =>"]=s,n),{})}:za(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Gs(n))}:zt(t)?Gs(t):Xe(t)&&!Ne(t)&&!Qa(t)?String(t):t,Gs=(e,t="")=>{var n;return zt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
- * @vue/reactivity v3.5.29
7
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
- * @license MIT
9
- **/let Ot;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=Ot,!t&&Ot&&(this.index=(Ot.scopes||(Ot.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=Ot;try{return Ot=this,t()}finally{Ot=n}}}on(){++this._on===1&&(this.prevScope=Ot,Ot=this)}off(){this._on>0&&--this._on===0&&(Ot=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 nu(){return Ot}let at;const zs=new WeakSet;class nl{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,Ot&&Ot.active&&Ot.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,zs.has(this)&&(zs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||sl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,_i(this),ol(this);const t=at,n=Kt;at=this,Kt=!0;try{return this.fn()}finally{il(this),at=t,Kt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Yo(t);this.deps=this.depsTail=void 0,_i(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?zs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){yo(this)&&this.run()}get dirty(){return yo(this)}}let rl=0,jr,Lr;function sl(e,t=!1){if(e.flags|=8,t){e.next=Lr,Lr=e;return}e.next=jr,jr=e}function Go(){rl++}function zo(){if(--rl>0)return;if(Lr){let t=Lr;for(Lr=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;jr;){let t=jr;for(jr=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function ol(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),Yo(r),ru(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function yo(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(al(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function al(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Vr)||(e.globalVersion=Vr,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!yo(e))))return;e.flags|=2;const t=e.dep,n=at,r=Kt;at=e,Kt=!0;try{ol(e);const s=e.fn(e._value);(t.version===0||Mn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{at=n,Kt=r,il(e),e.flags&=-3}}function Yo(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)Yo(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ru(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Kt=!0;const ll=[];function wn(){ll.push(Kt),Kt=!1}function bn(){const e=ll.pop();Kt=e===void 0?!0:e}function _i(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=at;at=void 0;try{t()}finally{at=n}}}let Vr=0;class su{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 Jo{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(!at||!Kt||at===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==at)n=this.activeLink=new su(at,this),at.deps?(n.prevDep=at.depsTail,at.depsTail.nextDep=n,at.depsTail=n):at.deps=at.depsTail=n,cl(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=at.depsTail,n.nextDep=void 0,at.depsTail.nextDep=n,at.depsTail=n,at.deps===n&&(at.deps=r)}return n}trigger(t){this.version++,Vr++,this.notify(t)}notify(t){Go();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{zo()}}}function cl(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)cl(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const wo=new WeakMap,tr=Symbol(""),bo=Symbol(""),qr=Symbol("");function At(e,t,n){if(Kt&&at){let r=wo.get(e);r||wo.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new Jo),s.map=r,s.key=n),s.track()}}function gn(e,t,n,r,s,o){const i=wo.get(e);if(!i){Vr++;return}const a=l=>{l&&l.trigger()};if(Go(),t==="clear")i.forEach(a);else{const l=Ne(e),d=l&&qo(n);if(l&&n==="length"){const c=Number(r);i.forEach((f,m)=>{(m==="length"||m===qr||!zt(m)&&m>=c)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(qr)),t){case"add":l?d&&a(i.get("length")):(a(i.get(tr)),gr(e)&&a(i.get(bo)));break;case"delete":l||(a(i.get(tr)),gr(e)&&a(i.get(bo)));break;case"set":gr(e)&&a(i.get(tr));break}}zo()}function ur(e){const t=ze(e);return t===e?t:(At(t,"iterate",qr),Ut(e)?t:t.map(Yt))}function Rs(e){return At(e=ze(e),"iterate",qr),e}function En(e,t){return _n(e)?br(nr(e)?Yt(t):t):Yt(t)}const ou={__proto__:null,[Symbol.iterator](){return Ys(this,Symbol.iterator,e=>En(this,e))},concat(...e){return ur(this).concat(...e.map(t=>Ne(t)?ur(t):t))},entries(){return Ys(this,"entries",e=>(e[1]=En(this,e[1]),e))},every(e,t){return dn(this,"every",e,t,void 0,arguments)},filter(e,t){return dn(this,"filter",e,t,n=>n.map(r=>En(this,r)),arguments)},find(e,t){return dn(this,"find",e,t,n=>En(this,n),arguments)},findIndex(e,t){return dn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return dn(this,"findLast",e,t,n=>En(this,n),arguments)},findLastIndex(e,t){return dn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return dn(this,"forEach",e,t,void 0,arguments)},includes(...e){return Js(this,"includes",e)},indexOf(...e){return Js(this,"indexOf",e)},join(e){return ur(this).join(e)},lastIndexOf(...e){return Js(this,"lastIndexOf",e)},map(e,t){return dn(this,"map",e,t,void 0,arguments)},pop(){return Er(this,"pop")},push(...e){return Er(this,"push",e)},reduce(e,...t){return ki(this,"reduce",e,t)},reduceRight(e,...t){return ki(this,"reduceRight",e,t)},shift(){return Er(this,"shift")},some(e,t){return dn(this,"some",e,t,void 0,arguments)},splice(...e){return Er(this,"splice",e)},toReversed(){return ur(this).toReversed()},toSorted(e){return ur(this).toSorted(e)},toSpliced(...e){return ur(this).toSpliced(...e)},unshift(...e){return Er(this,"unshift",e)},values(){return Ys(this,"values",e=>En(this,e))}};function Ys(e,t,n){const r=Rs(e),s=r[t]();return r!==e&&!Ut(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const iu=Array.prototype;function dn(e,t,n,r,s,o){const i=Rs(e),a=i!==e&&!Ut(e),l=i[t];if(l!==iu[t]){const f=l.apply(e,o);return a?Yt(f):f}let d=n;i!==e&&(a?d=function(f,m){return n.call(this,En(e,f),m,e)}:n.length>2&&(d=function(f,m){return n.call(this,f,m,e)}));const c=l.call(i,d,r);return a&&s?s(c):c}function ki(e,t,n,r){const s=Rs(e);let o=n;return s!==e&&(Ut(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,En(e,a),l,e)}),s[t](o,...r)}function Js(e,t,n){const r=ze(e);At(r,"iterate",qr);const s=r[t](...n);return(s===-1||s===!1)&&Zo(n[0])?(n[0]=ze(n[0]),r[t](...n)):s}function Er(e,t,n=[]){wn(),Go();const r=ze(e)[t].apply(e,n);return zo(),bn(),r}const au=Ho("__proto__,__v_isRef,__isVue"),ul=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(zt));function lu(e){zt(e)||(e=String(e));const t=ze(this);return At(t,"has",e),t.hasOwnProperty(e)}class dl{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?yu:ml:o?pl:hl).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Ne(t);if(!s){let l;if(i&&(l=ou[n]))return l;if(n==="hasOwnProperty")return lu}const a=Reflect.get(t,n,It(t)?t:r);if((zt(n)?ul.has(n):au(n))||(s||At(t,"get",n),o))return a;if(It(a)){const l=i&&qo(n)?a:a.value;return s&&Xe(l)?ko(l):l}return Xe(a)?s?ko(a):$s(a):a}}class fl extends dl{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Ne(t)&&qo(n);if(!this._isShallow){const d=_n(o);if(!Ut(r)&&!_n(r)&&(o=ze(o),r=ze(r)),!i&&It(o)&&!It(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:Qe(t,n),l=Reflect.set(t,n,r,It(t)?t:s);return t===ze(s)&&(a?Mn(r,o)&&gn(t,"set",n,r):gn(t,"add",n,r)),l}deleteProperty(t,n){const r=Qe(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&gn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!zt(n)||!ul.has(n))&&At(t,"has",n),r}ownKeys(t){return At(t,"iterate",Ne(t)?"length":tr),Reflect.ownKeys(t)}}class cu extends dl{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const uu=new fl,du=new cu,fu=new fl(!0);const _o=e=>e,os=e=>Reflect.getPrototypeOf(e);function hu(e,t,n){return function(...r){const s=this.__v_raw,o=ze(s),i=gr(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),c=n?_o:t?br:Yt;return!t&&At(o,"iterate",l?bo:tr),bt(Object.create(d),{next(){const{value:f,done:m}=d.next();return m?{value:f,done:m}:{value:a?[c(f[0]),c(f[1])]:c(f),done:m}}})}}function is(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function pu(e,t){const n={get(s){const o=this.__v_raw,i=ze(o),a=ze(s);e||(Mn(s,a)&&At(i,"get",s),At(i,"get",a));const{has:l}=os(i),d=t?_o:e?br:Yt;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&&At(ze(s),"iterate",tr),s.size},has(s){const o=this.__v_raw,i=ze(o),a=ze(s);return e||(Mn(s,a)&&At(i,"has",s),At(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=ze(a),d=t?_o:e?br:Yt;return!e&&At(l,"iterate",tr),a.forEach((c,f)=>s.call(o,d(c),d(f),i))}};return bt(n,e?{add:is("add"),set:is("set"),delete:is("delete"),clear:is("clear")}:{add(s){!t&&!Ut(s)&&!_n(s)&&(s=ze(s));const o=ze(this);return os(o).has.call(o,s)||(o.add(s),gn(o,"add",s,s)),this},set(s,o){!t&&!Ut(o)&&!_n(o)&&(o=ze(o));const i=ze(this),{has:a,get:l}=os(i);let d=a.call(i,s);d||(s=ze(s),d=a.call(i,s));const c=l.call(i,s);return i.set(s,o),d?Mn(o,c)&&gn(i,"set",s,o):gn(i,"add",s,o),this},delete(s){const o=ze(this),{has:i,get:a}=os(o);let l=i.call(o,s);l||(s=ze(s),l=i.call(o,s)),a&&a.call(o,s);const d=o.delete(s);return l&&gn(o,"delete",s,void 0),d},clear(){const s=ze(this),o=s.size!==0,i=s.clear();return o&&gn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=hu(s,e,t)}),n}function Qo(e,t){const n=pu(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(Qe(n,s)&&s in r?n:r,s,o)}const mu={get:Qo(!1,!1)},gu={get:Qo(!1,!0)},vu={get:Qo(!0,!1)};const hl=new WeakMap,pl=new WeakMap,ml=new WeakMap,yu=new WeakMap;function wu(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function bu(e){return e.__v_skip||!Object.isExtensible(e)?0:wu(qc(e))}function $s(e){return _n(e)?e:Xo(e,!1,uu,mu,hl)}function gl(e){return Xo(e,!1,fu,gu,pl)}function ko(e){return Xo(e,!0,du,vu,ml)}function Xo(e,t,n,r,s){if(!Xe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=bu(e);if(o===0)return e;const i=s.get(e);if(i)return i;const a=new Proxy(e,o===2?r:n);return s.set(e,a),a}function nr(e){return _n(e)?nr(e.__v_raw):!!(e&&e.__v_isReactive)}function _n(e){return!!(e&&e.__v_isReadonly)}function Ut(e){return!!(e&&e.__v_isShallow)}function Zo(e){return e?!!e.__v_raw:!1}function ze(e){const t=e&&e.__v_raw;return t?ze(t):e}function _u(e){return!Qe(e,"__v_skip")&&Object.isExtensible(e)&&Xa(e,"__v_skip",!0),e}const Yt=e=>Xe(e)?$s(e):e,br=e=>Xe(e)?ko(e):e;function It(e){return e?e.__v_isRef===!0:!1}function B(e){return vl(e,!1)}function ku(e){return vl(e,!0)}function vl(e,t){return It(e)?e:new Tu(e,t)}class Tu{constructor(t,n){this.dep=new Jo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ze(t),this._value=n?t:Yt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Ut(t)||_n(t);t=r?t:ze(t),Mn(t,n)&&(this._rawValue=t,this._value=r?t:Yt(t),this.dep.trigger())}}function $e(e){return It(e)?e.value:e}const Su={get:(e,t,n)=>t==="__v_raw"?e:$e(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return It(s)&&!It(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function yl(e){return nr(e)?e:new Proxy(e,Su)}class xu{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Jo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Vr-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&at!==this)return sl(this,!0),!0}get value(){const t=this.dep.track();return al(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Au(e,t,n=!1){let r,s;return De(e)?r=e:(r=e.get,s=e.set),new xu(r,s,n)}const as={},vs=new WeakMap;let Qn;function Cu(e,t=!1,n=Qn){if(n){let r=vs.get(n);r||vs.set(n,r=[]),r.push(e)}}function Eu(e,t,n=it){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=U=>s?U:Ut(U)||s===!1||s===0?vn(U,1):vn(U);let c,f,m,_,P=!1,I=!1;if(It(e)?(f=()=>e.value,P=Ut(e)):nr(e)?(f=()=>d(e),P=!0):Ne(e)?(I=!0,P=e.some(U=>nr(U)||Ut(U)),f=()=>e.map(U=>{if(It(U))return U.value;if(nr(U))return d(U);if(De(U))return l?l(U,2):U()})):De(e)?t?f=l?()=>l(e,2):e:f=()=>{if(m){wn();try{m()}finally{bn()}}const U=Qn;Qn=c;try{return l?l(e,3,[_]):e(_)}finally{Qn=U}}:f=on,t&&s){const U=f,ie=s===!0?1/0:s;f=()=>vn(U(),ie)}const F=nu(),q=()=>{c.stop(),F&&F.active&&Vo(F.effects,c)};if(o&&t){const U=t;t=(...ie)=>{U(...ie),q()}}let $=I?new Array(e.length).fill(as):as;const V=U=>{if(!(!(c.flags&1)||!c.dirty&&!U))if(t){const ie=c.run();if(s||P||(I?ie.some((ae,oe)=>Mn(ae,$[oe])):Mn(ie,$))){m&&m();const ae=Qn;Qn=c;try{const oe=[ie,$===as?void 0:I&&$[0]===as?[]:$,_];$=ie,l?l(t,3,oe):t(...oe)}finally{Qn=ae}}}else c.run()};return a&&a(V),c=new nl(f),c.scheduler=i?()=>i(V,!1):V,_=U=>Cu(U,!1,c),m=c.onStop=()=>{const U=vs.get(c);if(U){if(l)l(U,4);else for(const ie of U)ie();vs.delete(c)}},t?r?V(!0):$=c.run():i?i(V.bind(null,!0),!0):c.run(),q.pause=c.pause.bind(c),q.resume=c.resume.bind(c),q.stop=q,q}function vn(e,t=1/0,n){if(t<=0||!Xe(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,It(e))vn(e.value,t,n);else if(Ne(e))for(let r=0;r<e.length;r++)vn(e[r],t,n);else if(za(e)||gr(e))e.forEach(r=>{vn(r,t,n)});else if(Qa(e)){for(const r in e)vn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&vn(e[r],t,n)}return e}/**
10
- * @vue/runtime-core v3.5.29
11
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
- * @license MIT
13
- **/function Zr(e,t,n,r){try{return r?e(...r):e()}catch(s){Ms(s,t,n)}}function Jt(e,t,n,r){if(De(e)){const s=Zr(e,t,n,r);return s&&Ya(s)&&s.catch(o=>{Ms(o,t,n)}),s}if(Ne(e)){const s=[];for(let o=0;o<e.length;o++)s.push(Jt(e[o],t,n,r));return s}}function Ms(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||it;if(t){let a=t.parent;const l=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](e,l,d)===!1)return}a=a.parent}if(o){wn(),Zr(o,null,10,[e,l,d]),bn();return}}Iu(e,n,s,r,i)}function Iu(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Pt=[];let tn=-1;const vr=[];let In=null,fr=0;const wl=Promise.resolve();let ys=null;function Ft(e){const t=ys||wl;return e?t.then(this?e.bind(this):e):t}function Ru(e){let t=tn+1,n=Pt.length;for(;t<n;){const r=t+n>>>1,s=Pt[r],o=Wr(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function ei(e){if(!(e.flags&1)){const t=Wr(e),n=Pt[Pt.length-1];!n||!(e.flags&2)&&t>=Wr(n)?Pt.push(e):Pt.splice(Ru(t),0,e),e.flags|=1,bl()}}function bl(){ys||(ys=wl.then(kl))}function $u(e){Ne(e)?vr.push(...e):In&&e.id===-1?In.splice(fr+1,0,e):e.flags&1||(vr.push(e),e.flags|=1),bl()}function Ti(e,t,n=tn+1){for(;n<Pt.length;n++){const r=Pt[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Pt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function _l(e){if(vr.length){const t=[...new Set(vr)].sort((n,r)=>Wr(n)-Wr(r));if(vr.length=0,In){In.push(...t);return}for(In=t,fr=0;fr<In.length;fr++){const n=In[fr];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}In=null,fr=0}}const Wr=e=>e.id==null?e.flags&2?-1:1/0:e.id;function kl(e){try{for(tn=0;tn<Pt.length;tn++){const t=Pt[tn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Zr(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;tn<Pt.length;tn++){const t=Pt[tn];t&&(t.flags&=-2)}tn=-1,Pt.length=0,_l(),ys=null,(Pt.length||vr.length)&&kl()}}let _t=null,Tl=null;function ws(e){const t=_t;return _t=e,Tl=e&&e.type.__scopeId||null,t}function nt(e,t=_t,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&ks(-1);const o=ws(t);let i;try{i=e(...s)}finally{ws(o),r._d&&ks(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Pn(e,t){if(_t===null)return e;const n=Ds(_t),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=it]=t[s];o&&(De(o)&&(o={mounted:o,updated:o}),o.deep&&vn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Kn(e,t,n,r){const s=e.dirs,o=t&&t.dirs;for(let i=0;i<s.length;i++){const a=s[i];o&&(a.oldValue=o[i].value);let l=a.dir[r];l&&(wn(),Jt(l,n,8,[e.el,a,e,t]),bn())}}function hs(e,t){if(Et){let n=Et.provides;const r=Et.parent&&Et.parent.provides;r===n&&(n=Et.provides=Object.create(r)),n[e]=t}}function Gt(e,t,n=!1){const r=oi();if(r||wr){let s=wr?wr._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&De(t)?t.call(r&&r.proxy):t}}const Mu=Symbol.for("v-scx"),Pu=()=>Gt(Mu);function ct(e,t,n){return Sl(e,t,n)}function Sl(e,t,n=it){const{immediate:r,deep:s,flush:o,once:i}=n,a=bt({},n),l=t&&r||!t&&o!=="post";let d;if(Yr){if(o==="sync"){const _=Pu();d=_.__watcherHandles||(_.__watcherHandles=[])}else if(!l){const _=()=>{};return _.stop=on,_.resume=on,_.pause=on,_}}const c=Et;a.call=(_,P,I)=>Jt(_,c,P,I);let f=!1;o==="post"?a.scheduler=_=>{xt(_,c&&c.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(_,P)=>{P?_():ei(_)}),a.augmentJob=_=>{t&&(_.flags|=4),f&&(_.flags|=2,c&&(_.id=c.uid,_.i=c))};const m=Eu(e,t,a);return Yr&&(d?d.push(m):l&&m()),m}function Nu(e,t,n){const r=this.proxy,s=mt(e)?e.includes(".")?xl(r,e):()=>r[e]:e.bind(r,r);let o;De(t)?o=t:(o=t.handler,n=t);const i=es(this),a=Sl(s,o.bind(r),n);return i(),a}function xl(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 Al=Symbol("_vte"),Cl=e=>e.__isTeleport,Dr=e=>e&&(e.disabled||e.disabled===""),Si=e=>e&&(e.defer||e.defer===""),xi=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Ai=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,To=(e,t)=>{const n=e&&e.to;return mt(n)?t?t(n):null:n},El={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,d){const{mc:c,pc:f,pbc:m,o:{insert:_,querySelector:P,createText:I,createComment:F}}=d,q=Dr(t.props);let{shapeFlag:$,children:V,dynamicChildren:U}=t;if(e==null){const ie=t.el=I(""),ae=t.anchor=I("");_(ie,n,r),_(ae,n,r);const oe=(te,Z)=>{$&16&&c(V,te,Z,s,o,i,a,l)},ue=()=>{const te=t.target=To(t.props,P),Z=So(te,t,I,_);te&&(i!=="svg"&&xi(te)?i="svg":i!=="mathml"&&Ai(te)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(te),q||(oe(te,Z),ps(t,!1)))};q&&(oe(n,ae),ps(t,!0)),Si(t.props)?(t.el.__isMounted=!1,xt(()=>{ue(),delete t.el.__isMounted},o)):ue()}else{if(Si(t.props)&&e.el.__isMounted===!1){xt(()=>{El.process(e,t,n,r,s,o,i,a,l,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const ie=t.anchor=e.anchor,ae=t.target=e.target,oe=t.targetAnchor=e.targetAnchor,ue=Dr(e.props),te=ue?n:ae,Z=ue?ie:oe;if(i==="svg"||xi(ae)?i="svg":(i==="mathml"||Ai(ae))&&(i="mathml"),U?(m(e.dynamicChildren,U,te,s,o,i,a),ri(e,t,!0)):l||f(e,t,te,Z,s,o,i,a,!1),q)ue?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ls(t,n,ie,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const pe=t.target=To(t.props,P);pe&&ls(t,pe,null,d,0)}else ue&&ls(t,ae,oe,d,1);ps(t,q)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:d,targetAnchor:c,target:f,props:m}=e;if(f&&(s(d),s(c)),o&&s(l),i&16){const _=o||!Dr(m);for(let P=0;P<a.length;P++){const I=a[P];r(I,t,n,_,!!I.dynamicChildren)}}},move:ls,hydrate:Ou};function ls(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:c}=e,f=o===2;if(f&&r(i,t,n),(!f||Dr(c))&&l&16)for(let m=0;m<d.length;m++)s(d[m],t,n,2);f&&r(a,t,n)}function Ou(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:c}},f){function m(F,q){let $=q;for(;$;){if($&&$.nodeType===8){if($.data==="teleport start anchor")t.targetStart=$;else if($.data==="teleport anchor"){t.targetAnchor=$,F._lpa=t.targetAnchor&&i(t.targetAnchor);break}}$=i($)}}function _(F,q){q.anchor=f(i(F),q,a(F),n,r,s,o)}const P=t.target=To(t.props,l),I=Dr(t.props);if(P){const F=P._lpa||P.firstChild;t.shapeFlag&16&&(I?(_(e,t),m(P,F),t.targetAnchor||So(P,t,c,d,a(e)===P?e:null)):(t.anchor=i(e),m(P,F),t.targetAnchor||So(P,t,c,d),f(F&&i(F),t,P,n,r,s,o))),ps(t,I)}else I&&t.shapeFlag&16&&(_(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Il=El;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 So(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Al]=i,e&&(r(o,e,s),r(i,e,s)),i}const nn=Symbol("_leaveCb"),Ir=Symbol("_enterCb");function ju(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ln(()=>{e.isMounted=!0}),Dn(()=>{e.isUnmounting=!0}),e}const Ht=[Function,Array],Rl={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ht,onEnter:Ht,onAfterEnter:Ht,onEnterCancelled:Ht,onBeforeLeave:Ht,onLeave:Ht,onAfterLeave:Ht,onLeaveCancelled:Ht,onBeforeAppear:Ht,onAppear:Ht,onAfterAppear:Ht,onAppearCancelled:Ht},$l=e=>{const t=e.subTree;return t.component?$l(t.component):t},Lu={name:"BaseTransition",props:Rl,setup(e,{slots:t}){const n=oi(),r=ju();return()=>{const s=t.default&&Nl(t.default(),!0);if(!s||!s.length)return;const o=Ml(s),i=ze(e),{mode:a}=i;if(r.isLeaving)return Qs(o);const l=Ci(o);if(!l)return Qs(o);let d=xo(l,i,r,n,f=>d=f);l.type!==Ct&&Kr(l,d);let c=n.subTree&&Ci(n.subTree);if(c&&c.type!==Ct&&!Xn(c,l)&&$l(n).type!==Ct){let f=xo(c,i,r,n);if(Kr(c,f),a==="out-in"&&l.type!==Ct)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},Qs(o);a==="in-out"&&l.type!==Ct?f.delayLeave=(m,_,P)=>{const I=Pl(r,c);I[String(c.key)]=c,m[nn]=()=>{_(),m[nn]=void 0,delete d.delayedLeave,c=void 0},d.delayedLeave=()=>{P(),delete d.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function Ml(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ct){t=n;break}}return t}const Du=Lu;function Pl(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 xo(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:m,onLeave:_,onAfterLeave:P,onLeaveCancelled:I,onBeforeAppear:F,onAppear:q,onAfterAppear:$,onAppearCancelled:V}=t,U=String(e.key),ie=Pl(n,e),ae=(te,Z)=>{te&&Jt(te,r,9,Z)},oe=(te,Z)=>{const pe=Z[1];ae(te,Z),Ne(te)?te.every(Q=>Q.length<=1)&&pe():te.length<=1&&pe()},ue={mode:i,persisted:a,beforeEnter(te){let Z=l;if(!n.isMounted)if(o)Z=F||l;else return;te[nn]&&te[nn](!0);const pe=ie[U];pe&&Xn(e,pe)&&pe.el[nn]&&pe.el[nn](),ae(Z,[te])},enter(te){if(ie[U]===e)return;let Z=d,pe=c,Q=f;if(!n.isMounted)if(o)Z=q||d,pe=$||c,Q=V||f;else return;let Pe=!1;te[Ir]=et=>{Pe||(Pe=!0,et?ae(Q,[te]):ae(pe,[te]),ue.delayedLeave&&ue.delayedLeave(),te[Ir]=void 0)};const We=te[Ir].bind(null,!1);Z?oe(Z,[te,We]):We()},leave(te,Z){const pe=String(e.key);if(te[Ir]&&te[Ir](!0),n.isUnmounting)return Z();ae(m,[te]);let Q=!1;te[nn]=We=>{Q||(Q=!0,Z(),We?ae(I,[te]):ae(P,[te]),te[nn]=void 0,ie[pe]===e&&delete ie[pe])};const Pe=te[nn].bind(null,!1);ie[pe]=e,_?oe(_,[te,Pe]):Pe()},clone(te){const Z=xo(te,t,n,r,s);return s&&s(Z),Z}};return ue}function Qs(e){if(Ps(e))return e=Nn(e),e.children=null,e}function Ci(e){if(!Ps(e))return Cl(e.type)&&e.children?Ml(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&&De(n.default))return n.default()}}function Kr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Kr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Nl(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===Le?(i.patchFlag&128&&s++,r=r.concat(Nl(i.children,t,a))):(t||i.type!==Ct)&&r.push(a!=null?Nn(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function kt(e,t){return De(e)?bt({name:e.name},t,{setup:e}):e}function Ol(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ei(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const bs=new WeakMap;function Br(e,t,n,r,s=!1){if(Ne(e)){e.forEach((I,F)=>Br(I,t&&(Ne(t)?t[F]:t),n,r,s));return}if(yr(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Br(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?Ds(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,c=a.refs===it?a.refs={}:a.refs,f=a.setupState,m=ze(f),_=f===it?Ga:I=>Ei(c,I)?!1:Qe(m,I),P=(I,F)=>!(F&&Ei(c,F));if(d!=null&&d!==l){if(Ii(t),mt(d))c[d]=null,_(d)&&(f[d]=null);else if(It(d)){const I=t;P(d,I.k)&&(d.value=null),I.k&&(c[I.k]=null)}}if(De(l))Zr(l,a,12,[i,c]);else{const I=mt(l),F=It(l);if(I||F){const q=()=>{if(e.f){const $=I?_(l)?f[l]:c[l]:P()||!e.k?l.value:c[e.k];if(s)Ne($)&&Vo($,o);else if(Ne($))$.includes(o)||$.push(o);else if(I)c[l]=[o],_(l)&&(f[l]=c[l]);else{const V=[o];P(l,e.k)&&(l.value=V),e.k&&(c[e.k]=V)}}else I?(c[l]=i,_(l)&&(f[l]=i)):F&&(P(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const $=()=>{q(),bs.delete(e)};$.id=-1,bs.set(e,$),xt($,n)}else Ii(e),q()}}}function Ii(e){const t=bs.get(e);t&&(t.flags|=8,bs.delete(e))}Is().requestIdleCallback;Is().cancelIdleCallback;const yr=e=>!!e.type.__asyncLoader,Ps=e=>e.type.__isKeepAlive;function Bu(e,t){jl(e,"a",t)}function Fu(e,t){jl(e,"da",t)}function jl(e,t,n=Et){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Ns(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Ps(s.parent.vnode)&&Hu(r,t,n,s),s=s.parent}}function Hu(e,t,n,r){const s=Ns(t,e,r,!0);Os(()=>{Vo(r[t],s)},n)}function Ns(e,t,n=Et,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{wn();const a=es(n),l=Jt(t,n,e,i);return a(),bn(),l});return r?s.unshift(o):s.push(o),o}}const kn=e=>(t,n=Et)=>{(!Yr||e==="sp")&&Ns(e,(...r)=>t(...r),n)},Uu=kn("bm"),Ln=kn("m"),Vu=kn("bu"),qu=kn("u"),Dn=kn("bum"),Os=kn("um"),Wu=kn("sp"),Ku=kn("rtg"),Gu=kn("rtc");function zu(e,t=Et){Ns("ec",e,t)}const Yu="components",Ll=Symbol.for("v-ndc");function Ju(e){return mt(e)?Qu(Yu,e,!1)||e:e||Ll}function Qu(e,t,n=!0,r=!1){const s=_t||Et;if(s){const o=s.type;{const a=jd(o,!1);if(a&&(a===t||a===Vt(t)||a===Es(Vt(t))))return o}const i=Ri(s[e]||o[e],t)||Ri(s.appContext[e],t);return!i&&r?o:i}}function Ri(e,t){return e&&(e[t]||e[Vt(t)]||e[Es(Vt(t))])}function pt(e,t,n,r){let s;const o=n,i=Ne(e);if(i||mt(e)){const a=i&&nr(e);let l=!1,d=!1;a&&(l=!Ut(e),d=_n(e),e=Rs(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(l?d?br(Yt(e[c])):Yt(e[c]):e[c],c,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(Xe(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 c=a[l];s[l]=t(e[c],c,l,o)}}else s=[];return s}function sn(e,t,n={},r,s){if(_t.ce||_t.parent&&yr(_t.parent)&&_t.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),k(),ot(Le,null,[Ce("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),k();const i=o&&Dl(o(n)),a=n.key||i&&i.key,l=ot(Le,{key:(a&&!zt(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function Dl(e){return e.some(t=>zr(t)?!(t.type===Ct||t.type===Le&&!Dl(t.children)):!0)?e:null}const Ao=e=>e?sc(e)?Ds(e):Ao(e.parent):null,Fr=bt(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=>Ao(e.parent),$root:e=>Ao(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Fl(e),$forceUpdate:e=>e.f||(e.f=()=>{ei(e.update)}),$nextTick:e=>e.n||(e.n=Ft.bind(e.proxy)),$watch:e=>Nu.bind(e)}),Xs=(e,t)=>e!==it&&!e.__isScriptSetup&&Qe(e,t),Xu={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(Xs(r,t))return i[t]=1,r[t];if(s!==it&&Qe(s,t))return i[t]=2,s[t];if(Qe(o,t))return i[t]=3,o[t];if(n!==it&&Qe(n,t))return i[t]=4,n[t];Co&&(i[t]=0)}}const d=Fr[t];let c,f;if(d)return t==="$attrs"&&At(e.attrs,"get",""),d(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==it&&Qe(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,Qe(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return Xs(s,t)?(s[t]=n,!0):r!==it&&Qe(r,t)?(r[t]=n,!0):Qe(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!==it&&a[0]!=="$"&&Qe(e,a)||Xs(t,a)||Qe(o,a)||Qe(r,a)||Qe(Fr,a)||Qe(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Qe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Zu(){return ed().slots}function ed(e){const t=oi();return t.setupContext||(t.setupContext=ic(t))}function $i(e){return Ne(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Co=!0;function td(e){const t=Fl(e),n=e.proxy,r=e.ctx;Co=!1,t.beforeCreate&&Mi(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:d,created:c,beforeMount:f,mounted:m,beforeUpdate:_,updated:P,activated:I,deactivated:F,beforeDestroy:q,beforeUnmount:$,destroyed:V,unmounted:U,render:ie,renderTracked:ae,renderTriggered:oe,errorCaptured:ue,serverPrefetch:te,expose:Z,inheritAttrs:pe,components:Q,directives:Pe,filters:We}=t;if(d&&nd(d,r,null),i)for(const je in i){const xe=i[je];De(xe)&&(r[je]=xe.bind(n))}if(s){const je=s.call(n,n);Xe(je)&&(e.data=$s(je))}if(Co=!0,o)for(const je in o){const xe=o[je],rt=De(xe)?xe.bind(n,n):De(xe.get)?xe.get.bind(n,n):on,Ye=!De(xe)&&De(xe.set)?xe.set.bind(n):on,Ze=ce({get:rt,set:Ye});Object.defineProperty(r,je,{enumerable:!0,configurable:!0,get:()=>Ze.value,set:He=>Ze.value=He})}if(a)for(const je in a)Bl(a[je],r,n,je);if(l){const je=De(l)?l.call(n):l;Reflect.ownKeys(je).forEach(xe=>{hs(xe,je[xe])})}c&&Mi(c,e,"c");function Ae(je,xe){Ne(xe)?xe.forEach(rt=>je(rt.bind(n))):xe&&je(xe.bind(n))}if(Ae(Uu,f),Ae(Ln,m),Ae(Vu,_),Ae(qu,P),Ae(Bu,I),Ae(Fu,F),Ae(zu,ue),Ae(Gu,ae),Ae(Ku,oe),Ae(Dn,$),Ae(Os,U),Ae(Wu,te),Ne(Z))if(Z.length){const je=e.exposed||(e.exposed={});Z.forEach(xe=>{Object.defineProperty(je,xe,{get:()=>n[xe],set:rt=>n[xe]=rt,enumerable:!0})})}else e.exposed||(e.exposed={});ie&&e.render===on&&(e.render=ie),pe!=null&&(e.inheritAttrs=pe),Q&&(e.components=Q),Pe&&(e.directives=Pe),te&&Ol(e)}function nd(e,t,n=on){Ne(e)&&(e=Eo(e));for(const r in e){const s=e[r];let o;Xe(s)?"default"in s?o=Gt(s.from||r,s.default,!0):o=Gt(s.from||r):o=Gt(s),It(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function Mi(e,t,n){Jt(Ne(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Bl(e,t,n,r){let s=r.includes(".")?xl(n,r):()=>n[r];if(mt(e)){const o=t[e];De(o)&&ct(s,o)}else if(De(e))ct(s,e.bind(n));else if(Xe(e))if(Ne(e))e.forEach(o=>Bl(o,t,n,r));else{const o=De(e.handler)?e.handler.bind(n):t[e.handler];De(o)&&ct(s,o,e)}}function Fl(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=>_s(l,d,i,!0)),_s(l,t,i)),Xe(t)&&o.set(t,l),l}function _s(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&_s(e,o,n,!0),s&&s.forEach(i=>_s(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=rd[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const rd={data:Pi,props:Ni,emits:Ni,methods:Nr,computed:Nr,beforeCreate:$t,created:$t,beforeMount:$t,mounted:$t,beforeUpdate:$t,updated:$t,beforeDestroy:$t,beforeUnmount:$t,destroyed:$t,unmounted:$t,activated:$t,deactivated:$t,errorCaptured:$t,serverPrefetch:$t,components:Nr,directives:Nr,watch:od,provide:Pi,inject:sd};function Pi(e,t){return t?e?function(){return bt(De(e)?e.call(this,this):e,De(t)?t.call(this,this):t)}:t:e}function sd(e,t){return Nr(Eo(e),Eo(t))}function Eo(e){if(Ne(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function $t(e,t){return e?[...new Set([].concat(e,t))]:t}function Nr(e,t){return e?bt(Object.create(null),e,t):t}function Ni(e,t){return e?Ne(e)&&Ne(t)?[...new Set([...e,...t])]:bt(Object.create(null),$i(e),$i(t??{})):t}function od(e,t){if(!e)return t;if(!t)return e;const n=bt(Object.create(null),e);for(const r in t)n[r]=$t(e[r],t[r]);return n}function Hl(){return{app:null,config:{isNativeTag:Ga,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 id=0;function ad(e,t){return function(r,s=null){De(r)||(r=bt({},r)),s!=null&&!Xe(s)&&(s=null);const o=Hl(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:id++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:Dd,get config(){return o.config},set config(c){},use(c,...f){return i.has(c)||(c&&De(c.install)?(i.add(c),c.install(d,...f)):De(c)&&(i.add(c),c(d,...f))),d},mixin(c){return o.mixins.includes(c)||o.mixins.push(c),d},component(c,f){return f?(o.components[c]=f,d):o.components[c]},directive(c,f){return f?(o.directives[c]=f,d):o.directives[c]},mount(c,f,m){if(!l){const _=d._ceVNode||Ce(r,s);return _.appContext=o,m===!0?m="svg":m===!1&&(m=void 0),e(_,c,m),l=!0,d._container=c,c.__vue_app__=d,Ds(_.component)}},onUnmount(c){a.push(c)},unmount(){l&&(Jt(a,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(c,f){return o.provides[c]=f,d},runWithContext(c){const f=wr;wr=d;try{return c()}finally{wr=f}}};return d}}let wr=null;const ld=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Vt(t)}Modifiers`]||e[`${jn(t)}Modifiers`];function cd(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||it;let s=n;const o=t.startsWith("update:"),i=o&&ld(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>mt(c)?c.trim():c)),i.number&&(s=n.map(Wo)));let a,l=r[a=Ks(t)]||r[a=Ks(Vt(t))];!l&&o&&(l=r[a=Ks(jn(t))]),l&&Jt(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,Jt(d,e,6,s)}}const ud=new WeakMap;function Ul(e,t,n=!1){const r=n?ud:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!De(e)){const l=d=>{const c=Ul(d,t,!0);c&&(a=!0,bt(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(Xe(e)&&r.set(e,null),null):(Ne(o)?o.forEach(l=>i[l]=null):bt(i,o),Xe(e)&&r.set(e,i),i)}function js(e,t){return!e||!As(t)?!1:(t=t.slice(2).replace(/Once$/,""),Qe(e,t[0].toLowerCase()+t.slice(1))||Qe(e,jn(t))||Qe(e,t))}function Oi(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:d,renderCache:c,props:f,data:m,setupState:_,ctx:P,inheritAttrs:I}=e,F=ws(e);let q,$;try{if(n.shapeFlag&4){const U=s||r,ie=U;q=rn(d.call(ie,U,c,f,_,m,P)),$=a}else{const U=t;q=rn(U.length>1?U(f,{attrs:a,slots:i,emit:l}):U(f,null)),$=t.props?a:dd(a)}}catch(U){Hr.length=0,Ms(U,e,1),q=Ce(Ct)}let V=q;if($&&I!==!1){const U=Object.keys($),{shapeFlag:ie}=V;U.length&&ie&7&&(o&&U.some(Uo)&&($=fd($,o)),V=Nn(V,$,!1,!0))}return n.dirs&&(V=Nn(V,null,!1,!0),V.dirs=V.dirs?V.dirs.concat(n.dirs):n.dirs),n.transition&&Kr(V,n.transition),q=V,ws(F),q}const dd=e=>{let t;for(const n in e)(n==="class"||n==="style"||As(n))&&((t||(t={}))[n]=e[n]);return t},fd=(e,t)=>{const n={};for(const r in e)(!Uo(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function hd(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?ji(r,i,d):!!i;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const m=c[f];if(Vl(i,r,m)&&!js(d,m))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?ji(r,i,d):!0:!!i;return!1}function ji(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(Vl(t,e,o)&&!js(n,o))return!0}return!1}function Vl(e,t,n){const r=e[n],s=t[n];return n==="style"&&Xe(r)&&Xe(s)?!Ko(r,s):r!==s}function pd({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 ql={},Wl=()=>Object.create(ql),Kl=e=>Object.getPrototypeOf(e)===ql;function md(e,t,n,r=!1){const s={},o=Wl();e.propsDefaults=Object.create(null),Gl(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:gl(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function gd(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=ze(s),[l]=e.propsOptions;let d=!1;if((r||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let m=c[f];if(js(e.emitsOptions,m))continue;const _=t[m];if(l)if(Qe(o,m))_!==o[m]&&(o[m]=_,d=!0);else{const P=Vt(m);s[P]=Io(l,a,P,_,e,!1)}else _!==o[m]&&(o[m]=_,d=!0)}}}else{Gl(e,t,s,o)&&(d=!0);let c;for(const f in a)(!t||!Qe(t,f)&&((c=jn(f))===f||!Qe(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(s[f]=Io(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!Qe(t,f))&&(delete o[f],d=!0)}d&&gn(e.attrs,"set","")}function Gl(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Or(l))continue;const d=t[l];let c;s&&Qe(s,c=Vt(l))?!o||!o.includes(c)?n[c]=d:(a||(a={}))[c]=d:js(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=ze(n),d=a||it;for(let c=0;c<o.length;c++){const f=o[c];n[f]=Io(s,l,f,d[f],e,!Qe(d,f))}}return i}function Io(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=Qe(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&De(l)){const{propsDefaults:d}=s;if(n in d)r=d[n];else{const c=es(s);r=d[n]=l.call(null,t),c()}}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 vd=new WeakMap;function zl(e,t,n=!1){const r=n?vd:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!De(e)){const c=f=>{l=!0;const[m,_]=zl(f,t,!0);bt(i,m),_&&a.push(..._)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return Xe(e)&&r.set(e,mr),mr;if(Ne(o))for(let c=0;c<o.length;c++){const f=Vt(o[c]);Li(f)&&(i[f]=it)}else if(o)for(const c in o){const f=Vt(c);if(Li(f)){const m=o[c],_=i[f]=Ne(m)||De(m)?{type:m}:bt({},m),P=_.type;let I=!1,F=!0;if(Ne(P))for(let q=0;q<P.length;++q){const $=P[q],V=De($)&&$.name;if(V==="Boolean"){I=!0;break}else V==="String"&&(F=!1)}else I=De(P)&&P.name==="Boolean";_[0]=I,_[1]=F,(I||Qe(_,"default"))&&a.push(f)}}const d=[i,a];return Xe(e)&&r.set(e,d),d}function Li(e){return e[0]!=="$"&&!Or(e)}const ti=e=>e==="_"||e==="_ctx"||e==="$stable",ni=e=>Ne(e)?e.map(rn):[rn(e)],yd=(e,t,n)=>{if(t._n)return t;const r=nt((...s)=>ni(t(...s)),n);return r._c=!1,r},Yl=(e,t,n)=>{const r=e._ctx;for(const s in e){if(ti(s))continue;const o=e[s];if(De(o))t[s]=yd(s,o,r);else if(o!=null){const i=ni(o);t[s]=()=>i}}},Jl=(e,t)=>{const n=ni(t);e.slots.default=()=>n},Ql=(e,t,n)=>{for(const r in t)(n||!ti(r))&&(e[r]=t[r])},wd=(e,t,n)=>{const r=e.slots=Wl();if(e.vnode.shapeFlag&32){const s=t._;s?(Ql(r,t,n),n&&Xa(r,"_",s,!0)):Yl(t,r)}else t&&Jl(e,t)},bd=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=it;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:Ql(s,t,n):(o=!t.$stable,Yl(t,s)),i=t}else t&&(Jl(e,t),i={default:1});if(o)for(const a in s)!ti(a)&&i[a]==null&&delete s[a]},xt=xd;function _d(e){return kd(e)}function kd(e,t){const n=Is();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:d,setElementText:c,parentNode:f,nextSibling:m,setScopeId:_=on,insertStaticContent:P}=e,I=(p,y,x,O=null,H=null,D=null,ne=void 0,z=null,X=!!y.dynamicChildren)=>{if(p===y)return;p&&!Xn(p,y)&&(O=R(p),He(p,H,D,!0),p=null),y.patchFlag===-2&&(X=!1,y.dynamicChildren=null);const{type:W,ref:le,shapeFlag:re}=y;switch(W){case Ls:F(p,y,x,O);break;case Ct:q(p,y,x,O);break;case eo:p==null&&$(y,x,O,ne);break;case Le:Q(p,y,x,O,H,D,ne,z,X);break;default:re&1?ie(p,y,x,O,H,D,ne,z,X):re&6?Pe(p,y,x,O,H,D,ne,z,X):(re&64||re&128)&&W.process(p,y,x,O,H,D,ne,z,X,fe)}le!=null&&H?Br(le,p&&p.ref,D,y||p,!y):le==null&&p&&p.ref!=null&&Br(p.ref,null,D,p,!0)},F=(p,y,x,O)=>{if(p==null)r(y.el=a(y.children),x,O);else{const H=y.el=p.el;y.children!==p.children&&d(H,y.children)}},q=(p,y,x,O)=>{p==null?r(y.el=l(y.children||""),x,O):y.el=p.el},$=(p,y,x,O)=>{[p.el,p.anchor]=P(p.children,y,x,O,p.el,p.anchor)},V=({el:p,anchor:y},x,O)=>{let H;for(;p&&p!==y;)H=m(p),r(p,x,O),p=H;r(y,x,O)},U=({el:p,anchor:y})=>{let x;for(;p&&p!==y;)x=m(p),s(p),p=x;s(y)},ie=(p,y,x,O,H,D,ne,z,X)=>{if(y.type==="svg"?ne="svg":y.type==="math"&&(ne="mathml"),p==null)ae(y,x,O,H,D,ne,z,X);else{const W=p.el&&p.el._isVueCE?p.el:null;try{W&&W._beginPatch(),te(p,y,H,D,ne,z,X)}finally{W&&W._endPatch()}}},ae=(p,y,x,O,H,D,ne,z)=>{let X,W;const{props:le,shapeFlag:re,transition:ye,dirs:ve}=p;if(X=p.el=i(p.type,D,le&&le.is,le),re&8?c(X,p.children):re&16&&ue(p.children,X,null,O,H,Zs(p,D),ne,z),ve&&Kn(p,null,O,"created"),oe(X,p,p.scopeId,ne,O),le){for(const Oe in le)Oe!=="value"&&!Or(Oe)&&o(X,Oe,null,le[Oe],D,O);"value"in le&&o(X,"value",null,le.value,D),(W=le.onVnodeBeforeMount)&&en(W,O,p)}ve&&Kn(p,null,O,"beforeMount");const Ee=Td(H,ye);Ee&&ye.beforeEnter(X),r(X,y,x),((W=le&&le.onVnodeMounted)||Ee||ve)&&xt(()=>{W&&en(W,O,p),Ee&&ye.enter(X),ve&&Kn(p,null,O,"mounted")},H)},oe=(p,y,x,O,H)=>{if(x&&_(p,x),O)for(let D=0;D<O.length;D++)_(p,O[D]);if(H){let D=H.subTree;if(y===D||ec(D.type)&&(D.ssContent===y||D.ssFallback===y)){const ne=H.vnode;oe(p,ne,ne.scopeId,ne.slotScopeIds,H.parent)}}},ue=(p,y,x,O,H,D,ne,z,X=0)=>{for(let W=X;W<p.length;W++){const le=p[W]=z?mn(p[W]):rn(p[W]);I(null,le,y,x,O,H,D,ne,z)}},te=(p,y,x,O,H,D,ne)=>{const z=y.el=p.el;let{patchFlag:X,dynamicChildren:W,dirs:le}=y;X|=p.patchFlag&16;const re=p.props||it,ye=y.props||it;let ve;if(x&&Gn(x,!1),(ve=ye.onVnodeBeforeUpdate)&&en(ve,x,y,p),le&&Kn(y,p,x,"beforeUpdate"),x&&Gn(x,!0),(re.innerHTML&&ye.innerHTML==null||re.textContent&&ye.textContent==null)&&c(z,""),W?Z(p.dynamicChildren,W,z,x,O,Zs(y,H),D):ne||xe(p,y,z,null,x,O,Zs(y,H),D,!1),X>0){if(X&16)pe(z,re,ye,x,H);else if(X&2&&re.class!==ye.class&&o(z,"class",null,ye.class,H),X&4&&o(z,"style",re.style,ye.style,H),X&8){const Ee=y.dynamicProps;for(let Oe=0;Oe<Ee.length;Oe++){const Be=Ee[Oe],Ve=re[Be],qe=ye[Be];(qe!==Ve||Be==="value")&&o(z,Be,Ve,qe,H,x)}}X&1&&p.children!==y.children&&c(z,y.children)}else!ne&&W==null&&pe(z,re,ye,x,H);((ve=ye.onVnodeUpdated)||le)&&xt(()=>{ve&&en(ve,x,y,p),le&&Kn(y,p,x,"updated")},O)},Z=(p,y,x,O,H,D,ne)=>{for(let z=0;z<y.length;z++){const X=p[z],W=y[z],le=X.el&&(X.type===Le||!Xn(X,W)||X.shapeFlag&198)?f(X.el):x;I(X,W,le,null,O,H,D,ne,!0)}},pe=(p,y,x,O,H)=>{if(y!==x){if(y!==it)for(const D in y)!Or(D)&&!(D in x)&&o(p,D,y[D],null,H,O);for(const D in x){if(Or(D))continue;const ne=x[D],z=y[D];ne!==z&&D!=="value"&&o(p,D,z,ne,H,O)}"value"in x&&o(p,"value",y.value,x.value,H)}},Q=(p,y,x,O,H,D,ne,z,X)=>{const W=y.el=p?p.el:a(""),le=y.anchor=p?p.anchor:a("");let{patchFlag:re,dynamicChildren:ye,slotScopeIds:ve}=y;ve&&(z=z?z.concat(ve):ve),p==null?(r(W,x,O),r(le,x,O),ue(y.children||[],x,le,H,D,ne,z,X)):re>0&&re&64&&ye&&p.dynamicChildren&&p.dynamicChildren.length===ye.length?(Z(p.dynamicChildren,ye,x,H,D,ne,z),(y.key!=null||H&&y===H.subTree)&&ri(p,y,!0)):xe(p,y,x,le,H,D,ne,z,X)},Pe=(p,y,x,O,H,D,ne,z,X)=>{y.slotScopeIds=z,p==null?y.shapeFlag&512?H.ctx.activate(y,x,O,ne,X):We(y,x,O,H,D,ne,X):et(p,y,X)},We=(p,y,x,O,H,D,ne)=>{const z=p.component=Md(p,O,H);if(Ps(p)&&(z.ctx.renderer=fe),Pd(z,!1,ne),z.asyncDep){if(H&&H.registerDep(z,Ae,ne),!p.el){const X=z.subTree=Ce(Ct);q(null,X,y,x),p.placeholder=X.el}}else Ae(z,p,y,x,H,D,ne)},et=(p,y,x)=>{const O=y.component=p.component;if(hd(p,y,x))if(O.asyncDep&&!O.asyncResolved){je(O,y,x);return}else O.next=y,O.update();else y.el=p.el,O.vnode=y},Ae=(p,y,x,O,H,D,ne)=>{const z=()=>{if(p.isMounted){let{next:re,bu:ye,u:ve,parent:Ee,vnode:Oe}=p;{const S=Xl(p);if(S){re&&(re.el=Oe.el,je(p,re,ne)),S.asyncDep.then(()=>{xt(()=>{p.isUnmounted||W()},H)});return}}let Be=re,Ve;Gn(p,!1),re?(re.el=Oe.el,je(p,re,ne)):re=Oe,ye&&fs(ye),(Ve=re.props&&re.props.onVnodeBeforeUpdate)&&en(Ve,Ee,re,Oe),Gn(p,!0);const qe=Oi(p),ft=p.subTree;p.subTree=qe,I(ft,qe,f(ft.el),R(ft),p,H,D),re.el=qe.el,Be===null&&pd(p,qe.el),ve&&xt(ve,H),(Ve=re.props&&re.props.onVnodeUpdated)&&xt(()=>en(Ve,Ee,re,Oe),H)}else{let re;const{el:ye,props:ve}=y,{bm:Ee,m:Oe,parent:Be,root:Ve,type:qe}=p,ft=yr(y);Gn(p,!1),Ee&&fs(Ee),!ft&&(re=ve&&ve.onVnodeBeforeMount)&&en(re,Be,y),Gn(p,!0);{Ve.ce&&Ve.ce._hasShadowRoot()&&Ve.ce._injectChildStyle(qe);const S=p.subTree=Oi(p);I(null,S,x,O,p,H,D),y.el=S.el}if(Oe&&xt(Oe,H),!ft&&(re=ve&&ve.onVnodeMounted)){const S=y;xt(()=>en(re,Be,S),H)}(y.shapeFlag&256||Be&&yr(Be.vnode)&&Be.vnode.shapeFlag&256)&&p.a&&xt(p.a,H),p.isMounted=!0,y=x=O=null}};p.scope.on();const X=p.effect=new nl(z);p.scope.off();const W=p.update=X.run.bind(X),le=p.job=X.runIfDirty.bind(X);le.i=p,le.id=p.uid,X.scheduler=()=>ei(le),Gn(p,!0),W()},je=(p,y,x)=>{y.component=p;const O=p.vnode.props;p.vnode=y,p.next=null,gd(p,y.props,O,x),bd(p,y.children,x),wn(),Ti(p),bn()},xe=(p,y,x,O,H,D,ne,z,X=!1)=>{const W=p&&p.children,le=p?p.shapeFlag:0,re=y.children,{patchFlag:ye,shapeFlag:ve}=y;if(ye>0){if(ye&128){Ye(W,re,x,O,H,D,ne,z,X);return}else if(ye&256){rt(W,re,x,O,H,D,ne,z,X);return}}ve&8?(le&16&&Te(W,H,D),re!==W&&c(x,re)):le&16?ve&16?Ye(W,re,x,O,H,D,ne,z,X):Te(W,H,D,!0):(le&8&&c(x,""),ve&16&&ue(re,x,O,H,D,ne,z,X))},rt=(p,y,x,O,H,D,ne,z,X)=>{p=p||mr,y=y||mr;const W=p.length,le=y.length,re=Math.min(W,le);let ye;for(ye=0;ye<re;ye++){const ve=y[ye]=X?mn(y[ye]):rn(y[ye]);I(p[ye],ve,x,null,H,D,ne,z,X)}W>le?Te(p,H,D,!0,!1,re):ue(y,x,O,H,D,ne,z,X,re)},Ye=(p,y,x,O,H,D,ne,z,X)=>{let W=0;const le=y.length;let re=p.length-1,ye=le-1;for(;W<=re&&W<=ye;){const ve=p[W],Ee=y[W]=X?mn(y[W]):rn(y[W]);if(Xn(ve,Ee))I(ve,Ee,x,null,H,D,ne,z,X);else break;W++}for(;W<=re&&W<=ye;){const ve=p[re],Ee=y[ye]=X?mn(y[ye]):rn(y[ye]);if(Xn(ve,Ee))I(ve,Ee,x,null,H,D,ne,z,X);else break;re--,ye--}if(W>re){if(W<=ye){const ve=ye+1,Ee=ve<le?y[ve].el:O;for(;W<=ye;)I(null,y[W]=X?mn(y[W]):rn(y[W]),x,Ee,H,D,ne,z,X),W++}}else if(W>ye)for(;W<=re;)He(p[W],H,D,!0),W++;else{const ve=W,Ee=W,Oe=new Map;for(W=Ee;W<=ye;W++){const E=y[W]=X?mn(y[W]):rn(y[W]);E.key!=null&&Oe.set(E.key,W)}let Be,Ve=0;const qe=ye-Ee+1;let ft=!1,S=0;const v=new Array(qe);for(W=0;W<qe;W++)v[W]=0;for(W=ve;W<=re;W++){const E=p[W];if(Ve>=qe){He(E,H,D,!0);continue}let ee;if(E.key!=null)ee=Oe.get(E.key);else for(Be=Ee;Be<=ye;Be++)if(v[Be-Ee]===0&&Xn(E,y[Be])){ee=Be;break}ee===void 0?He(E,H,D,!0):(v[ee-Ee]=W+1,ee>=S?S=ee:ft=!0,I(E,y[ee],x,null,H,D,ne,z,X),Ve++)}const g=ft?Sd(v):mr;for(Be=g.length-1,W=qe-1;W>=0;W--){const E=Ee+W,ee=y[E],_e=y[E+1],Ue=E+1<le?_e.el||Zl(_e):O;v[W]===0?I(null,ee,x,Ue,H,D,ne,z,X):ft&&(Be<0||W!==g[Be]?Ze(ee,x,Ue,2):Be--)}}},Ze=(p,y,x,O,H=null)=>{const{el:D,type:ne,transition:z,children:X,shapeFlag:W}=p;if(W&6){Ze(p.component.subTree,y,x,O);return}if(W&128){p.suspense.move(y,x,O);return}if(W&64){ne.move(p,y,x,fe);return}if(ne===Le){r(D,y,x);for(let re=0;re<X.length;re++)Ze(X[re],y,x,O);r(p.anchor,y,x);return}if(ne===eo){V(p,y,x);return}if(O!==2&&W&1&&z)if(O===0)z.beforeEnter(D),r(D,y,x),xt(()=>z.enter(D),H);else{const{leave:re,delayLeave:ye,afterLeave:ve}=z,Ee=()=>{p.ctx.isUnmounted?s(D):r(D,y,x)},Oe=()=>{D._isLeaving&&D[nn](!0),re(D,()=>{Ee(),ve&&ve()})};ye?ye(D,Ee,Oe):Oe()}else r(D,y,x)},He=(p,y,x,O=!1,H=!1)=>{const{type:D,props:ne,ref:z,children:X,dynamicChildren:W,shapeFlag:le,patchFlag:re,dirs:ye,cacheIndex:ve}=p;if(re===-2&&(H=!1),z!=null&&(wn(),Br(z,null,x,p,!0),bn()),ve!=null&&(y.renderCache[ve]=void 0),le&256){y.ctx.deactivate(p);return}const Ee=le&1&&ye,Oe=!yr(p);let Be;if(Oe&&(Be=ne&&ne.onVnodeBeforeUnmount)&&en(Be,y,p),le&6)ke(p.component,x,O);else{if(le&128){p.suspense.unmount(x,O);return}Ee&&Kn(p,null,y,"beforeUnmount"),le&64?p.type.remove(p,y,x,fe,O):W&&!W.hasOnce&&(D!==Le||re>0&&re&64)?Te(W,y,x,!1,!0):(D===Le&&re&384||!H&&le&16)&&Te(X,y,x),O&&dt(p)}(Oe&&(Be=ne&&ne.onVnodeUnmounted)||Ee)&&xt(()=>{Be&&en(Be,y,p),Ee&&Kn(p,null,y,"unmounted")},x)},dt=p=>{const{type:y,el:x,anchor:O,transition:H}=p;if(y===Le){de(x,O);return}if(y===eo){U(p);return}const D=()=>{s(x),H&&!H.persisted&&H.afterLeave&&H.afterLeave()};if(p.shapeFlag&1&&H&&!H.persisted){const{leave:ne,delayLeave:z}=H,X=()=>ne(x,D);z?z(p.el,D,X):X()}else D()},de=(p,y)=>{let x;for(;p!==y;)x=m(p),s(p),p=x;s(y)},ke=(p,y,x)=>{const{bum:O,scope:H,job:D,subTree:ne,um:z,m:X,a:W}=p;Di(X),Di(W),O&&fs(O),H.stop(),D&&(D.flags|=8,He(ne,p,y,x)),z&&xt(z,y),xt(()=>{p.isUnmounted=!0},y)},Te=(p,y,x,O=!1,H=!1,D=0)=>{for(let ne=D;ne<p.length;ne++)He(p[ne],y,x,O,H)},R=p=>{if(p.shapeFlag&6)return R(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const y=m(p.anchor||p.el),x=y&&y[Al];return x?m(x):y};let G=!1;const J=(p,y,x)=>{let O;p==null?y._vnode&&(He(y._vnode,null,null,!0),O=y._vnode.component):I(y._vnode||null,p,y,null,null,null,x),y._vnode=p,G||(G=!0,Ti(O),_l(),G=!1)},fe={p:I,um:He,m:Ze,r:dt,mt:We,mc:ue,pc:xe,pbc:Z,n:R,o:e};return{render:J,hydrate:void 0,createApp:ad(J)}}function Zs({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Gn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Td(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ri(e,t,n=!1){const r=e.children,s=t.children;if(Ne(r)&&Ne(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]=mn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&ri(i,a)),a.type===Ls&&(a.patchFlag===-1&&(a=s[o]=mn(a)),a.el=i.el),a.type===Ct&&!a.el&&(a.el=i.el)}}function Sd(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 Xl(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Xl(t)}function Di(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Zl(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Zl(t.subTree):null}const ec=e=>e.__isSuspense;function xd(e,t){t&&t.pendingBranch?Ne(e)?t.effects.push(...e):t.effects.push(e):$u(e)}const Le=Symbol.for("v-fgt"),Ls=Symbol.for("v-txt"),Ct=Symbol.for("v-cmt"),eo=Symbol.for("v-stc"),Hr=[];let Dt=null;function k(e=!1){Hr.push(Dt=e?null:[])}function Ad(){Hr.pop(),Dt=Hr[Hr.length-1]||null}let Gr=1;function ks(e,t=!1){Gr+=e,e<0&&Dt&&t&&(Dt.hasOnce=!0)}function tc(e){return e.dynamicChildren=Gr>0?Dt||mr:null,Ad(),Gr>0&&Dt&&Dt.push(e),e}function C(e,t,n,r,s,o){return tc(b(e,t,n,r,s,o,!0))}function ot(e,t,n,r,s){return tc(Ce(e,t,n,r,s,!0))}function zr(e){return e?e.__v_isVNode===!0:!1}function Xn(e,t){return e.type===t.type&&e.key===t.key}const nc=({key:e})=>e??null,ms=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?mt(e)||It(e)||De(e)?{i:_t,r:e,k:t,f:!!n}:e:null);function b(e,t=null,n=null,r=0,s=null,o=e===Le?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&nc(t),ref:t&&ms(t),scopeId:Tl,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:_t};return a?(si(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=mt(n)?8:16),Gr>0&&!i&&Dt&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Dt.push(l),l}const Ce=Cd;function Cd(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===Ll)&&(e=Ct),zr(e)){const a=Nn(e,t,!0);return n&&si(a,n),Gr>0&&!o&&Dt&&(a.shapeFlag&6?Dt[Dt.indexOf(e)]=a:Dt.push(a)),a.patchFlag=-2,a}if(Ld(e)&&(e=e.__vccOpts),t){t=Ed(t);let{class:a,style:l}=t;a&&!mt(a)&&(t.class=lt(a)),Xe(l)&&(Zo(l)&&!Ne(l)&&(l=bt({},l)),t.style=rr(l))}const i=mt(e)?1:ec(e)?128:Cl(e)?64:Xe(e)?4:De(e)?2:0;return b(e,t,n,r,s,i,o,!0)}function Ed(e){return e?Zo(e)||Kl(e)?bt({},e):e:null}function Nn(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?rc(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&nc(d),ref:t&&t.ref?n&&o?Ne(o)?o.concat(ms(t)):[o,ms(t)]:ms(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!==Le?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&&Nn(e.ssContent),ssFallback:e.ssFallback&&Nn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Kr(c,l.clone(c)),c}function Id(e=" ",t=0){return Ce(Ls,null,e,t)}function ge(e="",t=!1){return t?(k(),ot(Ct,null,e)):Ce(Ct,null,e)}function rn(e){return e==null||typeof e=="boolean"?Ce(Ct):Ne(e)?Ce(Le,null,e.slice()):zr(e)?mn(e):Ce(Ls,null,String(e))}function mn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Nn(e)}function si(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Ne(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),si(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Kl(t)?t._ctx=_t:s===3&&_t&&(_t.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else De(t)?(t={default:t,_ctx:_t},n=32):(t=String(t),r&64?(n=16,t=[Id(t)]):n=8);e.children=t,e.shapeFlag|=n}function rc(...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=lt([t.class,r.class]));else if(s==="style")t.style=rr([t.style,r.style]);else if(As(s)){const o=t[s],i=r[s];i&&o!==i&&!(Ne(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function en(e,t,n,r=null){Jt(e,t,7,[n,r])}const Rd=Hl();let $d=0;function Md(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Rd,o={uid:$d++,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:zl(r,s),emitsOptions:Ul(r,s),emit:null,emitted:null,propsDefaults:it,inheritAttrs:r.inheritAttrs,ctx:it,data:it,props:it,attrs:it,slots:it,refs:it,setupState:it,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=cd.bind(null,o),e.ce&&e.ce(o),o}let Et=null;const oi=()=>Et||_t;let Ts,Ro;{const e=Is(),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)}};Ts=t("__VUE_INSTANCE_SETTERS__",n=>Et=n),Ro=t("__VUE_SSR_SETTERS__",n=>Yr=n)}const es=e=>{const t=Et;return Ts(e),e.scope.on(),()=>{e.scope.off(),Ts(t)}},Bi=()=>{Et&&Et.scope.off(),Ts(null)};function sc(e){return e.vnode.shapeFlag&4}let Yr=!1;function Pd(e,t=!1,n=!1){t&&Ro(t);const{props:r,children:s}=e.vnode,o=sc(e);md(e,r,o,t),wd(e,s,n||t);const i=o?Nd(e,t):void 0;return t&&Ro(!1),i}function Nd(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Xu);const{setup:r}=n;if(r){wn();const s=e.setupContext=r.length>1?ic(e):null,o=es(e),i=Zr(r,e,0,[e.props,s]),a=Ya(i);if(bn(),o(),(a||e.sp)&&!yr(e)&&Ol(e),a){if(i.then(Bi,Bi),t)return i.then(l=>{Fi(e,l)}).catch(l=>{Ms(l,e,0)});e.asyncDep=i}else Fi(e,i)}else oc(e)}function Fi(e,t,n){De(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Xe(t)&&(e.setupState=yl(t)),oc(e)}function oc(e,t,n){const r=e.type;e.render||(e.render=r.render||on);{const s=es(e);wn();try{td(e)}finally{bn(),s()}}}const Od={get(e,t){return At(e,"get",""),e[t]}};function ic(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Od),slots:e.slots,emit:e.emit,expose:t}}function Ds(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(yl(_u(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Fr)return Fr[n](e)},has(t,n){return n in t||n in Fr}})):e.proxy}function jd(e,t=!0){return De(e)?e.displayName||e.name:e.name||t&&e.__name}function Ld(e){return De(e)&&"__vccOpts"in e}const ce=(e,t)=>Au(e,t,Yr);function ii(e,t,n){try{ks(-1);const r=arguments.length;return r===2?Xe(t)&&!Ne(t)?zr(t)?Ce(e,null,[t]):Ce(e,t):Ce(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&zr(n)&&(n=[n]),Ce(e,t,n))}finally{ks(1)}}const Dd="3.5.29";/**
14
- * @vue/runtime-dom v3.5.29
15
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
- * @license MIT
17
- **/let $o;const Hi=typeof window<"u"&&window.trustedTypes;if(Hi)try{$o=Hi.createPolicy("vue",{createHTML:e=>e})}catch{}const ac=$o?e=>$o.createHTML(e):e=>e,Bd="http://www.w3.org/2000/svg",Fd="http://www.w3.org/1998/Math/MathML",pn=typeof document<"u"?document:null,Ui=pn&&pn.createElement("template"),Hd={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"?pn.createElementNS(Bd,e):t==="mathml"?pn.createElementNS(Fd,e):n?pn.createElement(e,{is:n}):pn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>pn.createTextNode(e),createComment:e=>pn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>pn.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{Ui.innerHTML=ac(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Ui.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]}},xn="transition",Rr="animation",Jr=Symbol("_vtc"),lc={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},Ud=bt({},Rl,lc),Vd=e=>(e.displayName="Transition",e.props=Ud,e),qd=Vd((e,{slots:t})=>ii(Du,Wd(e),t)),zn=(e,t=[])=>{Ne(e)?e.forEach(n=>n(...t)):e&&e(...t)},Vi=e=>e?Ne(e)?e.some(t=>t.length>1):e.length>1:!1;function Wd(e){const t={};for(const Q in e)Q in lc||(t[Q]=e[Q]);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:c=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:m=`${n}-leave-active`,leaveToClass:_=`${n}-leave-to`}=e,P=Kd(s),I=P&&P[0],F=P&&P[1],{onBeforeEnter:q,onEnter:$,onEnterCancelled:V,onLeave:U,onLeaveCancelled:ie,onBeforeAppear:ae=q,onAppear:oe=$,onAppearCancelled:ue=V}=t,te=(Q,Pe,We,et)=>{Q._enterCancelled=et,Yn(Q,Pe?c:a),Yn(Q,Pe?d:i),We&&We()},Z=(Q,Pe)=>{Q._isLeaving=!1,Yn(Q,f),Yn(Q,_),Yn(Q,m),Pe&&Pe()},pe=Q=>(Pe,We)=>{const et=Q?oe:$,Ae=()=>te(Pe,Q,We);zn(et,[Pe,Ae]),qi(()=>{Yn(Pe,Q?l:o),fn(Pe,Q?c:a),Vi(et)||Wi(Pe,r,I,Ae)})};return bt(t,{onBeforeEnter(Q){zn(q,[Q]),fn(Q,o),fn(Q,i)},onBeforeAppear(Q){zn(ae,[Q]),fn(Q,l),fn(Q,d)},onEnter:pe(!1),onAppear:pe(!0),onLeave(Q,Pe){Q._isLeaving=!0;const We=()=>Z(Q,Pe);fn(Q,f),Q._enterCancelled?(fn(Q,m),zi(Q)):(zi(Q),fn(Q,m)),qi(()=>{Q._isLeaving&&(Yn(Q,f),fn(Q,_),Vi(U)||Wi(Q,r,F,We))}),zn(U,[Q,We])},onEnterCancelled(Q){te(Q,!1,void 0,!0),zn(V,[Q])},onAppearCancelled(Q){te(Q,!0,void 0,!0),zn(ue,[Q])},onLeaveCancelled(Q){Z(Q),zn(ie,[Q])}})}function Kd(e){if(e==null)return null;if(Xe(e))return[to(e.enter),to(e.leave)];{const t=to(e);return[t,t]}}function to(e){return Gc(e)}function fn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Jr]||(e[Jr]=new Set)).add(t)}function Yn(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Jr];n&&(n.delete(t),n.size||(e[Jr]=void 0))}function qi(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Gd=0;function Wi(e,t,n,r){const s=e._endId=++Gd,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=zd(e,t);if(!i)return r();const d=i+"end";let c=0;const f=()=>{e.removeEventListener(d,m),o()},m=_=>{_.target===e&&++c>=l&&f()};setTimeout(()=>{c<l&&f()},a+1),e.addEventListener(d,m)}function zd(e,t){const n=window.getComputedStyle(e),r=P=>(n[P]||"").split(", "),s=r(`${xn}Delay`),o=r(`${xn}Duration`),i=Ki(s,o),a=r(`${Rr}Delay`),l=r(`${Rr}Duration`),d=Ki(a,l);let c=null,f=0,m=0;t===xn?i>0&&(c=xn,f=i,m=o.length):t===Rr?d>0&&(c=Rr,f=d,m=l.length):(f=Math.max(i,d),c=f>0?i>d?xn:Rr:null,m=c?c===xn?o.length:l.length:0);const _=c===xn&&/\b(?:transform|all)(?:,|$)/.test(r(`${xn}Property`).toString());return{type:c,timeout:f,propCount:m,hasTransform:_}}function Ki(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Gi(n)+Gi(e[r])))}function Gi(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function zi(e){return(e?e.ownerDocument:document).body.offsetHeight}function Yd(e,t,n){const r=e[Jr];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Yi=Symbol("_vod"),Jd=Symbol("_vsh"),Qd=Symbol(""),Xd=/(?:^|;)\s*display\s*:/;function Zd(e,t,n){const r=e.style,s=mt(n);let o=!1;if(n&&!s){if(t)if(mt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&gs(r,a,"")}else for(const i in t)n[i]==null&&gs(r,i,"");for(const i in n)i==="display"&&(o=!0),gs(r,i,n[i])}else if(s){if(t!==n){const i=r[Qd];i&&(n+=";"+i),r.cssText=n,o=Xd.test(n)}}else t&&e.removeAttribute("style");Yi in e&&(e[Yi]=o?r.display:"",e[Jd]&&(r.display="none"))}const Ji=/\s*!important$/;function gs(e,t,n){if(Ne(n))n.forEach(r=>gs(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=ef(e,t);Ji.test(n)?e.setProperty(jn(r),n.replace(Ji,""),"important"):e[r]=n}}const Qi=["Webkit","Moz","ms"],no={};function ef(e,t){const n=no[t];if(n)return n;let r=Vt(t);if(r!=="filter"&&r in e)return no[t]=r;r=Es(r);for(let s=0;s<Qi.length;s++){const o=Qi[s]+r;if(o in e)return no[t]=o}return t}const Xi="http://www.w3.org/1999/xlink";function Zi(e,t,n,r,s,o=Zc(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Xi,t.slice(6,t.length)):e.setAttributeNS(Xi,t,n):n==null||o&&!Za(n)?e.removeAttribute(t):e.setAttribute(t,o?"":zt(n)?String(n):n)}function ea(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ac(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=Za(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(s||t)}function hr(e,t,n,r){e.addEventListener(t,n,r)}function tf(e,t,n,r){e.removeEventListener(t,n,r)}const ta=Symbol("_vei");function nf(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]=rf(t);if(r){const d=o[t]=af(r,s);hr(e,a,d,l)}else i&&(tf(e,a,i,l),o[t]=void 0)}}const na=/(?:Once|Passive|Capture)$/;function rf(e){let t;if(na.test(e)){t={};let r;for(;r=e.match(na);)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 ro=0;const sf=Promise.resolve(),of=()=>ro||(sf.then(()=>ro=0),ro=Date.now());function af(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Jt(lf(r,n.value),t,5,[r])};return n.value=e,n.attached=of(),n}function lf(e,t){if(Ne(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 ra=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,cf=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?Yd(e,r,i):t==="style"?Zd(e,n,r):As(t)?Uo(t)||nf(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):uf(e,t,r,i))?(ea(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Zi(e,t,r,i,o,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!mt(r))?ea(e,Vt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Zi(e,t,r,i))};function uf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&ra(t)&&De(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 ra(t)&&mt(n)?!1:t in e}const sa=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ne(t)?n=>fs(t,n):t};function df(e){e.target.composing=!0}function oa(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const so=Symbol("_assign");function ia(e,t,n){return t&&(e=e.trim()),n&&(e=Wo(e)),e}const On={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[so]=sa(s);const o=r||s.props&&s.props.type==="number";hr(e,t?"change":"input",i=>{i.target.composing||e[so](ia(e.value,n,o))}),(n||o)&&hr(e,"change",()=>{e.value=ia(e.value,n,o)}),t||(hr(e,"compositionstart",df),hr(e,"compositionend",oa),hr(e,"change",oa))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[so]=sa(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Wo(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))}},ff=["ctrl","shift","alt","meta"],hf={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)=>ff.some(n=>e[`${n}Key`]&&!t.includes(n))},ut=(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=hf[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},pf={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Bt=(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||pf[i]===o))return e(s)}))},mf=bt({patchProp:cf},Hd);let aa;function gf(){return aa||(aa=_d(mf))}const vf=((...e)=>{const t=gf().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=wf(r);if(!s)return;const o=t._component;!De(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,yf(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function yf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function wf(e){return mt(e)?document.querySelector(e):e}/*!
18
- * vue-router v4.6.4
19
- * (c) 2025 Eduardo San Martin Morote
20
- * @license MIT
21
- */const pr=typeof document<"u";function cc(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function bf(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&cc(e.default)}const Je=Object.assign;function oo(e,t){const n={};for(const r in t){const s=t[r];n[r]=Qt(s)?s.map(e):e(s)}return n}const Ur=()=>{},Qt=Array.isArray;function la(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const uc=/#/g,_f=/&/g,kf=/\//g,Tf=/=/g,Sf=/\?/g,dc=/\+/g,xf=/%5B/g,Af=/%5D/g,fc=/%5E/g,Cf=/%60/g,hc=/%7B/g,Ef=/%7C/g,pc=/%7D/g,If=/%20/g;function ai(e){return e==null?"":encodeURI(""+e).replace(Ef,"|").replace(xf,"[").replace(Af,"]")}function Rf(e){return ai(e).replace(hc,"{").replace(pc,"}").replace(fc,"^")}function Mo(e){return ai(e).replace(dc,"%2B").replace(If,"+").replace(uc,"%23").replace(_f,"%26").replace(Cf,"`").replace(hc,"{").replace(pc,"}").replace(fc,"^")}function $f(e){return Mo(e).replace(Tf,"%3D")}function Mf(e){return ai(e).replace(uc,"%23").replace(Sf,"%3F")}function Pf(e){return Mf(e).replace(kf,"%2F")}function Qr(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Nf=/\/$/,Of=e=>e.replace(Nf,"");function io(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=Bf(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:Qr(i)}}function jf(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function ca(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Lf(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&_r(t.matched[r],n.matched[s])&&mc(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function _r(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function mc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Df(e[n],t[n]))return!1;return!0}function Df(e,t){return Qt(e)?ua(e,t):Qt(t)?ua(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function ua(e,t){return Qt(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Bf(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 An={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Po=(function(e){return e.pop="pop",e.push="push",e})({}),ao=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Ff(e){if(!e)if(pr){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Of(e)}const Hf=/^[^#]+#/;function Uf(e,t){return e.replace(Hf,"#")+t}function Vf(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 Bs=()=>({left:window.scrollX,top:window.scrollY});function qf(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=Vf(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 da(e,t){return(history.state?history.state.position-t:-1)+e}const No=new Map;function Wf(e,t){No.set(e,t)}function Kf(e){const t=No.get(e);return No.delete(e),t}function Gf(e){return typeof e=="string"||e&&typeof e=="object"}function gc(e){return typeof e=="string"||typeof e=="symbol"}let gt=(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 vc=Symbol("");gt.MATCHER_NOT_FOUND+"",gt.NAVIGATION_GUARD_REDIRECT+"",gt.NAVIGATION_ABORTED+"",gt.NAVIGATION_CANCELLED+"",gt.NAVIGATION_DUPLICATED+"";function kr(e,t){return Je(new Error,{type:e,[vc]:!0},t)}function hn(e,t){return e instanceof Error&&vc in e&&(t==null||!!(e.type&t))}const zf=["params","query","hash"];function Yf(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of zf)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Jf(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(dc," "),o=s.indexOf("="),i=Qr(o<0?s:s.slice(0,o)),a=o<0?null:Qr(s.slice(o+1));if(i in t){let l=t[i];Qt(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function fa(e){let t="";for(let n in e){const r=e[n];if(n=$f(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Qt(r)?r.map(s=>s&&Mo(s)):[r&&Mo(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function Qf(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Qt(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const Xf=Symbol(""),ha=Symbol(""),Fs=Symbol(""),li=Symbol(""),Oo=Symbol("");function $r(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Rn(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(kr(gt.NAVIGATION_ABORTED,{from:n,to:t})):m instanceof Error?l(m):Gf(m)?l(kr(gt.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(i&&r.enterCallbacks[s]===i&&typeof m=="function"&&i.push(m),a())},c=o(()=>e.call(r&&r.instances[s],t,n,d));let f=Promise.resolve(c);e.length<3&&(f=f.then(d)),f.catch(m=>l(m))})}function lo(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(cc(l)){const d=(l.__vccOpts||l)[t];d&&o.push(Rn(d,n,r,i,a,s))}else{let d=l();o.push(()=>d.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=bf(c)?c.default:c;i.mods[a]=c,i.components[a]=f;const m=(f.__vccOpts||f)[t];return m&&Rn(m,n,r,i,a,s)()}))}}return o}function Zf(e,t){const n=[],r=[],s=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;i<o;i++){const a=t.matched[i];a&&(e.matched.find(d=>_r(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>_r(d,l))||s.push(l))}return[n,r,s]}/*!
22
- * vue-router v4.6.4
23
- * (c) 2025 Eduardo San Martin Morote
24
- * @license MIT
25
- */let eh=()=>location.protocol+"//"+location.host;function yc(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),ca(a,"")}return ca(n,e)+r+s}function th(e,t,n,r){let s=[],o=[],i=null;const a=({state:m})=>{const _=yc(e,location),P=n.value,I=t.value;let F=0;if(m){if(n.value=_,t.value=m,i&&i===P){i=null;return}F=I?m.position-I.position:0}else r(_);s.forEach(q=>{q(n.value,P,{delta:F,type:Po.pop,direction:F?F>0?ao.forward:ao.back:ao.unknown})})};function l(){i=n.value}function d(m){s.push(m);const _=()=>{const P=s.indexOf(m);P>-1&&s.splice(P,1)};return o.push(_),_}function c(){if(document.visibilityState==="hidden"){const{history:m}=window;if(!m.state)return;m.replaceState(Je({},m.state,{scroll:Bs()}),"")}}function f(){for(const m of o)m();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:d,destroy:f}}function pa(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?Bs():null}}function nh(e){const{history:t,location:n}=window,r={value:yc(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,c){const f=e.indexOf("#"),m=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:eh()+e+l;try{t[c?"replaceState":"pushState"](d,"",m),s.value=d}catch(_){console.error(_),n[c?"replace":"assign"](m)}}function i(l,d){o(l,Je({},t.state,pa(s.value.back,l,s.value.forward,!0),d,{position:s.value.position}),!0),r.value=l}function a(l,d){const c=Je({},s.value,t.state,{forward:l,scroll:Bs()});o(c.current,c,!0),o(l,Je({},pa(r.value,l,null),{position:c.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function rh(e){e=Ff(e);const t=nh(e),n=th(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=Je({location:"",base:e,go:r,createHref:Uf.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+="#"),rh(e)}let er=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var wt=(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})(wt||{});const oh={type:er.Static,value:""},ih=/[a-zA-Z0-9_]/;function ah(e){if(!e)return[[]];if(e==="/")return[[oh]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${d}": ${_}`)}let n=wt.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",c="";function f(){d&&(n===wt.Static?o.push({type:er.Static,value:d}):n===wt.Param||n===wt.ParamRegExp||n===wt.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:er.Param,value:d,regexp:c,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!==wt.ParamRegExp){r=n,n=wt.EscapeNext;continue}switch(n){case wt.Static:l==="/"?(d&&f(),i()):l===":"?(f(),n=wt.Param):m();break;case wt.EscapeNext:m(),n=r;break;case wt.Param:l==="("?n=wt.ParamRegExp:ih.test(l)?m():(f(),n=wt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case wt.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=wt.ParamRegExpEnd:c+=l;break;case wt.ParamRegExpEnd:f(),n=wt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===wt.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),f(),i(),s}const ma="[^/]+?",lh={sensitive:!1,strict:!1,start:!0,end:!0};var Mt=(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})(Mt||{});const ch=/[.+*?^${}()[\]/\\]/g;function uh(e,t){const n=Je({},lh,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const c=d.length?[]:[Mt.Root];n.strict&&!d.length&&(s+="/");for(let f=0;f<d.length;f++){const m=d[f];let _=Mt.Segment+(n.sensitive?Mt.BonusCaseSensitive:0);if(m.type===er.Static)f||(s+="/"),s+=m.value.replace(ch,"\\$&"),_+=Mt.Static;else if(m.type===er.Param){const{value:P,repeatable:I,optional:F,regexp:q}=m;o.push({name:P,repeatable:I,optional:F});const $=q||ma;if($!==ma){_+=Mt.BonusCustomRegExp;try{`${$}`}catch(U){throw new Error(`Invalid custom RegExp for param "${P}" (${$}): `+U.message)}}let V=I?`((?:${$})(?:/(?:${$}))*)`:`(${$})`;f||(V=F&&d.length<2?`(?:/${V})`:"/"+V),F&&(V+="?"),s+=V,_+=Mt.Dynamic,F&&(_+=Mt.BonusOptional),I&&(_+=Mt.BonusRepeatable),$===".*"&&(_+=Mt.BonusWildcard)}c.push(_)}r.push(c)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=Mt.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(d){const c=d.match(i),f={};if(!c)return null;for(let m=1;m<c.length;m++){const _=c[m]||"",P=o[m-1];f[P.name]=_&&P.repeatable?_.split("/"):_}return f}function l(d){let c="",f=!1;for(const m of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const _ of m)if(_.type===er.Static)c+=_.value;else if(_.type===er.Param){const{value:P,repeatable:I,optional:F}=_,q=P in d?d[P]:"";if(Qt(q)&&!I)throw new Error(`Provided param "${P}" is an array but it is not repeatable (* or + modifiers)`);const $=Qt(q)?q.join("/"):q;if(!$)if(F)m.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${P}"`);c+=$}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function dh(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]===Mt.Static+Mt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Mt.Static+Mt.Segment?1:-1:0}function wc(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=dh(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(ga(r))return 1;if(ga(s))return-1}return s.length-r.length}function ga(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const fh={strict:!1,end:!0,sensitive:!1};function hh(e,t,n){const r=uh(ah(e.path),n),s=Je(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function ph(e,t){const n=[],r=new Map;t=la(fh,t);function s(f){return r.get(f)}function o(f,m,_){const P=!_,I=ya(f);I.aliasOf=_&&_.record;const F=la(t,f),q=[I];if("alias"in f){const U=typeof f.alias=="string"?[f.alias]:f.alias;for(const ie of U)q.push(ya(Je({},I,{components:_?_.record.components:I.components,path:ie,aliasOf:_?_.record:I})))}let $,V;for(const U of q){const{path:ie}=U;if(m&&ie[0]!=="/"){const ae=m.record.path,oe=ae[ae.length-1]==="/"?"":"/";U.path=m.record.path+(ie&&oe+ie)}if($=hh(U,m,F),_?_.alias.push($):(V=V||$,V!==$&&V.alias.push($),P&&f.name&&!wa($)&&i(f.name)),bc($)&&l($),I.children){const ae=I.children;for(let oe=0;oe<ae.length;oe++)o(ae[oe],$,_&&_.children[oe])}_=_||$}return V?()=>{i(V)}:Ur}function i(f){if(gc(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=vh(f,n);n.splice(m,0,f),f.record.name&&!wa(f)&&r.set(f.record.name,f)}function d(f,m){let _,P={},I,F;if("name"in f&&f.name){if(_=r.get(f.name),!_)throw kr(gt.MATCHER_NOT_FOUND,{location:f});F=_.record.name,P=Je(va(m.params,_.keys.filter(V=>!V.optional).concat(_.parent?_.parent.keys.filter(V=>V.optional):[]).map(V=>V.name)),f.params&&va(f.params,_.keys.map(V=>V.name))),I=_.stringify(P)}else if(f.path!=null)I=f.path,_=n.find(V=>V.re.test(I)),_&&(P=_.parse(I),F=_.record.name);else{if(_=m.name?r.get(m.name):n.find(V=>V.re.test(m.path)),!_)throw kr(gt.MATCHER_NOT_FOUND,{location:f,currentLocation:m});F=_.record.name,P=Je({},m.params,f.params),I=_.stringify(P)}const q=[];let $=_;for(;$;)q.unshift($.record),$=$.parent;return{name:F,path:I,params:P,matched:q,meta:gh(q)}}e.forEach(f=>o(f));function c(){n.length=0,r.clear()}return{addRoute:o,resolve:d,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function va(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function ya(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:mh(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 mh(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 wa(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function gh(e){return e.reduce((t,n)=>Je(t,n.meta),{})}function vh(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;wc(e,t[o])<0?r=o:n=o+1}const s=yh(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function yh(e){let t=e;for(;t=t.parent;)if(bc(t)&&wc(e,t)===0)return t}function bc({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function ba(e){const t=Gt(Fs),n=Gt(li),r=ce(()=>{const l=$e(e.to);return t.resolve(l)}),s=ce(()=>{const{matched:l}=r.value,{length:d}=l,c=l[d-1],f=n.matched;if(!c||!f.length)return-1;const m=f.findIndex(_r.bind(null,c));if(m>-1)return m;const _=_a(l[d-2]);return d>1&&_a(c)===_&&f[f.length-1].path!==_?f.findIndex(_r.bind(null,l[d-2])):m}),o=ce(()=>s.value>-1&&Th(n.params,r.value.params)),i=ce(()=>s.value>-1&&s.value===n.matched.length-1&&mc(n.params,r.value.params));function a(l={}){if(kh(l)){const d=t[$e(e.replace)?"replace":"push"]($e(e.to)).catch(Ur);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:r,href:ce(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function wh(e){return e.length===1?e[0]:e}const bh=kt({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:ba,setup(e,{slots:t}){const n=$s(ba(e)),{options:r}=Gt(Fs),s=ce(()=>({[ka(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[ka(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&wh(t.default(n));return e.custom?o:ii("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),_h=bh;function kh(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 Th(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(!Qt(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function _a(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const ka=(e,t,n)=>e??t??n,Sh=kt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Gt(Oo),s=ce(()=>e.route||r.value),o=Gt(ha,0),i=ce(()=>{let d=$e(o);const{matched:c}=s.value;let f;for(;(f=c[d])&&!f.components;)d++;return d}),a=ce(()=>s.value.matched[i.value]);hs(ha,ce(()=>i.value+1)),hs(Xf,a),hs(Oo,s);const l=B();return ct(()=>[l.value,a.value,e.name],([d,c,f],[m,_,P])=>{c&&(c.instances[f]=d,_&&_!==c&&d&&d===m&&(c.leaveGuards.size||(c.leaveGuards=_.leaveGuards),c.updateGuards.size||(c.updateGuards=_.updateGuards))),d&&c&&(!_||!_r(c,_)||!m)&&(c.enterCallbacks[f]||[]).forEach(I=>I(d))},{flush:"post"}),()=>{const d=s.value,c=e.name,f=a.value,m=f&&f.components[c];if(!m)return Ta(n.default,{Component:m,route:d});const _=f.props[c],P=_?_===!0?d.params:typeof _=="function"?_(d):_:null,F=ii(m,Je({},P,t,{onVnodeUnmounted:q=>{q.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return Ta(n.default,{Component:F,route:d})||F}}});function Ta(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const xh=Sh;function Ah(e){const t=ph(e.routes,e),n=e.parseQuery||Jf,r=e.stringifyQuery||fa,s=e.history,o=$r(),i=$r(),a=$r(),l=ku(An);let d=An;pr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=oo.bind(null,R=>""+R),f=oo.bind(null,Pf),m=oo.bind(null,Qr);function _(R,G){let J,fe;return gc(R)?(J=t.getRecordMatcher(R),fe=G):fe=R,t.addRoute(fe,J)}function P(R){const G=t.getRecordMatcher(R);G&&t.removeRoute(G)}function I(){return t.getRoutes().map(R=>R.record)}function F(R){return!!t.getRecordMatcher(R)}function q(R,G){if(G=Je({},G||l.value),typeof R=="string"){const x=io(n,R,G.path),O=t.resolve({path:x.path},G),H=s.createHref(x.fullPath);return Je(x,O,{params:m(O.params),hash:Qr(x.hash),redirectedFrom:void 0,href:H})}let J;if(R.path!=null)J=Je({},R,{path:io(n,R.path,G.path).path});else{const x=Je({},R.params);for(const O in x)x[O]==null&&delete x[O];J=Je({},R,{params:f(x)}),G.params=f(G.params)}const fe=t.resolve(J,G),Ie=R.hash||"";fe.params=c(m(fe.params));const p=jf(r,Je({},R,{hash:Rf(Ie),path:fe.path})),y=s.createHref(p);return Je({fullPath:p,hash:Ie,query:r===fa?Qf(R.query):R.query||{}},fe,{redirectedFrom:void 0,href:y})}function $(R){return typeof R=="string"?io(n,R,l.value.path):Je({},R)}function V(R,G){if(d!==R)return kr(gt.NAVIGATION_CANCELLED,{from:G,to:R})}function U(R){return oe(R)}function ie(R){return U(Je($(R),{replace:!0}))}function ae(R,G){const J=R.matched[R.matched.length-1];if(J&&J.redirect){const{redirect:fe}=J;let Ie=typeof fe=="function"?fe(R,G):fe;return typeof Ie=="string"&&(Ie=Ie.includes("?")||Ie.includes("#")?Ie=$(Ie):{path:Ie},Ie.params={}),Je({query:R.query,hash:R.hash,params:Ie.path!=null?{}:R.params},Ie)}}function oe(R,G){const J=d=q(R),fe=l.value,Ie=R.state,p=R.force,y=R.replace===!0,x=ae(J,fe);if(x)return oe(Je($(x),{state:typeof x=="object"?Je({},Ie,x.state):Ie,force:p,replace:y}),G||J);const O=J;O.redirectedFrom=G;let H;return!p&&Lf(r,fe,J)&&(H=kr(gt.NAVIGATION_DUPLICATED,{to:O,from:fe}),Ze(fe,fe,!0,!1)),(H?Promise.resolve(H):Z(O,fe)).catch(D=>hn(D)?hn(D,gt.NAVIGATION_GUARD_REDIRECT)?D:Ye(D):xe(D,O,fe)).then(D=>{if(D){if(hn(D,gt.NAVIGATION_GUARD_REDIRECT))return oe(Je({replace:y},$(D.to),{state:typeof D.to=="object"?Je({},Ie,D.to.state):Ie,force:p}),G||O)}else D=Q(O,fe,!0,y,Ie);return pe(O,fe,D),D})}function ue(R,G){const J=V(R,G);return J?Promise.reject(J):Promise.resolve()}function te(R){const G=de.values().next().value;return G&&typeof G.runWithContext=="function"?G.runWithContext(R):R()}function Z(R,G){let J;const[fe,Ie,p]=Zf(R,G);J=lo(fe.reverse(),"beforeRouteLeave",R,G);for(const x of fe)x.leaveGuards.forEach(O=>{J.push(Rn(O,R,G))});const y=ue.bind(null,R,G);return J.push(y),Te(J).then(()=>{J=[];for(const x of o.list())J.push(Rn(x,R,G));return J.push(y),Te(J)}).then(()=>{J=lo(Ie,"beforeRouteUpdate",R,G);for(const x of Ie)x.updateGuards.forEach(O=>{J.push(Rn(O,R,G))});return J.push(y),Te(J)}).then(()=>{J=[];for(const x of p)if(x.beforeEnter)if(Qt(x.beforeEnter))for(const O of x.beforeEnter)J.push(Rn(O,R,G));else J.push(Rn(x.beforeEnter,R,G));return J.push(y),Te(J)}).then(()=>(R.matched.forEach(x=>x.enterCallbacks={}),J=lo(p,"beforeRouteEnter",R,G,te),J.push(y),Te(J))).then(()=>{J=[];for(const x of i.list())J.push(Rn(x,R,G));return J.push(y),Te(J)}).catch(x=>hn(x,gt.NAVIGATION_CANCELLED)?x:Promise.reject(x))}function pe(R,G,J){a.list().forEach(fe=>te(()=>fe(R,G,J)))}function Q(R,G,J,fe,Ie){const p=V(R,G);if(p)return p;const y=G===An,x=pr?history.state:{};J&&(fe||y?s.replace(R.fullPath,Je({scroll:y&&x&&x.scroll},Ie)):s.push(R.fullPath,Ie)),l.value=R,Ze(R,G,J,y),Ye()}let Pe;function We(){Pe||(Pe=s.listen((R,G,J)=>{if(!ke.listening)return;const fe=q(R),Ie=ae(fe,ke.currentRoute.value);if(Ie){oe(Je(Ie,{replace:!0,force:!0}),fe).catch(Ur);return}d=fe;const p=l.value;pr&&Wf(da(p.fullPath,J.delta),Bs()),Z(fe,p).catch(y=>hn(y,gt.NAVIGATION_ABORTED|gt.NAVIGATION_CANCELLED)?y:hn(y,gt.NAVIGATION_GUARD_REDIRECT)?(oe(Je($(y.to),{force:!0}),fe).then(x=>{hn(x,gt.NAVIGATION_ABORTED|gt.NAVIGATION_DUPLICATED)&&!J.delta&&J.type===Po.pop&&s.go(-1,!1)}).catch(Ur),Promise.reject()):(J.delta&&s.go(-J.delta,!1),xe(y,fe,p))).then(y=>{y=y||Q(fe,p,!1),y&&(J.delta&&!hn(y,gt.NAVIGATION_CANCELLED)?s.go(-J.delta,!1):J.type===Po.pop&&hn(y,gt.NAVIGATION_ABORTED|gt.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),pe(fe,p,y)}).catch(Ur)}))}let et=$r(),Ae=$r(),je;function xe(R,G,J){Ye(R);const fe=Ae.list();return fe.length?fe.forEach(Ie=>Ie(R,G,J)):console.error(R),Promise.reject(R)}function rt(){return je&&l.value!==An?Promise.resolve():new Promise((R,G)=>{et.add([R,G])})}function Ye(R){return je||(je=!R,We(),et.list().forEach(([G,J])=>R?J(R):G()),et.reset()),R}function Ze(R,G,J,fe){const{scrollBehavior:Ie}=e;if(!pr||!Ie)return Promise.resolve();const p=!J&&Kf(da(R.fullPath,0))||(fe||!J)&&history.state&&history.state.scroll||null;return Ft().then(()=>Ie(R,G,p)).then(y=>y&&qf(y)).catch(y=>xe(y,R,G))}const He=R=>s.go(R);let dt;const de=new Set,ke={currentRoute:l,listening:!0,addRoute:_,removeRoute:P,clearRoutes:t.clearRoutes,hasRoute:F,getRoutes:I,resolve:q,options:e,push:U,replace:ie,go:He,back:()=>He(-1),forward:()=>He(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Ae.add,isReady:rt,install(R){R.component("RouterLink",_h),R.component("RouterView",xh),R.config.globalProperties.$router=ke,Object.defineProperty(R.config.globalProperties,"$route",{enumerable:!0,get:()=>$e(l)}),pr&&!dt&&l.value===An&&(dt=!0,U(s.location).catch(fe=>{}));const G={};for(const fe in An)Object.defineProperty(G,fe,{get:()=>l.value[fe],enumerable:!0});R.provide(Fs,ke),R.provide(li,gl(G)),R.provide(Oo,l);const J=R.unmount;de.add(R),R.unmount=function(){de.delete(R),de.size<1&&(d=An,Pe&&Pe(),Pe=null,l.value=An,dt=!1,je=!1),J()}}};function Te(R){return R.reduce((G,J)=>G.then(()=>te(J)),Promise.resolve())}return ke}function Ch(){return Gt(Fs)}function Eh(e){return Gt(li)}const Sa=768;function _c(){const e=B(typeof window<"u"?window.innerWidth<Sa:!1);let t=null;function n(r){e.value=r.matches}return Ln(()=>{t=window.matchMedia(`(max-width: ${Sa-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),Os(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Ih={key:0,class:"desktop-sidebar"},Rh={class:"desktop-main"},xa="codex-web-local.sidebar-width.v1",$h=260,Mh=620,Aa=320,Ph=kt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=_c();function r(d){return Math.min(Mh,Math.max($h,d))}function s(){if(typeof window>"u")return Aa;const d=window.localStorage.getItem(xa),c=Number(d);return Number.isFinite(c)?r(c):Aa}const o=B(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(xa,String(d))}function l(d){d.preventDefault();const c=d.clientX,f=o.value,m=P=>{const I=P.clientX-c;o.value=r(f+I)},_=()=>{a(o.value),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",m),window.addEventListener("mouseup",_)}return(d,c)=>(k(),C("div",{class:lt(["desktop-layout",{"is-mobile":$e(n)}]),style:rr(i.value)},[$e(n)?(k(),ot(Il,{key:0,to:"body"},[Ce(qd,{name:"drawer"},{default:nt(()=>[e.isSidebarCollapsed?ge("",!0):(k(),C("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=f=>d.$emit("close-sidebar"))},[b("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=ut(()=>{},["stop"]))},[sn(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ge("",!0),$e(n)?ge("",!0):(k(),C(Le,{key:1},[e.isSidebarCollapsed?ge("",!0):(k(),C("aside",Ih,[sn(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?ge("",!0):(k(),C("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),b("section",Rh,[sn(d.$slots,"content",{},void 0)])],6))}}),Ge=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Nh=Ge(Ph,[["__scopeId","data-v-2039d51b"]]),Oh={},jh={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Lh(e,t){return k(),C("svg",jh,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2m2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8m-9 4h4"},null,-1)])])}const co=Ge(Oh,[["render",Lh]]),Dh={},Bh={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Fh(e,t){return k(),C("svg",Bh,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const ci=Ge(Dh,[["render",Fh]]),Hh={},Uh={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Vh(e,t){return k(),C("svg",Uh,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const kc=Ge(Hh,[["render",Vh]]),qh={},Wh={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Kh(e,t){return k(),C("svg",Wh,[...t[0]||(t[0]=[b("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 Ca=Ge(qh,[["render",Kh]]),Gh={},zh={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Yh(e,t){return k(),C("svg",zh,[...t[0]||(t[0]=[b("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 Ss=Ge(Gh,[["render",Yh]]),Jh={},Qh={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Xh(e,t){return k(),C("svg",Qh,[...t[0]||(t[0]=[b("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 Zh=Ge(Jh,[["render",Xh]]),ep={},tp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function np(e,t){return k(),C("svg",tp,[...t[0]||(t[0]=[b("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 rp=Ge(ep,[["render",np]]),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 k(),C("svg",op,[...t[0]||(t[0]=[b("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 uo=Ge(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 k(),C("svg",lp,[...t[0]||(t[0]=[b("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 fo=Ge(ap,[["render",cp]]),up={key:0,class:"sidebar-menu-row-left"},dp={class:"sidebar-menu-row-main"},fp={key:1,class:"sidebar-menu-row-right"},hp={key:0,class:"sidebar-menu-row-right-default"},pp={key:1,class:"sidebar-menu-row-right-hover"},mp=kt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=Zu(),r=ce(()=>!!n.left),s=ce(()=>!!n.right),o=ce(()=>!!n["right-hover"]),i=ce(()=>s.value||o.value);return(a,l)=>(k(),ot(Ju(t.as),rc({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:nt(()=>[r.value?(k(),C("span",up,[sn(a.$slots,"left",{},void 0,!0)])):ge("",!0),b("span",dp,[sn(a.$slots,"default",{},void 0,!0)]),i.value?(k(),C("span",fp,[s.value?(k(),C("span",hp,[sn(a.$slots,"right",{},void 0,!0)])):ge("",!0),o.value?(k(),C("span",pp,[sn(a.$slots,"right-hover",{},void 0,!0)])):ge("",!0)])):ge("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Jn=Ge(mp,[["__scopeId","data-v-daeca4df"]]),gp={class:"thread-tree-root"},vp={key:0,class:"pinned-section"},yp={class:"thread-list"},wp={class:"thread-left-stack"},bp=["data-state"],_p=["onClick"],kp=["onClick"],Tp={class:"thread-row-title-wrap"},Sp={class:"thread-row-title"},xp={class:"thread-row-time"},Ap=["data-confirm","onClick"],Cp={key:0},Ep=["aria-expanded"],Ip=["data-active"],Rp={key:0},$p=["data-active"],Mp={key:0},Pp={key:1,class:"thread-tree-no-results"},Np={key:2,class:"thread-tree-loading"},Op={key:3,class:"thread-list thread-list-global"},jp={class:"thread-left-stack"},Lp=["data-state"],Dp=["onClick"],Bp=["onClick"],Fp={class:"thread-row-title-wrap"},Hp={class:"thread-row-title"},Up={class:"thread-row-time"},Vp=["data-confirm","onClick"],qp={key:0},Wp=["data-project-name","data-expanded","data-dragging"],Kp={class:"project-icon-stack"},Gp={class:"project-icon-folder"},zp={class:"project-icon-chevron"},Yp=["data-dragging-handle","onMousedown"],Jp={class:"project-title"},Qp={class:"project-hover-controls"},Xp=["onClick"],Zp=["onClick"],em=["onClick"],tm=["onInput"],nm=["aria-label","title","onClick"],rm={key:0,class:"thread-list"},sm={class:"thread-left-stack"},om=["data-state"],im=["onClick"],am=["onClick"],lm={class:"thread-row-title-wrap"},cm={class:"thread-row-title"},um={class:"thread-row-time"},dm=["data-confirm","onClick"],fm={key:0},hm=["onClick"],pm=4,Ea=6,Ia="codex-web-local.thread-view-mode.v1",Ra="codex-web-local.collapsed-projects.v1",mm=kt({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{}},emits:["select","archive","start-new-thread","rename-project","remove-project","reorder-project"],setup(e,{emit:t}){const n=e,r=t,s=B({}),o=B({}),i=B([]),a=B(""),l=B(""),d=B("actions"),c=B(""),f=B(null),m=B(null),_=B(null);let P=null,I=null;const F=B(""),q=B({}),$=new Map,V=new Map,U=new WeakMap,ie=B(null),ae=B(!1),oe=B(Z()),ue=typeof window<"u"?new ResizeObserver(T=>{for(const M of T){const N=M.target,Y=U.get(N);Y&&v(Y,N)}}):null;function te(){if(typeof window>"u")return{};try{const T=window.localStorage.getItem(Ra);if(!T)return{};const M=JSON.parse(T);return!M||typeof M!="object"||Array.isArray(M)?{}:M}catch{return{}}}function Z(){return typeof window>"u"?"project":window.localStorage.getItem(Ia)==="chronological"?"chronological":"project"}o.value=te(),ct(o,T=>{typeof window>"u"||window.localStorage.setItem(Ra,JSON.stringify(T))},{deep:!0}),ct(oe,T=>{typeof window>"u"||window.localStorage.setItem(Ia,T)});const pe=ce(()=>n.searchQuery.trim().toLowerCase()),Q=ce(()=>pe.value.length>0);function Pe(T){if(!Q.value)return!0;const M=pe.value;return T.title.toLowerCase().includes(M)||T.preview.toLowerCase().includes(M)}const We=ce(()=>Q.value?n.groups.map(T=>({...T,threads:T.threads.filter(Pe)})).filter(T=>T.threads.length>0):n.groups),et=ce(()=>oe.value==="chronological"),Ae=ce(()=>{const T=We.value,M=[];for(const N of T)for(const Y of N.threads)de(Y.id)||M.push(Y);return M.sort((N,Y)=>{const Fe=new Date(N.updatedAtIso||N.createdAtIso).getTime();return new Date(Y.updatedAtIso||Y.createdAtIso).getTime()-Fe})}),je=ce(()=>{const T=new Map;for(const M of n.groups)for(const N of M.threads)T.set(N.id,N);return T}),xe=ce(()=>i.value.map(T=>je.value.get(T)??null).filter(T=>T!==null).filter(Pe)),rt=ce(()=>{const T=_.value;if(!T||T.dropTargetIndexFull===null||n.groups.length===0)return null;const M=Math.max(0,Math.min(T.dropTargetIndexFull,n.groups.length)),N=M>T.fromIndex?M-1:M,Y=Math.max(0,Math.min(N,n.groups.length-1));return Y===T.fromIndex?null:Y}),Ye=ce(()=>{const M=(Q.value?We.value:n.groups).map(jt=>jt.projectName),N=_.value,Y=rt.value;if(!N||Y===null)return M;const Fe=[...M],[yt]=Fe.splice(N.fromIndex,1);return yt?(Fe.splice(Y,0,yt),Fe):M}),Ze=ce(()=>{const T={};let M=0;for(const N of Ye.value)T[N]=M,M+=ve(N);return T}),He=ce(()=>{let T=0;for(const M of Ye.value)T+=ve(M);return{height:`${Math.max(0,T)}px`}});function dt(T){const M=new Date(T).getTime();if(Number.isNaN(M))return"n/a";const N=Math.abs(Date.now()-M);if(N<6e4)return"now";const Y=Math.floor(N/6e4);if(Y<60)return`${Y}m`;const Fe=Math.floor(Y/60);return Fe<24?`${Fe}h`:`${Math.floor(Fe/24)}d`}function de(T){return i.value.includes(T)}function ke(T){if(de(T)){i.value=i.value.filter(M=>M!==T);return}i.value=[T,...i.value]}function Te(T){r("select",T)}function R(T){if(a.value!==T){a.value=T;return}a.value="",i.value=i.value.filter(M=>M!==T),r("archive",T)}function G(T){return`start new thread ${Ie(T)}`}function J(T){r("start-new-thread",T)}function fe(T){a.value===T&&(a.value="")}function Ie(T){return n.projectDisplayNameById[T]??T}function p(T){return l.value===T}function y(){l.value="",d.value="actions",c.value=""}function x(){ae.value=!ae.value}function O(T){oe.value=T,ae.value=!1}function H(T){if(l.value===T){y();return}l.value=T,d.value="actions",c.value=Ie(T)}function D(T){l.value=T,d.value="rename",c.value=Ie(T)}function ne(T){r("rename-project",{projectName:T,displayName:c.value})}function z(T){r("remove-project",T),y()}function X(T,M){if(!T.altKey||T.key!=="ArrowUp"&&T.key!=="ArrowDown")return;const N=n.groups.findIndex(yt=>yt.projectName===M);if(N<0)return;const Y=T.key==="ArrowUp"?-1:1,Fe=Math.max(0,Math.min(N+Y,n.groups.length-1));Fe!==N&&(T.preventDefault(),r("reorder-project",{projectName:M,toIndex:Fe}))}function W(T){return s.value[T]===!0}function le(T){return o.value[T]===!0}function re(T){s.value={...s.value,[T]:!W(T)}}function ye(T){if(F.value===T){F.value="";return}o.value={...o.value,[T]:!le(T)}}function ve(T){const M=q.value[T]??0,N=_.value,Fe=((N==null?void 0:N.projectName)===T?N.groupHeight:null)??M,yt=le(T)?0:Ea;return Math.max(0,Fe+yt)}function Ee(T,M){const N=M instanceof HTMLElement?M:M&&"$el"in M&&M.$el instanceof HTMLElement?M.$el:null;if(N){V.set(T,N);return}V.delete(T)}function Oe(T){const M=l.value;if(!M)return!1;const N=V.get(M);if(!N)return!1;if((typeof T.composedPath=="function"?T.composedPath():[]).includes(N))return!0;const Fe=T.target;return Fe instanceof Node?N.contains(Fe):!1}function Be(T){if(ae.value){const M=ie.value,N=typeof T.composedPath=="function"?T.composedPath():[];!!M&&(N.includes(M)||T.target instanceof Node&&M.contains(T.target))||(ae.value=!1)}l.value&&(Oe(T)||y())}function Ve(T){l.value&&(Oe(T)||y())}function qe(){ae.value&&(ae.value=!1),l.value&&y()}function ft(){window.addEventListener("pointerdown",Be,{capture:!0}),window.addEventListener("focusin",Ve,{capture:!0}),window.addEventListener("blur",qe)}function S(){window.removeEventListener("pointerdown",Be,{capture:!0}),window.removeEventListener("focusin",Ve,{capture:!0}),window.removeEventListener("blur",qe)}function v(T,M){const N=M.getBoundingClientRect().height;if(!Number.isFinite(N)||N<=0)return;const Y=q.value[T];Y!==void 0&&Math.abs(Y-N)<.5||(q.value={...q.value,[T]:N})}function g(T,M){const N=$.get(T);N&&N!==M&&ue&&ue.unobserve(N);const Y=M instanceof HTMLElement?M:M&&"$el"in M&&M.$el instanceof HTMLElement?M.$el:null;if(Y){$.set(T,Y),U.set(Y,T),v(T,Y),ue==null||ue.observe(Y);return}N&&(ue==null||ue.unobserve(N)),$.delete(T)}function E(T,M){if(T.button!==0||m.value||_.value)return;const N=n.groups.findIndex(jt=>jt.projectName===M),Y=$.get(M);if(N<0||!Y)return;const Fe=Y.getBoundingClientRect(),yt=le(M)?0:Ea;m.value={projectName:M,fromIndex:N,startClientX:T.clientX,startClientY:T.clientY,pointerOffsetY:T.clientY-Fe.top,groupLeft:Fe.left,groupWidth:Fe.width,groupHeight:Fe.height,groupOuterHeight:Fe.height+yt},T.preventDefault(),ee()}function ee(){window.addEventListener("mousemove",Ue),window.addEventListener("mouseup",me),window.addEventListener("keydown",he)}function _e(){window.removeEventListener("mousemove",Ue),window.removeEventListener("mouseup",me),window.removeEventListener("keydown",he)}function Ue(T){P={clientX:T.clientX,clientY:T.clientY},vt()}function me(T){Xt({clientX:T.clientX,clientY:T.clientY});const M=_.value;if(M&&rt.value!==null){const N=n.groups.findIndex(Y=>Y.projectName===M.projectName);if(N>=0){const Y=rt.value;Y!==N&&r("reorder-project",{projectName:M.projectName,toIndex:Y})}}tt()}function he(T){T.key==="Escape"&&(!m.value&&!_.value||(T.preventDefault(),tt()))}function tt(){I!==null&&(window.cancelAnimationFrame(I),I=null),P=null,m.value=null,_.value=null,F.value="",_e()}function vt(){I===null&&(I=window.requestAnimationFrame(()=>{if(I=null,!P)return;const T=P;P=null,Xt(T)}))}function Xt(T){const M=m.value;if(!_.value&&M){const N=T.clientX-M.startClientX,Y=T.clientY-M.startClientY;if(Math.hypot(N,Y)<pm)return;y(),F.value=M.projectName,_.value={projectName:M.projectName,fromIndex:M.fromIndex,pointerOffsetY:M.pointerOffsetY,groupLeft:M.groupLeft,groupWidth:M.groupWidth,groupHeight:M.groupHeight,groupOuterHeight:M.groupOuterHeight,ghostTop:T.clientY-M.pointerOffsetY,dropTargetIndexFull:null}}_.value&&Tn(T)}function Tn(T){const M=_.value;if(!M)return;if(M.ghostTop=T.clientY-M.pointerOffsetY,!sr(T)){M.dropTargetIndexFull=null;return}const N=T.clientY,Y=f.value;if(!Y){M.dropTargetIndexFull=null;return}const Fe=Y.getBoundingClientRect(),yt=new Map(n.groups.map((Nt,un)=>[Nt.projectName,un])),jt=n.groups.map(Nt=>Nt.projectName).filter(Nt=>Nt!==M.projectName);let cn=0,Fn=n.groups.length;for(const Nt of jt){const un=yt.get(Nt);if(un===void 0)continue;const Hn=ve(Nt),Cr=Fe.top+cn+Hn/2;if(N<Cr){Fn=un;break}cn+=Hn}M.dropTargetIndexFull=Fn}function sr(T){const M=f.value;if(!M)return!1;const N=M.getBoundingClientRect(),Y=T.clientX>=N.left&&T.clientX<=N.right,Fe=T.clientY>=N.top-32&&T.clientY<=N.bottom+32;return Y&&Fe}function Bn(T){var M;return((M=_.value)==null?void 0:M.projectName)===T}function or(T){const M=_.value,N=Ze.value[T]??0,Y=l.value===T;return!M||M.projectName!==T?{position:"absolute",top:"0",left:"0",right:"0",zIndex:Y?"40":"1",transform:`translate3d(0, ${N}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${M.groupLeft}px`,width:`${M.groupWidth}px`,height:`${M.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${M.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function an(T){return T.threads.filter(M=>!de(M.id))}function Sr(T){if(Q.value)return an(T);if(le(T.projectName))return[];const M=an(T);return W(T.projectName)?M:M.slice(0,10)}function xr(T){return Q.value?!1:!le(T.projectName)&&an(T).length>10}function Ar(T){return an(T).length>0}function ln(T){return T.inProgress?"working":T.unread?"unread":"idle"}ct(()=>n.groups.map(T=>T.projectName),T=>{var Fe,yt;const M=((Fe=_.value)==null?void 0:Fe.projectName)??((yt=m.value)==null?void 0:yt.projectName)??"";M&&!n.groups.some(jt=>jt.projectName===M)&&tt();const N=new Set(T),Y=Object.fromEntries(Object.entries(q.value).filter(([jt])=>N.has(jt)));Object.keys(Y).length!==Object.keys(q.value).length&&(q.value=Y)});const ir=ce(()=>ae.value||l.value!=="");return ct(ir,T=>{if(T){ft();return}S()}),Dn(()=>{for(const T of $.values())ue==null||ue.unobserve(T);$.clear(),V.clear(),S(),tt()}),(T,M)=>(k(),C("section",gp,[xe.value.length>0?(k(),C("section",vp,[b("ul",yp,[(k(!0),C(Le,null,pt(xe.value,N=>(k(),C("li",{key:N.id,class:"thread-row-item"},[Ce(Jn,{class:"thread-row","data-active":N.id===e.selectedThreadId,"data-pinned":de(N.id),onMouseleave:Y=>fe(N.id)},{left:nt(()=>[b("span",wp,[N.inProgress||N.unread?(k(),C("span",{key:0,class:"thread-status-indicator","data-state":ln(N)},null,8,bp)):ge("",!0),b("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Y=>ke(N.id)},[Ce(fo,{class:"thread-icon"})],8,_p)])]),right:nt(()=>[b("span",xp,we(dt(N.createdAtIso||N.updatedAtIso)),1)]),"right-hover":nt(()=>[b("button",{class:"thread-archive-button","data-confirm":a.value===N.id,type:"button",title:"archive_thread",onClick:Y=>R(N.id)},[a.value===N.id?(k(),C("span",Cp,"confirm")):(k(),ot(co,{key:1,class:"thread-icon"}))],8,Ap)]),default:nt(()=>[b("button",{class:"thread-main-button",type:"button",onClick:Y=>Te(N.id)},[b("span",Tp,[b("span",Sp,we(N.title),1),N.hasWorktree?(k(),ot(uo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ge("",!0)])],8,kp)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):ge("",!0),Ce(Jn,{as:"header",class:"thread-tree-header-row"},{right:nt(()=>[b("div",{ref_key:"organizeMenuWrapRef",ref:ie,class:"organize-menu-wrap"},[b("button",{class:"organize-menu-trigger",type:"button","aria-expanded":ae.value,"aria-label":"Organize threads",title:"Organize threads",onClick:x},[Ce(Ca,{class:"thread-icon"})],8,Ep),ae.value?(k(),C("div",{key:0,class:"organize-menu-panel",onClick:M[2]||(M[2]=ut(()=>{},["stop"]))},[M[7]||(M[7]=b("p",{class:"organize-menu-title"},"Organize",-1)),b("button",{class:"organize-menu-item","data-active":oe.value==="project",type:"button",onClick:M[0]||(M[0]=N=>O("project"))},[M[5]||(M[5]=b("span",null,"By project",-1)),oe.value==="project"?(k(),C("span",Rp,"✓")):ge("",!0)],8,Ip),b("button",{class:"organize-menu-item","data-active":oe.value==="chronological",type:"button",onClick:M[1]||(M[1]=N=>O("chronological"))},[M[6]||(M[6]=b("span",null,"Chronological list",-1)),oe.value==="chronological"?(k(),C("span",Mp,"✓")):ge("",!0)],8,$p)])):ge("",!0)],512)]),default:nt(()=>[M[8]||(M[8]=b("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Q.value&&We.value.length===0?(k(),C("p",Pp,"No matching threads")):e.isLoading&&e.groups.length===0?(k(),C("p",Np,"Loading threads...")):et.value?(k(),C("ul",Op,[(k(!0),C(Le,null,pt(Ae.value,N=>(k(),C("li",{key:N.id,class:"thread-row-item"},[Ce(Jn,{class:"thread-row","data-active":N.id===e.selectedThreadId,"data-pinned":de(N.id),onMouseleave:Y=>fe(N.id)},{left:nt(()=>[b("span",jp,[N.inProgress||N.unread?(k(),C("span",{key:0,class:"thread-status-indicator","data-state":ln(N)},null,8,Lp)):ge("",!0),b("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Y=>ke(N.id)},[Ce(fo,{class:"thread-icon"})],8,Dp)])]),right:nt(()=>[b("span",Up,we(dt(N.createdAtIso||N.updatedAtIso)),1)]),"right-hover":nt(()=>[b("button",{class:"thread-archive-button","data-confirm":a.value===N.id,type:"button",title:"archive_thread",onClick:Y=>R(N.id)},[a.value===N.id?(k(),C("span",qp,"confirm")):(k(),ot(co,{key:1,class:"thread-icon"}))],8,Vp)]),default:nt(()=>[b("button",{class:"thread-main-button",type:"button",onClick:Y=>Te(N.id)},[b("span",Fp,[b("span",Hp,we(N.title),1),N.hasWorktree?(k(),ot(uo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ge("",!0)])],8,Bp)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(k(),C("div",{key:4,ref_key:"groupsContainerRef",ref:f,class:"thread-tree-groups",style:rr(He.value)},[(k(!0),C(Le,null,pt(We.value,N=>(k(),C("article",{key:N.projectName,ref_for:!0,ref:Y=>g(N.projectName,Y),class:"project-group","data-project-name":N.projectName,"data-expanded":!le(N.projectName),"data-dragging":Bn(N.projectName),style:rr(or(N.projectName))},[Ce(Jn,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:Y=>ye(N.projectName),onKeydown:[Y=>X(Y,N.projectName),Bt(ut(Y=>ye(N.projectName),["prevent"]),["enter"]),Bt(ut(Y=>ye(N.projectName),["prevent"]),["space"])]},{left:nt(()=>[b("span",Kp,[b("span",Gp,[le(N.projectName)?(k(),ot(Zh,{key:0,class:"thread-icon"})):(k(),ot(rp,{key:1,class:"thread-icon"}))]),b("span",zp,[le(N.projectName)?(k(),ot(kc,{key:0,class:"thread-icon"})):(k(),ot(ci,{key:1,class:"thread-icon"}))])])]),right:nt(()=>[b("div",Qp,[b("div",{ref_for:!0,ref:Y=>Ee(N.projectName,Y),class:"project-menu-wrap"},[b("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:ut(Y=>H(N.projectName),["stop"])},[Ce(Ca,{class:"thread-icon"})],8,Xp),p(N.projectName)?(k(),C("div",{key:0,class:"project-menu-panel",onClick:M[4]||(M[4]=ut(()=>{},["stop"]))},[d.value==="actions"?(k(),C(Le,{key:0},[b("button",{class:"project-menu-item",type:"button",onClick:Y=>D(N.projectName)}," Edit name ",8,Zp),b("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:Y=>z(N.projectName)}," Remove ",8,em)],64)):(k(),C(Le,{key:1},[M[9]||(M[9]=b("label",{class:"project-menu-label"},"Project name",-1)),Pn(b("input",{"onUpdate:modelValue":M[3]||(M[3]=Y=>c.value=Y),class:"project-menu-input",type:"text",onInput:Y=>ne(N.projectName)},null,40,tm),[[On,c.value]])],64))])):ge("",!0)],512),b("button",{class:"thread-start-button",type:"button","aria-label":G(N.projectName),title:G(N.projectName),onClick:ut(Y=>J(N.projectName),["stop"])},[Ce(Ss,{class:"thread-icon"})],8,nm)])]),default:nt(()=>[b("span",{class:"project-main-button","data-dragging-handle":Bn(N.projectName),onMousedown:ut(Y=>E(Y,N.projectName),["left"])},[b("span",Jp,we(Ie(N.projectName)),1)],40,Yp)]),_:2},1032,["onClick","onKeydown"]),Ar(N)?(k(),C("ul",rm,[(k(!0),C(Le,null,pt(Sr(N),Y=>(k(),C("li",{key:Y.id,class:"thread-row-item"},[Ce(Jn,{class:"thread-row","data-active":Y.id===e.selectedThreadId,"data-pinned":de(Y.id),onMouseleave:Fe=>fe(Y.id)},{left:nt(()=>[b("span",sm,[Y.inProgress||Y.unread?(k(),C("span",{key:0,class:"thread-status-indicator","data-state":ln(Y)},null,8,om)):ge("",!0),b("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Fe=>ke(Y.id)},[Ce(fo,{class:"thread-icon"})],8,im)])]),right:nt(()=>[b("span",um,we(dt(Y.createdAtIso||Y.updatedAtIso)),1)]),"right-hover":nt(()=>[b("button",{class:"thread-archive-button","data-confirm":a.value===Y.id,type:"button",title:"archive_thread",onClick:Fe=>R(Y.id)},[a.value===Y.id?(k(),C("span",fm,"confirm")):(k(),ot(co,{key:1,class:"thread-icon"}))],8,dm)]),default:nt(()=>[b("button",{class:"thread-main-button",type:"button",onClick:Fe=>Te(Y.id)},[b("span",lm,[b("span",cm,we(Y.title),1),Y.hasWorktree?(k(),ot(uo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ge("",!0)])],8,am)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(k(),ot(Jn,{key:1,as:"p",class:"project-empty-row"},{left:nt(()=>[...M[10]||(M[10]=[b("span",{class:"project-empty-spacer"},null,-1)])]),default:nt(()=>[M[11]||(M[11]=b("span",{class:"project-empty"},"No threads",-1))]),_:1})),xr(N)?(k(),ot(Jn,{key:2,class:"thread-show-more-row"},{left:nt(()=>[...M[12]||(M[12]=[b("span",{class:"thread-show-more-spacer"},null,-1)])]),default:nt(()=>[b("button",{class:"thread-show-more-button",type:"button",onClick:Y=>re(N.projectName)},we(W(N.projectName)?"Show less":"Show more"),9,hm)]),_:2},1024)):ge("",!0)],12,Wp))),128))],4))]))}}),gm=Ge(mm,[["__scopeId","data-v-5bbc0cb5"]]),vm={class:"content-header"},ym={class:"content-leading"},wm={class:"content-title"},bm={class:"content-actions"},_m=kt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(k(),C("header",vm,[b("div",ym,[sn(t.$slots,"leading",{},void 0)]),b("h1",wm,we(e.title),1),b("div",bm,[sn(t.$slots,"actions",{},void 0)])]))}}),km=Ge(_m,[["__scopeId","data-v-66ee223c"]]),Tm={},Sm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function xm(e,t){return k(),C("svg",Sm,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const ui=Ge(Tm,[["render",xm]]),Am={},Cm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Em(e,t){return k(),C("svg",Cm,[...t[0]||(t[0]=[b("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 Im=Ge(Am,[["render",Em]]),Rm={class:"conversation-root"},$m={key:0,class:"conversation-loading"},Mm={key:1,class:"conversation-empty"},Pm={class:"message-row"},Nm={class:"message-stack"},Om={class:"request-card"},jm={class:"request-title"},Lm={class:"request-meta"},Dm={key:0,class:"request-reason"},Bm={key:1,class:"request-actions"},Fm=["onClick"],Hm=["onClick"],Um=["onClick"],Vm=["onClick"],qm={key:2,class:"request-actions"},Wm=["onClick"],Km=["onClick"],Gm=["onClick"],zm=["onClick"],Ym={key:3,class:"request-user-input"},Jm={class:"request-question-title"},Qm={key:0,class:"request-question-text"},Xm=["value","onChange"],Zm=["value"],eg=["value","onInput"],tg=["onClick"],ng={key:4,class:"request-actions"},rg=["onClick"],sg=["onClick"],og={key:5,class:"request-actions"},ig=["onClick"],ag=["onClick"],lg=["data-role","data-message-type"],cg={key:0,class:"message-row","data-role":"system"},ug={class:"message-stack","data-role":"system"},dg=["onClick"],fg={class:"cmd-label"},hg={class:"cmd-status"},pg={class:"cmd-output-inner"},mg={class:"cmd-output"},gg=["data-role","data-message-type"],vg=["data-role"],yg=["data-role"],wg=["data-role"],bg=["onClick"],_g=["src"],kg={key:1,class:"message-file-attachments"},Tg=["title"],Sg=["data-role"],xg={key:0,class:"worked-separator-wrap","aria-live":"polite"},Ag=["onClick"],Cg={class:"worked-separator-text"},Eg={key:0,class:"worked-details"},Ig=["onClick"],Rg={class:"cmd-label"},$g={class:"cmd-status"},Mg={class:"cmd-output-inner"},Pg={class:"cmd-output"},Ng={key:1,class:"message-text-flow"},Og={key:0,class:"message-text"},jg={key:0},Lg={key:2,class:"message-inline-code"},Dg={key:1,class:"message-text"},Bg=["onClick"],Fg=["src","alt","onError"],Hg=["onClick"],Ug={key:0,class:"conversation-item conversation-item-overlay"},Vg={class:"message-row"},qg={class:"message-stack"},Wg={class:"live-overlay-inline","aria-live":"polite"},Kg={class:"live-overlay-label"},Gg={key:0,class:"live-overlay-reasoning"},zg={key:1,class:"live-overlay-error"},Yg=["src"],Jg=16,Qg=kt({__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=B(new Set),r=B(new Set),s=B(new Set),o=B({});function i(S){return S.messageType==="commandExecution"&&!!S.commandExecution}function a(S){var v;return((v=S.commandExecution)==null?void 0:v.status)==="inProgress"||r.value.has(S.id)?!0:n.value.has(S.id)}function l(S){return r.value.has(S.id)}function d(S){var g;if(((g=S.commandExecution)==null?void 0:g.status)==="inProgress")return;const v=new Set(n.value);v.has(S.id)?v.delete(S.id):v.add(S.id),n.value=v}function c(S){const v=new Set(s.value);v.has(S.id)?v.delete(S.id):v.add(S.id),s.value=v}function f(S){return s.value.has(S.id)}function m(S){const v=S.commandExecution;if(!v)return"";switch(v.status){case"inProgress":return"⟳ Running";case"completed":return v.exitCode===0?"✓ Completed":`✗ Exit ${v.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function _(S){var g,E;const v=(g=S.commandExecution)==null?void 0:g.status;return v==="inProgress"?"cmd-status-running":v==="completed"&&((E=S.commandExecution)==null?void 0:E.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function P(S){const v=new Set(r.value);v.add(S),r.value=v,setTimeout(()=>{const g=new Set(r.value);g.delete(S),r.value=g},1e3)}function I(S,v){const g=[];for(let E=v-1;E>=0;E--){const ee=S[E];if(ee.messageType==="commandExecution")g.unshift(ee);else if(ee.role==="user"||ee.messageType==="worked")break}return g}const F=e,q=t,$=B(null),V=B(null),U=B(""),ie=B({}),ae=B({});let oe=0,ue=0,te=0;const Z=new WeakSet,pe=B(new Set);function Q(S){if(!S||/\s/u.test(S)||S.endsWith("/")||S.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(S))return!1;const v=S.startsWith("/"),g=/^[A-Za-z]:[\\/]/u.test(S),E=S.startsWith("./")||S.startsWith("../")||S.startsWith("~/"),ee=S.includes("/")||S.includes("\\");return v||g||E||ee}function Pe(S){return S.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||S}function We(S){if(!S)return null;let v=S,g=null;const E=v.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(E)v=E[1],g=Number(E[2]);else{const ee=v.match(/^(.*):(\d+)(?::\d+)?$/u);ee&&(v=ee[1],g=Number(ee[2]))}return Q(v)?{path:v,line:g}:null}function et(S){if(!S.includes("`"))return[{kind:"text",value:S}];const v=[];let g=0,E=0;for(;g<S.length;){if(S[g]!=="`"){g+=1;continue}let ee=1;for(;g+ee<S.length&&S[g+ee]==="`";)ee+=1;const _e="`".repeat(ee);let Ue=g+ee,me=-1;for(;Ue<S.length;){const tt=S.indexOf(_e,Ue);if(tt<0)break;const vt=tt>0&&S[tt-1]==="`",Xt=tt+ee<S.length&&S[tt+ee]==="`",Tn=S.slice(g+ee,tt).includes(`
26
- `);if(!vt&&!Xt&&!Tn){me=tt;break}Ue=tt+1}if(me<0){g+=ee;continue}g>E&&v.push({kind:"text",value:S.slice(E,g)});const he=S.slice(g+ee,me);if(he.length>0){const tt=We(he);if(tt){const vt=Pe(tt.path),Xt=tt.line?`${vt} (line ${String(tt.line)})`:vt;v.push({kind:"file",value:he,displayName:Xt})}else v.push({kind:"code",value:he})}else v.push({kind:"text",value:`${_e}${_e}`});g=me+ee,E=g}return E<S.length&&v.push({kind:"text",value:S.slice(E)}),v}function Ae(S){const v=S.trim();if(!v)return"";if(v.startsWith("data:")||v.startsWith("blob:")||v.startsWith("http://")||v.startsWith("https://")||v.startsWith("/codex-local-image?"))return v;if(v.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(v)}`;const g=v.startsWith("/"),E=/^[A-Za-z]:[\\/]/u.test(v);return g||E?`/codex-local-image?path=${encodeURIComponent(v)}`:v}function je(S){if(!S.includes("![")||!S.includes("]("))return[{kind:"text",value:S}];const v=[],g=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let E=0;for(const ee of S.matchAll(g)){const[_e,Ue,me]=ee;if(typeof ee.index!="number")continue;const he=ee.index,tt=he+_e.length,vt=Ae(me.trim());vt&&(he>E&&v.push({kind:"text",value:S.slice(E,he)}),v.push({kind:"image",url:vt,alt:Ue.trim(),markdown:_e}),E=tt)}return E<S.length&&v.push({kind:"text",value:S.slice(E)}),v.length>0?v:[{kind:"text",value:S}]}function xe(S){return S!==null&&typeof S=="object"&&!Array.isArray(S)?S:null}function rt(S){const v=new Date(S);return Number.isNaN(v.getTime())?S:v.toLocaleTimeString()}function Ye(S){const v=xe(S.params),g=v==null?void 0:v.reason;return typeof g=="string"?g.trim():""}function Ze(S,v){return`${String(S)}:${v}`}function He(S){const v=xe(S.params),g=Array.isArray(v==null?void 0:v.questions)?v.questions:[],E=[];for(const ee of g){const _e=xe(ee);if(!_e)continue;const Ue=typeof _e.id=="string"?_e.id:"";if(!Ue)continue;const me=Array.isArray(_e.options)?_e.options.map(he=>xe(he)).map(he=>he==null?void 0:he.label).filter(he=>typeof he=="string"&&he.length>0):[];E.push({id:Ue,header:typeof _e.header=="string"?_e.header:"",question:typeof _e.question=="string"?_e.question:"",isOther:_e.isOther===!0,options:me})}return E}function dt(S,v,g){const E=Ze(S,v),ee=ie.value[E];return typeof ee=="string"&&ee.length>0?ee:g}function de(S,v){const g=Ze(S,v);return ae.value[g]??""}function ke(S,v,g){const E=g.target;if(!(E instanceof HTMLSelectElement))return;const ee=Ze(S,v);ie.value={...ie.value,[ee]:E.value}}function Te(S,v,g){const E=g.target;if(!(E instanceof HTMLInputElement))return;const ee=Ze(S,v);ae.value={...ae.value,[ee]:E.value}}function R(S,v){q("respondServerRequest",{id:S,result:{decision:v}})}function G(S){const v=He(S),g={};for(const E of v){const ee=dt(S.id,E.id,E.options[0]||""),_e=de(S.id,E.id).trim(),Ue=[ee,_e].map(me=>me.trim()).filter(me=>me.length>0);g[E.id]={answers:Ue}}q("respondServerRequest",{id:S.id,result:{answers:g}})}function J(S){q("respondServerRequest",{id:S,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function fe(S){q("respondServerRequest",{id:S,result:{success:!0,contentItems:[]}})}function Ie(S){q("respondServerRequest",{id:S,result:{}})}function p(S){q("respondServerRequest",{id:S,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function y(S){return!(S.role!=="user"&&S.role!=="assistant"||typeof S.turnIndex!="number"||F.isTurnInProgress||F.isRollingBack)}function x(S){y(S)&&q("rollback",{turnIndex:S.turnIndex})}function O(){const S=$.value,v=V.value;!S||!v||(S.scrollTop=S.scrollHeight,v.scrollIntoView({block:"end"}))}function H(S){return S.scrollHeight-(S.scrollTop+S.clientHeight)<=Jg}function D(S){if(!F.activeThreadId)return;const v=Math.max(S.scrollHeight-S.clientHeight,0),g=v>0?Math.min(Math.max(S.scrollTop/v,0),1):1;q("updateScrollState",{threadId:F.activeThreadId,state:{scrollTop:S.scrollTop,isAtBottom:H(S),scrollRatio:g}})}function ne(){const S=$.value;if(!S)return;const v=F.scrollState;if(!v||v.isAtBottom){z();return}const g=Math.max(S.scrollHeight-S.clientHeight,0),E=typeof v.scrollRatio=="number"?v.scrollRatio*g:v.scrollTop;S.scrollTop=Math.min(Math.max(E,0),g),D(S)}function z(){const S=$.value;S&&(O(),D(S))}function X(){const S=F.scrollState;return!S||S.isAtBottom===!0}function W(){if(!X()){te=0,ue=0;return}if(z(),te-=1,te<=0){ue=0;return}ue=requestAnimationFrame(W)}function le(S=6){X()&&(ue&&(cancelAnimationFrame(ue),ue=0),te=Math.max(S,1),ue=requestAnimationFrame(W))}function re(){le(3)}function ye(){if(!X())return;const S=$.value;if(!S)return;const v=S.querySelectorAll("img.message-image-preview");for(const g of v)g.complete||Z.has(g)||(Z.add(g),g.addEventListener("load",re,{once:!0}),g.addEventListener("error",re,{once:!0}))}async function ve(){await Ft(),oe&&cancelAnimationFrame(oe),oe=requestAnimationFrame(()=>{oe=0,ne(),ye(),le()})}ct(()=>F.messages,async S=>{if(!F.isLoading){for(const v of S){if(v.messageType!=="commandExecution"||!v.commandExecution)continue;const g=o.value[v.id],E=v.commandExecution.status;g==="inProgress"&&E!=="inProgress"&&P(v.id),o.value[v.id]=E}await ve()}}),ct(()=>F.liveOverlay,async S=>{S&&(await Ft(),z(),le(8))},{deep:!0}),ct(()=>F.isLoading,async S=>{S||await ve()}),ct(()=>F.activeThreadId,()=>{U.value="",pe.value=new Set},{flush:"post"});function Ee(){const S=$.value;!S||F.isLoading||D(S)}function Oe(S){U.value=Ae(S)}function Be(S,v){return`${S}:${String(v)}`}function Ve(S,v){const g=new Set(pe.value);g.add(Be(S,v)),pe.value=g}function qe(S,v){return pe.value.has(Be(S,v))}function ft(){U.value=""}return Dn(()=>{oe&&cancelAnimationFrame(oe),ue&&cancelAnimationFrame(ue)}),(S,v)=>(k(),C("section",Rm,[e.isLoading?(k(),C("p",$m,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(k(),C("p",Mm," No messages in this thread yet. ")):(k(),C("ul",{key:2,ref_key:"conversationListRef",ref:$,class:"conversation-list",onScroll:Ee},[(k(!0),C(Le,null,pt(e.pendingRequests,g=>(k(),C("li",{key:`server-request:${g.id}`,class:"conversation-item conversation-item-request"},[b("div",Pm,[b("div",Nm,[b("article",Om,[b("p",jm,we(g.method),1),b("p",Lm,"Request #"+we(g.id)+" · "+we(rt(g.receivedAtIso)),1),Ye(g)?(k(),C("p",Dm,we(Ye(g)),1)):ge("",!0),g.method==="item/commandExecution/requestApproval"?(k(),C("section",Bm,[b("button",{type:"button",class:"request-button request-button-primary",onClick:E=>R(g.id,"accept")},"Accept",8,Fm),b("button",{type:"button",class:"request-button",onClick:E=>R(g.id,"acceptForSession")},"Accept for Session",8,Hm),b("button",{type:"button",class:"request-button",onClick:E=>R(g.id,"decline")},"Decline",8,Um),b("button",{type:"button",class:"request-button",onClick:E=>R(g.id,"cancel")},"Cancel",8,Vm)])):g.method==="item/fileChange/requestApproval"?(k(),C("section",qm,[b("button",{type:"button",class:"request-button request-button-primary",onClick:E=>R(g.id,"accept")},"Accept",8,Wm),b("button",{type:"button",class:"request-button",onClick:E=>R(g.id,"acceptForSession")},"Accept for Session",8,Km),b("button",{type:"button",class:"request-button",onClick:E=>R(g.id,"decline")},"Decline",8,Gm),b("button",{type:"button",class:"request-button",onClick:E=>R(g.id,"cancel")},"Cancel",8,zm)])):g.method==="item/tool/requestUserInput"?(k(),C("section",Ym,[(k(!0),C(Le,null,pt(He(g),E=>(k(),C("div",{key:`${g.id}:${E.id}`,class:"request-question"},[b("p",Jm,we(E.header||E.question),1),E.header&&E.question?(k(),C("p",Qm,we(E.question),1)):ge("",!0),b("select",{class:"request-select",value:dt(g.id,E.id,E.options[0]||""),onChange:ee=>ke(g.id,E.id,ee)},[(k(!0),C(Le,null,pt(E.options,ee=>(k(),C("option",{key:`${g.id}:${E.id}:${ee}`,value:ee},we(ee),9,Zm))),128))],40,Xm),E.isOther?(k(),C("input",{key:1,class:"request-input",type:"text",value:de(g.id,E.id),placeholder:"Other answer",onInput:ee=>Te(g.id,E.id,ee)},null,40,eg)):ge("",!0)]))),128)),b("button",{type:"button",class:"request-button request-button-primary",onClick:E=>G(g)}," Submit Answers ",8,tg)])):g.method==="item/tool/call"?(k(),C("section",ng,[b("button",{type:"button",class:"request-button request-button-primary",onClick:E=>J(g.id)},"Fail Tool Call",8,rg),b("button",{type:"button",class:"request-button",onClick:E=>fe(g.id)},"Success (Empty)",8,sg)])):(k(),C("section",og,[b("button",{type:"button",class:"request-button request-button-primary",onClick:E=>Ie(g.id)},"Return Empty Result",8,ig),b("button",{type:"button",class:"request-button",onClick:E=>p(g.id)},"Reject Request",8,ag)]))])])])]))),128)),(k(!0),C(Le,null,pt(e.messages,g=>{var E,ee;return k(),C("li",{key:g.id,class:lt(["conversation-item",{"conversation-item-rollbackable":y(g)}]),"data-role":g.role,"data-message-type":g.messageType||""},[i(g)?(k(),C("div",cg,[b("div",ug,[b("button",{type:"button",class:lt(["cmd-row",[_(g),{"cmd-expanded":a(g)}]]),onClick:_e=>d(g)},[b("span",{class:lt(["cmd-chevron",{"cmd-chevron-open":a(g)}])},"▶",2),b("code",fg,we(((E=g.commandExecution)==null?void 0:E.command)||"(command)"),1),b("span",hg,we(m(g)),1)],10,dg),b("div",{class:lt(["cmd-output-wrap",{"cmd-output-visible":a(g),"cmd-output-collapsing":l(g)}])},[b("div",pg,[b("pre",mg,we(((ee=g.commandExecution)==null?void 0:ee.aggregatedOutput)||"(no output)"),1)])],2)])])):(k(),C("div",{key:1,class:"message-row","data-role":g.role,"data-message-type":g.messageType||""},[b("div",{class:"message-stack","data-role":g.role},[b("article",{class:"message-body","data-role":g.role},[g.images&&g.images.length>0?(k(),C("ul",{key:0,class:"message-image-list","data-role":g.role},[(k(!0),C(Le,null,pt(g.images,_e=>(k(),C("li",{key:_e,class:"message-image-item"},[b("button",{class:"message-image-button",type:"button",onClick:Ue=>Oe(_e)},[b("img",{class:"message-image-preview",src:Ae(_e),alt:"Message image preview",loading:"lazy"},null,8,_g)],8,bg)]))),128))],8,wg)):ge("",!0),g.fileAttachments&&g.fileAttachments.length>0?(k(),C("div",kg,[(k(!0),C(Le,null,pt(g.fileAttachments,_e=>(k(),C("span",{key:_e.path,class:"message-file-chip"},[v[2]||(v[2]=b("span",{class:"message-file-chip-icon"},"📄",-1)),b("span",{class:"message-file-chip-name",title:_e.path},we(_e.label),9,Tg)]))),128))])):ge("",!0),g.text.length>0?(k(),C("article",{key:2,class:"message-card","data-role":g.role},[g.messageType==="worked"?(k(),C("div",xg,[b("button",{type:"button",class:"worked-separator",onClick:_e=>c(g)},[v[3]||(v[3]=b("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),b("span",{class:lt(["worked-chevron",{"worked-chevron-open":f(g)}])},"▶",2),b("p",Cg,we(g.text),1),v[4]||(v[4]=b("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Ag),f(g)?(k(),C("div",Eg,[(k(!0),C(Le,null,pt(I(e.messages,e.messages.indexOf(g)),_e=>{var Ue,me;return k(),C("div",{key:`worked-cmd-${_e.id}`,class:"worked-cmd-item"},[b("button",{type:"button",class:lt(["cmd-row",[_(_e),{"cmd-expanded":a(_e)}]]),onClick:he=>d(_e)},[b("span",{class:lt(["cmd-chevron",{"cmd-chevron-open":a(_e)}])},"▶",2),b("code",Rg,we(((Ue=_e.commandExecution)==null?void 0:Ue.command)||"(command)"),1),b("span",$g,we(m(_e)),1)],10,Ig),b("div",{class:lt(["cmd-output-wrap",{"cmd-output-visible":a(_e),"cmd-output-collapsing":l(_e)}])},[b("div",Mg,[b("pre",Pg,we(((me=_e.commandExecution)==null?void 0:me.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):ge("",!0)])):(k(),C("div",Ng,[(k(!0),C(Le,null,pt(je(g.text),(_e,Ue)=>(k(),C(Le,{key:`block-${Ue}`},[_e.kind==="text"?(k(),C("p",Og,[(k(!0),C(Le,null,pt(et(_e.value),(me,he)=>(k(),C(Le,{key:`seg-${Ue}-${he}`},[me.kind==="text"?(k(),C("span",jg,we(me.value),1)):me.kind==="file"?(k(),C("a",{key:1,class:"message-file-link",href:"#",onClick:v[0]||(v[0]=ut(()=>{},["prevent"]))},we(me.displayName),1)):(k(),C("code",Lg,we(me.value),1))],64))),128))])):qe(g.id,Ue)?(k(),C("p",Dg,we(_e.markdown),1)):(k(),C("button",{key:2,class:"message-image-button",type:"button",onClick:me=>Oe(_e.url)},[b("img",{class:"message-image-preview message-markdown-image",src:_e.url,alt:_e.alt||"Embedded message image",loading:"lazy",onError:me=>Ve(g.id,Ue)},null,40,Fg)],8,Bg))],64))),128))]))],8,Sg)):ge("",!0)],8,yg),y(g)?(k(),C("button",{key:0,class:"rollback-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:_e=>x(g)},[Ce(Im,{class:"rollback-icon"}),v[5]||(v[5]=b("span",{class:"rollback-label"},"Rollback",-1))],8,Hg)):ge("",!0)],8,vg)],8,gg))],10,lg)}),128)),e.liveOverlay?(k(),C("li",Ug,[b("div",Vg,[b("div",qg,[b("article",Wg,[b("p",Kg,we(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(k(),C("p",Gg,we(e.liveOverlay.reasoningText),1)):ge("",!0),e.liveOverlay.errorText?(k(),C("p",zg,we(e.liveOverlay.errorText),1)):ge("",!0)])])])])):ge("",!0),b("li",{ref_key:"bottomAnchorRef",ref:V,class:"conversation-bottom-anchor"},null,512)],544)),U.value.length>0?(k(),C("div",{key:3,class:"image-modal-backdrop",onClick:ft},[b("div",{class:"image-modal-content",onClick:v[1]||(v[1]=ut(()=>{},["stop"]))},[b("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:ft},[Ce(ui,{class:"icon-svg"})]),b("img",{class:"image-modal-image",src:U.value,alt:"Expanded message image"},null,8,Yg)])])):ge("",!0)]))}}),Xg=Ge(Qg,[["__scopeId","data-v-857238be"]]);function Zg(e){var c;const t=B("idle"),n=B(typeof navigator<"u"&&!!((c=navigator.mediaDevices)!=null&&c.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 P;const m=o,_=(r==null?void 0:r.mimeType)||((P=m[0])==null?void 0:P.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 P;if(f.length===0)return;const _=new Blob(f,{type:m});try{const I=m.split(/[/;]/)[1]??"webm",F=`----codex-transcribe-${crypto.randomUUID()}`,q=new Uint8Array(await _.arrayBuffer()),$=new TextEncoder,V=[];V.push($.encode(`--${F}\r
27
- `)),V.push($.encode(`Content-Disposition: form-data; name="file"; filename="codex.${I}"\r
28
- `)),V.push($.encode(`Content-Type: ${m}\r
29
- \r
30
- `)),V.push(q),V.push($.encode(`\r
31
- --${F}--\r
32
- `));let U=0;for(const Z of V)U+=Z.byteLength;const ie=new Uint8Array(U);let ae=0;for(const Z of V)ie.set(Z,ae),ae+=Z.byteLength;const oe=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${F}`},body:ie});if(!oe.ok)throw new Error(`Transcription failed: ${oe.status}`);const te=((await oe.json()).text??"").trim();te.length>0&&e.onTranscript(te)}catch(I){(P=e.onError)==null||P.call(e,I)}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 Dn(d),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function $a(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class yn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function di(e,t){const n=$a(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=$a(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function Tr(e,t,n){return e instanceof yn?e:e instanceof Error?new yn(e.message||t,{code:"unknown_error",method:n}):new yn(t,{code:"unknown_error",method:n})}function Tc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function ev(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 yn(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 yn(di(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 yn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Ma(e){const t=Tc(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 tv(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=Ma(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)),c=Ma(d);c&&e(c)}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 nv(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 yn(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 yn(di(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function rv(){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 yn(di(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Tc(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Pa(e){return new Date(e*1e3).toISOString()}function sv(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function ov(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const iv=/^##\s+(.+?):\s+(.+?)\s*$/,av=/^#\s*files mentioned by the user\s*:?\s*$/i;function lv(e){var s,o;const t=e.split(`
33
- `).findIndex(i=>av.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(iv);if(!l)break;const d=(s=l[1])==null?void 0:s.trim(),c=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");d&&c&&r.push({label:d,path:c})}return r}function cv(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 uv(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:ov(l),isUnhandled:!0});const o=n.join(`
35
- `),i=lv(o);return{text:cv(o),images:r,fileAttachments:i,rawBlocks:s}}function dv(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=uv(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=fv(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 fv(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function hv(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function pv(e){const t=hv(e);return t.length>0?t:"Untitled thread"}function mv(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:pv(e),projectName:sv(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:Pa(e.createdAt),updatedAtIso:Pa(e.updatedAt),preview:e.preview,unread:!1,inProgress:!1}}function gv(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 vv(e){const t=e.data.map(mv);return gv(t)}function Sc(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 dv(i))n.push({...a,turnIndex:r})}return n}async function qt(e,t){try{return await ev(e,t)}catch(n){throw Tr(n,`RPC ${e} failed`,e)}}function yv(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function wv(){const e=await qt("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return vv(e)}async function bv(e){const t=await qt("thread/read",{threadId:e,includeTurns:!0});return Sc(t)}async function _v(){try{return await wv()}catch(e){throw Tr(e,"Failed to load thread groups","thread/list")}}async function kv(e){try{return await bv(e)}catch(t){throw Tr(t,`Failed to load thread ${e}`,"thread/read")}}function Tv(e){return tv(e)}async function Sv(e,t){await nv({id:e,...t})}async function xv(){return rv()}async function Na(e){await qt("thread/resume",{threadId:e})}async function Av(e){await qt("thread/archive",{threadId:e})}async function Cv(e,t){const n=await qt("thread/rollback",{threadId:e,numTurns:t});return Sc(n)}function Ev(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 Iv(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 qt("thread/start",n),s=Ev(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw Tr(n,"Failed to start a new thread","thread/start")}}function Rv(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 $v(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:Rv(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})),c={threadId:e,input:l};d.length>0&&(c.attachments=d),typeof r=="string"&&r.length>0&&(c.model=r),typeof s=="string"&&s.length>0&&(c.effort=s),await qt("turn/start",c)}catch(a){throw Tr(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function Mv(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 qt("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw Tr(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function Pv(){const e=await qt("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 Nv(){const e=await qt("config/read",{}),t=e.config.model??"",n=yv(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function Ov(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 Oa(){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 Ov(n.data)}async function ja(){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 jv(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 Lv(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=fi(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 Dv(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=fi(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 Bv(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=fi(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}function fi(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 Fv(){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 La(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 Hv(e,t){var n;try{return((n=(await qt("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function Uv(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await qt("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 Vv(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 qv={},Wv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Kv(e,t){return k(),C("svg",Wv,[...t[0]||(t[0]=[b("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 Gv=Ge(qv,[["render",Kv]]),zv={},Yv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Jv(e,t){return k(),C("svg",Yv,[...t[0]||(t[0]=[b("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 Qv=Ge(zv,[["render",Jv]]),Xv={},Zv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ey(e,t){return k(),C("svg",Zv,[...t[0]||(t[0]=[b("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),b("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 ty=Ge(Xv,[["render",ey]]),ny=["disabled"],ry={class:"composer-dropdown-value"},sy={class:"composer-dropdown-menu"},oy={key:0,class:"composer-dropdown-search-wrap"},iy=["placeholder","onKeydown"],ay={class:"composer-dropdown-options",role:"listbox"},ly=["onClick"],cy={key:0,class:"composer-dropdown-empty"},uy={key:1,class:"composer-dropdown-add-wrap"},dy=["placeholder","onKeydown"],fy=kt({__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=B(null),o=B(null),i=B(null),a=B(!1),l=B(""),d=B(!1),c=B(""),f=ce(()=>{var pe;const Z=n.options.find(Q=>Q.value===n.modelValue);return Z?Z.label:((pe=n.placeholder)==null?void 0:pe.trim())||""}),m=ce(()=>n.openDirection??"down"),_=ce(()=>n.enableSearch===!0),P=ce(()=>n.showAddAction===!0),I=ce(()=>{var Z;return((Z=n.searchPlaceholder)==null?void 0:Z.trim())||"Quick search projects"}),F=ce(()=>{var Z;return((Z=n.addActionLabel)==null?void 0:Z.trim())||"Add new project"}),q=ce(()=>{var Z;return((Z=n.addPlaceholder)==null?void 0:Z.trim())||"Project name or absolute path"}),$=ce(()=>{const Z=l.value.trim().toLowerCase();return Z?n.options.filter(pe=>pe.label.toLowerCase().includes(Z)||pe.value.toLowerCase().includes(Z)):n.options});function V(){n.disabled||(a.value=!a.value)}function U(Z){r("update:modelValue",Z),a.value=!1,l.value=""}function ie(){var Z;d.value=!0,c.value=((Z=n.defaultAddValue)==null?void 0:Z.trim())||"",Ft(()=>{var pe;return(pe=i.value)==null?void 0:pe.focus()})}function ae(){if(l.value.length>0){l.value="";return}a.value=!1}function oe(){const Z=c.value.trim();Z&&(r("add",Z),d.value=!1,c.value="",a.value=!1,l.value="")}function ue(){d.value=!1,c.value="",Ft(()=>{var Z;return(Z=o.value)==null?void 0:Z.focus()})}function te(Z){if(!a.value)return;const pe=s.value;if(!pe)return;const Q=Z.target;Q instanceof Node&&(pe.contains(Q)||(a.value=!1,l.value="",d.value=!1,c.value=""))}return ct(a,Z=>{if(!Z){d.value=!1,c.value="";return}_.value&&Ft(()=>{var pe;return(pe=o.value)==null?void 0:pe.focus()})}),Ln(()=>{window.addEventListener("pointerdown",te)}),Dn(()=>{window.removeEventListener("pointerdown",te)}),(Z,pe)=>(k(),C("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[b("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:V},[b("span",ry,we(f.value),1),Ce(ci,{class:"composer-dropdown-chevron"})],8,ny),a.value?(k(),C("div",{key:0,class:lt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":m.value==="up","composer-dropdown-menu-wrap-down":m.value==="down"}])},[b("div",sy,[_.value?(k(),C("div",oy,[Pn(b("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":pe[0]||(pe[0]=Q=>l.value=Q),class:"composer-dropdown-search-input",type:"text",placeholder:I.value,onKeydown:Bt(ut(ae,["prevent"]),["esc"])},null,40,iy),[[On,l.value]])])):ge("",!0),b("ul",ay,[(k(!0),C(Le,null,pt($.value,Q=>(k(),C("li",{key:Q.value},[b("button",{class:lt(["composer-dropdown-option",{"is-selected":Q.value===e.modelValue}]),type:"button",onClick:Pe=>U(Q.value)},we(Q.label),11,ly)]))),128)),$.value.length===0?(k(),C("li",cy," No matching projects ")):ge("",!0)]),P.value?(k(),C("div",uy,[d.value?(k(),C(Le,{key:0},[Pn(b("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":pe[1]||(pe[1]=Q=>c.value=Q),class:"composer-dropdown-add-input",type:"text",placeholder:q.value,onKeydown:[Bt(ut(oe,["prevent"]),["enter"]),Bt(ut(ue,["prevent"]),["esc"])]},null,40,dy),[[On,c.value]]),b("div",{class:"composer-dropdown-add-actions"},[b("button",{type:"button",class:"composer-dropdown-add-btn",onClick:oe},"Open"),b("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ue},"Cancel")])],64)):(k(),C("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ie},we(F.value),1))])):ge("",!0)])],2)):ge("",!0)],512))}}),jo=Ge(fy,[["__scopeId","data-v-8fdced75"]]),hy=["disabled"],py={class:"search-dropdown-value"},my={class:"search-dropdown-search-wrap"},gy=["placeholder","onKeydown"],vy={key:0,class:"search-dropdown-list",role:"listbox"},yy=["onClick","onPointerenter"],wy={class:"search-dropdown-option-check"},by={class:"search-dropdown-option-label"},_y={key:0,class:"search-dropdown-option-desc"},ky={key:1,class:"search-dropdown-empty"},Ty=kt({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=B(null),o=B(null),i=B(!1),a=B(""),l=B(0),d=ce(()=>n.openDirection??"down"),c=ce(()=>new Set(n.selectedValues)),f=ce(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const $=n.options.find(V=>V.value===n.selectedValues[0]);return($==null?void 0:$.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),m=ce(()=>{const $=a.value.toLowerCase().trim();return $?n.options.filter(V=>{var U;return V.label.toLowerCase().includes($)||(((U=V.description)==null?void 0:U.toLowerCase().includes($))??!1)}):n.options});function _(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,Ft(()=>{var $;return($=o.value)==null?void 0:$.focus()})))}function P($){r("toggle",$.value,!c.value.has($.value))}function I($){m.value.length!==0&&(l.value=(l.value+$+m.value.length)%m.value.length)}function F(){const $=m.value[l.value];$&&P($)}function q($){if(!i.value)return;const V=s.value;if(!V)return;const U=$.target;U instanceof Node&&(V.contains(U)||(i.value=!1))}return ct(a,()=>{l.value=0}),Ln(()=>window.addEventListener("pointerdown",q)),Dn(()=>window.removeEventListener("pointerdown",q)),($,V)=>(k(),C("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[b("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:_},[b("span",py,we(f.value),1),Ce(ci,{class:"search-dropdown-chevron"})],8,hy),i.value?(k(),C("div",{key:0,class:lt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[b("div",my,[Pn(b("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":V[0]||(V[0]=U=>a.value=U),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[V[1]||(V[1]=Bt(ut(U=>i.value=!1,["prevent"]),["escape"])),Bt(ut(F,["prevent"]),["enter"]),V[2]||(V[2]=Bt(ut(U=>I(1),["prevent"]),["arrow-down"])),V[3]||(V[3]=Bt(ut(U=>I(-1),["prevent"]),["arrow-up"]))]},null,40,gy),[[On,a.value]])]),m.value.length>0?(k(),C("ul",vy,[(k(!0),C(Le,null,pt(m.value,(U,ie)=>(k(),C("li",{key:U.value},[b("button",{class:lt(["search-dropdown-option",{"is-selected":c.value.has(U.value),"is-highlighted":ie===l.value}]),type:"button",onClick:ae=>P(U),onPointerenter:ae=>l.value=ie},[b("span",wy,we(c.value.has(U.value)?"✓":""),1),b("span",by,we(U.label),1),U.description?(k(),C("span",_y,we(U.description),1)):ge("",!0)],42,yy)]))),128))])):(k(),C("div",ky,"No results"))],2)):ge("",!0)],512))}}),Sy=Ge(Ty,[["__scopeId","data-v-4d3f2c83"]]),xy={class:"skill-picker-header"},Ay=["onKeydown"],Cy={key:0,class:"skill-picker-list",role:"listbox"},Ey=["onClick","onPointerenter"],Iy={class:"skill-picker-name"},Ry={key:0,class:"skill-picker-desc"},$y={key:1,class:"skill-picker-empty"},My=kt({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=B(null),o=B(null),i=B(""),a=B(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 c(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,Ft(()=>{var _;return(_=o.value)==null?void 0:_.focus()}))}),ct(i,()=>{a.value=0}),(m,_)=>e.visible?(k(),C("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:rr(d.value)},[b("div",xy,[Pn(b("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":_[0]||(_[0]=P=>i.value=P),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[_[1]||(_[1]=Bt(ut(P=>m.$emit("close"),["prevent"]),["escape"])),Bt(ut(f,["prevent"]),["enter"]),_[2]||(_[2]=Bt(ut(P=>c(1),["prevent"]),["arrow-down"])),_[3]||(_[3]=Bt(ut(P=>c(-1),["prevent"]),["arrow-up"]))]},null,40,Ay),[[On,i.value]])]),l.value.length>0?(k(),C("ul",Cy,[(k(!0),C(Le,null,pt(l.value,(P,I)=>(k(),C("li",{key:P.path},[b("button",{class:lt(["skill-picker-item",{"is-highlighted":I===a.value}]),type:"button",onClick:F=>m.$emit("select",P),onPointerenter:F=>a.value=I},[b("span",Iy,we(P.name),1),P.description?(k(),C("span",Ry,we(P.description),1)):ge("",!0)],42,Ey)]))),128))])):(k(),C("div",$y,"No skills found"))],4)):ge("",!0)}}),Py=Ge(My,[["__scopeId","data-v-d6a08788"]]),Ny={key:0,class:"thread-composer-attachments"},Oy=["src","alt"],jy=["aria-label","disabled","onClick"],Ly={key:1,class:"thread-composer-file-chips"},Dy=["title"],By=["aria-label","disabled","onClick"],Fy={key:2,class:"thread-composer-skill-chips"},Hy={class:"thread-composer-skill-chip-name"},Uy=["aria-label","onClick"],Vy={class:"thread-composer-input-wrap"},qy={key:0,class:"thread-composer-file-mentions"},Wy=["onMousedown"],Ky={key:1,class:"thread-composer-file-mention-icon-markdown"},Gy={class:"thread-composer-file-mention-text"},zy={class:"thread-composer-file-mention-name"},Yy={key:0,class:"thread-composer-file-mention-dir"},Jy={key:1,class:"thread-composer-file-mention-empty"},Qy=["placeholder","disabled"],Xy={class:"thread-composer-controls"},Zy=["disabled"],ew={key:0,class:"thread-composer-attach-menu"},tw=["disabled"],nw=["disabled"],rw={class:"thread-composer-actions"},sw=["aria-label","title","disabled"],ow=["disabled"],iw=["aria-label","title","disabled"],aw=["disabled"],lw=["disabled"],cw=kt({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=B(""),i=B([]),a=B([]),l=B([]),{state:d,isSupported:c,startRecording:f,stopRecording:m}=Zg({onTranscript:v=>{o.value=o.value?`${o.value}
43
- ${v}`:v}}),_=B(null),P=B(null),I=B(null),F=B(null),q=B(!1),$=B(!1),V=B(null),U=B(""),ie=B([]),ae=B(!1),oe=B(0);let ue=null,te=0,Z=null;const pe=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),Q=[{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"}],Pe=ce(()=>r.models.map(v=>({value:v,label:v}))),We=ce(()=>r.skills??[]),et=ce(()=>a.value.map(v=>v.path)),Ae=ce(()=>(r.skills??[]).map(v=>({value:v.path,label:v.name,description:v.description}))),je=ce(()=>r.disabled||!r.activeThreadId?!1:o.value.trim().length>0||i.value.length>0||l.value.length>0),xe=ce(()=>r.disabled||!r.activeThreadId),rt=ce(()=>r.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function Ye(v="steer"){var E;const g=o.value.trim();if(je.value){if(s("submit",{text:g,imageUrls:i.value.map(ee=>ee.url),fileAttachments:[...l.value],skills:a.value.map(ee=>({name:ee.name,path:ee.path})),mode:v}),o.value="",i.value=[],a.value=[],l.value=[],q.value=!1,$.value=!1,z(),pe){(E=F.value)==null||E.blur();return}Ft(()=>{var ee;return(ee=F.value)==null?void 0:ee.focus()})}}function Ze(){s("interrupt")}function He(v){s("update:selected-model",v)}function dt(v){s("update:selected-reasoning-effort",v)}function de(){xe.value||(q.value=!q.value)}function ke(){var v;(v=P.value)==null||v.click()}function Te(){var v;(v=I.value)==null||v.click()}function R(v){i.value=i.value.filter(g=>g.id!==v)}function G(v){a.value=a.value.filter(g=>g.path!==v)}function J(v){l.value=l.value.filter(g=>g.fsPath!==v)}function fe(v){const g=v.replace(/\\/g,"/");if(l.value.some(_e=>_e.fsPath===g))return;const E=g.split("/").filter(Boolean),ee=E[E.length-1]??g;l.value=[...l.value,{label:ee,path:g,fsPath:g}]}function Ie(v){return v.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(v.name)}function p(v){if(!(!v||v.length===0))for(const g of Array.from(v))if(Ie(g)){const E=new FileReader;E.onload=()=>{typeof E.result=="string"&&i.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:g.name,url:E.result})},E.readAsDataURL(g)}else Vv(g).then(E=>{E&&fe(E)}).catch(()=>{})}function y(v){v&&(v.value="")}function x(v){const g=v.target;p((g==null?void 0:g.files)??null),y(g),q.value=!1}function O(v){const g=v.target;p((g==null?void 0:g.files)??null),y(g),q.value=!1}function H(){const v=o.value;v==="/"?$.value=!0:$.value&&!v.startsWith("/")&&($.value=!1),X()}function D(v){if(ae.value){if(v.key==="Escape"){v.preventDefault(),z();return}if(v.key==="ArrowDown"){v.preventDefault(),ie.value.length>0&&(oe.value=(oe.value+1)%ie.value.length);return}if(v.key==="ArrowUp"){if(v.preventDefault(),ie.value.length>0){const g=ie.value.length;oe.value=(oe.value+g-1)%g}return}if(v.key==="Enter"||v.key==="Tab"){v.preventDefault();const g=ie.value[oe.value];g?le(g):z();return}}if(v.key==="Enter"&&!v.shiftKey){v.preventDefault(),Ye("steer");return}if($.value){if(v.key==="Escape"){v.preventDefault(),ne();return}if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();return}}}function ne(){var v;$.value=!1,(v=F.value)==null||v.focus()}function z(){ae.value=!1,V.value=null,U.value="",ie.value=[],oe.value=0}function X(){const v=F.value;if(!v){z();return}const g=v.selectionStart??o.value.length,ee=o.value.slice(0,g).match(/(^|\s)(@[^\s@]*)$/);if(!ee){z();return}const _e=ee[2]??"",Ue=_e.length,me=g-Ue;V.value=me,U.value=_e.slice(1),ae.value=!0,W()}async function W(){if(!ae.value)return;const v=(r.cwd??"").trim();if(!v){ie.value=[];return}Z&&clearTimeout(Z);const g=++te;Z=setTimeout(async()=>{try{const E=await Bv(v,U.value,20);if(!ae.value||g!==te)return;ie.value=E,oe.value=0}catch{if(!ae.value||g!==te)return;ie.value=[]}},120)}function le(v){const g=F.value,E=V.value;if(E!==null&&g){const ee=g.selectionStart??o.value.length;o.value=`${o.value.slice(0,E)}${o.value.slice(ee)}`.trimEnd()}fe(v.path),z(),Ft(()=>g==null?void 0:g.focus())}function re(v){const g=v.lastIndexOf("/");return g<0?v:v.slice(g+1)}function ye(v){const g=v.lastIndexOf("/");return g<=0?"":v.slice(0,g)}function ve(v){const g=re(v),E=g.lastIndexOf(".");return E<=0?"":g.slice(E+1).toLowerCase()}function Ee(v){const g=ve(v);return g==="ts"?"TS":g==="tsx"?"TSX":g==="js"?"JS":g==="jsx"?"JSX":g==="json"?"{}":""}function Oe(v){const g=ve(v);return g.startsWith("ts")?"ts":g.startsWith("js")?"js":g==="json"?"json":"default"}function Be(v){const g=ve(v);return g==="md"||g==="mdx"}function Ve(v){var g;a.value.some(E=>E.path===v.path)||(a.value=[...a.value,v]),o.value=o.value.startsWith("/")?"":o.value,$.value=!1,(g=F.value)==null||g.focus()}function qe(v,g){if(g){const E=(r.skills??[]).find(ee=>ee.path===v);E&&!a.value.some(ee=>ee.path===v)&&(a.value=[...a.value,E])}else a.value=a.value.filter(E=>E.path!==v)}function ft(v){var me;const g=v.trim();if(!g)return;ue&&(clearTimeout(ue),ue=null),o.value="",(me=F.value)==null||me.focus();let E=0;const ee=3,_e=8,Ue=()=>{E=Math.min(E+ee,g.length),o.value=g.slice(0,E),E<g.length?ue=setTimeout(Ue,_e):(ue=null,Ft(()=>{const he=F.value;if(!he)return;const tt=o.value.length;he.setSelectionRange(tt,tt)}))};Ue()}function S(v){if(!q.value)return;const g=_.value;if(!g)return;const E=v.target;!E||g.contains(E)||(q.value=!1)}return Ln(()=>{document.addEventListener("click",S)}),Dn(()=>{document.removeEventListener("click",S),ue&&clearTimeout(ue),Z&&clearTimeout(Z)}),ct(()=>r.activeThreadId,()=>{ue&&(clearTimeout(ue),ue=null),o.value="",i.value=[],a.value=[],l.value=[],q.value=!1,$.value=!1,z()}),t({quickType:ft}),ct(()=>r.cwd,()=>{ae.value&&W()}),(v,g)=>(k(),C("form",{class:"thread-composer",onSubmit:g[7]||(g[7]=ut(E=>Ye("steer"),["prevent"]))},[b("div",{class:lt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[i.value.length>0?(k(),C("div",Ny,[(k(!0),C(Le,null,pt(i.value,E=>(k(),C("div",{key:E.id,class:"thread-composer-attachment"},[b("img",{class:"thread-composer-attachment-image",src:E.url,alt:E.name||"Selected image"},null,8,Oy),b("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${E.name||"image"}`,disabled:xe.value,onClick:ee=>R(E.id)}," x ",8,jy)]))),128))])):ge("",!0),l.value.length>0?(k(),C("div",Ly,[(k(!0),C(Le,null,pt(l.value,E=>(k(),C("span",{key:E.fsPath,class:"thread-composer-file-chip"},[Ce(Ss,{class:"thread-composer-file-chip-icon"}),b("span",{class:"thread-composer-file-chip-name",title:E.fsPath},we(E.label),9,Dy),b("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${E.label}`,disabled:xe.value,onClick:ee=>J(E.fsPath)},"×",8,By)]))),128))])):ge("",!0),a.value.length>0?(k(),C("div",Fy,[(k(!0),C(Le,null,pt(a.value,E=>(k(),C("span",{key:E.path,class:"thread-composer-skill-chip"},[b("span",Hy,we(E.name),1),b("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${E.name}`,onClick:ee=>G(E.path)},"×",8,Uy)]))),128))])):ge("",!0),b("div",Vy,[ae.value?(k(),C("div",qy,[ie.value.length>0?(k(!0),C(Le,{key:0},pt(ie.value,(E,ee)=>(k(),C("button",{key:E.path,class:lt(["thread-composer-file-mention-row",{"is-active":ee===oe.value}]),type:"button",onMousedown:ut(_e=>le(E),["prevent"])},[Ee(E.path)?(k(),C("span",{key:0,class:lt(["thread-composer-file-mention-icon-badge",`is-${Oe(E.path)}`])},we(Ee(E.path)),3)):Be(E.path)?(k(),C("span",Ky,"↓")):(k(),ot(Ss,{key:2,class:"thread-composer-file-mention-icon-file"})),b("span",Gy,[b("span",zy,we(re(E.path)),1),ye(E.path)?(k(),C("span",Yy,we(ye(E.path)),1)):ge("",!0)])],42,Wy))),128)):(k(),C("div",Jy,"No matching files"))])):ge("",!0),Pn(b("textarea",{ref_key:"inputRef",ref:F,"onUpdate:modelValue":g[0]||(g[0]=E=>o.value=E),class:"thread-composer-input",placeholder:rt.value,disabled:xe.value,onInput:H,onKeydown:D},null,40,Qy),[[On,o.value]]),Ce(Py,{skills:We.value,visible:$.value,"anchor-bottom":44,"anchor-left":0,onSelect:Ve,onClose:ne},null,8,["skills","visible"])]),b("div",Xy,[b("div",{ref_key:"attachMenuRootRef",ref:_,class:"thread-composer-attach"},[b("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:xe.value,onClick:de}," + ",8,Zy),q.value?(k(),C("div",ew,[b("button",{class:"thread-composer-attach-item",type:"button",disabled:xe.value,onClick:ke}," Add photos & files ",8,tw),b("button",{class:"thread-composer-attach-item",type:"button",disabled:xe.value,onClick:Te}," Take photo ",8,nw)])):ge("",!0)],512),Ce(jo,{class:"thread-composer-control","model-value":e.selectedModel,options:Pe.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":He},null,8,["model-value","options","disabled"]),Ce(Sy,{class:"thread-composer-control",options:Ae.value,"selected-values":et.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress||(e.skills??[]).length===0,onToggle:qe},null,8,["options","selected-values","disabled"]),Ce(jo,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:Q,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":dt},null,8,["model-value","disabled"]),b("div",rw,[$e(c)&&!e.isTurnInProgress?(k(),C("button",{key:0,class:lt(["thread-composer-mic",{"thread-composer-mic--active":$e(d)!=="idle"}]),type:"button","aria-label":$e(d)==="recording"?"Stop dictation":"Hold to dictate",title:$e(d)==="recording"?"Release to transcribe":"Hold to dictate",disabled:xe.value,onMousedown:g[1]||(g[1]=ut((...E)=>$e(f)&&$e(f)(...E),["prevent"])),onMouseup:g[2]||(g[2]=(...E)=>$e(m)&&$e(m)(...E)),onMouseleave:g[3]||(g[3]=E=>$e(d)==="recording"&&$e(m)()),onTouchstart:g[4]||(g[4]=ut((...E)=>$e(f)&&$e(f)(...E),["prevent"])),onTouchend:g[5]||(g[5]=(...E)=>$e(m)&&$e(m)(...E))},[Ce(Qv,{class:"thread-composer-mic-icon"})],42,sw)):ge("",!0),e.isTurnInProgress?(k(),C("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:Ze},[Ce(ty,{class:"thread-composer-stop-icon"})],8,ow)):ge("",!0),b("button",{class:lt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress}]),type:"button","aria-label":e.isTurnInProgress?"Queue message":"Send message",title:e.isTurnInProgress?"Queue (button) · Enter to steer":"Send",disabled:!je.value,onClick:g[6]||(g[6]=E=>Ye(e.isTurnInProgress?"queue":"steer"))},[Ce(Gv,{class:"thread-composer-submit-icon"})],10,iw)])])],2),b("input",{ref_key:"photoLibraryInputRef",ref:P,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:xe.value,onChange:x},null,40,aw),b("input",{ref_key:"cameraCaptureInputRef",ref:I,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:xe.value,onChange:O},null,40,lw)],32))}}),Da=Ge(cw,[["__scopeId","data-v-a288bb57"]]),uw={key:0,class:"queued-messages"},dw={class:"queued-messages-inner"},fw={class:"queued-row-text"},hw={class:"queued-row-actions"},pw=["onClick"],mw=["onClick"],gw=kt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(k(),C("div",uw,[b("div",dw,[(k(!0),C(Le,null,pt(e.messages,r=>(k(),C("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=b("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[b("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)),b("span",fw,we(r.text),1),b("div",hw,[b("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,pw),b("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]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[b("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,mw)])]))),128))])])):ge("",!0)}}),vw=Ge(gw,[["__scopeId","data-v-ea583733"]]),yw={},ww={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function bw(e,t){return k(),C("svg",ww,[...t[0]||(t[0]=[b("circle",{cx:"11",cy:"11",r:"8"},null,-1),b("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const Lo=Ge(yw,[["render",bw]]),_w={class:"skill-card-top"},kw=["src","alt"],Tw={key:1,class:"skill-card-avatar-fallback"},Sw={class:"skill-card-info"},xw={class:"skill-card-header"},Aw={class:"skill-card-name"},Cw={key:0,class:"skill-card-badge-disabled"},Ew={key:1,class:"skill-card-badge"},Iw={class:"skill-card-owner"},Rw={key:0,class:"skill-card-desc"},$w={key:1,class:"skill-card-date"},Mw=kt({__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)=>(k(),C("button",{class:lt(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[b("div",_w,[e.skill.avatarUrl?(k(),C("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,kw)):(k(),C("div",Tw,we(e.skill.owner.charAt(0)),1)),b("div",Sw,[b("div",xw,[b("span",Aw,we(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(k(),C("span",Cw,"Disabled")):e.skill.installed?(k(),C("span",Ew,"Installed")):ge("",!0)]),b("span",Iw,we(e.skill.owner),1)])]),e.skill.description?(k(),C("p",Rw,we(e.skill.description),1)):ge("",!0),n.value?(k(),C("span",$w,we(n.value),1)):ge("",!0)],2))}}),Ba=Ge(Mw,[["__scopeId","data-v-2a1e8196"]]),Pw={class:"sdm-panel"},Nw={class:"sdm-header"},Ow={class:"sdm-title-area"},jw=["src","alt"],Lw={class:"sdm-title-col"},Dw={class:"sdm-title-row"},Bw={class:"sdm-title"},Fw={key:0,class:"sdm-badge-disabled"},Hw={class:"sdm-owner"},Uw={class:"sdm-body"},Vw={key:0,class:"sdm-desc"},qw={key:1,class:"sdm-readme-loading"},Ww=["innerHTML"],Kw=["href"],Gw={class:"sdm-footer"},zw={class:"sdm-footer-actions"},Yw=["disabled"],Jw=["disabled"],Qw=["disabled"],Xw=kt({__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=B(null),o=B(""),i=B(!1),a=ce(()=>s.value??n.skill.enabled??!0),l=ce(()=>n.isInstalling===!0||n.isUninstalling===!0),d=ce(()=>{const I=o.value;if(!I)return"";const F=I.replace(/^---[\s\S]*?---\s*/,"");return c(F)});function c(I){return I.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 I=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),F=await fetch(`/codex-api/skills-hub/readme?${I}`);if(!F.ok)return;const q=await F.json();o.value=q.content??""}catch{}finally{i.value=!1}}}ct(()=>n.visible,I=>{I&&(s.value=null,o.value="",f())});function m(){r("install",n.skill)}function _(){r("uninstall",n.skill)}function P(){const I=!a.value;s.value=I,r("toggle-enabled",n.skill,I)}return(I,F)=>(k(),ot(Il,{to:"body"},[e.visible?(k(),C("div",{key:0,class:"sdm-overlay",onClick:F[1]||(F[1]=ut(q=>I.$emit("close"),["self"]))},[b("div",Pw,[b("div",Nw,[b("div",Ow,[e.skill.avatarUrl?(k(),C("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,jw)):ge("",!0),b("div",Lw,[b("div",Dw,[b("h3",Bw,we(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(k(),C("span",Fw,"Disabled")):ge("",!0)]),b("span",Hw,we(e.skill.owner),1)])]),b("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:F[0]||(F[0]=q=>I.$emit("close"))},[Ce(ui,{class:"sdm-close-icon"})])]),b("div",Uw,[e.skill.description?(k(),C("p",Vw,we(e.skill.description),1)):ge("",!0),i.value?(k(),C("div",qw,"Loading skill contents...")):o.value?(k(),C("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,Ww)):ge("",!0),b("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,Kw)]),b("div",Gw,[b("div",zw,[e.skill.installed?(k(),C("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:_},we(n.isUninstalling?"Uninstalling...":"Uninstall"),9,Yw)):(k(),C("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:m},we(n.isInstalling?"Installing...":"Install"),9,Jw)),e.skill.installed?(k(),C("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:P},we(a.value?"Disable":"Enable"),9,Qw)):ge("",!0)])])])])):ge("",!0)]))}}),Zw=Ge(Xw,[["__scopeId","data-v-19a385ca"]]),eb={class:"skills-hub"},tb={class:"skills-hub-toolbar"},nb={class:"skills-hub-search-wrap"},rb={key:0,class:"skills-hub-count"},sb={key:1,class:"skills-hub-section"},ob={class:"skills-hub-section-title"},ib={key:0,class:"skills-hub-grid"},ab={class:"skills-hub-section"},lb={key:0,class:"skills-hub-loading"},cb={key:1,class:"skills-hub-error"},ub={key:0,class:"skills-hub-grid"},db={key:1,class:"skills-hub-empty"},cs="codex-web-local.skills-hub.cache.v1",fb=kt({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=B(null),s=B(""),o=B("date"),i=B([]),a=B([]),l=B(0),d=B(!1),c=B(""),f=B(!0),m=B(!1),_=B(n),P=B(null),I=B(""),F=B(!1),q=B(!1);let $=null,V=null;const U=t,ie=ce(()=>o.value==="date"?"Newest":"A-Z"),ae=ce(()=>{var de;return((de=P.value)==null?void 0:de.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),oe=ce(()=>`${_.value.owner}/${_.value.name}`),ue=ce(()=>F.value&&I.value===oe.value),te=ce(()=>q.value&&I.value===oe.value),Z=ce(()=>{const de=s.value.toLowerCase().trim();return de?a.value.filter(ke=>ke.name.toLowerCase().includes(de)||ke.owner.toLowerCase().includes(de)||(ke.displayName??"").toLowerCase().includes(de)):a.value});function pe(de,ke="success"){P.value={text:de,type:ke},V&&clearTimeout(V),V=setTimeout(()=>{P.value=null},3e3)}function Q(){o.value=o.value==="date"?"name":"date",xe(s.value)}function Pe(de){return`${o.value}::${de.trim().toLowerCase()}`}function We(de){var ke;if(typeof window>"u")return null;try{const Te=window.localStorage.getItem(cs);return Te?((ke=JSON.parse(Te).byKey)==null?void 0:ke[de])??null:null}catch{return null}}function et(de,ke){if(!(typeof window>"u"))try{const Te=window.localStorage.getItem(cs),G=(Te?JSON.parse(Te):{}).byKey??{};G[de]=ke,window.localStorage.setItem(cs,JSON.stringify({byKey:G}))}catch{}}function Ae(){if(!(typeof window>"u"))try{window.localStorage.removeItem(cs)}catch{}}function je(de){const ke=de.installed??[];a.value=ke;const Te=new Set(ke.map(R=>R.name));i.value=de.data.map(R=>{if(R.installed||Te.has(R.name)){const G=ke.find(J=>J.name===R.name);return{...R,installed:!0,path:(G==null?void 0:G.path)??R.path,enabled:(G==null?void 0:G.enabled)??R.enabled}}return R}).filter(R=>!R.installed),l.value=de.total}async function xe(de){const ke=Pe(de),Te=We(ke);Te&&je(Te),d.value=!Te,c.value="";try{const R=new URLSearchParams;de.trim()&&R.set("q",de.trim()),R.set("limit","100"),R.set("sort",o.value);const G=await fetch(`/codex-api/skills-hub?${R}`);if(!G.ok)throw new Error(`HTTP ${G.status}`);const J=await G.json();je(J),et(ke,J)}catch(R){c.value=R instanceof Error?R.message:"Failed to load skills"}finally{d.value=!1}}function rt(){$&&clearTimeout($),$=setTimeout(()=>xe(s.value),300)}function Ye(de){_.value=de,m.value=!0}async function Ze(de){I.value=`${de.owner}/${de.name}`,F.value=!0;try{const Te=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:de.owner,name:de.name})})).json();if(!Te.ok)throw new Error(Te.error||"Install failed");const R={...de,installed:!0,path:Te.path,enabled:!0};a.value=[...a.value,R],i.value=i.value.filter(G=>G.name!==de.name),_.value=R,pe(`${de.displayName||de.name} skill installed`),m.value=!1,Ae(),U("skills-changed")}catch(ke){pe(ke instanceof Error?ke.message:"Failed to install skill","error")}finally{F.value=!1}}async function He(de){I.value=`${de.owner}/${de.name}`,q.value=!0;try{const Te=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:de.name,path:de.path})})).json();if(!Te.ok)throw new Error(Te.error||"Uninstall failed");a.value=a.value.filter(R=>R.name!==de.name),de.owner!=="local"&&(i.value=[...i.value,{...de,installed:!1,path:void 0,enabled:void 0}]),pe(`${de.displayName||de.name} skill uninstalled`),m.value=!1,Ae(),U("skills-changed")}catch(ke){pe(ke instanceof Error?ke.message:"Failed to uninstall skill","error")}finally{q.value=!1}}async function dt(de,ke){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:de.path,enabled:ke}})})).ok)throw new Error("Failed to update skill");pe(`${de.displayName||de.name} skill ${ke?"enabled":"disabled"}`),await xe(s.value)}catch(Te){pe(Te instanceof Error?Te.message:"Failed to update skill","error")}}return Ln(()=>{xe("")}),(de,ke)=>(k(),C("div",eb,[ke[3]||(ke[3]=b("div",{class:"skills-hub-header"},[b("h2",{class:"skills-hub-title"},"Skills Hub"),b("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),b("div",tb,[b("div",nb,[Ce(Lo,{class:"skills-hub-search-icon"}),Pn(b("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":ke[0]||(ke[0]=Te=>s.value=Te),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:rt},null,544),[[On,s.value]]),l.value>0?(k(),C("span",rb,we(l.value)+" skills",1)):ge("",!0)]),b("button",{class:"skills-hub-sort",type:"button",onClick:Q},we(ie.value),1)]),P.value?(k(),C("div",{key:0,class:lt(["skills-hub-toast",ae.value])},we(P.value.text),3)):ge("",!0),Z.value.length>0?(k(),C("div",sb,[b("button",{class:"skills-hub-section-toggle",type:"button",onClick:ke[1]||(ke[1]=Te=>f.value=!f.value)},[b("span",ob,"Installed ("+we(Z.value.length)+")",1),Ce(kc,{class:lt(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(k(),C("div",ib,[(k(!0),C(Le,null,pt(Z.value,Te=>(k(),ot(Ba,{key:Te.name,skill:Te,onSelect:R=>Ye(R)},null,8,["skill","onSelect"]))),128))])):ge("",!0)])):ge("",!0),b("div",ab,[d.value?(k(),C("div",lb,"Loading skills...")):c.value?(k(),C("div",cb,we(c.value),1)):(k(),C(Le,{key:2},[i.value.length>0?(k(),C("div",ub,[(k(!0),C(Le,null,pt(i.value,Te=>(k(),ot(Ba,{key:Te.url,skill:Te,onSelect:R=>Ye(R)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(k(),C("div",db,'No skills found for "'+we(s.value)+'"',1)):ge("",!0)],64))]),Ce(Zw,{skill:_.value,visible:m.value,"is-installing":ue.value,"is-uninstalling":te.value,onClose:ke[2]||(ke[2]=Te=>m.value=!1),onInstall:Ze,onUninstall:He,onToggleEnabled:dt},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),hb=Ge(fb,[["__scopeId","data-v-1967b404"]]),pb={},mb={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 gb(e,t){return k(),C("svg",mb,[...t[0]||(t[0]=[b("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),b("path",{d:"M9 4l0 16"},null,-1)])])}const vb=Ge(pb,[["render",gb]]),yb={},wb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function bb(e,t){return k(),C("svg",wb,[...t[0]||(t[0]=[b("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 _b=Ge(yb,[["render",bb]]),kb={},Tb={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Sb(e,t){return k(),C("svg",Tb,[...t[0]||(t[0]=[b("path",{d:"M20 11a8.1 8.1 0 0 0-15.5-2m-.5-4v4h4"},null,-1),b("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const xb=Ge(kb,[["render",Sb]]),Ab={class:"sidebar-thread-controls"},Cb=["aria-label","title"],Eb=["aria-pressed","aria-label","title"],Ib=kt({__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)=>(k(),C("div",Ab,[b("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?(k(),ot(_b,{key:0,class:"sidebar-thread-controls-icon"})):(k(),ot(vb,{key:1,class:"sidebar-thread-controls-icon"}))],8,Cb),b("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(xb,{class:"sidebar-thread-controls-icon"})],8,Eb),sn(t.$slots,"default",{},void 0),e.showNewThreadButton?(k(),C("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(Ss,{class:"sidebar-thread-controls-icon"})])):ge("",!0)]))}}),Fa=Ge(Ib,[["__scopeId","data-v-57866500"]]);function $n(e){return e.flatMap(t=>t.threads)}const xc="codex-web-local.thread-read-state.v1",Ac="codex-web-local.thread-scroll-state.v1",Do="codex-web-local.selected-thread-id.v1",Cc="codex-web-local.project-order.v1",Ec="codex-web-local.project-display-name.v1",Ic="codex-web-local.auto-refresh-enabled.v1",ho=220,Mr=4e3,Ha=["none","minimal","low","medium","high","xhigh"],Pr="__global__";function Rb(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(xc);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function Ua(e){typeof window>"u"||window.localStorage.setItem(xc,JSON.stringify(e))}function $b(){return typeof window>"u"?!1:window.localStorage.getItem(Ic)==="1"}function Va(e){typeof window>"u"||window.localStorage.setItem(Ic,e?"1":"0")}function Rc(e,t,n){return Math.min(Math.max(e,t),n)}function Mb(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=Rc(t.scrollRatio,0,1)),n}function Pb(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Ac);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=Mb(s);o&&(n[r]=o)}return n}catch{return{}}}function qa(e){typeof window>"u"||window.localStorage.setItem(Ac,JSON.stringify(e))}function Nb(){return typeof window>"u"?"":window.localStorage.getItem(Do)??""}function Ob(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Do);return}window.localStorage.setItem(Do,e)}}function jb(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Cc);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t)typeof r=="string"&&r.length>0&&!n.includes(r)&&n.push(r);return n}catch{return[]}}function dr(e){typeof window>"u"||window.localStorage.setItem(Cc,JSON.stringify(e))}function Lb(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Ec);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(Ec,JSON.stringify(e))}function us(e,t){const n=[];for(const r of e)n.includes(r)||n.push(r);for(const r of t)n.includes(r.projectName)||n.push(r.projectName);return Zn(e,n)?e:n}function mo(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>n.get(s)??{projectName:s,threads:[]});for(const s of e)t.includes(s.projectName)||r.push(s);return r}function Zn(e,t){const n=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(n.length!==r.length)return!1;for(let s=0;s<n.length;s+=1)if(n[s]!==r[s])return!1;return!0}function Db(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 Bb(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function Bo(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Zn(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&Bb(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function xs(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 Fb(e,t,n={}){const r=new Map(e.map(c=>[c.id,c])),s=new Map(t.map(c=>[c.id,c])),o=t.map(c=>{const f=r.get(c.id);return f&&Bo(f,c)?f:c});if(n.preserveMissing!==!0)return xs(e,o)?e:o;const i=e.map(c=>{const f=s.get(c.id);return!f||Bo(c,f)?c:f}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),d=[...i,...l];return xs(e,d)?e:d}function Fo(e){return e.replace(/\s+/gu," ").trim()}function Hb(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Fo(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=Fo(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function Wa(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Bo(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const $c="worked";function Cn(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function Ub(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 Vb(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function qb(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 Wb(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${Ub(e.durationMs)}`,messageType:$c}}function Kb(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function Gb(e,t){const n=Wb(t),r=e.filter(i=>i.messageType!==$c),s=Kb(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Rt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function zb(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 Yb(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 Jb(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 St(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function ds(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&&zb(d,l)?d:l});return o&&o.projectName===s.projectName&&Yb(o.threads,a)?o:{projectName:s.projectName,threads:a}});return Jb(e,r)?e:r}function Qb(e,t,n){const r=new Set($n(t).map(a=>a.id)),s=$n(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(c=>c.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 Xb(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function go(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function Zb(e){const t=e.split(`
44
- `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function e0(){const e=B([]),t=B([]),n=B(Nb()),r=B({}),s=B({}),o=B({}),i=B({}),a=B({}),l=B({}),d=B({}),c=B([]),f=B(""),m=B("medium"),_=B(Rb()),P=B(Pb()),I=B(jb()),F=B(Lb()),q=B({}),$=B({}),V=B({}),U=B({}),ie=B({}),ae=B({}),oe=B({}),ue=B({}),te=B({}),Z=B([]),pe=B(!1),Q=B(!1),Pe=B(!1),We=B(!1),et=B(!1),Ae=B(""),je=B(!1),xe=B(!1),rt=B($b()),Ye=B(Math.floor(Mr/1e3));let Ze=null,He=null,dt=null,de=null,ke=!1;const Te=new Set;let R=!1,G=!1;const J=new Map,fe=ce(()=>$n(e.value)),Ie=ce(()=>fe.value.find(u=>u.id===n.value)??null),p=ce(()=>P.value[n.value]??null),y=ce(()=>{const u=[],h=n.value;return h&&Array.isArray(ue.value[h])&&u.push(...ue.value[h]),Array.isArray(ue.value[Pr])&&u.push(...ue.value[Pr]),u.sort((w,A)=>w.receivedAtIso.localeCompare(A.receivedAtIso))}),x=ce(()=>{var K;const u=n.value;if(!u)return null;const h=ie.value[u],w=(o.value[u]??"").trim(),A=(((K=ae.value[u])==null?void 0:K.message)??"").trim();return!h&&!w&&!A?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:w,errorText:A}}),O=ce(()=>{const u=n.value;if(!u)return[];const h=r.value[u]??[],w=s.value[u]??[],A=i.value[u]??[],K=[...h,...A,...w],L=U.value[u];return L?Gb(K,L):K});function H(u){n.value!==u&&(n.value=u,Ob(u),G=!1)}function D(u){f.value=u.trim()}function ne(u){u&&!Ha.includes(u)||(m.value=u)}function z(u,h){const w=u.trim()||"default",A=h||"default";return[`Model: ${w}`,`Thinking: ${A}`]}async function X(){try{const[u,h]=await Promise.all([Pv(),Nv()]);c.value=u,f.value.length>0&&u.includes(f.value)||(h.model&&u.includes(h.model)?f.value=h.model:u.length>0?f.value=u[0]:f.value=""),h.reasoningEffort&&Ha.includes(h.reasoningEffort)&&(m.value=h.reasoningEffort)}catch{}}function W(u){const h=te.value;return Object.keys(h).length===0?u:u.map(w=>({projectName:w.projectName,threads:w.threads.map(A=>{const K=h[A.id];return K?{...A,title:K}:A})}))}function le(){const h=W(t.value).map(w=>({projectName:w.projectName,threads:w.threads.map(A=>{const K=a.value[A.id]===!0,L=n.value===A.id,be=_.value[A.id],Me=d.value[A.id]===!0,Re=!L&&!K&&(Me||be!==A.updatedAtIso);return{...A,inProgress:K,unread:Re}})}));e.value=ds(e.value,h)}function re(u,h,w){const A=new Date().toISOString(),K=h.trim(),L=Xb(K),be={id:u,title:Zb(w),projectName:L,cwd:K,hasWorktree:K.includes("/.codex/worktrees/")||K.includes("/.git/worktrees/"),createdAtIso:A,updatedAtIso:A,preview:w,unread:!1,inProgress:!1},Me=t.value.findIndex(st=>st.projectName===L);if(Me>=0){const Lt=t.value[Me].threads.filter(qn=>qn.id!==u),Vn={projectName:L,threads:[be,...Lt]},Sn=[...t.value];Sn.splice(Me,1,Vn),t.value=Sn}else t.value=[{projectName:L,threads:[be]},...t.value];const Re=us(I.value,t.value);Zn(I.value,Re)||(I.value=Re,dr(I.value)),le()}function ye(u){const h=new Set(u.map(L=>L.id)),w=St(_.value,h);w!==_.value&&(_.value=w,Ua(w));const A=St(P.value,h);A!==P.value&&(P.value=A,qa(A)),$.value=St($.value,h),q.value=St(q.value,h),V.value=St(V.value,h),r.value=St(r.value,h),s.value=St(s.value,h),o.value=St(o.value,h),i.value=St(i.value,h),U.value=St(U.value,h),ie.value=St(ie.value,h),ae.value=St(ae.value,h),oe.value=St(oe.value,h),d.value=St(d.value,h),a.value=St(a.value,h);const K={};for(const[L,be]of Object.entries(ue.value))(L===Pr||h.has(L))&&(K[L]=be);ue.value=K}function ve(u){const h=$n(t.value).find(w=>w.id===u);h&&(_.value={..._.value,[u]:h.updatedAtIso},Ua(_.value),d.value[u]&&(d.value=Rt(d.value,u)),le())}function Ee(u,h){if(!u)return;const w=U.value[u];if(h){if(Vb(w,h))return;U.value={...U.value,[u]:h}}else w&&(U.value=Rt(U.value,u))}function Oe(u,h){!u||a.value[u]===!0===h||(h?a.value={...a.value,[u]:!0}:a.value=Rt(a.value,u),le())}function Be(u){u&&u!==n.value&&d.value[u]!==!0&&(d.value={...d.value,[u]:!0},le())}function Ve(u,h){if(!u)return;const w=ie.value[u];if(!h){w&&(ie.value=Rt(ie.value,u));return}const A=an(h.label)||"Thinking",K=h.details.map(Me=>an(Me)).filter(Me=>Me.length>0&&Me!==A),L=Array.from(new Set([...(w==null?void 0:w.details)??[],...K])).slice(-3),be={label:A,details:L};qb(w,be)||(ie.value={...ie.value,[u]:be})}function qe(u,h){if(!u)return;const w=ae.value[u],A=h?Fo(h):"";if(!A){w&&(ae.value=Rt(ae.value,u));return}(w==null?void 0:w.message)!==A&&(ae.value={...ae.value,[u]:{message:A}})}function ft(u){const h=$n(t.value).find(w=>w.id===u);return(h==null?void 0:h.updatedAtIso)??""}function S(u,h){if(!u)return;const w={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(w.scrollRatio=Rc(h.scrollRatio,0,1));const A=P.value[u];A&&A.scrollTop===w.scrollTop&&A.isAtBottom===w.isAtBottom&&A.scrollRatio===w.scrollRatio||(P.value={...P.value,[u]:w},qa(P.value))}function v(u,h){const w=r.value[u]??[];xs(w,h)||(r.value={...r.value,[u]:h})}function g(u,h){const w=s.value[u]??[];xs(w,h)||(s.value={...s.value,[u]:h})}function E(u,h){const w=s.value[u]??[],A=Wa(w,h);g(u,A)}function ee(u,h){if(!u)return;const w=h.trim(),A=o.value[u]??"";if(w.length===0){if(!A)return;o.value=Rt(o.value,u);return}A!==w&&(o.value={...o.value,[u]:w})}function _e(u,h){if(!u)return;const w=o.value[u]??"";ee(u,`${w}${h}`)}function Ue(u){u&&u in o.value&&(o.value=Rt(o.value,u))}function me(u){return u!==null&&typeof u=="object"&&!Array.isArray(u)?u:null}function he(u){return typeof u=="string"?u:""}function tt(u){return typeof u=="number"&&Number.isFinite(u)?u:null}function vt(u){const h=me(u.params);if(!h)return"";const w=he(h.threadId);if(w)return w;const A=he(h.thread_id);if(A)return A;const K=he(h.conversationId);if(K)return K;const L=he(h.conversation_id);if(L)return L;const be=me(h.thread),Me=he(be==null?void 0:be.id);if(Me)return Me;const Re=me(h.turn),st=he(Re==null?void 0:Re.threadId);if(st)return st;const Lt=he(Re==null?void 0:Re.thread_id);return Lt||""}function Xt(u){if(u.method!=="turn/completed")return"";const h=me(u.params),w=me(h==null?void 0:h.turn);if(!w||w.status!=="failed")return"";const A=me(w.error);return he(A==null?void 0:A.message)}function Tn(u){const h=me(u);if(!h)return null;const w=h.id,A=he(h.method),K=h.params;if(typeof w!="number"||!Number.isInteger(w)||!A)return null;const L=me(K),be=he(L==null?void 0:L.threadId)||Pr,Me=he(L==null?void 0:L.turnId),Re=he(L==null?void 0:L.itemId),st=he(h.receivedAtIso)||new Date().toISOString();return{id:w,method:A,threadId:be,turnId:Me,itemId:Re,receivedAtIso:st,params:K??null}}function sr(u){const h=u.threadId||Pr,w=ue.value[h]??[],A=w.findIndex(L=>L.id===u.id),K=[...w];A>=0?K.splice(A,1,u):K.push(u),ue.value={...ue.value,[h]:K.sort((L,be)=>L.receivedAtIso.localeCompare(be.receivedAtIso))}}function Bn(u){const h={};for(const[w,A]of Object.entries(ue.value)){const K=A.filter(L=>L.id!==u);K.length>0&&(h[w]=K)}ue.value=h}function or(u){if(u.method==="server/request"){const h=Tn(u.params);return h&&sr(h),!0}if(u.method==="server/request/resolved"){const h=me(u.params),w=h==null?void 0:h.id;return typeof w=="number"&&Number.isInteger(w)&&Bn(w),!0}return!1}function an(u){return u.replace(/\s+/gu," ").trim()}function Sr(u){const h=vt(u);if(!h)return null;if(u.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(u.method==="item/started"){const w=me(u.params),A=me(w==null?void 0:w.item),K=he(A==null?void 0:A.type).toLowerCase();if(K==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(K==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(K==="commandexecution"){const L=he(A==null?void 0:A.command);return{threadId:h,activity:{label:"Running command",details:L?[L]:[]}}}}return u.method==="item/commandExecution/outputDelta"?{threadId:h,activity:{label:"Running command",details:[]}}:u.method==="item/reasoning/summaryTextDelta"||u.method==="item/reasoning/summaryPartAdded"?{threadId:h,activity:{label:"Thinking",details:[]}}:u.method==="item/agentMessage/delta"?{threadId:h,activity:{label:"Writing response",details:[]}}:null}function xr(u){if(u.method!=="turn/started")return null;const h=me(u.params);if(!h)return null;const w=vt(u);if(!w)return null;const A=me(h.turn),K=he(A==null?void 0:A.id)||he(h.turnId)||`${w}:unknown`;if(!K)return null;const L=Cn(he(A==null?void 0:A.startedAt))??Cn(he(h.startedAt))??Cn(u.atIso)??Date.now();return{threadId:w,turnId:K,startedAtMs:L}}function Ar(u){if(u.method!=="turn/completed")return null;const h=me(u.params);if(!h)return null;const w=vt(u);if(!w)return null;const A=me(h.turn),K=he(A==null?void 0:A.id)||he(h.turnId)||`${w}:unknown`;if(!K)return null;const L=Cn(he(A==null?void 0:A.completedAt))??Cn(he(h.completedAt))??Cn(u.atIso)??Date.now(),be=Cn(he(A==null?void 0:A.startedAt))??Cn(he(h.startedAt))??void 0;return{threadId:w,turnId:K,completedAtMs:L,startedAtMs:be}}function ln(u){return`${u}:live-reasoning`}function ir(u){const h=me(u.params);if(!h)return"";if(u.method==="item/started"){const w=me(h.item);return!w||w.type!=="reasoning"?"":he(w.id)}return""}function T(u){const h=me(u.params);if(!h)return null;if(u.method==="item/reasoning/summaryTextDelta"){const w=he(h.itemId),A=he(h.delta);return!w||!A?null:{messageId:ln(w),delta:A}}return null}function M(u){const h=me(u.params);if(!h)return"";if(u.method==="item/reasoning/summaryPartAdded"){const w=he(h.itemId);return w?ln(w):""}return""}function N(u){const h=me(u.params);if(!h)return"";if(u.method==="item/completed"){const w=me(h.item);return!w||w.type!=="reasoning"?"":ln(he(w.id))}return""}function Y(u){const h=me(u.params);if(!h)return"";if(u.method==="item/started"){const w=me(h.item);return!w||w.type!=="agentMessage"?"":he(w.id)}return""}function Fe(u){const h=me(u.params);if(!h)return null;if(u.method==="item/agentMessage/delta"){const w=he(h.itemId),A=he(h.delta);return!w||!A?null:{messageId:w,delta:A}}return null}function yt(u){const h=me(u.params);if(!h)return null;if(u.method==="item/completed"){const w=me(h.item);if(!w||w.type!=="agentMessage")return null;const A=he(w.id),K=he(w.text);return!A||!K?null:{id:A,role:"assistant",text:K,messageType:"agentMessage.live"}}return null}function jt(u){if(u.method!=="item/started")return null;const h=me(u.params),w=me(h==null?void 0:h.item);if(!w||w.type!=="commandExecution")return null;const A=he(w.id),K=he(w.command);if(!A)return null;const L=typeof w.cwd=="string"?w.cwd:null;return{id:A,role:"system",text:K,messageType:"commandExecution",commandExecution:{command:K,cwd:L,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function cn(u){if(u.method!=="item/commandExecution/outputDelta")return null;const h=me(u.params);if(!h)return null;const w=he(h.itemId),A=he(h.delta);return!w||!A?null:{itemId:w,delta:A}}function Fn(u){if(u.method!=="item/completed")return null;const h=me(u.params),w=me(h==null?void 0:h.item);if(!w||w.type!=="commandExecution")return null;const A=he(w.id),K=he(w.command);if(!A)return null;const L=typeof w.cwd=="string"?w.cwd:null,be=he(w.status),Me=be==="failed"?"failed":be==="declined"?"declined":be==="interrupted"?"interrupted":"completed",Re=typeof w.aggregatedOutput=="string"?w.aggregatedOutput:"",st=typeof w.exitCode=="number"?w.exitCode:null;return{id:A,role:"system",text:K,messageType:"commandExecution",commandExecution:{command:K,cwd:L,status:Me,aggregatedOutput:Re,exitCode:st}}}function Nt(u,h){const w=i.value[u]??[],A=Wa(w,h);A!==w&&(i.value={...i.value,[u]:A})}function un(u,h){const w=i.value[u];if(!w||w.length===0)return;const A=new Set(h.map(L=>L.id)),K=w.filter(L=>!A.has(L.id));K.length!==w.length&&(K.length===0?i.value=Rt(i.value,u):i.value={...i.value,[u]:K})}function Hn(u){if(u.method==="item/agentMessage/delta")return!0;const h=me(u.params);if(!h)return!1;if(u.method==="item/completed"){const w=me(h.item);return(w==null?void 0:w.type)==="agentMessage"}return!1}function Cr(u){var qn,gi,vi,yi;if(or(u))return;if(u.method==="thread/name/updated"){const Ke=me(u.params),Zt=he(Ke==null?void 0:Ke.threadId),Wn=he(Ke==null?void 0:Ke.threadName);Zt&&Wn&&(te.value={...te.value,[Zt]:Wn},le(),La(Zt,Wn))}const h=Sr(u);h&&Ve(h.threadId,h.activity);const w=xr(u);w&&(J.set(w.turnId,w),oe.value={...oe.value,[w.threadId]:w.turnId},Ee(w.threadId,null),qe(w.threadId,null),Oe(w.threadId,!0),d.value[w.threadId]&&(d.value=Rt(d.value,w.threadId)));const A=Ar(u);if(A){const Ke=J.get(A.turnId);Ke&&J.delete(A.turnId);const Zt=tt((qn=me(u.params))==null?void 0:qn.durationMs)??tt((vi=me((gi=me(u.params))==null?void 0:gi.turn))==null?void 0:vi.durationMs)??(typeof A.startedAtMs=="number"?A.completedAtMs-A.startedAtMs:null)??(Ke?A.completedAtMs-Ke.startedAtMs:null),Wn=typeof Zt=="number"?Math.max(0,Zt):0;Ee(A.threadId,{turnId:A.turnId,durationMs:Wn}),oe.value[A.threadId]&&(oe.value=Rt(oe.value,A.threadId)),Oe(A.threadId,!1),Ve(A.threadId,null),Be(A.threadId),ht(A.threadId)}const K=Xt(u);if(K){const Ke=(A==null?void 0:A.threadId)||vt(u);Ke&&qe(Ke,K),Ae.value=K}else A&&qe(A.threadId,null);const L=vt(u);if(!L||L!==n.value)return;Y(u);const be=Fe(u);if(be){const Ke=(s.value[L]??[]).find(Wn=>Wn.id===be.messageId),Zt=`${(Ke==null?void 0:Ke.text)??""}${be.delta}`;E(L,{id:be.messageId,role:"assistant",text:Zt,messageType:"agentMessage.live"})}const Me=yt(u);Me&&E(L,Me),ir(u);const Re=T(u);if(Re&&_e(L,Re.delta),M(u)){const Ke=o.value[L]??"";Ke.trim().length>0&&!Ke.endsWith(`
45
-
46
- `)&&ee(L,`${Ke}
47
-
48
- `)}N(u);const Lt=jt(u);Lt&&(Nt(L,Lt),Ve(L,{label:"Running command",details:[((yi=Lt.commandExecution)==null?void 0:yi.command)??""]}));const Vn=cn(u);if(Vn){const Ke=(i.value[L]??[]).find(Zt=>Zt.id===Vn.itemId);Ke!=null&&Ke.commandExecution&&Nt(L,{...Ke,commandExecution:{...Ke.commandExecution,aggregatedOutput:`${Ke.commandExecution.aggregatedOutput}${Vn.delta}`}})}const Sn=Fn(u);if(Sn&&Nt(L,Sn),Hn(u)&&(G&&n.value&&S(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),Ue(L)),u.method==="turn/completed"){G=!1,Ue(L),i.value[L]&&(i.value=Rt(i.value,L));const Ke=vt(u);Ke&&(Oe(Ke,!1),Ve(Ke,null),Be(Ke),ht(Ke))}}function ts(u){const h=vt(u);h&&Te.add(h);const w=u.method;(w.startsWith("thread/")||w.startsWith("turn/")||w.startsWith("item/"))&&(ke=!0),!(He!==null||typeof window>"u")&&(He=window.setTimeout(()=>{He=null,cr()},ho))}async function ns(u){if(!R){R=!0;try{const h=await Oa(),w=[];for(const A of h.order){const K=go(A);w.includes(K)||w.push(K)}if(w.length>0){const A=us(w,u);Zn(I.value,A)||(I.value=A,dr(I.value))}if(Object.keys(h.labels).length>0){const A={...F.value};let K=!1;for(const[L,be]of Object.entries(h.labels)){const Me=go(L);A[Me]!==be&&(A[Me]=be,K=!0)}K&&(F.value=A,po(A))}}catch{}}}async function Hs(){if(!(Object.keys(te.value).length>0))try{const u=await Fv();Object.keys(u.titles).length>0&&(te.value=u.titles)}catch{}}async function Us(u,h,w){if(te.value[u])return;const A=h.trim();if(!A)return;const K=A.length>300?A.slice(0,300):A;try{const L=await Hv(K,w);if(!L||te.value[u])return;te.value={...te.value,[u]:L},le(),La(u,L)}catch{}}async function ar(){var u;xe.value||(pe.value=!0);try{const[h]=await Promise.all([_v(),Hs()]);await ns(h);const w=us(I.value,h);Zn(I.value,w)||(I.value=w,dr(I.value));const A=mo(h,I.value),K=Qb(t.value,A,a.value);t.value=ds(t.value,K),a.value=St(a.value,new Set($n(t.value).map(Me=>Me.id))),le(),xe.value=!0;const L=$n(e.value);ye(L),L.some(Me=>Me.id===n.value)||H(((u=L[0])==null?void 0:u.id)??"")}finally{pe.value=!1}}async function Un(u,h={}){if(!u)return;const w=$.value[u]===!0,A=h.silent!==!0&&!w;A&&(Q.value=!0);try{V.value[u]!==!0&&(await Na(u),V.value={...V.value,[u]:!0});const K=await kv(u),L=r.value[u]??[],be=Fb(L,K,{preserveMissing:h.silent===!0});v(u,be);const Me=s.value[u]??[],Re=Hb(Me,K);g(u,Re),un(u,K),$.value={...$.value,[u]:!0};const st=ft(u);st&&(q.value={...q.value,[u]:st}),ve(u)}finally{A&&(Q.value=!1)}}async function rs(){try{const u=t.value.flatMap(h=>h.threads.map(w=>w.cwd)).filter(Boolean);Z.value=await Uv(u.length>0?[...new Set(u)]:void 0)}catch{}}async function Vs(){Ae.value="";try{await ar(),await Promise.all([X(),rs()]),await Un(n.value)}catch(u){Ae.value=u instanceof Error?u.message:"Unknown application error"}}async function ss(u){H(u);try{await Un(u)}catch(h){Ae.value=h instanceof Error?h.message:"Unknown application error"}}async function qs(u){try{await Av(u),await ar(),n.value===u&&await Un(n.value)}catch(h){Ae.value=h instanceof Error?h.message:"Unknown application error"}}async function j(u,h=[],w=[],A="steer",K=[]){const L=n.value,be=u.trim();if(!L||!be&&h.length===0&&K.length===0)return;const Me=a.value[L]===!0;if(Me&&A==="queue"){const Re=l.value[L]??[],st=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[L]:[...Re,{id:st,text:be,imageUrls:h,skills:w,fileAttachments:K}]};return}if(Me){G=!0,Se(L,be,h,w,K).catch(Re=>{const st=Re instanceof Error?Re.message:"Unknown application error";qe(L,st),Ae.value=st});return}Ae.value="",G=!0,Ee(L,null),Ve(L,{label:"Thinking",details:z(f.value,m.value)}),qe(L,null),Oe(L,!0);try{await Se(L,be,h,w,K)}catch(Re){G=!1,Oe(L,!1),Ve(L,null);const st=Re instanceof Error?Re.message:"Unknown application error";throw qe(L,st),Ae.value=st,Re}}async function se(u,h,w=[],A=[],K=[]){const L=u.trim(),be=h.trim(),Me=f.value.trim();if(!L&&w.length===0&&K.length===0)return"";Pe.value=!0,Ae.value="";let Re="";try{if(Re=await Iv(be||void 0,Me||void 0),!Re)return"";re(Re,be,L||"[Image]"),V.value={...V.value,[Re]:!0},H(Re),G=!0,Ee(Re,null),Ve(Re,{label:"Thinking",details:z(f.value,m.value)}),qe(Re,null),Oe(Re,!0);const st=Re,Lt=be||null,Vn=L;return Se(Re,L,w,A,K).catch(Sn=>{G=!1,Oe(Re,!1),Ve(Re,null);const qn=Sn instanceof Error?Sn.message:"Unknown application error";qe(Re,qn),Ae.value=qn}).finally(()=>{Pe.value=!1}),Us(st,Vn,Lt),Re}catch(st){G=!1,Re&&(Oe(Re,!1),Ve(Re,null));const Lt=st instanceof Error?st.message:"Unknown application error";throw Re&&qe(Re,Lt),Ae.value=Lt,Pe.value=!1,st}}async function Se(u,h,w=[],A=[],K=[]){const L=f.value.trim(),be=m.value;try{V.value[u]!==!0&&await Na(u),await $v(u,h,w,L||void 0,be||void 0,A.length>0?A:void 0,K),V.value={...V.value,[u]:!0},Te.add(u),ke=!0,await cr()}catch(Me){throw Me}}async function ht(u){const h=l.value[u];if(!h||h.length===0)return;const[w,...A]=h;l.value=A.length>0?{...l.value,[u]:A}:Rt(l.value,u),Pe.value=!0,Ae.value="",G=!0,Ee(u,null),Ve(u,{label:"Thinking",details:z(f.value,m.value)}),qe(u,null),Oe(u,!0);try{await Se(u,w.text,w.imageUrls,w.skills,w.fileAttachments)}catch{Oe(u,!1),Ve(u,null)}finally{Pe.value=!1}}async function Tt(){const u=n.value;if(!u||a.value[u]!==!0)return;const h=oe.value[u];We.value=!0,Ae.value="";try{await Mv(u,h),Oe(u,!1),Ve(u,null),qe(u,null),oe.value[u]&&(oe.value=Rt(oe.value,u)),Te.add(u),ke=!0,await cr()}catch(w){const A=w instanceof Error?w.message:"Failed to interrupt active turn";qe(u,A),Ae.value=A}finally{We.value=!1}}async function Wt(u){const h=n.value;if(!h||et.value)return;const A=(r.value[h]??[]).reduce((L,be)=>typeof be.turnIndex=="number"&&be.turnIndex>L?be.turnIndex:L,-1);if(A<0||u>A)return;const K=A-u+1;if(!(K<1)){et.value=!0,Ae.value="";try{const L=await Cv(h,K);v(h,L),g(h,[]),Ue(h),i.value[h]&&(i.value=Rt(i.value,h)),Ee(h,null),Ve(h,null),qe(h,null),ke=!0,await cr()}catch(L){Ae.value=L instanceof Error?L.message:"Failed to rollback thread"}finally{et.value=!1}}}function lr(u,h){u.length===0||(F.value[u]??"")===h||(F.value={...F.value,[u]:h},po(F.value))}function Mc(u){var K;if(u.length===0)return;const h=I.value.filter(L=>L!==u);if(Zn(I.value,h)||(I.value=h,dr(I.value)),t.value=t.value.filter(L=>L.projectName!==u),F.value[u]!==void 0){const L={...F.value};delete L[u],F.value=L,po(L)}le();const w=$n(e.value);ye(w),w.some(L=>L.id===n.value)||H(((K=w[0])==null?void 0:K.id)??""),Ws()}function Pc(u,h){if(u.length===0||t.value.length===0)return;const w=t.value.map(Re=>Re.projectName),A=w.indexOf(u);if(A===-1)return;const K=Math.max(0,Math.min(h,w.length-1)),L=Db(w,A,K);if(L===w)return;const be=us(L,t.value);I.value=be,dr(I.value);const Me=mo(t.value,I.value);t.value=ds(t.value,Me),le(),Ws()}function Nc(u){const h=u.trim();if(!h)return;const w=[h,...I.value.filter(K=>K!==h)];if(Zn(I.value,w))return;I.value=w,dr(I.value);const A=mo(t.value,I.value);t.value=ds(t.value,A),le(),Ws()}async function Ws(){var u,h;try{const w=await Oa(),A=new Map;for(const be of w.order){const Me=go(be);A.has(Me)||A.set(Me,be)}for(const be of t.value){const Me=((h=(u=be.threads[0])==null?void 0:u.cwd)==null?void 0:h.trim())??"";Me&&A.set(be.projectName,Me)}const K=[];for(const be of I.value){const Me=A.get(be);Me&&!K.includes(Me)&&K.push(Me)}for(const be of w.order)K.includes(be)||K.push(be);const L=w.active.filter(be=>K.includes(be));L.length===0&&K.length>0&&L.push(K[0]),await jv({order:K,labels:w.labels,active:L})}catch{}}async function Oc(){if(!je.value){je.value=!0;try{if(await ar(),!n.value)return;const u=n.value,h=ft(u),w=q.value[u]??"",A=h.length>0&&h!==w;(a.value[u]===!0||A)&&await Un(u,{silent:!0})}catch{}finally{je.value=!1}}}async function cr(){if(je.value){typeof window<"u"&&He===null&&(He=window.setTimeout(()=>{He=null,cr()},ho));return}je.value=!0;const u=ke,h=new Set(Te);ke=!1,Te.clear();try{u&&await ar();const w=n.value;if(!w)return;const A=h.has(w),K=a.value[w]===!0,L=ft(w),be=q.value[w]??"",Me=L.length>0&&L!==be;(A||K||Me||u)&&await Un(w,{silent:!0})}catch{}finally{je.value=!1,(ke||Te.size>0)&&typeof window<"u"&&He===null&&(He=window.setTimeout(()=>{He=null,cr()},ho))}}function jc(){typeof window>"u"||Ze||(rt.value&&pi(),Lc(),Ze=Tv(u=>{Cr(u),ts(u)}))}async function Lc(){try{const u=await xv();for(const h of u){const w=Tn(h);w&&sr(w)}}catch{}}async function Dc(u){try{await Sv(u.id,{result:u.result,error:u.error}),Bn(u.id)}catch(h){Ae.value=h instanceof Error?h.message:"Failed to reply to server request"}}function hi(u={}){const h=u.updatePreference??!0;dt!==null&&typeof window<"u"&&(window.clearInterval(dt),dt=null),de!==null&&typeof window<"u"&&(window.clearInterval(de),de=null),h&&(rt.value=!1,Va(!1)),Ye.value=Math.floor(Mr/1e3)}function pi(){typeof window>"u"||dt!==null||de!==null||(rt.value=!0,Va(!0),Ye.value=Math.floor(Mr/1e3),dt=window.setInterval(()=>{Ye.value=Math.floor(Mr/1e3),Oc()},Mr),de=window.setInterval(()=>{Ye.value=Math.max(0,Ye.value-1)},1e3))}function Bc(){if(rt.value){hi();return}pi()}function Fc(){hi({updatePreference:!1}),Ze&&(Ze(),Ze=null),ke=!1,Te.clear(),J.clear(),He!==null&&typeof window<"u"&&(window.clearTimeout(He),He=null),G=!1,r.value={},s.value={},o.value={},i.value={},ie.value={},U.value={},ae.value={},oe.value={},l.value={}}const Hc=ce(()=>{const u=n.value;return u?l.value[u]??[]:[]});function mi(u){const h=n.value;if(!h)return;const w=l.value[h];if(!w)return;const A=w.filter(K=>K.id!==u);l.value=A.length>0?{...l.value,[h]:A}:Rt(l.value,h)}function Uc(u){const h=n.value;if(!h)return;const w=l.value[h];if(!w)return;const A=w.find(K=>K.id===u);A&&(mi(u),j(A.text,A.imageUrls,A.skills,"steer",A.fileAttachments))}return{projectGroups:e,projectDisplayNameById:F,selectedThread:Ie,selectedThreadScrollState:p,selectedThreadServerRequests:y,selectedLiveOverlay:x,selectedThreadId:n,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:m,installedSkills:Z,messages:O,isLoadingThreads:pe,isLoadingMessages:Q,isSendingMessage:Pe,isInterruptingTurn:We,isAutoRefreshEnabled:rt,autoRefreshSecondsLeft:Ye,error:Ae,refreshAll:Vs,refreshSkills:rs,selectThread:ss,setThreadScrollState:S,archiveThreadById:qs,sendMessageToSelectedThread:j,sendMessageToNewThread:se,interruptSelectedThreadTurn:Tt,rollbackSelectedThread:Wt,isRollingBack:et,selectedThreadQueuedMessages:Hc,removeQueuedMessage:mi,steerQueuedMessage:Uc,setSelectedModelId:D,setSelectedReasoningEffort:ne,respondToPendingServerRequest:Dc,renameProject:lr,removeProject:Mc,reorderProject:Pc,pinProjectToTop:Nc,toggleAutoRefreshTimer:Bc,startPolling:jc,stopPolling:Fc}}const t0={class:"sidebar-root"},n0=["aria-pressed"],r0={key:1,class:"sidebar-search-bar"},s0={class:"content-root"},o0={class:"content-body"},i0={key:1,class:"content-grid"},a0={class:"new-thread-empty"},l0={class:"new-thread-suggestions","aria-label":"Build suggestions"},c0={class:"new-thread-suggestions-list"},u0=["onClick"],d0={class:"new-thread-suggestion-title"},f0={key:2,class:"content-grid"},h0={class:"content-thread"},p0={class:"composer-with-queue"},m0={class:"build-badge","aria-label":"Worktree name"},Ka="codex-web-local.sidebar-collapsed.v1",g0=kt({__name:"App",setup(e){const t="645c",n="0.1.15",r=["A personal habit tracker with streak analytics","A markdown knowledge base with fuzzy search","A local-first expense tracker with charts","A daily standup report generator","A visual JSON diff and merge helper","A commit message assistant with templates","A focus timer with ambient sounds","A bug triage board with severity filters","A screenshot annotator for QA feedback","A changelog generator from git history","A tiny CRM for freelance clients","A release checklist dashboard","A file organizer with smart naming rules","A project brief writer from prompts","A code snippet manager with tags","A meeting notes summarizer and action extractor","A portfolio site builder from markdown","A docs health checker for broken links","A command palette for favorite shell tasks","A roadmap planner with drag-and-drop milestones"],s=["Take a photo with camera and tell me what is on the picture","Draft and send a happy birthday Gmail message to Mom","Summarize my calendar for today with key priorities","Create a calendar event for lunch with Alex tomorrow at 1:00 PM"],{projectGroups:o,projectDisplayNameById:i,selectedThread:a,selectedThreadScrollState:l,selectedThreadServerRequests:d,selectedLiveOverlay:c,selectedThreadId:f,availableModelIds:m,selectedModelId:_,selectedReasoningEffort:P,installedSkills:I,messages:F,isLoadingThreads:q,isLoadingMessages:$,isInterruptingTurn:V,isAutoRefreshEnabled:U,autoRefreshSecondsLeft:ie,refreshAll:ae,refreshSkills:oe,selectThread:ue,setThreadScrollState:te,archiveThreadById:Z,sendMessageToSelectedThread:pe,sendMessageToNewThread:Q,interruptSelectedThreadTurn:Pe,rollbackSelectedThread:We,isRollingBack:et,selectedThreadQueuedMessages:Ae,removeQueuedMessage:je,steerQueuedMessage:xe,setSelectedModelId:rt,setSelectedReasoningEffort:Ye,respondToPendingServerRequest:Ze,renameProject:He,removeProject:dt,reorderProject:de,pinProjectToTop:ke,toggleAutoRefreshTimer:Te,startPolling:R,stopPolling:G}=e0(),J=Eh(),fe=Ch(),{isMobile:Ie}=_c(),p=B(!1),y=B(!1),x=B(""),O=B(ar()),H=B(""),D=B(!1),ne=B(null),z=B("New Project (1)"),X=B(""),W=B([]),le=B(null),re=ce(()=>{const j=J.params.threadId;return typeof j=="string"?j:""}),ye=ce(()=>{const j=new Set;for(const se of o.value)for(const Se of se.threads)j.add(Se.id);return j}),ve=ce(()=>J.name==="home"),Ee=ce(()=>J.name==="skills"),Oe=ce(()=>{var j;return Ee.value?"Skills":ve.value?"New thread":((j=a.value)==null?void 0:j.title)??"Choose a thread"}),Be=ce(()=>U.value?`Auto refresh in ${String(ie.value)}s`:"Enable 4s refresh"),Ve=ce(()=>F.value.filter(j=>{const se=rs(j.messageType,j.role);return se==="worked"?!0:!(se==="turnActivity.live"||se==="turnError.live"||se==="agentReasoning.live")})),qe=ce(()=>c.value),ft=ce(()=>ve.value?"__new-thread__":f.value),S=ce(()=>{var j,se;return ve.value?x.value.trim():((se=(j=a.value)==null?void 0:j.cwd)==null?void 0:se.trim())??""}),v=ce(()=>{var j;return!ve.value&&((j=a.value)==null?void 0:j.inProgress)===!0}),g=ce(()=>{var ht,Tt;const j=[],se=new Set;for(const Wt of o.value){const lr=((Tt=(ht=Wt.threads[0])==null?void 0:ht.cwd)==null?void 0:Tt.trim())??"";!lr||se.has(lr)||(se.add(lr),j.push({value:lr,label:i.value[Wt.projectName]??Wt.projectName}))}const Se=x.value.trim();return Se&&!se.has(Se)&&j.unshift({value:Se,label:Hn(Se)}),j}),E=ce(()=>[x.value,X.value,...o.value.map(se=>{var Se;return((Se=se.threads[0])==null?void 0:Se.cwd)??""})].map(se=>se.trim().toLowerCase()).some(se=>se.includes("/data/data/com.termux")||se.includes("/com.termux/files/home")||se.includes("/var/lib/proot-distro")||se.includes("/usr/var/lib/proot-distro")||se.includes("/.proot")||se.includes("proot-distro"))),ee=ce(()=>E.value?s:r);function _e(j,se){const Se=[...j];for(let ht=Se.length-1;ht>0;ht-=1){const Tt=Math.floor(Math.random()*(ht+1));[Se[ht],Se[Tt]]=[Se[Tt],Se[ht]]}return Se.slice(0,Math.min(se,Se.length))}function Ue(){W.value=_e(ee.value,3)}function me(j){var se;(se=le.value)==null||se.quickType(j)}Ln(()=>{window.addEventListener("keydown",M),Vs(),Nt(),cn(),Ue()}),Os(()=>{window.removeEventListener("keydown",M),G()});function he(){oe()}function tt(){D.value=!D.value,D.value?Ft(()=>{var j;return(j=ne.value)==null?void 0:j.focus()}):H.value=""}function vt(){var j;H.value="",(j=ne.value)==null||j.focus()}function Xt(j){j.key==="Escape"&&(D.value=!1,H.value="")}function Tn(j){j&&(J.name==="thread"&&re.value===j||(fe.push({name:"thread",params:{threadId:j}}),Ie.value&&T(!0)))}function sr(j){Z(j)}function Bn(j){var ht,Tt;const se=o.value.find(Wt=>Wt.projectName===j),Se=((Tt=(ht=se==null?void 0:se.threads[0])==null?void 0:ht.cwd)==null?void 0:Tt.trim())??"";Se&&(x.value=Se),Ie.value&&T(!0),!ve.value&&fe.push({name:"home"})}function or(){var se,Se;const j=((Se=(se=a.value)==null?void 0:se.cwd)==null?void 0:Se.trim())??"";j&&(x.value=j),Ie.value&&T(!0),!ve.value&&fe.push({name:"home"})}function an(j){He(j.projectName,j.displayName)}function Sr(j){dt(j)}function xr(j){de(j.projectName,j.toIndex)}function Ar(j){te(j.threadId,j.state)}function ln(j){Ze(j)}function ir(){Te()}function T(j){O.value!==j&&(O.value=j,Un(j))}function M(j){j.defaultPrevented||!j.ctrlKey&&!j.metaKey||j.shiftKey||j.altKey||j.key.toLowerCase()==="b"&&(j.preventDefault(),T(!O.value))}function N(j){const se=j.text;if(ve.value){qs(se,j.imageUrls,j.skills,j.fileAttachments);return}pe(se,j.imageUrls,j.skills,j.mode,j.fileAttachments)}function Y(j){x.value=j.trim()}async function Fe(j){const se=j.trim();if(!se)return;const Se=jt(se),ht=await yt(),Tt=Se?se:Cr(ht,se);if(Tt)try{const Wt=await Lv(Tt,{createIfMissing:!Se,label:Se?"":se});Wt&&(x.value=Wt,ke(Hn(Wt)),cn())}catch{}}async function yt(){const j=Fn();if(j)return j;try{const se=await ja();if(se)return X.value=se,se}catch{}return""}function jt(j){return j?j.startsWith("~/")||j.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(j):!1}async function cn(){const j=Fn();if(!j){z.value="New Project (1)";return}try{const se=await Dv(j);z.value=se.name||"New Project (1)"}catch{z.value="New Project (1)"}}function Fn(){var Se,ht;const j=x.value.trim();if(j)return un(j);const se=((ht=(Se=g.value[0])==null?void 0:Se.value)==null?void 0:ht.trim())??"";return se?un(se):X.value.trim()}async function Nt(){try{X.value=await ja()}catch{X.value=""}}function un(j){const se=j.trim().replace(/\/+$/,"");if(!se)return"";const Se=se.lastIndexOf("/");return Se<=0?"":se.slice(0,Se)}function Hn(j){const se=j.trim().replace(/\/+$/,"");if(!se)return"";const Se=se.lastIndexOf("/");return Se<0?se:se.slice(Se+1)}function Cr(j,se){const Se=j.trim().replace(/\/+$/,""),ht=se.trim().replace(/^\/+/,"");return!Se||!ht?"":`${Se}/${ht}`}function ts(j){rt(j)}function ns(j){Ye(j)}function Hs(){Pe()}function Us(j){We(j.turnIndex)}function ar(){return typeof window>"u"?!1:window.localStorage.getItem(Ka)==="1"}function Un(j){typeof window>"u"||window.localStorage.setItem(Ka,j?"1":"0")}function rs(j,se){const Se=(j??"").trim();return Se.length>0?Se:se.trim()||"message"}async function Vs(){await ae(),y.value=!0,await ss(),R()}async function ss(){if(!p.value){p.value=!0;try{if(J.name==="home"||J.name==="skills"){f.value!==""&&await ue("");return}if(J.name==="thread"){const j=re.value;if(!j)return;if(!ye.value.has(j)){await fe.replace({name:"home"});return}f.value!==j&&await ue(j);return}}finally{p.value=!1}}}ct(()=>[J.name,re.value,q.value,ye.value.has(re.value),f.value],async()=>{y.value&&await ss()}),ct(()=>f.value,async j=>{if(y.value&&!p.value&&!(ve.value||Ee.value)){if(!j){J.name!=="home"&&await fe.replace({name:"home"});return}J.name==="thread"&&re.value===j||await fe.replace({name:"thread",params:{threadId:j}})}}),ct(()=>g.value,j=>{if(j.length===0){x.value="";return}j.some(Se=>Se.value===x.value)||(x.value=j[0].value),cn()},{immediate:!0}),ct(()=>x.value,()=>{cn()}),ct(Ie,j=>{j&&!O.value&&T(!0)}),ct(()=>ve.value,j=>{j&&Ue()}),ct(()=>E.value,()=>{ve.value&&Ue()});async function qs(j,se=[],Se=[],ht=[]){try{const Tt=await Q(j,x.value,se,Se,ht);if(!Tt)return;await fe.replace({name:"thread",params:{threadId:Tt}})}catch{}}return(j,se)=>(k(),C(Le,null,[Ce(Nh,{"is-sidebar-collapsed":O.value,onCloseSidebar:se[4]||(se[4]=Se=>T(!0))},{sidebar:nt(()=>[b("section",t0,[O.value?ge("",!0):(k(),ot(Fa,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":O.value,"is-auto-refresh-enabled":$e(U),"auto-refresh-button-label":Be.value,"show-new-thread-button":!0,onToggleSidebar:se[0]||(se[0]=Se=>T(!O.value)),onToggleAutoRefresh:ir,onStartNewThread:or},{default:nt(()=>[b("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":D.value,"aria-label":"Search threads",title:"Search threads",onClick:tt},[Ce(Lo,{class:"sidebar-search-toggle-icon"})],8,n0)]),_:1},8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])),!O.value&&D.value?(k(),C("div",r0,[Ce(Lo,{class:"sidebar-search-bar-icon"}),Pn(b("input",{ref_key:"sidebarSearchInputRef",ref:ne,"onUpdate:modelValue":se[1]||(se[1]=Se=>H.value=Se),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Xt},null,544),[[On,H.value]]),H.value.length>0?(k(),C("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:vt},[Ce(ui,{class:"sidebar-search-clear-icon"})])):ge("",!0)])):ge("",!0),O.value?ge("",!0):(k(),C("button",{key:2,class:lt(["sidebar-skills-link",{"is-active":Ee.value}]),type:"button",onClick:se[2]||(se[2]=Se=>{$e(fe).push({name:"skills"}),$e(Ie)&&T(!0)})}," Skills Hub ",2)),O.value?ge("",!0):(k(),ot(gm,{key:3,groups:$e(o),"project-display-name-by-id":$e(i),"selected-thread-id":$e(f),"is-loading":$e(q),"search-query":H.value,onSelect:Tn,onArchive:sr,onStartNewThread:Bn,onRenameProject:an,onRemoveProject:Sr,onReorderProject:xr},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query"]))])]),content:nt(()=>[b("section",s0,[Ce(km,{title:Oe.value},{leading:nt(()=>[O.value||$e(Ie)?(k(),ot(Fa,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":O.value,"is-auto-refresh-enabled":$e(U),"auto-refresh-button-label":Be.value,"show-new-thread-button":!0,onToggleSidebar:se[3]||(se[3]=Se=>T(!O.value)),onToggleAutoRefresh:ir,onStartNewThread:or},null,8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])):ge("",!0)]),_:1},8,["title"]),b("section",o0,[Ee.value?(k(),ot(hb,{key:0,onSkillsChanged:he})):ve.value?(k(),C("div",i0,[b("div",a0,[se[5]||(se[5]=b("p",{class:"new-thread-hero"},"Let's build",-1)),b("div",l0,[b("ul",c0,[(k(!0),C(Le,null,pt(W.value,Se=>(k(),C("li",{key:Se},[b("button",{type:"button",class:"new-thread-suggestion-item",onClick:ht=>me(Se)},[b("span",d0,we(Se),1)],8,u0)]))),128))])]),Ce(jo,{class:"new-thread-folder-dropdown","model-value":x.value,options:g.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":z.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":Y,onAdd:Fe},null,8,["model-value","options","default-add-value"])]),Ce(Da,{ref_key:"homeComposerRef",ref:le,"active-thread-id":ft.value,cwd:S.value,models:$e(m),"selected-model":$e(_),"selected-reasoning-effort":$e(P),skills:$e(I),"is-turn-in-progress":!1,"is-interrupting-turn":!1,onSubmit:N,"onUpdate:selectedModel":ts,"onUpdate:selectedReasoningEffort":ns},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills"])])):(k(),C("div",f0,[b("div",h0,[Ce(Xg,{messages:Ve.value,"is-loading":$e($),"active-thread-id":ft.value,"scroll-state":$e(l),"live-overlay":qe.value,"pending-requests":$e(d),"is-turn-in-progress":v.value,"is-rolling-back":$e(et),onUpdateScrollState:Ar,onRespondServerRequest:ln,onRollback:Us},null,8,["messages","is-loading","active-thread-id","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),b("div",p0,[Ce(vw,{messages:$e(Ae),onSteer:$e(xe),onDelete:$e(je)},null,8,["messages","onSteer","onDelete"]),Ce(Da,{"active-thread-id":ft.value,cwd:S.value,models:$e(m),"selected-model":$e(_),"selected-reasoning-effort":$e(P),skills:$e(I),"is-turn-in-progress":v.value,"is-interrupting-turn":$e(V),"has-queue-above":$e(Ae).length>0,onSubmit:N,"onUpdate:selectedModel":ts,"onUpdate:selectedReasoningEffort":ns,onInterrupt:Hs},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),b("div",m0," WT "+we($e(t))+" • v"+we($e(n)),1)],64))}}),v0=Ge(g0,[["__scopeId","data-v-3b08d087"]]),vo={render:()=>null},y0=Ah({history:sh(),routes:[{path:"/",name:"home",component:vo},{path:"/thread/:threadId",name:"thread",component:vo},{path:"/skills",name:"skills",component:vo},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});vf(v0).use(y0).mount("#app");