codexapp 0.1.40 → 0.1.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1425 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();/**
2
+ * @vue/shared v3.5.30
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
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 yt={},Zr=[],xn=()=>{},Ru=()=>!1,zo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ma=e=>e.startsWith("onUpdate:"),At=Object.assign,Oa=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},oh=Object.prototype.hasOwnProperty,ct=(e,t)=>oh.call(e,t),je=Array.isArray,es=e=>Zs(e)==="[object Map]",Pu=e=>Zs(e)==="[object Set]",_l=e=>Zs(e)==="[object Date]",qe=e=>typeof e=="function",kt=e=>typeof e=="string",gn=e=>typeof e=="symbol",ft=e=>e!==null&&typeof e=="object",xu=e=>(ft(e)||qe(e))&&qe(e.then)&&qe(e.catch),Mu=Object.prototype.toString,Zs=e=>Mu.call(e),ih=e=>Zs(e).slice(8,-1),Ou=e=>Zs(e)==="[object Object]",Na=e=>kt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ps=xa(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Go=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ah=/-\w/g,Xt=Go(e=>e.replace(ah,t=>t.slice(1).toUpperCase())),lh=/\B([A-Z])/g,_r=Go(e=>e.replace(lh,"-$1").toLowerCase()),Ko=Go(e=>e.charAt(0).toUpperCase()+e.slice(1)),wi=Go(e=>e?`on${Ko(e)}`:""),Cn=(e,t)=>!Object.is(e,t),wo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Nu=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},$a=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ch=e=>{const t=kt(e)?Number(e):NaN;return isNaN(t)?e:t};let kl;const Jo=()=>kl||(kl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ur(e){if(je(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=kt(r)?hh(r):Ur(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(kt(e)||ft(e))return e}const uh=/;(?![^(]*\))/g,dh=/:([^]+)/,fh=/\/\*[^]*?\*\//g;function hh(e){const t={};return e.replace(fh,"").split(uh).forEach(n=>{if(n){const r=n.split(dh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function st(e){let t="";if(kt(e))t=e;else if(je(e))for(let n=0;n<e.length;n++){const r=st(e[n]);r&&(t+=r+" ")}else if(ft(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const ph="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",mh=xa(ph);function $u(e){return!!e||e===""}function gh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Da(e[r],t[r]);return n}function Da(e,t){if(e===t)return!0;let n=_l(e),r=_l(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=gn(e),r=gn(t),n||r)return e===t;if(n=je(e),r=je(t),n||r)return n&&r?gh(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||!Da(e[i],t[i]))return!1}}return String(e)===String(t)}const Du=e=>!!(e&&e.__v_isRef===!0),oe=e=>kt(e)?e:e==null?"":je(e)||ft(e)&&(e.toString===Mu||!qe(e.toString))?Du(e)?oe(e.value):JSON.stringify(e,Lu,2):String(e),Lu=(e,t)=>Du(t)?Lu(e,t.value):es(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[bi(r,o)+" =>"]=s,n),{})}:Pu(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>bi(n))}:gn(t)?bi(t):ft(t)&&!je(t)&&!Ou(t)?String(t):t,bi=(e,t="")=>{var n;return gn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
+ * @vue/reactivity v3.5.30
7
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
+ * @license MIT
9
+ **/let tn;class vh{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=tn,!t&&tn&&(this.index=(tn.scopes||(tn.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=tn;try{return tn=this,t()}finally{tn=n}}}on(){++this._on===1&&(this.prevScope=tn,tn=this)}off(){this._on>0&&--this._on===0&&(tn=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 yh(){return tn}let wt;const _i=new WeakSet;class ju{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,tn&&tn.active&&tn.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,_i.has(this)&&(_i.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Uu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Tl(this),Fu(this);const t=wt,n=hn;wt=this,hn=!0;try{return this.fn()}finally{Hu(this),wt=t,hn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ba(t);this.deps=this.depsTail=void 0,Tl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?_i.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Zi(this)&&this.run()}get dirty(){return Zi(this)}}let Bu=0,xs,Ms;function Uu(e,t=!1){if(e.flags|=8,t){e.next=Ms,Ms=e;return}e.next=xs,xs=e}function La(){Bu++}function ja(){if(--Bu>0)return;if(Ms){let t=Ms;for(Ms=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;xs;){let t=xs;for(xs=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 Fu(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Hu(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Ba(r),wh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Zi(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Vu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Vu(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Bs)||(e.globalVersion=Bs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Zi(e))))return;e.flags|=2;const t=e.dep,n=wt,r=hn;wt=e,hn=!0;try{Fu(e);const s=e.fn(e._value);(t.version===0||Cn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{wt=n,hn=r,Hu(e),e.flags&=-3}}function Ba(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)Ba(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function wh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let hn=!0;const Wu=[];function Gn(){Wu.push(hn),hn=!1}function Kn(){const e=Wu.pop();hn=e===void 0?!0:e}function Tl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=wt;wt=void 0;try{t()}finally{wt=n}}}let Bs=0;class bh{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 Ua{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(!wt||!hn||wt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==wt)n=this.activeLink=new bh(wt,this),wt.deps?(n.prevDep=wt.depsTail,wt.depsTail.nextDep=n,wt.depsTail=n):wt.deps=wt.depsTail=n,qu(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=wt.depsTail,n.nextDep=void 0,wt.depsTail.nextDep=n,wt.depsTail=n,wt.deps===n&&(wt.deps=r)}return n}trigger(t){this.version++,Bs++,this.notify(t)}notify(t){La();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ja()}}}function qu(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)qu(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ea=new WeakMap,Lr=Symbol(""),ta=Symbol(""),Us=Symbol("");function Bt(e,t,n){if(hn&&wt){let r=ea.get(e);r||ea.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new Ua),s.map=r,s.key=n),s.track()}}function Hn(e,t,n,r,s,o){const i=ea.get(e);if(!i){Bs++;return}const a=l=>{l&&l.trigger()};if(La(),t==="clear")i.forEach(a);else{const l=je(e),u=l&&Na(n);if(l&&n==="length"){const c=Number(r);i.forEach((f,g)=>{(g==="length"||g===Us||!gn(g)&&g>=c)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(Us)),t){case"add":l?u&&a(i.get("length")):(a(i.get(Lr)),es(e)&&a(i.get(ta)));break;case"delete":l||(a(i.get(Lr)),es(e)&&a(i.get(ta)));break;case"set":es(e)&&a(i.get(Lr));break}}ja()}function Kr(e){const t=at(e);return t===e?t:(Bt(t,"iterate",Us),un(e)?t:t.map(vn))}function Yo(e){return Bt(e=at(e),"iterate",Us),e}function Sn(e,t){return Jn(e)?ls(jr(e)?vn(t):t):vn(t)}const _h={__proto__:null,[Symbol.iterator](){return ki(this,Symbol.iterator,e=>Sn(this,e))},concat(...e){return Kr(this).concat(...e.map(t=>je(t)?Kr(t):t))},entries(){return ki(this,"entries",e=>(e[1]=Sn(this,e[1]),e))},every(e,t){return Ln(this,"every",e,t,void 0,arguments)},filter(e,t){return Ln(this,"filter",e,t,n=>n.map(r=>Sn(this,r)),arguments)},find(e,t){return Ln(this,"find",e,t,n=>Sn(this,n),arguments)},findIndex(e,t){return Ln(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ln(this,"findLast",e,t,n=>Sn(this,n),arguments)},findLastIndex(e,t){return Ln(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ln(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ti(this,"includes",e)},indexOf(...e){return Ti(this,"indexOf",e)},join(e){return Kr(this).join(e)},lastIndexOf(...e){return Ti(this,"lastIndexOf",e)},map(e,t){return Ln(this,"map",e,t,void 0,arguments)},pop(){return Ts(this,"pop")},push(...e){return Ts(this,"push",e)},reduce(e,...t){return Il(this,"reduce",e,t)},reduceRight(e,...t){return Il(this,"reduceRight",e,t)},shift(){return Ts(this,"shift")},some(e,t){return Ln(this,"some",e,t,void 0,arguments)},splice(...e){return Ts(this,"splice",e)},toReversed(){return Kr(this).toReversed()},toSorted(e){return Kr(this).toSorted(e)},toSpliced(...e){return Kr(this).toSpliced(...e)},unshift(...e){return Ts(this,"unshift",e)},values(){return ki(this,"values",e=>Sn(this,e))}};function ki(e,t,n){const r=Yo(e),s=r[t]();return r!==e&&!un(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const kh=Array.prototype;function Ln(e,t,n,r,s,o){const i=Yo(e),a=i!==e&&!un(e),l=i[t];if(l!==kh[t]){const f=l.apply(e,o);return a?vn(f):f}let u=n;i!==e&&(a?u=function(f,g){return n.call(this,Sn(e,f),g,e)}:n.length>2&&(u=function(f,g){return n.call(this,f,g,e)}));const c=l.call(i,u,r);return a&&s?s(c):c}function Il(e,t,n,r){const s=Yo(e),o=s!==e&&!un(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(u,c,f){return a&&(a=!1,u=Sn(e,u)),n.call(this,u,Sn(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?Sn(e,l):l}function Ti(e,t,n){const r=at(e);Bt(r,"iterate",Us);const s=r[t](...n);return(s===-1||s===!1)&&Va(n[0])?(n[0]=at(n[0]),r[t](...n)):s}function Ts(e,t,n=[]){Gn(),La();const r=at(e)[t].apply(e,n);return ja(),Kn(),r}const Th=xa("__proto__,__v_isRef,__isVue"),zu=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(gn));function Ih(e){gn(e)||(e=String(e));const t=at(this);return Bt(t,"has",e),t.hasOwnProperty(e)}class Gu{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?Nh:Xu:o?Yu:Ju).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=je(t);if(!s){let l;if(i&&(l=_h[n]))return l;if(n==="hasOwnProperty")return Ih}const a=Reflect.get(t,n,Vt(t)?t:r);if((gn(n)?zu.has(n):Th(n))||(s||Bt(t,"get",n),o))return a;if(Vt(a)){const l=i&&Na(n)?a:a.value;return s&&ft(l)?ra(l):l}return ft(a)?s?ra(a):Xo(a):a}}class Ku extends Gu{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=je(t)&&Na(n);if(!this._isShallow){const u=Jn(o);if(!un(r)&&!Jn(r)&&(o=at(o),r=at(r)),!i&&Vt(o)&&!Vt(r))return u||(o.value=r),!0}const a=i?Number(n)<t.length:ct(t,n),l=Reflect.set(t,n,r,Vt(t)?t:s);return t===at(s)&&(a?Cn(r,o)&&Hn(t,"set",n,r):Hn(t,"add",n,r)),l}deleteProperty(t,n){const r=ct(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&Hn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!gn(n)||!zu.has(n))&&Bt(t,"has",n),r}ownKeys(t){return Bt(t,"iterate",je(t)?"length":Lr),Reflect.ownKeys(t)}}class Sh extends Gu{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Eh=new Ku,Ch=new Sh,Ah=new Ku(!0);const na=e=>e,co=e=>Reflect.getPrototypeOf(e);function Rh(e,t,n){return function(...r){const s=this.__v_raw,o=at(s),i=es(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=s[e](...r),c=n?na:t?ls:vn;return!t&&Bt(o,"iterate",l?ta:Lr),At(Object.create(u),{next(){const{value:f,done:g}=u.next();return g?{value:f,done:g}:{value:a?[c(f[0]),c(f[1])]:c(f),done:g}}})}}function uo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ph(e,t){const n={get(s){const o=this.__v_raw,i=at(o),a=at(s);e||(Cn(s,a)&&Bt(i,"get",s),Bt(i,"get",a));const{has:l}=co(i),u=t?na:e?ls:vn;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&&Bt(at(s),"iterate",Lr),s.size},has(s){const o=this.__v_raw,i=at(o),a=at(s);return e||(Cn(s,a)&&Bt(i,"has",s),Bt(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=at(a),u=t?na:e?ls:vn;return!e&&Bt(l,"iterate",Lr),a.forEach((c,f)=>s.call(o,u(c),u(f),i))}};return At(n,e?{add:uo("add"),set:uo("set"),delete:uo("delete"),clear:uo("clear")}:{add(s){const o=at(this),i=co(o),a=at(s),l=!t&&!un(s)&&!Jn(s)?a:s;return i.has.call(o,l)||Cn(s,l)&&i.has.call(o,s)||Cn(a,l)&&i.has.call(o,a)||(o.add(l),Hn(o,"add",l,l)),this},set(s,o){!t&&!un(o)&&!Jn(o)&&(o=at(o));const i=at(this),{has:a,get:l}=co(i);let u=a.call(i,s);u||(s=at(s),u=a.call(i,s));const c=l.call(i,s);return i.set(s,o),u?Cn(o,c)&&Hn(i,"set",s,o):Hn(i,"add",s,o),this},delete(s){const o=at(this),{has:i,get:a}=co(o);let l=i.call(o,s);l||(s=at(s),l=i.call(o,s)),a&&a.call(o,s);const u=o.delete(s);return l&&Hn(o,"delete",s,void 0),u},clear(){const s=at(this),o=s.size!==0,i=s.clear();return o&&Hn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Rh(s,e,t)}),n}function Fa(e,t){const n=Ph(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(ct(n,s)&&s in r?n:r,s,o)}const xh={get:Fa(!1,!1)},Mh={get:Fa(!1,!0)},Oh={get:Fa(!0,!1)};const Ju=new WeakMap,Yu=new WeakMap,Xu=new WeakMap,Nh=new WeakMap;function $h(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Dh(e){return e.__v_skip||!Object.isExtensible(e)?0:$h(ih(e))}function Xo(e){return Jn(e)?e:Ha(e,!1,Eh,xh,Ju)}function Qu(e){return Ha(e,!1,Ah,Mh,Yu)}function ra(e){return Ha(e,!0,Ch,Oh,Xu)}function Ha(e,t,n,r,s){if(!ft(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Dh(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 jr(e){return Jn(e)?jr(e.__v_raw):!!(e&&e.__v_isReactive)}function Jn(e){return!!(e&&e.__v_isReadonly)}function un(e){return!!(e&&e.__v_isShallow)}function Va(e){return e?!!e.__v_raw:!1}function at(e){const t=e&&e.__v_raw;return t?at(t):e}function Lh(e){return!ct(e,"__v_skip")&&Object.isExtensible(e)&&Nu(e,"__v_skip",!0),e}const vn=e=>ft(e)?Xo(e):e,ls=e=>ft(e)?ra(e):e;function Vt(e){return e?e.__v_isRef===!0:!1}function D(e){return Zu(e,!1)}function jh(e){return Zu(e,!0)}function Zu(e,t){return Vt(e)?e:new Bh(e,t)}class Bh{constructor(t,n){this.dep=new Ua,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:at(t),this._value=n?t:vn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||un(t)||Jn(t);t=r?t:at(t),Cn(t,n)&&(this._rawValue=t,this._value=r?t:vn(t),this.dep.trigger())}}function ye(e){return Vt(e)?e.value:e}const Uh={get:(e,t,n)=>t==="__v_raw"?e:ye(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Vt(s)&&!Vt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function ed(e){return jr(e)?e:new Proxy(e,Uh)}class Fh{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ua(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Bs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&wt!==this)return Uu(this,!0),!0}get value(){const t=this.dep.track();return Vu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Hh(e,t,n=!1){let r,s;return qe(e)?r=e:(r=e.get,s=e.set),new Fh(r,s,n)}const fo={},Ro=new WeakMap;let xr;function Vh(e,t=!1,n=xr){if(n){let r=Ro.get(n);r||Ro.set(n,r=[]),r.push(e)}}function Wh(e,t,n=yt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,u=K=>s?K:un(K)||s===!1||s===0?Vn(K,1):Vn(K);let c,f,g,I,j=!1,x=!1;if(Vt(e)?(f=()=>e.value,j=un(e)):jr(e)?(f=()=>u(e),j=!0):je(e)?(x=!0,j=e.some(K=>jr(K)||un(K)),f=()=>e.map(K=>{if(Vt(K))return K.value;if(jr(K))return u(K);if(qe(K))return l?l(K,2):K()})):qe(e)?t?f=l?()=>l(e,2):e:f=()=>{if(g){Gn();try{g()}finally{Kn()}}const K=xr;xr=c;try{return l?l(e,3,[I]):e(I)}finally{xr=K}}:f=xn,t&&s){const K=f,le=s===!0?1/0:s;f=()=>Vn(K(),le)}const B=yh(),ee=()=>{c.stop(),B&&B.active&&Oa(B.effects,c)};if(o&&t){const K=t;t=(...le)=>{K(...le),ee()}}let z=x?new Array(e.length).fill(fo):fo;const Q=K=>{if(!(!(c.flags&1)||!c.dirty&&!K))if(t){const le=c.run();if(s||j||(x?le.some((de,ve)=>Cn(de,z[ve])):Cn(le,z))){g&&g();const de=xr;xr=c;try{const ve=[le,z===fo?void 0:x&&z[0]===fo?[]:z,I];z=le,l?l(t,3,ve):t(...ve)}finally{xr=de}}}else c.run()};return a&&a(Q),c=new ju(f),c.scheduler=i?()=>i(Q,!1):Q,I=K=>Vh(K,!1,c),g=c.onStop=()=>{const K=Ro.get(c);if(K){if(l)l(K,4);else for(const le of K)le();Ro.delete(c)}},t?r?Q(!0):z=c.run():i?i(Q.bind(null,!0),!0):c.run(),ee.pause=c.pause.bind(c),ee.resume=c.resume.bind(c),ee.stop=ee,ee}function Vn(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--,Vt(e))Vn(e.value,t,n);else if(je(e))for(let r=0;r<e.length;r++)Vn(e[r],t,n);else if(Pu(e)||es(e))e.forEach(r=>{Vn(r,t,n)});else if(Ou(e)){for(const r in e)Vn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Vn(e[r],t,n)}return e}/**
10
+ * @vue/runtime-core v3.5.30
11
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
+ * @license MIT
13
+ **/function eo(e,t,n,r){try{return r?e(...r):e()}catch(s){Qo(s,t,n)}}function yn(e,t,n,r){if(qe(e)){const s=eo(e,t,n,r);return s&&xu(s)&&s.catch(o=>{Qo(o,t,n)}),s}if(je(e)){const s=[];for(let o=0;o<e.length;o++)s.push(yn(e[o],t,n,r));return s}}function Qo(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){Gn(),eo(o,null,10,[e,l,u]),Kn();return}}qh(e,n,s,r,i)}function qh(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Jt=[];let Tn=-1;const ts=[];let fr=null,Yr=0;const td=Promise.resolve();let Po=null;function Ht(e){const t=Po||td;return e?t.then(this?e.bind(this):e):t}function zh(e){let t=Tn+1,n=Jt.length;for(;t<n;){const r=t+n>>>1,s=Jt[r],o=Fs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function Wa(e){if(!(e.flags&1)){const t=Fs(e),n=Jt[Jt.length-1];!n||!(e.flags&2)&&t>=Fs(n)?Jt.push(e):Jt.splice(zh(t),0,e),e.flags|=1,nd()}}function nd(){Po||(Po=td.then(sd))}function Gh(e){je(e)?ts.push(...e):fr&&e.id===-1?fr.splice(Yr+1,0,e):e.flags&1||(ts.push(e),e.flags|=1),nd()}function Sl(e,t,n=Tn+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 rd(e){if(ts.length){const t=[...new Set(ts)].sort((n,r)=>Fs(n)-Fs(r));if(ts.length=0,fr){fr.push(...t);return}for(fr=t,Yr=0;Yr<fr.length;Yr++){const n=fr[Yr];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}fr=null,Yr=0}}const Fs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function sd(e){try{for(Tn=0;Tn<Jt.length;Tn++){const t=Jt[Tn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),eo(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Tn<Jt.length;Tn++){const t=Jt[Tn];t&&(t.flags&=-2)}Tn=-1,Jt.length=0,rd(),Po=null,(Jt.length||ts.length)&&sd()}}let Mt=null,od=null;function xo(e){const t=Mt;return Mt=e,od=e&&e.type.__scopeId||null,t}function gt(e,t=Mt,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&$o(-1);const o=xo(t);let i;try{i=e(...s)}finally{xo(o),r._d&&$o(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Yn(e,t){if(Mt===null)return e;const n=si(Mt),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&&Vn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Er(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&&(Gn(),yn(l,n,8,[e.el,a,e,t]),Kn())}}function bo(e,t){if(Ft){let n=Ft.provides;const r=Ft.parent&&Ft.parent.provides;r===n&&(n=Ft.provides=Object.create(r)),n[e]=t}}function pn(e,t,n=!1){const r=Ja();if(r||rs){let s=rs?rs._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 Kh=Symbol.for("v-scx"),Jh=()=>pn(Kh);function dt(e,t,n){return id(e,t,n)}function id(e,t,n=yt){const{immediate:r,deep:s,flush:o,once:i}=n,a=At({},n),l=t&&r||!t&&o!=="post";let u;if(zs){if(o==="sync"){const I=Jh();u=I.__watcherHandles||(I.__watcherHandles=[])}else if(!l){const I=()=>{};return I.stop=xn,I.resume=xn,I.pause=xn,I}}const c=Ft;a.call=(I,j,x)=>yn(I,c,j,x);let f=!1;o==="post"?a.scheduler=I=>{jt(I,c&&c.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(I,j)=>{j?I():Wa(I)}),a.augmentJob=I=>{t&&(I.flags|=4),f&&(I.flags|=2,c&&(I.id=c.uid,I.i=c))};const g=Wh(e,t,a);return zs&&(u?u.push(g):l&&g()),g}function Yh(e,t,n){const r=this.proxy,s=kt(e)?e.includes(".")?ad(r,e):()=>r[e]:e.bind(r,r);let o;qe(t)?o=t:(o=t.handler,n=t);const i=to(this),a=id(s,o.bind(r),n);return i(),a}function ad(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 ld=Symbol("_vte"),cd=e=>e.__isTeleport,Os=e=>e&&(e.disabled||e.disabled===""),El=e=>e&&(e.defer||e.defer===""),Cl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Al=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,sa=(e,t)=>{const n=e&&e.to;return kt(n)?t?t(n):null:n},ud={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,u){const{mc:c,pc:f,pbc:g,o:{insert:I,querySelector:j,createText:x,createComment:B}}=u,ee=Os(t.props);let{shapeFlag:z,children:Q,dynamicChildren:K}=t;if(e==null){const le=t.el=x(""),de=t.anchor=x("");I(le,n,r),I(de,n,r);const ve=(ae,te)=>{z&16&&c(Q,ae,te,s,o,i,a,l)},Te=()=>{const ae=t.target=sa(t.props,j),te=oa(ae,t,x,I);ae&&(i!=="svg"&&Cl(ae)?i="svg":i!=="mathml"&&Al(ae)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(ae),ee||(ve(ae,te),_o(t,!1)))};ee&&(ve(n,de),_o(t,!0)),El(t.props)?(t.el.__isMounted=!1,jt(()=>{Te(),delete t.el.__isMounted},o)):Te()}else{if(El(t.props)&&e.el.__isMounted===!1){jt(()=>{ud.process(e,t,n,r,s,o,i,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const le=t.anchor=e.anchor,de=t.target=e.target,ve=t.targetAnchor=e.targetAnchor,Te=Os(e.props),ae=Te?n:de,te=Te?le:ve;if(i==="svg"||Cl(de)?i="svg":(i==="mathml"||Al(de))&&(i="mathml"),K?(g(e.dynamicChildren,K,ae,s,o,i,a),Ga(e,t,!0)):l||f(e,t,ae,te,s,o,i,a,!1),ee)Te?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ho(t,n,le,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const re=t.target=sa(t.props,j);re&&ho(t,re,null,u,0)}else Te&&ho(t,de,ve,u,1);_o(t,ee)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:c,target:f,props:g}=e;if(f&&(s(u),s(c)),o&&s(l),i&16){const I=o||!Os(g);for(let j=0;j<a.length;j++){const x=a[j];r(x,t,n,I,!!x.dynamicChildren)}}},move:ho,hydrate:Xh};function ho(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||Os(c))&&l&16)for(let g=0;g<u.length;g++)s(u[g],t,n,2);f&&r(a,t,n)}function Xh(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:c}},f){function g(B,ee){let z=ee;for(;z;){if(z&&z.nodeType===8){if(z.data==="teleport start anchor")t.targetStart=z;else if(z.data==="teleport anchor"){t.targetAnchor=z,B._lpa=t.targetAnchor&&i(t.targetAnchor);break}}z=i(z)}}function I(B,ee){ee.anchor=f(i(B),ee,a(B),n,r,s,o)}const j=t.target=sa(t.props,l),x=Os(t.props);if(j){const B=j._lpa||j.firstChild;t.shapeFlag&16&&(x?(I(e,t),g(j,B),t.targetAnchor||oa(j,t,c,u,a(e)===j?e:null)):(t.anchor=i(e),g(j,B),t.targetAnchor||oa(j,t,c,u),f(B&&i(B),t,j,n,r,s,o))),_o(t,x)}else x&&t.shapeFlag&16&&(I(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Mo=ud;function _o(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 oa(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[ld]=i,e&&(r(o,e,s),r(i,e,s)),i}const In=Symbol("_leaveCb"),Is=Symbol("_enterCb");function Qh(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return tr(()=>{e.isMounted=!0}),nr(()=>{e.isUnmounting=!0}),e}const ln=[Function,Array],dd={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ln,onEnter:ln,onAfterEnter:ln,onEnterCancelled:ln,onBeforeLeave:ln,onLeave:ln,onAfterLeave:ln,onLeaveCancelled:ln,onBeforeAppear:ln,onAppear:ln,onAfterAppear:ln,onAppearCancelled:ln},fd=e=>{const t=e.subTree;return t.component?fd(t.component):t},Zh={name:"BaseTransition",props:dd,setup(e,{slots:t}){const n=Ja(),r=Qh();return()=>{const s=t.default&&md(t.default(),!0);if(!s||!s.length)return;const o=hd(s),i=at(e),{mode:a}=i;if(r.isLeaving)return Ii(o);const l=Rl(o);if(!l)return Ii(o);let u=ia(l,i,r,n,f=>u=f);l.type!==Ut&&Hs(l,u);let c=n.subTree&&Rl(n.subTree);if(c&&c.type!==Ut&&!Or(c,l)&&fd(n).type!==Ut){let f=ia(c,i,r,n);if(Hs(c,f),a==="out-in"&&l.type!==Ut)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},Ii(o);a==="in-out"&&l.type!==Ut?f.delayLeave=(g,I,j)=>{const x=pd(r,c);x[String(c.key)]=c,g[In]=()=>{I(),g[In]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{j(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function hd(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ut){t=n;break}}return t}const ep=Zh;function pd(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 ia(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:g,onLeave:I,onAfterLeave:j,onLeaveCancelled:x,onBeforeAppear:B,onAppear:ee,onAfterAppear:z,onAppearCancelled:Q}=t,K=String(e.key),le=pd(n,e),de=(ae,te)=>{ae&&yn(ae,r,9,te)},ve=(ae,te)=>{const re=te[1];de(ae,te),je(ae)?ae.every(X=>X.length<=1)&&re():ae.length<=1&&re()},Te={mode:i,persisted:a,beforeEnter(ae){let te=l;if(!n.isMounted)if(o)te=B||l;else return;ae[In]&&ae[In](!0);const re=le[K];re&&Or(e,re)&&re.el[In]&&re.el[In](),de(te,[ae])},enter(ae){if(le[K]===e)return;let te=u,re=c,X=f;if(!n.isMounted)if(o)te=ee||u,re=z||c,X=Q||f;else return;let Pe=!1;ae[Is]=$e=>{Pe||(Pe=!0,$e?de(X,[ae]):de(re,[ae]),Te.delayedLeave&&Te.delayedLeave(),ae[Is]=void 0)};const ke=ae[Is].bind(null,!1);te?ve(te,[ae,ke]):ke()},leave(ae,te){const re=String(e.key);if(ae[Is]&&ae[Is](!0),n.isUnmounting)return te();de(g,[ae]);let X=!1;ae[In]=ke=>{X||(X=!0,te(),ke?de(x,[ae]):de(j,[ae]),ae[In]=void 0,le[re]===e&&delete le[re])};const Pe=ae[In].bind(null,!1);le[re]=e,I?ve(I,[ae,Pe]):Pe()},clone(ae){const te=ia(ae,t,n,r,s);return s&&s(te),te}};return Te}function Ii(e){if(Zo(e))return e=br(e),e.children=null,e}function Rl(e){if(!Zo(e))return cd(e.type)&&e.children?hd(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 Hs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Hs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function md(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===Le?(i.patchFlag&128&&s++,r=r.concat(md(i.children,t,a))):(t||i.type!==Ut)&&r.push(a!=null?br(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Rt(e,t){return qe(e)?At({name:e.name},t,{setup:e}):e}function gd(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Pl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Oo=new WeakMap;function Ns(e,t,n,r,s=!1){if(je(e)){e.forEach((x,B)=>Ns(x,t&&(je(t)?t[B]:t),n,r,s));return}if(ns(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Ns(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?si(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,g=at(f),I=f===yt?Ru:x=>Pl(c,x)?!1:ct(g,x),j=(x,B)=>!(B&&Pl(c,B));if(u!=null&&u!==l){if(xl(t),kt(u))c[u]=null,I(u)&&(f[u]=null);else if(Vt(u)){const x=t;j(u,x.k)&&(u.value=null),x.k&&(c[x.k]=null)}}if(qe(l))eo(l,a,12,[i,c]);else{const x=kt(l),B=Vt(l);if(x||B){const ee=()=>{if(e.f){const z=x?I(l)?f[l]:c[l]:j()||!e.k?l.value:c[e.k];if(s)je(z)&&Oa(z,o);else if(je(z))z.includes(o)||z.push(o);else if(x)c[l]=[o],I(l)&&(f[l]=c[l]);else{const Q=[o];j(l,e.k)&&(l.value=Q),e.k&&(c[e.k]=Q)}}else x?(c[l]=i,I(l)&&(f[l]=i)):B&&(j(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const z=()=>{ee(),Oo.delete(e)};z.id=-1,Oo.set(e,z),jt(z,n)}else xl(e),ee()}}}function xl(e){const t=Oo.get(e);t&&(t.flags|=8,Oo.delete(e))}Jo().requestIdleCallback;Jo().cancelIdleCallback;const ns=e=>!!e.type.__asyncLoader,Zo=e=>e.type.__isKeepAlive;function tp(e,t){vd(e,"a",t)}function np(e,t){vd(e,"da",t)}function vd(e,t,n=Ft){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(ei(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Zo(s.parent.vnode)&&rp(r,t,n,s),s=s.parent}}function rp(e,t,n,r){const s=ei(t,e,r,!0);ti(()=>{Oa(r[t],s)},n)}function ei(e,t,n=Ft,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Gn();const a=to(n),l=yn(t,n,e,i);return a(),Kn(),l});return r?s.unshift(o):s.push(o),o}}const er=e=>(t,n=Ft)=>{(!zs||e==="sp")&&ei(e,(...r)=>t(...r),n)},sp=er("bm"),tr=er("m"),op=er("bu"),ip=er("u"),nr=er("bum"),ti=er("um"),ap=er("sp"),lp=er("rtg"),cp=er("rtc");function up(e,t=Ft){ei("ec",e,t)}const dp="components",yd=Symbol.for("v-ndc");function aa(e){return kt(e)?fp(dp,e,!1)||e:e||yd}function fp(e,t,n=!0,r=!1){const s=Mt||Ft;if(s){const o=s.type;{const a=Yp(o,!1);if(a&&(a===t||a===Xt(t)||a===Ko(Xt(t))))return o}const i=Ml(s[e]||o[e],t)||Ml(s.appContext[e],t);return!i&&r?o:i}}function Ml(e,t){return e&&(e[t]||e[Xt(t)]||e[Ko(Xt(t))])}function bt(e,t,n,r){let s;const o=n,i=je(e);if(i||kt(e)){const a=i&&jr(e);let l=!1,u=!1;a&&(l=!un(e),u=Jn(e),e=Yo(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(l?u?ls(vn(e[c])):vn(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 Pn(e,t,n={},r,s){if(Mt.ce||Mt.parent&&ns(Mt.parent)&&Mt.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),b(),ut(Le,null,[Se("slot",n,r)],u?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),b();const i=o&&wd(o(n)),a=n.key||i&&i.key,l=ut(Le,{key:(a&&!gn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function wd(e){return e.some(t=>Ws(t)?!(t.type===Ut||t.type===Le&&!wd(t.children)):!0)?e:null}const la=e=>e?Bd(e)?si(e):la(e.parent):null,$s=At(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=>la(e.parent),$root:e=>la(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>_d(e),$forceUpdate:e=>e.f||(e.f=()=>{Wa(e.update)}),$nextTick:e=>e.n||(e.n=Ht.bind(e.proxy)),$watch:e=>Yh.bind(e)}),Si=(e,t)=>e!==yt&&!e.__isScriptSetup&&ct(e,t),hp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:o,accessCache:i,type:a,appContext:l}=e;if(t[0]!=="$"){const g=i[t];if(g!==void 0)switch(g){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(Si(r,t))return i[t]=1,r[t];if(s!==yt&&ct(s,t))return i[t]=2,s[t];if(ct(o,t))return i[t]=3,o[t];if(n!==yt&&ct(n,t))return i[t]=4,n[t];ca&&(i[t]=0)}}const u=$s[t];let c,f;if(u)return t==="$attrs"&&Bt(e.attrs,"get",""),u(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==yt&&ct(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,ct(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return Si(s,t)?(s[t]=n,!0):r!==yt&&ct(r,t)?(r[t]=n,!0):ct(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]!=="$"&&ct(e,a)||Si(t,a)||ct(o,a)||ct(r,a)||ct($s,a)||ct(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ct(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function pp(){return mp().slots}function mp(e){const t=Ja();return t.setupContext||(t.setupContext=Fd(t))}function Ol(e){return je(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let ca=!0;function gp(e){const t=_d(e),n=e.proxy,r=e.ctx;ca=!1,t.beforeCreate&&Nl(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:u,created:c,beforeMount:f,mounted:g,beforeUpdate:I,updated:j,activated:x,deactivated:B,beforeDestroy:ee,beforeUnmount:z,destroyed:Q,unmounted:K,render:le,renderTracked:de,renderTriggered:ve,errorCaptured:Te,serverPrefetch:ae,expose:te,inheritAttrs:re,components:X,directives:Pe,filters:ke}=t;if(u&&vp(u,r,null),i)for(const we in i){const Ee=i[we];qe(Ee)&&(r[we]=Ee.bind(n))}if(s){const we=s.call(n,n);ft(we)&&(e.data=Xo(we))}if(ca=!0,o)for(const we in o){const Ee=o[we],ht=qe(Ee)?Ee.bind(n,n):qe(Ee.get)?Ee.get.bind(n,n):xn,Ge=!qe(Ee)&&qe(Ee.set)?Ee.set.bind(n):xn,He=ce({get:ht,set:Ge});Object.defineProperty(r,we,{enumerable:!0,configurable:!0,get:()=>He.value,set:Ke=>He.value=Ke})}if(a)for(const we in a)bd(a[we],r,n,we);if(l){const we=qe(l)?l.call(n):l;Reflect.ownKeys(we).forEach(Ee=>{bo(Ee,we[Ee])})}c&&Nl(c,e,"c");function Ae(we,Ee){je(Ee)?Ee.forEach(ht=>we(ht.bind(n))):Ee&&we(Ee.bind(n))}if(Ae(sp,f),Ae(tr,g),Ae(op,I),Ae(ip,j),Ae(tp,x),Ae(np,B),Ae(up,Te),Ae(cp,de),Ae(lp,ve),Ae(nr,z),Ae(ti,K),Ae(ap,ae),je(te))if(te.length){const we=e.exposed||(e.exposed={});te.forEach(Ee=>{Object.defineProperty(we,Ee,{get:()=>n[Ee],set:ht=>n[Ee]=ht,enumerable:!0})})}else e.exposed||(e.exposed={});le&&e.render===xn&&(e.render=le),re!=null&&(e.inheritAttrs=re),X&&(e.components=X),Pe&&(e.directives=Pe),ae&&gd(e)}function vp(e,t,n=xn){je(e)&&(e=ua(e));for(const r in e){const s=e[r];let o;ft(s)?"default"in s?o=pn(s.from||r,s.default,!0):o=pn(s.from||r):o=pn(s),Vt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function Nl(e,t,n){yn(je(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function bd(e,t,n,r){let s=r.includes(".")?ad(n,r):()=>n[r];if(kt(e)){const o=t[e];qe(o)&&dt(s,o)}else if(qe(e))dt(s,e.bind(n));else if(ft(e))if(je(e))e.forEach(o=>bd(o,t,n,r));else{const o=qe(e.handler)?e.handler.bind(n):t[e.handler];qe(o)&&dt(s,o,e)}}function _d(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=>No(l,u,i,!0)),No(l,t,i)),ft(t)&&o.set(t,l),l}function No(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&No(e,o,n,!0),s&&s.forEach(i=>No(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=yp[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const yp={data:$l,props:Dl,emits:Dl,methods:Rs,computed:Rs,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:Rs,directives:Rs,watch:bp,provide:$l,inject:wp};function $l(e,t){return t?e?function(){return At(qe(e)?e.call(this,this):e,qe(t)?t.call(this,this):t)}:t:e}function wp(e,t){return Rs(ua(e),ua(t))}function ua(e){if(je(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 Rs(e,t){return e?At(Object.create(null),e,t):t}function Dl(e,t){return e?je(e)&&je(t)?[...new Set([...e,...t])]:At(Object.create(null),Ol(e),Ol(t??{})):t}function bp(e,t){if(!e)return t;if(!t)return e;const n=At(Object.create(null),e);for(const r in t)n[r]=Gt(e[r],t[r]);return n}function kd(){return{app:null,config:{isNativeTag:Ru,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 _p=0;function kp(e,t){return function(r,s=null){qe(r)||(r=At({},r)),s!=null&&!ft(s)&&(s=null);const o=kd(),i=new WeakSet,a=[];let l=!1;const u=o.app={_uid:_p++,_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&&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,g){if(!l){const I=u._ceVNode||Se(r,s);return I.appContext=o,g===!0?g="svg":g===!1&&(g=void 0),e(I,c,g),l=!0,u._container=c,c.__vue_app__=u,si(I.component)}},onUnmount(c){a.push(c)},unmount(){l&&(yn(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=rs;rs=u;try{return c()}finally{rs=f}}};return u}}let rs=null;const Tp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Xt(t)}Modifiers`]||e[`${_r(t)}Modifiers`];function Ip(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||yt;let s=n;const o=t.startsWith("update:"),i=o&&Tp(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>kt(c)?c.trim():c)),i.number&&(s=n.map($a)));let a,l=r[a=wi(t)]||r[a=wi(Xt(t))];!l&&o&&(l=r[a=wi(_r(t))]),l&&yn(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,yn(u,e,6,s)}}const Sp=new WeakMap;function Td(e,t,n=!1){const r=n?Sp: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=Td(u,t,!0);c&&(a=!0,At(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):(je(o)?o.forEach(l=>i[l]=null):At(i,o),ft(e)&&r.set(e,i),i)}function ni(e,t){return!e||!zo(t)?!1:(t=t.slice(2).replace(/Once$/,""),ct(e,t[0].toLowerCase()+t.slice(1))||ct(e,_r(t))||ct(e,t))}function Ll(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:g,setupState:I,ctx:j,inheritAttrs:x}=e,B=xo(e);let ee,z;try{if(n.shapeFlag&4){const K=s||r,le=K;ee=En(u.call(le,K,c,f,I,g,j)),z=a}else{const K=t;ee=En(K.length>1?K(f,{attrs:a,slots:i,emit:l}):K(f,null)),z=t.props?a:Ep(a)}}catch(K){Ds.length=0,Qo(K,e,1),ee=Se(Ut)}let Q=ee;if(z&&x!==!1){const K=Object.keys(z),{shapeFlag:le}=Q;K.length&&le&7&&(o&&K.some(Ma)&&(z=Cp(z,o)),Q=br(Q,z,!1,!0))}return n.dirs&&(Q=br(Q,null,!1,!0),Q.dirs=Q.dirs?Q.dirs.concat(n.dirs):n.dirs),n.transition&&Hs(Q,n.transition),ee=Q,xo(B),ee}const Ep=e=>{let t;for(const n in e)(n==="class"||n==="style"||zo(n))&&((t||(t={}))[n]=e[n]);return t},Cp=(e,t)=>{const n={};for(const r in e)(!Ma(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Ap(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?jl(r,i,u):!!i;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const g=c[f];if(Id(i,r,g)&&!ni(u,g))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?jl(r,i,u):!0:!!i;return!1}function jl(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(Id(t,e,o)&&!ni(n,o))return!0}return!1}function Id(e,t,n){const r=e[n],s=t[n];return n==="style"&&ft(r)&&ft(s)?!Da(r,s):r!==s}function Rp({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 Sd={},Ed=()=>Object.create(Sd),Cd=e=>Object.getPrototypeOf(e)===Sd;function Pp(e,t,n,r=!1){const s={},o=Ed();e.propsDefaults=Object.create(null),Ad(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Qu(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function xp(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=at(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 g=c[f];if(ni(e.emitsOptions,g))continue;const I=t[g];if(l)if(ct(o,g))I!==o[g]&&(o[g]=I,u=!0);else{const j=Xt(g);s[j]=da(l,a,j,I,e,!1)}else I!==o[g]&&(o[g]=I,u=!0)}}}else{Ad(e,t,s,o)&&(u=!0);let c;for(const f in a)(!t||!ct(t,f)&&((c=_r(f))===f||!ct(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(s[f]=da(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!ct(t,f))&&(delete o[f],u=!0)}u&&Hn(e.attrs,"set","")}function Ad(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Ps(l))continue;const u=t[l];let c;s&&ct(s,c=Xt(l))?!o||!o.includes(c)?n[c]=u:(a||(a={}))[c]=u:ni(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(o){const l=at(n),u=a||yt;for(let c=0;c<o.length;c++){const f=o[c];n[f]=da(s,l,f,u[f],e,!ct(u,f))}}return i}function da(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=ct(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=to(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===_r(n))&&(r=!0))}return r}const Mp=new WeakMap;function Rd(e,t,n=!1){const r=n?Mp: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[g,I]=Rd(f,t,!0);At(i,g),I&&a.push(...I)};!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,Zr),Zr;if(je(o))for(let c=0;c<o.length;c++){const f=Xt(o[c]);Bl(f)&&(i[f]=yt)}else if(o)for(const c in o){const f=Xt(c);if(Bl(f)){const g=o[c],I=i[f]=je(g)||qe(g)?{type:g}:At({},g),j=I.type;let x=!1,B=!0;if(je(j))for(let ee=0;ee<j.length;++ee){const z=j[ee],Q=qe(z)&&z.name;if(Q==="Boolean"){x=!0;break}else Q==="String"&&(B=!1)}else x=qe(j)&&j.name==="Boolean";I[0]=x,I[1]=B,(x||ct(I,"default"))&&a.push(f)}}const u=[i,a];return ft(e)&&r.set(e,u),u}function Bl(e){return e[0]!=="$"&&!Ps(e)}const qa=e=>e==="_"||e==="_ctx"||e==="$stable",za=e=>je(e)?e.map(En):[En(e)],Op=(e,t,n)=>{if(t._n)return t;const r=gt((...s)=>za(t(...s)),n);return r._c=!1,r},Pd=(e,t,n)=>{const r=e._ctx;for(const s in e){if(qa(s))continue;const o=e[s];if(qe(o))t[s]=Op(s,o,r);else if(o!=null){const i=za(o);t[s]=()=>i}}},xd=(e,t)=>{const n=za(t);e.slots.default=()=>n},Md=(e,t,n)=>{for(const r in t)(n||!qa(r))&&(e[r]=t[r])},Np=(e,t,n)=>{const r=e.slots=Ed();if(e.vnode.shapeFlag&32){const s=t._;s?(Md(r,t,n),n&&Nu(r,"_",s,!0)):Pd(t,r)}else t&&xd(e,t)},$p=(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:Md(s,t,n):(o=!t.$stable,Pd(t,s)),i=t}else t&&(xd(e,t),i={default:1});if(o)for(const a in s)!qa(a)&&i[a]==null&&delete s[a]},jt=Up;function Dp(e){return Lp(e)}function Lp(e,t){const n=Jo();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:g,setScopeId:I=xn,insertStaticContent:j}=e,x=(v,_,M,H=null,U=null,O=null,L=void 0,q=null,Y=!!_.dynamicChildren)=>{if(v===_)return;v&&!Or(v,_)&&(H=W(v),Ke(v,U,O,!0),v=null),_.patchFlag===-2&&(Y=!1,_.dynamicChildren=null);const{type:G,ref:_e,shapeFlag:pe}=_;switch(G){case ri:B(v,_,M,H);break;case Ut:ee(v,_,M,H);break;case Ci:v==null&&z(_,M,H,L);break;case Le:X(v,_,M,H,U,O,L,q,Y);break;default:pe&1?le(v,_,M,H,U,O,L,q,Y):pe&6?Pe(v,_,M,H,U,O,L,q,Y):(pe&64||pe&128)&&G.process(v,_,M,H,U,O,L,q,Y,be)}_e!=null&&U?Ns(_e,v&&v.ref,O,_||v,!_):_e==null&&v&&v.ref!=null&&Ns(v.ref,null,O,v,!0)},B=(v,_,M,H)=>{if(v==null)r(_.el=a(_.children),M,H);else{const U=_.el=v.el;_.children!==v.children&&u(U,_.children)}},ee=(v,_,M,H)=>{v==null?r(_.el=l(_.children||""),M,H):_.el=v.el},z=(v,_,M,H)=>{[v.el,v.anchor]=j(v.children,_,M,H,v.el,v.anchor)},Q=({el:v,anchor:_},M,H)=>{let U;for(;v&&v!==_;)U=g(v),r(v,M,H),v=U;r(_,M,H)},K=({el:v,anchor:_})=>{let M;for(;v&&v!==_;)M=g(v),s(v),v=M;s(_)},le=(v,_,M,H,U,O,L,q,Y)=>{if(_.type==="svg"?L="svg":_.type==="math"&&(L="mathml"),v==null)de(_,M,H,U,O,L,q,Y);else{const G=v.el&&v.el._isVueCE?v.el:null;try{G&&G._beginPatch(),ae(v,_,U,O,L,q,Y)}finally{G&&G._endPatch()}}},de=(v,_,M,H,U,O,L,q)=>{let Y,G;const{props:_e,shapeFlag:pe,transition:me,dirs:Ie}=v;if(Y=v.el=i(v.type,O,_e&&_e.is,_e),pe&8?c(Y,v.children):pe&16&&Te(v.children,Y,null,H,U,Ei(v,O),L,q),Ie&&Er(v,null,H,"created"),ve(Y,v,v.scopeId,L,H),_e){for(const Ve in _e)Ve!=="value"&&!Ps(Ve)&&o(Y,Ve,null,_e[Ve],O,H);"value"in _e&&o(Y,"value",null,_e.value,O),(G=_e.onVnodeBeforeMount)&&kn(G,H,v)}Ie&&Er(v,null,H,"beforeMount");const Oe=jp(U,me);Oe&&me.beforeEnter(Y),r(Y,_,M),((G=_e&&_e.onVnodeMounted)||Oe||Ie)&&jt(()=>{G&&kn(G,H,v),Oe&&me.enter(Y),Ie&&Er(v,null,H,"mounted")},U)},ve=(v,_,M,H,U)=>{if(M&&I(v,M),H)for(let O=0;O<H.length;O++)I(v,H[O]);if(U){let O=U.subTree;if(_===O||$d(O.type)&&(O.ssContent===_||O.ssFallback===_)){const L=U.vnode;ve(v,L,L.scopeId,L.slotScopeIds,U.parent)}}},Te=(v,_,M,H,U,O,L,q,Y=0)=>{for(let G=Y;G<v.length;G++){const _e=v[G]=q?Fn(v[G]):En(v[G]);x(null,_e,_,M,H,U,O,L,q)}},ae=(v,_,M,H,U,O,L)=>{const q=_.el=v.el;let{patchFlag:Y,dynamicChildren:G,dirs:_e}=_;Y|=v.patchFlag&16;const pe=v.props||yt,me=_.props||yt;let Ie;if(M&&Cr(M,!1),(Ie=me.onVnodeBeforeUpdate)&&kn(Ie,M,_,v),_e&&Er(_,v,M,"beforeUpdate"),M&&Cr(M,!0),(pe.innerHTML&&me.innerHTML==null||pe.textContent&&me.textContent==null)&&c(q,""),G?te(v.dynamicChildren,G,q,M,H,Ei(_,U),O):L||Ee(v,_,q,null,M,H,Ei(_,U),O,!1),Y>0){if(Y&16)re(q,pe,me,M,U);else if(Y&2&&pe.class!==me.class&&o(q,"class",null,me.class,U),Y&4&&o(q,"style",pe.style,me.style,U),Y&8){const Oe=_.dynamicProps;for(let Ve=0;Ve<Oe.length;Ve++){const De=Oe[Ve],Xe=pe[De],ot=me[De];(ot!==Xe||De==="value")&&o(q,De,Xe,ot,U,M)}}Y&1&&v.children!==_.children&&c(q,_.children)}else!L&&G==null&&re(q,pe,me,M,U);((Ie=me.onVnodeUpdated)||_e)&&jt(()=>{Ie&&kn(Ie,M,_,v),_e&&Er(_,v,M,"updated")},H)},te=(v,_,M,H,U,O,L)=>{for(let q=0;q<_.length;q++){const Y=v[q],G=_[q],_e=Y.el&&(Y.type===Le||!Or(Y,G)||Y.shapeFlag&198)?f(Y.el):M;x(Y,G,_e,null,H,U,O,L,!0)}},re=(v,_,M,H,U)=>{if(_!==M){if(_!==yt)for(const O in _)!Ps(O)&&!(O in M)&&o(v,O,_[O],null,U,H);for(const O in M){if(Ps(O))continue;const L=M[O],q=_[O];L!==q&&O!=="value"&&o(v,O,q,L,U,H)}"value"in M&&o(v,"value",_.value,M.value,U)}},X=(v,_,M,H,U,O,L,q,Y)=>{const G=_.el=v?v.el:a(""),_e=_.anchor=v?v.anchor:a("");let{patchFlag:pe,dynamicChildren:me,slotScopeIds:Ie}=_;Ie&&(q=q?q.concat(Ie):Ie),v==null?(r(G,M,H),r(_e,M,H),Te(_.children||[],M,_e,U,O,L,q,Y)):pe>0&&pe&64&&me&&v.dynamicChildren&&v.dynamicChildren.length===me.length?(te(v.dynamicChildren,me,M,U,O,L,q),(_.key!=null||U&&_===U.subTree)&&Ga(v,_,!0)):Ee(v,_,M,_e,U,O,L,q,Y)},Pe=(v,_,M,H,U,O,L,q,Y)=>{_.slotScopeIds=q,v==null?_.shapeFlag&512?U.ctx.activate(_,M,H,L,Y):ke(_,M,H,U,O,L,Y):$e(v,_,Y)},ke=(v,_,M,H,U,O,L)=>{const q=v.component=zp(v,H,U);if(Zo(v)&&(q.ctx.renderer=be),Gp(q,!1,L),q.asyncDep){if(U&&U.registerDep(q,Ae,L),!v.el){const Y=q.subTree=Se(Ut);ee(null,Y,_,M),v.placeholder=Y.el}}else Ae(q,v,_,M,U,O,L)},$e=(v,_,M)=>{const H=_.component=v.component;if(Ap(v,_,M))if(H.asyncDep&&!H.asyncResolved){we(H,_,M);return}else H.next=_,H.update();else _.el=v.el,H.vnode=_},Ae=(v,_,M,H,U,O,L)=>{const q=()=>{if(v.isMounted){let{next:pe,bu:me,u:Ie,parent:Oe,vnode:Ve}=v;{const et=Od(v);if(et){pe&&(pe.el=Ve.el,we(v,pe,L)),et.asyncDep.then(()=>{jt(()=>{v.isUnmounted||G()},U)});return}}let De=pe,Xe;Cr(v,!1),pe?(pe.el=Ve.el,we(v,pe,L)):pe=Ve,me&&wo(me),(Xe=pe.props&&pe.props.onVnodeBeforeUpdate)&&kn(Xe,Oe,pe,Ve),Cr(v,!0);const ot=Ll(v),We=v.subTree;v.subTree=ot,x(We,ot,f(We.el),W(We),v,U,O),pe.el=ot.el,De===null&&Rp(v,ot.el),Ie&&jt(Ie,U),(Xe=pe.props&&pe.props.onVnodeUpdated)&&jt(()=>kn(Xe,Oe,pe,Ve),U)}else{let pe;const{el:me,props:Ie}=_,{bm:Oe,m:Ve,parent:De,root:Xe,type:ot}=v,We=ns(_);Cr(v,!1),Oe&&wo(Oe),!We&&(pe=Ie&&Ie.onVnodeBeforeMount)&&kn(pe,De,_),Cr(v,!0);{Xe.ce&&Xe.ce._hasShadowRoot()&&Xe.ce._injectChildStyle(ot,v.parent?v.parent.type:void 0);const et=v.subTree=Ll(v);x(null,et,M,H,v,U,O),_.el=et.el}if(Ve&&jt(Ve,U),!We&&(pe=Ie&&Ie.onVnodeMounted)){const et=_;jt(()=>kn(pe,De,et),U)}(_.shapeFlag&256||De&&ns(De.vnode)&&De.vnode.shapeFlag&256)&&v.a&&jt(v.a,U),v.isMounted=!0,_=M=H=null}};v.scope.on();const Y=v.effect=new ju(q);v.scope.off();const G=v.update=Y.run.bind(Y),_e=v.job=Y.runIfDirty.bind(Y);_e.i=v,_e.id=v.uid,Y.scheduler=()=>Wa(_e),Cr(v,!0),G()},we=(v,_,M)=>{_.component=v;const H=v.vnode.props;v.vnode=_,v.next=null,xp(v,_.props,H,M),$p(v,_.children,M),Gn(),Sl(v),Kn()},Ee=(v,_,M,H,U,O,L,q,Y=!1)=>{const G=v&&v.children,_e=v?v.shapeFlag:0,pe=_.children,{patchFlag:me,shapeFlag:Ie}=_;if(me>0){if(me&128){Ge(G,pe,M,H,U,O,L,q,Y);return}else if(me&256){ht(G,pe,M,H,U,O,L,q,Y);return}}Ie&8?(_e&16&&Be(G,U,O),pe!==G&&c(M,pe)):_e&16?Ie&16?Ge(G,pe,M,H,U,O,L,q,Y):Be(G,U,O,!0):(_e&8&&c(M,""),Ie&16&&Te(pe,M,H,U,O,L,q,Y))},ht=(v,_,M,H,U,O,L,q,Y)=>{v=v||Zr,_=_||Zr;const G=v.length,_e=_.length,pe=Math.min(G,_e);let me;for(me=0;me<pe;me++){const Ie=_[me]=Y?Fn(_[me]):En(_[me]);x(v[me],Ie,M,null,U,O,L,q,Y)}G>_e?Be(v,U,O,!0,!1,pe):Te(_,M,H,U,O,L,q,Y,pe)},Ge=(v,_,M,H,U,O,L,q,Y)=>{let G=0;const _e=_.length;let pe=v.length-1,me=_e-1;for(;G<=pe&&G<=me;){const Ie=v[G],Oe=_[G]=Y?Fn(_[G]):En(_[G]);if(Or(Ie,Oe))x(Ie,Oe,M,null,U,O,L,q,Y);else break;G++}for(;G<=pe&&G<=me;){const Ie=v[pe],Oe=_[me]=Y?Fn(_[me]):En(_[me]);if(Or(Ie,Oe))x(Ie,Oe,M,null,U,O,L,q,Y);else break;pe--,me--}if(G>pe){if(G<=me){const Ie=me+1,Oe=Ie<_e?_[Ie].el:H;for(;G<=me;)x(null,_[G]=Y?Fn(_[G]):En(_[G]),M,Oe,U,O,L,q,Y),G++}}else if(G>me)for(;G<=pe;)Ke(v[G],U,O,!0),G++;else{const Ie=G,Oe=G,Ve=new Map;for(G=Oe;G<=me;G++){const tt=_[G]=Y?Fn(_[G]):En(_[G]);tt.key!=null&&Ve.set(tt.key,G)}let De,Xe=0;const ot=me-Oe+1;let We=!1,et=0;const St=new Array(ot);for(G=0;G<ot;G++)St[G]=0;for(G=Ie;G<=pe;G++){const tt=v[G];if(Xe>=ot){Ke(tt,U,O,!0);continue}let mt;if(tt.key!=null)mt=Ve.get(tt.key);else for(De=Oe;De<=me;De++)if(St[De-Oe]===0&&Or(tt,_[De])){mt=De;break}mt===void 0?Ke(tt,U,O,!0):(St[mt-Oe]=G+1,mt>=et?et=mt:We=!0,x(tt,_[mt],M,null,U,O,L,q,Y),Xe++)}const Ot=We?Bp(St):Zr;for(De=Ot.length-1,G=ot-1;G>=0;G--){const tt=Oe+G,mt=_[tt],Wt=_[tt+1],Pt=tt+1<_e?Wt.el||Nd(Wt):H;St[G]===0?x(null,mt,M,Pt,U,O,L,q,Y):We&&(De<0||G!==Ot[De]?He(mt,M,Pt,2):De--)}}},He=(v,_,M,H,U=null)=>{const{el:O,type:L,transition:q,children:Y,shapeFlag:G}=v;if(G&6){He(v.component.subTree,_,M,H);return}if(G&128){v.suspense.move(_,M,H);return}if(G&64){L.move(v,_,M,be);return}if(L===Le){r(O,_,M);for(let pe=0;pe<Y.length;pe++)He(Y[pe],_,M,H);r(v.anchor,_,M);return}if(L===Ci){Q(v,_,M);return}if(H!==2&&G&1&&q)if(H===0)q.beforeEnter(O),r(O,_,M),jt(()=>q.enter(O),U);else{const{leave:pe,delayLeave:me,afterLeave:Ie}=q,Oe=()=>{v.ctx.isUnmounted?s(O):r(O,_,M)},Ve=()=>{O._isLeaving&&O[In](!0),pe(O,()=>{Oe(),Ie&&Ie()})};me?me(O,Oe,Ve):Ve()}else r(O,_,M)},Ke=(v,_,M,H=!1,U=!1)=>{const{type:O,props:L,ref:q,children:Y,dynamicChildren:G,shapeFlag:_e,patchFlag:pe,dirs:me,cacheIndex:Ie}=v;if(pe===-2&&(U=!1),q!=null&&(Gn(),Ns(q,null,M,v,!0),Kn()),Ie!=null&&(_.renderCache[Ie]=void 0),_e&256){_.ctx.deactivate(v);return}const Oe=_e&1&&me,Ve=!ns(v);let De;if(Ve&&(De=L&&L.onVnodeBeforeUnmount)&&kn(De,_,v),_e&6)Ne(v.component,M,H);else{if(_e&128){v.suspense.unmount(M,H);return}Oe&&Er(v,null,_,"beforeUnmount"),_e&64?v.type.remove(v,_,M,be,H):G&&!G.hasOnce&&(O!==Le||pe>0&&pe&64)?Be(G,_,M,!1,!0):(O===Le&&pe&384||!U&&_e&16)&&Be(Y,_,M),H&&Ze(v)}(Ve&&(De=L&&L.onVnodeUnmounted)||Oe)&&jt(()=>{De&&kn(De,_,v),Oe&&Er(v,null,_,"unmounted")},M)},Ze=v=>{const{type:_,el:M,anchor:H,transition:U}=v;if(_===Le){pt(M,H);return}if(_===Ci){K(v);return}const O=()=>{s(M),U&&!U.persisted&&U.afterLeave&&U.afterLeave()};if(v.shapeFlag&1&&U&&!U.persisted){const{leave:L,delayLeave:q}=U,Y=()=>L(M,O);q?q(v.el,O,Y):Y()}else O()},pt=(v,_)=>{let M;for(;v!==_;)M=g(v),s(v),v=M;s(_)},Ne=(v,_,M)=>{const{bum:H,scope:U,job:O,subTree:L,um:q,m:Y,a:G}=v;Ul(Y),Ul(G),H&&wo(H),U.stop(),O&&(O.flags|=8,Ke(L,v,_,M)),q&&jt(q,_),jt(()=>{v.isUnmounted=!0},_)},Be=(v,_,M,H=!1,U=!1,O=0)=>{for(let L=O;L<v.length;L++)Ke(v[L],_,M,H,U)},W=v=>{if(v.shapeFlag&6)return W(v.component.subTree);if(v.shapeFlag&128)return v.suspense.next();const _=g(v.anchor||v.el),M=_&&_[ld];return M?g(M):_};let fe=!1;const ue=(v,_,M)=>{let H;v==null?_._vnode&&(Ke(_._vnode,null,null,!0),H=_._vnode.component):x(_._vnode||null,v,_,null,null,null,M),_._vnode=v,fe||(fe=!0,Sl(H),rd(),fe=!1)},be={p:x,um:Ke,m:He,r:Ze,mt:ke,mc:Te,pc:Ee,pbc:te,n:W,o:e};return{render:ue,hydrate:void 0,createApp:kp(ue)}}function Ei({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 Cr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function jp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ga(e,t,n=!1){const r=e.children,s=t.children;if(je(r)&&je(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]=Fn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&Ga(i,a)),a.type===ri&&(a.patchFlag===-1&&(a=s[o]=Fn(a)),a.el=i.el),a.type===Ut&&!a.el&&(a.el=i.el)}}function Bp(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 Od(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Od(t)}function Ul(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Nd(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Nd(t.subTree):null}const $d=e=>e.__isSuspense;function Up(e,t){t&&t.pendingBranch?je(e)?t.effects.push(...e):t.effects.push(e):Gh(e)}const Le=Symbol.for("v-fgt"),ri=Symbol.for("v-txt"),Ut=Symbol.for("v-cmt"),Ci=Symbol.for("v-stc"),Ds=[];let an=null;function b(e=!1){Ds.push(an=e?null:[])}function Fp(){Ds.pop(),an=Ds[Ds.length-1]||null}let Vs=1;function $o(e,t=!1){Vs+=e,e<0&&an&&t&&(an.hasOnce=!0)}function Dd(e){return e.dynamicChildren=Vs>0?an||Zr:null,Fp(),Vs>0&&an&&an.push(e),e}function S(e,t,n,r,s,o){return Dd(p(e,t,n,r,s,o,!0))}function ut(e,t,n,r,s){return Dd(Se(e,t,n,r,s,!0))}function Ws(e){return e?e.__v_isVNode===!0:!1}function Or(e,t){return e.type===t.type&&e.key===t.key}const Ld=({key:e})=>e??null,ko=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?kt(e)||Vt(e)||qe(e)?{i:Mt,r:e,k:t,f:!!n}:e:null);function p(e,t=null,n=null,r=0,s=null,o=e===Le?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ld(t),ref:t&&ko(t),scopeId:od,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:Mt};return a?(Ka(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=kt(n)?8:16),Vs>0&&!i&&an&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&an.push(l),l}const Se=Hp;function Hp(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===yd)&&(e=Ut),Ws(e)){const a=br(e,t,!0);return n&&Ka(a,n),Vs>0&&!o&&an&&(a.shapeFlag&6?an[an.indexOf(e)]=a:an.push(a)),a.patchFlag=-2,a}if(Xp(e)&&(e=e.__vccOpts),t){t=Vp(t);let{class:a,style:l}=t;a&&!kt(a)&&(t.class=st(a)),ft(l)&&(Va(l)&&!je(l)&&(l=At({},l)),t.style=Ur(l))}const i=kt(e)?1:$d(e)?128:cd(e)?64:ft(e)?4:qe(e)?2:0;return p(e,t,n,r,s,i,o,!0)}function Vp(e){return e?Va(e)||Cd(e)?At({},e):e:null}function br(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,u=t?jd(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Ld(u),ref:t&&t.ref?n&&o?je(o)?o.concat(ko(t)):[o,ko(t)]:ko(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Le?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&br(e.ssContent),ssFallback:e.ssFallback&&br(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Hs(c,l.clone(c)),c}function qs(e=" ",t=0){return Se(ri,null,e,t)}function ie(e="",t=!1){return t?(b(),ut(Ut,null,e)):Se(Ut,null,e)}function En(e){return e==null||typeof e=="boolean"?Se(Ut):je(e)?Se(Le,null,e.slice()):Ws(e)?Fn(e):Se(ri,null,String(e))}function Fn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:br(e)}function Ka(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(je(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),Ka(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Cd(t)?t._ctx=Mt:s===3&&Mt&&(Mt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else qe(t)?(t={default:t,_ctx:Mt},n=32):(t=String(t),r&64?(n=16,t=[qs(t)]):n=8);e.children=t,e.shapeFlag|=n}function jd(...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=st([t.class,r.class]));else if(s==="style")t.style=Ur([t.style,r.style]);else if(zo(s)){const o=t[s],i=r[s];i&&o!==i&&!(je(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function kn(e,t,n,r=null){yn(e,t,7,[n,r])}const Wp=kd();let qp=0;function zp(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Wp,o={uid:qp++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new vh(!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:Rd(r,s),emitsOptions:Td(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=Ip.bind(null,o),e.ce&&e.ce(o),o}let Ft=null;const Ja=()=>Ft||Mt;let Do,fa;{const e=Jo(),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)}};Do=t("__VUE_INSTANCE_SETTERS__",n=>Ft=n),fa=t("__VUE_SSR_SETTERS__",n=>zs=n)}const to=e=>{const t=Ft;return Do(e),e.scope.on(),()=>{e.scope.off(),Do(t)}},Fl=()=>{Ft&&Ft.scope.off(),Do(null)};function Bd(e){return e.vnode.shapeFlag&4}let zs=!1;function Gp(e,t=!1,n=!1){t&&fa(t);const{props:r,children:s}=e.vnode,o=Bd(e);Pp(e,r,o,t),Np(e,s,n||t);const i=o?Kp(e,t):void 0;return t&&fa(!1),i}function Kp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,hp);const{setup:r}=n;if(r){Gn();const s=e.setupContext=r.length>1?Fd(e):null,o=to(e),i=eo(r,e,0,[e.props,s]),a=xu(i);if(Kn(),o(),(a||e.sp)&&!ns(e)&&gd(e),a){if(i.then(Fl,Fl),t)return i.then(l=>{Hl(e,l)}).catch(l=>{Qo(l,e,0)});e.asyncDep=i}else Hl(e,i)}else Ud(e)}function Hl(e,t,n){qe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ft(t)&&(e.setupState=ed(t)),Ud(e)}function Ud(e,t,n){const r=e.type;e.render||(e.render=r.render||xn);{const s=to(e);Gn();try{gp(e)}finally{Kn(),s()}}}const Jp={get(e,t){return Bt(e,"get",""),e[t]}};function Fd(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Jp),slots:e.slots,emit:e.emit,expose:t}}function si(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ed(Lh(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in $s)return $s[n](e)},has(t,n){return n in t||n in $s}})):e.proxy}function Yp(e,t=!0){return qe(e)?e.displayName||e.name:e.name||t&&e.__name}function Xp(e){return qe(e)&&"__vccOpts"in e}const ce=(e,t)=>Hh(e,t,zs);function Ya(e,t,n){try{$o(-1);const r=arguments.length;return r===2?ft(t)&&!je(t)?Ws(t)?Se(e,null,[t]):Se(e,t):Se(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ws(n)&&(n=[n]),Se(e,t,n))}finally{$o(1)}}const Qp="3.5.30";/**
14
+ * @vue/runtime-dom v3.5.30
15
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
+ * @license MIT
17
+ **/let ha;const Vl=typeof window<"u"&&window.trustedTypes;if(Vl)try{ha=Vl.createPolicy("vue",{createHTML:e=>e})}catch{}const Hd=ha?e=>ha.createHTML(e):e=>e,Zp="http://www.w3.org/2000/svg",em="http://www.w3.org/1998/Math/MathML",Un=typeof document<"u"?document:null,Wl=Un&&Un.createElement("template"),tm={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"?Un.createElementNS(Zp,e):t==="mathml"?Un.createElementNS(em,e):n?Un.createElement(e,{is:n}):Un.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Un.createTextNode(e),createComment:e=>Un.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Un.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{Wl.innerHTML=Hd(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Wl.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]}},lr="transition",Ss="animation",Gs=Symbol("_vtc"),Vd={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},nm=At({},dd,Vd),rm=e=>(e.displayName="Transition",e.props=nm,e),Wd=rm((e,{slots:t})=>Ya(ep,sm(e),t)),Ar=(e,t=[])=>{je(e)?e.forEach(n=>n(...t)):e&&e(...t)},ql=e=>e?je(e)?e.some(t=>t.length>1):e.length>1:!1;function sm(e){const t={};for(const X in e)X in Vd||(t[X]=e[X]);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:g=`${n}-leave-active`,leaveToClass:I=`${n}-leave-to`}=e,j=om(s),x=j&&j[0],B=j&&j[1],{onBeforeEnter:ee,onEnter:z,onEnterCancelled:Q,onLeave:K,onLeaveCancelled:le,onBeforeAppear:de=ee,onAppear:ve=z,onAppearCancelled:Te=Q}=t,ae=(X,Pe,ke,$e)=>{X._enterCancelled=$e,Rr(X,Pe?c:a),Rr(X,Pe?u:i),ke&&ke()},te=(X,Pe)=>{X._isLeaving=!1,Rr(X,f),Rr(X,I),Rr(X,g),Pe&&Pe()},re=X=>(Pe,ke)=>{const $e=X?ve:z,Ae=()=>ae(Pe,X,ke);Ar($e,[Pe,Ae]),zl(()=>{Rr(Pe,X?l:o),jn(Pe,X?c:a),ql($e)||Gl(Pe,r,x,Ae)})};return At(t,{onBeforeEnter(X){Ar(ee,[X]),jn(X,o),jn(X,i)},onBeforeAppear(X){Ar(de,[X]),jn(X,l),jn(X,u)},onEnter:re(!1),onAppear:re(!0),onLeave(X,Pe){X._isLeaving=!0;const ke=()=>te(X,Pe);jn(X,f),X._enterCancelled?(jn(X,g),Yl(X)):(Yl(X),jn(X,g)),zl(()=>{X._isLeaving&&(Rr(X,f),jn(X,I),ql(K)||Gl(X,r,B,ke))}),Ar(K,[X,ke])},onEnterCancelled(X){ae(X,!1,void 0,!0),Ar(Q,[X])},onAppearCancelled(X){ae(X,!0,void 0,!0),Ar(Te,[X])},onLeaveCancelled(X){te(X),Ar(le,[X])}})}function om(e){if(e==null)return null;if(ft(e))return[Ai(e.enter),Ai(e.leave)];{const t=Ai(e);return[t,t]}}function Ai(e){return ch(e)}function jn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Gs]||(e[Gs]=new Set)).add(t)}function Rr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Gs];n&&(n.delete(t),n.size||(e[Gs]=void 0))}function zl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let im=0;function Gl(e,t,n,r){const s=e._endId=++im,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=am(e,t);if(!i)return r();const u=i+"end";let c=0;const f=()=>{e.removeEventListener(u,g),o()},g=I=>{I.target===e&&++c>=l&&f()};setTimeout(()=>{c<l&&f()},a+1),e.addEventListener(u,g)}function am(e,t){const n=window.getComputedStyle(e),r=j=>(n[j]||"").split(", "),s=r(`${lr}Delay`),o=r(`${lr}Duration`),i=Kl(s,o),a=r(`${Ss}Delay`),l=r(`${Ss}Duration`),u=Kl(a,l);let c=null,f=0,g=0;t===lr?i>0&&(c=lr,f=i,g=o.length):t===Ss?u>0&&(c=Ss,f=u,g=l.length):(f=Math.max(i,u),c=f>0?i>u?lr:Ss:null,g=c?c===lr?o.length:l.length:0);const I=c===lr&&/\b(?:transform|all)(?:,|$)/.test(r(`${lr}Property`).toString());return{type:c,timeout:f,propCount:g,hasTransform:I}}function Kl(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Jl(n)+Jl(e[r])))}function Jl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Yl(e){return(e?e.ownerDocument:document).body.offsetHeight}function lm(e,t,n){const r=e[Gs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Xl=Symbol("_vod"),cm=Symbol("_vsh"),um=Symbol(""),dm=/(?:^|;)\s*display\s*:/;function fm(e,t,n){const r=e.style,s=kt(n);let o=!1;if(n&&!s){if(t)if(kt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&To(r,a,"")}else for(const i in t)n[i]==null&&To(r,i,"");for(const i in n)i==="display"&&(o=!0),To(r,i,n[i])}else if(s){if(t!==n){const i=r[um];i&&(n+=";"+i),r.cssText=n,o=dm.test(n)}}else t&&e.removeAttribute("style");Xl in e&&(e[Xl]=o?r.display:"",e[cm]&&(r.display="none"))}const Ql=/\s*!important$/;function To(e,t,n){if(je(n))n.forEach(r=>To(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=hm(e,t);Ql.test(n)?e.setProperty(_r(r),n.replace(Ql,""),"important"):e[r]=n}}const Zl=["Webkit","Moz","ms"],Ri={};function hm(e,t){const n=Ri[t];if(n)return n;let r=Xt(t);if(r!=="filter"&&r in e)return Ri[t]=r;r=Ko(r);for(let s=0;s<Zl.length;s++){const o=Zl[s]+r;if(o in e)return Ri[t]=o}return t}const ec="http://www.w3.org/1999/xlink";function tc(e,t,n,r,s,o=mh(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ec,t.slice(6,t.length)):e.setAttributeNS(ec,t,n):n==null||o&&!$u(n)?e.removeAttribute(t):e.setAttribute(t,o?"":gn(n)?String(n):n)}function nc(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Hd(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=$u(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 Xr(e,t,n,r){e.addEventListener(t,n,r)}function pm(e,t,n,r){e.removeEventListener(t,n,r)}const rc=Symbol("_vei");function mm(e,t,n,r,s=null){const o=e[rc]||(e[rc]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=gm(t);if(r){const u=o[t]=wm(r,s);Xr(e,a,u,l)}else i&&(pm(e,a,i,l),o[t]=void 0)}}const sc=/(?:Once|Passive|Capture)$/;function gm(e){let t;if(sc.test(e)){t={};let r;for(;r=e.match(sc);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):_r(e.slice(2)),t]}let Pi=0;const vm=Promise.resolve(),ym=()=>Pi||(vm.then(()=>Pi=0),Pi=Date.now());function wm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;yn(bm(r,n.value),t,5,[r])};return n.value=e,n.attached=ym(),n}function bm(e,t){if(je(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 oc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,_m=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?lm(e,r,i):t==="style"?fm(e,n,r):zo(t)?Ma(t)||mm(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):km(e,t,r,i))?(nc(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&tc(e,t,r,i,o,t!=="value")):e._isVueCE&&(Tm(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!kt(r)))?nc(e,Xt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),tc(e,t,r,i))};function km(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&oc(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 oc(t)&&kt(n)?!1:t in e}function Tm(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 ic=e=>{const t=e.props["onUpdate:modelValue"]||!1;return je(t)?n=>wo(t,n):t};function Im(e){e.target.composing=!0}function ac(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const xi=Symbol("_assign");function lc(e,t,n){return t&&(e=e.trim()),n&&(e=$a(e)),e}const Xn={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[xi]=ic(s);const o=r||s.props&&s.props.type==="number";Xr(e,t?"change":"input",i=>{i.target.composing||e[xi](lc(e.value,n,o))}),(n||o)&&Xr(e,"change",()=>{e.value=lc(e.value,n,o)}),t||(Xr(e,"compositionstart",Im),Xr(e,"compositionend",ac),Xr(e,"change",ac))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[xi]=ic(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?$a(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))}},Sm=["ctrl","shift","alt","meta"],Em={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)=>Sm.some(n=>e[`${n}Key`]&&!t.includes(n))},rt=(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=Em[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Cm={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=_r(s.key);if(t.some(i=>i===o||Cm[i]===o))return e(s)}))},Am=At({patchProp:_m},tm);let cc;function Rm(){return cc||(cc=Dp(Am))}const Pm=((...e)=>{const t=Rm().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Mm(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,xm(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function xm(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Mm(e){return kt(e)?document.querySelector(e):e}/*!
18
+ * vue-router v4.6.4
19
+ * (c) 2025 Eduardo San Martin Morote
20
+ * @license MIT
21
+ */const Qr=typeof document<"u";function qd(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Om(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&qd(e.default)}const lt=Object.assign;function Mi(e,t){const n={};for(const r in t){const s=t[r];n[r]=wn(s)?s.map(e):e(s)}return n}const Ls=()=>{},wn=Array.isArray;function uc(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const zd=/#/g,Nm=/&/g,$m=/\//g,Dm=/=/g,Lm=/\?/g,Gd=/\+/g,jm=/%5B/g,Bm=/%5D/g,Kd=/%5E/g,Um=/%60/g,Jd=/%7B/g,Fm=/%7C/g,Yd=/%7D/g,Hm=/%20/g;function Xa(e){return e==null?"":encodeURI(""+e).replace(Fm,"|").replace(jm,"[").replace(Bm,"]")}function Vm(e){return Xa(e).replace(Jd,"{").replace(Yd,"}").replace(Kd,"^")}function pa(e){return Xa(e).replace(Gd,"%2B").replace(Hm,"+").replace(zd,"%23").replace(Nm,"%26").replace(Um,"`").replace(Jd,"{").replace(Yd,"}").replace(Kd,"^")}function Wm(e){return pa(e).replace(Dm,"%3D")}function qm(e){return Xa(e).replace(zd,"%23").replace(Lm,"%3F")}function zm(e){return qm(e).replace($m,"%2F")}function Ks(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Gm=/\/$/,Km=e=>e.replace(Gm,"");function Oi(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:Ks(i)}}function Jm(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function dc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Ym(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&cs(t.matched[r],n.matched[s])&&Xd(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function cs(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Xd(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Xm(e[n],t[n]))return!1;return!0}function Xm(e,t){return wn(e)?fc(e,t):wn(t)?fc(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function fc(e,t){return wn(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 cr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let ma=(function(e){return e.pop="pop",e.push="push",e})({}),Ni=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Zm(e){if(!e)if(Qr){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Km(e)}const eg=/^[^#]+#/;function tg(e,t){return e.replace(eg,"#")+t}function ng(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 oi=()=>({left:window.scrollX,top:window.scrollY});function rg(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=ng(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 hc(e,t){return(history.state?history.state.position-t:-1)+e}const ga=new Map;function sg(e,t){ga.set(e,t)}function og(e){const t=ga.get(e);return ga.delete(e),t}function ig(e){return typeof e=="string"||e&&typeof e=="object"}function Qd(e){return typeof e=="string"||typeof e=="symbol"}let It=(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("");It.MATCHER_NOT_FOUND+"",It.NAVIGATION_GUARD_REDIRECT+"",It.NAVIGATION_ABORTED+"",It.NAVIGATION_CANCELLED+"",It.NAVIGATION_DUPLICATED+"";function us(e,t){return lt(new Error,{type:e,[Zd]:!0},t)}function Bn(e,t){return e instanceof Error&&Zd in e&&(t==null||!!(e.type&t))}const ag=["params","query","hash"];function lg(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of ag)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function cg(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(Gd," "),o=s.indexOf("="),i=Ks(o<0?s:s.slice(0,o)),a=o<0?null:Ks(s.slice(o+1));if(i in t){let l=t[i];wn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function pc(e){let t="";for(let n in e){const r=e[n];if(n=Wm(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(wn(r)?r.map(s=>s&&pa(s)):[r&&pa(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function ug(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=wn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const dg=Symbol(""),mc=Symbol(""),ii=Symbol(""),Qa=Symbol(""),va=Symbol("");function Es(){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 hr(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const u=g=>{g===!1?l(us(It.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?l(g):ig(g)?l(us(It.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(i&&r.enterCallbacks[s]===i&&typeof g=="function"&&i.push(g),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(g=>l(g))})}function $i(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(qd(l)){const u=(l.__vccOpts||l)[t];u&&o.push(hr(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=Om(c)?c.default:c;i.mods[a]=c,i.components[a]=f;const g=(f.__vccOpts||f)[t];return g&&hr(g,n,r,i,a,s)()}))}}return o}function fg(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=>cs(u,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(u=>cs(u,l))||s.push(l))}return[n,r,s]}/*!
22
+ * vue-router v4.6.4
23
+ * (c) 2025 Eduardo San Martin Morote
24
+ * @license MIT
25
+ */let hg=()=>location.protocol+"//"+location.host;function ef(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),dc(a,"")}return dc(n,e)+r+s}function pg(e,t,n,r){let s=[],o=[],i=null;const a=({state:g})=>{const I=ef(e,location),j=n.value,x=t.value;let B=0;if(g){if(n.value=I,t.value=g,i&&i===j){i=null;return}B=x?g.position-x.position:0}else r(I);s.forEach(ee=>{ee(n.value,j,{delta:B,type:ma.pop,direction:B?B>0?Ni.forward:Ni.back:Ni.unknown})})};function l(){i=n.value}function u(g){s.push(g);const I=()=>{const j=s.indexOf(g);j>-1&&s.splice(j,1)};return o.push(I),I}function c(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(lt({},g.state,{scroll:oi()}),"")}}function f(){for(const g of o)g();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 gc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?oi():null}}function mg(e){const{history:t,location:n}=window,r={value:ef(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("#"),g=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:hg()+e+l;try{t[c?"replaceState":"pushState"](u,"",g),s.value=u}catch(I){console.error(I),n[c?"replace":"assign"](g)}}function i(l,u){o(l,lt({},t.state,gc(s.value.back,l,s.value.forward,!0),u,{position:s.value.position}),!0),r.value=l}function a(l,u){const c=lt({},s.value,t.state,{forward:l,scroll:oi()});o(c.current,c,!0),o(l,lt({},gc(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function gg(e){e=Zm(e);const t=mg(e),n=pg(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=lt({location:"",base:e,go:r,createHref:tg.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 vg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),gg(e)}let $r=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Ct=(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})(Ct||{});const yg={type:$r.Static,value:""},wg=/[a-zA-Z0-9_]/;function bg(e){if(!e)return[[]];if(e==="/")return[[yg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(I){throw new Error(`ERR (${n})/"${u}": ${I}`)}let n=Ct.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,u="",c="";function f(){u&&(n===Ct.Static?o.push({type:$r.Static,value:u}):n===Ct.Param||n===Ct.ParamRegExp||n===Ct.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:$r.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function g(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Ct.ParamRegExp){r=n,n=Ct.EscapeNext;continue}switch(n){case Ct.Static:l==="/"?(u&&f(),i()):l===":"?(f(),n=Ct.Param):g();break;case Ct.EscapeNext:g(),n=r;break;case Ct.Param:l==="("?n=Ct.ParamRegExp:wg.test(l)?g():(f(),n=Ct.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Ct.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=Ct.ParamRegExpEnd:c+=l;break;case Ct.ParamRegExpEnd:f(),n=Ct.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Ct.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),i(),s}const vc="[^/]+?",_g={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 kg=/[.+*?^${}()[\]/\\]/g;function Tg(e,t){const n=lt({},_g,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 g=u[f];let I=Kt.Segment+(n.sensitive?Kt.BonusCaseSensitive:0);if(g.type===$r.Static)f||(s+="/"),s+=g.value.replace(kg,"\\$&"),I+=Kt.Static;else if(g.type===$r.Param){const{value:j,repeatable:x,optional:B,regexp:ee}=g;o.push({name:j,repeatable:x,optional:B});const z=ee||vc;if(z!==vc){I+=Kt.BonusCustomRegExp;try{`${z}`}catch(K){throw new Error(`Invalid custom RegExp for param "${j}" (${z}): `+K.message)}}let Q=x?`((?:${z})(?:/(?:${z}))*)`:`(${z})`;f||(Q=B&&u.length<2?`(?:/${Q})`:"/"+Q),B&&(Q+="?"),s+=Q,I+=Kt.Dynamic,B&&(I+=Kt.BonusOptional),x&&(I+=Kt.BonusRepeatable),z===".*"&&(I+=Kt.BonusWildcard)}c.push(I)}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 g=1;g<c.length;g++){const I=c[g]||"",j=o[g-1];f[j.name]=I&&j.repeatable?I.split("/"):I}return f}function l(u){let c="",f=!1;for(const g of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const I of g)if(I.type===$r.Static)c+=I.value;else if(I.type===$r.Param){const{value:j,repeatable:x,optional:B}=I,ee=j in u?u[j]:"";if(wn(ee)&&!x)throw new Error(`Provided param "${j}" is an array but it is not repeatable (* or + modifiers)`);const z=wn(ee)?ee.join("/"):ee;if(!z)if(B)g.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${j}"`);c+=z}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function Ig(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 tf(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=Ig(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(yc(r))return 1;if(yc(s))return-1}return s.length-r.length}function yc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Sg={strict:!1,end:!0,sensitive:!1};function Eg(e,t,n){const r=Tg(bg(e.path),n),s=lt(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Cg(e,t){const n=[],r=new Map;t=uc(Sg,t);function s(f){return r.get(f)}function o(f,g,I){const j=!I,x=bc(f);x.aliasOf=I&&I.record;const B=uc(t,f),ee=[x];if("alias"in f){const K=typeof f.alias=="string"?[f.alias]:f.alias;for(const le of K)ee.push(bc(lt({},x,{components:I?I.record.components:x.components,path:le,aliasOf:I?I.record:x})))}let z,Q;for(const K of ee){const{path:le}=K;if(g&&le[0]!=="/"){const de=g.record.path,ve=de[de.length-1]==="/"?"":"/";K.path=g.record.path+(le&&ve+le)}if(z=Eg(K,g,B),I?I.alias.push(z):(Q=Q||z,Q!==z&&Q.alias.push(z),j&&f.name&&!_c(z)&&i(f.name)),nf(z)&&l(z),x.children){const de=x.children;for(let ve=0;ve<de.length;ve++)o(de[ve],z,I&&I.children[ve])}I=I||z}return Q?()=>{i(Q)}:Ls}function i(f){if(Qd(f)){const g=r.get(f);g&&(r.delete(f),n.splice(n.indexOf(g),1),g.children.forEach(i),g.alias.forEach(i))}else{const g=n.indexOf(f);g>-1&&(n.splice(g,1),f.record.name&&r.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function a(){return n}function l(f){const g=Pg(f,n);n.splice(g,0,f),f.record.name&&!_c(f)&&r.set(f.record.name,f)}function u(f,g){let I,j={},x,B;if("name"in f&&f.name){if(I=r.get(f.name),!I)throw us(It.MATCHER_NOT_FOUND,{location:f});B=I.record.name,j=lt(wc(g.params,I.keys.filter(Q=>!Q.optional).concat(I.parent?I.parent.keys.filter(Q=>Q.optional):[]).map(Q=>Q.name)),f.params&&wc(f.params,I.keys.map(Q=>Q.name))),x=I.stringify(j)}else if(f.path!=null)x=f.path,I=n.find(Q=>Q.re.test(x)),I&&(j=I.parse(x),B=I.record.name);else{if(I=g.name?r.get(g.name):n.find(Q=>Q.re.test(g.path)),!I)throw us(It.MATCHER_NOT_FOUND,{location:f,currentLocation:g});B=I.record.name,j=lt({},g.params,f.params),x=I.stringify(j)}const ee=[];let z=I;for(;z;)ee.unshift(z.record),z=z.parent;return{name:B,path:x,params:j,matched:ee,meta:Rg(ee)}}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 wc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function bc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ag(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 Ag(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 _c(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Rg(e){return e.reduce((t,n)=>lt(t,n.meta),{})}function Pg(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;tf(e,t[o])<0?r=o:n=o+1}const s=xg(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function xg(e){let t=e;for(;t=t.parent;)if(nf(t)&&tf(e,t)===0)return t}function nf({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function kc(e){const t=pn(ii),n=pn(Qa),r=ce(()=>{const l=ye(e.to);return t.resolve(l)}),s=ce(()=>{const{matched:l}=r.value,{length:u}=l,c=l[u-1],f=n.matched;if(!c||!f.length)return-1;const g=f.findIndex(cs.bind(null,c));if(g>-1)return g;const I=Tc(l[u-2]);return u>1&&Tc(c)===I&&f[f.length-1].path!==I?f.findIndex(cs.bind(null,l[u-2])):g}),o=ce(()=>s.value>-1&&Dg(n.params,r.value.params)),i=ce(()=>s.value>-1&&s.value===n.matched.length-1&&Xd(n.params,r.value.params));function a(l={}){if($g(l)){const u=t[ye(e.replace)?"replace":"push"](ye(e.to)).catch(Ls);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:ce(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Mg(e){return e.length===1?e[0]:e}const Og=Rt({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:kc,setup(e,{slots:t}){const n=Xo(kc(e)),{options:r}=pn(ii),s=ce(()=>({[Ic(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Ic(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Mg(t.default(n));return e.custom?o:Ya("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Ng=Og;function $g(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 Dg(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(!wn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Tc(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ic=(e,t,n)=>e??t??n,Lg=Rt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=pn(va),s=ce(()=>e.route||r.value),o=pn(mc,0),i=ce(()=>{let u=ye(o);const{matched:c}=s.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),a=ce(()=>s.value.matched[i.value]);bo(mc,ce(()=>i.value+1)),bo(dg,a),bo(va,s);const l=D();return dt(()=>[l.value,a.value,e.name],([u,c,f],[g,I,j])=>{c&&(c.instances[f]=u,I&&I!==c&&u&&u===g&&(c.leaveGuards.size||(c.leaveGuards=I.leaveGuards),c.updateGuards.size||(c.updateGuards=I.updateGuards))),u&&c&&(!I||!cs(c,I)||!g)&&(c.enterCallbacks[f]||[]).forEach(x=>x(u))},{flush:"post"}),()=>{const u=s.value,c=e.name,f=a.value,g=f&&f.components[c];if(!g)return Sc(n.default,{Component:g,route:u});const I=f.props[c],j=I?I===!0?u.params:typeof I=="function"?I(u):I:null,B=Ya(g,lt({},j,t,{onVnodeUnmounted:ee=>{ee.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return Sc(n.default,{Component:B,route:u})||B}}});function Sc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const jg=Lg;function Bg(e){const t=Cg(e.routes,e),n=e.parseQuery||cg,r=e.stringifyQuery||pc,s=e.history,o=Es(),i=Es(),a=Es(),l=jh(cr);let u=cr;Qr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Mi.bind(null,W=>""+W),f=Mi.bind(null,zm),g=Mi.bind(null,Ks);function I(W,fe){let ue,be;return Qd(W)?(ue=t.getRecordMatcher(W),be=fe):be=W,t.addRoute(be,ue)}function j(W){const fe=t.getRecordMatcher(W);fe&&t.removeRoute(fe)}function x(){return t.getRoutes().map(W=>W.record)}function B(W){return!!t.getRecordMatcher(W)}function ee(W,fe){if(fe=lt({},fe||l.value),typeof W=="string"){const M=Oi(n,W,fe.path),H=t.resolve({path:M.path},fe),U=s.createHref(M.fullPath);return lt(M,H,{params:g(H.params),hash:Ks(M.hash),redirectedFrom:void 0,href:U})}let ue;if(W.path!=null)ue=lt({},W,{path:Oi(n,W.path,fe.path).path});else{const M=lt({},W.params);for(const H in M)M[H]==null&&delete M[H];ue=lt({},W,{params:f(M)}),fe.params=f(fe.params)}const be=t.resolve(ue,fe),Ce=W.hash||"";be.params=c(g(be.params));const v=Jm(r,lt({},W,{hash:Vm(Ce),path:be.path})),_=s.createHref(v);return lt({fullPath:v,hash:Ce,query:r===pc?ug(W.query):W.query||{}},be,{redirectedFrom:void 0,href:_})}function z(W){return typeof W=="string"?Oi(n,W,l.value.path):lt({},W)}function Q(W,fe){if(u!==W)return us(It.NAVIGATION_CANCELLED,{from:fe,to:W})}function K(W){return ve(W)}function le(W){return K(lt(z(W),{replace:!0}))}function de(W,fe){const ue=W.matched[W.matched.length-1];if(ue&&ue.redirect){const{redirect:be}=ue;let Ce=typeof be=="function"?be(W,fe):be;return typeof Ce=="string"&&(Ce=Ce.includes("?")||Ce.includes("#")?Ce=z(Ce):{path:Ce},Ce.params={}),lt({query:W.query,hash:W.hash,params:Ce.path!=null?{}:W.params},Ce)}}function ve(W,fe){const ue=u=ee(W),be=l.value,Ce=W.state,v=W.force,_=W.replace===!0,M=de(ue,be);if(M)return ve(lt(z(M),{state:typeof M=="object"?lt({},Ce,M.state):Ce,force:v,replace:_}),fe||ue);const H=ue;H.redirectedFrom=fe;let U;return!v&&Ym(r,be,ue)&&(U=us(It.NAVIGATION_DUPLICATED,{to:H,from:be}),He(be,be,!0,!1)),(U?Promise.resolve(U):te(H,be)).catch(O=>Bn(O)?Bn(O,It.NAVIGATION_GUARD_REDIRECT)?O:Ge(O):Ee(O,H,be)).then(O=>{if(O){if(Bn(O,It.NAVIGATION_GUARD_REDIRECT))return ve(lt({replace:_},z(O.to),{state:typeof O.to=="object"?lt({},Ce,O.to.state):Ce,force:v}),fe||H)}else O=X(H,be,!0,_,Ce);return re(H,be,O),O})}function Te(W,fe){const ue=Q(W,fe);return ue?Promise.reject(ue):Promise.resolve()}function ae(W){const fe=pt.values().next().value;return fe&&typeof fe.runWithContext=="function"?fe.runWithContext(W):W()}function te(W,fe){let ue;const[be,Ce,v]=fg(W,fe);ue=$i(be.reverse(),"beforeRouteLeave",W,fe);for(const M of be)M.leaveGuards.forEach(H=>{ue.push(hr(H,W,fe))});const _=Te.bind(null,W,fe);return ue.push(_),Be(ue).then(()=>{ue=[];for(const M of o.list())ue.push(hr(M,W,fe));return ue.push(_),Be(ue)}).then(()=>{ue=$i(Ce,"beforeRouteUpdate",W,fe);for(const M of Ce)M.updateGuards.forEach(H=>{ue.push(hr(H,W,fe))});return ue.push(_),Be(ue)}).then(()=>{ue=[];for(const M of v)if(M.beforeEnter)if(wn(M.beforeEnter))for(const H of M.beforeEnter)ue.push(hr(H,W,fe));else ue.push(hr(M.beforeEnter,W,fe));return ue.push(_),Be(ue)}).then(()=>(W.matched.forEach(M=>M.enterCallbacks={}),ue=$i(v,"beforeRouteEnter",W,fe,ae),ue.push(_),Be(ue))).then(()=>{ue=[];for(const M of i.list())ue.push(hr(M,W,fe));return ue.push(_),Be(ue)}).catch(M=>Bn(M,It.NAVIGATION_CANCELLED)?M:Promise.reject(M))}function re(W,fe,ue){a.list().forEach(be=>ae(()=>be(W,fe,ue)))}function X(W,fe,ue,be,Ce){const v=Q(W,fe);if(v)return v;const _=fe===cr,M=Qr?history.state:{};ue&&(be||_?s.replace(W.fullPath,lt({scroll:_&&M&&M.scroll},Ce)):s.push(W.fullPath,Ce)),l.value=W,He(W,fe,ue,_),Ge()}let Pe;function ke(){Pe||(Pe=s.listen((W,fe,ue)=>{if(!Ne.listening)return;const be=ee(W),Ce=de(be,Ne.currentRoute.value);if(Ce){ve(lt(Ce,{replace:!0,force:!0}),be).catch(Ls);return}u=be;const v=l.value;Qr&&sg(hc(v.fullPath,ue.delta),oi()),te(be,v).catch(_=>Bn(_,It.NAVIGATION_ABORTED|It.NAVIGATION_CANCELLED)?_:Bn(_,It.NAVIGATION_GUARD_REDIRECT)?(ve(lt(z(_.to),{force:!0}),be).then(M=>{Bn(M,It.NAVIGATION_ABORTED|It.NAVIGATION_DUPLICATED)&&!ue.delta&&ue.type===ma.pop&&s.go(-1,!1)}).catch(Ls),Promise.reject()):(ue.delta&&s.go(-ue.delta,!1),Ee(_,be,v))).then(_=>{_=_||X(be,v,!1),_&&(ue.delta&&!Bn(_,It.NAVIGATION_CANCELLED)?s.go(-ue.delta,!1):ue.type===ma.pop&&Bn(_,It.NAVIGATION_ABORTED|It.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),re(be,v,_)}).catch(Ls)}))}let $e=Es(),Ae=Es(),we;function Ee(W,fe,ue){Ge(W);const be=Ae.list();return be.length?be.forEach(Ce=>Ce(W,fe,ue)):console.error(W),Promise.reject(W)}function ht(){return we&&l.value!==cr?Promise.resolve():new Promise((W,fe)=>{$e.add([W,fe])})}function Ge(W){return we||(we=!W,ke(),$e.list().forEach(([fe,ue])=>W?ue(W):fe()),$e.reset()),W}function He(W,fe,ue,be){const{scrollBehavior:Ce}=e;if(!Qr||!Ce)return Promise.resolve();const v=!ue&&og(hc(W.fullPath,0))||(be||!ue)&&history.state&&history.state.scroll||null;return Ht().then(()=>Ce(W,fe,v)).then(_=>_&&rg(_)).catch(_=>Ee(_,W,fe))}const Ke=W=>s.go(W);let Ze;const pt=new Set,Ne={currentRoute:l,listening:!0,addRoute:I,removeRoute:j,clearRoutes:t.clearRoutes,hasRoute:B,getRoutes:x,resolve:ee,options:e,push:K,replace:le,go:Ke,back:()=>Ke(-1),forward:()=>Ke(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Ae.add,isReady:ht,install(W){W.component("RouterLink",Ng),W.component("RouterView",jg),W.config.globalProperties.$router=Ne,Object.defineProperty(W.config.globalProperties,"$route",{enumerable:!0,get:()=>ye(l)}),Qr&&!Ze&&l.value===cr&&(Ze=!0,K(s.location).catch(be=>{}));const fe={};for(const be in cr)Object.defineProperty(fe,be,{get:()=>l.value[be],enumerable:!0});W.provide(ii,Ne),W.provide(Qa,Qu(fe)),W.provide(va,l);const ue=W.unmount;pt.add(W),W.unmount=function(){pt.delete(W),pt.size<1&&(u=cr,Pe&&Pe(),Pe=null,l.value=cr,Ze=!1,we=!1),ue()}}};function Be(W){return W.reduce((fe,ue)=>fe.then(()=>ae(ue)),Promise.resolve())}return Ne}function Ug(){return pn(ii)}function Fg(e){return pn(Qa)}const Ec=768;function rf(){const e=D(typeof window<"u"?window.innerWidth<Ec:!1);let t=null;function n(r){e.value=r.matches}return tr(()=>{t=window.matchMedia(`(max-width: ${Ec-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),ti(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Hg={key:0,class:"desktop-sidebar"},Vg={class:"desktop-main"},Cc="codex-web-local.sidebar-width.v1",Wg=260,qg=620,Ac=320,zg=Rt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=rf();function r(u){return Math.min(qg,Math.max(Wg,u))}function s(){if(typeof window>"u")return Ac;const u=window.localStorage.getItem(Cc),c=Number(u);return Number.isFinite(c)?r(c):Ac}const o=D(s()),i=ce(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${o.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(u){typeof window>"u"||window.localStorage.setItem(Cc,String(u))}function l(u){u.preventDefault();const c=u.clientX,f=o.value,g=j=>{const x=j.clientX-c;o.value=r(f+x)},I=()=>{a(o.value),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",I)};window.addEventListener("mousemove",g),window.addEventListener("mouseup",I)}return(u,c)=>(b(),S("div",{class:st(["desktop-layout",{"is-mobile":ye(n)}]),style:Ur(i.value)},[ye(n)?(b(),ut(Mo,{key:0,to:"body"},[Se(Wd,{name:"drawer"},{default:gt(()=>[e.isSidebarCollapsed?ie("",!0):(b(),S("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=f=>u.$emit("close-sidebar"))},[p("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=rt(()=>{},["stop"]))},[Pn(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ie("",!0),ye(n)?ie("",!0):(b(),S(Le,{key:1},[e.isSidebarCollapsed?ie("",!0):(b(),S("aside",Hg,[Pn(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?ie("",!0):(b(),S("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),p("section",Vg,[Pn(u.$slots,"content",{},void 0)])],6))}}),nt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Gg=nt(zg,[["__scopeId","data-v-df29c633"]]),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 b(),S("svg",Jg,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const ai=nt(Kg,[["render",Yg]]),Xg={},Qg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Zg(e,t){return b(),S("svg",Qg,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const sf=nt(Xg,[["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 b(),S("svg",tv,[...t[0]||(t[0]=[p("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const Cs=nt(ev,[["render",nv]]),rv={},sv={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function ov(e,t){return b(),S("svg",sv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16zm9.5-13.5l4 4"},null,-1)])])}const Lo=nt(rv,[["render",ov]]),iv={},av={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function lv(e,t){return b(),S("svg",av,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2"},null,-1)])])}const Za=nt(iv,[["render",lv]]),cv={},uv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function dv(e,t){return b(),S("svg",uv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const fv=nt(cv,[["render",dv]]),hv={},pv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function mv(e,t){return b(),S("svg",pv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 18v-6m0 0a4 4 0 0 1 4-4h2m-6 4a4 4 0 0 0-4-4H6m0-4a2 2 0 1 0 0 4a2 2 0 0 0 0-4m12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4m-6 14a2 2 0 1 0 0 4a2 2 0 0 0 0-4"},null,-1)])])}const Io=nt(hv,[["render",mv]]),gv={},vv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function yv(e,t){return b(),S("svg",vv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 4.5l-4 4L7 10l-1.5 1.5l7 7L14 17l1.5-4l4-4M9 15l-4.5 4.5M14.5 4L20 9.5"},null,-1)])])}const Di=nt(gv,[["render",yv]]),wv={key:0,class:"sidebar-menu-row-left"},bv={class:"sidebar-menu-row-main"},_v={key:1,class:"sidebar-menu-row-right"},kv={key:0,class:"sidebar-menu-row-right-default"},Tv={key:1,class:"sidebar-menu-row-right-hover"},Iv=Rt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=pp(),r=ce(()=>!!n.left),s=ce(()=>!!n.right),o=ce(()=>!!n["right-hover"]),i=ce(()=>s.value||o.value);return(a,l)=>(b(),ut(aa(t.as),jd({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:gt(()=>[r.value?(b(),S("span",wv,[Pn(a.$slots,"left",{},void 0,!0)])):ie("",!0),p("span",bv,[Pn(a.$slots,"default",{},void 0,!0)]),i.value?(b(),S("span",_v,[s.value?(b(),S("span",kv,[Pn(a.$slots,"right",{},void 0,!0)])):ie("",!0),o.value?(b(),S("span",Tv,[Pn(a.$slots,"right-hover",{},void 0,!0)])):ie("",!0)])):ie("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Pr=nt(Iv,[["__scopeId","data-v-daeca4df"]]),Sv={class:"thread-tree-root"},Ev={key:0,class:"pinned-section"},Cv={class:"thread-list"},Av={class:"thread-left-stack"},Rv=["data-state"],Pv=["onClick"],xv=["onClick"],Mv={class:"thread-row-title-wrap"},Ov={class:"thread-row-title"},Nv={class:"thread-row-time"},$v=["onClick"],Dv=["onClick"],Lv=["onClick"],jv=["onClick"],Bv=["aria-expanded"],Uv=["data-active"],Fv={key:0},Hv=["data-active"],Vv={key:0},Wv={key:1,class:"thread-tree-no-results"},qv={key:2,class:"thread-tree-loading"},zv={key:3,class:"thread-list thread-list-global"},Gv={class:"thread-left-stack"},Kv=["data-state"],Jv=["onClick"],Yv=["onClick"],Xv={class:"thread-row-title-wrap"},Qv={class:"thread-row-title"},Zv={class:"thread-row-time"},ey=["onClick"],ty=["onClick"],ny=["onClick"],ry=["onClick"],sy=["data-project-name","data-expanded","data-dragging"],oy={class:"project-icon-stack"},iy={class:"project-icon-folder"},ay={class:"project-icon-chevron"},ly=["data-dragging-handle","onMousedown"],cy={class:"project-title"},uy={class:"project-hover-controls"},dy=["onClick"],fy=["onClick"],hy=["onClick"],py=["onClick"],my=["onInput"],gy=["aria-label","title","onClick"],vy={key:0,class:"thread-list"},yy={class:"thread-left-stack"},wy=["data-state"],by=["onClick"],_y=["onClick"],ky={class:"thread-row-title-wrap"},Ty={class:"thread-row-title"},Iy={class:"thread-row-time"},Sy=["onClick"],Ey=["onClick"],Cy=["onClick"],Ay=["onClick"],Ry=["onClick"],Py={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},xy=["onKeydown"],My={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},Oy={class:"rename-thread-subtitle"},Ny=4,Rc=6,Pc="codex-web-local.thread-view-mode.v1",xc="codex-web-local.collapsed-projects.v1",$y=Rt({__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=D({}),o=D({}),i=D([]),a=D(""),l=D(""),u=D("actions"),c=D(""),f=D(!1),g=D(""),I=D(""),j=D(null),x=D(!1),B=D(""),ee=D(""),z=D(null),Q=D(null),K=D(null);let le=null,de=null;const ve=D(""),Te=D({}),ae=new Map,te=new Map,re=new Map,X=new WeakMap,Pe=D(null),ke=D(!1),$e=D(Ee()),Ae=typeof window<"u"?new ResizeObserver(E=>{for(const N of E){const $=N.target,Z=X.get($);Z&&F(Z,$)}}):null;function we(){if(typeof window>"u")return{};try{const E=window.localStorage.getItem(xc);if(!E)return{};const N=JSON.parse(E);return!N||typeof N!="object"||Array.isArray(N)?{}:N}catch{return{}}}function Ee(){return typeof window>"u"?"project":window.localStorage.getItem(Pc)==="chronological"?"chronological":"project"}o.value=we(),dt(o,E=>{typeof window>"u"||window.localStorage.setItem(xc,JSON.stringify(E))},{deep:!0}),dt($e,E=>{typeof window>"u"||window.localStorage.setItem(Pc,E)});const ht=ce(()=>n.searchQuery.trim().toLowerCase()),Ge=ce(()=>ht.value.length>0),He=ce(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function Ke(E){if(!Ge.value)return!0;if(He.value)return He.value.has(E.id);const N=ht.value;return E.title.toLowerCase().includes(N)||E.preview.toLowerCase().includes(N)}const Ze=ce(()=>Ge.value?n.groups.map(E=>({...E,threads:E.threads.filter(Ke)})).filter(E=>E.threads.length>0):n.groups),pt=ce(()=>$e.value==="chronological"),Ne=ce(()=>{const E=Ze.value,N=[];for(const $ of E)for(const Z of $.threads)_(Z.id)||N.push(Z);return N.sort(($,Z)=>{const Ue=new Date($.updatedAtIso||$.createdAtIso).getTime();return new Date(Z.updatedAtIso||Z.createdAtIso).getTime()-Ue})}),Be=ce(()=>{const E=new Map;for(const N of n.groups)for(const $ of N.threads)E.set($.id,$);return E}),W=ce(()=>i.value.map(E=>Be.value.get(E)??null).filter(E=>E!==null).filter(Ke)),fe=ce(()=>{const E=K.value;if(!E||E.dropTargetIndexFull===null||n.groups.length===0)return null;const N=Math.max(0,Math.min(E.dropTargetIndexFull,n.groups.length)),$=N>E.fromIndex?N-1:N,Z=Math.max(0,Math.min($,n.groups.length-1));return Z===E.fromIndex?null:Z}),ue=ce(()=>{const N=(Ge.value?Ze.value:n.groups).map(en=>en.projectName),$=K.value,Z=fe.value;if(!$||Z===null)return N;const Ue=[...N],[Et]=Ue.splice($.fromIndex,1);return Et?(Ue.splice(Z,0,Et),Ue):N}),be=ce(()=>{const E={};let N=0;for(const $ of ue.value)E[$]=N,N+=Tt($);return E}),Ce=ce(()=>{let E=0;for(const N of ue.value)E+=Tt(N);return{height:`${Math.max(0,E)}px`}});function v(E){const N=new Date(E).getTime();if(Number.isNaN(N))return"n/a";const $=Math.abs(Date.now()-N);if($<6e4)return"now";const Z=Math.floor($/6e4);if(Z<60)return`${Z}m`;const Ue=Math.floor(Z/60);return Ue<24?`${Ue}h`:`${Math.floor(Ue/24)}d`}function _(E){return i.value.includes(E)}function M(E){if(_(E)){i.value=i.value.filter(N=>N!==E);return}i.value=[E,...i.value]}function H(E){r("select",E)}function U(E){r("export-thread",E),G()}function O(E){return`start new thread ${Xe(E)}`}function L(E){r("start-new-thread",E)}function q(E){l.value===E&&G()}function Y(E){return l.value===E}function G(){l.value=""}function _e(E){if(l.value===E){G();return}l.value=E}function pe(E,N){g.value=E,I.value=N,f.value=!0,G(),Ht(()=>{var $,Z;($=j.value)==null||$.focus(),(Z=j.value)==null||Z.select()})}function me(){f.value=!1,g.value="",I.value=""}function Ie(){const E=g.value,N=I.value.trim();!E||!N||(r("rename-thread",{threadId:E,title:N}),me())}function Oe(E,N){B.value=E,ee.value=N,x.value=!0,G()}function Ve(){x.value=!1,B.value="",ee.value=""}function De(){const E=B.value;E&&(i.value=i.value.filter(N=>N!==E),r("archive",E),Ve())}function Xe(E){return n.projectDisplayNameById[E]??E}function ot(E){return a.value===E}function We(){a.value="",u.value="actions",c.value=""}function et(){ke.value=!ke.value}function St(E){$e.value=E,ke.value=!1}function Ot(E){if(a.value===E){We();return}a.value=E,u.value="actions",c.value=Xe(E)}function tt(E){a.value=E,u.value="rename",c.value=Xe(E)}function mt(E){r("rename-project",{projectName:E,displayName:c.value})}function Wt(E){r("remove-project",E),We()}function Pt(E){r("browse-project-files",E),We()}function qt(E,N){if(!E.altKey||E.key!=="ArrowUp"&&E.key!=="ArrowDown")return;const $=n.groups.findIndex(Et=>Et.projectName===N);if($<0)return;const Z=E.key==="ArrowUp"?-1:1,Ue=Math.max(0,Math.min($+Z,n.groups.length-1));Ue!==$&&(E.preventDefault(),r("reorder-project",{projectName:N,toIndex:Ue}))}function zt(E){return s.value[E]===!0}function Me(E){return o.value[E]===!0}function xe(E){s.value={...s.value,[E]:!zt(E)}}function Nt(E){if(ve.value===E){ve.value="";return}o.value={...o.value,[E]:!Me(E)}}function Tt(E){const N=Te.value[E]??0,$=K.value,Ue=(($==null?void 0:$.projectName)===E?$.groupHeight:null)??N,Et=Me(E)?0:Rc;return Math.max(0,Ue+Et)}function $t(E,N){const $=N instanceof HTMLElement?N:N&&"$el"in N&&N.$el instanceof HTMLElement?N.$el:null;if($){te.set(E,$);return}te.delete(E)}function rn(E,N){const $=N instanceof HTMLElement?N:N&&"$el"in N&&N.$el instanceof HTMLElement?N.$el:null;if($){re.set(E,$);return}re.delete(E)}function dn(E){const N=a.value;if(!N)return!1;const $=te.get(N);if(!$)return!1;if((typeof E.composedPath=="function"?E.composedPath():[]).includes($))return!0;const Ue=E.target;return Ue instanceof Node?$.contains(Ue):!1}function k(E){const N=l.value;if(!N)return!1;const $=re.get(N);if(!$)return!1;if((typeof E.composedPath=="function"?E.composedPath():[]).includes($))return!0;const Ue=E.target;return Ue instanceof Node?$.contains(Ue):!1}function C(E){if(ke.value){const N=Pe.value,$=typeof E.composedPath=="function"?E.composedPath():[];!!N&&($.includes(N)||E.target instanceof Node&&N.contains(E.target))||(ke.value=!1)}a.value&&(dn(E)||We(),l.value&&(k(E)||G()))}function A(E){a.value&&!dn(E)&&We(),l.value&&!k(E)&&G()}function J(){ke.value&&(ke.value=!1),a.value&&We(),l.value&&G()}function T(){window.addEventListener("pointerdown",C,{capture:!0}),window.addEventListener("focusin",A,{capture:!0}),window.addEventListener("blur",J)}function R(){window.removeEventListener("pointerdown",C,{capture:!0}),window.removeEventListener("focusin",A,{capture:!0}),window.removeEventListener("blur",J)}function F(E,N){const $=N.getBoundingClientRect().height;if(!Number.isFinite($)||$<=0)return;const Z=Te.value[E];Z!==void 0&&Math.abs(Z-$)<.5||(Te.value={...Te.value,[E]:$})}function se(E,N){const $=ae.get(E);$&&$!==N&&Ae&&Ae.unobserve($);const Z=N instanceof HTMLElement?N:N&&"$el"in N&&N.$el instanceof HTMLElement?N.$el:null;if(Z){ae.set(E,Z),X.set(Z,E),F(E,Z),Ae==null||Ae.observe(Z);return}$&&(Ae==null||Ae.unobserve($)),ae.delete(E)}function Re(E,N){if(E.button!==0||Q.value||K.value)return;const $=n.groups.findIndex(en=>en.projectName===N),Z=ae.get(N);if($<0||!Z)return;const Ue=Z.getBoundingClientRect(),Et=Me(N)?0:Rc;Q.value={projectName:N,fromIndex:$,startClientX:E.clientX,startClientY:E.clientY,pointerOffsetY:E.clientY-Ue.top,groupLeft:Ue.left,groupWidth:Ue.width,groupHeight:Ue.height,groupOuterHeight:Ue.height+Et},E.preventDefault(),Qe()}function Qe(){window.addEventListener("mousemove",it),window.addEventListener("mouseup",_t),window.addEventListener("keydown",Zt)}function Je(){window.removeEventListener("mousemove",it),window.removeEventListener("mouseup",_t),window.removeEventListener("keydown",Zt)}function it(E){le={clientX:E.clientX,clientY:E.clientY},Hr()}function _t(E){Tr({clientX:E.clientX,clientY:E.clientY});const N=K.value;if(N&&fe.value!==null){const $=n.groups.findIndex(Z=>Z.projectName===N.projectName);if($>=0){const Z=fe.value;Z!==$&&r("reorder-project",{projectName:N.projectName,toIndex:Z})}}Dt()}function Zt(E){E.key==="Escape"&&(!Q.value&&!K.value||(E.preventDefault(),Dt()))}function Dt(){de!==null&&(window.cancelAnimationFrame(de),de=null),le=null,Q.value=null,K.value=null,ve.value="",Je()}function Hr(){de===null&&(de=window.requestAnimationFrame(()=>{if(de=null,!le)return;const E=le;le=null,Tr(E)}))}function Tr(E){const N=Q.value;if(!K.value&&N){const $=E.clientX-N.startClientX,Z=E.clientY-N.startClientY;if(Math.hypot($,Z)<Ny)return;We(),ve.value=N.projectName,K.value={projectName:N.projectName,fromIndex:N.fromIndex,pointerOffsetY:N.pointerOffsetY,groupLeft:N.groupLeft,groupWidth:N.groupWidth,groupHeight:N.groupHeight,groupOuterHeight:N.groupOuterHeight,ghostTop:E.clientY-N.pointerOffsetY,dropTargetIndexFull:null}}K.value&&vs(E)}function vs(E){const N=K.value;if(!N)return;if(N.ghostTop=E.clientY-N.pointerOffsetY,!Ir(E)){N.dropTargetIndexFull=null;return}const $=E.clientY,Z=z.value;if(!Z){N.dropTargetIndexFull=null;return}const Ue=Z.getBoundingClientRect(),Et=new Map(n.groups.map((sn,bn)=>[sn.projectName,bn])),en=n.groups.map(sn=>sn.projectName).filter(sn=>sn!==N.projectName);let qr=0,Nn=n.groups.length;for(const sn of en){const bn=Et.get(sn);if(bn===void 0)continue;const zr=Tt(sn),bs=Ue.top+qr+zr/2;if($<bs){Nn=bn;break}qr+=zr}N.dropTargetIndexFull=Nn}function Ir(E){const N=z.value;if(!N)return!1;const $=N.getBoundingClientRect(),Z=E.clientX>=$.left&&E.clientX<=$.right,Ue=E.clientY>=$.top-32&&E.clientY<=$.bottom+32;return Z&&Ue}function Vr(E){var N;return((N=K.value)==null?void 0:N.projectName)===E}function ys(E){const N=K.value,$=be.value[E]??0,Z=a.value===E;return!N||N.projectName!==E?{position:"absolute",top:"0",left:"0",right:"0",zIndex:Z?"40":"1",transform:`translate3d(0, ${$}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${N.groupLeft}px`,width:`${N.groupWidth}px`,height:`${N.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${N.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function rr(E){return E.threads.filter(N=>!_(N.id))}function sr(E){if(Ge.value)return rr(E);if(Me(E.projectName))return[];const N=rr(E);return zt(E.projectName)?N:N.slice(0,10)}function Wr(E){return Ge.value?!1:!Me(E.projectName)&&rr(E).length>10}function ws(E){return rr(E).length>0}function or(E){return E.inProgress?"working":E.unread?"unread":"idle"}dt(()=>n.groups.map(E=>E.projectName),E=>{var Ue,Et;const N=((Ue=K.value)==null?void 0:Ue.projectName)??((Et=Q.value)==null?void 0:Et.projectName)??"";N&&!n.groups.some(en=>en.projectName===N)&&Dt();const $=new Set(E),Z=Object.fromEntries(Object.entries(Te.value).filter(([en])=>$.has(en)));Object.keys(Z).length!==Object.keys(Te.value).length&&(Te.value=Z)});const ir=ce(()=>ke.value||a.value!=="");return dt(ir,E=>{if(E){T();return}R()}),nr(()=>{for(const E of ae.values())Ae==null||Ae.unobserve(E);ae.clear(),te.clear(),R(),Dt()}),(E,N)=>(b(),S("section",Sv,[W.value.length>0?(b(),S("section",Ev,[p("ul",Cv,[(b(!0),S(Le,null,bt(W.value,$=>(b(),S("li",{key:$.id,class:"thread-row-item"},[Se(Pr,{class:"thread-row","data-active":$.id===e.selectedThreadId,"data-pinned":_($.id),onMouseleave:Z=>q($.id)},{left:gt(()=>[p("span",Av,[$.inProgress||$.unread?(b(),S("span",{key:0,class:"thread-status-indicator","data-state":or($)},null,8,Rv)):ie("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Z=>M($.id)},[Se(Di,{class:"thread-icon"})],8,Pv)])]),right:gt(()=>[p("span",Nv,oe(v($.createdAtIso||$.updatedAtIso)),1)]),"right-hover":gt(()=>[p("div",{ref_for:!0,ref:Z=>rn($.id,Z),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:rt(Z=>_e($.id),["stop"])},[Se(Cs,{class:"thread-icon"})],8,$v),Y($.id)?(b(),S("div",{key:0,class:"thread-menu-panel",onClick:N[0]||(N[0]=rt(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:Z=>U($.id)}," Export chat ",8,Dv),p("button",{class:"thread-menu-item",type:"button",onClick:Z=>pe($.id,$.title)}," Rename thread ",8,Lv),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Z=>Oe($.id,$.title)}," Delete thread ",8,jv)])):ie("",!0)],512)]),default:gt(()=>[p("button",{class:"thread-main-button",type:"button",onClick:Z=>H($.id)},[p("span",Mv,[p("span",Ov,oe($.title),1),$.hasWorktree?(b(),ut(Io,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ie("",!0)])],8,xv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):ie("",!0),Se(Pr,{as:"header",class:"thread-tree-header-row"},{right:gt(()=>[p("div",{ref_key:"organizeMenuWrapRef",ref:Pe,class:"organize-menu-wrap"},[p("button",{class:"organize-menu-trigger",type:"button","aria-expanded":ke.value,"aria-label":"Organize threads",title:"Organize threads",onClick:et},[Se(Cs,{class:"thread-icon"})],8,Bv),ke.value?(b(),S("div",{key:0,class:"organize-menu-panel",onClick:N[3]||(N[3]=rt(()=>{},["stop"]))},[N[11]||(N[11]=p("p",{class:"organize-menu-title"},"Organize",-1)),p("button",{class:"organize-menu-item","data-active":$e.value==="project",type:"button",onClick:N[1]||(N[1]=$=>St("project"))},[N[9]||(N[9]=p("span",null,"By project",-1)),$e.value==="project"?(b(),S("span",Fv,"✓")):ie("",!0)],8,Uv),p("button",{class:"organize-menu-item","data-active":$e.value==="chronological",type:"button",onClick:N[2]||(N[2]=$=>St("chronological"))},[N[10]||(N[10]=p("span",null,"Chronological list",-1)),$e.value==="chronological"?(b(),S("span",Vv,"✓")):ie("",!0)],8,Hv)])):ie("",!0)],512)]),default:gt(()=>[N[12]||(N[12]=p("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Ge.value&&Ze.value.length===0?(b(),S("p",Wv,"No matching threads")):e.isLoading&&e.groups.length===0?(b(),S("p",qv,"Loading threads...")):pt.value?(b(),S("ul",zv,[(b(!0),S(Le,null,bt(Ne.value,$=>(b(),S("li",{key:$.id,class:"thread-row-item"},[Se(Pr,{class:"thread-row","data-active":$.id===e.selectedThreadId,"data-pinned":_($.id),onMouseleave:Z=>q($.id)},{left:gt(()=>[p("span",Gv,[$.inProgress||$.unread?(b(),S("span",{key:0,class:"thread-status-indicator","data-state":or($)},null,8,Kv)):ie("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Z=>M($.id)},[Se(Di,{class:"thread-icon"})],8,Jv)])]),right:gt(()=>[p("span",Zv,oe(v($.createdAtIso||$.updatedAtIso)),1)]),"right-hover":gt(()=>[p("div",{ref_for:!0,ref:Z=>rn($.id,Z),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:rt(Z=>_e($.id),["stop"])},[Se(Cs,{class:"thread-icon"})],8,ey),Y($.id)?(b(),S("div",{key:0,class:"thread-menu-panel",onClick:N[4]||(N[4]=rt(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:Z=>U($.id)}," Export chat ",8,ty),p("button",{class:"thread-menu-item",type:"button",onClick:Z=>pe($.id,$.title)}," Rename thread ",8,ny),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Z=>Oe($.id,$.title)}," Delete thread ",8,ry)])):ie("",!0)],512)]),default:gt(()=>[p("button",{class:"thread-main-button",type:"button",onClick:Z=>H($.id)},[p("span",Xv,[p("span",Qv,oe($.title),1),$.hasWorktree?(b(),ut(Io,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ie("",!0)])],8,Yv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(b(),S("div",{key:4,ref_key:"groupsContainerRef",ref:z,class:"thread-tree-groups",style:Ur(Ce.value)},[(b(!0),S(Le,null,bt(Ze.value,$=>(b(),S("article",{key:$.projectName,ref_for:!0,ref:Z=>se($.projectName,Z),class:"project-group","data-project-name":$.projectName,"data-expanded":!Me($.projectName),"data-dragging":Vr($.projectName),style:Ur(ys($.projectName))},[Se(Pr,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:Z=>Nt($.projectName),onKeydown:[Z=>qt(Z,$.projectName),Yt(rt(Z=>Nt($.projectName),["prevent"]),["enter"]),Yt(rt(Z=>Nt($.projectName),["prevent"]),["space"])]},{left:gt(()=>[p("span",oy,[p("span",iy,[Me($.projectName)?(b(),ut(Za,{key:0,class:"thread-icon"})):(b(),ut(fv,{key:1,class:"thread-icon"}))]),p("span",ay,[Me($.projectName)?(b(),ut(sf,{key:0,class:"thread-icon"})):(b(),ut(ai,{key:1,class:"thread-icon"}))])])]),right:gt(()=>[p("div",uy,[p("div",{ref_for:!0,ref:Z=>$t($.projectName,Z),class:"project-menu-wrap"},[p("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:rt(Z=>Ot($.projectName),["stop"])},[Se(Cs,{class:"thread-icon"})],8,dy),ot($.projectName)?(b(),S("div",{key:0,class:"project-menu-panel",onClick:N[6]||(N[6]=rt(()=>{},["stop"]))},[u.value==="actions"?(b(),S(Le,{key:0},[p("button",{class:"project-menu-item",type:"button",onClick:Z=>Pt($.projectName)}," Browse files ",8,fy),p("button",{class:"project-menu-item",type:"button",onClick:Z=>tt($.projectName)}," Edit name ",8,hy),p("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:Z=>Wt($.projectName)}," Remove ",8,py)],64)):(b(),S(Le,{key:1},[N[13]||(N[13]=p("label",{class:"project-menu-label"},"Project name",-1)),Yn(p("input",{"onUpdate:modelValue":N[5]||(N[5]=Z=>c.value=Z),class:"project-menu-input",type:"text",onInput:Z=>mt($.projectName)},null,40,my),[[Xn,c.value]])],64))])):ie("",!0)],512),p("button",{class:"thread-start-button",type:"button","aria-label":O($.projectName),title:O($.projectName),onClick:rt(Z=>L($.projectName),["stop"])},[Se(Lo,{class:"thread-icon"})],8,gy)])]),default:gt(()=>[p("span",{class:"project-main-button","data-dragging-handle":Vr($.projectName),onMousedown:rt(Z=>Re(Z,$.projectName),["left"])},[p("span",cy,oe(Xe($.projectName)),1)],40,ly)]),_:2},1032,["onClick","onKeydown"]),ws($)?(b(),S("ul",vy,[(b(!0),S(Le,null,bt(sr($),Z=>(b(),S("li",{key:Z.id,class:"thread-row-item"},[Se(Pr,{class:"thread-row","data-active":Z.id===e.selectedThreadId,"data-pinned":_(Z.id),onMouseleave:Ue=>q(Z.id)},{left:gt(()=>[p("span",yy,[Z.inProgress||Z.unread?(b(),S("span",{key:0,class:"thread-status-indicator","data-state":or(Z)},null,8,wy)):ie("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Ue=>M(Z.id)},[Se(Di,{class:"thread-icon"})],8,by)])]),right:gt(()=>[p("span",Iy,oe(v(Z.createdAtIso||Z.updatedAtIso)),1)]),"right-hover":gt(()=>[p("div",{ref_for:!0,ref:Ue=>rn(Z.id,Ue),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:rt(Ue=>_e(Z.id),["stop"])},[Se(Cs,{class:"thread-icon"})],8,Sy),Y(Z.id)?(b(),S("div",{key:0,class:"thread-menu-panel",onClick:N[7]||(N[7]=rt(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:Ue=>U(Z.id)}," Export chat ",8,Ey),p("button",{class:"thread-menu-item",type:"button",onClick:Ue=>pe(Z.id,Z.title)}," Rename thread ",8,Cy),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Ue=>Oe(Z.id,Z.title)}," Delete thread ",8,Ay)])):ie("",!0)],512)]),default:gt(()=>[p("button",{class:"thread-main-button",type:"button",onClick:Ue=>H(Z.id)},[p("span",ky,[p("span",Ty,oe(Z.title),1),Z.hasWorktree?(b(),ut(Io,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ie("",!0)])],8,_y)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(b(),ut(Pr,{key:1,as:"p",class:"project-empty-row"},{left:gt(()=>[...N[14]||(N[14]=[p("span",{class:"project-empty-spacer"},null,-1)])]),default:gt(()=>[N[15]||(N[15]=p("span",{class:"project-empty"},"No threads",-1))]),_:1})),Wr($)?(b(),ut(Pr,{key:2,class:"thread-show-more-row"},{left:gt(()=>[...N[16]||(N[16]=[p("span",{class:"thread-show-more-spacer"},null,-1)])]),default:gt(()=>[p("button",{class:"thread-show-more-button",type:"button",onClick:Z=>xe($.projectName)},oe(zt($.projectName)?"Show less":"Show more"),9,Ry)]),_:2},1024)):ie("",!0)],12,sy))),128))],4)),(b(),ut(Mo,{to:"body"},[f.value?(b(),S("div",{key:0,class:"rename-thread-overlay",onClick:rt(me,["self"])},[p("div",Py,[N[17]||(N[17]=p("h3",{class:"rename-thread-title"},"Rename thread",-1)),N[18]||(N[18]=p("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Yn(p("input",{ref_key:"renameThreadInputRef",ref:j,"onUpdate:modelValue":N[8]||(N[8]=$=>I.value=$),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Yt(rt(Ie,["prevent"]),["enter"]),Yt(rt(me,["prevent"]),["esc"])]},null,40,xy),[[Xn,I.value]]),p("div",{class:"rename-thread-actions"},[p("button",{class:"rename-thread-button",type:"button",onClick:me},"Cancel"),p("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Ie},"Save")])])])):ie("",!0)])),(b(),ut(Mo,{to:"body"},[x.value?(b(),S("div",{key:0,class:"rename-thread-overlay",onClick:rt(Ve,["self"])},[p("div",My,[N[19]||(N[19]=p("h3",{class:"rename-thread-title"},"Delete thread?",-1)),p("p",Oy,' This will archive the thread "'+oe(ee.value)+'". You can find it later in archived threads. ',1),p("div",{class:"rename-thread-actions"},[p("button",{class:"rename-thread-button",type:"button",onClick:Ve},"Cancel"),p("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:De},"Delete")])])])):ie("",!0)]))]))}}),Dy=nt($y,[["__scopeId","data-v-e2f8a8e1"]]),Ly={class:"content-header"},jy={class:"content-leading"},By={class:"content-title"},Uy={class:"content-actions"},Fy=Rt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(b(),S("header",Ly,[p("div",jy,[Pn(t.$slots,"leading",{},void 0)]),p("h1",By,oe(e.title),1),p("div",Uy,[Pn(t.$slots,"actions",{},void 0)])]))}}),Hy=nt(Fy,[["__scopeId","data-v-66ee223c"]]),Vy={},Wy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function qy(e,t){return b(),S("svg",Wy,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const el=nt(Vy,[["render",qy]]),zy={},Gy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ky(e,t){return b(),S("svg",Gy,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const Jy=nt(zy,[["render",Ky]]),Yy={},Xy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Qy(e,t){return b(),S("svg",Xy,[...t[0]||(t[0]=[p("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 Zy=nt(Yy,[["render",Qy]]),ew={class:"conversation-root"},tw={key:0,class:"conversation-loading"},nw={key:1,class:"conversation-empty"},rw={class:"message-row"},sw={class:"message-stack"},ow={class:"request-card"},iw={class:"request-title"},aw={class:"request-meta"},lw={key:0,class:"request-reason"},cw={key:1,class:"request-actions"},uw=["onClick"],dw=["onClick"],fw=["onClick"],hw=["onClick"],pw={key:2,class:"request-actions"},mw=["onClick"],gw=["onClick"],vw=["onClick"],yw=["onClick"],ww={key:3,class:"request-user-input"},bw={class:"request-question-title"},_w={key:0,class:"request-question-text"},kw=["value","onChange"],Tw=["value"],Iw=["value","onInput"],Sw=["onClick"],Ew={key:4,class:"request-actions"},Cw=["onClick"],Aw=["onClick"],Rw={key:5,class:"request-actions"},Pw=["onClick"],xw=["onClick"],Mw=["data-role","data-message-type"],Ow={key:0,class:"message-row","data-role":"system"},Nw={class:"message-stack","data-role":"system"},$w=["onClick"],Dw={class:"cmd-label"},Lw={class:"cmd-status"},jw={class:"cmd-output-inner"},Bw={class:"cmd-output"},Uw=["data-role","data-message-type"],Fw=["data-role"],Hw=["data-role"],Vw=["data-role"],Ww=["onClick"],qw=["src"],zw={key:1,class:"message-file-attachments"},Gw=["href","title"],Kw=["data-role"],Jw={key:0,class:"worked-separator-wrap","aria-live":"polite"},Yw=["onClick"],Xw={class:"worked-separator-text"},Qw={key:0,class:"worked-details"},Zw=["onClick"],eb={class:"cmd-label"},tb={class:"cmd-status"},nb={class:"cmd-output-inner"},rb={class:"cmd-output"},sb={key:1,class:"message-text-flow"},ob={key:0,class:"message-text"},ib={key:0},ab={key:1,class:"message-bold-text"},lb=["href","title"],cb=["href","title"],ub={key:4,class:"message-inline-code"},db={key:1,class:"message-text"},fb=["onClick"],hb=["src","alt","onError"],pb={key:0,class:"message-actions"},mb=["onClick"],gb=["onClick"],vb={key:0,class:"conversation-item conversation-item-overlay"},yb={class:"message-row"},wb={class:"message-stack"},bb={class:"live-overlay-inline","aria-live":"polite"},_b={class:"live-overlay-label"},kb={key:1,class:"live-overlay-error"},Tb=["src"],Ib=16,Sb=Rt({__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=D(new Set),r=D(new Set),s=D(new Set),o=D({});function i(k){return k.messageType==="commandExecution"&&!!k.commandExecution}function a(k){var C;return((C=k.commandExecution)==null?void 0:C.status)==="inProgress"||r.value.has(k.id)?!0:n.value.has(k.id)}function l(k){return r.value.has(k.id)}function u(k){var A;if(((A=k.commandExecution)==null?void 0:A.status)==="inProgress")return;const C=new Set(n.value);C.has(k.id)?C.delete(k.id):C.add(k.id),n.value=C}function c(k){const C=new Set(s.value);C.has(k.id)?C.delete(k.id):C.add(k.id),s.value=C}function f(k){return s.value.has(k.id)}function g(k){const C=k.commandExecution;if(!C)return"";switch(C.status){case"inProgress":return"⟳ Running";case"completed":return C.exitCode===0?"✓ Completed":`✗ Exit ${C.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function I(k){var A,J;const C=(A=k.commandExecution)==null?void 0:A.status;return C==="inProgress"?"cmd-status-running":C==="completed"&&((J=k.commandExecution)==null?void 0:J.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function j(k){const C=new Set(r.value);C.add(k),r.value=C,setTimeout(()=>{const A=new Set(r.value);A.delete(k),r.value=A},1e3)}function x(k,C){const A=[];for(let J=C-1;J>=0;J--){const T=k[J];if(T.messageType==="commandExecution")A.unshift(T);else if(T.role==="user"||T.messageType==="worked")break}return A}const B=e,ee=t,z=D(null),Q=D(null),K=D(null),le=D(""),de=D({}),ve=D({});let Te=0,ae=0,te=0;const re=new WeakSet,X=D(new Set);function Pe(k){if(!k||/\s/u.test(k)||k.endsWith("/")||k.endsWith("\\"))return!1;if(k.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(k))return!1;const C=k.startsWith("/"),A=/^[A-Za-z]:[\\/]/u.test(k),J=k.startsWith("./")||k.startsWith("../")||k.startsWith("~/"),T=k.includes("/")||k.includes("\\");return C||A||J||T}function ke(k){return k.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||k}function $e(k){return k.replace(/\\/gu,"/")}function Ae(k){if(!k.startsWith("file://"))return k;let C=k.replace(/^file:\/\//u,"");try{C=decodeURIComponent(C)}catch{}return/^\/[A-Za-z]:\//u.test(C)&&(C=C.slice(1)),C}function we(k){const C=$e(k),A=C.match(/^\/Users\/([^/]+)/u);if(A)return`/Users/${A[1]}`;const J=C.match(/^\/home\/([^/]+)/u);return J?`/home/${J[1]}`:""}function Ee(k){const C=$e(k);if(!C)return C;let A="",J=C;const T=J.match(/^([A-Za-z]:)(\/.*)?$/u);T?(A=`${T[1]}/`,J=(T[2]??"").replace(/^\/+/u,"")):J.startsWith("/")&&(A="/",J=J.slice(1));const R=J.split("/").filter(Boolean),F=[];for(const Re of R)if(Re!=="."){if(Re===".."){F.length>0&&F.pop();continue}F.push(Re)}const se=F.join("/");return A?`${A}${se}`.replace(/\/+$/u,"")||A:se||C}function ht(k,C){const A=$e(Ae(k.trim()));if(!A)return"";if(A.startsWith("/")||/^[A-Za-z]:\//u.test(A))return Ee(A);if(A.startsWith("~/")){const R=we(C);if(R)return Ee(`${R}/${A.slice(2)}`)}const T=$e(C.trim());return Ee(T?`${T.replace(/\/+$/u,"")}/${A}`:A)}function Ge(k){if(!k)return null;let C=k.trim();C=He(C).core.trim();let J=null;const T=C.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(T)C=T[1],J=Number(T[2]);else{const R=C.match(/^(.*):(\d+)(?::\d+)?$/u);R&&(C=R[1],J=Number(R[2]))}return C=Ae(C),Pe(C)?{path:C,line:J}:null}function He(k){let C=k,A="",J="";for(;/^[('"`[{<“‘]/u.test(C);)A+=C[0],C=C.slice(1);for(;/[)"'`\]}>”’]$/u.test(C);)J=C.slice(-1)+J,C=C.slice(0,-1);return{core:C,leading:A,trailing:J}}function Ke(k){const A=k.trim().match(/^\[([^\]\n]+)\]\(([^)\n]+)\)$/u);if(!A)return null;const J=(A[1]??"").trim(),T=(A[2]??"").trim(),R=He(J).core.trim()||J,F=He(T).core.trim();return F?{label:R,target:F}:null}function Ze(k){const C=[],A=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let J=0;for(const T of k.matchAll(A)){if(typeof T.index!="number")continue;const R=T.index,F=R+T[0].length;R>J&&C.push({kind:"text",value:k.slice(J,R)});let se=T[0],Re="";for(;/[.,;:]$/u.test(se);)Re=se.slice(-1)+Re,se=se.slice(0,-1);const Qe=He(se);se=Qe.core;const Je=Qe.leading,it=Qe.trailing+Re;if(Je&&C.push({kind:"text",value:Je}),se.startsWith("**")&&se.endsWith("**")&&se.length>4)C.push({kind:"bold",value:se.slice(2,-2)}),it&&C.push({kind:"text",value:it});else if(/^https?:\/\//u.test(se))C.push({kind:"url",value:se,href:se}),it&&C.push({kind:"text",value:it});else{const _t=Ge(se);_t?(C.push({kind:"file",value:se,path:_t.path,displayPath:se,downloadName:ke(_t.path)}),it&&C.push({kind:"text",value:it})):C.push({kind:"text",value:T[0]})}J=F}return J<k.length&&C.push({kind:"text",value:k.slice(J)}),pt(C)}function pt(k){const C=[];let A=!1,J="";const T=R=>{R&&C.push({kind:"text",value:R})};for(const R of k){if(R.kind!=="text"){A&&(T(`**${J}`),A=!1,J=""),C.push(R);continue}let F=R.value;for(;F.length>0;){const se=F.indexOf("**");if(se<0){A?J+=F:T(F);break}const Re=F.slice(0,se);A?J+=Re:T(Re),F=F.slice(se+2),A?(J.length>0?C.push({kind:"bold",value:J}):T("****"),J="",A=!1):A=!0}}return A&&T(`**${J}`),C}function Ne(k){const C=/\[([^\]\n]+)\]\(([^)\n]+)\)/gu,A=[];let J=0;for(const T of k.matchAll(C)){if(typeof T.index!="number")continue;const[R,F,se]=T,Re=T.index,Qe=Re+R.length;Re>J&&A.push(...Ze(k.slice(J,Re)));const Je=Ke(`[${F??""}](${se??""})`),it=(Je==null?void 0:Je.label)??(F??"").trim(),_t=(Je==null?void 0:Je.target)??(se??"").trim();if(/^https?:\/\//u.test(_t))A.push({kind:"url",value:it||_t,href:_t});else{const Zt=Ge(_t);Zt?A.push({kind:"file",value:_t,path:Zt.path,displayPath:it||_t,downloadName:ke(Zt.path)}):A.push({kind:"text",value:R})}J=Qe}return J<k.length&&A.push(...Ze(k.slice(J))),A}function Be(k){if(!k.includes("`"))return Ne(k);const C=[];let A=0,J=0;for(;A<k.length;){if(k[A]!=="`"){A+=1;continue}let T=1;for(;A+T<k.length&&k[A+T]==="`";)T+=1;const R="`".repeat(T);let F=A+T,se=-1;for(;F<k.length;){const Qe=k.indexOf(R,F);if(Qe<0)break;const Je=Qe>0&&k[Qe-1]==="`",it=Qe+T<k.length&&k[Qe+T]==="`",_t=k.slice(A+T,Qe).includes(`
26
+ `);if(!Je&&!it&&!_t){se=Qe;break}F=Qe+1}if(se<0){A+=T;continue}A>J&&C.push(...Ne(k.slice(J,A)));const Re=k.slice(A+T,se);if(Re.length>0){const Qe=Ke(Re);if(Qe)if(/^https?:\/\//u.test(Qe.target))C.push({kind:"url",value:Qe.label||Qe.target,href:Qe.target});else{const Je=Ge(Qe.target);Je?C.push({kind:"file",value:Qe.target,path:Je.path,displayPath:Qe.label||Qe.target,downloadName:ke(Je.path)}):C.push({kind:"code",value:Re})}else{const Je=Ge(Re);if(Je){const it=Je.line?`${Je.path}:${String(Je.line)}`:Je.path;C.push({kind:"file",value:Re,path:Je.path,displayPath:it,downloadName:ke(Je.path)})}else C.push({kind:"code",value:Re})}}else C.push({kind:"text",value:`${R}${R}`});A=se+T,J=A}return J<k.length&&C.push(...Ne(k.slice(J))),C}function W(k){const C=k.trim();if(!C)return"";if(C.startsWith("data:")||C.startsWith("blob:")||C.startsWith("http://")||C.startsWith("https://")||C.startsWith("/codex-local-image?"))return C;if(C.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(C)}`;const A=C.startsWith("/"),J=/^[A-Za-z]:[\\/]/u.test(C);return A||J?`/codex-local-image?path=${encodeURIComponent(C)}`:C}function fe(k){const C=k.trim();if(!C)return"#";const A=F=>F.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(F),J=Ge(C),T=(J==null?void 0:J.path)??C,R=ht(T,B.cwd);if(A(R)){const F=R.startsWith("/")?R:`/${R}`;return`/codex-local-browse${encodeURI(F)}`}return"#"}function ue(k){if(!k.includes("![")||!k.includes("]("))return[{kind:"text",value:k}];const C=[],A=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let J=0;for(const T of k.matchAll(A)){const[R,F,se]=T;if(typeof T.index!="number")continue;const Re=T.index,Qe=Re+R.length,Je=W(se.trim());Je&&(Re>J&&C.push({kind:"text",value:k.slice(J,Re)}),C.push({kind:"image",url:Je,alt:F.trim(),markdown:R}),J=Qe)}return J<k.length&&C.push({kind:"text",value:k.slice(J)}),C.length>0?C:[{kind:"text",value:k}]}function be(k){return k!==null&&typeof k=="object"&&!Array.isArray(k)?k:null}function Ce(k){const C=new Date(k);return Number.isNaN(C.getTime())?k:C.toLocaleTimeString()}function v(k){const C=be(k.params),A=C==null?void 0:C.reason;return typeof A=="string"?A.trim():""}function _(k,C){return`${String(k)}:${C}`}function M(k){const C=be(k.params),A=Array.isArray(C==null?void 0:C.questions)?C.questions:[],J=[];for(const T of A){const R=be(T);if(!R)continue;const F=typeof R.id=="string"?R.id:"";if(!F)continue;const se=Array.isArray(R.options)?R.options.map(Re=>be(Re)).map(Re=>Re==null?void 0:Re.label).filter(Re=>typeof Re=="string"&&Re.length>0):[];J.push({id:F,header:typeof R.header=="string"?R.header:"",question:typeof R.question=="string"?R.question:"",isOther:R.isOther===!0,options:se})}return J}function H(k,C,A){const J=_(k,C),T=de.value[J];return typeof T=="string"&&T.length>0?T:A}function U(k,C){const A=_(k,C);return ve.value[A]??""}function O(k,C,A){const J=A.target;if(!(J instanceof HTMLSelectElement))return;const T=_(k,C);de.value={...de.value,[T]:J.value}}function L(k,C,A){const J=A.target;if(!(J instanceof HTMLInputElement))return;const T=_(k,C);ve.value={...ve.value,[T]:J.value}}function q(k,C){ee("respondServerRequest",{id:k,result:{decision:C}})}function Y(k){const C=M(k),A={};for(const J of C){const T=H(k.id,J.id,J.options[0]||""),R=U(k.id,J.id).trim(),F=[T,R].map(se=>se.trim()).filter(se=>se.length>0);A[J.id]={answers:F}}ee("respondServerRequest",{id:k.id,result:{answers:A}})}function G(k){ee("respondServerRequest",{id:k,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function _e(k){ee("respondServerRequest",{id:k,result:{success:!0,contentItems:[]}})}function pe(k){ee("respondServerRequest",{id:k,result:{}})}function me(k){ee("respondServerRequest",{id:k,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function Ie(k){return!(k.role!=="user"&&k.role!=="assistant"||typeof k.turnIndex!="number"||B.isTurnInProgress||B.isRollingBack)}function Oe(k){return k.role!=="user"&&k.role!=="assistant"?!1:k.text.trim().length>0}function Ve(k){return Oe(k)||Ie(k)}async function De(k){if(!Oe(k))return;const C=k.text.trim();try{await navigator.clipboard.writeText(C)}catch{const A=document.createElement("textarea");A.value=C,A.setAttribute("readonly","true"),A.style.position="fixed",A.style.opacity="0",document.body.appendChild(A),A.select(),document.execCommand("copy"),document.body.removeChild(A)}}function Xe(k){if(!Ie(k))return;const C=k.role==="user"?k.text.trim():"";ee("rollback",{turnIndex:k.turnIndex,prependText:C.length>0?C:void 0})}function ot(){const k=z.value,C=Q.value;!k||!C||(k.scrollTop=k.scrollHeight,C.scrollIntoView({block:"end"}))}function We(k){return k.scrollHeight-(k.scrollTop+k.clientHeight)<=Ib}function et(k){if(!B.activeThreadId)return;const C=Math.max(k.scrollHeight-k.clientHeight,0),A=C>0?Math.min(Math.max(k.scrollTop/C,0),1):1;ee("updateScrollState",{threadId:B.activeThreadId,state:{scrollTop:k.scrollTop,isAtBottom:We(k),scrollRatio:A}})}function St(){const k=z.value;if(!k)return;const C=B.scrollState;if(!C||C.isAtBottom){Ot();return}const A=Math.max(k.scrollHeight-k.clientHeight,0),J=typeof C.scrollRatio=="number"?C.scrollRatio*A:C.scrollTop;k.scrollTop=Math.min(Math.max(J,0),A),et(k)}function Ot(){const k=z.value;k&&(ot(),et(k))}function tt(){const k=B.scrollState;return!k||k.isAtBottom===!0}function mt(){if(!tt()){te=0,ae=0;return}if(Ot(),te-=1,te<=0){ae=0;return}ae=requestAnimationFrame(mt)}function Wt(k=6){tt()&&(ae&&(cancelAnimationFrame(ae),ae=0),te=Math.max(k,1),ae=requestAnimationFrame(mt))}function Pt(){Wt(3)}function qt(){if(!tt())return;const k=z.value;if(!k)return;const C=k.querySelectorAll("img.message-image-preview");for(const A of C)A.complete||re.has(A)||(re.add(A),A.addEventListener("load",Pt,{once:!0}),A.addEventListener("error",Pt,{once:!0}))}async function zt(){await Ht(),Te&&cancelAnimationFrame(Te),Te=requestAnimationFrame(()=>{Te=0,St(),qt(),Wt()})}dt(()=>B.messages,async k=>{if(!B.isLoading){for(const C of k){if(C.messageType!=="commandExecution"||!C.commandExecution)continue;const A=o.value[C.id],J=C.commandExecution.status;A==="inProgress"&&J!=="inProgress"&&j(C.id),o.value[C.id]=J}await zt()}}),dt(()=>B.liveOverlay,async k=>{k&&(await Ht(),Ot(),Wt(8))},{deep:!0}),dt(()=>B.isLoading,async k=>{k||await zt()}),dt(()=>B.activeThreadId,()=>{le.value="",X.value=new Set},{flush:"post"});function Me(){const k=z.value;!k||B.isLoading||et(k)}function xe(k){le.value=W(k)}function Nt(k,C){return`${k}:${String(C)}`}function Tt(k,C){const A=new Set(X.value);A.add(Nt(k,C)),X.value=A}function $t(k,C){return X.value.has(Nt(k,C))}function rn(){le.value=""}function dn(){const k=K.value;k&&(k.scrollTop=k.scrollHeight)}return dt(()=>{var k;return(k=B.liveOverlay)==null?void 0:k.reasoningText},async k=>{k&&(await Ht(),dn())}),nr(()=>{Te&&cancelAnimationFrame(Te),ae&&cancelAnimationFrame(ae)}),(k,C)=>(b(),S("section",ew,[e.isLoading?(b(),S("p",tw,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(b(),S("p",nw," No messages in this thread yet. ")):(b(),S("ul",{key:2,ref_key:"conversationListRef",ref:z,class:"conversation-list",onScroll:Me},[(b(!0),S(Le,null,bt(e.pendingRequests,A=>(b(),S("li",{key:`server-request:${A.id}`,class:"conversation-item conversation-item-request"},[p("div",rw,[p("div",sw,[p("article",ow,[p("p",iw,oe(A.method),1),p("p",aw,"Request #"+oe(A.id)+" · "+oe(Ce(A.receivedAtIso)),1),v(A)?(b(),S("p",lw,oe(v(A)),1)):ie("",!0),A.method==="item/commandExecution/requestApproval"?(b(),S("section",cw,[p("button",{type:"button",class:"request-button request-button-primary",onClick:J=>q(A.id,"accept")},"Accept",8,uw),p("button",{type:"button",class:"request-button",onClick:J=>q(A.id,"acceptForSession")},"Accept for Session",8,dw),p("button",{type:"button",class:"request-button",onClick:J=>q(A.id,"decline")},"Decline",8,fw),p("button",{type:"button",class:"request-button",onClick:J=>q(A.id,"cancel")},"Cancel",8,hw)])):A.method==="item/fileChange/requestApproval"?(b(),S("section",pw,[p("button",{type:"button",class:"request-button request-button-primary",onClick:J=>q(A.id,"accept")},"Accept",8,mw),p("button",{type:"button",class:"request-button",onClick:J=>q(A.id,"acceptForSession")},"Accept for Session",8,gw),p("button",{type:"button",class:"request-button",onClick:J=>q(A.id,"decline")},"Decline",8,vw),p("button",{type:"button",class:"request-button",onClick:J=>q(A.id,"cancel")},"Cancel",8,yw)])):A.method==="item/tool/requestUserInput"?(b(),S("section",ww,[(b(!0),S(Le,null,bt(M(A),J=>(b(),S("div",{key:`${A.id}:${J.id}`,class:"request-question"},[p("p",bw,oe(J.header||J.question),1),J.header&&J.question?(b(),S("p",_w,oe(J.question),1)):ie("",!0),p("select",{class:"request-select",value:H(A.id,J.id,J.options[0]||""),onChange:T=>O(A.id,J.id,T)},[(b(!0),S(Le,null,bt(J.options,T=>(b(),S("option",{key:`${A.id}:${J.id}:${T}`,value:T},oe(T),9,Tw))),128))],40,kw),J.isOther?(b(),S("input",{key:1,class:"request-input",type:"text",value:U(A.id,J.id),placeholder:"Other answer",onInput:T=>L(A.id,J.id,T)},null,40,Iw)):ie("",!0)]))),128)),p("button",{type:"button",class:"request-button request-button-primary",onClick:J=>Y(A)}," Submit Answers ",8,Sw)])):A.method==="item/tool/call"?(b(),S("section",Ew,[p("button",{type:"button",class:"request-button request-button-primary",onClick:J=>G(A.id)},"Fail Tool Call",8,Cw),p("button",{type:"button",class:"request-button",onClick:J=>_e(A.id)},"Success (Empty)",8,Aw)])):(b(),S("section",Rw,[p("button",{type:"button",class:"request-button request-button-primary",onClick:J=>pe(A.id)},"Return Empty Result",8,Pw),p("button",{type:"button",class:"request-button",onClick:J=>me(A.id)},"Reject Request",8,xw)]))])])])]))),128)),(b(!0),S(Le,null,bt(e.messages,A=>{var J,T;return b(),S("li",{key:A.id,class:st(["conversation-item",{"conversation-item-actionable":Ve(A)}]),"data-role":A.role,"data-message-type":A.messageType||""},[i(A)?(b(),S("div",Ow,[p("div",Nw,[p("button",{type:"button",class:st(["cmd-row",[I(A),{"cmd-expanded":a(A)}]]),onClick:R=>u(A)},[p("span",{class:st(["cmd-chevron",{"cmd-chevron-open":a(A)}])},"▶",2),p("code",Dw,oe(((J=A.commandExecution)==null?void 0:J.command)||"(command)"),1),p("span",Lw,oe(g(A)),1)],10,$w),p("div",{class:st(["cmd-output-wrap",{"cmd-output-visible":a(A),"cmd-output-collapsing":l(A)}])},[p("div",jw,[p("pre",Bw,oe(((T=A.commandExecution)==null?void 0:T.aggregatedOutput)||"(no output)"),1)])],2)])])):(b(),S("div",{key:1,class:"message-row","data-role":A.role,"data-message-type":A.messageType||""},[p("div",{class:"message-stack","data-role":A.role},[p("article",{class:"message-body","data-role":A.role},[A.images&&A.images.length>0?(b(),S("ul",{key:0,class:"message-image-list","data-role":A.role},[(b(!0),S(Le,null,bt(A.images,R=>(b(),S("li",{key:R,class:"message-image-item"},[p("button",{class:"message-image-button",type:"button",onClick:F=>xe(R)},[p("img",{class:"message-image-preview",src:W(R),alt:"Message image preview",loading:"lazy"},null,8,qw)],8,Ww)]))),128))],8,Vw)):ie("",!0),A.fileAttachments&&A.fileAttachments.length>0?(b(),S("div",zw,[(b(!0),S(Le,null,bt(A.fileAttachments,R=>(b(),S("span",{key:R.path,class:"message-file-chip"},[C[1]||(C[1]=p("span",{class:"message-file-chip-icon"},"📄",-1)),p("a",{class:"message-file-link message-file-chip-name",href:fe(R.path),target:"_blank",rel:"noopener noreferrer",title:R.path},oe(R.path),9,Gw)]))),128))])):ie("",!0),A.text.length>0?(b(),S("article",{key:2,class:"message-card","data-role":A.role},[A.messageType==="worked"?(b(),S("div",Jw,[p("button",{type:"button",class:"worked-separator",onClick:R=>c(A)},[C[2]||(C[2]=p("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),p("span",{class:st(["worked-chevron",{"worked-chevron-open":f(A)}])},"▶",2),p("p",Xw,oe(A.text),1),C[3]||(C[3]=p("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Yw),f(A)?(b(),S("div",Qw,[(b(!0),S(Le,null,bt(x(e.messages,e.messages.indexOf(A)),R=>{var F,se;return b(),S("div",{key:`worked-cmd-${R.id}`,class:"worked-cmd-item"},[p("button",{type:"button",class:st(["cmd-row",[I(R),{"cmd-expanded":a(R)}]]),onClick:Re=>u(R)},[p("span",{class:st(["cmd-chevron",{"cmd-chevron-open":a(R)}])},"▶",2),p("code",eb,oe(((F=R.commandExecution)==null?void 0:F.command)||"(command)"),1),p("span",tb,oe(g(R)),1)],10,Zw),p("div",{class:st(["cmd-output-wrap",{"cmd-output-visible":a(R),"cmd-output-collapsing":l(R)}])},[p("div",nb,[p("pre",rb,oe(((se=R.commandExecution)==null?void 0:se.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):ie("",!0)])):(b(),S("div",sb,[(b(!0),S(Le,null,bt(ue(A.text),(R,F)=>(b(),S(Le,{key:`block-${F}`},[R.kind==="text"?(b(),S("p",ob,[(b(!0),S(Le,null,bt(Be(R.value),(se,Re)=>(b(),S(Le,{key:`seg-${F}-${Re}`},[se.kind==="text"?(b(),S("span",ib,oe(se.value),1)):se.kind==="bold"?(b(),S("strong",ab,oe(se.value),1)):se.kind==="file"?(b(),S("a",{key:2,class:"message-file-link",href:fe(se.path),target:"_blank",rel:"noopener noreferrer",title:se.path},oe(se.displayPath),9,lb)):se.kind==="url"?(b(),S("a",{key:3,class:"message-file-link",href:se.href,target:"_blank",rel:"noopener noreferrer",title:se.href},oe(se.value),9,cb)):(b(),S("code",ub,oe(se.value),1))],64))),128))])):$t(A.id,F)?(b(),S("p",db,oe(R.markdown),1)):(b(),S("button",{key:2,class:"message-image-button",type:"button",onClick:se=>xe(R.url)},[p("img",{class:"message-image-preview message-markdown-image",src:R.url,alt:R.alt||"Embedded message image",loading:"lazy",onError:se=>Tt(A.id,F)},null,40,hb)],8,fb))],64))),128))]))],8,Kw)):ie("",!0)],8,Hw),Ve(A)?(b(),S("div",pb,[Oe(A)?(b(),S("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:R=>De(A)},[Se(Zy,{class:"message-action-icon"}),C[4]||(C[4]=p("span",{class:"message-action-label"},"Copy",-1))],8,mb)):ie("",!0),Ie(A)?(b(),S("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:R=>Xe(A)},[Se(Jy,{class:"message-action-icon"}),C[5]||(C[5]=p("span",{class:"message-action-label"},"Rollback",-1))],8,gb)):ie("",!0)])):ie("",!0)],8,Fw)],8,Uw))],10,Mw)}),128)),e.liveOverlay?(b(),S("li",vb,[p("div",yb,[p("div",wb,[p("article",bb,[p("p",_b,oe(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(b(),S("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:K},oe(e.liveOverlay.reasoningText),513)):ie("",!0),e.liveOverlay.errorText?(b(),S("p",kb,oe(e.liveOverlay.errorText),1)):ie("",!0)])])])])):ie("",!0),p("li",{ref_key:"bottomAnchorRef",ref:Q,class:"conversation-bottom-anchor"},null,512)],544)),le.value.length>0?(b(),S("div",{key:3,class:"image-modal-backdrop",onClick:rn},[p("div",{class:"image-modal-content",onClick:C[0]||(C[0]=rt(()=>{},["stop"]))},[p("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:rn},[Se(el,{class:"icon-svg"})]),p("img",{class:"image-modal-image",src:le.value,alt:"Expanded message image"},null,8,Tb)])])):ie("",!0)]))}}),Eb=nt(Sb,[["__scopeId","data-v-a273105f"]]),Mc=.0025,Li=3,Oc=2,Cb=256;function Ab(e){var te;const t=D("idle"),n=D(typeof navigator<"u"&&!!((te=navigator.mediaDevices)!=null&&te.getUserMedia)),r=D(0),s=D(null);let o=null,i=null,a=[],l=null,u=null,c=null,f=null,g=[],I=!1,j=!1,x=null;function B(){x&&(x.abort(),x=null),t.value==="transcribing"&&(t.value="idle")}function ee(){const re=s.value;if(!re||typeof window>"u")return;const X=re.getContext("2d");if(!X)return;const Pe=Math.max(1,Math.floor(re.clientWidth)),ke=Math.max(1,Math.floor(re.clientHeight||36)),$e=window.devicePixelRatio||1,Ae=Math.max(1,Math.floor(Pe*$e)),we=Math.max(1,Math.floor(ke*$e));(re.width!==Ae||re.height!==we)&&(re.width=Ae,re.height=we),X.setTransform($e,0,0,$e,0,0),X.clearRect(0,0,Pe,ke);const Ee=Math.max(12,Math.floor(Pe/(Li+Oc))),ht=g.slice(-Ee),Ge=Math.max(0,Ee-ht.length),He=ke/2,Ke=getComputedStyle(re).color||"#000000";for(let Ze=0;Ze<Ee;Ze+=1){const pt=ht[Ze-Ge]??0,Be=Math.max(.08,Math.min(1,pt*18))*He,W=Ze*(Li+Oc);X.globalAlpha=pt<=Mc?.35:1,X.fillStyle=Ke,X.fillRect(W,He-Be,Li,Be*2)}X.globalAlpha=1}function z(){g=[],r.value=0,ee()}function Q(){c&&(c.disconnect(),c.onaudioprocess=null,c=null),u&&(u.disconnect(),u=null),l&&(l.close(),l=null),f=null}function K(re){if(typeof window>"u")return;const X=window.webkitAudioContext,Pe=window.AudioContext??X;Pe&&(Q(),z(),l=new Pe,u=l.createMediaStreamSource(re),c=l.createScriptProcessor(2048,1,1),f=performance.now(),c.onaudioprocess=ke=>{const $e=ke.inputBuffer.getChannelData(0);let Ae=0;for(let we=0;we<$e.length;we+=1){const Ee=Math.abs($e[we]??0);Ae+=Ee<Mc?0:Ee}g.push(Ae/$e.length),g.length>Cb&&g.shift(),f!==null&&(r.value=Math.max(0,performance.now()-f)),ee()},u.connect(c),c.connect(l.destination),ee())}async function le(){var re;if(t.value==="transcribing"&&B(),!(t.value!=="idle"||!n.value||I)){I=!0,j=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),a=[],o=new MediaRecorder(i),o.ondataavailable=X=>{X.data.size>0&&a.push(X.data)},o.onstop=()=>{var ke;const X=a,Pe=(o==null?void 0:o.mimeType)||((ke=X[0])==null?void 0:ke.type)||"audio/webm";Te(),ve(X,Pe)},K(i),o.start(250),t.value="recording",j&&de()}catch(X){Te(),t.value="idle",(re=e.onError)==null||re.call(e,X)}finally{I=!1}}}function de(){if(I&&t.value==="idle"){j=!0;return}if(!(t.value!=="recording"||!o)&&o.state!=="inactive"){t.value="transcribing";try{o.requestData()}catch{}o.stop()}}async function ve(re,X){var $e,Ae,we,Ee,ht;if(re.length===0){($e=e.onEmpty)==null||$e.call(e),t.value="idle";return}const Pe=new Blob(re,{type:X});t.value="transcribing";let ke=null;try{const Ge=X.split(/[/;]/)[1]??"webm",He=new FormData;He.append("file",Pe,`codex.${Ge}`);const Ke=((Ae=e.getLanguage)==null?void 0:Ae.call(e).trim())??"";Ke&&Ke.toLowerCase()!=="auto"&&He.append("language",Ke),ke=new AbortController,x=ke;const Ze=await fetch("/codex-api/transcribe",{method:"POST",body:He,signal:ke.signal}),pt=await Ze.text();let Ne=null;try{Ne=pt.trim()?JSON.parse(pt):null}catch{Ne=null}if(!Ze.ok){const W=(we=Ne==null?void 0:Ne.error)==null?void 0:we.trim(),fe=pt.trim();throw new Error(W||fe||`Transcription failed: ${Ze.status}`)}const Be=((Ne==null?void 0:Ne.text)??"").trim();Be.length>0?e.onTranscript(Be):(Ee=e.onEmpty)==null||Ee.call(e)}catch(Ge){if(Ge instanceof DOMException&&Ge.name==="AbortError")return;(ht=e.onError)==null||ht.call(e,Ge)}finally{ke&&x===ke&&(x=null),t.value==="transcribing"&&(t.value="idle")}}function Te(){Q(),z(),o&&(o.ondataavailable=null,o.onstop=null,o=null),i&&(i.getTracks().forEach(re=>re.stop()),i=null),a=[]}nr(()=>{B(),Te()});function ae(){if(t.value==="recording"){de();return}(t.value==="idle"||t.value==="transcribing")&&le()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:s,startRecording:le,stopRecording:de,toggleRecording:ae}}function Nc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class zn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function tl(e,t){const n=Nc(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Nc(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function ps(e,t,n){return e instanceof zn?e:e instanceof Error?new zn(e.message||t,{code:"unknown_error",method:n}):new zn(t,{code:"unknown_error",method:n})}function of(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function Rb(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 zn(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 zn(tl(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 zn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function $c(e){const t=of(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 Pb(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=$c(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=$c(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 xb(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 zn(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 zn(tl(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Mb(){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 zn(tl(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=of(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Dc(e){return new Date(e*1e3).toISOString()}function Ob(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Nb(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const $b=/^##\s+(.+?):\s+(.+?)\s*$/,Db=/^#\s*files mentioned by the user\s*:?\s*$/i;function Lb(e){var s,o;const t=e.split(`
27
+ `).findIndex(i=>Db.test(i.trim()));if(t<0)return[];const n=e.split(`
28
+ `).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match($b);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 jb(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 Bb(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:Nb(l),isUnhandled:!0});const o=n.join(`
29
+ `),i=Lb(o);return{text:jb(o),images:r,fileAttachments:i,rawBlocks:s}}function Ub(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Bb(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=Fb(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 Fb(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Hb(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Vb(e){const t=Hb(e);return t.length>0?t:"Untitled thread"}function af(e){return(e==null?void 0:e.status)==="inProgress"}function Wb(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 af(r)}function qb(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:Vb(e),projectName:Ob(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:Dc(e.createdAt),updatedAtIso:Dc(e.updatedAt),preview:e.preview,unread:!1,inProgress:Wb(e)}}function zb(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 Gb(e){const t=e.data.map(qb);return zb(t)}function lf(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 Ub(i))n.push({...a,turnIndex:r})}return n}function Kb(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return af(t.at(-1))}async function nn(e,t){try{return await Rb(e,t)}catch(n){throw ps(n,`RPC ${e} failed`,e)}}function Jb(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Yb(){const e=await nn("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return Gb(e)}async function Xb(e){const t=await nn("thread/read",{threadId:e,includeTurns:!0});return{messages:lf(t),inProgress:Kb(t)}}async function Qb(){try{return await Yb()}catch(e){throw ps(e,"Failed to load thread groups","thread/list")}}async function Zb(e){try{return await Xb(e)}catch(t){throw ps(t,`Failed to load thread ${e}`,"thread/read")}}function e_(e){return Pb(e)}async function t_(e,t){await xb({id:e,...t})}async function n_(){return Mb()}async function ji(e){await nn("thread/resume",{threadId:e})}async function r_(e){await nn("thread/archive",{threadId:e})}async function s_(e,t){await nn("thread/name/set",{threadId:e,name:t})}async function Lc(e,t){const n=await nn("thread/rollback",{threadId:e,numTurns:t});return lf(n)}function o_(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 jc(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=o_(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw ps(n,"Failed to start a new thread","thread/start")}}function i_(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
30
+ `;for(const r of t)n+=`
31
+ ## ${r.label}: ${r.path}
32
+ `;return`${n}
33
+ ## My request for Codex:
34
+
35
+ ${e}
36
+ `}async function Bi(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:i_(t,i)}];for(const f of n){const g=f.trim();g&&l.push({type:"image",url:g,image_url:g})}if(o)for(const f of o)l.push({type:"skill",name:f.name,path:f.path});const 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 ps(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function a_(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 ps(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function l_(e){await nn("setDefaultModel",{model:e})}async function c_(){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 u_(){const e=await nn("config/read",{}),t=e.config.model??"",n=Jb(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function d_(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 ya(){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 d_(n.data)}async function f_(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 Bc(){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 h_(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 p_(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=nl(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 m_(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=nl(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 g_(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=nl(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,g=typeof f=="string"?f.trim():"";g&&l.push({path:g})}return l}async function v_(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 nl(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 y_(){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 Ui(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 w_(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 b_(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 Uc(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 __={},k_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function T_(e,t){return b(),S("svg",k_,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 5l0 14m-6-8l6-6l6 6"},null,-1)])])}const I_=nt(__,[["render",T_]]),S_={},E_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function C_(e,t){return b(),S("svg",E_,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 2m0 3a3 3 0 0 1 3-3h0a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h0a3 3 0 0 1-3-3zM5 10a7 7 0 0 0 14 0M8 21h8M12 17v4"},null,-1)])])}const A_=nt(S_,[["render",C_]]),R_={},P_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function x_(e,t){return b(),S("svg",P_,[...t[0]||(t[0]=[p("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),p("path",{fill:"currentColor",d:"M8 5a3 3 0 0 0 -3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3 -3v-8a3 3 0 0 0 -3 -3h-8z"},null,-1)])])}const Fc=nt(R_,[["render",x_]]),M_=["disabled"],O_={class:"composer-dropdown-value"},N_={class:"composer-dropdown-menu"},$_={key:0,class:"composer-dropdown-search-wrap"},D_=["placeholder","onKeydown"],L_={class:"composer-dropdown-options",role:"listbox"},j_=["onClick"],B_={key:0,class:"composer-dropdown-empty"},U_={key:1,class:"composer-dropdown-add-wrap"},F_=["placeholder","onKeydown"],H_=Rt({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(null),a=D(!1),l=D(""),u=D(!1),c=D(""),f=ce(()=>{var re;const te=n.options.find(X=>X.value===n.modelValue);return te?te.label:((re=n.placeholder)==null?void 0:re.trim())||""}),g=ce(()=>n.openDirection??"down"),I=ce(()=>n.enableSearch===!0),j=ce(()=>n.showAddAction===!0),x=ce(()=>{var te;return((te=n.searchPlaceholder)==null?void 0:te.trim())||"Quick search projects"}),B=ce(()=>{var te;return((te=n.addActionLabel)==null?void 0:te.trim())||"Add new project"}),ee=ce(()=>{var te;return((te=n.addPlaceholder)==null?void 0:te.trim())||"Project name or absolute path"}),z=ce(()=>{const te=l.value.trim().toLowerCase();return te?n.options.filter(re=>re.label.toLowerCase().includes(te)||re.value.toLowerCase().includes(te)):n.options});function Q(){n.disabled||(a.value=!a.value)}function K(te){r("update:modelValue",te),a.value=!1,l.value=""}function le(){var te;u.value=!0,c.value=((te=n.defaultAddValue)==null?void 0:te.trim())||"",Ht(()=>{var re;return(re=i.value)==null?void 0:re.focus()})}function de(){if(l.value.length>0){l.value="";return}a.value=!1}function ve(){const te=c.value.trim();te&&(r("add",te),u.value=!1,c.value="",a.value=!1,l.value="")}function Te(){u.value=!1,c.value="",a.value=!1,l.value=""}function ae(te){if(!a.value)return;const re=s.value;if(!re)return;const X=te.target;X instanceof Node&&(re.contains(X)||(a.value=!1,l.value="",u.value=!1,c.value=""))}return dt(a,te=>{if(!te){u.value=!1,c.value="";return}I.value&&Ht(()=>{var re;return(re=o.value)==null?void 0:re.focus()})}),tr(()=>{window.addEventListener("pointerdown",ae)}),nr(()=>{window.removeEventListener("pointerdown",ae)}),(te,re)=>(b(),S("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[p("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:Q},[p("span",O_,oe(f.value),1),Se(ai,{class:"composer-dropdown-chevron"})],8,M_),a.value?(b(),S("div",{key:0,class:st(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":g.value==="up","composer-dropdown-menu-wrap-down":g.value==="down"}])},[p("div",N_,[I.value?(b(),S("div",$_,[Yn(p("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":re[0]||(re[0]=X=>l.value=X),class:"composer-dropdown-search-input",type:"text",placeholder:x.value,onKeydown:Yt(rt(de,["prevent"]),["esc"])},null,40,D_),[[Xn,l.value]])])):ie("",!0),p("ul",L_,[(b(!0),S(Le,null,bt(z.value,X=>(b(),S("li",{key:X.value},[p("button",{class:st(["composer-dropdown-option",{"is-selected":X.value===e.modelValue}]),type:"button",onClick:Pe=>K(X.value)},oe(X.label),11,j_)]))),128)),z.value.length===0?(b(),S("li",B_," No matching projects ")):ie("",!0)]),j.value?(b(),S("div",U_,[u.value?(b(),S(Le,{key:0},[Yn(p("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":re[1]||(re[1]=X=>c.value=X),class:"composer-dropdown-add-input",type:"text",placeholder:ee.value,onKeydown:[Yt(rt(ve,["prevent"]),["enter"]),Yt(rt(Te,["prevent"]),["esc"])]},null,40,F_),[[Xn,c.value]]),p("div",{class:"composer-dropdown-add-actions"},[p("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ve},"Open"),p("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Te},"Cancel")])],64)):(b(),S("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:le},oe(B.value),1))])):ie("",!0)])],2)):ie("",!0)],512))}}),jo=nt(H_,[["__scopeId","data-v-7cfa2012"]]),V_=["disabled"],W_={class:"search-dropdown-value"},q_={class:"search-dropdown-search-wrap"},z_=["placeholder","onKeydown"],G_={key:0,class:"search-dropdown-list",role:"listbox"},K_=["onClick","onPointerenter"],J_={class:"search-dropdown-option-check"},Y_={class:"search-dropdown-option-label"},X_={key:0,class:"search-dropdown-option-desc"},Q_={key:1,class:"search-dropdown-empty"},Z_=Rt({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(!1),a=D(""),l=D(0),u=ce(()=>n.openDirection??"down"),c=ce(()=>new Set(n.selectedValues)),f=ce(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const z=n.options.find(Q=>Q.value===n.selectedValues[0]);return(z==null?void 0:z.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),g=ce(()=>{const z=a.value.toLowerCase().trim();return z?n.options.filter(Q=>{var K;return Q.label.toLowerCase().includes(z)||(((K=Q.description)==null?void 0:K.toLowerCase().includes(z))??!1)}):n.options});function I(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,Ht(()=>{var z;return(z=o.value)==null?void 0:z.focus()})))}function j(z){r("toggle",z.value,!c.value.has(z.value))}function x(z){g.value.length!==0&&(l.value=(l.value+z+g.value.length)%g.value.length)}function B(){const z=g.value[l.value];z&&j(z)}function ee(z){if(!i.value)return;const Q=s.value;if(!Q)return;const K=z.target;K instanceof Node&&(Q.contains(K)||(i.value=!1))}return dt(a,()=>{l.value=0}),tr(()=>window.addEventListener("pointerdown",ee)),nr(()=>window.removeEventListener("pointerdown",ee)),(z,Q)=>(b(),S("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[p("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:I},[p("span",W_,oe(f.value),1),Se(ai,{class:"search-dropdown-chevron"})],8,V_),i.value?(b(),S("div",{key:0,class:st(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":u.value==="up","search-dropdown-menu-wrap-down":u.value==="down"}])},[p("div",q_,[Yn(p("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":Q[0]||(Q[0]=K=>a.value=K),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[Q[1]||(Q[1]=Yt(rt(K=>i.value=!1,["prevent"]),["escape"])),Yt(rt(B,["prevent"]),["enter"]),Q[2]||(Q[2]=Yt(rt(K=>x(1),["prevent"]),["arrow-down"])),Q[3]||(Q[3]=Yt(rt(K=>x(-1),["prevent"]),["arrow-up"]))]},null,40,z_),[[Xn,a.value]])]),g.value.length>0?(b(),S("ul",G_,[(b(!0),S(Le,null,bt(g.value,(K,le)=>(b(),S("li",{key:K.value},[p("button",{class:st(["search-dropdown-option",{"is-selected":c.value.has(K.value),"is-highlighted":le===l.value}]),type:"button",onClick:de=>j(K),onPointerenter:de=>l.value=le},[p("span",J_,oe(c.value.has(K.value)?"✓":""),1),p("span",Y_,oe(K.label),1),K.description?(b(),S("span",X_,oe(K.description),1)):ie("",!0)],42,K_)]))),128))])):(b(),S("div",Q_,"No results"))],2)):ie("",!0)],512))}}),ek=nt(Z_,[["__scopeId","data-v-a0f2edd4"]]),tk={class:"skill-picker-header"},nk=["onKeydown"],rk={key:0,class:"skill-picker-list",role:"listbox"},sk=["onClick","onPointerenter"],ok={class:"skill-picker-name"},ik={key:0,class:"skill-picker-desc"},ak={key:1,class:"skill-picker-empty"},lk=Rt({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(""),a=D(0),l=ce(()=>{const g=i.value.toLowerCase().trim();return g?n.skills.filter(I=>I.name.toLowerCase().includes(g)||I.description.toLowerCase().includes(g)):n.skills}),u=ce(()=>{const g={};return n.anchorBottom!=null&&(g.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(g.left=`${n.anchorLeft}px`),g});function c(g){l.value.length!==0&&(a.value=(a.value+g+l.value.length)%l.value.length)}function f(){const g=l.value[a.value];g&&r("select",g)}return dt(()=>n.visible,g=>{g&&(i.value="",a.value=0,Ht(()=>{var I;return(I=o.value)==null?void 0:I.focus()}))}),dt(i,()=>{a.value=0}),(g,I)=>e.visible?(b(),S("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:Ur(u.value)},[p("div",tk,[Yn(p("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":I[0]||(I[0]=j=>i.value=j),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[I[1]||(I[1]=Yt(rt(j=>g.$emit("close"),["prevent"]),["escape"])),Yt(rt(f,["prevent"]),["enter"]),I[2]||(I[2]=Yt(rt(j=>c(1),["prevent"]),["arrow-down"])),I[3]||(I[3]=Yt(rt(j=>c(-1),["prevent"]),["arrow-up"]))]},null,40,nk),[[Xn,i.value]])]),l.value.length>0?(b(),S("ul",rk,[(b(!0),S(Le,null,bt(l.value,(j,x)=>(b(),S("li",{key:j.path},[p("button",{class:st(["skill-picker-item",{"is-highlighted":x===a.value}]),type:"button",onClick:B=>g.$emit("select",j),onPointerenter:B=>a.value=x},[p("span",ok,oe(j.name),1),j.description?(b(),S("span",ik,oe(j.description),1)):ie("",!0)],42,sk)]))),128))])):(b(),S("div",ak,"No skills found"))],4)):ie("",!0)}}),ck=nt(lk,[["__scopeId","data-v-ff3fb7dc"]]),uk={key:0,class:"thread-composer-dictation-error"},dk={key:0,class:"thread-composer-attachments"},fk=["src","alt"],hk=["aria-label","disabled","onClick"],pk={key:1,class:"thread-composer-folder-chips"},mk=["title"],gk={class:"thread-composer-folder-chip-meta"},vk=["aria-label","disabled","onClick"],yk={key:2,class:"thread-composer-file-chips"},wk=["title"],bk=["aria-label","disabled","onClick"],_k={key:3,class:"thread-composer-skill-chips"},kk={class:"thread-composer-skill-chip-name"},Tk=["aria-label","onClick"],Ik={class:"thread-composer-input-wrap"},Sk={key:0,class:"thread-composer-file-mentions"},Ek=["onMousedown"],Ck={key:1,class:"thread-composer-file-mention-icon-markdown"},Ak={class:"thread-composer-file-mention-text"},Rk={class:"thread-composer-file-mention-name"},Pk={key:0,class:"thread-composer-file-mention-dir"},xk={key:1,class:"thread-composer-file-mention-empty"},Mk=["placeholder","disabled"],Ok=["disabled"],Nk={key:0,class:"thread-composer-attach-menu"},$k=["disabled"],Dk=["disabled"],Lk=["disabled"],jk={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},Bk={key:1,class:"thread-composer-dictation-timer"},Uk=["aria-label","title","disabled"],Fk=["disabled"],Hk=["aria-label","title","disabled"],Vk=["disabled"],Wk=["disabled"],qk=["disabled"],zk=Rt({__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:{},dictationClickToToggle:{type:Boolean},prependDraftRequest:{},dictationAutoSend:{type:Boolean},dictationLanguage:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=D(""),o=D([]),i=D([]),a=D([]),l=D([]),u=D(""),{state:c,isSupported:f,recordingDurationMs:g,waveformCanvasRef:I,startRecording:j,stopRecording:x,toggleRecording:B}=Ab({getLanguage:()=>n.dictationLanguage??"auto",onTranscript:T=>{if(s.value=s.value?`${s.value}
37
+ ${T}`:T,u.value="",n.dictationAutoSend!==!1){const R=n.isTurnInProgress?Be.value:"steer";v(R,{rollbackLatestUserTurn:R==="steer"&&Ae}),Ae=!1;return}Ht(()=>{var R;return(R=le.value)==null?void 0:R.focus()})},onEmpty:()=>{u.value=n.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:T=>{if(T instanceof DOMException&&T.name==="NotAllowedError"){u.value="Microphone access was denied.";return}u.value=T instanceof Error?T.message:"Dictation failed."}}),ee=D(null),z=D(null),Q=D(null),K=D(null),le=D(null),de=D(!1),ve=D(!1),Te=D(null),ae=D(""),te=D([]),re=D(!1),X=D(0);let Pe=0,ke=null,$e=!1,Ae=!1;const we=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"}],ht=ce(()=>n.models.map(T=>({value:T,label:T}))),Ge=ce(()=>n.skills??[]),He=ce(()=>i.value.map(T=>T.path)),Ke=ce(()=>(n.skills??[]).map(T=>({value:T.path,label:T.name,description:T.description}))),Ze=ce(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),pt=ce(()=>{const T=new Set;for(const R of l.value)for(const F of R.filePaths)T.add(F);return a.value.filter(R=>!T.has(R.fsPath))}),Ne=ce(()=>n.disabled||!n.activeThreadId),Be=ce(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),W=ce(()=>c.value==="recording"),fe=ce(()=>c.value==="recording"?"Stop dictation":n.dictationClickToToggle?"Click to dictate":"Hold to dictate"),ue=ce(()=>c.value==="idle"?u.value.trim():""),be=ce(()=>{const T=Math.max(0,Math.floor(g.value/1e3)),R=Math.floor(T/60),F=T%60;return`${R}:${String(F).padStart(2,"0")}`}),Ce=ce(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function v(T="steer",R){var se;const F=s.value.trim();if(Ze.value){if(r("submit",{text:F,imageUrls:o.value.map(Re=>Re.url),fileAttachments:[...a.value],skills:i.value.map(Re=>({name:Re.name,path:Re.path})),mode:T,rollbackLatestUserTurn:(R==null?void 0:R.rollbackLatestUserTurn)===!0}),s.value="",o.value=[],i.value=[],a.value=[],l.value=[],de.value=!1,ve.value=!1,qt(),we){(se=le.value)==null||se.blur();return}Ht(()=>{var Re;return(Re=le.value)==null?void 0:Re.focus()})}}function _(){r("interrupt")}function M(T){r("update:selected-model",T)}function H(T){r("update:selected-reasoning-effort",T)}function U(){n.dictationClickToToggle&&(u.value&&(u.value=""),c.value==="idle"&&(Ae=n.isTurnInProgress===!0&&n.inProgressSubmitMode==="steer"),B())}function O(T){if(n.dictationClickToToggle||(T.preventDefault(),$e))return;$e=!0;const R=T.currentTarget;if(R)try{R.setPointerCapture(T.pointerId)}catch{}u.value&&(u.value=""),Ae=n.isTurnInProgress===!0&&n.inProgressSubmitMode==="steer",window.addEventListener("pointerup",L),window.addEventListener("pointercancel",L),window.addEventListener("blur",L),j()}function L(){n.dictationClickToToggle||$e&&($e=!1,window.removeEventListener("pointerup",L),window.removeEventListener("pointercancel",L),window.removeEventListener("blur",L),x())}function q(){Ne.value||(de.value=!de.value)}function Y(){var T;(T=z.value)==null||T.click()}function G(){var T;(T=Q.value)==null||T.click()}function _e(){var T;(T=K.value)==null||T.click()}function pe(T){o.value=o.value.filter(R=>R.id!==T)}function me(T){i.value=i.value.filter(R=>R.path!==T)}function Ie(T){a.value=a.value.filter(R=>R.fsPath!==T)}function Oe(T){const R=l.value.find(se=>se.id===T);if(!R)return;const F=new Set(R.filePaths);a.value=a.value.filter(se=>!F.has(se.fsPath)),l.value=l.value.filter(se=>se.id!==T)}function Ve(T){return T.total<=0?0:Math.round(T.processed/T.total*100)}function De(T,R){const F=T.replace(/\\/g,"/");if(a.value.some(Qe=>Qe.fsPath===F))return;const se=F.split("/").filter(Boolean),Re=(R==null?void 0:R.trim())||se[se.length-1]||F;a.value=[...a.value,{label:Re,path:F,fsPath:F}]}function Xe(T){return T.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(T.name)}function ot(T){if(!(!T||T.length===0))for(const R of Array.from(T))if(Xe(R)){const F=new FileReader;F.onload=()=>{typeof F.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:R.name,url:F.result})},F.readAsDataURL(R)}else Uc(R).then(F=>{F&&De(F)}).catch(()=>{})}async function We(T){if(!T||T.length===0)return;const R=Array.from(T),se=(R[0].webkitRelativePath||R[0].name).split("/").filter(Boolean)[0]||"Folder",Re=`${Date.now()}-${Math.random().toString(36).slice(2)}`;l.value=[...l.value,{id:Re,name:se,total:R.length,processed:0,filePaths:[],isUploading:!0}];const Qe=Je=>{l.value=l.value.map(it=>it.id===Re?Je(it):it)};for(const Je of R)try{const it=await Uc(Je);if(it){const _t=Je.webkitRelativePath||Je.name;De(it,_t),Qe(Zt=>({...Zt,processed:Zt.processed+1,filePaths:[...Zt.filePaths,it]}));continue}Qe(_t=>({..._t,processed:_t.processed+1}))}catch{Qe(it=>({...it,processed:it.processed+1}))}Qe(Je=>({...Je,isUploading:!1}))}function et(T){T&&(T.value="")}function St(T){const R=T.target;ot((R==null?void 0:R.files)??null),et(R),de.value=!1}function Ot(T){const R=T.target;ot((R==null?void 0:R.files)??null),et(R),de.value=!1}function tt(T){const R=T.target;We((R==null?void 0:R.files)??null),et(R),de.value=!1}function mt(){u.value&&(u.value="");const R=s.value.startsWith("/");R!==ve.value&&(ve.value=R),zt()}function Wt(T){if(re.value){if(T.key==="Escape"){T.preventDefault(),qt();return}if(T.key==="ArrowDown"){T.preventDefault(),te.value.length>0&&(X.value=(X.value+1)%te.value.length);return}if(T.key==="ArrowUp"){if(T.preventDefault(),te.value.length>0){const F=te.value.length;X.value=(X.value+F-1)%F}return}if(T.key==="Enter"||T.key==="Tab"){T.preventDefault();const F=te.value[X.value];F?xe(F):qt();return}}if(n.sendWithEnter!==!1?T.key==="Enter"&&!T.shiftKey:T.key==="Enter"&&(T.metaKey||T.ctrlKey)){T.preventDefault(),v(n.isTurnInProgress?Be.value:"steer");return}if(ve.value){if(T.key==="Escape"){T.preventDefault(),Pt();return}if(T.key==="ArrowDown"||T.key==="ArrowUp"){T.preventDefault();return}}}function Pt(){var T;ve.value=!1,(T=le.value)==null||T.focus()}function qt(){re.value=!1,Te.value=null,ae.value="",te.value=[],X.value=0}function zt(){const T=le.value;if(!T){qt();return}const R=T.selectionStart??s.value.length,se=s.value.slice(0,R).match(/(^|\s)(@[^\s@]*)$/);if(!se){qt();return}const Re=se[2]??"",Qe=Re.length,Je=R-Qe;Te.value=Je,ae.value=Re.slice(1),re.value=!0,Me()}async function Me(){if(!re.value)return;const T=(n.cwd??"").trim();if(!T){te.value=[];return}ke&&clearTimeout(ke);const R=++Pe;ke=setTimeout(async()=>{try{const F=await g_(T,ae.value,20);if(!re.value||R!==Pe)return;te.value=F,X.value=0}catch{if(!re.value||R!==Pe)return;te.value=[]}},120)}function xe(T){const R=le.value,F=Te.value;if(F!==null&&R){const se=R.selectionStart??s.value.length;s.value=`${s.value.slice(0,F)}${s.value.slice(se)}`.trimEnd()}De(T.path),qt(),Ht(()=>R==null?void 0:R.focus())}function Nt(T){const R=T.lastIndexOf("/");return R<0?T:T.slice(R+1)}function Tt(T){const R=T.lastIndexOf("/");return R<=0?"":T.slice(0,R)}function $t(T){const R=Nt(T),F=R.lastIndexOf(".");return F<=0?"":R.slice(F+1).toLowerCase()}function rn(T){const R=$t(T);return R==="ts"?"TS":R==="tsx"?"TSX":R==="js"?"JS":R==="jsx"?"JSX":R==="json"?"{}":""}function dn(T){const R=$t(T);return R.startsWith("ts")?"ts":R.startsWith("js")?"js":R==="json"?"json":"default"}function k(T){const R=$t(T);return R==="md"||R==="mdx"}function C(T){var R;i.value.some(F=>F.path===T.path)||(i.value=[...i.value,T]),s.value=s.value.startsWith("/")?"":s.value,ve.value=!1,(R=le.value)==null||R.focus()}function A(T,R){if(R){const F=(n.skills??[]).find(se=>se.path===T);F&&!i.value.some(se=>se.path===T)&&(i.value=[...i.value,F])}else i.value=i.value.filter(F=>F.path!==T)}function J(T){if(!de.value)return;const R=ee.value;if(!R)return;const F=T.target;!F||R.contains(F)||(de.value=!1)}return tr(()=>{document.addEventListener("click",J)}),nr(()=>{document.removeEventListener("click",J),window.removeEventListener("pointerup",L),window.removeEventListener("pointercancel",L),window.removeEventListener("blur",L),ke&&clearTimeout(ke)}),dt(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],l.value=[],u.value="",de.value=!1,ve.value=!1,qt()}),dt(()=>n.cwd,()=>{re.value&&Me()}),dt(()=>{var T;return(T=n.prependDraftRequest)==null?void 0:T.id},()=>{var R,F;const T=((F=(R=n.prependDraftRequest)==null?void 0:R.text)==null?void 0:F.trim())??"";T&&(s.value=s.value?`${T}
38
+ ${s.value}`:T,mt(),Ht(()=>{var se;return(se=le.value)==null?void 0:se.focus()}))}),(T,R)=>(b(),S("form",{class:"thread-composer",onSubmit:R[2]||(R[2]=rt(F=>v("steer"),["prevent"]))},[ue.value?(b(),S("p",uk,oe(ue.value),1)):ie("",!0),p("div",{class:st(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(b(),S("div",dk,[(b(!0),S(Le,null,bt(o.value,F=>(b(),S("div",{key:F.id,class:"thread-composer-attachment"},[p("img",{class:"thread-composer-attachment-image",src:F.url,alt:F.name||"Selected image"},null,8,fk),p("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${F.name||"image"}`,disabled:Ne.value,onClick:se=>pe(F.id)}," x ",8,hk)]))),128))])):ie("",!0),l.value.length>0?(b(),S("div",pk,[(b(!0),S(Le,null,bt(l.value,F=>(b(),S("span",{key:F.id,class:"thread-composer-folder-chip"},[Se(Za,{class:"thread-composer-folder-chip-icon"}),p("span",{class:"thread-composer-folder-chip-name",title:F.name},oe(F.name),9,mk),p("span",gk,[F.isUploading?(b(),S(Le,{key:0},[qs(oe(Ve(F))+"% uploading ("+oe(F.processed)+"/"+oe(F.total)+") ",1)],64)):(b(),S(Le,{key:1},[qs(oe(F.filePaths.length)+" file"+oe(F.filePaths.length===1?"":"s"),1)],64))]),p("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${F.name}`,disabled:Ne.value,onClick:se=>Oe(F.id)},"×",8,vk)]))),128))])):ie("",!0),pt.value.length>0?(b(),S("div",yk,[(b(!0),S(Le,null,bt(pt.value,F=>(b(),S("span",{key:F.fsPath,class:"thread-composer-file-chip"},[Se(Lo,{class:"thread-composer-file-chip-icon"}),p("span",{class:"thread-composer-file-chip-name",title:F.fsPath},oe(F.label),9,wk),p("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${F.label}`,disabled:Ne.value,onClick:se=>Ie(F.fsPath)},"×",8,bk)]))),128))])):ie("",!0),i.value.length>0?(b(),S("div",_k,[(b(!0),S(Le,null,bt(i.value,F=>(b(),S("span",{key:F.path,class:"thread-composer-skill-chip"},[p("span",kk,oe(F.name),1),p("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${F.name}`,onClick:se=>me(F.path)},"×",8,Tk)]))),128))])):ie("",!0),p("div",Ik,[re.value?(b(),S("div",Sk,[te.value.length>0?(b(!0),S(Le,{key:0},bt(te.value,(F,se)=>(b(),S("button",{key:F.path,class:st(["thread-composer-file-mention-row",{"is-active":se===X.value}]),type:"button",onMousedown:rt(Re=>xe(F),["prevent"])},[rn(F.path)?(b(),S("span",{key:0,class:st(["thread-composer-file-mention-icon-badge",`is-${dn(F.path)}`])},oe(rn(F.path)),3)):k(F.path)?(b(),S("span",Ck,"↓")):(b(),ut(Lo,{key:2,class:"thread-composer-file-mention-icon-file"})),p("span",Ak,[p("span",Rk,oe(Nt(F.path)),1),Tt(F.path)?(b(),S("span",Pk,oe(Tt(F.path)),1)):ie("",!0)])],42,Ek))),128)):(b(),S("div",xk,"No matching files"))])):ie("",!0),Yn(p("textarea",{ref_key:"inputRef",ref:le,"onUpdate:modelValue":R[0]||(R[0]=F=>s.value=F),class:"thread-composer-input",placeholder:Ce.value,disabled:Ne.value,onInput:mt,onKeydown:Wt},null,40,Mk),[[Xn,s.value]]),Se(ck,{skills:Ge.value,visible:ve.value,"anchor-bottom":44,"anchor-left":0,onSelect:C,onClose:Pt},null,8,["skills","visible"])]),p("div",{class:st(["thread-composer-controls",{"thread-composer-controls--recording":W.value}])},[p("div",{ref_key:"attachMenuRootRef",ref:ee,class:"thread-composer-attach"},[p("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Ne.value,onClick:q}," + ",8,Ok),de.value?(b(),S("div",Nk,[p("button",{class:"thread-composer-attach-item",type:"button",disabled:Ne.value,onClick:Y}," Add photos & files ",8,$k),p("button",{class:"thread-composer-attach-item",type:"button",disabled:Ne.value,onClick:_e}," Add folder ",8,Dk),p("button",{class:"thread-composer-attach-item",type:"button",disabled:Ne.value,onClick:G}," Take photo ",8,Lk)])):ie("",!0)],512),W.value?ie("",!0):(b(),S(Le,{key:0},[Se(jo,{class:"thread-composer-control","model-value":e.selectedModel,options:ht.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":M},null,8,["model-value","options","disabled"]),Se(ek,{class:"thread-composer-control",options:Ke.value,"selected-values":He.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:A},null,8,["options","selected-values","disabled"]),Se(jo,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:Ee,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":H},null,8,["model-value","disabled"])],64)),p("div",{class:st(["thread-composer-actions",{"thread-composer-actions--recording":W.value}])},[ye(c)==="recording"?(b(),S("div",jk,[p("canvas",{ref_key:"dictationWaveformCanvasRef",ref:I,class:"thread-composer-dictation-waveform"},null,512)])):ie("",!0),ye(c)==="recording"?(b(),S("span",Bk,oe(be.value),1)):ie("",!0),ye(f)?(b(),S("button",{key:2,class:st(["thread-composer-mic",{"thread-composer-mic--active":ye(c)==="recording"}]),type:"button","aria-label":fe.value,title:fe.value,disabled:Ne.value,onClick:U,onPointerdown:O,onPointerup:L,onPointercancel:L},[ye(c)==="recording"?(b(),ut(Fc,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(b(),ut(A_,{key:1,class:"thread-composer-mic-icon"}))],42,Uk)):ie("",!0),e.isTurnInProgress?(b(),S("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:_},[Se(Fc,{class:"thread-composer-stop-icon"})],8,Fk)):(b(),S("button",{key:4,class:st(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&Be.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&Be.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${Be.value}`:"Send",disabled:!Ze.value,onClick:R[1]||(R[1]=F=>v(e.isTurnInProgress?Be.value:"steer"))},[Se(I_,{class:"thread-composer-submit-icon"})],10,Hk))],2)],2)],2),p("input",{ref_key:"photoLibraryInputRef",ref:z,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Ne.value,onChange:St},null,40,Vk),p("input",{ref_key:"cameraCaptureInputRef",ref:Q,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Ne.value,onChange:Ot},null,40,Wk),p("input",{ref_key:"folderPickerInputRef",ref:K,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:Ne.value,onChange:tt},null,40,qk)],32))}}),Hc=nt(zk,[["__scopeId","data-v-c1acf67b"]]),Gk={key:0,class:"queued-messages"},Kk={class:"queued-messages-inner"},Jk={class:"queued-row-text"},Yk={class:"queued-row-actions"},Xk=["onClick"],Qk=["onClick"],Zk=Rt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(b(),S("div",Gk,[p("div",Kk,[(b(!0),S(Le,null,bt(e.messages,r=>(b(),S("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=p("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),p("span",Jk,oe(r.text),1),p("div",Yk,[p("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Xk),p("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:s=>t.$emit("delete",r.id)},[...n[0]||(n[0]=[p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,Qk)])]))),128))])])):ie("",!0)}}),e0=nt(Zk,[["__scopeId","data-v-ea583733"]]),t0={class:"runtime-dropdown-trigger-label"},n0={key:0,class:"runtime-dropdown-menu-wrap"},r0={class:"runtime-dropdown-menu"},s0=["onClick"],o0={class:"runtime-dropdown-option-label"},i0={key:0,class:"runtime-dropdown-option-check"},a0=Rt({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(!1),i=[{value:"local",label:"Local project",icon:Za},{value:"worktree",label:"New worktree",icon:Io}],a=ce(()=>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 g=c.target;g instanceof Node&&(f.contains(g)||(o.value=!1))}return tr(()=>{window.addEventListener("pointerdown",u)}),nr(()=>{window.removeEventListener("pointerdown",u)}),(c,f)=>(b(),S("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[p("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=g=>o.value=!o.value)},[(b(),ut(aa(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),p("span",t0,oe(a.value.label),1),Se(ai,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(b(),S("div",n0,[p("div",r0,[f[1]||(f[1]=p("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(b(),S(Le,null,bt(i,g=>p("button",{key:g.value,class:st(["runtime-dropdown-option",{"is-selected":e.modelValue===g.value}]),type:"button",onClick:I=>l(g.value)},[(b(),ut(aa(g.icon),{class:"runtime-dropdown-option-icon"})),p("span",o0,oe(g.label),1),e.modelValue===g.value?(b(),S("span",i0,"✓")):ie("",!0)],10,s0)),64))])])):ie("",!0)],512))}}),l0=nt(a0,[["__scopeId","data-v-9c9b71e5"]]),c0={},u0={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function d0(e,t){return b(),S("svg",u0,[...t[0]||(t[0]=[p("circle",{cx:"11",cy:"11",r:"8"},null,-1),p("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const wa=nt(c0,[["render",d0]]),f0={class:"skill-card-top"},h0=["src","alt"],p0={key:1,class:"skill-card-avatar-fallback"},m0={class:"skill-card-info"},g0={class:"skill-card-header"},v0={class:"skill-card-name"},y0={key:0,class:"skill-card-badge-disabled"},w0={key:1,class:"skill-card-badge"},b0={class:"skill-card-owner"},_0={key:0,class:"skill-card-desc"},k0={key:1,class:"skill-card-date"},T0=Rt({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=ce(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function r(s){const o=s.target;o.style.display="none"}return(s,o)=>(b(),S("button",{class:st(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[p("div",f0,[e.skill.avatarUrl?(b(),S("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,h0)):(b(),S("div",p0,oe(e.skill.owner.charAt(0)),1)),p("div",m0,[p("div",g0,[p("span",v0,oe(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(b(),S("span",y0,"Disabled")):e.skill.installed?(b(),S("span",w0,"Installed")):ie("",!0)]),p("span",b0,oe(e.skill.owner),1)])]),e.skill.description?(b(),S("p",_0,oe(e.skill.description),1)):ie("",!0),n.value?(b(),S("span",k0,oe(n.value),1)):ie("",!0)],2))}}),Vc=nt(T0,[["__scopeId","data-v-2a1e8196"]]),I0={class:"sdm-panel"},S0={class:"sdm-header"},E0={class:"sdm-title-area"},C0=["src","alt"],A0={class:"sdm-title-col"},R0={class:"sdm-title-row"},P0={class:"sdm-title"},x0={key:0,class:"sdm-badge-disabled"},M0={class:"sdm-owner"},O0={class:"sdm-body"},N0={key:0,class:"sdm-desc"},$0={key:1,class:"sdm-readme-loading"},D0=["innerHTML"],L0=["href"],j0={class:"sdm-footer"},B0={class:"sdm-footer-actions"},U0=["disabled"],F0=["disabled"],H0=["disabled"],V0=Rt({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(""),i=D(!1),a=ce(()=>s.value??n.skill.enabled??!0),l=ce(()=>n.isInstalling===!0||n.isUninstalling===!0),u=ce(()=>{const x=o.value;if(!x)return"";const B=x.replace(/^---[\s\S]*?---\s*/,"");return c(B)});function c(x){return x.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 x=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),B=await fetch(`/codex-api/skills-hub/readme?${x}`);if(!B.ok)return;const ee=await B.json();o.value=ee.content??""}catch{}finally{i.value=!1}}}dt(()=>n.visible,x=>{x&&(s.value=null,o.value="",f())});function g(){r("install",n.skill)}function I(){r("uninstall",n.skill)}function j(){const x=!a.value;s.value=x,r("toggle-enabled",n.skill,x)}return(x,B)=>(b(),ut(Mo,{to:"body"},[e.visible?(b(),S("div",{key:0,class:"sdm-overlay",onClick:B[1]||(B[1]=rt(ee=>x.$emit("close"),["self"]))},[p("div",I0,[p("div",S0,[p("div",E0,[e.skill.avatarUrl?(b(),S("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,C0)):ie("",!0),p("div",A0,[p("div",R0,[p("h3",P0,oe(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(b(),S("span",x0,"Disabled")):ie("",!0)]),p("span",M0,oe(e.skill.owner),1)])]),p("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:B[0]||(B[0]=ee=>x.$emit("close"))},[Se(el,{class:"sdm-close-icon"})])]),p("div",O0,[e.skill.description?(b(),S("p",N0,oe(e.skill.description),1)):ie("",!0),i.value?(b(),S("div",$0,"Loading skill contents...")):o.value?(b(),S("div",{key:2,class:"sdm-readme",innerHTML:u.value},null,8,D0)):ie("",!0),p("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,L0)]),p("div",j0,[p("div",B0,[e.skill.installed?(b(),S("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:I},oe(n.isUninstalling?"Uninstalling...":"Uninstall"),9,U0)):(b(),S("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:g},oe(n.isInstalling?"Installing...":"Install"),9,F0)),e.skill.installed?(b(),S("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:j},oe(a.value?"Disable":"Enable"),9,H0)):ie("",!0)])])])])):ie("",!0)]))}}),W0=nt(V0,[["__scopeId","data-v-19a385ca"]]),q0=()=>{};var Wc={};/**
39
+ * @license
40
+ * Copyright 2017 Google LLC
41
+ *
42
+ * Licensed under the Apache License, Version 2.0 (the "License");
43
+ * you may not use this file except in compliance with the License.
44
+ * You may obtain a copy of the License at
45
+ *
46
+ * http://www.apache.org/licenses/LICENSE-2.0
47
+ *
48
+ * Unless required by applicable law or agreed to in writing, software
49
+ * distributed under the License is distributed on an "AS IS" BASIS,
50
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
51
+ * See the License for the specific language governing permissions and
52
+ * limitations under the License.
53
+ */const cf=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},z0=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("")},uf={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 g=(a&15)<<2|u>>6,I=u&63;l||(I=64,i||(g=64)),r.push(n[c],n[f],n[g],n[I])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(cf(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):z0(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 G0;const g=o<<2|a>>4;if(r.push(g),u!==64){const I=a<<4&240|u>>2;if(r.push(I),f!==64){const j=u<<6&192|f;r.push(j)}}}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 G0 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const K0=function(e){const t=cf(e);return uf.encodeByteArray(t,!0)},df=function(e){return K0(e).replace(/\./g,"")},ff=function(e){try{return uf.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
54
+ * @license
55
+ * Copyright 2022 Google LLC
56
+ *
57
+ * Licensed under the Apache License, Version 2.0 (the "License");
58
+ * you may not use this file except in compliance with the License.
59
+ * You may obtain a copy of the License at
60
+ *
61
+ * http://www.apache.org/licenses/LICENSE-2.0
62
+ *
63
+ * Unless required by applicable law or agreed to in writing, software
64
+ * distributed under the License is distributed on an "AS IS" BASIS,
65
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
66
+ * See the License for the specific language governing permissions and
67
+ * limitations under the License.
68
+ */function J0(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
69
+ * @license
70
+ * Copyright 2022 Google LLC
71
+ *
72
+ * Licensed under the Apache License, Version 2.0 (the "License");
73
+ * you may not use this file except in compliance with the License.
74
+ * You may obtain a copy of the License at
75
+ *
76
+ * http://www.apache.org/licenses/LICENSE-2.0
77
+ *
78
+ * Unless required by applicable law or agreed to in writing, software
79
+ * distributed under the License is distributed on an "AS IS" BASIS,
80
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
81
+ * See the License for the specific language governing permissions and
82
+ * limitations under the License.
83
+ */const Y0=()=>J0().__FIREBASE_DEFAULTS__,X0=()=>{if(typeof process>"u"||typeof Wc>"u")return;const e=Wc.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},Q0=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&ff(e[1]);return t&&JSON.parse(t)},rl=()=>{try{return q0()||Y0()||X0()||Q0()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},Z0=e=>{var t,n;return(n=(t=rl())==null?void 0:t.emulatorHosts)==null?void 0:n[e]},hf=()=>{var e;return(e=rl())==null?void 0:e.config},pf=e=>{var t;return(t=rl())==null?void 0:t[`_${e}`]};/**
84
+ * @license
85
+ * Copyright 2017 Google LLC
86
+ *
87
+ * Licensed under the Apache License, Version 2.0 (the "License");
88
+ * you may not use this file except in compliance with the License.
89
+ * You may obtain a copy of the License at
90
+ *
91
+ * http://www.apache.org/licenses/LICENSE-2.0
92
+ *
93
+ * Unless required by applicable law or agreed to in writing, software
94
+ * distributed under the License is distributed on an "AS IS" BASIS,
95
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
96
+ * See the License for the specific language governing permissions and
97
+ * limitations under the License.
98
+ */class eT{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(n,r))}}}/**
99
+ * @license
100
+ * Copyright 2017 Google LLC
101
+ *
102
+ * Licensed under the Apache License, Version 2.0 (the "License");
103
+ * you may not use this file except in compliance with the License.
104
+ * You may obtain a copy of the License at
105
+ *
106
+ * http://www.apache.org/licenses/LICENSE-2.0
107
+ *
108
+ * Unless required by applicable law or agreed to in writing, software
109
+ * distributed under the License is distributed on an "AS IS" BASIS,
110
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
111
+ * See the License for the specific language governing permissions and
112
+ * limitations under the License.
113
+ */function Qt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function tT(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Qt())}function nT(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function rT(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function sT(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function oT(){const e=Qt();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function iT(){try{return typeof indexedDB=="object"}catch{return!1}}function aT(){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)}})}/**
114
+ * @license
115
+ * Copyright 2017 Google LLC
116
+ *
117
+ * Licensed under the Apache License, Version 2.0 (the "License");
118
+ * you may not use this file except in compliance with the License.
119
+ * You may obtain a copy of the License at
120
+ *
121
+ * http://www.apache.org/licenses/LICENSE-2.0
122
+ *
123
+ * Unless required by applicable law or agreed to in writing, software
124
+ * distributed under the License is distributed on an "AS IS" BASIS,
125
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
126
+ * See the License for the specific language governing permissions and
127
+ * limitations under the License.
128
+ */const lT="FirebaseError";class kr extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=lT,Object.setPrototypeOf(this,kr.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,no.prototype.create)}}class no{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?cT(o,r):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new kr(s,a,r)}}function cT(e,t){return e.replace(uT,(n,r)=>{const s=t[r];return s!=null?String(s):`<${r}?>`})}const uT=/\{\$([^}]+)}/g;function dT(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function ds(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(qc(o)&&qc(i)){if(!ds(o,i))return!1}else if(o!==i)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function qc(e){return e!==null&&typeof e=="object"}/**
129
+ * @license
130
+ * Copyright 2017 Google LLC
131
+ *
132
+ * Licensed under the Apache License, Version 2.0 (the "License");
133
+ * you may not use this file except in compliance with the License.
134
+ * You may obtain a copy of the License at
135
+ *
136
+ * http://www.apache.org/licenses/LICENSE-2.0
137
+ *
138
+ * Unless required by applicable law or agreed to in writing, software
139
+ * distributed under the License is distributed on an "AS IS" BASIS,
140
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
141
+ * See the License for the specific language governing permissions and
142
+ * limitations under the License.
143
+ */function ro(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 fT(e,t){const n=new hT(e,t);return n.subscribe.bind(n)}class hT{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.");pT(t,["next","error","complete"])?s=t:s={next:t,error:n,complete:r},s.next===void 0&&(s.next=Fi),s.error===void 0&&(s.error=Fi),s.complete===void 0&&(s.complete=Fi);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 pT(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 Fi(){}/**
144
+ * @license
145
+ * Copyright 2021 Google LLC
146
+ *
147
+ * Licensed under the Apache License, Version 2.0 (the "License");
148
+ * you may not use this file except in compliance with the License.
149
+ * You may obtain a copy of the License at
150
+ *
151
+ * http://www.apache.org/licenses/LICENSE-2.0
152
+ *
153
+ * Unless required by applicable law or agreed to in writing, software
154
+ * distributed under the License is distributed on an "AS IS" BASIS,
155
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
156
+ * See the License for the specific language governing permissions and
157
+ * limitations under the License.
158
+ */function ms(e){return e&&e._delegate?e._delegate:e}/**
159
+ * @license
160
+ * Copyright 2025 Google LLC
161
+ *
162
+ * Licensed under the Apache License, Version 2.0 (the "License");
163
+ * you may not use this file except in compliance with the License.
164
+ * You may obtain a copy of the License at
165
+ *
166
+ * http://www.apache.org/licenses/LICENSE-2.0
167
+ *
168
+ * Unless required by applicable law or agreed to in writing, software
169
+ * distributed under the License is distributed on an "AS IS" BASIS,
170
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
171
+ * See the License for the specific language governing permissions and
172
+ * limitations under the License.
173
+ */function sl(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function mT(e){return(await fetch(e,{credentials:"include"})).ok}class fs{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}}/**
174
+ * @license
175
+ * Copyright 2019 Google LLC
176
+ *
177
+ * Licensed under the Apache License, Version 2.0 (the "License");
178
+ * you may not use this file except in compliance with the License.
179
+ * You may obtain a copy of the License at
180
+ *
181
+ * http://www.apache.org/licenses/LICENSE-2.0
182
+ *
183
+ * Unless required by applicable law or agreed to in writing, software
184
+ * distributed under the License is distributed on an "AS IS" BASIS,
185
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
186
+ * See the License for the specific language governing permissions and
187
+ * limitations under the License.
188
+ */const Mr="[DEFAULT]";/**
189
+ * @license
190
+ * Copyright 2019 Google LLC
191
+ *
192
+ * Licensed under the Apache License, Version 2.0 (the "License");
193
+ * you may not use this file except in compliance with the License.
194
+ * You may obtain a copy of the License at
195
+ *
196
+ * http://www.apache.org/licenses/LICENSE-2.0
197
+ *
198
+ * Unless required by applicable law or agreed to in writing, software
199
+ * distributed under the License is distributed on an "AS IS" BASIS,
200
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ * See the License for the specific language governing permissions and
202
+ * limitations under the License.
203
+ */class gT{constructor(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){const r=new eT;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:n});s&&r.resolve(s)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(t){const n=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),r=(t==null?void 0:t.optional)??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(s){if(r)return null;throw s}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(yT(t))try{this.getOrInitializeService({instanceIdentifier:Mr})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(n);try{const o=this.getOrInitializeService({instanceIdentifier:s});r.resolve(o)}catch{}}}}clearInstance(t=Mr){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...t.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=Mr){return this.instances.has(t)}getOptions(t=Mr){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:n={}}=t,r=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[o,i]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(o);r===a&&i.resolve(s)}return s}onInit(t,n){const r=this.normalizeInstanceIdentifier(n),s=this.onInitCallbacks.get(r)??new Set;s.add(t),this.onInitCallbacks.set(r,s);const o=this.instances.get(r);return o&&t(o,r),()=>{s.delete(t)}}invokeOnInitCallbacks(t,n){const r=this.onInitCallbacks.get(n);if(r)for(const s of r)try{s(t,n)}catch{}}getOrInitializeService({instanceIdentifier:t,options:n={}}){let r=this.instances.get(t);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:vT(t),options:n}),this.instances.set(t,r),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(r,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,r)}catch{}return r||null}normalizeInstanceIdentifier(t=Mr){return this.component?this.component.multipleInstances?t:Mr:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function vT(e){return e===Mr?void 0:e}function yT(e){return e.instantiationMode==="EAGER"}/**
204
+ * @license
205
+ * Copyright 2019 Google LLC
206
+ *
207
+ * Licensed under the Apache License, Version 2.0 (the "License");
208
+ * you may not use this file except in compliance with the License.
209
+ * You may obtain a copy of the License at
210
+ *
211
+ * http://www.apache.org/licenses/LICENSE-2.0
212
+ *
213
+ * Unless required by applicable law or agreed to in writing, software
214
+ * distributed under the License is distributed on an "AS IS" BASIS,
215
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
216
+ * See the License for the specific language governing permissions and
217
+ * limitations under the License.
218
+ */class wT{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const n=this.getProvider(t.name);if(n.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);n.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const n=new gT(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
219
+ * @license
220
+ * Copyright 2017 Google LLC
221
+ *
222
+ * Licensed under the Apache License, Version 2.0 (the "License");
223
+ * you may not use this file except in compliance with the License.
224
+ * You may obtain a copy of the License at
225
+ *
226
+ * http://www.apache.org/licenses/LICENSE-2.0
227
+ *
228
+ * Unless required by applicable law or agreed to in writing, software
229
+ * distributed under the License is distributed on an "AS IS" BASIS,
230
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
231
+ * See the License for the specific language governing permissions and
232
+ * limitations under the License.
233
+ */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 bT={debug:vt.DEBUG,verbose:vt.VERBOSE,info:vt.INFO,warn:vt.WARN,error:vt.ERROR,silent:vt.SILENT},_T=vt.INFO,kT={[vt.DEBUG]:"log",[vt.VERBOSE]:"log",[vt.INFO]:"info",[vt.WARN]:"warn",[vt.ERROR]:"error"},TT=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),s=kT[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 mf{constructor(t){this.name=t,this._logLevel=_T,this._logHandler=TT,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"?bT[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 IT=(e,t)=>t.some(n=>e instanceof n);let zc,Gc;function ST(){return zc||(zc=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ET(){return Gc||(Gc=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const gf=new WeakMap,ba=new WeakMap,vf=new WeakMap,Hi=new WeakMap,ol=new WeakMap;function CT(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(yr(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&gf.set(n,e)}).catch(()=>{}),ol.set(t,e),t}function AT(e){if(ba.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)});ba.set(e,t)}let _a={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return ba.get(e);if(t==="objectStoreNames")return e.objectStoreNames||vf.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return yr(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 RT(e){_a=e(_a)}function PT(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Vi(this),t,...n);return vf.set(r,t.sort?t.sort():[t]),yr(r)}:ET().includes(e)?function(...t){return e.apply(Vi(this),t),yr(gf.get(this))}:function(...t){return yr(e.apply(Vi(this),t))}}function xT(e){return typeof e=="function"?PT(e):(e instanceof IDBTransaction&&AT(e),IT(e,ST())?new Proxy(e,_a):e)}function yr(e){if(e instanceof IDBRequest)return CT(e);if(Hi.has(e))return Hi.get(e);const t=xT(e);return t!==e&&(Hi.set(e,t),ol.set(t,e)),t}const Vi=e=>ol.get(e);function MT(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=yr(i);return r&&i.addEventListener("upgradeneeded",l=>{r(yr(i.result),l.oldVersion,l.newVersion,yr(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 OT=["get","getKey","getAll","getAllKeys","count"],NT=["put","add","delete","clear"],Wi=new Map;function Kc(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Wi.get(t))return Wi.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=NT.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||OT.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 Wi.set(t,o),o}RT(e=>({...e,get:(t,n,r)=>Kc(t,n)||e.get(t,n,r),has:(t,n)=>!!Kc(t,n)||e.has(t,n)}));/**
234
+ * @license
235
+ * Copyright 2019 Google LLC
236
+ *
237
+ * Licensed under the Apache License, Version 2.0 (the "License");
238
+ * you may not use this file except in compliance with the License.
239
+ * You may obtain a copy of the License at
240
+ *
241
+ * http://www.apache.org/licenses/LICENSE-2.0
242
+ *
243
+ * Unless required by applicable law or agreed to in writing, software
244
+ * distributed under the License is distributed on an "AS IS" BASIS,
245
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
246
+ * See the License for the specific language governing permissions and
247
+ * limitations under the License.
248
+ */class $T{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(DT(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function DT(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const ka="@firebase/app",Jc="0.14.10";/**
249
+ * @license
250
+ * Copyright 2019 Google LLC
251
+ *
252
+ * Licensed under the Apache License, Version 2.0 (the "License");
253
+ * you may not use this file except in compliance with the License.
254
+ * You may obtain a copy of the License at
255
+ *
256
+ * http://www.apache.org/licenses/LICENSE-2.0
257
+ *
258
+ * Unless required by applicable law or agreed to in writing, software
259
+ * distributed under the License is distributed on an "AS IS" BASIS,
260
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
261
+ * See the License for the specific language governing permissions and
262
+ * limitations under the License.
263
+ */const Qn=new mf("@firebase/app"),LT="@firebase/app-compat",jT="@firebase/analytics-compat",BT="@firebase/analytics",UT="@firebase/app-check-compat",FT="@firebase/app-check",HT="@firebase/auth",VT="@firebase/auth-compat",WT="@firebase/database",qT="@firebase/data-connect",zT="@firebase/database-compat",GT="@firebase/functions",KT="@firebase/functions-compat",JT="@firebase/installations",YT="@firebase/installations-compat",XT="@firebase/messaging",QT="@firebase/messaging-compat",ZT="@firebase/performance",eI="@firebase/performance-compat",tI="@firebase/remote-config",nI="@firebase/remote-config-compat",rI="@firebase/storage",sI="@firebase/storage-compat",oI="@firebase/firestore",iI="@firebase/ai",aI="@firebase/firestore-compat",lI="firebase",cI="12.11.0";/**
264
+ * @license
265
+ * Copyright 2019 Google LLC
266
+ *
267
+ * Licensed under the Apache License, Version 2.0 (the "License");
268
+ * you may not use this file except in compliance with the License.
269
+ * You may obtain a copy of the License at
270
+ *
271
+ * http://www.apache.org/licenses/LICENSE-2.0
272
+ *
273
+ * Unless required by applicable law or agreed to in writing, software
274
+ * distributed under the License is distributed on an "AS IS" BASIS,
275
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
276
+ * See the License for the specific language governing permissions and
277
+ * limitations under the License.
278
+ */const Ta="[DEFAULT]",uI={[ka]:"fire-core",[LT]:"fire-core-compat",[BT]:"fire-analytics",[jT]:"fire-analytics-compat",[FT]:"fire-app-check",[UT]:"fire-app-check-compat",[HT]:"fire-auth",[VT]:"fire-auth-compat",[WT]:"fire-rtdb",[qT]:"fire-data-connect",[zT]:"fire-rtdb-compat",[GT]:"fire-fn",[KT]:"fire-fn-compat",[JT]:"fire-iid",[YT]:"fire-iid-compat",[XT]:"fire-fcm",[QT]:"fire-fcm-compat",[ZT]:"fire-perf",[eI]:"fire-perf-compat",[tI]:"fire-rc",[nI]:"fire-rc-compat",[rI]:"fire-gcs",[sI]:"fire-gcs-compat",[oI]:"fire-fst",[aI]:"fire-fst-compat",[iI]:"fire-vertex","fire-js":"fire-js",[lI]:"fire-js-all"};/**
279
+ * @license
280
+ * Copyright 2019 Google LLC
281
+ *
282
+ * Licensed under the Apache License, Version 2.0 (the "License");
283
+ * you may not use this file except in compliance with the License.
284
+ * You may obtain a copy of the License at
285
+ *
286
+ * http://www.apache.org/licenses/LICENSE-2.0
287
+ *
288
+ * Unless required by applicable law or agreed to in writing, software
289
+ * distributed under the License is distributed on an "AS IS" BASIS,
290
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
291
+ * See the License for the specific language governing permissions and
292
+ * limitations under the License.
293
+ */const Js=new Map,dI=new Map,Ia=new Map;function Yc(e,t){try{e.container.addComponent(t)}catch(n){Qn.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function Ys(e){const t=e.name;if(Ia.has(t))return Qn.debug(`There were multiple attempts to register component ${t}.`),!1;Ia.set(t,e);for(const n of Js.values())Yc(n,e);for(const n of dI.values())Yc(n,e);return!0}function yf(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function An(e){return e==null?!1:e.settings!==void 0}/**
294
+ * @license
295
+ * Copyright 2019 Google LLC
296
+ *
297
+ * Licensed under the Apache License, Version 2.0 (the "License");
298
+ * you may not use this file except in compliance with the License.
299
+ * You may obtain a copy of the License at
300
+ *
301
+ * http://www.apache.org/licenses/LICENSE-2.0
302
+ *
303
+ * Unless required by applicable law or agreed to in writing, software
304
+ * distributed under the License is distributed on an "AS IS" BASIS,
305
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
306
+ * See the License for the specific language governing permissions and
307
+ * limitations under the License.
308
+ */const fI={"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."},wr=new no("app","Firebase",fI);/**
309
+ * @license
310
+ * Copyright 2019 Google LLC
311
+ *
312
+ * Licensed under the Apache License, Version 2.0 (the "License");
313
+ * you may not use this file except in compliance with the License.
314
+ * You may obtain a copy of the License at
315
+ *
316
+ * http://www.apache.org/licenses/LICENSE-2.0
317
+ *
318
+ * Unless required by applicable law or agreed to in writing, software
319
+ * distributed under the License is distributed on an "AS IS" BASIS,
320
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
321
+ * See the License for the specific language governing permissions and
322
+ * limitations under the License.
323
+ */class hI{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 fs("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 wr.create("app-deleted",{appName:this._name})}}/**
324
+ * @license
325
+ * Copyright 2019 Google LLC
326
+ *
327
+ * Licensed under the Apache License, Version 2.0 (the "License");
328
+ * you may not use this file except in compliance with the License.
329
+ * You may obtain a copy of the License at
330
+ *
331
+ * http://www.apache.org/licenses/LICENSE-2.0
332
+ *
333
+ * Unless required by applicable law or agreed to in writing, software
334
+ * distributed under the License is distributed on an "AS IS" BASIS,
335
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
336
+ * See the License for the specific language governing permissions and
337
+ * limitations under the License.
338
+ */const so=cI;function wf(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:Ta,automaticDataCollectionEnabled:!0,...t},s=r.name;if(typeof s!="string"||!s)throw wr.create("bad-app-name",{appName:String(s)});if(n||(n=hf()),!n)throw wr.create("no-options");const o=Js.get(s);if(o){if(ds(n,o.options)&&ds(r,o.config))return o;throw wr.create("duplicate-app",{appName:s})}const i=new wT(s);for(const l of Ia.values())i.addComponent(l);const a=new hI(n,r,i);return Js.set(s,a),a}function bf(e=Ta){const t=Js.get(e);if(!t&&e===Ta&&hf())return wf();if(!t)throw wr.create("no-app",{appName:e});return t}function pI(){return Array.from(Js.values())}function ss(e,t,n){let r=uI[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 "/")`),Qn.warn(i.join(" "));return}Ys(new fs(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/**
339
+ * @license
340
+ * Copyright 2021 Google LLC
341
+ *
342
+ * Licensed under the Apache License, Version 2.0 (the "License");
343
+ * you may not use this file except in compliance with the License.
344
+ * You may obtain a copy of the License at
345
+ *
346
+ * http://www.apache.org/licenses/LICENSE-2.0
347
+ *
348
+ * Unless required by applicable law or agreed to in writing, software
349
+ * distributed under the License is distributed on an "AS IS" BASIS,
350
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
351
+ * See the License for the specific language governing permissions and
352
+ * limitations under the License.
353
+ */const mI="firebase-heartbeat-database",gI=1,Xs="firebase-heartbeat-store";let qi=null;function _f(){return qi||(qi=MT(mI,gI,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Xs)}catch(n){console.warn(n)}}}}).catch(e=>{throw wr.create("idb-open",{originalErrorMessage:e.message})})),qi}async function vI(e){try{const n=(await _f()).transaction(Xs),r=await n.objectStore(Xs).get(kf(e));return await n.done,r}catch(t){if(t instanceof kr)Qn.warn(t.message);else{const n=wr.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});Qn.warn(n.message)}}}async function Xc(e,t){try{const r=(await _f()).transaction(Xs,"readwrite");await r.objectStore(Xs).put(t,kf(e)),await r.done}catch(n){if(n instanceof kr)Qn.warn(n.message);else{const r=wr.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Qn.warn(r.message)}}}function kf(e){return`${e.name}!${e.options.appId}`}/**
354
+ * @license
355
+ * Copyright 2021 Google LLC
356
+ *
357
+ * Licensed under the Apache License, Version 2.0 (the "License");
358
+ * you may not use this file except in compliance with the License.
359
+ * You may obtain a copy of the License at
360
+ *
361
+ * http://www.apache.org/licenses/LICENSE-2.0
362
+ *
363
+ * Unless required by applicable law or agreed to in writing, software
364
+ * distributed under the License is distributed on an "AS IS" BASIS,
365
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
366
+ * See the License for the specific language governing permissions and
367
+ * limitations under the License.
368
+ */const yI=1024,wI=30;class bI{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new kI(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=Qc();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>wI){const i=TI(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){Qn.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=Qc(),{heartbeatsToSend:r,unsentEntries:s}=_I(this._heartbeatsCache.heartbeats),o=df(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 Qn.warn(n),""}}}function Qc(){return new Date().toISOString().substring(0,10)}function _I(e,t=yI){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),Zc(n)>t){o.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),Zc(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class kI{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return iT()?aT().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await vI(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 Xc(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 Xc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...t.heartbeats]})}else return}}function Zc(e){return df(JSON.stringify({version:2,heartbeats:e})).length}function TI(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}/**
369
+ * @license
370
+ * Copyright 2019 Google LLC
371
+ *
372
+ * Licensed under the Apache License, Version 2.0 (the "License");
373
+ * you may not use this file except in compliance with the License.
374
+ * You may obtain a copy of the License at
375
+ *
376
+ * http://www.apache.org/licenses/LICENSE-2.0
377
+ *
378
+ * Unless required by applicable law or agreed to in writing, software
379
+ * distributed under the License is distributed on an "AS IS" BASIS,
380
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
381
+ * See the License for the specific language governing permissions and
382
+ * limitations under the License.
383
+ */function II(e){Ys(new fs("platform-logger",t=>new $T(t),"PRIVATE")),Ys(new fs("heartbeat",t=>new bI(t),"PRIVATE")),ss(ka,Jc,e),ss(ka,Jc,"esm2020"),ss("fire-js","")}II("");var SI="firebase",EI="12.11.0";/**
384
+ * @license
385
+ * Copyright 2020 Google LLC
386
+ *
387
+ * Licensed under the Apache License, Version 2.0 (the "License");
388
+ * you may not use this file except in compliance with the License.
389
+ * You may obtain a copy of the License at
390
+ *
391
+ * http://www.apache.org/licenses/LICENSE-2.0
392
+ *
393
+ * Unless required by applicable law or agreed to in writing, software
394
+ * distributed under the License is distributed on an "AS IS" BASIS,
395
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
396
+ * See the License for the specific language governing permissions and
397
+ * limitations under the License.
398
+ */ss(SI,EI,"app");function Tf(){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 CI=Tf,If=new no("auth","Firebase",Tf());/**
399
+ * @license
400
+ * Copyright 2020 Google LLC
401
+ *
402
+ * Licensed under the Apache License, Version 2.0 (the "License");
403
+ * you may not use this file except in compliance with the License.
404
+ * You may obtain a copy of the License at
405
+ *
406
+ * http://www.apache.org/licenses/LICENSE-2.0
407
+ *
408
+ * Unless required by applicable law or agreed to in writing, software
409
+ * distributed under the License is distributed on an "AS IS" BASIS,
410
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
411
+ * See the License for the specific language governing permissions and
412
+ * limitations under the License.
413
+ */const Bo=new mf("@firebase/auth");function AI(e,...t){Bo.logLevel<=vt.WARN&&Bo.warn(`Auth (${so}): ${e}`,...t)}function So(e,...t){Bo.logLevel<=vt.ERROR&&Bo.error(`Auth (${so}): ${e}`,...t)}/**
414
+ * @license
415
+ * Copyright 2020 Google LLC
416
+ *
417
+ * Licensed under the Apache License, Version 2.0 (the "License");
418
+ * you may not use this file except in compliance with the License.
419
+ * You may obtain a copy of the License at
420
+ *
421
+ * http://www.apache.org/licenses/LICENSE-2.0
422
+ *
423
+ * Unless required by applicable law or agreed to in writing, software
424
+ * distributed under the License is distributed on an "AS IS" BASIS,
425
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
426
+ * See the License for the specific language governing permissions and
427
+ * limitations under the License.
428
+ */function On(e,...t){throw al(e,...t)}function mn(e,...t){return al(e,...t)}function il(e,t,n){const r={...CI(),[t]:n};return new no("auth","Firebase",r).create(t,{appName:e.name})}function Br(e){return il(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function RI(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&On(e,"argument-error"),il(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function al(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 If.create(e,...t)}function Fe(e,t,...n){if(!e)throw al(t,...n)}function Wn(e){const t="INTERNAL ASSERTION FAILED: "+e;throw So(t),new Error(t)}function Zn(e,t){e||Wn(t)}/**
429
+ * @license
430
+ * Copyright 2020 Google LLC
431
+ *
432
+ * Licensed under the Apache License, Version 2.0 (the "License");
433
+ * you may not use this file except in compliance with the License.
434
+ * You may obtain a copy of the License at
435
+ *
436
+ * http://www.apache.org/licenses/LICENSE-2.0
437
+ *
438
+ * Unless required by applicable law or agreed to in writing, software
439
+ * distributed under the License is distributed on an "AS IS" BASIS,
440
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
441
+ * See the License for the specific language governing permissions and
442
+ * limitations under the License.
443
+ */function Sa(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function PI(){return eu()==="http:"||eu()==="https:"}function eu(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
444
+ * @license
445
+ * Copyright 2020 Google LLC
446
+ *
447
+ * Licensed under the Apache License, Version 2.0 (the "License");
448
+ * you may not use this file except in compliance with the License.
449
+ * You may obtain a copy of the License at
450
+ *
451
+ * http://www.apache.org/licenses/LICENSE-2.0
452
+ *
453
+ * Unless required by applicable law or agreed to in writing, software
454
+ * distributed under the License is distributed on an "AS IS" BASIS,
455
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
456
+ * See the License for the specific language governing permissions and
457
+ * limitations under the License.
458
+ */function xI(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(PI()||rT()||"connection"in navigator)?navigator.onLine:!0}function MI(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
459
+ * @license
460
+ * Copyright 2020 Google LLC
461
+ *
462
+ * Licensed under the Apache License, Version 2.0 (the "License");
463
+ * you may not use this file except in compliance with the License.
464
+ * You may obtain a copy of the License at
465
+ *
466
+ * http://www.apache.org/licenses/LICENSE-2.0
467
+ *
468
+ * Unless required by applicable law or agreed to in writing, software
469
+ * distributed under the License is distributed on an "AS IS" BASIS,
470
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
471
+ * See the License for the specific language governing permissions and
472
+ * limitations under the License.
473
+ */class oo{constructor(t,n){this.shortDelay=t,this.longDelay=n,Zn(n>t,"Short delay should be less than long delay!"),this.isMobile=tT()||sT()}get(){return xI()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
474
+ * @license
475
+ * Copyright 2020 Google LLC
476
+ *
477
+ * Licensed under the Apache License, Version 2.0 (the "License");
478
+ * you may not use this file except in compliance with the License.
479
+ * You may obtain a copy of the License at
480
+ *
481
+ * http://www.apache.org/licenses/LICENSE-2.0
482
+ *
483
+ * Unless required by applicable law or agreed to in writing, software
484
+ * distributed under the License is distributed on an "AS IS" BASIS,
485
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
486
+ * See the License for the specific language governing permissions and
487
+ * limitations under the License.
488
+ */function ll(e,t){Zn(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
489
+ * @license
490
+ * Copyright 2020 Google LLC
491
+ *
492
+ * Licensed under the Apache License, Version 2.0 (the "License");
493
+ * you may not use this file except in compliance with the License.
494
+ * You may obtain a copy of the License at
495
+ *
496
+ * http://www.apache.org/licenses/LICENSE-2.0
497
+ *
498
+ * Unless required by applicable law or agreed to in writing, software
499
+ * distributed under the License is distributed on an "AS IS" BASIS,
500
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
501
+ * See the License for the specific language governing permissions and
502
+ * limitations under the License.
503
+ */class Sf{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;Wn("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;Wn("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;Wn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
504
+ * @license
505
+ * Copyright 2020 Google LLC
506
+ *
507
+ * Licensed under the Apache License, Version 2.0 (the "License");
508
+ * you may not use this file except in compliance with the License.
509
+ * You may obtain a copy of the License at
510
+ *
511
+ * http://www.apache.org/licenses/LICENSE-2.0
512
+ *
513
+ * Unless required by applicable law or agreed to in writing, software
514
+ * distributed under the License is distributed on an "AS IS" BASIS,
515
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
516
+ * See the License for the specific language governing permissions and
517
+ * limitations under the License.
518
+ */const OI={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
519
+ * @license
520
+ * Copyright 2020 Google LLC
521
+ *
522
+ * Licensed under the Apache License, Version 2.0 (the "License");
523
+ * you may not use this file except in compliance with the License.
524
+ * You may obtain a copy of the License at
525
+ *
526
+ * http://www.apache.org/licenses/LICENSE-2.0
527
+ *
528
+ * Unless required by applicable law or agreed to in writing, software
529
+ * distributed under the License is distributed on an "AS IS" BASIS,
530
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
531
+ * See the License for the specific language governing permissions and
532
+ * limitations under the License.
533
+ */const NI=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],$I=new oo(3e4,6e4);function cl(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function gs(e,t,n,r,s={}){return Ef(e,s,async()=>{let o={},i={};r&&(t==="GET"?i=r:o={body:JSON.stringify(r)});const a=ro({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 nT()||(u.referrerPolicy="no-referrer"),e.emulatorConfig&&sl(e.emulatorConfig.host)&&(u.credentials="include"),Sf.fetch()(await Cf(e,e.config.apiHost,n,a),u)})}async function Ef(e,t,n){e._canInitEmulator=!1;const r={...OI,...t};try{const s=new LI(e),o=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw po(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 po(e,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw po(e,"email-already-in-use",i);if(l==="USER_DISABLED")throw po(e,"user-disabled",i);const c=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw il(e,c,u);On(e,c)}}catch(s){if(s instanceof kr)throw s;On(e,"network-request-failed",{message:String(s)})}}async function DI(e,t,n,r,s={}){const o=await gs(e,t,n,r,s);return"mfaPendingCredential"in o&&On(e,"multi-factor-auth-required",{_serverResponse:o}),o}async function Cf(e,t,n,r){const s=`${t}${n}?${r}`,o=e,i=o.config.emulator?ll(e.config,s):`${e.config.apiScheme}://${s}`;return NI.includes(n)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(i).toString():i}class LI{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(mn(this.auth,"network-request-failed")),$I.get())})}}function po(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=mn(e,t,r);return s.customData._tokenResponse=n,s}/**
534
+ * @license
535
+ * Copyright 2020 Google LLC
536
+ *
537
+ * Licensed under the Apache License, Version 2.0 (the "License");
538
+ * you may not use this file except in compliance with the License.
539
+ * You may obtain a copy of the License at
540
+ *
541
+ * http://www.apache.org/licenses/LICENSE-2.0
542
+ *
543
+ * Unless required by applicable law or agreed to in writing, software
544
+ * distributed under the License is distributed on an "AS IS" BASIS,
545
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
546
+ * See the License for the specific language governing permissions and
547
+ * limitations under the License.
548
+ */async function jI(e,t){return gs(e,"POST","/v1/accounts:delete",t)}async function Uo(e,t){return gs(e,"POST","/v1/accounts:lookup",t)}/**
549
+ * @license
550
+ * Copyright 2020 Google LLC
551
+ *
552
+ * Licensed under the Apache License, Version 2.0 (the "License");
553
+ * you may not use this file except in compliance with the License.
554
+ * You may obtain a copy of the License at
555
+ *
556
+ * http://www.apache.org/licenses/LICENSE-2.0
557
+ *
558
+ * Unless required by applicable law or agreed to in writing, software
559
+ * distributed under the License is distributed on an "AS IS" BASIS,
560
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
561
+ * See the License for the specific language governing permissions and
562
+ * limitations under the License.
563
+ */function js(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function BI(e,t=!1){const n=ms(e),r=await n.getIdToken(t),s=ul(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:js(zi(s.auth_time)),issuedAtTime:js(zi(s.iat)),expirationTime:js(zi(s.exp)),signInProvider:i||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function zi(e){return Number(e)*1e3}function ul(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return So("JWT malformed, contained fewer than 3 sections"),null;try{const s=ff(n);return s?JSON.parse(s):(So("Failed to decode base64 JWT payload"),null)}catch(s){return So("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function tu(e){const t=ul(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)}/**
564
+ * @license
565
+ * Copyright 2020 Google LLC
566
+ *
567
+ * Licensed under the Apache License, Version 2.0 (the "License");
568
+ * you may not use this file except in compliance with the License.
569
+ * You may obtain a copy of the License at
570
+ *
571
+ * http://www.apache.org/licenses/LICENSE-2.0
572
+ *
573
+ * Unless required by applicable law or agreed to in writing, software
574
+ * distributed under the License is distributed on an "AS IS" BASIS,
575
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
576
+ * See the License for the specific language governing permissions and
577
+ * limitations under the License.
578
+ */async function Qs(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof kr&&UI(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function UI({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
579
+ * @license
580
+ * Copyright 2020 Google LLC
581
+ *
582
+ * Licensed under the Apache License, Version 2.0 (the "License");
583
+ * you may not use this file except in compliance with the License.
584
+ * You may obtain a copy of the License at
585
+ *
586
+ * http://www.apache.org/licenses/LICENSE-2.0
587
+ *
588
+ * Unless required by applicable law or agreed to in writing, software
589
+ * distributed under the License is distributed on an "AS IS" BASIS,
590
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
591
+ * See the License for the specific language governing permissions and
592
+ * limitations under the License.
593
+ */class FI{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(t){if(t){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(t=!1){if(!this.isRunning)return;const n=this.getInterval(t);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){(t==null?void 0:t.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
594
+ * @license
595
+ * Copyright 2020 Google LLC
596
+ *
597
+ * Licensed under the Apache License, Version 2.0 (the "License");
598
+ * you may not use this file except in compliance with the License.
599
+ * You may obtain a copy of the License at
600
+ *
601
+ * http://www.apache.org/licenses/LICENSE-2.0
602
+ *
603
+ * Unless required by applicable law or agreed to in writing, software
604
+ * distributed under the License is distributed on an "AS IS" BASIS,
605
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
606
+ * See the License for the specific language governing permissions and
607
+ * limitations under the License.
608
+ */class Ea{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=js(this.lastLoginAt),this.creationTime=js(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
609
+ * @license
610
+ * Copyright 2019 Google LLC
611
+ *
612
+ * Licensed under the Apache License, Version 2.0 (the "License");
613
+ * you may not use this file except in compliance with the License.
614
+ * You may obtain a copy of the License at
615
+ *
616
+ * http://www.apache.org/licenses/LICENSE-2.0
617
+ *
618
+ * Unless required by applicable law or agreed to in writing, software
619
+ * distributed under the License is distributed on an "AS IS" BASIS,
620
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
621
+ * See the License for the specific language governing permissions and
622
+ * limitations under the License.
623
+ */async function Fo(e){var f;const t=e.auth,n=await e.getIdToken(),r=await Qs(e,Uo(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?Af(s.providerUserInfo):[],i=VI(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 Ea(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(e,c)}async function HI(e){const t=ms(e);await Fo(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function VI(e,t){return[...e.filter(r=>!t.some(s=>s.providerId===r.providerId)),...t]}function Af(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}))}/**
624
+ * @license
625
+ * Copyright 2020 Google LLC
626
+ *
627
+ * Licensed under the Apache License, Version 2.0 (the "License");
628
+ * you may not use this file except in compliance with the License.
629
+ * You may obtain a copy of the License at
630
+ *
631
+ * http://www.apache.org/licenses/LICENSE-2.0
632
+ *
633
+ * Unless required by applicable law or agreed to in writing, software
634
+ * distributed under the License is distributed on an "AS IS" BASIS,
635
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
636
+ * See the License for the specific language governing permissions and
637
+ * limitations under the License.
638
+ */async function WI(e,t){const n=await Ef(e,{},async()=>{const r=ro({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:o}=e.config,i=await Cf(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&&sl(e.emulatorConfig.host)&&(l.credentials="include"),Sf.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function qI(e,t){return gs(e,"POST","/v2/accounts:revokeToken",cl(e,t))}/**
639
+ * @license
640
+ * Copyright 2020 Google LLC
641
+ *
642
+ * Licensed under the Apache License, Version 2.0 (the "License");
643
+ * you may not use this file except in compliance with the License.
644
+ * You may obtain a copy of the License at
645
+ *
646
+ * http://www.apache.org/licenses/LICENSE-2.0
647
+ *
648
+ * Unless required by applicable law or agreed to in writing, software
649
+ * distributed under the License is distributed on an "AS IS" BASIS,
650
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
651
+ * See the License for the specific language governing permissions and
652
+ * limitations under the License.
653
+ */class os{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):tu(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){Fe(t.length!==0,"internal-error");const n=tu(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 WI(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 os;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 os,this.toJSON())}_performRefresh(){return Wn("not implemented")}}/**
654
+ * @license
655
+ * Copyright 2020 Google LLC
656
+ *
657
+ * Licensed under the Apache License, Version 2.0 (the "License");
658
+ * you may not use this file except in compliance with the License.
659
+ * You may obtain a copy of the License at
660
+ *
661
+ * http://www.apache.org/licenses/LICENSE-2.0
662
+ *
663
+ * Unless required by applicable law or agreed to in writing, software
664
+ * distributed under the License is distributed on an "AS IS" BASIS,
665
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
666
+ * See the License for the specific language governing permissions and
667
+ * limitations under the License.
668
+ */function ur(e,t){Fe(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class fn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new FI(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 Ea(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await Qs(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 BI(this,t)}reload(){return HI(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 fn({...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 Fo(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(An(this.auth.app))return Promise.reject(Br(this.auth));const t=await this.getIdToken();return await Qs(this,jI(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:g,isAnonymous:I,providerData:j,stsTokenManager:x}=n;Fe(f&&x,t,"internal-error");const B=os.fromJSON(this.name,x);Fe(typeof f=="string",t,"internal-error"),ur(r,t.name),ur(s,t.name),Fe(typeof g=="boolean",t,"internal-error"),Fe(typeof I=="boolean",t,"internal-error"),ur(o,t.name),ur(i,t.name),ur(a,t.name),ur(l,t.name),ur(u,t.name),ur(c,t.name);const ee=new fn({uid:f,auth:t,email:s,emailVerified:g,displayName:r,isAnonymous:I,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:B,createdAt:u,lastLoginAt:c});return j&&Array.isArray(j)&&(ee.providerData=j.map(z=>({...z}))),l&&(ee._redirectEventId=l),ee}static async _fromIdTokenResponse(t,n,r=!1){const s=new os;s.updateFromServerResponse(n);const o=new fn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await Fo(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?Af(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new os;a.updateFromIdToken(r);const l=new fn({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 Ea(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,u),l}}/**
669
+ * @license
670
+ * Copyright 2020 Google LLC
671
+ *
672
+ * Licensed under the Apache License, Version 2.0 (the "License");
673
+ * you may not use this file except in compliance with the License.
674
+ * You may obtain a copy of the License at
675
+ *
676
+ * http://www.apache.org/licenses/LICENSE-2.0
677
+ *
678
+ * Unless required by applicable law or agreed to in writing, software
679
+ * distributed under the License is distributed on an "AS IS" BASIS,
680
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
681
+ * See the License for the specific language governing permissions and
682
+ * limitations under the License.
683
+ */const nu=new Map;function qn(e){Zn(e instanceof Function,"Expected a class definition");let t=nu.get(e);return t?(Zn(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,nu.set(e,t),t)}/**
684
+ * @license
685
+ * Copyright 2019 Google LLC
686
+ *
687
+ * Licensed under the Apache License, Version 2.0 (the "License");
688
+ * you may not use this file except in compliance with the License.
689
+ * You may obtain a copy of the License at
690
+ *
691
+ * http://www.apache.org/licenses/LICENSE-2.0
692
+ *
693
+ * Unless required by applicable law or agreed to in writing, software
694
+ * distributed under the License is distributed on an "AS IS" BASIS,
695
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
696
+ * See the License for the specific language governing permissions and
697
+ * limitations under the License.
698
+ */class Rf{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){}}Rf.type="NONE";const ru=Rf;/**
699
+ * @license
700
+ * Copyright 2019 Google LLC
701
+ *
702
+ * Licensed under the Apache License, Version 2.0 (the "License");
703
+ * you may not use this file except in compliance with the License.
704
+ * You may obtain a copy of the License at
705
+ *
706
+ * http://www.apache.org/licenses/LICENSE-2.0
707
+ *
708
+ * Unless required by applicable law or agreed to in writing, software
709
+ * distributed under the License is distributed on an "AS IS" BASIS,
710
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
711
+ * See the License for the specific language governing permissions and
712
+ * limitations under the License.
713
+ */function Eo(e,t,n){return`firebase:${e}:${t}:${n}`}class is{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=Eo(this.userKey,s.apiKey,o),this.fullPersistenceKey=Eo("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 Uo(this.auth,{idToken:t}).catch(()=>{});return n?fn._fromGetAccountInfoResponse(this.auth,n,t):null}return fn._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 is(qn(ru),t,r);const s=(await Promise.all(n.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let o=s[0]||qn(ru);const i=Eo(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 g=await Uo(t,{idToken:c}).catch(()=>{});if(!g)break;f=await fn._fromGetAccountInfoResponse(t,g,c)}else f=fn._fromJSON(t,c);u!==o&&(a=f),o=u;break}}catch{}const l=s.filter(u=>u._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new is(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 is(o,t,r))}}/**
714
+ * @license
715
+ * Copyright 2020 Google LLC
716
+ *
717
+ * Licensed under the Apache License, Version 2.0 (the "License");
718
+ * you may not use this file except in compliance with the License.
719
+ * You may obtain a copy of the License at
720
+ *
721
+ * http://www.apache.org/licenses/LICENSE-2.0
722
+ *
723
+ * Unless required by applicable law or agreed to in writing, software
724
+ * distributed under the License is distributed on an "AS IS" BASIS,
725
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
726
+ * See the License for the specific language governing permissions and
727
+ * limitations under the License.
728
+ */function su(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Of(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Pf(t))return"Firefox";if(t.includes("silk/"))return"Silk";if($f(t))return"Blackberry";if(Df(t))return"Webos";if(xf(t))return"Safari";if((t.includes("chrome/")||Mf(t))&&!t.includes("edge/"))return"Chrome";if(Nf(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 Pf(e=Qt()){return/firefox\//i.test(e)}function xf(e=Qt()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Mf(e=Qt()){return/crios\//i.test(e)}function Of(e=Qt()){return/iemobile/i.test(e)}function Nf(e=Qt()){return/android/i.test(e)}function $f(e=Qt()){return/blackberry/i.test(e)}function Df(e=Qt()){return/webos/i.test(e)}function dl(e=Qt()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function zI(e=Qt()){var t;return dl(e)&&!!((t=window.navigator)!=null&&t.standalone)}function GI(){return oT()&&document.documentMode===10}function Lf(e=Qt()){return dl(e)||Nf(e)||Df(e)||$f(e)||/windows phone/i.test(e)||Of(e)}/**
729
+ * @license
730
+ * Copyright 2020 Google LLC
731
+ *
732
+ * Licensed under the Apache License, Version 2.0 (the "License");
733
+ * you may not use this file except in compliance with the License.
734
+ * You may obtain a copy of the License at
735
+ *
736
+ * http://www.apache.org/licenses/LICENSE-2.0
737
+ *
738
+ * Unless required by applicable law or agreed to in writing, software
739
+ * distributed under the License is distributed on an "AS IS" BASIS,
740
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
741
+ * See the License for the specific language governing permissions and
742
+ * limitations under the License.
743
+ */function jf(e,t=[]){let n;switch(e){case"Browser":n=su(Qt());break;case"Worker":n=`${su(Qt())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${so}/${r}`}/**
744
+ * @license
745
+ * Copyright 2022 Google LLC
746
+ *
747
+ * Licensed under the Apache License, Version 2.0 (the "License");
748
+ * you may not use this file except in compliance with the License.
749
+ * You may obtain a copy of the License at
750
+ *
751
+ * http://www.apache.org/licenses/LICENSE-2.0
752
+ *
753
+ * Unless required by applicable law or agreed to in writing, software
754
+ * distributed under the License is distributed on an "AS IS" BASIS,
755
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
756
+ * See the License for the specific language governing permissions and
757
+ * limitations under the License.
758
+ */class KI{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,n){const r=o=>new Promise((i,a)=>{try{const l=t(o);i(l)}catch(l){a(l)}});r.onAbort=n,this.queue.push(r);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const n=[];try{for(const r of this.queue)await r(t),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const s of n)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/**
759
+ * @license
760
+ * Copyright 2023 Google LLC
761
+ *
762
+ * Licensed under the Apache License, Version 2.0 (the "License");
763
+ * you may not use this file except in compliance with the License.
764
+ * You may obtain a copy of the License at
765
+ *
766
+ * http://www.apache.org/licenses/LICENSE-2.0
767
+ *
768
+ * Unless required by applicable law or agreed to in writing, software
769
+ * distributed under the License is distributed on an "AS IS" BASIS,
770
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
771
+ * See the License for the specific language governing permissions and
772
+ * limitations under the License.
773
+ */async function JI(e,t={}){return gs(e,"GET","/v2/passwordPolicy",cl(e,t))}/**
774
+ * @license
775
+ * Copyright 2023 Google LLC
776
+ *
777
+ * Licensed under the Apache License, Version 2.0 (the "License");
778
+ * you may not use this file except in compliance with the License.
779
+ * You may obtain a copy of the License at
780
+ *
781
+ * http://www.apache.org/licenses/LICENSE-2.0
782
+ *
783
+ * Unless required by applicable law or agreed to in writing, software
784
+ * distributed under the License is distributed on an "AS IS" BASIS,
785
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
786
+ * See the License for the specific language governing permissions and
787
+ * limitations under the License.
788
+ */const YI=6;class XI{constructor(t){var r;const n=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??YI,n.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=n.maxPasswordLength),n.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=n.containsLowercaseCharacter),n.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=n.containsUppercaseCharacter),n.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=n.containsNumericCharacter),n.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=n.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((r=t.allowedNonAlphanumericCharacters)==null?void 0:r.join(""))??"",this.forceUpgradeOnSignin=t.forceUpgradeOnSignin??!1,this.schemaVersion=t.schemaVersion}validatePassword(t){const n={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,n),this.validatePasswordCharacterOptions(t,n),n.isValid&&(n.isValid=n.meetsMinPasswordLength??!0),n.isValid&&(n.isValid=n.meetsMaxPasswordLength??!0),n.isValid&&(n.isValid=n.containsLowercaseLetter??!0),n.isValid&&(n.isValid=n.containsUppercaseLetter??!0),n.isValid&&(n.isValid=n.containsNumericCharacter??!0),n.isValid&&(n.isValid=n.containsNonAlphanumericCharacter??!0),n}validatePasswordLengthOptions(t,n){const r=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=t.length>=r),s&&(n.meetsMaxPasswordLength=t.length<=s)}validatePasswordCharacterOptions(t,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let s=0;s<t.length;s++)r=t.charAt(s),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(t,n,r,s,o){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=o))}}/**
789
+ * @license
790
+ * Copyright 2020 Google LLC
791
+ *
792
+ * Licensed under the Apache License, Version 2.0 (the "License");
793
+ * you may not use this file except in compliance with the License.
794
+ * You may obtain a copy of the License at
795
+ *
796
+ * http://www.apache.org/licenses/LICENSE-2.0
797
+ *
798
+ * Unless required by applicable law or agreed to in writing, software
799
+ * distributed under the License is distributed on an "AS IS" BASIS,
800
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
801
+ * See the License for the specific language governing permissions and
802
+ * limitations under the License.
803
+ */class QI{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 ou(this),this.idTokenSubscription=new ou(this),this.beforeStateQueue=new KI(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=If,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=qn(n)),this._initializationPromise=this.queue(async()=>{var r,s,o;if(!this._deleted&&(this.persistenceManager=await is.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 Uo(this,{idToken:t}),r=await fn._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(An(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 Fo(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=MI()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(An(this.app))return Promise.reject(Br(this));const n=t?ms(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 An(this.app)?Promise.reject(Br(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return An(this.app)?Promise.reject(Br(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(qn(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 JI(this),n=new XI(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 no("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 qI(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&&qn(t)||this._popupRedirectResolver;Fe(n,this,"argument-error"),this.redirectPersistenceManager=await is.create(this,[qn(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=jf(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(An(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&&AI(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function li(e){return ms(e)}class ou{constructor(t){this.auth=t,this.observer=null,this.addObserver=fT(n=>this.observer=n)}get next(){return Fe(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
804
+ * @license
805
+ * Copyright 2020 Google LLC
806
+ *
807
+ * Licensed under the Apache License, Version 2.0 (the "License");
808
+ * you may not use this file except in compliance with the License.
809
+ * You may obtain a copy of the License at
810
+ *
811
+ * http://www.apache.org/licenses/LICENSE-2.0
812
+ *
813
+ * Unless required by applicable law or agreed to in writing, software
814
+ * distributed under the License is distributed on an "AS IS" BASIS,
815
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
816
+ * See the License for the specific language governing permissions and
817
+ * limitations under the License.
818
+ */let fl={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function ZI(e){fl=e}function eS(e){return fl.loadJS(e)}function tS(){return fl.gapiScript}function nS(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
819
+ * @license
820
+ * Copyright 2020 Google LLC
821
+ *
822
+ * Licensed under the Apache License, Version 2.0 (the "License");
823
+ * you may not use this file except in compliance with the License.
824
+ * You may obtain a copy of the License at
825
+ *
826
+ * http://www.apache.org/licenses/LICENSE-2.0
827
+ *
828
+ * Unless required by applicable law or agreed to in writing, software
829
+ * distributed under the License is distributed on an "AS IS" BASIS,
830
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
831
+ * See the License for the specific language governing permissions and
832
+ * limitations under the License.
833
+ */function rS(e,t){const n=yf(e,"auth");if(n.isInitialized()){const s=n.getImmediate(),o=n.getOptions();if(ds(o,t??{}))return s;On(s,"already-initialized")}return n.initialize({options:t})}function sS(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(qn);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function oS(e,t,n){const r=li(e);Fe(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const s=!1,o=Bf(t),{host:i,port:a}=iS(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(ds(u,r.config.emulator)&&ds(c,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=c,r.settings.appVerificationDisabledForTesting=!0,sl(i)?mT(`${o}//${i}${l}`):aS()}function Bf(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function iS(e){const t=Bf(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:iu(r.substr(o.length+1))}}else{const[o,i]=r.split(":");return{host:o,port:iu(i)}}}function iu(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function aS(){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())}/**
834
+ * @license
835
+ * Copyright 2020 Google LLC
836
+ *
837
+ * Licensed under the Apache License, Version 2.0 (the "License");
838
+ * you may not use this file except in compliance with the License.
839
+ * You may obtain a copy of the License at
840
+ *
841
+ * http://www.apache.org/licenses/LICENSE-2.0
842
+ *
843
+ * Unless required by applicable law or agreed to in writing, software
844
+ * distributed under the License is distributed on an "AS IS" BASIS,
845
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
846
+ * See the License for the specific language governing permissions and
847
+ * limitations under the License.
848
+ */class Uf{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return Wn("not implemented")}_getIdTokenResponse(t){return Wn("not implemented")}_linkToIdToken(t,n){return Wn("not implemented")}_getReauthenticationResolver(t){return Wn("not implemented")}}/**
849
+ * @license
850
+ * Copyright 2020 Google LLC
851
+ *
852
+ * Licensed under the Apache License, Version 2.0 (the "License");
853
+ * you may not use this file except in compliance with the License.
854
+ * You may obtain a copy of the License at
855
+ *
856
+ * http://www.apache.org/licenses/LICENSE-2.0
857
+ *
858
+ * Unless required by applicable law or agreed to in writing, software
859
+ * distributed under the License is distributed on an "AS IS" BASIS,
860
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
861
+ * See the License for the specific language governing permissions and
862
+ * limitations under the License.
863
+ */async function as(e,t){return DI(e,"POST","/v1/accounts:signInWithIdp",cl(e,t))}/**
864
+ * @license
865
+ * Copyright 2020 Google LLC
866
+ *
867
+ * Licensed under the Apache License, Version 2.0 (the "License");
868
+ * you may not use this file except in compliance with the License.
869
+ * You may obtain a copy of the License at
870
+ *
871
+ * http://www.apache.org/licenses/LICENSE-2.0
872
+ *
873
+ * Unless required by applicable law or agreed to in writing, software
874
+ * distributed under the License is distributed on an "AS IS" BASIS,
875
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
876
+ * See the License for the specific language governing permissions and
877
+ * limitations under the License.
878
+ */const lS="http://localhost";class Fr extends Uf{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new Fr(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):On("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 Fr(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 as(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,as(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,as(t,n)}buildRequest(){const t={requestUri:lS,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=ro(n)}return t}}/**
879
+ * @license
880
+ * Copyright 2020 Google LLC
881
+ *
882
+ * Licensed under the Apache License, Version 2.0 (the "License");
883
+ * you may not use this file except in compliance with the License.
884
+ * You may obtain a copy of the License at
885
+ *
886
+ * http://www.apache.org/licenses/LICENSE-2.0
887
+ *
888
+ * Unless required by applicable law or agreed to in writing, software
889
+ * distributed under the License is distributed on an "AS IS" BASIS,
890
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
891
+ * See the License for the specific language governing permissions and
892
+ * limitations under the License.
893
+ */class hl{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}}/**
894
+ * @license
895
+ * Copyright 2019 Google LLC
896
+ *
897
+ * Licensed under the Apache License, Version 2.0 (the "License");
898
+ * you may not use this file except in compliance with the License.
899
+ * You may obtain a copy of the License at
900
+ *
901
+ * http://www.apache.org/licenses/LICENSE-2.0
902
+ *
903
+ * Unless required by applicable law or agreed to in writing, software
904
+ * distributed under the License is distributed on an "AS IS" BASIS,
905
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
906
+ * See the License for the specific language governing permissions and
907
+ * limitations under the License.
908
+ */class io extends hl{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
909
+ * @license
910
+ * Copyright 2020 Google LLC
911
+ *
912
+ * Licensed under the Apache License, Version 2.0 (the "License");
913
+ * you may not use this file except in compliance with the License.
914
+ * You may obtain a copy of the License at
915
+ *
916
+ * http://www.apache.org/licenses/LICENSE-2.0
917
+ *
918
+ * Unless required by applicable law or agreed to in writing, software
919
+ * distributed under the License is distributed on an "AS IS" BASIS,
920
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
921
+ * See the License for the specific language governing permissions and
922
+ * limitations under the License.
923
+ */class mr extends io{constructor(){super("facebook.com")}static credential(t){return Fr._fromParams({providerId:mr.PROVIDER_ID,signInMethod:mr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return mr.credentialFromTaggedObject(t)}static credentialFromError(t){return mr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return mr.credential(t.oauthAccessToken)}catch{return null}}}mr.FACEBOOK_SIGN_IN_METHOD="facebook.com";mr.PROVIDER_ID="facebook.com";/**
924
+ * @license
925
+ * Copyright 2020 Google LLC
926
+ *
927
+ * Licensed under the Apache License, Version 2.0 (the "License");
928
+ * you may not use this file except in compliance with the License.
929
+ * You may obtain a copy of the License at
930
+ *
931
+ * http://www.apache.org/licenses/LICENSE-2.0
932
+ *
933
+ * Unless required by applicable law or agreed to in writing, software
934
+ * distributed under the License is distributed on an "AS IS" BASIS,
935
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
936
+ * See the License for the specific language governing permissions and
937
+ * limitations under the License.
938
+ */class gr extends io{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return Fr._fromParams({providerId:gr.PROVIDER_ID,signInMethod:gr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return gr.credentialFromTaggedObject(t)}static credentialFromError(t){return gr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return gr.credential(n,r)}catch{return null}}}gr.GOOGLE_SIGN_IN_METHOD="google.com";gr.PROVIDER_ID="google.com";/**
939
+ * @license
940
+ * Copyright 2020 Google LLC
941
+ *
942
+ * Licensed under the Apache License, Version 2.0 (the "License");
943
+ * you may not use this file except in compliance with the License.
944
+ * You may obtain a copy of the License at
945
+ *
946
+ * http://www.apache.org/licenses/LICENSE-2.0
947
+ *
948
+ * Unless required by applicable law or agreed to in writing, software
949
+ * distributed under the License is distributed on an "AS IS" BASIS,
950
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
951
+ * See the License for the specific language governing permissions and
952
+ * limitations under the License.
953
+ */class Rn extends io{constructor(){super("github.com")}static credential(t){return Fr._fromParams({providerId:Rn.PROVIDER_ID,signInMethod:Rn.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Rn.credentialFromTaggedObject(t)}static credentialFromError(t){return Rn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Rn.credential(t.oauthAccessToken)}catch{return null}}}Rn.GITHUB_SIGN_IN_METHOD="github.com";Rn.PROVIDER_ID="github.com";/**
954
+ * @license
955
+ * Copyright 2020 Google LLC
956
+ *
957
+ * Licensed under the Apache License, Version 2.0 (the "License");
958
+ * you may not use this file except in compliance with the License.
959
+ * You may obtain a copy of the License at
960
+ *
961
+ * http://www.apache.org/licenses/LICENSE-2.0
962
+ *
963
+ * Unless required by applicable law or agreed to in writing, software
964
+ * distributed under the License is distributed on an "AS IS" BASIS,
965
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
966
+ * See the License for the specific language governing permissions and
967
+ * limitations under the License.
968
+ */class vr extends io{constructor(){super("twitter.com")}static credential(t,n){return Fr._fromParams({providerId:vr.PROVIDER_ID,signInMethod:vr.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret: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{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return vr.credential(n,r)}catch{return null}}}vr.TWITTER_SIGN_IN_METHOD="twitter.com";vr.PROVIDER_ID="twitter.com";/**
969
+ * @license
970
+ * Copyright 2020 Google LLC
971
+ *
972
+ * Licensed under the Apache License, Version 2.0 (the "License");
973
+ * you may not use this file except in compliance with the License.
974
+ * You may obtain a copy of the License at
975
+ *
976
+ * http://www.apache.org/licenses/LICENSE-2.0
977
+ *
978
+ * Unless required by applicable law or agreed to in writing, software
979
+ * distributed under the License is distributed on an "AS IS" BASIS,
980
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
981
+ * See the License for the specific language governing permissions and
982
+ * limitations under the License.
983
+ */class hs{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 fn._fromIdTokenResponse(t,r,s),i=au(r);return new hs({user:o,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const s=au(r);return new hs({user:t,providerId:s,_tokenResponse:r,operationType:n})}}function au(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
984
+ * @license
985
+ * Copyright 2020 Google LLC
986
+ *
987
+ * Licensed under the Apache License, Version 2.0 (the "License");
988
+ * you may not use this file except in compliance with the License.
989
+ * You may obtain a copy of the License at
990
+ *
991
+ * http://www.apache.org/licenses/LICENSE-2.0
992
+ *
993
+ * Unless required by applicable law or agreed to in writing, software
994
+ * distributed under the License is distributed on an "AS IS" BASIS,
995
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
996
+ * See the License for the specific language governing permissions and
997
+ * limitations under the License.
998
+ */class Ho extends kr{constructor(t,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,Ho.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 Ho(t,n,r,s)}}function Ff(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?Ho._fromErrorAndOperation(e,o,t,r):o})}async function cS(e,t,n=!1){const r=await Qs(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return hs._forOperation(e,"link",r)}/**
999
+ * @license
1000
+ * Copyright 2019 Google LLC
1001
+ *
1002
+ * Licensed under the Apache License, Version 2.0 (the "License");
1003
+ * you may not use this file except in compliance with the License.
1004
+ * You may obtain a copy of the License at
1005
+ *
1006
+ * http://www.apache.org/licenses/LICENSE-2.0
1007
+ *
1008
+ * Unless required by applicable law or agreed to in writing, software
1009
+ * distributed under the License is distributed on an "AS IS" BASIS,
1010
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1011
+ * See the License for the specific language governing permissions and
1012
+ * limitations under the License.
1013
+ */async function uS(e,t,n=!1){const{auth:r}=e;if(An(r.app))return Promise.reject(Br(r));const s="reauthenticate";try{const o=await Qs(e,Ff(r,s,t,e),n);Fe(o.idToken,r,"internal-error");const i=ul(o.idToken);Fe(i,r,"internal-error");const{sub:a}=i;return Fe(e.uid===a,r,"user-mismatch"),hs._forOperation(e,s,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&On(r,"user-mismatch"),o}}/**
1014
+ * @license
1015
+ * Copyright 2020 Google LLC
1016
+ *
1017
+ * Licensed under the Apache License, Version 2.0 (the "License");
1018
+ * you may not use this file except in compliance with the License.
1019
+ * You may obtain a copy of the License at
1020
+ *
1021
+ * http://www.apache.org/licenses/LICENSE-2.0
1022
+ *
1023
+ * Unless required by applicable law or agreed to in writing, software
1024
+ * distributed under the License is distributed on an "AS IS" BASIS,
1025
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1026
+ * See the License for the specific language governing permissions and
1027
+ * limitations under the License.
1028
+ */async function dS(e,t,n=!1){if(An(e.app))return Promise.reject(Br(e));const r="signIn",s=await Ff(e,r,t),o=await hs._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(o.user),o}function fS(e,t,n,r){return ms(e).onIdTokenChanged(t,n,r)}function hS(e,t,n){return ms(e).beforeAuthStateChanged(t,n)}const Vo="__sak";/**
1029
+ * @license
1030
+ * Copyright 2019 Google LLC
1031
+ *
1032
+ * Licensed under the Apache License, Version 2.0 (the "License");
1033
+ * you may not use this file except in compliance with the License.
1034
+ * You may obtain a copy of the License at
1035
+ *
1036
+ * http://www.apache.org/licenses/LICENSE-2.0
1037
+ *
1038
+ * Unless required by applicable law or agreed to in writing, software
1039
+ * distributed under the License is distributed on an "AS IS" BASIS,
1040
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1041
+ * See the License for the specific language governing permissions and
1042
+ * limitations under the License.
1043
+ */class Hf{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Vo,"1"),this.storage.removeItem(Vo),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()}}/**
1044
+ * @license
1045
+ * Copyright 2020 Google LLC
1046
+ *
1047
+ * Licensed under the Apache License, Version 2.0 (the "License");
1048
+ * you may not use this file except in compliance with the License.
1049
+ * You may obtain a copy of the License at
1050
+ *
1051
+ * http://www.apache.org/licenses/LICENSE-2.0
1052
+ *
1053
+ * Unless required by applicable law or agreed to in writing, software
1054
+ * distributed under the License is distributed on an "AS IS" BASIS,
1055
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1056
+ * See the License for the specific language governing permissions and
1057
+ * limitations under the License.
1058
+ */const pS=1e3,mS=10;class Vf extends Hf{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Lf(),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);GI()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,mS):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)})},pS)}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]}}Vf.type="LOCAL";const gS=Vf;/**
1059
+ * @license
1060
+ * Copyright 2020 Google LLC
1061
+ *
1062
+ * Licensed under the Apache License, Version 2.0 (the "License");
1063
+ * you may not use this file except in compliance with the License.
1064
+ * You may obtain a copy of the License at
1065
+ *
1066
+ * http://www.apache.org/licenses/LICENSE-2.0
1067
+ *
1068
+ * Unless required by applicable law or agreed to in writing, software
1069
+ * distributed under the License is distributed on an "AS IS" BASIS,
1070
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1071
+ * See the License for the specific language governing permissions and
1072
+ * limitations under the License.
1073
+ */class Wf extends Hf{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}Wf.type="SESSION";const qf=Wf;/**
1074
+ * @license
1075
+ * Copyright 2019 Google LLC
1076
+ *
1077
+ * Licensed under the Apache License, Version 2.0 (the "License");
1078
+ * you may not use this file except in compliance with the License.
1079
+ * You may obtain a copy of the License at
1080
+ *
1081
+ * http://www.apache.org/licenses/LICENSE-2.0
1082
+ *
1083
+ * Unless required by applicable law or agreed to in writing, software
1084
+ * distributed under the License is distributed on an "AS IS" BASIS,
1085
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1086
+ * See the License for the specific language governing permissions and
1087
+ * limitations under the License.
1088
+ */function vS(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
1089
+ * @license
1090
+ * Copyright 2019 Google LLC
1091
+ *
1092
+ * Licensed under the Apache License, Version 2.0 (the "License");
1093
+ * you may not use this file except in compliance with the License.
1094
+ * You may obtain a copy of the License at
1095
+ *
1096
+ * http://www.apache.org/licenses/LICENSE-2.0
1097
+ *
1098
+ * Unless required by applicable law or agreed to in writing, software
1099
+ * distributed under the License is distributed on an "AS IS" BASIS,
1100
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1101
+ * See the License for the specific language governing permissions and
1102
+ * limitations under the License.
1103
+ */class ci{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const n=this.receivers.find(s=>s.isListeningto(t));if(n)return n;const r=new ci(t);return this.receivers.push(r),r}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const n=t,{eventId:r,eventType:s,data:o}=n.data,i=this.handlersMap[s];if(!(i!=null&&i.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:s});const a=Array.from(i).map(async u=>u(n.origin,o)),l=await vS(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:s,response:l})}_subscribe(t,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(n)}_unsubscribe(t,n){this.handlersMap[t]&&n&&this.handlersMap[t].delete(n),(!n||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}ci.receivers=[];/**
1104
+ * @license
1105
+ * Copyright 2020 Google LLC
1106
+ *
1107
+ * Licensed under the Apache License, Version 2.0 (the "License");
1108
+ * you may not use this file except in compliance with the License.
1109
+ * You may obtain a copy of the License at
1110
+ *
1111
+ * http://www.apache.org/licenses/LICENSE-2.0
1112
+ *
1113
+ * Unless required by applicable law or agreed to in writing, software
1114
+ * distributed under the License is distributed on an "AS IS" BASIS,
1115
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1116
+ * See the License for the specific language governing permissions and
1117
+ * limitations under the License.
1118
+ */function pl(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
1119
+ * @license
1120
+ * Copyright 2019 Google LLC
1121
+ *
1122
+ * Licensed under the Apache License, Version 2.0 (the "License");
1123
+ * you may not use this file except in compliance with the License.
1124
+ * You may obtain a copy of the License at
1125
+ *
1126
+ * http://www.apache.org/licenses/LICENSE-2.0
1127
+ *
1128
+ * Unless required by applicable law or agreed to in writing, software
1129
+ * distributed under the License is distributed on an "AS IS" BASIS,
1130
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1131
+ * See the License for the specific language governing permissions and
1132
+ * limitations under the License.
1133
+ */class yS{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=pl("",20);s.port1.start();const c=setTimeout(()=>{l(new Error("unsupported_event"))},r);i={messageChannel:s,onMessage(f){const g=f;if(g.data.eventId===u)switch(g.data.status){case"ack":clearTimeout(c),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(g.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)})}}/**
1134
+ * @license
1135
+ * Copyright 2020 Google LLC
1136
+ *
1137
+ * Licensed under the Apache License, Version 2.0 (the "License");
1138
+ * you may not use this file except in compliance with the License.
1139
+ * You may obtain a copy of the License at
1140
+ *
1141
+ * http://www.apache.org/licenses/LICENSE-2.0
1142
+ *
1143
+ * Unless required by applicable law or agreed to in writing, software
1144
+ * distributed under the License is distributed on an "AS IS" BASIS,
1145
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1146
+ * See the License for the specific language governing permissions and
1147
+ * limitations under the License.
1148
+ */function Mn(){return window}function wS(e){Mn().location.href=e}/**
1149
+ * @license
1150
+ * Copyright 2020 Google LLC.
1151
+ *
1152
+ * Licensed under the Apache License, Version 2.0 (the "License");
1153
+ * you may not use this file except in compliance with the License.
1154
+ * You may obtain a copy of the License at
1155
+ *
1156
+ * http://www.apache.org/licenses/LICENSE-2.0
1157
+ *
1158
+ * Unless required by applicable law or agreed to in writing, software
1159
+ * distributed under the License is distributed on an "AS IS" BASIS,
1160
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1161
+ * See the License for the specific language governing permissions and
1162
+ * limitations under the License.
1163
+ */function zf(){return typeof Mn().WorkerGlobalScope<"u"&&typeof Mn().importScripts=="function"}async function bS(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function _S(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function kS(){return zf()?self:null}/**
1164
+ * @license
1165
+ * Copyright 2019 Google LLC
1166
+ *
1167
+ * Licensed under the Apache License, Version 2.0 (the "License");
1168
+ * you may not use this file except in compliance with the License.
1169
+ * You may obtain a copy of the License at
1170
+ *
1171
+ * http://www.apache.org/licenses/LICENSE-2.0
1172
+ *
1173
+ * Unless required by applicable law or agreed to in writing, software
1174
+ * distributed under the License is distributed on an "AS IS" BASIS,
1175
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1176
+ * See the License for the specific language governing permissions and
1177
+ * limitations under the License.
1178
+ */const Gf="firebaseLocalStorageDb",TS=1,Wo="firebaseLocalStorage",Kf="fbase_key";class ao{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 ui(e,t){return e.transaction([Wo],t?"readwrite":"readonly").objectStore(Wo)}function IS(){const e=indexedDB.deleteDatabase(Gf);return new ao(e).toPromise()}function Ca(){const e=indexedDB.open(Gf,TS);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(Wo,{keyPath:Kf})}catch(s){n(s)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(Wo)?t(r):(r.close(),await IS(),t(await Ca()))})})}async function lu(e,t,n){const r=ui(e,!0).put({[Kf]:t,value:n});return new ao(r).toPromise()}async function SS(e,t){const n=ui(e,!1).get(t),r=await new ao(n).toPromise();return r===void 0?null:r.value}function cu(e,t){const n=ui(e,!0).delete(t);return new ao(n).toPromise()}const ES=800,CS=3;class Jf{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 Ca(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>CS)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return zf()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=ci._getInstance(kS()),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 bS(),!this.activeServiceWorker)return;this.sender=new yS(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||_S()!==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 Ca();return await lu(t,Vo,"1"),await cu(t,Vo),!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=>lu(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>SS(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>cu(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(s=>{const o=ui(s,!1).getAll();return new ao(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(),ES)}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()}}Jf.type="LOCAL";const AS=Jf;new oo(3e4,6e4);/**
1179
+ * @license
1180
+ * Copyright 2021 Google LLC
1181
+ *
1182
+ * Licensed under the Apache License, Version 2.0 (the "License");
1183
+ * you may not use this file except in compliance with the License.
1184
+ * You may obtain a copy of the License at
1185
+ *
1186
+ * http://www.apache.org/licenses/LICENSE-2.0
1187
+ *
1188
+ * Unless required by applicable law or agreed to in writing, software
1189
+ * distributed under the License is distributed on an "AS IS" BASIS,
1190
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1191
+ * See the License for the specific language governing permissions and
1192
+ * limitations under the License.
1193
+ */function Yf(e,t){return t?qn(t):(Fe(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
1194
+ * @license
1195
+ * Copyright 2019 Google LLC
1196
+ *
1197
+ * Licensed under the Apache License, Version 2.0 (the "License");
1198
+ * you may not use this file except in compliance with the License.
1199
+ * You may obtain a copy of the License at
1200
+ *
1201
+ * http://www.apache.org/licenses/LICENSE-2.0
1202
+ *
1203
+ * Unless required by applicable law or agreed to in writing, software
1204
+ * distributed under the License is distributed on an "AS IS" BASIS,
1205
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1206
+ * See the License for the specific language governing permissions and
1207
+ * limitations under the License.
1208
+ */class ml extends Uf{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return as(t,this._buildIdpRequest())}_linkToIdToken(t,n){return as(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return as(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 RS(e){return dS(e.auth,new ml(e),e.bypassAuthState)}function PS(e){const{auth:t,user:n}=e;return Fe(n,t,"internal-error"),uS(n,new ml(e),e.bypassAuthState)}async function xS(e){const{auth:t,user:n}=e;return Fe(n,t,"internal-error"),cS(n,new ml(e),e.bypassAuthState)}/**
1209
+ * @license
1210
+ * Copyright 2020 Google LLC
1211
+ *
1212
+ * Licensed under the Apache License, Version 2.0 (the "License");
1213
+ * you may not use this file except in compliance with the License.
1214
+ * You may obtain a copy of the License at
1215
+ *
1216
+ * http://www.apache.org/licenses/LICENSE-2.0
1217
+ *
1218
+ * Unless required by applicable law or agreed to in writing, software
1219
+ * distributed under the License is distributed on an "AS IS" BASIS,
1220
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1221
+ * See the License for the specific language governing permissions and
1222
+ * limitations under the License.
1223
+ */class Xf{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 RS;case"linkViaPopup":case"linkViaRedirect":return xS;case"reauthViaPopup":case"reauthViaRedirect":return PS;default:On(this.auth,"internal-error")}}resolve(t){Zn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){Zn(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()}}/**
1224
+ * @license
1225
+ * Copyright 2020 Google LLC
1226
+ *
1227
+ * Licensed under the Apache License, Version 2.0 (the "License");
1228
+ * you may not use this file except in compliance with the License.
1229
+ * You may obtain a copy of the License at
1230
+ *
1231
+ * http://www.apache.org/licenses/LICENSE-2.0
1232
+ *
1233
+ * Unless required by applicable law or agreed to in writing, software
1234
+ * distributed under the License is distributed on an "AS IS" BASIS,
1235
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1236
+ * See the License for the specific language governing permissions and
1237
+ * limitations under the License.
1238
+ */const MS=new oo(2e3,1e4);async function OS(e,t,n){if(An(e.app))return Promise.reject(mn(e,"operation-not-supported-in-this-environment"));const r=li(e);RI(e,t,hl);const s=Yf(r,n);return new Dr(r,"signInViaPopup",t,s).executeNotNull()}class Dr extends Xf{constructor(t,n,r,s,o){super(t,n,s,o),this.provider=r,this.authWindow=null,this.pollId=null,Dr.currentPopupAction&&Dr.currentPopupAction.cancel(),Dr.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Fe(t,this.auth,"internal-error"),t}async onExecution(){Zn(this.filter.length===1,"Popup operations only handle one event");const t=pl();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(mn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(mn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Dr.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(mn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,MS.get())};t()}}Dr.currentPopupAction=null;/**
1239
+ * @license
1240
+ * Copyright 2020 Google LLC
1241
+ *
1242
+ * Licensed under the Apache License, Version 2.0 (the "License");
1243
+ * you may not use this file except in compliance with the License.
1244
+ * You may obtain a copy of the License at
1245
+ *
1246
+ * http://www.apache.org/licenses/LICENSE-2.0
1247
+ *
1248
+ * Unless required by applicable law or agreed to in writing, software
1249
+ * distributed under the License is distributed on an "AS IS" BASIS,
1250
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1251
+ * See the License for the specific language governing permissions and
1252
+ * limitations under the License.
1253
+ */const NS="pendingRedirect",Co=new Map;class $S extends Xf{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=Co.get(this.auth._key());if(!t){try{const r=await DS(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}Co.set(this.auth._key(),t)}return this.bypassAuthState||Co.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 DS(e,t){const n=BS(t),r=jS(e);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function LS(e,t){Co.set(e._key(),t)}function jS(e){return qn(e._redirectPersistence)}function BS(e){return Eo(NS,e.config.apiKey,e.name)}async function US(e,t,n=!1){if(An(e.app))return Promise.reject(Br(e));const r=li(e),s=Yf(r,t),i=await new $S(r,s,n).execute();return i&&!n&&(delete i.user._redirectEventId,await r._persistUserIfCurrent(i.user),await r._setRedirectUser(null,t)),i}/**
1254
+ * @license
1255
+ * Copyright 2020 Google LLC
1256
+ *
1257
+ * Licensed under the Apache License, Version 2.0 (the "License");
1258
+ * you may not use this file except in compliance with the License.
1259
+ * You may obtain a copy of the License at
1260
+ *
1261
+ * http://www.apache.org/licenses/LICENSE-2.0
1262
+ *
1263
+ * Unless required by applicable law or agreed to in writing, software
1264
+ * distributed under the License is distributed on an "AS IS" BASIS,
1265
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1266
+ * See the License for the specific language governing permissions and
1267
+ * limitations under the License.
1268
+ */const FS=600*1e3;class HS{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||!VS(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!Qf(t)){const s=((r=t.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(mn(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>=FS&&this.cachedEventUids.clear(),this.cachedEventUids.has(uu(t))}saveEventToCache(t){this.cachedEventUids.add(uu(t)),this.lastProcessedEventTime=Date.now()}}function uu(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function Qf({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function VS(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Qf(e);default:return!1}}/**
1269
+ * @license
1270
+ * Copyright 2020 Google LLC
1271
+ *
1272
+ * Licensed under the Apache License, Version 2.0 (the "License");
1273
+ * you may not use this file except in compliance with the License.
1274
+ * You may obtain a copy of the License at
1275
+ *
1276
+ * http://www.apache.org/licenses/LICENSE-2.0
1277
+ *
1278
+ * Unless required by applicable law or agreed to in writing, software
1279
+ * distributed under the License is distributed on an "AS IS" BASIS,
1280
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1281
+ * See the License for the specific language governing permissions and
1282
+ * limitations under the License.
1283
+ */async function WS(e,t={}){return gs(e,"GET","/v1/projects",t)}/**
1284
+ * @license
1285
+ * Copyright 2020 Google LLC
1286
+ *
1287
+ * Licensed under the Apache License, Version 2.0 (the "License");
1288
+ * you may not use this file except in compliance with the License.
1289
+ * You may obtain a copy of the License at
1290
+ *
1291
+ * http://www.apache.org/licenses/LICENSE-2.0
1292
+ *
1293
+ * Unless required by applicable law or agreed to in writing, software
1294
+ * distributed under the License is distributed on an "AS IS" BASIS,
1295
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1296
+ * See the License for the specific language governing permissions and
1297
+ * limitations under the License.
1298
+ */const qS=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,zS=/^https?/;async function GS(e){if(e.config.emulator)return;const{authorizedDomains:t}=await WS(e);for(const n of t)try{if(KS(n))return}catch{}On(e,"unauthorized-domain")}function KS(e){const t=Sa(),{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(!zS.test(n))return!1;if(qS.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
1299
+ * @license
1300
+ * Copyright 2020 Google LLC.
1301
+ *
1302
+ * Licensed under the Apache License, Version 2.0 (the "License");
1303
+ * you may not use this file except in compliance with the License.
1304
+ * You may obtain a copy of the License at
1305
+ *
1306
+ * http://www.apache.org/licenses/LICENSE-2.0
1307
+ *
1308
+ * Unless required by applicable law or agreed to in writing, software
1309
+ * distributed under the License is distributed on an "AS IS" BASIS,
1310
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1311
+ * See the License for the specific language governing permissions and
1312
+ * limitations under the License.
1313
+ */const JS=new oo(3e4,6e4);function du(){const e=Mn().___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 YS(e){return new Promise((t,n)=>{var s,o,i;function r(){du(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{du(),n(mn(e,"network-request-failed"))},timeout:JS.get()})}if((o=(s=Mn().gapi)==null?void 0:s.iframes)!=null&&o.Iframe)t(gapi.iframes.getContext());else if((i=Mn().gapi)!=null&&i.load)r();else{const a=nS("iframefcb");return Mn()[a]=()=>{gapi.load?r():n(mn(e,"network-request-failed"))},eS(`${tS()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw Ao=null,t})}let Ao=null;function XS(e){return Ao=Ao||YS(e),Ao}/**
1314
+ * @license
1315
+ * Copyright 2020 Google LLC.
1316
+ *
1317
+ * Licensed under the Apache License, Version 2.0 (the "License");
1318
+ * you may not use this file except in compliance with the License.
1319
+ * You may obtain a copy of the License at
1320
+ *
1321
+ * http://www.apache.org/licenses/LICENSE-2.0
1322
+ *
1323
+ * Unless required by applicable law or agreed to in writing, software
1324
+ * distributed under the License is distributed on an "AS IS" BASIS,
1325
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1326
+ * See the License for the specific language governing permissions and
1327
+ * limitations under the License.
1328
+ */const QS=new oo(5e3,15e3),ZS="__/auth/iframe",eE="emulator/auth/iframe",tE={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},nE=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function rE(e){const t=e.config;Fe(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?ll(t,eE):`https://${e.config.authDomain}/${ZS}`,r={apiKey:t.apiKey,appName:e.name,v:so},s=nE.get(e.config.apiHost);s&&(r.eid=s);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${ro(r).slice(1)}`}async function sE(e){const t=await XS(e),n=Mn().gapi;return Fe(n,e,"internal-error"),t.open({where:document.body,url:rE(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:tE,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const i=mn(e,"network-request-failed"),a=Mn().setTimeout(()=>{o(i)},QS.get());function l(){Mn().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{o(i)})}))}/**
1329
+ * @license
1330
+ * Copyright 2020 Google LLC.
1331
+ *
1332
+ * Licensed under the Apache License, Version 2.0 (the "License");
1333
+ * you may not use this file except in compliance with the License.
1334
+ * You may obtain a copy of the License at
1335
+ *
1336
+ * http://www.apache.org/licenses/LICENSE-2.0
1337
+ *
1338
+ * Unless required by applicable law or agreed to in writing, software
1339
+ * distributed under the License is distributed on an "AS IS" BASIS,
1340
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1341
+ * See the License for the specific language governing permissions and
1342
+ * limitations under the License.
1343
+ */const oE={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},iE=500,aE=600,lE="_blank",cE="http://localhost";class fu{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function uE(e,t,n,r=iE,s=aE){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={...oE,width:r.toString(),height:s.toString(),top:o,left:i},u=Qt().toLowerCase();n&&(a=Mf(u)?lE:n),Pf(u)&&(t=t||cE,l.scrollbars="yes");const c=Object.entries(l).reduce((g,[I,j])=>`${g}${I}=${j},`,"");if(zI(u)&&a!=="_self")return dE(t||"",a),new fu(null);const f=window.open(t||"",a,c);Fe(f,e,"popup-blocked");try{f.focus()}catch{}return new fu(f)}function dE(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)}/**
1344
+ * @license
1345
+ * Copyright 2021 Google LLC
1346
+ *
1347
+ * Licensed under the Apache License, Version 2.0 (the "License");
1348
+ * you may not use this file except in compliance with the License.
1349
+ * You may obtain a copy of the License at
1350
+ *
1351
+ * http://www.apache.org/licenses/LICENSE-2.0
1352
+ *
1353
+ * Unless required by applicable law or agreed to in writing, software
1354
+ * distributed under the License is distributed on an "AS IS" BASIS,
1355
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1356
+ * See the License for the specific language governing permissions and
1357
+ * limitations under the License.
1358
+ */const fE="__/auth/handler",hE="emulator/auth/handler",pE=encodeURIComponent("fac");async function hu(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:so,eventId:s};if(t instanceof hl){t.setDefaultLanguage(e.languageCode),i.providerId=t.providerId||"",dT(t.getCustomParameters())||(i.customParameters=JSON.stringify(t.getCustomParameters()));for(const[c,f]of Object.entries({}))i[c]=f}if(t instanceof io){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?`#${pE}=${encodeURIComponent(l)}`:"";return`${mE(e)}?${ro(a).slice(1)}${u}`}function mE({config:e}){return e.emulator?ll(e,hE):`https://${e.authDomain}/${fE}`}/**
1359
+ * @license
1360
+ * Copyright 2020 Google LLC
1361
+ *
1362
+ * Licensed under the Apache License, Version 2.0 (the "License");
1363
+ * you may not use this file except in compliance with the License.
1364
+ * You may obtain a copy of the License at
1365
+ *
1366
+ * http://www.apache.org/licenses/LICENSE-2.0
1367
+ *
1368
+ * Unless required by applicable law or agreed to in writing, software
1369
+ * distributed under the License is distributed on an "AS IS" BASIS,
1370
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1371
+ * See the License for the specific language governing permissions and
1372
+ * limitations under the License.
1373
+ */const Gi="webStorageSupport";class gE{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=qf,this._completeRedirectFn=US,this._overrideRedirectResult=LS}async _openPopup(t,n,r,s){var i;Zn((i=this.eventManagers[t._key()])==null?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await hu(t,n,r,Sa(),s);return uE(t,o,pl())}async _openRedirect(t,n,r,s){await this._originValidation(t);const o=await hu(t,n,r,Sa(),s);return wS(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):(Zn(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 sE(t),r=new HS(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(Gi,{type:Gi},s=>{var i;const o=(i=s==null?void 0:s[0])==null?void 0:i[Gi];o!==void 0&&n(!!o),On(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=GS(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return Lf()||xf()||dl()}}const vE=gE;var pu="@firebase/auth",mu="1.12.2";/**
1374
+ * @license
1375
+ * Copyright 2020 Google LLC
1376
+ *
1377
+ * Licensed under the Apache License, Version 2.0 (the "License");
1378
+ * you may not use this file except in compliance with the License.
1379
+ * You may obtain a copy of the License at
1380
+ *
1381
+ * http://www.apache.org/licenses/LICENSE-2.0
1382
+ *
1383
+ * Unless required by applicable law or agreed to in writing, software
1384
+ * distributed under the License is distributed on an "AS IS" BASIS,
1385
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1386
+ * See the License for the specific language governing permissions and
1387
+ * limitations under the License.
1388
+ */class yE{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),((t=this.auth.currentUser)==null?void 0:t.uid)||null}async getToken(t){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(t)}:null}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const n=this.auth.onIdTokenChanged(r=>{t((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(t,n),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const n=this.internalListeners.get(t);n&&(this.internalListeners.delete(t),n(),this.updateProactiveRefresh())}assertAuthConfigured(){Fe(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1389
+ * @license
1390
+ * Copyright 2020 Google LLC
1391
+ *
1392
+ * Licensed under the Apache License, Version 2.0 (the "License");
1393
+ * you may not use this file except in compliance with the License.
1394
+ * You may obtain a copy of the License at
1395
+ *
1396
+ * http://www.apache.org/licenses/LICENSE-2.0
1397
+ *
1398
+ * Unless required by applicable law or agreed to in writing, software
1399
+ * distributed under the License is distributed on an "AS IS" BASIS,
1400
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1401
+ * See the License for the specific language governing permissions and
1402
+ * limitations under the License.
1403
+ */function wE(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 bE(e){Ys(new fs("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:jf(e)},u=new QI(r,s,o,l);return sS(u,n),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),Ys(new fs("auth-internal",t=>{const n=li(t.getProvider("auth").getImmediate());return(r=>new yE(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),ss(pu,mu,wE(e)),ss(pu,mu,"esm2020")}/**
1404
+ * @license
1405
+ * Copyright 2021 Google LLC
1406
+ *
1407
+ * Licensed under the Apache License, Version 2.0 (the "License");
1408
+ * you may not use this file except in compliance with the License.
1409
+ * You may obtain a copy of the License at
1410
+ *
1411
+ * http://www.apache.org/licenses/LICENSE-2.0
1412
+ *
1413
+ * Unless required by applicable law or agreed to in writing, software
1414
+ * distributed under the License is distributed on an "AS IS" BASIS,
1415
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1416
+ * See the License for the specific language governing permissions and
1417
+ * limitations under the License.
1418
+ */const _E=300,kE=pf("authIdTokenMaxAge")||_E;let gu=null;const TE=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>kE)return;const s=n==null?void 0:n.token;gu!==s&&(gu=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function IE(e=bf()){const t=yf(e,"auth");if(t.isInitialized())return t.getImmediate();const n=rS(e,{popupRedirectResolver:vE,persistence:[AS,gS,qf]}),r=pf("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=TE(o.toString());hS(n,i,()=>i(n.currentUser)),fS(n,a=>i(a))}}const s=Z0("auth");return s&&oS(n,`http://${s}`),n}function SE(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}ZI({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=mn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",SE().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="});bE("Browser");const EE={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 CE(e){const t=D(null),n=D(""),r=D(""),s=D(""),o=D({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),i=ce(()=>s.value==="pull"),a=ce(()=>s.value==="push"),l=ce(()=>s.value!=="");async function u(){try{const x=await fetch("/codex-api/skills-sync/status");if(!x.ok)return;const B=await x.json();B.data&&(o.value=B.data)}catch{}}async function c(){try{const x=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),B=await x.json();if(!x.ok||!B.data)throw new Error("Failed to start GitHub login");t.value=B.data;const ee=30,z=Math.max((B.data.interval??5)*1e3,3e3);let Q=!1;for(let K=0;K<ee;K++){await new Promise(ve=>setTimeout(ve,z));const le=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:B.data.device_code})}),de=await le.json();if(!le.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(x){e.showToast(x instanceof Error?x.message:"Failed GitHub login","error")}}async function f(){try{const x=pI().length>0?bf():wf(EE),B=IE(x),ee=new Rn;ee.addScope("repo");const z=await OS(B,ee),Q=Rn.credentialFromResult(z),K=(Q==null?void 0:Q.accessToken)??"";if(!K)throw new Error("GitHub access token missing from Firebase login");const le=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:K})}),de=await le.json();if(!le.ok||!de.ok)throw new Error(de.error||"Failed to login with GitHub token");await u(),e.showToast("GitHub login successful")}catch(x){const B=x instanceof Error?x.message:"Failed Firebase GitHub login";e.showToast(B,"error")}}async function g(){r.value="",n.value="pull-started",s.value="pull";try{const x=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),B=await x.json();if(!x.ok||!B.ok)throw new Error(B.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(x){const B=x instanceof Error?x.message:"Failed to pull sync";r.value=B,n.value="pull-failed",e.showToast(B,"error")}finally{s.value=""}}async function I(){r.value="",n.value="push-started",s.value="push";try{const x=await fetch("/codex-api/skills-sync/push",{method:"POST"}),B=await x.json();if(!x.ok||!B.ok)throw new Error(B.error||"Failed to push synced skills");n.value="push-success",e.showToast("Pushed skills to private sync repo")}catch(x){const B=x instanceof Error?x.message:"Failed to push sync";r.value=B,n.value="push-failed",e.showToast(B,"error")}finally{s.value=""}}async function j(){try{const x=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),B=await x.json();if(!x.ok||!B.ok)throw new Error(B.error||"Failed to logout GitHub");await u(),e.showToast("Logged out from GitHub")}catch(x){e.showToast(x instanceof Error?x.message:"Failed to logout GitHub","error")}}return{deviceLogin:t,isPullInFlight:i,isPushInFlight:a,isSyncActionInFlight:l,loadSyncStatus:u,logoutGithub:j,pullSkillsSync:g,pushSkillsSync:I,startGithubFirebaseLogin:f,startGithubLogin:c,syncActionError:r,syncActionStatus:n,syncStatus:o}}const AE={class:"skills-hub"},RE={class:"skills-sync-panel"},PE={class:"skills-sync-header"},xE={key:0,class:"skills-sync-badge"},ME={key:1,class:"skills-sync-badge"},OE={key:2,class:"skills-sync-badge"},NE={class:"skills-sync-meta"},$E={key:0,class:"skills-sync-error"},DE={key:1,class:"skills-sync-meta"},LE={key:2,class:"skills-sync-error"},jE={key:3,class:"skills-sync-device"},BE=["href"],UE={class:"skills-sync-actions"},FE=["disabled"],HE=["disabled"],VE=["disabled"],WE={key:1,class:"skills-hub-section"},qE={class:"skills-hub-section-title"},zE={key:0,class:"skills-hub-grid"},GE={class:"skills-hub-toolbar"},KE={class:"skills-hub-search-wrap"},JE={key:0,class:"skills-hub-count"},YE={class:"skills-hub-section"},XE={key:0,class:"skills-hub-loading"},QE={key:1,class:"skills-hub-error"},ZE={key:0,class:"skills-hub-grid"},eC={key:1,class:"skills-hub-empty"},mo="codex-web-local.skills-hub.cache.v1",tC=Rt({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=D(null),s=D(""),o=D("date"),i=D([]),a=D([]),l=D(0),u=D(!1),c=D(""),f=D(!0),g=D(!1),I=D(n),j=D(null),x=D(""),B=D(!1),ee=D(!1);let z=null,Q=null;const K=t,le=ce(()=>o.value==="date"?"Newest":"A-Z"),de=ce(()=>{var O;return((O=j.value)==null?void 0:O.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),ve=ce(()=>`${I.value.owner}/${I.value.name}`),Te=ce(()=>B.value&&x.value===ve.value),ae=ce(()=>ee.value&&x.value===ve.value),te=ce(()=>{const O=s.value.toLowerCase().trim();return O?a.value.filter(L=>L.name.toLowerCase().includes(O)||L.owner.toLowerCase().includes(O)||(L.displayName??"").toLowerCase().includes(O)):a.value});function re(O,L="success"){j.value={text:O,type:L},Q&&clearTimeout(Q),Q=setTimeout(()=>{j.value=null},3e3)}function X(){o.value=o.value==="date"?"name":"date",Ee(s.value)}function Pe(O){return`${o.value}::${O.trim().toLowerCase()}`}function ke(O){var L;if(typeof window>"u")return null;try{const q=window.localStorage.getItem(mo);return q?((L=JSON.parse(q).byKey)==null?void 0:L[O])??null:null}catch{return null}}function $e(O,L){if(!(typeof window>"u"))try{const q=window.localStorage.getItem(mo),G=(q?JSON.parse(q):{}).byKey??{};G[O]=L,window.localStorage.setItem(mo,JSON.stringify({byKey:G}))}catch{}}function Ae(){if(!(typeof window>"u"))try{window.localStorage.removeItem(mo)}catch{}}function we(O){const L=O.installed??[];a.value=L;const q=new Set(L.map(Y=>Y.name));i.value=O.data.map(Y=>{if(Y.installed||q.has(Y.name)){const G=L.find(_e=>_e.name===Y.name);return{...Y,installed:!0,path:(G==null?void 0:G.path)??Y.path,enabled:(G==null?void 0:G.enabled)??Y.enabled}}return Y}).filter(Y=>!Y.installed),l.value=O.total}async function Ee(O){const L=Pe(O),q=ke(L);q&&we(q),u.value=!q,c.value="";try{const Y=new URLSearchParams;O.trim()&&Y.set("q",O.trim()),Y.set("limit","100"),Y.set("sort",o.value);const G=await fetch(`/codex-api/skills-hub?${Y}`);if(!G.ok)throw new Error(`HTTP ${G.status}`);const _e=await G.json();we(_e),$e(L,_e)}catch(Y){c.value=Y instanceof Error?Y.message:"Failed to load skills"}finally{u.value=!1}}function ht(){z&&clearTimeout(z),z=setTimeout(()=>Ee(s.value),300)}function Ge(O){I.value=O,g.value=!0}async function He(O){x.value=`${O.owner}/${O.name}`,B.value=!0;try{const q=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:O.owner,name:O.name})})).json();if(!q.ok)throw new Error(q.error||"Install failed");const Y={...O,installed:!0,path:q.path,enabled:!0};a.value=[...a.value,Y],i.value=i.value.filter(G=>G.name!==O.name),I.value=Y,re(`${O.displayName||O.name} skill installed`),g.value=!1,Ae(),K("skills-changed")}catch(L){re(L instanceof Error?L.message:"Failed to install skill","error")}finally{B.value=!1}}async function Ke(O){x.value=`${O.owner}/${O.name}`,ee.value=!0;try{const q=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:O.name,path:O.path})})).json();if(!q.ok)throw new Error(q.error||"Uninstall failed");a.value=a.value.filter(Y=>Y.name!==O.name),O.owner!=="local"&&(i.value=[...i.value,{...O,installed:!1,path:void 0,enabled:void 0}]),re(`${O.displayName||O.name} skill uninstalled`),g.value=!1,Ae(),K("skills-changed")}catch(L){re(L instanceof Error?L.message:"Failed to uninstall skill","error")}finally{ee.value=!1}}async function Ze(O,L){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:O.path,enabled:L}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),re(`${O.displayName||O.name} skill ${L?"enabled":"disabled"}`),await Ee(s.value)}catch(q){re(q instanceof Error?q.message:"Failed to update skill","error")}}const{deviceLogin:pt,isPullInFlight:Ne,isPushInFlight:Be,isSyncActionInFlight:W,loadSyncStatus:fe,logoutGithub:ue,pullSkillsSync:be,pushSkillsSync:Ce,startGithubFirebaseLogin:v,startGithubLogin:_,syncActionError:M,syncActionStatus:H,syncStatus:U}=CE({showToast:re,onPulled:async()=>{await Ee(s.value),K("skills-changed")}});return tr(()=>{Ee(""),fe()}),(O,L)=>(b(),S("div",AE,[L[11]||(L[11]=p("div",{class:"skills-hub-header"},[p("h2",{class:"skills-hub-title"},"Skills Hub"),p("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),p("div",RE,[p("div",PE,[L[8]||(L[8]=p("strong",null,"Skills Sync (GitHub)",-1)),ye(U).configured?(b(),S("span",xE,"Connected: "+oe(ye(U).repoOwner)+"/"+oe(ye(U).repoName),1)):ye(U).loggedIn?(b(),S("span",ME,"Logged in as "+oe(ye(U).githubUsername),1)):(b(),S("span",OE,"Not connected"))]),p("div",NE,[p("span",null,"Startup: "+oe(ye(U).startup.mode),1),p("span",null,"Branch: "+oe(ye(U).startup.branch),1),p("span",null,"Action: "+oe(ye(U).startup.lastAction),1)]),ye(U).startup.lastError?(b(),S("div",$E,oe(ye(U).startup.lastError),1)):ie("",!0),ye(H)?(b(),S("div",DE,[p("span",null,"Manual sync: "+oe(ye(H)),1)])):ie("",!0),ye(M)?(b(),S("div",LE,oe(ye(M)),1)):ie("",!0),ye(pt)?(b(),S("div",jE,[p("span",null,[L[9]||(L[9]=qs("Open ",-1)),p("a",{href:ye(pt).verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,BE),L[10]||(L[10]=qs(" and enter code:",-1))]),p("code",null,oe(ye(pt).user_code),1)])):ie("",!0),p("div",UE,[ye(U).loggedIn?ie("",!0):(b(),S("button",{key:0,class:"skills-hub-sort",type:"button",onClick:L[0]||(L[0]=(...q)=>ye(v)&&ye(v)(...q))},"Login with GitHub")),ye(U).loggedIn?ie("",!0):(b(),S("button",{key:1,class:"skills-hub-sort",type:"button",onClick:L[1]||(L[1]=(...q)=>ye(_)&&ye(_)(...q))},"Device Login")),ye(U).loggedIn?(b(),S("button",{key:2,class:"skills-hub-sort",type:"button",onClick:L[2]||(L[2]=(...q)=>ye(ue)&&ye(ue)(...q)),disabled:ye(W)},"Logout GitHub",8,FE)):ie("",!0),p("button",{class:"skills-hub-sort",type:"button",onClick:L[3]||(L[3]=(...q)=>ye(be)&&ye(be)(...q)),disabled:ye(W)},oe(ye(Ne)?"Pulling...":"Pull"),9,HE),ye(U).loggedIn?(b(),S("button",{key:3,class:"skills-hub-sort",type:"button",onClick:L[4]||(L[4]=(...q)=>ye(Ce)&&ye(Ce)(...q)),disabled:!ye(U).configured||ye(W)},oe(ye(Be)?"Pushing...":"Push"),9,VE)):ie("",!0)])]),j.value?(b(),S("div",{key:0,class:st(["skills-hub-toast",de.value])},oe(j.value.text),3)):ie("",!0),te.value.length>0?(b(),S("div",WE,[p("button",{class:"skills-hub-section-toggle",type:"button",onClick:L[5]||(L[5]=q=>f.value=!f.value)},[p("span",qE,"Installed ("+oe(te.value.length)+")",1),Se(sf,{class:st(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(b(),S("div",zE,[(b(!0),S(Le,null,bt(te.value,q=>(b(),ut(Vc,{key:q.name,skill:q,onSelect:Y=>Ge(Y)},null,8,["skill","onSelect"]))),128))])):ie("",!0)])):ie("",!0),p("div",GE,[p("div",KE,[Se(wa,{class:"skills-hub-search-icon"}),Yn(p("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":L[6]||(L[6]=q=>s.value=q),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:ht},null,544),[[Xn,s.value]]),l.value>0?(b(),S("span",JE,oe(l.value)+" skills",1)):ie("",!0)]),p("button",{class:"skills-hub-sort",type:"button",onClick:X},oe(le.value),1)]),p("div",YE,[u.value?(b(),S("div",XE,"Loading skills...")):c.value?(b(),S("div",QE,oe(c.value),1)):(b(),S(Le,{key:2},[i.value.length>0?(b(),S("div",ZE,[(b(!0),S(Le,null,bt(i.value,q=>(b(),ut(Vc,{key:q.url,skill:q,onSelect:Y=>Ge(Y)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(b(),S("div",eC,'No skills found for "'+oe(s.value)+'"',1)):ie("",!0)],64))]),Se(W0,{skill:I.value,visible:g.value,"is-installing":Te.value,"is-uninstalling":ae.value,onClose:L[7]||(L[7]=q=>g.value=!1),onInstall:He,onUninstall:Ke,onToggleEnabled:Ze},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),nC=nt(tC,[["__scopeId","data-v-2f6920be"]]),rC={},sC={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 oC(e,t){return b(),S("svg",sC,[...t[0]||(t[0]=[p("path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"},null,-1),p("path",{d:"M9 4l0 16"},null,-1)])])}const iC=nt(rC,[["render",oC]]),aC={},lC={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function cC(e,t){return b(),S("svg",lC,[...t[0]||(t[0]=[p("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm12 -16h-8v14h8a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1"},null,-1)])])}const uC=nt(aC,[["render",cC]]),dC={class:"sidebar-thread-controls"},fC=["aria-label","title"],hC=Rt({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(b(),S("div",dC,[p("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(b(),ut(uC,{key:0,class:"sidebar-thread-controls-icon"})):(b(),ut(iC,{key:1,class:"sidebar-thread-controls-icon"}))],8,fC),Pn(t.$slots,"default",{},void 0),e.showNewThreadButton?(b(),S("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"))},[Se(Lo,{class:"sidebar-thread-controls-icon"})])):ie("",!0)]))}}),vu=nt(hC,[["__scopeId","data-v-46a10052"]]),pC={},mC={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function gC(e,t){return b(),S("svg",mC,[...t[0]||(t[0]=[p("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[p("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),p("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const vC=nt(pC,[["render",gC]]);function pr(e){return e.flatMap(t=>t.threads)}const Zf="codex-web-local.thread-read-state.v1",eh="codex-web-local.thread-scroll-state.v1",Aa="codex-web-local.selected-thread-id.v1",th="codex-web-local.project-order.v1",nh="codex-web-local.project-display-name.v1",Ki=220,yu=["none","minimal","low","medium","high","xhigh"],As="__global__",cn="gpt-5.2-codex";function yC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Zf);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function wu(e){typeof window>"u"||window.localStorage.setItem(Zf,JSON.stringify(e))}function rh(e,t,n){return Math.min(Math.max(e,t),n)}function wC(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=rh(t.scrollRatio,0,1)),n}function bC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(eh);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=wC(s);o&&(n[r]=o)}return n}catch{return{}}}function bu(e){typeof window>"u"||window.localStorage.setItem(eh,JSON.stringify(e))}function _C(){return typeof window>"u"?"":window.localStorage.getItem(Aa)??""}function kC(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Aa);return}window.localStorage.setItem(Aa,e)}}function TC(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(th);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 Jr(e){typeof window>"u"||window.localStorage.setItem(th,JSON.stringify(e))}function IC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(nh);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 Ji(e){typeof window>"u"||window.localStorage.setItem(nh,JSON.stringify(e))}function go(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 Nr(e,n)?e:n}function Yi(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 Nr(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 SC(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 EC(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function vo(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 Ra(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Nr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&EC(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function qo(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 CC(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&&Ra(f,c)?f:c});if(n.preserveMissing!==!0)return qo(e,o)?e:o;const i=e.map(c=>{const f=s.get(c.id);return!f||Ra(c,f)?c:f}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),u=[...i,...l];return qo(e,u)?e:u}function Pa(e){return e.replace(/\s+/gu," ").trim()}function AC(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Pa(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=Pa(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function _u(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Ra(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const sh="worked";function dr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function RC(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 PC(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function xC(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 MC(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${RC(e.durationMs)}`,messageType:sh}}function OC(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function NC(e,t){const n=MC(t),r=e.filter(i=>i.messageType!==sh),s=OC(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function xt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function $C(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 DC(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 LC(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 Lt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function yo(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&&$C(u,l)?u:l});return o&&o.projectName===s.projectName&&DC(o.threads,a)?o:{projectName:s.projectName,threads:a}});return LC(e,r)?e:r}function jC(e,t,n){const r=new Set(pr(t).map(a=>a.id)),s=pr(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 BC(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Xi(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function UC(e){const t=e.split(`
1419
+ `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function FC(){const e=D([]),t=D([]),n=D(_C()),r=D({}),s=D({}),o=D({}),i=D({}),a=D({}),l=D({}),u=D({}),c=D([]),f=D(""),g=D("medium"),I=D(yC()),j=D(bC()),x=D(TC()),B=D(IC()),ee=D({}),z=D({}),Q=D({}),K=D({}),le=D({}),de=D({}),ve=D({}),Te=D({}),ae=D({}),te=D({}),re=D([]),X=D(!1),Pe=D(!1),ke=D(!1),$e=D(!1),Ae=D(!1),we=D(""),Ee=D(!1),ht=D(!1);let Ge=null,He=null,Ke=!1;const Ze=new Set;let pt=!1,Ne=!1;const Be=new Map,W=new Set,fe=ce(()=>pr(e.value)),ue=ce(()=>fe.value.find(d=>d.id===n.value)??null),be=ce(()=>j.value[n.value]??null),Ce=ce(()=>{const d=[],m=n.value;return m&&Array.isArray(Te.value[m])&&d.push(...Te.value[m]),Array.isArray(Te.value[As])&&d.push(...Te.value[As]),d.sort((y,P)=>y.receivedAtIso.localeCompare(P.receivedAtIso))}),v=ce(()=>{var h;const d=n.value;if(!d)return null;const m=le.value[d],y=(o.value[d]??"").trim(),P=(((h=de.value[d])==null?void 0:h.message)??"").trim();return!m&&!y&&!P?null:{activityLabel:(m==null?void 0:m.label)||"Thinking",activityDetails:(m==null?void 0:m.details)??[],reasoningText:y,errorText:P}}),_=ce(()=>{const d=n.value;if(!d)return[];const m=r.value[d]??[],y=s.value[d]??[],P=i.value[d]??[],h=[...m,...P,...y],w=K.value[d];return w?NC(h,w):h});function M(d){n.value!==d&&(n.value=d,kC(d),Ne=!1)}function H(d){f.value=d.trim()}async function U(){f.value=cn,c.value.includes(cn)||(c.value=[...c.value,cn]);try{await l_(cn)}catch{}}function O(d,m){ae.value={...ae.value,[d]:m}}function L(d){ae.value[d]&&(ae.value=xt(ae.value,d))}async function q(d){if(W.has(d))return;const m=ae.value[d];if(!(!m||m.fallbackRetried)){W.add(d),O(d,{...m,fallbackRetried:!0});try{await U();try{const y=await Lc(d,1);tt(d,y),mt(d,[]),zt(d),i.value[d]&&(i.value=xt(i.value,d))}catch{}et(d,null),we.value="",De(d,null),We(d,{label:"Thinking",details:G(cn,m.effort)}),Xe(d,!0),Q.value[d]!==!0&&await ji(d),await Bi(d,m.text,m.imageUrls,cn,m.effort||void 0,m.skills.length>0?m.skills:void 0,m.fileAttachments),Q.value={...Q.value,[d]:!0},Ze.add(d),Ke=!0,await $n()}catch(y){const P=y instanceof Error?y.message:"Unknown application error";et(d,P),we.value=P,Xe(d,!1),We(d,null)}finally{W.delete(d)}}}function Y(d){d&&!yu.includes(d)||(g.value=d)}function G(d,m){const y=d.trim()||"default",P=m||"default";return[`Model: ${y}`,`Thinking: ${P}`]}async function _e(){try{const[d,m]=await Promise.all([c_(),u_()]);c.value=d,f.value.length>0&&d.includes(f.value)||(m.model&&d.includes(m.model)?f.value=m.model:d.length>0?f.value=d[0]:f.value=""),m.reasoningEffort&&yu.includes(m.reasoningEffort)&&(g.value=m.reasoningEffort)}catch{}}function pe(d){const m=te.value;return Object.keys(m).length===0?d:d.map(y=>({projectName:y.projectName,threads:y.threads.map(P=>{const h=m[P.id];return h?{...P,title:h}:P})}))}function me(){const m=pe(t.value).map(y=>({projectName:y.projectName,threads:y.threads.map(P=>{const h=a.value[P.id]===!0,w=n.value===P.id,V=I.value[P.id],he=u.value[P.id]===!0,ne=!w&&!h&&(he||V!==P.updatedAtIso);return{...P,inProgress:h,unread:ne}})}));e.value=yo(e.value,m)}function Ie(d,m,y){const P=new Date().toISOString(),h=m.trim(),w=BC(h),V={id:d,title:UC(y),projectName:w,cwd:h,hasWorktree:h.includes("/.codex/worktrees/")||h.includes("/.git/worktrees/"),createdAtIso:P,updatedAtIso:P,preview:y,unread:!1,inProgress:!1},he=t.value.findIndex(ge=>ge.projectName===w);if(he>=0){const ze=t.value[he].threads.filter(ar=>ar.id!==d),Dn={projectName:w,threads:[V,...ze]},on=[...t.value];on.splice(he,1,Dn),t.value=on}else t.value=[{projectName:w,threads:[V]},...t.value];const ne=go(x.value,t.value);Nr(x.value,ne)||(x.value=ne,Jr(x.value)),me()}function Oe(d){const m=new Set(d.map(w=>w.id)),y=Lt(I.value,m);y!==I.value&&(I.value=y,wu(y));const P=Lt(j.value,m);P!==j.value&&(j.value=P,bu(P)),z.value=Lt(z.value,m),ee.value=Lt(ee.value,m),Q.value=Lt(Q.value,m),r.value=Lt(r.value,m),s.value=Lt(s.value,m),o.value=Lt(o.value,m),i.value=Lt(i.value,m),K.value=Lt(K.value,m),le.value=Lt(le.value,m),de.value=Lt(de.value,m),ve.value=Lt(ve.value,m),u.value=Lt(u.value,m),a.value=Lt(a.value,m);const h={};for(const[w,V]of Object.entries(Te.value))(w===As||m.has(w))&&(h[w]=V);Te.value=h}function Ve(d){const m=pr(t.value).find(y=>y.id===d);m&&(I.value={...I.value,[d]:m.updatedAtIso},wu(I.value),u.value[d]&&(u.value=xt(u.value,d)),me())}function De(d,m){if(!d)return;const y=K.value[d];if(m){if(PC(y,m))return;K.value={...K.value,[d]:m}}else y&&(K.value=xt(K.value,d))}function Xe(d,m){!d||a.value[d]===!0===m||(m?a.value={...a.value,[d]:!0}:a.value=xt(a.value,d),me())}function ot(d){d&&d!==n.value&&u.value[d]!==!0&&(u.value={...u.value,[d]:!0},me())}function We(d,m){if(!d)return;const y=le.value[d];if(!m){y&&(le.value=xt(le.value,d));return}const P=J(m.label)||"Thinking",h=m.details.map(he=>J(he)).filter(he=>he.length>0&&he!==P),w=Array.from(new Set([...(y==null?void 0:y.details)??[],...h])).slice(-3),V={label:P,details:w};xC(y,V)||(le.value={...le.value,[d]:V})}function et(d,m){if(!d)return;const y=de.value[d],P=m?Pa(m):"";if(!P){y&&(de.value=xt(de.value,d));return}(y==null?void 0:y.message)!==P&&(de.value={...de.value,[d]:{message:P}})}function St(d){const m=pr(t.value).find(y=>y.id===d);return(m==null?void 0:m.updatedAtIso)??""}function Ot(d,m){if(!d)return;const y={scrollTop:Math.max(0,m.scrollTop),isAtBottom:m.isAtBottom===!0};typeof m.scrollRatio=="number"&&Number.isFinite(m.scrollRatio)&&(y.scrollRatio=rh(m.scrollRatio,0,1));const P=j.value[d];P&&P.scrollTop===y.scrollTop&&P.isAtBottom===y.isAtBottom&&P.scrollRatio===y.scrollRatio||(j.value={...j.value,[d]:y},bu(j.value))}function tt(d,m){const y=r.value[d]??[];qo(y,m)||(r.value={...r.value,[d]:m})}function mt(d,m){const y=s.value[d]??[];qo(y,m)||(s.value={...s.value,[d]:m})}function Wt(d,m){const y=s.value[d]??[],P=_u(y,m);mt(d,P)}function Pt(d,m){if(!d)return;const y=m.trim(),P=o.value[d]??"";if(y.length===0){if(!P)return;o.value=xt(o.value,d);return}P!==y&&(o.value={...o.value,[d]:y})}function qt(d,m){if(!d)return;const y=o.value[d]??"";Pt(d,`${y}${m}`)}function zt(d){d&&d in o.value&&(o.value=xt(o.value,d))}function Me(d){return d!==null&&typeof d=="object"&&!Array.isArray(d)?d:null}function xe(d){return typeof d=="string"?d:""}function Nt(d){return typeof d=="number"&&Number.isFinite(d)?d:null}function Tt(d){const m=Me(d.params);if(!m)return"";const y=xe(m.threadId);if(y)return y;const P=xe(m.thread_id);if(P)return P;const h=xe(m.conversationId);if(h)return h;const w=xe(m.conversation_id);if(w)return w;const V=Me(m.thread),he=xe(V==null?void 0:V.id);if(he)return he;const ne=Me(m.turn),ge=xe(ne==null?void 0:ne.threadId);if(ge)return ge;const ze=xe(ne==null?void 0:ne.thread_id);return ze||""}function $t(d){if(d.method!=="turn/completed")return"";const m=Me(d.params),y=Me(m==null?void 0:m.turn);if(!y||y.status!=="failed")return"";const P=Me(y.error);return xe(P==null?void 0:P.message)}function rn(d){var y;if(d.method!=="error")return"";const m=Me(d.params);return xe(m==null?void 0:m.message)||xe((y=Me(m==null?void 0:m.error))==null?void 0:y.message)}function dn(d){const m=Me(d);if(!m)return null;const y=m.id,P=xe(m.method),h=m.params;if(typeof y!="number"||!Number.isInteger(y)||!P)return null;const w=Me(h),V=xe(w==null?void 0:w.threadId)||As,he=xe(w==null?void 0:w.turnId),ne=xe(w==null?void 0:w.itemId),ge=xe(m.receivedAtIso)||new Date().toISOString();return{id:y,method:P,threadId:V,turnId:he,itemId:ne,receivedAtIso:ge,params:h??null}}function k(d){const m=d.threadId||As,y=Te.value[m]??[],P=y.findIndex(w=>w.id===d.id),h=[...y];P>=0?h.splice(P,1,d):h.push(d),Te.value={...Te.value,[m]:h.sort((w,V)=>w.receivedAtIso.localeCompare(V.receivedAtIso))}}function C(d){const m={};for(const[y,P]of Object.entries(Te.value)){const h=P.filter(w=>w.id!==d);h.length>0&&(m[y]=h)}Te.value=m}function A(d){if(d.method==="server/request"){const m=dn(d.params);return m&&k(m),!0}if(d.method==="server/request/resolved"){const m=Me(d.params),y=m==null?void 0:m.id;return typeof y=="number"&&Number.isInteger(y)&&C(y),!0}return!1}function J(d){return d.replace(/\s+/gu," ").trim()}function T(d){const m=Tt(d);if(!m)return null;if(d.method==="turn/started")return{threadId:m,activity:{label:"Thinking",details:[]}};if(d.method==="item/started"){const y=Me(d.params),P=Me(y==null?void 0:y.item),h=xe(P==null?void 0:P.type).toLowerCase();if(h==="reasoning")return{threadId:m,activity:{label:"Thinking",details:[]}};if(h==="agentmessage")return{threadId:m,activity:{label:"Writing response",details:[]}};if(h==="commandexecution"){const w=xe(P==null?void 0:P.command);return{threadId:m,activity:{label:"Running command",details:w?[w]:[]}}}}return d.method==="item/commandExecution/outputDelta"?{threadId:m,activity:{label:"Running command",details:[]}}:d.method==="item/reasoning/summaryTextDelta"||d.method==="item/reasoning/summaryPartAdded"?{threadId:m,activity:{label:"Thinking",details:[]}}:d.method==="item/agentMessage/delta"?{threadId:m,activity:{label:"Writing response",details:[]}}:null}function R(d){if(d.method!=="turn/started")return null;const m=Me(d.params);if(!m)return null;const y=Tt(d);if(!y)return null;const P=Me(m.turn),h=xe(P==null?void 0:P.id)||xe(m.turnId)||`${y}:unknown`;if(!h)return null;const w=dr(xe(P==null?void 0:P.startedAt))??dr(xe(m.startedAt))??dr(d.atIso)??Date.now();return{threadId:y,turnId:h,startedAtMs:w}}function F(d){if(d.method!=="turn/completed")return null;const m=Me(d.params);if(!m)return null;const y=Tt(d);if(!y)return null;const P=Me(m.turn),h=xe(P==null?void 0:P.id)||xe(m.turnId)||`${y}:unknown`;if(!h)return null;const w=dr(xe(P==null?void 0:P.completedAt))??dr(xe(m.completedAt))??dr(d.atIso)??Date.now(),V=dr(xe(P==null?void 0:P.startedAt))??dr(xe(m.startedAt))??void 0;return{threadId:y,turnId:h,completedAtMs:w,startedAtMs:V}}function se(d){return`${d}:live-reasoning`}function Re(d){const m=Me(d.params);if(!m)return"";if(d.method==="item/started"){const y=Me(m.item);return!y||y.type!=="reasoning"?"":xe(y.id)}return""}function Qe(d){const m=Me(d.params);if(!m)return null;if(d.method==="item/reasoning/summaryTextDelta"){const y=xe(m.itemId),P=xe(m.delta);return!y||!P?null:{messageId:se(y),delta:P}}return null}function Je(d){const m=Me(d.params);if(!m)return"";if(d.method==="item/reasoning/summaryPartAdded"){const y=xe(m.itemId);return y?se(y):""}return""}function it(d){const m=Me(d.params);if(!m)return"";if(d.method==="item/completed"){const y=Me(m.item);return!y||y.type!=="reasoning"?"":se(xe(y.id))}return""}function _t(d){const m=Me(d.params);if(!m)return"";if(d.method==="item/started"){const y=Me(m.item);return!y||y.type!=="agentMessage"?"":xe(y.id)}return""}function Zt(d){const m=Me(d.params);if(!m)return null;if(d.method==="item/agentMessage/delta"){const y=xe(m.itemId),P=xe(m.delta);return!y||!P?null:{messageId:y,delta:P}}return null}function Dt(d){const m=Me(d.params);if(!m)return null;if(d.method==="item/completed"){const y=Me(m.item);if(!y||y.type!=="agentMessage")return null;const P=xe(y.id),h=xe(y.text);return!P||!h?null:{id:P,role:"assistant",text:h,messageType:"agentMessage.live"}}return null}function Hr(d){if(d.method!=="item/started")return null;const m=Me(d.params),y=Me(m==null?void 0:m.item);if(!y||y.type!=="commandExecution")return null;const P=xe(y.id),h=xe(y.command);if(!P)return null;const w=typeof y.cwd=="string"?y.cwd:null;return{id:P,role:"system",text:h,messageType:"commandExecution",commandExecution:{command:h,cwd:w,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function Tr(d){if(d.method!=="item/commandExecution/outputDelta")return null;const m=Me(d.params);if(!m)return null;const y=xe(m.itemId),P=xe(m.delta);return!y||!P?null:{itemId:y,delta:P}}function vs(d){if(d.method!=="item/completed")return null;const m=Me(d.params),y=Me(m==null?void 0:m.item);if(!y||y.type!=="commandExecution")return null;const P=xe(y.id),h=xe(y.command);if(!P)return null;const w=typeof y.cwd=="string"?y.cwd:null,V=xe(y.status),he=V==="failed"?"failed":V==="declined"?"declined":V==="interrupted"?"interrupted":"completed",ne=typeof y.aggregatedOutput=="string"?y.aggregatedOutput:"",ge=typeof y.exitCode=="number"?y.exitCode:null;return{id:P,role:"system",text:h,messageType:"commandExecution",commandExecution:{command:h,cwd:w,status:he,aggregatedOutput:ne,exitCode:ge}}}function Ir(d,m){const y=i.value[d]??[],P=_u(y,m);P!==y&&(i.value={...i.value,[d]:P})}function Vr(d,m){const y=i.value[d];if(!y||y.length===0)return;const P=new Set(m.map(w=>w.id)),h=y.filter(w=>!P.has(w.id));h.length!==y.length&&(h.length===0?i.value=xt(i.value,d):i.value={...i.value,[d]:h})}function ys(d){if(d.method==="item/agentMessage/delta")return!0;const m=Me(d.params);if(!m)return!1;if(d.method==="item/completed"){const y=Me(m.item);return(y==null?void 0:y.type)==="agentMessage"}return!1}function rr(d){var vl,yl,wl,bl;if(A(d))return;if(d.method==="thread/name/updated"){const Ye=Me(d.params),_n=xe(Ye==null?void 0:Ye.threadId),Sr=xe(Ye==null?void 0:Ye.threadName);_n&&Sr&&(te.value={...te.value,[_n]:Sr},me(),Ui(_n,Sr))}const m=T(d);m&&We(m.threadId,m.activity);const y=R(d);y&&(Be.set(y.turnId,y),ve.value={...ve.value,[y.threadId]:y.turnId},De(y.threadId,null),et(y.threadId,null),Xe(y.threadId,!0),u.value[y.threadId]&&(u.value=xt(u.value,y.threadId)));const P=F(d),h=$t(d),V=!!((P==null?void 0:P.threadId)??Tt(d))&&!!h&&f.value!==cn&&vo(new Error(h));if(P){const Ye=Be.get(P.turnId);Ye&&Be.delete(P.turnId);const _n=Nt((vl=Me(d.params))==null?void 0:vl.durationMs)??Nt((wl=Me((yl=Me(d.params))==null?void 0:yl.turn))==null?void 0:wl.durationMs)??(typeof P.startedAtMs=="number"?P.completedAtMs-P.startedAtMs:null)??(Ye?P.completedAtMs-Ye.startedAtMs:null),Sr=typeof _n=="number"?Math.max(0,_n):0;De(P.threadId,{turnId:P.turnId,durationMs:Sr}),ve.value[P.threadId]&&(ve.value=xt(ve.value,P.threadId)),Xe(P.threadId,!1),We(P.threadId,null),ot(P.threadId),V||(L(P.threadId),sn(P.threadId))}if(h){const Ye=(P==null?void 0:P.threadId)||Tt(d);Ye&&et(Ye,h),we.value=h,Ye&&V&&q(Ye)}else P&&et(P.threadId,null);const he=rn(d);if(he){const Ye=Tt(d);Ye&&et(Ye,he),we.value=he,f.value!==cn&&vo(new Error(he))&&(Ye?q(Ye):U())}const ne=Tt(d);if(!ne||ne!==n.value)return;_t(d);const ge=Zt(d);if(ge){const Ye=(s.value[ne]??[]).find(Sr=>Sr.id===ge.messageId),_n=`${(Ye==null?void 0:Ye.text)??""}${ge.delta}`;Wt(ne,{id:ge.messageId,role:"assistant",text:_n,messageType:"agentMessage.live"})}const ze=Dt(d);ze&&Wt(ne,ze),Re(d);const Dn=Qe(d);if(Dn&&qt(ne,Dn.delta),Je(d)){const Ye=o.value[ne]??"";Ye.trim().length>0&&!Ye.endsWith(`
1420
+
1421
+ `)&&Pt(ne,`${Ye}
1422
+
1423
+ `)}it(d);const ar=Hr(d);ar&&(Ir(ne,ar),We(ne,{label:"Running command",details:[((bl=ar.commandExecution)==null?void 0:bl.command)??""]}));const yi=Tr(d);if(yi){const Ye=(i.value[ne]??[]).find(_n=>_n.id===yi.itemId);Ye!=null&&Ye.commandExecution&&Ir(ne,{...Ye,commandExecution:{...Ye.commandExecution,aggregatedOutput:`${Ye.commandExecution.aggregatedOutput}${yi.delta}`}})}const gl=vs(d);if(gl&&Ir(ne,gl),ys(d)&&(Ne&&n.value&&Ot(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),zt(ne)),d.method==="turn/completed"){Ne=!1,zt(ne),i.value[ne]&&(i.value=xt(i.value,ne));const Ye=Tt(d);Ye&&(Xe(Ye,!1),We(Ye,null),ot(Ye),V||(L(Ye),sn(Ye)))}}function sr(d){const m=Tt(d);m&&Ze.add(m);const y=d.method;(y.startsWith("thread/")||y.startsWith("turn/")||y.startsWith("item/"))&&(Ke=!0),!(He!==null||typeof window>"u")&&(He=window.setTimeout(()=>{He=null,$n()},Ki))}async function Wr(d){if(!pt){pt=!0;try{const m=await ya(),y=[];for(const P of m.order){const h=Xi(P);y.includes(h)||y.push(h)}if(y.length>0){const P=go(y,d);Nr(x.value,P)||(x.value=P,Jr(x.value))}if(Object.keys(m.labels).length>0){const P={...B.value};let h=!1;for(const[w,V]of Object.entries(m.labels)){const he=Xi(w);P[he]!==V&&(P[he]=V,h=!0)}h&&(B.value=P,Ji(P))}}catch{}}}async function ws(){if(!(Object.keys(te.value).length>0))try{const d=await y_();Object.keys(d.titles).length>0&&(te.value=d.titles)}catch{}}async function or(d,m,y){if(te.value[d])return;const P=m.trim();if(!P)return;const h=P.length>300?P.slice(0,300):P;try{const w=await w_(h,y);if(!w||te.value[d])return;te.value={...te.value,[d]:w},me(),Ui(d,w)}catch{}}async function ir(){var d;ht.value||(X.value=!0);try{const[m]=await Promise.all([Qb(),ws()]);await Wr(m);const y=go(x.value,m);Nr(x.value,y)||(x.value=y,Jr(x.value));const P=Yi(m,x.value),h=jC(t.value,P,a.value);t.value=yo(t.value,h),a.value=Lt(a.value,new Set(pr(t.value).map(he=>he.id))),me(),ht.value=!0;const w=pr(e.value);Oe(w),w.some(he=>he.id===n.value)||M(((d=w[0])==null?void 0:d.id)??"")}finally{X.value=!1}}async function E(d,m={}){if(!d)return;const y=z.value[d]===!0,P=m.silent!==!0&&!y;P&&(Pe.value=!0);try{Q.value[d]!==!0&&(await ji(d),Q.value={...Q.value,[d]:!0});const{messages:h,inProgress:w}=await Zb(d),V=r.value[d]??[],he=CC(V,h,{preserveMissing:m.silent===!0});tt(d,he);const ne=s.value[d]??[],ge=AC(ne,h);mt(d,ge),Vr(d,h),z.value={...z.value,[d]:!0};const ze=St(d);ze&&(ee.value={...ee.value,[d]:ze}),Xe(d,w),Ve(d)}finally{P&&(Pe.value=!1)}}async function N(){try{const d=t.value.flatMap(m=>m.threads.map(y=>y.cwd)).filter(Boolean);re.value=await b_(d.length>0?[...new Set(d)]:void 0)}catch{}}async function $(){we.value="";try{await ir(),await Promise.all([_e(),N()]),await E(n.value)}catch(d){we.value=d instanceof Error?d.message:"Unknown application error"}}async function Z(d){M(d);try{await E(d)}catch(m){we.value=m instanceof Error?m.message:"Unknown application error"}}async function Ue(d){try{await r_(d),await ir(),n.value===d&&await E(n.value)}catch(m){we.value=m instanceof Error?m.message:"Unknown application error"}}async function Et(d,m){const y=m.trim();if(!(!d||!y))try{await s_(d,y),te.value={...te.value,[d]:y},me(),Ui(d,y)}catch(P){we.value=P instanceof Error?P.message:"Unknown application error"}}async function en(d,m=[],y=[],P="steer",h=[]){const w=n.value,V=d.trim();if(!w||!V&&m.length===0&&h.length===0)return;const he=a.value[w]===!0;if(he&&P==="queue"){const ne=l.value[w]??[],ge=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[w]:[...ne,{id:ge,text:V,imageUrls:m,skills:y,fileAttachments:h}]};return}if(he){Ne=!0,Nn(w,V,m,y,h).catch(ne=>{const ge=ne instanceof Error?ne.message:"Unknown application error";et(w,ge),we.value=ge});return}we.value="",Ne=!0,De(w,null),We(w,{label:"Thinking",details:G(f.value,g.value)}),et(w,null),Xe(w,!0);try{await Nn(w,V,m,y,h)}catch(ne){Ne=!1,Xe(w,!1),We(w,null);const ge=ne instanceof Error?ne.message:"Unknown application error";throw et(w,ge),we.value=ge,ne}}async function qr(d,m,y=[],P=[],h=[]){const w=d.trim(),V=m.trim(),he=f.value.trim();if(!w&&y.length===0&&h.length===0)return"";ke.value=!0,we.value="";let ne="";try{try{ne=await jc(V||void 0,he||void 0)}catch(on){if(he&&he!==cn&&vo(on))await U(),ne=await jc(V||void 0,cn);else throw on}if(!ne)return"";Ie(ne,V,w||"[Image]"),Q.value={...Q.value,[ne]:!0},M(ne),Ne=!0,De(ne,null),We(ne,{label:"Thinking",details:G(f.value,g.value)}),et(ne,null),Xe(ne,!0);const ge=ne,ze=V||null,Dn=w;return Nn(ne,w,y,P,h).catch(on=>{Ne=!1,Xe(ne,!1),We(ne,null);const ar=on instanceof Error?on.message:"Unknown application error";et(ne,ar),we.value=ar}).finally(()=>{ke.value=!1}),or(ge,Dn,ze),ne}catch(ge){Ne=!1,ne&&(Xe(ne,!1),We(ne,null));const ze=ge instanceof Error?ge.message:"Unknown application error";throw ne&&et(ne,ze),we.value=ze,ke.value=!1,ge}}async function Nn(d,m,y=[],P=[],h=[]){const w=f.value.trim(),V=g.value,he=m.trim(),ne=P.map(ze=>({name:ze.name,path:ze.path})),ge=h.map(ze=>({...ze}));O(d,{text:he,imageUrls:[...y],skills:ne,fileAttachments:ge,effort:V,fallbackRetried:!1});try{Q.value[d]!==!0&&await ji(d);try{await Bi(d,m,y,w||void 0,V||void 0,P.length>0?P:void 0,h)}catch(ze){if(w&&w!==cn&&vo(ze))await U(),O(d,{text:he,imageUrls:[...y],skills:ne,fileAttachments:ge,effort:V,fallbackRetried:!0}),await Bi(d,m,y,cn,V||void 0,P.length>0?P:void 0,h);else throw ze}Q.value={...Q.value,[d]:!0},Ze.add(d),Ke=!0,await $n()}catch(ze){throw ze}}async function sn(d){const m=l.value[d];if(!m||m.length===0)return;const[y,...P]=m;l.value=P.length>0?{...l.value,[d]:P}:xt(l.value,d),ke.value=!0,we.value="",Ne=!0,De(d,null),We(d,{label:"Thinking",details:G(f.value,g.value)}),et(d,null),Xe(d,!0);try{await Nn(d,y.text,y.imageUrls,y.skills,y.fileAttachments)}catch{Xe(d,!1),We(d,null)}finally{ke.value=!1}}async function bn(){const d=n.value;if(!d||a.value[d]!==!0)return;const m=ve.value[d];$e.value=!0,we.value="";try{await a_(d,m),Xe(d,!1),We(d,null),et(d,null),ve.value[d]&&(ve.value=xt(ve.value,d)),Ze.add(d),Ke=!0,await $n()}catch(y){const P=y instanceof Error?y.message:"Failed to interrupt active turn";et(d,P),we.value=P}finally{$e.value=!1}}async function zr(d){const m=n.value;if(!m||Ae.value)return;const P=(r.value[m]??[]).reduce((w,V)=>typeof V.turnIndex=="number"&&V.turnIndex>w?V.turnIndex:w,-1);if(P<0||d>P)return;const h=P-d+1;if(!(h<1)){Ae.value=!0,we.value="";try{const w=await Lc(m,h);tt(m,w),mt(m,[]),zt(m),i.value[m]&&(i.value=xt(i.value,m)),De(m,null),We(m,null),et(m,null),Ke=!0,await $n()}catch(w){we.value=w instanceof Error?w.message:"Failed to rollback thread"}finally{Ae.value=!1}}}function bs(d,m){d.length===0||(B.value[d]??"")===m||(B.value={...B.value,[d]:m},Ji(B.value))}function di(d){var h;if(d.length===0)return;const m=x.value.filter(w=>w!==d);if(Nr(x.value,m)||(x.value=m,Jr(x.value)),t.value=t.value.filter(w=>w.projectName!==d),B.value[d]!==void 0){const w={...B.value};delete w[d],B.value=w,Ji(w)}me();const y=pr(e.value);Oe(y),y.some(w=>w.id===n.value)||M(((h=y[0])==null?void 0:h.id)??""),_s()}function fi(d,m){if(d.length===0||t.value.length===0)return;const y=t.value.map(ne=>ne.projectName),P=y.indexOf(d);if(P===-1)return;const h=Math.max(0,Math.min(m,y.length-1)),w=SC(y,P,h);if(w===y)return;const V=go(w,t.value);x.value=V,Jr(x.value);const he=Yi(t.value,x.value);t.value=yo(t.value,he),me(),_s()}function hi(d){const m=d.trim();if(!m)return;const y=[m,...x.value.filter(h=>h!==m)];if(Nr(x.value,y))return;x.value=y,Jr(x.value);const P=Yi(t.value,x.value);t.value=yo(t.value,P),me(),_s()}async function _s(){var d,m;try{const y=await ya(),P=new Map;for(const V of y.order){const he=Xi(V);P.has(he)||P.set(he,V)}for(const V of t.value){const he=((m=(d=V.threads[0])==null?void 0:d.cwd)==null?void 0:m.trim())??"";he&&P.set(V.projectName,he)}const h=[];for(const V of x.value){const he=P.get(V);he&&!h.includes(he)&&h.push(he)}for(const V of y.order)h.includes(V)||h.push(V);const w=y.active.filter(V=>h.includes(V));w.length===0&&h.length>0&&w.push(h[0]),await h_({order:h,labels:y.labels,active:w})}catch{}}async function $n(){if(Ee.value){typeof window<"u"&&He===null&&(He=window.setTimeout(()=>{He=null,$n()},Ki));return}Ee.value=!0;const d=Ke,m=new Set(Ze);Ke=!1,Ze.clear();try{d&&await ir();const y=n.value;if(!y)return;const P=m.has(y),h=a.value[y]===!0,w=St(y),V=ee.value[y]??"",he=w.length>0&&w!==V;(P||h||he||d)&&await E(y,{silent:!0})}catch{}finally{Ee.value=!1,(Ke||Ze.size>0)&&typeof window<"u"&&He===null&&(He=window.setTimeout(()=>{He=null,$n()},Ki))}}function pi(){typeof window>"u"||Ge||(mi(),Ge=e_(d=>{rr(d),sr(d)}))}async function mi(){try{const d=await n_();for(const m of d){const y=dn(m);y&&k(y)}}catch{}}async function gi(d){try{await t_(d.id,{result:d.result,error:d.error}),C(d.id)}catch(m){we.value=m instanceof Error?m.message:"Failed to reply to server request"}}function ks(){Ge&&(Ge(),Ge=null),Ke=!1,Ze.clear(),Be.clear(),He!==null&&typeof window<"u"&&(window.clearTimeout(He),He=null),Ne=!1,r.value={},s.value={},o.value={},i.value={},le.value={},K.value={},de.value={},ve.value={},l.value={}}const Gr=ce(()=>{const d=n.value;return d?l.value[d]??[]:[]});function lo(d){const m=n.value;if(!m)return;const y=l.value[m];if(!y)return;const P=y.filter(h=>h.id!==d);l.value=P.length>0?{...l.value,[m]:P}:xt(l.value,m)}function vi(d){const m=n.value;if(!m)return;const y=l.value[m];if(!y)return;const P=y.find(h=>h.id===d);P&&(lo(d),en(P.text,P.imageUrls,P.skills,"steer",P.fileAttachments))}return{projectGroups:e,projectDisplayNameById:B,selectedThread:ue,selectedThreadScrollState:be,selectedThreadServerRequests:Ce,selectedLiveOverlay:v,selectedThreadId:n,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:g,installedSkills:re,messages:_,isLoadingThreads:X,isLoadingMessages:Pe,isSendingMessage:ke,isInterruptingTurn:$e,error:we,refreshAll:$,refreshSkills:N,selectThread:Z,setThreadScrollState:Ot,archiveThreadById:Ue,renameThreadById:Et,sendMessageToSelectedThread:en,sendMessageToNewThread:qr,interruptSelectedThreadTurn:bn,rollbackSelectedThread:zr,isRollingBack:Ae,selectedThreadQueuedMessages:Gr,removeQueuedMessage:lo,steerQueuedMessage:vi,setSelectedModelId:H,setSelectedReasoningEffort:Y,respondToPendingServerRequest:gi,renameProject:bs,removeProject:di,reorderProject:fi,pinProjectToTop:hi,startPolling:pi,stopPolling:ks}}const HC={class:"sidebar-root"},VC={class:"sidebar-scrollable"},WC=["aria-pressed"],qC={key:1,class:"sidebar-search-bar"},zC={key:0,class:"sidebar-settings-area"},GC={key:0,class:"sidebar-settings-panel"},KC={class:"sidebar-settings-value"},JC={class:"sidebar-settings-value"},YC={class:"sidebar-settings-row sidebar-settings-row--select"},XC={class:"content-root"},QC={class:"content-body"},ZC={key:1,class:"content-grid"},eA={class:"new-thread-empty"},tA={class:"worktree-init-status-title"},nA={class:"worktree-init-status-message"},rA={key:2,class:"content-grid"},sA={class:"content-thread"},oA={class:"composer-with-queue"},iA={class:"build-badge","aria-label":"Worktree name and version"},ku="codex-web-local.sidebar-collapsed.v1",Tu="codex-web-local.send-with-enter.v1",Iu="codex-web-local.in-progress-send-mode.v1",Su="codex-web-local.dark-mode.v1",Eu="codex-web-local.dictation-click-to-toggle.v1",Cu="codex-web-local.dictation-auto-send.v1",Au="codex-web-local.dictation-language.v1",aA=Rt({__name:"App",setup(e){const t="6cac",n="0.1.44",r={en:"english",zh:"chinese",de:"german",es:"spanish",ru:"russian",ko:"korean",fr:"french",ja:"japanese",pt:"portuguese",tr:"turkish",pl:"polish",ca:"catalan",nl:"dutch",ar:"arabic",sv:"swedish",it:"italian",id:"indonesian",hi:"hindi",fi:"finnish",vi:"vietnamese",he:"hebrew",uk:"ukrainian",el:"greek",ms:"malay",cs:"czech",ro:"romanian",da:"danish",hu:"hungarian",ta:"tamil",no:"norwegian",th:"thai",ur:"urdu",hr:"croatian",bg:"bulgarian",lt:"lithuanian",la:"latin",mi:"maori",ml:"malayalam",cy:"welsh",sk:"slovak",te:"telugu",fa:"persian",lv:"latvian",bn:"bengali",sr:"serbian",az:"azerbaijani",sl:"slovenian",kn:"kannada",et:"estonian",mk:"macedonian",br:"breton",eu:"basque",is:"icelandic",hy:"armenian",ne:"nepali",mn:"mongolian",bs:"bosnian",kk:"kazakh",sq:"albanian",sw:"swahili",gl:"galician",mr:"marathi",pa:"punjabi",si:"sinhala",km:"khmer",sn:"shona",yo:"yoruba",so:"somali",af:"afrikaans",oc:"occitan",ka:"georgian",be:"belarusian",tg:"tajik",sd:"sindhi",gu:"gujarati",am:"amharic",yi:"yiddish",lo:"lao",uz:"uzbek",fo:"faroese",ht:"haitian creole",ps:"pashto",tk:"turkmen",nn:"nynorsk",mt:"maltese",sa:"sanskrit",lb:"luxembourgish",my:"myanmar",bo:"tibetan",tl:"tagalog",mg:"malagasy",as:"assamese",tt:"tatar",haw:"hawaiian",ln:"lingala",ha:"hausa",ba:"bashkir",jw:"javanese",su:"sundanese",yue:"cantonese"},{projectGroups:s,projectDisplayNameById:o,selectedThread:i,selectedThreadScrollState:a,selectedThreadServerRequests:l,selectedLiveOverlay:u,selectedThreadId:c,availableModelIds:f,selectedModelId:g,selectedReasoningEffort:I,installedSkills:j,messages:x,isLoadingThreads:B,isLoadingMessages:ee,isInterruptingTurn:z,refreshAll:Q,refreshSkills:K,selectThread:le,setThreadScrollState:de,archiveThreadById:ve,renameThreadById:Te,sendMessageToSelectedThread:ae,sendMessageToNewThread:te,interruptSelectedThreadTurn:re,rollbackSelectedThread:X,isRollingBack:Pe,selectedThreadQueuedMessages:ke,removeQueuedMessage:$e,steerQueuedMessage:Ae,setSelectedModelId:we,setSelectedReasoningEffort:Ee,respondToPendingServerRequest:ht,renameProject:Ge,removeProject:He,reorderProject:Ke,pinProjectToTop:Ze,startPolling:pt,stopPolling:Ne}=FC(),Be=Fg(),W=Ug(),{isMobile:fe}=rf(),ue=D(!1),be=D(!1),Ce=D(""),v=D("local"),_=D({order:[],labels:{}}),M=D({phase:"idle",title:"",message:""}),H=D(lo()),U=D(""),O=D(!1),L=D(null),q=D(null);let Y=null;const G=D("New Project (1)"),_e=D(""),pe=D(!1),me=D(bn(Tu,!0)),Ie=D(bs()),Oe=D(zr()),Ve=D(bn(Eu,!1)),De=D(null);let Xe=0;const ot=D(bn(Cu,!0)),We=D(mi()),et=ce(()=>gi()),St=ce(()=>{const h=Be.params.threadId;return typeof h=="string"?h:""}),Ot=ce(()=>{const h=new Set;for(const w of s.value)for(const V of w.threads)h.add(V.id);return h}),tt=ce(()=>Be.name==="home"),mt=ce(()=>Be.name==="skills"),Wt=ce(()=>{var h;return mt.value?"Skills":tt.value?"New thread":((h=i.value)==null?void 0:h.title)??"Choose a thread"}),Pt=ce(()=>x.value.filter(h=>{const w=d(h.messageType,h.role);return w==="worked"?!0:!(w==="turnActivity.live"||w==="turnError.live"||w==="agentReasoning.live")})),qt=ce(()=>{let h=-1;for(const w of x.value)w.role==="user"&&typeof w.turnIndex=="number"&&w.turnIndex>h&&(h=w.turnIndex);return h}),zt=ce(()=>u.value),Me=ce(()=>tt.value?"__new-thread__":c.value),xe=ce(()=>{var h,w;return tt.value?Ce.value.trim():((w=(h=i.value)==null?void 0:h.cwd)==null?void 0:w.trim())??""}),Nt=ce(()=>{var h;return!tt.value&&((h=i.value)==null?void 0:h.inProgress)===!0}),Tt=ce(()=>{var he,ne;const h=[],w=new Set;for(const ge of _.value.order){const ze=ge.trim();!ze||w.has(ze)||(w.add(ze),h.push({value:ze,label:_.value.labels[ze]||E(ze)}))}for(const ge of s.value){const ze=((ne=(he=ge.threads[0])==null?void 0:he.cwd)==null?void 0:ne.trim())??"";!ze||w.has(ze)||(w.add(ze),h.push({value:ze,label:o.value[ge.projectName]??ge.projectName}))}const V=Ce.value.trim();return V&&!w.has(V)&&h.unshift({value:V,label:E(V)}),h}),$t=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;tr(()=>{window.addEventListener("keydown",Hr),Gr(),$t==null||$t.addEventListener("change",Gr),m(),ws(),or(),sr()}),ti(()=>{window.removeEventListener("keydown",Hr),$t==null||$t.removeEventListener("change",Gr),Y&&(clearTimeout(Y),Y=null),Ne()}),dt(U,h=>{const w=h.trim();if(Y&&(clearTimeout(Y),Y=null),!w){q.value=null;return}Y=setTimeout(()=>{v_(w,1e3).then(V=>{U.value.trim()===w&&(q.value=V.threadIds)}).catch(()=>{U.value.trim()===w&&(q.value=null)})},220)});function rn(){K()}function dn(){O.value=!O.value,O.value?Ht(()=>{var h;return(h=L.value)==null?void 0:h.focus()}):U.value=""}function k(){var h;U.value="",(h=L.value)==null||h.focus()}function C(h){h.key==="Escape"&&(O.value=!1,U.value="")}function A(h){h&&(Be.name==="thread"&&St.value===h||(W.push({name:"thread",params:{threadId:h}}),fe.value&&Dt(!0)))}async function J(h){h&&(c.value!==h&&(await le(h),await W.push({name:"thread",params:{threadId:h}})),await Ht(),en())}function T(h){ve(h)}function R(h){var he,ne;const w=s.value.find(ge=>ge.projectName===h),V=((ne=(he=w==null?void 0:w.threads[0])==null?void 0:he.cwd)==null?void 0:ne.trim())??"";V&&(Ce.value=V),fe.value&&Dt(!0),!tt.value&&W.push({name:"home"})}function F(h){var he,ne;const w=s.value.find(ge=>ge.projectName===h),V=((ne=(he=w==null?void 0:w.threads[0])==null?void 0:he.cwd)==null?void 0:ne.trim())??"";!V||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(V)}`,"_blank","noopener,noreferrer")}function se(){var w,V;const h=((V=(w=i.value)==null?void 0:w.cwd)==null?void 0:V.trim())??"";h&&(Ce.value=h),fe.value&&Dt(!0),!tt.value&&W.push({name:"home"})}function Re(h){Ge(h.projectName,h.displayName)}function Qe(h){Te(h.threadId,h.title)}function Je(h){He(h)}function it(h){Ke(h.projectName,h.toIndex)}function _t(h){de(h.threadId,h.state)}function Zt(h){ht(h)}function Dt(h){H.value!==h&&(H.value=h,vi(h))}function Hr(h){h.defaultPrevented||!h.ctrlKey&&!h.metaKey||h.shiftKey||h.altKey||h.key.toLowerCase()==="b"&&(h.preventDefault(),Dt(!H.value))}function Tr(h){const w=h.text;if(tt.value){P(w,h.imageUrls,h.skills,h.fileAttachments);return}if(h.rollbackLatestUserTurn===!0){vs(h);return}ae(w,h.imageUrls,h.skills,h.mode,h.fileAttachments)}async function vs(h){Nt.value&&await re();const w=qt.value;w>=0&&await X(w),await ae(h.text,h.imageUrls,h.skills,"steer",h.fileAttachments)}function Ir(h){Ce.value=h.trim()}async function Vr(h){const w=h.trim();if(!w)return;const V=rr(w),he=await ys(),ne=V?w:N(he,w);if(ne)try{const ge=await p_(ne,{createIfMissing:!V,label:V?"":w});ge&&(Ce.value=ge,Ze(E(ge)),or(),sr())}catch{}}async function ys(){const h=Wr();if(h)return h;try{const w=await Bc();if(w)return _e.value=w,w}catch{}return""}function rr(h){return h?h.startsWith("~/")||h.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(h):!1}async function sr(){const h=Wr();if(!h){G.value="New Project (1)";return}try{const w=await m_(h);G.value=w.name||"New Project (1)"}catch{G.value="New Project (1)"}}function Wr(){var V,he;const h=Ce.value.trim();if(h)return ir(h);const w=((he=(V=Tt.value[0])==null?void 0:V.value)==null?void 0:he.trim())??"";return w?ir(w):_e.value.trim()}async function ws(){try{_e.value=await Bc()}catch{_e.value=""}}async function or(){try{const h=await ya();_.value={order:[...h.order],labels:{...h.labels}}}catch{_.value={order:[],labels:{}}}}function ir(h){const w=h.trim().replace(/\/+$/,"");if(!w)return"";const V=w.lastIndexOf("/");return V<=0?"":w.slice(0,V)}function E(h){const w=h.trim().replace(/\/+$/,"");if(!w)return"";const V=w.lastIndexOf("/");return V<0?w:w.slice(V+1)}function N(h,w){const V=h.trim().replace(/\/+$/,""),he=w.trim().replace(/^\/+/,"");return!V||!he?"":`${V}/${he}`}function $(h){we(h)}function Z(h){Ee(h)}function Ue(){re()}function Et(h){var V;const w=((V=h.prependText)==null?void 0:V.trim())??"";w.length>0&&(Xe+=1,De.value={id:Xe,text:w}),X(h.turnIndex)}function en(){if(tt.value||mt.value||typeof document>"u"||!i.value||Pt.value.length===0)return;const h=qr(),w=Nn(),V=new Blob([h],{type:"text/markdown;charset=utf-8"}),he=URL.createObjectURL(V),ne=document.createElement("a");ne.href=he,ne.download=w,document.body.appendChild(ne),ne.click(),document.body.removeChild(ne),window.setTimeout(()=>URL.revokeObjectURL(he),0)}function qr(){var V,he,ne;const h=[],w=((he=(V=i.value)==null?void 0:V.title)==null?void 0:he.trim())||"Untitled thread";h.push(`# ${sn(w)}`),h.push(""),h.push(`- Exported: ${new Date().toISOString()}`),h.push(`- Thread ID: ${((ne=i.value)==null?void 0:ne.id)??""}`),h.push(""),h.push("---"),h.push("");for(const ge of Pt.value){const ze=ge.role?ge.role.toUpperCase():"MESSAGE";h.push(`## ${ze}`),h.push("");const Dn=ge.text.trim();if(Dn&&(h.push(Dn),h.push("")),ge.commandExecution&&(h.push("```text"),h.push(`command: ${ge.commandExecution.command}`),h.push(`status: ${ge.commandExecution.status}`),ge.commandExecution.cwd&&h.push(`cwd: ${ge.commandExecution.cwd}`),ge.commandExecution.exitCode!==null&&h.push(`exitCode: ${ge.commandExecution.exitCode}`),h.push(ge.commandExecution.aggregatedOutput||"(no output)"),h.push("```"),h.push("")),ge.fileAttachments&&ge.fileAttachments.length>0){h.push("Attachments:");for(const on of ge.fileAttachments)h.push(`- ${on.path}`);h.push("")}if(ge.images&&ge.images.length>0){h.push("Images:");for(const on of ge.images)h.push(`- ${on}`);h.push("")}}return`${h.join(`
1424
+ `).trimEnd()}
1425
+ `}function Nn(){var ne,ge;const V=(((ge=(ne=i.value)==null?void 0:ne.title)==null?void 0:ge.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",he=new Date().toISOString().replace(/[:.]/g,"-");return`${V}-${he}.md`}function sn(h){return h.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function bn(h,w){if(typeof window>"u")return w;const V=window.localStorage.getItem(h);return V===null?w:V==="1"}function zr(){if(typeof window>"u")return"system";const h=window.localStorage.getItem(Su);return h==="light"||h==="dark"?h:"system"}function bs(){return typeof window>"u"?"steer":window.localStorage.getItem(Iu)==="queue"?"queue":"steer"}function di(){me.value=!me.value,window.localStorage.setItem(Tu,me.value?"1":"0")}function fi(){Ie.value=Ie.value==="steer"?"queue":"steer",window.localStorage.setItem(Iu,Ie.value)}function hi(){const h=["system","light","dark"],w=h.indexOf(Oe.value);Oe.value=h[(w+1)%h.length],window.localStorage.setItem(Su,Oe.value),Gr()}function _s(){Ve.value=!Ve.value,window.localStorage.setItem(Eu,Ve.value?"1":"0")}function $n(){ot.value=!ot.value,window.localStorage.setItem(Cu,ot.value?"1":"0")}function pi(h){const V=ks(h.trim())||"auto";We.value=V,window.localStorage.setItem(Au,V)}function mi(){var V;if(typeof window>"u")return"auto";const h=((V=window.localStorage.getItem(Au))==null?void 0:V.trim())||"auto";return ks(h)||"auto"}function gi(){const h=[{value:"auto",label:"Auto-detect"}],w=new Set(["auto"]);function V(ne){const ge=r[ne]||ne;return`${ge.charAt(0).toUpperCase()+ge.slice(1)} (${ne})`}for(const ne of typeof navigator<"u"?navigator.languages??[]:[]){const ge=ks(ne);!ge||w.has(ge)||(w.add(ge),h.push({value:ge,label:`Preferred: ${V(ge)}`}))}for(const ne of Object.keys(r))w.has(ne)||(w.add(ne),h.push({value:ne,label:V(ne)}));const he=We.value.trim();return he&&!w.has(he)&&h.push({value:he,label:V(he)}),h}function ks(h){const w=h.trim().toLowerCase();if(!w||w==="auto")return"";if(w in r)return w;const V=w.split("-")[0]??w;return V in r?V:""}function Gr(){const h=document.documentElement;if(Oe.value==="dark")h.classList.add("dark");else if(Oe.value==="light")h.classList.remove("dark");else{const w=window.matchMedia("(prefers-color-scheme: dark)").matches;h.classList.toggle("dark",w)}}function lo(){return typeof window>"u"?!1:window.localStorage.getItem(ku)==="1"}function vi(h){typeof window>"u"||window.localStorage.setItem(ku,h?"1":"0")}function d(h,w){const V=(h??"").trim();return V.length>0?V:w.trim()||"message"}async function m(){await Q(),be.value=!0,await y(),pt()}async function y(){if(!ue.value){ue.value=!0;try{if(Be.name==="home"||Be.name==="skills"){c.value!==""&&await le("");return}if(Be.name==="thread"){const h=St.value;if(!h)return;if(!Ot.value.has(h)){await W.replace({name:"home"});return}c.value!==h&&await le(h);return}}finally{ue.value=!1}}}dt(()=>[Be.name,St.value,B.value,Ot.value.has(St.value),c.value],async()=>{be.value&&await y()}),dt(()=>c.value,async h=>{if(be.value&&!ue.value&&!(tt.value||mt.value)){if(!h){Be.name!=="home"&&await W.replace({name:"home"});return}Be.name==="thread"&&St.value===h||await W.replace({name:"thread",params:{threadId:h}})}}),dt(()=>Tt.value,h=>{if(h.length===0){Ce.value="";return}h.some(V=>V.value===Ce.value)||(Ce.value=h[0].value),sr()},{immediate:!0}),dt(()=>Ce.value,()=>{M.value={phase:"idle",title:"",message:""},sr()}),dt(()=>v.value,h=>{h==="local"&&(M.value={phase:"idle",title:"",message:""})}),dt(()=>Be.name,h=>{h!=="home"&&(M.value={phase:"idle",title:"",message:""})}),dt(()=>c.value,()=>{M.value={phase:"idle",title:"",message:""}}),dt(fe,h=>{h&&!H.value&&Dt(!0)});async function P(h,w=[],V=[],he=[]){try{M.value={phase:"idle",title:"",message:""};let ne=Ce.value;if(v.value==="worktree"){M.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const ze=await f_(Ce.value);ne=ze.cwd,Ce.value=ze.cwd,M.value={phase:"idle",title:"",message:""}}catch{M.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const ge=await te(h,ne,w,V,he);if(!ge)return;await W.replace({name:"thread",params:{threadId:ge}})}catch{}}return(h,w)=>(b(),S(Le,null,[Se(Gg,{"is-sidebar-collapsed":H.value,onCloseSidebar:w[6]||(w[6]=V=>Dt(!0))},{sidebar:gt(()=>[p("section",HC,[p("div",VC,[H.value?ie("",!0):(b(),ut(vu,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":H.value,"show-new-thread-button":!0,onToggleSidebar:w[0]||(w[0]=V=>Dt(!H.value)),onStartNewThread:se},{default:gt(()=>[p("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":O.value,"aria-label":"Search threads",title:"Search threads",onClick:dn},[Se(wa,{class:"sidebar-search-toggle-icon"})],8,WC)]),_:1},8,["is-sidebar-collapsed"])),!H.value&&O.value?(b(),S("div",qC,[Se(wa,{class:"sidebar-search-bar-icon"}),Yn(p("input",{ref_key:"sidebarSearchInputRef",ref:L,"onUpdate:modelValue":w[1]||(w[1]=V=>U.value=V),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:C},null,544),[[Xn,U.value]]),U.value.length>0?(b(),S("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:k},[Se(el,{class:"sidebar-search-clear-icon"})])):ie("",!0)])):ie("",!0),H.value?ie("",!0):(b(),S("button",{key:2,class:st(["sidebar-skills-link",{"is-active":mt.value}]),type:"button",onClick:w[2]||(w[2]=V=>{ye(W).push({name:"skills"}),ye(fe)&&Dt(!0)})}," Skills Hub ",2)),H.value?ie("",!0):(b(),ut(Dy,{key:3,groups:ye(s),"project-display-name-by-id":ye(o),"selected-thread-id":ye(c),"is-loading":ye(B),"search-query":U.value,"search-matched-thread-ids":q.value,onSelect:A,onArchive:T,onStartNewThread:R,onRenameProject:Re,onBrowseProjectFiles:F,onRenameThread:Qe,onRemoveProject:Je,onReorderProject:it,onExportThread:J},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),H.value?ie("",!0):(b(),S("div",zC,[Se(Wd,{name:"settings-panel"},{default:gt(()=>[pe.value?(b(),S("div",GC,[p("button",{class:"sidebar-settings-row",type:"button",onClick:di},[w[7]||(w[7]=p("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),p("span",{class:st(["sidebar-settings-toggle",{"is-on":!me.value}])},null,2)]),p("button",{class:"sidebar-settings-row",type:"button",onClick:fi},[w[8]||(w[8]=p("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),p("span",KC,oe(Ie.value==="steer"?"Steer":"Queue"),1)]),p("button",{class:"sidebar-settings-row",type:"button",onClick:hi},[w[9]||(w[9]=p("span",{class:"sidebar-settings-label"},"Appearance",-1)),p("span",JC,oe(Oe.value==="system"?"System":Oe.value==="dark"?"Dark":"Light"),1)]),p("button",{class:"sidebar-settings-row",type:"button",onClick:_s},[w[10]||(w[10]=p("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),p("span",{class:st(["sidebar-settings-toggle",{"is-on":Ve.value}])},null,2)]),p("button",{class:"sidebar-settings-row",type:"button",onClick:$n},[w[11]||(w[11]=p("span",{class:"sidebar-settings-label"},"Auto send dictation",-1)),p("span",{class:st(["sidebar-settings-toggle",{"is-on":ot.value}])},null,2)]),p("div",YC,[w[12]||(w[12]=p("span",{class:"sidebar-settings-label"},"Dictation language",-1)),Se(jo,{class:"sidebar-settings-language-dropdown","model-value":We.value,options:et.value,placeholder:"Auto-detect","open-direction":"up","enable-search":!0,"search-placeholder":"Search language...","onUpdate:modelValue":pi},null,8,["model-value","options"])])])):ie("",!0)]),_:1}),p("button",{class:"sidebar-settings-button",type:"button",onClick:w[3]||(w[3]=V=>pe.value=!pe.value)},[Se(vC,{class:"sidebar-settings-icon"}),w[13]||(w[13]=p("span",null,"Settings",-1))])]))])]),content:gt(()=>[p("section",XC,[Se(Hy,{title:Wt.value},{leading:gt(()=>[H.value||ye(fe)?(b(),ut(vu,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":H.value,"show-new-thread-button":!0,onToggleSidebar:w[4]||(w[4]=V=>Dt(!H.value)),onStartNewThread:se},null,8,["is-sidebar-collapsed"])):ie("",!0)]),_:1},8,["title"]),p("section",QC,[mt.value?(b(),ut(nC,{key:0,onSkillsChanged:rn})):tt.value?(b(),S("div",ZC,[p("div",eA,[w[14]||(w[14]=p("p",{class:"new-thread-hero"},"Let's build",-1)),Se(jo,{class:"new-thread-folder-dropdown","model-value":Ce.value,options:Tt.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":Ir,onAdd:Vr},null,8,["model-value","options","default-add-value"]),Se(l0,{class:"new-thread-runtime-dropdown",modelValue:v.value,"onUpdate:modelValue":w[5]||(w[5]=V=>v.value=V)},null,8,["modelValue"]),M.value.phase!=="idle"?(b(),S("div",{key:0,class:st(["worktree-init-status",{"is-running":M.value.phase==="running","is-error":M.value.phase==="error"}])},[p("strong",tA,oe(M.value.title),1),p("span",nA,oe(M.value.message),1)],2)):ie("",!0)]),Se(Hc,{"active-thread-id":Me.value,cwd:xe.value,models:ye(f),"selected-model":ye(g),"selected-reasoning-effort":ye(I),skills:ye(j),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":me.value,"in-progress-submit-mode":Ie.value,"dictation-click-to-toggle":Ve.value,"dictation-auto-send":ot.value,"prepend-draft-request":De.value,"dictation-language":We.value,onSubmit:Tr,"onUpdate:selectedModel":$,"onUpdate:selectedReasoningEffort":Z},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","prepend-draft-request","dictation-language"])])):(b(),S("div",rA,[p("div",sA,[Se(Eb,{messages:Pt.value,"is-loading":ye(ee),"active-thread-id":Me.value,cwd:xe.value,"scroll-state":ye(a),"live-overlay":zt.value,"pending-requests":ye(l),"is-turn-in-progress":Nt.value,"is-rolling-back":ye(Pe),onUpdateScrollState:_t,onRespondServerRequest:Zt,onRollback:Et},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),p("div",oA,[Se(e0,{messages:ye(ke),onSteer:ye(Ae),onDelete:ye($e)},null,8,["messages","onSteer","onDelete"]),Se(Hc,{"active-thread-id":Me.value,cwd:xe.value,models:ye(f),"selected-model":ye(g),"selected-reasoning-effort":ye(I),skills:ye(j),"is-turn-in-progress":Nt.value,"is-interrupting-turn":ye(z),"has-queue-above":ye(ke).length>0,"send-with-enter":me.value,"in-progress-submit-mode":Ie.value,"dictation-click-to-toggle":Ve.value,"dictation-auto-send":ot.value,"prepend-draft-request":De.value,"dictation-language":We.value,onSubmit:Tr,"onUpdate:selectedModel":$,"onUpdate:selectedReasoningEffort":Z,onInterrupt:Ue},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","dictation-click-to-toggle","dictation-auto-send","prepend-draft-request","dictation-language"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),p("div",iA," WT "+oe(ye(t))+" · v"+oe(ye(n)),1)],64))}}),lA=nt(aA,[["__scopeId","data-v-25259ec2"]]),Qi={render:()=>null},cA=Bg({history:vg(),routes:[{path:"/",name:"home",component:Qi},{path:"/thread/:threadId",name:"thread",component:Qi},{path:"/skills",name:"skills",component:Qi},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Pm(lA).use(cA).mount("#app");