codexapp 0.1.35 → 0.1.36

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.
@@ -2,45 +2,45 @@
2
2
  * @vue/shared v3.5.30
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
- **/function xa(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const bt={},ss=[],On=()=>{},_u=()=>!1,Jo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Pa=e=>e.startsWith("onUpdate:"),$t=Object.assign,Ma=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Zf=Object.prototype.hasOwnProperty,dt=(e,t)=>Zf.call(e,t),Le=Array.isArray,os=e=>ro(e)==="[object Map]",ku=e=>ro(e)==="[object Set]",wl=e=>ro(e)==="[object Date]",ze=e=>typeof e=="function",Ct=e=>typeof e=="string",vn=e=>typeof e=="symbol",ft=e=>e!==null&&typeof e=="object",Tu=e=>(ft(e)||ze(e))&&ze(e.then)&&ze(e.catch),Iu=Object.prototype.toString,ro=e=>Iu.call(e),eh=e=>ro(e).slice(8,-1),Su=e=>ro(e)==="[object Object]",Oa=e=>Ct(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ns=xa(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Yo=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},th=/-\w/g,Qt=Yo(e=>e.replace(th,t=>t.slice(1).toUpperCase())),nh=/\B([A-Z])/g,Tr=Yo(e=>e.replace(nh,"-$1").toLowerCase()),Qo=Yo(e=>e.charAt(0).toUpperCase()+e.slice(1)),vi=Yo(e=>e?`on${Qo(e)}`:""),Rn=(e,t)=>!Object.is(e,t),To=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Eu=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Na=e=>{const t=parseFloat(e);return isNaN(t)?e:t},rh=e=>{const t=Ct(e)?Number(e):NaN;return isNaN(t)?e:t};let bl;const Xo=()=>bl||(bl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function zr(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=Ct(r)?ah(r):zr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(Ct(e)||ft(e))return e}const sh=/;(?![^(]*\))/g,oh=/:([^]+)/,ih=/\/\*[^]*?\*\//g;function ah(e){const t={};return e.replace(ih,"").split(sh).forEach(n=>{if(n){const r=n.split(oh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function gt(e){let t="";if(Ct(e))t=e;else if(Le(e))for(let n=0;n<e.length;n++){const r=gt(e[n]);r&&(t+=r+" ")}else if(ft(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const lh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ch=xa(lh);function Cu(e){return!!e||e===""}function uh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=$a(e[r],t[r]);return n}function $a(e,t){if(e===t)return!0;let n=wl(e),r=wl(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=vn(e),r=vn(t),n||r)return e===t;if(n=Le(e),r=Le(t),n||r)return n&&r?uh(e,t):!1;if(n=ft(e),r=ft(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||!$a(e[i],t[i]))return!1}}return String(e)===String(t)}const Au=e=>!!(e&&e.__v_isRef===!0),ce=e=>Ct(e)?e:e==null?"":Le(e)||ft(e)&&(e.toString===Iu||!ze(e.toString))?Au(e)?ce(e.value):JSON.stringify(e,Ru,2):String(e),Ru=(e,t)=>Au(t)?Ru(e,t.value):os(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[yi(r,o)+" =>"]=s,n),{})}:ku(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>yi(n))}:vn(t)?yi(t):ft(t)&&!Le(t)&&!Su(t)?String(t):t,yi=(e,t="")=>{var n;return vn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
5
+ **/function Ra(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const yt={},rs=[],On=()=>{},bu=()=>!1,Jo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Pa=e=>e.startsWith("onUpdate:"),$t=Object.assign,xa=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Zf=Object.prototype.hasOwnProperty,ut=(e,t)=>Zf.call(e,t),Le=Array.isArray,ss=e=>ro(e)==="[object Map]",_u=e=>ro(e)==="[object Set]",yl=e=>ro(e)==="[object Date]",qe=e=>typeof e=="function",Ct=e=>typeof e=="string",vn=e=>typeof e=="symbol",dt=e=>e!==null&&typeof e=="object",ku=e=>(dt(e)||qe(e))&&qe(e.then)&&qe(e.catch),Tu=Object.prototype.toString,ro=e=>Tu.call(e),eh=e=>ro(e).slice(8,-1),Iu=e=>ro(e)==="[object Object]",Ma=e=>Ct(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ns=Ra(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Yo=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},th=/-\w/g,Xt=Yo(e=>e.replace(th,t=>t.slice(1).toUpperCase())),nh=/\B([A-Z])/g,kr=Yo(e=>e.replace(nh,"-$1").toLowerCase()),Qo=Yo(e=>e.charAt(0).toUpperCase()+e.slice(1)),gi=Yo(e=>e?`on${Qo(e)}`:""),Rn=(e,t)=>!Object.is(e,t),To=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Su=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Oa=e=>{const t=parseFloat(e);return isNaN(t)?e:t},rh=e=>{const t=Ct(e)?Number(e):NaN;return isNaN(t)?e:t};let wl;const Xo=()=>wl||(wl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function qr(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=Ct(r)?ah(r):qr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(Ct(e)||dt(e))return e}const sh=/;(?![^(]*\))/g,oh=/:([^]+)/,ih=/\/\*[^]*?\*\//g;function ah(e){const t={};return e.replace(ih,"").split(sh).forEach(n=>{if(n){const r=n.split(oh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function mt(e){let t="";if(Ct(e))t=e;else if(Le(e))for(let n=0;n<e.length;n++){const r=mt(e[n]);r&&(t+=r+" ")}else if(dt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const lh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ch=Ra(lh);function Eu(e){return!!e||e===""}function uh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Na(e[r],t[r]);return n}function Na(e,t){if(e===t)return!0;let n=yl(e),r=yl(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=vn(e),r=vn(t),n||r)return e===t;if(n=Le(e),r=Le(t),n||r)return n&&r?uh(e,t):!1;if(n=dt(e),r=dt(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||!Na(e[i],t[i]))return!1}}return String(e)===String(t)}const Cu=e=>!!(e&&e.__v_isRef===!0),ce=e=>Ct(e)?e:e==null?"":Le(e)||dt(e)&&(e.toString===Tu||!qe(e.toString))?Cu(e)?ce(e.value):JSON.stringify(e,Au,2):String(e),Au=(e,t)=>Cu(t)?Au(e,t.value):ss(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[vi(r,o)+" =>"]=s,n),{})}:_u(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>vi(n))}:vn(t)?vi(t):dt(t)&&!Le(t)&&!Iu(t)?String(t):t,vi=(e,t="")=>{var n;return vn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
6
  * @vue/reactivity v3.5.30
7
7
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
8
  * @license MIT
9
- **/let en;class dh{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=en,!t&&en&&(this.index=(en.scopes||(en.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=en;try{return en=this,t()}finally{en=n}}}on(){++this._on===1&&(this.prevScope=en,en=this)}off(){this._on>0&&--this._on===0&&(en=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 fh(){return en}let Tt;const wi=new WeakSet;class xu{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,en&&en.active&&en.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,wi.has(this)&&(wi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Mu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,_l(this),Ou(this);const t=Tt,n=pn;Tt=this,pn=!0;try{return this.fn()}finally{Nu(this),Tt=t,pn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)ja(t);this.deps=this.depsTail=void 0,_l(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?wi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Yi(this)&&this.run()}get dirty(){return Yi(this)}}let Pu=0,$s,Ds;function Mu(e,t=!1){if(e.flags|=8,t){e.next=Ds,Ds=e;return}e.next=$s,$s=e}function Da(){Pu++}function La(){if(--Pu>0)return;if(Ds){let t=Ds;for(Ds=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;$s;){let t=$s;for($s=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 Ou(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Nu(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),ja(r),hh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Yi(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&($u(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function $u(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ws)||(e.globalVersion=Ws,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Yi(e))))return;e.flags|=2;const t=e.dep,n=Tt,r=pn;Tt=e,pn=!0;try{Ou(e);const s=e.fn(e._value);(t.version===0||Rn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Tt=n,pn=r,Nu(e),e.flags&=-3}}function ja(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)ja(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function hh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let pn=!0;const Du=[];function Xn(){Du.push(pn),pn=!1}function Zn(){const e=Du.pop();pn=e===void 0?!0:e}function _l(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Tt;Tt=void 0;try{t()}finally{Tt=n}}}let Ws=0;class ph{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 Ba{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(!Tt||!pn||Tt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Tt)n=this.activeLink=new ph(Tt,this),Tt.deps?(n.prevDep=Tt.depsTail,Tt.depsTail.nextDep=n,Tt.depsTail=n):Tt.deps=Tt.depsTail=n,Lu(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=Tt.depsTail,n.nextDep=void 0,Tt.depsTail.nextDep=n,Tt.depsTail=n,Tt.deps===n&&(Tt.deps=r)}return n}trigger(t){this.version++,Ws++,this.notify(t)}notify(t){Da();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{La()}}}function Lu(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)Lu(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Qi=new WeakMap,Hr=Symbol(""),Xi=Symbol(""),zs=Symbol("");function Vt(e,t,n){if(pn&&Tt){let r=Qi.get(e);r||Qi.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new Ba),s.map=r,s.key=n),s.track()}}function Gn(e,t,n,r,s,o){const i=Qi.get(e);if(!i){Ws++;return}const a=l=>{l&&l.trigger()};if(Da(),t==="clear")i.forEach(a);else{const l=Le(e),u=l&&Oa(n);if(l&&n==="length"){const c=Number(r);i.forEach((f,h)=>{(h==="length"||h===zs||!vn(h)&&h>=c)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(zs)),t){case"add":l?u&&a(i.get("length")):(a(i.get(Hr)),os(e)&&a(i.get(Xi)));break;case"delete":l||(a(i.get(Hr)),os(e)&&a(i.get(Xi)));break;case"set":os(e)&&a(i.get(Hr));break}}La()}function Zr(e){const t=ct(e);return t===e?t:(Vt(t,"iterate",zs),dn(e)?t:t.map(yn))}function Zo(e){return Vt(e=ct(e),"iterate",zs),e}function Cn(e,t){return er(e)?hs(Vr(e)?yn(t):t):yn(t)}const mh={__proto__:null,[Symbol.iterator](){return bi(this,Symbol.iterator,e=>Cn(this,e))},concat(...e){return Zr(this).concat(...e.map(t=>Le(t)?Zr(t):t))},entries(){return bi(this,"entries",e=>(e[1]=Cn(this,e[1]),e))},every(e,t){return Hn(this,"every",e,t,void 0,arguments)},filter(e,t){return Hn(this,"filter",e,t,n=>n.map(r=>Cn(this,r)),arguments)},find(e,t){return Hn(this,"find",e,t,n=>Cn(this,n),arguments)},findIndex(e,t){return Hn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Hn(this,"findLast",e,t,n=>Cn(this,n),arguments)},findLastIndex(e,t){return Hn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Hn(this,"forEach",e,t,void 0,arguments)},includes(...e){return _i(this,"includes",e)},indexOf(...e){return _i(this,"indexOf",e)},join(e){return Zr(this).join(e)},lastIndexOf(...e){return _i(this,"lastIndexOf",e)},map(e,t){return Hn(this,"map",e,t,void 0,arguments)},pop(){return Cs(this,"pop")},push(...e){return Cs(this,"push",e)},reduce(e,...t){return kl(this,"reduce",e,t)},reduceRight(e,...t){return kl(this,"reduceRight",e,t)},shift(){return Cs(this,"shift")},some(e,t){return Hn(this,"some",e,t,void 0,arguments)},splice(...e){return Cs(this,"splice",e)},toReversed(){return Zr(this).toReversed()},toSorted(e){return Zr(this).toSorted(e)},toSpliced(...e){return Zr(this).toSpliced(...e)},unshift(...e){return Cs(this,"unshift",e)},values(){return bi(this,"values",e=>Cn(this,e))}};function bi(e,t,n){const r=Zo(e),s=r[t]();return r!==e&&!dn(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const gh=Array.prototype;function Hn(e,t,n,r,s,o){const i=Zo(e),a=i!==e&&!dn(e),l=i[t];if(l!==gh[t]){const f=l.apply(e,o);return a?yn(f):f}let u=n;i!==e&&(a?u=function(f,h){return n.call(this,Cn(e,f),h,e)}:n.length>2&&(u=function(f,h){return n.call(this,f,h,e)}));const c=l.call(i,u,r);return a&&s?s(c):c}function kl(e,t,n,r){const s=Zo(e),o=s!==e&&!dn(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(u,c,f){return a&&(a=!1,u=Cn(e,u)),n.call(this,u,Cn(e,c),f,e)}):n.length>3&&(i=function(u,c,f){return n.call(this,u,c,f,e)}));const l=s[t](i,...r);return a?Cn(e,l):l}function _i(e,t,n){const r=ct(e);Vt(r,"iterate",zs);const s=r[t](...n);return(s===-1||s===!1)&&Ha(n[0])?(n[0]=ct(n[0]),r[t](...n)):s}function Cs(e,t,n=[]){Xn(),Da();const r=ct(e)[t].apply(e,n);return La(),Zn(),r}const vh=xa("__proto__,__v_isRef,__isVue"),ju=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(vn));function yh(e){vn(e)||(e=String(e));const t=ct(this);return Vt(t,"has",e),t.hasOwnProperty(e)}class Bu{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?Ah:Vu:o?Hu:Fu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Le(t);if(!s){let l;if(i&&(l=mh[n]))return l;if(n==="hasOwnProperty")return yh}const a=Reflect.get(t,n,qt(t)?t:r);if((vn(n)?ju.has(n):vh(n))||(s||Vt(t,"get",n),o))return a;if(qt(a)){const l=i&&Oa(n)?a:a.value;return s&&ft(l)?ea(l):l}return ft(a)?s?ea(a):ei(a):a}}class Uu extends Bu{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Le(t)&&Oa(n);if(!this._isShallow){const u=er(o);if(!dn(r)&&!er(r)&&(o=ct(o),r=ct(r)),!i&&qt(o)&&!qt(r))return u||(o.value=r),!0}const a=i?Number(n)<t.length:dt(t,n),l=Reflect.set(t,n,r,qt(t)?t:s);return t===ct(s)&&(a?Rn(r,o)&&Gn(t,"set",n,r):Gn(t,"add",n,r)),l}deleteProperty(t,n){const r=dt(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(!vn(n)||!ju.has(n))&&Vt(t,"has",n),r}ownKeys(t){return Vt(t,"iterate",Le(t)?"length":Hr),Reflect.ownKeys(t)}}class wh extends Bu{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const bh=new Uu,_h=new wh,kh=new Uu(!0);const Zi=e=>e,po=e=>Reflect.getPrototypeOf(e);function Th(e,t,n){return function(...r){const s=this.__v_raw,o=ct(s),i=os(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=s[e](...r),c=n?Zi:t?hs:yn;return!t&&Vt(o,"iterate",l?Xi:Hr),$t(Object.create(u),{next(){const{value:f,done:h}=u.next();return h?{value:f,done:h}:{value:a?[c(f[0]),c(f[1])]:c(f),done:h}}})}}function mo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ih(e,t){const n={get(s){const o=this.__v_raw,i=ct(o),a=ct(s);e||(Rn(s,a)&&Vt(i,"get",s),Vt(i,"get",a));const{has:l}=po(i),u=t?Zi:e?hs:yn;if(l.call(i,s))return u(o.get(s));if(l.call(i,a))return u(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Vt(ct(s),"iterate",Hr),s.size},has(s){const o=this.__v_raw,i=ct(o),a=ct(s);return e||(Rn(s,a)&&Vt(i,"has",s),Vt(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=ct(a),u=t?Zi:e?hs:yn;return!e&&Vt(l,"iterate",Hr),a.forEach((c,f)=>s.call(o,u(c),u(f),i))}};return $t(n,e?{add:mo("add"),set:mo("set"),delete:mo("delete"),clear:mo("clear")}:{add(s){const o=ct(this),i=po(o),a=ct(s),l=!t&&!dn(s)&&!er(s)?a:s;return i.has.call(o,l)||Rn(s,l)&&i.has.call(o,s)||Rn(a,l)&&i.has.call(o,a)||(o.add(l),Gn(o,"add",l,l)),this},set(s,o){!t&&!dn(o)&&!er(o)&&(o=ct(o));const i=ct(this),{has:a,get:l}=po(i);let u=a.call(i,s);u||(s=ct(s),u=a.call(i,s));const c=l.call(i,s);return i.set(s,o),u?Rn(o,c)&&Gn(i,"set",s,o):Gn(i,"add",s,o),this},delete(s){const o=ct(this),{has:i,get:a}=po(o);let l=i.call(o,s);l||(s=ct(s),l=i.call(o,s)),a&&a.call(o,s);const u=o.delete(s);return l&&Gn(o,"delete",s,void 0),u},clear(){const s=ct(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]=Th(s,e,t)}),n}function Ua(e,t){const n=Ih(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(dt(n,s)&&s in r?n:r,s,o)}const Sh={get:Ua(!1,!1)},Eh={get:Ua(!1,!0)},Ch={get:Ua(!0,!1)};const Fu=new WeakMap,Hu=new WeakMap,Vu=new WeakMap,Ah=new WeakMap;function Rh(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function xh(e){return e.__v_skip||!Object.isExtensible(e)?0:Rh(eh(e))}function ei(e){return er(e)?e:Fa(e,!1,bh,Sh,Fu)}function Wu(e){return Fa(e,!1,kh,Eh,Hu)}function ea(e){return Fa(e,!0,_h,Ch,Vu)}function Fa(e,t,n,r,s){if(!ft(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=xh(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 Vr(e){return er(e)?Vr(e.__v_raw):!!(e&&e.__v_isReactive)}function er(e){return!!(e&&e.__v_isReadonly)}function dn(e){return!!(e&&e.__v_isShallow)}function Ha(e){return e?!!e.__v_raw:!1}function ct(e){const t=e&&e.__v_raw;return t?ct(t):e}function Ph(e){return!dt(e,"__v_skip")&&Object.isExtensible(e)&&Eu(e,"__v_skip",!0),e}const yn=e=>ft(e)?ei(e):e,hs=e=>ft(e)?ea(e):e;function qt(e){return e?e.__v_isRef===!0:!1}function L(e){return zu(e,!1)}function Mh(e){return zu(e,!0)}function zu(e,t){return qt(e)?e:new Oh(e,t)}class Oh{constructor(t,n){this.dep=new Ba,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ct(t),this._value=n?t:yn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||dn(t)||er(t);t=r?t:ct(t),Rn(t,n)&&(this._rawValue=t,this._value=r?t:yn(t),this.dep.trigger())}}function ue(e){return qt(e)?e.value:e}const Nh={get:(e,t,n)=>t==="__v_raw"?e:ue(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return qt(s)&&!qt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function qu(e){return Vr(e)?e:new Proxy(e,Nh)}class $h{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ba(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ws-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Tt!==this)return Mu(this,!0),!0}get value(){const t=this.dep.track();return $u(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Dh(e,t,n=!1){let r,s;return ze(e)?r=e:(r=e.get,s=e.set),new $h(r,s,n)}const go={},Oo=new WeakMap;let Dr;function Lh(e,t=!1,n=Dr){if(n){let r=Oo.get(n);r||Oo.set(n,r=[]),r.push(e)}}function jh(e,t,n=bt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,u=j=>s?j:dn(j)||s===!1||s===0?Kn(j,1):Kn(j);let c,f,h,b,N=!1,I=!1;if(qt(e)?(f=()=>e.value,N=dn(e)):Vr(e)?(f=()=>u(e),N=!0):Le(e)?(I=!0,N=e.some(j=>Vr(j)||dn(j)),f=()=>e.map(j=>{if(qt(j))return j.value;if(Vr(j))return u(j);if(ze(j))return l?l(j,2):j()})):ze(e)?t?f=l?()=>l(e,2):e:f=()=>{if(h){Xn();try{h()}finally{Zn()}}const j=Dr;Dr=c;try{return l?l(e,3,[b]):e(b)}finally{Dr=j}}:f=On,t&&s){const j=f,oe=s===!0?1/0:s;f=()=>Kn(j(),oe)}const O=fh(),Y=()=>{c.stop(),O&&O.active&&Ma(O.effects,c)};if(o&&t){const j=t;t=(...oe)=>{j(...oe),Y()}}let $=I?new Array(e.length).fill(go):go;const z=j=>{if(!(!(c.flags&1)||!c.dirty&&!j))if(t){const oe=c.run();if(s||N||(I?oe.some((de,ve)=>Rn(de,$[ve])):Rn(oe,$))){h&&h();const de=Dr;Dr=c;try{const ve=[oe,$===go?void 0:I&&$[0]===go?[]:$,b];$=oe,l?l(t,3,ve):t(...ve)}finally{Dr=de}}}else c.run()};return a&&a(z),c=new xu(f),c.scheduler=i?()=>i(z,!1):z,b=j=>Lh(j,!1,c),h=c.onStop=()=>{const j=Oo.get(c);if(j){if(l)l(j,4);else for(const oe of j)oe();Oo.delete(c)}},t?r?z(!0):$=c.run():i?i(z.bind(null,!0),!0):c.run(),Y.pause=c.pause.bind(c),Y.resume=c.resume.bind(c),Y.stop=Y,Y}function Kn(e,t=1/0,n){if(t<=0||!ft(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,qt(e))Kn(e.value,t,n);else if(Le(e))for(let r=0;r<e.length;r++)Kn(e[r],t,n);else if(ku(e)||os(e))e.forEach(r=>{Kn(r,t,n)});else if(Su(e)){for(const r in e)Kn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Kn(e[r],t,n)}return e}/**
9
+ **/let en;class dh{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=en,!t&&en&&(this.index=(en.scopes||(en.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=en;try{return en=this,t()}finally{en=n}}}on(){++this._on===1&&(this.prevScope=en,en=this)}off(){this._on>0&&--this._on===0&&(en=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 fh(){return en}let kt;const yi=new WeakSet;class Ru{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,en&&en.active&&en.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,yi.has(this)&&(yi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||xu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,bl(this),Mu(this);const t=kt,n=pn;kt=this,pn=!0;try{return this.fn()}finally{Ou(this),kt=t,pn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)La(t);this.deps=this.depsTail=void 0,bl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?yi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ji(this)&&this.run()}get dirty(){return Ji(this)}}let Pu=0,$s,Ds;function xu(e,t=!1){if(e.flags|=8,t){e.next=Ds,Ds=e;return}e.next=$s,$s=e}function $a(){Pu++}function Da(){if(--Pu>0)return;if(Ds){let t=Ds;for(Ds=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;$s;){let t=$s;for($s=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 Mu(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ou(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),La(r),hh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Ji(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Nu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Nu(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ws)||(e.globalVersion=Ws,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ji(e))))return;e.flags|=2;const t=e.dep,n=kt,r=pn;kt=e,pn=!0;try{Mu(e);const s=e.fn(e._value);(t.version===0||Rn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{kt=n,pn=r,Ou(e),e.flags&=-3}}function La(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)La(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function hh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let pn=!0;const $u=[];function Qn(){$u.push(pn),pn=!1}function Xn(){const e=$u.pop();pn=e===void 0?!0:e}function bl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=kt;kt=void 0;try{t()}finally{kt=n}}}let Ws=0;class ph{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 ja{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(!kt||!pn||kt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==kt)n=this.activeLink=new ph(kt,this),kt.deps?(n.prevDep=kt.depsTail,kt.depsTail.nextDep=n,kt.depsTail=n):kt.deps=kt.depsTail=n,Du(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=kt.depsTail,n.nextDep=void 0,kt.depsTail.nextDep=n,kt.depsTail=n,kt.deps===n&&(kt.deps=r)}return n}trigger(t){this.version++,Ws++,this.notify(t)}notify(t){$a();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Da()}}}function Du(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)Du(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Yi=new WeakMap,Hr=Symbol(""),Qi=Symbol(""),qs=Symbol("");function Wt(e,t,n){if(pn&&kt){let r=Yi.get(e);r||Yi.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new ja),s.map=r,s.key=n),s.track()}}function zn(e,t,n,r,s,o){const i=Yi.get(e);if(!i){Ws++;return}const a=l=>{l&&l.trigger()};if($a(),t==="clear")i.forEach(a);else{const l=Le(e),u=l&&Ma(n);if(l&&n==="length"){const c=Number(r);i.forEach((f,h)=>{(h==="length"||h===qs||!vn(h)&&h>=c)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(qs)),t){case"add":l?u&&a(i.get("length")):(a(i.get(Hr)),ss(e)&&a(i.get(Qi)));break;case"delete":l||(a(i.get(Hr)),ss(e)&&a(i.get(Qi)));break;case"set":ss(e)&&a(i.get(Hr));break}}Da()}function Xr(e){const t=lt(e);return t===e?t:(Wt(t,"iterate",qs),dn(e)?t:t.map(yn))}function Zo(e){return Wt(e=lt(e),"iterate",qs),e}function Cn(e,t){return Zn(e)?fs(Vr(e)?yn(t):t):yn(t)}const mh={__proto__:null,[Symbol.iterator](){return wi(this,Symbol.iterator,e=>Cn(this,e))},concat(...e){return Xr(this).concat(...e.map(t=>Le(t)?Xr(t):t))},entries(){return wi(this,"entries",e=>(e[1]=Cn(this,e[1]),e))},every(e,t){return Fn(this,"every",e,t,void 0,arguments)},filter(e,t){return Fn(this,"filter",e,t,n=>n.map(r=>Cn(this,r)),arguments)},find(e,t){return Fn(this,"find",e,t,n=>Cn(this,n),arguments)},findIndex(e,t){return Fn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Fn(this,"findLast",e,t,n=>Cn(this,n),arguments)},findLastIndex(e,t){return Fn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Fn(this,"forEach",e,t,void 0,arguments)},includes(...e){return bi(this,"includes",e)},indexOf(...e){return bi(this,"indexOf",e)},join(e){return Xr(this).join(e)},lastIndexOf(...e){return bi(this,"lastIndexOf",e)},map(e,t){return Fn(this,"map",e,t,void 0,arguments)},pop(){return Cs(this,"pop")},push(...e){return Cs(this,"push",e)},reduce(e,...t){return _l(this,"reduce",e,t)},reduceRight(e,...t){return _l(this,"reduceRight",e,t)},shift(){return Cs(this,"shift")},some(e,t){return Fn(this,"some",e,t,void 0,arguments)},splice(...e){return Cs(this,"splice",e)},toReversed(){return Xr(this).toReversed()},toSorted(e){return Xr(this).toSorted(e)},toSpliced(...e){return Xr(this).toSpliced(...e)},unshift(...e){return Cs(this,"unshift",e)},values(){return wi(this,"values",e=>Cn(this,e))}};function wi(e,t,n){const r=Zo(e),s=r[t]();return r!==e&&!dn(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const gh=Array.prototype;function Fn(e,t,n,r,s,o){const i=Zo(e),a=i!==e&&!dn(e),l=i[t];if(l!==gh[t]){const f=l.apply(e,o);return a?yn(f):f}let u=n;i!==e&&(a?u=function(f,h){return n.call(this,Cn(e,f),h,e)}:n.length>2&&(u=function(f,h){return n.call(this,f,h,e)}));const c=l.call(i,u,r);return a&&s?s(c):c}function _l(e,t,n,r){const s=Zo(e),o=s!==e&&!dn(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(u,c,f){return a&&(a=!1,u=Cn(e,u)),n.call(this,u,Cn(e,c),f,e)}):n.length>3&&(i=function(u,c,f){return n.call(this,u,c,f,e)}));const l=s[t](i,...r);return a?Cn(e,l):l}function bi(e,t,n){const r=lt(e);Wt(r,"iterate",qs);const s=r[t](...n);return(s===-1||s===!1)&&Fa(n[0])?(n[0]=lt(n[0]),r[t](...n)):s}function Cs(e,t,n=[]){Qn(),$a();const r=lt(e)[t].apply(e,n);return Da(),Xn(),r}const vh=Ra("__proto__,__v_isRef,__isVue"),Lu=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(vn));function yh(e){vn(e)||(e=String(e));const t=lt(this);return Wt(t,"has",e),t.hasOwnProperty(e)}class ju{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?Ah:Hu:o?Fu:Uu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Le(t);if(!s){let l;if(i&&(l=mh[n]))return l;if(n==="hasOwnProperty")return yh}const a=Reflect.get(t,n,Gt(t)?t:r);if((vn(n)?Lu.has(n):vh(n))||(s||Wt(t,"get",n),o))return a;if(Gt(a)){const l=i&&Ma(n)?a:a.value;return s&&dt(l)?Zi(l):l}return dt(a)?s?Zi(a):ei(a):a}}class Bu extends ju{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Le(t)&&Ma(n);if(!this._isShallow){const u=Zn(o);if(!dn(r)&&!Zn(r)&&(o=lt(o),r=lt(r)),!i&&Gt(o)&&!Gt(r))return u||(o.value=r),!0}const a=i?Number(n)<t.length:ut(t,n),l=Reflect.set(t,n,r,Gt(t)?t:s);return t===lt(s)&&(a?Rn(r,o)&&zn(t,"set",n,r):zn(t,"add",n,r)),l}deleteProperty(t,n){const r=ut(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&zn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!vn(n)||!Lu.has(n))&&Wt(t,"has",n),r}ownKeys(t){return Wt(t,"iterate",Le(t)?"length":Hr),Reflect.ownKeys(t)}}class wh extends ju{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const bh=new Bu,_h=new wh,kh=new Bu(!0);const Xi=e=>e,po=e=>Reflect.getPrototypeOf(e);function Th(e,t,n){return function(...r){const s=this.__v_raw,o=lt(s),i=ss(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=s[e](...r),c=n?Xi:t?fs:yn;return!t&&Wt(o,"iterate",l?Qi:Hr),$t(Object.create(u),{next(){const{value:f,done:h}=u.next();return h?{value:f,done:h}:{value:a?[c(f[0]),c(f[1])]:c(f),done:h}}})}}function mo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ih(e,t){const n={get(s){const o=this.__v_raw,i=lt(o),a=lt(s);e||(Rn(s,a)&&Wt(i,"get",s),Wt(i,"get",a));const{has:l}=po(i),u=t?Xi:e?fs:yn;if(l.call(i,s))return u(o.get(s));if(l.call(i,a))return u(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Wt(lt(s),"iterate",Hr),s.size},has(s){const o=this.__v_raw,i=lt(o),a=lt(s);return e||(Rn(s,a)&&Wt(i,"has",s),Wt(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=lt(a),u=t?Xi:e?fs:yn;return!e&&Wt(l,"iterate",Hr),a.forEach((c,f)=>s.call(o,u(c),u(f),i))}};return $t(n,e?{add:mo("add"),set:mo("set"),delete:mo("delete"),clear:mo("clear")}:{add(s){const o=lt(this),i=po(o),a=lt(s),l=!t&&!dn(s)&&!Zn(s)?a:s;return i.has.call(o,l)||Rn(s,l)&&i.has.call(o,s)||Rn(a,l)&&i.has.call(o,a)||(o.add(l),zn(o,"add",l,l)),this},set(s,o){!t&&!dn(o)&&!Zn(o)&&(o=lt(o));const i=lt(this),{has:a,get:l}=po(i);let u=a.call(i,s);u||(s=lt(s),u=a.call(i,s));const c=l.call(i,s);return i.set(s,o),u?Rn(o,c)&&zn(i,"set",s,o):zn(i,"add",s,o),this},delete(s){const o=lt(this),{has:i,get:a}=po(o);let l=i.call(o,s);l||(s=lt(s),l=i.call(o,s)),a&&a.call(o,s);const u=o.delete(s);return l&&zn(o,"delete",s,void 0),u},clear(){const s=lt(this),o=s.size!==0,i=s.clear();return o&&zn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Th(s,e,t)}),n}function Ba(e,t){const n=Ih(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(ut(n,s)&&s in r?n:r,s,o)}const Sh={get:Ba(!1,!1)},Eh={get:Ba(!1,!0)},Ch={get:Ba(!0,!1)};const Uu=new WeakMap,Fu=new WeakMap,Hu=new WeakMap,Ah=new WeakMap;function Rh(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ph(e){return e.__v_skip||!Object.isExtensible(e)?0:Rh(eh(e))}function ei(e){return Zn(e)?e:Ua(e,!1,bh,Sh,Uu)}function Vu(e){return Ua(e,!1,kh,Eh,Fu)}function Zi(e){return Ua(e,!0,_h,Ch,Hu)}function Ua(e,t,n,r,s){if(!dt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Ph(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 Vr(e){return Zn(e)?Vr(e.__v_raw):!!(e&&e.__v_isReactive)}function Zn(e){return!!(e&&e.__v_isReadonly)}function dn(e){return!!(e&&e.__v_isShallow)}function Fa(e){return e?!!e.__v_raw:!1}function lt(e){const t=e&&e.__v_raw;return t?lt(t):e}function xh(e){return!ut(e,"__v_skip")&&Object.isExtensible(e)&&Su(e,"__v_skip",!0),e}const yn=e=>dt(e)?ei(e):e,fs=e=>dt(e)?Zi(e):e;function Gt(e){return e?e.__v_isRef===!0:!1}function L(e){return Wu(e,!1)}function Mh(e){return Wu(e,!0)}function Wu(e,t){return Gt(e)?e:new Oh(e,t)}class Oh{constructor(t,n){this.dep=new ja,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:lt(t),this._value=n?t:yn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||dn(t)||Zn(t);t=r?t:lt(t),Rn(t,n)&&(this._rawValue=t,this._value=r?t:yn(t),this.dep.trigger())}}function ue(e){return Gt(e)?e.value:e}const Nh={get:(e,t,n)=>t==="__v_raw"?e:ue(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Gt(s)&&!Gt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function qu(e){return Vr(e)?e:new Proxy(e,Nh)}class $h{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ja(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ws-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&kt!==this)return xu(this,!0),!0}get value(){const t=this.dep.track();return Nu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Dh(e,t,n=!1){let r,s;return qe(e)?r=e:(r=e.get,s=e.set),new $h(r,s,n)}const go={},Oo=new WeakMap;let Dr;function Lh(e,t=!1,n=Dr){if(n){let r=Oo.get(n);r||Oo.set(n,r=[]),r.push(e)}}function jh(e,t,n=yt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,u=j=>s?j:dn(j)||s===!1||s===0?Gn(j,1):Gn(j);let c,f,h,b,N=!1,I=!1;if(Gt(e)?(f=()=>e.value,N=dn(e)):Vr(e)?(f=()=>u(e),N=!0):Le(e)?(I=!0,N=e.some(j=>Vr(j)||dn(j)),f=()=>e.map(j=>{if(Gt(j))return j.value;if(Vr(j))return u(j);if(qe(j))return l?l(j,2):j()})):qe(e)?t?f=l?()=>l(e,2):e:f=()=>{if(h){Qn();try{h()}finally{Xn()}}const j=Dr;Dr=c;try{return l?l(e,3,[b]):e(b)}finally{Dr=j}}:f=On,t&&s){const j=f,oe=s===!0?1/0:s;f=()=>Gn(j(),oe)}const O=fh(),Y=()=>{c.stop(),O&&O.active&&xa(O.effects,c)};if(o&&t){const j=t;t=(...oe)=>{j(...oe),Y()}}let $=I?new Array(e.length).fill(go):go;const q=j=>{if(!(!(c.flags&1)||!c.dirty&&!j))if(t){const oe=c.run();if(s||N||(I?oe.some((de,ve)=>Rn(de,$[ve])):Rn(oe,$))){h&&h();const de=Dr;Dr=c;try{const ve=[oe,$===go?void 0:I&&$[0]===go?[]:$,b];$=oe,l?l(t,3,ve):t(...ve)}finally{Dr=de}}}else c.run()};return a&&a(q),c=new Ru(f),c.scheduler=i?()=>i(q,!1):q,b=j=>Lh(j,!1,c),h=c.onStop=()=>{const j=Oo.get(c);if(j){if(l)l(j,4);else for(const oe of j)oe();Oo.delete(c)}},t?r?q(!0):$=c.run():i?i(q.bind(null,!0),!0):c.run(),Y.pause=c.pause.bind(c),Y.resume=c.resume.bind(c),Y.stop=Y,Y}function Gn(e,t=1/0,n){if(t<=0||!dt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Gt(e))Gn(e.value,t,n);else if(Le(e))for(let r=0;r<e.length;r++)Gn(e[r],t,n);else if(_u(e)||ss(e))e.forEach(r=>{Gn(r,t,n)});else if(Iu(e)){for(const r in e)Gn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Gn(e[r],t,n)}return e}/**
10
10
  * @vue/runtime-core v3.5.30
11
11
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
12
  * @license MIT
13
- **/function so(e,t,n,r){try{return r?e(...r):e()}catch(s){ti(s,t,n)}}function wn(e,t,n,r){if(ze(e)){const s=so(e,t,n,r);return s&&Tu(s)&&s.catch(o=>{ti(o,t,n)}),s}if(Le(e)){const s=[];for(let o=0;o<e.length;o++)s.push(wn(e[o],t,n,r));return s}}function ti(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||bt;if(t){let a=t.parent;const l=t.proxy,u=`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,u)===!1)return}a=a.parent}if(o){Xn(),so(o,null,10,[e,l,u]),Zn();return}}Bh(e,n,s,r,i)}function Bh(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Jt=[];let Sn=-1;const is=[];let pr=null,ts=0;const Gu=Promise.resolve();let No=null;function tn(e){const t=No||Gu;return e?t.then(this?e.bind(this):e):t}function Uh(e){let t=Sn+1,n=Jt.length;for(;t<n;){const r=t+n>>>1,s=Jt[r],o=qs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function Va(e){if(!(e.flags&1)){const t=qs(e),n=Jt[Jt.length-1];!n||!(e.flags&2)&&t>=qs(n)?Jt.push(e):Jt.splice(Uh(t),0,e),e.flags|=1,Ku()}}function Ku(){No||(No=Gu.then(Yu))}function Fh(e){Le(e)?is.push(...e):pr&&e.id===-1?pr.splice(ts+1,0,e):e.flags&1||(is.push(e),e.flags|=1),Ku()}function Tl(e,t,n=Sn+1){for(;n<Jt.length;n++){const r=Jt[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Jt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Ju(e){if(is.length){const t=[...new Set(is)].sort((n,r)=>qs(n)-qs(r));if(is.length=0,pr){pr.push(...t);return}for(pr=t,ts=0;ts<pr.length;ts++){const n=pr[ts];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}pr=null,ts=0}}const qs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Yu(e){try{for(Sn=0;Sn<Jt.length;Sn++){const t=Jt[Sn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),so(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Sn<Jt.length;Sn++){const t=Jt[Sn];t&&(t.flags&=-2)}Sn=-1,Jt.length=0,Ju(),No=null,(Jt.length||is.length)&&Yu()}}let Ut=null,Qu=null;function $o(e){const t=Ut;return Ut=e,Qu=e&&e.type.__scopeId||null,t}function pt(e,t=Ut,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Bo(-1);const o=$o(t);let i;try{i=e(...s)}finally{$o(o),r._d&&Bo(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function tr(e,t){if(Ut===null)return e;const n=ai(Ut),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=bt]=t[s];o&&(ze(o)&&(o={mounted:o,updated:o}),o.deep&&Kn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Pr(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&&(Xn(),wn(l,n,8,[e.el,a,e,t]),Zn())}}function Io(e,t){if(zt){let n=zt.provides;const r=zt.parent&&zt.parent.provides;r===n&&(n=zt.provides=Object.create(r)),n[e]=t}}function mn(e,t,n=!1){const r=Ka();if(r||ls){let s=ls?ls._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&&ze(t)?t.call(r&&r.proxy):t}}const Hh=Symbol.for("v-scx"),Vh=()=>mn(Hh);function mt(e,t,n){return Xu(e,t,n)}function Xu(e,t,n=bt){const{immediate:r,deep:s,flush:o,once:i}=n,a=$t({},n),l=t&&r||!t&&o!=="post";let u;if(Ys){if(o==="sync"){const b=Vh();u=b.__watcherHandles||(b.__watcherHandles=[])}else if(!l){const b=()=>{};return b.stop=On,b.resume=On,b.pause=On,b}}const c=zt;a.call=(b,N,I)=>wn(b,c,N,I);let f=!1;o==="post"?a.scheduler=b=>{Ht(b,c&&c.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(b,N)=>{N?b():Va(b)}),a.augmentJob=b=>{t&&(b.flags|=4),f&&(b.flags|=2,c&&(b.id=c.uid,b.i=c))};const h=jh(e,t,a);return Ys&&(u?u.push(h):l&&h()),h}function Wh(e,t,n){const r=this.proxy,s=Ct(e)?e.includes(".")?Zu(r,e):()=>r[e]:e.bind(r,r);let o;ze(t)?o=t:(o=t.handler,n=t);const i=oo(this),a=Xu(s,o.bind(r),n);return i(),a}function Zu(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 ed=Symbol("_vte"),td=e=>e.__isTeleport,Ls=e=>e&&(e.disabled||e.disabled===""),Il=e=>e&&(e.defer||e.defer===""),Sl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,El=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ta=(e,t)=>{const n=e&&e.to;return Ct(n)?t?t(n):null:n},nd={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,u){const{mc:c,pc:f,pbc:h,o:{insert:b,querySelector:N,createText:I,createComment:O}}=u,Y=Ls(t.props);let{shapeFlag:$,children:z,dynamicChildren:j}=t;if(e==null){const oe=t.el=I(""),de=t.anchor=I("");b(oe,n,r),b(de,n,r);const ve=(re,ee)=>{$&16&&c(z,re,ee,s,o,i,a,l)},Ie=()=>{const re=t.target=ta(t.props,N),ee=na(re,t,I,b);re&&(i!=="svg"&&Sl(re)?i="svg":i!=="mathml"&&El(re)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(re),Y||(ve(re,ee),So(t,!1)))};Y&&(ve(n,de),So(t,!0)),Il(t.props)?(t.el.__isMounted=!1,Ht(()=>{Ie(),delete t.el.__isMounted},o)):Ie()}else{if(Il(t.props)&&e.el.__isMounted===!1){Ht(()=>{nd.process(e,t,n,r,s,o,i,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const oe=t.anchor=e.anchor,de=t.target=e.target,ve=t.targetAnchor=e.targetAnchor,Ie=Ls(e.props),re=Ie?n:de,ee=Ie?oe:ve;if(i==="svg"||Sl(de)?i="svg":(i==="mathml"||El(de))&&(i="mathml"),j?(h(e.dynamicChildren,j,re,s,o,i,a),qa(e,t,!0)):l||f(e,t,re,ee,s,o,i,a,!1),Y)Ie?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):vo(t,n,oe,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ye=t.target=ta(t.props,N);ye&&vo(t,ye,null,u,0)}else Ie&&vo(t,de,ve,u,1);So(t,Y)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:c,target:f,props:h}=e;if(f&&(s(u),s(c)),o&&s(l),i&16){const b=o||!Ls(h);for(let N=0;N<a.length;N++){const I=a[N];r(I,t,n,b,!!I.dynamicChildren)}}},move:vo,hydrate:zh};function vo(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:u,props:c}=e,f=o===2;if(f&&r(i,t,n),(!f||Ls(c))&&l&16)for(let h=0;h<u.length;h++)s(u[h],t,n,2);f&&r(a,t,n)}function zh(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:c}},f){function h(O,Y){let $=Y;for(;$;){if($&&$.nodeType===8){if($.data==="teleport start anchor")t.targetStart=$;else if($.data==="teleport anchor"){t.targetAnchor=$,O._lpa=t.targetAnchor&&i(t.targetAnchor);break}}$=i($)}}function b(O,Y){Y.anchor=f(i(O),Y,a(O),n,r,s,o)}const N=t.target=ta(t.props,l),I=Ls(t.props);if(N){const O=N._lpa||N.firstChild;t.shapeFlag&16&&(I?(b(e,t),h(N,O),t.targetAnchor||na(N,t,c,u,a(e)===N?e:null)):(t.anchor=i(e),h(N,O),t.targetAnchor||na(N,t,c,u),f(O&&i(O),t,N,n,r,s,o))),So(t,I)}else I&&t.shapeFlag&16&&(b(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Do=nd;function So(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 na(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[ed]=i,e&&(r(o,e,s),r(i,e,s)),i}const En=Symbol("_leaveCb"),As=Symbol("_enterCb");function qh(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ir(()=>{e.isMounted=!0}),ar(()=>{e.isUnmounting=!0}),e}const cn=[Function,Array],rd={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:cn,onEnter:cn,onAfterEnter:cn,onEnterCancelled:cn,onBeforeLeave:cn,onLeave:cn,onAfterLeave:cn,onLeaveCancelled:cn,onBeforeAppear:cn,onAppear:cn,onAfterAppear:cn,onAppearCancelled:cn},sd=e=>{const t=e.subTree;return t.component?sd(t.component):t},Gh={name:"BaseTransition",props:rd,setup(e,{slots:t}){const n=Ka(),r=qh();return()=>{const s=t.default&&ad(t.default(),!0);if(!s||!s.length)return;const o=od(s),i=ct(e),{mode:a}=i;if(r.isLeaving)return ki(o);const l=Cl(o);if(!l)return ki(o);let u=ra(l,i,r,n,f=>u=f);l.type!==Wt&&Gs(l,u);let c=n.subTree&&Cl(n.subTree);if(c&&c.type!==Wt&&!jr(c,l)&&sd(n).type!==Wt){let f=ra(c,i,r,n);if(Gs(c,f),a==="out-in"&&l.type!==Wt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},ki(o);a==="in-out"&&l.type!==Wt?f.delayLeave=(h,b,N)=>{const I=id(r,c);I[String(c.key)]=c,h[En]=()=>{b(),h[En]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{N(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function od(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Wt){t=n;break}}return t}const Kh=Gh;function id(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 ra(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:h,onLeave:b,onAfterLeave:N,onLeaveCancelled:I,onBeforeAppear:O,onAppear:Y,onAfterAppear:$,onAppearCancelled:z}=t,j=String(e.key),oe=id(n,e),de=(re,ee)=>{re&&wn(re,r,9,ee)},ve=(re,ee)=>{const ye=ee[1];de(re,ee),Le(re)?re.every(te=>te.length<=1)&&ye():re.length<=1&&ye()},Ie={mode:i,persisted:a,beforeEnter(re){let ee=l;if(!n.isMounted)if(o)ee=O||l;else return;re[En]&&re[En](!0);const ye=oe[j];ye&&jr(e,ye)&&ye.el[En]&&ye.el[En](),de(ee,[re])},enter(re){if(oe[j]===e)return;let ee=u,ye=c,te=f;if(!n.isMounted)if(o)ee=Y||u,ye=$||c,te=z||f;else return;let je=!1;re[As]=Qe=>{je||(je=!0,Qe?de(te,[re]):de(ye,[re]),Ie.delayedLeave&&Ie.delayedLeave(),re[As]=void 0)};const Be=re[As].bind(null,!1);ee?ve(ee,[re,Be]):Be()},leave(re,ee){const ye=String(e.key);if(re[As]&&re[As](!0),n.isUnmounting)return ee();de(h,[re]);let te=!1;re[En]=Be=>{te||(te=!0,ee(),Be?de(I,[re]):de(N,[re]),re[En]=void 0,oe[ye]===e&&delete oe[ye])};const je=re[En].bind(null,!1);oe[ye]=e,b?ve(b,[re,je]):je()},clone(re){const ee=ra(re,t,n,r,s);return s&&s(ee),ee}};return Ie}function ki(e){if(ni(e))return e=kr(e),e.children=null,e}function Cl(e){if(!ni(e))return td(e.type)&&e.children?od(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&&ze(n.default))return n.default()}}function Gs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Gs(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 ad(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===He?(i.patchFlag&128&&s++,r=r.concat(ad(i.children,t,a))):(t||i.type!==Wt)&&r.push(a!=null?kr(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Lt(e,t){return ze(e)?$t({name:e.name},t,{setup:e}):e}function ld(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Al(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Lo=new WeakMap;function js(e,t,n,r,s=!1){if(Le(e)){e.forEach((I,O)=>js(I,t&&(Le(t)?t[O]:t),n,r,s));return}if(as(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&js(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?ai(r.component):r.el,i=s?null:o,{i:a,r:l}=e,u=t&&t.r,c=a.refs===bt?a.refs={}:a.refs,f=a.setupState,h=ct(f),b=f===bt?_u:I=>Al(c,I)?!1:dt(h,I),N=(I,O)=>!(O&&Al(c,O));if(u!=null&&u!==l){if(Rl(t),Ct(u))c[u]=null,b(u)&&(f[u]=null);else if(qt(u)){const I=t;N(u,I.k)&&(u.value=null),I.k&&(c[I.k]=null)}}if(ze(l))so(l,a,12,[i,c]);else{const I=Ct(l),O=qt(l);if(I||O){const Y=()=>{if(e.f){const $=I?b(l)?f[l]:c[l]:N()||!e.k?l.value:c[e.k];if(s)Le($)&&Ma($,o);else if(Le($))$.includes(o)||$.push(o);else if(I)c[l]=[o],b(l)&&(f[l]=c[l]);else{const z=[o];N(l,e.k)&&(l.value=z),e.k&&(c[e.k]=z)}}else I?(c[l]=i,b(l)&&(f[l]=i)):O&&(N(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const $=()=>{Y(),Lo.delete(e)};$.id=-1,Lo.set(e,$),Ht($,n)}else Rl(e),Y()}}}function Rl(e){const t=Lo.get(e);t&&(t.flags|=8,Lo.delete(e))}Xo().requestIdleCallback;Xo().cancelIdleCallback;const as=e=>!!e.type.__asyncLoader,ni=e=>e.type.__isKeepAlive;function Jh(e,t){cd(e,"a",t)}function Yh(e,t){cd(e,"da",t)}function cd(e,t,n=zt){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(ri(t,r,n),n){let s=n.parent;for(;s&&s.parent;)ni(s.parent.vnode)&&Qh(r,t,n,s),s=s.parent}}function Qh(e,t,n,r){const s=ri(t,e,r,!0);si(()=>{Ma(r[t],s)},n)}function ri(e,t,n=zt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Xn();const a=oo(n),l=wn(t,n,e,i);return a(),Zn(),l});return r?s.unshift(o):s.push(o),o}}const or=e=>(t,n=zt)=>{(!Ys||e==="sp")&&ri(e,(...r)=>t(...r),n)},Xh=or("bm"),ir=or("m"),Zh=or("bu"),ep=or("u"),ar=or("bum"),si=or("um"),tp=or("sp"),np=or("rtg"),rp=or("rtc");function sp(e,t=zt){ri("ec",e,t)}const op="components",ud=Symbol.for("v-ndc");function sa(e){return Ct(e)?ip(op,e,!1)||e:e||ud}function ip(e,t,n=!0,r=!1){const s=Ut||zt;if(s){const o=s.type;{const a=Wp(o,!1);if(a&&(a===t||a===Qt(t)||a===Qo(Qt(t))))return o}const i=xl(s[e]||o[e],t)||xl(s.appContext[e],t);return!i&&r?o:i}}function xl(e,t){return e&&(e[t]||e[Qt(t)]||e[Qo(Qt(t))])}function Et(e,t,n,r){let s;const o=n,i=Le(e);if(i||Ct(e)){const a=i&&Vr(e);let l=!1,u=!1;a&&(l=!dn(e),u=er(e),e=Zo(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(l?u?hs(yn(e[c])):yn(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(ft(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,u=a.length;l<u;l++){const c=a[l];s[l]=t(e[c],c,l,o)}}else s=[];return s}function Mn(e,t,n={},r,s){if(Ut.ce||Ut.parent&&as(Ut.parent)&&Ut.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),yt(He,null,[Ce("slot",n,r)],u?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&dd(o(n)),a=n.key||i&&i.key,l=yt(He,{key:(a&&!vn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function dd(e){return e.some(t=>Js(t)?!(t.type===Wt||t.type===He&&!dd(t.children)):!0)?e:null}const oa=e=>e?Pd(e)?ai(e):oa(e.parent):null,Bs=$t(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=>oa(e.parent),$root:e=>oa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>hd(e),$forceUpdate:e=>e.f||(e.f=()=>{Va(e.update)}),$nextTick:e=>e.n||(e.n=tn.bind(e.proxy)),$watch:e=>Wh.bind(e)}),Ti=(e,t)=>e!==bt&&!e.__isScriptSetup&&dt(e,t),ap={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 h=i[t];if(h!==void 0)switch(h){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(Ti(r,t))return i[t]=1,r[t];if(s!==bt&&dt(s,t))return i[t]=2,s[t];if(dt(o,t))return i[t]=3,o[t];if(n!==bt&&dt(n,t))return i[t]=4,n[t];ia&&(i[t]=0)}}const u=Bs[t];let c,f;if(u)return t==="$attrs"&&Vt(e.attrs,"get",""),u(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==bt&&dt(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,dt(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return Ti(s,t)?(s[t]=n,!0):r!==bt&&dt(r,t)?(r[t]=n,!0):dt(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!==bt&&a[0]!=="$"&&dt(e,a)||Ti(t,a)||dt(o,a)||dt(r,a)||dt(Bs,a)||dt(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:dt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function lp(){return cp().slots}function cp(e){const t=Ka();return t.setupContext||(t.setupContext=Od(t))}function Pl(e){return Le(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let ia=!0;function up(e){const t=hd(e),n=e.proxy,r=e.ctx;ia=!1,t.beforeCreate&&Ml(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:u,created:c,beforeMount:f,mounted:h,beforeUpdate:b,updated:N,activated:I,deactivated:O,beforeDestroy:Y,beforeUnmount:$,destroyed:z,unmounted:j,render:oe,renderTracked:de,renderTriggered:ve,errorCaptured:Ie,serverPrefetch:re,expose:ee,inheritAttrs:ye,components:te,directives:je,filters:Be}=t;if(u&&dp(u,r,null),i)for(const Te in i){const $e=i[Te];ze($e)&&(r[Te]=$e.bind(n))}if(s){const Te=s.call(n,n);ft(Te)&&(e.data=ei(Te))}if(ia=!0,o)for(const Te in o){const $e=o[Te],It=ze($e)?$e.bind(n,n):ze($e.get)?$e.get.bind(n,n):On,nt=!ze($e)&&ze($e.set)?$e.set.bind(n):On,Xe=pe({get:It,set:nt});Object.defineProperty(r,Te,{enumerable:!0,configurable:!0,get:()=>Xe.value,set:Ze=>Xe.value=Ze})}if(a)for(const Te in a)fd(a[Te],r,n,Te);if(l){const Te=ze(l)?l.call(n):l;Reflect.ownKeys(Te).forEach($e=>{Io($e,Te[$e])})}c&&Ml(c,e,"c");function Re(Te,$e){Le($e)?$e.forEach(It=>Te(It.bind(n))):$e&&Te($e.bind(n))}if(Re(Xh,f),Re(ir,h),Re(Zh,b),Re(ep,N),Re(Jh,I),Re(Yh,O),Re(sp,Ie),Re(rp,de),Re(np,ve),Re(ar,$),Re(si,j),Re(tp,re),Le(ee))if(ee.length){const Te=e.exposed||(e.exposed={});ee.forEach($e=>{Object.defineProperty(Te,$e,{get:()=>n[$e],set:It=>n[$e]=It,enumerable:!0})})}else e.exposed||(e.exposed={});oe&&e.render===On&&(e.render=oe),ye!=null&&(e.inheritAttrs=ye),te&&(e.components=te),je&&(e.directives=je),re&&ld(e)}function dp(e,t,n=On){Le(e)&&(e=aa(e));for(const r in e){const s=e[r];let o;ft(s)?"default"in s?o=mn(s.from||r,s.default,!0):o=mn(s.from||r):o=mn(s),qt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function Ml(e,t,n){wn(Le(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function fd(e,t,n,r){let s=r.includes(".")?Zu(n,r):()=>n[r];if(Ct(e)){const o=t[e];ze(o)&&mt(s,o)}else if(ze(e))mt(s,e.bind(n));else if(ft(e))if(Le(e))e.forEach(o=>fd(o,t,n,r));else{const o=ze(e.handler)?e.handler.bind(n):t[e.handler];ze(o)&&mt(s,o,e)}}function hd(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(u=>jo(l,u,i,!0)),jo(l,t,i)),ft(t)&&o.set(t,l),l}function jo(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&jo(e,o,n,!0),s&&s.forEach(i=>jo(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=fp[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const fp={data:Ol,props:Nl,emits:Nl,methods:Os,computed:Os,beforeCreate:Gt,created:Gt,beforeMount:Gt,mounted:Gt,beforeUpdate:Gt,updated:Gt,beforeDestroy:Gt,beforeUnmount:Gt,destroyed:Gt,unmounted:Gt,activated:Gt,deactivated:Gt,errorCaptured:Gt,serverPrefetch:Gt,components:Os,directives:Os,watch:pp,provide:Ol,inject:hp};function Ol(e,t){return t?e?function(){return $t(ze(e)?e.call(this,this):e,ze(t)?t.call(this,this):t)}:t:e}function hp(e,t){return Os(aa(e),aa(t))}function aa(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Gt(e,t){return e?[...new Set([].concat(e,t))]:t}function Os(e,t){return e?$t(Object.create(null),e,t):t}function Nl(e,t){return e?Le(e)&&Le(t)?[...new Set([...e,...t])]:$t(Object.create(null),Pl(e),Pl(t??{})):t}function pp(e,t){if(!e)return t;if(!t)return e;const n=$t(Object.create(null),e);for(const r in t)n[r]=Gt(e[r],t[r]);return n}function pd(){return{app:null,config:{isNativeTag:_u,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 mp=0;function gp(e,t){return function(r,s=null){ze(r)||(r=$t({},r)),s!=null&&!ft(s)&&(s=null);const o=pd(),i=new WeakSet,a=[];let l=!1;const u=o.app={_uid:mp++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:qp,get config(){return o.config},set config(c){},use(c,...f){return i.has(c)||(c&&ze(c.install)?(i.add(c),c.install(u,...f)):ze(c)&&(i.add(c),c(u,...f))),u},mixin(c){return o.mixins.includes(c)||o.mixins.push(c),u},component(c,f){return f?(o.components[c]=f,u):o.components[c]},directive(c,f){return f?(o.directives[c]=f,u):o.directives[c]},mount(c,f,h){if(!l){const b=u._ceVNode||Ce(r,s);return b.appContext=o,h===!0?h="svg":h===!1&&(h=void 0),e(b,c,h),l=!0,u._container=c,c.__vue_app__=u,ai(b.component)}},onUnmount(c){a.push(c)},unmount(){l&&(wn(a,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(c,f){return o.provides[c]=f,u},runWithContext(c){const f=ls;ls=u;try{return c()}finally{ls=f}}};return u}}let ls=null;const vp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Qt(t)}Modifiers`]||e[`${Tr(t)}Modifiers`];function yp(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||bt;let s=n;const o=t.startsWith("update:"),i=o&&vp(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>Ct(c)?c.trim():c)),i.number&&(s=n.map(Na)));let a,l=r[a=vi(t)]||r[a=vi(Qt(t))];!l&&o&&(l=r[a=vi(Tr(t))]),l&&wn(l,e,6,s);const u=r[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,wn(u,e,6,s)}}const wp=new WeakMap;function md(e,t,n=!1){const r=n?wp:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!ze(e)){const l=u=>{const c=md(u,t,!0);c&&(a=!0,$t(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(ft(e)&&r.set(e,null),null):(Le(o)?o.forEach(l=>i[l]=null):$t(i,o),ft(e)&&r.set(e,i),i)}function oi(e,t){return!e||!Jo(t)?!1:(t=t.slice(2).replace(/Once$/,""),dt(e,t[0].toLowerCase()+t.slice(1))||dt(e,Tr(t))||dt(e,t))}function $l(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:u,renderCache:c,props:f,data:h,setupState:b,ctx:N,inheritAttrs:I}=e,O=$o(e);let Y,$;try{if(n.shapeFlag&4){const j=s||r,oe=j;Y=An(u.call(oe,j,c,f,b,h,N)),$=a}else{const j=t;Y=An(j.length>1?j(f,{attrs:a,slots:i,emit:l}):j(f,null)),$=t.props?a:bp(a)}}catch(j){Us.length=0,ti(j,e,1),Y=Ce(Wt)}let z=Y;if($&&I!==!1){const j=Object.keys($),{shapeFlag:oe}=z;j.length&&oe&7&&(o&&j.some(Pa)&&($=_p($,o)),z=kr(z,$,!1,!0))}return n.dirs&&(z=kr(z,null,!1,!0),z.dirs=z.dirs?z.dirs.concat(n.dirs):n.dirs),n.transition&&Gs(z,n.transition),Y=z,$o(O),Y}const bp=e=>{let t;for(const n in e)(n==="class"||n==="style"||Jo(n))&&((t||(t={}))[n]=e[n]);return t},_p=(e,t)=>{const n={};for(const r in e)(!Pa(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function kp(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Dl(r,i,u):!!i;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const h=c[f];if(gd(i,r,h)&&!oi(u,h))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Dl(r,i,u):!0:!!i;return!1}function Dl(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(gd(t,e,o)&&!oi(n,o))return!0}return!1}function gd(e,t,n){const r=e[n],s=t[n];return n==="style"&&ft(r)&&ft(s)?!$a(r,s):r!==s}function Tp({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 vd={},yd=()=>Object.create(vd),wd=e=>Object.getPrototypeOf(e)===vd;function Ip(e,t,n,r=!1){const s={},o=yd();e.propsDefaults=Object.create(null),bd(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Wu(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Sp(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=ct(s),[l]=e.propsOptions;let u=!1;if((r||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let h=c[f];if(oi(e.emitsOptions,h))continue;const b=t[h];if(l)if(dt(o,h))b!==o[h]&&(o[h]=b,u=!0);else{const N=Qt(h);s[N]=la(l,a,N,b,e,!1)}else b!==o[h]&&(o[h]=b,u=!0)}}}else{bd(e,t,s,o)&&(u=!0);let c;for(const f in a)(!t||!dt(t,f)&&((c=Tr(f))===f||!dt(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(s[f]=la(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!dt(t,f))&&(delete o[f],u=!0)}u&&Gn(e.attrs,"set","")}function bd(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Ns(l))continue;const u=t[l];let c;s&&dt(s,c=Qt(l))?!o||!o.includes(c)?n[c]=u:(a||(a={}))[c]=u:oi(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(o){const l=ct(n),u=a||bt;for(let c=0;c<o.length;c++){const f=o[c];n[f]=la(s,l,f,u[f],e,!dt(u,f))}}return i}function la(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=dt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&ze(l)){const{propsDefaults:u}=s;if(n in u)r=u[n];else{const c=oo(s);r=u[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===Tr(n))&&(r=!0))}return r}const Ep=new WeakMap;function _d(e,t,n=!1){const r=n?Ep:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!ze(e)){const c=f=>{l=!0;const[h,b]=_d(f,t,!0);$t(i,h),b&&a.push(...b)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return ft(e)&&r.set(e,ss),ss;if(Le(o))for(let c=0;c<o.length;c++){const f=Qt(o[c]);Ll(f)&&(i[f]=bt)}else if(o)for(const c in o){const f=Qt(c);if(Ll(f)){const h=o[c],b=i[f]=Le(h)||ze(h)?{type:h}:$t({},h),N=b.type;let I=!1,O=!0;if(Le(N))for(let Y=0;Y<N.length;++Y){const $=N[Y],z=ze($)&&$.name;if(z==="Boolean"){I=!0;break}else z==="String"&&(O=!1)}else I=ze(N)&&N.name==="Boolean";b[0]=I,b[1]=O,(I||dt(b,"default"))&&a.push(f)}}const u=[i,a];return ft(e)&&r.set(e,u),u}function Ll(e){return e[0]!=="$"&&!Ns(e)}const Wa=e=>e==="_"||e==="_ctx"||e==="$stable",za=e=>Le(e)?e.map(An):[An(e)],Cp=(e,t,n)=>{if(t._n)return t;const r=pt((...s)=>za(t(...s)),n);return r._c=!1,r},kd=(e,t,n)=>{const r=e._ctx;for(const s in e){if(Wa(s))continue;const o=e[s];if(ze(o))t[s]=Cp(s,o,r);else if(o!=null){const i=za(o);t[s]=()=>i}}},Td=(e,t)=>{const n=za(t);e.slots.default=()=>n},Id=(e,t,n)=>{for(const r in t)(n||!Wa(r))&&(e[r]=t[r])},Ap=(e,t,n)=>{const r=e.slots=yd();if(e.vnode.shapeFlag&32){const s=t._;s?(Id(r,t,n),n&&Eu(r,"_",s,!0)):kd(t,r)}else t&&Td(e,t)},Rp=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=bt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:Id(s,t,n):(o=!t.$stable,kd(t,s)),i=t}else t&&(Td(e,t),i={default:1});if(o)for(const a in s)!Wa(a)&&i[a]==null&&delete s[a]},Ht=Np;function xp(e){return Pp(e)}function Pp(e,t){const n=Xo();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:h,setScopeId:b=On,insertStaticContent:N}=e,I=(g,v,A,H=null,F=null,x=null,D=void 0,B=null,G=!!v.dynamicChildren)=>{if(g===v)return;g&&!jr(g,v)&&(H=W(g),Ze(g,F,x,!0),g=null),v.patchFlag===-2&&(G=!1,v.dynamicChildren=null);const{type:V,ref:be,shapeFlag:ae}=v;switch(V){case ii:O(g,v,A,H);break;case Wt:Y(g,v,A,H);break;case Si:g==null&&$(v,A,H,D);break;case He:te(g,v,A,H,F,x,D,B,G);break;default:ae&1?oe(g,v,A,H,F,x,D,B,G):ae&6?je(g,v,A,H,F,x,D,B,G):(ae&64||ae&128)&&V.process(g,v,A,H,F,x,D,B,G,fe)}be!=null&&F?js(be,g&&g.ref,x,v||g,!v):be==null&&g&&g.ref!=null&&js(g.ref,null,x,g,!0)},O=(g,v,A,H)=>{if(g==null)r(v.el=a(v.children),A,H);else{const F=v.el=g.el;v.children!==g.children&&u(F,v.children)}},Y=(g,v,A,H)=>{g==null?r(v.el=l(v.children||""),A,H):v.el=g.el},$=(g,v,A,H)=>{[g.el,g.anchor]=N(g.children,v,A,H,g.el,g.anchor)},z=({el:g,anchor:v},A,H)=>{let F;for(;g&&g!==v;)F=h(g),r(g,A,H),g=F;r(v,A,H)},j=({el:g,anchor:v})=>{let A;for(;g&&g!==v;)A=h(g),s(g),g=A;s(v)},oe=(g,v,A,H,F,x,D,B,G)=>{if(v.type==="svg"?D="svg":v.type==="math"&&(D="mathml"),g==null)de(v,A,H,F,x,D,B,G);else{const V=g.el&&g.el._isVueCE?g.el:null;try{V&&V._beginPatch(),re(g,v,F,x,D,B,G)}finally{V&&V._endPatch()}}},de=(g,v,A,H,F,x,D,B)=>{let G,V;const{props:be,shapeFlag:ae,transition:he,dirs:Se}=g;if(G=g.el=i(g.type,x,be&&be.is,be),ae&8?c(G,g.children):ae&16&&Ie(g.children,G,null,H,F,Ii(g,x),D,B),Se&&Pr(g,null,H,"created"),ve(G,g,g.scopeId,D,H),be){for(const Ke in be)Ke!=="value"&&!Ns(Ke)&&o(G,Ke,null,be[Ke],x,H);"value"in be&&o(G,"value",null,be.value,x),(V=be.onVnodeBeforeMount)&&In(V,H,g)}Se&&Pr(g,null,H,"beforeMount");const Me=Mp(F,he);Me&&he.beforeEnter(G),r(G,v,A),((V=be&&be.onVnodeMounted)||Me||Se)&&Ht(()=>{V&&In(V,H,g),Me&&he.enter(G),Se&&Pr(g,null,H,"mounted")},F)},ve=(g,v,A,H,F)=>{if(A&&b(g,A),H)for(let x=0;x<H.length;x++)b(g,H[x]);if(F){let x=F.subTree;if(v===x||Cd(x.type)&&(x.ssContent===v||x.ssFallback===v)){const D=F.vnode;ve(g,D,D.scopeId,D.slotScopeIds,F.parent)}}},Ie=(g,v,A,H,F,x,D,B,G=0)=>{for(let V=G;V<g.length;V++){const be=g[V]=B?qn(g[V]):An(g[V]);I(null,be,v,A,H,F,x,D,B)}},re=(g,v,A,H,F,x,D)=>{const B=v.el=g.el;let{patchFlag:G,dynamicChildren:V,dirs:be}=v;G|=g.patchFlag&16;const ae=g.props||bt,he=v.props||bt;let Se;if(A&&Mr(A,!1),(Se=he.onVnodeBeforeUpdate)&&In(Se,A,v,g),be&&Pr(v,g,A,"beforeUpdate"),A&&Mr(A,!0),(ae.innerHTML&&he.innerHTML==null||ae.textContent&&he.textContent==null)&&c(B,""),V?ee(g.dynamicChildren,V,B,A,H,Ii(v,F),x):D||$e(g,v,B,null,A,H,Ii(v,F),x,!1),G>0){if(G&16)ye(B,ae,he,A,F);else if(G&2&&ae.class!==he.class&&o(B,"class",null,he.class,F),G&4&&o(B,"style",ae.style,he.style,F),G&8){const Me=v.dynamicProps;for(let Ke=0;Ke<Me.length;Ke++){const Pe=Me[Ke],Ve=ae[Pe],_t=he[Pe];(_t!==Ve||Pe==="value")&&o(B,Pe,Ve,_t,F,A)}}G&1&&g.children!==v.children&&c(B,v.children)}else!D&&V==null&&ye(B,ae,he,A,F);((Se=he.onVnodeUpdated)||be)&&Ht(()=>{Se&&In(Se,A,v,g),be&&Pr(v,g,A,"updated")},H)},ee=(g,v,A,H,F,x,D)=>{for(let B=0;B<v.length;B++){const G=g[B],V=v[B],be=G.el&&(G.type===He||!jr(G,V)||G.shapeFlag&198)?f(G.el):A;I(G,V,be,null,H,F,x,D,!0)}},ye=(g,v,A,H,F)=>{if(v!==A){if(v!==bt)for(const x in v)!Ns(x)&&!(x in A)&&o(g,x,v[x],null,F,H);for(const x in A){if(Ns(x))continue;const D=A[x],B=v[x];D!==B&&x!=="value"&&o(g,x,B,D,F,H)}"value"in A&&o(g,"value",v.value,A.value,F)}},te=(g,v,A,H,F,x,D,B,G)=>{const V=v.el=g?g.el:a(""),be=v.anchor=g?g.anchor:a("");let{patchFlag:ae,dynamicChildren:he,slotScopeIds:Se}=v;Se&&(B=B?B.concat(Se):Se),g==null?(r(V,A,H),r(be,A,H),Ie(v.children||[],A,be,F,x,D,B,G)):ae>0&&ae&64&&he&&g.dynamicChildren&&g.dynamicChildren.length===he.length?(ee(g.dynamicChildren,he,A,F,x,D,B),(v.key!=null||F&&v===F.subTree)&&qa(g,v,!0)):$e(g,v,A,be,F,x,D,B,G)},je=(g,v,A,H,F,x,D,B,G)=>{v.slotScopeIds=B,g==null?v.shapeFlag&512?F.ctx.activate(v,A,H,D,G):Be(v,A,H,F,x,D,G):Qe(g,v,G)},Be=(g,v,A,H,F,x,D)=>{const B=g.component=Up(g,H,F);if(ni(g)&&(B.ctx.renderer=fe),Fp(B,!1,D),B.asyncDep){if(F&&F.registerDep(B,Re,D),!g.el){const G=B.subTree=Ce(Wt);Y(null,G,v,A),g.placeholder=G.el}}else Re(B,g,v,A,F,x,D)},Qe=(g,v,A)=>{const H=v.component=g.component;if(kp(g,v,A))if(H.asyncDep&&!H.asyncResolved){Te(H,v,A);return}else H.next=v,H.update();else v.el=g.el,H.vnode=v},Re=(g,v,A,H,F,x,D)=>{const B=()=>{if(g.isMounted){let{next:ae,bu:he,u:Se,parent:Me,vnode:Ke}=g;{const K=Sd(g);if(K){ae&&(ae.el=Ke.el,Te(g,ae,D)),K.asyncDep.then(()=>{Ht(()=>{g.isUnmounted||V()},F)});return}}let Pe=ae,Ve;Mr(g,!1),ae?(ae.el=Ke.el,Te(g,ae,D)):ae=Ke,he&&To(he),(Ve=ae.props&&ae.props.onVnodeBeforeUpdate)&&In(Ve,Me,ae,Ke),Mr(g,!0);const _t=$l(g),U=g.subTree;g.subTree=_t,I(U,_t,f(U.el),W(U),g,F,x),ae.el=_t.el,Pe===null&&Tp(g,_t.el),Se&&Ht(Se,F),(Ve=ae.props&&ae.props.onVnodeUpdated)&&Ht(()=>In(Ve,Me,ae,Ke),F)}else{let ae;const{el:he,props:Se}=v,{bm:Me,m:Ke,parent:Pe,root:Ve,type:_t}=g,U=as(v);Mr(g,!1),Me&&To(Me),!U&&(ae=Se&&Se.onVnodeBeforeMount)&&In(ae,Pe,v),Mr(g,!0);{Ve.ce&&Ve.ce._hasShadowRoot()&&Ve.ce._injectChildStyle(_t,g.parent?g.parent.type:void 0);const K=g.subTree=$l(g);I(null,K,A,H,g,F,x),v.el=K.el}if(Ke&&Ht(Ke,F),!U&&(ae=Se&&Se.onVnodeMounted)){const K=v;Ht(()=>In(ae,Pe,K),F)}(v.shapeFlag&256||Pe&&as(Pe.vnode)&&Pe.vnode.shapeFlag&256)&&g.a&&Ht(g.a,F),g.isMounted=!0,v=A=H=null}};g.scope.on();const G=g.effect=new xu(B);g.scope.off();const V=g.update=G.run.bind(G),be=g.job=G.runIfDirty.bind(G);be.i=g,be.id=g.uid,G.scheduler=()=>Va(be),Mr(g,!0),V()},Te=(g,v,A)=>{v.component=g;const H=g.vnode.props;g.vnode=v,g.next=null,Sp(g,v.props,H,A),Rp(g,v.children,A),Xn(),Tl(g),Zn()},$e=(g,v,A,H,F,x,D,B,G=!1)=>{const V=g&&g.children,be=g?g.shapeFlag:0,ae=v.children,{patchFlag:he,shapeFlag:Se}=v;if(he>0){if(he&128){nt(V,ae,A,H,F,x,D,B,G);return}else if(he&256){It(V,ae,A,H,F,x,D,B,G);return}}Se&8?(be&16&&et(V,F,x),ae!==V&&c(A,ae)):be&16?Se&16?nt(V,ae,A,H,F,x,D,B,G):et(V,F,x,!0):(be&8&&c(A,""),Se&16&&Ie(ae,A,H,F,x,D,B,G))},It=(g,v,A,H,F,x,D,B,G)=>{g=g||ss,v=v||ss;const V=g.length,be=v.length,ae=Math.min(V,be);let he;for(he=0;he<ae;he++){const Se=v[he]=G?qn(v[he]):An(v[he]);I(g[he],Se,A,null,F,x,D,B,G)}V>be?et(g,F,x,!0,!1,ae):Ie(v,A,H,F,x,D,B,G,ae)},nt=(g,v,A,H,F,x,D,B,G)=>{let V=0;const be=v.length;let ae=g.length-1,he=be-1;for(;V<=ae&&V<=he;){const Se=g[V],Me=v[V]=G?qn(v[V]):An(v[V]);if(jr(Se,Me))I(Se,Me,A,null,F,x,D,B,G);else break;V++}for(;V<=ae&&V<=he;){const Se=g[ae],Me=v[he]=G?qn(v[he]):An(v[he]);if(jr(Se,Me))I(Se,Me,A,null,F,x,D,B,G);else break;ae--,he--}if(V>ae){if(V<=he){const Se=he+1,Me=Se<be?v[Se].el:H;for(;V<=he;)I(null,v[V]=G?qn(v[V]):An(v[V]),A,Me,F,x,D,B,G),V++}}else if(V>he)for(;V<=ae;)Ze(g[V],F,x,!0),V++;else{const Se=V,Me=V,Ke=new Map;for(V=Me;V<=he;V++){const it=v[V]=G?qn(v[V]):An(v[V]);it.key!=null&&Ke.set(it.key,V)}let Pe,Ve=0;const _t=he-Me+1;let U=!1,K=0;const ne=new Array(_t);for(V=0;V<_t;V++)ne[V]=0;for(V=Se;V<=ae;V++){const it=g[V];if(Ve>=_t){Ze(it,F,x,!0);continue}let kt;if(it.key!=null)kt=Ke.get(it.key);else for(Pe=Me;Pe<=he;Pe++)if(ne[Pe-Me]===0&&jr(it,v[Pe])){kt=Pe;break}kt===void 0?Ze(it,F,x,!0):(ne[kt-Me]=V+1,kt>=K?K=kt:U=!0,I(it,v[kt],A,null,F,x,D,B,G),Ve++)}const Je=U?Op(ne):ss;for(Pe=Je.length-1,V=_t-1;V>=0;V--){const it=Me+V,kt=v[it],xt=v[it+1],ln=it+1<be?xt.el||Ed(xt):H;ne[V]===0?I(null,kt,A,ln,F,x,D,B,G):U&&(Pe<0||V!==Je[Pe]?Xe(kt,A,ln,2):Pe--)}}},Xe=(g,v,A,H,F=null)=>{const{el:x,type:D,transition:B,children:G,shapeFlag:V}=g;if(V&6){Xe(g.component.subTree,v,A,H);return}if(V&128){g.suspense.move(v,A,H);return}if(V&64){D.move(g,v,A,fe);return}if(D===He){r(x,v,A);for(let ae=0;ae<G.length;ae++)Xe(G[ae],v,A,H);r(g.anchor,v,A);return}if(D===Si){z(g,v,A);return}if(H!==2&&V&1&&B)if(H===0)B.beforeEnter(x),r(x,v,A),Ht(()=>B.enter(x),F);else{const{leave:ae,delayLeave:he,afterLeave:Se}=B,Me=()=>{g.ctx.isUnmounted?s(x):r(x,v,A)},Ke=()=>{x._isLeaving&&x[En](!0),ae(x,()=>{Me(),Se&&Se()})};he?he(x,Me,Ke):Ke()}else r(x,v,A)},Ze=(g,v,A,H=!1,F=!1)=>{const{type:x,props:D,ref:B,children:G,dynamicChildren:V,shapeFlag:be,patchFlag:ae,dirs:he,cacheIndex:Se}=g;if(ae===-2&&(F=!1),B!=null&&(Xn(),js(B,null,A,g,!0),Zn()),Se!=null&&(v.renderCache[Se]=void 0),be&256){v.ctx.deactivate(g);return}const Me=be&1&&he,Ke=!as(g);let Pe;if(Ke&&(Pe=D&&D.onVnodeBeforeUnmount)&&In(Pe,v,g),be&6)Ge(g.component,A,H);else{if(be&128){g.suspense.unmount(A,H);return}Me&&Pr(g,null,v,"beforeUnmount"),be&64?g.type.remove(g,v,A,fe,H):V&&!V.hasOnce&&(x!==He||ae>0&&ae&64)?et(V,v,A,!1,!0):(x===He&&ae&384||!F&&be&16)&&et(G,v,A),H&&ht(g)}(Ke&&(Pe=D&&D.onVnodeUnmounted)||Me)&&Ht(()=>{Pe&&In(Pe,v,g),Me&&Pr(g,null,v,"unmounted")},A)},ht=g=>{const{type:v,el:A,anchor:H,transition:F}=g;if(v===He){Rt(A,H);return}if(v===Si){j(g);return}const x=()=>{s(A),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(g.shapeFlag&1&&F&&!F.persisted){const{leave:D,delayLeave:B}=F,G=()=>D(A,x);B?B(g.el,x,G):G()}else x()},Rt=(g,v)=>{let A;for(;g!==v;)A=h(g),s(g),g=A;s(v)},Ge=(g,v,A)=>{const{bum:H,scope:F,job:x,subTree:D,um:B,m:G,a:V}=g;jl(G),jl(V),H&&To(H),F.stop(),x&&(x.flags|=8,Ze(D,g,v,A)),B&&Ht(B,v),Ht(()=>{g.isUnmounted=!0},v)},et=(g,v,A,H=!1,F=!1,x=0)=>{for(let D=x;D<g.length;D++)Ze(g[D],v,A,H,F)},W=g=>{if(g.shapeFlag&6)return W(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const v=h(g.anchor||g.el),A=v&&v[ed];return A?h(A):v};let me=!1;const ie=(g,v,A)=>{let H;g==null?v._vnode&&(Ze(v._vnode,null,null,!0),H=v._vnode.component):I(v._vnode||null,g,v,null,null,null,A),v._vnode=g,me||(me=!0,Tl(H),Ju(),me=!1)},fe={p:I,um:Ze,m:Xe,r:ht,mt:Be,mc:Ie,pc:$e,pbc:ee,n:W,o:e};return{render:ie,hydrate:void 0,createApp:gp(ie)}}function Ii({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 Mr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Mp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function qa(e,t,n=!1){const r=e.children,s=t.children;if(Le(r)&&Le(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]=qn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&qa(i,a)),a.type===ii&&(a.patchFlag===-1&&(a=s[o]=qn(a)),a.el=i.el),a.type===Wt&&!a.el&&(a.el=i.el)}}function Op(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const u=e[r];if(u!==0){if(s=n[n.length-1],e[s]<u){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<u?o=a+1:i=a;u<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 Sd(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Sd(t)}function jl(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ed(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Ed(t.subTree):null}const Cd=e=>e.__isSuspense;function Np(e,t){t&&t.pendingBranch?Le(e)?t.effects.push(...e):t.effects.push(e):Fh(e)}const He=Symbol.for("v-fgt"),ii=Symbol.for("v-txt"),Wt=Symbol.for("v-cmt"),Si=Symbol.for("v-stc"),Us=[];let an=null;function w(e=!1){Us.push(an=e?null:[])}function $p(){Us.pop(),an=Us[Us.length-1]||null}let Ks=1;function Bo(e,t=!1){Ks+=e,e<0&&an&&t&&(an.hasOnce=!0)}function Ad(e){return e.dynamicChildren=Ks>0?an||ss:null,$p(),Ks>0&&an&&an.push(e),e}function T(e,t,n,r,s,o){return Ad(m(e,t,n,r,s,o,!0))}function yt(e,t,n,r,s){return Ad(Ce(e,t,n,r,s,!0))}function Js(e){return e?e.__v_isVNode===!0:!1}function jr(e,t){return e.type===t.type&&e.key===t.key}const Rd=({key:e})=>e??null,Eo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ct(e)||qt(e)||ze(e)?{i:Ut,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,s=null,o=e===He?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Rd(t),ref:t&&Eo(t),scopeId:Qu,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:Ut};return a?(Ga(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=Ct(n)?8:16),Ks>0&&!i&&an&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&an.push(l),l}const Ce=Dp;function Dp(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===ud)&&(e=Wt),Js(e)){const a=kr(e,t,!0);return n&&Ga(a,n),Ks>0&&!o&&an&&(a.shapeFlag&6?an[an.indexOf(e)]=a:an.push(a)),a.patchFlag=-2,a}if(zp(e)&&(e=e.__vccOpts),t){t=Lp(t);let{class:a,style:l}=t;a&&!Ct(a)&&(t.class=gt(a)),ft(l)&&(Ha(l)&&!Le(l)&&(l=$t({},l)),t.style=zr(l))}const i=Ct(e)?1:Cd(e)?128:td(e)?64:ft(e)?4:ze(e)?2:0;return m(e,t,n,r,s,i,o,!0)}function Lp(e){return e?Ha(e)||wd(e)?$t({},e):e:null}function kr(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,u=t?xd(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Rd(u),ref:t&&t.ref?n&&o?Le(o)?o.concat(Eo(t)):[o,Eo(t)]:Eo(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==He?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&kr(e.ssContent),ssFallback:e.ssFallback&&kr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Gs(c,l.clone(c)),c}function ca(e=" ",t=0){return Ce(ii,null,e,t)}function se(e="",t=!1){return t?(w(),yt(Wt,null,e)):Ce(Wt,null,e)}function An(e){return e==null||typeof e=="boolean"?Ce(Wt):Le(e)?Ce(He,null,e.slice()):Js(e)?qn(e):Ce(ii,null,String(e))}function qn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:kr(e)}function Ga(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Le(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),Ga(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!wd(t)?t._ctx=Ut:s===3&&Ut&&(Ut.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ze(t)?(t={default:t,_ctx:Ut},n=32):(t=String(t),r&64?(n=16,t=[ca(t)]):n=8);e.children=t,e.shapeFlag|=n}function xd(...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=gt([t.class,r.class]));else if(s==="style")t.style=zr([t.style,r.style]);else if(Jo(s)){const o=t[s],i=r[s];i&&o!==i&&!(Le(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function In(e,t,n,r=null){wn(e,t,7,[n,r])}const jp=pd();let Bp=0;function Up(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||jp,o={uid:Bp++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new dh(!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:_d(r,s),emitsOptions:md(r,s),emit:null,emitted:null,propsDefaults:bt,inheritAttrs:r.inheritAttrs,ctx:bt,data:bt,props:bt,attrs:bt,slots:bt,refs:bt,setupState:bt,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=yp.bind(null,o),e.ce&&e.ce(o),o}let zt=null;const Ka=()=>zt||Ut;let Uo,ua;{const e=Xo(),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)}};Uo=t("__VUE_INSTANCE_SETTERS__",n=>zt=n),ua=t("__VUE_SSR_SETTERS__",n=>Ys=n)}const oo=e=>{const t=zt;return Uo(e),e.scope.on(),()=>{e.scope.off(),Uo(t)}},Bl=()=>{zt&&zt.scope.off(),Uo(null)};function Pd(e){return e.vnode.shapeFlag&4}let Ys=!1;function Fp(e,t=!1,n=!1){t&&ua(t);const{props:r,children:s}=e.vnode,o=Pd(e);Ip(e,r,o,t),Ap(e,s,n||t);const i=o?Hp(e,t):void 0;return t&&ua(!1),i}function Hp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ap);const{setup:r}=n;if(r){Xn();const s=e.setupContext=r.length>1?Od(e):null,o=oo(e),i=so(r,e,0,[e.props,s]),a=Tu(i);if(Zn(),o(),(a||e.sp)&&!as(e)&&ld(e),a){if(i.then(Bl,Bl),t)return i.then(l=>{Ul(e,l)}).catch(l=>{ti(l,e,0)});e.asyncDep=i}else Ul(e,i)}else Md(e)}function Ul(e,t,n){ze(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ft(t)&&(e.setupState=qu(t)),Md(e)}function Md(e,t,n){const r=e.type;e.render||(e.render=r.render||On);{const s=oo(e);Xn();try{up(e)}finally{Zn(),s()}}}const Vp={get(e,t){return Vt(e,"get",""),e[t]}};function Od(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Vp),slots:e.slots,emit:e.emit,expose:t}}function ai(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(qu(Ph(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Bs)return Bs[n](e)},has(t,n){return n in t||n in Bs}})):e.proxy}function Wp(e,t=!0){return ze(e)?e.displayName||e.name:e.name||t&&e.__name}function zp(e){return ze(e)&&"__vccOpts"in e}const pe=(e,t)=>Dh(e,t,Ys);function Ja(e,t,n){try{Bo(-1);const r=arguments.length;return r===2?ft(t)&&!Le(t)?Js(t)?Ce(e,null,[t]):Ce(e,t):Ce(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Js(n)&&(n=[n]),Ce(e,t,n))}finally{Bo(1)}}const qp="3.5.30";/**
13
+ **/function so(e,t,n,r){try{return r?e(...r):e()}catch(s){ti(s,t,n)}}function wn(e,t,n,r){if(qe(e)){const s=so(e,t,n,r);return s&&ku(s)&&s.catch(o=>{ti(o,t,n)}),s}if(Le(e)){const s=[];for(let o=0;o<e.length;o++)s.push(wn(e[o],t,n,r));return s}}function ti(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||yt;if(t){let a=t.parent;const l=t.proxy,u=`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,u)===!1)return}a=a.parent}if(o){Qn(),so(o,null,10,[e,l,u]),Xn();return}}Bh(e,n,s,r,i)}function Bh(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Yt=[];let Sn=-1;const os=[];let hr=null,es=0;const zu=Promise.resolve();let No=null;function tn(e){const t=No||zu;return e?t.then(this?e.bind(this):e):t}function Uh(e){let t=Sn+1,n=Yt.length;for(;t<n;){const r=t+n>>>1,s=Yt[r],o=zs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function Ha(e){if(!(e.flags&1)){const t=zs(e),n=Yt[Yt.length-1];!n||!(e.flags&2)&&t>=zs(n)?Yt.push(e):Yt.splice(Uh(t),0,e),e.flags|=1,Gu()}}function Gu(){No||(No=zu.then(Ju))}function Fh(e){Le(e)?os.push(...e):hr&&e.id===-1?hr.splice(es+1,0,e):e.flags&1||(os.push(e),e.flags|=1),Gu()}function kl(e,t,n=Sn+1){for(;n<Yt.length;n++){const r=Yt[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Yt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Ku(e){if(os.length){const t=[...new Set(os)].sort((n,r)=>zs(n)-zs(r));if(os.length=0,hr){hr.push(...t);return}for(hr=t,es=0;es<hr.length;es++){const n=hr[es];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}hr=null,es=0}}const zs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ju(e){try{for(Sn=0;Sn<Yt.length;Sn++){const t=Yt[Sn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),so(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Sn<Yt.length;Sn++){const t=Yt[Sn];t&&(t.flags&=-2)}Sn=-1,Yt.length=0,Ku(),No=null,(Yt.length||os.length)&&Ju()}}let Ft=null,Yu=null;function $o(e){const t=Ft;return Ft=e,Yu=e&&e.type.__scopeId||null,t}function ht(e,t=Ft,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Bo(-1);const o=$o(t);let i;try{i=e(...s)}finally{$o(o),r._d&&Bo(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function er(e,t){if(Ft===null)return e;const n=ai(Ft),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=yt]=t[s];o&&(qe(o)&&(o={mounted:o,updated:o}),o.deep&&Gn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function xr(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&&(Qn(),wn(l,n,8,[e.el,a,e,t]),Xn())}}function Io(e,t){if(zt){let n=zt.provides;const r=zt.parent&&zt.parent.provides;r===n&&(n=zt.provides=Object.create(r)),n[e]=t}}function mn(e,t,n=!1){const r=Ga();if(r||as){let s=as?as._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&&qe(t)?t.call(r&&r.proxy):t}}const Hh=Symbol.for("v-scx"),Vh=()=>mn(Hh);function pt(e,t,n){return Qu(e,t,n)}function Qu(e,t,n=yt){const{immediate:r,deep:s,flush:o,once:i}=n,a=$t({},n),l=t&&r||!t&&o!=="post";let u;if(Ys){if(o==="sync"){const b=Vh();u=b.__watcherHandles||(b.__watcherHandles=[])}else if(!l){const b=()=>{};return b.stop=On,b.resume=On,b.pause=On,b}}const c=zt;a.call=(b,N,I)=>wn(b,c,N,I);let f=!1;o==="post"?a.scheduler=b=>{Vt(b,c&&c.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(b,N)=>{N?b():Ha(b)}),a.augmentJob=b=>{t&&(b.flags|=4),f&&(b.flags|=2,c&&(b.id=c.uid,b.i=c))};const h=jh(e,t,a);return Ys&&(u?u.push(h):l&&h()),h}function Wh(e,t,n){const r=this.proxy,s=Ct(e)?e.includes(".")?Xu(r,e):()=>r[e]:e.bind(r,r);let o;qe(t)?o=t:(o=t.handler,n=t);const i=oo(this),a=Qu(s,o.bind(r),n);return i(),a}function Xu(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 Zu=Symbol("_vte"),ed=e=>e.__isTeleport,Ls=e=>e&&(e.disabled||e.disabled===""),Tl=e=>e&&(e.defer||e.defer===""),Il=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Sl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ea=(e,t)=>{const n=e&&e.to;return Ct(n)?t?t(n):null:n},td={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,u){const{mc:c,pc:f,pbc:h,o:{insert:b,querySelector:N,createText:I,createComment:O}}=u,Y=Ls(t.props);let{shapeFlag:$,children:q,dynamicChildren:j}=t;if(e==null){const oe=t.el=I(""),de=t.anchor=I("");b(oe,n,r),b(de,n,r);const ve=(re,ee)=>{$&16&&c(q,re,ee,s,o,i,a,l)},Ie=()=>{const re=t.target=ea(t.props,N),ee=ta(re,t,I,b);re&&(i!=="svg"&&Il(re)?i="svg":i!=="mathml"&&Sl(re)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(re),Y||(ve(re,ee),So(t,!1)))};Y&&(ve(n,de),So(t,!0)),Tl(t.props)?(t.el.__isMounted=!1,Vt(()=>{Ie(),delete t.el.__isMounted},o)):Ie()}else{if(Tl(t.props)&&e.el.__isMounted===!1){Vt(()=>{td.process(e,t,n,r,s,o,i,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const oe=t.anchor=e.anchor,de=t.target=e.target,ve=t.targetAnchor=e.targetAnchor,Ie=Ls(e.props),re=Ie?n:de,ee=Ie?oe:ve;if(i==="svg"||Il(de)?i="svg":(i==="mathml"||Sl(de))&&(i="mathml"),j?(h(e.dynamicChildren,j,re,s,o,i,a),qa(e,t,!0)):l||f(e,t,re,ee,s,o,i,a,!1),Y)Ie?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):vo(t,n,oe,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ye=t.target=ea(t.props,N);ye&&vo(t,ye,null,u,0)}else Ie&&vo(t,de,ve,u,1);So(t,Y)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:c,target:f,props:h}=e;if(f&&(s(u),s(c)),o&&s(l),i&16){const b=o||!Ls(h);for(let N=0;N<a.length;N++){const I=a[N];r(I,t,n,b,!!I.dynamicChildren)}}},move:vo,hydrate:qh};function vo(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:u,props:c}=e,f=o===2;if(f&&r(i,t,n),(!f||Ls(c))&&l&16)for(let h=0;h<u.length;h++)s(u[h],t,n,2);f&&r(a,t,n)}function qh(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:c}},f){function h(O,Y){let $=Y;for(;$;){if($&&$.nodeType===8){if($.data==="teleport start anchor")t.targetStart=$;else if($.data==="teleport anchor"){t.targetAnchor=$,O._lpa=t.targetAnchor&&i(t.targetAnchor);break}}$=i($)}}function b(O,Y){Y.anchor=f(i(O),Y,a(O),n,r,s,o)}const N=t.target=ea(t.props,l),I=Ls(t.props);if(N){const O=N._lpa||N.firstChild;t.shapeFlag&16&&(I?(b(e,t),h(N,O),t.targetAnchor||ta(N,t,c,u,a(e)===N?e:null)):(t.anchor=i(e),h(N,O),t.targetAnchor||ta(N,t,c,u),f(O&&i(O),t,N,n,r,s,o))),So(t,I)}else I&&t.shapeFlag&16&&(b(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Do=td;function So(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 ta(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Zu]=i,e&&(r(o,e,s),r(i,e,s)),i}const En=Symbol("_leaveCb"),As=Symbol("_enterCb");function zh(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return or(()=>{e.isMounted=!0}),ir(()=>{e.isUnmounting=!0}),e}const cn=[Function,Array],nd={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:cn,onEnter:cn,onAfterEnter:cn,onEnterCancelled:cn,onBeforeLeave:cn,onLeave:cn,onAfterLeave:cn,onLeaveCancelled:cn,onBeforeAppear:cn,onAppear:cn,onAfterAppear:cn,onAppearCancelled:cn},rd=e=>{const t=e.subTree;return t.component?rd(t.component):t},Gh={name:"BaseTransition",props:nd,setup(e,{slots:t}){const n=Ga(),r=zh();return()=>{const s=t.default&&id(t.default(),!0);if(!s||!s.length)return;const o=sd(s),i=lt(e),{mode:a}=i;if(r.isLeaving)return _i(o);const l=El(o);if(!l)return _i(o);let u=na(l,i,r,n,f=>u=f);l.type!==qt&&Gs(l,u);let c=n.subTree&&El(n.subTree);if(c&&c.type!==qt&&!jr(c,l)&&rd(n).type!==qt){let f=na(c,i,r,n);if(Gs(c,f),a==="out-in"&&l.type!==qt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},_i(o);a==="in-out"&&l.type!==qt?f.delayLeave=(h,b,N)=>{const I=od(r,c);I[String(c.key)]=c,h[En]=()=>{b(),h[En]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{N(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function sd(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==qt){t=n;break}}return t}const Kh=Gh;function od(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 na(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:h,onLeave:b,onAfterLeave:N,onLeaveCancelled:I,onBeforeAppear:O,onAppear:Y,onAfterAppear:$,onAppearCancelled:q}=t,j=String(e.key),oe=od(n,e),de=(re,ee)=>{re&&wn(re,r,9,ee)},ve=(re,ee)=>{const ye=ee[1];de(re,ee),Le(re)?re.every(te=>te.length<=1)&&ye():re.length<=1&&ye()},Ie={mode:i,persisted:a,beforeEnter(re){let ee=l;if(!n.isMounted)if(o)ee=O||l;else return;re[En]&&re[En](!0);const ye=oe[j];ye&&jr(e,ye)&&ye.el[En]&&ye.el[En](),de(ee,[re])},enter(re){if(oe[j]===e)return;let ee=u,ye=c,te=f;if(!n.isMounted)if(o)ee=Y||u,ye=$||c,te=q||f;else return;let je=!1;re[As]=Ye=>{je||(je=!0,Ye?de(te,[re]):de(ye,[re]),Ie.delayedLeave&&Ie.delayedLeave(),re[As]=void 0)};const Be=re[As].bind(null,!1);ee?ve(ee,[re,Be]):Be()},leave(re,ee){const ye=String(e.key);if(re[As]&&re[As](!0),n.isUnmounting)return ee();de(h,[re]);let te=!1;re[En]=Be=>{te||(te=!0,ee(),Be?de(I,[re]):de(N,[re]),re[En]=void 0,oe[ye]===e&&delete oe[ye])};const je=re[En].bind(null,!1);oe[ye]=e,b?ve(b,[re,je]):je()},clone(re){const ee=na(re,t,n,r,s);return s&&s(ee),ee}};return Ie}function _i(e){if(ni(e))return e=_r(e),e.children=null,e}function El(e){if(!ni(e))return ed(e.type)&&e.children?sd(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&&qe(n.default))return n.default()}}function Gs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Gs(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 id(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===He?(i.patchFlag&128&&s++,r=r.concat(id(i.children,t,a))):(t||i.type!==qt)&&r.push(a!=null?_r(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Lt(e,t){return qe(e)?$t({name:e.name},t,{setup:e}):e}function ad(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Cl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Lo=new WeakMap;function js(e,t,n,r,s=!1){if(Le(e)){e.forEach((I,O)=>js(I,t&&(Le(t)?t[O]:t),n,r,s));return}if(is(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&js(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?ai(r.component):r.el,i=s?null:o,{i:a,r:l}=e,u=t&&t.r,c=a.refs===yt?a.refs={}:a.refs,f=a.setupState,h=lt(f),b=f===yt?bu:I=>Cl(c,I)?!1:ut(h,I),N=(I,O)=>!(O&&Cl(c,O));if(u!=null&&u!==l){if(Al(t),Ct(u))c[u]=null,b(u)&&(f[u]=null);else if(Gt(u)){const I=t;N(u,I.k)&&(u.value=null),I.k&&(c[I.k]=null)}}if(qe(l))so(l,a,12,[i,c]);else{const I=Ct(l),O=Gt(l);if(I||O){const Y=()=>{if(e.f){const $=I?b(l)?f[l]:c[l]:N()||!e.k?l.value:c[e.k];if(s)Le($)&&xa($,o);else if(Le($))$.includes(o)||$.push(o);else if(I)c[l]=[o],b(l)&&(f[l]=c[l]);else{const q=[o];N(l,e.k)&&(l.value=q),e.k&&(c[e.k]=q)}}else I?(c[l]=i,b(l)&&(f[l]=i)):O&&(N(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const $=()=>{Y(),Lo.delete(e)};$.id=-1,Lo.set(e,$),Vt($,n)}else Al(e),Y()}}}function Al(e){const t=Lo.get(e);t&&(t.flags|=8,Lo.delete(e))}Xo().requestIdleCallback;Xo().cancelIdleCallback;const is=e=>!!e.type.__asyncLoader,ni=e=>e.type.__isKeepAlive;function Jh(e,t){ld(e,"a",t)}function Yh(e,t){ld(e,"da",t)}function ld(e,t,n=zt){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(ri(t,r,n),n){let s=n.parent;for(;s&&s.parent;)ni(s.parent.vnode)&&Qh(r,t,n,s),s=s.parent}}function Qh(e,t,n,r){const s=ri(t,e,r,!0);si(()=>{xa(r[t],s)},n)}function ri(e,t,n=zt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Qn();const a=oo(n),l=wn(t,n,e,i);return a(),Xn(),l});return r?s.unshift(o):s.push(o),o}}const sr=e=>(t,n=zt)=>{(!Ys||e==="sp")&&ri(e,(...r)=>t(...r),n)},Xh=sr("bm"),or=sr("m"),Zh=sr("bu"),ep=sr("u"),ir=sr("bum"),si=sr("um"),tp=sr("sp"),np=sr("rtg"),rp=sr("rtc");function sp(e,t=zt){ri("ec",e,t)}const op="components",cd=Symbol.for("v-ndc");function ra(e){return Ct(e)?ip(op,e,!1)||e:e||cd}function ip(e,t,n=!0,r=!1){const s=Ft||zt;if(s){const o=s.type;{const a=Wp(o,!1);if(a&&(a===t||a===Xt(t)||a===Qo(Xt(t))))return o}const i=Rl(s[e]||o[e],t)||Rl(s.appContext[e],t);return!i&&r?o:i}}function Rl(e,t){return e&&(e[t]||e[Xt(t)]||e[Qo(Xt(t))])}function Et(e,t,n,r){let s;const o=n,i=Le(e);if(i||Ct(e)){const a=i&&Vr(e);let l=!1,u=!1;a&&(l=!dn(e),u=Zn(e),e=Zo(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(l?u?fs(yn(e[c])):yn(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(dt(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,u=a.length;l<u;l++){const c=a[l];s[l]=t(e[c],c,l,o)}}else s=[];return s}function Mn(e,t,n={},r,s){if(Ft.ce||Ft.parent&&is(Ft.parent)&&Ft.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),gt(He,null,[Ce("slot",n,r)],u?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&ud(o(n)),a=n.key||i&&i.key,l=gt(He,{key:(a&&!vn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function ud(e){return e.some(t=>Js(t)?!(t.type===qt||t.type===He&&!ud(t.children)):!0)?e:null}const sa=e=>e?Pd(e)?ai(e):sa(e.parent):null,Bs=$t(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=>sa(e.parent),$root:e=>sa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>fd(e),$forceUpdate:e=>e.f||(e.f=()=>{Ha(e.update)}),$nextTick:e=>e.n||(e.n=tn.bind(e.proxy)),$watch:e=>Wh.bind(e)}),ki=(e,t)=>e!==yt&&!e.__isScriptSetup&&ut(e,t),ap={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 h=i[t];if(h!==void 0)switch(h){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(ki(r,t))return i[t]=1,r[t];if(s!==yt&&ut(s,t))return i[t]=2,s[t];if(ut(o,t))return i[t]=3,o[t];if(n!==yt&&ut(n,t))return i[t]=4,n[t];oa&&(i[t]=0)}}const u=Bs[t];let c,f;if(u)return t==="$attrs"&&Wt(e.attrs,"get",""),u(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==yt&&ut(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,ut(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return ki(s,t)?(s[t]=n,!0):r!==yt&&ut(r,t)?(r[t]=n,!0):ut(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!==yt&&a[0]!=="$"&&ut(e,a)||ki(t,a)||ut(o,a)||ut(r,a)||ut(Bs,a)||ut(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ut(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function lp(){return cp().slots}function cp(e){const t=Ga();return t.setupContext||(t.setupContext=Md(t))}function Pl(e){return Le(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let oa=!0;function up(e){const t=fd(e),n=e.proxy,r=e.ctx;oa=!1,t.beforeCreate&&xl(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:u,created:c,beforeMount:f,mounted:h,beforeUpdate:b,updated:N,activated:I,deactivated:O,beforeDestroy:Y,beforeUnmount:$,destroyed:q,unmounted:j,render:oe,renderTracked:de,renderTriggered:ve,errorCaptured:Ie,serverPrefetch:re,expose:ee,inheritAttrs:ye,components:te,directives:je,filters:Be}=t;if(u&&dp(u,r,null),i)for(const Te in i){const $e=i[Te];qe($e)&&(r[Te]=$e.bind(n))}if(s){const Te=s.call(n,n);dt(Te)&&(e.data=ei(Te))}if(oa=!0,o)for(const Te in o){const $e=o[Te],Tt=qe($e)?$e.bind(n,n):qe($e.get)?$e.get.bind(n,n):On,nt=!qe($e)&&qe($e.set)?$e.set.bind(n):On,Qe=pe({get:Tt,set:nt});Object.defineProperty(r,Te,{enumerable:!0,configurable:!0,get:()=>Qe.value,set:Xe=>Qe.value=Xe})}if(a)for(const Te in a)dd(a[Te],r,n,Te);if(l){const Te=qe(l)?l.call(n):l;Reflect.ownKeys(Te).forEach($e=>{Io($e,Te[$e])})}c&&xl(c,e,"c");function Re(Te,$e){Le($e)?$e.forEach(Tt=>Te(Tt.bind(n))):$e&&Te($e.bind(n))}if(Re(Xh,f),Re(or,h),Re(Zh,b),Re(ep,N),Re(Jh,I),Re(Yh,O),Re(sp,Ie),Re(rp,de),Re(np,ve),Re(ir,$),Re(si,j),Re(tp,re),Le(ee))if(ee.length){const Te=e.exposed||(e.exposed={});ee.forEach($e=>{Object.defineProperty(Te,$e,{get:()=>n[$e],set:Tt=>n[$e]=Tt,enumerable:!0})})}else e.exposed||(e.exposed={});oe&&e.render===On&&(e.render=oe),ye!=null&&(e.inheritAttrs=ye),te&&(e.components=te),je&&(e.directives=je),re&&ad(e)}function dp(e,t,n=On){Le(e)&&(e=ia(e));for(const r in e){const s=e[r];let o;dt(s)?"default"in s?o=mn(s.from||r,s.default,!0):o=mn(s.from||r):o=mn(s),Gt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function xl(e,t,n){wn(Le(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function dd(e,t,n,r){let s=r.includes(".")?Xu(n,r):()=>n[r];if(Ct(e)){const o=t[e];qe(o)&&pt(s,o)}else if(qe(e))pt(s,e.bind(n));else if(dt(e))if(Le(e))e.forEach(o=>dd(o,t,n,r));else{const o=qe(e.handler)?e.handler.bind(n):t[e.handler];qe(o)&&pt(s,o,e)}}function fd(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(u=>jo(l,u,i,!0)),jo(l,t,i)),dt(t)&&o.set(t,l),l}function jo(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&jo(e,o,n,!0),s&&s.forEach(i=>jo(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=fp[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const fp={data:Ml,props:Ol,emits:Ol,methods:Os,computed:Os,beforeCreate:Kt,created:Kt,beforeMount:Kt,mounted:Kt,beforeUpdate:Kt,updated:Kt,beforeDestroy:Kt,beforeUnmount:Kt,destroyed:Kt,unmounted:Kt,activated:Kt,deactivated:Kt,errorCaptured:Kt,serverPrefetch:Kt,components:Os,directives:Os,watch:pp,provide:Ml,inject:hp};function Ml(e,t){return t?e?function(){return $t(qe(e)?e.call(this,this):e,qe(t)?t.call(this,this):t)}:t:e}function hp(e,t){return Os(ia(e),ia(t))}function ia(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Kt(e,t){return e?[...new Set([].concat(e,t))]:t}function Os(e,t){return e?$t(Object.create(null),e,t):t}function Ol(e,t){return e?Le(e)&&Le(t)?[...new Set([...e,...t])]:$t(Object.create(null),Pl(e),Pl(t??{})):t}function pp(e,t){if(!e)return t;if(!t)return e;const n=$t(Object.create(null),e);for(const r in t)n[r]=Kt(e[r],t[r]);return n}function hd(){return{app:null,config:{isNativeTag:bu,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 mp=0;function gp(e,t){return function(r,s=null){qe(r)||(r=$t({},r)),s!=null&&!dt(s)&&(s=null);const o=hd(),i=new WeakSet,a=[];let l=!1;const u=o.app={_uid:mp++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:zp,get config(){return o.config},set config(c){},use(c,...f){return i.has(c)||(c&&qe(c.install)?(i.add(c),c.install(u,...f)):qe(c)&&(i.add(c),c(u,...f))),u},mixin(c){return o.mixins.includes(c)||o.mixins.push(c),u},component(c,f){return f?(o.components[c]=f,u):o.components[c]},directive(c,f){return f?(o.directives[c]=f,u):o.directives[c]},mount(c,f,h){if(!l){const b=u._ceVNode||Ce(r,s);return b.appContext=o,h===!0?h="svg":h===!1&&(h=void 0),e(b,c,h),l=!0,u._container=c,c.__vue_app__=u,ai(b.component)}},onUnmount(c){a.push(c)},unmount(){l&&(wn(a,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(c,f){return o.provides[c]=f,u},runWithContext(c){const f=as;as=u;try{return c()}finally{as=f}}};return u}}let as=null;const vp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Xt(t)}Modifiers`]||e[`${kr(t)}Modifiers`];function yp(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||yt;let s=n;const o=t.startsWith("update:"),i=o&&vp(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>Ct(c)?c.trim():c)),i.number&&(s=n.map(Oa)));let a,l=r[a=gi(t)]||r[a=gi(Xt(t))];!l&&o&&(l=r[a=gi(kr(t))]),l&&wn(l,e,6,s);const u=r[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,wn(u,e,6,s)}}const wp=new WeakMap;function pd(e,t,n=!1){const r=n?wp:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!qe(e)){const l=u=>{const c=pd(u,t,!0);c&&(a=!0,$t(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(dt(e)&&r.set(e,null),null):(Le(o)?o.forEach(l=>i[l]=null):$t(i,o),dt(e)&&r.set(e,i),i)}function oi(e,t){return!e||!Jo(t)?!1:(t=t.slice(2).replace(/Once$/,""),ut(e,t[0].toLowerCase()+t.slice(1))||ut(e,kr(t))||ut(e,t))}function Nl(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:u,renderCache:c,props:f,data:h,setupState:b,ctx:N,inheritAttrs:I}=e,O=$o(e);let Y,$;try{if(n.shapeFlag&4){const j=s||r,oe=j;Y=An(u.call(oe,j,c,f,b,h,N)),$=a}else{const j=t;Y=An(j.length>1?j(f,{attrs:a,slots:i,emit:l}):j(f,null)),$=t.props?a:bp(a)}}catch(j){Us.length=0,ti(j,e,1),Y=Ce(qt)}let q=Y;if($&&I!==!1){const j=Object.keys($),{shapeFlag:oe}=q;j.length&&oe&7&&(o&&j.some(Pa)&&($=_p($,o)),q=_r(q,$,!1,!0))}return n.dirs&&(q=_r(q,null,!1,!0),q.dirs=q.dirs?q.dirs.concat(n.dirs):n.dirs),n.transition&&Gs(q,n.transition),Y=q,$o(O),Y}const bp=e=>{let t;for(const n in e)(n==="class"||n==="style"||Jo(n))&&((t||(t={}))[n]=e[n]);return t},_p=(e,t)=>{const n={};for(const r in e)(!Pa(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function kp(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?$l(r,i,u):!!i;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const h=c[f];if(md(i,r,h)&&!oi(u,h))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?$l(r,i,u):!0:!!i;return!1}function $l(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(md(t,e,o)&&!oi(n,o))return!0}return!1}function md(e,t,n){const r=e[n],s=t[n];return n==="style"&&dt(r)&&dt(s)?!Na(r,s):r!==s}function Tp({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 gd={},vd=()=>Object.create(gd),yd=e=>Object.getPrototypeOf(e)===gd;function Ip(e,t,n,r=!1){const s={},o=vd();e.propsDefaults=Object.create(null),wd(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Vu(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Sp(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=lt(s),[l]=e.propsOptions;let u=!1;if((r||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let h=c[f];if(oi(e.emitsOptions,h))continue;const b=t[h];if(l)if(ut(o,h))b!==o[h]&&(o[h]=b,u=!0);else{const N=Xt(h);s[N]=aa(l,a,N,b,e,!1)}else b!==o[h]&&(o[h]=b,u=!0)}}}else{wd(e,t,s,o)&&(u=!0);let c;for(const f in a)(!t||!ut(t,f)&&((c=kr(f))===f||!ut(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(s[f]=aa(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!ut(t,f))&&(delete o[f],u=!0)}u&&zn(e.attrs,"set","")}function wd(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Ns(l))continue;const u=t[l];let c;s&&ut(s,c=Xt(l))?!o||!o.includes(c)?n[c]=u:(a||(a={}))[c]=u:oi(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(o){const l=lt(n),u=a||yt;for(let c=0;c<o.length;c++){const f=o[c];n[f]=aa(s,l,f,u[f],e,!ut(u,f))}}return i}function aa(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=ut(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&qe(l)){const{propsDefaults:u}=s;if(n in u)r=u[n];else{const c=oo(s);r=u[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===kr(n))&&(r=!0))}return r}const Ep=new WeakMap;function bd(e,t,n=!1){const r=n?Ep:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!qe(e)){const c=f=>{l=!0;const[h,b]=bd(f,t,!0);$t(i,h),b&&a.push(...b)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return dt(e)&&r.set(e,rs),rs;if(Le(o))for(let c=0;c<o.length;c++){const f=Xt(o[c]);Dl(f)&&(i[f]=yt)}else if(o)for(const c in o){const f=Xt(c);if(Dl(f)){const h=o[c],b=i[f]=Le(h)||qe(h)?{type:h}:$t({},h),N=b.type;let I=!1,O=!0;if(Le(N))for(let Y=0;Y<N.length;++Y){const $=N[Y],q=qe($)&&$.name;if(q==="Boolean"){I=!0;break}else q==="String"&&(O=!1)}else I=qe(N)&&N.name==="Boolean";b[0]=I,b[1]=O,(I||ut(b,"default"))&&a.push(f)}}const u=[i,a];return dt(e)&&r.set(e,u),u}function Dl(e){return e[0]!=="$"&&!Ns(e)}const Va=e=>e==="_"||e==="_ctx"||e==="$stable",Wa=e=>Le(e)?e.map(An):[An(e)],Cp=(e,t,n)=>{if(t._n)return t;const r=ht((...s)=>Wa(t(...s)),n);return r._c=!1,r},_d=(e,t,n)=>{const r=e._ctx;for(const s in e){if(Va(s))continue;const o=e[s];if(qe(o))t[s]=Cp(s,o,r);else if(o!=null){const i=Wa(o);t[s]=()=>i}}},kd=(e,t)=>{const n=Wa(t);e.slots.default=()=>n},Td=(e,t,n)=>{for(const r in t)(n||!Va(r))&&(e[r]=t[r])},Ap=(e,t,n)=>{const r=e.slots=vd();if(e.vnode.shapeFlag&32){const s=t._;s?(Td(r,t,n),n&&Su(r,"_",s,!0)):_d(t,r)}else t&&kd(e,t)},Rp=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=yt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:Td(s,t,n):(o=!t.$stable,_d(t,s)),i=t}else t&&(kd(e,t),i={default:1});if(o)for(const a in s)!Va(a)&&i[a]==null&&delete s[a]},Vt=Np;function Pp(e){return xp(e)}function xp(e,t){const n=Xo();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:h,setScopeId:b=On,insertStaticContent:N}=e,I=(g,v,A,H=null,F=null,P=null,D=void 0,B=null,G=!!v.dynamicChildren)=>{if(g===v)return;g&&!jr(g,v)&&(H=W(g),Xe(g,F,P,!0),g=null),v.patchFlag===-2&&(G=!1,v.dynamicChildren=null);const{type:V,ref:be,shapeFlag:ae}=v;switch(V){case ii:O(g,v,A,H);break;case qt:Y(g,v,A,H);break;case Ii:g==null&&$(v,A,H,D);break;case He:te(g,v,A,H,F,P,D,B,G);break;default:ae&1?oe(g,v,A,H,F,P,D,B,G):ae&6?je(g,v,A,H,F,P,D,B,G):(ae&64||ae&128)&&V.process(g,v,A,H,F,P,D,B,G,fe)}be!=null&&F?js(be,g&&g.ref,P,v||g,!v):be==null&&g&&g.ref!=null&&js(g.ref,null,P,g,!0)},O=(g,v,A,H)=>{if(g==null)r(v.el=a(v.children),A,H);else{const F=v.el=g.el;v.children!==g.children&&u(F,v.children)}},Y=(g,v,A,H)=>{g==null?r(v.el=l(v.children||""),A,H):v.el=g.el},$=(g,v,A,H)=>{[g.el,g.anchor]=N(g.children,v,A,H,g.el,g.anchor)},q=({el:g,anchor:v},A,H)=>{let F;for(;g&&g!==v;)F=h(g),r(g,A,H),g=F;r(v,A,H)},j=({el:g,anchor:v})=>{let A;for(;g&&g!==v;)A=h(g),s(g),g=A;s(v)},oe=(g,v,A,H,F,P,D,B,G)=>{if(v.type==="svg"?D="svg":v.type==="math"&&(D="mathml"),g==null)de(v,A,H,F,P,D,B,G);else{const V=g.el&&g.el._isVueCE?g.el:null;try{V&&V._beginPatch(),re(g,v,F,P,D,B,G)}finally{V&&V._endPatch()}}},de=(g,v,A,H,F,P,D,B)=>{let G,V;const{props:be,shapeFlag:ae,transition:he,dirs:Se}=g;if(G=g.el=i(g.type,P,be&&be.is,be),ae&8?c(G,g.children):ae&16&&Ie(g.children,G,null,H,F,Ti(g,P),D,B),Se&&xr(g,null,H,"created"),ve(G,g,g.scopeId,D,H),be){for(const Ke in be)Ke!=="value"&&!Ns(Ke)&&o(G,Ke,null,be[Ke],P,H);"value"in be&&o(G,"value",null,be.value,P),(V=be.onVnodeBeforeMount)&&In(V,H,g)}Se&&xr(g,null,H,"beforeMount");const Me=Mp(F,he);Me&&he.beforeEnter(G),r(G,v,A),((V=be&&be.onVnodeMounted)||Me||Se)&&Vt(()=>{V&&In(V,H,g),Me&&he.enter(G),Se&&xr(g,null,H,"mounted")},F)},ve=(g,v,A,H,F)=>{if(A&&b(g,A),H)for(let P=0;P<H.length;P++)b(g,H[P]);if(F){let P=F.subTree;if(v===P||Ed(P.type)&&(P.ssContent===v||P.ssFallback===v)){const D=F.vnode;ve(g,D,D.scopeId,D.slotScopeIds,F.parent)}}},Ie=(g,v,A,H,F,P,D,B,G=0)=>{for(let V=G;V<g.length;V++){const be=g[V]=B?qn(g[V]):An(g[V]);I(null,be,v,A,H,F,P,D,B)}},re=(g,v,A,H,F,P,D)=>{const B=v.el=g.el;let{patchFlag:G,dynamicChildren:V,dirs:be}=v;G|=g.patchFlag&16;const ae=g.props||yt,he=v.props||yt;let Se;if(A&&Mr(A,!1),(Se=he.onVnodeBeforeUpdate)&&In(Se,A,v,g),be&&xr(v,g,A,"beforeUpdate"),A&&Mr(A,!0),(ae.innerHTML&&he.innerHTML==null||ae.textContent&&he.textContent==null)&&c(B,""),V?ee(g.dynamicChildren,V,B,A,H,Ti(v,F),P):D||$e(g,v,B,null,A,H,Ti(v,F),P,!1),G>0){if(G&16)ye(B,ae,he,A,F);else if(G&2&&ae.class!==he.class&&o(B,"class",null,he.class,F),G&4&&o(B,"style",ae.style,he.style,F),G&8){const Me=v.dynamicProps;for(let Ke=0;Ke<Me.length;Ke++){const xe=Me[Ke],Ve=ae[xe],wt=he[xe];(wt!==Ve||xe==="value")&&o(B,xe,Ve,wt,F,A)}}G&1&&g.children!==v.children&&c(B,v.children)}else!D&&V==null&&ye(B,ae,he,A,F);((Se=he.onVnodeUpdated)||be)&&Vt(()=>{Se&&In(Se,A,v,g),be&&xr(v,g,A,"updated")},H)},ee=(g,v,A,H,F,P,D)=>{for(let B=0;B<v.length;B++){const G=g[B],V=v[B],be=G.el&&(G.type===He||!jr(G,V)||G.shapeFlag&198)?f(G.el):A;I(G,V,be,null,H,F,P,D,!0)}},ye=(g,v,A,H,F)=>{if(v!==A){if(v!==yt)for(const P in v)!Ns(P)&&!(P in A)&&o(g,P,v[P],null,F,H);for(const P in A){if(Ns(P))continue;const D=A[P],B=v[P];D!==B&&P!=="value"&&o(g,P,B,D,F,H)}"value"in A&&o(g,"value",v.value,A.value,F)}},te=(g,v,A,H,F,P,D,B,G)=>{const V=v.el=g?g.el:a(""),be=v.anchor=g?g.anchor:a("");let{patchFlag:ae,dynamicChildren:he,slotScopeIds:Se}=v;Se&&(B=B?B.concat(Se):Se),g==null?(r(V,A,H),r(be,A,H),Ie(v.children||[],A,be,F,P,D,B,G)):ae>0&&ae&64&&he&&g.dynamicChildren&&g.dynamicChildren.length===he.length?(ee(g.dynamicChildren,he,A,F,P,D,B),(v.key!=null||F&&v===F.subTree)&&qa(g,v,!0)):$e(g,v,A,be,F,P,D,B,G)},je=(g,v,A,H,F,P,D,B,G)=>{v.slotScopeIds=B,g==null?v.shapeFlag&512?F.ctx.activate(v,A,H,D,G):Be(v,A,H,F,P,D,G):Ye(g,v,G)},Be=(g,v,A,H,F,P,D)=>{const B=g.component=Up(g,H,F);if(ni(g)&&(B.ctx.renderer=fe),Fp(B,!1,D),B.asyncDep){if(F&&F.registerDep(B,Re,D),!g.el){const G=B.subTree=Ce(qt);Y(null,G,v,A),g.placeholder=G.el}}else Re(B,g,v,A,F,P,D)},Ye=(g,v,A)=>{const H=v.component=g.component;if(kp(g,v,A))if(H.asyncDep&&!H.asyncResolved){Te(H,v,A);return}else H.next=v,H.update();else v.el=g.el,H.vnode=v},Re=(g,v,A,H,F,P,D)=>{const B=()=>{if(g.isMounted){let{next:ae,bu:he,u:Se,parent:Me,vnode:Ke}=g;{const K=Id(g);if(K){ae&&(ae.el=Ke.el,Te(g,ae,D)),K.asyncDep.then(()=>{Vt(()=>{g.isUnmounted||V()},F)});return}}let xe=ae,Ve;Mr(g,!1),ae?(ae.el=Ke.el,Te(g,ae,D)):ae=Ke,he&&To(he),(Ve=ae.props&&ae.props.onVnodeBeforeUpdate)&&In(Ve,Me,ae,Ke),Mr(g,!0);const wt=Nl(g),U=g.subTree;g.subTree=wt,I(U,wt,f(U.el),W(U),g,F,P),ae.el=wt.el,xe===null&&Tp(g,wt.el),Se&&Vt(Se,F),(Ve=ae.props&&ae.props.onVnodeUpdated)&&Vt(()=>In(Ve,Me,ae,Ke),F)}else{let ae;const{el:he,props:Se}=v,{bm:Me,m:Ke,parent:xe,root:Ve,type:wt}=g,U=is(v);Mr(g,!1),Me&&To(Me),!U&&(ae=Se&&Se.onVnodeBeforeMount)&&In(ae,xe,v),Mr(g,!0);{Ve.ce&&Ve.ce._hasShadowRoot()&&Ve.ce._injectChildStyle(wt,g.parent?g.parent.type:void 0);const K=g.subTree=Nl(g);I(null,K,A,H,g,F,P),v.el=K.el}if(Ke&&Vt(Ke,F),!U&&(ae=Se&&Se.onVnodeMounted)){const K=v;Vt(()=>In(ae,xe,K),F)}(v.shapeFlag&256||xe&&is(xe.vnode)&&xe.vnode.shapeFlag&256)&&g.a&&Vt(g.a,F),g.isMounted=!0,v=A=H=null}};g.scope.on();const G=g.effect=new Ru(B);g.scope.off();const V=g.update=G.run.bind(G),be=g.job=G.runIfDirty.bind(G);be.i=g,be.id=g.uid,G.scheduler=()=>Ha(be),Mr(g,!0),V()},Te=(g,v,A)=>{v.component=g;const H=g.vnode.props;g.vnode=v,g.next=null,Sp(g,v.props,H,A),Rp(g,v.children,A),Qn(),kl(g),Xn()},$e=(g,v,A,H,F,P,D,B,G=!1)=>{const V=g&&g.children,be=g?g.shapeFlag:0,ae=v.children,{patchFlag:he,shapeFlag:Se}=v;if(he>0){if(he&128){nt(V,ae,A,H,F,P,D,B,G);return}else if(he&256){Tt(V,ae,A,H,F,P,D,B,G);return}}Se&8?(be&16&&et(V,F,P),ae!==V&&c(A,ae)):be&16?Se&16?nt(V,ae,A,H,F,P,D,B,G):et(V,F,P,!0):(be&8&&c(A,""),Se&16&&Ie(ae,A,H,F,P,D,B,G))},Tt=(g,v,A,H,F,P,D,B,G)=>{g=g||rs,v=v||rs;const V=g.length,be=v.length,ae=Math.min(V,be);let he;for(he=0;he<ae;he++){const Se=v[he]=G?qn(v[he]):An(v[he]);I(g[he],Se,A,null,F,P,D,B,G)}V>be?et(g,F,P,!0,!1,ae):Ie(v,A,H,F,P,D,B,G,ae)},nt=(g,v,A,H,F,P,D,B,G)=>{let V=0;const be=v.length;let ae=g.length-1,he=be-1;for(;V<=ae&&V<=he;){const Se=g[V],Me=v[V]=G?qn(v[V]):An(v[V]);if(jr(Se,Me))I(Se,Me,A,null,F,P,D,B,G);else break;V++}for(;V<=ae&&V<=he;){const Se=g[ae],Me=v[he]=G?qn(v[he]):An(v[he]);if(jr(Se,Me))I(Se,Me,A,null,F,P,D,B,G);else break;ae--,he--}if(V>ae){if(V<=he){const Se=he+1,Me=Se<be?v[Se].el:H;for(;V<=he;)I(null,v[V]=G?qn(v[V]):An(v[V]),A,Me,F,P,D,B,G),V++}}else if(V>he)for(;V<=ae;)Xe(g[V],F,P,!0),V++;else{const Se=V,Me=V,Ke=new Map;for(V=Me;V<=he;V++){const ot=v[V]=G?qn(v[V]):An(v[V]);ot.key!=null&&Ke.set(ot.key,V)}let xe,Ve=0;const wt=he-Me+1;let U=!1,K=0;const ne=new Array(wt);for(V=0;V<wt;V++)ne[V]=0;for(V=Se;V<=ae;V++){const ot=g[V];if(Ve>=wt){Xe(ot,F,P,!0);continue}let bt;if(ot.key!=null)bt=Ke.get(ot.key);else for(xe=Me;xe<=he;xe++)if(ne[xe-Me]===0&&jr(ot,v[xe])){bt=xe;break}bt===void 0?Xe(ot,F,P,!0):(ne[bt-Me]=V+1,bt>=K?K=bt:U=!0,I(ot,v[bt],A,null,F,P,D,B,G),Ve++)}const Je=U?Op(ne):rs;for(xe=Je.length-1,V=wt-1;V>=0;V--){const ot=Me+V,bt=v[ot],Pt=v[ot+1],ln=ot+1<be?Pt.el||Sd(Pt):H;ne[V]===0?I(null,bt,A,ln,F,P,D,B,G):U&&(xe<0||V!==Je[xe]?Qe(bt,A,ln,2):xe--)}}},Qe=(g,v,A,H,F=null)=>{const{el:P,type:D,transition:B,children:G,shapeFlag:V}=g;if(V&6){Qe(g.component.subTree,v,A,H);return}if(V&128){g.suspense.move(v,A,H);return}if(V&64){D.move(g,v,A,fe);return}if(D===He){r(P,v,A);for(let ae=0;ae<G.length;ae++)Qe(G[ae],v,A,H);r(g.anchor,v,A);return}if(D===Ii){q(g,v,A);return}if(H!==2&&V&1&&B)if(H===0)B.beforeEnter(P),r(P,v,A),Vt(()=>B.enter(P),F);else{const{leave:ae,delayLeave:he,afterLeave:Se}=B,Me=()=>{g.ctx.isUnmounted?s(P):r(P,v,A)},Ke=()=>{P._isLeaving&&P[En](!0),ae(P,()=>{Me(),Se&&Se()})};he?he(P,Me,Ke):Ke()}else r(P,v,A)},Xe=(g,v,A,H=!1,F=!1)=>{const{type:P,props:D,ref:B,children:G,dynamicChildren:V,shapeFlag:be,patchFlag:ae,dirs:he,cacheIndex:Se}=g;if(ae===-2&&(F=!1),B!=null&&(Qn(),js(B,null,A,g,!0),Xn()),Se!=null&&(v.renderCache[Se]=void 0),be&256){v.ctx.deactivate(g);return}const Me=be&1&&he,Ke=!is(g);let xe;if(Ke&&(xe=D&&D.onVnodeBeforeUnmount)&&In(xe,v,g),be&6)Ge(g.component,A,H);else{if(be&128){g.suspense.unmount(A,H);return}Me&&xr(g,null,v,"beforeUnmount"),be&64?g.type.remove(g,v,A,fe,H):V&&!V.hasOnce&&(P!==He||ae>0&&ae&64)?et(V,v,A,!1,!0):(P===He&&ae&384||!F&&be&16)&&et(G,v,A),H&&ft(g)}(Ke&&(xe=D&&D.onVnodeUnmounted)||Me)&&Vt(()=>{xe&&In(xe,v,g),Me&&xr(g,null,v,"unmounted")},A)},ft=g=>{const{type:v,el:A,anchor:H,transition:F}=g;if(v===He){Rt(A,H);return}if(v===Ii){j(g);return}const P=()=>{s(A),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(g.shapeFlag&1&&F&&!F.persisted){const{leave:D,delayLeave:B}=F,G=()=>D(A,P);B?B(g.el,P,G):G()}else P()},Rt=(g,v)=>{let A;for(;g!==v;)A=h(g),s(g),g=A;s(v)},Ge=(g,v,A)=>{const{bum:H,scope:F,job:P,subTree:D,um:B,m:G,a:V}=g;Ll(G),Ll(V),H&&To(H),F.stop(),P&&(P.flags|=8,Xe(D,g,v,A)),B&&Vt(B,v),Vt(()=>{g.isUnmounted=!0},v)},et=(g,v,A,H=!1,F=!1,P=0)=>{for(let D=P;D<g.length;D++)Xe(g[D],v,A,H,F)},W=g=>{if(g.shapeFlag&6)return W(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const v=h(g.anchor||g.el),A=v&&v[Zu];return A?h(A):v};let me=!1;const ie=(g,v,A)=>{let H;g==null?v._vnode&&(Xe(v._vnode,null,null,!0),H=v._vnode.component):I(v._vnode||null,g,v,null,null,null,A),v._vnode=g,me||(me=!0,kl(H),Ku(),me=!1)},fe={p:I,um:Xe,m:Qe,r:ft,mt:Be,mc:Ie,pc:$e,pbc:ee,n:W,o:e};return{render:ie,hydrate:void 0,createApp:gp(ie)}}function Ti({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 Mr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Mp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function qa(e,t,n=!1){const r=e.children,s=t.children;if(Le(r)&&Le(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]=qn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&qa(i,a)),a.type===ii&&(a.patchFlag===-1&&(a=s[o]=qn(a)),a.el=i.el),a.type===qt&&!a.el&&(a.el=i.el)}}function Op(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const u=e[r];if(u!==0){if(s=n[n.length-1],e[s]<u){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<u?o=a+1:i=a;u<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 Id(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Id(t)}function Ll(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Sd(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Sd(t.subTree):null}const Ed=e=>e.__isSuspense;function Np(e,t){t&&t.pendingBranch?Le(e)?t.effects.push(...e):t.effects.push(e):Fh(e)}const He=Symbol.for("v-fgt"),ii=Symbol.for("v-txt"),qt=Symbol.for("v-cmt"),Ii=Symbol.for("v-stc"),Us=[];let an=null;function w(e=!1){Us.push(an=e?null:[])}function $p(){Us.pop(),an=Us[Us.length-1]||null}let Ks=1;function Bo(e,t=!1){Ks+=e,e<0&&an&&t&&(an.hasOnce=!0)}function Cd(e){return e.dynamicChildren=Ks>0?an||rs:null,$p(),Ks>0&&an&&an.push(e),e}function T(e,t,n,r,s,o){return Cd(m(e,t,n,r,s,o,!0))}function gt(e,t,n,r,s){return Cd(Ce(e,t,n,r,s,!0))}function Js(e){return e?e.__v_isVNode===!0:!1}function jr(e,t){return e.type===t.type&&e.key===t.key}const Ad=({key:e})=>e??null,Eo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ct(e)||Gt(e)||qe(e)?{i:Ft,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,s=null,o=e===He?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ad(t),ref:t&&Eo(t),scopeId:Yu,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:Ft};return a?(za(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=Ct(n)?8:16),Ks>0&&!i&&an&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&an.push(l),l}const Ce=Dp;function Dp(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===cd)&&(e=qt),Js(e)){const a=_r(e,t,!0);return n&&za(a,n),Ks>0&&!o&&an&&(a.shapeFlag&6?an[an.indexOf(e)]=a:an.push(a)),a.patchFlag=-2,a}if(qp(e)&&(e=e.__vccOpts),t){t=Lp(t);let{class:a,style:l}=t;a&&!Ct(a)&&(t.class=mt(a)),dt(l)&&(Fa(l)&&!Le(l)&&(l=$t({},l)),t.style=qr(l))}const i=Ct(e)?1:Ed(e)?128:ed(e)?64:dt(e)?4:qe(e)?2:0;return m(e,t,n,r,s,i,o,!0)}function Lp(e){return e?Fa(e)||yd(e)?$t({},e):e:null}function _r(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,u=t?Rd(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Ad(u),ref:t&&t.ref?n&&o?Le(o)?o.concat(Eo(t)):[o,Eo(t)]:Eo(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==He?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&_r(e.ssContent),ssFallback:e.ssFallback&&_r(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Gs(c,l.clone(c)),c}function la(e=" ",t=0){return Ce(ii,null,e,t)}function se(e="",t=!1){return t?(w(),gt(qt,null,e)):Ce(qt,null,e)}function An(e){return e==null||typeof e=="boolean"?Ce(qt):Le(e)?Ce(He,null,e.slice()):Js(e)?qn(e):Ce(ii,null,String(e))}function qn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:_r(e)}function za(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Le(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),za(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!yd(t)?t._ctx=Ft:s===3&&Ft&&(Ft.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else qe(t)?(t={default:t,_ctx:Ft},n=32):(t=String(t),r&64?(n=16,t=[la(t)]):n=8);e.children=t,e.shapeFlag|=n}function Rd(...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=mt([t.class,r.class]));else if(s==="style")t.style=qr([t.style,r.style]);else if(Jo(s)){const o=t[s],i=r[s];i&&o!==i&&!(Le(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function In(e,t,n,r=null){wn(e,t,7,[n,r])}const jp=hd();let Bp=0;function Up(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||jp,o={uid:Bp++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new dh(!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:bd(r,s),emitsOptions:pd(r,s),emit:null,emitted:null,propsDefaults:yt,inheritAttrs:r.inheritAttrs,ctx:yt,data:yt,props:yt,attrs:yt,slots:yt,refs:yt,setupState:yt,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=yp.bind(null,o),e.ce&&e.ce(o),o}let zt=null;const Ga=()=>zt||Ft;let Uo,ca;{const e=Xo(),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)}};Uo=t("__VUE_INSTANCE_SETTERS__",n=>zt=n),ca=t("__VUE_SSR_SETTERS__",n=>Ys=n)}const oo=e=>{const t=zt;return Uo(e),e.scope.on(),()=>{e.scope.off(),Uo(t)}},jl=()=>{zt&&zt.scope.off(),Uo(null)};function Pd(e){return e.vnode.shapeFlag&4}let Ys=!1;function Fp(e,t=!1,n=!1){t&&ca(t);const{props:r,children:s}=e.vnode,o=Pd(e);Ip(e,r,o,t),Ap(e,s,n||t);const i=o?Hp(e,t):void 0;return t&&ca(!1),i}function Hp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ap);const{setup:r}=n;if(r){Qn();const s=e.setupContext=r.length>1?Md(e):null,o=oo(e),i=so(r,e,0,[e.props,s]),a=ku(i);if(Xn(),o(),(a||e.sp)&&!is(e)&&ad(e),a){if(i.then(jl,jl),t)return i.then(l=>{Bl(e,l)}).catch(l=>{ti(l,e,0)});e.asyncDep=i}else Bl(e,i)}else xd(e)}function Bl(e,t,n){qe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:dt(t)&&(e.setupState=qu(t)),xd(e)}function xd(e,t,n){const r=e.type;e.render||(e.render=r.render||On);{const s=oo(e);Qn();try{up(e)}finally{Xn(),s()}}}const Vp={get(e,t){return Wt(e,"get",""),e[t]}};function Md(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Vp),slots:e.slots,emit:e.emit,expose:t}}function ai(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(qu(xh(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Bs)return Bs[n](e)},has(t,n){return n in t||n in Bs}})):e.proxy}function Wp(e,t=!0){return qe(e)?e.displayName||e.name:e.name||t&&e.__name}function qp(e){return qe(e)&&"__vccOpts"in e}const pe=(e,t)=>Dh(e,t,Ys);function Ka(e,t,n){try{Bo(-1);const r=arguments.length;return r===2?dt(t)&&!Le(t)?Js(t)?Ce(e,null,[t]):Ce(e,t):Ce(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Js(n)&&(n=[n]),Ce(e,t,n))}finally{Bo(1)}}const zp="3.5.30";/**
14
14
  * @vue/runtime-dom v3.5.30
15
15
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
16
  * @license MIT
17
- **/let da;const Fl=typeof window<"u"&&window.trustedTypes;if(Fl)try{da=Fl.createPolicy("vue",{createHTML:e=>e})}catch{}const Nd=da?e=>da.createHTML(e):e=>e,Gp="http://www.w3.org/2000/svg",Kp="http://www.w3.org/1998/Math/MathML",zn=typeof document<"u"?document:null,Hl=zn&&zn.createElement("template"),Jp={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"?zn.createElementNS(Gp,e):t==="mathml"?zn.createElementNS(Kp,e):n?zn.createElement(e,{is:n}):zn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>zn.createTextNode(e),createComment:e=>zn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>zn.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{Hl.innerHTML=Nd(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Hl.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]}},ur="transition",Rs="animation",Qs=Symbol("_vtc"),$d={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},Yp=$t({},rd,$d),Qp=e=>(e.displayName="Transition",e.props=Yp,e),Dd=Qp((e,{slots:t})=>Ja(Kh,Xp(e),t)),Or=(e,t=[])=>{Le(e)?e.forEach(n=>n(...t)):e&&e(...t)},Vl=e=>e?Le(e)?e.some(t=>t.length>1):e.length>1:!1;function Xp(e){const t={};for(const te in e)te in $d||(t[te]=e[te]);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:u=i,appearToClass:c=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:b=`${n}-leave-to`}=e,N=Zp(s),I=N&&N[0],O=N&&N[1],{onBeforeEnter:Y,onEnter:$,onEnterCancelled:z,onLeave:j,onLeaveCancelled:oe,onBeforeAppear:de=Y,onAppear:ve=$,onAppearCancelled:Ie=z}=t,re=(te,je,Be,Qe)=>{te._enterCancelled=Qe,Nr(te,je?c:a),Nr(te,je?u:i),Be&&Be()},ee=(te,je)=>{te._isLeaving=!1,Nr(te,f),Nr(te,b),Nr(te,h),je&&je()},ye=te=>(je,Be)=>{const Qe=te?ve:$,Re=()=>re(je,te,Be);Or(Qe,[je,Re]),Wl(()=>{Nr(je,te?l:o),Vn(je,te?c:a),Vl(Qe)||zl(je,r,I,Re)})};return $t(t,{onBeforeEnter(te){Or(Y,[te]),Vn(te,o),Vn(te,i)},onBeforeAppear(te){Or(de,[te]),Vn(te,l),Vn(te,u)},onEnter:ye(!1),onAppear:ye(!0),onLeave(te,je){te._isLeaving=!0;const Be=()=>ee(te,je);Vn(te,f),te._enterCancelled?(Vn(te,h),Kl(te)):(Kl(te),Vn(te,h)),Wl(()=>{te._isLeaving&&(Nr(te,f),Vn(te,b),Vl(j)||zl(te,r,O,Be))}),Or(j,[te,Be])},onEnterCancelled(te){re(te,!1,void 0,!0),Or(z,[te])},onAppearCancelled(te){re(te,!0,void 0,!0),Or(Ie,[te])},onLeaveCancelled(te){ee(te),Or(oe,[te])}})}function Zp(e){if(e==null)return null;if(ft(e))return[Ei(e.enter),Ei(e.leave)];{const t=Ei(e);return[t,t]}}function Ei(e){return rh(e)}function Vn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Qs]||(e[Qs]=new Set)).add(t)}function Nr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Qs];n&&(n.delete(t),n.size||(e[Qs]=void 0))}function Wl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let em=0;function zl(e,t,n,r){const s=e._endId=++em,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=tm(e,t);if(!i)return r();const u=i+"end";let c=0;const f=()=>{e.removeEventListener(u,h),o()},h=b=>{b.target===e&&++c>=l&&f()};setTimeout(()=>{c<l&&f()},a+1),e.addEventListener(u,h)}function tm(e,t){const n=window.getComputedStyle(e),r=N=>(n[N]||"").split(", "),s=r(`${ur}Delay`),o=r(`${ur}Duration`),i=ql(s,o),a=r(`${Rs}Delay`),l=r(`${Rs}Duration`),u=ql(a,l);let c=null,f=0,h=0;t===ur?i>0&&(c=ur,f=i,h=o.length):t===Rs?u>0&&(c=Rs,f=u,h=l.length):(f=Math.max(i,u),c=f>0?i>u?ur:Rs:null,h=c?c===ur?o.length:l.length:0);const b=c===ur&&/\b(?:transform|all)(?:,|$)/.test(r(`${ur}Property`).toString());return{type:c,timeout:f,propCount:h,hasTransform:b}}function ql(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Gl(n)+Gl(e[r])))}function Gl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Kl(e){return(e?e.ownerDocument:document).body.offsetHeight}function nm(e,t,n){const r=e[Qs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Jl=Symbol("_vod"),rm=Symbol("_vsh"),sm=Symbol(""),om=/(?:^|;)\s*display\s*:/;function im(e,t,n){const r=e.style,s=Ct(n);let o=!1;if(n&&!s){if(t)if(Ct(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Co(r,a,"")}else for(const i in t)n[i]==null&&Co(r,i,"");for(const i in n)i==="display"&&(o=!0),Co(r,i,n[i])}else if(s){if(t!==n){const i=r[sm];i&&(n+=";"+i),r.cssText=n,o=om.test(n)}}else t&&e.removeAttribute("style");Jl in e&&(e[Jl]=o?r.display:"",e[rm]&&(r.display="none"))}const Yl=/\s*!important$/;function Co(e,t,n){if(Le(n))n.forEach(r=>Co(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=am(e,t);Yl.test(n)?e.setProperty(Tr(r),n.replace(Yl,""),"important"):e[r]=n}}const Ql=["Webkit","Moz","ms"],Ci={};function am(e,t){const n=Ci[t];if(n)return n;let r=Qt(t);if(r!=="filter"&&r in e)return Ci[t]=r;r=Qo(r);for(let s=0;s<Ql.length;s++){const o=Ql[s]+r;if(o in e)return Ci[t]=o}return t}const Xl="http://www.w3.org/1999/xlink";function Zl(e,t,n,r,s,o=ch(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Xl,t.slice(6,t.length)):e.setAttributeNS(Xl,t,n):n==null||o&&!Cu(n)?e.removeAttribute(t):e.setAttribute(t,o?"":vn(n)?String(n):n)}function ec(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Nd(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=Cu(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 ns(e,t,n,r){e.addEventListener(t,n,r)}function lm(e,t,n,r){e.removeEventListener(t,n,r)}const tc=Symbol("_vei");function cm(e,t,n,r,s=null){const o=e[tc]||(e[tc]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=um(t);if(r){const u=o[t]=hm(r,s);ns(e,a,u,l)}else i&&(lm(e,a,i,l),o[t]=void 0)}}const nc=/(?:Once|Passive|Capture)$/;function um(e){let t;if(nc.test(e)){t={};let r;for(;r=e.match(nc);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Tr(e.slice(2)),t]}let Ai=0;const dm=Promise.resolve(),fm=()=>Ai||(dm.then(()=>Ai=0),Ai=Date.now());function hm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;wn(pm(r,n.value),t,5,[r])};return n.value=e,n.attached=fm(),n}function pm(e,t){if(Le(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 rc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,mm=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?nm(e,r,i):t==="style"?im(e,n,r):Jo(t)?Pa(t)||cm(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):gm(e,t,r,i))?(ec(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Zl(e,t,r,i,o,t!=="value")):e._isVueCE&&(vm(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ct(r)))?ec(e,Qt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Zl(e,t,r,i))};function gm(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&rc(t)&&ze(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 rc(t)&&Ct(n)?!1:t in e}function vm(e,t){const n=e._def.props;if(!n)return!1;const r=Qt(t);return Array.isArray(n)?n.some(s=>Qt(s)===r):Object.keys(n).some(s=>Qt(s)===r)}const sc=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Le(t)?n=>To(t,n):t};function ym(e){e.target.composing=!0}function oc(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ri=Symbol("_assign");function ic(e,t,n){return t&&(e=e.trim()),n&&(e=Na(e)),e}const nr={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Ri]=sc(s);const o=r||s.props&&s.props.type==="number";ns(e,t?"change":"input",i=>{i.target.composing||e[Ri](ic(e.value,n,o))}),(n||o)&&ns(e,"change",()=>{e.value=ic(e.value,n,o)}),t||(ns(e,"compositionstart",ym),ns(e,"compositionend",oc),ns(e,"change",oc))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Ri]=sc(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Na(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))}},wm=["ctrl","shift","alt","meta"],bm={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)=>wm.some(n=>e[`${n}Key`]&&!t.includes(n))},tt=(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=bm[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},_m={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Yt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Tr(s.key);if(t.some(i=>i===o||_m[i]===o))return e(s)}))},km=$t({patchProp:mm},Jp);let ac;function Tm(){return ac||(ac=xp(km))}const Im=((...e)=>{const t=Tm().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Em(r);if(!s)return;const o=t._component;!ze(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Sm(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Sm(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Em(e){return Ct(e)?document.querySelector(e):e}/*!
17
+ **/let ua;const Ul=typeof window<"u"&&window.trustedTypes;if(Ul)try{ua=Ul.createPolicy("vue",{createHTML:e=>e})}catch{}const Od=ua?e=>ua.createHTML(e):e=>e,Gp="http://www.w3.org/2000/svg",Kp="http://www.w3.org/1998/Math/MathML",Wn=typeof document<"u"?document:null,Fl=Wn&&Wn.createElement("template"),Jp={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"?Wn.createElementNS(Gp,e):t==="mathml"?Wn.createElementNS(Kp,e):n?Wn.createElement(e,{is:n}):Wn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Wn.createTextNode(e),createComment:e=>Wn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Wn.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{Fl.innerHTML=Od(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Fl.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]}},cr="transition",Rs="animation",Qs=Symbol("_vtc"),Nd={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},Yp=$t({},nd,Nd),Qp=e=>(e.displayName="Transition",e.props=Yp,e),$d=Qp((e,{slots:t})=>Ka(Kh,Xp(e),t)),Or=(e,t=[])=>{Le(e)?e.forEach(n=>n(...t)):e&&e(...t)},Hl=e=>e?Le(e)?e.some(t=>t.length>1):e.length>1:!1;function Xp(e){const t={};for(const te in e)te in Nd||(t[te]=e[te]);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:u=i,appearToClass:c=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:b=`${n}-leave-to`}=e,N=Zp(s),I=N&&N[0],O=N&&N[1],{onBeforeEnter:Y,onEnter:$,onEnterCancelled:q,onLeave:j,onLeaveCancelled:oe,onBeforeAppear:de=Y,onAppear:ve=$,onAppearCancelled:Ie=q}=t,re=(te,je,Be,Ye)=>{te._enterCancelled=Ye,Nr(te,je?c:a),Nr(te,je?u:i),Be&&Be()},ee=(te,je)=>{te._isLeaving=!1,Nr(te,f),Nr(te,b),Nr(te,h),je&&je()},ye=te=>(je,Be)=>{const Ye=te?ve:$,Re=()=>re(je,te,Be);Or(Ye,[je,Re]),Vl(()=>{Nr(je,te?l:o),Hn(je,te?c:a),Hl(Ye)||Wl(je,r,I,Re)})};return $t(t,{onBeforeEnter(te){Or(Y,[te]),Hn(te,o),Hn(te,i)},onBeforeAppear(te){Or(de,[te]),Hn(te,l),Hn(te,u)},onEnter:ye(!1),onAppear:ye(!0),onLeave(te,je){te._isLeaving=!0;const Be=()=>ee(te,je);Hn(te,f),te._enterCancelled?(Hn(te,h),Gl(te)):(Gl(te),Hn(te,h)),Vl(()=>{te._isLeaving&&(Nr(te,f),Hn(te,b),Hl(j)||Wl(te,r,O,Be))}),Or(j,[te,Be])},onEnterCancelled(te){re(te,!1,void 0,!0),Or(q,[te])},onAppearCancelled(te){re(te,!0,void 0,!0),Or(Ie,[te])},onLeaveCancelled(te){ee(te),Or(oe,[te])}})}function Zp(e){if(e==null)return null;if(dt(e))return[Si(e.enter),Si(e.leave)];{const t=Si(e);return[t,t]}}function Si(e){return rh(e)}function Hn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Qs]||(e[Qs]=new Set)).add(t)}function Nr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Qs];n&&(n.delete(t),n.size||(e[Qs]=void 0))}function Vl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let em=0;function Wl(e,t,n,r){const s=e._endId=++em,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=tm(e,t);if(!i)return r();const u=i+"end";let c=0;const f=()=>{e.removeEventListener(u,h),o()},h=b=>{b.target===e&&++c>=l&&f()};setTimeout(()=>{c<l&&f()},a+1),e.addEventListener(u,h)}function tm(e,t){const n=window.getComputedStyle(e),r=N=>(n[N]||"").split(", "),s=r(`${cr}Delay`),o=r(`${cr}Duration`),i=ql(s,o),a=r(`${Rs}Delay`),l=r(`${Rs}Duration`),u=ql(a,l);let c=null,f=0,h=0;t===cr?i>0&&(c=cr,f=i,h=o.length):t===Rs?u>0&&(c=Rs,f=u,h=l.length):(f=Math.max(i,u),c=f>0?i>u?cr:Rs:null,h=c?c===cr?o.length:l.length:0);const b=c===cr&&/\b(?:transform|all)(?:,|$)/.test(r(`${cr}Property`).toString());return{type:c,timeout:f,propCount:h,hasTransform:b}}function ql(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>zl(n)+zl(e[r])))}function zl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Gl(e){return(e?e.ownerDocument:document).body.offsetHeight}function nm(e,t,n){const r=e[Qs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Kl=Symbol("_vod"),rm=Symbol("_vsh"),sm=Symbol(""),om=/(?:^|;)\s*display\s*:/;function im(e,t,n){const r=e.style,s=Ct(n);let o=!1;if(n&&!s){if(t)if(Ct(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Co(r,a,"")}else for(const i in t)n[i]==null&&Co(r,i,"");for(const i in n)i==="display"&&(o=!0),Co(r,i,n[i])}else if(s){if(t!==n){const i=r[sm];i&&(n+=";"+i),r.cssText=n,o=om.test(n)}}else t&&e.removeAttribute("style");Kl in e&&(e[Kl]=o?r.display:"",e[rm]&&(r.display="none"))}const Jl=/\s*!important$/;function Co(e,t,n){if(Le(n))n.forEach(r=>Co(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=am(e,t);Jl.test(n)?e.setProperty(kr(r),n.replace(Jl,""),"important"):e[r]=n}}const Yl=["Webkit","Moz","ms"],Ei={};function am(e,t){const n=Ei[t];if(n)return n;let r=Xt(t);if(r!=="filter"&&r in e)return Ei[t]=r;r=Qo(r);for(let s=0;s<Yl.length;s++){const o=Yl[s]+r;if(o in e)return Ei[t]=o}return t}const Ql="http://www.w3.org/1999/xlink";function Xl(e,t,n,r,s,o=ch(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Ql,t.slice(6,t.length)):e.setAttributeNS(Ql,t,n):n==null||o&&!Eu(n)?e.removeAttribute(t):e.setAttribute(t,o?"":vn(n)?String(n):n)}function Zl(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Od(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=Eu(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 ts(e,t,n,r){e.addEventListener(t,n,r)}function lm(e,t,n,r){e.removeEventListener(t,n,r)}const ec=Symbol("_vei");function cm(e,t,n,r,s=null){const o=e[ec]||(e[ec]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=um(t);if(r){const u=o[t]=hm(r,s);ts(e,a,u,l)}else i&&(lm(e,a,i,l),o[t]=void 0)}}const tc=/(?:Once|Passive|Capture)$/;function um(e){let t;if(tc.test(e)){t={};let r;for(;r=e.match(tc);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):kr(e.slice(2)),t]}let Ci=0;const dm=Promise.resolve(),fm=()=>Ci||(dm.then(()=>Ci=0),Ci=Date.now());function hm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;wn(pm(r,n.value),t,5,[r])};return n.value=e,n.attached=fm(),n}function pm(e,t){if(Le(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 nc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,mm=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?nm(e,r,i):t==="style"?im(e,n,r):Jo(t)?Pa(t)||cm(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):gm(e,t,r,i))?(Zl(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Xl(e,t,r,i,o,t!=="value")):e._isVueCE&&(vm(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ct(r)))?Zl(e,Xt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Xl(e,t,r,i))};function gm(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&nc(t)&&qe(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 nc(t)&&Ct(n)?!1:t in e}function vm(e,t){const n=e._def.props;if(!n)return!1;const r=Xt(t);return Array.isArray(n)?n.some(s=>Xt(s)===r):Object.keys(n).some(s=>Xt(s)===r)}const rc=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Le(t)?n=>To(t,n):t};function ym(e){e.target.composing=!0}function sc(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ai=Symbol("_assign");function oc(e,t,n){return t&&(e=e.trim()),n&&(e=Oa(e)),e}const tr={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Ai]=rc(s);const o=r||s.props&&s.props.type==="number";ts(e,t?"change":"input",i=>{i.target.composing||e[Ai](oc(e.value,n,o))}),(n||o)&&ts(e,"change",()=>{e.value=oc(e.value,n,o)}),t||(ts(e,"compositionstart",ym),ts(e,"compositionend",sc),ts(e,"change",sc))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Ai]=rc(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Oa(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))}},wm=["ctrl","shift","alt","meta"],bm={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)=>wm.some(n=>e[`${n}Key`]&&!t.includes(n))},tt=(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=bm[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},_m={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Qt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=kr(s.key);if(t.some(i=>i===o||_m[i]===o))return e(s)}))},km=$t({patchProp:mm},Jp);let ic;function Tm(){return ic||(ic=Pp(km))}const Im=((...e)=>{const t=Tm().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Em(r);if(!s)return;const o=t._component;!qe(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Sm(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Sm(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Em(e){return Ct(e)?document.querySelector(e):e}/*!
18
18
  * vue-router v4.6.4
19
19
  * (c) 2025 Eduardo San Martin Morote
20
20
  * @license MIT
21
- */const rs=typeof document<"u";function Ld(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Cm(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Ld(e.default)}const ut=Object.assign;function xi(e,t){const n={};for(const r in t){const s=t[r];n[r]=bn(s)?s.map(e):e(s)}return n}const Fs=()=>{},bn=Array.isArray;function lc(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const jd=/#/g,Am=/&/g,Rm=/\//g,xm=/=/g,Pm=/\?/g,Bd=/\+/g,Mm=/%5B/g,Om=/%5D/g,Ud=/%5E/g,Nm=/%60/g,Fd=/%7B/g,$m=/%7C/g,Hd=/%7D/g,Dm=/%20/g;function Ya(e){return e==null?"":encodeURI(""+e).replace($m,"|").replace(Mm,"[").replace(Om,"]")}function Lm(e){return Ya(e).replace(Fd,"{").replace(Hd,"}").replace(Ud,"^")}function fa(e){return Ya(e).replace(Bd,"%2B").replace(Dm,"+").replace(jd,"%23").replace(Am,"%26").replace(Nm,"`").replace(Fd,"{").replace(Hd,"}").replace(Ud,"^")}function jm(e){return fa(e).replace(xm,"%3D")}function Bm(e){return Ya(e).replace(jd,"%23").replace(Pm,"%3F")}function Um(e){return Bm(e).replace(Rm,"%2F")}function Xs(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Fm=/\/$/,Hm=e=>e.replace(Fm,"");function Pi(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=qm(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:Xs(i)}}function Vm(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function cc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Wm(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&ps(t.matched[r],n.matched[s])&&Vd(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ps(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Vd(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!zm(e[n],t[n]))return!1;return!0}function zm(e,t){return bn(e)?uc(e,t):bn(t)?uc(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function uc(e,t){return bn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function qm(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 dr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let ha=(function(e){return e.pop="pop",e.push="push",e})({}),Mi=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Gm(e){if(!e)if(rs){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Hm(e)}const Km=/^[^#]+#/;function Jm(e,t){return e.replace(Km,"#")+t}function Ym(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 li=()=>({left:window.scrollX,top:window.scrollY});function Qm(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=Ym(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 dc(e,t){return(history.state?history.state.position-t:-1)+e}const pa=new Map;function Xm(e,t){pa.set(e,t)}function Zm(e){const t=pa.get(e);return pa.delete(e),t}function eg(e){return typeof e=="string"||e&&typeof e=="object"}function Wd(e){return typeof e=="string"||typeof e=="symbol"}let At=(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 zd=Symbol("");At.MATCHER_NOT_FOUND+"",At.NAVIGATION_GUARD_REDIRECT+"",At.NAVIGATION_ABORTED+"",At.NAVIGATION_CANCELLED+"",At.NAVIGATION_DUPLICATED+"";function ms(e,t){return ut(new Error,{type:e,[zd]:!0},t)}function Wn(e,t){return e instanceof Error&&zd in e&&(t==null||!!(e.type&t))}const tg=["params","query","hash"];function ng(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of tg)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function rg(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(Bd," "),o=s.indexOf("="),i=Xs(o<0?s:s.slice(0,o)),a=o<0?null:Xs(s.slice(o+1));if(i in t){let l=t[i];bn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function fc(e){let t="";for(let n in e){const r=e[n];if(n=jm(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(bn(r)?r.map(s=>s&&fa(s)):[r&&fa(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function sg(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=bn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const og=Symbol(""),hc=Symbol(""),ci=Symbol(""),Qa=Symbol(""),ma=Symbol("");function xs(){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 mr(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const u=h=>{h===!1?l(ms(At.NAVIGATION_ABORTED,{from:n,to:t})):h instanceof Error?l(h):eg(h)?l(ms(At.NAVIGATION_GUARD_REDIRECT,{from:t,to:h})):(i&&r.enterCallbacks[s]===i&&typeof h=="function"&&i.push(h),a())},c=o(()=>e.call(r&&r.instances[s],t,n,u));let f=Promise.resolve(c);e.length<3&&(f=f.then(u)),f.catch(h=>l(h))})}function Oi(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(Ld(l)){const u=(l.__vccOpts||l)[t];u&&o.push(mr(u,n,r,i,a,s))}else{let u=l();o.push(()=>u.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Cm(c)?c.default:c;i.mods[a]=c,i.components[a]=f;const h=(f.__vccOpts||f)[t];return h&&mr(h,n,r,i,a,s)()}))}}return o}function ig(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(u=>ps(u,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(u=>ps(u,l))||s.push(l))}return[n,r,s]}/*!
21
+ */const ns=typeof document<"u";function Dd(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Cm(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Dd(e.default)}const ct=Object.assign;function Ri(e,t){const n={};for(const r in t){const s=t[r];n[r]=bn(s)?s.map(e):e(s)}return n}const Fs=()=>{},bn=Array.isArray;function ac(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Ld=/#/g,Am=/&/g,Rm=/\//g,Pm=/=/g,xm=/\?/g,jd=/\+/g,Mm=/%5B/g,Om=/%5D/g,Bd=/%5E/g,Nm=/%60/g,Ud=/%7B/g,$m=/%7C/g,Fd=/%7D/g,Dm=/%20/g;function Ja(e){return e==null?"":encodeURI(""+e).replace($m,"|").replace(Mm,"[").replace(Om,"]")}function Lm(e){return Ja(e).replace(Ud,"{").replace(Fd,"}").replace(Bd,"^")}function da(e){return Ja(e).replace(jd,"%2B").replace(Dm,"+").replace(Ld,"%23").replace(Am,"%26").replace(Nm,"`").replace(Ud,"{").replace(Fd,"}").replace(Bd,"^")}function jm(e){return da(e).replace(Pm,"%3D")}function Bm(e){return Ja(e).replace(Ld,"%23").replace(xm,"%3F")}function Um(e){return Bm(e).replace(Rm,"%2F")}function Xs(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Fm=/\/$/,Hm=e=>e.replace(Fm,"");function Pi(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=zm(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:Xs(i)}}function Vm(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function lc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Wm(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&hs(t.matched[r],n.matched[s])&&Hd(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function hs(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Hd(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!qm(e[n],t[n]))return!1;return!0}function qm(e,t){return bn(e)?cc(e,t):bn(t)?cc(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function cc(e,t){return bn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function zm(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 ur={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let fa=(function(e){return e.pop="pop",e.push="push",e})({}),xi=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Gm(e){if(!e)if(ns){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Hm(e)}const Km=/^[^#]+#/;function Jm(e,t){return e.replace(Km,"#")+t}function Ym(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 li=()=>({left:window.scrollX,top:window.scrollY});function Qm(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=Ym(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 uc(e,t){return(history.state?history.state.position-t:-1)+e}const ha=new Map;function Xm(e,t){ha.set(e,t)}function Zm(e){const t=ha.get(e);return ha.delete(e),t}function eg(e){return typeof e=="string"||e&&typeof e=="object"}function Vd(e){return typeof e=="string"||typeof e=="symbol"}let At=(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 Wd=Symbol("");At.MATCHER_NOT_FOUND+"",At.NAVIGATION_GUARD_REDIRECT+"",At.NAVIGATION_ABORTED+"",At.NAVIGATION_CANCELLED+"",At.NAVIGATION_DUPLICATED+"";function ps(e,t){return ct(new Error,{type:e,[Wd]:!0},t)}function Vn(e,t){return e instanceof Error&&Wd in e&&(t==null||!!(e.type&t))}const tg=["params","query","hash"];function ng(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of tg)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function rg(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(jd," "),o=s.indexOf("="),i=Xs(o<0?s:s.slice(0,o)),a=o<0?null:Xs(s.slice(o+1));if(i in t){let l=t[i];bn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function dc(e){let t="";for(let n in e){const r=e[n];if(n=jm(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(bn(r)?r.map(s=>s&&da(s)):[r&&da(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function sg(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=bn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const og=Symbol(""),fc=Symbol(""),ci=Symbol(""),Ya=Symbol(""),pa=Symbol("");function Ps(){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 pr(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const u=h=>{h===!1?l(ps(At.NAVIGATION_ABORTED,{from:n,to:t})):h instanceof Error?l(h):eg(h)?l(ps(At.NAVIGATION_GUARD_REDIRECT,{from:t,to:h})):(i&&r.enterCallbacks[s]===i&&typeof h=="function"&&i.push(h),a())},c=o(()=>e.call(r&&r.instances[s],t,n,u));let f=Promise.resolve(c);e.length<3&&(f=f.then(u)),f.catch(h=>l(h))})}function Mi(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(Dd(l)){const u=(l.__vccOpts||l)[t];u&&o.push(pr(u,n,r,i,a,s))}else{let u=l();o.push(()=>u.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Cm(c)?c.default:c;i.mods[a]=c,i.components[a]=f;const h=(f.__vccOpts||f)[t];return h&&pr(h,n,r,i,a,s)()}))}}return o}function ig(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(u=>hs(u,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(u=>hs(u,l))||s.push(l))}return[n,r,s]}/*!
22
22
  * vue-router v4.6.4
23
23
  * (c) 2025 Eduardo San Martin Morote
24
24
  * @license MIT
25
- */let ag=()=>location.protocol+"//"+location.host;function qd(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),cc(a,"")}return cc(n,e)+r+s}function lg(e,t,n,r){let s=[],o=[],i=null;const a=({state:h})=>{const b=qd(e,location),N=n.value,I=t.value;let O=0;if(h){if(n.value=b,t.value=h,i&&i===N){i=null;return}O=I?h.position-I.position:0}else r(b);s.forEach(Y=>{Y(n.value,N,{delta:O,type:ha.pop,direction:O?O>0?Mi.forward:Mi.back:Mi.unknown})})};function l(){i=n.value}function u(h){s.push(h);const b=()=>{const N=s.indexOf(h);N>-1&&s.splice(N,1)};return o.push(b),b}function c(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(ut({},h.state,{scroll:li()}),"")}}function f(){for(const h of o)h();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:u,destroy:f}}function pc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?li():null}}function cg(e){const{history:t,location:n}=window,r={value:qd(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,u,c){const f=e.indexOf("#"),h=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:ag()+e+l;try{t[c?"replaceState":"pushState"](u,"",h),s.value=u}catch(b){console.error(b),n[c?"replace":"assign"](h)}}function i(l,u){o(l,ut({},t.state,pc(s.value.back,l,s.value.forward,!0),u,{position:s.value.position}),!0),r.value=l}function a(l,u){const c=ut({},s.value,t.state,{forward:l,scroll:li()});o(c.current,c,!0),o(l,ut({},pc(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function ug(e){e=Gm(e);const t=cg(e),n=lg(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=ut({location:"",base:e,go:r,createHref:Jm.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 dg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),ug(e)}let Ur=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Nt=(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})(Nt||{});const fg={type:Ur.Static,value:""},hg=/[a-zA-Z0-9_]/;function pg(e){if(!e)return[[]];if(e==="/")return[[fg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(b){throw new Error(`ERR (${n})/"${u}": ${b}`)}let n=Nt.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,u="",c="";function f(){u&&(n===Nt.Static?o.push({type:Ur.Static,value:u}):n===Nt.Param||n===Nt.ParamRegExp||n===Nt.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Ur.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function h(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Nt.ParamRegExp){r=n,n=Nt.EscapeNext;continue}switch(n){case Nt.Static:l==="/"?(u&&f(),i()):l===":"?(f(),n=Nt.Param):h();break;case Nt.EscapeNext:h(),n=r;break;case Nt.Param:l==="("?n=Nt.ParamRegExp:hg.test(l)?h():(f(),n=Nt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Nt.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=Nt.ParamRegExpEnd:c+=l;break;case Nt.ParamRegExpEnd:f(),n=Nt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Nt.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),i(),s}const mc="[^/]+?",mg={sensitive:!1,strict:!1,start:!0,end:!0};var Kt=(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})(Kt||{});const gg=/[.+*?^${}()[\]/\\]/g;function vg(e,t){const n=ut({},mg,t),r=[];let s=n.start?"^":"";const o=[];for(const u of e){const c=u.length?[]:[Kt.Root];n.strict&&!u.length&&(s+="/");for(let f=0;f<u.length;f++){const h=u[f];let b=Kt.Segment+(n.sensitive?Kt.BonusCaseSensitive:0);if(h.type===Ur.Static)f||(s+="/"),s+=h.value.replace(gg,"\\$&"),b+=Kt.Static;else if(h.type===Ur.Param){const{value:N,repeatable:I,optional:O,regexp:Y}=h;o.push({name:N,repeatable:I,optional:O});const $=Y||mc;if($!==mc){b+=Kt.BonusCustomRegExp;try{`${$}`}catch(j){throw new Error(`Invalid custom RegExp for param "${N}" (${$}): `+j.message)}}let z=I?`((?:${$})(?:/(?:${$}))*)`:`(${$})`;f||(z=O&&u.length<2?`(?:/${z})`:"/"+z),O&&(z+="?"),s+=z,b+=Kt.Dynamic,O&&(b+=Kt.BonusOptional),I&&(b+=Kt.BonusRepeatable),$===".*"&&(b+=Kt.BonusWildcard)}c.push(b)}r.push(c)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=Kt.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(u){const c=u.match(i),f={};if(!c)return null;for(let h=1;h<c.length;h++){const b=c[h]||"",N=o[h-1];f[N.name]=b&&N.repeatable?b.split("/"):b}return f}function l(u){let c="",f=!1;for(const h of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const b of h)if(b.type===Ur.Static)c+=b.value;else if(b.type===Ur.Param){const{value:N,repeatable:I,optional:O}=b,Y=N in u?u[N]:"";if(bn(Y)&&!I)throw new Error(`Provided param "${N}" is an array but it is not repeatable (* or + modifiers)`);const $=bn(Y)?Y.join("/"):Y;if(!$)if(O)h.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${N}"`);c+=$}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function yg(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]===Kt.Static+Kt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Kt.Static+Kt.Segment?1:-1:0}function Gd(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=yg(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(gc(r))return 1;if(gc(s))return-1}return s.length-r.length}function gc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const wg={strict:!1,end:!0,sensitive:!1};function bg(e,t,n){const r=vg(pg(e.path),n),s=ut(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function _g(e,t){const n=[],r=new Map;t=lc(wg,t);function s(f){return r.get(f)}function o(f,h,b){const N=!b,I=yc(f);I.aliasOf=b&&b.record;const O=lc(t,f),Y=[I];if("alias"in f){const j=typeof f.alias=="string"?[f.alias]:f.alias;for(const oe of j)Y.push(yc(ut({},I,{components:b?b.record.components:I.components,path:oe,aliasOf:b?b.record:I})))}let $,z;for(const j of Y){const{path:oe}=j;if(h&&oe[0]!=="/"){const de=h.record.path,ve=de[de.length-1]==="/"?"":"/";j.path=h.record.path+(oe&&ve+oe)}if($=bg(j,h,O),b?b.alias.push($):(z=z||$,z!==$&&z.alias.push($),N&&f.name&&!wc($)&&i(f.name)),Kd($)&&l($),I.children){const de=I.children;for(let ve=0;ve<de.length;ve++)o(de[ve],$,b&&b.children[ve])}b=b||$}return z?()=>{i(z)}:Fs}function i(f){if(Wd(f)){const h=r.get(f);h&&(r.delete(f),n.splice(n.indexOf(h),1),h.children.forEach(i),h.alias.forEach(i))}else{const h=n.indexOf(f);h>-1&&(n.splice(h,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 h=Ig(f,n);n.splice(h,0,f),f.record.name&&!wc(f)&&r.set(f.record.name,f)}function u(f,h){let b,N={},I,O;if("name"in f&&f.name){if(b=r.get(f.name),!b)throw ms(At.MATCHER_NOT_FOUND,{location:f});O=b.record.name,N=ut(vc(h.params,b.keys.filter(z=>!z.optional).concat(b.parent?b.parent.keys.filter(z=>z.optional):[]).map(z=>z.name)),f.params&&vc(f.params,b.keys.map(z=>z.name))),I=b.stringify(N)}else if(f.path!=null)I=f.path,b=n.find(z=>z.re.test(I)),b&&(N=b.parse(I),O=b.record.name);else{if(b=h.name?r.get(h.name):n.find(z=>z.re.test(h.path)),!b)throw ms(At.MATCHER_NOT_FOUND,{location:f,currentLocation:h});O=b.record.name,N=ut({},h.params,f.params),I=b.stringify(N)}const Y=[];let $=b;for(;$;)Y.unshift($.record),$=$.parent;return{name:O,path:I,params:N,matched:Y,meta:Tg(Y)}}e.forEach(f=>o(f));function c(){n.length=0,r.clear()}return{addRoute:o,resolve:u,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function vc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function yc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:kg(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 kg(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 wc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Tg(e){return e.reduce((t,n)=>ut(t,n.meta),{})}function Ig(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Gd(e,t[o])<0?r=o:n=o+1}const s=Sg(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Sg(e){let t=e;for(;t=t.parent;)if(Kd(t)&&Gd(e,t)===0)return t}function Kd({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function bc(e){const t=mn(ci),n=mn(Qa),r=pe(()=>{const l=ue(e.to);return t.resolve(l)}),s=pe(()=>{const{matched:l}=r.value,{length:u}=l,c=l[u-1],f=n.matched;if(!c||!f.length)return-1;const h=f.findIndex(ps.bind(null,c));if(h>-1)return h;const b=_c(l[u-2]);return u>1&&_c(c)===b&&f[f.length-1].path!==b?f.findIndex(ps.bind(null,l[u-2])):h}),o=pe(()=>s.value>-1&&xg(n.params,r.value.params)),i=pe(()=>s.value>-1&&s.value===n.matched.length-1&&Vd(n.params,r.value.params));function a(l={}){if(Rg(l)){const u=t[ue(e.replace)?"replace":"push"](ue(e.to)).catch(Fs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:pe(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Eg(e){return e.length===1?e[0]:e}const Cg=Lt({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:bc,setup(e,{slots:t}){const n=ei(bc(e)),{options:r}=mn(ci),s=pe(()=>({[kc(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[kc(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Eg(t.default(n));return e.custom?o:Ja("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Ag=Cg;function Rg(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 xg(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(!bn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function _c(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const kc=(e,t,n)=>e??t??n,Pg=Lt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=mn(ma),s=pe(()=>e.route||r.value),o=mn(hc,0),i=pe(()=>{let u=ue(o);const{matched:c}=s.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),a=pe(()=>s.value.matched[i.value]);Io(hc,pe(()=>i.value+1)),Io(og,a),Io(ma,s);const l=L();return mt(()=>[l.value,a.value,e.name],([u,c,f],[h,b,N])=>{c&&(c.instances[f]=u,b&&b!==c&&u&&u===h&&(c.leaveGuards.size||(c.leaveGuards=b.leaveGuards),c.updateGuards.size||(c.updateGuards=b.updateGuards))),u&&c&&(!b||!ps(c,b)||!h)&&(c.enterCallbacks[f]||[]).forEach(I=>I(u))},{flush:"post"}),()=>{const u=s.value,c=e.name,f=a.value,h=f&&f.components[c];if(!h)return Tc(n.default,{Component:h,route:u});const b=f.props[c],N=b?b===!0?u.params:typeof b=="function"?b(u):b:null,O=Ja(h,ut({},N,t,{onVnodeUnmounted:Y=>{Y.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return Tc(n.default,{Component:O,route:u})||O}}});function Tc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Mg=Pg;function Og(e){const t=_g(e.routes,e),n=e.parseQuery||rg,r=e.stringifyQuery||fc,s=e.history,o=xs(),i=xs(),a=xs(),l=Mh(dr);let u=dr;rs&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=xi.bind(null,W=>""+W),f=xi.bind(null,Um),h=xi.bind(null,Xs);function b(W,me){let ie,fe;return Wd(W)?(ie=t.getRecordMatcher(W),fe=me):fe=W,t.addRoute(fe,ie)}function N(W){const me=t.getRecordMatcher(W);me&&t.removeRoute(me)}function I(){return t.getRoutes().map(W=>W.record)}function O(W){return!!t.getRecordMatcher(W)}function Y(W,me){if(me=ut({},me||l.value),typeof W=="string"){const A=Pi(n,W,me.path),H=t.resolve({path:A.path},me),F=s.createHref(A.fullPath);return ut(A,H,{params:h(H.params),hash:Xs(A.hash),redirectedFrom:void 0,href:F})}let ie;if(W.path!=null)ie=ut({},W,{path:Pi(n,W.path,me.path).path});else{const A=ut({},W.params);for(const H in A)A[H]==null&&delete A[H];ie=ut({},W,{params:f(A)}),me.params=f(me.params)}const fe=t.resolve(ie,me),De=W.hash||"";fe.params=c(h(fe.params));const g=Vm(r,ut({},W,{hash:Lm(De),path:fe.path})),v=s.createHref(g);return ut({fullPath:g,hash:De,query:r===fc?sg(W.query):W.query||{}},fe,{redirectedFrom:void 0,href:v})}function $(W){return typeof W=="string"?Pi(n,W,l.value.path):ut({},W)}function z(W,me){if(u!==W)return ms(At.NAVIGATION_CANCELLED,{from:me,to:W})}function j(W){return ve(W)}function oe(W){return j(ut($(W),{replace:!0}))}function de(W,me){const ie=W.matched[W.matched.length-1];if(ie&&ie.redirect){const{redirect:fe}=ie;let De=typeof fe=="function"?fe(W,me):fe;return typeof De=="string"&&(De=De.includes("?")||De.includes("#")?De=$(De):{path:De},De.params={}),ut({query:W.query,hash:W.hash,params:De.path!=null?{}:W.params},De)}}function ve(W,me){const ie=u=Y(W),fe=l.value,De=W.state,g=W.force,v=W.replace===!0,A=de(ie,fe);if(A)return ve(ut($(A),{state:typeof A=="object"?ut({},De,A.state):De,force:g,replace:v}),me||ie);const H=ie;H.redirectedFrom=me;let F;return!g&&Wm(r,fe,ie)&&(F=ms(At.NAVIGATION_DUPLICATED,{to:H,from:fe}),Xe(fe,fe,!0,!1)),(F?Promise.resolve(F):ee(H,fe)).catch(x=>Wn(x)?Wn(x,At.NAVIGATION_GUARD_REDIRECT)?x:nt(x):$e(x,H,fe)).then(x=>{if(x){if(Wn(x,At.NAVIGATION_GUARD_REDIRECT))return ve(ut({replace:v},$(x.to),{state:typeof x.to=="object"?ut({},De,x.to.state):De,force:g}),me||H)}else x=te(H,fe,!0,v,De);return ye(H,fe,x),x})}function Ie(W,me){const ie=z(W,me);return ie?Promise.reject(ie):Promise.resolve()}function re(W){const me=Rt.values().next().value;return me&&typeof me.runWithContext=="function"?me.runWithContext(W):W()}function ee(W,me){let ie;const[fe,De,g]=ig(W,me);ie=Oi(fe.reverse(),"beforeRouteLeave",W,me);for(const A of fe)A.leaveGuards.forEach(H=>{ie.push(mr(H,W,me))});const v=Ie.bind(null,W,me);return ie.push(v),et(ie).then(()=>{ie=[];for(const A of o.list())ie.push(mr(A,W,me));return ie.push(v),et(ie)}).then(()=>{ie=Oi(De,"beforeRouteUpdate",W,me);for(const A of De)A.updateGuards.forEach(H=>{ie.push(mr(H,W,me))});return ie.push(v),et(ie)}).then(()=>{ie=[];for(const A of g)if(A.beforeEnter)if(bn(A.beforeEnter))for(const H of A.beforeEnter)ie.push(mr(H,W,me));else ie.push(mr(A.beforeEnter,W,me));return ie.push(v),et(ie)}).then(()=>(W.matched.forEach(A=>A.enterCallbacks={}),ie=Oi(g,"beforeRouteEnter",W,me,re),ie.push(v),et(ie))).then(()=>{ie=[];for(const A of i.list())ie.push(mr(A,W,me));return ie.push(v),et(ie)}).catch(A=>Wn(A,At.NAVIGATION_CANCELLED)?A:Promise.reject(A))}function ye(W,me,ie){a.list().forEach(fe=>re(()=>fe(W,me,ie)))}function te(W,me,ie,fe,De){const g=z(W,me);if(g)return g;const v=me===dr,A=rs?history.state:{};ie&&(fe||v?s.replace(W.fullPath,ut({scroll:v&&A&&A.scroll},De)):s.push(W.fullPath,De)),l.value=W,Xe(W,me,ie,v),nt()}let je;function Be(){je||(je=s.listen((W,me,ie)=>{if(!Ge.listening)return;const fe=Y(W),De=de(fe,Ge.currentRoute.value);if(De){ve(ut(De,{replace:!0,force:!0}),fe).catch(Fs);return}u=fe;const g=l.value;rs&&Xm(dc(g.fullPath,ie.delta),li()),ee(fe,g).catch(v=>Wn(v,At.NAVIGATION_ABORTED|At.NAVIGATION_CANCELLED)?v:Wn(v,At.NAVIGATION_GUARD_REDIRECT)?(ve(ut($(v.to),{force:!0}),fe).then(A=>{Wn(A,At.NAVIGATION_ABORTED|At.NAVIGATION_DUPLICATED)&&!ie.delta&&ie.type===ha.pop&&s.go(-1,!1)}).catch(Fs),Promise.reject()):(ie.delta&&s.go(-ie.delta,!1),$e(v,fe,g))).then(v=>{v=v||te(fe,g,!1),v&&(ie.delta&&!Wn(v,At.NAVIGATION_CANCELLED)?s.go(-ie.delta,!1):ie.type===ha.pop&&Wn(v,At.NAVIGATION_ABORTED|At.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ye(fe,g,v)}).catch(Fs)}))}let Qe=xs(),Re=xs(),Te;function $e(W,me,ie){nt(W);const fe=Re.list();return fe.length?fe.forEach(De=>De(W,me,ie)):console.error(W),Promise.reject(W)}function It(){return Te&&l.value!==dr?Promise.resolve():new Promise((W,me)=>{Qe.add([W,me])})}function nt(W){return Te||(Te=!W,Be(),Qe.list().forEach(([me,ie])=>W?ie(W):me()),Qe.reset()),W}function Xe(W,me,ie,fe){const{scrollBehavior:De}=e;if(!rs||!De)return Promise.resolve();const g=!ie&&Zm(dc(W.fullPath,0))||(fe||!ie)&&history.state&&history.state.scroll||null;return tn().then(()=>De(W,me,g)).then(v=>v&&Qm(v)).catch(v=>$e(v,W,me))}const Ze=W=>s.go(W);let ht;const Rt=new Set,Ge={currentRoute:l,listening:!0,addRoute:b,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:O,getRoutes:I,resolve:Y,options:e,push:j,replace:oe,go:Ze,back:()=>Ze(-1),forward:()=>Ze(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Re.add,isReady:It,install(W){W.component("RouterLink",Ag),W.component("RouterView",Mg),W.config.globalProperties.$router=Ge,Object.defineProperty(W.config.globalProperties,"$route",{enumerable:!0,get:()=>ue(l)}),rs&&!ht&&l.value===dr&&(ht=!0,j(s.location).catch(fe=>{}));const me={};for(const fe in dr)Object.defineProperty(me,fe,{get:()=>l.value[fe],enumerable:!0});W.provide(ci,Ge),W.provide(Qa,Wu(me)),W.provide(ma,l);const ie=W.unmount;Rt.add(W),W.unmount=function(){Rt.delete(W),Rt.size<1&&(u=dr,je&&je(),je=null,l.value=dr,ht=!1,Te=!1),ie()}}};function et(W){return W.reduce((me,ie)=>me.then(()=>re(ie)),Promise.resolve())}return Ge}function Ng(){return mn(ci)}function $g(e){return mn(Qa)}const Ic=768;function Jd(){const e=L(typeof window<"u"?window.innerWidth<Ic:!1);let t=null;function n(r){e.value=r.matches}return ir(()=>{t=window.matchMedia(`(max-width: ${Ic-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),si(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Dg={key:0,class:"desktop-sidebar"},Lg={class:"desktop-main"},Sc="codex-web-local.sidebar-width.v1",jg=260,Bg=620,Ec=320,Ug=Lt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Jd();function r(u){return Math.min(Bg,Math.max(jg,u))}function s(){if(typeof window>"u")return Ec;const u=window.localStorage.getItem(Sc),c=Number(u);return Number.isFinite(c)?r(c):Ec}const o=L(s()),i=pe(()=>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(u){typeof window>"u"||window.localStorage.setItem(Sc,String(u))}function l(u){u.preventDefault();const c=u.clientX,f=o.value,h=N=>{const I=N.clientX-c;o.value=r(f+I)},b=()=>{a(o.value),window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",b)};window.addEventListener("mousemove",h),window.addEventListener("mouseup",b)}return(u,c)=>(w(),T("div",{class:gt(["desktop-layout",{"is-mobile":ue(n)}]),style:zr(i.value)},[ue(n)?(w(),yt(Do,{key:0,to:"body"},[Ce(Dd,{name:"drawer"},{default:pt(()=>[e.isSidebarCollapsed?se("",!0):(w(),T("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=f=>u.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=tt(()=>{},["stop"]))},[Mn(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):se("",!0),ue(n)?se("",!0):(w(),T(He,{key:1},[e.isSidebarCollapsed?se("",!0):(w(),T("aside",Dg,[Mn(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?se("",!0):(w(),T("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),m("section",Lg,[Mn(u.$slots,"content",{},void 0)])],6))}}),st=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Fg=st(Ug,[["__scopeId","data-v-df29c633"]]),Hg={},Vg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Wg(e,t){return w(),T("svg",Vg,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const ui=st(Hg,[["render",Wg]]),zg={},qg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Gg(e,t){return w(),T("svg",qg,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const Yd=st(zg,[["render",Gg]]),Kg={},Jg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Yg(e,t){return w(),T("svg",Jg,[...t[0]||(t[0]=[m("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 Ps=st(Kg,[["render",Yg]]),Qg={},Xg={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Zg(e,t){return w(),T("svg",Xg,[...t[0]||(t[0]=[m("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 Fo=st(Qg,[["render",Zg]]),ev={},tv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function nv(e,t){return w(),T("svg",tv,[...t[0]||(t[0]=[m("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 Qd=st(ev,[["render",nv]]),rv={},sv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ov(e,t){return w(),T("svg",sv,[...t[0]||(t[0]=[m("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 iv=st(rv,[["render",ov]]),av={},lv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function cv(e,t){return w(),T("svg",lv,[...t[0]||(t[0]=[m("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 Ao=st(av,[["render",cv]]),uv={},dv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function fv(e,t){return w(),T("svg",dv,[...t[0]||(t[0]=[m("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 Ni=st(uv,[["render",fv]]),hv={key:0,class:"sidebar-menu-row-left"},pv={class:"sidebar-menu-row-main"},mv={key:1,class:"sidebar-menu-row-right"},gv={key:0,class:"sidebar-menu-row-right-default"},vv={key:1,class:"sidebar-menu-row-right-hover"},yv=Lt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=lp(),r=pe(()=>!!n.left),s=pe(()=>!!n.right),o=pe(()=>!!n["right-hover"]),i=pe(()=>s.value||o.value);return(a,l)=>(w(),yt(sa(t.as),xd({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:pt(()=>[r.value?(w(),T("span",hv,[Mn(a.$slots,"left",{},void 0,!0)])):se("",!0),m("span",pv,[Mn(a.$slots,"default",{},void 0,!0)]),i.value?(w(),T("span",mv,[s.value?(w(),T("span",gv,[Mn(a.$slots,"right",{},void 0,!0)])):se("",!0),o.value?(w(),T("span",vv,[Mn(a.$slots,"right-hover",{},void 0,!0)])):se("",!0)])):se("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),$r=st(yv,[["__scopeId","data-v-daeca4df"]]),wv={class:"thread-tree-root"},bv={key:0,class:"pinned-section"},_v={class:"thread-list"},kv={class:"thread-left-stack"},Tv=["data-state"],Iv=["onClick"],Sv=["onClick"],Ev={class:"thread-row-title-wrap"},Cv={class:"thread-row-title"},Av={class:"thread-row-time"},Rv=["onClick"],xv=["onClick"],Pv=["onClick"],Mv=["onClick"],Ov=["aria-expanded"],Nv=["data-active"],$v={key:0},Dv=["data-active"],Lv={key:0},jv={key:1,class:"thread-tree-no-results"},Bv={key:2,class:"thread-tree-loading"},Uv={key:3,class:"thread-list thread-list-global"},Fv={class:"thread-left-stack"},Hv=["data-state"],Vv=["onClick"],Wv=["onClick"],zv={class:"thread-row-title-wrap"},qv={class:"thread-row-title"},Gv={class:"thread-row-time"},Kv=["onClick"],Jv=["onClick"],Yv=["onClick"],Qv=["onClick"],Xv=["data-project-name","data-expanded","data-dragging"],Zv={class:"project-icon-stack"},ey={class:"project-icon-folder"},ty={class:"project-icon-chevron"},ny=["data-dragging-handle","onMousedown"],ry={class:"project-title"},sy={class:"project-hover-controls"},oy=["onClick"],iy=["onClick"],ay=["onClick"],ly=["onClick"],cy=["onInput"],uy=["aria-label","title","onClick"],dy={key:0,class:"thread-list"},fy={class:"thread-left-stack"},hy=["data-state"],py=["onClick"],my=["onClick"],gy={class:"thread-row-title-wrap"},vy={class:"thread-row-title"},yy={class:"thread-row-time"},wy=["onClick"],by=["onClick"],_y=["onClick"],ky=["onClick"],Ty=["onClick"],Iy={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Sy=["onKeydown"],Ey={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},Cy={class:"rename-thread-subtitle"},Ay=4,Cc=6,Ac="codex-web-local.thread-view-mode.v1",Rc="codex-web-local.collapsed-projects.v1",Ry=Lt({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project","export-thread"],setup(e,{emit:t}){const n=e,r=t,s=L({}),o=L({}),i=L([]),a=L(""),l=L(""),u=L("actions"),c=L(""),f=L(!1),h=L(""),b=L(""),N=L(null),I=L(!1),O=L(""),Y=L(""),$=L(null),z=L(null),j=L(null);let oe=null,de=null;const ve=L(""),Ie=L({}),re=new Map,ee=new Map,ye=new Map,te=new WeakMap,je=L(null),Be=L(!1),Qe=L($e()),Re=typeof window<"u"?new ResizeObserver(k=>{for(const P of k){const M=P.target,J=te.get(M);J&&Ae(J,M)}}):null;function Te(){if(typeof window>"u")return{};try{const k=window.localStorage.getItem(Rc);if(!k)return{};const P=JSON.parse(k);return!P||typeof P!="object"||Array.isArray(P)?{}:P}catch{return{}}}function $e(){return typeof window>"u"?"project":window.localStorage.getItem(Ac)==="chronological"?"chronological":"project"}o.value=Te(),mt(o,k=>{typeof window>"u"||window.localStorage.setItem(Rc,JSON.stringify(k))},{deep:!0}),mt(Qe,k=>{typeof window>"u"||window.localStorage.setItem(Ac,k)});const It=pe(()=>n.searchQuery.trim().toLowerCase()),nt=pe(()=>It.value.length>0),Xe=pe(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function Ze(k){if(!nt.value)return!0;if(Xe.value)return Xe.value.has(k.id);const P=It.value;return k.title.toLowerCase().includes(P)||k.preview.toLowerCase().includes(P)}const ht=pe(()=>nt.value?n.groups.map(k=>({...k,threads:k.threads.filter(Ze)})).filter(k=>k.threads.length>0):n.groups),Rt=pe(()=>Qe.value==="chronological"),Ge=pe(()=>{const k=ht.value,P=[];for(const M of k)for(const J of M.threads)v(J.id)||P.push(J);return P.sort((M,J)=>{const Ue=new Date(M.updatedAtIso||M.createdAtIso).getTime();return new Date(J.updatedAtIso||J.createdAtIso).getTime()-Ue})}),et=pe(()=>{const k=new Map;for(const P of n.groups)for(const M of P.threads)k.set(M.id,M);return k}),W=pe(()=>i.value.map(k=>et.value.get(k)??null).filter(k=>k!==null).filter(Ze)),me=pe(()=>{const k=j.value;if(!k||k.dropTargetIndexFull===null||n.groups.length===0)return null;const P=Math.max(0,Math.min(k.dropTargetIndexFull,n.groups.length)),M=P>k.fromIndex?P-1:P,J=Math.max(0,Math.min(M,n.groups.length-1));return J===k.fromIndex?null:J}),ie=pe(()=>{const P=(nt.value?ht.value:n.groups).map(Zt=>Zt.projectName),M=j.value,J=me.value;if(!M||J===null)return P;const Ue=[...P],[Ot]=Ue.splice(M.fromIndex,1);return Ot?(Ue.splice(J,0,Ot),Ue):P}),fe=pe(()=>{const k={};let P=0;for(const M of ie.value)k[M]=P,P+=jt(M);return k}),De=pe(()=>{let k=0;for(const P of ie.value)k+=jt(P);return{height:`${Math.max(0,k)}px`}});function g(k){const P=new Date(k).getTime();if(Number.isNaN(P))return"n/a";const M=Math.abs(Date.now()-P);if(M<6e4)return"now";const J=Math.floor(M/6e4);if(J<60)return`${J}m`;const Ue=Math.floor(J/60);return Ue<24?`${Ue}h`:`${Math.floor(Ue/24)}d`}function v(k){return i.value.includes(k)}function A(k){if(v(k)){i.value=i.value.filter(P=>P!==k);return}i.value=[k,...i.value]}function H(k){r("select",k)}function F(k){r("export-thread",k),V()}function x(k){return`start new thread ${Ve(k)}`}function D(k){r("start-new-thread",k)}function B(k){l.value===k&&V()}function G(k){return l.value===k}function V(){l.value=""}function be(k){if(l.value===k){V();return}l.value=k}function ae(k,P){h.value=k,b.value=P,f.value=!0,V(),tn(()=>{var M,J;(M=N.value)==null||M.focus(),(J=N.value)==null||J.select()})}function he(){f.value=!1,h.value="",b.value=""}function Se(){const k=h.value,P=b.value.trim();!k||!P||(r("rename-thread",{threadId:k,title:P}),he())}function Me(k,P){O.value=k,Y.value=P,I.value=!0,V()}function Ke(){I.value=!1,O.value="",Y.value=""}function Pe(){const k=O.value;k&&(i.value=i.value.filter(P=>P!==k),r("archive",k),Ke())}function Ve(k){return n.projectDisplayNameById[k]??k}function _t(k){return a.value===k}function U(){a.value="",u.value="actions",c.value=""}function K(){Be.value=!Be.value}function ne(k){Qe.value=k,Be.value=!1}function Je(k){if(a.value===k){U();return}a.value=k,u.value="actions",c.value=Ve(k)}function it(k){a.value=k,u.value="rename",c.value=Ve(k)}function kt(k){r("rename-project",{projectName:k,displayName:c.value})}function xt(k){r("remove-project",k),U()}function ln(k){r("browse-project-files",k),U()}function Sr(k,P){if(!k.altKey||k.key!=="ArrowUp"&&k.key!=="ArrowDown")return;const M=n.groups.findIndex(Ot=>Ot.projectName===P);if(M<0)return;const J=k.key==="ArrowUp"?-1:1,Ue=Math.max(0,Math.min(M+J,n.groups.length-1));Ue!==M&&(k.preventDefault(),r("reorder-project",{projectName:P,toIndex:Ue}))}function rn(k){return s.value[k]===!0}function Ne(k){return o.value[k]===!0}function Oe(k){s.value={...s.value,[k]:!rn(k)}}function fn(k){if(ve.value===k){ve.value="";return}o.value={...o.value,[k]:!Ne(k)}}function jt(k){const P=Ie.value[k]??0,M=j.value,Ue=((M==null?void 0:M.projectName)===k?M.groupHeight:null)??P,Ot=Ne(k)?0:Cc;return Math.max(0,Ue+Ot)}function Er(k,P){const M=P instanceof HTMLElement?P:P&&"$el"in P&&P.$el instanceof HTMLElement?P.$el:null;if(M){ee.set(k,M);return}ee.delete(k)}function _n(k,P){const M=P instanceof HTMLElement?P:P&&"$el"in P&&P.$el instanceof HTMLElement?P.$el:null;if(M){ye.set(k,M);return}ye.delete(k)}function kn(k){const P=a.value;if(!P)return!1;const M=ee.get(P);if(!M)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(M))return!0;const Ue=k.target;return Ue instanceof Node?M.contains(Ue):!1}function _(k){const P=l.value;if(!P)return!1;const M=ye.get(P);if(!M)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(M))return!0;const Ue=k.target;return Ue instanceof Node?M.contains(Ue):!1}function S(k){if(Be.value){const P=je.value,M=typeof k.composedPath=="function"?k.composedPath():[];!!P&&(M.includes(P)||k.target instanceof Node&&P.contains(k.target))||(Be.value=!1)}a.value&&(kn(k)||U(),l.value&&(_(k)||V()))}function E(k){a.value&&!kn(k)&&U(),l.value&&!_(k)&&V()}function q(){Be.value&&(Be.value=!1),a.value&&U(),l.value&&V()}function ge(){window.addEventListener("pointerdown",S,{capture:!0}),window.addEventListener("focusin",E,{capture:!0}),window.addEventListener("blur",q)}function le(){window.removeEventListener("pointerdown",S,{capture:!0}),window.removeEventListener("focusin",E,{capture:!0}),window.removeEventListener("blur",q)}function Ae(k,P){const M=P.getBoundingClientRect().height;if(!Number.isFinite(M)||M<=0)return;const J=Ie.value[k];J!==void 0&&Math.abs(J-M)<.5||(Ie.value={...Ie.value,[k]:M})}function ke(k,P){const M=re.get(k);M&&M!==P&&Re&&Re.unobserve(M);const J=P instanceof HTMLElement?P:P&&"$el"in P&&P.$el instanceof HTMLElement?P.$el:null;if(J){re.set(k,J),te.set(J,k),Ae(k,J),Re==null||Re.observe(J);return}M&&(Re==null||Re.unobserve(M)),re.delete(k)}function We(k,P){if(k.button!==0||z.value||j.value)return;const M=n.groups.findIndex(Zt=>Zt.projectName===P),J=re.get(P);if(M<0||!J)return;const Ue=J.getBoundingClientRect(),Ot=Ne(P)?0:Cc;z.value={projectName:P,fromIndex:M,startClientX:k.clientX,startClientY:k.clientY,pointerOffsetY:k.clientY-Ue.top,groupLeft:Ue.left,groupWidth:Ue.width,groupHeight:Ue.height,groupOuterHeight:Ue.height+Ot},k.preventDefault(),at()}function at(){window.addEventListener("mousemove",Pt),window.addEventListener("mouseup",Mt),window.addEventListener("keydown",sn)}function lt(){window.removeEventListener("mousemove",Pt),window.removeEventListener("mouseup",Mt),window.removeEventListener("keydown",sn)}function Pt(k){oe={clientX:k.clientX,clientY:k.clientY},ks()}function Mt(k){Cr({clientX:k.clientX,clientY:k.clientY});const P=j.value;if(P&&me.value!==null){const M=n.groups.findIndex(J=>J.projectName===P.projectName);if(M>=0){const J=me.value;J!==M&&r("reorder-project",{projectName:P.projectName,toIndex:J})}}Dn()}function sn(k){k.key==="Escape"&&(!z.value&&!j.value||(k.preventDefault(),Dn()))}function Dn(){de!==null&&(window.cancelAnimationFrame(de),de=null),oe=null,z.value=null,j.value=null,ve.value="",lt()}function ks(){de===null&&(de=window.requestAnimationFrame(()=>{if(de=null,!oe)return;const k=oe;oe=null,Cr(k)}))}function Cr(k){const P=z.value;if(!j.value&&P){const M=k.clientX-P.startClientX,J=k.clientY-P.startClientY;if(Math.hypot(M,J)<Ay)return;U(),ve.value=P.projectName,j.value={projectName:P.projectName,fromIndex:P.fromIndex,pointerOffsetY:P.pointerOffsetY,groupLeft:P.groupLeft,groupWidth:P.groupWidth,groupHeight:P.groupHeight,groupOuterHeight:P.groupOuterHeight,ghostTop:k.clientY-P.pointerOffsetY,dropTargetIndexFull:null}}j.value&&Gr(k)}function Gr(k){const P=j.value;if(!P)return;if(P.ghostTop=k.clientY-P.pointerOffsetY,!Ln(k)){P.dropTargetIndexFull=null;return}const M=k.clientY,J=$.value;if(!J){P.dropTargetIndexFull=null;return}const Ue=J.getBoundingClientRect(),Ot=new Map(n.groups.map((on,lr)=>[on.projectName,lr])),Zt=n.groups.map(on=>on.projectName).filter(on=>on!==P.projectName);let Bn=0,Un=n.groups.length;for(const on of Zt){const lr=Ot.get(on);if(lr===void 0)continue;const Yr=jt(on),Qr=Ue.top+Bn+Yr/2;if(M<Qr){Un=lr;break}Bn+=Yr}P.dropTargetIndexFull=Un}function Ln(k){const P=$.value;if(!P)return!1;const M=P.getBoundingClientRect(),J=k.clientX>=M.left&&k.clientX<=M.right,Ue=k.clientY>=M.top-32&&k.clientY<=M.bottom+32;return J&&Ue}function Kr(k){var P;return((P=j.value)==null?void 0:P.projectName)===k}function Jr(k){const P=j.value,M=fe.value[k]??0,J=a.value===k;return!P||P.projectName!==k?{position:"absolute",top:"0",left:"0",right:"0",zIndex:J?"40":"1",transform:`translate3d(0, ${M}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${P.groupLeft}px`,width:`${P.groupWidth}px`,height:`${P.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${P.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function jn(k){return k.threads.filter(P=>!v(P.id))}function Ts(k){if(nt.value)return jn(k);if(Ne(k.projectName))return[];const P=jn(k);return rn(k.projectName)?P:P.slice(0,10)}function Is(k){return nt.value?!1:!Ne(k.projectName)&&jn(k).length>10}function Ss(k){return jn(k).length>0}function Ar(k){return k.inProgress?"working":k.unread?"unread":"idle"}mt(()=>n.groups.map(k=>k.projectName),k=>{var Ue,Ot;const P=((Ue=j.value)==null?void 0:Ue.projectName)??((Ot=z.value)==null?void 0:Ot.projectName)??"";P&&!n.groups.some(Zt=>Zt.projectName===P)&&Dn();const M=new Set(k),J=Object.fromEntries(Object.entries(Ie.value).filter(([Zt])=>M.has(Zt)));Object.keys(J).length!==Object.keys(Ie.value).length&&(Ie.value=J)});const Rr=pe(()=>Be.value||a.value!=="");return mt(Rr,k=>{if(k){ge();return}le()}),ar(()=>{for(const k of re.values())Re==null||Re.unobserve(k);re.clear(),ee.clear(),le(),Dn()}),(k,P)=>(w(),T("section",wv,[W.value.length>0?(w(),T("section",bv,[m("ul",_v,[(w(!0),T(He,null,Et(W.value,M=>(w(),T("li",{key:M.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":M.id===e.selectedThreadId,"data-pinned":v(M.id),onMouseleave:J=>B(M.id)},{left:pt(()=>[m("span",kv,[M.inProgress||M.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Ar(M)},null,8,Tv)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>A(M.id)},[Ce(Ni,{class:"thread-icon"})],8,Iv)])]),right:pt(()=>[m("span",Av,ce(g(M.createdAtIso||M.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:J=>_n(M.id,J),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(J=>be(M.id),["stop"])},[Ce(Ps,{class:"thread-icon"})],8,Rv),G(M.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:P[0]||(P[0]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:J=>F(M.id)}," Export chat ",8,xv),m("button",{class:"thread-menu-item",type:"button",onClick:J=>ae(M.id,M.title)}," Rename thread ",8,Pv),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:J=>Me(M.id,M.title)}," Delete thread ",8,Mv)])):se("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:J=>H(M.id)},[m("span",Ev,[m("span",Cv,ce(M.title),1),M.hasWorktree?(w(),yt(Ao,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,Sv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):se("",!0),Ce($r,{as:"header",class:"thread-tree-header-row"},{right:pt(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:je,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Be.value,"aria-label":"Organize threads",title:"Organize threads",onClick:K},[Ce(Ps,{class:"thread-icon"})],8,Ov),Be.value?(w(),T("div",{key:0,class:"organize-menu-panel",onClick:P[3]||(P[3]=tt(()=>{},["stop"]))},[P[11]||(P[11]=m("p",{class:"organize-menu-title"},"Organize",-1)),m("button",{class:"organize-menu-item","data-active":Qe.value==="project",type:"button",onClick:P[1]||(P[1]=M=>ne("project"))},[P[9]||(P[9]=m("span",null,"By project",-1)),Qe.value==="project"?(w(),T("span",$v,"✓")):se("",!0)],8,Nv),m("button",{class:"organize-menu-item","data-active":Qe.value==="chronological",type:"button",onClick:P[2]||(P[2]=M=>ne("chronological"))},[P[10]||(P[10]=m("span",null,"Chronological list",-1)),Qe.value==="chronological"?(w(),T("span",Lv,"✓")):se("",!0)],8,Dv)])):se("",!0)],512)]),default:pt(()=>[P[12]||(P[12]=m("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),nt.value&&ht.value.length===0?(w(),T("p",jv,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),T("p",Bv,"Loading threads...")):Rt.value?(w(),T("ul",Uv,[(w(!0),T(He,null,Et(Ge.value,M=>(w(),T("li",{key:M.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":M.id===e.selectedThreadId,"data-pinned":v(M.id),onMouseleave:J=>B(M.id)},{left:pt(()=>[m("span",Fv,[M.inProgress||M.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Ar(M)},null,8,Hv)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>A(M.id)},[Ce(Ni,{class:"thread-icon"})],8,Vv)])]),right:pt(()=>[m("span",Gv,ce(g(M.createdAtIso||M.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:J=>_n(M.id,J),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(J=>be(M.id),["stop"])},[Ce(Ps,{class:"thread-icon"})],8,Kv),G(M.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:P[4]||(P[4]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:J=>F(M.id)}," Export chat ",8,Jv),m("button",{class:"thread-menu-item",type:"button",onClick:J=>ae(M.id,M.title)}," Rename thread ",8,Yv),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:J=>Me(M.id,M.title)}," Delete thread ",8,Qv)])):se("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:J=>H(M.id)},[m("span",zv,[m("span",qv,ce(M.title),1),M.hasWorktree?(w(),yt(Ao,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,Wv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),T("div",{key:4,ref_key:"groupsContainerRef",ref:$,class:"thread-tree-groups",style:zr(De.value)},[(w(!0),T(He,null,Et(ht.value,M=>(w(),T("article",{key:M.projectName,ref_for:!0,ref:J=>ke(M.projectName,J),class:"project-group","data-project-name":M.projectName,"data-expanded":!Ne(M.projectName),"data-dragging":Kr(M.projectName),style:zr(Jr(M.projectName))},[Ce($r,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:J=>fn(M.projectName),onKeydown:[J=>Sr(J,M.projectName),Yt(tt(J=>fn(M.projectName),["prevent"]),["enter"]),Yt(tt(J=>fn(M.projectName),["prevent"]),["space"])]},{left:pt(()=>[m("span",Zv,[m("span",ey,[Ne(M.projectName)?(w(),yt(Qd,{key:0,class:"thread-icon"})):(w(),yt(iv,{key:1,class:"thread-icon"}))]),m("span",ty,[Ne(M.projectName)?(w(),yt(Yd,{key:0,class:"thread-icon"})):(w(),yt(ui,{key:1,class:"thread-icon"}))])])]),right:pt(()=>[m("div",sy,[m("div",{ref_for:!0,ref:J=>Er(M.projectName,J),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:tt(J=>Je(M.projectName),["stop"])},[Ce(Ps,{class:"thread-icon"})],8,oy),_t(M.projectName)?(w(),T("div",{key:0,class:"project-menu-panel",onClick:P[6]||(P[6]=tt(()=>{},["stop"]))},[u.value==="actions"?(w(),T(He,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:J=>ln(M.projectName)}," Browse files ",8,iy),m("button",{class:"project-menu-item",type:"button",onClick:J=>it(M.projectName)}," Edit name ",8,ay),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:J=>xt(M.projectName)}," Remove ",8,ly)],64)):(w(),T(He,{key:1},[P[13]||(P[13]=m("label",{class:"project-menu-label"},"Project name",-1)),tr(m("input",{"onUpdate:modelValue":P[5]||(P[5]=J=>c.value=J),class:"project-menu-input",type:"text",onInput:J=>kt(M.projectName)},null,40,cy),[[nr,c.value]])],64))])):se("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":x(M.projectName),title:x(M.projectName),onClick:tt(J=>D(M.projectName),["stop"])},[Ce(Fo,{class:"thread-icon"})],8,uy)])]),default:pt(()=>[m("span",{class:"project-main-button","data-dragging-handle":Kr(M.projectName),onMousedown:tt(J=>We(J,M.projectName),["left"])},[m("span",ry,ce(Ve(M.projectName)),1)],40,ny)]),_:2},1032,["onClick","onKeydown"]),Ss(M)?(w(),T("ul",dy,[(w(!0),T(He,null,Et(Ts(M),J=>(w(),T("li",{key:J.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":J.id===e.selectedThreadId,"data-pinned":v(J.id),onMouseleave:Ue=>B(J.id)},{left:pt(()=>[m("span",fy,[J.inProgress||J.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Ar(J)},null,8,hy)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Ue=>A(J.id)},[Ce(Ni,{class:"thread-icon"})],8,py)])]),right:pt(()=>[m("span",yy,ce(g(J.createdAtIso||J.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:Ue=>_n(J.id,Ue),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(Ue=>be(J.id),["stop"])},[Ce(Ps,{class:"thread-icon"})],8,wy),G(J.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:P[7]||(P[7]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Ue=>F(J.id)}," Export chat ",8,by),m("button",{class:"thread-menu-item",type:"button",onClick:Ue=>ae(J.id,J.title)}," Rename thread ",8,_y),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Ue=>Me(J.id,J.title)}," Delete thread ",8,ky)])):se("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Ue=>H(J.id)},[m("span",gy,[m("span",vy,ce(J.title),1),J.hasWorktree?(w(),yt(Ao,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,my)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),yt($r,{key:1,as:"p",class:"project-empty-row"},{left:pt(()=>[...P[14]||(P[14]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:pt(()=>[P[15]||(P[15]=m("span",{class:"project-empty"},"No threads",-1))]),_:1})),Is(M)?(w(),yt($r,{key:2,class:"thread-show-more-row"},{left:pt(()=>[...P[16]||(P[16]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:pt(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:J=>Oe(M.projectName)},ce(rn(M.projectName)?"Show less":"Show more"),9,Ty)]),_:2},1024)):se("",!0)],12,Xv))),128))],4)),(w(),yt(Do,{to:"body"},[f.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:tt(he,["self"])},[m("div",Iy,[P[17]||(P[17]=m("h3",{class:"rename-thread-title"},"Rename thread",-1)),P[18]||(P[18]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),tr(m("input",{ref_key:"renameThreadInputRef",ref:N,"onUpdate:modelValue":P[8]||(P[8]=M=>b.value=M),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Yt(tt(Se,["prevent"]),["enter"]),Yt(tt(he,["prevent"]),["esc"])]},null,40,Sy),[[nr,b.value]]),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:he},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Se},"Save")])])])):se("",!0)])),(w(),yt(Do,{to:"body"},[I.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:tt(Ke,["self"])},[m("div",Ey,[P[19]||(P[19]=m("h3",{class:"rename-thread-title"},"Delete thread?",-1)),m("p",Cy,' This will archive the thread "'+ce(Y.value)+'". You can find it later in archived threads. ',1),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:Ke},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Pe},"Delete")])])])):se("",!0)]))]))}}),xy=st(Ry,[["__scopeId","data-v-e2f8a8e1"]]),Py={class:"content-header"},My={class:"content-leading"},Oy={class:"content-title"},Ny={class:"content-actions"},$y=Lt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),T("header",Py,[m("div",My,[Mn(t.$slots,"leading",{},void 0)]),m("h1",Oy,ce(e.title),1),m("div",Ny,[Mn(t.$slots,"actions",{},void 0)])]))}}),Dy=st($y,[["__scopeId","data-v-66ee223c"]]),Ly={},jy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function By(e,t){return w(),T("svg",jy,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Xa=st(Ly,[["render",By]]),Uy={},Fy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Hy(e,t){return w(),T("svg",Fy,[...t[0]||(t[0]=[m("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 Vy=st(Uy,[["render",Hy]]),Wy={},zy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function qy(e,t){return w(),T("svg",zy,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2zm-4 4a2 2 0 0 1-2-2V8m4 8h10"},null,-1)])])}const Gy=st(Wy,[["render",qy]]),Ky={class:"conversation-root"},Jy={key:0,class:"conversation-loading"},Yy={key:1,class:"conversation-empty"},Qy={class:"message-row"},Xy={class:"message-stack"},Zy={class:"request-card"},ew={class:"request-title"},tw={class:"request-meta"},nw={key:0,class:"request-reason"},rw={key:1,class:"request-actions"},sw=["onClick"],ow=["onClick"],iw=["onClick"],aw=["onClick"],lw={key:2,class:"request-actions"},cw=["onClick"],uw=["onClick"],dw=["onClick"],fw=["onClick"],hw={key:3,class:"request-user-input"},pw={class:"request-question-title"},mw={key:0,class:"request-question-text"},gw=["value","onChange"],vw=["value"],yw=["value","onInput"],ww=["onClick"],bw={key:4,class:"request-actions"},_w=["onClick"],kw=["onClick"],Tw={key:5,class:"request-actions"},Iw=["onClick"],Sw=["onClick"],Ew=["data-role","data-message-type"],Cw={key:0,class:"message-row","data-role":"system"},Aw={class:"message-stack","data-role":"system"},Rw=["onClick"],xw={class:"cmd-label"},Pw={class:"cmd-status"},Mw={class:"cmd-output-inner"},Ow={class:"cmd-output"},Nw=["data-role","data-message-type"],$w=["data-role"],Dw=["data-role"],Lw=["data-role"],jw=["onClick"],Bw=["src"],Uw={key:1,class:"message-file-attachments"},Fw=["href","title"],Hw=["data-role"],Vw={key:0,class:"worked-separator-wrap","aria-live":"polite"},Ww=["onClick"],zw={class:"worked-separator-text"},qw={key:0,class:"worked-details"},Gw=["onClick"],Kw={class:"cmd-label"},Jw={class:"cmd-status"},Yw={class:"cmd-output-inner"},Qw={class:"cmd-output"},Xw={key:1,class:"message-text-flow"},Zw={key:0,class:"message-text"},eb={key:0},tb={key:1,class:"message-bold-text"},nb=["href","title"],rb=["href","title"],sb={key:4,class:"message-inline-code"},ob={key:1,class:"message-text"},ib=["onClick"],ab=["src","alt","onError"],lb={key:0,class:"message-actions"},cb=["onClick"],ub=["onClick"],db={key:0,class:"conversation-item conversation-item-overlay"},fb={class:"message-row"},hb={class:"message-stack"},pb={class:"live-overlay-inline","aria-live":"polite"},mb={class:"live-overlay-label"},gb={key:1,class:"live-overlay-error"},vb=["src"],yb=16,wb=Lt({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=L(new Set),r=L(new Set),s=L(new Set),o=L({});function i(_){return _.messageType==="commandExecution"&&!!_.commandExecution}function a(_){var S;return((S=_.commandExecution)==null?void 0:S.status)==="inProgress"||r.value.has(_.id)?!0:n.value.has(_.id)}function l(_){return r.value.has(_.id)}function u(_){var E;if(((E=_.commandExecution)==null?void 0:E.status)==="inProgress")return;const S=new Set(n.value);S.has(_.id)?S.delete(_.id):S.add(_.id),n.value=S}function c(_){const S=new Set(s.value);S.has(_.id)?S.delete(_.id):S.add(_.id),s.value=S}function f(_){return s.value.has(_.id)}function h(_){const S=_.commandExecution;if(!S)return"";switch(S.status){case"inProgress":return"⟳ Running";case"completed":return S.exitCode===0?"✓ Completed":`✗ Exit ${S.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function b(_){var E,q;const S=(E=_.commandExecution)==null?void 0:E.status;return S==="inProgress"?"cmd-status-running":S==="completed"&&((q=_.commandExecution)==null?void 0:q.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function N(_){const S=new Set(r.value);S.add(_),r.value=S,setTimeout(()=>{const E=new Set(r.value);E.delete(_),r.value=E},1e3)}function I(_,S){const E=[];for(let q=S-1;q>=0;q--){const ge=_[q];if(ge.messageType==="commandExecution")E.unshift(ge);else if(ge.role==="user"||ge.messageType==="worked")break}return E}const O=e,Y=t,$=L(null),z=L(null),j=L(null),oe=L(""),de=L({}),ve=L({});let Ie=0,re=0,ee=0;const ye=new WeakSet,te=L(new Set);function je(_){if(!_||/\s/u.test(_)||_.endsWith("/")||_.endsWith("\\"))return!1;if(_.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(_))return!1;const S=_.startsWith("/"),E=/^[A-Za-z]:[\\/]/u.test(_),q=_.startsWith("./")||_.startsWith("../")||_.startsWith("~/"),ge=_.includes("/")||_.includes("\\");return S||E||q||ge}function Be(_){return _.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||_}function Qe(_){return _.replace(/\\/gu,"/")}function Re(_){if(!_.startsWith("file://"))return _;let S=_.replace(/^file:\/\//u,"");try{S=decodeURIComponent(S)}catch{}return/^\/[A-Za-z]:\//u.test(S)&&(S=S.slice(1)),S}function Te(_){const S=Qe(_),E=S.match(/^\/Users\/([^/]+)/u);if(E)return`/Users/${E[1]}`;const q=S.match(/^\/home\/([^/]+)/u);return q?`/home/${q[1]}`:""}function $e(_){const S=Qe(_);if(!S)return S;let E="",q=S;const ge=q.match(/^([A-Za-z]:)(\/.*)?$/u);ge?(E=`${ge[1]}/`,q=(ge[2]??"").replace(/^\/+/u,"")):q.startsWith("/")&&(E="/",q=q.slice(1));const le=q.split("/").filter(Boolean),Ae=[];for(const We of le)if(We!=="."){if(We===".."){Ae.length>0&&Ae.pop();continue}Ae.push(We)}const ke=Ae.join("/");return E?`${E}${ke}`.replace(/\/+$/u,"")||E:ke||S}function It(_,S){const E=Qe(Re(_.trim()));if(!E)return"";if(E.startsWith("/")||/^[A-Za-z]:\//u.test(E))return $e(E);if(E.startsWith("~/")){const le=Te(S);if(le)return $e(`${le}/${E.slice(2)}`)}const ge=Qe(S.trim());return $e(ge?`${ge.replace(/\/+$/u,"")}/${E}`:E)}function nt(_){if(!_)return null;let S=_.trim();S=Xe(S).core.trim();let q=null;const ge=S.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(ge)S=ge[1],q=Number(ge[2]);else{const le=S.match(/^(.*):(\d+)(?::\d+)?$/u);le&&(S=le[1],q=Number(le[2]))}return S=Re(S),je(S)?{path:S,line:q}:null}function Xe(_){let S=_,E="",q="";for(;/^[('"`[{<“‘]/u.test(S);)E+=S[0],S=S.slice(1);for(;/[)"'`\]}>”’]$/u.test(S);)q=S.slice(-1)+q,S=S.slice(0,-1);return{core:S,leading:E,trailing:q}}function Ze(_){const E=_.trim().match(/^\[([^\]\n]+)\]\(([^)\n]+)\)$/u);if(!E)return null;const q=(E[1]??"").trim(),ge=(E[2]??"").trim(),le=Xe(q).core.trim()||q,Ae=Xe(ge).core.trim();return Ae?{label:le,target:Ae}:null}function ht(_){const S=[],E=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let q=0;for(const ge of _.matchAll(E)){if(typeof ge.index!="number")continue;const le=ge.index,Ae=le+ge[0].length;le>q&&S.push({kind:"text",value:_.slice(q,le)});let ke=ge[0],We="";for(;/[.,;:]$/u.test(ke);)We=ke.slice(-1)+We,ke=ke.slice(0,-1);const at=Xe(ke);ke=at.core;const lt=at.leading,Pt=at.trailing+We;if(lt&&S.push({kind:"text",value:lt}),ke.startsWith("**")&&ke.endsWith("**")&&ke.length>4)S.push({kind:"bold",value:ke.slice(2,-2)}),Pt&&S.push({kind:"text",value:Pt});else if(/^https?:\/\//u.test(ke))S.push({kind:"url",value:ke,href:ke}),Pt&&S.push({kind:"text",value:Pt});else{const Mt=nt(ke);Mt?(S.push({kind:"file",value:ke,path:Mt.path,displayPath:ke,downloadName:Be(Mt.path)}),Pt&&S.push({kind:"text",value:Pt})):S.push({kind:"text",value:ge[0]})}q=Ae}return q<_.length&&S.push({kind:"text",value:_.slice(q)}),Rt(S)}function Rt(_){const S=[];let E=!1,q="";const ge=le=>{le&&S.push({kind:"text",value:le})};for(const le of _){if(le.kind!=="text"){E&&(ge(`**${q}`),E=!1,q=""),S.push(le);continue}let Ae=le.value;for(;Ae.length>0;){const ke=Ae.indexOf("**");if(ke<0){E?q+=Ae:ge(Ae);break}const We=Ae.slice(0,ke);E?q+=We:ge(We),Ae=Ae.slice(ke+2),E?(q.length>0?S.push({kind:"bold",value:q}):ge("****"),q="",E=!1):E=!0}}return E&&ge(`**${q}`),S}function Ge(_){const S=/\[([^\]\n]+)\]\(([^)\n]+)\)/gu,E=[];let q=0;for(const ge of _.matchAll(S)){if(typeof ge.index!="number")continue;const[le,Ae,ke]=ge,We=ge.index,at=We+le.length;We>q&&E.push(...ht(_.slice(q,We)));const lt=Ze(`[${Ae??""}](${ke??""})`),Pt=(lt==null?void 0:lt.label)??(Ae??"").trim(),Mt=(lt==null?void 0:lt.target)??(ke??"").trim();if(/^https?:\/\//u.test(Mt))E.push({kind:"url",value:Pt||Mt,href:Mt});else{const sn=nt(Mt);sn?E.push({kind:"file",value:Mt,path:sn.path,displayPath:Pt||Mt,downloadName:Be(sn.path)}):E.push({kind:"text",value:le})}q=at}return q<_.length&&E.push(...ht(_.slice(q))),E}function et(_){if(!_.includes("`"))return Ge(_);const S=[];let E=0,q=0;for(;E<_.length;){if(_[E]!=="`"){E+=1;continue}let ge=1;for(;E+ge<_.length&&_[E+ge]==="`";)ge+=1;const le="`".repeat(ge);let Ae=E+ge,ke=-1;for(;Ae<_.length;){const at=_.indexOf(le,Ae);if(at<0)break;const lt=at>0&&_[at-1]==="`",Pt=at+ge<_.length&&_[at+ge]==="`",Mt=_.slice(E+ge,at).includes(`
26
- `);if(!lt&&!Pt&&!Mt){ke=at;break}Ae=at+1}if(ke<0){E+=ge;continue}E>q&&S.push(...Ge(_.slice(q,E)));const We=_.slice(E+ge,ke);if(We.length>0){const at=Ze(We);if(at)if(/^https?:\/\//u.test(at.target))S.push({kind:"url",value:at.label||at.target,href:at.target});else{const lt=nt(at.target);lt?S.push({kind:"file",value:at.target,path:lt.path,displayPath:at.label||at.target,downloadName:Be(lt.path)}):S.push({kind:"code",value:We})}else{const lt=nt(We);if(lt){const Pt=lt.line?`${lt.path}:${String(lt.line)}`:lt.path;S.push({kind:"file",value:We,path:lt.path,displayPath:Pt,downloadName:Be(lt.path)})}else S.push({kind:"code",value:We})}}else S.push({kind:"text",value:`${le}${le}`});E=ke+ge,q=E}return q<_.length&&S.push(...Ge(_.slice(q))),S}function W(_){const S=_.trim();if(!S)return"";if(S.startsWith("data:")||S.startsWith("blob:")||S.startsWith("http://")||S.startsWith("https://")||S.startsWith("/codex-local-image?"))return S;if(S.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(S)}`;const E=S.startsWith("/"),q=/^[A-Za-z]:[\\/]/u.test(S);return E||q?`/codex-local-image?path=${encodeURIComponent(S)}`:S}function me(_){const S=_.trim();if(!S)return"#";const E=Ae=>Ae.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(Ae),q=nt(S),ge=(q==null?void 0:q.path)??S,le=It(ge,O.cwd);if(E(le)){const Ae=le.startsWith("/")?le:`/${le}`;return`/codex-local-browse${encodeURI(Ae)}`}return"#"}function ie(_){if(!_.includes("![")||!_.includes("]("))return[{kind:"text",value:_}];const S=[],E=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let q=0;for(const ge of _.matchAll(E)){const[le,Ae,ke]=ge;if(typeof ge.index!="number")continue;const We=ge.index,at=We+le.length,lt=W(ke.trim());lt&&(We>q&&S.push({kind:"text",value:_.slice(q,We)}),S.push({kind:"image",url:lt,alt:Ae.trim(),markdown:le}),q=at)}return q<_.length&&S.push({kind:"text",value:_.slice(q)}),S.length>0?S:[{kind:"text",value:_}]}function fe(_){return _!==null&&typeof _=="object"&&!Array.isArray(_)?_:null}function De(_){const S=new Date(_);return Number.isNaN(S.getTime())?_:S.toLocaleTimeString()}function g(_){const S=fe(_.params),E=S==null?void 0:S.reason;return typeof E=="string"?E.trim():""}function v(_,S){return`${String(_)}:${S}`}function A(_){const S=fe(_.params),E=Array.isArray(S==null?void 0:S.questions)?S.questions:[],q=[];for(const ge of E){const le=fe(ge);if(!le)continue;const Ae=typeof le.id=="string"?le.id:"";if(!Ae)continue;const ke=Array.isArray(le.options)?le.options.map(We=>fe(We)).map(We=>We==null?void 0:We.label).filter(We=>typeof We=="string"&&We.length>0):[];q.push({id:Ae,header:typeof le.header=="string"?le.header:"",question:typeof le.question=="string"?le.question:"",isOther:le.isOther===!0,options:ke})}return q}function H(_,S,E){const q=v(_,S),ge=de.value[q];return typeof ge=="string"&&ge.length>0?ge:E}function F(_,S){const E=v(_,S);return ve.value[E]??""}function x(_,S,E){const q=E.target;if(!(q instanceof HTMLSelectElement))return;const ge=v(_,S);de.value={...de.value,[ge]:q.value}}function D(_,S,E){const q=E.target;if(!(q instanceof HTMLInputElement))return;const ge=v(_,S);ve.value={...ve.value,[ge]:q.value}}function B(_,S){Y("respondServerRequest",{id:_,result:{decision:S}})}function G(_){const S=A(_),E={};for(const q of S){const ge=H(_.id,q.id,q.options[0]||""),le=F(_.id,q.id).trim(),Ae=[ge,le].map(ke=>ke.trim()).filter(ke=>ke.length>0);E[q.id]={answers:Ae}}Y("respondServerRequest",{id:_.id,result:{answers:E}})}function V(_){Y("respondServerRequest",{id:_,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function be(_){Y("respondServerRequest",{id:_,result:{success:!0,contentItems:[]}})}function ae(_){Y("respondServerRequest",{id:_,result:{}})}function he(_){Y("respondServerRequest",{id:_,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function Se(_){return!(_.role!=="user"&&_.role!=="assistant"||typeof _.turnIndex!="number"||O.isTurnInProgress||O.isRollingBack)}function Me(_){return _.role!=="user"&&_.role!=="assistant"?!1:_.text.trim().length>0}function Ke(_){return Me(_)||Se(_)}async function Pe(_){if(!Me(_))return;const S=_.text.trim();try{await navigator.clipboard.writeText(S)}catch{const E=document.createElement("textarea");E.value=S,E.setAttribute("readonly","true"),E.style.position="fixed",E.style.opacity="0",document.body.appendChild(E),E.select(),document.execCommand("copy"),document.body.removeChild(E)}}function Ve(_){Se(_)&&Y("rollback",{turnIndex:_.turnIndex})}function _t(){const _=$.value,S=z.value;!_||!S||(_.scrollTop=_.scrollHeight,S.scrollIntoView({block:"end"}))}function U(_){return _.scrollHeight-(_.scrollTop+_.clientHeight)<=yb}function K(_){if(!O.activeThreadId)return;const S=Math.max(_.scrollHeight-_.clientHeight,0),E=S>0?Math.min(Math.max(_.scrollTop/S,0),1):1;Y("updateScrollState",{threadId:O.activeThreadId,state:{scrollTop:_.scrollTop,isAtBottom:U(_),scrollRatio:E}})}function ne(){const _=$.value;if(!_)return;const S=O.scrollState;if(!S||S.isAtBottom){Je();return}const E=Math.max(_.scrollHeight-_.clientHeight,0),q=typeof S.scrollRatio=="number"?S.scrollRatio*E:S.scrollTop;_.scrollTop=Math.min(Math.max(q,0),E),K(_)}function Je(){const _=$.value;_&&(_t(),K(_))}function it(){const _=O.scrollState;return!_||_.isAtBottom===!0}function kt(){if(!it()){ee=0,re=0;return}if(Je(),ee-=1,ee<=0){re=0;return}re=requestAnimationFrame(kt)}function xt(_=6){it()&&(re&&(cancelAnimationFrame(re),re=0),ee=Math.max(_,1),re=requestAnimationFrame(kt))}function ln(){xt(3)}function Sr(){if(!it())return;const _=$.value;if(!_)return;const S=_.querySelectorAll("img.message-image-preview");for(const E of S)E.complete||ye.has(E)||(ye.add(E),E.addEventListener("load",ln,{once:!0}),E.addEventListener("error",ln,{once:!0}))}async function rn(){await tn(),Ie&&cancelAnimationFrame(Ie),Ie=requestAnimationFrame(()=>{Ie=0,ne(),Sr(),xt()})}mt(()=>O.messages,async _=>{if(!O.isLoading){for(const S of _){if(S.messageType!=="commandExecution"||!S.commandExecution)continue;const E=o.value[S.id],q=S.commandExecution.status;E==="inProgress"&&q!=="inProgress"&&N(S.id),o.value[S.id]=q}await rn()}}),mt(()=>O.liveOverlay,async _=>{_&&(await tn(),Je(),xt(8))},{deep:!0}),mt(()=>O.isLoading,async _=>{_||await rn()}),mt(()=>O.activeThreadId,()=>{oe.value="",te.value=new Set},{flush:"post"});function Ne(){const _=$.value;!_||O.isLoading||K(_)}function Oe(_){oe.value=W(_)}function fn(_,S){return`${_}:${String(S)}`}function jt(_,S){const E=new Set(te.value);E.add(fn(_,S)),te.value=E}function Er(_,S){return te.value.has(fn(_,S))}function _n(){oe.value=""}function kn(){const _=j.value;_&&(_.scrollTop=_.scrollHeight)}return mt(()=>{var _;return(_=O.liveOverlay)==null?void 0:_.reasoningText},async _=>{_&&(await tn(),kn())}),ar(()=>{Ie&&cancelAnimationFrame(Ie),re&&cancelAnimationFrame(re)}),(_,S)=>(w(),T("section",Ky,[e.isLoading?(w(),T("p",Jy,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),T("p",Yy," No messages in this thread yet. ")):(w(),T("ul",{key:2,ref_key:"conversationListRef",ref:$,class:"conversation-list",onScroll:Ne},[(w(!0),T(He,null,Et(e.pendingRequests,E=>(w(),T("li",{key:`server-request:${E.id}`,class:"conversation-item conversation-item-request"},[m("div",Qy,[m("div",Xy,[m("article",Zy,[m("p",ew,ce(E.method),1),m("p",tw,"Request #"+ce(E.id)+" · "+ce(De(E.receivedAtIso)),1),g(E)?(w(),T("p",nw,ce(g(E)),1)):se("",!0),E.method==="item/commandExecution/requestApproval"?(w(),T("section",rw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:q=>B(E.id,"accept")},"Accept",8,sw),m("button",{type:"button",class:"request-button",onClick:q=>B(E.id,"acceptForSession")},"Accept for Session",8,ow),m("button",{type:"button",class:"request-button",onClick:q=>B(E.id,"decline")},"Decline",8,iw),m("button",{type:"button",class:"request-button",onClick:q=>B(E.id,"cancel")},"Cancel",8,aw)])):E.method==="item/fileChange/requestApproval"?(w(),T("section",lw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:q=>B(E.id,"accept")},"Accept",8,cw),m("button",{type:"button",class:"request-button",onClick:q=>B(E.id,"acceptForSession")},"Accept for Session",8,uw),m("button",{type:"button",class:"request-button",onClick:q=>B(E.id,"decline")},"Decline",8,dw),m("button",{type:"button",class:"request-button",onClick:q=>B(E.id,"cancel")},"Cancel",8,fw)])):E.method==="item/tool/requestUserInput"?(w(),T("section",hw,[(w(!0),T(He,null,Et(A(E),q=>(w(),T("div",{key:`${E.id}:${q.id}`,class:"request-question"},[m("p",pw,ce(q.header||q.question),1),q.header&&q.question?(w(),T("p",mw,ce(q.question),1)):se("",!0),m("select",{class:"request-select",value:H(E.id,q.id,q.options[0]||""),onChange:ge=>x(E.id,q.id,ge)},[(w(!0),T(He,null,Et(q.options,ge=>(w(),T("option",{key:`${E.id}:${q.id}:${ge}`,value:ge},ce(ge),9,vw))),128))],40,gw),q.isOther?(w(),T("input",{key:1,class:"request-input",type:"text",value:F(E.id,q.id),placeholder:"Other answer",onInput:ge=>D(E.id,q.id,ge)},null,40,yw)):se("",!0)]))),128)),m("button",{type:"button",class:"request-button request-button-primary",onClick:q=>G(E)}," Submit Answers ",8,ww)])):E.method==="item/tool/call"?(w(),T("section",bw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:q=>V(E.id)},"Fail Tool Call",8,_w),m("button",{type:"button",class:"request-button",onClick:q=>be(E.id)},"Success (Empty)",8,kw)])):(w(),T("section",Tw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:q=>ae(E.id)},"Return Empty Result",8,Iw),m("button",{type:"button",class:"request-button",onClick:q=>he(E.id)},"Reject Request",8,Sw)]))])])])]))),128)),(w(!0),T(He,null,Et(e.messages,E=>{var q,ge;return w(),T("li",{key:E.id,class:gt(["conversation-item",{"conversation-item-actionable":Ke(E)}]),"data-role":E.role,"data-message-type":E.messageType||""},[i(E)?(w(),T("div",Cw,[m("div",Aw,[m("button",{type:"button",class:gt(["cmd-row",[b(E),{"cmd-expanded":a(E)}]]),onClick:le=>u(E)},[m("span",{class:gt(["cmd-chevron",{"cmd-chevron-open":a(E)}])},"▶",2),m("code",xw,ce(((q=E.commandExecution)==null?void 0:q.command)||"(command)"),1),m("span",Pw,ce(h(E)),1)],10,Rw),m("div",{class:gt(["cmd-output-wrap",{"cmd-output-visible":a(E),"cmd-output-collapsing":l(E)}])},[m("div",Mw,[m("pre",Ow,ce(((ge=E.commandExecution)==null?void 0:ge.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),T("div",{key:1,class:"message-row","data-role":E.role,"data-message-type":E.messageType||""},[m("div",{class:"message-stack","data-role":E.role},[m("article",{class:"message-body","data-role":E.role},[E.images&&E.images.length>0?(w(),T("ul",{key:0,class:"message-image-list","data-role":E.role},[(w(!0),T(He,null,Et(E.images,le=>(w(),T("li",{key:le,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:Ae=>Oe(le)},[m("img",{class:"message-image-preview",src:W(le),alt:"Message image preview",loading:"lazy"},null,8,Bw)],8,jw)]))),128))],8,Lw)):se("",!0),E.fileAttachments&&E.fileAttachments.length>0?(w(),T("div",Uw,[(w(!0),T(He,null,Et(E.fileAttachments,le=>(w(),T("span",{key:le.path,class:"message-file-chip"},[S[1]||(S[1]=m("span",{class:"message-file-chip-icon"},"📄",-1)),m("a",{class:"message-file-link message-file-chip-name",href:me(le.path),target:"_blank",rel:"noopener noreferrer",title:le.path},ce(le.path),9,Fw)]))),128))])):se("",!0),E.text.length>0?(w(),T("article",{key:2,class:"message-card","data-role":E.role},[E.messageType==="worked"?(w(),T("div",Vw,[m("button",{type:"button",class:"worked-separator",onClick:le=>c(E)},[S[2]||(S[2]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),m("span",{class:gt(["worked-chevron",{"worked-chevron-open":f(E)}])},"▶",2),m("p",zw,ce(E.text),1),S[3]||(S[3]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Ww),f(E)?(w(),T("div",qw,[(w(!0),T(He,null,Et(I(e.messages,e.messages.indexOf(E)),le=>{var Ae,ke;return w(),T("div",{key:`worked-cmd-${le.id}`,class:"worked-cmd-item"},[m("button",{type:"button",class:gt(["cmd-row",[b(le),{"cmd-expanded":a(le)}]]),onClick:We=>u(le)},[m("span",{class:gt(["cmd-chevron",{"cmd-chevron-open":a(le)}])},"▶",2),m("code",Kw,ce(((Ae=le.commandExecution)==null?void 0:Ae.command)||"(command)"),1),m("span",Jw,ce(h(le)),1)],10,Gw),m("div",{class:gt(["cmd-output-wrap",{"cmd-output-visible":a(le),"cmd-output-collapsing":l(le)}])},[m("div",Yw,[m("pre",Qw,ce(((ke=le.commandExecution)==null?void 0:ke.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):se("",!0)])):(w(),T("div",Xw,[(w(!0),T(He,null,Et(ie(E.text),(le,Ae)=>(w(),T(He,{key:`block-${Ae}`},[le.kind==="text"?(w(),T("p",Zw,[(w(!0),T(He,null,Et(et(le.value),(ke,We)=>(w(),T(He,{key:`seg-${Ae}-${We}`},[ke.kind==="text"?(w(),T("span",eb,ce(ke.value),1)):ke.kind==="bold"?(w(),T("strong",tb,ce(ke.value),1)):ke.kind==="file"?(w(),T("a",{key:2,class:"message-file-link",href:me(ke.path),target:"_blank",rel:"noopener noreferrer",title:ke.path},ce(ke.displayPath),9,nb)):ke.kind==="url"?(w(),T("a",{key:3,class:"message-file-link",href:ke.href,target:"_blank",rel:"noopener noreferrer",title:ke.href},ce(ke.value),9,rb)):(w(),T("code",sb,ce(ke.value),1))],64))),128))])):Er(E.id,Ae)?(w(),T("p",ob,ce(le.markdown),1)):(w(),T("button",{key:2,class:"message-image-button",type:"button",onClick:ke=>Oe(le.url)},[m("img",{class:"message-image-preview message-markdown-image",src:le.url,alt:le.alt||"Embedded message image",loading:"lazy",onError:ke=>jt(E.id,Ae)},null,40,ab)],8,ib))],64))),128))]))],8,Hw)):se("",!0)],8,Dw),Ke(E)?(w(),T("div",lb,[Me(E)?(w(),T("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:le=>Pe(E)},[Ce(Gy,{class:"message-action-icon"}),S[4]||(S[4]=m("span",{class:"message-action-label"},"Copy",-1))],8,cb)):se("",!0),Se(E)?(w(),T("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:le=>Ve(E)},[Ce(Vy,{class:"message-action-icon"}),S[5]||(S[5]=m("span",{class:"message-action-label"},"Rollback",-1))],8,ub)):se("",!0)])):se("",!0)],8,$w)],8,Nw))],10,Ew)}),128)),e.liveOverlay?(w(),T("li",db,[m("div",fb,[m("div",hb,[m("article",pb,[m("p",mb,ce(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),T("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:j},ce(e.liveOverlay.reasoningText),513)):se("",!0),e.liveOverlay.errorText?(w(),T("p",gb,ce(e.liveOverlay.errorText),1)):se("",!0)])])])])):se("",!0),m("li",{ref_key:"bottomAnchorRef",ref:z,class:"conversation-bottom-anchor"},null,512)],544)),oe.value.length>0?(w(),T("div",{key:3,class:"image-modal-backdrop",onClick:_n},[m("div",{class:"image-modal-content",onClick:S[0]||(S[0]=tt(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:_n},[Ce(Xa,{class:"icon-svg"})]),m("img",{class:"image-modal-image",src:oe.value,alt:"Expanded message image"},null,8,vb)])])):se("",!0)]))}}),bb=st(wb,[["__scopeId","data-v-b2208f01"]]);function _b(e){var c;const t=L("idle"),n=L(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=h=>{h.data.size>0&&o.push(h.data)},r.onstop=()=>{var N;const h=o,b=(r==null?void 0:r.mimeType)||((N=h[0])==null?void 0:N.type)||"audio/webm";u(),t.value="idle",l(h,b)},r.start(),t.value="recording"}catch(h){u(),(f=e.onError)==null||f.call(e,h)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,h){var N;if(f.length===0)return;const b=new Blob(f,{type:h});try{const I=h.split(/[/;]/)[1]??"webm",O=`----codex-transcribe-${crypto.randomUUID()}`,Y=new Uint8Array(await b.arrayBuffer()),$=new TextEncoder,z=[];z.push($.encode(`--${O}\r
27
- `)),z.push($.encode(`Content-Disposition: form-data; name="file"; filename="codex.${I}"\r
28
- `)),z.push($.encode(`Content-Type: ${h}\r
25
+ */let ag=()=>location.protocol+"//"+location.host;function qd(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),lc(a,"")}return lc(n,e)+r+s}function lg(e,t,n,r){let s=[],o=[],i=null;const a=({state:h})=>{const b=qd(e,location),N=n.value,I=t.value;let O=0;if(h){if(n.value=b,t.value=h,i&&i===N){i=null;return}O=I?h.position-I.position:0}else r(b);s.forEach(Y=>{Y(n.value,N,{delta:O,type:fa.pop,direction:O?O>0?xi.forward:xi.back:xi.unknown})})};function l(){i=n.value}function u(h){s.push(h);const b=()=>{const N=s.indexOf(h);N>-1&&s.splice(N,1)};return o.push(b),b}function c(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(ct({},h.state,{scroll:li()}),"")}}function f(){for(const h of o)h();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:u,destroy:f}}function hc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?li():null}}function cg(e){const{history:t,location:n}=window,r={value:qd(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,u,c){const f=e.indexOf("#"),h=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:ag()+e+l;try{t[c?"replaceState":"pushState"](u,"",h),s.value=u}catch(b){console.error(b),n[c?"replace":"assign"](h)}}function i(l,u){o(l,ct({},t.state,hc(s.value.back,l,s.value.forward,!0),u,{position:s.value.position}),!0),r.value=l}function a(l,u){const c=ct({},s.value,t.state,{forward:l,scroll:li()});o(c.current,c,!0),o(l,ct({},hc(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function ug(e){e=Gm(e);const t=cg(e),n=lg(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=ct({location:"",base:e,go:r,createHref:Jm.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 dg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),ug(e)}let Ur=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Nt=(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})(Nt||{});const fg={type:Ur.Static,value:""},hg=/[a-zA-Z0-9_]/;function pg(e){if(!e)return[[]];if(e==="/")return[[fg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(b){throw new Error(`ERR (${n})/"${u}": ${b}`)}let n=Nt.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,u="",c="";function f(){u&&(n===Nt.Static?o.push({type:Ur.Static,value:u}):n===Nt.Param||n===Nt.ParamRegExp||n===Nt.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Ur.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function h(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Nt.ParamRegExp){r=n,n=Nt.EscapeNext;continue}switch(n){case Nt.Static:l==="/"?(u&&f(),i()):l===":"?(f(),n=Nt.Param):h();break;case Nt.EscapeNext:h(),n=r;break;case Nt.Param:l==="("?n=Nt.ParamRegExp:hg.test(l)?h():(f(),n=Nt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Nt.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=Nt.ParamRegExpEnd:c+=l;break;case Nt.ParamRegExpEnd:f(),n=Nt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Nt.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),i(),s}const pc="[^/]+?",mg={sensitive:!1,strict:!1,start:!0,end:!0};var Jt=(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})(Jt||{});const gg=/[.+*?^${}()[\]/\\]/g;function vg(e,t){const n=ct({},mg,t),r=[];let s=n.start?"^":"";const o=[];for(const u of e){const c=u.length?[]:[Jt.Root];n.strict&&!u.length&&(s+="/");for(let f=0;f<u.length;f++){const h=u[f];let b=Jt.Segment+(n.sensitive?Jt.BonusCaseSensitive:0);if(h.type===Ur.Static)f||(s+="/"),s+=h.value.replace(gg,"\\$&"),b+=Jt.Static;else if(h.type===Ur.Param){const{value:N,repeatable:I,optional:O,regexp:Y}=h;o.push({name:N,repeatable:I,optional:O});const $=Y||pc;if($!==pc){b+=Jt.BonusCustomRegExp;try{`${$}`}catch(j){throw new Error(`Invalid custom RegExp for param "${N}" (${$}): `+j.message)}}let q=I?`((?:${$})(?:/(?:${$}))*)`:`(${$})`;f||(q=O&&u.length<2?`(?:/${q})`:"/"+q),O&&(q+="?"),s+=q,b+=Jt.Dynamic,O&&(b+=Jt.BonusOptional),I&&(b+=Jt.BonusRepeatable),$===".*"&&(b+=Jt.BonusWildcard)}c.push(b)}r.push(c)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=Jt.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(u){const c=u.match(i),f={};if(!c)return null;for(let h=1;h<c.length;h++){const b=c[h]||"",N=o[h-1];f[N.name]=b&&N.repeatable?b.split("/"):b}return f}function l(u){let c="",f=!1;for(const h of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const b of h)if(b.type===Ur.Static)c+=b.value;else if(b.type===Ur.Param){const{value:N,repeatable:I,optional:O}=b,Y=N in u?u[N]:"";if(bn(Y)&&!I)throw new Error(`Provided param "${N}" is an array but it is not repeatable (* or + modifiers)`);const $=bn(Y)?Y.join("/"):Y;if(!$)if(O)h.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${N}"`);c+=$}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function yg(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]===Jt.Static+Jt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Jt.Static+Jt.Segment?1:-1:0}function zd(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=yg(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(mc(r))return 1;if(mc(s))return-1}return s.length-r.length}function mc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const wg={strict:!1,end:!0,sensitive:!1};function bg(e,t,n){const r=vg(pg(e.path),n),s=ct(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function _g(e,t){const n=[],r=new Map;t=ac(wg,t);function s(f){return r.get(f)}function o(f,h,b){const N=!b,I=vc(f);I.aliasOf=b&&b.record;const O=ac(t,f),Y=[I];if("alias"in f){const j=typeof f.alias=="string"?[f.alias]:f.alias;for(const oe of j)Y.push(vc(ct({},I,{components:b?b.record.components:I.components,path:oe,aliasOf:b?b.record:I})))}let $,q;for(const j of Y){const{path:oe}=j;if(h&&oe[0]!=="/"){const de=h.record.path,ve=de[de.length-1]==="/"?"":"/";j.path=h.record.path+(oe&&ve+oe)}if($=bg(j,h,O),b?b.alias.push($):(q=q||$,q!==$&&q.alias.push($),N&&f.name&&!yc($)&&i(f.name)),Gd($)&&l($),I.children){const de=I.children;for(let ve=0;ve<de.length;ve++)o(de[ve],$,b&&b.children[ve])}b=b||$}return q?()=>{i(q)}:Fs}function i(f){if(Vd(f)){const h=r.get(f);h&&(r.delete(f),n.splice(n.indexOf(h),1),h.children.forEach(i),h.alias.forEach(i))}else{const h=n.indexOf(f);h>-1&&(n.splice(h,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 h=Ig(f,n);n.splice(h,0,f),f.record.name&&!yc(f)&&r.set(f.record.name,f)}function u(f,h){let b,N={},I,O;if("name"in f&&f.name){if(b=r.get(f.name),!b)throw ps(At.MATCHER_NOT_FOUND,{location:f});O=b.record.name,N=ct(gc(h.params,b.keys.filter(q=>!q.optional).concat(b.parent?b.parent.keys.filter(q=>q.optional):[]).map(q=>q.name)),f.params&&gc(f.params,b.keys.map(q=>q.name))),I=b.stringify(N)}else if(f.path!=null)I=f.path,b=n.find(q=>q.re.test(I)),b&&(N=b.parse(I),O=b.record.name);else{if(b=h.name?r.get(h.name):n.find(q=>q.re.test(h.path)),!b)throw ps(At.MATCHER_NOT_FOUND,{location:f,currentLocation:h});O=b.record.name,N=ct({},h.params,f.params),I=b.stringify(N)}const Y=[];let $=b;for(;$;)Y.unshift($.record),$=$.parent;return{name:O,path:I,params:N,matched:Y,meta:Tg(Y)}}e.forEach(f=>o(f));function c(){n.length=0,r.clear()}return{addRoute:o,resolve:u,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function gc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function vc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:kg(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 kg(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 yc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Tg(e){return e.reduce((t,n)=>ct(t,n.meta),{})}function Ig(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;zd(e,t[o])<0?r=o:n=o+1}const s=Sg(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Sg(e){let t=e;for(;t=t.parent;)if(Gd(t)&&zd(e,t)===0)return t}function Gd({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function wc(e){const t=mn(ci),n=mn(Ya),r=pe(()=>{const l=ue(e.to);return t.resolve(l)}),s=pe(()=>{const{matched:l}=r.value,{length:u}=l,c=l[u-1],f=n.matched;if(!c||!f.length)return-1;const h=f.findIndex(hs.bind(null,c));if(h>-1)return h;const b=bc(l[u-2]);return u>1&&bc(c)===b&&f[f.length-1].path!==b?f.findIndex(hs.bind(null,l[u-2])):h}),o=pe(()=>s.value>-1&&Pg(n.params,r.value.params)),i=pe(()=>s.value>-1&&s.value===n.matched.length-1&&Hd(n.params,r.value.params));function a(l={}){if(Rg(l)){const u=t[ue(e.replace)?"replace":"push"](ue(e.to)).catch(Fs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:pe(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Eg(e){return e.length===1?e[0]:e}const Cg=Lt({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:wc,setup(e,{slots:t}){const n=ei(wc(e)),{options:r}=mn(ci),s=pe(()=>({[_c(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[_c(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Eg(t.default(n));return e.custom?o:Ka("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Ag=Cg;function Rg(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 Pg(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(!bn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function bc(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const _c=(e,t,n)=>e??t??n,xg=Lt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=mn(pa),s=pe(()=>e.route||r.value),o=mn(fc,0),i=pe(()=>{let u=ue(o);const{matched:c}=s.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),a=pe(()=>s.value.matched[i.value]);Io(fc,pe(()=>i.value+1)),Io(og,a),Io(pa,s);const l=L();return pt(()=>[l.value,a.value,e.name],([u,c,f],[h,b,N])=>{c&&(c.instances[f]=u,b&&b!==c&&u&&u===h&&(c.leaveGuards.size||(c.leaveGuards=b.leaveGuards),c.updateGuards.size||(c.updateGuards=b.updateGuards))),u&&c&&(!b||!hs(c,b)||!h)&&(c.enterCallbacks[f]||[]).forEach(I=>I(u))},{flush:"post"}),()=>{const u=s.value,c=e.name,f=a.value,h=f&&f.components[c];if(!h)return kc(n.default,{Component:h,route:u});const b=f.props[c],N=b?b===!0?u.params:typeof b=="function"?b(u):b:null,O=Ka(h,ct({},N,t,{onVnodeUnmounted:Y=>{Y.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return kc(n.default,{Component:O,route:u})||O}}});function kc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Mg=xg;function Og(e){const t=_g(e.routes,e),n=e.parseQuery||rg,r=e.stringifyQuery||dc,s=e.history,o=Ps(),i=Ps(),a=Ps(),l=Mh(ur);let u=ur;ns&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Ri.bind(null,W=>""+W),f=Ri.bind(null,Um),h=Ri.bind(null,Xs);function b(W,me){let ie,fe;return Vd(W)?(ie=t.getRecordMatcher(W),fe=me):fe=W,t.addRoute(fe,ie)}function N(W){const me=t.getRecordMatcher(W);me&&t.removeRoute(me)}function I(){return t.getRoutes().map(W=>W.record)}function O(W){return!!t.getRecordMatcher(W)}function Y(W,me){if(me=ct({},me||l.value),typeof W=="string"){const A=Pi(n,W,me.path),H=t.resolve({path:A.path},me),F=s.createHref(A.fullPath);return ct(A,H,{params:h(H.params),hash:Xs(A.hash),redirectedFrom:void 0,href:F})}let ie;if(W.path!=null)ie=ct({},W,{path:Pi(n,W.path,me.path).path});else{const A=ct({},W.params);for(const H in A)A[H]==null&&delete A[H];ie=ct({},W,{params:f(A)}),me.params=f(me.params)}const fe=t.resolve(ie,me),De=W.hash||"";fe.params=c(h(fe.params));const g=Vm(r,ct({},W,{hash:Lm(De),path:fe.path})),v=s.createHref(g);return ct({fullPath:g,hash:De,query:r===dc?sg(W.query):W.query||{}},fe,{redirectedFrom:void 0,href:v})}function $(W){return typeof W=="string"?Pi(n,W,l.value.path):ct({},W)}function q(W,me){if(u!==W)return ps(At.NAVIGATION_CANCELLED,{from:me,to:W})}function j(W){return ve(W)}function oe(W){return j(ct($(W),{replace:!0}))}function de(W,me){const ie=W.matched[W.matched.length-1];if(ie&&ie.redirect){const{redirect:fe}=ie;let De=typeof fe=="function"?fe(W,me):fe;return typeof De=="string"&&(De=De.includes("?")||De.includes("#")?De=$(De):{path:De},De.params={}),ct({query:W.query,hash:W.hash,params:De.path!=null?{}:W.params},De)}}function ve(W,me){const ie=u=Y(W),fe=l.value,De=W.state,g=W.force,v=W.replace===!0,A=de(ie,fe);if(A)return ve(ct($(A),{state:typeof A=="object"?ct({},De,A.state):De,force:g,replace:v}),me||ie);const H=ie;H.redirectedFrom=me;let F;return!g&&Wm(r,fe,ie)&&(F=ps(At.NAVIGATION_DUPLICATED,{to:H,from:fe}),Qe(fe,fe,!0,!1)),(F?Promise.resolve(F):ee(H,fe)).catch(P=>Vn(P)?Vn(P,At.NAVIGATION_GUARD_REDIRECT)?P:nt(P):$e(P,H,fe)).then(P=>{if(P){if(Vn(P,At.NAVIGATION_GUARD_REDIRECT))return ve(ct({replace:v},$(P.to),{state:typeof P.to=="object"?ct({},De,P.to.state):De,force:g}),me||H)}else P=te(H,fe,!0,v,De);return ye(H,fe,P),P})}function Ie(W,me){const ie=q(W,me);return ie?Promise.reject(ie):Promise.resolve()}function re(W){const me=Rt.values().next().value;return me&&typeof me.runWithContext=="function"?me.runWithContext(W):W()}function ee(W,me){let ie;const[fe,De,g]=ig(W,me);ie=Mi(fe.reverse(),"beforeRouteLeave",W,me);for(const A of fe)A.leaveGuards.forEach(H=>{ie.push(pr(H,W,me))});const v=Ie.bind(null,W,me);return ie.push(v),et(ie).then(()=>{ie=[];for(const A of o.list())ie.push(pr(A,W,me));return ie.push(v),et(ie)}).then(()=>{ie=Mi(De,"beforeRouteUpdate",W,me);for(const A of De)A.updateGuards.forEach(H=>{ie.push(pr(H,W,me))});return ie.push(v),et(ie)}).then(()=>{ie=[];for(const A of g)if(A.beforeEnter)if(bn(A.beforeEnter))for(const H of A.beforeEnter)ie.push(pr(H,W,me));else ie.push(pr(A.beforeEnter,W,me));return ie.push(v),et(ie)}).then(()=>(W.matched.forEach(A=>A.enterCallbacks={}),ie=Mi(g,"beforeRouteEnter",W,me,re),ie.push(v),et(ie))).then(()=>{ie=[];for(const A of i.list())ie.push(pr(A,W,me));return ie.push(v),et(ie)}).catch(A=>Vn(A,At.NAVIGATION_CANCELLED)?A:Promise.reject(A))}function ye(W,me,ie){a.list().forEach(fe=>re(()=>fe(W,me,ie)))}function te(W,me,ie,fe,De){const g=q(W,me);if(g)return g;const v=me===ur,A=ns?history.state:{};ie&&(fe||v?s.replace(W.fullPath,ct({scroll:v&&A&&A.scroll},De)):s.push(W.fullPath,De)),l.value=W,Qe(W,me,ie,v),nt()}let je;function Be(){je||(je=s.listen((W,me,ie)=>{if(!Ge.listening)return;const fe=Y(W),De=de(fe,Ge.currentRoute.value);if(De){ve(ct(De,{replace:!0,force:!0}),fe).catch(Fs);return}u=fe;const g=l.value;ns&&Xm(uc(g.fullPath,ie.delta),li()),ee(fe,g).catch(v=>Vn(v,At.NAVIGATION_ABORTED|At.NAVIGATION_CANCELLED)?v:Vn(v,At.NAVIGATION_GUARD_REDIRECT)?(ve(ct($(v.to),{force:!0}),fe).then(A=>{Vn(A,At.NAVIGATION_ABORTED|At.NAVIGATION_DUPLICATED)&&!ie.delta&&ie.type===fa.pop&&s.go(-1,!1)}).catch(Fs),Promise.reject()):(ie.delta&&s.go(-ie.delta,!1),$e(v,fe,g))).then(v=>{v=v||te(fe,g,!1),v&&(ie.delta&&!Vn(v,At.NAVIGATION_CANCELLED)?s.go(-ie.delta,!1):ie.type===fa.pop&&Vn(v,At.NAVIGATION_ABORTED|At.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ye(fe,g,v)}).catch(Fs)}))}let Ye=Ps(),Re=Ps(),Te;function $e(W,me,ie){nt(W);const fe=Re.list();return fe.length?fe.forEach(De=>De(W,me,ie)):console.error(W),Promise.reject(W)}function Tt(){return Te&&l.value!==ur?Promise.resolve():new Promise((W,me)=>{Ye.add([W,me])})}function nt(W){return Te||(Te=!W,Be(),Ye.list().forEach(([me,ie])=>W?ie(W):me()),Ye.reset()),W}function Qe(W,me,ie,fe){const{scrollBehavior:De}=e;if(!ns||!De)return Promise.resolve();const g=!ie&&Zm(uc(W.fullPath,0))||(fe||!ie)&&history.state&&history.state.scroll||null;return tn().then(()=>De(W,me,g)).then(v=>v&&Qm(v)).catch(v=>$e(v,W,me))}const Xe=W=>s.go(W);let ft;const Rt=new Set,Ge={currentRoute:l,listening:!0,addRoute:b,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:O,getRoutes:I,resolve:Y,options:e,push:j,replace:oe,go:Xe,back:()=>Xe(-1),forward:()=>Xe(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Re.add,isReady:Tt,install(W){W.component("RouterLink",Ag),W.component("RouterView",Mg),W.config.globalProperties.$router=Ge,Object.defineProperty(W.config.globalProperties,"$route",{enumerable:!0,get:()=>ue(l)}),ns&&!ft&&l.value===ur&&(ft=!0,j(s.location).catch(fe=>{}));const me={};for(const fe in ur)Object.defineProperty(me,fe,{get:()=>l.value[fe],enumerable:!0});W.provide(ci,Ge),W.provide(Ya,Vu(me)),W.provide(pa,l);const ie=W.unmount;Rt.add(W),W.unmount=function(){Rt.delete(W),Rt.size<1&&(u=ur,je&&je(),je=null,l.value=ur,ft=!1,Te=!1),ie()}}};function et(W){return W.reduce((me,ie)=>me.then(()=>re(ie)),Promise.resolve())}return Ge}function Ng(){return mn(ci)}function $g(e){return mn(Ya)}const Tc=768;function Kd(){const e=L(typeof window<"u"?window.innerWidth<Tc:!1);let t=null;function n(r){e.value=r.matches}return or(()=>{t=window.matchMedia(`(max-width: ${Tc-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),si(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Dg={key:0,class:"desktop-sidebar"},Lg={class:"desktop-main"},Ic="codex-web-local.sidebar-width.v1",jg=260,Bg=620,Sc=320,Ug=Lt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Kd();function r(u){return Math.min(Bg,Math.max(jg,u))}function s(){if(typeof window>"u")return Sc;const u=window.localStorage.getItem(Ic),c=Number(u);return Number.isFinite(c)?r(c):Sc}const o=L(s()),i=pe(()=>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(u){typeof window>"u"||window.localStorage.setItem(Ic,String(u))}function l(u){u.preventDefault();const c=u.clientX,f=o.value,h=N=>{const I=N.clientX-c;o.value=r(f+I)},b=()=>{a(o.value),window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",b)};window.addEventListener("mousemove",h),window.addEventListener("mouseup",b)}return(u,c)=>(w(),T("div",{class:mt(["desktop-layout",{"is-mobile":ue(n)}]),style:qr(i.value)},[ue(n)?(w(),gt(Do,{key:0,to:"body"},[Ce($d,{name:"drawer"},{default:ht(()=>[e.isSidebarCollapsed?se("",!0):(w(),T("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=f=>u.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=tt(()=>{},["stop"]))},[Mn(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):se("",!0),ue(n)?se("",!0):(w(),T(He,{key:1},[e.isSidebarCollapsed?se("",!0):(w(),T("aside",Dg,[Mn(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?se("",!0):(w(),T("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),m("section",Lg,[Mn(u.$slots,"content",{},void 0)])],6))}}),rt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Fg=rt(Ug,[["__scopeId","data-v-df29c633"]]),Hg={},Vg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Wg(e,t){return w(),T("svg",Vg,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const ui=rt(Hg,[["render",Wg]]),qg={},zg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Gg(e,t){return w(),T("svg",zg,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const Jd=rt(qg,[["render",Gg]]),Kg={},Jg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Yg(e,t){return w(),T("svg",Jg,[...t[0]||(t[0]=[m("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 xs=rt(Kg,[["render",Yg]]),Qg={},Xg={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Zg(e,t){return w(),T("svg",Xg,[...t[0]||(t[0]=[m("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 Fo=rt(Qg,[["render",Zg]]),ev={},tv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function nv(e,t){return w(),T("svg",tv,[...t[0]||(t[0]=[m("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 Yd=rt(ev,[["render",nv]]),rv={},sv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ov(e,t){return w(),T("svg",sv,[...t[0]||(t[0]=[m("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 iv=rt(rv,[["render",ov]]),av={},lv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function cv(e,t){return w(),T("svg",lv,[...t[0]||(t[0]=[m("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 Ao=rt(av,[["render",cv]]),uv={},dv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function fv(e,t){return w(),T("svg",dv,[...t[0]||(t[0]=[m("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 Oi=rt(uv,[["render",fv]]),hv={key:0,class:"sidebar-menu-row-left"},pv={class:"sidebar-menu-row-main"},mv={key:1,class:"sidebar-menu-row-right"},gv={key:0,class:"sidebar-menu-row-right-default"},vv={key:1,class:"sidebar-menu-row-right-hover"},yv=Lt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=lp(),r=pe(()=>!!n.left),s=pe(()=>!!n.right),o=pe(()=>!!n["right-hover"]),i=pe(()=>s.value||o.value);return(a,l)=>(w(),gt(ra(t.as),Rd({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:ht(()=>[r.value?(w(),T("span",hv,[Mn(a.$slots,"left",{},void 0,!0)])):se("",!0),m("span",pv,[Mn(a.$slots,"default",{},void 0,!0)]),i.value?(w(),T("span",mv,[s.value?(w(),T("span",gv,[Mn(a.$slots,"right",{},void 0,!0)])):se("",!0),o.value?(w(),T("span",vv,[Mn(a.$slots,"right-hover",{},void 0,!0)])):se("",!0)])):se("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),$r=rt(yv,[["__scopeId","data-v-daeca4df"]]),wv={class:"thread-tree-root"},bv={key:0,class:"pinned-section"},_v={class:"thread-list"},kv={class:"thread-left-stack"},Tv=["data-state"],Iv=["onClick"],Sv=["onClick"],Ev={class:"thread-row-title-wrap"},Cv={class:"thread-row-title"},Av={class:"thread-row-time"},Rv=["onClick"],Pv=["onClick"],xv=["onClick"],Mv=["onClick"],Ov=["aria-expanded"],Nv=["data-active"],$v={key:0},Dv=["data-active"],Lv={key:0},jv={key:1,class:"thread-tree-no-results"},Bv={key:2,class:"thread-tree-loading"},Uv={key:3,class:"thread-list thread-list-global"},Fv={class:"thread-left-stack"},Hv=["data-state"],Vv=["onClick"],Wv=["onClick"],qv={class:"thread-row-title-wrap"},zv={class:"thread-row-title"},Gv={class:"thread-row-time"},Kv=["onClick"],Jv=["onClick"],Yv=["onClick"],Qv=["onClick"],Xv=["data-project-name","data-expanded","data-dragging"],Zv={class:"project-icon-stack"},ey={class:"project-icon-folder"},ty={class:"project-icon-chevron"},ny=["data-dragging-handle","onMousedown"],ry={class:"project-title"},sy={class:"project-hover-controls"},oy=["onClick"],iy=["onClick"],ay=["onClick"],ly=["onClick"],cy=["onInput"],uy=["aria-label","title","onClick"],dy={key:0,class:"thread-list"},fy={class:"thread-left-stack"},hy=["data-state"],py=["onClick"],my=["onClick"],gy={class:"thread-row-title-wrap"},vy={class:"thread-row-title"},yy={class:"thread-row-time"},wy=["onClick"],by=["onClick"],_y=["onClick"],ky=["onClick"],Ty=["onClick"],Iy={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Sy=["onKeydown"],Ey={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},Cy={class:"rename-thread-subtitle"},Ay=4,Ec=6,Cc="codex-web-local.thread-view-mode.v1",Ac="codex-web-local.collapsed-projects.v1",Ry=Lt({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project","export-thread"],setup(e,{emit:t}){const n=e,r=t,s=L({}),o=L({}),i=L([]),a=L(""),l=L(""),u=L("actions"),c=L(""),f=L(!1),h=L(""),b=L(""),N=L(null),I=L(!1),O=L(""),Y=L(""),$=L(null),q=L(null),j=L(null);let oe=null,de=null;const ve=L(""),Ie=L({}),re=new Map,ee=new Map,ye=new Map,te=new WeakMap,je=L(null),Be=L(!1),Ye=L($e()),Re=typeof window<"u"?new ResizeObserver(k=>{for(const x of k){const M=x.target,J=te.get(M);J&&Ae(J,M)}}):null;function Te(){if(typeof window>"u")return{};try{const k=window.localStorage.getItem(Ac);if(!k)return{};const x=JSON.parse(k);return!x||typeof x!="object"||Array.isArray(x)?{}:x}catch{return{}}}function $e(){return typeof window>"u"?"project":window.localStorage.getItem(Cc)==="chronological"?"chronological":"project"}o.value=Te(),pt(o,k=>{typeof window>"u"||window.localStorage.setItem(Ac,JSON.stringify(k))},{deep:!0}),pt(Ye,k=>{typeof window>"u"||window.localStorage.setItem(Cc,k)});const Tt=pe(()=>n.searchQuery.trim().toLowerCase()),nt=pe(()=>Tt.value.length>0),Qe=pe(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function Xe(k){if(!nt.value)return!0;if(Qe.value)return Qe.value.has(k.id);const x=Tt.value;return k.title.toLowerCase().includes(x)||k.preview.toLowerCase().includes(x)}const ft=pe(()=>nt.value?n.groups.map(k=>({...k,threads:k.threads.filter(Xe)})).filter(k=>k.threads.length>0):n.groups),Rt=pe(()=>Ye.value==="chronological"),Ge=pe(()=>{const k=ft.value,x=[];for(const M of k)for(const J of M.threads)v(J.id)||x.push(J);return x.sort((M,J)=>{const Ue=new Date(M.updatedAtIso||M.createdAtIso).getTime();return new Date(J.updatedAtIso||J.createdAtIso).getTime()-Ue})}),et=pe(()=>{const k=new Map;for(const x of n.groups)for(const M of x.threads)k.set(M.id,M);return k}),W=pe(()=>i.value.map(k=>et.value.get(k)??null).filter(k=>k!==null).filter(Xe)),me=pe(()=>{const k=j.value;if(!k||k.dropTargetIndexFull===null||n.groups.length===0)return null;const x=Math.max(0,Math.min(k.dropTargetIndexFull,n.groups.length)),M=x>k.fromIndex?x-1:x,J=Math.max(0,Math.min(M,n.groups.length-1));return J===k.fromIndex?null:J}),ie=pe(()=>{const x=(nt.value?ft.value:n.groups).map(Bt=>Bt.projectName),M=j.value,J=me.value;if(!M||J===null)return x;const Ue=[...x],[Ot]=Ue.splice(M.fromIndex,1);return Ot?(Ue.splice(J,0,Ot),Ue):x}),fe=pe(()=>{const k={};let x=0;for(const M of ie.value)k[M]=x,x+=jt(M);return k}),De=pe(()=>{let k=0;for(const x of ie.value)k+=jt(x);return{height:`${Math.max(0,k)}px`}});function g(k){const x=new Date(k).getTime();if(Number.isNaN(x))return"n/a";const M=Math.abs(Date.now()-x);if(M<6e4)return"now";const J=Math.floor(M/6e4);if(J<60)return`${J}m`;const Ue=Math.floor(J/60);return Ue<24?`${Ue}h`:`${Math.floor(Ue/24)}d`}function v(k){return i.value.includes(k)}function A(k){if(v(k)){i.value=i.value.filter(x=>x!==k);return}i.value=[k,...i.value]}function H(k){r("select",k)}function F(k){r("export-thread",k),V()}function P(k){return`start new thread ${Ve(k)}`}function D(k){r("start-new-thread",k)}function B(k){l.value===k&&V()}function G(k){return l.value===k}function V(){l.value=""}function be(k){if(l.value===k){V();return}l.value=k}function ae(k,x){h.value=k,b.value=x,f.value=!0,V(),tn(()=>{var M,J;(M=N.value)==null||M.focus(),(J=N.value)==null||J.select()})}function he(){f.value=!1,h.value="",b.value=""}function Se(){const k=h.value,x=b.value.trim();!k||!x||(r("rename-thread",{threadId:k,title:x}),he())}function Me(k,x){O.value=k,Y.value=x,I.value=!0,V()}function Ke(){I.value=!1,O.value="",Y.value=""}function xe(){const k=O.value;k&&(i.value=i.value.filter(x=>x!==k),r("archive",k),Ke())}function Ve(k){return n.projectDisplayNameById[k]??k}function wt(k){return a.value===k}function U(){a.value="",u.value="actions",c.value=""}function K(){Be.value=!Be.value}function ne(k){Ye.value=k,Be.value=!1}function Je(k){if(a.value===k){U();return}a.value=k,u.value="actions",c.value=Ve(k)}function ot(k){a.value=k,u.value="rename",c.value=Ve(k)}function bt(k){r("rename-project",{projectName:k,displayName:c.value})}function Pt(k){r("remove-project",k),U()}function ln(k){r("browse-project-files",k),U()}function Ir(k,x){if(!k.altKey||k.key!=="ArrowUp"&&k.key!=="ArrowDown")return;const M=n.groups.findIndex(Ot=>Ot.projectName===x);if(M<0)return;const J=k.key==="ArrowUp"?-1:1,Ue=Math.max(0,Math.min(M+J,n.groups.length-1));Ue!==M&&(k.preventDefault(),r("reorder-project",{projectName:x,toIndex:Ue}))}function rn(k){return s.value[k]===!0}function Ne(k){return o.value[k]===!0}function Oe(k){s.value={...s.value,[k]:!rn(k)}}function fn(k){if(ve.value===k){ve.value="";return}o.value={...o.value,[k]:!Ne(k)}}function jt(k){const x=Ie.value[k]??0,M=j.value,Ue=((M==null?void 0:M.projectName)===k?M.groupHeight:null)??x,Ot=Ne(k)?0:Ec;return Math.max(0,Ue+Ot)}function Sr(k,x){const M=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(M){ee.set(k,M);return}ee.delete(k)}function _n(k,x){const M=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(M){ye.set(k,M);return}ye.delete(k)}function kn(k){const x=a.value;if(!x)return!1;const M=ee.get(x);if(!M)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(M))return!0;const Ue=k.target;return Ue instanceof Node?M.contains(Ue):!1}function _(k){const x=l.value;if(!x)return!1;const M=ye.get(x);if(!M)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(M))return!0;const Ue=k.target;return Ue instanceof Node?M.contains(Ue):!1}function S(k){if(Be.value){const x=je.value,M=typeof k.composedPath=="function"?k.composedPath():[];!!x&&(M.includes(x)||k.target instanceof Node&&x.contains(k.target))||(Be.value=!1)}a.value&&(kn(k)||U(),l.value&&(_(k)||V()))}function E(k){a.value&&!kn(k)&&U(),l.value&&!_(k)&&V()}function z(){Be.value&&(Be.value=!1),a.value&&U(),l.value&&V()}function ge(){window.addEventListener("pointerdown",S,{capture:!0}),window.addEventListener("focusin",E,{capture:!0}),window.addEventListener("blur",z)}function le(){window.removeEventListener("pointerdown",S,{capture:!0}),window.removeEventListener("focusin",E,{capture:!0}),window.removeEventListener("blur",z)}function Ae(k,x){const M=x.getBoundingClientRect().height;if(!Number.isFinite(M)||M<=0)return;const J=Ie.value[k];J!==void 0&&Math.abs(J-M)<.5||(Ie.value={...Ie.value,[k]:M})}function ke(k,x){const M=re.get(k);M&&M!==x&&Re&&Re.unobserve(M);const J=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(J){re.set(k,J),te.set(J,k),Ae(k,J),Re==null||Re.observe(J);return}M&&(Re==null||Re.unobserve(M)),re.delete(k)}function We(k,x){if(k.button!==0||q.value||j.value)return;const M=n.groups.findIndex(Bt=>Bt.projectName===x),J=re.get(x);if(M<0||!J)return;const Ue=J.getBoundingClientRect(),Ot=Ne(x)?0:Ec;q.value={projectName:x,fromIndex:M,startClientX:k.clientX,startClientY:k.clientY,pointerOffsetY:k.clientY-Ue.top,groupLeft:Ue.left,groupWidth:Ue.width,groupHeight:Ue.height,groupOuterHeight:Ue.height+Ot},k.preventDefault(),it()}function it(){window.addEventListener("mousemove",xt),window.addEventListener("mouseup",Mt),window.addEventListener("keydown",sn)}function at(){window.removeEventListener("mousemove",xt),window.removeEventListener("mouseup",Mt),window.removeEventListener("keydown",sn)}function xt(k){oe={clientX:k.clientX,clientY:k.clientY},_s()}function Mt(k){Er({clientX:k.clientX,clientY:k.clientY});const x=j.value;if(x&&me.value!==null){const M=n.groups.findIndex(J=>J.projectName===x.projectName);if(M>=0){const J=me.value;J!==M&&r("reorder-project",{projectName:x.projectName,toIndex:J})}}Dn()}function sn(k){k.key==="Escape"&&(!q.value&&!j.value||(k.preventDefault(),Dn()))}function Dn(){de!==null&&(window.cancelAnimationFrame(de),de=null),oe=null,q.value=null,j.value=null,ve.value="",at()}function _s(){de===null&&(de=window.requestAnimationFrame(()=>{if(de=null,!oe)return;const k=oe;oe=null,Er(k)}))}function Er(k){const x=q.value;if(!j.value&&x){const M=k.clientX-x.startClientX,J=k.clientY-x.startClientY;if(Math.hypot(M,J)<Ay)return;U(),ve.value=x.projectName,j.value={projectName:x.projectName,fromIndex:x.fromIndex,pointerOffsetY:x.pointerOffsetY,groupLeft:x.groupLeft,groupWidth:x.groupWidth,groupHeight:x.groupHeight,groupOuterHeight:x.groupOuterHeight,ghostTop:k.clientY-x.pointerOffsetY,dropTargetIndexFull:null}}j.value&&Gr(k)}function Gr(k){const x=j.value;if(!x)return;if(x.ghostTop=k.clientY-x.pointerOffsetY,!Ln(k)){x.dropTargetIndexFull=null;return}const M=k.clientY,J=$.value;if(!J){x.dropTargetIndexFull=null;return}const Ue=J.getBoundingClientRect(),Ot=new Map(n.groups.map((on,ar)=>[on.projectName,ar])),Bt=n.groups.map(on=>on.projectName).filter(on=>on!==x.projectName);let Yr=0,Bn=n.groups.length;for(const on of Bt){const ar=Ot.get(on);if(ar===void 0)continue;const Rr=jt(on),Ss=Ue.top+Yr+Rr/2;if(M<Ss){Bn=ar;break}Yr+=Rr}x.dropTargetIndexFull=Bn}function Ln(k){const x=$.value;if(!x)return!1;const M=x.getBoundingClientRect(),J=k.clientX>=M.left&&k.clientX<=M.right,Ue=k.clientY>=M.top-32&&k.clientY<=M.bottom+32;return J&&Ue}function Kr(k){var x;return((x=j.value)==null?void 0:x.projectName)===k}function Jr(k){const x=j.value,M=fe.value[k]??0,J=a.value===k;return!x||x.projectName!==k?{position:"absolute",top:"0",left:"0",right:"0",zIndex:J?"40":"1",transform:`translate3d(0, ${M}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${x.groupLeft}px`,width:`${x.groupWidth}px`,height:`${x.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${x.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function jn(k){return k.threads.filter(x=>!v(x.id))}function ks(k){if(nt.value)return jn(k);if(Ne(k.projectName))return[];const x=jn(k);return rn(k.projectName)?x:x.slice(0,10)}function Ts(k){return nt.value?!1:!Ne(k.projectName)&&jn(k).length>10}function Is(k){return jn(k).length>0}function Cr(k){return k.inProgress?"working":k.unread?"unread":"idle"}pt(()=>n.groups.map(k=>k.projectName),k=>{var Ue,Ot;const x=((Ue=j.value)==null?void 0:Ue.projectName)??((Ot=q.value)==null?void 0:Ot.projectName)??"";x&&!n.groups.some(Bt=>Bt.projectName===x)&&Dn();const M=new Set(k),J=Object.fromEntries(Object.entries(Ie.value).filter(([Bt])=>M.has(Bt)));Object.keys(J).length!==Object.keys(Ie.value).length&&(Ie.value=J)});const Ar=pe(()=>Be.value||a.value!=="");return pt(Ar,k=>{if(k){ge();return}le()}),ir(()=>{for(const k of re.values())Re==null||Re.unobserve(k);re.clear(),ee.clear(),le(),Dn()}),(k,x)=>(w(),T("section",wv,[W.value.length>0?(w(),T("section",bv,[m("ul",_v,[(w(!0),T(He,null,Et(W.value,M=>(w(),T("li",{key:M.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":M.id===e.selectedThreadId,"data-pinned":v(M.id),onMouseleave:J=>B(M.id)},{left:ht(()=>[m("span",kv,[M.inProgress||M.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Cr(M)},null,8,Tv)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>A(M.id)},[Ce(Oi,{class:"thread-icon"})],8,Iv)])]),right:ht(()=>[m("span",Av,ce(g(M.createdAtIso||M.updatedAtIso)),1)]),"right-hover":ht(()=>[m("div",{ref_for:!0,ref:J=>_n(M.id,J),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(J=>be(M.id),["stop"])},[Ce(xs,{class:"thread-icon"})],8,Rv),G(M.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:x[0]||(x[0]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:J=>F(M.id)}," Export chat ",8,Pv),m("button",{class:"thread-menu-item",type:"button",onClick:J=>ae(M.id,M.title)}," Rename thread ",8,xv),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:J=>Me(M.id,M.title)}," Delete thread ",8,Mv)])):se("",!0)],512)]),default:ht(()=>[m("button",{class:"thread-main-button",type:"button",onClick:J=>H(M.id)},[m("span",Ev,[m("span",Cv,ce(M.title),1),M.hasWorktree?(w(),gt(Ao,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,Sv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):se("",!0),Ce($r,{as:"header",class:"thread-tree-header-row"},{right:ht(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:je,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Be.value,"aria-label":"Organize threads",title:"Organize threads",onClick:K},[Ce(xs,{class:"thread-icon"})],8,Ov),Be.value?(w(),T("div",{key:0,class:"organize-menu-panel",onClick:x[3]||(x[3]=tt(()=>{},["stop"]))},[x[11]||(x[11]=m("p",{class:"organize-menu-title"},"Organize",-1)),m("button",{class:"organize-menu-item","data-active":Ye.value==="project",type:"button",onClick:x[1]||(x[1]=M=>ne("project"))},[x[9]||(x[9]=m("span",null,"By project",-1)),Ye.value==="project"?(w(),T("span",$v,"✓")):se("",!0)],8,Nv),m("button",{class:"organize-menu-item","data-active":Ye.value==="chronological",type:"button",onClick:x[2]||(x[2]=M=>ne("chronological"))},[x[10]||(x[10]=m("span",null,"Chronological list",-1)),Ye.value==="chronological"?(w(),T("span",Lv,"✓")):se("",!0)],8,Dv)])):se("",!0)],512)]),default:ht(()=>[x[12]||(x[12]=m("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),nt.value&&ft.value.length===0?(w(),T("p",jv,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),T("p",Bv,"Loading threads...")):Rt.value?(w(),T("ul",Uv,[(w(!0),T(He,null,Et(Ge.value,M=>(w(),T("li",{key:M.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":M.id===e.selectedThreadId,"data-pinned":v(M.id),onMouseleave:J=>B(M.id)},{left:ht(()=>[m("span",Fv,[M.inProgress||M.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Cr(M)},null,8,Hv)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>A(M.id)},[Ce(Oi,{class:"thread-icon"})],8,Vv)])]),right:ht(()=>[m("span",Gv,ce(g(M.createdAtIso||M.updatedAtIso)),1)]),"right-hover":ht(()=>[m("div",{ref_for:!0,ref:J=>_n(M.id,J),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(J=>be(M.id),["stop"])},[Ce(xs,{class:"thread-icon"})],8,Kv),G(M.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:x[4]||(x[4]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:J=>F(M.id)}," Export chat ",8,Jv),m("button",{class:"thread-menu-item",type:"button",onClick:J=>ae(M.id,M.title)}," Rename thread ",8,Yv),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:J=>Me(M.id,M.title)}," Delete thread ",8,Qv)])):se("",!0)],512)]),default:ht(()=>[m("button",{class:"thread-main-button",type:"button",onClick:J=>H(M.id)},[m("span",qv,[m("span",zv,ce(M.title),1),M.hasWorktree?(w(),gt(Ao,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,Wv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),T("div",{key:4,ref_key:"groupsContainerRef",ref:$,class:"thread-tree-groups",style:qr(De.value)},[(w(!0),T(He,null,Et(ft.value,M=>(w(),T("article",{key:M.projectName,ref_for:!0,ref:J=>ke(M.projectName,J),class:"project-group","data-project-name":M.projectName,"data-expanded":!Ne(M.projectName),"data-dragging":Kr(M.projectName),style:qr(Jr(M.projectName))},[Ce($r,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:J=>fn(M.projectName),onKeydown:[J=>Ir(J,M.projectName),Qt(tt(J=>fn(M.projectName),["prevent"]),["enter"]),Qt(tt(J=>fn(M.projectName),["prevent"]),["space"])]},{left:ht(()=>[m("span",Zv,[m("span",ey,[Ne(M.projectName)?(w(),gt(Yd,{key:0,class:"thread-icon"})):(w(),gt(iv,{key:1,class:"thread-icon"}))]),m("span",ty,[Ne(M.projectName)?(w(),gt(Jd,{key:0,class:"thread-icon"})):(w(),gt(ui,{key:1,class:"thread-icon"}))])])]),right:ht(()=>[m("div",sy,[m("div",{ref_for:!0,ref:J=>Sr(M.projectName,J),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:tt(J=>Je(M.projectName),["stop"])},[Ce(xs,{class:"thread-icon"})],8,oy),wt(M.projectName)?(w(),T("div",{key:0,class:"project-menu-panel",onClick:x[6]||(x[6]=tt(()=>{},["stop"]))},[u.value==="actions"?(w(),T(He,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:J=>ln(M.projectName)}," Browse files ",8,iy),m("button",{class:"project-menu-item",type:"button",onClick:J=>ot(M.projectName)}," Edit name ",8,ay),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:J=>Pt(M.projectName)}," Remove ",8,ly)],64)):(w(),T(He,{key:1},[x[13]||(x[13]=m("label",{class:"project-menu-label"},"Project name",-1)),er(m("input",{"onUpdate:modelValue":x[5]||(x[5]=J=>c.value=J),class:"project-menu-input",type:"text",onInput:J=>bt(M.projectName)},null,40,cy),[[tr,c.value]])],64))])):se("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":P(M.projectName),title:P(M.projectName),onClick:tt(J=>D(M.projectName),["stop"])},[Ce(Fo,{class:"thread-icon"})],8,uy)])]),default:ht(()=>[m("span",{class:"project-main-button","data-dragging-handle":Kr(M.projectName),onMousedown:tt(J=>We(J,M.projectName),["left"])},[m("span",ry,ce(Ve(M.projectName)),1)],40,ny)]),_:2},1032,["onClick","onKeydown"]),Is(M)?(w(),T("ul",dy,[(w(!0),T(He,null,Et(ks(M),J=>(w(),T("li",{key:J.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":J.id===e.selectedThreadId,"data-pinned":v(J.id),onMouseleave:Ue=>B(J.id)},{left:ht(()=>[m("span",fy,[J.inProgress||J.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Cr(J)},null,8,hy)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Ue=>A(J.id)},[Ce(Oi,{class:"thread-icon"})],8,py)])]),right:ht(()=>[m("span",yy,ce(g(J.createdAtIso||J.updatedAtIso)),1)]),"right-hover":ht(()=>[m("div",{ref_for:!0,ref:Ue=>_n(J.id,Ue),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(Ue=>be(J.id),["stop"])},[Ce(xs,{class:"thread-icon"})],8,wy),G(J.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:x[7]||(x[7]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Ue=>F(J.id)}," Export chat ",8,by),m("button",{class:"thread-menu-item",type:"button",onClick:Ue=>ae(J.id,J.title)}," Rename thread ",8,_y),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Ue=>Me(J.id,J.title)}," Delete thread ",8,ky)])):se("",!0)],512)]),default:ht(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Ue=>H(J.id)},[m("span",gy,[m("span",vy,ce(J.title),1),J.hasWorktree?(w(),gt(Ao,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,my)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),gt($r,{key:1,as:"p",class:"project-empty-row"},{left:ht(()=>[...x[14]||(x[14]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:ht(()=>[x[15]||(x[15]=m("span",{class:"project-empty"},"No threads",-1))]),_:1})),Ts(M)?(w(),gt($r,{key:2,class:"thread-show-more-row"},{left:ht(()=>[...x[16]||(x[16]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:ht(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:J=>Oe(M.projectName)},ce(rn(M.projectName)?"Show less":"Show more"),9,Ty)]),_:2},1024)):se("",!0)],12,Xv))),128))],4)),(w(),gt(Do,{to:"body"},[f.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:tt(he,["self"])},[m("div",Iy,[x[17]||(x[17]=m("h3",{class:"rename-thread-title"},"Rename thread",-1)),x[18]||(x[18]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),er(m("input",{ref_key:"renameThreadInputRef",ref:N,"onUpdate:modelValue":x[8]||(x[8]=M=>b.value=M),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Qt(tt(Se,["prevent"]),["enter"]),Qt(tt(he,["prevent"]),["esc"])]},null,40,Sy),[[tr,b.value]]),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:he},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Se},"Save")])])])):se("",!0)])),(w(),gt(Do,{to:"body"},[I.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:tt(Ke,["self"])},[m("div",Ey,[x[19]||(x[19]=m("h3",{class:"rename-thread-title"},"Delete thread?",-1)),m("p",Cy,' This will archive the thread "'+ce(Y.value)+'". You can find it later in archived threads. ',1),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:Ke},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:xe},"Delete")])])])):se("",!0)]))]))}}),Py=rt(Ry,[["__scopeId","data-v-e2f8a8e1"]]),xy={class:"content-header"},My={class:"content-leading"},Oy={class:"content-title"},Ny={class:"content-actions"},$y=Lt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),T("header",xy,[m("div",My,[Mn(t.$slots,"leading",{},void 0)]),m("h1",Oy,ce(e.title),1),m("div",Ny,[Mn(t.$slots,"actions",{},void 0)])]))}}),Dy=rt($y,[["__scopeId","data-v-66ee223c"]]),Ly={},jy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function By(e,t){return w(),T("svg",jy,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Qa=rt(Ly,[["render",By]]),Uy={},Fy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Hy(e,t){return w(),T("svg",Fy,[...t[0]||(t[0]=[m("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 Vy=rt(Uy,[["render",Hy]]),Wy={},qy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function zy(e,t){return w(),T("svg",qy,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2zm-4 4a2 2 0 0 1-2-2V8m4 8h10"},null,-1)])])}const Gy=rt(Wy,[["render",zy]]),Ky={class:"conversation-root"},Jy={key:0,class:"conversation-loading"},Yy={key:1,class:"conversation-empty"},Qy={class:"message-row"},Xy={class:"message-stack"},Zy={class:"request-card"},ew={class:"request-title"},tw={class:"request-meta"},nw={key:0,class:"request-reason"},rw={key:1,class:"request-actions"},sw=["onClick"],ow=["onClick"],iw=["onClick"],aw=["onClick"],lw={key:2,class:"request-actions"},cw=["onClick"],uw=["onClick"],dw=["onClick"],fw=["onClick"],hw={key:3,class:"request-user-input"},pw={class:"request-question-title"},mw={key:0,class:"request-question-text"},gw=["value","onChange"],vw=["value"],yw=["value","onInput"],ww=["onClick"],bw={key:4,class:"request-actions"},_w=["onClick"],kw=["onClick"],Tw={key:5,class:"request-actions"},Iw=["onClick"],Sw=["onClick"],Ew=["data-role","data-message-type"],Cw={key:0,class:"message-row","data-role":"system"},Aw={class:"message-stack","data-role":"system"},Rw=["onClick"],Pw={class:"cmd-label"},xw={class:"cmd-status"},Mw={class:"cmd-output-inner"},Ow={class:"cmd-output"},Nw=["data-role","data-message-type"],$w=["data-role"],Dw=["data-role"],Lw=["data-role"],jw=["onClick"],Bw=["src"],Uw={key:1,class:"message-file-attachments"},Fw=["href","title"],Hw=["data-role"],Vw={key:0,class:"worked-separator-wrap","aria-live":"polite"},Ww=["onClick"],qw={class:"worked-separator-text"},zw={key:0,class:"worked-details"},Gw=["onClick"],Kw={class:"cmd-label"},Jw={class:"cmd-status"},Yw={class:"cmd-output-inner"},Qw={class:"cmd-output"},Xw={key:1,class:"message-text-flow"},Zw={key:0,class:"message-text"},eb={key:0},tb={key:1,class:"message-bold-text"},nb=["href","title"],rb=["href","title"],sb={key:4,class:"message-inline-code"},ob={key:1,class:"message-text"},ib=["onClick"],ab=["src","alt","onError"],lb={key:0,class:"message-actions"},cb=["onClick"],ub=["onClick"],db={key:0,class:"conversation-item conversation-item-overlay"},fb={class:"message-row"},hb={class:"message-stack"},pb={class:"live-overlay-inline","aria-live":"polite"},mb={class:"live-overlay-label"},gb={key:1,class:"live-overlay-error"},vb=["src"],yb=16,wb=Lt({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=L(new Set),r=L(new Set),s=L(new Set),o=L({});function i(_){return _.messageType==="commandExecution"&&!!_.commandExecution}function a(_){var S;return((S=_.commandExecution)==null?void 0:S.status)==="inProgress"||r.value.has(_.id)?!0:n.value.has(_.id)}function l(_){return r.value.has(_.id)}function u(_){var E;if(((E=_.commandExecution)==null?void 0:E.status)==="inProgress")return;const S=new Set(n.value);S.has(_.id)?S.delete(_.id):S.add(_.id),n.value=S}function c(_){const S=new Set(s.value);S.has(_.id)?S.delete(_.id):S.add(_.id),s.value=S}function f(_){return s.value.has(_.id)}function h(_){const S=_.commandExecution;if(!S)return"";switch(S.status){case"inProgress":return"⟳ Running";case"completed":return S.exitCode===0?"✓ Completed":`✗ Exit ${S.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function b(_){var E,z;const S=(E=_.commandExecution)==null?void 0:E.status;return S==="inProgress"?"cmd-status-running":S==="completed"&&((z=_.commandExecution)==null?void 0:z.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function N(_){const S=new Set(r.value);S.add(_),r.value=S,setTimeout(()=>{const E=new Set(r.value);E.delete(_),r.value=E},1e3)}function I(_,S){const E=[];for(let z=S-1;z>=0;z--){const ge=_[z];if(ge.messageType==="commandExecution")E.unshift(ge);else if(ge.role==="user"||ge.messageType==="worked")break}return E}const O=e,Y=t,$=L(null),q=L(null),j=L(null),oe=L(""),de=L({}),ve=L({});let Ie=0,re=0,ee=0;const ye=new WeakSet,te=L(new Set);function je(_){if(!_||/\s/u.test(_)||_.endsWith("/")||_.endsWith("\\"))return!1;if(_.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(_))return!1;const S=_.startsWith("/"),E=/^[A-Za-z]:[\\/]/u.test(_),z=_.startsWith("./")||_.startsWith("../")||_.startsWith("~/"),ge=_.includes("/")||_.includes("\\");return S||E||z||ge}function Be(_){return _.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||_}function Ye(_){return _.replace(/\\/gu,"/")}function Re(_){if(!_.startsWith("file://"))return _;let S=_.replace(/^file:\/\//u,"");try{S=decodeURIComponent(S)}catch{}return/^\/[A-Za-z]:\//u.test(S)&&(S=S.slice(1)),S}function Te(_){const S=Ye(_),E=S.match(/^\/Users\/([^/]+)/u);if(E)return`/Users/${E[1]}`;const z=S.match(/^\/home\/([^/]+)/u);return z?`/home/${z[1]}`:""}function $e(_){const S=Ye(_);if(!S)return S;let E="",z=S;const ge=z.match(/^([A-Za-z]:)(\/.*)?$/u);ge?(E=`${ge[1]}/`,z=(ge[2]??"").replace(/^\/+/u,"")):z.startsWith("/")&&(E="/",z=z.slice(1));const le=z.split("/").filter(Boolean),Ae=[];for(const We of le)if(We!=="."){if(We===".."){Ae.length>0&&Ae.pop();continue}Ae.push(We)}const ke=Ae.join("/");return E?`${E}${ke}`.replace(/\/+$/u,"")||E:ke||S}function Tt(_,S){const E=Ye(Re(_.trim()));if(!E)return"";if(E.startsWith("/")||/^[A-Za-z]:\//u.test(E))return $e(E);if(E.startsWith("~/")){const le=Te(S);if(le)return $e(`${le}/${E.slice(2)}`)}const ge=Ye(S.trim());return $e(ge?`${ge.replace(/\/+$/u,"")}/${E}`:E)}function nt(_){if(!_)return null;let S=_.trim();S=Qe(S).core.trim();let z=null;const ge=S.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(ge)S=ge[1],z=Number(ge[2]);else{const le=S.match(/^(.*):(\d+)(?::\d+)?$/u);le&&(S=le[1],z=Number(le[2]))}return S=Re(S),je(S)?{path:S,line:z}:null}function Qe(_){let S=_,E="",z="";for(;/^[('"`[{<“‘]/u.test(S);)E+=S[0],S=S.slice(1);for(;/[)"'`\]}>”’]$/u.test(S);)z=S.slice(-1)+z,S=S.slice(0,-1);return{core:S,leading:E,trailing:z}}function Xe(_){const E=_.trim().match(/^\[([^\]\n]+)\]\(([^)\n]+)\)$/u);if(!E)return null;const z=(E[1]??"").trim(),ge=(E[2]??"").trim(),le=Qe(z).core.trim()||z,Ae=Qe(ge).core.trim();return Ae?{label:le,target:Ae}:null}function ft(_){const S=[],E=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let z=0;for(const ge of _.matchAll(E)){if(typeof ge.index!="number")continue;const le=ge.index,Ae=le+ge[0].length;le>z&&S.push({kind:"text",value:_.slice(z,le)});let ke=ge[0],We="";for(;/[.,;:]$/u.test(ke);)We=ke.slice(-1)+We,ke=ke.slice(0,-1);const it=Qe(ke);ke=it.core;const at=it.leading,xt=it.trailing+We;if(at&&S.push({kind:"text",value:at}),ke.startsWith("**")&&ke.endsWith("**")&&ke.length>4)S.push({kind:"bold",value:ke.slice(2,-2)}),xt&&S.push({kind:"text",value:xt});else if(/^https?:\/\//u.test(ke))S.push({kind:"url",value:ke,href:ke}),xt&&S.push({kind:"text",value:xt});else{const Mt=nt(ke);Mt?(S.push({kind:"file",value:ke,path:Mt.path,displayPath:ke,downloadName:Be(Mt.path)}),xt&&S.push({kind:"text",value:xt})):S.push({kind:"text",value:ge[0]})}z=Ae}return z<_.length&&S.push({kind:"text",value:_.slice(z)}),Rt(S)}function Rt(_){const S=[];let E=!1,z="";const ge=le=>{le&&S.push({kind:"text",value:le})};for(const le of _){if(le.kind!=="text"){E&&(ge(`**${z}`),E=!1,z=""),S.push(le);continue}let Ae=le.value;for(;Ae.length>0;){const ke=Ae.indexOf("**");if(ke<0){E?z+=Ae:ge(Ae);break}const We=Ae.slice(0,ke);E?z+=We:ge(We),Ae=Ae.slice(ke+2),E?(z.length>0?S.push({kind:"bold",value:z}):ge("****"),z="",E=!1):E=!0}}return E&&ge(`**${z}`),S}function Ge(_){const S=/\[([^\]\n]+)\]\(([^)\n]+)\)/gu,E=[];let z=0;for(const ge of _.matchAll(S)){if(typeof ge.index!="number")continue;const[le,Ae,ke]=ge,We=ge.index,it=We+le.length;We>z&&E.push(...ft(_.slice(z,We)));const at=Xe(`[${Ae??""}](${ke??""})`),xt=(at==null?void 0:at.label)??(Ae??"").trim(),Mt=(at==null?void 0:at.target)??(ke??"").trim();if(/^https?:\/\//u.test(Mt))E.push({kind:"url",value:xt||Mt,href:Mt});else{const sn=nt(Mt);sn?E.push({kind:"file",value:Mt,path:sn.path,displayPath:xt||Mt,downloadName:Be(sn.path)}):E.push({kind:"text",value:le})}z=it}return z<_.length&&E.push(...ft(_.slice(z))),E}function et(_){if(!_.includes("`"))return Ge(_);const S=[];let E=0,z=0;for(;E<_.length;){if(_[E]!=="`"){E+=1;continue}let ge=1;for(;E+ge<_.length&&_[E+ge]==="`";)ge+=1;const le="`".repeat(ge);let Ae=E+ge,ke=-1;for(;Ae<_.length;){const it=_.indexOf(le,Ae);if(it<0)break;const at=it>0&&_[it-1]==="`",xt=it+ge<_.length&&_[it+ge]==="`",Mt=_.slice(E+ge,it).includes(`
26
+ `);if(!at&&!xt&&!Mt){ke=it;break}Ae=it+1}if(ke<0){E+=ge;continue}E>z&&S.push(...Ge(_.slice(z,E)));const We=_.slice(E+ge,ke);if(We.length>0){const it=Xe(We);if(it)if(/^https?:\/\//u.test(it.target))S.push({kind:"url",value:it.label||it.target,href:it.target});else{const at=nt(it.target);at?S.push({kind:"file",value:it.target,path:at.path,displayPath:it.label||it.target,downloadName:Be(at.path)}):S.push({kind:"code",value:We})}else{const at=nt(We);if(at){const xt=at.line?`${at.path}:${String(at.line)}`:at.path;S.push({kind:"file",value:We,path:at.path,displayPath:xt,downloadName:Be(at.path)})}else S.push({kind:"code",value:We})}}else S.push({kind:"text",value:`${le}${le}`});E=ke+ge,z=E}return z<_.length&&S.push(...Ge(_.slice(z))),S}function W(_){const S=_.trim();if(!S)return"";if(S.startsWith("data:")||S.startsWith("blob:")||S.startsWith("http://")||S.startsWith("https://")||S.startsWith("/codex-local-image?"))return S;if(S.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(S)}`;const E=S.startsWith("/"),z=/^[A-Za-z]:[\\/]/u.test(S);return E||z?`/codex-local-image?path=${encodeURIComponent(S)}`:S}function me(_){const S=_.trim();if(!S)return"#";const E=Ae=>Ae.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(Ae),z=nt(S),ge=(z==null?void 0:z.path)??S,le=Tt(ge,O.cwd);if(E(le)){const Ae=le.startsWith("/")?le:`/${le}`;return`/codex-local-browse${encodeURI(Ae)}`}return"#"}function ie(_){if(!_.includes("![")||!_.includes("]("))return[{kind:"text",value:_}];const S=[],E=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let z=0;for(const ge of _.matchAll(E)){const[le,Ae,ke]=ge;if(typeof ge.index!="number")continue;const We=ge.index,it=We+le.length,at=W(ke.trim());at&&(We>z&&S.push({kind:"text",value:_.slice(z,We)}),S.push({kind:"image",url:at,alt:Ae.trim(),markdown:le}),z=it)}return z<_.length&&S.push({kind:"text",value:_.slice(z)}),S.length>0?S:[{kind:"text",value:_}]}function fe(_){return _!==null&&typeof _=="object"&&!Array.isArray(_)?_:null}function De(_){const S=new Date(_);return Number.isNaN(S.getTime())?_:S.toLocaleTimeString()}function g(_){const S=fe(_.params),E=S==null?void 0:S.reason;return typeof E=="string"?E.trim():""}function v(_,S){return`${String(_)}:${S}`}function A(_){const S=fe(_.params),E=Array.isArray(S==null?void 0:S.questions)?S.questions:[],z=[];for(const ge of E){const le=fe(ge);if(!le)continue;const Ae=typeof le.id=="string"?le.id:"";if(!Ae)continue;const ke=Array.isArray(le.options)?le.options.map(We=>fe(We)).map(We=>We==null?void 0:We.label).filter(We=>typeof We=="string"&&We.length>0):[];z.push({id:Ae,header:typeof le.header=="string"?le.header:"",question:typeof le.question=="string"?le.question:"",isOther:le.isOther===!0,options:ke})}return z}function H(_,S,E){const z=v(_,S),ge=de.value[z];return typeof ge=="string"&&ge.length>0?ge:E}function F(_,S){const E=v(_,S);return ve.value[E]??""}function P(_,S,E){const z=E.target;if(!(z instanceof HTMLSelectElement))return;const ge=v(_,S);de.value={...de.value,[ge]:z.value}}function D(_,S,E){const z=E.target;if(!(z instanceof HTMLInputElement))return;const ge=v(_,S);ve.value={...ve.value,[ge]:z.value}}function B(_,S){Y("respondServerRequest",{id:_,result:{decision:S}})}function G(_){const S=A(_),E={};for(const z of S){const ge=H(_.id,z.id,z.options[0]||""),le=F(_.id,z.id).trim(),Ae=[ge,le].map(ke=>ke.trim()).filter(ke=>ke.length>0);E[z.id]={answers:Ae}}Y("respondServerRequest",{id:_.id,result:{answers:E}})}function V(_){Y("respondServerRequest",{id:_,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function be(_){Y("respondServerRequest",{id:_,result:{success:!0,contentItems:[]}})}function ae(_){Y("respondServerRequest",{id:_,result:{}})}function he(_){Y("respondServerRequest",{id:_,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function Se(_){return!(_.role!=="user"&&_.role!=="assistant"||typeof _.turnIndex!="number"||O.isTurnInProgress||O.isRollingBack)}function Me(_){return _.role!=="user"&&_.role!=="assistant"?!1:_.text.trim().length>0}function Ke(_){return Me(_)||Se(_)}async function xe(_){if(!Me(_))return;const S=_.text.trim();try{await navigator.clipboard.writeText(S)}catch{const E=document.createElement("textarea");E.value=S,E.setAttribute("readonly","true"),E.style.position="fixed",E.style.opacity="0",document.body.appendChild(E),E.select(),document.execCommand("copy"),document.body.removeChild(E)}}function Ve(_){Se(_)&&Y("rollback",{turnIndex:_.turnIndex})}function wt(){const _=$.value,S=q.value;!_||!S||(_.scrollTop=_.scrollHeight,S.scrollIntoView({block:"end"}))}function U(_){return _.scrollHeight-(_.scrollTop+_.clientHeight)<=yb}function K(_){if(!O.activeThreadId)return;const S=Math.max(_.scrollHeight-_.clientHeight,0),E=S>0?Math.min(Math.max(_.scrollTop/S,0),1):1;Y("updateScrollState",{threadId:O.activeThreadId,state:{scrollTop:_.scrollTop,isAtBottom:U(_),scrollRatio:E}})}function ne(){const _=$.value;if(!_)return;const S=O.scrollState;if(!S||S.isAtBottom){Je();return}const E=Math.max(_.scrollHeight-_.clientHeight,0),z=typeof S.scrollRatio=="number"?S.scrollRatio*E:S.scrollTop;_.scrollTop=Math.min(Math.max(z,0),E),K(_)}function Je(){const _=$.value;_&&(wt(),K(_))}function ot(){const _=O.scrollState;return!_||_.isAtBottom===!0}function bt(){if(!ot()){ee=0,re=0;return}if(Je(),ee-=1,ee<=0){re=0;return}re=requestAnimationFrame(bt)}function Pt(_=6){ot()&&(re&&(cancelAnimationFrame(re),re=0),ee=Math.max(_,1),re=requestAnimationFrame(bt))}function ln(){Pt(3)}function Ir(){if(!ot())return;const _=$.value;if(!_)return;const S=_.querySelectorAll("img.message-image-preview");for(const E of S)E.complete||ye.has(E)||(ye.add(E),E.addEventListener("load",ln,{once:!0}),E.addEventListener("error",ln,{once:!0}))}async function rn(){await tn(),Ie&&cancelAnimationFrame(Ie),Ie=requestAnimationFrame(()=>{Ie=0,ne(),Ir(),Pt()})}pt(()=>O.messages,async _=>{if(!O.isLoading){for(const S of _){if(S.messageType!=="commandExecution"||!S.commandExecution)continue;const E=o.value[S.id],z=S.commandExecution.status;E==="inProgress"&&z!=="inProgress"&&N(S.id),o.value[S.id]=z}await rn()}}),pt(()=>O.liveOverlay,async _=>{_&&(await tn(),Je(),Pt(8))},{deep:!0}),pt(()=>O.isLoading,async _=>{_||await rn()}),pt(()=>O.activeThreadId,()=>{oe.value="",te.value=new Set},{flush:"post"});function Ne(){const _=$.value;!_||O.isLoading||K(_)}function Oe(_){oe.value=W(_)}function fn(_,S){return`${_}:${String(S)}`}function jt(_,S){const E=new Set(te.value);E.add(fn(_,S)),te.value=E}function Sr(_,S){return te.value.has(fn(_,S))}function _n(){oe.value=""}function kn(){const _=j.value;_&&(_.scrollTop=_.scrollHeight)}return pt(()=>{var _;return(_=O.liveOverlay)==null?void 0:_.reasoningText},async _=>{_&&(await tn(),kn())}),ir(()=>{Ie&&cancelAnimationFrame(Ie),re&&cancelAnimationFrame(re)}),(_,S)=>(w(),T("section",Ky,[e.isLoading?(w(),T("p",Jy,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),T("p",Yy," No messages in this thread yet. ")):(w(),T("ul",{key:2,ref_key:"conversationListRef",ref:$,class:"conversation-list",onScroll:Ne},[(w(!0),T(He,null,Et(e.pendingRequests,E=>(w(),T("li",{key:`server-request:${E.id}`,class:"conversation-item conversation-item-request"},[m("div",Qy,[m("div",Xy,[m("article",Zy,[m("p",ew,ce(E.method),1),m("p",tw,"Request #"+ce(E.id)+" · "+ce(De(E.receivedAtIso)),1),g(E)?(w(),T("p",nw,ce(g(E)),1)):se("",!0),E.method==="item/commandExecution/requestApproval"?(w(),T("section",rw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>B(E.id,"accept")},"Accept",8,sw),m("button",{type:"button",class:"request-button",onClick:z=>B(E.id,"acceptForSession")},"Accept for Session",8,ow),m("button",{type:"button",class:"request-button",onClick:z=>B(E.id,"decline")},"Decline",8,iw),m("button",{type:"button",class:"request-button",onClick:z=>B(E.id,"cancel")},"Cancel",8,aw)])):E.method==="item/fileChange/requestApproval"?(w(),T("section",lw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>B(E.id,"accept")},"Accept",8,cw),m("button",{type:"button",class:"request-button",onClick:z=>B(E.id,"acceptForSession")},"Accept for Session",8,uw),m("button",{type:"button",class:"request-button",onClick:z=>B(E.id,"decline")},"Decline",8,dw),m("button",{type:"button",class:"request-button",onClick:z=>B(E.id,"cancel")},"Cancel",8,fw)])):E.method==="item/tool/requestUserInput"?(w(),T("section",hw,[(w(!0),T(He,null,Et(A(E),z=>(w(),T("div",{key:`${E.id}:${z.id}`,class:"request-question"},[m("p",pw,ce(z.header||z.question),1),z.header&&z.question?(w(),T("p",mw,ce(z.question),1)):se("",!0),m("select",{class:"request-select",value:H(E.id,z.id,z.options[0]||""),onChange:ge=>P(E.id,z.id,ge)},[(w(!0),T(He,null,Et(z.options,ge=>(w(),T("option",{key:`${E.id}:${z.id}:${ge}`,value:ge},ce(ge),9,vw))),128))],40,gw),z.isOther?(w(),T("input",{key:1,class:"request-input",type:"text",value:F(E.id,z.id),placeholder:"Other answer",onInput:ge=>D(E.id,z.id,ge)},null,40,yw)):se("",!0)]))),128)),m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>G(E)}," Submit Answers ",8,ww)])):E.method==="item/tool/call"?(w(),T("section",bw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>V(E.id)},"Fail Tool Call",8,_w),m("button",{type:"button",class:"request-button",onClick:z=>be(E.id)},"Success (Empty)",8,kw)])):(w(),T("section",Tw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>ae(E.id)},"Return Empty Result",8,Iw),m("button",{type:"button",class:"request-button",onClick:z=>he(E.id)},"Reject Request",8,Sw)]))])])])]))),128)),(w(!0),T(He,null,Et(e.messages,E=>{var z,ge;return w(),T("li",{key:E.id,class:mt(["conversation-item",{"conversation-item-actionable":Ke(E)}]),"data-role":E.role,"data-message-type":E.messageType||""},[i(E)?(w(),T("div",Cw,[m("div",Aw,[m("button",{type:"button",class:mt(["cmd-row",[b(E),{"cmd-expanded":a(E)}]]),onClick:le=>u(E)},[m("span",{class:mt(["cmd-chevron",{"cmd-chevron-open":a(E)}])},"▶",2),m("code",Pw,ce(((z=E.commandExecution)==null?void 0:z.command)||"(command)"),1),m("span",xw,ce(h(E)),1)],10,Rw),m("div",{class:mt(["cmd-output-wrap",{"cmd-output-visible":a(E),"cmd-output-collapsing":l(E)}])},[m("div",Mw,[m("pre",Ow,ce(((ge=E.commandExecution)==null?void 0:ge.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),T("div",{key:1,class:"message-row","data-role":E.role,"data-message-type":E.messageType||""},[m("div",{class:"message-stack","data-role":E.role},[m("article",{class:"message-body","data-role":E.role},[E.images&&E.images.length>0?(w(),T("ul",{key:0,class:"message-image-list","data-role":E.role},[(w(!0),T(He,null,Et(E.images,le=>(w(),T("li",{key:le,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:Ae=>Oe(le)},[m("img",{class:"message-image-preview",src:W(le),alt:"Message image preview",loading:"lazy"},null,8,Bw)],8,jw)]))),128))],8,Lw)):se("",!0),E.fileAttachments&&E.fileAttachments.length>0?(w(),T("div",Uw,[(w(!0),T(He,null,Et(E.fileAttachments,le=>(w(),T("span",{key:le.path,class:"message-file-chip"},[S[1]||(S[1]=m("span",{class:"message-file-chip-icon"},"📄",-1)),m("a",{class:"message-file-link message-file-chip-name",href:me(le.path),target:"_blank",rel:"noopener noreferrer",title:le.path},ce(le.path),9,Fw)]))),128))])):se("",!0),E.text.length>0?(w(),T("article",{key:2,class:"message-card","data-role":E.role},[E.messageType==="worked"?(w(),T("div",Vw,[m("button",{type:"button",class:"worked-separator",onClick:le=>c(E)},[S[2]||(S[2]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),m("span",{class:mt(["worked-chevron",{"worked-chevron-open":f(E)}])},"▶",2),m("p",qw,ce(E.text),1),S[3]||(S[3]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Ww),f(E)?(w(),T("div",zw,[(w(!0),T(He,null,Et(I(e.messages,e.messages.indexOf(E)),le=>{var Ae,ke;return w(),T("div",{key:`worked-cmd-${le.id}`,class:"worked-cmd-item"},[m("button",{type:"button",class:mt(["cmd-row",[b(le),{"cmd-expanded":a(le)}]]),onClick:We=>u(le)},[m("span",{class:mt(["cmd-chevron",{"cmd-chevron-open":a(le)}])},"▶",2),m("code",Kw,ce(((Ae=le.commandExecution)==null?void 0:Ae.command)||"(command)"),1),m("span",Jw,ce(h(le)),1)],10,Gw),m("div",{class:mt(["cmd-output-wrap",{"cmd-output-visible":a(le),"cmd-output-collapsing":l(le)}])},[m("div",Yw,[m("pre",Qw,ce(((ke=le.commandExecution)==null?void 0:ke.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):se("",!0)])):(w(),T("div",Xw,[(w(!0),T(He,null,Et(ie(E.text),(le,Ae)=>(w(),T(He,{key:`block-${Ae}`},[le.kind==="text"?(w(),T("p",Zw,[(w(!0),T(He,null,Et(et(le.value),(ke,We)=>(w(),T(He,{key:`seg-${Ae}-${We}`},[ke.kind==="text"?(w(),T("span",eb,ce(ke.value),1)):ke.kind==="bold"?(w(),T("strong",tb,ce(ke.value),1)):ke.kind==="file"?(w(),T("a",{key:2,class:"message-file-link",href:me(ke.path),target:"_blank",rel:"noopener noreferrer",title:ke.path},ce(ke.displayPath),9,nb)):ke.kind==="url"?(w(),T("a",{key:3,class:"message-file-link",href:ke.href,target:"_blank",rel:"noopener noreferrer",title:ke.href},ce(ke.value),9,rb)):(w(),T("code",sb,ce(ke.value),1))],64))),128))])):Sr(E.id,Ae)?(w(),T("p",ob,ce(le.markdown),1)):(w(),T("button",{key:2,class:"message-image-button",type:"button",onClick:ke=>Oe(le.url)},[m("img",{class:"message-image-preview message-markdown-image",src:le.url,alt:le.alt||"Embedded message image",loading:"lazy",onError:ke=>jt(E.id,Ae)},null,40,ab)],8,ib))],64))),128))]))],8,Hw)):se("",!0)],8,Dw),Ke(E)?(w(),T("div",lb,[Me(E)?(w(),T("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:le=>xe(E)},[Ce(Gy,{class:"message-action-icon"}),S[4]||(S[4]=m("span",{class:"message-action-label"},"Copy",-1))],8,cb)):se("",!0),Se(E)?(w(),T("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:le=>Ve(E)},[Ce(Vy,{class:"message-action-icon"}),S[5]||(S[5]=m("span",{class:"message-action-label"},"Rollback",-1))],8,ub)):se("",!0)])):se("",!0)],8,$w)],8,Nw))],10,Ew)}),128)),e.liveOverlay?(w(),T("li",db,[m("div",fb,[m("div",hb,[m("article",pb,[m("p",mb,ce(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),T("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:j},ce(e.liveOverlay.reasoningText),513)):se("",!0),e.liveOverlay.errorText?(w(),T("p",gb,ce(e.liveOverlay.errorText),1)):se("",!0)])])])])):se("",!0),m("li",{ref_key:"bottomAnchorRef",ref:q,class:"conversation-bottom-anchor"},null,512)],544)),oe.value.length>0?(w(),T("div",{key:3,class:"image-modal-backdrop",onClick:_n},[m("div",{class:"image-modal-content",onClick:S[0]||(S[0]=tt(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:_n},[Ce(Qa,{class:"icon-svg"})]),m("img",{class:"image-modal-image",src:oe.value,alt:"Expanded message image"},null,8,vb)])])):se("",!0)]))}}),bb=rt(wb,[["__scopeId","data-v-b2208f01"]]);function _b(e){var c;const t=L("idle"),n=L(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=h=>{h.data.size>0&&o.push(h.data)},r.onstop=()=>{var N;const h=o,b=(r==null?void 0:r.mimeType)||((N=h[0])==null?void 0:N.type)||"audio/webm";u(),t.value="idle",l(h,b)},r.start(),t.value="recording"}catch(h){u(),(f=e.onError)==null||f.call(e,h)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,h){var N;if(f.length===0)return;const b=new Blob(f,{type:h});try{const I=h.split(/[/;]/)[1]??"webm",O=`----codex-transcribe-${crypto.randomUUID()}`,Y=new Uint8Array(await b.arrayBuffer()),$=new TextEncoder,q=[];q.push($.encode(`--${O}\r
27
+ `)),q.push($.encode(`Content-Disposition: form-data; name="file"; filename="codex.${I}"\r
28
+ `)),q.push($.encode(`Content-Type: ${h}\r
29
29
  \r
30
- `)),z.push(Y),z.push($.encode(`\r
30
+ `)),q.push(Y),q.push($.encode(`\r
31
31
  --${O}--\r
32
- `));let j=0;for(const ee of z)j+=ee.byteLength;const oe=new Uint8Array(j);let de=0;for(const ee of z)oe.set(ee,de),de+=ee.byteLength;const ve=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${O}`},body:oe});if(!ve.ok)throw new Error(`Transcription failed: ${ve.status}`);const re=((await ve.json()).text??"").trim();re.length>0&&e.onTranscript(re)}catch(I){(N=e.onError)==null||N.call(e,I)}finally{t.value!=="recording"&&(t.value="idle")}}function u(){r&&(r.ondataavailable=null,r.onstop=null,r=null),s&&(s.getTracks().forEach(f=>f.stop()),s=null),o=[]}return ar(u),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function xc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Qn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Za(e,t){const n=xc(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=xc(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function ws(e,t,n){return e instanceof Qn?e:e instanceof Error?new Qn(e.message||t,{code:"unknown_error",method:n}):new Qn(t,{code:"unknown_error",method:n})}function Xd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function kb(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 Qn(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 Qn(Za(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 Qn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Pc(e){const t=Xd(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 Tb(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=Pc(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 u=JSON.parse(String(l.data)),c=Pc(u);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 Ib(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 Qn(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 Qn(Za(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Sb(){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 Qn(Za(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Xd(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Mc(e){return new Date(e*1e3).toISOString()}function Eb(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Cb(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Ab=/^##\s+(.+?):\s+(.+?)\s*$/,Rb=/^#\s*files mentioned by the user\s*:?\s*$/i;function xb(e){var s,o;const t=e.split(`
32
+ `));let j=0;for(const ee of q)j+=ee.byteLength;const oe=new Uint8Array(j);let de=0;for(const ee of q)oe.set(ee,de),de+=ee.byteLength;const ve=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${O}`},body:oe});if(!ve.ok)throw new Error(`Transcription failed: ${ve.status}`);const re=((await ve.json()).text??"").trim();re.length>0&&e.onTranscript(re)}catch(I){(N=e.onError)==null||N.call(e,I)}finally{t.value!=="recording"&&(t.value="idle")}}function u(){r&&(r.ondataavailable=null,r.onstop=null,r=null),s&&(s.getTracks().forEach(f=>f.stop()),s=null),o=[]}return ir(u),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Rc(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 Xa(e,t){const n=Rc(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Rc(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function ys(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 Qd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function kb(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(Xa(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 Pc(e){const t=Qd(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 Tb(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=Pc(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 u=JSON.parse(String(l.data)),c=Pc(u);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 Ib(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(Xa(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Sb(){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(Xa(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Qd(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function xc(e){return new Date(e*1e3).toISOString()}function Eb(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Cb(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Ab=/^##\s+(.+?):\s+(.+?)\s*$/,Rb=/^#\s*files mentioned by the user\s*:?\s*$/i;function Pb(e){var s,o;const t=e.split(`
33
33
  `).findIndex(i=>Rb.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(Ab);if(!l)break;const u=(s=l[1])==null?void 0:s.trim(),c=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");u&&c&&r.push({label:u,path:c})}return r}function Pb(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 Mb(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:Cb(l),isUnhandled:!0});const o=n.join(`
35
- `),i=xb(o);return{text:Pb(o),images:r,fileAttachments:i,rawBlocks:s}}function Ob(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Mb(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=Nb(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 Nb(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function $b(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Db(e){const t=$b(e);return t.length>0?t:"Untitled thread"}function Zd(e){return(e==null?void 0:e.status)==="inProgress"}function Lb(e){const t=e;if(t.inProgress===!0||t.status==="inProgress"||t.turnStatus==="inProgress")return!0;const r=(Array.isArray(e.turns)?e.turns:[]).at(-1);return Zd(r)}function jb(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:Db(e),projectName:Eb(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:Mc(e.createdAt),updatedAtIso:Mc(e.updatedAt),preview:e.preview,unread:!1,inProgress:Lb(e)}}function Bb(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 Ub(e){const t=e.data.map(jb);return Bb(t)}function ef(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 Ob(i))n.push({...a,turnIndex:r})}return n}function Fb(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return Zd(t.at(-1))}async function nn(e,t){try{return await kb(e,t)}catch(n){throw ws(n,`RPC ${e} failed`,e)}}function Hb(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Vb(){const e=await nn("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return Ub(e)}async function Wb(e){const t=await nn("thread/read",{threadId:e,includeTurns:!0});return{messages:ef(t),inProgress:Fb(t)}}async function zb(){try{return await Vb()}catch(e){throw ws(e,"Failed to load thread groups","thread/list")}}async function qb(e){try{return await Wb(e)}catch(t){throw ws(t,`Failed to load thread ${e}`,"thread/read")}}function Gb(e){return Tb(e)}async function Kb(e,t){await Ib({id:e,...t})}async function Jb(){return Sb()}async function $i(e){await nn("thread/resume",{threadId:e})}async function Yb(e){await nn("thread/archive",{threadId:e})}async function Qb(e,t){await nn("thread/name/set",{threadId:e,name:t})}async function Oc(e,t){const n=await nn("thread/rollback",{threadId:e,numTurns:t});return ef(n)}function Xb(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 Nc(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 nn("thread/start",n),s=Xb(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw ws(n,"Failed to start a new thread","thread/start")}}function Zb(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
34
+ `).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(Ab);if(!l)break;const u=(s=l[1])==null?void 0:s.trim(),c=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");u&&c&&r.push({label:u,path:c})}return r}function xb(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 Mb(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:Cb(l),isUnhandled:!0});const o=n.join(`
35
+ `),i=Pb(o);return{text:xb(o),images:r,fileAttachments:i,rawBlocks:s}}function Ob(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Mb(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=Nb(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 Nb(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function $b(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Db(e){const t=$b(e);return t.length>0?t:"Untitled thread"}function Xd(e){return(e==null?void 0:e.status)==="inProgress"}function Lb(e){const t=e;if(t.inProgress===!0||t.status==="inProgress"||t.turnStatus==="inProgress")return!0;const r=(Array.isArray(e.turns)?e.turns:[]).at(-1);return Xd(r)}function jb(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:Db(e),projectName:Eb(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:xc(e.createdAt),updatedAtIso:xc(e.updatedAt),preview:e.preview,unread:!1,inProgress:Lb(e)}}function Bb(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 Ub(e){const t=e.data.map(jb);return Bb(t)}function Zd(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 Ob(i))n.push({...a,turnIndex:r})}return n}function Fb(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return Xd(t.at(-1))}async function nn(e,t){try{return await kb(e,t)}catch(n){throw ys(n,`RPC ${e} failed`,e)}}function Hb(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Vb(){const e=await nn("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return Ub(e)}async function Wb(e){const t=await nn("thread/read",{threadId:e,includeTurns:!0});return{messages:Zd(t),inProgress:Fb(t)}}async function qb(){try{return await Vb()}catch(e){throw ys(e,"Failed to load thread groups","thread/list")}}async function zb(e){try{return await Wb(e)}catch(t){throw ys(t,`Failed to load thread ${e}`,"thread/read")}}function Gb(e){return Tb(e)}async function Kb(e,t){await Ib({id:e,...t})}async function Jb(){return Sb()}async function Ni(e){await nn("thread/resume",{threadId:e})}async function Yb(e){await nn("thread/archive",{threadId:e})}async function Qb(e,t){await nn("thread/name/set",{threadId:e,name:t})}async function Mc(e,t){const n=await nn("thread/rollback",{threadId:e,numTurns:t});return Zd(n)}function Xb(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 Oc(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 nn("thread/start",n),s=Xb(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw ys(n,"Failed to start a new thread","thread/start")}}function Zb(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
36
36
  `;for(const r of t)n+=`
37
37
  ## ${r.label}: ${r.path}
38
38
  `;return`${n}
39
39
  ## My request for Codex:
40
40
 
41
41
  ${e}
42
- `}async function Di(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:Zb(t,i)}];for(const f of n){const h=f.trim();h&&l.push({type:"image",url:h,image_url:h})}if(o)for(const f of o)l.push({type:"skill",name:f.name,path:f.path});const u=i.map(f=>({label:f.label,path:f.path,fsPath:f.fsPath})),c={threadId:e,input:l};u.length>0&&(c.attachments=u),typeof r=="string"&&r.length>0&&(c.model=r),typeof s=="string"&&s.length>0&&(c.effort=s),await nn("turn/start",c)}catch(a){throw ws(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function e_(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 nn("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw ws(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function t_(e){await nn("setDefaultModel",{model:e})}async function n_(){const e=await nn("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 r_(){const e=await nn("config/read",{}),t=e.config.model??"",n=Hb(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function s_(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 ga(){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 s_(n.data)}async function o_(e){const t=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e})}),n=await t.json();if(!t.ok||!n.data)throw new Error(n.error||"Failed to create worktree");return n.data}async function $c(){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 i_(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 a_(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=el(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 l_(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=el(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 c_(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 u=el(o,"Failed to search files");throw new Error(u)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const u of a){if(!u||typeof u!="object"||Array.isArray(u))continue;const f=u.path,h=typeof f=="string"?f.trim():"";h&&l.push({path:h})}return l}async function u_(e,t=200){const n=await fetch("/codex-api/thread-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,limit:t})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to search threads");return r.data??{threadIds:[],indexedThreadCount:0}}function el(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 d_(){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 Li(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 f_(e,t){var n;try{return((n=(await nn("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function h_(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await nn("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 p_(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 m_={},g_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function v_(e,t){return w(),T("svg",g_,[...t[0]||(t[0]=[m("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 y_=st(m_,[["render",v_]]),w_={},b_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function __(e,t){return w(),T("svg",b_,[...t[0]||(t[0]=[m("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 k_=st(w_,[["render",__]]),T_={},I_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function S_(e,t){return w(),T("svg",I_,[...t[0]||(t[0]=[m("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),m("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 E_=st(T_,[["render",S_]]),C_=["disabled"],A_={class:"composer-dropdown-value"},R_={class:"composer-dropdown-menu"},x_={key:0,class:"composer-dropdown-search-wrap"},P_=["placeholder","onKeydown"],M_={class:"composer-dropdown-options",role:"listbox"},O_=["onClick"],N_={key:0,class:"composer-dropdown-empty"},$_={key:1,class:"composer-dropdown-add-wrap"},D_=["placeholder","onKeydown"],L_=Lt({__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=L(null),o=L(null),i=L(null),a=L(!1),l=L(""),u=L(!1),c=L(""),f=pe(()=>{var ye;const ee=n.options.find(te=>te.value===n.modelValue);return ee?ee.label:((ye=n.placeholder)==null?void 0:ye.trim())||""}),h=pe(()=>n.openDirection??"down"),b=pe(()=>n.enableSearch===!0),N=pe(()=>n.showAddAction===!0),I=pe(()=>{var ee;return((ee=n.searchPlaceholder)==null?void 0:ee.trim())||"Quick search projects"}),O=pe(()=>{var ee;return((ee=n.addActionLabel)==null?void 0:ee.trim())||"Add new project"}),Y=pe(()=>{var ee;return((ee=n.addPlaceholder)==null?void 0:ee.trim())||"Project name or absolute path"}),$=pe(()=>{const ee=l.value.trim().toLowerCase();return ee?n.options.filter(ye=>ye.label.toLowerCase().includes(ee)||ye.value.toLowerCase().includes(ee)):n.options});function z(){n.disabled||(a.value=!a.value)}function j(ee){r("update:modelValue",ee),a.value=!1,l.value=""}function oe(){var ee;u.value=!0,c.value=((ee=n.defaultAddValue)==null?void 0:ee.trim())||"",tn(()=>{var ye;return(ye=i.value)==null?void 0:ye.focus()})}function de(){if(l.value.length>0){l.value="";return}a.value=!1}function ve(){const ee=c.value.trim();ee&&(r("add",ee),u.value=!1,c.value="",a.value=!1,l.value="")}function Ie(){u.value=!1,c.value="",a.value=!1,l.value=""}function re(ee){if(!a.value)return;const ye=s.value;if(!ye)return;const te=ee.target;te instanceof Node&&(ye.contains(te)||(a.value=!1,l.value="",u.value=!1,c.value=""))}return mt(a,ee=>{if(!ee){u.value=!1,c.value="";return}b.value&&tn(()=>{var ye;return(ye=o.value)==null?void 0:ye.focus()})}),ir(()=>{window.addEventListener("pointerdown",re)}),ar(()=>{window.removeEventListener("pointerdown",re)}),(ee,ye)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:z},[m("span",A_,ce(f.value),1),Ce(ui,{class:"composer-dropdown-chevron"})],8,C_),a.value?(w(),T("div",{key:0,class:gt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":h.value==="up","composer-dropdown-menu-wrap-down":h.value==="down"}])},[m("div",R_,[b.value?(w(),T("div",x_,[tr(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ye[0]||(ye[0]=te=>l.value=te),class:"composer-dropdown-search-input",type:"text",placeholder:I.value,onKeydown:Yt(tt(de,["prevent"]),["esc"])},null,40,P_),[[nr,l.value]])])):se("",!0),m("ul",M_,[(w(!0),T(He,null,Et($.value,te=>(w(),T("li",{key:te.value},[m("button",{class:gt(["composer-dropdown-option",{"is-selected":te.value===e.modelValue}]),type:"button",onClick:je=>j(te.value)},ce(te.label),11,O_)]))),128)),$.value.length===0?(w(),T("li",N_," No matching projects ")):se("",!0)]),N.value?(w(),T("div",$_,[u.value?(w(),T(He,{key:0},[tr(m("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ye[1]||(ye[1]=te=>c.value=te),class:"composer-dropdown-add-input",type:"text",placeholder:Y.value,onKeydown:[Yt(tt(ve,["prevent"]),["enter"]),Yt(tt(Ie,["prevent"]),["esc"])]},null,40,D_),[[nr,c.value]]),m("div",{class:"composer-dropdown-add-actions"},[m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ve},"Open"),m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Ie},"Cancel")])],64)):(w(),T("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:oe},ce(O.value),1))])):se("",!0)])],2)):se("",!0)],512))}}),va=st(L_,[["__scopeId","data-v-7cfa2012"]]),j_=["disabled"],B_={class:"search-dropdown-value"},U_={class:"search-dropdown-search-wrap"},F_=["placeholder","onKeydown"],H_={key:0,class:"search-dropdown-list",role:"listbox"},V_=["onClick","onPointerenter"],W_={class:"search-dropdown-option-check"},z_={class:"search-dropdown-option-label"},q_={key:0,class:"search-dropdown-option-desc"},G_={key:1,class:"search-dropdown-empty"},K_=Lt({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(!1),a=L(""),l=L(0),u=pe(()=>n.openDirection??"down"),c=pe(()=>new Set(n.selectedValues)),f=pe(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const $=n.options.find(z=>z.value===n.selectedValues[0]);return($==null?void 0:$.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),h=pe(()=>{const $=a.value.toLowerCase().trim();return $?n.options.filter(z=>{var j;return z.label.toLowerCase().includes($)||(((j=z.description)==null?void 0:j.toLowerCase().includes($))??!1)}):n.options});function b(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,tn(()=>{var $;return($=o.value)==null?void 0:$.focus()})))}function N($){r("toggle",$.value,!c.value.has($.value))}function I($){h.value.length!==0&&(l.value=(l.value+$+h.value.length)%h.value.length)}function O(){const $=h.value[l.value];$&&N($)}function Y($){if(!i.value)return;const z=s.value;if(!z)return;const j=$.target;j instanceof Node&&(z.contains(j)||(i.value=!1))}return mt(a,()=>{l.value=0}),ir(()=>window.addEventListener("pointerdown",Y)),ar(()=>window.removeEventListener("pointerdown",Y)),($,z)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:b},[m("span",B_,ce(f.value),1),Ce(ui,{class:"search-dropdown-chevron"})],8,j_),i.value?(w(),T("div",{key:0,class:gt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":u.value==="up","search-dropdown-menu-wrap-down":u.value==="down"}])},[m("div",U_,[tr(m("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":z[0]||(z[0]=j=>a.value=j),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[z[1]||(z[1]=Yt(tt(j=>i.value=!1,["prevent"]),["escape"])),Yt(tt(O,["prevent"]),["enter"]),z[2]||(z[2]=Yt(tt(j=>I(1),["prevent"]),["arrow-down"])),z[3]||(z[3]=Yt(tt(j=>I(-1),["prevent"]),["arrow-up"]))]},null,40,F_),[[nr,a.value]])]),h.value.length>0?(w(),T("ul",H_,[(w(!0),T(He,null,Et(h.value,(j,oe)=>(w(),T("li",{key:j.value},[m("button",{class:gt(["search-dropdown-option",{"is-selected":c.value.has(j.value),"is-highlighted":oe===l.value}]),type:"button",onClick:de=>N(j),onPointerenter:de=>l.value=oe},[m("span",W_,ce(c.value.has(j.value)?"✓":""),1),m("span",z_,ce(j.label),1),j.description?(w(),T("span",q_,ce(j.description),1)):se("",!0)],42,V_)]))),128))])):(w(),T("div",G_,"No results"))],2)):se("",!0)],512))}}),J_=st(K_,[["__scopeId","data-v-a0f2edd4"]]),Y_={class:"skill-picker-header"},Q_=["onKeydown"],X_={key:0,class:"skill-picker-list",role:"listbox"},Z_=["onClick","onPointerenter"],ek={class:"skill-picker-name"},tk={key:0,class:"skill-picker-desc"},nk={key:1,class:"skill-picker-empty"},rk=Lt({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(""),a=L(0),l=pe(()=>{const h=i.value.toLowerCase().trim();return h?n.skills.filter(b=>b.name.toLowerCase().includes(h)||b.description.toLowerCase().includes(h)):n.skills}),u=pe(()=>{const h={};return n.anchorBottom!=null&&(h.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(h.left=`${n.anchorLeft}px`),h});function c(h){l.value.length!==0&&(a.value=(a.value+h+l.value.length)%l.value.length)}function f(){const h=l.value[a.value];h&&r("select",h)}return mt(()=>n.visible,h=>{h&&(i.value="",a.value=0,tn(()=>{var b;return(b=o.value)==null?void 0:b.focus()}))}),mt(i,()=>{a.value=0}),(h,b)=>e.visible?(w(),T("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:zr(u.value)},[m("div",Y_,[tr(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":b[0]||(b[0]=N=>i.value=N),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[b[1]||(b[1]=Yt(tt(N=>h.$emit("close"),["prevent"]),["escape"])),Yt(tt(f,["prevent"]),["enter"]),b[2]||(b[2]=Yt(tt(N=>c(1),["prevent"]),["arrow-down"])),b[3]||(b[3]=Yt(tt(N=>c(-1),["prevent"]),["arrow-up"]))]},null,40,Q_),[[nr,i.value]])]),l.value.length>0?(w(),T("ul",X_,[(w(!0),T(He,null,Et(l.value,(N,I)=>(w(),T("li",{key:N.path},[m("button",{class:gt(["skill-picker-item",{"is-highlighted":I===a.value}]),type:"button",onClick:O=>h.$emit("select",N),onPointerenter:O=>a.value=I},[m("span",ek,ce(N.name),1),N.description?(w(),T("span",tk,ce(N.description),1)):se("",!0)],42,Z_)]))),128))])):(w(),T("div",nk,"No skills found"))],4)):se("",!0)}}),sk=st(rk,[["__scopeId","data-v-ff3fb7dc"]]),ok={key:0,class:"thread-composer-attachments"},ik=["src","alt"],ak=["aria-label","disabled","onClick"],lk={key:1,class:"thread-composer-file-chips"},ck=["title"],uk=["aria-label","disabled","onClick"],dk={key:2,class:"thread-composer-skill-chips"},fk={class:"thread-composer-skill-chip-name"},hk=["aria-label","onClick"],pk={class:"thread-composer-input-wrap"},mk={key:0,class:"thread-composer-file-mentions"},gk=["onMousedown"],vk={key:1,class:"thread-composer-file-mention-icon-markdown"},yk={class:"thread-composer-file-mention-text"},wk={class:"thread-composer-file-mention-name"},bk={key:0,class:"thread-composer-file-mention-dir"},_k={key:1,class:"thread-composer-file-mention-empty"},kk=["placeholder","disabled"],Tk={class:"thread-composer-controls"},Ik=["disabled"],Sk={key:0,class:"thread-composer-attach-menu"},Ek=["disabled"],Ck=["disabled"],Ak={class:"thread-composer-actions"},Rk=["aria-label","title","disabled"],xk=["disabled"],Pk=["aria-label","title","disabled"],Mk=["disabled"],Ok=["disabled"],Nk=Lt({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=L(""),o=L([]),i=L([]),a=L([]),{state:l,isSupported:u,startRecording:c,stopRecording:f}=_b({onTranscript:U=>{s.value=s.value?`${s.value}
43
- ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L(""),j=L([]),oe=L(!1),de=L(0);let ve=0,Ie=null;const re=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),ee=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],ye=pe(()=>n.models.map(U=>({value:U,label:U}))),te=pe(()=>n.skills??[]),je=pe(()=>i.value.map(U=>U.path)),Be=pe(()=>(n.skills??[]).map(U=>({value:U.path,label:U.name,description:U.description}))),Qe=pe(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Re=pe(()=>n.disabled||!n.activeThreadId),Te=pe(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),$e=pe(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function It(U="steer"){var ne;const K=s.value.trim();if(Qe.value){if(r("submit",{text:K,imageUrls:o.value.map(Je=>Je.url),fileAttachments:[...a.value],skills:i.value.map(Je=>({name:Je.name,path:Je.path})),mode:U}),s.value="",o.value=[],i.value=[],a.value=[],O.value=!1,Y.value=!1,D(),re){(ne=I.value)==null||ne.blur();return}tn(()=>{var Je;return(Je=I.value)==null?void 0:Je.focus()})}}function nt(){r("interrupt")}function Xe(U){r("update:selected-model",U)}function Ze(U){r("update:selected-reasoning-effort",U)}function ht(){Re.value||(O.value=!O.value)}function Rt(){var U;(U=b.value)==null||U.click()}function Ge(){var U;(U=N.value)==null||U.click()}function et(U){o.value=o.value.filter(K=>K.id!==U)}function W(U){i.value=i.value.filter(K=>K.path!==U)}function me(U){a.value=a.value.filter(K=>K.fsPath!==U)}function ie(U){const K=U.replace(/\\/g,"/");if(a.value.some(it=>it.fsPath===K))return;const ne=K.split("/").filter(Boolean),Je=ne[ne.length-1]??K;a.value=[...a.value,{label:Je,path:K,fsPath:K}]}function fe(U){return U.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(U.name)}function De(U){if(!(!U||U.length===0))for(const K of Array.from(U))if(fe(K)){const ne=new FileReader;ne.onload=()=>{typeof ne.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:K.name,url:ne.result})},ne.readAsDataURL(K)}else p_(K).then(ne=>{ne&&ie(ne)}).catch(()=>{})}function g(U){U&&(U.value="")}function v(U){const K=U.target;De((K==null?void 0:K.files)??null),g(K),O.value=!1}function A(U){const K=U.target;De((K==null?void 0:K.files)??null),g(K),O.value=!1}function H(){const K=s.value.startsWith("/");K!==Y.value&&(Y.value=K),B()}function F(U){if(oe.value){if(U.key==="Escape"){U.preventDefault(),D();return}if(U.key==="ArrowDown"){U.preventDefault(),j.value.length>0&&(de.value=(de.value+1)%j.value.length);return}if(U.key==="ArrowUp"){if(U.preventDefault(),j.value.length>0){const ne=j.value.length;de.value=(de.value+ne-1)%ne}return}if(U.key==="Enter"||U.key==="Tab"){U.preventDefault();const ne=j.value[de.value];ne?V(ne):D();return}}if(n.sendWithEnter!==!1?U.key==="Enter"&&!U.shiftKey:U.key==="Enter"&&(U.metaKey||U.ctrlKey)){U.preventDefault(),It(n.isTurnInProgress?Te.value:"steer");return}if(Y.value){if(U.key==="Escape"){U.preventDefault(),x();return}if(U.key==="ArrowDown"||U.key==="ArrowUp"){U.preventDefault();return}}}function x(){var U;Y.value=!1,(U=I.value)==null||U.focus()}function D(){oe.value=!1,$.value=null,z.value="",j.value=[],de.value=0}function B(){const U=I.value;if(!U){D();return}const K=U.selectionStart??s.value.length,Je=s.value.slice(0,K).match(/(^|\s)(@[^\s@]*)$/);if(!Je){D();return}const it=Je[2]??"",kt=it.length,xt=K-kt;$.value=xt,z.value=it.slice(1),oe.value=!0,G()}async function G(){if(!oe.value)return;const U=(n.cwd??"").trim();if(!U){j.value=[];return}Ie&&clearTimeout(Ie);const K=++ve;Ie=setTimeout(async()=>{try{const ne=await c_(U,z.value,20);if(!oe.value||K!==ve)return;j.value=ne,de.value=0}catch{if(!oe.value||K!==ve)return;j.value=[]}},120)}function V(U){const K=I.value,ne=$.value;if(ne!==null&&K){const Je=K.selectionStart??s.value.length;s.value=`${s.value.slice(0,ne)}${s.value.slice(Je)}`.trimEnd()}ie(U.path),D(),tn(()=>K==null?void 0:K.focus())}function be(U){const K=U.lastIndexOf("/");return K<0?U:U.slice(K+1)}function ae(U){const K=U.lastIndexOf("/");return K<=0?"":U.slice(0,K)}function he(U){const K=be(U),ne=K.lastIndexOf(".");return ne<=0?"":K.slice(ne+1).toLowerCase()}function Se(U){const K=he(U);return K==="ts"?"TS":K==="tsx"?"TSX":K==="js"?"JS":K==="jsx"?"JSX":K==="json"?"{}":""}function Me(U){const K=he(U);return K.startsWith("ts")?"ts":K.startsWith("js")?"js":K==="json"?"json":"default"}function Ke(U){const K=he(U);return K==="md"||K==="mdx"}function Pe(U){var K;i.value.some(ne=>ne.path===U.path)||(i.value=[...i.value,U]),s.value=s.value.startsWith("/")?"":s.value,Y.value=!1,(K=I.value)==null||K.focus()}function Ve(U,K){if(K){const ne=(n.skills??[]).find(Je=>Je.path===U);ne&&!i.value.some(Je=>Je.path===U)&&(i.value=[...i.value,ne])}else i.value=i.value.filter(ne=>ne.path!==U)}function _t(U){if(!O.value)return;const K=h.value;if(!K)return;const ne=U.target;!ne||K.contains(ne)||(O.value=!1)}return ir(()=>{document.addEventListener("click",_t)}),ar(()=>{document.removeEventListener("click",_t),Ie&&clearTimeout(Ie)}),mt(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],O.value=!1,Y.value=!1,D()}),mt(()=>n.cwd,()=>{oe.value&&G()}),(U,K)=>(w(),T("form",{class:"thread-composer",onSubmit:K[7]||(K[7]=tt(ne=>It("steer"),["prevent"]))},[m("div",{class:gt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(w(),T("div",ok,[(w(!0),T(He,null,Et(o.value,ne=>(w(),T("div",{key:ne.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:ne.url,alt:ne.name||"Selected image"},null,8,ik),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${ne.name||"image"}`,disabled:Re.value,onClick:Je=>et(ne.id)}," x ",8,ak)]))),128))])):se("",!0),a.value.length>0?(w(),T("div",lk,[(w(!0),T(He,null,Et(a.value,ne=>(w(),T("span",{key:ne.fsPath,class:"thread-composer-file-chip"},[Ce(Fo,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:ne.fsPath},ce(ne.label),9,ck),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${ne.label}`,disabled:Re.value,onClick:Je=>me(ne.fsPath)},"×",8,uk)]))),128))])):se("",!0),i.value.length>0?(w(),T("div",dk,[(w(!0),T(He,null,Et(i.value,ne=>(w(),T("span",{key:ne.path,class:"thread-composer-skill-chip"},[m("span",fk,ce(ne.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${ne.name}`,onClick:Je=>W(ne.path)},"×",8,hk)]))),128))])):se("",!0),m("div",pk,[oe.value?(w(),T("div",mk,[j.value.length>0?(w(!0),T(He,{key:0},Et(j.value,(ne,Je)=>(w(),T("button",{key:ne.path,class:gt(["thread-composer-file-mention-row",{"is-active":Je===de.value}]),type:"button",onMousedown:tt(it=>V(ne),["prevent"])},[Se(ne.path)?(w(),T("span",{key:0,class:gt(["thread-composer-file-mention-icon-badge",`is-${Me(ne.path)}`])},ce(Se(ne.path)),3)):Ke(ne.path)?(w(),T("span",vk,"↓")):(w(),yt(Fo,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",yk,[m("span",wk,ce(be(ne.path)),1),ae(ne.path)?(w(),T("span",bk,ce(ae(ne.path)),1)):se("",!0)])],42,gk))),128)):(w(),T("div",_k,"No matching files"))])):se("",!0),tr(m("textarea",{ref_key:"inputRef",ref:I,"onUpdate:modelValue":K[0]||(K[0]=ne=>s.value=ne),class:"thread-composer-input",placeholder:$e.value,disabled:Re.value,onInput:H,onKeydown:F},null,40,kk),[[nr,s.value]]),Ce(sk,{skills:te.value,visible:Y.value,"anchor-bottom":44,"anchor-left":0,onSelect:Pe,onClose:x},null,8,["skills","visible"])]),m("div",Tk,[m("div",{ref_key:"attachMenuRootRef",ref:h,class:"thread-composer-attach"},[m("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Re.value,onClick:ht}," + ",8,Ik),O.value?(w(),T("div",Sk,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:Re.value,onClick:Rt}," Add photos & files ",8,Ek),m("button",{class:"thread-composer-attach-item",type:"button",disabled:Re.value,onClick:Ge}," Take photo ",8,Ck)])):se("",!0)],512),Ce(va,{class:"thread-composer-control","model-value":e.selectedModel,options:ye.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":Xe},null,8,["model-value","options","disabled"]),Ce(J_,{class:"thread-composer-control",options:Be.value,"selected-values":je.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:Ve},null,8,["options","selected-values","disabled"]),Ce(va,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:ee,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":Ze},null,8,["model-value","disabled"]),m("div",Ak,[ue(u)&&!e.isTurnInProgress?(w(),T("button",{key:0,class:gt(["thread-composer-mic",{"thread-composer-mic--active":ue(l)!=="idle"}]),type:"button","aria-label":ue(l)==="recording"?"Stop dictation":"Hold to dictate",title:ue(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Re.value,onMousedown:K[1]||(K[1]=tt((...ne)=>ue(c)&&ue(c)(...ne),["prevent"])),onMouseup:K[2]||(K[2]=(...ne)=>ue(f)&&ue(f)(...ne)),onMouseleave:K[3]||(K[3]=ne=>ue(l)==="recording"&&ue(f)()),onTouchstart:K[4]||(K[4]=tt((...ne)=>ue(c)&&ue(c)(...ne),["prevent"])),onTouchend:K[5]||(K[5]=(...ne)=>ue(f)&&ue(f)(...ne))},[Ce(k_,{class:"thread-composer-mic-icon"})],42,Rk)):se("",!0),e.isTurnInProgress?(w(),T("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:nt},[Ce(E_,{class:"thread-composer-stop-icon"})],8,xk)):se("",!0),m("button",{class:gt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&Te.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&Te.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${Te.value}`:"Send",disabled:!Qe.value,onClick:K[6]||(K[6]=ne=>It(e.isTurnInProgress?Te.value:"steer"))},[Ce(y_,{class:"thread-composer-submit-icon"})],10,Pk)])])],2),m("input",{ref_key:"photoLibraryInputRef",ref:b,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Re.value,onChange:v},null,40,Mk),m("input",{ref_key:"cameraCaptureInputRef",ref:N,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Re.value,onChange:A},null,40,Ok)],32))}}),Dc=st(Nk,[["__scopeId","data-v-983e7906"]]),$k={key:0,class:"queued-messages"},Dk={class:"queued-messages-inner"},Lk={class:"queued-row-text"},jk={class:"queued-row-actions"},Bk=["onClick"],Uk=["onClick"],Fk=Lt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(w(),T("div",$k,[m("div",Dk,[(w(!0),T(He,null,Et(e.messages,r=>(w(),T("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=m("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("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)),m("span",Lk,ce(r.text),1),m("div",jk,[m("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Bk),m("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]=[m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("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,Uk)])]))),128))])])):se("",!0)}}),Hk=st(Fk,[["__scopeId","data-v-ea583733"]]),Vk={class:"runtime-dropdown-trigger-label"},Wk={key:0,class:"runtime-dropdown-menu-wrap"},zk={class:"runtime-dropdown-menu"},qk=["onClick"],Gk={class:"runtime-dropdown-option-label"},Kk={key:0,class:"runtime-dropdown-option-check"},Jk=Lt({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(!1),i=[{value:"local",label:"Local project",icon:Qd},{value:"worktree",label:"New worktree",icon:Ao}],a=pe(()=>i.find(c=>c.value===n.modelValue)??i[0]);function l(c){r("update:modelValue",c),o.value=!1}function u(c){if(!o.value)return;const f=s.value;if(!f)return;const h=c.target;h instanceof Node&&(f.contains(h)||(o.value=!1))}return ir(()=>{window.addEventListener("pointerdown",u)}),ar(()=>{window.removeEventListener("pointerdown",u)}),(c,f)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[m("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=h=>o.value=!o.value)},[(w(),yt(sa(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),m("span",Vk,ce(a.value.label),1),Ce(ui,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),T("div",Wk,[m("div",zk,[f[1]||(f[1]=m("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),T(He,null,Et(i,h=>m("button",{key:h.value,class:gt(["runtime-dropdown-option",{"is-selected":e.modelValue===h.value}]),type:"button",onClick:b=>l(h.value)},[(w(),yt(sa(h.icon),{class:"runtime-dropdown-option-icon"})),m("span",Gk,ce(h.label),1),e.modelValue===h.value?(w(),T("span",Kk,"✓")):se("",!0)],10,qk)),64))])])):se("",!0)],512))}}),Yk=st(Jk,[["__scopeId","data-v-9c9b71e5"]]),Qk={},Xk={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Zk(e,t){return w(),T("svg",Xk,[...t[0]||(t[0]=[m("circle",{cx:"11",cy:"11",r:"8"},null,-1),m("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const ya=st(Qk,[["render",Zk]]),e0={class:"skill-card-top"},t0=["src","alt"],n0={key:1,class:"skill-card-avatar-fallback"},r0={class:"skill-card-info"},s0={class:"skill-card-header"},o0={class:"skill-card-name"},i0={key:0,class:"skill-card-badge-disabled"},a0={key:1,class:"skill-card-badge"},l0={class:"skill-card-owner"},c0={key:0,class:"skill-card-desc"},u0={key:1,class:"skill-card-date"},d0=Lt({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=pe(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function r(s){const o=s.target;o.style.display="none"}return(s,o)=>(w(),T("button",{class:gt(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[m("div",e0,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,t0)):(w(),T("div",n0,ce(e.skill.owner.charAt(0)),1)),m("div",r0,[m("div",s0,[m("span",o0,ce(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),T("span",i0,"Disabled")):e.skill.installed?(w(),T("span",a0,"Installed")):se("",!0)]),m("span",l0,ce(e.skill.owner),1)])]),e.skill.description?(w(),T("p",c0,ce(e.skill.description),1)):se("",!0),n.value?(w(),T("span",u0,ce(n.value),1)):se("",!0)],2))}}),Lc=st(d0,[["__scopeId","data-v-2a1e8196"]]),f0={class:"sdm-panel"},h0={class:"sdm-header"},p0={class:"sdm-title-area"},m0=["src","alt"],g0={class:"sdm-title-col"},v0={class:"sdm-title-row"},y0={class:"sdm-title"},w0={key:0,class:"sdm-badge-disabled"},b0={class:"sdm-owner"},_0={class:"sdm-body"},k0={key:0,class:"sdm-desc"},T0={key:1,class:"sdm-readme-loading"},I0=["innerHTML"],S0=["href"],E0={class:"sdm-footer"},C0={class:"sdm-footer-actions"},A0=["disabled"],R0=["disabled"],x0=["disabled"],P0=Lt({__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=L(null),o=L(""),i=L(!1),a=pe(()=>s.value??n.skill.enabled??!0),l=pe(()=>n.isInstalling===!0||n.isUninstalling===!0),u=pe(()=>{const I=o.value;if(!I)return"";const O=I.replace(/^---[\s\S]*?---\s*/,"");return c(O)});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}),O=await fetch(`/codex-api/skills-hub/readme?${I}`);if(!O.ok)return;const Y=await O.json();o.value=Y.content??""}catch{}finally{i.value=!1}}}mt(()=>n.visible,I=>{I&&(s.value=null,o.value="",f())});function h(){r("install",n.skill)}function b(){r("uninstall",n.skill)}function N(){const I=!a.value;s.value=I,r("toggle-enabled",n.skill,I)}return(I,O)=>(w(),yt(Do,{to:"body"},[e.visible?(w(),T("div",{key:0,class:"sdm-overlay",onClick:O[1]||(O[1]=tt(Y=>I.$emit("close"),["self"]))},[m("div",f0,[m("div",h0,[m("div",p0,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,m0)):se("",!0),m("div",g0,[m("div",v0,[m("h3",y0,ce(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),T("span",w0,"Disabled")):se("",!0)]),m("span",b0,ce(e.skill.owner),1)])]),m("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:O[0]||(O[0]=Y=>I.$emit("close"))},[Ce(Xa,{class:"sdm-close-icon"})])]),m("div",_0,[e.skill.description?(w(),T("p",k0,ce(e.skill.description),1)):se("",!0),i.value?(w(),T("div",T0,"Loading skill contents...")):o.value?(w(),T("div",{key:2,class:"sdm-readme",innerHTML:u.value},null,8,I0)):se("",!0),m("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,S0)]),m("div",E0,[m("div",C0,[e.skill.installed?(w(),T("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:b},ce(n.isUninstalling?"Uninstalling...":"Uninstall"),9,A0)):(w(),T("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:h},ce(n.isInstalling?"Installing...":"Install"),9,R0)),e.skill.installed?(w(),T("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:N},ce(a.value?"Disable":"Enable"),9,x0)):se("",!0)])])])])):se("",!0)]))}}),M0=st(P0,[["__scopeId","data-v-19a385ca"]]),O0=()=>{};var jc={};/**
42
+ `}async function $i(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:Zb(t,i)}];for(const f of n){const h=f.trim();h&&l.push({type:"image",url:h,image_url:h})}if(o)for(const f of o)l.push({type:"skill",name:f.name,path:f.path});const u=i.map(f=>({label:f.label,path:f.path,fsPath:f.fsPath})),c={threadId:e,input:l};u.length>0&&(c.attachments=u),typeof r=="string"&&r.length>0&&(c.model=r),typeof s=="string"&&s.length>0&&(c.effort=s),await nn("turn/start",c)}catch(a){throw ys(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function e_(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 nn("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw ys(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function t_(e){await nn("setDefaultModel",{model:e})}async function n_(){const e=await nn("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 r_(){const e=await nn("config/read",{}),t=e.config.model??"",n=Hb(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function s_(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 ma(){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 s_(n.data)}async function o_(e){const t=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e})}),n=await t.json();if(!t.ok||!n.data)throw new Error(n.error||"Failed to create worktree");return n.data}async function Nc(){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 i_(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 a_(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=Za(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 l_(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=Za(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 c_(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 u=Za(o,"Failed to search files");throw new Error(u)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const u of a){if(!u||typeof u!="object"||Array.isArray(u))continue;const f=u.path,h=typeof f=="string"?f.trim():"";h&&l.push({path:h})}return l}async function u_(e,t=200){const n=await fetch("/codex-api/thread-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,limit:t})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to search threads");return r.data??{threadIds:[],indexedThreadCount:0}}function Za(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 d_(){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 Di(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 f_(e,t){var n;try{return((n=(await nn("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function h_(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await nn("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 p_(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 m_={},g_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function v_(e,t){return w(),T("svg",g_,[...t[0]||(t[0]=[m("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 y_=rt(m_,[["render",v_]]),w_={},b_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function __(e,t){return w(),T("svg",b_,[...t[0]||(t[0]=[m("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 k_=rt(w_,[["render",__]]),T_={},I_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function S_(e,t){return w(),T("svg",I_,[...t[0]||(t[0]=[m("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),m("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 E_=rt(T_,[["render",S_]]),C_=["disabled"],A_={class:"composer-dropdown-value"},R_={class:"composer-dropdown-menu"},P_={key:0,class:"composer-dropdown-search-wrap"},x_=["placeholder","onKeydown"],M_={class:"composer-dropdown-options",role:"listbox"},O_=["onClick"],N_={key:0,class:"composer-dropdown-empty"},$_={key:1,class:"composer-dropdown-add-wrap"},D_=["placeholder","onKeydown"],L_=Lt({__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=L(null),o=L(null),i=L(null),a=L(!1),l=L(""),u=L(!1),c=L(""),f=pe(()=>{var ye;const ee=n.options.find(te=>te.value===n.modelValue);return ee?ee.label:((ye=n.placeholder)==null?void 0:ye.trim())||""}),h=pe(()=>n.openDirection??"down"),b=pe(()=>n.enableSearch===!0),N=pe(()=>n.showAddAction===!0),I=pe(()=>{var ee;return((ee=n.searchPlaceholder)==null?void 0:ee.trim())||"Quick search projects"}),O=pe(()=>{var ee;return((ee=n.addActionLabel)==null?void 0:ee.trim())||"Add new project"}),Y=pe(()=>{var ee;return((ee=n.addPlaceholder)==null?void 0:ee.trim())||"Project name or absolute path"}),$=pe(()=>{const ee=l.value.trim().toLowerCase();return ee?n.options.filter(ye=>ye.label.toLowerCase().includes(ee)||ye.value.toLowerCase().includes(ee)):n.options});function q(){n.disabled||(a.value=!a.value)}function j(ee){r("update:modelValue",ee),a.value=!1,l.value=""}function oe(){var ee;u.value=!0,c.value=((ee=n.defaultAddValue)==null?void 0:ee.trim())||"",tn(()=>{var ye;return(ye=i.value)==null?void 0:ye.focus()})}function de(){if(l.value.length>0){l.value="";return}a.value=!1}function ve(){const ee=c.value.trim();ee&&(r("add",ee),u.value=!1,c.value="",a.value=!1,l.value="")}function Ie(){u.value=!1,c.value="",a.value=!1,l.value=""}function re(ee){if(!a.value)return;const ye=s.value;if(!ye)return;const te=ee.target;te instanceof Node&&(ye.contains(te)||(a.value=!1,l.value="",u.value=!1,c.value=""))}return pt(a,ee=>{if(!ee){u.value=!1,c.value="";return}b.value&&tn(()=>{var ye;return(ye=o.value)==null?void 0:ye.focus()})}),or(()=>{window.addEventListener("pointerdown",re)}),ir(()=>{window.removeEventListener("pointerdown",re)}),(ee,ye)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:q},[m("span",A_,ce(f.value),1),Ce(ui,{class:"composer-dropdown-chevron"})],8,C_),a.value?(w(),T("div",{key:0,class:mt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":h.value==="up","composer-dropdown-menu-wrap-down":h.value==="down"}])},[m("div",R_,[b.value?(w(),T("div",P_,[er(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ye[0]||(ye[0]=te=>l.value=te),class:"composer-dropdown-search-input",type:"text",placeholder:I.value,onKeydown:Qt(tt(de,["prevent"]),["esc"])},null,40,x_),[[tr,l.value]])])):se("",!0),m("ul",M_,[(w(!0),T(He,null,Et($.value,te=>(w(),T("li",{key:te.value},[m("button",{class:mt(["composer-dropdown-option",{"is-selected":te.value===e.modelValue}]),type:"button",onClick:je=>j(te.value)},ce(te.label),11,O_)]))),128)),$.value.length===0?(w(),T("li",N_," No matching projects ")):se("",!0)]),N.value?(w(),T("div",$_,[u.value?(w(),T(He,{key:0},[er(m("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ye[1]||(ye[1]=te=>c.value=te),class:"composer-dropdown-add-input",type:"text",placeholder:Y.value,onKeydown:[Qt(tt(ve,["prevent"]),["enter"]),Qt(tt(Ie,["prevent"]),["esc"])]},null,40,D_),[[tr,c.value]]),m("div",{class:"composer-dropdown-add-actions"},[m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ve},"Open"),m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Ie},"Cancel")])],64)):(w(),T("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:oe},ce(O.value),1))])):se("",!0)])],2)):se("",!0)],512))}}),ga=rt(L_,[["__scopeId","data-v-7cfa2012"]]),j_=["disabled"],B_={class:"search-dropdown-value"},U_={class:"search-dropdown-search-wrap"},F_=["placeholder","onKeydown"],H_={key:0,class:"search-dropdown-list",role:"listbox"},V_=["onClick","onPointerenter"],W_={class:"search-dropdown-option-check"},q_={class:"search-dropdown-option-label"},z_={key:0,class:"search-dropdown-option-desc"},G_={key:1,class:"search-dropdown-empty"},K_=Lt({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(!1),a=L(""),l=L(0),u=pe(()=>n.openDirection??"down"),c=pe(()=>new Set(n.selectedValues)),f=pe(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const $=n.options.find(q=>q.value===n.selectedValues[0]);return($==null?void 0:$.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),h=pe(()=>{const $=a.value.toLowerCase().trim();return $?n.options.filter(q=>{var j;return q.label.toLowerCase().includes($)||(((j=q.description)==null?void 0:j.toLowerCase().includes($))??!1)}):n.options});function b(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,tn(()=>{var $;return($=o.value)==null?void 0:$.focus()})))}function N($){r("toggle",$.value,!c.value.has($.value))}function I($){h.value.length!==0&&(l.value=(l.value+$+h.value.length)%h.value.length)}function O(){const $=h.value[l.value];$&&N($)}function Y($){if(!i.value)return;const q=s.value;if(!q)return;const j=$.target;j instanceof Node&&(q.contains(j)||(i.value=!1))}return pt(a,()=>{l.value=0}),or(()=>window.addEventListener("pointerdown",Y)),ir(()=>window.removeEventListener("pointerdown",Y)),($,q)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:b},[m("span",B_,ce(f.value),1),Ce(ui,{class:"search-dropdown-chevron"})],8,j_),i.value?(w(),T("div",{key:0,class:mt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":u.value==="up","search-dropdown-menu-wrap-down":u.value==="down"}])},[m("div",U_,[er(m("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":q[0]||(q[0]=j=>a.value=j),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[q[1]||(q[1]=Qt(tt(j=>i.value=!1,["prevent"]),["escape"])),Qt(tt(O,["prevent"]),["enter"]),q[2]||(q[2]=Qt(tt(j=>I(1),["prevent"]),["arrow-down"])),q[3]||(q[3]=Qt(tt(j=>I(-1),["prevent"]),["arrow-up"]))]},null,40,F_),[[tr,a.value]])]),h.value.length>0?(w(),T("ul",H_,[(w(!0),T(He,null,Et(h.value,(j,oe)=>(w(),T("li",{key:j.value},[m("button",{class:mt(["search-dropdown-option",{"is-selected":c.value.has(j.value),"is-highlighted":oe===l.value}]),type:"button",onClick:de=>N(j),onPointerenter:de=>l.value=oe},[m("span",W_,ce(c.value.has(j.value)?"✓":""),1),m("span",q_,ce(j.label),1),j.description?(w(),T("span",z_,ce(j.description),1)):se("",!0)],42,V_)]))),128))])):(w(),T("div",G_,"No results"))],2)):se("",!0)],512))}}),J_=rt(K_,[["__scopeId","data-v-a0f2edd4"]]),Y_={class:"skill-picker-header"},Q_=["onKeydown"],X_={key:0,class:"skill-picker-list",role:"listbox"},Z_=["onClick","onPointerenter"],ek={class:"skill-picker-name"},tk={key:0,class:"skill-picker-desc"},nk={key:1,class:"skill-picker-empty"},rk=Lt({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(""),a=L(0),l=pe(()=>{const h=i.value.toLowerCase().trim();return h?n.skills.filter(b=>b.name.toLowerCase().includes(h)||b.description.toLowerCase().includes(h)):n.skills}),u=pe(()=>{const h={};return n.anchorBottom!=null&&(h.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(h.left=`${n.anchorLeft}px`),h});function c(h){l.value.length!==0&&(a.value=(a.value+h+l.value.length)%l.value.length)}function f(){const h=l.value[a.value];h&&r("select",h)}return pt(()=>n.visible,h=>{h&&(i.value="",a.value=0,tn(()=>{var b;return(b=o.value)==null?void 0:b.focus()}))}),pt(i,()=>{a.value=0}),(h,b)=>e.visible?(w(),T("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:qr(u.value)},[m("div",Y_,[er(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":b[0]||(b[0]=N=>i.value=N),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[b[1]||(b[1]=Qt(tt(N=>h.$emit("close"),["prevent"]),["escape"])),Qt(tt(f,["prevent"]),["enter"]),b[2]||(b[2]=Qt(tt(N=>c(1),["prevent"]),["arrow-down"])),b[3]||(b[3]=Qt(tt(N=>c(-1),["prevent"]),["arrow-up"]))]},null,40,Q_),[[tr,i.value]])]),l.value.length>0?(w(),T("ul",X_,[(w(!0),T(He,null,Et(l.value,(N,I)=>(w(),T("li",{key:N.path},[m("button",{class:mt(["skill-picker-item",{"is-highlighted":I===a.value}]),type:"button",onClick:O=>h.$emit("select",N),onPointerenter:O=>a.value=I},[m("span",ek,ce(N.name),1),N.description?(w(),T("span",tk,ce(N.description),1)):se("",!0)],42,Z_)]))),128))])):(w(),T("div",nk,"No skills found"))],4)):se("",!0)}}),sk=rt(rk,[["__scopeId","data-v-ff3fb7dc"]]),ok={key:0,class:"thread-composer-attachments"},ik=["src","alt"],ak=["aria-label","disabled","onClick"],lk={key:1,class:"thread-composer-file-chips"},ck=["title"],uk=["aria-label","disabled","onClick"],dk={key:2,class:"thread-composer-skill-chips"},fk={class:"thread-composer-skill-chip-name"},hk=["aria-label","onClick"],pk={class:"thread-composer-input-wrap"},mk={key:0,class:"thread-composer-file-mentions"},gk=["onMousedown"],vk={key:1,class:"thread-composer-file-mention-icon-markdown"},yk={class:"thread-composer-file-mention-text"},wk={class:"thread-composer-file-mention-name"},bk={key:0,class:"thread-composer-file-mention-dir"},_k={key:1,class:"thread-composer-file-mention-empty"},kk=["placeholder","disabled"],Tk={class:"thread-composer-controls"},Ik=["disabled"],Sk={key:0,class:"thread-composer-attach-menu"},Ek=["disabled"],Ck=["disabled"],Ak={class:"thread-composer-actions"},Rk=["aria-label","title","disabled"],Pk=["disabled"],xk=["aria-label","title","disabled"],Mk=["disabled"],Ok=["disabled"],Nk=Lt({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=L(""),o=L([]),i=L([]),a=L([]),{state:l,isSupported:u,startRecording:c,stopRecording:f}=_b({onTranscript:U=>{s.value=s.value?`${s.value}
43
+ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),q=L(""),j=L([]),oe=L(!1),de=L(0);let ve=0,Ie=null;const re=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),ee=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],ye=pe(()=>n.models.map(U=>({value:U,label:U}))),te=pe(()=>n.skills??[]),je=pe(()=>i.value.map(U=>U.path)),Be=pe(()=>(n.skills??[]).map(U=>({value:U.path,label:U.name,description:U.description}))),Ye=pe(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Re=pe(()=>n.disabled||!n.activeThreadId),Te=pe(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),$e=pe(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function Tt(U="steer"){var ne;const K=s.value.trim();if(Ye.value){if(r("submit",{text:K,imageUrls:o.value.map(Je=>Je.url),fileAttachments:[...a.value],skills:i.value.map(Je=>({name:Je.name,path:Je.path})),mode:U}),s.value="",o.value=[],i.value=[],a.value=[],O.value=!1,Y.value=!1,D(),re){(ne=I.value)==null||ne.blur();return}tn(()=>{var Je;return(Je=I.value)==null?void 0:Je.focus()})}}function nt(){r("interrupt")}function Qe(U){r("update:selected-model",U)}function Xe(U){r("update:selected-reasoning-effort",U)}function ft(){Re.value||(O.value=!O.value)}function Rt(){var U;(U=b.value)==null||U.click()}function Ge(){var U;(U=N.value)==null||U.click()}function et(U){o.value=o.value.filter(K=>K.id!==U)}function W(U){i.value=i.value.filter(K=>K.path!==U)}function me(U){a.value=a.value.filter(K=>K.fsPath!==U)}function ie(U){const K=U.replace(/\\/g,"/");if(a.value.some(ot=>ot.fsPath===K))return;const ne=K.split("/").filter(Boolean),Je=ne[ne.length-1]??K;a.value=[...a.value,{label:Je,path:K,fsPath:K}]}function fe(U){return U.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(U.name)}function De(U){if(!(!U||U.length===0))for(const K of Array.from(U))if(fe(K)){const ne=new FileReader;ne.onload=()=>{typeof ne.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:K.name,url:ne.result})},ne.readAsDataURL(K)}else p_(K).then(ne=>{ne&&ie(ne)}).catch(()=>{})}function g(U){U&&(U.value="")}function v(U){const K=U.target;De((K==null?void 0:K.files)??null),g(K),O.value=!1}function A(U){const K=U.target;De((K==null?void 0:K.files)??null),g(K),O.value=!1}function H(){const K=s.value.startsWith("/");K!==Y.value&&(Y.value=K),B()}function F(U){if(oe.value){if(U.key==="Escape"){U.preventDefault(),D();return}if(U.key==="ArrowDown"){U.preventDefault(),j.value.length>0&&(de.value=(de.value+1)%j.value.length);return}if(U.key==="ArrowUp"){if(U.preventDefault(),j.value.length>0){const ne=j.value.length;de.value=(de.value+ne-1)%ne}return}if(U.key==="Enter"||U.key==="Tab"){U.preventDefault();const ne=j.value[de.value];ne?V(ne):D();return}}if(n.sendWithEnter!==!1?U.key==="Enter"&&!U.shiftKey:U.key==="Enter"&&(U.metaKey||U.ctrlKey)){U.preventDefault(),Tt(n.isTurnInProgress?Te.value:"steer");return}if(Y.value){if(U.key==="Escape"){U.preventDefault(),P();return}if(U.key==="ArrowDown"||U.key==="ArrowUp"){U.preventDefault();return}}}function P(){var U;Y.value=!1,(U=I.value)==null||U.focus()}function D(){oe.value=!1,$.value=null,q.value="",j.value=[],de.value=0}function B(){const U=I.value;if(!U){D();return}const K=U.selectionStart??s.value.length,Je=s.value.slice(0,K).match(/(^|\s)(@[^\s@]*)$/);if(!Je){D();return}const ot=Je[2]??"",bt=ot.length,Pt=K-bt;$.value=Pt,q.value=ot.slice(1),oe.value=!0,G()}async function G(){if(!oe.value)return;const U=(n.cwd??"").trim();if(!U){j.value=[];return}Ie&&clearTimeout(Ie);const K=++ve;Ie=setTimeout(async()=>{try{const ne=await c_(U,q.value,20);if(!oe.value||K!==ve)return;j.value=ne,de.value=0}catch{if(!oe.value||K!==ve)return;j.value=[]}},120)}function V(U){const K=I.value,ne=$.value;if(ne!==null&&K){const Je=K.selectionStart??s.value.length;s.value=`${s.value.slice(0,ne)}${s.value.slice(Je)}`.trimEnd()}ie(U.path),D(),tn(()=>K==null?void 0:K.focus())}function be(U){const K=U.lastIndexOf("/");return K<0?U:U.slice(K+1)}function ae(U){const K=U.lastIndexOf("/");return K<=0?"":U.slice(0,K)}function he(U){const K=be(U),ne=K.lastIndexOf(".");return ne<=0?"":K.slice(ne+1).toLowerCase()}function Se(U){const K=he(U);return K==="ts"?"TS":K==="tsx"?"TSX":K==="js"?"JS":K==="jsx"?"JSX":K==="json"?"{}":""}function Me(U){const K=he(U);return K.startsWith("ts")?"ts":K.startsWith("js")?"js":K==="json"?"json":"default"}function Ke(U){const K=he(U);return K==="md"||K==="mdx"}function xe(U){var K;i.value.some(ne=>ne.path===U.path)||(i.value=[...i.value,U]),s.value=s.value.startsWith("/")?"":s.value,Y.value=!1,(K=I.value)==null||K.focus()}function Ve(U,K){if(K){const ne=(n.skills??[]).find(Je=>Je.path===U);ne&&!i.value.some(Je=>Je.path===U)&&(i.value=[...i.value,ne])}else i.value=i.value.filter(ne=>ne.path!==U)}function wt(U){if(!O.value)return;const K=h.value;if(!K)return;const ne=U.target;!ne||K.contains(ne)||(O.value=!1)}return or(()=>{document.addEventListener("click",wt)}),ir(()=>{document.removeEventListener("click",wt),Ie&&clearTimeout(Ie)}),pt(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],O.value=!1,Y.value=!1,D()}),pt(()=>n.cwd,()=>{oe.value&&G()}),(U,K)=>(w(),T("form",{class:"thread-composer",onSubmit:K[7]||(K[7]=tt(ne=>Tt("steer"),["prevent"]))},[m("div",{class:mt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(w(),T("div",ok,[(w(!0),T(He,null,Et(o.value,ne=>(w(),T("div",{key:ne.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:ne.url,alt:ne.name||"Selected image"},null,8,ik),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${ne.name||"image"}`,disabled:Re.value,onClick:Je=>et(ne.id)}," x ",8,ak)]))),128))])):se("",!0),a.value.length>0?(w(),T("div",lk,[(w(!0),T(He,null,Et(a.value,ne=>(w(),T("span",{key:ne.fsPath,class:"thread-composer-file-chip"},[Ce(Fo,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:ne.fsPath},ce(ne.label),9,ck),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${ne.label}`,disabled:Re.value,onClick:Je=>me(ne.fsPath)},"×",8,uk)]))),128))])):se("",!0),i.value.length>0?(w(),T("div",dk,[(w(!0),T(He,null,Et(i.value,ne=>(w(),T("span",{key:ne.path,class:"thread-composer-skill-chip"},[m("span",fk,ce(ne.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${ne.name}`,onClick:Je=>W(ne.path)},"×",8,hk)]))),128))])):se("",!0),m("div",pk,[oe.value?(w(),T("div",mk,[j.value.length>0?(w(!0),T(He,{key:0},Et(j.value,(ne,Je)=>(w(),T("button",{key:ne.path,class:mt(["thread-composer-file-mention-row",{"is-active":Je===de.value}]),type:"button",onMousedown:tt(ot=>V(ne),["prevent"])},[Se(ne.path)?(w(),T("span",{key:0,class:mt(["thread-composer-file-mention-icon-badge",`is-${Me(ne.path)}`])},ce(Se(ne.path)),3)):Ke(ne.path)?(w(),T("span",vk,"↓")):(w(),gt(Fo,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",yk,[m("span",wk,ce(be(ne.path)),1),ae(ne.path)?(w(),T("span",bk,ce(ae(ne.path)),1)):se("",!0)])],42,gk))),128)):(w(),T("div",_k,"No matching files"))])):se("",!0),er(m("textarea",{ref_key:"inputRef",ref:I,"onUpdate:modelValue":K[0]||(K[0]=ne=>s.value=ne),class:"thread-composer-input",placeholder:$e.value,disabled:Re.value,onInput:H,onKeydown:F},null,40,kk),[[tr,s.value]]),Ce(sk,{skills:te.value,visible:Y.value,"anchor-bottom":44,"anchor-left":0,onSelect:xe,onClose:P},null,8,["skills","visible"])]),m("div",Tk,[m("div",{ref_key:"attachMenuRootRef",ref:h,class:"thread-composer-attach"},[m("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Re.value,onClick:ft}," + ",8,Ik),O.value?(w(),T("div",Sk,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:Re.value,onClick:Rt}," Add photos & files ",8,Ek),m("button",{class:"thread-composer-attach-item",type:"button",disabled:Re.value,onClick:Ge}," Take photo ",8,Ck)])):se("",!0)],512),Ce(ga,{class:"thread-composer-control","model-value":e.selectedModel,options:ye.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":Qe},null,8,["model-value","options","disabled"]),Ce(J_,{class:"thread-composer-control",options:Be.value,"selected-values":je.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:Ve},null,8,["options","selected-values","disabled"]),Ce(ga,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:ee,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":Xe},null,8,["model-value","disabled"]),m("div",Ak,[ue(u)&&!e.isTurnInProgress?(w(),T("button",{key:0,class:mt(["thread-composer-mic",{"thread-composer-mic--active":ue(l)!=="idle"}]),type:"button","aria-label":ue(l)==="recording"?"Stop dictation":"Hold to dictate",title:ue(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Re.value,onMousedown:K[1]||(K[1]=tt((...ne)=>ue(c)&&ue(c)(...ne),["prevent"])),onMouseup:K[2]||(K[2]=(...ne)=>ue(f)&&ue(f)(...ne)),onMouseleave:K[3]||(K[3]=ne=>ue(l)==="recording"&&ue(f)()),onTouchstart:K[4]||(K[4]=tt((...ne)=>ue(c)&&ue(c)(...ne),["prevent"])),onTouchend:K[5]||(K[5]=(...ne)=>ue(f)&&ue(f)(...ne))},[Ce(k_,{class:"thread-composer-mic-icon"})],42,Rk)):se("",!0),e.isTurnInProgress?(w(),T("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:nt},[Ce(E_,{class:"thread-composer-stop-icon"})],8,Pk)):se("",!0),m("button",{class:mt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&Te.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&Te.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${Te.value}`:"Send",disabled:!Ye.value,onClick:K[6]||(K[6]=ne=>Tt(e.isTurnInProgress?Te.value:"steer"))},[Ce(y_,{class:"thread-composer-submit-icon"})],10,xk)])])],2),m("input",{ref_key:"photoLibraryInputRef",ref:b,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Re.value,onChange:v},null,40,Mk),m("input",{ref_key:"cameraCaptureInputRef",ref:N,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Re.value,onChange:A},null,40,Ok)],32))}}),$c=rt(Nk,[["__scopeId","data-v-983e7906"]]),$k={key:0,class:"queued-messages"},Dk={class:"queued-messages-inner"},Lk={class:"queued-row-text"},jk={class:"queued-row-actions"},Bk=["onClick"],Uk=["onClick"],Fk=Lt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(w(),T("div",$k,[m("div",Dk,[(w(!0),T(He,null,Et(e.messages,r=>(w(),T("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=m("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("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)),m("span",Lk,ce(r.text),1),m("div",jk,[m("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Bk),m("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]=[m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("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,Uk)])]))),128))])])):se("",!0)}}),Hk=rt(Fk,[["__scopeId","data-v-ea583733"]]),Vk={class:"runtime-dropdown-trigger-label"},Wk={key:0,class:"runtime-dropdown-menu-wrap"},qk={class:"runtime-dropdown-menu"},zk=["onClick"],Gk={class:"runtime-dropdown-option-label"},Kk={key:0,class:"runtime-dropdown-option-check"},Jk=Lt({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(!1),i=[{value:"local",label:"Local project",icon:Yd},{value:"worktree",label:"New worktree",icon:Ao}],a=pe(()=>i.find(c=>c.value===n.modelValue)??i[0]);function l(c){r("update:modelValue",c),o.value=!1}function u(c){if(!o.value)return;const f=s.value;if(!f)return;const h=c.target;h instanceof Node&&(f.contains(h)||(o.value=!1))}return or(()=>{window.addEventListener("pointerdown",u)}),ir(()=>{window.removeEventListener("pointerdown",u)}),(c,f)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[m("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=h=>o.value=!o.value)},[(w(),gt(ra(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),m("span",Vk,ce(a.value.label),1),Ce(ui,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),T("div",Wk,[m("div",qk,[f[1]||(f[1]=m("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),T(He,null,Et(i,h=>m("button",{key:h.value,class:mt(["runtime-dropdown-option",{"is-selected":e.modelValue===h.value}]),type:"button",onClick:b=>l(h.value)},[(w(),gt(ra(h.icon),{class:"runtime-dropdown-option-icon"})),m("span",Gk,ce(h.label),1),e.modelValue===h.value?(w(),T("span",Kk,"✓")):se("",!0)],10,zk)),64))])])):se("",!0)],512))}}),Yk=rt(Jk,[["__scopeId","data-v-9c9b71e5"]]),Qk={},Xk={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Zk(e,t){return w(),T("svg",Xk,[...t[0]||(t[0]=[m("circle",{cx:"11",cy:"11",r:"8"},null,-1),m("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const va=rt(Qk,[["render",Zk]]),e0={class:"skill-card-top"},t0=["src","alt"],n0={key:1,class:"skill-card-avatar-fallback"},r0={class:"skill-card-info"},s0={class:"skill-card-header"},o0={class:"skill-card-name"},i0={key:0,class:"skill-card-badge-disabled"},a0={key:1,class:"skill-card-badge"},l0={class:"skill-card-owner"},c0={key:0,class:"skill-card-desc"},u0={key:1,class:"skill-card-date"},d0=Lt({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=pe(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function r(s){const o=s.target;o.style.display="none"}return(s,o)=>(w(),T("button",{class:mt(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[m("div",e0,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,t0)):(w(),T("div",n0,ce(e.skill.owner.charAt(0)),1)),m("div",r0,[m("div",s0,[m("span",o0,ce(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),T("span",i0,"Disabled")):e.skill.installed?(w(),T("span",a0,"Installed")):se("",!0)]),m("span",l0,ce(e.skill.owner),1)])]),e.skill.description?(w(),T("p",c0,ce(e.skill.description),1)):se("",!0),n.value?(w(),T("span",u0,ce(n.value),1)):se("",!0)],2))}}),Dc=rt(d0,[["__scopeId","data-v-2a1e8196"]]),f0={class:"sdm-panel"},h0={class:"sdm-header"},p0={class:"sdm-title-area"},m0=["src","alt"],g0={class:"sdm-title-col"},v0={class:"sdm-title-row"},y0={class:"sdm-title"},w0={key:0,class:"sdm-badge-disabled"},b0={class:"sdm-owner"},_0={class:"sdm-body"},k0={key:0,class:"sdm-desc"},T0={key:1,class:"sdm-readme-loading"},I0=["innerHTML"],S0=["href"],E0={class:"sdm-footer"},C0={class:"sdm-footer-actions"},A0=["disabled"],R0=["disabled"],P0=["disabled"],x0=Lt({__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=L(null),o=L(""),i=L(!1),a=pe(()=>s.value??n.skill.enabled??!0),l=pe(()=>n.isInstalling===!0||n.isUninstalling===!0),u=pe(()=>{const I=o.value;if(!I)return"";const O=I.replace(/^---[\s\S]*?---\s*/,"");return c(O)});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}),O=await fetch(`/codex-api/skills-hub/readme?${I}`);if(!O.ok)return;const Y=await O.json();o.value=Y.content??""}catch{}finally{i.value=!1}}}pt(()=>n.visible,I=>{I&&(s.value=null,o.value="",f())});function h(){r("install",n.skill)}function b(){r("uninstall",n.skill)}function N(){const I=!a.value;s.value=I,r("toggle-enabled",n.skill,I)}return(I,O)=>(w(),gt(Do,{to:"body"},[e.visible?(w(),T("div",{key:0,class:"sdm-overlay",onClick:O[1]||(O[1]=tt(Y=>I.$emit("close"),["self"]))},[m("div",f0,[m("div",h0,[m("div",p0,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,m0)):se("",!0),m("div",g0,[m("div",v0,[m("h3",y0,ce(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),T("span",w0,"Disabled")):se("",!0)]),m("span",b0,ce(e.skill.owner),1)])]),m("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:O[0]||(O[0]=Y=>I.$emit("close"))},[Ce(Qa,{class:"sdm-close-icon"})])]),m("div",_0,[e.skill.description?(w(),T("p",k0,ce(e.skill.description),1)):se("",!0),i.value?(w(),T("div",T0,"Loading skill contents...")):o.value?(w(),T("div",{key:2,class:"sdm-readme",innerHTML:u.value},null,8,I0)):se("",!0),m("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,S0)]),m("div",E0,[m("div",C0,[e.skill.installed?(w(),T("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:b},ce(n.isUninstalling?"Uninstalling...":"Uninstall"),9,A0)):(w(),T("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:h},ce(n.isInstalling?"Installing...":"Install"),9,R0)),e.skill.installed?(w(),T("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:N},ce(a.value?"Disable":"Enable"),9,P0)):se("",!0)])])])])):se("",!0)]))}}),M0=rt(x0,[["__scopeId","data-v-19a385ca"]]),O0=()=>{};var Lc={};/**
44
44
  * @license
45
45
  * Copyright 2017 Google LLC
46
46
  *
@@ -55,7 +55,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
55
55
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
56
56
  * See the License for the specific language governing permissions and
57
57
  * limitations under the License.
58
- */const tf=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128)}return t},N0=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const s=e[n++];if(s<128)t[r++]=String.fromCharCode(s);else if(s>191&&s<224){const o=e[n++];t[r++]=String.fromCharCode((s&31)<<6|o&63)}else if(s>239&&s<365){const o=e[n++],i=e[n++],a=e[n++],l=((s&7)<<18|(o&63)<<12|(i&63)<<6|a&63)-65536;t[r++]=String.fromCharCode(55296+(l>>10)),t[r++]=String.fromCharCode(56320+(l&1023))}else{const o=e[n++],i=e[n++];t[r++]=String.fromCharCode((s&15)<<12|(o&63)<<6|i&63)}}return t.join("")},nf={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<e.length;s+=3){const o=e[s],i=s+1<e.length,a=i?e[s+1]:0,l=s+2<e.length,u=l?e[s+2]:0,c=o>>2,f=(o&3)<<4|a>>4;let h=(a&15)<<2|u>>6,b=u&63;l||(b=64,i||(h=64)),r.push(n[c],n[f],n[h],n[b])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(tf(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):N0(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<e.length;){const o=n[e.charAt(s++)],a=s<e.length?n[e.charAt(s)]:0;++s;const u=s<e.length?n[e.charAt(s)]:64;++s;const f=s<e.length?n[e.charAt(s)]:64;if(++s,o==null||a==null||u==null||f==null)throw new $0;const h=o<<2|a>>4;if(r.push(h),u!==64){const b=a<<4&240|u>>2;if(r.push(b),f!==64){const N=u<<6&192|f;r.push(N)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class $0 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const D0=function(e){const t=tf(e);return nf.encodeByteArray(t,!0)},rf=function(e){return D0(e).replace(/\./g,"")},sf=function(e){try{return nf.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
58
+ */const ef=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128)}return t},N0=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const s=e[n++];if(s<128)t[r++]=String.fromCharCode(s);else if(s>191&&s<224){const o=e[n++];t[r++]=String.fromCharCode((s&31)<<6|o&63)}else if(s>239&&s<365){const o=e[n++],i=e[n++],a=e[n++],l=((s&7)<<18|(o&63)<<12|(i&63)<<6|a&63)-65536;t[r++]=String.fromCharCode(55296+(l>>10)),t[r++]=String.fromCharCode(56320+(l&1023))}else{const o=e[n++],i=e[n++];t[r++]=String.fromCharCode((s&15)<<12|(o&63)<<6|i&63)}}return t.join("")},tf={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<e.length;s+=3){const o=e[s],i=s+1<e.length,a=i?e[s+1]:0,l=s+2<e.length,u=l?e[s+2]:0,c=o>>2,f=(o&3)<<4|a>>4;let h=(a&15)<<2|u>>6,b=u&63;l||(b=64,i||(h=64)),r.push(n[c],n[f],n[h],n[b])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(ef(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):N0(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<e.length;){const o=n[e.charAt(s++)],a=s<e.length?n[e.charAt(s)]:0;++s;const u=s<e.length?n[e.charAt(s)]:64;++s;const f=s<e.length?n[e.charAt(s)]:64;if(++s,o==null||a==null||u==null||f==null)throw new $0;const h=o<<2|a>>4;if(r.push(h),u!==64){const b=a<<4&240|u>>2;if(r.push(b),f!==64){const N=u<<6&192|f;r.push(N)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class $0 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const D0=function(e){const t=ef(e);return tf.encodeByteArray(t,!0)},nf=function(e){return D0(e).replace(/\./g,"")},rf=function(e){try{return tf.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
59
59
  * @license
60
60
  * Copyright 2022 Google LLC
61
61
  *
@@ -85,7 +85,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
85
85
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
86
86
  * See the License for the specific language governing permissions and
87
87
  * limitations under the License.
88
- */const j0=()=>L0().__FIREBASE_DEFAULTS__,B0=()=>{if(typeof process>"u"||typeof jc>"u")return;const e=jc.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},U0=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&sf(e[1]);return t&&JSON.parse(t)},tl=()=>{try{return O0()||j0()||B0()||U0()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},F0=e=>{var t,n;return(n=(t=tl())==null?void 0:t.emulatorHosts)==null?void 0:n[e]},of=()=>{var e;return(e=tl())==null?void 0:e.config},af=e=>{var t;return(t=tl())==null?void 0:t[`_${e}`]};/**
88
+ */const j0=()=>L0().__FIREBASE_DEFAULTS__,B0=()=>{if(typeof process>"u"||typeof Lc>"u")return;const e=Lc.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},U0=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&rf(e[1]);return t&&JSON.parse(t)},el=()=>{try{return O0()||j0()||B0()||U0()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},F0=e=>{var t,n;return(n=(t=el())==null?void 0:t.emulatorHosts)==null?void 0:n[e]},sf=()=>{var e;return(e=el())==null?void 0:e.config},of=e=>{var t;return(t=el())==null?void 0:t[`_${e}`]};/**
89
89
  * @license
90
90
  * Copyright 2017 Google LLC
91
91
  *
@@ -115,7 +115,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
115
115
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
116
116
  * See the License for the specific language governing permissions and
117
117
  * limitations under the License.
118
- */function di(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function V0(e){return(await fetch(e,{credentials:"include"})).ok}const Hs={};function W0(){const e={prod:[],emulator:[]};for(const t of Object.keys(Hs))Hs[t]?e.emulator.push(t):e.prod.push(t);return e}function z0(e){let t=document.getElementById(e),n=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),n=!0),{created:n,element:t}}let Bc=!1;function q0(e,t){if(typeof window>"u"||typeof document>"u"||!di(window.location.host)||Hs[e]===t||Hs[e]||Bc)return;Hs[e]=t;function n(h){return`__firebase__banner__${h}`}const r="__firebase__banner",o=W0().prod.length>0;function i(){const h=document.getElementById(r);h&&h.remove()}function a(h){h.style.display="flex",h.style.background="#7faaf0",h.style.position="fixed",h.style.bottom="5px",h.style.left="5px",h.style.padding=".5em",h.style.borderRadius="5px",h.style.alignItems="center"}function l(h,b){h.setAttribute("width","24"),h.setAttribute("id",b),h.setAttribute("height","24"),h.setAttribute("viewBox","0 0 24 24"),h.setAttribute("fill","none"),h.style.marginLeft="-6px"}function u(){const h=document.createElement("span");return h.style.cursor="pointer",h.style.marginLeft="16px",h.style.fontSize="24px",h.innerHTML=" &times;",h.onclick=()=>{Bc=!0,i()},h}function c(h,b){h.setAttribute("id",b),h.innerText="Learn more",h.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",h.setAttribute("target","__blank"),h.style.paddingLeft="5px",h.style.textDecoration="underline"}function f(){const h=z0(r),b=n("text"),N=document.getElementById(b)||document.createElement("span"),I=n("learnmore"),O=document.getElementById(I)||document.createElement("a"),Y=n("preprendIcon"),$=document.getElementById(Y)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(h.created){const z=h.element;a(z),c(O,I);const j=u();l($,Y),z.append($,N,O,j),document.body.appendChild(z)}o?(N.innerText="Preview backend disconnected.",$.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
118
+ */function di(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function V0(e){return(await fetch(e,{credentials:"include"})).ok}const Hs={};function W0(){const e={prod:[],emulator:[]};for(const t of Object.keys(Hs))Hs[t]?e.emulator.push(t):e.prod.push(t);return e}function q0(e){let t=document.getElementById(e),n=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),n=!0),{created:n,element:t}}let jc=!1;function z0(e,t){if(typeof window>"u"||typeof document>"u"||!di(window.location.host)||Hs[e]===t||Hs[e]||jc)return;Hs[e]=t;function n(h){return`__firebase__banner__${h}`}const r="__firebase__banner",o=W0().prod.length>0;function i(){const h=document.getElementById(r);h&&h.remove()}function a(h){h.style.display="flex",h.style.background="#7faaf0",h.style.position="fixed",h.style.bottom="5px",h.style.left="5px",h.style.padding=".5em",h.style.borderRadius="5px",h.style.alignItems="center"}function l(h,b){h.setAttribute("width","24"),h.setAttribute("id",b),h.setAttribute("height","24"),h.setAttribute("viewBox","0 0 24 24"),h.setAttribute("fill","none"),h.style.marginLeft="-6px"}function u(){const h=document.createElement("span");return h.style.cursor="pointer",h.style.marginLeft="16px",h.style.fontSize="24px",h.innerHTML=" &times;",h.onclick=()=>{jc=!0,i()},h}function c(h,b){h.setAttribute("id",b),h.innerText="Learn more",h.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",h.setAttribute("target","__blank"),h.style.paddingLeft="5px",h.style.textDecoration="underline"}function f(){const h=q0(r),b=n("text"),N=document.getElementById(b)||document.createElement("span"),I=n("learnmore"),O=document.getElementById(I)||document.createElement("a"),Y=n("preprendIcon"),$=document.getElementById(Y)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(h.created){const q=h.element;a(q),c(O,I);const j=u();l($,Y),q.append($,N,O,j),document.body.appendChild(q)}o?(N.innerText="Preview backend disconnected.",$.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
119
119
  <path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
120
120
  </g>
121
121
  <defs>
@@ -144,7 +144,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
144
144
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
145
145
  * See the License for the specific language governing permissions and
146
146
  * limitations under the License.
147
- */function Xt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function G0(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Xt())}function K0(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function J0(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function Y0(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Q0(){const e=Xt();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function X0(){try{return typeof indexedDB=="object"}catch{return!1}}function Z0(){return new Promise((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{var o;t(((o=s.error)==null?void 0:o.message)||"")}}catch(n){t(n)}})}/**
147
+ */function Zt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function G0(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Zt())}function K0(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function J0(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function Y0(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Q0(){const e=Zt();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function X0(){try{return typeof indexedDB=="object"}catch{return!1}}function Z0(){return new Promise((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{var o;t(((o=s.error)==null?void 0:o.message)||"")}}catch(n){t(n)}})}/**
148
148
  * @license
149
149
  * Copyright 2017 Google LLC
150
150
  *
@@ -159,7 +159,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
159
159
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
160
160
  * See the License for the specific language governing permissions and
161
161
  * limitations under the License.
162
- */const eT="FirebaseError";class Ir extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=eT,Object.setPrototypeOf(this,Ir.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,io.prototype.create)}}class io{constructor(t,n,r){this.service=t,this.serviceName=n,this.errors=r}create(t,...n){const r=n[0]||{},s=`${this.service}/${t}`,o=this.errors[t],i=o?tT(o,r):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new Ir(s,a,r)}}function tT(e,t){return e.replace(nT,(n,r)=>{const s=t[r];return s!=null?String(s):`<${r}?>`})}const nT=/\{\$([^}]+)}/g;function rT(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function gs(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const s of n){if(!r.includes(s))return!1;const o=e[s],i=t[s];if(Uc(o)&&Uc(i)){if(!gs(o,i))return!1}else if(o!==i)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function Uc(e){return e!==null&&typeof e=="object"}/**
162
+ */const eT="FirebaseError";class Tr extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=eT,Object.setPrototypeOf(this,Tr.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,io.prototype.create)}}class io{constructor(t,n,r){this.service=t,this.serviceName=n,this.errors=r}create(t,...n){const r=n[0]||{},s=`${this.service}/${t}`,o=this.errors[t],i=o?tT(o,r):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new Tr(s,a,r)}}function tT(e,t){return e.replace(nT,(n,r)=>{const s=t[r];return s!=null?String(s):`<${r}?>`})}const nT=/\{\$([^}]+)}/g;function rT(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function ms(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const s of n){if(!r.includes(s))return!1;const o=e[s],i=t[s];if(Bc(o)&&Bc(i)){if(!ms(o,i))return!1}else if(o!==i)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function Bc(e){return e!==null&&typeof e=="object"}/**
163
163
  * @license
164
164
  * Copyright 2017 Google LLC
165
165
  *
@@ -174,7 +174,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
174
174
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
175
175
  * See the License for the specific language governing permissions and
176
176
  * limitations under the License.
177
- */function ao(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(s=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(s))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function sT(e,t){const n=new oT(e,t);return n.subscribe.bind(n)}class oT{constructor(t,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{t(this)}).catch(r=>{this.error(r)})}next(t){this.forEachObserver(n=>{n.next(t)})}error(t){this.forEachObserver(n=>{n.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,n,r){let s;if(t===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");iT(t,["next","error","complete"])?s=t:s={next:t,error:n,complete:r},s.next===void 0&&(s.next=ji),s.error===void 0&&(s.error=ji),s.complete===void 0&&(s.complete=ji);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch{}}),this.observers.push(s),o}unsubscribeOne(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,t)}sendOne(t,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[t]!==void 0)try{n(this.observers[t])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(t){this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function iT(e,t){if(typeof e!="object"||e===null)return!1;for(const n of t)if(n in e&&typeof e[n]=="function")return!0;return!1}function ji(){}/**
177
+ */function ao(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(s=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(s))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function sT(e,t){const n=new oT(e,t);return n.subscribe.bind(n)}class oT{constructor(t,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{t(this)}).catch(r=>{this.error(r)})}next(t){this.forEachObserver(n=>{n.next(t)})}error(t){this.forEachObserver(n=>{n.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,n,r){let s;if(t===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");iT(t,["next","error","complete"])?s=t:s={next:t,error:n,complete:r},s.next===void 0&&(s.next=Li),s.error===void 0&&(s.error=Li),s.complete===void 0&&(s.complete=Li);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch{}}),this.observers.push(s),o}unsubscribeOne(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,t)}sendOne(t,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[t]!==void 0)try{n(this.observers[t])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(t){this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function iT(e,t){if(typeof e!="object"||e===null)return!1;for(const n of t)if(n in e&&typeof e[n]=="function")return!0;return!1}function Li(){}/**
178
178
  * @license
179
179
  * Copyright 2021 Google LLC
180
180
  *
@@ -189,7 +189,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
189
189
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
190
  * See the License for the specific language governing permissions and
191
191
  * limitations under the License.
192
- */function bs(e){return e&&e._delegate?e._delegate:e}class vs{constructor(t,n,r){this.name=t,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
192
+ */function ws(e){return e&&e._delegate?e._delegate:e}class gs{constructor(t,n,r){this.name=t,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
193
193
  * @license
194
194
  * Copyright 2019 Google LLC
195
195
  *
@@ -249,7 +249,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
249
249
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
250
250
  * See the License for the specific language governing permissions and
251
251
  * limitations under the License.
252
- */var wt;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(wt||(wt={}));const dT={debug:wt.DEBUG,verbose:wt.VERBOSE,info:wt.INFO,warn:wt.WARN,error:wt.ERROR,silent:wt.SILENT},fT=wt.INFO,hT={[wt.DEBUG]:"log",[wt.VERBOSE]:"log",[wt.INFO]:"info",[wt.WARN]:"warn",[wt.ERROR]:"error"},pT=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),s=hT[t];if(s)console[s](`[${r}] ${e.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class lf{constructor(t){this.name=t,this._logLevel=fT,this._logHandler=pT,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in wt))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?dT[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,wt.DEBUG,...t),this._logHandler(this,wt.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,wt.VERBOSE,...t),this._logHandler(this,wt.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,wt.INFO,...t),this._logHandler(this,wt.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,wt.WARN,...t),this._logHandler(this,wt.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,wt.ERROR,...t),this._logHandler(this,wt.ERROR,...t)}}const mT=(e,t)=>t.some(n=>e instanceof n);let Fc,Hc;function gT(){return Fc||(Fc=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function vT(){return Hc||(Hc=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const cf=new WeakMap,wa=new WeakMap,uf=new WeakMap,Bi=new WeakMap,nl=new WeakMap;function yT(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(br(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&cf.set(n,e)}).catch(()=>{}),nl.set(t,e),t}function wT(e){if(wa.has(e))return;const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{n(),s()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});wa.set(e,t)}let ba={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return wa.get(e);if(t==="objectStoreNames")return e.objectStoreNames||uf.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return br(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function bT(e){ba=e(ba)}function _T(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Ui(this),t,...n);return uf.set(r,t.sort?t.sort():[t]),br(r)}:vT().includes(e)?function(...t){return e.apply(Ui(this),t),br(cf.get(this))}:function(...t){return br(e.apply(Ui(this),t))}}function kT(e){return typeof e=="function"?_T(e):(e instanceof IDBTransaction&&wT(e),mT(e,gT())?new Proxy(e,ba):e)}function br(e){if(e instanceof IDBRequest)return yT(e);if(Bi.has(e))return Bi.get(e);const t=kT(e);return t!==e&&(Bi.set(e,t),nl.set(t,e)),t}const Ui=e=>nl.get(e);function TT(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=br(i);return r&&i.addEventListener("upgradeneeded",l=>{r(br(i.result),l.oldVersion,l.newVersion,br(i.transaction),l)}),n&&i.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{o&&l.addEventListener("close",()=>o()),s&&l.addEventListener("versionchange",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),a}const IT=["get","getKey","getAll","getAllKeys","count"],ST=["put","add","delete","clear"],Fi=new Map;function Vc(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Fi.get(t))return Fi.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=ST.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||IT.includes(n)))return;const o=async function(i,...a){const l=this.transaction(i,s?"readwrite":"readonly");let u=l.store;return r&&(u=u.index(a.shift())),(await Promise.all([u[n](...a),s&&l.done]))[0]};return Fi.set(t,o),o}bT(e=>({...e,get:(t,n,r)=>Vc(t,n)||e.get(t,n,r),has:(t,n)=>!!Vc(t,n)||e.has(t,n)}));/**
252
+ */var vt;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(vt||(vt={}));const dT={debug:vt.DEBUG,verbose:vt.VERBOSE,info:vt.INFO,warn:vt.WARN,error:vt.ERROR,silent:vt.SILENT},fT=vt.INFO,hT={[vt.DEBUG]:"log",[vt.VERBOSE]:"log",[vt.INFO]:"info",[vt.WARN]:"warn",[vt.ERROR]:"error"},pT=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),s=hT[t];if(s)console[s](`[${r}] ${e.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class af{constructor(t){this.name=t,this._logLevel=fT,this._logHandler=pT,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in vt))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?dT[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,vt.DEBUG,...t),this._logHandler(this,vt.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,vt.VERBOSE,...t),this._logHandler(this,vt.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,vt.INFO,...t),this._logHandler(this,vt.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,vt.WARN,...t),this._logHandler(this,vt.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,vt.ERROR,...t),this._logHandler(this,vt.ERROR,...t)}}const mT=(e,t)=>t.some(n=>e instanceof n);let Uc,Fc;function gT(){return Uc||(Uc=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function vT(){return Fc||(Fc=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const lf=new WeakMap,ya=new WeakMap,cf=new WeakMap,ji=new WeakMap,tl=new WeakMap;function yT(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(wr(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&lf.set(n,e)}).catch(()=>{}),tl.set(t,e),t}function wT(e){if(ya.has(e))return;const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{n(),s()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});ya.set(e,t)}let wa={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return ya.get(e);if(t==="objectStoreNames")return e.objectStoreNames||cf.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return wr(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function bT(e){wa=e(wa)}function _T(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Bi(this),t,...n);return cf.set(r,t.sort?t.sort():[t]),wr(r)}:vT().includes(e)?function(...t){return e.apply(Bi(this),t),wr(lf.get(this))}:function(...t){return wr(e.apply(Bi(this),t))}}function kT(e){return typeof e=="function"?_T(e):(e instanceof IDBTransaction&&wT(e),mT(e,gT())?new Proxy(e,wa):e)}function wr(e){if(e instanceof IDBRequest)return yT(e);if(ji.has(e))return ji.get(e);const t=kT(e);return t!==e&&(ji.set(e,t),tl.set(t,e)),t}const Bi=e=>tl.get(e);function TT(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=wr(i);return r&&i.addEventListener("upgradeneeded",l=>{r(wr(i.result),l.oldVersion,l.newVersion,wr(i.transaction),l)}),n&&i.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{o&&l.addEventListener("close",()=>o()),s&&l.addEventListener("versionchange",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),a}const IT=["get","getKey","getAll","getAllKeys","count"],ST=["put","add","delete","clear"],Ui=new Map;function Hc(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Ui.get(t))return Ui.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=ST.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||IT.includes(n)))return;const o=async function(i,...a){const l=this.transaction(i,s?"readwrite":"readonly");let u=l.store;return r&&(u=u.index(a.shift())),(await Promise.all([u[n](...a),s&&l.done]))[0]};return Ui.set(t,o),o}bT(e=>({...e,get:(t,n,r)=>Hc(t,n)||e.get(t,n,r),has:(t,n)=>!!Hc(t,n)||e.has(t,n)}));/**
253
253
  * @license
254
254
  * Copyright 2019 Google LLC
255
255
  *
@@ -264,7 +264,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
264
264
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
265
265
  * See the License for the specific language governing permissions and
266
266
  * limitations under the License.
267
- */class ET{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(CT(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function CT(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const _a="@firebase/app",Wc="0.14.9";/**
267
+ */class ET{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(CT(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function CT(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const ba="@firebase/app",Vc="0.14.9";/**
268
268
  * @license
269
269
  * Copyright 2019 Google LLC
270
270
  *
@@ -279,7 +279,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
279
279
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
280
280
  * See the License for the specific language governing permissions and
281
281
  * limitations under the License.
282
- */const rr=new lf("@firebase/app"),AT="@firebase/app-compat",RT="@firebase/analytics-compat",xT="@firebase/analytics",PT="@firebase/app-check-compat",MT="@firebase/app-check",OT="@firebase/auth",NT="@firebase/auth-compat",$T="@firebase/database",DT="@firebase/data-connect",LT="@firebase/database-compat",jT="@firebase/functions",BT="@firebase/functions-compat",UT="@firebase/installations",FT="@firebase/installations-compat",HT="@firebase/messaging",VT="@firebase/messaging-compat",WT="@firebase/performance",zT="@firebase/performance-compat",qT="@firebase/remote-config",GT="@firebase/remote-config-compat",KT="@firebase/storage",JT="@firebase/storage-compat",YT="@firebase/firestore",QT="@firebase/ai",XT="@firebase/firestore-compat",ZT="firebase",e1="12.10.0";/**
282
+ */const nr=new af("@firebase/app"),AT="@firebase/app-compat",RT="@firebase/analytics-compat",PT="@firebase/analytics",xT="@firebase/app-check-compat",MT="@firebase/app-check",OT="@firebase/auth",NT="@firebase/auth-compat",$T="@firebase/database",DT="@firebase/data-connect",LT="@firebase/database-compat",jT="@firebase/functions",BT="@firebase/functions-compat",UT="@firebase/installations",FT="@firebase/installations-compat",HT="@firebase/messaging",VT="@firebase/messaging-compat",WT="@firebase/performance",qT="@firebase/performance-compat",zT="@firebase/remote-config",GT="@firebase/remote-config-compat",KT="@firebase/storage",JT="@firebase/storage-compat",YT="@firebase/firestore",QT="@firebase/ai",XT="@firebase/firestore-compat",ZT="firebase",e1="12.10.0";/**
283
283
  * @license
284
284
  * Copyright 2019 Google LLC
285
285
  *
@@ -294,7 +294,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
294
294
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
295
295
  * See the License for the specific language governing permissions and
296
296
  * limitations under the License.
297
- */const ka="[DEFAULT]",t1={[_a]:"fire-core",[AT]:"fire-core-compat",[xT]:"fire-analytics",[RT]:"fire-analytics-compat",[MT]:"fire-app-check",[PT]:"fire-app-check-compat",[OT]:"fire-auth",[NT]:"fire-auth-compat",[$T]:"fire-rtdb",[DT]:"fire-data-connect",[LT]:"fire-rtdb-compat",[jT]:"fire-fn",[BT]:"fire-fn-compat",[UT]:"fire-iid",[FT]:"fire-iid-compat",[HT]:"fire-fcm",[VT]:"fire-fcm-compat",[WT]:"fire-perf",[zT]:"fire-perf-compat",[qT]:"fire-rc",[GT]:"fire-rc-compat",[KT]:"fire-gcs",[JT]:"fire-gcs-compat",[YT]:"fire-fst",[XT]:"fire-fst-compat",[QT]:"fire-vertex","fire-js":"fire-js",[ZT]:"fire-js-all"};/**
297
+ */const _a="[DEFAULT]",t1={[ba]:"fire-core",[AT]:"fire-core-compat",[PT]:"fire-analytics",[RT]:"fire-analytics-compat",[MT]:"fire-app-check",[xT]:"fire-app-check-compat",[OT]:"fire-auth",[NT]:"fire-auth-compat",[$T]:"fire-rtdb",[DT]:"fire-data-connect",[LT]:"fire-rtdb-compat",[jT]:"fire-fn",[BT]:"fire-fn-compat",[UT]:"fire-iid",[FT]:"fire-iid-compat",[HT]:"fire-fcm",[VT]:"fire-fcm-compat",[WT]:"fire-perf",[qT]:"fire-perf-compat",[zT]:"fire-rc",[GT]:"fire-rc-compat",[KT]:"fire-gcs",[JT]:"fire-gcs-compat",[YT]:"fire-fst",[XT]:"fire-fst-compat",[QT]:"fire-vertex","fire-js":"fire-js",[ZT]:"fire-js-all"};/**
298
298
  * @license
299
299
  * Copyright 2019 Google LLC
300
300
  *
@@ -309,7 +309,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
309
309
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
310
310
  * See the License for the specific language governing permissions and
311
311
  * limitations under the License.
312
- */const Zs=new Map,n1=new Map,Ta=new Map;function zc(e,t){try{e.container.addComponent(t)}catch(n){rr.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function eo(e){const t=e.name;if(Ta.has(t))return rr.debug(`There were multiple attempts to register component ${t}.`),!1;Ta.set(t,e);for(const n of Zs.values())zc(n,e);for(const n of n1.values())zc(n,e);return!0}function df(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function xn(e){return e==null?!1:e.settings!==void 0}/**
312
+ */const Zs=new Map,n1=new Map,ka=new Map;function Wc(e,t){try{e.container.addComponent(t)}catch(n){nr.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function eo(e){const t=e.name;if(ka.has(t))return nr.debug(`There were multiple attempts to register component ${t}.`),!1;ka.set(t,e);for(const n of Zs.values())Wc(n,e);for(const n of n1.values())Wc(n,e);return!0}function uf(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function Pn(e){return e==null?!1:e.settings!==void 0}/**
313
313
  * @license
314
314
  * Copyright 2019 Google LLC
315
315
  *
@@ -324,7 +324,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
324
324
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
325
325
  * See the License for the specific language governing permissions and
326
326
  * limitations under the License.
327
- */const r1={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},_r=new io("app","Firebase",r1);/**
327
+ */const r1={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},br=new io("app","Firebase",r1);/**
328
328
  * @license
329
329
  * Copyright 2019 Google LLC
330
330
  *
@@ -339,7 +339,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
339
339
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
340
340
  * See the License for the specific language governing permissions and
341
341
  * limitations under the License.
342
- */class s1{constructor(t,n,r){this._isDeleted=!1,this._options={...t},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new vs("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw _r.create("app-deleted",{appName:this._name})}}/**
342
+ */class s1{constructor(t,n,r){this._isDeleted=!1,this._options={...t},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new gs("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw br.create("app-deleted",{appName:this._name})}}/**
343
343
  * @license
344
344
  * Copyright 2019 Google LLC
345
345
  *
@@ -354,7 +354,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
354
354
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
355
355
  * See the License for the specific language governing permissions and
356
356
  * limitations under the License.
357
- */const lo=e1;function ff(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:ka,automaticDataCollectionEnabled:!0,...t},s=r.name;if(typeof s!="string"||!s)throw _r.create("bad-app-name",{appName:String(s)});if(n||(n=of()),!n)throw _r.create("no-options");const o=Zs.get(s);if(o){if(gs(n,o.options)&&gs(r,o.config))return o;throw _r.create("duplicate-app",{appName:s})}const i=new uT(s);for(const l of Ta.values())i.addComponent(l);const a=new s1(n,r,i);return Zs.set(s,a),a}function hf(e=ka){const t=Zs.get(e);if(!t&&e===ka&&of())return ff();if(!t)throw _r.create("no-app",{appName:e});return t}function o1(){return Array.from(Zs.values())}function cs(e,t,n){let r=t1[e]??e;n&&(r+=`-${n}`);const s=r.match(/\s|\//),o=t.match(/\s|\//);if(s||o){const i=[`Unable to register library "${r}" with version "${t}":`];s&&i.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&i.push("and"),o&&i.push(`version name "${t}" contains illegal characters (whitespace or "/")`),rr.warn(i.join(" "));return}eo(new vs(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/**
357
+ */const lo=e1;function df(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:_a,automaticDataCollectionEnabled:!0,...t},s=r.name;if(typeof s!="string"||!s)throw br.create("bad-app-name",{appName:String(s)});if(n||(n=sf()),!n)throw br.create("no-options");const o=Zs.get(s);if(o){if(ms(n,o.options)&&ms(r,o.config))return o;throw br.create("duplicate-app",{appName:s})}const i=new uT(s);for(const l of ka.values())i.addComponent(l);const a=new s1(n,r,i);return Zs.set(s,a),a}function ff(e=_a){const t=Zs.get(e);if(!t&&e===_a&&sf())return df();if(!t)throw br.create("no-app",{appName:e});return t}function o1(){return Array.from(Zs.values())}function ls(e,t,n){let r=t1[e]??e;n&&(r+=`-${n}`);const s=r.match(/\s|\//),o=t.match(/\s|\//);if(s||o){const i=[`Unable to register library "${r}" with version "${t}":`];s&&i.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&i.push("and"),o&&i.push(`version name "${t}" contains illegal characters (whitespace or "/")`),nr.warn(i.join(" "));return}eo(new gs(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/**
358
358
  * @license
359
359
  * Copyright 2021 Google LLC
360
360
  *
@@ -369,7 +369,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
369
369
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
370
370
  * See the License for the specific language governing permissions and
371
371
  * limitations under the License.
372
- */const i1="firebase-heartbeat-database",a1=1,to="firebase-heartbeat-store";let Hi=null;function pf(){return Hi||(Hi=TT(i1,a1,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(to)}catch(n){console.warn(n)}}}}).catch(e=>{throw _r.create("idb-open",{originalErrorMessage:e.message})})),Hi}async function l1(e){try{const n=(await pf()).transaction(to),r=await n.objectStore(to).get(mf(e));return await n.done,r}catch(t){if(t instanceof Ir)rr.warn(t.message);else{const n=_r.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});rr.warn(n.message)}}}async function qc(e,t){try{const r=(await pf()).transaction(to,"readwrite");await r.objectStore(to).put(t,mf(e)),await r.done}catch(n){if(n instanceof Ir)rr.warn(n.message);else{const r=_r.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});rr.warn(r.message)}}}function mf(e){return`${e.name}!${e.options.appId}`}/**
372
+ */const i1="firebase-heartbeat-database",a1=1,to="firebase-heartbeat-store";let Fi=null;function hf(){return Fi||(Fi=TT(i1,a1,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(to)}catch(n){console.warn(n)}}}}).catch(e=>{throw br.create("idb-open",{originalErrorMessage:e.message})})),Fi}async function l1(e){try{const n=(await hf()).transaction(to),r=await n.objectStore(to).get(pf(e));return await n.done,r}catch(t){if(t instanceof Tr)nr.warn(t.message);else{const n=br.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});nr.warn(n.message)}}}async function qc(e,t){try{const r=(await hf()).transaction(to,"readwrite");await r.objectStore(to).put(t,pf(e)),await r.done}catch(n){if(n instanceof Tr)nr.warn(n.message);else{const r=br.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});nr.warn(r.message)}}}function pf(e){return`${e.name}!${e.options.appId}`}/**
373
373
  * @license
374
374
  * Copyright 2021 Google LLC
375
375
  *
@@ -384,7 +384,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
384
384
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
385
385
  * See the License for the specific language governing permissions and
386
386
  * limitations under the License.
387
- */const c1=1024,u1=30;class d1{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new h1(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var t,n;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=Gc();if(((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(i=>i.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:s}),this._heartbeatsCache.heartbeats.length>u1){const i=p1(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){rr.warn(r)}}async getHeartbeatsHeader(){var t;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=Gc(),{heartbeatsToSend:r,unsentEntries:s}=f1(this._heartbeatsCache.heartbeats),o=rf(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(n){return rr.warn(n),""}}}function Gc(){return new Date().toISOString().substring(0,10)}function f1(e,t=c1){const n=[];let r=e.slice();for(const s of e){const o=n.find(i=>i.agent===s.agent);if(o){if(o.dates.push(s.date),Kc(n)>t){o.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),Kc(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class h1{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return X0()?Z0().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await l1(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return qc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return qc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...t.heartbeats]})}else return}}function Kc(e){return rf(JSON.stringify({version:2,heartbeats:e})).length}function p1(e){if(e.length===0)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}/**
387
+ */const c1=1024,u1=30;class d1{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new h1(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var t,n;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=zc();if(((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(i=>i.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:s}),this._heartbeatsCache.heartbeats.length>u1){const i=p1(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){nr.warn(r)}}async getHeartbeatsHeader(){var t;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=zc(),{heartbeatsToSend:r,unsentEntries:s}=f1(this._heartbeatsCache.heartbeats),o=nf(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(n){return nr.warn(n),""}}}function zc(){return new Date().toISOString().substring(0,10)}function f1(e,t=c1){const n=[];let r=e.slice();for(const s of e){const o=n.find(i=>i.agent===s.agent);if(o){if(o.dates.push(s.date),Gc(n)>t){o.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),Gc(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class h1{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return X0()?Z0().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await l1(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return qc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return qc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...t.heartbeats]})}else return}}function Gc(e){return nf(JSON.stringify({version:2,heartbeats:e})).length}function p1(e){if(e.length===0)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}/**
388
388
  * @license
389
389
  * Copyright 2019 Google LLC
390
390
  *
@@ -399,7 +399,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
399
399
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
400
400
  * See the License for the specific language governing permissions and
401
401
  * limitations under the License.
402
- */function m1(e){eo(new vs("platform-logger",t=>new ET(t),"PRIVATE")),eo(new vs("heartbeat",t=>new d1(t),"PRIVATE")),cs(_a,Wc,e),cs(_a,Wc,"esm2020"),cs("fire-js","")}m1("");var g1="firebase",v1="12.10.0";/**
402
+ */function m1(e){eo(new gs("platform-logger",t=>new ET(t),"PRIVATE")),eo(new gs("heartbeat",t=>new d1(t),"PRIVATE")),ls(ba,Vc,e),ls(ba,Vc,"esm2020"),ls("fire-js","")}m1("");var g1="firebase",v1="12.10.0";/**
403
403
  * @license
404
404
  * Copyright 2020 Google LLC
405
405
  *
@@ -414,7 +414,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
414
414
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
415
415
  * See the License for the specific language governing permissions and
416
416
  * limitations under the License.
417
- */cs(g1,v1,"app");function gf(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const y1=gf,vf=new io("auth","Firebase",gf());/**
417
+ */ls(g1,v1,"app");function mf(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const y1=mf,gf=new io("auth","Firebase",mf());/**
418
418
  * @license
419
419
  * Copyright 2020 Google LLC
420
420
  *
@@ -429,7 +429,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
429
429
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
430
430
  * See the License for the specific language governing permissions and
431
431
  * limitations under the License.
432
- */const Ho=new lf("@firebase/auth");function w1(e,...t){Ho.logLevel<=wt.WARN&&Ho.warn(`Auth (${lo}): ${e}`,...t)}function Ro(e,...t){Ho.logLevel<=wt.ERROR&&Ho.error(`Auth (${lo}): ${e}`,...t)}/**
432
+ */const Ho=new af("@firebase/auth");function w1(e,...t){Ho.logLevel<=vt.WARN&&Ho.warn(`Auth (${lo}): ${e}`,...t)}function Ro(e,...t){Ho.logLevel<=vt.ERROR&&Ho.error(`Auth (${lo}): ${e}`,...t)}/**
433
433
  * @license
434
434
  * Copyright 2020 Google LLC
435
435
  *
@@ -444,7 +444,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
444
444
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
445
445
  * See the License for the specific language governing permissions and
446
446
  * limitations under the License.
447
- */function $n(e,...t){throw sl(e,...t)}function gn(e,...t){return sl(e,...t)}function rl(e,t,n){const r={...y1(),[t]:n};return new io("auth","Firebase",r).create(t,{appName:e.name})}function Wr(e){return rl(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function b1(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&$n(e,"argument-error"),rl(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function sl(e,...t){if(typeof e!="string"){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return vf.create(e,...t)}function Fe(e,t,...n){if(!e)throw sl(t,...n)}function Jn(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Ro(t),new Error(t)}function sr(e,t){e||Jn(t)}/**
447
+ */function $n(e,...t){throw rl(e,...t)}function gn(e,...t){return rl(e,...t)}function nl(e,t,n){const r={...y1(),[t]:n};return new io("auth","Firebase",r).create(t,{appName:e.name})}function Wr(e){return nl(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function b1(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&$n(e,"argument-error"),nl(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function rl(e,...t){if(typeof e!="string"){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return gf.create(e,...t)}function Fe(e,t,...n){if(!e)throw rl(t,...n)}function Kn(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Ro(t),new Error(t)}function rr(e,t){e||Kn(t)}/**
448
448
  * @license
449
449
  * Copyright 2020 Google LLC
450
450
  *
@@ -459,7 +459,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
459
459
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
460
460
  * See the License for the specific language governing permissions and
461
461
  * limitations under the License.
462
- */function Ia(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function _1(){return Jc()==="http:"||Jc()==="https:"}function Jc(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
462
+ */function Ta(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function _1(){return Kc()==="http:"||Kc()==="https:"}function Kc(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
463
463
  * @license
464
464
  * Copyright 2020 Google LLC
465
465
  *
@@ -489,7 +489,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
489
489
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
490
490
  * See the License for the specific language governing permissions and
491
491
  * limitations under the License.
492
- */class co{constructor(t,n){this.shortDelay=t,this.longDelay=n,sr(n>t,"Short delay should be less than long delay!"),this.isMobile=G0()||Y0()}get(){return k1()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
492
+ */class co{constructor(t,n){this.shortDelay=t,this.longDelay=n,rr(n>t,"Short delay should be less than long delay!"),this.isMobile=G0()||Y0()}get(){return k1()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
493
493
  * @license
494
494
  * Copyright 2020 Google LLC
495
495
  *
@@ -504,7 +504,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
504
504
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
505
505
  * See the License for the specific language governing permissions and
506
506
  * limitations under the License.
507
- */function ol(e,t){sr(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
507
+ */function sl(e,t){rr(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
508
508
  * @license
509
509
  * Copyright 2020 Google LLC
510
510
  *
@@ -519,7 +519,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
519
519
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
520
520
  * See the License for the specific language governing permissions and
521
521
  * limitations under the License.
522
- */class yf{static initialize(t,n,r){this.fetchImpl=t,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Jn("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Jn("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Jn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
522
+ */class vf{static initialize(t,n,r){this.fetchImpl=t,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Kn("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Kn("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Kn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
523
523
  * @license
524
524
  * Copyright 2020 Google LLC
525
525
  *
@@ -549,7 +549,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
549
549
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
550
550
  * See the License for the specific language governing permissions and
551
551
  * limitations under the License.
552
- */const S1=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],E1=new co(3e4,6e4);function il(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function _s(e,t,n,r,s={}){return wf(e,s,async()=>{let o={},i={};r&&(t==="GET"?i=r:o={body:JSON.stringify(r)});const a=ao({key:e.config.apiKey,...i}).slice(1),l=await e._getAdditionalHeaders();l["Content-Type"]="application/json",e.languageCode&&(l["X-Firebase-Locale"]=e.languageCode);const u={method:t,headers:l,...o};return K0()||(u.referrerPolicy="no-referrer"),e.emulatorConfig&&di(e.emulatorConfig.host)&&(u.credentials="include"),yf.fetch()(await bf(e,e.config.apiHost,n,a),u)})}async function wf(e,t,n){e._canInitEmulator=!1;const r={...I1,...t};try{const s=new A1(e),o=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw yo(e,"account-exists-with-different-credential",i);if(o.ok&&!("errorMessage"in i))return i;{const a=o.ok?i.errorMessage:i.error.message,[l,u]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw yo(e,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw yo(e,"email-already-in-use",i);if(l==="USER_DISABLED")throw yo(e,"user-disabled",i);const c=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw rl(e,c,u);$n(e,c)}}catch(s){if(s instanceof Ir)throw s;$n(e,"network-request-failed",{message:String(s)})}}async function C1(e,t,n,r,s={}){const o=await _s(e,t,n,r,s);return"mfaPendingCredential"in o&&$n(e,"multi-factor-auth-required",{_serverResponse:o}),o}async function bf(e,t,n,r){const s=`${t}${n}?${r}`,o=e,i=o.config.emulator?ol(e.config,s):`${e.config.apiScheme}://${s}`;return S1.includes(n)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(i).toString():i}class A1{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(gn(this.auth,"network-request-failed")),E1.get())})}}function yo(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=gn(e,t,r);return s.customData._tokenResponse=n,s}/**
552
+ */const S1=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],E1=new co(3e4,6e4);function ol(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function bs(e,t,n,r,s={}){return yf(e,s,async()=>{let o={},i={};r&&(t==="GET"?i=r:o={body:JSON.stringify(r)});const a=ao({key:e.config.apiKey,...i}).slice(1),l=await e._getAdditionalHeaders();l["Content-Type"]="application/json",e.languageCode&&(l["X-Firebase-Locale"]=e.languageCode);const u={method:t,headers:l,...o};return K0()||(u.referrerPolicy="no-referrer"),e.emulatorConfig&&di(e.emulatorConfig.host)&&(u.credentials="include"),vf.fetch()(await wf(e,e.config.apiHost,n,a),u)})}async function yf(e,t,n){e._canInitEmulator=!1;const r={...I1,...t};try{const s=new A1(e),o=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw yo(e,"account-exists-with-different-credential",i);if(o.ok&&!("errorMessage"in i))return i;{const a=o.ok?i.errorMessage:i.error.message,[l,u]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw yo(e,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw yo(e,"email-already-in-use",i);if(l==="USER_DISABLED")throw yo(e,"user-disabled",i);const c=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw nl(e,c,u);$n(e,c)}}catch(s){if(s instanceof Tr)throw s;$n(e,"network-request-failed",{message:String(s)})}}async function C1(e,t,n,r,s={}){const o=await bs(e,t,n,r,s);return"mfaPendingCredential"in o&&$n(e,"multi-factor-auth-required",{_serverResponse:o}),o}async function wf(e,t,n,r){const s=`${t}${n}?${r}`,o=e,i=o.config.emulator?sl(e.config,s):`${e.config.apiScheme}://${s}`;return S1.includes(n)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(i).toString():i}class A1{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(gn(this.auth,"network-request-failed")),E1.get())})}}function yo(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=gn(e,t,r);return s.customData._tokenResponse=n,s}/**
553
553
  * @license
554
554
  * Copyright 2020 Google LLC
555
555
  *
@@ -564,7 +564,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
564
564
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
565
565
  * See the License for the specific language governing permissions and
566
566
  * limitations under the License.
567
- */async function R1(e,t){return _s(e,"POST","/v1/accounts:delete",t)}async function Vo(e,t){return _s(e,"POST","/v1/accounts:lookup",t)}/**
567
+ */async function R1(e,t){return bs(e,"POST","/v1/accounts:delete",t)}async function Vo(e,t){return bs(e,"POST","/v1/accounts:lookup",t)}/**
568
568
  * @license
569
569
  * Copyright 2020 Google LLC
570
570
  *
@@ -579,7 +579,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
579
579
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
580
580
  * See the License for the specific language governing permissions and
581
581
  * limitations under the License.
582
- */function Vs(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function x1(e,t=!1){const n=bs(e),r=await n.getIdToken(t),s=al(r);Fe(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const o=typeof s.firebase=="object"?s.firebase:void 0,i=o==null?void 0:o.sign_in_provider;return{claims:s,token:r,authTime:Vs(Vi(s.auth_time)),issuedAtTime:Vs(Vi(s.iat)),expirationTime:Vs(Vi(s.exp)),signInProvider:i||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function Vi(e){return Number(e)*1e3}function al(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return Ro("JWT malformed, contained fewer than 3 sections"),null;try{const s=sf(n);return s?JSON.parse(s):(Ro("Failed to decode base64 JWT payload"),null)}catch(s){return Ro("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function Yc(e){const t=al(e);return Fe(t,"internal-error"),Fe(typeof t.exp<"u","internal-error"),Fe(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
582
+ */function Vs(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function P1(e,t=!1){const n=ws(e),r=await n.getIdToken(t),s=il(r);Fe(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const o=typeof s.firebase=="object"?s.firebase:void 0,i=o==null?void 0:o.sign_in_provider;return{claims:s,token:r,authTime:Vs(Hi(s.auth_time)),issuedAtTime:Vs(Hi(s.iat)),expirationTime:Vs(Hi(s.exp)),signInProvider:i||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function Hi(e){return Number(e)*1e3}function il(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return Ro("JWT malformed, contained fewer than 3 sections"),null;try{const s=rf(n);return s?JSON.parse(s):(Ro("Failed to decode base64 JWT payload"),null)}catch(s){return Ro("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function Jc(e){const t=il(e);return Fe(t,"internal-error"),Fe(typeof t.exp<"u","internal-error"),Fe(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
583
583
  * @license
584
584
  * Copyright 2020 Google LLC
585
585
  *
@@ -594,7 +594,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
594
594
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
595
595
  * See the License for the specific language governing permissions and
596
596
  * limitations under the License.
597
- */async function no(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof Ir&&P1(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function P1({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
597
+ */async function no(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof Tr&&x1(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function x1({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
598
598
  * @license
599
599
  * Copyright 2020 Google LLC
600
600
  *
@@ -624,7 +624,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
624
624
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
625
625
  * See the License for the specific language governing permissions and
626
626
  * limitations under the License.
627
- */class Sa{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Vs(this.lastLoginAt),this.creationTime=Vs(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
627
+ */class Ia{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Vs(this.lastLoginAt),this.creationTime=Vs(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
628
628
  * @license
629
629
  * Copyright 2019 Google LLC
630
630
  *
@@ -639,7 +639,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
639
639
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
640
640
  * See the License for the specific language governing permissions and
641
641
  * limitations under the License.
642
- */async function Wo(e){var f;const t=e.auth,n=await e.getIdToken(),r=await no(e,Vo(t,{idToken:n}));Fe(r==null?void 0:r.users.length,t,"internal-error");const s=r.users[0];e._notifyReloadListener(s);const o=(f=s.providerUserInfo)!=null&&f.length?_f(s.providerUserInfo):[],i=N1(e.providerData,o),a=e.isAnonymous,l=!(e.email&&s.passwordHash)&&!(i!=null&&i.length),u=a?l:!1,c={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:i,metadata:new Sa(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(e,c)}async function O1(e){const t=bs(e);await Wo(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function N1(e,t){return[...e.filter(r=>!t.some(s=>s.providerId===r.providerId)),...t]}function _f(e){return e.map(({providerId:t,...n})=>({providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}/**
642
+ */async function Wo(e){var f;const t=e.auth,n=await e.getIdToken(),r=await no(e,Vo(t,{idToken:n}));Fe(r==null?void 0:r.users.length,t,"internal-error");const s=r.users[0];e._notifyReloadListener(s);const o=(f=s.providerUserInfo)!=null&&f.length?bf(s.providerUserInfo):[],i=N1(e.providerData,o),a=e.isAnonymous,l=!(e.email&&s.passwordHash)&&!(i!=null&&i.length),u=a?l:!1,c={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:i,metadata:new Ia(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(e,c)}async function O1(e){const t=ws(e);await Wo(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function N1(e,t){return[...e.filter(r=>!t.some(s=>s.providerId===r.providerId)),...t]}function bf(e){return e.map(({providerId:t,...n})=>({providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}/**
643
643
  * @license
644
644
  * Copyright 2020 Google LLC
645
645
  *
@@ -654,7 +654,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
654
654
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
655
655
  * See the License for the specific language governing permissions and
656
656
  * limitations under the License.
657
- */async function $1(e,t){const n=await wf(e,{},async()=>{const r=ao({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:o}=e.config,i=await bf(e,s,"/v1/token",`key=${o}`),a=await e._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const l={method:"POST",headers:a,body:r};return e.emulatorConfig&&di(e.emulatorConfig.host)&&(l.credentials="include"),yf.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function D1(e,t){return _s(e,"POST","/v2/accounts:revokeToken",il(e,t))}/**
657
+ */async function $1(e,t){const n=await yf(e,{},async()=>{const r=ao({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:o}=e.config,i=await wf(e,s,"/v1/token",`key=${o}`),a=await e._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const l={method:"POST",headers:a,body:r};return e.emulatorConfig&&di(e.emulatorConfig.host)&&(l.credentials="include"),vf.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function D1(e,t){return bs(e,"POST","/v2/accounts:revokeToken",ol(e,t))}/**
658
658
  * @license
659
659
  * Copyright 2020 Google LLC
660
660
  *
@@ -669,7 +669,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
669
669
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
670
670
  * See the License for the specific language governing permissions and
671
671
  * limitations under the License.
672
- */class us{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Fe(t.idToken,"internal-error"),Fe(typeof t.idToken<"u","internal-error"),Fe(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):Yc(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){Fe(t.length!==0,"internal-error");const n=Yc(t);this.updateTokensAndExpiration(t,null,n)}async getToken(t,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Fe(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(t,n){const{accessToken:r,refreshToken:s,expiresIn:o}=await $1(t,n);this.updateTokensAndExpiration(r,s,Number(o))}updateTokensAndExpiration(t,n,r){this.refreshToken=n||null,this.accessToken=t||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(t,n){const{refreshToken:r,accessToken:s,expirationTime:o}=n,i=new us;return r&&(Fe(typeof r=="string","internal-error",{appName:t}),i.refreshToken=r),s&&(Fe(typeof s=="string","internal-error",{appName:t}),i.accessToken=s),o&&(Fe(typeof o=="number","internal-error",{appName:t}),i.expirationTime=o),i}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new us,this.toJSON())}_performRefresh(){return Jn("not implemented")}}/**
672
+ */class cs{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Fe(t.idToken,"internal-error"),Fe(typeof t.idToken<"u","internal-error"),Fe(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):Jc(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){Fe(t.length!==0,"internal-error");const n=Jc(t);this.updateTokensAndExpiration(t,null,n)}async getToken(t,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Fe(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(t,n){const{accessToken:r,refreshToken:s,expiresIn:o}=await $1(t,n);this.updateTokensAndExpiration(r,s,Number(o))}updateTokensAndExpiration(t,n,r){this.refreshToken=n||null,this.accessToken=t||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(t,n){const{refreshToken:r,accessToken:s,expirationTime:o}=n,i=new cs;return r&&(Fe(typeof r=="string","internal-error",{appName:t}),i.refreshToken=r),s&&(Fe(typeof s=="string","internal-error",{appName:t}),i.accessToken=s),o&&(Fe(typeof o=="number","internal-error",{appName:t}),i.expirationTime=o),i}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new cs,this.toJSON())}_performRefresh(){return Kn("not implemented")}}/**
673
673
  * @license
674
674
  * Copyright 2020 Google LLC
675
675
  *
@@ -684,7 +684,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
684
684
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
685
685
  * See the License for the specific language governing permissions and
686
686
  * limitations under the License.
687
- */function fr(e,t){Fe(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class hn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new M1(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new Sa(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await no(this,this.stsTokenManager.getToken(this.auth,t));return Fe(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return x1(this,t)}reload(){return O1(this)}_assign(t){this!==t&&(Fe(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(n=>({...n})),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const n=new hn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){Fe(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,n=!1){let r=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),n&&await Wo(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(xn(this.auth.app))return Promise.reject(Wr(this.auth));const t=await this.getIdToken();return await no(this,R1(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>({...t})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,n){const r=n.displayName??void 0,s=n.email??void 0,o=n.phoneNumber??void 0,i=n.photoURL??void 0,a=n.tenantId??void 0,l=n._redirectEventId??void 0,u=n.createdAt??void 0,c=n.lastLoginAt??void 0,{uid:f,emailVerified:h,isAnonymous:b,providerData:N,stsTokenManager:I}=n;Fe(f&&I,t,"internal-error");const O=us.fromJSON(this.name,I);Fe(typeof f=="string",t,"internal-error"),fr(r,t.name),fr(s,t.name),Fe(typeof h=="boolean",t,"internal-error"),Fe(typeof b=="boolean",t,"internal-error"),fr(o,t.name),fr(i,t.name),fr(a,t.name),fr(l,t.name),fr(u,t.name),fr(c,t.name);const Y=new hn({uid:f,auth:t,email:s,emailVerified:h,displayName:r,isAnonymous:b,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:O,createdAt:u,lastLoginAt:c});return N&&Array.isArray(N)&&(Y.providerData=N.map($=>({...$}))),l&&(Y._redirectEventId=l),Y}static async _fromIdTokenResponse(t,n,r=!1){const s=new us;s.updateFromServerResponse(n);const o=new hn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await Wo(o),o}static async _fromGetAccountInfoResponse(t,n,r){const s=n.users[0];Fe(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?_f(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new us;a.updateFromIdToken(r);const l=new hn({uid:s.localId,auth:t,stsTokenManager:a,isAnonymous:i}),u={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:o,metadata:new Sa(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,u),l}}/**
687
+ */function dr(e,t){Fe(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class hn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new M1(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new Ia(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await no(this,this.stsTokenManager.getToken(this.auth,t));return Fe(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return P1(this,t)}reload(){return O1(this)}_assign(t){this!==t&&(Fe(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(n=>({...n})),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const n=new hn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){Fe(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,n=!1){let r=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),n&&await Wo(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Pn(this.auth.app))return Promise.reject(Wr(this.auth));const t=await this.getIdToken();return await no(this,R1(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>({...t})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,n){const r=n.displayName??void 0,s=n.email??void 0,o=n.phoneNumber??void 0,i=n.photoURL??void 0,a=n.tenantId??void 0,l=n._redirectEventId??void 0,u=n.createdAt??void 0,c=n.lastLoginAt??void 0,{uid:f,emailVerified:h,isAnonymous:b,providerData:N,stsTokenManager:I}=n;Fe(f&&I,t,"internal-error");const O=cs.fromJSON(this.name,I);Fe(typeof f=="string",t,"internal-error"),dr(r,t.name),dr(s,t.name),Fe(typeof h=="boolean",t,"internal-error"),Fe(typeof b=="boolean",t,"internal-error"),dr(o,t.name),dr(i,t.name),dr(a,t.name),dr(l,t.name),dr(u,t.name),dr(c,t.name);const Y=new hn({uid:f,auth:t,email:s,emailVerified:h,displayName:r,isAnonymous:b,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:O,createdAt:u,lastLoginAt:c});return N&&Array.isArray(N)&&(Y.providerData=N.map($=>({...$}))),l&&(Y._redirectEventId=l),Y}static async _fromIdTokenResponse(t,n,r=!1){const s=new cs;s.updateFromServerResponse(n);const o=new hn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await Wo(o),o}static async _fromGetAccountInfoResponse(t,n,r){const s=n.users[0];Fe(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?bf(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new cs;a.updateFromIdToken(r);const l=new hn({uid:s.localId,auth:t,stsTokenManager:a,isAnonymous:i}),u={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:o,metadata:new Ia(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,u),l}}/**
688
688
  * @license
689
689
  * Copyright 2020 Google LLC
690
690
  *
@@ -699,7 +699,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
699
699
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
700
700
  * See the License for the specific language governing permissions and
701
701
  * limitations under the License.
702
- */const Qc=new Map;function Yn(e){sr(e instanceof Function,"Expected a class definition");let t=Qc.get(e);return t?(sr(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Qc.set(e,t),t)}/**
702
+ */const Yc=new Map;function Jn(e){rr(e instanceof Function,"Expected a class definition");let t=Yc.get(e);return t?(rr(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Yc.set(e,t),t)}/**
703
703
  * @license
704
704
  * Copyright 2019 Google LLC
705
705
  *
@@ -714,7 +714,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
714
714
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
715
715
  * See the License for the specific language governing permissions and
716
716
  * limitations under the License.
717
- */class kf{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,n){this.storage[t]=n}async _get(t){const n=this.storage[t];return n===void 0?null:n}async _remove(t){delete this.storage[t]}_addListener(t,n){}_removeListener(t,n){}}kf.type="NONE";const Xc=kf;/**
717
+ */class _f{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,n){this.storage[t]=n}async _get(t){const n=this.storage[t];return n===void 0?null:n}async _remove(t){delete this.storage[t]}_addListener(t,n){}_removeListener(t,n){}}_f.type="NONE";const Qc=_f;/**
718
718
  * @license
719
719
  * Copyright 2019 Google LLC
720
720
  *
@@ -729,7 +729,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
729
729
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
730
730
  * See the License for the specific language governing permissions and
731
731
  * limitations under the License.
732
- */function xo(e,t,n){return`firebase:${e}:${t}:${n}`}class ds{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=xo(this.userKey,s.apiKey,o),this.fullPersistenceKey=xo("persistence",s.apiKey,o),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);if(!t)return null;if(typeof t=="string"){const n=await Vo(this.auth,{idToken:t}).catch(()=>{});return n?hn._fromGetAccountInfoResponse(this.auth,n,t):null}return hn._fromJSON(this.auth,t)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=t,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,n,r="authUser"){if(!n.length)return new ds(Yn(Xc),t,r);const s=(await Promise.all(n.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let o=s[0]||Yn(Xc);const i=xo(r,t.config.apiKey,t.name);let a=null;for(const u of n)try{const c=await u._get(i);if(c){let f;if(typeof c=="string"){const h=await Vo(t,{idToken:c}).catch(()=>{});if(!h)break;f=await hn._fromGetAccountInfoResponse(t,h,c)}else f=hn._fromJSON(t,c);u!==o&&(a=f),o=u;break}}catch{}const l=s.filter(u=>u._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new ds(o,t,r):(o=l[0],a&&await o._set(i,a.toJSON()),await Promise.all(n.map(async u=>{if(u!==o)try{await u._remove(i)}catch{}})),new ds(o,t,r))}}/**
732
+ */function Po(e,t,n){return`firebase:${e}:${t}:${n}`}class us{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=Po(this.userKey,s.apiKey,o),this.fullPersistenceKey=Po("persistence",s.apiKey,o),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);if(!t)return null;if(typeof t=="string"){const n=await Vo(this.auth,{idToken:t}).catch(()=>{});return n?hn._fromGetAccountInfoResponse(this.auth,n,t):null}return hn._fromJSON(this.auth,t)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=t,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,n,r="authUser"){if(!n.length)return new us(Jn(Qc),t,r);const s=(await Promise.all(n.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let o=s[0]||Jn(Qc);const i=Po(r,t.config.apiKey,t.name);let a=null;for(const u of n)try{const c=await u._get(i);if(c){let f;if(typeof c=="string"){const h=await Vo(t,{idToken:c}).catch(()=>{});if(!h)break;f=await hn._fromGetAccountInfoResponse(t,h,c)}else f=hn._fromJSON(t,c);u!==o&&(a=f),o=u;break}}catch{}const l=s.filter(u=>u._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new us(o,t,r):(o=l[0],a&&await o._set(i,a.toJSON()),await Promise.all(n.map(async u=>{if(u!==o)try{await u._remove(i)}catch{}})),new us(o,t,r))}}/**
733
733
  * @license
734
734
  * Copyright 2020 Google LLC
735
735
  *
@@ -744,7 +744,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
744
744
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
745
745
  * See the License for the specific language governing permissions and
746
746
  * limitations under the License.
747
- */function Zc(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Ef(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Tf(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Af(t))return"Blackberry";if(Rf(t))return"Webos";if(If(t))return"Safari";if((t.includes("chrome/")||Sf(t))&&!t.includes("edge/"))return"Chrome";if(Cf(t))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=e.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function Tf(e=Xt()){return/firefox\//i.test(e)}function If(e=Xt()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Sf(e=Xt()){return/crios\//i.test(e)}function Ef(e=Xt()){return/iemobile/i.test(e)}function Cf(e=Xt()){return/android/i.test(e)}function Af(e=Xt()){return/blackberry/i.test(e)}function Rf(e=Xt()){return/webos/i.test(e)}function ll(e=Xt()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function L1(e=Xt()){var t;return ll(e)&&!!((t=window.navigator)!=null&&t.standalone)}function j1(){return Q0()&&document.documentMode===10}function xf(e=Xt()){return ll(e)||Cf(e)||Rf(e)||Af(e)||/windows phone/i.test(e)||Ef(e)}/**
747
+ */function Xc(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Sf(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(kf(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Cf(t))return"Blackberry";if(Af(t))return"Webos";if(Tf(t))return"Safari";if((t.includes("chrome/")||If(t))&&!t.includes("edge/"))return"Chrome";if(Ef(t))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=e.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function kf(e=Zt()){return/firefox\//i.test(e)}function Tf(e=Zt()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function If(e=Zt()){return/crios\//i.test(e)}function Sf(e=Zt()){return/iemobile/i.test(e)}function Ef(e=Zt()){return/android/i.test(e)}function Cf(e=Zt()){return/blackberry/i.test(e)}function Af(e=Zt()){return/webos/i.test(e)}function al(e=Zt()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function L1(e=Zt()){var t;return al(e)&&!!((t=window.navigator)!=null&&t.standalone)}function j1(){return Q0()&&document.documentMode===10}function Rf(e=Zt()){return al(e)||Ef(e)||Af(e)||Cf(e)||/windows phone/i.test(e)||Sf(e)}/**
748
748
  * @license
749
749
  * Copyright 2020 Google LLC
750
750
  *
@@ -759,7 +759,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
759
759
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
760
760
  * See the License for the specific language governing permissions and
761
761
  * limitations under the License.
762
- */function Pf(e,t=[]){let n;switch(e){case"Browser":n=Zc(Xt());break;case"Worker":n=`${Zc(Xt())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${lo}/${r}`}/**
762
+ */function Pf(e,t=[]){let n;switch(e){case"Browser":n=Xc(Zt());break;case"Worker":n=`${Xc(Zt())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${lo}/${r}`}/**
763
763
  * @license
764
764
  * Copyright 2022 Google LLC
765
765
  *
@@ -789,7 +789,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
789
789
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
790
790
  * See the License for the specific language governing permissions and
791
791
  * limitations under the License.
792
- */async function U1(e,t={}){return _s(e,"GET","/v2/passwordPolicy",il(e,t))}/**
792
+ */async function U1(e,t={}){return bs(e,"GET","/v2/passwordPolicy",ol(e,t))}/**
793
793
  * @license
794
794
  * Copyright 2023 Google LLC
795
795
  *
@@ -819,7 +819,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
819
819
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
820
820
  * See the License for the specific language governing permissions and
821
821
  * limitations under the License.
822
- */class V1{constructor(t,n,r,s){this.app=t,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new eu(this),this.idTokenSubscription=new eu(this),this.beforeStateQueue=new B1(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=vf,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(o=>this._resolvePersistenceManagerAvailable=o)}_initializeWithPersistence(t,n){return n&&(this._popupRedirectResolver=Yn(n)),this._initializationPromise=this.queue(async()=>{var r,s,o;if(!this._deleted&&(this.persistenceManager=await ds.create(this,t),(r=this._resolvePersistenceManagerAvailable)==null||r.call(this),!this._deleted)){if((s=this._popupRedirectResolver)!=null&&s._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((o=this.currentUser)==null?void 0:o.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUserFromIdToken(t){try{const n=await Vo(this,{idToken:t}),r=await hn._fromGetAccountInfoResponse(this,n,t);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var o;if(xn(this.app)){const i=this.app.settings.authIdToken;return i?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(i).then(a,a))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,s=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const i=(o=this.redirectUser)==null?void 0:o._redirectEventId,a=r==null?void 0:r._redirectEventId,l=await this.tryRedirectSignIn(t);(!i||i===a)&&(l!=null&&l.user)&&(r=l.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(i){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(i))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return Fe(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(t){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(t){try{await Wo(t)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=T1()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(xn(this.app))return Promise.reject(Wr(this));const n=t?bs(t):null;return n&&Fe(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(t,n=!1){if(!this._deleted)return t&&Fe(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return xn(this.app)?Promise.reject(Wr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return xn(this.app)?Promise.reject(Wr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Yn(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await U1(this),n=new H1(t);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(t){this._errorFactory=new io("auth","Firebase",t())}onAuthStateChanged(t,n,r){return this.registerStateListener(this.authStateSubscription,t,n,r)}beforeAuthStateChanged(t,n){return this.beforeStateQueue.pushCallback(t,n)}onIdTokenChanged(t,n,r){return this.registerStateListener(this.idTokenSubscription,t,n,r)}authStateReady(){return new Promise((t,n)=>{if(this.currentUser)t();else{const r=this.onAuthStateChanged(()=>{r(),t()},n)}})}async revokeAccessToken(t){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await D1(this,r)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)==null?void 0:t.toJSON()}}async _setRedirectUser(t,n){const r=await this.getOrInitRedirectPersistenceManager(n);return t===null?r.removeCurrentUser():r.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const n=t&&Yn(t)||this._popupRedirectResolver;Fe(n,this,"argument-error"),this.redirectPersistenceManager=await ds.create(this,[Yn(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)==null?void 0:n._redirectEventId)===t?this._currentUser:((r=this.redirectUser)==null?void 0:r._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const t=((n=this.currentUser)==null?void 0:n.uid)??null;this.lastNotifiedUid!==t&&(this.lastNotifiedUid=t,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,n,r,s){if(this._deleted)return()=>{};const o=typeof n=="function"?n:n.next.bind(n);let i=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Fe(a,this,"internal-error"),a.then(()=>{i||o(this.currentUser)}),typeof n=="function"){const l=t.addObserver(n,r,s);return()=>{i=!0,l()}}else{const l=t.addObserver(n);return()=>{i=!0,l()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Fe(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Pf(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var s;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await((s=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:s.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var n;if(xn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await((n=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:n.getToken());return t!=null&&t.error&&w1(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function fi(e){return bs(e)}class eu{constructor(t){this.auth=t,this.observer=null,this.addObserver=sT(n=>this.observer=n)}get next(){return Fe(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
822
+ */class V1{constructor(t,n,r,s){this.app=t,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Zc(this),this.idTokenSubscription=new Zc(this),this.beforeStateQueue=new B1(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=gf,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(o=>this._resolvePersistenceManagerAvailable=o)}_initializeWithPersistence(t,n){return n&&(this._popupRedirectResolver=Jn(n)),this._initializationPromise=this.queue(async()=>{var r,s,o;if(!this._deleted&&(this.persistenceManager=await us.create(this,t),(r=this._resolvePersistenceManagerAvailable)==null||r.call(this),!this._deleted)){if((s=this._popupRedirectResolver)!=null&&s._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((o=this.currentUser)==null?void 0:o.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUserFromIdToken(t){try{const n=await Vo(this,{idToken:t}),r=await hn._fromGetAccountInfoResponse(this,n,t);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var o;if(Pn(this.app)){const i=this.app.settings.authIdToken;return i?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(i).then(a,a))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,s=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const i=(o=this.redirectUser)==null?void 0:o._redirectEventId,a=r==null?void 0:r._redirectEventId,l=await this.tryRedirectSignIn(t);(!i||i===a)&&(l!=null&&l.user)&&(r=l.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(i){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(i))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return Fe(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(t){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(t){try{await Wo(t)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=T1()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(Pn(this.app))return Promise.reject(Wr(this));const n=t?ws(t):null;return n&&Fe(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(t,n=!1){if(!this._deleted)return t&&Fe(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return Pn(this.app)?Promise.reject(Wr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return Pn(this.app)?Promise.reject(Wr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Jn(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await U1(this),n=new H1(t);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(t){this._errorFactory=new io("auth","Firebase",t())}onAuthStateChanged(t,n,r){return this.registerStateListener(this.authStateSubscription,t,n,r)}beforeAuthStateChanged(t,n){return this.beforeStateQueue.pushCallback(t,n)}onIdTokenChanged(t,n,r){return this.registerStateListener(this.idTokenSubscription,t,n,r)}authStateReady(){return new Promise((t,n)=>{if(this.currentUser)t();else{const r=this.onAuthStateChanged(()=>{r(),t()},n)}})}async revokeAccessToken(t){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await D1(this,r)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)==null?void 0:t.toJSON()}}async _setRedirectUser(t,n){const r=await this.getOrInitRedirectPersistenceManager(n);return t===null?r.removeCurrentUser():r.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const n=t&&Jn(t)||this._popupRedirectResolver;Fe(n,this,"argument-error"),this.redirectPersistenceManager=await us.create(this,[Jn(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)==null?void 0:n._redirectEventId)===t?this._currentUser:((r=this.redirectUser)==null?void 0:r._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const t=((n=this.currentUser)==null?void 0:n.uid)??null;this.lastNotifiedUid!==t&&(this.lastNotifiedUid=t,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,n,r,s){if(this._deleted)return()=>{};const o=typeof n=="function"?n:n.next.bind(n);let i=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Fe(a,this,"internal-error"),a.then(()=>{i||o(this.currentUser)}),typeof n=="function"){const l=t.addObserver(n,r,s);return()=>{i=!0,l()}}else{const l=t.addObserver(n);return()=>{i=!0,l()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Fe(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Pf(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var s;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await((s=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:s.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var n;if(Pn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await((n=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:n.getToken());return t!=null&&t.error&&w1(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function fi(e){return ws(e)}class Zc{constructor(t){this.auth=t,this.observer=null,this.addObserver=sT(n=>this.observer=n)}get next(){return Fe(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
823
823
  * @license
824
824
  * Copyright 2020 Google LLC
825
825
  *
@@ -834,7 +834,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
834
834
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
835
835
  * See the License for the specific language governing permissions and
836
836
  * limitations under the License.
837
- */let cl={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function W1(e){cl=e}function z1(e){return cl.loadJS(e)}function q1(){return cl.gapiScript}function G1(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
837
+ */let ll={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function W1(e){ll=e}function q1(e){return ll.loadJS(e)}function z1(){return ll.gapiScript}function G1(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
838
838
  * @license
839
839
  * Copyright 2020 Google LLC
840
840
  *
@@ -849,7 +849,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
849
849
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
850
850
  * See the License for the specific language governing permissions and
851
851
  * limitations under the License.
852
- */function K1(e,t){const n=df(e,"auth");if(n.isInitialized()){const s=n.getImmediate(),o=n.getOptions();if(gs(o,t??{}))return s;$n(s,"already-initialized")}return n.initialize({options:t})}function J1(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Yn);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function Y1(e,t,n){const r=fi(e);Fe(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const s=!1,o=Mf(t),{host:i,port:a}=Q1(t),l=a===null?"":`:${a}`,u={url:`${o}//${i}${l}/`},c=Object.freeze({host:i,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){Fe(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Fe(gs(u,r.config.emulator)&&gs(c,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=c,r.settings.appVerificationDisabledForTesting=!0,di(i)?(V0(`${o}//${i}${l}`),q0("Auth",!0)):X1()}function Mf(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Q1(e){const t=Mf(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const o=s[1];return{host:o,port:tu(r.substr(o.length+1))}}else{const[o,i]=r.split(":");return{host:o,port:tu(i)}}}function tu(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function X1(){function e(){const t=document.createElement("p"),n=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e())}/**
852
+ */function K1(e,t){const n=uf(e,"auth");if(n.isInitialized()){const s=n.getImmediate(),o=n.getOptions();if(ms(o,t??{}))return s;$n(s,"already-initialized")}return n.initialize({options:t})}function J1(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Jn);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function Y1(e,t,n){const r=fi(e);Fe(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const s=!1,o=xf(t),{host:i,port:a}=Q1(t),l=a===null?"":`:${a}`,u={url:`${o}//${i}${l}/`},c=Object.freeze({host:i,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){Fe(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Fe(ms(u,r.config.emulator)&&ms(c,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=c,r.settings.appVerificationDisabledForTesting=!0,di(i)?(V0(`${o}//${i}${l}`),z0("Auth",!0)):X1()}function xf(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Q1(e){const t=xf(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const o=s[1];return{host:o,port:eu(r.substr(o.length+1))}}else{const[o,i]=r.split(":");return{host:o,port:eu(i)}}}function eu(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function X1(){function e(){const t=document.createElement("p"),n=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e())}/**
853
853
  * @license
854
854
  * Copyright 2020 Google LLC
855
855
  *
@@ -864,7 +864,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
864
864
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
865
865
  * See the License for the specific language governing permissions and
866
866
  * limitations under the License.
867
- */class Of{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return Jn("not implemented")}_getIdTokenResponse(t){return Jn("not implemented")}_linkToIdToken(t,n){return Jn("not implemented")}_getReauthenticationResolver(t){return Jn("not implemented")}}/**
867
+ */class Mf{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return Kn("not implemented")}_getIdTokenResponse(t){return Kn("not implemented")}_linkToIdToken(t,n){return Kn("not implemented")}_getReauthenticationResolver(t){return Kn("not implemented")}}/**
868
868
  * @license
869
869
  * Copyright 2020 Google LLC
870
870
  *
@@ -879,7 +879,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
879
879
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
880
880
  * See the License for the specific language governing permissions and
881
881
  * limitations under the License.
882
- */async function fs(e,t){return C1(e,"POST","/v1/accounts:signInWithIdp",il(e,t))}/**
882
+ */async function ds(e,t){return C1(e,"POST","/v1/accounts:signInWithIdp",ol(e,t))}/**
883
883
  * @license
884
884
  * Copyright 2020 Google LLC
885
885
  *
@@ -894,7 +894,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
894
894
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
895
895
  * See the License for the specific language governing permissions and
896
896
  * limitations under the License.
897
- */const Z1="http://localhost";class qr extends Of{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new qr(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):$n("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:s,...o}=n;if(!r||!s)return null;const i=new qr(r,s);return i.idToken=o.idToken||void 0,i.accessToken=o.accessToken||void 0,i.secret=o.secret,i.nonce=o.nonce,i.pendingToken=o.pendingToken||null,i}_getIdTokenResponse(t){const n=this.buildRequest();return fs(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,fs(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,fs(t,n)}buildRequest(){const t={requestUri:Z1,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),t.postBody=ao(n)}return t}}/**
897
+ */const Z1="http://localhost";class zr extends Mf{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new zr(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):$n("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:s,...o}=n;if(!r||!s)return null;const i=new zr(r,s);return i.idToken=o.idToken||void 0,i.accessToken=o.accessToken||void 0,i.secret=o.secret,i.nonce=o.nonce,i.pendingToken=o.pendingToken||null,i}_getIdTokenResponse(t){const n=this.buildRequest();return ds(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,ds(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,ds(t,n)}buildRequest(){const t={requestUri:Z1,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),t.postBody=ao(n)}return t}}/**
898
898
  * @license
899
899
  * Copyright 2020 Google LLC
900
900
  *
@@ -909,7 +909,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
909
909
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
910
910
  * See the License for the specific language governing permissions and
911
911
  * limitations under the License.
912
- */class ul{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/**
912
+ */class cl{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/**
913
913
  * @license
914
914
  * Copyright 2019 Google LLC
915
915
  *
@@ -924,7 +924,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
924
924
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
925
925
  * See the License for the specific language governing permissions and
926
926
  * limitations under the License.
927
- */class uo extends ul{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
927
+ */class uo extends cl{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
928
928
  * @license
929
929
  * Copyright 2020 Google LLC
930
930
  *
@@ -939,7 +939,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
939
939
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
940
940
  * See the License for the specific language governing permissions and
941
941
  * limitations under the License.
942
- */class vr extends uo{constructor(){super("facebook.com")}static credential(t){return qr._fromParams({providerId:vr.PROVIDER_ID,signInMethod:vr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return vr.credentialFromTaggedObject(t)}static credentialFromError(t){return vr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return vr.credential(t.oauthAccessToken)}catch{return null}}}vr.FACEBOOK_SIGN_IN_METHOD="facebook.com";vr.PROVIDER_ID="facebook.com";/**
942
+ */class gr extends uo{constructor(){super("facebook.com")}static credential(t){return zr._fromParams({providerId:gr.PROVIDER_ID,signInMethod:gr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return gr.credentialFromTaggedObject(t)}static credentialFromError(t){return gr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return gr.credential(t.oauthAccessToken)}catch{return null}}}gr.FACEBOOK_SIGN_IN_METHOD="facebook.com";gr.PROVIDER_ID="facebook.com";/**
943
943
  * @license
944
944
  * Copyright 2020 Google LLC
945
945
  *
@@ -954,7 +954,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
954
954
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
955
955
  * See the License for the specific language governing permissions and
956
956
  * limitations under the License.
957
- */class yr extends uo{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return qr._fromParams({providerId:yr.PROVIDER_ID,signInMethod:yr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return yr.credentialFromTaggedObject(t)}static credentialFromError(t){return yr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return yr.credential(n,r)}catch{return null}}}yr.GOOGLE_SIGN_IN_METHOD="google.com";yr.PROVIDER_ID="google.com";/**
957
+ */class vr extends uo{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return zr._fromParams({providerId:vr.PROVIDER_ID,signInMethod:vr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return vr.credentialFromTaggedObject(t)}static credentialFromError(t){return vr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return vr.credential(n,r)}catch{return null}}}vr.GOOGLE_SIGN_IN_METHOD="google.com";vr.PROVIDER_ID="google.com";/**
958
958
  * @license
959
959
  * Copyright 2020 Google LLC
960
960
  *
@@ -969,7 +969,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
969
969
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
970
970
  * See the License for the specific language governing permissions and
971
971
  * limitations under the License.
972
- */class Pn extends uo{constructor(){super("github.com")}static credential(t){return qr._fromParams({providerId:Pn.PROVIDER_ID,signInMethod:Pn.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Pn.credentialFromTaggedObject(t)}static credentialFromError(t){return Pn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Pn.credential(t.oauthAccessToken)}catch{return null}}}Pn.GITHUB_SIGN_IN_METHOD="github.com";Pn.PROVIDER_ID="github.com";/**
972
+ */class xn extends uo{constructor(){super("github.com")}static credential(t){return zr._fromParams({providerId:xn.PROVIDER_ID,signInMethod:xn.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return xn.credentialFromTaggedObject(t)}static credentialFromError(t){return xn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return xn.credential(t.oauthAccessToken)}catch{return null}}}xn.GITHUB_SIGN_IN_METHOD="github.com";xn.PROVIDER_ID="github.com";/**
973
973
  * @license
974
974
  * Copyright 2020 Google LLC
975
975
  *
@@ -984,7 +984,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
984
984
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
985
985
  * See the License for the specific language governing permissions and
986
986
  * limitations under the License.
987
- */class wr extends uo{constructor(){super("twitter.com")}static credential(t,n){return qr._fromParams({providerId:wr.PROVIDER_ID,signInMethod:wr.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return wr.credentialFromTaggedObject(t)}static credentialFromError(t){return wr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return wr.credential(n,r)}catch{return null}}}wr.TWITTER_SIGN_IN_METHOD="twitter.com";wr.PROVIDER_ID="twitter.com";/**
987
+ */class yr extends uo{constructor(){super("twitter.com")}static credential(t,n){return zr._fromParams({providerId:yr.PROVIDER_ID,signInMethod:yr.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return yr.credentialFromTaggedObject(t)}static credentialFromError(t){return yr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return yr.credential(n,r)}catch{return null}}}yr.TWITTER_SIGN_IN_METHOD="twitter.com";yr.PROVIDER_ID="twitter.com";/**
988
988
  * @license
989
989
  * Copyright 2020 Google LLC
990
990
  *
@@ -999,7 +999,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
999
999
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1000
1000
  * See the License for the specific language governing permissions and
1001
1001
  * limitations under the License.
1002
- */class ys{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,n,r,s=!1){const o=await hn._fromIdTokenResponse(t,r,s),i=nu(r);return new ys({user:o,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const s=nu(r);return new ys({user:t,providerId:s,_tokenResponse:r,operationType:n})}}function nu(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
1002
+ */class vs{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,n,r,s=!1){const o=await hn._fromIdTokenResponse(t,r,s),i=tu(r);return new vs({user:o,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const s=tu(r);return new vs({user:t,providerId:s,_tokenResponse:r,operationType:n})}}function tu(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
1003
1003
  * @license
1004
1004
  * Copyright 2020 Google LLC
1005
1005
  *
@@ -1014,7 +1014,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1014
1014
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1015
1015
  * See the License for the specific language governing permissions and
1016
1016
  * limitations under the License.
1017
- */class zo extends Ir{constructor(t,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,zo.prototype),this.customData={appName:t.name,tenantId:t.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(t,n,r,s){return new zo(t,n,r,s)}}function Nf(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?zo._fromErrorAndOperation(e,o,t,r):o})}async function eI(e,t,n=!1){const r=await no(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return ys._forOperation(e,"link",r)}/**
1017
+ */class qo extends Tr{constructor(t,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,qo.prototype),this.customData={appName:t.name,tenantId:t.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(t,n,r,s){return new qo(t,n,r,s)}}function Of(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?qo._fromErrorAndOperation(e,o,t,r):o})}async function eI(e,t,n=!1){const r=await no(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return vs._forOperation(e,"link",r)}/**
1018
1018
  * @license
1019
1019
  * Copyright 2019 Google LLC
1020
1020
  *
@@ -1029,7 +1029,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1029
1029
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1030
1030
  * See the License for the specific language governing permissions and
1031
1031
  * limitations under the License.
1032
- */async function tI(e,t,n=!1){const{auth:r}=e;if(xn(r.app))return Promise.reject(Wr(r));const s="reauthenticate";try{const o=await no(e,Nf(r,s,t,e),n);Fe(o.idToken,r,"internal-error");const i=al(o.idToken);Fe(i,r,"internal-error");const{sub:a}=i;return Fe(e.uid===a,r,"user-mismatch"),ys._forOperation(e,s,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&$n(r,"user-mismatch"),o}}/**
1032
+ */async function tI(e,t,n=!1){const{auth:r}=e;if(Pn(r.app))return Promise.reject(Wr(r));const s="reauthenticate";try{const o=await no(e,Of(r,s,t,e),n);Fe(o.idToken,r,"internal-error");const i=il(o.idToken);Fe(i,r,"internal-error");const{sub:a}=i;return Fe(e.uid===a,r,"user-mismatch"),vs._forOperation(e,s,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&$n(r,"user-mismatch"),o}}/**
1033
1033
  * @license
1034
1034
  * Copyright 2020 Google LLC
1035
1035
  *
@@ -1044,7 +1044,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1044
1044
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1045
1045
  * See the License for the specific language governing permissions and
1046
1046
  * limitations under the License.
1047
- */async function nI(e,t,n=!1){if(xn(e.app))return Promise.reject(Wr(e));const r="signIn",s=await Nf(e,r,t),o=await ys._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(o.user),o}function rI(e,t,n,r){return bs(e).onIdTokenChanged(t,n,r)}function sI(e,t,n){return bs(e).beforeAuthStateChanged(t,n)}const qo="__sak";/**
1047
+ */async function nI(e,t,n=!1){if(Pn(e.app))return Promise.reject(Wr(e));const r="signIn",s=await Of(e,r,t),o=await vs._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(o.user),o}function rI(e,t,n,r){return ws(e).onIdTokenChanged(t,n,r)}function sI(e,t,n){return ws(e).beforeAuthStateChanged(t,n)}const zo="__sak";/**
1048
1048
  * @license
1049
1049
  * Copyright 2019 Google LLC
1050
1050
  *
@@ -1059,7 +1059,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1059
1059
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1060
1060
  * See the License for the specific language governing permissions and
1061
1061
  * limitations under the License.
1062
- */class $f{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(qo,"1"),this.storage.removeItem(qo),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,n){return this.storage.setItem(t,JSON.stringify(n)),Promise.resolve()}_get(t){const n=this.storage.getItem(t);return Promise.resolve(n?JSON.parse(n):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1062
+ */class Nf{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(zo,"1"),this.storage.removeItem(zo),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,n){return this.storage.setItem(t,JSON.stringify(n)),Promise.resolve()}_get(t){const n=this.storage.getItem(t);return Promise.resolve(n?JSON.parse(n):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1063
1063
  * @license
1064
1064
  * Copyright 2020 Google LLC
1065
1065
  *
@@ -1074,7 +1074,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1074
1074
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1075
1075
  * See the License for the specific language governing permissions and
1076
1076
  * limitations under the License.
1077
- */const oI=1e3,iI=10;class Df extends $f{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=xf(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),s=this.localCache[n];r!==s&&t(n,s,r)}}onStorageEvent(t,n=!1){if(!t.key){this.forAllChangedKeys((i,a,l)=>{this.notifyListeners(i,l)});return}const r=t.key;n?this.detachListener():this.stopPolling();const s=()=>{const i=this.storage.getItem(r);!n&&this.localCache[r]===i||this.notifyListeners(r,i)},o=this.storage.getItem(r);j1()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,iI):s()}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const s of Array.from(r))s(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:n,newValue:r}),!0)})},oI)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,n){await super._set(t,n),this.localCache[t]=JSON.stringify(n)}async _get(t){const n=await super._get(t);return this.localCache[t]=JSON.stringify(n),n}async _remove(t){await super._remove(t),delete this.localCache[t]}}Df.type="LOCAL";const aI=Df;/**
1077
+ */const oI=1e3,iI=10;class $f extends Nf{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Rf(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),s=this.localCache[n];r!==s&&t(n,s,r)}}onStorageEvent(t,n=!1){if(!t.key){this.forAllChangedKeys((i,a,l)=>{this.notifyListeners(i,l)});return}const r=t.key;n?this.detachListener():this.stopPolling();const s=()=>{const i=this.storage.getItem(r);!n&&this.localCache[r]===i||this.notifyListeners(r,i)},o=this.storage.getItem(r);j1()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,iI):s()}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const s of Array.from(r))s(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:n,newValue:r}),!0)})},oI)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,n){await super._set(t,n),this.localCache[t]=JSON.stringify(n)}async _get(t){const n=await super._get(t);return this.localCache[t]=JSON.stringify(n),n}async _remove(t){await super._remove(t),delete this.localCache[t]}}$f.type="LOCAL";const aI=$f;/**
1078
1078
  * @license
1079
1079
  * Copyright 2020 Google LLC
1080
1080
  *
@@ -1089,7 +1089,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1089
1089
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1090
1090
  * See the License for the specific language governing permissions and
1091
1091
  * limitations under the License.
1092
- */class Lf extends $f{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}Lf.type="SESSION";const jf=Lf;/**
1092
+ */class Df extends Nf{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}Df.type="SESSION";const Lf=Df;/**
1093
1093
  * @license
1094
1094
  * Copyright 2019 Google LLC
1095
1095
  *
@@ -1134,7 +1134,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1134
1134
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1135
1135
  * See the License for the specific language governing permissions and
1136
1136
  * limitations under the License.
1137
- */function dl(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
1137
+ */function ul(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
1138
1138
  * @license
1139
1139
  * Copyright 2019 Google LLC
1140
1140
  *
@@ -1149,7 +1149,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1149
1149
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1150
1150
  * See the License for the specific language governing permissions and
1151
1151
  * limitations under the License.
1152
- */class cI{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,n,r=50){const s=typeof MessageChannel<"u"?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let o,i;return new Promise((a,l)=>{const u=dl("",20);s.port1.start();const c=setTimeout(()=>{l(new Error("unsupported_event"))},r);i={messageChannel:s,onMessage(f){const h=f;if(h.data.eventId===u)switch(h.data.status){case"ack":clearTimeout(c),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(h.data.response);break;default:clearTimeout(c),clearTimeout(o),l(new Error("invalid_response"));break}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:t,eventId:u,data:n},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}/**
1152
+ */class cI{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,n,r=50){const s=typeof MessageChannel<"u"?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let o,i;return new Promise((a,l)=>{const u=ul("",20);s.port1.start();const c=setTimeout(()=>{l(new Error("unsupported_event"))},r);i={messageChannel:s,onMessage(f){const h=f;if(h.data.eventId===u)switch(h.data.status){case"ack":clearTimeout(c),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(h.data.response);break;default:clearTimeout(c),clearTimeout(o),l(new Error("invalid_response"));break}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:t,eventId:u,data:n},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}/**
1153
1153
  * @license
1154
1154
  * Copyright 2020 Google LLC
1155
1155
  *
@@ -1179,7 +1179,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1179
1179
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1180
1180
  * See the License for the specific language governing permissions and
1181
1181
  * limitations under the License.
1182
- */function Bf(){return typeof Nn().WorkerGlobalScope<"u"&&typeof Nn().importScripts=="function"}async function dI(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function fI(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function hI(){return Bf()?self:null}/**
1182
+ */function jf(){return typeof Nn().WorkerGlobalScope<"u"&&typeof Nn().importScripts=="function"}async function dI(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function fI(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function hI(){return jf()?self:null}/**
1183
1183
  * @license
1184
1184
  * Copyright 2019 Google LLC
1185
1185
  *
@@ -1194,7 +1194,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1194
1194
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1195
1195
  * See the License for the specific language governing permissions and
1196
1196
  * limitations under the License.
1197
- */const Uf="firebaseLocalStorageDb",pI=1,Go="firebaseLocalStorage",Ff="fbase_key";class fo{constructor(t){this.request=t}toPromise(){return new Promise((t,n)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function pi(e,t){return e.transaction([Go],t?"readwrite":"readonly").objectStore(Go)}function mI(){const e=indexedDB.deleteDatabase(Uf);return new fo(e).toPromise()}function Ea(){const e=indexedDB.open(Uf,pI);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(Go,{keyPath:Ff})}catch(s){n(s)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(Go)?t(r):(r.close(),await mI(),t(await Ea()))})})}async function ru(e,t,n){const r=pi(e,!0).put({[Ff]:t,value:n});return new fo(r).toPromise()}async function gI(e,t){const n=pi(e,!1).get(t),r=await new fo(n).toPromise();return r===void 0?null:r.value}function su(e,t){const n=pi(e,!0).delete(t);return new fo(n).toPromise()}const vI=800,yI=3;class Hf{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Ea(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>yI)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Bf()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=hi._getInstance(hI()),this.receiver._subscribe("keyChanged",async(t,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(t,n)=>["keyChanged"])}async initializeSender(){var n,r;if(this.activeServiceWorker=await dI(),!this.activeServiceWorker)return;this.sender=new cI(this.activeServiceWorker);const t=await this.sender._send("ping",{},800);t&&(n=t[0])!=null&&n.fulfilled&&(r=t[0])!=null&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||fI()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await Ea();return await ru(t,qo,"1"),await su(t,qo),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>ru(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>gI(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>su(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(s=>{const o=pi(s,!1).getAll();return new fo(o).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(t.length!==0)for(const{fbase_key:s,value:o}of t)r.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(o)&&(this.notifyListeners(s,o),n.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!r.has(s)&&(this.notifyListeners(s,null),n.push(s));return n}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const s of Array.from(r))s(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),vI)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}Hf.type="LOCAL";const wI=Hf;new co(3e4,6e4);/**
1197
+ */const Bf="firebaseLocalStorageDb",pI=1,Go="firebaseLocalStorage",Uf="fbase_key";class fo{constructor(t){this.request=t}toPromise(){return new Promise((t,n)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function pi(e,t){return e.transaction([Go],t?"readwrite":"readonly").objectStore(Go)}function mI(){const e=indexedDB.deleteDatabase(Bf);return new fo(e).toPromise()}function Sa(){const e=indexedDB.open(Bf,pI);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(Go,{keyPath:Uf})}catch(s){n(s)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(Go)?t(r):(r.close(),await mI(),t(await Sa()))})})}async function nu(e,t,n){const r=pi(e,!0).put({[Uf]:t,value:n});return new fo(r).toPromise()}async function gI(e,t){const n=pi(e,!1).get(t),r=await new fo(n).toPromise();return r===void 0?null:r.value}function ru(e,t){const n=pi(e,!0).delete(t);return new fo(n).toPromise()}const vI=800,yI=3;class Ff{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Sa(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>yI)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return jf()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=hi._getInstance(hI()),this.receiver._subscribe("keyChanged",async(t,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(t,n)=>["keyChanged"])}async initializeSender(){var n,r;if(this.activeServiceWorker=await dI(),!this.activeServiceWorker)return;this.sender=new cI(this.activeServiceWorker);const t=await this.sender._send("ping",{},800);t&&(n=t[0])!=null&&n.fulfilled&&(r=t[0])!=null&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||fI()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await Sa();return await nu(t,zo,"1"),await ru(t,zo),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>nu(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>gI(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>ru(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(s=>{const o=pi(s,!1).getAll();return new fo(o).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(t.length!==0)for(const{fbase_key:s,value:o}of t)r.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(o)&&(this.notifyListeners(s,o),n.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!r.has(s)&&(this.notifyListeners(s,null),n.push(s));return n}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const s of Array.from(r))s(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),vI)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}Ff.type="LOCAL";const wI=Ff;new co(3e4,6e4);/**
1198
1198
  * @license
1199
1199
  * Copyright 2021 Google LLC
1200
1200
  *
@@ -1209,7 +1209,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1209
1209
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1210
1210
  * See the License for the specific language governing permissions and
1211
1211
  * limitations under the License.
1212
- */function Vf(e,t){return t?Yn(t):(Fe(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
1212
+ */function Hf(e,t){return t?Jn(t):(Fe(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
1213
1213
  * @license
1214
1214
  * Copyright 2019 Google LLC
1215
1215
  *
@@ -1224,7 +1224,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1224
1224
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1225
1225
  * See the License for the specific language governing permissions and
1226
1226
  * limitations under the License.
1227
- */class fl extends Of{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return fs(t,this._buildIdpRequest())}_linkToIdToken(t,n){return fs(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return fs(t,this._buildIdpRequest())}_buildIdpRequest(t){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(n.idToken=t),n}}function bI(e){return nI(e.auth,new fl(e),e.bypassAuthState)}function _I(e){const{auth:t,user:n}=e;return Fe(n,t,"internal-error"),tI(n,new fl(e),e.bypassAuthState)}async function kI(e){const{auth:t,user:n}=e;return Fe(n,t,"internal-error"),eI(n,new fl(e),e.bypassAuthState)}/**
1227
+ */class dl extends Mf{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return ds(t,this._buildIdpRequest())}_linkToIdToken(t,n){return ds(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return ds(t,this._buildIdpRequest())}_buildIdpRequest(t){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(n.idToken=t),n}}function bI(e){return nI(e.auth,new dl(e),e.bypassAuthState)}function _I(e){const{auth:t,user:n}=e;return Fe(n,t,"internal-error"),tI(n,new dl(e),e.bypassAuthState)}async function kI(e){const{auth:t,user:n}=e;return Fe(n,t,"internal-error"),eI(n,new dl(e),e.bypassAuthState)}/**
1228
1228
  * @license
1229
1229
  * Copyright 2020 Google LLC
1230
1230
  *
@@ -1239,7 +1239,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1239
1239
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1240
1240
  * See the License for the specific language governing permissions and
1241
1241
  * limitations under the License.
1242
- */class Wf{constructor(t,n,r,s,o=!1){this.auth=t,this.resolver=r,this.user=s,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(t,n)=>{this.pendingPromise={resolve:t,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(t){const{urlResponse:n,sessionId:r,postBody:s,tenantId:o,error:i,type:a}=t;if(i){this.reject(i);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:o||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(u){this.reject(u)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return bI;case"linkViaPopup":case"linkViaRedirect":return kI;case"reauthViaPopup":case"reauthViaRedirect":return _I;default:$n(this.auth,"internal-error")}}resolve(t){sr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){sr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1242
+ */class Vf{constructor(t,n,r,s,o=!1){this.auth=t,this.resolver=r,this.user=s,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(t,n)=>{this.pendingPromise={resolve:t,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(t){const{urlResponse:n,sessionId:r,postBody:s,tenantId:o,error:i,type:a}=t;if(i){this.reject(i);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:o||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(u){this.reject(u)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return bI;case"linkViaPopup":case"linkViaRedirect":return kI;case"reauthViaPopup":case"reauthViaRedirect":return _I;default:$n(this.auth,"internal-error")}}resolve(t){rr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){rr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1243
1243
  * @license
1244
1244
  * Copyright 2020 Google LLC
1245
1245
  *
@@ -1254,7 +1254,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1254
1254
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1255
1255
  * See the License for the specific language governing permissions and
1256
1256
  * limitations under the License.
1257
- */const TI=new co(2e3,1e4);async function II(e,t,n){if(xn(e.app))return Promise.reject(gn(e,"operation-not-supported-in-this-environment"));const r=fi(e);b1(e,t,ul);const s=Vf(r,n);return new Fr(r,"signInViaPopup",t,s).executeNotNull()}class Fr extends Wf{constructor(t,n,r,s,o){super(t,n,s,o),this.provider=r,this.authWindow=null,this.pollId=null,Fr.currentPopupAction&&Fr.currentPopupAction.cancel(),Fr.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Fe(t,this.auth,"internal-error"),t}async onExecution(){sr(this.filter.length===1,"Popup operations only handle one event");const t=dl();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(gn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(gn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Fr.currentPopupAction=null}pollUserCancellation(){const t=()=>{var n,r;if((r=(n=this.authWindow)==null?void 0:n.window)!=null&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(gn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,TI.get())};t()}}Fr.currentPopupAction=null;/**
1257
+ */const TI=new co(2e3,1e4);async function II(e,t,n){if(Pn(e.app))return Promise.reject(gn(e,"operation-not-supported-in-this-environment"));const r=fi(e);b1(e,t,cl);const s=Hf(r,n);return new Fr(r,"signInViaPopup",t,s).executeNotNull()}class Fr extends Vf{constructor(t,n,r,s,o){super(t,n,s,o),this.provider=r,this.authWindow=null,this.pollId=null,Fr.currentPopupAction&&Fr.currentPopupAction.cancel(),Fr.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Fe(t,this.auth,"internal-error"),t}async onExecution(){rr(this.filter.length===1,"Popup operations only handle one event");const t=ul();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(gn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(gn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Fr.currentPopupAction=null}pollUserCancellation(){const t=()=>{var n,r;if((r=(n=this.authWindow)==null?void 0:n.window)!=null&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(gn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,TI.get())};t()}}Fr.currentPopupAction=null;/**
1258
1258
  * @license
1259
1259
  * Copyright 2020 Google LLC
1260
1260
  *
@@ -1269,7 +1269,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1269
1269
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1270
1270
  * See the License for the specific language governing permissions and
1271
1271
  * limitations under the License.
1272
- */const SI="pendingRedirect",Po=new Map;class EI extends Wf{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=Po.get(this.auth._key());if(!t){try{const r=await CI(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}Po.set(this.auth._key(),t)}return this.bypassAuthState||Po.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const n=await this.auth._redirectUserForId(t.eventId);if(n)return this.user=n,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function CI(e,t){const n=xI(t),r=RI(e);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function AI(e,t){Po.set(e._key(),t)}function RI(e){return Yn(e._redirectPersistence)}function xI(e){return xo(SI,e.config.apiKey,e.name)}async function PI(e,t,n=!1){if(xn(e.app))return Promise.reject(Wr(e));const r=fi(e),s=Vf(r,t),i=await new EI(r,s,n).execute();return i&&!n&&(delete i.user._redirectEventId,await r._persistUserIfCurrent(i.user),await r._setRedirectUser(null,t)),i}/**
1272
+ */const SI="pendingRedirect",xo=new Map;class EI extends Vf{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=xo.get(this.auth._key());if(!t){try{const r=await CI(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}xo.set(this.auth._key(),t)}return this.bypassAuthState||xo.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const n=await this.auth._redirectUserForId(t.eventId);if(n)return this.user=n,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function CI(e,t){const n=PI(t),r=RI(e);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function AI(e,t){xo.set(e._key(),t)}function RI(e){return Jn(e._redirectPersistence)}function PI(e){return Po(SI,e.config.apiKey,e.name)}async function xI(e,t,n=!1){if(Pn(e.app))return Promise.reject(Wr(e));const r=fi(e),s=Hf(r,t),i=await new EI(r,s,n).execute();return i&&!n&&(delete i.user._redirectEventId,await r._persistUserIfCurrent(i.user),await r._setRedirectUser(null,t)),i}/**
1273
1273
  * @license
1274
1274
  * Copyright 2020 Google LLC
1275
1275
  *
@@ -1284,7 +1284,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1284
1284
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1285
1285
  * See the License for the specific language governing permissions and
1286
1286
  * limitations under the License.
1287
- */const MI=600*1e3;class OI{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(t,r)&&(n=!0,this.sendToConsumer(t,r),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!NI(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!zf(t)){const s=((r=t.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(gn(this.auth,s))}else n.onAuthEvent(t)}isEventForConsumer(t,n){const r=n.eventId===null||!!t.eventId&&t.eventId===n.eventId;return n.filter.includes(t.type)&&r}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=MI&&this.cachedEventUids.clear(),this.cachedEventUids.has(ou(t))}saveEventToCache(t){this.cachedEventUids.add(ou(t)),this.lastProcessedEventTime=Date.now()}}function ou(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function zf({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function NI(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return zf(e);default:return!1}}/**
1287
+ */const MI=600*1e3;class OI{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(t,r)&&(n=!0,this.sendToConsumer(t,r),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!NI(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!Wf(t)){const s=((r=t.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(gn(this.auth,s))}else n.onAuthEvent(t)}isEventForConsumer(t,n){const r=n.eventId===null||!!t.eventId&&t.eventId===n.eventId;return n.filter.includes(t.type)&&r}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=MI&&this.cachedEventUids.clear(),this.cachedEventUids.has(su(t))}saveEventToCache(t){this.cachedEventUids.add(su(t)),this.lastProcessedEventTime=Date.now()}}function su(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function Wf({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function NI(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Wf(e);default:return!1}}/**
1288
1288
  * @license
1289
1289
  * Copyright 2020 Google LLC
1290
1290
  *
@@ -1299,7 +1299,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1299
1299
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1300
1300
  * See the License for the specific language governing permissions and
1301
1301
  * limitations under the License.
1302
- */async function $I(e,t={}){return _s(e,"GET","/v1/projects",t)}/**
1302
+ */async function $I(e,t={}){return bs(e,"GET","/v1/projects",t)}/**
1303
1303
  * @license
1304
1304
  * Copyright 2020 Google LLC
1305
1305
  *
@@ -1314,7 +1314,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1314
1314
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1315
1315
  * See the License for the specific language governing permissions and
1316
1316
  * limitations under the License.
1317
- */const DI=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,LI=/^https?/;async function jI(e){if(e.config.emulator)return;const{authorizedDomains:t}=await $I(e);for(const n of t)try{if(BI(n))return}catch{}$n(e,"unauthorized-domain")}function BI(e){const t=Ia(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const i=new URL(e);return i.hostname===""&&r===""?n==="chrome-extension:"&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):n==="chrome-extension:"&&i.hostname===r}if(!LI.test(n))return!1;if(DI.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
1317
+ */const DI=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,LI=/^https?/;async function jI(e){if(e.config.emulator)return;const{authorizedDomains:t}=await $I(e);for(const n of t)try{if(BI(n))return}catch{}$n(e,"unauthorized-domain")}function BI(e){const t=Ta(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const i=new URL(e);return i.hostname===""&&r===""?n==="chrome-extension:"&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):n==="chrome-extension:"&&i.hostname===r}if(!LI.test(n))return!1;if(DI.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
1318
1318
  * @license
1319
1319
  * Copyright 2020 Google LLC.
1320
1320
  *
@@ -1329,7 +1329,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1329
1329
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1330
1330
  * See the License for the specific language governing permissions and
1331
1331
  * limitations under the License.
1332
- */const UI=new co(3e4,6e4);function iu(){const e=Nn().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}}function FI(e){return new Promise((t,n)=>{var s,o,i;function r(){iu(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{iu(),n(gn(e,"network-request-failed"))},timeout:UI.get()})}if((o=(s=Nn().gapi)==null?void 0:s.iframes)!=null&&o.Iframe)t(gapi.iframes.getContext());else if((i=Nn().gapi)!=null&&i.load)r();else{const a=G1("iframefcb");return Nn()[a]=()=>{gapi.load?r():n(gn(e,"network-request-failed"))},z1(`${q1()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw Mo=null,t})}let Mo=null;function HI(e){return Mo=Mo||FI(e),Mo}/**
1332
+ */const UI=new co(3e4,6e4);function ou(){const e=Nn().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}}function FI(e){return new Promise((t,n)=>{var s,o,i;function r(){ou(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{ou(),n(gn(e,"network-request-failed"))},timeout:UI.get()})}if((o=(s=Nn().gapi)==null?void 0:s.iframes)!=null&&o.Iframe)t(gapi.iframes.getContext());else if((i=Nn().gapi)!=null&&i.load)r();else{const a=G1("iframefcb");return Nn()[a]=()=>{gapi.load?r():n(gn(e,"network-request-failed"))},q1(`${z1()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw Mo=null,t})}let Mo=null;function HI(e){return Mo=Mo||FI(e),Mo}/**
1333
1333
  * @license
1334
1334
  * Copyright 2020 Google LLC.
1335
1335
  *
@@ -1344,7 +1344,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1344
1344
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1345
1345
  * See the License for the specific language governing permissions and
1346
1346
  * limitations under the License.
1347
- */const VI=new co(5e3,15e3),WI="__/auth/iframe",zI="emulator/auth/iframe",qI={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},GI=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function KI(e){const t=e.config;Fe(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?ol(t,zI):`https://${e.config.authDomain}/${WI}`,r={apiKey:t.apiKey,appName:e.name,v:lo},s=GI.get(e.config.apiHost);s&&(r.eid=s);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${ao(r).slice(1)}`}async function JI(e){const t=await HI(e),n=Nn().gapi;return Fe(n,e,"internal-error"),t.open({where:document.body,url:KI(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:qI,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const i=gn(e,"network-request-failed"),a=Nn().setTimeout(()=>{o(i)},VI.get());function l(){Nn().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{o(i)})}))}/**
1347
+ */const VI=new co(5e3,15e3),WI="__/auth/iframe",qI="emulator/auth/iframe",zI={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},GI=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function KI(e){const t=e.config;Fe(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?sl(t,qI):`https://${e.config.authDomain}/${WI}`,r={apiKey:t.apiKey,appName:e.name,v:lo},s=GI.get(e.config.apiHost);s&&(r.eid=s);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${ao(r).slice(1)}`}async function JI(e){const t=await HI(e),n=Nn().gapi;return Fe(n,e,"internal-error"),t.open({where:document.body,url:KI(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:zI,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const i=gn(e,"network-request-failed"),a=Nn().setTimeout(()=>{o(i)},VI.get());function l(){Nn().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{o(i)})}))}/**
1348
1348
  * @license
1349
1349
  * Copyright 2020 Google LLC.
1350
1350
  *
@@ -1359,7 +1359,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1359
1359
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1360
1360
  * See the License for the specific language governing permissions and
1361
1361
  * limitations under the License.
1362
- */const YI={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},QI=500,XI=600,ZI="_blank",eS="http://localhost";class au{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function tS(e,t,n,r=QI,s=XI){const o=Math.max((window.screen.availHeight-s)/2,0).toString(),i=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l={...YI,width:r.toString(),height:s.toString(),top:o,left:i},u=Xt().toLowerCase();n&&(a=Sf(u)?ZI:n),Tf(u)&&(t=t||eS,l.scrollbars="yes");const c=Object.entries(l).reduce((h,[b,N])=>`${h}${b}=${N},`,"");if(L1(u)&&a!=="_self")return nS(t||"",a),new au(null);const f=window.open(t||"",a,c);Fe(f,e,"popup-blocked");try{f.focus()}catch{}return new au(f)}function nS(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
1362
+ */const YI={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},QI=500,XI=600,ZI="_blank",eS="http://localhost";class iu{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function tS(e,t,n,r=QI,s=XI){const o=Math.max((window.screen.availHeight-s)/2,0).toString(),i=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l={...YI,width:r.toString(),height:s.toString(),top:o,left:i},u=Zt().toLowerCase();n&&(a=If(u)?ZI:n),kf(u)&&(t=t||eS,l.scrollbars="yes");const c=Object.entries(l).reduce((h,[b,N])=>`${h}${b}=${N},`,"");if(L1(u)&&a!=="_self")return nS(t||"",a),new iu(null);const f=window.open(t||"",a,c);Fe(f,e,"popup-blocked");try{f.focus()}catch{}return new iu(f)}function nS(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
1363
1363
  * @license
1364
1364
  * Copyright 2021 Google LLC
1365
1365
  *
@@ -1374,7 +1374,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1374
1374
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1375
1375
  * See the License for the specific language governing permissions and
1376
1376
  * limitations under the License.
1377
- */const rS="__/auth/handler",sS="emulator/auth/handler",oS=encodeURIComponent("fac");async function lu(e,t,n,r,s,o){Fe(e.config.authDomain,e,"auth-domain-config-required"),Fe(e.config.apiKey,e,"invalid-api-key");const i={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:lo,eventId:s};if(t instanceof ul){t.setDefaultLanguage(e.languageCode),i.providerId=t.providerId||"",rT(t.getCustomParameters())||(i.customParameters=JSON.stringify(t.getCustomParameters()));for(const[c,f]of Object.entries({}))i[c]=f}if(t instanceof uo){const c=t.getScopes().filter(f=>f!=="");c.length>0&&(i.scopes=c.join(","))}e.tenantId&&(i.tid=e.tenantId);const a=i;for(const c of Object.keys(a))a[c]===void 0&&delete a[c];const l=await e._getAppCheckToken(),u=l?`#${oS}=${encodeURIComponent(l)}`:"";return`${iS(e)}?${ao(a).slice(1)}${u}`}function iS({config:e}){return e.emulator?ol(e,sS):`https://${e.authDomain}/${rS}`}/**
1377
+ */const rS="__/auth/handler",sS="emulator/auth/handler",oS=encodeURIComponent("fac");async function au(e,t,n,r,s,o){Fe(e.config.authDomain,e,"auth-domain-config-required"),Fe(e.config.apiKey,e,"invalid-api-key");const i={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:lo,eventId:s};if(t instanceof cl){t.setDefaultLanguage(e.languageCode),i.providerId=t.providerId||"",rT(t.getCustomParameters())||(i.customParameters=JSON.stringify(t.getCustomParameters()));for(const[c,f]of Object.entries({}))i[c]=f}if(t instanceof uo){const c=t.getScopes().filter(f=>f!=="");c.length>0&&(i.scopes=c.join(","))}e.tenantId&&(i.tid=e.tenantId);const a=i;for(const c of Object.keys(a))a[c]===void 0&&delete a[c];const l=await e._getAppCheckToken(),u=l?`#${oS}=${encodeURIComponent(l)}`:"";return`${iS(e)}?${ao(a).slice(1)}${u}`}function iS({config:e}){return e.emulator?sl(e,sS):`https://${e.authDomain}/${rS}`}/**
1378
1378
  * @license
1379
1379
  * Copyright 2020 Google LLC
1380
1380
  *
@@ -1389,7 +1389,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1389
1389
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1390
1390
  * See the License for the specific language governing permissions and
1391
1391
  * limitations under the License.
1392
- */const Wi="webStorageSupport";class aS{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=jf,this._completeRedirectFn=PI,this._overrideRedirectResult=AI}async _openPopup(t,n,r,s){var i;sr((i=this.eventManagers[t._key()])==null?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await lu(t,n,r,Ia(),s);return tS(t,o,dl())}async _openRedirect(t,n,r,s){await this._originValidation(t);const o=await lu(t,n,r,Ia(),s);return uI(o),new Promise(()=>{})}_initialize(t){const n=t._key();if(this.eventManagers[n]){const{manager:s,promise:o}=this.eventManagers[n];return s?Promise.resolve(s):(sr(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(t);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(t){const n=await JI(t),r=new OI(t);return n.register("authEvent",s=>(Fe(s==null?void 0:s.authEvent,t,"invalid-auth-event"),{status:r.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:r},this.iframes[t._key()]=n,r}_isIframeWebStorageSupported(t,n){this.iframes[t._key()].send(Wi,{type:Wi},s=>{var i;const o=(i=s==null?void 0:s[0])==null?void 0:i[Wi];o!==void 0&&n(!!o),$n(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=jI(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return xf()||If()||ll()}}const lS=aS;var cu="@firebase/auth",uu="1.12.1";/**
1392
+ */const Vi="webStorageSupport";class aS{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Lf,this._completeRedirectFn=xI,this._overrideRedirectResult=AI}async _openPopup(t,n,r,s){var i;rr((i=this.eventManagers[t._key()])==null?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await au(t,n,r,Ta(),s);return tS(t,o,ul())}async _openRedirect(t,n,r,s){await this._originValidation(t);const o=await au(t,n,r,Ta(),s);return uI(o),new Promise(()=>{})}_initialize(t){const n=t._key();if(this.eventManagers[n]){const{manager:s,promise:o}=this.eventManagers[n];return s?Promise.resolve(s):(rr(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(t);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(t){const n=await JI(t),r=new OI(t);return n.register("authEvent",s=>(Fe(s==null?void 0:s.authEvent,t,"invalid-auth-event"),{status:r.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:r},this.iframes[t._key()]=n,r}_isIframeWebStorageSupported(t,n){this.iframes[t._key()].send(Vi,{type:Vi},s=>{var i;const o=(i=s==null?void 0:s[0])==null?void 0:i[Vi];o!==void 0&&n(!!o),$n(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=jI(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return Rf()||Tf()||al()}}const lS=aS;var lu="@firebase/auth",cu="1.12.1";/**
1393
1393
  * @license
1394
1394
  * Copyright 2020 Google LLC
1395
1395
  *
@@ -1419,7 +1419,7 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1419
1419
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1420
1420
  * See the License for the specific language governing permissions and
1421
1421
  * limitations under the License.
1422
- */function uS(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function dS(e){eo(new vs("auth",(t,{options:n})=>{const r=t.getProvider("app").getImmediate(),s=t.getProvider("heartbeat"),o=t.getProvider("app-check-internal"),{apiKey:i,authDomain:a}=r.options;Fe(i&&!i.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:i,authDomain:a,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Pf(e)},u=new V1(r,s,o,l);return J1(u,n),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),eo(new vs("auth-internal",t=>{const n=fi(t.getProvider("auth").getImmediate());return(r=>new cS(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),cs(cu,uu,uS(e)),cs(cu,uu,"esm2020")}/**
1422
+ */function uS(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function dS(e){eo(new gs("auth",(t,{options:n})=>{const r=t.getProvider("app").getImmediate(),s=t.getProvider("heartbeat"),o=t.getProvider("app-check-internal"),{apiKey:i,authDomain:a}=r.options;Fe(i&&!i.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:i,authDomain:a,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Pf(e)},u=new V1(r,s,o,l);return J1(u,n),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),eo(new gs("auth-internal",t=>{const n=fi(t.getProvider("auth").getImmediate());return(r=>new cS(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),ls(lu,cu,uS(e)),ls(lu,cu,"esm2020")}/**
1423
1423
  * @license
1424
1424
  * Copyright 2021 Google LLC
1425
1425
  *
@@ -1434,11 +1434,11 @@ ${U}`:U}}),h=L(null),b=L(null),N=L(null),I=L(null),O=L(!1),Y=L(!1),$=L(null),z=L
1434
1434
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1435
1435
  * See the License for the specific language governing permissions and
1436
1436
  * limitations under the License.
1437
- */const fS=300,hS=af("authIdTokenMaxAge")||fS;let du=null;const pS=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>hS)return;const s=n==null?void 0:n.token;du!==s&&(du=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function mS(e=hf()){const t=df(e,"auth");if(t.isInitialized())return t.getImmediate();const n=K1(e,{popupRedirectResolver:lS,persistence:[wI,aI,jf]}),r=af("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=pS(o.toString());sI(n,i,()=>i(n.currentUser)),rI(n,a=>i(a))}}const s=F0("auth");return s&&Y1(n,`http://${s}`),n}function gS(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}W1({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=gn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",gS().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});dS("Browser");const vS={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};function yS(e){const t=L(null),n=L(""),r=L(""),s=L(""),o=L({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),i=pe(()=>s.value==="pull"),a=pe(()=>s.value==="push"),l=pe(()=>s.value!=="");async function u(){try{const I=await fetch("/codex-api/skills-sync/status");if(!I.ok)return;const O=await I.json();O.data&&(o.value=O.data)}catch{}}async function c(){try{const I=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),O=await I.json();if(!I.ok||!O.data)throw new Error("Failed to start GitHub login");t.value=O.data;const Y=30,$=Math.max((O.data.interval??5)*1e3,3e3);let z=!1;for(let j=0;j<Y;j++){await new Promise(ve=>setTimeout(ve,$));const oe=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:O.data.device_code})}),de=await oe.json();if(!oe.ok)throw new Error(de.error||"Failed to complete GitHub login");if(de.ok){z=!0;break}if(!de.pending)throw new Error(de.error||"Failed to complete GitHub login")}if(!z)throw new Error("GitHub login timed out. Please retry.");t.value=null,await u(),e.showToast("GitHub login successful")}catch(I){e.showToast(I instanceof Error?I.message:"Failed GitHub login","error")}}async function f(){try{const I=o1().length>0?hf():ff(vS),O=mS(I),Y=new Pn;Y.addScope("repo");const $=await II(O,Y),z=Pn.credentialFromResult($),j=(z==null?void 0:z.accessToken)??"";if(!j)throw new Error("GitHub access token missing from Firebase login");const oe=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:j})}),de=await oe.json();if(!oe.ok||!de.ok)throw new Error(de.error||"Failed to login with GitHub token");await u(),e.showToast("GitHub login successful")}catch(I){const O=I instanceof Error?I.message:"Failed Firebase GitHub login";e.showToast(O,"error")}}async function h(){r.value="",n.value="pull-started",s.value="pull";try{const I=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),O=await I.json();if(!I.ok||!O.ok)throw new Error(O.error||"Failed to pull synced skills");await e.onPulled(),n.value="pull-success",e.showToast(o.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(I){const O=I instanceof Error?I.message:"Failed to pull sync";r.value=O,n.value="pull-failed",e.showToast(O,"error")}finally{s.value=""}}async function b(){r.value="",n.value="push-started",s.value="push";try{const I=await fetch("/codex-api/skills-sync/push",{method:"POST"}),O=await I.json();if(!I.ok||!O.ok)throw new Error(O.error||"Failed to push synced skills");n.value="push-success",e.showToast("Pushed skills to private sync repo")}catch(I){const O=I instanceof Error?I.message:"Failed to push sync";r.value=O,n.value="push-failed",e.showToast(O,"error")}finally{s.value=""}}async function N(){try{const I=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),O=await I.json();if(!I.ok||!O.ok)throw new Error(O.error||"Failed to logout GitHub");await u(),e.showToast("Logged out from GitHub")}catch(I){e.showToast(I instanceof Error?I.message:"Failed to logout GitHub","error")}}return{deviceLogin:t,isPullInFlight:i,isPushInFlight:a,isSyncActionInFlight:l,loadSyncStatus:u,logoutGithub:N,pullSkillsSync:h,pushSkillsSync:b,startGithubFirebaseLogin:f,startGithubLogin:c,syncActionError:r,syncActionStatus:n,syncStatus:o}}const wS={class:"skills-hub"},bS={class:"skills-sync-panel"},_S={class:"skills-sync-header"},kS={key:0,class:"skills-sync-badge"},TS={key:1,class:"skills-sync-badge"},IS={key:2,class:"skills-sync-badge"},SS={class:"skills-sync-meta"},ES={key:0,class:"skills-sync-error"},CS={key:1,class:"skills-sync-meta"},AS={key:2,class:"skills-sync-error"},RS={key:3,class:"skills-sync-device"},xS=["href"],PS={class:"skills-sync-actions"},MS=["disabled"],OS=["disabled"],NS=["disabled"],$S={key:1,class:"skills-hub-section"},DS={class:"skills-hub-section-title"},LS={key:0,class:"skills-hub-grid"},jS={class:"skills-hub-toolbar"},BS={class:"skills-hub-search-wrap"},US={key:0,class:"skills-hub-count"},FS={class:"skills-hub-section"},HS={key:0,class:"skills-hub-loading"},VS={key:1,class:"skills-hub-error"},WS={key:0,class:"skills-hub-grid"},zS={key:1,class:"skills-hub-empty"},wo="codex-web-local.skills-hub.cache.v1",qS=Lt({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=L(null),s=L(""),o=L("date"),i=L([]),a=L([]),l=L(0),u=L(!1),c=L(""),f=L(!0),h=L(!1),b=L(n),N=L(null),I=L(""),O=L(!1),Y=L(!1);let $=null,z=null;const j=t,oe=pe(()=>o.value==="date"?"Newest":"A-Z"),de=pe(()=>{var x;return((x=N.value)==null?void 0:x.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),ve=pe(()=>`${b.value.owner}/${b.value.name}`),Ie=pe(()=>O.value&&I.value===ve.value),re=pe(()=>Y.value&&I.value===ve.value),ee=pe(()=>{const x=s.value.toLowerCase().trim();return x?a.value.filter(D=>D.name.toLowerCase().includes(x)||D.owner.toLowerCase().includes(x)||(D.displayName??"").toLowerCase().includes(x)):a.value});function ye(x,D="success"){N.value={text:x,type:D},z&&clearTimeout(z),z=setTimeout(()=>{N.value=null},3e3)}function te(){o.value=o.value==="date"?"name":"date",$e(s.value)}function je(x){return`${o.value}::${x.trim().toLowerCase()}`}function Be(x){var D;if(typeof window>"u")return null;try{const B=window.localStorage.getItem(wo);return B?((D=JSON.parse(B).byKey)==null?void 0:D[x])??null:null}catch{return null}}function Qe(x,D){if(!(typeof window>"u"))try{const B=window.localStorage.getItem(wo),V=(B?JSON.parse(B):{}).byKey??{};V[x]=D,window.localStorage.setItem(wo,JSON.stringify({byKey:V}))}catch{}}function Re(){if(!(typeof window>"u"))try{window.localStorage.removeItem(wo)}catch{}}function Te(x){const D=x.installed??[];a.value=D;const B=new Set(D.map(G=>G.name));i.value=x.data.map(G=>{if(G.installed||B.has(G.name)){const V=D.find(be=>be.name===G.name);return{...G,installed:!0,path:(V==null?void 0:V.path)??G.path,enabled:(V==null?void 0:V.enabled)??G.enabled}}return G}).filter(G=>!G.installed),l.value=x.total}async function $e(x){const D=je(x),B=Be(D);B&&Te(B),u.value=!B,c.value="";try{const G=new URLSearchParams;x.trim()&&G.set("q",x.trim()),G.set("limit","100"),G.set("sort",o.value);const V=await fetch(`/codex-api/skills-hub?${G}`);if(!V.ok)throw new Error(`HTTP ${V.status}`);const be=await V.json();Te(be),Qe(D,be)}catch(G){c.value=G instanceof Error?G.message:"Failed to load skills"}finally{u.value=!1}}function It(){$&&clearTimeout($),$=setTimeout(()=>$e(s.value),300)}function nt(x){b.value=x,h.value=!0}async function Xe(x){I.value=`${x.owner}/${x.name}`,O.value=!0;try{const B=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:x.owner,name:x.name})})).json();if(!B.ok)throw new Error(B.error||"Install failed");const G={...x,installed:!0,path:B.path,enabled:!0};a.value=[...a.value,G],i.value=i.value.filter(V=>V.name!==x.name),b.value=G,ye(`${x.displayName||x.name} skill installed`),h.value=!1,Re(),j("skills-changed")}catch(D){ye(D instanceof Error?D.message:"Failed to install skill","error")}finally{O.value=!1}}async function Ze(x){I.value=`${x.owner}/${x.name}`,Y.value=!0;try{const B=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:x.name,path:x.path})})).json();if(!B.ok)throw new Error(B.error||"Uninstall failed");a.value=a.value.filter(G=>G.name!==x.name),x.owner!=="local"&&(i.value=[...i.value,{...x,installed:!1,path:void 0,enabled:void 0}]),ye(`${x.displayName||x.name} skill uninstalled`),h.value=!1,Re(),j("skills-changed")}catch(D){ye(D instanceof Error?D.message:"Failed to uninstall skill","error")}finally{Y.value=!1}}async function ht(x,D){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:x.path,enabled:D}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),ye(`${x.displayName||x.name} skill ${D?"enabled":"disabled"}`),await $e(s.value)}catch(B){ye(B instanceof Error?B.message:"Failed to update skill","error")}}const{deviceLogin:Rt,isPullInFlight:Ge,isPushInFlight:et,isSyncActionInFlight:W,loadSyncStatus:me,logoutGithub:ie,pullSkillsSync:fe,pushSkillsSync:De,startGithubFirebaseLogin:g,startGithubLogin:v,syncActionError:A,syncActionStatus:H,syncStatus:F}=yS({showToast:ye,onPulled:async()=>{await $e(s.value),j("skills-changed")}});return ir(()=>{$e(""),me()}),(x,D)=>(w(),T("div",wS,[D[11]||(D[11]=m("div",{class:"skills-hub-header"},[m("h2",{class:"skills-hub-title"},"Skills Hub"),m("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),m("div",bS,[m("div",_S,[D[8]||(D[8]=m("strong",null,"Skills Sync (GitHub)",-1)),ue(F).configured?(w(),T("span",kS,"Connected: "+ce(ue(F).repoOwner)+"/"+ce(ue(F).repoName),1)):ue(F).loggedIn?(w(),T("span",TS,"Logged in as "+ce(ue(F).githubUsername),1)):(w(),T("span",IS,"Not connected"))]),m("div",SS,[m("span",null,"Startup: "+ce(ue(F).startup.mode),1),m("span",null,"Branch: "+ce(ue(F).startup.branch),1),m("span",null,"Action: "+ce(ue(F).startup.lastAction),1)]),ue(F).startup.lastError?(w(),T("div",ES,ce(ue(F).startup.lastError),1)):se("",!0),ue(H)?(w(),T("div",CS,[m("span",null,"Manual sync: "+ce(ue(H)),1)])):se("",!0),ue(A)?(w(),T("div",AS,ce(ue(A)),1)):se("",!0),ue(Rt)?(w(),T("div",RS,[m("span",null,[D[9]||(D[9]=ca("Open ",-1)),m("a",{href:ue(Rt).verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,xS),D[10]||(D[10]=ca(" and enter code:",-1))]),m("code",null,ce(ue(Rt).user_code),1)])):se("",!0),m("div",PS,[ue(F).loggedIn?se("",!0):(w(),T("button",{key:0,class:"skills-hub-sort",type:"button",onClick:D[0]||(D[0]=(...B)=>ue(g)&&ue(g)(...B))},"Login with GitHub")),ue(F).loggedIn?se("",!0):(w(),T("button",{key:1,class:"skills-hub-sort",type:"button",onClick:D[1]||(D[1]=(...B)=>ue(v)&&ue(v)(...B))},"Device Login")),ue(F).loggedIn?(w(),T("button",{key:2,class:"skills-hub-sort",type:"button",onClick:D[2]||(D[2]=(...B)=>ue(ie)&&ue(ie)(...B)),disabled:ue(W)},"Logout GitHub",8,MS)):se("",!0),m("button",{class:"skills-hub-sort",type:"button",onClick:D[3]||(D[3]=(...B)=>ue(fe)&&ue(fe)(...B)),disabled:ue(W)},ce(ue(Ge)?"Pulling...":"Pull"),9,OS),ue(F).loggedIn?(w(),T("button",{key:3,class:"skills-hub-sort",type:"button",onClick:D[4]||(D[4]=(...B)=>ue(De)&&ue(De)(...B)),disabled:!ue(F).configured||ue(W)},ce(ue(et)?"Pushing...":"Push"),9,NS)):se("",!0)])]),N.value?(w(),T("div",{key:0,class:gt(["skills-hub-toast",de.value])},ce(N.value.text),3)):se("",!0),ee.value.length>0?(w(),T("div",$S,[m("button",{class:"skills-hub-section-toggle",type:"button",onClick:D[5]||(D[5]=B=>f.value=!f.value)},[m("span",DS,"Installed ("+ce(ee.value.length)+")",1),Ce(Yd,{class:gt(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),T("div",LS,[(w(!0),T(He,null,Et(ee.value,B=>(w(),yt(Lc,{key:B.name,skill:B,onSelect:G=>nt(G)},null,8,["skill","onSelect"]))),128))])):se("",!0)])):se("",!0),m("div",jS,[m("div",BS,[Ce(ya,{class:"skills-hub-search-icon"}),tr(m("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":D[6]||(D[6]=B=>s.value=B),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:It},null,544),[[nr,s.value]]),l.value>0?(w(),T("span",US,ce(l.value)+" skills",1)):se("",!0)]),m("button",{class:"skills-hub-sort",type:"button",onClick:te},ce(oe.value),1)]),m("div",FS,[u.value?(w(),T("div",HS,"Loading skills...")):c.value?(w(),T("div",VS,ce(c.value),1)):(w(),T(He,{key:2},[i.value.length>0?(w(),T("div",WS,[(w(!0),T(He,null,Et(i.value,B=>(w(),yt(Lc,{key:B.url,skill:B,onSelect:G=>nt(G)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),T("div",zS,'No skills found for "'+ce(s.value)+'"',1)):se("",!0)],64))]),Ce(M0,{skill:b.value,visible:h.value,"is-installing":Ie.value,"is-uninstalling":re.value,onClose:D[7]||(D[7]=B=>h.value=!1),onInstall:Xe,onUninstall:Ze,onToggleEnabled:ht},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),GS=st(qS,[["__scopeId","data-v-2f6920be"]]),KS={},JS={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 YS(e,t){return w(),T("svg",JS,[...t[0]||(t[0]=[m("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),m("path",{d:"M9 4l0 16"},null,-1)])])}const QS=st(KS,[["render",YS]]),XS={},ZS={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function eE(e,t){return w(),T("svg",ZS,[...t[0]||(t[0]=[m("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 tE=st(XS,[["render",eE]]),nE={class:"sidebar-thread-controls"},rE=["aria-label","title"],sE=Lt({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(w(),T("div",nE,[m("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(w(),yt(tE,{key:0,class:"sidebar-thread-controls-icon"})):(w(),yt(QS,{key:1,class:"sidebar-thread-controls-icon"}))],8,rE),Mn(t.$slots,"default",{},void 0),e.showNewThreadButton?(w(),T("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[1]||(n[1]=r=>t.$emit("start-new-thread"))},[Ce(Fo,{class:"sidebar-thread-controls-icon"})])):se("",!0)]))}}),fu=st(sE,[["__scopeId","data-v-46a10052"]]),oE={},iE={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function aE(e,t){return w(),T("svg",iE,[...t[0]||(t[0]=[m("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[m("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),m("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const lE=st(oE,[["render",aE]]);function gr(e){return e.flatMap(t=>t.threads)}const qf="codex-web-local.thread-read-state.v1",Gf="codex-web-local.thread-scroll-state.v1",Ca="codex-web-local.selected-thread-id.v1",Kf="codex-web-local.project-order.v1",Jf="codex-web-local.project-display-name.v1",zi=220,hu=["none","minimal","low","medium","high","xhigh"],Ms="__global__",un="gpt-5.2-codex";function cE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(qf);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function pu(e){typeof window>"u"||window.localStorage.setItem(qf,JSON.stringify(e))}function Yf(e,t,n){return Math.min(Math.max(e,t),n)}function uE(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=Yf(t.scrollRatio,0,1)),n}function dE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Gf);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=uE(s);o&&(n[r]=o)}return n}catch{return{}}}function mu(e){typeof window>"u"||window.localStorage.setItem(Gf,JSON.stringify(e))}function fE(){return typeof window>"u"?"":window.localStorage.getItem(Ca)??""}function hE(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Ca);return}window.localStorage.setItem(Ca,e)}}function pE(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Kf);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 es(e){typeof window>"u"||window.localStorage.setItem(Kf,JSON.stringify(e))}function mE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Jf);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 qi(e){typeof window>"u"||window.localStorage.setItem(Jf,JSON.stringify(e))}function bo(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 Br(e,n)?e:n}function Gi(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 Br(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 gE(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 vE(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function _o(e){if(!(e instanceof Error))return!1;const t=e.message.toLowerCase();return t.includes("not supported when using codex with a chatgpt account")||t.includes("model is not supported")}function Aa(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Br(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&vE(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Ko(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 yE(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&&Aa(f,c)?f:c});if(n.preserveMissing!==!0)return Ko(e,o)?e:o;const i=e.map(c=>{const f=s.get(c.id);return!f||Aa(c,f)?c:f}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),u=[...i,...l];return Ko(e,u)?e:u}function Ra(e){return e.replace(/\s+/gu," ").trim()}function wE(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Ra(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=Ra(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function gu(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Aa(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const Qf="worked";function hr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function bE(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 _E(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function kE(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 TE(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${bE(e.durationMs)}`,messageType:Qf}}function IE(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function SE(e,t){const n=TE(t),r=e.filter(i=>i.messageType!==Qf),s=IE(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Bt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function EE(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 CE(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 AE(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 Ft(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function ko(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 u=i.get(l.id);return u&&EE(u,l)?u:l});return o&&o.projectName===s.projectName&&CE(o.threads,a)?o:{projectName:s.projectName,threads:a}});return AE(e,r)?e:r}function RE(e,t,n){const r=new Set(gr(t).map(a=>a.id)),s=gr(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 u=i.findIndex(c=>c.projectName===a.projectName);u>=0&&(i[u]={projectName:i[u].projectName,threads:[a,...i[u].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function xE(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Ki(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function PE(e){const t=e.split(`
1438
- `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function ME(){const e=L([]),t=L([]),n=L(fE()),r=L({}),s=L({}),o=L({}),i=L({}),a=L({}),l=L({}),u=L({}),c=L([]),f=L(""),h=L("medium"),b=L(cE()),N=L(dE()),I=L(pE()),O=L(mE()),Y=L({}),$=L({}),z=L({}),j=L({}),oe=L({}),de=L({}),ve=L({}),Ie=L({}),re=L({}),ee=L({}),ye=L([]),te=L(!1),je=L(!1),Be=L(!1),Qe=L(!1),Re=L(!1),Te=L(""),$e=L(!1),It=L(!1);let nt=null,Xe=null,Ze=!1;const ht=new Set;let Rt=!1,Ge=!1;const et=new Map,W=new Set,me=pe(()=>gr(e.value)),ie=pe(()=>me.value.find(d=>d.id===n.value)??null),fe=pe(()=>N.value[n.value]??null),De=pe(()=>{const d=[],p=n.value;return p&&Array.isArray(Ie.value[p])&&d.push(...Ie.value[p]),Array.isArray(Ie.value[Ms])&&d.push(...Ie.value[Ms]),d.sort((y,C)=>y.receivedAtIso.localeCompare(C.receivedAtIso))}),g=pe(()=>{var X;const d=n.value;if(!d)return null;const p=oe.value[d],y=(o.value[d]??"").trim(),C=(((X=de.value[d])==null?void 0:X.message)??"").trim();return!p&&!y&&!C?null:{activityLabel:(p==null?void 0:p.label)||"Thinking",activityDetails:(p==null?void 0:p.details)??[],reasoningText:y,errorText:C}}),v=pe(()=>{const d=n.value;if(!d)return[];const p=r.value[d]??[],y=s.value[d]??[],C=i.value[d]??[],X=[...p,...C,...y],Q=j.value[d];return Q?SE(X,Q):X});function A(d){n.value!==d&&(n.value=d,hE(d),Ge=!1)}function H(d){f.value=d.trim()}async function F(){f.value=un,c.value.includes(un)||(c.value=[...c.value,un]);try{await t_(un)}catch{}}function x(d,p){re.value={...re.value,[d]:p}}function D(d){re.value[d]&&(re.value=Bt(re.value,d))}async function B(d){if(W.has(d))return;const p=re.value[d];if(!(!p||p.fallbackRetried)){W.add(d),x(d,{...p,fallbackRetried:!0});try{await F();try{const y=await Oc(d,1);it(d,y),kt(d,[]),rn(d),i.value[d]&&(i.value=Bt(i.value,d))}catch{}K(d,null),Te.value="",Pe(d,null),U(d,{label:"Thinking",details:V(un,p.effort)}),Ve(d,!0),z.value[d]!==!0&&await $i(d),await Di(d,p.text,p.imageUrls,un,p.effort||void 0,p.skills.length>0?p.skills:void 0,p.fileAttachments),z.value={...z.value,[d]:!0},ht.add(d),Ze=!0,await rt()}catch(y){const C=y instanceof Error?y.message:"Unknown application error";K(d,C),Te.value=C,Ve(d,!1),U(d,null)}finally{W.delete(d)}}}function G(d){d&&!hu.includes(d)||(h.value=d)}function V(d,p){const y=d.trim()||"default",C=p||"default";return[`Model: ${y}`,`Thinking: ${C}`]}async function be(){try{const[d,p]=await Promise.all([n_(),r_()]);c.value=d,f.value.length>0&&d.includes(f.value)||(p.model&&d.includes(p.model)?f.value=p.model:d.length>0?f.value=d[0]:f.value=""),p.reasoningEffort&&hu.includes(p.reasoningEffort)&&(h.value=p.reasoningEffort)}catch{}}function ae(d){const p=ee.value;return Object.keys(p).length===0?d:d.map(y=>({projectName:y.projectName,threads:y.threads.map(C=>{const X=p[C.id];return X?{...C,title:X}:C})}))}function he(){const p=ae(t.value).map(y=>({projectName:y.projectName,threads:y.threads.map(C=>{const X=a.value[C.id]===!0,Q=n.value===C.id,_e=b.value[C.id],xe=u.value[C.id]===!0,we=!Q&&!X&&(xe||_e!==C.updatedAtIso);return{...C,inProgress:X,unread:we}})}));e.value=ko(e.value,p)}function Se(d,p,y){const C=new Date().toISOString(),X=p.trim(),Q=xE(X),_e={id:d,title:PE(y),projectName:Q,cwd:X,hasWorktree:X.includes("/.codex/worktrees/")||X.includes("/.git/worktrees/"),createdAtIso:C,updatedAtIso:C,preview:y,unread:!1,inProgress:!1},xe=t.value.findIndex(ot=>ot.projectName===Q);if(xe>=0){const St=t.value[xe].threads.filter(cr=>cr.id!==d),Xr={projectName:Q,threads:[_e,...St]},Fn=[...t.value];Fn.splice(xe,1,Xr),t.value=Fn}else t.value=[{projectName:Q,threads:[_e]},...t.value];const we=bo(I.value,t.value);Br(I.value,we)||(I.value=we,es(I.value)),he()}function Me(d){const p=new Set(d.map(Q=>Q.id)),y=Ft(b.value,p);y!==b.value&&(b.value=y,pu(y));const C=Ft(N.value,p);C!==N.value&&(N.value=C,mu(C)),$.value=Ft($.value,p),Y.value=Ft(Y.value,p),z.value=Ft(z.value,p),r.value=Ft(r.value,p),s.value=Ft(s.value,p),o.value=Ft(o.value,p),i.value=Ft(i.value,p),j.value=Ft(j.value,p),oe.value=Ft(oe.value,p),de.value=Ft(de.value,p),ve.value=Ft(ve.value,p),u.value=Ft(u.value,p),a.value=Ft(a.value,p);const X={};for(const[Q,_e]of Object.entries(Ie.value))(Q===Ms||p.has(Q))&&(X[Q]=_e);Ie.value=X}function Ke(d){const p=gr(t.value).find(y=>y.id===d);p&&(b.value={...b.value,[d]:p.updatedAtIso},pu(b.value),u.value[d]&&(u.value=Bt(u.value,d)),he())}function Pe(d,p){if(!d)return;const y=j.value[d];if(p){if(_E(y,p))return;j.value={...j.value,[d]:p}}else y&&(j.value=Bt(j.value,d))}function Ve(d,p){!d||a.value[d]===!0===p||(p?a.value={...a.value,[d]:!0}:a.value=Bt(a.value,d),he())}function _t(d){d&&d!==n.value&&u.value[d]!==!0&&(u.value={...u.value,[d]:!0},he())}function U(d,p){if(!d)return;const y=oe.value[d];if(!p){y&&(oe.value=Bt(oe.value,d));return}const C=q(p.label)||"Thinking",X=p.details.map(xe=>q(xe)).filter(xe=>xe.length>0&&xe!==C),Q=Array.from(new Set([...(y==null?void 0:y.details)??[],...X])).slice(-3),_e={label:C,details:Q};kE(y,_e)||(oe.value={...oe.value,[d]:_e})}function K(d,p){if(!d)return;const y=de.value[d],C=p?Ra(p):"";if(!C){y&&(de.value=Bt(de.value,d));return}(y==null?void 0:y.message)!==C&&(de.value={...de.value,[d]:{message:C}})}function ne(d){const p=gr(t.value).find(y=>y.id===d);return(p==null?void 0:p.updatedAtIso)??""}function Je(d,p){if(!d)return;const y={scrollTop:Math.max(0,p.scrollTop),isAtBottom:p.isAtBottom===!0};typeof p.scrollRatio=="number"&&Number.isFinite(p.scrollRatio)&&(y.scrollRatio=Yf(p.scrollRatio,0,1));const C=N.value[d];C&&C.scrollTop===y.scrollTop&&C.isAtBottom===y.isAtBottom&&C.scrollRatio===y.scrollRatio||(N.value={...N.value,[d]:y},mu(N.value))}function it(d,p){const y=r.value[d]??[];Ko(y,p)||(r.value={...r.value,[d]:p})}function kt(d,p){const y=s.value[d]??[];Ko(y,p)||(s.value={...s.value,[d]:p})}function xt(d,p){const y=s.value[d]??[],C=gu(y,p);kt(d,C)}function ln(d,p){if(!d)return;const y=p.trim(),C=o.value[d]??"";if(y.length===0){if(!C)return;o.value=Bt(o.value,d);return}C!==y&&(o.value={...o.value,[d]:y})}function Sr(d,p){if(!d)return;const y=o.value[d]??"";ln(d,`${y}${p}`)}function rn(d){d&&d in o.value&&(o.value=Bt(o.value,d))}function Ne(d){return d!==null&&typeof d=="object"&&!Array.isArray(d)?d:null}function Oe(d){return typeof d=="string"?d:""}function fn(d){return typeof d=="number"&&Number.isFinite(d)?d:null}function jt(d){const p=Ne(d.params);if(!p)return"";const y=Oe(p.threadId);if(y)return y;const C=Oe(p.thread_id);if(C)return C;const X=Oe(p.conversationId);if(X)return X;const Q=Oe(p.conversation_id);if(Q)return Q;const _e=Ne(p.thread),xe=Oe(_e==null?void 0:_e.id);if(xe)return xe;const we=Ne(p.turn),ot=Oe(we==null?void 0:we.threadId);if(ot)return ot;const St=Oe(we==null?void 0:we.thread_id);return St||""}function Er(d){if(d.method!=="turn/completed")return"";const p=Ne(d.params),y=Ne(p==null?void 0:p.turn);if(!y||y.status!=="failed")return"";const C=Ne(y.error);return Oe(C==null?void 0:C.message)}function _n(d){var y;if(d.method!=="error")return"";const p=Ne(d.params);return Oe(p==null?void 0:p.message)||Oe((y=Ne(p==null?void 0:p.error))==null?void 0:y.message)}function kn(d){const p=Ne(d);if(!p)return null;const y=p.id,C=Oe(p.method),X=p.params;if(typeof y!="number"||!Number.isInteger(y)||!C)return null;const Q=Ne(X),_e=Oe(Q==null?void 0:Q.threadId)||Ms,xe=Oe(Q==null?void 0:Q.turnId),we=Oe(Q==null?void 0:Q.itemId),ot=Oe(p.receivedAtIso)||new Date().toISOString();return{id:y,method:C,threadId:_e,turnId:xe,itemId:we,receivedAtIso:ot,params:X??null}}function _(d){const p=d.threadId||Ms,y=Ie.value[p]??[],C=y.findIndex(Q=>Q.id===d.id),X=[...y];C>=0?X.splice(C,1,d):X.push(d),Ie.value={...Ie.value,[p]:X.sort((Q,_e)=>Q.receivedAtIso.localeCompare(_e.receivedAtIso))}}function S(d){const p={};for(const[y,C]of Object.entries(Ie.value)){const X=C.filter(Q=>Q.id!==d);X.length>0&&(p[y]=X)}Ie.value=p}function E(d){if(d.method==="server/request"){const p=kn(d.params);return p&&_(p),!0}if(d.method==="server/request/resolved"){const p=Ne(d.params),y=p==null?void 0:p.id;return typeof y=="number"&&Number.isInteger(y)&&S(y),!0}return!1}function q(d){return d.replace(/\s+/gu," ").trim()}function ge(d){const p=jt(d);if(!p)return null;if(d.method==="turn/started")return{threadId:p,activity:{label:"Thinking",details:[]}};if(d.method==="item/started"){const y=Ne(d.params),C=Ne(y==null?void 0:y.item),X=Oe(C==null?void 0:C.type).toLowerCase();if(X==="reasoning")return{threadId:p,activity:{label:"Thinking",details:[]}};if(X==="agentmessage")return{threadId:p,activity:{label:"Writing response",details:[]}};if(X==="commandexecution"){const Q=Oe(C==null?void 0:C.command);return{threadId:p,activity:{label:"Running command",details:Q?[Q]:[]}}}}return d.method==="item/commandExecution/outputDelta"?{threadId:p,activity:{label:"Running command",details:[]}}:d.method==="item/reasoning/summaryTextDelta"||d.method==="item/reasoning/summaryPartAdded"?{threadId:p,activity:{label:"Thinking",details:[]}}:d.method==="item/agentMessage/delta"?{threadId:p,activity:{label:"Writing response",details:[]}}:null}function le(d){if(d.method!=="turn/started")return null;const p=Ne(d.params);if(!p)return null;const y=jt(d);if(!y)return null;const C=Ne(p.turn),X=Oe(C==null?void 0:C.id)||Oe(p.turnId)||`${y}:unknown`;if(!X)return null;const Q=hr(Oe(C==null?void 0:C.startedAt))??hr(Oe(p.startedAt))??hr(d.atIso)??Date.now();return{threadId:y,turnId:X,startedAtMs:Q}}function Ae(d){if(d.method!=="turn/completed")return null;const p=Ne(d.params);if(!p)return null;const y=jt(d);if(!y)return null;const C=Ne(p.turn),X=Oe(C==null?void 0:C.id)||Oe(p.turnId)||`${y}:unknown`;if(!X)return null;const Q=hr(Oe(C==null?void 0:C.completedAt))??hr(Oe(p.completedAt))??hr(d.atIso)??Date.now(),_e=hr(Oe(C==null?void 0:C.startedAt))??hr(Oe(p.startedAt))??void 0;return{threadId:y,turnId:X,completedAtMs:Q,startedAtMs:_e}}function ke(d){return`${d}:live-reasoning`}function We(d){const p=Ne(d.params);if(!p)return"";if(d.method==="item/started"){const y=Ne(p.item);return!y||y.type!=="reasoning"?"":Oe(y.id)}return""}function at(d){const p=Ne(d.params);if(!p)return null;if(d.method==="item/reasoning/summaryTextDelta"){const y=Oe(p.itemId),C=Oe(p.delta);return!y||!C?null:{messageId:ke(y),delta:C}}return null}function lt(d){const p=Ne(d.params);if(!p)return"";if(d.method==="item/reasoning/summaryPartAdded"){const y=Oe(p.itemId);return y?ke(y):""}return""}function Pt(d){const p=Ne(d.params);if(!p)return"";if(d.method==="item/completed"){const y=Ne(p.item);return!y||y.type!=="reasoning"?"":ke(Oe(y.id))}return""}function Mt(d){const p=Ne(d.params);if(!p)return"";if(d.method==="item/started"){const y=Ne(p.item);return!y||y.type!=="agentMessage"?"":Oe(y.id)}return""}function sn(d){const p=Ne(d.params);if(!p)return null;if(d.method==="item/agentMessage/delta"){const y=Oe(p.itemId),C=Oe(p.delta);return!y||!C?null:{messageId:y,delta:C}}return null}function Dn(d){const p=Ne(d.params);if(!p)return null;if(d.method==="item/completed"){const y=Ne(p.item);if(!y||y.type!=="agentMessage")return null;const C=Oe(y.id),X=Oe(y.text);return!C||!X?null:{id:C,role:"assistant",text:X,messageType:"agentMessage.live"}}return null}function ks(d){if(d.method!=="item/started")return null;const p=Ne(d.params),y=Ne(p==null?void 0:p.item);if(!y||y.type!=="commandExecution")return null;const C=Oe(y.id),X=Oe(y.command);if(!C)return null;const Q=typeof y.cwd=="string"?y.cwd:null;return{id:C,role:"system",text:X,messageType:"commandExecution",commandExecution:{command:X,cwd:Q,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function Cr(d){if(d.method!=="item/commandExecution/outputDelta")return null;const p=Ne(d.params);if(!p)return null;const y=Oe(p.itemId),C=Oe(p.delta);return!y||!C?null:{itemId:y,delta:C}}function Gr(d){if(d.method!=="item/completed")return null;const p=Ne(d.params),y=Ne(p==null?void 0:p.item);if(!y||y.type!=="commandExecution")return null;const C=Oe(y.id),X=Oe(y.command);if(!C)return null;const Q=typeof y.cwd=="string"?y.cwd:null,_e=Oe(y.status),xe=_e==="failed"?"failed":_e==="declined"?"declined":_e==="interrupted"?"interrupted":"completed",we=typeof y.aggregatedOutput=="string"?y.aggregatedOutput:"",ot=typeof y.exitCode=="number"?y.exitCode:null;return{id:C,role:"system",text:X,messageType:"commandExecution",commandExecution:{command:X,cwd:Q,status:xe,aggregatedOutput:we,exitCode:ot}}}function Ln(d,p){const y=i.value[d]??[],C=gu(y,p);C!==y&&(i.value={...i.value,[d]:C})}function Kr(d,p){const y=i.value[d];if(!y||y.length===0)return;const C=new Set(p.map(Q=>Q.id)),X=y.filter(Q=>!C.has(Q.id));X.length!==y.length&&(X.length===0?i.value=Bt(i.value,d):i.value={...i.value,[d]:X})}function Jr(d){if(d.method==="item/agentMessage/delta")return!0;const p=Ne(d.params);if(!p)return!1;if(d.method==="item/completed"){const y=Ne(p.item);return(y==null?void 0:y.type)==="agentMessage"}return!1}function jn(d){var ml,gl,vl,yl;if(E(d))return;if(d.method==="thread/name/updated"){const qe=Ne(d.params),Tn=Oe(qe==null?void 0:qe.threadId),xr=Oe(qe==null?void 0:qe.threadName);Tn&&xr&&(ee.value={...ee.value,[Tn]:xr},he(),Li(Tn,xr))}const p=ge(d);p&&U(p.threadId,p.activity);const y=le(d);y&&(et.set(y.turnId,y),ve.value={...ve.value,[y.threadId]:y.turnId},Pe(y.threadId,null),K(y.threadId,null),Ve(y.threadId,!0),u.value[y.threadId]&&(u.value=Bt(u.value,y.threadId)));const C=Ae(d),X=Er(d),_e=!!((C==null?void 0:C.threadId)??jt(d))&&!!X&&f.value!==un&&_o(new Error(X));if(C){const qe=et.get(C.turnId);qe&&et.delete(C.turnId);const Tn=fn((ml=Ne(d.params))==null?void 0:ml.durationMs)??fn((vl=Ne((gl=Ne(d.params))==null?void 0:gl.turn))==null?void 0:vl.durationMs)??(typeof C.startedAtMs=="number"?C.completedAtMs-C.startedAtMs:null)??(qe?C.completedAtMs-qe.startedAtMs:null),xr=typeof Tn=="number"?Math.max(0,Tn):0;Pe(C.threadId,{turnId:C.turnId,durationMs:xr}),ve.value[C.threadId]&&(ve.value=Bt(ve.value,C.threadId)),Ve(C.threadId,!1),U(C.threadId,null),_t(C.threadId),_e||(D(C.threadId),on(C.threadId))}if(X){const qe=(C==null?void 0:C.threadId)||jt(d);qe&&K(qe,X),Te.value=X,qe&&_e&&B(qe)}else C&&K(C.threadId,null);const xe=_n(d);if(xe){const qe=jt(d);qe&&K(qe,xe),Te.value=xe,f.value!==un&&_o(new Error(xe))&&(qe?B(qe):F())}const we=jt(d);if(!we||we!==n.value)return;Mt(d);const ot=sn(d);if(ot){const qe=(s.value[we]??[]).find(xr=>xr.id===ot.messageId),Tn=`${(qe==null?void 0:qe.text)??""}${ot.delta}`;xt(we,{id:ot.messageId,role:"assistant",text:Tn,messageType:"agentMessage.live"})}const St=Dn(d);St&&xt(we,St),We(d);const Xr=at(d);if(Xr&&Sr(we,Xr.delta),lt(d)){const qe=o.value[we]??"";qe.trim().length>0&&!qe.endsWith(`
1437
+ */const fS=300,hS=of("authIdTokenMaxAge")||fS;let uu=null;const pS=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>hS)return;const s=n==null?void 0:n.token;uu!==s&&(uu=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function mS(e=ff()){const t=uf(e,"auth");if(t.isInitialized())return t.getImmediate();const n=K1(e,{popupRedirectResolver:lS,persistence:[wI,aI,Lf]}),r=of("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=pS(o.toString());sI(n,i,()=>i(n.currentUser)),rI(n,a=>i(a))}}const s=F0("auth");return s&&Y1(n,`http://${s}`),n}function gS(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}W1({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=gn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",gS().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});dS("Browser");const vS={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};function yS(e){const t=L(null),n=L(""),r=L(""),s=L(""),o=L({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),i=pe(()=>s.value==="pull"),a=pe(()=>s.value==="push"),l=pe(()=>s.value!=="");async function u(){try{const I=await fetch("/codex-api/skills-sync/status");if(!I.ok)return;const O=await I.json();O.data&&(o.value=O.data)}catch{}}async function c(){try{const I=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),O=await I.json();if(!I.ok||!O.data)throw new Error("Failed to start GitHub login");t.value=O.data;const Y=30,$=Math.max((O.data.interval??5)*1e3,3e3);let q=!1;for(let j=0;j<Y;j++){await new Promise(ve=>setTimeout(ve,$));const oe=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:O.data.device_code})}),de=await oe.json();if(!oe.ok)throw new Error(de.error||"Failed to complete GitHub login");if(de.ok){q=!0;break}if(!de.pending)throw new Error(de.error||"Failed to complete GitHub login")}if(!q)throw new Error("GitHub login timed out. Please retry.");t.value=null,await u(),e.showToast("GitHub login successful")}catch(I){e.showToast(I instanceof Error?I.message:"Failed GitHub login","error")}}async function f(){try{const I=o1().length>0?ff():df(vS),O=mS(I),Y=new xn;Y.addScope("repo");const $=await II(O,Y),q=xn.credentialFromResult($),j=(q==null?void 0:q.accessToken)??"";if(!j)throw new Error("GitHub access token missing from Firebase login");const oe=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:j})}),de=await oe.json();if(!oe.ok||!de.ok)throw new Error(de.error||"Failed to login with GitHub token");await u(),e.showToast("GitHub login successful")}catch(I){const O=I instanceof Error?I.message:"Failed Firebase GitHub login";e.showToast(O,"error")}}async function h(){r.value="",n.value="pull-started",s.value="pull";try{const I=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),O=await I.json();if(!I.ok||!O.ok)throw new Error(O.error||"Failed to pull synced skills");await e.onPulled(),n.value="pull-success",e.showToast(o.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(I){const O=I instanceof Error?I.message:"Failed to pull sync";r.value=O,n.value="pull-failed",e.showToast(O,"error")}finally{s.value=""}}async function b(){r.value="",n.value="push-started",s.value="push";try{const I=await fetch("/codex-api/skills-sync/push",{method:"POST"}),O=await I.json();if(!I.ok||!O.ok)throw new Error(O.error||"Failed to push synced skills");n.value="push-success",e.showToast("Pushed skills to private sync repo")}catch(I){const O=I instanceof Error?I.message:"Failed to push sync";r.value=O,n.value="push-failed",e.showToast(O,"error")}finally{s.value=""}}async function N(){try{const I=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),O=await I.json();if(!I.ok||!O.ok)throw new Error(O.error||"Failed to logout GitHub");await u(),e.showToast("Logged out from GitHub")}catch(I){e.showToast(I instanceof Error?I.message:"Failed to logout GitHub","error")}}return{deviceLogin:t,isPullInFlight:i,isPushInFlight:a,isSyncActionInFlight:l,loadSyncStatus:u,logoutGithub:N,pullSkillsSync:h,pushSkillsSync:b,startGithubFirebaseLogin:f,startGithubLogin:c,syncActionError:r,syncActionStatus:n,syncStatus:o}}const wS={class:"skills-hub"},bS={class:"skills-sync-panel"},_S={class:"skills-sync-header"},kS={key:0,class:"skills-sync-badge"},TS={key:1,class:"skills-sync-badge"},IS={key:2,class:"skills-sync-badge"},SS={class:"skills-sync-meta"},ES={key:0,class:"skills-sync-error"},CS={key:1,class:"skills-sync-meta"},AS={key:2,class:"skills-sync-error"},RS={key:3,class:"skills-sync-device"},PS=["href"],xS={class:"skills-sync-actions"},MS=["disabled"],OS=["disabled"],NS=["disabled"],$S={key:1,class:"skills-hub-section"},DS={class:"skills-hub-section-title"},LS={key:0,class:"skills-hub-grid"},jS={class:"skills-hub-toolbar"},BS={class:"skills-hub-search-wrap"},US={key:0,class:"skills-hub-count"},FS={class:"skills-hub-section"},HS={key:0,class:"skills-hub-loading"},VS={key:1,class:"skills-hub-error"},WS={key:0,class:"skills-hub-grid"},qS={key:1,class:"skills-hub-empty"},wo="codex-web-local.skills-hub.cache.v1",zS=Lt({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=L(null),s=L(""),o=L("date"),i=L([]),a=L([]),l=L(0),u=L(!1),c=L(""),f=L(!0),h=L(!1),b=L(n),N=L(null),I=L(""),O=L(!1),Y=L(!1);let $=null,q=null;const j=t,oe=pe(()=>o.value==="date"?"Newest":"A-Z"),de=pe(()=>{var P;return((P=N.value)==null?void 0:P.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),ve=pe(()=>`${b.value.owner}/${b.value.name}`),Ie=pe(()=>O.value&&I.value===ve.value),re=pe(()=>Y.value&&I.value===ve.value),ee=pe(()=>{const P=s.value.toLowerCase().trim();return P?a.value.filter(D=>D.name.toLowerCase().includes(P)||D.owner.toLowerCase().includes(P)||(D.displayName??"").toLowerCase().includes(P)):a.value});function ye(P,D="success"){N.value={text:P,type:D},q&&clearTimeout(q),q=setTimeout(()=>{N.value=null},3e3)}function te(){o.value=o.value==="date"?"name":"date",$e(s.value)}function je(P){return`${o.value}::${P.trim().toLowerCase()}`}function Be(P){var D;if(typeof window>"u")return null;try{const B=window.localStorage.getItem(wo);return B?((D=JSON.parse(B).byKey)==null?void 0:D[P])??null:null}catch{return null}}function Ye(P,D){if(!(typeof window>"u"))try{const B=window.localStorage.getItem(wo),V=(B?JSON.parse(B):{}).byKey??{};V[P]=D,window.localStorage.setItem(wo,JSON.stringify({byKey:V}))}catch{}}function Re(){if(!(typeof window>"u"))try{window.localStorage.removeItem(wo)}catch{}}function Te(P){const D=P.installed??[];a.value=D;const B=new Set(D.map(G=>G.name));i.value=P.data.map(G=>{if(G.installed||B.has(G.name)){const V=D.find(be=>be.name===G.name);return{...G,installed:!0,path:(V==null?void 0:V.path)??G.path,enabled:(V==null?void 0:V.enabled)??G.enabled}}return G}).filter(G=>!G.installed),l.value=P.total}async function $e(P){const D=je(P),B=Be(D);B&&Te(B),u.value=!B,c.value="";try{const G=new URLSearchParams;P.trim()&&G.set("q",P.trim()),G.set("limit","100"),G.set("sort",o.value);const V=await fetch(`/codex-api/skills-hub?${G}`);if(!V.ok)throw new Error(`HTTP ${V.status}`);const be=await V.json();Te(be),Ye(D,be)}catch(G){c.value=G instanceof Error?G.message:"Failed to load skills"}finally{u.value=!1}}function Tt(){$&&clearTimeout($),$=setTimeout(()=>$e(s.value),300)}function nt(P){b.value=P,h.value=!0}async function Qe(P){I.value=`${P.owner}/${P.name}`,O.value=!0;try{const B=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:P.owner,name:P.name})})).json();if(!B.ok)throw new Error(B.error||"Install failed");const G={...P,installed:!0,path:B.path,enabled:!0};a.value=[...a.value,G],i.value=i.value.filter(V=>V.name!==P.name),b.value=G,ye(`${P.displayName||P.name} skill installed`),h.value=!1,Re(),j("skills-changed")}catch(D){ye(D instanceof Error?D.message:"Failed to install skill","error")}finally{O.value=!1}}async function Xe(P){I.value=`${P.owner}/${P.name}`,Y.value=!0;try{const B=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:P.name,path:P.path})})).json();if(!B.ok)throw new Error(B.error||"Uninstall failed");a.value=a.value.filter(G=>G.name!==P.name),P.owner!=="local"&&(i.value=[...i.value,{...P,installed:!1,path:void 0,enabled:void 0}]),ye(`${P.displayName||P.name} skill uninstalled`),h.value=!1,Re(),j("skills-changed")}catch(D){ye(D instanceof Error?D.message:"Failed to uninstall skill","error")}finally{Y.value=!1}}async function ft(P,D){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:P.path,enabled:D}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),ye(`${P.displayName||P.name} skill ${D?"enabled":"disabled"}`),await $e(s.value)}catch(B){ye(B instanceof Error?B.message:"Failed to update skill","error")}}const{deviceLogin:Rt,isPullInFlight:Ge,isPushInFlight:et,isSyncActionInFlight:W,loadSyncStatus:me,logoutGithub:ie,pullSkillsSync:fe,pushSkillsSync:De,startGithubFirebaseLogin:g,startGithubLogin:v,syncActionError:A,syncActionStatus:H,syncStatus:F}=yS({showToast:ye,onPulled:async()=>{await $e(s.value),j("skills-changed")}});return or(()=>{$e(""),me()}),(P,D)=>(w(),T("div",wS,[D[11]||(D[11]=m("div",{class:"skills-hub-header"},[m("h2",{class:"skills-hub-title"},"Skills Hub"),m("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),m("div",bS,[m("div",_S,[D[8]||(D[8]=m("strong",null,"Skills Sync (GitHub)",-1)),ue(F).configured?(w(),T("span",kS,"Connected: "+ce(ue(F).repoOwner)+"/"+ce(ue(F).repoName),1)):ue(F).loggedIn?(w(),T("span",TS,"Logged in as "+ce(ue(F).githubUsername),1)):(w(),T("span",IS,"Not connected"))]),m("div",SS,[m("span",null,"Startup: "+ce(ue(F).startup.mode),1),m("span",null,"Branch: "+ce(ue(F).startup.branch),1),m("span",null,"Action: "+ce(ue(F).startup.lastAction),1)]),ue(F).startup.lastError?(w(),T("div",ES,ce(ue(F).startup.lastError),1)):se("",!0),ue(H)?(w(),T("div",CS,[m("span",null,"Manual sync: "+ce(ue(H)),1)])):se("",!0),ue(A)?(w(),T("div",AS,ce(ue(A)),1)):se("",!0),ue(Rt)?(w(),T("div",RS,[m("span",null,[D[9]||(D[9]=la("Open ",-1)),m("a",{href:ue(Rt).verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,PS),D[10]||(D[10]=la(" and enter code:",-1))]),m("code",null,ce(ue(Rt).user_code),1)])):se("",!0),m("div",xS,[ue(F).loggedIn?se("",!0):(w(),T("button",{key:0,class:"skills-hub-sort",type:"button",onClick:D[0]||(D[0]=(...B)=>ue(g)&&ue(g)(...B))},"Login with GitHub")),ue(F).loggedIn?se("",!0):(w(),T("button",{key:1,class:"skills-hub-sort",type:"button",onClick:D[1]||(D[1]=(...B)=>ue(v)&&ue(v)(...B))},"Device Login")),ue(F).loggedIn?(w(),T("button",{key:2,class:"skills-hub-sort",type:"button",onClick:D[2]||(D[2]=(...B)=>ue(ie)&&ue(ie)(...B)),disabled:ue(W)},"Logout GitHub",8,MS)):se("",!0),m("button",{class:"skills-hub-sort",type:"button",onClick:D[3]||(D[3]=(...B)=>ue(fe)&&ue(fe)(...B)),disabled:ue(W)},ce(ue(Ge)?"Pulling...":"Pull"),9,OS),ue(F).loggedIn?(w(),T("button",{key:3,class:"skills-hub-sort",type:"button",onClick:D[4]||(D[4]=(...B)=>ue(De)&&ue(De)(...B)),disabled:!ue(F).configured||ue(W)},ce(ue(et)?"Pushing...":"Push"),9,NS)):se("",!0)])]),N.value?(w(),T("div",{key:0,class:mt(["skills-hub-toast",de.value])},ce(N.value.text),3)):se("",!0),ee.value.length>0?(w(),T("div",$S,[m("button",{class:"skills-hub-section-toggle",type:"button",onClick:D[5]||(D[5]=B=>f.value=!f.value)},[m("span",DS,"Installed ("+ce(ee.value.length)+")",1),Ce(Jd,{class:mt(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),T("div",LS,[(w(!0),T(He,null,Et(ee.value,B=>(w(),gt(Dc,{key:B.name,skill:B,onSelect:G=>nt(G)},null,8,["skill","onSelect"]))),128))])):se("",!0)])):se("",!0),m("div",jS,[m("div",BS,[Ce(va,{class:"skills-hub-search-icon"}),er(m("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":D[6]||(D[6]=B=>s.value=B),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:Tt},null,544),[[tr,s.value]]),l.value>0?(w(),T("span",US,ce(l.value)+" skills",1)):se("",!0)]),m("button",{class:"skills-hub-sort",type:"button",onClick:te},ce(oe.value),1)]),m("div",FS,[u.value?(w(),T("div",HS,"Loading skills...")):c.value?(w(),T("div",VS,ce(c.value),1)):(w(),T(He,{key:2},[i.value.length>0?(w(),T("div",WS,[(w(!0),T(He,null,Et(i.value,B=>(w(),gt(Dc,{key:B.url,skill:B,onSelect:G=>nt(G)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),T("div",qS,'No skills found for "'+ce(s.value)+'"',1)):se("",!0)],64))]),Ce(M0,{skill:b.value,visible:h.value,"is-installing":Ie.value,"is-uninstalling":re.value,onClose:D[7]||(D[7]=B=>h.value=!1),onInstall:Qe,onUninstall:Xe,onToggleEnabled:ft},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),GS=rt(zS,[["__scopeId","data-v-2f6920be"]]),KS={},JS={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 YS(e,t){return w(),T("svg",JS,[...t[0]||(t[0]=[m("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),m("path",{d:"M9 4l0 16"},null,-1)])])}const QS=rt(KS,[["render",YS]]),XS={},ZS={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function eE(e,t){return w(),T("svg",ZS,[...t[0]||(t[0]=[m("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 tE=rt(XS,[["render",eE]]),nE={class:"sidebar-thread-controls"},rE=["aria-label","title"],sE=Lt({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(w(),T("div",nE,[m("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(w(),gt(tE,{key:0,class:"sidebar-thread-controls-icon"})):(w(),gt(QS,{key:1,class:"sidebar-thread-controls-icon"}))],8,rE),Mn(t.$slots,"default",{},void 0),e.showNewThreadButton?(w(),T("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[1]||(n[1]=r=>t.$emit("start-new-thread"))},[Ce(Fo,{class:"sidebar-thread-controls-icon"})])):se("",!0)]))}}),du=rt(sE,[["__scopeId","data-v-46a10052"]]),oE={},iE={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function aE(e,t){return w(),T("svg",iE,[...t[0]||(t[0]=[m("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[m("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),m("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const lE=rt(oE,[["render",aE]]);function mr(e){return e.flatMap(t=>t.threads)}const qf="codex-web-local.thread-read-state.v1",zf="codex-web-local.thread-scroll-state.v1",Ea="codex-web-local.selected-thread-id.v1",Gf="codex-web-local.project-order.v1",Kf="codex-web-local.project-display-name.v1",Wi=220,fu=["none","minimal","low","medium","high","xhigh"],Ms="__global__",un="gpt-5.2-codex";function cE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(qf);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function hu(e){typeof window>"u"||window.localStorage.setItem(qf,JSON.stringify(e))}function Jf(e,t,n){return Math.min(Math.max(e,t),n)}function uE(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=Jf(t.scrollRatio,0,1)),n}function dE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(zf);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=uE(s);o&&(n[r]=o)}return n}catch{return{}}}function pu(e){typeof window>"u"||window.localStorage.setItem(zf,JSON.stringify(e))}function fE(){return typeof window>"u"?"":window.localStorage.getItem(Ea)??""}function hE(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Ea);return}window.localStorage.setItem(Ea,e)}}function pE(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Gf);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 Zr(e){typeof window>"u"||window.localStorage.setItem(Gf,JSON.stringify(e))}function mE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Kf);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 qi(e){typeof window>"u"||window.localStorage.setItem(Kf,JSON.stringify(e))}function bo(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 Br(e,n)?e:n}function zi(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 Br(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 gE(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 vE(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function _o(e){if(!(e instanceof Error))return!1;const t=e.message.toLowerCase();return t.includes("not supported when using codex with a chatgpt account")||t.includes("model is not supported")}function Ca(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Br(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&vE(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Ko(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 yE(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&&Ca(f,c)?f:c});if(n.preserveMissing!==!0)return Ko(e,o)?e:o;const i=e.map(c=>{const f=s.get(c.id);return!f||Ca(c,f)?c:f}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),u=[...i,...l];return Ko(e,u)?e:u}function Aa(e){return e.replace(/\s+/gu," ").trim()}function wE(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Aa(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=Aa(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function mu(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Ca(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const Yf="worked";function fr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function bE(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 _E(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function kE(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 TE(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${bE(e.durationMs)}`,messageType:Yf}}function IE(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function SE(e,t){const n=TE(t),r=e.filter(i=>i.messageType!==Yf),s=IE(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Ut(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function EE(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 CE(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 AE(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 Ht(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function ko(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 u=i.get(l.id);return u&&EE(u,l)?u:l});return o&&o.projectName===s.projectName&&CE(o.threads,a)?o:{projectName:s.projectName,threads:a}});return AE(e,r)?e:r}function RE(e,t,n){const r=new Set(mr(t).map(a=>a.id)),s=mr(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 u=i.findIndex(c=>c.projectName===a.projectName);u>=0&&(i[u]={projectName:i[u].projectName,threads:[a,...i[u].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function PE(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Gi(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function xE(e){const t=e.split(`
1438
+ `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function ME(){const e=L([]),t=L([]),n=L(fE()),r=L({}),s=L({}),o=L({}),i=L({}),a=L({}),l=L({}),u=L({}),c=L([]),f=L(""),h=L("medium"),b=L(cE()),N=L(dE()),I=L(pE()),O=L(mE()),Y=L({}),$=L({}),q=L({}),j=L({}),oe=L({}),de=L({}),ve=L({}),Ie=L({}),re=L({}),ee=L({}),ye=L([]),te=L(!1),je=L(!1),Be=L(!1),Ye=L(!1),Re=L(!1),Te=L(""),$e=L(!1),Tt=L(!1);let nt=null,Qe=null,Xe=!1;const ft=new Set;let Rt=!1,Ge=!1;const et=new Map,W=new Set,me=pe(()=>mr(e.value)),ie=pe(()=>me.value.find(d=>d.id===n.value)??null),fe=pe(()=>N.value[n.value]??null),De=pe(()=>{const d=[],p=n.value;return p&&Array.isArray(Ie.value[p])&&d.push(...Ie.value[p]),Array.isArray(Ie.value[Ms])&&d.push(...Ie.value[Ms]),d.sort((y,C)=>y.receivedAtIso.localeCompare(C.receivedAtIso))}),g=pe(()=>{var X;const d=n.value;if(!d)return null;const p=oe.value[d],y=(o.value[d]??"").trim(),C=(((X=de.value[d])==null?void 0:X.message)??"").trim();return!p&&!y&&!C?null:{activityLabel:(p==null?void 0:p.label)||"Thinking",activityDetails:(p==null?void 0:p.details)??[],reasoningText:y,errorText:C}}),v=pe(()=>{const d=n.value;if(!d)return[];const p=r.value[d]??[],y=s.value[d]??[],C=i.value[d]??[],X=[...p,...C,...y],Q=j.value[d];return Q?SE(X,Q):X});function A(d){n.value!==d&&(n.value=d,hE(d),Ge=!1)}function H(d){f.value=d.trim()}async function F(){f.value=un,c.value.includes(un)||(c.value=[...c.value,un]);try{await t_(un)}catch{}}function P(d,p){re.value={...re.value,[d]:p}}function D(d){re.value[d]&&(re.value=Ut(re.value,d))}async function B(d){if(W.has(d))return;const p=re.value[d];if(!(!p||p.fallbackRetried)){W.add(d),P(d,{...p,fallbackRetried:!0});try{await F();try{const y=await Mc(d,1);ot(d,y),bt(d,[]),rn(d),i.value[d]&&(i.value=Ut(i.value,d))}catch{}K(d,null),Te.value="",xe(d,null),U(d,{label:"Thinking",details:V(un,p.effort)}),Ve(d,!0),q.value[d]!==!0&&await Ni(d),await $i(d,p.text,p.imageUrls,un,p.effort||void 0,p.skills.length>0?p.skills:void 0,p.fileAttachments),q.value={...q.value,[d]:!0},ft.add(d),Xe=!0,await It()}catch(y){const C=y instanceof Error?y.message:"Unknown application error";K(d,C),Te.value=C,Ve(d,!1),U(d,null)}finally{W.delete(d)}}}function G(d){d&&!fu.includes(d)||(h.value=d)}function V(d,p){const y=d.trim()||"default",C=p||"default";return[`Model: ${y}`,`Thinking: ${C}`]}async function be(){try{const[d,p]=await Promise.all([n_(),r_()]);c.value=d,f.value.length>0&&d.includes(f.value)||(p.model&&d.includes(p.model)?f.value=p.model:d.length>0?f.value=d[0]:f.value=""),p.reasoningEffort&&fu.includes(p.reasoningEffort)&&(h.value=p.reasoningEffort)}catch{}}function ae(d){const p=ee.value;return Object.keys(p).length===0?d:d.map(y=>({projectName:y.projectName,threads:y.threads.map(C=>{const X=p[C.id];return X?{...C,title:X}:C})}))}function he(){const p=ae(t.value).map(y=>({projectName:y.projectName,threads:y.threads.map(C=>{const X=a.value[C.id]===!0,Q=n.value===C.id,_e=b.value[C.id],Pe=u.value[C.id]===!0,we=!Q&&!X&&(Pe||_e!==C.updatedAtIso);return{...C,inProgress:X,unread:we}})}));e.value=ko(e.value,p)}function Se(d,p,y){const C=new Date().toISOString(),X=p.trim(),Q=PE(X),_e={id:d,title:xE(y),projectName:Q,cwd:X,hasWorktree:X.includes("/.codex/worktrees/")||X.includes("/.git/worktrees/"),createdAtIso:C,updatedAtIso:C,preview:y,unread:!1,inProgress:!1},Pe=t.value.findIndex(st=>st.projectName===Q);if(Pe>=0){const St=t.value[Pe].threads.filter(lr=>lr.id!==d),Qr={projectName:Q,threads:[_e,...St]},Un=[...t.value];Un.splice(Pe,1,Qr),t.value=Un}else t.value=[{projectName:Q,threads:[_e]},...t.value];const we=bo(I.value,t.value);Br(I.value,we)||(I.value=we,Zr(I.value)),he()}function Me(d){const p=new Set(d.map(Q=>Q.id)),y=Ht(b.value,p);y!==b.value&&(b.value=y,hu(y));const C=Ht(N.value,p);C!==N.value&&(N.value=C,pu(C)),$.value=Ht($.value,p),Y.value=Ht(Y.value,p),q.value=Ht(q.value,p),r.value=Ht(r.value,p),s.value=Ht(s.value,p),o.value=Ht(o.value,p),i.value=Ht(i.value,p),j.value=Ht(j.value,p),oe.value=Ht(oe.value,p),de.value=Ht(de.value,p),ve.value=Ht(ve.value,p),u.value=Ht(u.value,p),a.value=Ht(a.value,p);const X={};for(const[Q,_e]of Object.entries(Ie.value))(Q===Ms||p.has(Q))&&(X[Q]=_e);Ie.value=X}function Ke(d){const p=mr(t.value).find(y=>y.id===d);p&&(b.value={...b.value,[d]:p.updatedAtIso},hu(b.value),u.value[d]&&(u.value=Ut(u.value,d)),he())}function xe(d,p){if(!d)return;const y=j.value[d];if(p){if(_E(y,p))return;j.value={...j.value,[d]:p}}else y&&(j.value=Ut(j.value,d))}function Ve(d,p){!d||a.value[d]===!0===p||(p?a.value={...a.value,[d]:!0}:a.value=Ut(a.value,d),he())}function wt(d){d&&d!==n.value&&u.value[d]!==!0&&(u.value={...u.value,[d]:!0},he())}function U(d,p){if(!d)return;const y=oe.value[d];if(!p){y&&(oe.value=Ut(oe.value,d));return}const C=z(p.label)||"Thinking",X=p.details.map(Pe=>z(Pe)).filter(Pe=>Pe.length>0&&Pe!==C),Q=Array.from(new Set([...(y==null?void 0:y.details)??[],...X])).slice(-3),_e={label:C,details:Q};kE(y,_e)||(oe.value={...oe.value,[d]:_e})}function K(d,p){if(!d)return;const y=de.value[d],C=p?Aa(p):"";if(!C){y&&(de.value=Ut(de.value,d));return}(y==null?void 0:y.message)!==C&&(de.value={...de.value,[d]:{message:C}})}function ne(d){const p=mr(t.value).find(y=>y.id===d);return(p==null?void 0:p.updatedAtIso)??""}function Je(d,p){if(!d)return;const y={scrollTop:Math.max(0,p.scrollTop),isAtBottom:p.isAtBottom===!0};typeof p.scrollRatio=="number"&&Number.isFinite(p.scrollRatio)&&(y.scrollRatio=Jf(p.scrollRatio,0,1));const C=N.value[d];C&&C.scrollTop===y.scrollTop&&C.isAtBottom===y.isAtBottom&&C.scrollRatio===y.scrollRatio||(N.value={...N.value,[d]:y},pu(N.value))}function ot(d,p){const y=r.value[d]??[];Ko(y,p)||(r.value={...r.value,[d]:p})}function bt(d,p){const y=s.value[d]??[];Ko(y,p)||(s.value={...s.value,[d]:p})}function Pt(d,p){const y=s.value[d]??[],C=mu(y,p);bt(d,C)}function ln(d,p){if(!d)return;const y=p.trim(),C=o.value[d]??"";if(y.length===0){if(!C)return;o.value=Ut(o.value,d);return}C!==y&&(o.value={...o.value,[d]:y})}function Ir(d,p){if(!d)return;const y=o.value[d]??"";ln(d,`${y}${p}`)}function rn(d){d&&d in o.value&&(o.value=Ut(o.value,d))}function Ne(d){return d!==null&&typeof d=="object"&&!Array.isArray(d)?d:null}function Oe(d){return typeof d=="string"?d:""}function fn(d){return typeof d=="number"&&Number.isFinite(d)?d:null}function jt(d){const p=Ne(d.params);if(!p)return"";const y=Oe(p.threadId);if(y)return y;const C=Oe(p.thread_id);if(C)return C;const X=Oe(p.conversationId);if(X)return X;const Q=Oe(p.conversation_id);if(Q)return Q;const _e=Ne(p.thread),Pe=Oe(_e==null?void 0:_e.id);if(Pe)return Pe;const we=Ne(p.turn),st=Oe(we==null?void 0:we.threadId);if(st)return st;const St=Oe(we==null?void 0:we.thread_id);return St||""}function Sr(d){if(d.method!=="turn/completed")return"";const p=Ne(d.params),y=Ne(p==null?void 0:p.turn);if(!y||y.status!=="failed")return"";const C=Ne(y.error);return Oe(C==null?void 0:C.message)}function _n(d){var y;if(d.method!=="error")return"";const p=Ne(d.params);return Oe(p==null?void 0:p.message)||Oe((y=Ne(p==null?void 0:p.error))==null?void 0:y.message)}function kn(d){const p=Ne(d);if(!p)return null;const y=p.id,C=Oe(p.method),X=p.params;if(typeof y!="number"||!Number.isInteger(y)||!C)return null;const Q=Ne(X),_e=Oe(Q==null?void 0:Q.threadId)||Ms,Pe=Oe(Q==null?void 0:Q.turnId),we=Oe(Q==null?void 0:Q.itemId),st=Oe(p.receivedAtIso)||new Date().toISOString();return{id:y,method:C,threadId:_e,turnId:Pe,itemId:we,receivedAtIso:st,params:X??null}}function _(d){const p=d.threadId||Ms,y=Ie.value[p]??[],C=y.findIndex(Q=>Q.id===d.id),X=[...y];C>=0?X.splice(C,1,d):X.push(d),Ie.value={...Ie.value,[p]:X.sort((Q,_e)=>Q.receivedAtIso.localeCompare(_e.receivedAtIso))}}function S(d){const p={};for(const[y,C]of Object.entries(Ie.value)){const X=C.filter(Q=>Q.id!==d);X.length>0&&(p[y]=X)}Ie.value=p}function E(d){if(d.method==="server/request"){const p=kn(d.params);return p&&_(p),!0}if(d.method==="server/request/resolved"){const p=Ne(d.params),y=p==null?void 0:p.id;return typeof y=="number"&&Number.isInteger(y)&&S(y),!0}return!1}function z(d){return d.replace(/\s+/gu," ").trim()}function ge(d){const p=jt(d);if(!p)return null;if(d.method==="turn/started")return{threadId:p,activity:{label:"Thinking",details:[]}};if(d.method==="item/started"){const y=Ne(d.params),C=Ne(y==null?void 0:y.item),X=Oe(C==null?void 0:C.type).toLowerCase();if(X==="reasoning")return{threadId:p,activity:{label:"Thinking",details:[]}};if(X==="agentmessage")return{threadId:p,activity:{label:"Writing response",details:[]}};if(X==="commandexecution"){const Q=Oe(C==null?void 0:C.command);return{threadId:p,activity:{label:"Running command",details:Q?[Q]:[]}}}}return d.method==="item/commandExecution/outputDelta"?{threadId:p,activity:{label:"Running command",details:[]}}:d.method==="item/reasoning/summaryTextDelta"||d.method==="item/reasoning/summaryPartAdded"?{threadId:p,activity:{label:"Thinking",details:[]}}:d.method==="item/agentMessage/delta"?{threadId:p,activity:{label:"Writing response",details:[]}}:null}function le(d){if(d.method!=="turn/started")return null;const p=Ne(d.params);if(!p)return null;const y=jt(d);if(!y)return null;const C=Ne(p.turn),X=Oe(C==null?void 0:C.id)||Oe(p.turnId)||`${y}:unknown`;if(!X)return null;const Q=fr(Oe(C==null?void 0:C.startedAt))??fr(Oe(p.startedAt))??fr(d.atIso)??Date.now();return{threadId:y,turnId:X,startedAtMs:Q}}function Ae(d){if(d.method!=="turn/completed")return null;const p=Ne(d.params);if(!p)return null;const y=jt(d);if(!y)return null;const C=Ne(p.turn),X=Oe(C==null?void 0:C.id)||Oe(p.turnId)||`${y}:unknown`;if(!X)return null;const Q=fr(Oe(C==null?void 0:C.completedAt))??fr(Oe(p.completedAt))??fr(d.atIso)??Date.now(),_e=fr(Oe(C==null?void 0:C.startedAt))??fr(Oe(p.startedAt))??void 0;return{threadId:y,turnId:X,completedAtMs:Q,startedAtMs:_e}}function ke(d){return`${d}:live-reasoning`}function We(d){const p=Ne(d.params);if(!p)return"";if(d.method==="item/started"){const y=Ne(p.item);return!y||y.type!=="reasoning"?"":Oe(y.id)}return""}function it(d){const p=Ne(d.params);if(!p)return null;if(d.method==="item/reasoning/summaryTextDelta"){const y=Oe(p.itemId),C=Oe(p.delta);return!y||!C?null:{messageId:ke(y),delta:C}}return null}function at(d){const p=Ne(d.params);if(!p)return"";if(d.method==="item/reasoning/summaryPartAdded"){const y=Oe(p.itemId);return y?ke(y):""}return""}function xt(d){const p=Ne(d.params);if(!p)return"";if(d.method==="item/completed"){const y=Ne(p.item);return!y||y.type!=="reasoning"?"":ke(Oe(y.id))}return""}function Mt(d){const p=Ne(d.params);if(!p)return"";if(d.method==="item/started"){const y=Ne(p.item);return!y||y.type!=="agentMessage"?"":Oe(y.id)}return""}function sn(d){const p=Ne(d.params);if(!p)return null;if(d.method==="item/agentMessage/delta"){const y=Oe(p.itemId),C=Oe(p.delta);return!y||!C?null:{messageId:y,delta:C}}return null}function Dn(d){const p=Ne(d.params);if(!p)return null;if(d.method==="item/completed"){const y=Ne(p.item);if(!y||y.type!=="agentMessage")return null;const C=Oe(y.id),X=Oe(y.text);return!C||!X?null:{id:C,role:"assistant",text:X,messageType:"agentMessage.live"}}return null}function _s(d){if(d.method!=="item/started")return null;const p=Ne(d.params),y=Ne(p==null?void 0:p.item);if(!y||y.type!=="commandExecution")return null;const C=Oe(y.id),X=Oe(y.command);if(!C)return null;const Q=typeof y.cwd=="string"?y.cwd:null;return{id:C,role:"system",text:X,messageType:"commandExecution",commandExecution:{command:X,cwd:Q,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function Er(d){if(d.method!=="item/commandExecution/outputDelta")return null;const p=Ne(d.params);if(!p)return null;const y=Oe(p.itemId),C=Oe(p.delta);return!y||!C?null:{itemId:y,delta:C}}function Gr(d){if(d.method!=="item/completed")return null;const p=Ne(d.params),y=Ne(p==null?void 0:p.item);if(!y||y.type!=="commandExecution")return null;const C=Oe(y.id),X=Oe(y.command);if(!C)return null;const Q=typeof y.cwd=="string"?y.cwd:null,_e=Oe(y.status),Pe=_e==="failed"?"failed":_e==="declined"?"declined":_e==="interrupted"?"interrupted":"completed",we=typeof y.aggregatedOutput=="string"?y.aggregatedOutput:"",st=typeof y.exitCode=="number"?y.exitCode:null;return{id:C,role:"system",text:X,messageType:"commandExecution",commandExecution:{command:X,cwd:Q,status:Pe,aggregatedOutput:we,exitCode:st}}}function Ln(d,p){const y=i.value[d]??[],C=mu(y,p);C!==y&&(i.value={...i.value,[d]:C})}function Kr(d,p){const y=i.value[d];if(!y||y.length===0)return;const C=new Set(p.map(Q=>Q.id)),X=y.filter(Q=>!C.has(Q.id));X.length!==y.length&&(X.length===0?i.value=Ut(i.value,d):i.value={...i.value,[d]:X})}function Jr(d){if(d.method==="item/agentMessage/delta")return!0;const p=Ne(d.params);if(!p)return!1;if(d.method==="item/completed"){const y=Ne(p.item);return(y==null?void 0:y.type)==="agentMessage"}return!1}function jn(d){var pl,ml,gl,vl;if(E(d))return;if(d.method==="thread/name/updated"){const ze=Ne(d.params),Tn=Oe(ze==null?void 0:ze.threadId),Pr=Oe(ze==null?void 0:ze.threadName);Tn&&Pr&&(ee.value={...ee.value,[Tn]:Pr},he(),Di(Tn,Pr))}const p=ge(d);p&&U(p.threadId,p.activity);const y=le(d);y&&(et.set(y.turnId,y),ve.value={...ve.value,[y.threadId]:y.turnId},xe(y.threadId,null),K(y.threadId,null),Ve(y.threadId,!0),u.value[y.threadId]&&(u.value=Ut(u.value,y.threadId)));const C=Ae(d),X=Sr(d),_e=!!((C==null?void 0:C.threadId)??jt(d))&&!!X&&f.value!==un&&_o(new Error(X));if(C){const ze=et.get(C.turnId);ze&&et.delete(C.turnId);const Tn=fn((pl=Ne(d.params))==null?void 0:pl.durationMs)??fn((gl=Ne((ml=Ne(d.params))==null?void 0:ml.turn))==null?void 0:gl.durationMs)??(typeof C.startedAtMs=="number"?C.completedAtMs-C.startedAtMs:null)??(ze?C.completedAtMs-ze.startedAtMs:null),Pr=typeof Tn=="number"?Math.max(0,Tn):0;xe(C.threadId,{turnId:C.turnId,durationMs:Pr}),ve.value[C.threadId]&&(ve.value=Ut(ve.value,C.threadId)),Ve(C.threadId,!1),U(C.threadId,null),wt(C.threadId),_e||(D(C.threadId),on(C.threadId))}if(X){const ze=(C==null?void 0:C.threadId)||jt(d);ze&&K(ze,X),Te.value=X,ze&&_e&&B(ze)}else C&&K(C.threadId,null);const Pe=_n(d);if(Pe){const ze=jt(d);ze&&K(ze,Pe),Te.value=Pe,f.value!==un&&_o(new Error(Pe))&&(ze?B(ze):F())}const we=jt(d);if(!we||we!==n.value)return;Mt(d);const st=sn(d);if(st){const ze=(s.value[we]??[]).find(Pr=>Pr.id===st.messageId),Tn=`${(ze==null?void 0:ze.text)??""}${st.delta}`;Pt(we,{id:st.messageId,role:"assistant",text:Tn,messageType:"agentMessage.live"})}const St=Dn(d);St&&Pt(we,St),We(d);const Qr=it(d);if(Qr&&Ir(we,Qr.delta),at(d)){const ze=o.value[we]??"";ze.trim().length>0&&!ze.endsWith(`
1439
1439
 
1440
- `)&&ln(we,`${qe}
1440
+ `)&&ln(we,`${ze}
1441
1441
 
1442
- `)}Pt(d);const cr=ks(d);cr&&(Ln(we,cr),U(we,{label:"Running command",details:[((yl=cr.commandExecution)==null?void 0:yl.command)??""]}));const gi=Cr(d);if(gi){const qe=(i.value[we]??[]).find(Tn=>Tn.id===gi.itemId);qe!=null&&qe.commandExecution&&Ln(we,{...qe,commandExecution:{...qe.commandExecution,aggregatedOutput:`${qe.commandExecution.aggregatedOutput}${gi.delta}`}})}const pl=Gr(d);if(pl&&Ln(we,pl),Jr(d)&&(Ge&&n.value&&Je(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),rn(we)),d.method==="turn/completed"){Ge=!1,rn(we),i.value[we]&&(i.value=Bt(i.value,we));const qe=jt(d);qe&&(Ve(qe,!1),U(qe,null),_t(qe),_e||(D(qe),on(qe)))}}function Ts(d){const p=jt(d);p&&ht.add(p);const y=d.method;(y.startsWith("thread/")||y.startsWith("turn/")||y.startsWith("item/"))&&(Ze=!0),!(Xe!==null||typeof window>"u")&&(Xe=window.setTimeout(()=>{Xe=null,rt()},zi))}async function Is(d){if(!Rt){Rt=!0;try{const p=await ga(),y=[];for(const C of p.order){const X=Ki(C);y.includes(X)||y.push(X)}if(y.length>0){const C=bo(y,d);Br(I.value,C)||(I.value=C,es(I.value))}if(Object.keys(p.labels).length>0){const C={...O.value};let X=!1;for(const[Q,_e]of Object.entries(p.labels)){const xe=Ki(Q);C[xe]!==_e&&(C[xe]=_e,X=!0)}X&&(O.value=C,qi(C))}}catch{}}}async function Ss(){if(!(Object.keys(ee.value).length>0))try{const d=await d_();Object.keys(d.titles).length>0&&(ee.value=d.titles)}catch{}}async function Ar(d,p,y){if(ee.value[d])return;const C=p.trim();if(!C)return;const X=C.length>300?C.slice(0,300):C;try{const Q=await f_(X,y);if(!Q||ee.value[d])return;ee.value={...ee.value,[d]:Q},he(),Li(d,Q)}catch{}}async function Rr(){var d;It.value||(te.value=!0);try{const[p]=await Promise.all([zb(),Ss()]);await Is(p);const y=bo(I.value,p);Br(I.value,y)||(I.value=y,es(I.value));const C=Gi(p,I.value),X=RE(t.value,C,a.value);t.value=ko(t.value,X),a.value=Ft(a.value,new Set(gr(t.value).map(xe=>xe.id))),he(),It.value=!0;const Q=gr(e.value);Me(Q),Q.some(xe=>xe.id===n.value)||A(((d=Q[0])==null?void 0:d.id)??"")}finally{te.value=!1}}async function k(d,p={}){if(!d)return;const y=$.value[d]===!0,C=p.silent!==!0&&!y;C&&(je.value=!0);try{z.value[d]!==!0&&(await $i(d),z.value={...z.value,[d]:!0});const{messages:X,inProgress:Q}=await qb(d),_e=r.value[d]??[],xe=yE(_e,X,{preserveMissing:p.silent===!0});it(d,xe);const we=s.value[d]??[],ot=wE(we,X);kt(d,ot),Kr(d,X),$.value={...$.value,[d]:!0};const St=ne(d);St&&(Y.value={...Y.value,[d]:St}),Ve(d,Q),Ke(d)}finally{C&&(je.value=!1)}}async function P(){try{const d=t.value.flatMap(p=>p.threads.map(y=>y.cwd)).filter(Boolean);ye.value=await h_(d.length>0?[...new Set(d)]:void 0)}catch{}}async function M(){Te.value="";try{await Rr(),await Promise.all([be(),P()]),await k(n.value)}catch(d){Te.value=d instanceof Error?d.message:"Unknown application error"}}async function J(d){A(d);try{await k(d)}catch(p){Te.value=p instanceof Error?p.message:"Unknown application error"}}async function Ue(d){try{await Yb(d),await Rr(),n.value===d&&await k(n.value)}catch(p){Te.value=p instanceof Error?p.message:"Unknown application error"}}async function Ot(d,p){const y=p.trim();if(!(!d||!y))try{await Qb(d,y),ee.value={...ee.value,[d]:y},he(),Li(d,y)}catch(C){Te.value=C instanceof Error?C.message:"Unknown application error"}}async function Zt(d,p=[],y=[],C="steer",X=[]){const Q=n.value,_e=d.trim();if(!Q||!_e&&p.length===0&&X.length===0)return;const xe=a.value[Q]===!0;if(xe&&C==="queue"){const we=l.value[Q]??[],ot=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[Q]:[...we,{id:ot,text:_e,imageUrls:p,skills:y,fileAttachments:X}]};return}if(xe){Ge=!0,Un(Q,_e,p,y,X).catch(we=>{const ot=we instanceof Error?we.message:"Unknown application error";K(Q,ot),Te.value=ot});return}Te.value="",Ge=!0,Pe(Q,null),U(Q,{label:"Thinking",details:V(f.value,h.value)}),K(Q,null),Ve(Q,!0);try{await Un(Q,_e,p,y,X)}catch(we){Ge=!1,Ve(Q,!1),U(Q,null);const ot=we instanceof Error?we.message:"Unknown application error";throw K(Q,ot),Te.value=ot,we}}async function Bn(d,p,y=[],C=[],X=[]){const Q=d.trim(),_e=p.trim(),xe=f.value.trim();if(!Q&&y.length===0&&X.length===0)return"";Be.value=!0,Te.value="";let we="";try{try{we=await Nc(_e||void 0,xe||void 0)}catch(Fn){if(xe&&xe!==un&&_o(Fn))await F(),we=await Nc(_e||void 0,un);else throw Fn}if(!we)return"";Se(we,_e,Q||"[Image]"),z.value={...z.value,[we]:!0},A(we),Ge=!0,Pe(we,null),U(we,{label:"Thinking",details:V(f.value,h.value)}),K(we,null),Ve(we,!0);const ot=we,St=_e||null,Xr=Q;return Un(we,Q,y,C,X).catch(Fn=>{Ge=!1,Ve(we,!1),U(we,null);const cr=Fn instanceof Error?Fn.message:"Unknown application error";K(we,cr),Te.value=cr}).finally(()=>{Be.value=!1}),Ar(ot,Xr,St),we}catch(ot){Ge=!1,we&&(Ve(we,!1),U(we,null));const St=ot instanceof Error?ot.message:"Unknown application error";throw we&&K(we,St),Te.value=St,Be.value=!1,ot}}async function Un(d,p,y=[],C=[],X=[]){const Q=f.value.trim(),_e=h.value,xe=p.trim(),we=C.map(St=>({name:St.name,path:St.path})),ot=X.map(St=>({...St}));x(d,{text:xe,imageUrls:[...y],skills:we,fileAttachments:ot,effort:_e,fallbackRetried:!1});try{z.value[d]!==!0&&await $i(d);try{await Di(d,p,y,Q||void 0,_e||void 0,C.length>0?C:void 0,X)}catch(St){if(Q&&Q!==un&&_o(St))await F(),x(d,{text:xe,imageUrls:[...y],skills:we,fileAttachments:ot,effort:_e,fallbackRetried:!0}),await Di(d,p,y,un,_e||void 0,C.length>0?C:void 0,X);else throw St}z.value={...z.value,[d]:!0},ht.add(d),Ze=!0,await rt()}catch(St){throw St}}async function on(d){const p=l.value[d];if(!p||p.length===0)return;const[y,...C]=p;l.value=C.length>0?{...l.value,[d]:C}:Bt(l.value,d),Be.value=!0,Te.value="",Ge=!0,Pe(d,null),U(d,{label:"Thinking",details:V(f.value,h.value)}),K(d,null),Ve(d,!0);try{await Un(d,y.text,y.imageUrls,y.skills,y.fileAttachments)}catch{Ve(d,!1),U(d,null)}finally{Be.value=!1}}async function lr(){const d=n.value;if(!d||a.value[d]!==!0)return;const p=ve.value[d];Qe.value=!0,Te.value="";try{await e_(d,p),Ve(d,!1),U(d,null),K(d,null),ve.value[d]&&(ve.value=Bt(ve.value,d)),ht.add(d),Ze=!0,await rt()}catch(y){const C=y instanceof Error?y.message:"Failed to interrupt active turn";K(d,C),Te.value=C}finally{Qe.value=!1}}async function Yr(d){const p=n.value;if(!p||Re.value)return;const C=(r.value[p]??[]).reduce((Q,_e)=>typeof _e.turnIndex=="number"&&_e.turnIndex>Q?_e.turnIndex:Q,-1);if(C<0||d>C)return;const X=C-d+1;if(!(X<1)){Re.value=!0,Te.value="";try{const Q=await Oc(p,X);it(p,Q),kt(p,[]),rn(p),i.value[p]&&(i.value=Bt(i.value,p)),Pe(p,null),U(p,null),K(p,null),Ze=!0,await rt()}catch(Q){Te.value=Q instanceof Error?Q.message:"Failed to rollback thread"}finally{Re.value=!1}}}function Qr(d,p){d.length===0||(O.value[d]??"")===p||(O.value={...O.value,[d]:p},qi(O.value))}function mi(d){var X;if(d.length===0)return;const p=I.value.filter(Q=>Q!==d);if(Br(I.value,p)||(I.value=p,es(I.value)),t.value=t.value.filter(Q=>Q.projectName!==d),O.value[d]!==void 0){const Q={...O.value};delete Q[d],O.value=Q,qi(Q)}he();const y=gr(e.value);Me(y),y.some(Q=>Q.id===n.value)||A(((X=y[0])==null?void 0:X.id)??""),Ee()}function R(d,p){if(d.length===0||t.value.length===0)return;const y=t.value.map(we=>we.projectName),C=y.indexOf(d);if(C===-1)return;const X=Math.max(0,Math.min(p,y.length-1)),Q=gE(y,C,X);if(Q===y)return;const _e=bo(Q,t.value);I.value=_e,es(I.value);const xe=Gi(t.value,I.value);t.value=ko(t.value,xe),he(),Ee()}function Z(d){const p=d.trim();if(!p)return;const y=[p,...I.value.filter(X=>X!==p)];if(Br(I.value,y))return;I.value=y,es(I.value);const C=Gi(t.value,I.value);t.value=ko(t.value,C),he(),Ee()}async function Ee(){var d,p;try{const y=await ga(),C=new Map;for(const _e of y.order){const xe=Ki(_e);C.has(xe)||C.set(xe,_e)}for(const _e of t.value){const xe=((p=(d=_e.threads[0])==null?void 0:d.cwd)==null?void 0:p.trim())??"";xe&&C.set(_e.projectName,xe)}const X=[];for(const _e of I.value){const xe=C.get(_e);xe&&!X.includes(xe)&&X.push(xe)}for(const _e of y.order)X.includes(_e)||X.push(_e);const Q=y.active.filter(_e=>X.includes(_e));Q.length===0&&X.length>0&&Q.push(X[0]),await i_({order:X,labels:y.labels,active:Q})}catch{}}async function rt(){if($e.value){typeof window<"u"&&Xe===null&&(Xe=window.setTimeout(()=>{Xe=null,rt()},zi));return}$e.value=!0;const d=Ze,p=new Set(ht);Ze=!1,ht.clear();try{d&&await Rr();const y=n.value;if(!y)return;const C=p.has(y),X=a.value[y]===!0,Q=ne(y),_e=Y.value[y]??"",xe=Q.length>0&&Q!==_e;(C||X||xe||d)&&await k(y,{silent:!0})}catch{}finally{$e.value=!1,(Ze||ht.size>0)&&typeof window<"u"&&Xe===null&&(Xe=window.setTimeout(()=>{Xe=null,rt()},zi))}}function vt(){typeof window>"u"||nt||(Ye(),nt=Gb(d=>{jn(d),Ts(d)}))}async function Ye(){try{const d=await Jb();for(const p of d){const y=kn(p);y&&_(y)}}catch{}}async function Dt(d){try{await Kb(d.id,{result:d.result,error:d.error}),S(d.id)}catch(p){Te.value=p instanceof Error?p.message:"Failed to reply to server request"}}function ho(){nt&&(nt(),nt=null),Ze=!1,ht.clear(),et.clear(),Xe!==null&&typeof window<"u"&&(window.clearTimeout(Xe),Xe=null),Ge=!1,r.value={},s.value={},o.value={},i.value={},oe.value={},j.value={},de.value={},ve.value={},l.value={}}const Es=pe(()=>{const d=n.value;return d?l.value[d]??[]:[]});function hl(d){const p=n.value;if(!p)return;const y=l.value[p];if(!y)return;const C=y.filter(X=>X.id!==d);l.value=C.length>0?{...l.value,[p]:C}:Bt(l.value,p)}function Xf(d){const p=n.value;if(!p)return;const y=l.value[p];if(!y)return;const C=y.find(X=>X.id===d);C&&(hl(d),Zt(C.text,C.imageUrls,C.skills,"steer",C.fileAttachments))}return{projectGroups:e,projectDisplayNameById:O,selectedThread:ie,selectedThreadScrollState:fe,selectedThreadServerRequests:De,selectedLiveOverlay:g,selectedThreadId:n,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:h,installedSkills:ye,messages:v,isLoadingThreads:te,isLoadingMessages:je,isSendingMessage:Be,isInterruptingTurn:Qe,error:Te,refreshAll:M,refreshSkills:P,selectThread:J,setThreadScrollState:Je,archiveThreadById:Ue,renameThreadById:Ot,sendMessageToSelectedThread:Zt,sendMessageToNewThread:Bn,interruptSelectedThreadTurn:lr,rollbackSelectedThread:Yr,isRollingBack:Re,selectedThreadQueuedMessages:Es,removeQueuedMessage:hl,steerQueuedMessage:Xf,setSelectedModelId:H,setSelectedReasoningEffort:G,respondToPendingServerRequest:Dt,renameProject:Qr,removeProject:mi,reorderProject:R,pinProjectToTop:Z,startPolling:vt,stopPolling:ho}}const OE={class:"sidebar-root"},NE={class:"sidebar-scrollable"},$E=["aria-pressed"],DE={key:1,class:"sidebar-search-bar"},LE={key:0,class:"sidebar-settings-area"},jE={key:0,class:"sidebar-settings-panel"},BE={class:"sidebar-settings-value"},UE={class:"sidebar-settings-value"},FE={class:"content-root"},HE={class:"content-body"},VE={key:1,class:"content-grid"},WE={class:"new-thread-empty"},zE={class:"worktree-init-status-title"},qE={class:"worktree-init-status-message"},GE={key:2,class:"content-grid"},KE={class:"content-thread"},JE={class:"composer-with-queue"},YE={class:"build-badge","aria-label":"Worktree name and version"},vu="codex-web-local.sidebar-collapsed.v1",yu="codex-web-local.send-with-enter.v1",wu="codex-web-local.in-progress-send-mode.v1",bu="codex-web-local.dark-mode.v1",QE=Lt({__name:"App",setup(e){const t="a65b",n="0.1.35",{projectGroups:r,projectDisplayNameById:s,selectedThread:o,selectedThreadScrollState:i,selectedThreadServerRequests:a,selectedLiveOverlay:l,selectedThreadId:u,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:h,installedSkills:b,messages:N,isLoadingThreads:I,isLoadingMessages:O,isInterruptingTurn:Y,refreshAll:$,refreshSkills:z,selectThread:j,setThreadScrollState:oe,archiveThreadById:de,renameThreadById:ve,sendMessageToSelectedThread:Ie,sendMessageToNewThread:re,interruptSelectedThreadTurn:ee,rollbackSelectedThread:ye,isRollingBack:te,selectedThreadQueuedMessages:je,removeQueuedMessage:Be,steerQueuedMessage:Qe,setSelectedModelId:Re,setSelectedReasoningEffort:Te,respondToPendingServerRequest:$e,renameProject:It,removeProject:nt,reorderProject:Xe,pinProjectToTop:Ze,startPolling:ht,stopPolling:Rt}=ME(),Ge=$g(),et=Ng(),{isMobile:W}=Jd(),me=L(!1),ie=L(!1),fe=L(""),De=L("local"),g=L({order:[],labels:{}}),v=L({phase:"idle",title:"",message:""}),A=L(Un()),H=L(""),F=L(!1),x=L(null),D=L(null);let B=null;const G=L("New Project (1)"),V=L(""),be=L(!1),ae=L(P(yu,!0)),he=L(J()),Se=L(M()),Me=pe(()=>{const R=Ge.params.threadId;return typeof R=="string"?R:""}),Ke=pe(()=>{const R=new Set;for(const Z of r.value)for(const Ee of Z.threads)R.add(Ee.id);return R}),Pe=pe(()=>Ge.name==="home"),Ve=pe(()=>Ge.name==="skills"),_t=pe(()=>{var R;return Ve.value?"Skills":Pe.value?"New thread":((R=o.value)==null?void 0:R.title)??"Choose a thread"}),U=pe(()=>N.value.filter(R=>{const Z=lr(R.messageType,R.role);return Z==="worked"?!0:!(Z==="turnActivity.live"||Z==="turnError.live"||Z==="agentReasoning.live")})),K=pe(()=>l.value),ne=pe(()=>Pe.value?"__new-thread__":u.value),Je=pe(()=>{var R,Z;return Pe.value?fe.value.trim():((Z=(R=o.value)==null?void 0:R.cwd)==null?void 0:Z.trim())??""}),it=pe(()=>{var R;return!Pe.value&&((R=o.value)==null?void 0:R.inProgress)===!0}),kt=pe(()=>{var rt,vt;const R=[],Z=new Set;for(const Ye of g.value.order){const Dt=Ye.trim();!Dt||Z.has(Dt)||(Z.add(Dt),R.push({value:Dt,label:g.value.labels[Dt]||Ln(Dt)}))}for(const Ye of r.value){const Dt=((vt=(rt=Ye.threads[0])==null?void 0:rt.cwd)==null?void 0:vt.trim())??"";!Dt||Z.has(Dt)||(Z.add(Dt),R.push({value:Dt,label:s.value[Ye.projectName]??Ye.projectName}))}const Ee=fe.value.trim();return Ee&&!Z.has(Ee)&&R.unshift({value:Ee,label:Ln(Ee)}),R}),xt=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;ir(()=>{window.addEventListener("keydown",ke),Bn(),xt==null||xt.addEventListener("change",Bn),Yr(),ks(),Cr(),sn()}),si(()=>{window.removeEventListener("keydown",ke),xt==null||xt.removeEventListener("change",Bn),B&&(clearTimeout(B),B=null),Rt()}),mt(H,R=>{const Z=R.trim();if(B&&(clearTimeout(B),B=null),!Z){D.value=null;return}B=setTimeout(()=>{u_(Z,1e3).then(Ee=>{H.value.trim()===Z&&(D.value=Ee.threadIds)}).catch(()=>{H.value.trim()===Z&&(D.value=null)})},220)});function ln(){z()}function Sr(){F.value=!F.value,F.value?tn(()=>{var R;return(R=x.value)==null?void 0:R.focus()}):H.value=""}function rn(){var R;H.value="",(R=x.value)==null||R.focus()}function Ne(R){R.key==="Escape"&&(F.value=!1,H.value="")}function Oe(R){R&&(Ge.name==="thread"&&Me.value===R||(et.push({name:"thread",params:{threadId:R}}),W.value&&Ae(!0)))}async function fn(R){R&&(u.value!==R&&(await j(R),await et.push({name:"thread",params:{threadId:R}})),await tn(),Ss())}function jt(R){de(R)}function Er(R){var rt,vt;const Z=r.value.find(Ye=>Ye.projectName===R),Ee=((vt=(rt=Z==null?void 0:Z.threads[0])==null?void 0:rt.cwd)==null?void 0:vt.trim())??"";Ee&&(fe.value=Ee),W.value&&Ae(!0),!Pe.value&&et.push({name:"home"})}function _n(R){var rt,vt;const Z=r.value.find(Ye=>Ye.projectName===R),Ee=((vt=(rt=Z==null?void 0:Z.threads[0])==null?void 0:rt.cwd)==null?void 0:vt.trim())??"";!Ee||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(Ee)}`,"_blank","noopener,noreferrer")}function kn(){var Z,Ee;const R=((Ee=(Z=o.value)==null?void 0:Z.cwd)==null?void 0:Ee.trim())??"";R&&(fe.value=R),W.value&&Ae(!0),!Pe.value&&et.push({name:"home"})}function _(R){It(R.projectName,R.displayName)}function S(R){ve(R.threadId,R.title)}function E(R){nt(R)}function q(R){Xe(R.projectName,R.toIndex)}function ge(R){oe(R.threadId,R.state)}function le(R){$e(R)}function Ae(R){A.value!==R&&(A.value=R,on(R))}function ke(R){R.defaultPrevented||!R.ctrlKey&&!R.metaKey||R.shiftKey||R.altKey||R.key.toLowerCase()==="b"&&(R.preventDefault(),Ae(!A.value))}function We(R){const Z=R.text;if(Pe.value){mi(Z,R.imageUrls,R.skills,R.fileAttachments);return}Ie(Z,R.imageUrls,R.skills,R.mode,R.fileAttachments)}function at(R){fe.value=R.trim()}async function lt(R){const Z=R.trim();if(!Z)return;const Ee=Mt(Z),rt=await Pt(),vt=Ee?Z:Kr(rt,Z);if(vt)try{const Ye=await a_(vt,{createIfMissing:!Ee,label:Ee?"":Z});Ye&&(fe.value=Ye,Ze(Ln(Ye)),Cr(),sn())}catch{}}async function Pt(){const R=Dn();if(R)return R;try{const Z=await $c();if(Z)return V.value=Z,Z}catch{}return""}function Mt(R){return R?R.startsWith("~/")||R.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(R):!1}async function sn(){const R=Dn();if(!R){G.value="New Project (1)";return}try{const Z=await l_(R);G.value=Z.name||"New Project (1)"}catch{G.value="New Project (1)"}}function Dn(){var Ee,rt;const R=fe.value.trim();if(R)return Gr(R);const Z=((rt=(Ee=kt.value[0])==null?void 0:Ee.value)==null?void 0:rt.trim())??"";return Z?Gr(Z):V.value.trim()}async function ks(){try{V.value=await $c()}catch{V.value=""}}async function Cr(){try{const R=await ga();g.value={order:[...R.order],labels:{...R.labels}}}catch{g.value={order:[],labels:{}}}}function Gr(R){const Z=R.trim().replace(/\/+$/,"");if(!Z)return"";const Ee=Z.lastIndexOf("/");return Ee<=0?"":Z.slice(0,Ee)}function Ln(R){const Z=R.trim().replace(/\/+$/,"");if(!Z)return"";const Ee=Z.lastIndexOf("/");return Ee<0?Z:Z.slice(Ee+1)}function Kr(R,Z){const Ee=R.trim().replace(/\/+$/,""),rt=Z.trim().replace(/^\/+/,"");return!Ee||!rt?"":`${Ee}/${rt}`}function Jr(R){Re(R)}function jn(R){Te(R)}function Ts(){ee()}function Is(R){ye(R.turnIndex)}function Ss(){if(Pe.value||Ve.value||typeof document>"u"||!o.value||U.value.length===0)return;const R=Ar(),Z=Rr(),Ee=new Blob([R],{type:"text/markdown;charset=utf-8"}),rt=URL.createObjectURL(Ee),vt=document.createElement("a");vt.href=rt,vt.download=Z,document.body.appendChild(vt),vt.click(),document.body.removeChild(vt),window.setTimeout(()=>URL.revokeObjectURL(rt),0)}function Ar(){var Ee,rt,vt;const R=[],Z=((rt=(Ee=o.value)==null?void 0:Ee.title)==null?void 0:rt.trim())||"Untitled thread";R.push(`# ${k(Z)}`),R.push(""),R.push(`- Exported: ${new Date().toISOString()}`),R.push(`- Thread ID: ${((vt=o.value)==null?void 0:vt.id)??""}`),R.push(""),R.push("---"),R.push("");for(const Ye of U.value){const Dt=Ye.role?Ye.role.toUpperCase():"MESSAGE";R.push(`## ${Dt}`),R.push("");const ho=Ye.text.trim();if(ho&&(R.push(ho),R.push("")),Ye.commandExecution&&(R.push("```text"),R.push(`command: ${Ye.commandExecution.command}`),R.push(`status: ${Ye.commandExecution.status}`),Ye.commandExecution.cwd&&R.push(`cwd: ${Ye.commandExecution.cwd}`),Ye.commandExecution.exitCode!==null&&R.push(`exitCode: ${Ye.commandExecution.exitCode}`),R.push(Ye.commandExecution.aggregatedOutput||"(no output)"),R.push("```"),R.push("")),Ye.fileAttachments&&Ye.fileAttachments.length>0){R.push("Attachments:");for(const Es of Ye.fileAttachments)R.push(`- ${Es.path}`);R.push("")}if(Ye.images&&Ye.images.length>0){R.push("Images:");for(const Es of Ye.images)R.push(`- ${Es}`);R.push("")}}return`${R.join(`
1442
+ `)}xt(d);const lr=_s(d);lr&&(Ln(we,lr),U(we,{label:"Running command",details:[((vl=lr.commandExecution)==null?void 0:vl.command)??""]}));const mi=Er(d);if(mi){const ze=(i.value[we]??[]).find(Tn=>Tn.id===mi.itemId);ze!=null&&ze.commandExecution&&Ln(we,{...ze,commandExecution:{...ze.commandExecution,aggregatedOutput:`${ze.commandExecution.aggregatedOutput}${mi.delta}`}})}const hl=Gr(d);if(hl&&Ln(we,hl),Jr(d)&&(Ge&&n.value&&Je(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),rn(we)),d.method==="turn/completed"){Ge=!1,rn(we),i.value[we]&&(i.value=Ut(i.value,we));const ze=jt(d);ze&&(Ve(ze,!1),U(ze,null),wt(ze),_e||(D(ze),on(ze)))}}function ks(d){const p=jt(d);p&&ft.add(p);const y=d.method;(y.startsWith("thread/")||y.startsWith("turn/")||y.startsWith("item/"))&&(Xe=!0),!(Qe!==null||typeof window>"u")&&(Qe=window.setTimeout(()=>{Qe=null,It()},Wi))}async function Ts(d){if(!Rt){Rt=!0;try{const p=await ma(),y=[];for(const C of p.order){const X=Gi(C);y.includes(X)||y.push(X)}if(y.length>0){const C=bo(y,d);Br(I.value,C)||(I.value=C,Zr(I.value))}if(Object.keys(p.labels).length>0){const C={...O.value};let X=!1;for(const[Q,_e]of Object.entries(p.labels)){const Pe=Gi(Q);C[Pe]!==_e&&(C[Pe]=_e,X=!0)}X&&(O.value=C,qi(C))}}catch{}}}async function Is(){if(!(Object.keys(ee.value).length>0))try{const d=await d_();Object.keys(d.titles).length>0&&(ee.value=d.titles)}catch{}}async function Cr(d,p,y){if(ee.value[d])return;const C=p.trim();if(!C)return;const X=C.length>300?C.slice(0,300):C;try{const Q=await f_(X,y);if(!Q||ee.value[d])return;ee.value={...ee.value,[d]:Q},he(),Di(d,Q)}catch{}}async function Ar(){var d;Tt.value||(te.value=!0);try{const[p]=await Promise.all([qb(),Is()]);await Ts(p);const y=bo(I.value,p);Br(I.value,y)||(I.value=y,Zr(I.value));const C=zi(p,I.value),X=RE(t.value,C,a.value);t.value=ko(t.value,X),a.value=Ht(a.value,new Set(mr(t.value).map(Pe=>Pe.id))),he(),Tt.value=!0;const Q=mr(e.value);Me(Q),Q.some(Pe=>Pe.id===n.value)||A(((d=Q[0])==null?void 0:d.id)??"")}finally{te.value=!1}}async function k(d,p={}){if(!d)return;const y=$.value[d]===!0,C=p.silent!==!0&&!y;C&&(je.value=!0);try{q.value[d]!==!0&&(await Ni(d),q.value={...q.value,[d]:!0});const{messages:X,inProgress:Q}=await zb(d),_e=r.value[d]??[],Pe=yE(_e,X,{preserveMissing:p.silent===!0});ot(d,Pe);const we=s.value[d]??[],st=wE(we,X);bt(d,st),Kr(d,X),$.value={...$.value,[d]:!0};const St=ne(d);St&&(Y.value={...Y.value,[d]:St}),Ve(d,Q),Ke(d)}finally{C&&(je.value=!1)}}async function x(){try{const d=t.value.flatMap(p=>p.threads.map(y=>y.cwd)).filter(Boolean);ye.value=await h_(d.length>0?[...new Set(d)]:void 0)}catch{}}async function M(){Te.value="";try{await Ar(),await Promise.all([be(),x()]),await k(n.value)}catch(d){Te.value=d instanceof Error?d.message:"Unknown application error"}}async function J(d){A(d);try{await k(d)}catch(p){Te.value=p instanceof Error?p.message:"Unknown application error"}}async function Ue(d){try{await Yb(d),await Ar(),n.value===d&&await k(n.value)}catch(p){Te.value=p instanceof Error?p.message:"Unknown application error"}}async function Ot(d,p){const y=p.trim();if(!(!d||!y))try{await Qb(d,y),ee.value={...ee.value,[d]:y},he(),Di(d,y)}catch(C){Te.value=C instanceof Error?C.message:"Unknown application error"}}async function Bt(d,p=[],y=[],C="steer",X=[]){const Q=n.value,_e=d.trim();if(!Q||!_e&&p.length===0&&X.length===0)return;const Pe=a.value[Q]===!0;if(Pe&&C==="queue"){const we=l.value[Q]??[],st=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[Q]:[...we,{id:st,text:_e,imageUrls:p,skills:y,fileAttachments:X}]};return}if(Pe){Ge=!0,Bn(Q,_e,p,y,X).catch(we=>{const st=we instanceof Error?we.message:"Unknown application error";K(Q,st),Te.value=st});return}Te.value="",Ge=!0,xe(Q,null),U(Q,{label:"Thinking",details:V(f.value,h.value)}),K(Q,null),Ve(Q,!0);try{await Bn(Q,_e,p,y,X)}catch(we){Ge=!1,Ve(Q,!1),U(Q,null);const st=we instanceof Error?we.message:"Unknown application error";throw K(Q,st),Te.value=st,we}}async function Yr(d,p,y=[],C=[],X=[]){const Q=d.trim(),_e=p.trim(),Pe=f.value.trim();if(!Q&&y.length===0&&X.length===0)return"";Be.value=!0,Te.value="";let we="";try{try{we=await Oc(_e||void 0,Pe||void 0)}catch(Un){if(Pe&&Pe!==un&&_o(Un))await F(),we=await Oc(_e||void 0,un);else throw Un}if(!we)return"";Se(we,_e,Q||"[Image]"),q.value={...q.value,[we]:!0},A(we),Ge=!0,xe(we,null),U(we,{label:"Thinking",details:V(f.value,h.value)}),K(we,null),Ve(we,!0);const st=we,St=_e||null,Qr=Q;return Bn(we,Q,y,C,X).catch(Un=>{Ge=!1,Ve(we,!1),U(we,null);const lr=Un instanceof Error?Un.message:"Unknown application error";K(we,lr),Te.value=lr}).finally(()=>{Be.value=!1}),Cr(st,Qr,St),we}catch(st){Ge=!1,we&&(Ve(we,!1),U(we,null));const St=st instanceof Error?st.message:"Unknown application error";throw we&&K(we,St),Te.value=St,Be.value=!1,st}}async function Bn(d,p,y=[],C=[],X=[]){const Q=f.value.trim(),_e=h.value,Pe=p.trim(),we=C.map(St=>({name:St.name,path:St.path})),st=X.map(St=>({...St}));P(d,{text:Pe,imageUrls:[...y],skills:we,fileAttachments:st,effort:_e,fallbackRetried:!1});try{q.value[d]!==!0&&await Ni(d);try{await $i(d,p,y,Q||void 0,_e||void 0,C.length>0?C:void 0,X)}catch(St){if(Q&&Q!==un&&_o(St))await F(),P(d,{text:Pe,imageUrls:[...y],skills:we,fileAttachments:st,effort:_e,fallbackRetried:!0}),await $i(d,p,y,un,_e||void 0,C.length>0?C:void 0,X);else throw St}q.value={...q.value,[d]:!0},ft.add(d),Xe=!0,await It()}catch(St){throw St}}async function on(d){const p=l.value[d];if(!p||p.length===0)return;const[y,...C]=p;l.value=C.length>0?{...l.value,[d]:C}:Ut(l.value,d),Be.value=!0,Te.value="",Ge=!0,xe(d,null),U(d,{label:"Thinking",details:V(f.value,h.value)}),K(d,null),Ve(d,!0);try{await Bn(d,y.text,y.imageUrls,y.skills,y.fileAttachments)}catch{Ve(d,!1),U(d,null)}finally{Be.value=!1}}async function ar(){const d=n.value;if(!d||a.value[d]!==!0)return;const p=ve.value[d];Ye.value=!0,Te.value="";try{await e_(d,p),Ve(d,!1),U(d,null),K(d,null),ve.value[d]&&(ve.value=Ut(ve.value,d)),ft.add(d),Xe=!0,await It()}catch(y){const C=y instanceof Error?y.message:"Failed to interrupt active turn";K(d,C),Te.value=C}finally{Ye.value=!1}}async function Rr(d){const p=n.value;if(!p||Re.value)return;const C=(r.value[p]??[]).reduce((Q,_e)=>typeof _e.turnIndex=="number"&&_e.turnIndex>Q?_e.turnIndex:Q,-1);if(C<0||d>C)return;const X=C-d+1;if(!(X<1)){Re.value=!0,Te.value="";try{const Q=await Mc(p,X);ot(p,Q),bt(p,[]),rn(p),i.value[p]&&(i.value=Ut(i.value,p)),xe(p,null),U(p,null),K(p,null),Xe=!0,await It()}catch(Q){Te.value=Q instanceof Error?Q.message:"Failed to rollback thread"}finally{Re.value=!1}}}function Ss(d,p){d.length===0||(O.value[d]??"")===p||(O.value={...O.value,[d]:p},qi(O.value))}function R(d){var X;if(d.length===0)return;const p=I.value.filter(Q=>Q!==d);if(Br(I.value,p)||(I.value=p,Zr(I.value)),t.value=t.value.filter(Q=>Q.projectName!==d),O.value[d]!==void 0){const Q={...O.value};delete Q[d],O.value=Q,qi(Q)}he();const y=mr(e.value);Me(y),y.some(Q=>Q.id===n.value)||A(((X=y[0])==null?void 0:X.id)??""),_t()}function Z(d,p){if(d.length===0||t.value.length===0)return;const y=t.value.map(we=>we.projectName),C=y.indexOf(d);if(C===-1)return;const X=Math.max(0,Math.min(p,y.length-1)),Q=gE(y,C,X);if(Q===y)return;const _e=bo(Q,t.value);I.value=_e,Zr(I.value);const Pe=zi(t.value,I.value);t.value=ko(t.value,Pe),he(),_t()}function Ee(d){const p=d.trim();if(!p)return;const y=[p,...I.value.filter(X=>X!==p)];if(Br(I.value,y))return;I.value=y,Zr(I.value);const C=zi(t.value,I.value);t.value=ko(t.value,C),he(),_t()}async function _t(){var d,p;try{const y=await ma(),C=new Map;for(const _e of y.order){const Pe=Gi(_e);C.has(Pe)||C.set(Pe,_e)}for(const _e of t.value){const Pe=((p=(d=_e.threads[0])==null?void 0:d.cwd)==null?void 0:p.trim())??"";Pe&&C.set(_e.projectName,Pe)}const X=[];for(const _e of I.value){const Pe=C.get(_e);Pe&&!X.includes(Pe)&&X.push(Pe)}for(const _e of y.order)X.includes(_e)||X.push(_e);const Q=y.active.filter(_e=>X.includes(_e));Q.length===0&&X.length>0&&Q.push(X[0]),await i_({order:X,labels:y.labels,active:Q})}catch{}}async function It(){if($e.value){typeof window<"u"&&Qe===null&&(Qe=window.setTimeout(()=>{Qe=null,It()},Wi));return}$e.value=!0;const d=Xe,p=new Set(ft);Xe=!1,ft.clear();try{d&&await Ar();const y=n.value;if(!y)return;const C=p.has(y),X=a.value[y]===!0,Q=ne(y),_e=Y.value[y]??"",Pe=Q.length>0&&Q!==_e;(C||X||Pe||d)&&await k(y,{silent:!0})}catch{}finally{$e.value=!1,(Xe||ft.size>0)&&typeof window<"u"&&Qe===null&&(Qe=window.setTimeout(()=>{Qe=null,It()},Wi))}}function Ze(){typeof window>"u"||nt||(Dt(),nt=Gb(d=>{jn(d),ks(d)}))}async function Dt(){try{const d=await Jb();for(const p of d){const y=kn(p);y&&_(y)}}catch{}}async function ho(d){try{await Kb(d.id,{result:d.result,error:d.error}),S(d.id)}catch(p){Te.value=p instanceof Error?p.message:"Failed to reply to server request"}}function Es(){nt&&(nt(),nt=null),Xe=!1,ft.clear(),et.clear(),Qe!==null&&typeof window<"u"&&(window.clearTimeout(Qe),Qe=null),Ge=!1,r.value={},s.value={},o.value={},i.value={},oe.value={},j.value={},de.value={},ve.value={},l.value={}}const Qf=pe(()=>{const d=n.value;return d?l.value[d]??[]:[]});function fl(d){const p=n.value;if(!p)return;const y=l.value[p];if(!y)return;const C=y.filter(X=>X.id!==d);l.value=C.length>0?{...l.value,[p]:C}:Ut(l.value,p)}function Xf(d){const p=n.value;if(!p)return;const y=l.value[p];if(!y)return;const C=y.find(X=>X.id===d);C&&(fl(d),Bt(C.text,C.imageUrls,C.skills,"steer",C.fileAttachments))}return{projectGroups:e,projectDisplayNameById:O,selectedThread:ie,selectedThreadScrollState:fe,selectedThreadServerRequests:De,selectedLiveOverlay:g,selectedThreadId:n,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:h,installedSkills:ye,messages:v,isLoadingThreads:te,isLoadingMessages:je,isSendingMessage:Be,isInterruptingTurn:Ye,error:Te,refreshAll:M,refreshSkills:x,selectThread:J,setThreadScrollState:Je,archiveThreadById:Ue,renameThreadById:Ot,sendMessageToSelectedThread:Bt,sendMessageToNewThread:Yr,interruptSelectedThreadTurn:ar,rollbackSelectedThread:Rr,isRollingBack:Re,selectedThreadQueuedMessages:Qf,removeQueuedMessage:fl,steerQueuedMessage:Xf,setSelectedModelId:H,setSelectedReasoningEffort:G,respondToPendingServerRequest:ho,renameProject:Ss,removeProject:R,reorderProject:Z,pinProjectToTop:Ee,startPolling:Ze,stopPolling:Es}}const OE={class:"sidebar-root"},NE={class:"sidebar-scrollable"},$E=["aria-pressed"],DE={key:1,class:"sidebar-search-bar"},LE={key:0,class:"sidebar-settings-area"},jE={key:0,class:"sidebar-settings-panel"},BE={class:"sidebar-settings-value"},UE={class:"sidebar-settings-value"},FE={class:"content-root"},HE={class:"content-body"},VE={key:1,class:"content-grid"},WE={class:"new-thread-empty"},qE={class:"worktree-init-status-title"},zE={class:"worktree-init-status-message"},GE={key:2,class:"content-grid"},KE={class:"content-thread"},JE={class:"composer-with-queue"},YE={class:"build-badge","aria-label":"Worktree name and version"},gu="codex-web-local.sidebar-collapsed.v1",vu="codex-web-local.send-with-enter.v1",yu="codex-web-local.in-progress-send-mode.v1",wu="codex-web-local.dark-mode.v1",QE=Lt({__name:"App",setup(e){const t="a65b",n="0.1.36",{projectGroups:r,projectDisplayNameById:s,selectedThread:o,selectedThreadScrollState:i,selectedThreadServerRequests:a,selectedLiveOverlay:l,selectedThreadId:u,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:h,installedSkills:b,messages:N,isLoadingThreads:I,isLoadingMessages:O,isInterruptingTurn:Y,refreshAll:$,refreshSkills:q,selectThread:j,setThreadScrollState:oe,archiveThreadById:de,renameThreadById:ve,sendMessageToSelectedThread:Ie,sendMessageToNewThread:re,interruptSelectedThreadTurn:ee,rollbackSelectedThread:ye,isRollingBack:te,selectedThreadQueuedMessages:je,removeQueuedMessage:Be,steerQueuedMessage:Ye,setSelectedModelId:Re,setSelectedReasoningEffort:Te,respondToPendingServerRequest:$e,renameProject:Tt,removeProject:nt,reorderProject:Qe,pinProjectToTop:Xe,startPolling:ft,stopPolling:Rt}=ME(),Ge=$g(),et=Ng(),{isMobile:W}=Kd(),me=L(!1),ie=L(!1),fe=L(""),De=L("local"),g=L({order:[],labels:{}}),v=L({phase:"idle",title:"",message:""}),A=L(Yr()),H=L(""),F=L(!1),P=L(null),D=L(null);let B=null;const G=L("New Project (1)"),V=L(""),be=L(!1),ae=L(k(vu,!0)),he=L(M()),Se=L(x()),Me=pe(()=>{const R=Ge.params.threadId;return typeof R=="string"?R:""}),Ke=pe(()=>{const R=new Set;for(const Z of r.value)for(const Ee of Z.threads)R.add(Ee.id);return R}),xe=pe(()=>Ge.name==="home"),Ve=pe(()=>Ge.name==="skills"),wt=pe(()=>{var R;return Ve.value?"Skills":xe.value?"New thread":((R=o.value)==null?void 0:R.title)??"Choose a thread"}),U=pe(()=>N.value.filter(R=>{const Z=on(R.messageType,R.role);return Z==="worked"?!0:!(Z==="turnActivity.live"||Z==="turnError.live"||Z==="agentReasoning.live")})),K=pe(()=>l.value),ne=pe(()=>xe.value?"__new-thread__":u.value),Je=pe(()=>{var R,Z;return xe.value?fe.value.trim():((Z=(R=o.value)==null?void 0:R.cwd)==null?void 0:Z.trim())??""}),ot=pe(()=>{var R;return!xe.value&&((R=o.value)==null?void 0:R.inProgress)===!0}),bt=pe(()=>{var _t,It;const R=[],Z=new Set;for(const Ze of g.value.order){const Dt=Ze.trim();!Dt||Z.has(Dt)||(Z.add(Dt),R.push({value:Dt,label:g.value.labels[Dt]||Ln(Dt)}))}for(const Ze of r.value){const Dt=((It=(_t=Ze.threads[0])==null?void 0:_t.cwd)==null?void 0:It.trim())??"";!Dt||Z.has(Dt)||(Z.add(Dt),R.push({value:Dt,label:s.value[Ze.projectName]??Ze.projectName}))}const Ee=fe.value.trim();return Ee&&!Z.has(Ee)&&R.unshift({value:Ee,label:Ln(Ee)}),R}),Pt=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;or(()=>{window.addEventListener("keydown",ke),Bt(),Pt==null||Pt.addEventListener("change",Bt),ar(),_s(),Er(),sn()}),si(()=>{window.removeEventListener("keydown",ke),Pt==null||Pt.removeEventListener("change",Bt),B&&(clearTimeout(B),B=null),Rt()}),pt(H,R=>{const Z=R.trim();if(B&&(clearTimeout(B),B=null),!Z){D.value=null;return}B=setTimeout(()=>{u_(Z,1e3).then(Ee=>{H.value.trim()===Z&&(D.value=Ee.threadIds)}).catch(()=>{H.value.trim()===Z&&(D.value=null)})},220)});function ln(){q()}function Ir(){F.value=!F.value,F.value?tn(()=>{var R;return(R=P.value)==null?void 0:R.focus()}):H.value=""}function rn(){var R;H.value="",(R=P.value)==null||R.focus()}function Ne(R){R.key==="Escape"&&(F.value=!1,H.value="")}function Oe(R){R&&(Ge.name==="thread"&&Me.value===R||(et.push({name:"thread",params:{threadId:R}}),W.value&&Ae(!0)))}async function fn(R){R&&(u.value!==R&&(await j(R),await et.push({name:"thread",params:{threadId:R}})),await tn(),Is())}function jt(R){de(R)}function Sr(R){var _t,It;const Z=r.value.find(Ze=>Ze.projectName===R),Ee=((It=(_t=Z==null?void 0:Z.threads[0])==null?void 0:_t.cwd)==null?void 0:It.trim())??"";Ee&&(fe.value=Ee),W.value&&Ae(!0),!xe.value&&et.push({name:"home"})}function _n(R){var _t,It;const Z=r.value.find(Ze=>Ze.projectName===R),Ee=((It=(_t=Z==null?void 0:Z.threads[0])==null?void 0:_t.cwd)==null?void 0:It.trim())??"";!Ee||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(Ee)}`,"_blank","noopener,noreferrer")}function kn(){var Z,Ee;const R=((Ee=(Z=o.value)==null?void 0:Z.cwd)==null?void 0:Ee.trim())??"";R&&(fe.value=R),W.value&&Ae(!0),!xe.value&&et.push({name:"home"})}function _(R){Tt(R.projectName,R.displayName)}function S(R){ve(R.threadId,R.title)}function E(R){nt(R)}function z(R){Qe(R.projectName,R.toIndex)}function ge(R){oe(R.threadId,R.state)}function le(R){$e(R)}function Ae(R){A.value!==R&&(A.value=R,Bn(R))}function ke(R){R.defaultPrevented||!R.ctrlKey&&!R.metaKey||R.shiftKey||R.altKey||R.key.toLowerCase()==="b"&&(R.preventDefault(),Ae(!A.value))}function We(R){const Z=R.text;if(xe.value){Ss(Z,R.imageUrls,R.skills,R.fileAttachments);return}Ie(Z,R.imageUrls,R.skills,R.mode,R.fileAttachments)}function it(R){fe.value=R.trim()}async function at(R){const Z=R.trim();if(!Z)return;const Ee=Mt(Z),_t=await xt(),It=Ee?Z:Kr(_t,Z);if(It)try{const Ze=await a_(It,{createIfMissing:!Ee,label:Ee?"":Z});Ze&&(fe.value=Ze,Xe(Ln(Ze)),Er(),sn())}catch{}}async function xt(){const R=Dn();if(R)return R;try{const Z=await Nc();if(Z)return V.value=Z,Z}catch{}return""}function Mt(R){return R?R.startsWith("~/")||R.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(R):!1}async function sn(){const R=Dn();if(!R){G.value="New Project (1)";return}try{const Z=await l_(R);G.value=Z.name||"New Project (1)"}catch{G.value="New Project (1)"}}function Dn(){var Ee,_t;const R=fe.value.trim();if(R)return Gr(R);const Z=((_t=(Ee=bt.value[0])==null?void 0:Ee.value)==null?void 0:_t.trim())??"";return Z?Gr(Z):V.value.trim()}async function _s(){try{V.value=await Nc()}catch{V.value=""}}async function Er(){try{const R=await ma();g.value={order:[...R.order],labels:{...R.labels}}}catch{g.value={order:[],labels:{}}}}function Gr(R){const Z=R.trim().replace(/\/+$/,"");if(!Z)return"";const Ee=Z.lastIndexOf("/");return Ee<=0?"":Z.slice(0,Ee)}function Ln(R){const Z=R.trim().replace(/\/+$/,"");if(!Z)return"";const Ee=Z.lastIndexOf("/");return Ee<0?Z:Z.slice(Ee+1)}function Kr(R,Z){const Ee=R.trim().replace(/\/+$/,""),_t=Z.trim().replace(/^\/+/,"");return!Ee||!_t?"":`${Ee}/${_t}`}function Jr(R){Re(R)}function jn(R){Te(R)}function ks(){ee()}function Ts(R){ye(R.turnIndex)}function Is(){if(xe.value||Ve.value||typeof document>"u"||!o.value||U.value.length===0)return;const R=Cr(),Z=new Blob([R],{type:"text/markdown;charset=utf-8"}),Ee=URL.createObjectURL(Z);window.open(Ee,"_blank","noopener,noreferrer")||(window.location.href=Ee),window.setTimeout(()=>URL.revokeObjectURL(Ee),6e4)}function Cr(){var Ee,_t,It;const R=[],Z=((_t=(Ee=o.value)==null?void 0:Ee.title)==null?void 0:_t.trim())||"Untitled thread";R.push(`# ${Ar(Z)}`),R.push(""),R.push(`- Exported: ${new Date().toISOString()}`),R.push(`- Thread ID: ${((It=o.value)==null?void 0:It.id)??""}`),R.push(""),R.push("---"),R.push("");for(const Ze of U.value){const Dt=Ze.role?Ze.role.toUpperCase():"MESSAGE";R.push(`## ${Dt}`),R.push("");const ho=Ze.text.trim();if(ho&&(R.push(ho),R.push("")),Ze.commandExecution&&(R.push("```text"),R.push(`command: ${Ze.commandExecution.command}`),R.push(`status: ${Ze.commandExecution.status}`),Ze.commandExecution.cwd&&R.push(`cwd: ${Ze.commandExecution.cwd}`),Ze.commandExecution.exitCode!==null&&R.push(`exitCode: ${Ze.commandExecution.exitCode}`),R.push(Ze.commandExecution.aggregatedOutput||"(no output)"),R.push("```"),R.push("")),Ze.fileAttachments&&Ze.fileAttachments.length>0){R.push("Attachments:");for(const Es of Ze.fileAttachments)R.push(`- ${Es.path}`);R.push("")}if(Ze.images&&Ze.images.length>0){R.push("Images:");for(const Es of Ze.images)R.push(`- ${Es}`);R.push("")}}return`${R.join(`
1443
1443
  `).trimEnd()}
1444
- `}function Rr(){var vt,Ye;const Ee=(((Ye=(vt=o.value)==null?void 0:vt.title)==null?void 0:Ye.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",rt=new Date().toISOString().replace(/[:.]/g,"-");return`${Ee}-${rt}.md`}function k(R){return R.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function P(R,Z){if(typeof window>"u")return Z;const Ee=window.localStorage.getItem(R);return Ee===null?Z:Ee==="1"}function M(){if(typeof window>"u")return"system";const R=window.localStorage.getItem(bu);return R==="light"||R==="dark"?R:"system"}function J(){return typeof window>"u"?"queue":window.localStorage.getItem(wu)==="steer"?"steer":"queue"}function Ue(){ae.value=!ae.value,window.localStorage.setItem(yu,ae.value?"1":"0")}function Ot(){he.value=he.value==="steer"?"queue":"steer",window.localStorage.setItem(wu,he.value)}function Zt(){const R=["system","light","dark"],Z=R.indexOf(Se.value);Se.value=R[(Z+1)%R.length],window.localStorage.setItem(bu,Se.value),Bn()}function Bn(){const R=document.documentElement;if(Se.value==="dark")R.classList.add("dark");else if(Se.value==="light")R.classList.remove("dark");else{const Z=window.matchMedia("(prefers-color-scheme: dark)").matches;R.classList.toggle("dark",Z)}}function Un(){return typeof window>"u"?!1:window.localStorage.getItem(vu)==="1"}function on(R){typeof window>"u"||window.localStorage.setItem(vu,R?"1":"0")}function lr(R,Z){const Ee=(R??"").trim();return Ee.length>0?Ee:Z.trim()||"message"}async function Yr(){await $(),ie.value=!0,await Qr(),ht()}async function Qr(){if(!me.value){me.value=!0;try{if(Ge.name==="home"||Ge.name==="skills"){u.value!==""&&await j("");return}if(Ge.name==="thread"){const R=Me.value;if(!R)return;if(!Ke.value.has(R)){await et.replace({name:"home"});return}u.value!==R&&await j(R);return}}finally{me.value=!1}}}mt(()=>[Ge.name,Me.value,I.value,Ke.value.has(Me.value),u.value],async()=>{ie.value&&await Qr()}),mt(()=>u.value,async R=>{if(ie.value&&!me.value&&!(Pe.value||Ve.value)){if(!R){Ge.name!=="home"&&await et.replace({name:"home"});return}Ge.name==="thread"&&Me.value===R||await et.replace({name:"thread",params:{threadId:R}})}}),mt(()=>kt.value,R=>{if(R.length===0){fe.value="";return}R.some(Ee=>Ee.value===fe.value)||(fe.value=R[0].value),sn()},{immediate:!0}),mt(()=>fe.value,()=>{v.value={phase:"idle",title:"",message:""},sn()}),mt(()=>De.value,R=>{R==="local"&&(v.value={phase:"idle",title:"",message:""})}),mt(()=>Ge.name,R=>{R!=="home"&&(v.value={phase:"idle",title:"",message:""})}),mt(()=>u.value,()=>{v.value={phase:"idle",title:"",message:""}}),mt(W,R=>{R&&!A.value&&Ae(!0)});async function mi(R,Z=[],Ee=[],rt=[]){try{v.value={phase:"idle",title:"",message:""};let vt=fe.value;if(De.value==="worktree"){v.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const Dt=await o_(fe.value);vt=Dt.cwd,fe.value=Dt.cwd,v.value={phase:"idle",title:"",message:""}}catch{v.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Ye=await re(R,vt,Z,Ee,rt);if(!Ye)return;await et.replace({name:"thread",params:{threadId:Ye}})}catch{}}return(R,Z)=>(w(),T(He,null,[Ce(Fg,{"is-sidebar-collapsed":A.value,onCloseSidebar:Z[6]||(Z[6]=Ee=>Ae(!0))},{sidebar:pt(()=>[m("section",OE,[m("div",NE,[A.value?se("",!0):(w(),yt(fu,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":A.value,"show-new-thread-button":!0,onToggleSidebar:Z[0]||(Z[0]=Ee=>Ae(!A.value)),onStartNewThread:kn},{default:pt(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":F.value,"aria-label":"Search threads",title:"Search threads",onClick:Sr},[Ce(ya,{class:"sidebar-search-toggle-icon"})],8,$E)]),_:1},8,["is-sidebar-collapsed"])),!A.value&&F.value?(w(),T("div",DE,[Ce(ya,{class:"sidebar-search-bar-icon"}),tr(m("input",{ref_key:"sidebarSearchInputRef",ref:x,"onUpdate:modelValue":Z[1]||(Z[1]=Ee=>H.value=Ee),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Ne},null,544),[[nr,H.value]]),H.value.length>0?(w(),T("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:rn},[Ce(Xa,{class:"sidebar-search-clear-icon"})])):se("",!0)])):se("",!0),A.value?se("",!0):(w(),T("button",{key:2,class:gt(["sidebar-skills-link",{"is-active":Ve.value}]),type:"button",onClick:Z[2]||(Z[2]=Ee=>{ue(et).push({name:"skills"}),ue(W)&&Ae(!0)})}," Skills Hub ",2)),A.value?se("",!0):(w(),yt(xy,{key:3,groups:ue(r),"project-display-name-by-id":ue(s),"selected-thread-id":ue(u),"is-loading":ue(I),"search-query":H.value,"search-matched-thread-ids":D.value,onSelect:Oe,onArchive:jt,onStartNewThread:Er,onRenameProject:_,onBrowseProjectFiles:_n,onRenameThread:S,onRemoveProject:E,onReorderProject:q,onExportThread:fn},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),A.value?se("",!0):(w(),T("div",LE,[Ce(Dd,{name:"settings-panel"},{default:pt(()=>[be.value?(w(),T("div",jE,[m("button",{class:"sidebar-settings-row",type:"button",onClick:Ue},[Z[7]||(Z[7]=m("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),m("span",{class:gt(["sidebar-settings-toggle",{"is-on":!ae.value}])},null,2)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Ot},[Z[8]||(Z[8]=m("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),m("span",BE,ce(he.value==="steer"?"Steer":"Queue"),1)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Zt},[Z[9]||(Z[9]=m("span",{class:"sidebar-settings-label"},"Appearance",-1)),m("span",UE,ce(Se.value==="system"?"System":Se.value==="dark"?"Dark":"Light"),1)])])):se("",!0)]),_:1}),m("button",{class:"sidebar-settings-button",type:"button",onClick:Z[3]||(Z[3]=Ee=>be.value=!be.value)},[Ce(lE,{class:"sidebar-settings-icon"}),Z[10]||(Z[10]=m("span",null,"Settings",-1))])]))])]),content:pt(()=>[m("section",FE,[Ce(Dy,{title:_t.value},{leading:pt(()=>[A.value||ue(W)?(w(),yt(fu,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":A.value,"show-new-thread-button":!0,onToggleSidebar:Z[4]||(Z[4]=Ee=>Ae(!A.value)),onStartNewThread:kn},null,8,["is-sidebar-collapsed"])):se("",!0)]),_:1},8,["title"]),m("section",HE,[Ve.value?(w(),yt(GS,{key:0,onSkillsChanged:ln})):Pe.value?(w(),T("div",VE,[m("div",WE,[Z[11]||(Z[11]=m("p",{class:"new-thread-hero"},"Let's build",-1)),Ce(va,{class:"new-thread-folder-dropdown","model-value":fe.value,options:kt.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":G.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":at,onAdd:lt},null,8,["model-value","options","default-add-value"]),Ce(Yk,{class:"new-thread-runtime-dropdown",modelValue:De.value,"onUpdate:modelValue":Z[5]||(Z[5]=Ee=>De.value=Ee)},null,8,["modelValue"]),v.value.phase!=="idle"?(w(),T("div",{key:0,class:gt(["worktree-init-status",{"is-running":v.value.phase==="running","is-error":v.value.phase==="error"}])},[m("strong",zE,ce(v.value.title),1),m("span",qE,ce(v.value.message),1)],2)):se("",!0)]),Ce(Dc,{"active-thread-id":ne.value,cwd:Je.value,models:ue(c),"selected-model":ue(f),"selected-reasoning-effort":ue(h),skills:ue(b),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":ae.value,"in-progress-submit-mode":he.value,onSubmit:We,"onUpdate:selectedModel":Jr,"onUpdate:selectedReasoningEffort":jn},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(w(),T("div",GE,[m("div",KE,[Ce(bb,{messages:U.value,"is-loading":ue(O),"active-thread-id":ne.value,cwd:Je.value,"scroll-state":ue(i),"live-overlay":K.value,"pending-requests":ue(a),"is-turn-in-progress":it.value,"is-rolling-back":ue(te),onUpdateScrollState:ge,onRespondServerRequest:le,onRollback:Is},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),m("div",JE,[Ce(Hk,{messages:ue(je),onSteer:ue(Qe),onDelete:ue(Be)},null,8,["messages","onSteer","onDelete"]),Ce(Dc,{"active-thread-id":ne.value,cwd:Je.value,models:ue(c),"selected-model":ue(f),"selected-reasoning-effort":ue(h),skills:ue(b),"is-turn-in-progress":it.value,"is-interrupting-turn":ue(Y),"has-queue-above":ue(je).length>0,"send-with-enter":ae.value,"in-progress-submit-mode":he.value,onSubmit:We,"onUpdate:selectedModel":Jr,"onUpdate:selectedReasoningEffort":jn,onInterrupt:Ts},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),m("div",YE," WT "+ce(ue(t))+" · v"+ce(ue(n)),1)],64))}}),XE=st(QE,[["__scopeId","data-v-f2b7f06b"]]),Ji={render:()=>null},ZE=Og({history:dg(),routes:[{path:"/",name:"home",component:Ji},{path:"/thread/:threadId",name:"thread",component:Ji},{path:"/skills",name:"skills",component:Ji},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Im(XE).use(ZE).mount("#app");
1444
+ `}function Ar(R){return R.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function k(R,Z){if(typeof window>"u")return Z;const Ee=window.localStorage.getItem(R);return Ee===null?Z:Ee==="1"}function x(){if(typeof window>"u")return"system";const R=window.localStorage.getItem(wu);return R==="light"||R==="dark"?R:"system"}function M(){return typeof window>"u"?"queue":window.localStorage.getItem(yu)==="steer"?"steer":"queue"}function J(){ae.value=!ae.value,window.localStorage.setItem(vu,ae.value?"1":"0")}function Ue(){he.value=he.value==="steer"?"queue":"steer",window.localStorage.setItem(yu,he.value)}function Ot(){const R=["system","light","dark"],Z=R.indexOf(Se.value);Se.value=R[(Z+1)%R.length],window.localStorage.setItem(wu,Se.value),Bt()}function Bt(){const R=document.documentElement;if(Se.value==="dark")R.classList.add("dark");else if(Se.value==="light")R.classList.remove("dark");else{const Z=window.matchMedia("(prefers-color-scheme: dark)").matches;R.classList.toggle("dark",Z)}}function Yr(){return typeof window>"u"?!1:window.localStorage.getItem(gu)==="1"}function Bn(R){typeof window>"u"||window.localStorage.setItem(gu,R?"1":"0")}function on(R,Z){const Ee=(R??"").trim();return Ee.length>0?Ee:Z.trim()||"message"}async function ar(){await $(),ie.value=!0,await Rr(),ft()}async function Rr(){if(!me.value){me.value=!0;try{if(Ge.name==="home"||Ge.name==="skills"){u.value!==""&&await j("");return}if(Ge.name==="thread"){const R=Me.value;if(!R)return;if(!Ke.value.has(R)){await et.replace({name:"home"});return}u.value!==R&&await j(R);return}}finally{me.value=!1}}}pt(()=>[Ge.name,Me.value,I.value,Ke.value.has(Me.value),u.value],async()=>{ie.value&&await Rr()}),pt(()=>u.value,async R=>{if(ie.value&&!me.value&&!(xe.value||Ve.value)){if(!R){Ge.name!=="home"&&await et.replace({name:"home"});return}Ge.name==="thread"&&Me.value===R||await et.replace({name:"thread",params:{threadId:R}})}}),pt(()=>bt.value,R=>{if(R.length===0){fe.value="";return}R.some(Ee=>Ee.value===fe.value)||(fe.value=R[0].value),sn()},{immediate:!0}),pt(()=>fe.value,()=>{v.value={phase:"idle",title:"",message:""},sn()}),pt(()=>De.value,R=>{R==="local"&&(v.value={phase:"idle",title:"",message:""})}),pt(()=>Ge.name,R=>{R!=="home"&&(v.value={phase:"idle",title:"",message:""})}),pt(()=>u.value,()=>{v.value={phase:"idle",title:"",message:""}}),pt(W,R=>{R&&!A.value&&Ae(!0)});async function Ss(R,Z=[],Ee=[],_t=[]){try{v.value={phase:"idle",title:"",message:""};let It=fe.value;if(De.value==="worktree"){v.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const Dt=await o_(fe.value);It=Dt.cwd,fe.value=Dt.cwd,v.value={phase:"idle",title:"",message:""}}catch{v.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Ze=await re(R,It,Z,Ee,_t);if(!Ze)return;await et.replace({name:"thread",params:{threadId:Ze}})}catch{}}return(R,Z)=>(w(),T(He,null,[Ce(Fg,{"is-sidebar-collapsed":A.value,onCloseSidebar:Z[6]||(Z[6]=Ee=>Ae(!0))},{sidebar:ht(()=>[m("section",OE,[m("div",NE,[A.value?se("",!0):(w(),gt(du,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":A.value,"show-new-thread-button":!0,onToggleSidebar:Z[0]||(Z[0]=Ee=>Ae(!A.value)),onStartNewThread:kn},{default:ht(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":F.value,"aria-label":"Search threads",title:"Search threads",onClick:Ir},[Ce(va,{class:"sidebar-search-toggle-icon"})],8,$E)]),_:1},8,["is-sidebar-collapsed"])),!A.value&&F.value?(w(),T("div",DE,[Ce(va,{class:"sidebar-search-bar-icon"}),er(m("input",{ref_key:"sidebarSearchInputRef",ref:P,"onUpdate:modelValue":Z[1]||(Z[1]=Ee=>H.value=Ee),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Ne},null,544),[[tr,H.value]]),H.value.length>0?(w(),T("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:rn},[Ce(Qa,{class:"sidebar-search-clear-icon"})])):se("",!0)])):se("",!0),A.value?se("",!0):(w(),T("button",{key:2,class:mt(["sidebar-skills-link",{"is-active":Ve.value}]),type:"button",onClick:Z[2]||(Z[2]=Ee=>{ue(et).push({name:"skills"}),ue(W)&&Ae(!0)})}," Skills Hub ",2)),A.value?se("",!0):(w(),gt(Py,{key:3,groups:ue(r),"project-display-name-by-id":ue(s),"selected-thread-id":ue(u),"is-loading":ue(I),"search-query":H.value,"search-matched-thread-ids":D.value,onSelect:Oe,onArchive:jt,onStartNewThread:Sr,onRenameProject:_,onBrowseProjectFiles:_n,onRenameThread:S,onRemoveProject:E,onReorderProject:z,onExportThread:fn},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),A.value?se("",!0):(w(),T("div",LE,[Ce($d,{name:"settings-panel"},{default:ht(()=>[be.value?(w(),T("div",jE,[m("button",{class:"sidebar-settings-row",type:"button",onClick:J},[Z[7]||(Z[7]=m("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),m("span",{class:mt(["sidebar-settings-toggle",{"is-on":!ae.value}])},null,2)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Ue},[Z[8]||(Z[8]=m("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),m("span",BE,ce(he.value==="steer"?"Steer":"Queue"),1)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Ot},[Z[9]||(Z[9]=m("span",{class:"sidebar-settings-label"},"Appearance",-1)),m("span",UE,ce(Se.value==="system"?"System":Se.value==="dark"?"Dark":"Light"),1)])])):se("",!0)]),_:1}),m("button",{class:"sidebar-settings-button",type:"button",onClick:Z[3]||(Z[3]=Ee=>be.value=!be.value)},[Ce(lE,{class:"sidebar-settings-icon"}),Z[10]||(Z[10]=m("span",null,"Settings",-1))])]))])]),content:ht(()=>[m("section",FE,[Ce(Dy,{title:wt.value},{leading:ht(()=>[A.value||ue(W)?(w(),gt(du,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":A.value,"show-new-thread-button":!0,onToggleSidebar:Z[4]||(Z[4]=Ee=>Ae(!A.value)),onStartNewThread:kn},null,8,["is-sidebar-collapsed"])):se("",!0)]),_:1},8,["title"]),m("section",HE,[Ve.value?(w(),gt(GS,{key:0,onSkillsChanged:ln})):xe.value?(w(),T("div",VE,[m("div",WE,[Z[11]||(Z[11]=m("p",{class:"new-thread-hero"},"Let's build",-1)),Ce(ga,{class:"new-thread-folder-dropdown","model-value":fe.value,options:bt.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":G.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":it,onAdd:at},null,8,["model-value","options","default-add-value"]),Ce(Yk,{class:"new-thread-runtime-dropdown",modelValue:De.value,"onUpdate:modelValue":Z[5]||(Z[5]=Ee=>De.value=Ee)},null,8,["modelValue"]),v.value.phase!=="idle"?(w(),T("div",{key:0,class:mt(["worktree-init-status",{"is-running":v.value.phase==="running","is-error":v.value.phase==="error"}])},[m("strong",qE,ce(v.value.title),1),m("span",zE,ce(v.value.message),1)],2)):se("",!0)]),Ce($c,{"active-thread-id":ne.value,cwd:Je.value,models:ue(c),"selected-model":ue(f),"selected-reasoning-effort":ue(h),skills:ue(b),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":ae.value,"in-progress-submit-mode":he.value,onSubmit:We,"onUpdate:selectedModel":Jr,"onUpdate:selectedReasoningEffort":jn},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(w(),T("div",GE,[m("div",KE,[Ce(bb,{messages:U.value,"is-loading":ue(O),"active-thread-id":ne.value,cwd:Je.value,"scroll-state":ue(i),"live-overlay":K.value,"pending-requests":ue(a),"is-turn-in-progress":ot.value,"is-rolling-back":ue(te),onUpdateScrollState:ge,onRespondServerRequest:le,onRollback:Ts},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),m("div",JE,[Ce(Hk,{messages:ue(je),onSteer:ue(Ye),onDelete:ue(Be)},null,8,["messages","onSteer","onDelete"]),Ce($c,{"active-thread-id":ne.value,cwd:Je.value,models:ue(c),"selected-model":ue(f),"selected-reasoning-effort":ue(h),skills:ue(b),"is-turn-in-progress":ot.value,"is-interrupting-turn":ue(Y),"has-queue-above":ue(je).length>0,"send-with-enter":ae.value,"in-progress-submit-mode":he.value,onSubmit:We,"onUpdate:selectedModel":Jr,"onUpdate:selectedReasoningEffort":jn,onInterrupt:ks},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),m("div",YE," WT "+ce(ue(t))+" · v"+ce(ue(n)),1)],64))}}),XE=rt(QE,[["__scopeId","data-v-744fca1a"]]),Ki={render:()=>null},ZE=Og({history:dg(),routes:[{path:"/",name:"home",component:Ki},{path:"/thread/:threadId",name:"thread",component:Ki},{path:"/skills",name:"skills",component:Ki},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Im(XE).use(ZE).mount("#app");