codexapp 0.1.36 → 0.1.37

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,1430 @@
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 Aa(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const bt={},ss=[],Mn=()=>{},wu=()=>!1,Ko=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ra=e=>e.startsWith("onUpdate:"),$t=Object.assign,Pa=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Qf=Object.prototype.hasOwnProperty,dt=(e,t)=>Qf.call(e,t),Le=Array.isArray,os=e=>no(e)==="[object Map]",bu=e=>no(e)==="[object Set]",yl=e=>no(e)==="[object Date]",ze=e=>typeof e=="function",Ct=e=>typeof e=="string",vn=e=>typeof e=="symbol",ft=e=>e!==null&&typeof e=="object",_u=e=>(ft(e)||ze(e))&&ze(e.then)&&ze(e.catch),ku=Object.prototype.toString,no=e=>ku.call(e),Xf=e=>no(e).slice(8,-1),Tu=e=>no(e)==="[object Object]",xa=e=>Ct(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ns=Aa(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Jo=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Zf=/-\w/g,Qt=Jo(e=>e.replace(Zf,t=>t.slice(1).toUpperCase())),eh=/\B([A-Z])/g,Tr=Jo(e=>e.replace(eh,"-$1").toLowerCase()),Yo=Jo(e=>e.charAt(0).toUpperCase()+e.slice(1)),mi=Jo(e=>e?`on${Yo(e)}`:""),Rn=(e,t)=>!Object.is(e,t),ko=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Iu=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Oa=e=>{const t=parseFloat(e);return isNaN(t)?e:t},th=e=>{const t=Ct(e)?Number(e):NaN;return isNaN(t)?e:t};let wl;const Qo=()=>wl||(wl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function zr(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=Ct(r)?oh(r):zr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(Ct(e)||ft(e))return e}const nh=/;(?![^(]*\))/g,rh=/:([^]+)/,sh=/\/\*[^]*?\*\//g;function oh(e){const t={};return e.replace(sh,"").split(nh).forEach(n=>{if(n){const r=n.split(rh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function gt(e){let t="";if(Ct(e))t=e;else if(Le(e))for(let n=0;n<e.length;n++){const r=gt(e[n]);r&&(t+=r+" ")}else if(ft(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const ih="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ah=Aa(ih);function Su(e){return!!e||e===""}function lh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Ma(e[r],t[r]);return n}function Ma(e,t){if(e===t)return!0;let n=yl(e),r=yl(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=vn(e),r=vn(t),n||r)return e===t;if(n=Le(e),r=Le(t),n||r)return n&&r?lh(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||!Ma(e[i],t[i]))return!1}}return String(e)===String(t)}const Eu=e=>!!(e&&e.__v_isRef===!0),ce=e=>Ct(e)?e:e==null?"":Le(e)||ft(e)&&(e.toString===ku||!ze(e.toString))?Eu(e)?ce(e.value):JSON.stringify(e,Cu,2):String(e),Cu=(e,t)=>Eu(t)?Cu(e,t.value):os(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[gi(r,o)+" =>"]=s,n),{})}:bu(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>gi(n))}:vn(t)?gi(t):ft(t)&&!Le(t)&&!Tu(t)?String(t):t,gi=(e,t="")=>{var n;return vn(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 en;class ch{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=en,!t&&en&&(this.index=(en.scopes||(en.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=en;try{return en=this,t()}finally{en=n}}}on(){++this._on===1&&(this.prevScope=en,en=this)}off(){this._on>0&&--this._on===0&&(en=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function uh(){return en}let Tt;const vi=new WeakSet;class Au{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,en&&en.active&&en.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,vi.has(this)&&(vi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Pu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,bl(this),xu(this);const t=Tt,n=pn;Tt=this,pn=!0;try{return this.fn()}finally{Ou(this),Tt=t,pn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Da(t);this.deps=this.depsTail=void 0,bl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?vi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ki(this)&&this.run()}get dirty(){return Ki(this)}}let Ru=0,$s,Ds;function Pu(e,t=!1){if(e.flags|=8,t){e.next=Ds,Ds=e;return}e.next=$s,$s=e}function Na(){Ru++}function $a(){if(--Ru>0)return;if(Ds){let t=Ds;for(Ds=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;$s;){let t=$s;for($s=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function xu(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ou(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Da(r),dh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Ki(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Mu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Mu(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Vs)||(e.globalVersion=Vs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ki(e))))return;e.flags|=2;const t=e.dep,n=Tt,r=pn;Tt=e,pn=!0;try{xu(e);const s=e.fn(e._value);(t.version===0||Rn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Tt=n,pn=r,Ou(e),e.flags&=-3}}function Da(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)Da(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function dh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let pn=!0;const Nu=[];function Xn(){Nu.push(pn),pn=!1}function Zn(){const e=Nu.pop();pn=e===void 0?!0:e}function bl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Tt;Tt=void 0;try{t()}finally{Tt=n}}}let Vs=0;class fh{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 La{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Tt||!pn||Tt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Tt)n=this.activeLink=new fh(Tt,this),Tt.deps?(n.prevDep=Tt.depsTail,Tt.depsTail.nextDep=n,Tt.depsTail=n):Tt.deps=Tt.depsTail=n,$u(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=Tt.depsTail,n.nextDep=void 0,Tt.depsTail.nextDep=n,Tt.depsTail=n,Tt.deps===n&&(Tt.deps=r)}return n}trigger(t){this.version++,Vs++,this.notify(t)}notify(t){Na();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{$a()}}}function $u(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)$u(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ji=new WeakMap,Hr=Symbol(""),Yi=Symbol(""),Ws=Symbol("");function Vt(e,t,n){if(pn&&Tt){let r=Ji.get(e);r||Ji.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new La),s.map=r,s.key=n),s.track()}}function Gn(e,t,n,r,s,o){const i=Ji.get(e);if(!i){Vs++;return}const a=l=>{l&&l.trigger()};if(Na(),t==="clear")i.forEach(a);else{const l=Le(e),u=l&&xa(n);if(l&&n==="length"){const c=Number(r);i.forEach((f,p)=>{(p==="length"||p===Ws||!vn(p)&&p>=c)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(Ws)),t){case"add":l?u&&a(i.get("length")):(a(i.get(Hr)),os(e)&&a(i.get(Yi)));break;case"delete":l||(a(i.get(Hr)),os(e)&&a(i.get(Yi)));break;case"set":os(e)&&a(i.get(Hr));break}}$a()}function Zr(e){const t=ct(e);return t===e?t:(Vt(t,"iterate",Ws),dn(e)?t:t.map(yn))}function Xo(e){return Vt(e=ct(e),"iterate",Ws),e}function Cn(e,t){return er(e)?hs(Vr(e)?yn(t):t):yn(t)}const hh={__proto__:null,[Symbol.iterator](){return yi(this,Symbol.iterator,e=>Cn(this,e))},concat(...e){return Zr(this).concat(...e.map(t=>Le(t)?Zr(t):t))},entries(){return yi(this,"entries",e=>(e[1]=Cn(this,e[1]),e))},every(e,t){return Hn(this,"every",e,t,void 0,arguments)},filter(e,t){return Hn(this,"filter",e,t,n=>n.map(r=>Cn(this,r)),arguments)},find(e,t){return Hn(this,"find",e,t,n=>Cn(this,n),arguments)},findIndex(e,t){return Hn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Hn(this,"findLast",e,t,n=>Cn(this,n),arguments)},findLastIndex(e,t){return Hn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Hn(this,"forEach",e,t,void 0,arguments)},includes(...e){return wi(this,"includes",e)},indexOf(...e){return wi(this,"indexOf",e)},join(e){return Zr(this).join(e)},lastIndexOf(...e){return wi(this,"lastIndexOf",e)},map(e,t){return Hn(this,"map",e,t,void 0,arguments)},pop(){return Cs(this,"pop")},push(...e){return Cs(this,"push",e)},reduce(e,...t){return _l(this,"reduce",e,t)},reduceRight(e,...t){return _l(this,"reduceRight",e,t)},shift(){return Cs(this,"shift")},some(e,t){return Hn(this,"some",e,t,void 0,arguments)},splice(...e){return Cs(this,"splice",e)},toReversed(){return Zr(this).toReversed()},toSorted(e){return Zr(this).toSorted(e)},toSpliced(...e){return Zr(this).toSpliced(...e)},unshift(...e){return Cs(this,"unshift",e)},values(){return yi(this,"values",e=>Cn(this,e))}};function yi(e,t,n){const r=Xo(e),s=r[t]();return r!==e&&!dn(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const ph=Array.prototype;function Hn(e,t,n,r,s,o){const i=Xo(e),a=i!==e&&!dn(e),l=i[t];if(l!==ph[t]){const f=l.apply(e,o);return a?yn(f):f}let u=n;i!==e&&(a?u=function(f,p){return n.call(this,Cn(e,f),p,e)}:n.length>2&&(u=function(f,p){return n.call(this,f,p,e)}));const c=l.call(i,u,r);return a&&s?s(c):c}function _l(e,t,n,r){const s=Xo(e),o=s!==e&&!dn(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(u,c,f){return a&&(a=!1,u=Cn(e,u)),n.call(this,u,Cn(e,c),f,e)}):n.length>3&&(i=function(u,c,f){return n.call(this,u,c,f,e)}));const l=s[t](i,...r);return a?Cn(e,l):l}function wi(e,t,n){const r=ct(e);Vt(r,"iterate",Ws);const s=r[t](...n);return(s===-1||s===!1)&&Ua(n[0])?(n[0]=ct(n[0]),r[t](...n)):s}function Cs(e,t,n=[]){Xn(),Na();const r=ct(e)[t].apply(e,n);return $a(),Zn(),r}const mh=Aa("__proto__,__v_isRef,__isVue"),Du=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(vn));function gh(e){vn(e)||(e=String(e));const t=ct(this);return Vt(t,"has",e),t.hasOwnProperty(e)}class Lu{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?Eh:Fu:o?Uu:Bu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Le(t);if(!s){let l;if(i&&(l=hh[n]))return l;if(n==="hasOwnProperty")return gh}const a=Reflect.get(t,n,qt(t)?t:r);if((vn(n)?Du.has(n):mh(n))||(s||Vt(t,"get",n),o))return a;if(qt(a)){const l=i&&xa(n)?a:a.value;return s&&ft(l)?Xi(l):l}return ft(a)?s?Xi(a):Zo(a):a}}class ju extends Lu{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Le(t)&&xa(n);if(!this._isShallow){const u=er(o);if(!dn(r)&&!er(r)&&(o=ct(o),r=ct(r)),!i&&qt(o)&&!qt(r))return u||(o.value=r),!0}const a=i?Number(n)<t.length:dt(t,n),l=Reflect.set(t,n,r,qt(t)?t:s);return t===ct(s)&&(a?Rn(r,o)&&Gn(t,"set",n,r):Gn(t,"add",n,r)),l}deleteProperty(t,n){const r=dt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&Gn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!vn(n)||!Du.has(n))&&Vt(t,"has",n),r}ownKeys(t){return Vt(t,"iterate",Le(t)?"length":Hr),Reflect.ownKeys(t)}}class vh extends Lu{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const yh=new ju,wh=new vh,bh=new ju(!0);const Qi=e=>e,ho=e=>Reflect.getPrototypeOf(e);function _h(e,t,n){return function(...r){const s=this.__v_raw,o=ct(s),i=os(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=s[e](...r),c=n?Qi:t?hs:yn;return!t&&Vt(o,"iterate",l?Yi:Hr),$t(Object.create(u),{next(){const{value:f,done:p}=u.next();return p?{value:f,done:p}:{value:a?[c(f[0]),c(f[1])]:c(f),done:p}}})}}function po(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function kh(e,t){const n={get(s){const o=this.__v_raw,i=ct(o),a=ct(s);e||(Rn(s,a)&&Vt(i,"get",s),Vt(i,"get",a));const{has:l}=ho(i),u=t?Qi:e?hs:yn;if(l.call(i,s))return u(o.get(s));if(l.call(i,a))return u(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Vt(ct(s),"iterate",Hr),s.size},has(s){const o=this.__v_raw,i=ct(o),a=ct(s);return e||(Rn(s,a)&&Vt(i,"has",s),Vt(i,"has",a)),s===a?o.has(s):o.has(s)||o.has(a)},forEach(s,o){const i=this,a=i.__v_raw,l=ct(a),u=t?Qi:e?hs:yn;return!e&&Vt(l,"iterate",Hr),a.forEach((c,f)=>s.call(o,u(c),u(f),i))}};return $t(n,e?{add:po("add"),set:po("set"),delete:po("delete"),clear:po("clear")}:{add(s){const o=ct(this),i=ho(o),a=ct(s),l=!t&&!dn(s)&&!er(s)?a:s;return i.has.call(o,l)||Rn(s,l)&&i.has.call(o,s)||Rn(a,l)&&i.has.call(o,a)||(o.add(l),Gn(o,"add",l,l)),this},set(s,o){!t&&!dn(o)&&!er(o)&&(o=ct(o));const i=ct(this),{has:a,get:l}=ho(i);let u=a.call(i,s);u||(s=ct(s),u=a.call(i,s));const c=l.call(i,s);return i.set(s,o),u?Rn(o,c)&&Gn(i,"set",s,o):Gn(i,"add",s,o),this},delete(s){const o=ct(this),{has:i,get:a}=ho(o);let l=i.call(o,s);l||(s=ct(s),l=i.call(o,s)),a&&a.call(o,s);const u=o.delete(s);return l&&Gn(o,"delete",s,void 0),u},clear(){const s=ct(this),o=s.size!==0,i=s.clear();return o&&Gn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=_h(s,e,t)}),n}function ja(e,t){const n=kh(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(dt(n,s)&&s in r?n:r,s,o)}const Th={get:ja(!1,!1)},Ih={get:ja(!1,!0)},Sh={get:ja(!0,!1)};const Bu=new WeakMap,Uu=new WeakMap,Fu=new WeakMap,Eh=new WeakMap;function Ch(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ah(e){return e.__v_skip||!Object.isExtensible(e)?0:Ch(Xf(e))}function Zo(e){return er(e)?e:Ba(e,!1,yh,Th,Bu)}function Hu(e){return Ba(e,!1,bh,Ih,Uu)}function Xi(e){return Ba(e,!0,wh,Sh,Fu)}function Ba(e,t,n,r,s){if(!ft(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Ah(e);if(o===0)return e;const i=s.get(e);if(i)return i;const a=new Proxy(e,o===2?r:n);return s.set(e,a),a}function Vr(e){return er(e)?Vr(e.__v_raw):!!(e&&e.__v_isReactive)}function er(e){return!!(e&&e.__v_isReadonly)}function dn(e){return!!(e&&e.__v_isShallow)}function Ua(e){return e?!!e.__v_raw:!1}function ct(e){const t=e&&e.__v_raw;return t?ct(t):e}function Rh(e){return!dt(e,"__v_skip")&&Object.isExtensible(e)&&Iu(e,"__v_skip",!0),e}const yn=e=>ft(e)?Zo(e):e,hs=e=>ft(e)?Xi(e):e;function qt(e){return e?e.__v_isRef===!0:!1}function D(e){return Vu(e,!1)}function Ph(e){return Vu(e,!0)}function Vu(e,t){return qt(e)?e:new xh(e,t)}class xh{constructor(t,n){this.dep=new La,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ct(t),this._value=n?t:yn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||dn(t)||er(t);t=r?t:ct(t),Rn(t,n)&&(this._rawValue=t,this._value=r?t:yn(t),this.dep.trigger())}}function ue(e){return qt(e)?e.value:e}const Oh={get:(e,t,n)=>t==="__v_raw"?e:ue(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return qt(s)&&!qt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Wu(e){return Vr(e)?e:new Proxy(e,Oh)}class Mh{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new La(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Vs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Tt!==this)return Pu(this,!0),!0}get value(){const t=this.dep.track();return Mu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Nh(e,t,n=!1){let r,s;return ze(e)?r=e:(r=e.get,s=e.set),new Mh(r,s,n)}const mo={},Oo=new WeakMap;let Dr;function $h(e,t=!1,n=Dr){if(n){let r=Oo.get(n);r||Oo.set(n,r=[]),r.push(e)}}function Dh(e,t,n=bt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,u=B=>s?B:dn(B)||s===!1||s===0?Kn(B,1):Kn(B);let c,f,p,_,N=!1,I=!1;if(qt(e)?(f=()=>e.value,N=dn(e)):Vr(e)?(f=()=>u(e),N=!0):Le(e)?(I=!0,N=e.some(B=>Vr(B)||dn(B)),f=()=>e.map(B=>{if(qt(B))return B.value;if(Vr(B))return u(B);if(ze(B))return l?l(B,2):B()})):ze(e)?t?f=l?()=>l(e,2):e:f=()=>{if(p){Xn();try{p()}finally{Zn()}}const B=Dr;Dr=c;try{return l?l(e,3,[_]):e(_)}finally{Dr=B}}:f=Mn,t&&s){const B=f,oe=s===!0?1/0:s;f=()=>Kn(B(),oe)}const M=uh(),Y=()=>{c.stop(),M&&M.active&&Pa(M.effects,c)};if(o&&t){const B=t;t=(...oe)=>{B(...oe),Y()}}let j=I?new Array(e.length).fill(mo):mo;const q=B=>{if(!(!(c.flags&1)||!c.dirty&&!B))if(t){const oe=c.run();if(s||N||(I?oe.some((de,ve)=>Rn(de,j[ve])):Rn(oe,j))){p&&p();const de=Dr;Dr=c;try{const ve=[oe,j===mo?void 0:I&&j[0]===mo?[]:j,_];j=oe,l?l(t,3,ve):t(...ve)}finally{Dr=de}}}else c.run()};return a&&a(q),c=new Au(f),c.scheduler=i?()=>i(q,!1):q,_=B=>$h(B,!1,c),p=c.onStop=()=>{const B=Oo.get(c);if(B){if(l)l(B,4);else for(const oe of B)oe();Oo.delete(c)}},t?r?q(!0):j=c.run():i?i(q.bind(null,!0),!0):c.run(),Y.pause=c.pause.bind(c),Y.resume=c.resume.bind(c),Y.stop=Y,Y}function Kn(e,t=1/0,n){if(t<=0||!ft(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,qt(e))Kn(e.value,t,n);else if(Le(e))for(let r=0;r<e.length;r++)Kn(e[r],t,n);else if(bu(e)||os(e))e.forEach(r=>{Kn(r,t,n)});else if(Tu(e)){for(const r in e)Kn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Kn(e[r],t,n)}return e}/**
10
+ * @vue/runtime-core v3.5.30
11
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
+ * @license MIT
13
+ **/function ro(e,t,n,r){try{return r?e(...r):e()}catch(s){ei(s,t,n)}}function wn(e,t,n,r){if(ze(e)){const s=ro(e,t,n,r);return s&&_u(s)&&s.catch(o=>{ei(o,t,n)}),s}if(Le(e)){const s=[];for(let o=0;o<e.length;o++)s.push(wn(e[o],t,n,r));return s}}function ei(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||bt;if(t){let a=t.parent;const l=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](e,l,u)===!1)return}a=a.parent}if(o){Xn(),ro(o,null,10,[e,l,u]),Zn();return}}Lh(e,n,s,r,i)}function Lh(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Jt=[];let Sn=-1;const is=[];let pr=null,ts=0;const zu=Promise.resolve();let Mo=null;function tn(e){const t=Mo||zu;return e?t.then(this?e.bind(this):e):t}function jh(e){let t=Sn+1,n=Jt.length;for(;t<n;){const r=t+n>>>1,s=Jt[r],o=zs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function Fa(e){if(!(e.flags&1)){const t=zs(e),n=Jt[Jt.length-1];!n||!(e.flags&2)&&t>=zs(n)?Jt.push(e):Jt.splice(jh(t),0,e),e.flags|=1,qu()}}function qu(){Mo||(Mo=zu.then(Ku))}function Bh(e){Le(e)?is.push(...e):pr&&e.id===-1?pr.splice(ts+1,0,e):e.flags&1||(is.push(e),e.flags|=1),qu()}function kl(e,t,n=Sn+1){for(;n<Jt.length;n++){const r=Jt[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Jt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Gu(e){if(is.length){const t=[...new Set(is)].sort((n,r)=>zs(n)-zs(r));if(is.length=0,pr){pr.push(...t);return}for(pr=t,ts=0;ts<pr.length;ts++){const n=pr[ts];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}pr=null,ts=0}}const zs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ku(e){try{for(Sn=0;Sn<Jt.length;Sn++){const t=Jt[Sn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ro(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Sn<Jt.length;Sn++){const t=Jt[Sn];t&&(t.flags&=-2)}Sn=-1,Jt.length=0,Gu(),Mo=null,(Jt.length||is.length)&&Ku()}}let Ut=null,Ju=null;function No(e){const t=Ut;return Ut=e,Ju=e&&e.type.__scopeId||null,t}function pt(e,t=Ut,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&jo(-1);const o=No(t);let i;try{i=e(...s)}finally{No(o),r._d&&jo(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function tr(e,t){if(Ut===null)return e;const n=ii(Ut),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=bt]=t[s];o&&(ze(o)&&(o={mounted:o,updated:o}),o.deep&&Kn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function xr(e,t,n,r){const s=e.dirs,o=t&&t.dirs;for(let i=0;i<s.length;i++){const a=s[i];o&&(a.oldValue=o[i].value);let l=a.dir[r];l&&(Xn(),wn(l,n,8,[e.el,a,e,t]),Zn())}}function To(e,t){if(zt){let n=zt.provides;const r=zt.parent&&zt.parent.provides;r===n&&(n=zt.provides=Object.create(r)),n[e]=t}}function mn(e,t,n=!1){const r=qa();if(r||ls){let s=ls?ls._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&ze(t)?t.call(r&&r.proxy):t}}const Uh=Symbol.for("v-scx"),Fh=()=>mn(Uh);function mt(e,t,n){return Yu(e,t,n)}function Yu(e,t,n=bt){const{immediate:r,deep:s,flush:o,once:i}=n,a=$t({},n),l=t&&r||!t&&o!=="post";let u;if(Js){if(o==="sync"){const _=Fh();u=_.__watcherHandles||(_.__watcherHandles=[])}else if(!l){const _=()=>{};return _.stop=Mn,_.resume=Mn,_.pause=Mn,_}}const c=zt;a.call=(_,N,I)=>wn(_,c,N,I);let f=!1;o==="post"?a.scheduler=_=>{Ht(_,c&&c.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(_,N)=>{N?_():Fa(_)}),a.augmentJob=_=>{t&&(_.flags|=4),f&&(_.flags|=2,c&&(_.id=c.uid,_.i=c))};const p=Dh(e,t,a);return Js&&(u?u.push(p):l&&p()),p}function Hh(e,t,n){const r=this.proxy,s=Ct(e)?e.includes(".")?Qu(r,e):()=>r[e]:e.bind(r,r);let o;ze(t)?o=t:(o=t.handler,n=t);const i=so(this),a=Yu(s,o.bind(r),n);return i(),a}function Qu(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 Xu=Symbol("_vte"),Zu=e=>e.__isTeleport,Ls=e=>e&&(e.disabled||e.disabled===""),Tl=e=>e&&(e.defer||e.defer===""),Il=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Sl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Zi=(e,t)=>{const n=e&&e.to;return Ct(n)?t?t(n):null:n},ed={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,u){const{mc:c,pc:f,pbc:p,o:{insert:_,querySelector:N,createText:I,createComment:M}}=u,Y=Ls(t.props);let{shapeFlag:j,children:q,dynamicChildren:B}=t;if(e==null){const oe=t.el=I(""),de=t.anchor=I("");_(oe,n,r),_(de,n,r);const ve=(re,ee)=>{j&16&&c(q,re,ee,s,o,i,a,l)},Ie=()=>{const re=t.target=Zi(t.props,N),ee=ea(re,t,I,_);re&&(i!=="svg"&&Il(re)?i="svg":i!=="mathml"&&Sl(re)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(re),Y||(ve(re,ee),Io(t,!1)))};Y&&(ve(n,de),Io(t,!0)),Tl(t.props)?(t.el.__isMounted=!1,Ht(()=>{Ie(),delete t.el.__isMounted},o)):Ie()}else{if(Tl(t.props)&&e.el.__isMounted===!1){Ht(()=>{ed.process(e,t,n,r,s,o,i,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const oe=t.anchor=e.anchor,de=t.target=e.target,ve=t.targetAnchor=e.targetAnchor,Ie=Ls(e.props),re=Ie?n:de,ee=Ie?oe:ve;if(i==="svg"||Il(de)?i="svg":(i==="mathml"||Sl(de))&&(i="mathml"),B?(p(e.dynamicChildren,B,re,s,o,i,a),Wa(e,t,!0)):l||f(e,t,re,ee,s,o,i,a,!1),Y)Ie?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):go(t,n,oe,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ye=t.target=Zi(t.props,N);ye&&go(t,ye,null,u,0)}else Ie&&go(t,de,ve,u,1);Io(t,Y)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:c,target:f,props:p}=e;if(f&&(s(u),s(c)),o&&s(l),i&16){const _=o||!Ls(p);for(let N=0;N<a.length;N++){const I=a[N];r(I,t,n,_,!!I.dynamicChildren)}}},move:go,hydrate:Vh};function go(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:u,props:c}=e,f=o===2;if(f&&r(i,t,n),(!f||Ls(c))&&l&16)for(let p=0;p<u.length;p++)s(u[p],t,n,2);f&&r(a,t,n)}function Vh(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:c}},f){function p(M,Y){let j=Y;for(;j;){if(j&&j.nodeType===8){if(j.data==="teleport start anchor")t.targetStart=j;else if(j.data==="teleport anchor"){t.targetAnchor=j,M._lpa=t.targetAnchor&&i(t.targetAnchor);break}}j=i(j)}}function _(M,Y){Y.anchor=f(i(M),Y,a(M),n,r,s,o)}const N=t.target=Zi(t.props,l),I=Ls(t.props);if(N){const M=N._lpa||N.firstChild;t.shapeFlag&16&&(I?(_(e,t),p(N,M),t.targetAnchor||ea(N,t,c,u,a(e)===N?e:null)):(t.anchor=i(e),p(N,M),t.targetAnchor||ea(N,t,c,u),f(M&&i(M),t,N,n,r,s,o))),Io(t,I)}else I&&t.shapeFlag&16&&(_(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const $o=ed;function Io(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 ea(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Xu]=i,e&&(r(o,e,s),r(i,e,s)),i}const En=Symbol("_leaveCb"),As=Symbol("_enterCb");function Wh(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ir(()=>{e.isMounted=!0}),ar(()=>{e.isUnmounting=!0}),e}const cn=[Function,Array],td={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:cn,onEnter:cn,onAfterEnter:cn,onEnterCancelled:cn,onBeforeLeave:cn,onLeave:cn,onAfterLeave:cn,onLeaveCancelled:cn,onBeforeAppear:cn,onAppear:cn,onAfterAppear:cn,onAppearCancelled:cn},nd=e=>{const t=e.subTree;return t.component?nd(t.component):t},zh={name:"BaseTransition",props:td,setup(e,{slots:t}){const n=qa(),r=Wh();return()=>{const s=t.default&&od(t.default(),!0);if(!s||!s.length)return;const o=rd(s),i=ct(e),{mode:a}=i;if(r.isLeaving)return bi(o);const l=El(o);if(!l)return bi(o);let u=ta(l,i,r,n,f=>u=f);l.type!==Wt&&qs(l,u);let c=n.subTree&&El(n.subTree);if(c&&c.type!==Wt&&!jr(c,l)&&nd(n).type!==Wt){let f=ta(c,i,r,n);if(qs(c,f),a==="out-in"&&l.type!==Wt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},bi(o);a==="in-out"&&l.type!==Wt?f.delayLeave=(p,_,N)=>{const I=sd(r,c);I[String(c.key)]=c,p[En]=()=>{_(),p[En]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{N(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function rd(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Wt){t=n;break}}return t}const qh=zh;function sd(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 ta(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:p,onLeave:_,onAfterLeave:N,onLeaveCancelled:I,onBeforeAppear:M,onAppear:Y,onAfterAppear:j,onAppearCancelled:q}=t,B=String(e.key),oe=sd(n,e),de=(re,ee)=>{re&&wn(re,r,9,ee)},ve=(re,ee)=>{const ye=ee[1];de(re,ee),Le(re)?re.every(te=>te.length<=1)&&ye():re.length<=1&&ye()},Ie={mode:i,persisted:a,beforeEnter(re){let ee=l;if(!n.isMounted)if(o)ee=M||l;else return;re[En]&&re[En](!0);const ye=oe[B];ye&&jr(e,ye)&&ye.el[En]&&ye.el[En](),de(ee,[re])},enter(re){if(oe[B]===e)return;let ee=u,ye=c,te=f;if(!n.isMounted)if(o)ee=Y||u,ye=j||c,te=q||f;else return;let je=!1;re[As]=Qe=>{je||(je=!0,Qe?de(te,[re]):de(ye,[re]),Ie.delayedLeave&&Ie.delayedLeave(),re[As]=void 0)};const Be=re[As].bind(null,!1);ee?ve(ee,[re,Be]):Be()},leave(re,ee){const ye=String(e.key);if(re[As]&&re[As](!0),n.isUnmounting)return ee();de(p,[re]);let te=!1;re[En]=Be=>{te||(te=!0,ee(),Be?de(I,[re]):de(N,[re]),re[En]=void 0,oe[ye]===e&&delete oe[ye])};const je=re[En].bind(null,!1);oe[ye]=e,_?ve(_,[re,je]):je()},clone(re){const ee=ta(re,t,n,r,s);return s&&s(ee),ee}};return Ie}function bi(e){if(ti(e))return e=kr(e),e.children=null,e}function El(e){if(!ti(e))return Zu(e.type)&&e.children?rd(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&ze(n.default))return n.default()}}function qs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,qs(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 od(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===He?(i.patchFlag&128&&s++,r=r.concat(od(i.children,t,a))):(t||i.type!==Wt)&&r.push(a!=null?kr(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Lt(e,t){return ze(e)?$t({name:e.name},t,{setup:e}):e}function id(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Cl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Do=new WeakMap;function js(e,t,n,r,s=!1){if(Le(e)){e.forEach((I,M)=>js(I,t&&(Le(t)?t[M]:t),n,r,s));return}if(as(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&js(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?ii(r.component):r.el,i=s?null:o,{i:a,r:l}=e,u=t&&t.r,c=a.refs===bt?a.refs={}:a.refs,f=a.setupState,p=ct(f),_=f===bt?wu:I=>Cl(c,I)?!1:dt(p,I),N=(I,M)=>!(M&&Cl(c,M));if(u!=null&&u!==l){if(Al(t),Ct(u))c[u]=null,_(u)&&(f[u]=null);else if(qt(u)){const I=t;N(u,I.k)&&(u.value=null),I.k&&(c[I.k]=null)}}if(ze(l))ro(l,a,12,[i,c]);else{const I=Ct(l),M=qt(l);if(I||M){const Y=()=>{if(e.f){const j=I?_(l)?f[l]:c[l]:N()||!e.k?l.value:c[e.k];if(s)Le(j)&&Pa(j,o);else if(Le(j))j.includes(o)||j.push(o);else if(I)c[l]=[o],_(l)&&(f[l]=c[l]);else{const q=[o];N(l,e.k)&&(l.value=q),e.k&&(c[e.k]=q)}}else I?(c[l]=i,_(l)&&(f[l]=i)):M&&(N(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const j=()=>{Y(),Do.delete(e)};j.id=-1,Do.set(e,j),Ht(j,n)}else Al(e),Y()}}}function Al(e){const t=Do.get(e);t&&(t.flags|=8,Do.delete(e))}Qo().requestIdleCallback;Qo().cancelIdleCallback;const as=e=>!!e.type.__asyncLoader,ti=e=>e.type.__isKeepAlive;function Gh(e,t){ad(e,"a",t)}function Kh(e,t){ad(e,"da",t)}function ad(e,t,n=zt){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(ni(t,r,n),n){let s=n.parent;for(;s&&s.parent;)ti(s.parent.vnode)&&Jh(r,t,n,s),s=s.parent}}function Jh(e,t,n,r){const s=ni(t,e,r,!0);ri(()=>{Pa(r[t],s)},n)}function ni(e,t,n=zt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Xn();const a=so(n),l=wn(t,n,e,i);return a(),Zn(),l});return r?s.unshift(o):s.push(o),o}}const or=e=>(t,n=zt)=>{(!Js||e==="sp")&&ni(e,(...r)=>t(...r),n)},Yh=or("bm"),ir=or("m"),Qh=or("bu"),Xh=or("u"),ar=or("bum"),ri=or("um"),Zh=or("sp"),ep=or("rtg"),tp=or("rtc");function np(e,t=zt){ni("ec",e,t)}const rp="components",ld=Symbol.for("v-ndc");function na(e){return Ct(e)?sp(rp,e,!1)||e:e||ld}function sp(e,t,n=!0,r=!1){const s=Ut||zt;if(s){const o=s.type;{const a=Hp(o,!1);if(a&&(a===t||a===Qt(t)||a===Yo(Qt(t))))return o}const i=Rl(s[e]||o[e],t)||Rl(s.appContext[e],t);return!i&&r?o:i}}function Rl(e,t){return e&&(e[t]||e[Qt(t)]||e[Yo(Qt(t))])}function Et(e,t,n,r){let s;const o=n,i=Le(e);if(i||Ct(e)){const a=i&&Vr(e);let l=!1,u=!1;a&&(l=!dn(e),u=er(e),e=Xo(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(l?u?hs(yn(e[c])):yn(e[c]):e[c],c,void 0,o)}else if(typeof e=="number"){s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,o)}else if(ft(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,u=a.length;l<u;l++){const c=a[l];s[l]=t(e[c],c,l,o)}}else s=[];return s}function On(e,t,n={},r,s){if(Ut.ce||Ut.parent&&as(Ut.parent)&&Ut.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),yt(He,null,[Ce("slot",n,r)],u?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&cd(o(n)),a=n.key||i&&i.key,l=yt(He,{key:(a&&!vn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function cd(e){return e.some(t=>Ks(t)?!(t.type===Wt||t.type===He&&!cd(t.children)):!0)?e:null}const ra=e=>e?Rd(e)?ii(e):ra(e.parent):null,Bs=$t(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ra(e.parent),$root:e=>ra(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>dd(e),$forceUpdate:e=>e.f||(e.f=()=>{Fa(e.update)}),$nextTick:e=>e.n||(e.n=tn.bind(e.proxy)),$watch:e=>Hh.bind(e)}),_i=(e,t)=>e!==bt&&!e.__isScriptSetup&&dt(e,t),op={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 p=i[t];if(p!==void 0)switch(p){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(_i(r,t))return i[t]=1,r[t];if(s!==bt&&dt(s,t))return i[t]=2,s[t];if(dt(o,t))return i[t]=3,o[t];if(n!==bt&&dt(n,t))return i[t]=4,n[t];sa&&(i[t]=0)}}const u=Bs[t];let c,f;if(u)return t==="$attrs"&&Vt(e.attrs,"get",""),u(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==bt&&dt(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,dt(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return _i(s,t)?(s[t]=n,!0):r!==bt&&dt(r,t)?(r[t]=n,!0):dt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,props:o,type:i}},a){let l;return!!(n[a]||e!==bt&&a[0]!=="$"&&dt(e,a)||_i(t,a)||dt(o,a)||dt(r,a)||dt(Bs,a)||dt(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:dt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ip(){return ap().slots}function ap(e){const t=qa();return t.setupContext||(t.setupContext=xd(t))}function Pl(e){return Le(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let sa=!0;function lp(e){const t=dd(e),n=e.proxy,r=e.ctx;sa=!1,t.beforeCreate&&xl(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:u,created:c,beforeMount:f,mounted:p,beforeUpdate:_,updated:N,activated:I,deactivated:M,beforeDestroy:Y,beforeUnmount:j,destroyed:q,unmounted:B,render:oe,renderTracked:de,renderTriggered:ve,errorCaptured:Ie,serverPrefetch:re,expose:ee,inheritAttrs:ye,components:te,directives:je,filters:Be}=t;if(u&&cp(u,r,null),i)for(const Te in i){const $e=i[Te];ze($e)&&(r[Te]=$e.bind(n))}if(s){const Te=s.call(n,n);ft(Te)&&(e.data=Zo(Te))}if(sa=!0,o)for(const Te in o){const $e=o[Te],It=ze($e)?$e.bind(n,n):ze($e.get)?$e.get.bind(n,n):Mn,nt=!ze($e)&&ze($e.set)?$e.set.bind(n):Mn,Xe=pe({get:It,set:nt});Object.defineProperty(r,Te,{enumerable:!0,configurable:!0,get:()=>Xe.value,set:Ze=>Xe.value=Ze})}if(a)for(const Te in a)ud(a[Te],r,n,Te);if(l){const Te=ze(l)?l.call(n):l;Reflect.ownKeys(Te).forEach($e=>{To($e,Te[$e])})}c&&xl(c,e,"c");function Re(Te,$e){Le($e)?$e.forEach(It=>Te(It.bind(n))):$e&&Te($e.bind(n))}if(Re(Yh,f),Re(ir,p),Re(Qh,_),Re(Xh,N),Re(Gh,I),Re(Kh,M),Re(np,Ie),Re(tp,de),Re(ep,ve),Re(ar,j),Re(ri,B),Re(Zh,re),Le(ee))if(ee.length){const Te=e.exposed||(e.exposed={});ee.forEach($e=>{Object.defineProperty(Te,$e,{get:()=>n[$e],set:It=>n[$e]=It,enumerable:!0})})}else e.exposed||(e.exposed={});oe&&e.render===Mn&&(e.render=oe),ye!=null&&(e.inheritAttrs=ye),te&&(e.components=te),je&&(e.directives=je),re&&id(e)}function cp(e,t,n=Mn){Le(e)&&(e=oa(e));for(const r in e){const s=e[r];let o;ft(s)?"default"in s?o=mn(s.from||r,s.default,!0):o=mn(s.from||r):o=mn(s),qt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function xl(e,t,n){wn(Le(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function ud(e,t,n,r){let s=r.includes(".")?Qu(n,r):()=>n[r];if(Ct(e)){const o=t[e];ze(o)&&mt(s,o)}else if(ze(e))mt(s,e.bind(n));else if(ft(e))if(Le(e))e.forEach(o=>ud(o,t,n,r));else{const o=ze(e.handler)?e.handler.bind(n):t[e.handler];ze(o)&&mt(s,o,e)}}function dd(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=>Lo(l,u,i,!0)),Lo(l,t,i)),ft(t)&&o.set(t,l),l}function Lo(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Lo(e,o,n,!0),s&&s.forEach(i=>Lo(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=up[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const up={data:Ol,props:Ml,emits:Ml,methods:Ms,computed:Ms,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:Ms,directives:Ms,watch:fp,provide:Ol,inject:dp};function Ol(e,t){return t?e?function(){return $t(ze(e)?e.call(this,this):e,ze(t)?t.call(this,this):t)}:t:e}function dp(e,t){return Ms(oa(e),oa(t))}function oa(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Gt(e,t){return e?[...new Set([].concat(e,t))]:t}function Ms(e,t){return e?$t(Object.create(null),e,t):t}function Ml(e,t){return e?Le(e)&&Le(t)?[...new Set([...e,...t])]:$t(Object.create(null),Pl(e),Pl(t??{})):t}function fp(e,t){if(!e)return t;if(!t)return e;const n=$t(Object.create(null),e);for(const r in t)n[r]=Gt(e[r],t[r]);return n}function fd(){return{app:null,config:{isNativeTag:wu,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 hp=0;function pp(e,t){return function(r,s=null){ze(r)||(r=$t({},r)),s!=null&&!ft(s)&&(s=null);const o=fd(),i=new WeakSet,a=[];let l=!1;const u=o.app={_uid:hp++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:Wp,get config(){return o.config},set config(c){},use(c,...f){return i.has(c)||(c&&ze(c.install)?(i.add(c),c.install(u,...f)):ze(c)&&(i.add(c),c(u,...f))),u},mixin(c){return o.mixins.includes(c)||o.mixins.push(c),u},component(c,f){return f?(o.components[c]=f,u):o.components[c]},directive(c,f){return f?(o.directives[c]=f,u):o.directives[c]},mount(c,f,p){if(!l){const _=u._ceVNode||Ce(r,s);return _.appContext=o,p===!0?p="svg":p===!1&&(p=void 0),e(_,c,p),l=!0,u._container=c,c.__vue_app__=u,ii(_.component)}},onUnmount(c){a.push(c)},unmount(){l&&(wn(a,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(c,f){return o.provides[c]=f,u},runWithContext(c){const f=ls;ls=u;try{return c()}finally{ls=f}}};return u}}let ls=null;const mp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Qt(t)}Modifiers`]||e[`${Tr(t)}Modifiers`];function gp(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||bt;let s=n;const o=t.startsWith("update:"),i=o&&mp(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>Ct(c)?c.trim():c)),i.number&&(s=n.map(Oa)));let a,l=r[a=mi(t)]||r[a=mi(Qt(t))];!l&&o&&(l=r[a=mi(Tr(t))]),l&&wn(l,e,6,s);const u=r[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,wn(u,e,6,s)}}const vp=new WeakMap;function hd(e,t,n=!1){const r=n?vp:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!ze(e)){const l=u=>{const c=hd(u,t,!0);c&&(a=!0,$t(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(ft(e)&&r.set(e,null),null):(Le(o)?o.forEach(l=>i[l]=null):$t(i,o),ft(e)&&r.set(e,i),i)}function si(e,t){return!e||!Ko(t)?!1:(t=t.slice(2).replace(/Once$/,""),dt(e,t[0].toLowerCase()+t.slice(1))||dt(e,Tr(t))||dt(e,t))}function Nl(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:u,renderCache:c,props:f,data:p,setupState:_,ctx:N,inheritAttrs:I}=e,M=No(e);let Y,j;try{if(n.shapeFlag&4){const B=s||r,oe=B;Y=An(u.call(oe,B,c,f,_,p,N)),j=a}else{const B=t;Y=An(B.length>1?B(f,{attrs:a,slots:i,emit:l}):B(f,null)),j=t.props?a:yp(a)}}catch(B){Us.length=0,ei(B,e,1),Y=Ce(Wt)}let q=Y;if(j&&I!==!1){const B=Object.keys(j),{shapeFlag:oe}=q;B.length&&oe&7&&(o&&B.some(Ra)&&(j=wp(j,o)),q=kr(q,j,!1,!0))}return n.dirs&&(q=kr(q,null,!1,!0),q.dirs=q.dirs?q.dirs.concat(n.dirs):n.dirs),n.transition&&qs(q,n.transition),Y=q,No(M),Y}const yp=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ko(n))&&((t||(t={}))[n]=e[n]);return t},wp=(e,t)=>{const n={};for(const r in e)(!Ra(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function bp(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?$l(r,i,u):!!i;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const p=c[f];if(pd(i,r,p)&&!si(u,p))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?$l(r,i,u):!0:!!i;return!1}function $l(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let s=0;s<r.length;s++){const o=r[s];if(pd(t,e,o)&&!si(n,o))return!0}return!1}function pd(e,t,n){const r=e[n],s=t[n];return n==="style"&&ft(r)&&ft(s)?!Ma(r,s):r!==s}function _p({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 md={},gd=()=>Object.create(md),vd=e=>Object.getPrototypeOf(e)===md;function kp(e,t,n,r=!1){const s={},o=gd();e.propsDefaults=Object.create(null),yd(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Hu(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Tp(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=ct(s),[l]=e.propsOptions;let u=!1;if((r||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let p=c[f];if(si(e.emitsOptions,p))continue;const _=t[p];if(l)if(dt(o,p))_!==o[p]&&(o[p]=_,u=!0);else{const N=Qt(p);s[N]=ia(l,a,N,_,e,!1)}else _!==o[p]&&(o[p]=_,u=!0)}}}else{yd(e,t,s,o)&&(u=!0);let c;for(const f in a)(!t||!dt(t,f)&&((c=Tr(f))===f||!dt(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(s[f]=ia(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!dt(t,f))&&(delete o[f],u=!0)}u&&Gn(e.attrs,"set","")}function yd(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Ns(l))continue;const u=t[l];let c;s&&dt(s,c=Qt(l))?!o||!o.includes(c)?n[c]=u:(a||(a={}))[c]=u:si(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(o){const l=ct(n),u=a||bt;for(let c=0;c<o.length;c++){const f=o[c];n[f]=ia(s,l,f,u[f],e,!dt(u,f))}}return i}function ia(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=dt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&ze(l)){const{propsDefaults:u}=s;if(n in u)r=u[n];else{const c=so(s);r=u[n]=l.call(null,t),c()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===Tr(n))&&(r=!0))}return r}const Ip=new WeakMap;function wd(e,t,n=!1){const r=n?Ip:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!ze(e)){const c=f=>{l=!0;const[p,_]=wd(f,t,!0);$t(i,p),_&&a.push(..._)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return ft(e)&&r.set(e,ss),ss;if(Le(o))for(let c=0;c<o.length;c++){const f=Qt(o[c]);Dl(f)&&(i[f]=bt)}else if(o)for(const c in o){const f=Qt(c);if(Dl(f)){const p=o[c],_=i[f]=Le(p)||ze(p)?{type:p}:$t({},p),N=_.type;let I=!1,M=!0;if(Le(N))for(let Y=0;Y<N.length;++Y){const j=N[Y],q=ze(j)&&j.name;if(q==="Boolean"){I=!0;break}else q==="String"&&(M=!1)}else I=ze(N)&&N.name==="Boolean";_[0]=I,_[1]=M,(I||dt(_,"default"))&&a.push(f)}}const u=[i,a];return ft(e)&&r.set(e,u),u}function Dl(e){return e[0]!=="$"&&!Ns(e)}const Ha=e=>e==="_"||e==="_ctx"||e==="$stable",Va=e=>Le(e)?e.map(An):[An(e)],Sp=(e,t,n)=>{if(t._n)return t;const r=pt((...s)=>Va(t(...s)),n);return r._c=!1,r},bd=(e,t,n)=>{const r=e._ctx;for(const s in e){if(Ha(s))continue;const o=e[s];if(ze(o))t[s]=Sp(s,o,r);else if(o!=null){const i=Va(o);t[s]=()=>i}}},_d=(e,t)=>{const n=Va(t);e.slots.default=()=>n},kd=(e,t,n)=>{for(const r in t)(n||!Ha(r))&&(e[r]=t[r])},Ep=(e,t,n)=>{const r=e.slots=gd();if(e.vnode.shapeFlag&32){const s=t._;s?(kd(r,t,n),n&&Iu(r,"_",s,!0)):bd(t,r)}else t&&_d(e,t)},Cp=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=bt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:kd(s,t,n):(o=!t.$stable,bd(t,s)),i=t}else t&&(_d(e,t),i={default:1});if(o)for(const a in s)!Ha(a)&&i[a]==null&&delete s[a]},Ht=Op;function Ap(e){return Rp(e)}function Rp(e,t){const n=Qo();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:p,setScopeId:_=Mn,insertStaticContent:N}=e,I=(g,v,A,H=null,F=null,P=null,$=void 0,L=null,G=!!v.dynamicChildren)=>{if(g===v)return;g&&!jr(g,v)&&(H=W(g),Ze(g,F,P,!0),g=null),v.patchFlag===-2&&(G=!1,v.dynamicChildren=null);const{type:V,ref:be,shapeFlag:ae}=v;switch(V){case oi:M(g,v,A,H);break;case Wt:Y(g,v,A,H);break;case Ti:g==null&&j(v,A,H,$);break;case He:te(g,v,A,H,F,P,$,L,G);break;default:ae&1?oe(g,v,A,H,F,P,$,L,G):ae&6?je(g,v,A,H,F,P,$,L,G):(ae&64||ae&128)&&V.process(g,v,A,H,F,P,$,L,G,fe)}be!=null&&F?js(be,g&&g.ref,P,v||g,!v):be==null&&g&&g.ref!=null&&js(g.ref,null,P,g,!0)},M=(g,v,A,H)=>{if(g==null)r(v.el=a(v.children),A,H);else{const F=v.el=g.el;v.children!==g.children&&u(F,v.children)}},Y=(g,v,A,H)=>{g==null?r(v.el=l(v.children||""),A,H):v.el=g.el},j=(g,v,A,H)=>{[g.el,g.anchor]=N(g.children,v,A,H,g.el,g.anchor)},q=({el:g,anchor:v},A,H)=>{let F;for(;g&&g!==v;)F=p(g),r(g,A,H),g=F;r(v,A,H)},B=({el:g,anchor:v})=>{let A;for(;g&&g!==v;)A=p(g),s(g),g=A;s(v)},oe=(g,v,A,H,F,P,$,L,G)=>{if(v.type==="svg"?$="svg":v.type==="math"&&($="mathml"),g==null)de(v,A,H,F,P,$,L,G);else{const V=g.el&&g.el._isVueCE?g.el:null;try{V&&V._beginPatch(),re(g,v,F,P,$,L,G)}finally{V&&V._endPatch()}}},de=(g,v,A,H,F,P,$,L)=>{let G,V;const{props:be,shapeFlag:ae,transition:he,dirs:Se}=g;if(G=g.el=i(g.type,P,be&&be.is,be),ae&8?c(G,g.children):ae&16&&Ie(g.children,G,null,H,F,ki(g,P),$,L),Se&&xr(g,null,H,"created"),ve(G,g,g.scopeId,$,H),be){for(const Ke in be)Ke!=="value"&&!Ns(Ke)&&o(G,Ke,null,be[Ke],P,H);"value"in be&&o(G,"value",null,be.value,P),(V=be.onVnodeBeforeMount)&&In(V,H,g)}Se&&xr(g,null,H,"beforeMount");const Oe=Pp(F,he);Oe&&he.beforeEnter(G),r(G,v,A),((V=be&&be.onVnodeMounted)||Oe||Se)&&Ht(()=>{V&&In(V,H,g),Oe&&he.enter(G),Se&&xr(g,null,H,"mounted")},F)},ve=(g,v,A,H,F)=>{if(A&&_(g,A),H)for(let P=0;P<H.length;P++)_(g,H[P]);if(F){let P=F.subTree;if(v===P||Sd(P.type)&&(P.ssContent===v||P.ssFallback===v)){const $=F.vnode;ve(g,$,$.scopeId,$.slotScopeIds,F.parent)}}},Ie=(g,v,A,H,F,P,$,L,G=0)=>{for(let V=G;V<g.length;V++){const be=g[V]=L?qn(g[V]):An(g[V]);I(null,be,v,A,H,F,P,$,L)}},re=(g,v,A,H,F,P,$)=>{const L=v.el=g.el;let{patchFlag:G,dynamicChildren:V,dirs:be}=v;G|=g.patchFlag&16;const ae=g.props||bt,he=v.props||bt;let Se;if(A&&Or(A,!1),(Se=he.onVnodeBeforeUpdate)&&In(Se,A,v,g),be&&xr(v,g,A,"beforeUpdate"),A&&Or(A,!0),(ae.innerHTML&&he.innerHTML==null||ae.textContent&&he.textContent==null)&&c(L,""),V?ee(g.dynamicChildren,V,L,A,H,ki(v,F),P):$||$e(g,v,L,null,A,H,ki(v,F),P,!1),G>0){if(G&16)ye(L,ae,he,A,F);else if(G&2&&ae.class!==he.class&&o(L,"class",null,he.class,F),G&4&&o(L,"style",ae.style,he.style,F),G&8){const Oe=v.dynamicProps;for(let Ke=0;Ke<Oe.length;Ke++){const xe=Oe[Ke],Ve=ae[xe],_t=he[xe];(_t!==Ve||xe==="value")&&o(L,xe,Ve,_t,F,A)}}G&1&&g.children!==v.children&&c(L,v.children)}else!$&&V==null&&ye(L,ae,he,A,F);((Se=he.onVnodeUpdated)||be)&&Ht(()=>{Se&&In(Se,A,v,g),be&&xr(v,g,A,"updated")},H)},ee=(g,v,A,H,F,P,$)=>{for(let L=0;L<v.length;L++){const G=g[L],V=v[L],be=G.el&&(G.type===He||!jr(G,V)||G.shapeFlag&198)?f(G.el):A;I(G,V,be,null,H,F,P,$,!0)}},ye=(g,v,A,H,F)=>{if(v!==A){if(v!==bt)for(const P in v)!Ns(P)&&!(P in A)&&o(g,P,v[P],null,F,H);for(const P in A){if(Ns(P))continue;const $=A[P],L=v[P];$!==L&&P!=="value"&&o(g,P,L,$,F,H)}"value"in A&&o(g,"value",v.value,A.value,F)}},te=(g,v,A,H,F,P,$,L,G)=>{const V=v.el=g?g.el:a(""),be=v.anchor=g?g.anchor:a("");let{patchFlag:ae,dynamicChildren:he,slotScopeIds:Se}=v;Se&&(L=L?L.concat(Se):Se),g==null?(r(V,A,H),r(be,A,H),Ie(v.children||[],A,be,F,P,$,L,G)):ae>0&&ae&64&&he&&g.dynamicChildren&&g.dynamicChildren.length===he.length?(ee(g.dynamicChildren,he,A,F,P,$,L),(v.key!=null||F&&v===F.subTree)&&Wa(g,v,!0)):$e(g,v,A,be,F,P,$,L,G)},je=(g,v,A,H,F,P,$,L,G)=>{v.slotScopeIds=L,g==null?v.shapeFlag&512?F.ctx.activate(v,A,H,$,G):Be(v,A,H,F,P,$,G):Qe(g,v,G)},Be=(g,v,A,H,F,P,$)=>{const L=g.component=jp(g,H,F);if(ti(g)&&(L.ctx.renderer=fe),Bp(L,!1,$),L.asyncDep){if(F&&F.registerDep(L,Re,$),!g.el){const G=L.subTree=Ce(Wt);Y(null,G,v,A),g.placeholder=G.el}}else Re(L,g,v,A,F,P,$)},Qe=(g,v,A)=>{const H=v.component=g.component;if(bp(g,v,A))if(H.asyncDep&&!H.asyncResolved){Te(H,v,A);return}else H.next=v,H.update();else v.el=g.el,H.vnode=v},Re=(g,v,A,H,F,P,$)=>{const L=()=>{if(g.isMounted){let{next:ae,bu:he,u:Se,parent:Oe,vnode:Ke}=g;{const K=Td(g);if(K){ae&&(ae.el=Ke.el,Te(g,ae,$)),K.asyncDep.then(()=>{Ht(()=>{g.isUnmounted||V()},F)});return}}let xe=ae,Ve;Or(g,!1),ae?(ae.el=Ke.el,Te(g,ae,$)):ae=Ke,he&&ko(he),(Ve=ae.props&&ae.props.onVnodeBeforeUpdate)&&In(Ve,Oe,ae,Ke),Or(g,!0);const _t=Nl(g),U=g.subTree;g.subTree=_t,I(U,_t,f(U.el),W(U),g,F,P),ae.el=_t.el,xe===null&&_p(g,_t.el),Se&&Ht(Se,F),(Ve=ae.props&&ae.props.onVnodeUpdated)&&Ht(()=>In(Ve,Oe,ae,Ke),F)}else{let ae;const{el:he,props:Se}=v,{bm:Oe,m:Ke,parent:xe,root:Ve,type:_t}=g,U=as(v);Or(g,!1),Oe&&ko(Oe),!U&&(ae=Se&&Se.onVnodeBeforeMount)&&In(ae,xe,v),Or(g,!0);{Ve.ce&&Ve.ce._hasShadowRoot()&&Ve.ce._injectChildStyle(_t,g.parent?g.parent.type:void 0);const K=g.subTree=Nl(g);I(null,K,A,H,g,F,P),v.el=K.el}if(Ke&&Ht(Ke,F),!U&&(ae=Se&&Se.onVnodeMounted)){const K=v;Ht(()=>In(ae,xe,K),F)}(v.shapeFlag&256||xe&&as(xe.vnode)&&xe.vnode.shapeFlag&256)&&g.a&&Ht(g.a,F),g.isMounted=!0,v=A=H=null}};g.scope.on();const G=g.effect=new Au(L);g.scope.off();const V=g.update=G.run.bind(G),be=g.job=G.runIfDirty.bind(G);be.i=g,be.id=g.uid,G.scheduler=()=>Fa(be),Or(g,!0),V()},Te=(g,v,A)=>{v.component=g;const H=g.vnode.props;g.vnode=v,g.next=null,Tp(g,v.props,H,A),Cp(g,v.children,A),Xn(),kl(g),Zn()},$e=(g,v,A,H,F,P,$,L,G=!1)=>{const V=g&&g.children,be=g?g.shapeFlag:0,ae=v.children,{patchFlag:he,shapeFlag:Se}=v;if(he>0){if(he&128){nt(V,ae,A,H,F,P,$,L,G);return}else if(he&256){It(V,ae,A,H,F,P,$,L,G);return}}Se&8?(be&16&&et(V,F,P),ae!==V&&c(A,ae)):be&16?Se&16?nt(V,ae,A,H,F,P,$,L,G):et(V,F,P,!0):(be&8&&c(A,""),Se&16&&Ie(ae,A,H,F,P,$,L,G))},It=(g,v,A,H,F,P,$,L,G)=>{g=g||ss,v=v||ss;const V=g.length,be=v.length,ae=Math.min(V,be);let he;for(he=0;he<ae;he++){const Se=v[he]=G?qn(v[he]):An(v[he]);I(g[he],Se,A,null,F,P,$,L,G)}V>be?et(g,F,P,!0,!1,ae):Ie(v,A,H,F,P,$,L,G,ae)},nt=(g,v,A,H,F,P,$,L,G)=>{let V=0;const be=v.length;let ae=g.length-1,he=be-1;for(;V<=ae&&V<=he;){const Se=g[V],Oe=v[V]=G?qn(v[V]):An(v[V]);if(jr(Se,Oe))I(Se,Oe,A,null,F,P,$,L,G);else break;V++}for(;V<=ae&&V<=he;){const Se=g[ae],Oe=v[he]=G?qn(v[he]):An(v[he]);if(jr(Se,Oe))I(Se,Oe,A,null,F,P,$,L,G);else break;ae--,he--}if(V>ae){if(V<=he){const Se=he+1,Oe=Se<be?v[Se].el:H;for(;V<=he;)I(null,v[V]=G?qn(v[V]):An(v[V]),A,Oe,F,P,$,L,G),V++}}else if(V>he)for(;V<=ae;)Ze(g[V],F,P,!0),V++;else{const Se=V,Oe=V,Ke=new Map;for(V=Oe;V<=he;V++){const it=v[V]=G?qn(v[V]):An(v[V]);it.key!=null&&Ke.set(it.key,V)}let xe,Ve=0;const _t=he-Oe+1;let U=!1,K=0;const ne=new Array(_t);for(V=0;V<_t;V++)ne[V]=0;for(V=Se;V<=ae;V++){const it=g[V];if(Ve>=_t){Ze(it,F,P,!0);continue}let kt;if(it.key!=null)kt=Ke.get(it.key);else for(xe=Oe;xe<=he;xe++)if(ne[xe-Oe]===0&&jr(it,v[xe])){kt=xe;break}kt===void 0?Ze(it,F,P,!0):(ne[kt-Oe]=V+1,kt>=K?K=kt:U=!0,I(it,v[kt],A,null,F,P,$,L,G),Ve++)}const Je=U?xp(ne):ss;for(xe=Je.length-1,V=_t-1;V>=0;V--){const it=Oe+V,kt=v[it],Pt=v[it+1],ln=it+1<be?Pt.el||Id(Pt):H;ne[V]===0?I(null,kt,A,ln,F,P,$,L,G):U&&(xe<0||V!==Je[xe]?Xe(kt,A,ln,2):xe--)}}},Xe=(g,v,A,H,F=null)=>{const{el:P,type:$,transition:L,children:G,shapeFlag:V}=g;if(V&6){Xe(g.component.subTree,v,A,H);return}if(V&128){g.suspense.move(v,A,H);return}if(V&64){$.move(g,v,A,fe);return}if($===He){r(P,v,A);for(let ae=0;ae<G.length;ae++)Xe(G[ae],v,A,H);r(g.anchor,v,A);return}if($===Ti){q(g,v,A);return}if(H!==2&&V&1&&L)if(H===0)L.beforeEnter(P),r(P,v,A),Ht(()=>L.enter(P),F);else{const{leave:ae,delayLeave:he,afterLeave:Se}=L,Oe=()=>{g.ctx.isUnmounted?s(P):r(P,v,A)},Ke=()=>{P._isLeaving&&P[En](!0),ae(P,()=>{Oe(),Se&&Se()})};he?he(P,Oe,Ke):Ke()}else r(P,v,A)},Ze=(g,v,A,H=!1,F=!1)=>{const{type:P,props:$,ref:L,children:G,dynamicChildren:V,shapeFlag:be,patchFlag:ae,dirs:he,cacheIndex:Se}=g;if(ae===-2&&(F=!1),L!=null&&(Xn(),js(L,null,A,g,!0),Zn()),Se!=null&&(v.renderCache[Se]=void 0),be&256){v.ctx.deactivate(g);return}const Oe=be&1&&he,Ke=!as(g);let xe;if(Ke&&(xe=$&&$.onVnodeBeforeUnmount)&&In(xe,v,g),be&6)Ge(g.component,A,H);else{if(be&128){g.suspense.unmount(A,H);return}Oe&&xr(g,null,v,"beforeUnmount"),be&64?g.type.remove(g,v,A,fe,H):V&&!V.hasOnce&&(P!==He||ae>0&&ae&64)?et(V,v,A,!1,!0):(P===He&&ae&384||!F&&be&16)&&et(G,v,A),H&&ht(g)}(Ke&&(xe=$&&$.onVnodeUnmounted)||Oe)&&Ht(()=>{xe&&In(xe,v,g),Oe&&xr(g,null,v,"unmounted")},A)},ht=g=>{const{type:v,el:A,anchor:H,transition:F}=g;if(v===He){Rt(A,H);return}if(v===Ti){B(g);return}const P=()=>{s(A),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(g.shapeFlag&1&&F&&!F.persisted){const{leave:$,delayLeave:L}=F,G=()=>$(A,P);L?L(g.el,P,G):G()}else P()},Rt=(g,v)=>{let A;for(;g!==v;)A=p(g),s(g),g=A;s(v)},Ge=(g,v,A)=>{const{bum:H,scope:F,job:P,subTree:$,um:L,m:G,a:V}=g;Ll(G),Ll(V),H&&ko(H),F.stop(),P&&(P.flags|=8,Ze($,g,v,A)),L&&Ht(L,v),Ht(()=>{g.isUnmounted=!0},v)},et=(g,v,A,H=!1,F=!1,P=0)=>{for(let $=P;$<g.length;$++)Ze(g[$],v,A,H,F)},W=g=>{if(g.shapeFlag&6)return W(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const v=p(g.anchor||g.el),A=v&&v[Xu];return A?p(A):v};let me=!1;const ie=(g,v,A)=>{let H;g==null?v._vnode&&(Ze(v._vnode,null,null,!0),H=v._vnode.component):I(v._vnode||null,g,v,null,null,null,A),v._vnode=g,me||(me=!0,kl(H),Gu(),me=!1)},fe={p:I,um:Ze,m:Xe,r:ht,mt:Be,mc:Ie,pc:$e,pbc:ee,n:W,o:e};return{render:ie,hydrate:void 0,createApp:pp(ie)}}function ki({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 Or({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Pp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Wa(e,t,n=!1){const r=e.children,s=t.children;if(Le(r)&&Le(s))for(let o=0;o<r.length;o++){const i=r[o];let a=s[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[o]=qn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&Wa(i,a)),a.type===oi&&(a.patchFlag===-1&&(a=s[o]=qn(a)),a.el=i.el),a.type===Wt&&!a.el&&(a.el=i.el)}}function xp(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 Td(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Td(t)}function Ll(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Id(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Id(t.subTree):null}const Sd=e=>e.__isSuspense;function Op(e,t){t&&t.pendingBranch?Le(e)?t.effects.push(...e):t.effects.push(e):Bh(e)}const He=Symbol.for("v-fgt"),oi=Symbol.for("v-txt"),Wt=Symbol.for("v-cmt"),Ti=Symbol.for("v-stc"),Us=[];let an=null;function w(e=!1){Us.push(an=e?null:[])}function Mp(){Us.pop(),an=Us[Us.length-1]||null}let Gs=1;function jo(e,t=!1){Gs+=e,e<0&&an&&t&&(an.hasOnce=!0)}function Ed(e){return e.dynamicChildren=Gs>0?an||ss:null,Mp(),Gs>0&&an&&an.push(e),e}function T(e,t,n,r,s,o){return Ed(m(e,t,n,r,s,o,!0))}function yt(e,t,n,r,s){return Ed(Ce(e,t,n,r,s,!0))}function Ks(e){return e?e.__v_isVNode===!0:!1}function jr(e,t){return e.type===t.type&&e.key===t.key}const Cd=({key:e})=>e??null,So=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ct(e)||qt(e)||ze(e)?{i:Ut,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,s=null,o=e===He?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Cd(t),ref:t&&So(t),scopeId:Ju,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Ut};return a?(za(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=Ct(n)?8:16),Gs>0&&!i&&an&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&an.push(l),l}const Ce=Np;function Np(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===ld)&&(e=Wt),Ks(e)){const a=kr(e,t,!0);return n&&za(a,n),Gs>0&&!o&&an&&(a.shapeFlag&6?an[an.indexOf(e)]=a:an.push(a)),a.patchFlag=-2,a}if(Vp(e)&&(e=e.__vccOpts),t){t=$p(t);let{class:a,style:l}=t;a&&!Ct(a)&&(t.class=gt(a)),ft(l)&&(Ua(l)&&!Le(l)&&(l=$t({},l)),t.style=zr(l))}const i=Ct(e)?1:Sd(e)?128:Zu(e)?64:ft(e)?4:ze(e)?2:0;return m(e,t,n,r,s,i,o,!0)}function $p(e){return e?Ua(e)||vd(e)?$t({},e):e:null}function kr(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,u=t?Ad(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Cd(u),ref:t&&t.ref?n&&o?Le(o)?o.concat(So(t)):[o,So(t)]:So(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==He?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&kr(e.ssContent),ssFallback:e.ssFallback&&kr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&qs(c,l.clone(c)),c}function aa(e=" ",t=0){return Ce(oi,null,e,t)}function se(e="",t=!1){return t?(w(),yt(Wt,null,e)):Ce(Wt,null,e)}function An(e){return e==null||typeof e=="boolean"?Ce(Wt):Le(e)?Ce(He,null,e.slice()):Ks(e)?qn(e):Ce(oi,null,String(e))}function qn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:kr(e)}function za(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Le(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),za(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!vd(t)?t._ctx=Ut:s===3&&Ut&&(Ut.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ze(t)?(t={default:t,_ctx:Ut},n=32):(t=String(t),r&64?(n=16,t=[aa(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ad(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const s in r)if(s==="class")t.class!==r.class&&(t.class=gt([t.class,r.class]));else if(s==="style")t.style=zr([t.style,r.style]);else if(Ko(s)){const o=t[s],i=r[s];i&&o!==i&&!(Le(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function In(e,t,n,r=null){wn(e,t,7,[n,r])}const Dp=fd();let Lp=0;function jp(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Dp,o={uid:Lp++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new ch(!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:wd(r,s),emitsOptions:hd(r,s),emit:null,emitted:null,propsDefaults:bt,inheritAttrs:r.inheritAttrs,ctx:bt,data:bt,props:bt,attrs:bt,slots:bt,refs:bt,setupState:bt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=gp.bind(null,o),e.ce&&e.ce(o),o}let zt=null;const qa=()=>zt||Ut;let Bo,la;{const e=Qo(),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)}};Bo=t("__VUE_INSTANCE_SETTERS__",n=>zt=n),la=t("__VUE_SSR_SETTERS__",n=>Js=n)}const so=e=>{const t=zt;return Bo(e),e.scope.on(),()=>{e.scope.off(),Bo(t)}},jl=()=>{zt&&zt.scope.off(),Bo(null)};function Rd(e){return e.vnode.shapeFlag&4}let Js=!1;function Bp(e,t=!1,n=!1){t&&la(t);const{props:r,children:s}=e.vnode,o=Rd(e);kp(e,r,o,t),Ep(e,s,n||t);const i=o?Up(e,t):void 0;return t&&la(!1),i}function Up(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,op);const{setup:r}=n;if(r){Xn();const s=e.setupContext=r.length>1?xd(e):null,o=so(e),i=ro(r,e,0,[e.props,s]),a=_u(i);if(Zn(),o(),(a||e.sp)&&!as(e)&&id(e),a){if(i.then(jl,jl),t)return i.then(l=>{Bl(e,l)}).catch(l=>{ei(l,e,0)});e.asyncDep=i}else Bl(e,i)}else Pd(e)}function Bl(e,t,n){ze(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ft(t)&&(e.setupState=Wu(t)),Pd(e)}function Pd(e,t,n){const r=e.type;e.render||(e.render=r.render||Mn);{const s=so(e);Xn();try{lp(e)}finally{Zn(),s()}}}const Fp={get(e,t){return Vt(e,"get",""),e[t]}};function xd(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Fp),slots:e.slots,emit:e.emit,expose:t}}function ii(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Wu(Rh(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Bs)return Bs[n](e)},has(t,n){return n in t||n in Bs}})):e.proxy}function Hp(e,t=!0){return ze(e)?e.displayName||e.name:e.name||t&&e.__name}function Vp(e){return ze(e)&&"__vccOpts"in e}const pe=(e,t)=>Nh(e,t,Js);function Ga(e,t,n){try{jo(-1);const r=arguments.length;return r===2?ft(t)&&!Le(t)?Ks(t)?Ce(e,null,[t]):Ce(e,t):Ce(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ks(n)&&(n=[n]),Ce(e,t,n))}finally{jo(1)}}const Wp="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 ca;const Ul=typeof window<"u"&&window.trustedTypes;if(Ul)try{ca=Ul.createPolicy("vue",{createHTML:e=>e})}catch{}const Od=ca?e=>ca.createHTML(e):e=>e,zp="http://www.w3.org/2000/svg",qp="http://www.w3.org/1998/Math/MathML",zn=typeof document<"u"?document:null,Fl=zn&&zn.createElement("template"),Gp={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?zn.createElementNS(zp,e):t==="mathml"?zn.createElementNS(qp,e):n?zn.createElement(e,{is:n}):zn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>zn.createTextNode(e),createComment:e=>zn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>zn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,o){const i=n?n.previousSibling:t.lastChild;if(s&&(s===o||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{Fl.innerHTML=Od(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Fl.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ur="transition",Rs="animation",Ys=Symbol("_vtc"),Md={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},Kp=$t({},td,Md),Jp=e=>(e.displayName="Transition",e.props=Kp,e),Nd=Jp((e,{slots:t})=>Ga(qh,Yp(e),t)),Mr=(e,t=[])=>{Le(e)?e.forEach(n=>n(...t)):e&&e(...t)},Hl=e=>e?Le(e)?e.some(t=>t.length>1):e.length>1:!1;function Yp(e){const t={};for(const te in e)te in Md||(t[te]=e[te]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:u=i,appearToClass:c=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:_=`${n}-leave-to`}=e,N=Qp(s),I=N&&N[0],M=N&&N[1],{onBeforeEnter:Y,onEnter:j,onEnterCancelled:q,onLeave:B,onLeaveCancelled:oe,onBeforeAppear:de=Y,onAppear:ve=j,onAppearCancelled:Ie=q}=t,re=(te,je,Be,Qe)=>{te._enterCancelled=Qe,Nr(te,je?c:a),Nr(te,je?u:i),Be&&Be()},ee=(te,je)=>{te._isLeaving=!1,Nr(te,f),Nr(te,_),Nr(te,p),je&&je()},ye=te=>(je,Be)=>{const Qe=te?ve:j,Re=()=>re(je,te,Be);Mr(Qe,[je,Re]),Vl(()=>{Nr(je,te?l:o),Vn(je,te?c:a),Hl(Qe)||Wl(je,r,I,Re)})};return $t(t,{onBeforeEnter(te){Mr(Y,[te]),Vn(te,o),Vn(te,i)},onBeforeAppear(te){Mr(de,[te]),Vn(te,l),Vn(te,u)},onEnter:ye(!1),onAppear:ye(!0),onLeave(te,je){te._isLeaving=!0;const Be=()=>ee(te,je);Vn(te,f),te._enterCancelled?(Vn(te,p),Gl(te)):(Gl(te),Vn(te,p)),Vl(()=>{te._isLeaving&&(Nr(te,f),Vn(te,_),Hl(B)||Wl(te,r,M,Be))}),Mr(B,[te,Be])},onEnterCancelled(te){re(te,!1,void 0,!0),Mr(q,[te])},onAppearCancelled(te){re(te,!0,void 0,!0),Mr(Ie,[te])},onLeaveCancelled(te){ee(te),Mr(oe,[te])}})}function Qp(e){if(e==null)return null;if(ft(e))return[Ii(e.enter),Ii(e.leave)];{const t=Ii(e);return[t,t]}}function Ii(e){return th(e)}function Vn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Ys]||(e[Ys]=new Set)).add(t)}function Nr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Ys];n&&(n.delete(t),n.size||(e[Ys]=void 0))}function Vl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Xp=0;function Wl(e,t,n,r){const s=e._endId=++Xp,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=Zp(e,t);if(!i)return r();const u=i+"end";let c=0;const f=()=>{e.removeEventListener(u,p),o()},p=_=>{_.target===e&&++c>=l&&f()};setTimeout(()=>{c<l&&f()},a+1),e.addEventListener(u,p)}function Zp(e,t){const n=window.getComputedStyle(e),r=N=>(n[N]||"").split(", "),s=r(`${ur}Delay`),o=r(`${ur}Duration`),i=zl(s,o),a=r(`${Rs}Delay`),l=r(`${Rs}Duration`),u=zl(a,l);let c=null,f=0,p=0;t===ur?i>0&&(c=ur,f=i,p=o.length):t===Rs?u>0&&(c=Rs,f=u,p=l.length):(f=Math.max(i,u),c=f>0?i>u?ur:Rs:null,p=c?c===ur?o.length:l.length:0);const _=c===ur&&/\b(?:transform|all)(?:,|$)/.test(r(`${ur}Property`).toString());return{type:c,timeout:f,propCount:p,hasTransform:_}}function zl(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>ql(n)+ql(e[r])))}function ql(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Gl(e){return(e?e.ownerDocument:document).body.offsetHeight}function em(e,t,n){const r=e[Ys];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Kl=Symbol("_vod"),tm=Symbol("_vsh"),nm=Symbol(""),rm=/(?:^|;)\s*display\s*:/;function sm(e,t,n){const r=e.style,s=Ct(n);let o=!1;if(n&&!s){if(t)if(Ct(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Eo(r,a,"")}else for(const i in t)n[i]==null&&Eo(r,i,"");for(const i in n)i==="display"&&(o=!0),Eo(r,i,n[i])}else if(s){if(t!==n){const i=r[nm];i&&(n+=";"+i),r.cssText=n,o=rm.test(n)}}else t&&e.removeAttribute("style");Kl in e&&(e[Kl]=o?r.display:"",e[tm]&&(r.display="none"))}const Jl=/\s*!important$/;function Eo(e,t,n){if(Le(n))n.forEach(r=>Eo(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=om(e,t);Jl.test(n)?e.setProperty(Tr(r),n.replace(Jl,""),"important"):e[r]=n}}const Yl=["Webkit","Moz","ms"],Si={};function om(e,t){const n=Si[t];if(n)return n;let r=Qt(t);if(r!=="filter"&&r in e)return Si[t]=r;r=Yo(r);for(let s=0;s<Yl.length;s++){const o=Yl[s]+r;if(o in e)return Si[t]=o}return t}const Ql="http://www.w3.org/1999/xlink";function Xl(e,t,n,r,s,o=ah(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Ql,t.slice(6,t.length)):e.setAttributeNS(Ql,t,n):n==null||o&&!Su(n)?e.removeAttribute(t):e.setAttribute(t,o?"":vn(n)?String(n):n)}function Zl(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Od(n):n);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const a=o==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=Su(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(s||t)}function ns(e,t,n,r){e.addEventListener(t,n,r)}function im(e,t,n,r){e.removeEventListener(t,n,r)}const ec=Symbol("_vei");function am(e,t,n,r,s=null){const o=e[ec]||(e[ec]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=lm(t);if(r){const u=o[t]=dm(r,s);ns(e,a,u,l)}else i&&(im(e,a,i,l),o[t]=void 0)}}const tc=/(?:Once|Passive|Capture)$/;function lm(e){let t;if(tc.test(e)){t={};let r;for(;r=e.match(tc);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Tr(e.slice(2)),t]}let Ei=0;const cm=Promise.resolve(),um=()=>Ei||(cm.then(()=>Ei=0),Ei=Date.now());function dm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;wn(fm(r,n.value),t,5,[r])};return n.value=e,n.attached=um(),n}function fm(e,t){if(Le(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>s=>!s._stopped&&r&&r(s))}else return t}const nc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,hm=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?em(e,r,i):t==="style"?sm(e,n,r):Ko(t)?Ra(t)||am(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):pm(e,t,r,i))?(Zl(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Xl(e,t,r,i,o,t!=="value")):e._isVueCE&&(mm(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ct(r)))?Zl(e,Qt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Xl(e,t,r,i))};function pm(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&nc(t)&&ze(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return nc(t)&&Ct(n)?!1:t in e}function mm(e,t){const n=e._def.props;if(!n)return!1;const r=Qt(t);return Array.isArray(n)?n.some(s=>Qt(s)===r):Object.keys(n).some(s=>Qt(s)===r)}const rc=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Le(t)?n=>ko(t,n):t};function gm(e){e.target.composing=!0}function sc(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ci=Symbol("_assign");function oc(e,t,n){return t&&(e=e.trim()),n&&(e=Oa(e)),e}const nr={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Ci]=rc(s);const o=r||s.props&&s.props.type==="number";ns(e,t?"change":"input",i=>{i.target.composing||e[Ci](oc(e.value,n,o))}),(n||o)&&ns(e,"change",()=>{e.value=oc(e.value,n,o)}),t||(ns(e,"compositionstart",gm),ns(e,"compositionend",sc),ns(e,"change",sc))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Ci]=rc(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Oa(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===l)||(e.value=l))}},vm=["ctrl","shift","alt","meta"],ym={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)=>vm.some(n=>e[`${n}Key`]&&!t.includes(n))},tt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i<t.length;i++){const a=ym[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},wm={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Yt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Tr(s.key);if(t.some(i=>i===o||wm[i]===o))return e(s)}))},bm=$t({patchProp:hm},Gp);let ic;function _m(){return ic||(ic=Ap(bm))}const km=((...e)=>{const t=_m().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Im(r);if(!s)return;const o=t._component;!ze(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Tm(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Tm(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Im(e){return Ct(e)?document.querySelector(e):e}/*!
18
+ * vue-router v4.6.4
19
+ * (c) 2025 Eduardo San Martin Morote
20
+ * @license MIT
21
+ */const rs=typeof document<"u";function $d(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Sm(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&$d(e.default)}const ut=Object.assign;function Ai(e,t){const n={};for(const r in t){const s=t[r];n[r]=bn(s)?s.map(e):e(s)}return n}const Fs=()=>{},bn=Array.isArray;function ac(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Dd=/#/g,Em=/&/g,Cm=/\//g,Am=/=/g,Rm=/\?/g,Ld=/\+/g,Pm=/%5B/g,xm=/%5D/g,jd=/%5E/g,Om=/%60/g,Bd=/%7B/g,Mm=/%7C/g,Ud=/%7D/g,Nm=/%20/g;function Ka(e){return e==null?"":encodeURI(""+e).replace(Mm,"|").replace(Pm,"[").replace(xm,"]")}function $m(e){return Ka(e).replace(Bd,"{").replace(Ud,"}").replace(jd,"^")}function ua(e){return Ka(e).replace(Ld,"%2B").replace(Nm,"+").replace(Dd,"%23").replace(Em,"%26").replace(Om,"`").replace(Bd,"{").replace(Ud,"}").replace(jd,"^")}function Dm(e){return ua(e).replace(Am,"%3D")}function Lm(e){return Ka(e).replace(Dd,"%23").replace(Rm,"%3F")}function jm(e){return Lm(e).replace(Cm,"%2F")}function Qs(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Bm=/\/$/,Um=e=>e.replace(Bm,"");function Ri(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=Wm(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:Qs(i)}}function Fm(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function lc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Hm(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&ps(t.matched[r],n.matched[s])&&Fd(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ps(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Fd(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Vm(e[n],t[n]))return!1;return!0}function Vm(e,t){return bn(e)?cc(e,t):bn(t)?cc(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function cc(e,t){return bn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Wm(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let o=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i).join("/")}const dr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let da=(function(e){return e.pop="pop",e.push="push",e})({}),Pi=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function zm(e){if(!e)if(rs){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Um(e)}const qm=/^[^#]+#/;function Gm(e,t){return e.replace(qm,"#")+t}function Km(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 ai=()=>({left:window.scrollX,top:window.scrollY});function Jm(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=Km(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function uc(e,t){return(history.state?history.state.position-t:-1)+e}const fa=new Map;function Ym(e,t){fa.set(e,t)}function Qm(e){const t=fa.get(e);return fa.delete(e),t}function Xm(e){return typeof e=="string"||e&&typeof e=="object"}function Hd(e){return typeof e=="string"||typeof e=="symbol"}let At=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Vd=Symbol("");At.MATCHER_NOT_FOUND+"",At.NAVIGATION_GUARD_REDIRECT+"",At.NAVIGATION_ABORTED+"",At.NAVIGATION_CANCELLED+"",At.NAVIGATION_DUPLICATED+"";function ms(e,t){return ut(new Error,{type:e,[Vd]:!0},t)}function Wn(e,t){return e instanceof Error&&Vd in e&&(t==null||!!(e.type&t))}const Zm=["params","query","hash"];function eg(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Zm)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function tg(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(Ld," "),o=s.indexOf("="),i=Qs(o<0?s:s.slice(0,o)),a=o<0?null:Qs(s.slice(o+1));if(i in t){let l=t[i];bn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function dc(e){let t="";for(let n in e){const r=e[n];if(n=Dm(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(bn(r)?r.map(s=>s&&ua(s)):[r&&ua(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function ng(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=bn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const rg=Symbol(""),fc=Symbol(""),li=Symbol(""),Ja=Symbol(""),ha=Symbol("");function Ps(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function mr(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const u=p=>{p===!1?l(ms(At.NAVIGATION_ABORTED,{from:n,to:t})):p instanceof Error?l(p):Xm(p)?l(ms(At.NAVIGATION_GUARD_REDIRECT,{from:t,to:p})):(i&&r.enterCallbacks[s]===i&&typeof p=="function"&&i.push(p),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(p=>l(p))})}function xi(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($d(l)){const u=(l.__vccOpts||l)[t];u&&o.push(mr(u,n,r,i,a,s))}else{let u=l();o.push(()=>u.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Sm(c)?c.default:c;i.mods[a]=c,i.components[a]=f;const p=(f.__vccOpts||f)[t];return p&&mr(p,n,r,i,a,s)()}))}}return o}function sg(e,t){const n=[],r=[],s=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;i<o;i++){const a=t.matched[i];a&&(e.matched.find(u=>ps(u,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(u=>ps(u,l))||s.push(l))}return[n,r,s]}/*!
22
+ * vue-router v4.6.4
23
+ * (c) 2025 Eduardo San Martin Morote
24
+ * @license MIT
25
+ */let og=()=>location.protocol+"//"+location.host;function Wd(e,t){const{pathname:n,search:r,hash:s}=t,o=e.indexOf("#");if(o>-1){let i=s.includes(e.slice(o))?e.slice(o).length:1,a=s.slice(i);return a[0]!=="/"&&(a="/"+a),lc(a,"")}return lc(n,e)+r+s}function ig(e,t,n,r){let s=[],o=[],i=null;const a=({state:p})=>{const _=Wd(e,location),N=n.value,I=t.value;let M=0;if(p){if(n.value=_,t.value=p,i&&i===N){i=null;return}M=I?p.position-I.position:0}else r(_);s.forEach(Y=>{Y(n.value,N,{delta:M,type:da.pop,direction:M?M>0?Pi.forward:Pi.back:Pi.unknown})})};function l(){i=n.value}function u(p){s.push(p);const _=()=>{const N=s.indexOf(p);N>-1&&s.splice(N,1)};return o.push(_),_}function c(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(ut({},p.state,{scroll:ai()}),"")}}function f(){for(const p of o)p();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:u,destroy:f}}function hc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ai():null}}function ag(e){const{history:t,location:n}=window,r={value:Wd(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("#"),p=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:og()+e+l;try{t[c?"replaceState":"pushState"](u,"",p),s.value=u}catch(_){console.error(_),n[c?"replace":"assign"](p)}}function i(l,u){o(l,ut({},t.state,hc(s.value.back,l,s.value.forward,!0),u,{position:s.value.position}),!0),r.value=l}function a(l,u){const c=ut({},s.value,t.state,{forward:l,scroll:ai()});o(c.current,c,!0),o(l,ut({},hc(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function lg(e){e=zm(e);const t=ag(e),n=ig(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=ut({location:"",base:e,go:r,createHref:Gm.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 cg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),lg(e)}let Ur=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Nt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Nt||{});const ug={type:Ur.Static,value:""},dg=/[a-zA-Z0-9_]/;function fg(e){if(!e)return[[]];if(e==="/")return[[ug]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${u}": ${_}`)}let n=Nt.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,u="",c="";function f(){u&&(n===Nt.Static?o.push({type:Ur.Static,value:u}):n===Nt.Param||n===Nt.ParamRegExp||n===Nt.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Ur.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function p(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Nt.ParamRegExp){r=n,n=Nt.EscapeNext;continue}switch(n){case Nt.Static:l==="/"?(u&&f(),i()):l===":"?(f(),n=Nt.Param):p();break;case Nt.EscapeNext:p(),n=r;break;case Nt.Param:l==="("?n=Nt.ParamRegExp:dg.test(l)?p():(f(),n=Nt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Nt.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=Nt.ParamRegExpEnd:c+=l;break;case Nt.ParamRegExpEnd:f(),n=Nt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Nt.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),i(),s}const pc="[^/]+?",hg={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 pg=/[.+*?^${}()[\]/\\]/g;function mg(e,t){const n=ut({},hg,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 p=u[f];let _=Kt.Segment+(n.sensitive?Kt.BonusCaseSensitive:0);if(p.type===Ur.Static)f||(s+="/"),s+=p.value.replace(pg,"\\$&"),_+=Kt.Static;else if(p.type===Ur.Param){const{value:N,repeatable:I,optional:M,regexp:Y}=p;o.push({name:N,repeatable:I,optional:M});const j=Y||pc;if(j!==pc){_+=Kt.BonusCustomRegExp;try{`${j}`}catch(B){throw new Error(`Invalid custom RegExp for param "${N}" (${j}): `+B.message)}}let q=I?`((?:${j})(?:/(?:${j}))*)`:`(${j})`;f||(q=M&&u.length<2?`(?:/${q})`:"/"+q),M&&(q+="?"),s+=q,_+=Kt.Dynamic,M&&(_+=Kt.BonusOptional),I&&(_+=Kt.BonusRepeatable),j===".*"&&(_+=Kt.BonusWildcard)}c.push(_)}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 p=1;p<c.length;p++){const _=c[p]||"",N=o[p-1];f[N.name]=_&&N.repeatable?_.split("/"):_}return f}function l(u){let c="",f=!1;for(const p of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const _ of p)if(_.type===Ur.Static)c+=_.value;else if(_.type===Ur.Param){const{value:N,repeatable:I,optional:M}=_,Y=N in u?u[N]:"";if(bn(Y)&&!I)throw new Error(`Provided param "${N}" is an array but it is not repeatable (* or + modifiers)`);const j=bn(Y)?Y.join("/"):Y;if(!j)if(M)p.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${N}"`);c+=j}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function gg(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 zd(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=gg(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(mc(r))return 1;if(mc(s))return-1}return s.length-r.length}function mc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const vg={strict:!1,end:!0,sensitive:!1};function yg(e,t,n){const r=mg(fg(e.path),n),s=ut(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function wg(e,t){const n=[],r=new Map;t=ac(vg,t);function s(f){return r.get(f)}function o(f,p,_){const N=!_,I=vc(f);I.aliasOf=_&&_.record;const M=ac(t,f),Y=[I];if("alias"in f){const B=typeof f.alias=="string"?[f.alias]:f.alias;for(const oe of B)Y.push(vc(ut({},I,{components:_?_.record.components:I.components,path:oe,aliasOf:_?_.record:I})))}let j,q;for(const B of Y){const{path:oe}=B;if(p&&oe[0]!=="/"){const de=p.record.path,ve=de[de.length-1]==="/"?"":"/";B.path=p.record.path+(oe&&ve+oe)}if(j=yg(B,p,M),_?_.alias.push(j):(q=q||j,q!==j&&q.alias.push(j),N&&f.name&&!yc(j)&&i(f.name)),qd(j)&&l(j),I.children){const de=I.children;for(let ve=0;ve<de.length;ve++)o(de[ve],j,_&&_.children[ve])}_=_||j}return q?()=>{i(q)}:Fs}function i(f){if(Hd(f)){const p=r.get(f);p&&(r.delete(f),n.splice(n.indexOf(p),1),p.children.forEach(i),p.alias.forEach(i))}else{const p=n.indexOf(f);p>-1&&(n.splice(p,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 p=kg(f,n);n.splice(p,0,f),f.record.name&&!yc(f)&&r.set(f.record.name,f)}function u(f,p){let _,N={},I,M;if("name"in f&&f.name){if(_=r.get(f.name),!_)throw ms(At.MATCHER_NOT_FOUND,{location:f});M=_.record.name,N=ut(gc(p.params,_.keys.filter(q=>!q.optional).concat(_.parent?_.parent.keys.filter(q=>q.optional):[]).map(q=>q.name)),f.params&&gc(f.params,_.keys.map(q=>q.name))),I=_.stringify(N)}else if(f.path!=null)I=f.path,_=n.find(q=>q.re.test(I)),_&&(N=_.parse(I),M=_.record.name);else{if(_=p.name?r.get(p.name):n.find(q=>q.re.test(p.path)),!_)throw ms(At.MATCHER_NOT_FOUND,{location:f,currentLocation:p});M=_.record.name,N=ut({},p.params,f.params),I=_.stringify(N)}const Y=[];let j=_;for(;j;)Y.unshift(j.record),j=j.parent;return{name:M,path:I,params:N,matched:Y,meta:_g(Y)}}e.forEach(f=>o(f));function c(){n.length=0,r.clear()}return{addRoute:o,resolve:u,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function gc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function vc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:bg(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 bg(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function yc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function _g(e){return e.reduce((t,n)=>ut(t,n.meta),{})}function kg(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;zd(e,t[o])<0?r=o:n=o+1}const s=Tg(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Tg(e){let t=e;for(;t=t.parent;)if(qd(t)&&zd(e,t)===0)return t}function qd({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function wc(e){const t=mn(li),n=mn(Ja),r=pe(()=>{const l=ue(e.to);return t.resolve(l)}),s=pe(()=>{const{matched:l}=r.value,{length:u}=l,c=l[u-1],f=n.matched;if(!c||!f.length)return-1;const p=f.findIndex(ps.bind(null,c));if(p>-1)return p;const _=bc(l[u-2]);return u>1&&bc(c)===_&&f[f.length-1].path!==_?f.findIndex(ps.bind(null,l[u-2])):p}),o=pe(()=>s.value>-1&&Ag(n.params,r.value.params)),i=pe(()=>s.value>-1&&s.value===n.matched.length-1&&Fd(n.params,r.value.params));function a(l={}){if(Cg(l)){const u=t[ue(e.replace)?"replace":"push"](ue(e.to)).catch(Fs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:pe(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Ig(e){return e.length===1?e[0]:e}const Sg=Lt({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:wc,setup(e,{slots:t}){const n=Zo(wc(e)),{options:r}=mn(li),s=pe(()=>({[_c(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[_c(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Ig(t.default(n));return e.custom?o:Ga("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Eg=Sg;function Cg(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 Ag(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!bn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function bc(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const _c=(e,t,n)=>e??t??n,Rg=Lt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=mn(ha),s=pe(()=>e.route||r.value),o=mn(fc,0),i=pe(()=>{let u=ue(o);const{matched:c}=s.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),a=pe(()=>s.value.matched[i.value]);To(fc,pe(()=>i.value+1)),To(rg,a),To(ha,s);const l=D();return mt(()=>[l.value,a.value,e.name],([u,c,f],[p,_,N])=>{c&&(c.instances[f]=u,_&&_!==c&&u&&u===p&&(c.leaveGuards.size||(c.leaveGuards=_.leaveGuards),c.updateGuards.size||(c.updateGuards=_.updateGuards))),u&&c&&(!_||!ps(c,_)||!p)&&(c.enterCallbacks[f]||[]).forEach(I=>I(u))},{flush:"post"}),()=>{const u=s.value,c=e.name,f=a.value,p=f&&f.components[c];if(!p)return kc(n.default,{Component:p,route:u});const _=f.props[c],N=_?_===!0?u.params:typeof _=="function"?_(u):_:null,M=Ga(p,ut({},N,t,{onVnodeUnmounted:Y=>{Y.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return kc(n.default,{Component:M,route:u})||M}}});function kc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Pg=Rg;function xg(e){const t=wg(e.routes,e),n=e.parseQuery||tg,r=e.stringifyQuery||dc,s=e.history,o=Ps(),i=Ps(),a=Ps(),l=Ph(dr);let u=dr;rs&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Ai.bind(null,W=>""+W),f=Ai.bind(null,jm),p=Ai.bind(null,Qs);function _(W,me){let ie,fe;return Hd(W)?(ie=t.getRecordMatcher(W),fe=me):fe=W,t.addRoute(fe,ie)}function N(W){const me=t.getRecordMatcher(W);me&&t.removeRoute(me)}function I(){return t.getRoutes().map(W=>W.record)}function M(W){return!!t.getRecordMatcher(W)}function Y(W,me){if(me=ut({},me||l.value),typeof W=="string"){const A=Ri(n,W,me.path),H=t.resolve({path:A.path},me),F=s.createHref(A.fullPath);return ut(A,H,{params:p(H.params),hash:Qs(A.hash),redirectedFrom:void 0,href:F})}let ie;if(W.path!=null)ie=ut({},W,{path:Ri(n,W.path,me.path).path});else{const A=ut({},W.params);for(const H in A)A[H]==null&&delete A[H];ie=ut({},W,{params:f(A)}),me.params=f(me.params)}const fe=t.resolve(ie,me),De=W.hash||"";fe.params=c(p(fe.params));const g=Fm(r,ut({},W,{hash:$m(De),path:fe.path})),v=s.createHref(g);return ut({fullPath:g,hash:De,query:r===dc?ng(W.query):W.query||{}},fe,{redirectedFrom:void 0,href:v})}function j(W){return typeof W=="string"?Ri(n,W,l.value.path):ut({},W)}function q(W,me){if(u!==W)return ms(At.NAVIGATION_CANCELLED,{from:me,to:W})}function B(W){return ve(W)}function oe(W){return B(ut(j(W),{replace:!0}))}function de(W,me){const ie=W.matched[W.matched.length-1];if(ie&&ie.redirect){const{redirect:fe}=ie;let De=typeof fe=="function"?fe(W,me):fe;return typeof De=="string"&&(De=De.includes("?")||De.includes("#")?De=j(De):{path:De},De.params={}),ut({query:W.query,hash:W.hash,params:De.path!=null?{}:W.params},De)}}function ve(W,me){const ie=u=Y(W),fe=l.value,De=W.state,g=W.force,v=W.replace===!0,A=de(ie,fe);if(A)return ve(ut(j(A),{state:typeof A=="object"?ut({},De,A.state):De,force:g,replace:v}),me||ie);const H=ie;H.redirectedFrom=me;let F;return!g&&Hm(r,fe,ie)&&(F=ms(At.NAVIGATION_DUPLICATED,{to:H,from:fe}),Xe(fe,fe,!0,!1)),(F?Promise.resolve(F):ee(H,fe)).catch(P=>Wn(P)?Wn(P,At.NAVIGATION_GUARD_REDIRECT)?P:nt(P):$e(P,H,fe)).then(P=>{if(P){if(Wn(P,At.NAVIGATION_GUARD_REDIRECT))return ve(ut({replace:v},j(P.to),{state:typeof P.to=="object"?ut({},De,P.to.state):De,force:g}),me||H)}else P=te(H,fe,!0,v,De);return ye(H,fe,P),P})}function Ie(W,me){const ie=q(W,me);return ie?Promise.reject(ie):Promise.resolve()}function re(W){const me=Rt.values().next().value;return me&&typeof me.runWithContext=="function"?me.runWithContext(W):W()}function ee(W,me){let ie;const[fe,De,g]=sg(W,me);ie=xi(fe.reverse(),"beforeRouteLeave",W,me);for(const A of fe)A.leaveGuards.forEach(H=>{ie.push(mr(H,W,me))});const v=Ie.bind(null,W,me);return ie.push(v),et(ie).then(()=>{ie=[];for(const A of o.list())ie.push(mr(A,W,me));return ie.push(v),et(ie)}).then(()=>{ie=xi(De,"beforeRouteUpdate",W,me);for(const A of De)A.updateGuards.forEach(H=>{ie.push(mr(H,W,me))});return ie.push(v),et(ie)}).then(()=>{ie=[];for(const A of g)if(A.beforeEnter)if(bn(A.beforeEnter))for(const H of A.beforeEnter)ie.push(mr(H,W,me));else ie.push(mr(A.beforeEnter,W,me));return ie.push(v),et(ie)}).then(()=>(W.matched.forEach(A=>A.enterCallbacks={}),ie=xi(g,"beforeRouteEnter",W,me,re),ie.push(v),et(ie))).then(()=>{ie=[];for(const A of i.list())ie.push(mr(A,W,me));return ie.push(v),et(ie)}).catch(A=>Wn(A,At.NAVIGATION_CANCELLED)?A:Promise.reject(A))}function ye(W,me,ie){a.list().forEach(fe=>re(()=>fe(W,me,ie)))}function te(W,me,ie,fe,De){const g=q(W,me);if(g)return g;const v=me===dr,A=rs?history.state:{};ie&&(fe||v?s.replace(W.fullPath,ut({scroll:v&&A&&A.scroll},De)):s.push(W.fullPath,De)),l.value=W,Xe(W,me,ie,v),nt()}let je;function Be(){je||(je=s.listen((W,me,ie)=>{if(!Ge.listening)return;const fe=Y(W),De=de(fe,Ge.currentRoute.value);if(De){ve(ut(De,{replace:!0,force:!0}),fe).catch(Fs);return}u=fe;const g=l.value;rs&&Ym(uc(g.fullPath,ie.delta),ai()),ee(fe,g).catch(v=>Wn(v,At.NAVIGATION_ABORTED|At.NAVIGATION_CANCELLED)?v:Wn(v,At.NAVIGATION_GUARD_REDIRECT)?(ve(ut(j(v.to),{force:!0}),fe).then(A=>{Wn(A,At.NAVIGATION_ABORTED|At.NAVIGATION_DUPLICATED)&&!ie.delta&&ie.type===da.pop&&s.go(-1,!1)}).catch(Fs),Promise.reject()):(ie.delta&&s.go(-ie.delta,!1),$e(v,fe,g))).then(v=>{v=v||te(fe,g,!1),v&&(ie.delta&&!Wn(v,At.NAVIGATION_CANCELLED)?s.go(-ie.delta,!1):ie.type===da.pop&&Wn(v,At.NAVIGATION_ABORTED|At.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ye(fe,g,v)}).catch(Fs)}))}let Qe=Ps(),Re=Ps(),Te;function $e(W,me,ie){nt(W);const fe=Re.list();return fe.length?fe.forEach(De=>De(W,me,ie)):console.error(W),Promise.reject(W)}function It(){return Te&&l.value!==dr?Promise.resolve():new Promise((W,me)=>{Qe.add([W,me])})}function nt(W){return Te||(Te=!W,Be(),Qe.list().forEach(([me,ie])=>W?ie(W):me()),Qe.reset()),W}function Xe(W,me,ie,fe){const{scrollBehavior:De}=e;if(!rs||!De)return Promise.resolve();const g=!ie&&Qm(uc(W.fullPath,0))||(fe||!ie)&&history.state&&history.state.scroll||null;return tn().then(()=>De(W,me,g)).then(v=>v&&Jm(v)).catch(v=>$e(v,W,me))}const Ze=W=>s.go(W);let ht;const Rt=new Set,Ge={currentRoute:l,listening:!0,addRoute:_,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:M,getRoutes:I,resolve:Y,options:e,push:B,replace:oe,go:Ze,back:()=>Ze(-1),forward:()=>Ze(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Re.add,isReady:It,install(W){W.component("RouterLink",Eg),W.component("RouterView",Pg),W.config.globalProperties.$router=Ge,Object.defineProperty(W.config.globalProperties,"$route",{enumerable:!0,get:()=>ue(l)}),rs&&!ht&&l.value===dr&&(ht=!0,B(s.location).catch(fe=>{}));const me={};for(const fe in dr)Object.defineProperty(me,fe,{get:()=>l.value[fe],enumerable:!0});W.provide(li,Ge),W.provide(Ja,Hu(me)),W.provide(ha,l);const ie=W.unmount;Rt.add(W),W.unmount=function(){Rt.delete(W),Rt.size<1&&(u=dr,je&&je(),je=null,l.value=dr,ht=!1,Te=!1),ie()}}};function et(W){return W.reduce((me,ie)=>me.then(()=>re(ie)),Promise.resolve())}return Ge}function Og(){return mn(li)}function Mg(e){return mn(Ja)}const Tc=768;function Gd(){const e=D(typeof window<"u"?window.innerWidth<Tc:!1);let t=null;function n(r){e.value=r.matches}return ir(()=>{t=window.matchMedia(`(max-width: ${Tc-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),ri(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Ng={key:0,class:"desktop-sidebar"},$g={class:"desktop-main"},Ic="codex-web-local.sidebar-width.v1",Dg=260,Lg=620,Sc=320,jg=Lt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Gd();function r(u){return Math.min(Lg,Math.max(Dg,u))}function s(){if(typeof window>"u")return Sc;const u=window.localStorage.getItem(Ic),c=Number(u);return Number.isFinite(c)?r(c):Sc}const o=D(s()),i=pe(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${o.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(u){typeof window>"u"||window.localStorage.setItem(Ic,String(u))}function l(u){u.preventDefault();const c=u.clientX,f=o.value,p=N=>{const I=N.clientX-c;o.value=r(f+I)},_=()=>{a(o.value),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",_)}return(u,c)=>(w(),T("div",{class:gt(["desktop-layout",{"is-mobile":ue(n)}]),style:zr(i.value)},[ue(n)?(w(),yt($o,{key:0,to:"body"},[Ce(Nd,{name:"drawer"},{default:pt(()=>[e.isSidebarCollapsed?se("",!0):(w(),T("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=f=>u.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=tt(()=>{},["stop"]))},[On(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):se("",!0),ue(n)?se("",!0):(w(),T(He,{key:1},[e.isSidebarCollapsed?se("",!0):(w(),T("aside",Ng,[On(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?se("",!0):(w(),T("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),m("section",$g,[On(u.$slots,"content",{},void 0)])],6))}}),st=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Bg=st(jg,[["__scopeId","data-v-df29c633"]]),Ug={},Fg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Hg(e,t){return w(),T("svg",Fg,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const ci=st(Ug,[["render",Hg]]),Vg={},Wg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function zg(e,t){return w(),T("svg",Wg,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const Kd=st(Vg,[["render",zg]]),qg={},Gg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Kg(e,t){return w(),T("svg",Gg,[...t[0]||(t[0]=[m("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const xs=st(qg,[["render",Kg]]),Jg={},Yg={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Qg(e,t){return w(),T("svg",Yg,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16zm9.5-13.5l4 4"},null,-1)])])}const Uo=st(Jg,[["render",Qg]]),Xg={},Zg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ev(e,t){return w(),T("svg",Zg,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"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 Jd=st(Xg,[["render",ev]]),tv={},nv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function rv(e,t){return w(),T("svg",nv,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const sv=st(tv,[["render",rv]]),ov={},iv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function av(e,t){return w(),T("svg",iv,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 18v-6m0 0a4 4 0 0 1 4-4h2m-6 4a4 4 0 0 0-4-4H6m0-4a2 2 0 1 0 0 4a2 2 0 0 0 0-4m12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4m-6 14a2 2 0 1 0 0 4a2 2 0 0 0 0-4"},null,-1)])])}const Co=st(ov,[["render",av]]),lv={},cv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function uv(e,t){return w(),T("svg",cv,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 4.5l-4 4L7 10l-1.5 1.5l7 7L14 17l1.5-4l4-4M9 15l-4.5 4.5M14.5 4L20 9.5"},null,-1)])])}const Oi=st(lv,[["render",uv]]),dv={key:0,class:"sidebar-menu-row-left"},fv={class:"sidebar-menu-row-main"},hv={key:1,class:"sidebar-menu-row-right"},pv={key:0,class:"sidebar-menu-row-right-default"},mv={key:1,class:"sidebar-menu-row-right-hover"},gv=Lt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=ip(),r=pe(()=>!!n.left),s=pe(()=>!!n.right),o=pe(()=>!!n["right-hover"]),i=pe(()=>s.value||o.value);return(a,l)=>(w(),yt(na(t.as),Ad({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:pt(()=>[r.value?(w(),T("span",dv,[On(a.$slots,"left",{},void 0,!0)])):se("",!0),m("span",fv,[On(a.$slots,"default",{},void 0,!0)]),i.value?(w(),T("span",hv,[s.value?(w(),T("span",pv,[On(a.$slots,"right",{},void 0,!0)])):se("",!0),o.value?(w(),T("span",mv,[On(a.$slots,"right-hover",{},void 0,!0)])):se("",!0)])):se("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),$r=st(gv,[["__scopeId","data-v-daeca4df"]]),vv={class:"thread-tree-root"},yv={key:0,class:"pinned-section"},wv={class:"thread-list"},bv={class:"thread-left-stack"},_v=["data-state"],kv=["onClick"],Tv=["onClick"],Iv={class:"thread-row-title-wrap"},Sv={class:"thread-row-title"},Ev={class:"thread-row-time"},Cv=["onClick"],Av=["onClick"],Rv=["onClick"],Pv=["onClick"],xv=["aria-expanded"],Ov=["data-active"],Mv={key:0},Nv=["data-active"],$v={key:0},Dv={key:1,class:"thread-tree-no-results"},Lv={key:2,class:"thread-tree-loading"},jv={key:3,class:"thread-list thread-list-global"},Bv={class:"thread-left-stack"},Uv=["data-state"],Fv=["onClick"],Hv=["onClick"],Vv={class:"thread-row-title-wrap"},Wv={class:"thread-row-title"},zv={class:"thread-row-time"},qv=["onClick"],Gv=["onClick"],Kv=["onClick"],Jv=["onClick"],Yv=["data-project-name","data-expanded","data-dragging"],Qv={class:"project-icon-stack"},Xv={class:"project-icon-folder"},Zv={class:"project-icon-chevron"},ey=["data-dragging-handle","onMousedown"],ty={class:"project-title"},ny={class:"project-hover-controls"},ry=["onClick"],sy=["onClick"],oy=["onClick"],iy=["onClick"],ay=["onInput"],ly=["aria-label","title","onClick"],cy={key:0,class:"thread-list"},uy={class:"thread-left-stack"},dy=["data-state"],fy=["onClick"],hy=["onClick"],py={class:"thread-row-title-wrap"},my={class:"thread-row-title"},gy={class:"thread-row-time"},vy=["onClick"],yy=["onClick"],wy=["onClick"],by=["onClick"],_y=["onClick"],ky={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Ty=["onKeydown"],Iy={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},Sy={class:"rename-thread-subtitle"},Ey=4,Ec=6,Cc="codex-web-local.thread-view-mode.v1",Ac="codex-web-local.collapsed-projects.v1",Cy=Lt({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project","export-thread"],setup(e,{emit:t}){const n=e,r=t,s=D({}),o=D({}),i=D([]),a=D(""),l=D(""),u=D("actions"),c=D(""),f=D(!1),p=D(""),_=D(""),N=D(null),I=D(!1),M=D(""),Y=D(""),j=D(null),q=D(null),B=D(null);let oe=null,de=null;const ve=D(""),Ie=D({}),re=new Map,ee=new Map,ye=new Map,te=new WeakMap,je=D(null),Be=D(!1),Qe=D($e()),Re=typeof window<"u"?new ResizeObserver(k=>{for(const x of k){const O=x.target,J=te.get(O);J&&Ae(J,O)}}):null;function Te(){if(typeof window>"u")return{};try{const k=window.localStorage.getItem(Ac);if(!k)return{};const x=JSON.parse(k);return!x||typeof x!="object"||Array.isArray(x)?{}:x}catch{return{}}}function $e(){return typeof window>"u"?"project":window.localStorage.getItem(Cc)==="chronological"?"chronological":"project"}o.value=Te(),mt(o,k=>{typeof window>"u"||window.localStorage.setItem(Ac,JSON.stringify(k))},{deep:!0}),mt(Qe,k=>{typeof window>"u"||window.localStorage.setItem(Cc,k)});const It=pe(()=>n.searchQuery.trim().toLowerCase()),nt=pe(()=>It.value.length>0),Xe=pe(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function Ze(k){if(!nt.value)return!0;if(Xe.value)return Xe.value.has(k.id);const x=It.value;return k.title.toLowerCase().includes(x)||k.preview.toLowerCase().includes(x)}const ht=pe(()=>nt.value?n.groups.map(k=>({...k,threads:k.threads.filter(Ze)})).filter(k=>k.threads.length>0):n.groups),Rt=pe(()=>Qe.value==="chronological"),Ge=pe(()=>{const k=ht.value,x=[];for(const O of k)for(const J of O.threads)v(J.id)||x.push(J);return x.sort((O,J)=>{const Ue=new Date(O.updatedAtIso||O.createdAtIso).getTime();return new Date(J.updatedAtIso||J.createdAtIso).getTime()-Ue})}),et=pe(()=>{const k=new Map;for(const x of n.groups)for(const O of x.threads)k.set(O.id,O);return k}),W=pe(()=>i.value.map(k=>et.value.get(k)??null).filter(k=>k!==null).filter(Ze)),me=pe(()=>{const k=B.value;if(!k||k.dropTargetIndexFull===null||n.groups.length===0)return null;const x=Math.max(0,Math.min(k.dropTargetIndexFull,n.groups.length)),O=x>k.fromIndex?x-1:x,J=Math.max(0,Math.min(O,n.groups.length-1));return J===k.fromIndex?null:J}),ie=pe(()=>{const x=(nt.value?ht.value:n.groups).map(Zt=>Zt.projectName),O=B.value,J=me.value;if(!O||J===null)return x;const Ue=[...x],[Mt]=Ue.splice(O.fromIndex,1);return Mt?(Ue.splice(J,0,Mt),Ue):x}),fe=pe(()=>{const k={};let x=0;for(const O of ie.value)k[O]=x,x+=jt(O);return k}),De=pe(()=>{let k=0;for(const x of ie.value)k+=jt(x);return{height:`${Math.max(0,k)}px`}});function g(k){const x=new Date(k).getTime();if(Number.isNaN(x))return"n/a";const O=Math.abs(Date.now()-x);if(O<6e4)return"now";const J=Math.floor(O/6e4);if(J<60)return`${J}m`;const Ue=Math.floor(J/60);return Ue<24?`${Ue}h`:`${Math.floor(Ue/24)}d`}function v(k){return i.value.includes(k)}function A(k){if(v(k)){i.value=i.value.filter(x=>x!==k);return}i.value=[k,...i.value]}function H(k){r("select",k)}function F(k){r("export-thread",k),V()}function P(k){return`start new thread ${Ve(k)}`}function $(k){r("start-new-thread",k)}function L(k){l.value===k&&V()}function G(k){return l.value===k}function V(){l.value=""}function be(k){if(l.value===k){V();return}l.value=k}function ae(k,x){p.value=k,_.value=x,f.value=!0,V(),tn(()=>{var O,J;(O=N.value)==null||O.focus(),(J=N.value)==null||J.select()})}function he(){f.value=!1,p.value="",_.value=""}function Se(){const k=p.value,x=_.value.trim();!k||!x||(r("rename-thread",{threadId:k,title:x}),he())}function Oe(k,x){M.value=k,Y.value=x,I.value=!0,V()}function Ke(){I.value=!1,M.value="",Y.value=""}function xe(){const k=M.value;k&&(i.value=i.value.filter(x=>x!==k),r("archive",k),Ke())}function Ve(k){return n.projectDisplayNameById[k]??k}function _t(k){return a.value===k}function U(){a.value="",u.value="actions",c.value=""}function K(){Be.value=!Be.value}function ne(k){Qe.value=k,Be.value=!1}function Je(k){if(a.value===k){U();return}a.value=k,u.value="actions",c.value=Ve(k)}function it(k){a.value=k,u.value="rename",c.value=Ve(k)}function kt(k){r("rename-project",{projectName:k,displayName:c.value})}function Pt(k){r("remove-project",k),U()}function ln(k){r("browse-project-files",k),U()}function Sr(k,x){if(!k.altKey||k.key!=="ArrowUp"&&k.key!=="ArrowDown")return;const O=n.groups.findIndex(Mt=>Mt.projectName===x);if(O<0)return;const J=k.key==="ArrowUp"?-1:1,Ue=Math.max(0,Math.min(O+J,n.groups.length-1));Ue!==O&&(k.preventDefault(),r("reorder-project",{projectName:x,toIndex:Ue}))}function rn(k){return s.value[k]===!0}function Ne(k){return o.value[k]===!0}function Me(k){s.value={...s.value,[k]:!rn(k)}}function fn(k){if(ve.value===k){ve.value="";return}o.value={...o.value,[k]:!Ne(k)}}function jt(k){const x=Ie.value[k]??0,O=B.value,Ue=((O==null?void 0:O.projectName)===k?O.groupHeight:null)??x,Mt=Ne(k)?0:Ec;return Math.max(0,Ue+Mt)}function Er(k,x){const O=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(O){ee.set(k,O);return}ee.delete(k)}function _n(k,x){const O=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(O){ye.set(k,O);return}ye.delete(k)}function kn(k){const x=a.value;if(!x)return!1;const O=ee.get(x);if(!O)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(O))return!0;const Ue=k.target;return Ue instanceof Node?O.contains(Ue):!1}function b(k){const x=l.value;if(!x)return!1;const O=ye.get(x);if(!O)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(O))return!0;const Ue=k.target;return Ue instanceof Node?O.contains(Ue):!1}function S(k){if(Be.value){const x=je.value,O=typeof k.composedPath=="function"?k.composedPath():[];!!x&&(O.includes(x)||k.target instanceof Node&&x.contains(k.target))||(Be.value=!1)}a.value&&(kn(k)||U(),l.value&&(b(k)||V()))}function E(k){a.value&&!kn(k)&&U(),l.value&&!b(k)&&V()}function z(){Be.value&&(Be.value=!1),a.value&&U(),l.value&&V()}function ge(){window.addEventListener("pointerdown",S,{capture:!0}),window.addEventListener("focusin",E,{capture:!0}),window.addEventListener("blur",z)}function le(){window.removeEventListener("pointerdown",S,{capture:!0}),window.removeEventListener("focusin",E,{capture:!0}),window.removeEventListener("blur",z)}function Ae(k,x){const O=x.getBoundingClientRect().height;if(!Number.isFinite(O)||O<=0)return;const J=Ie.value[k];J!==void 0&&Math.abs(J-O)<.5||(Ie.value={...Ie.value,[k]:O})}function ke(k,x){const O=re.get(k);O&&O!==x&&Re&&Re.unobserve(O);const J=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(J){re.set(k,J),te.set(J,k),Ae(k,J),Re==null||Re.observe(J);return}O&&(Re==null||Re.unobserve(O)),re.delete(k)}function We(k,x){if(k.button!==0||q.value||B.value)return;const O=n.groups.findIndex(Zt=>Zt.projectName===x),J=re.get(x);if(O<0||!J)return;const Ue=J.getBoundingClientRect(),Mt=Ne(x)?0:Ec;q.value={projectName:x,fromIndex:O,startClientX:k.clientX,startClientY:k.clientY,pointerOffsetY:k.clientY-Ue.top,groupLeft:Ue.left,groupWidth:Ue.width,groupHeight:Ue.height,groupOuterHeight:Ue.height+Mt},k.preventDefault(),at()}function at(){window.addEventListener("mousemove",xt),window.addEventListener("mouseup",Ot),window.addEventListener("keydown",sn)}function lt(){window.removeEventListener("mousemove",xt),window.removeEventListener("mouseup",Ot),window.removeEventListener("keydown",sn)}function xt(k){oe={clientX:k.clientX,clientY:k.clientY},ks()}function Ot(k){Cr({clientX:k.clientX,clientY:k.clientY});const x=B.value;if(x&&me.value!==null){const O=n.groups.findIndex(J=>J.projectName===x.projectName);if(O>=0){const J=me.value;J!==O&&r("reorder-project",{projectName:x.projectName,toIndex:J})}}Dn()}function sn(k){k.key==="Escape"&&(!q.value&&!B.value||(k.preventDefault(),Dn()))}function Dn(){de!==null&&(window.cancelAnimationFrame(de),de=null),oe=null,q.value=null,B.value=null,ve.value="",lt()}function ks(){de===null&&(de=window.requestAnimationFrame(()=>{if(de=null,!oe)return;const k=oe;oe=null,Cr(k)}))}function Cr(k){const x=q.value;if(!B.value&&x){const O=k.clientX-x.startClientX,J=k.clientY-x.startClientY;if(Math.hypot(O,J)<Ey)return;U(),ve.value=x.projectName,B.value={projectName:x.projectName,fromIndex:x.fromIndex,pointerOffsetY:x.pointerOffsetY,groupLeft:x.groupLeft,groupWidth:x.groupWidth,groupHeight:x.groupHeight,groupOuterHeight:x.groupOuterHeight,ghostTop:k.clientY-x.pointerOffsetY,dropTargetIndexFull:null}}B.value&&Gr(k)}function Gr(k){const x=B.value;if(!x)return;if(x.ghostTop=k.clientY-x.pointerOffsetY,!Ln(k)){x.dropTargetIndexFull=null;return}const O=k.clientY,J=j.value;if(!J){x.dropTargetIndexFull=null;return}const Ue=J.getBoundingClientRect(),Mt=new Map(n.groups.map((on,lr)=>[on.projectName,lr])),Zt=n.groups.map(on=>on.projectName).filter(on=>on!==x.projectName);let Bn=0,Un=n.groups.length;for(const on of Zt){const lr=Mt.get(on);if(lr===void 0)continue;const Yr=jt(on),Qr=Ue.top+Bn+Yr/2;if(O<Qr){Un=lr;break}Bn+=Yr}x.dropTargetIndexFull=Un}function Ln(k){const x=j.value;if(!x)return!1;const O=x.getBoundingClientRect(),J=k.clientX>=O.left&&k.clientX<=O.right,Ue=k.clientY>=O.top-32&&k.clientY<=O.bottom+32;return J&&Ue}function Kr(k){var x;return((x=B.value)==null?void 0:x.projectName)===k}function Jr(k){const x=B.value,O=fe.value[k]??0,J=a.value===k;return!x||x.projectName!==k?{position:"absolute",top:"0",left:"0",right:"0",zIndex:J?"40":"1",transform:`translate3d(0, ${O}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${x.groupLeft}px`,width:`${x.groupWidth}px`,height:`${x.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${x.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function jn(k){return k.threads.filter(x=>!v(x.id))}function Ts(k){if(nt.value)return jn(k);if(Ne(k.projectName))return[];const x=jn(k);return rn(k.projectName)?x:x.slice(0,10)}function Is(k){return nt.value?!1:!Ne(k.projectName)&&jn(k).length>10}function Ss(k){return jn(k).length>0}function Ar(k){return k.inProgress?"working":k.unread?"unread":"idle"}mt(()=>n.groups.map(k=>k.projectName),k=>{var Ue,Mt;const x=((Ue=B.value)==null?void 0:Ue.projectName)??((Mt=q.value)==null?void 0:Mt.projectName)??"";x&&!n.groups.some(Zt=>Zt.projectName===x)&&Dn();const O=new Set(k),J=Object.fromEntries(Object.entries(Ie.value).filter(([Zt])=>O.has(Zt)));Object.keys(J).length!==Object.keys(Ie.value).length&&(Ie.value=J)});const Rr=pe(()=>Be.value||a.value!=="");return mt(Rr,k=>{if(k){ge();return}le()}),ar(()=>{for(const k of re.values())Re==null||Re.unobserve(k);re.clear(),ee.clear(),le(),Dn()}),(k,x)=>(w(),T("section",vv,[W.value.length>0?(w(),T("section",yv,[m("ul",wv,[(w(!0),T(He,null,Et(W.value,O=>(w(),T("li",{key:O.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":O.id===e.selectedThreadId,"data-pinned":v(O.id),onMouseleave:J=>L(O.id)},{left:pt(()=>[m("span",bv,[O.inProgress||O.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Ar(O)},null,8,_v)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>A(O.id)},[Ce(Oi,{class:"thread-icon"})],8,kv)])]),right:pt(()=>[m("span",Ev,ce(g(O.createdAtIso||O.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:J=>_n(O.id,J),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(J=>be(O.id),["stop"])},[Ce(xs,{class:"thread-icon"})],8,Cv),G(O.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:x[0]||(x[0]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:J=>F(O.id)}," Export chat ",8,Av),m("button",{class:"thread-menu-item",type:"button",onClick:J=>ae(O.id,O.title)}," Rename thread ",8,Rv),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:J=>Oe(O.id,O.title)}," Delete thread ",8,Pv)])):se("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:J=>H(O.id)},[m("span",Iv,[m("span",Sv,ce(O.title),1),O.hasWorktree?(w(),yt(Co,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,Tv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):se("",!0),Ce($r,{as:"header",class:"thread-tree-header-row"},{right:pt(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:je,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Be.value,"aria-label":"Organize threads",title:"Organize threads",onClick:K},[Ce(xs,{class:"thread-icon"})],8,xv),Be.value?(w(),T("div",{key:0,class:"organize-menu-panel",onClick:x[3]||(x[3]=tt(()=>{},["stop"]))},[x[11]||(x[11]=m("p",{class:"organize-menu-title"},"Organize",-1)),m("button",{class:"organize-menu-item","data-active":Qe.value==="project",type:"button",onClick:x[1]||(x[1]=O=>ne("project"))},[x[9]||(x[9]=m("span",null,"By project",-1)),Qe.value==="project"?(w(),T("span",Mv,"✓")):se("",!0)],8,Ov),m("button",{class:"organize-menu-item","data-active":Qe.value==="chronological",type:"button",onClick:x[2]||(x[2]=O=>ne("chronological"))},[x[10]||(x[10]=m("span",null,"Chronological list",-1)),Qe.value==="chronological"?(w(),T("span",$v,"✓")):se("",!0)],8,Nv)])):se("",!0)],512)]),default:pt(()=>[x[12]||(x[12]=m("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),nt.value&&ht.value.length===0?(w(),T("p",Dv,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),T("p",Lv,"Loading threads...")):Rt.value?(w(),T("ul",jv,[(w(!0),T(He,null,Et(Ge.value,O=>(w(),T("li",{key:O.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":O.id===e.selectedThreadId,"data-pinned":v(O.id),onMouseleave:J=>L(O.id)},{left:pt(()=>[m("span",Bv,[O.inProgress||O.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Ar(O)},null,8,Uv)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>A(O.id)},[Ce(Oi,{class:"thread-icon"})],8,Fv)])]),right:pt(()=>[m("span",zv,ce(g(O.createdAtIso||O.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:J=>_n(O.id,J),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(J=>be(O.id),["stop"])},[Ce(xs,{class:"thread-icon"})],8,qv),G(O.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:x[4]||(x[4]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:J=>F(O.id)}," Export chat ",8,Gv),m("button",{class:"thread-menu-item",type:"button",onClick:J=>ae(O.id,O.title)}," Rename thread ",8,Kv),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:J=>Oe(O.id,O.title)}," Delete thread ",8,Jv)])):se("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:J=>H(O.id)},[m("span",Vv,[m("span",Wv,ce(O.title),1),O.hasWorktree?(w(),yt(Co,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,Hv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),T("div",{key:4,ref_key:"groupsContainerRef",ref:j,class:"thread-tree-groups",style:zr(De.value)},[(w(!0),T(He,null,Et(ht.value,O=>(w(),T("article",{key:O.projectName,ref_for:!0,ref:J=>ke(O.projectName,J),class:"project-group","data-project-name":O.projectName,"data-expanded":!Ne(O.projectName),"data-dragging":Kr(O.projectName),style:zr(Jr(O.projectName))},[Ce($r,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:J=>fn(O.projectName),onKeydown:[J=>Sr(J,O.projectName),Yt(tt(J=>fn(O.projectName),["prevent"]),["enter"]),Yt(tt(J=>fn(O.projectName),["prevent"]),["space"])]},{left:pt(()=>[m("span",Qv,[m("span",Xv,[Ne(O.projectName)?(w(),yt(Jd,{key:0,class:"thread-icon"})):(w(),yt(sv,{key:1,class:"thread-icon"}))]),m("span",Zv,[Ne(O.projectName)?(w(),yt(Kd,{key:0,class:"thread-icon"})):(w(),yt(ci,{key:1,class:"thread-icon"}))])])]),right:pt(()=>[m("div",ny,[m("div",{ref_for:!0,ref:J=>Er(O.projectName,J),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:tt(J=>Je(O.projectName),["stop"])},[Ce(xs,{class:"thread-icon"})],8,ry),_t(O.projectName)?(w(),T("div",{key:0,class:"project-menu-panel",onClick:x[6]||(x[6]=tt(()=>{},["stop"]))},[u.value==="actions"?(w(),T(He,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:J=>ln(O.projectName)}," Browse files ",8,sy),m("button",{class:"project-menu-item",type:"button",onClick:J=>it(O.projectName)}," Edit name ",8,oy),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:J=>Pt(O.projectName)}," Remove ",8,iy)],64)):(w(),T(He,{key:1},[x[13]||(x[13]=m("label",{class:"project-menu-label"},"Project name",-1)),tr(m("input",{"onUpdate:modelValue":x[5]||(x[5]=J=>c.value=J),class:"project-menu-input",type:"text",onInput:J=>kt(O.projectName)},null,40,ay),[[nr,c.value]])],64))])):se("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":P(O.projectName),title:P(O.projectName),onClick:tt(J=>$(O.projectName),["stop"])},[Ce(Uo,{class:"thread-icon"})],8,ly)])]),default:pt(()=>[m("span",{class:"project-main-button","data-dragging-handle":Kr(O.projectName),onMousedown:tt(J=>We(J,O.projectName),["left"])},[m("span",ty,ce(Ve(O.projectName)),1)],40,ey)]),_:2},1032,["onClick","onKeydown"]),Ss(O)?(w(),T("ul",cy,[(w(!0),T(He,null,Et(Ts(O),J=>(w(),T("li",{key:J.id,class:"thread-row-item"},[Ce($r,{class:"thread-row","data-active":J.id===e.selectedThreadId,"data-pinned":v(J.id),onMouseleave:Ue=>L(J.id)},{left:pt(()=>[m("span",uy,[J.inProgress||J.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Ar(J)},null,8,dy)):se("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Ue=>A(J.id)},[Ce(Oi,{class:"thread-icon"})],8,fy)])]),right:pt(()=>[m("span",gy,ce(g(J.createdAtIso||J.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:Ue=>_n(J.id,Ue),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(Ue=>be(J.id),["stop"])},[Ce(xs,{class:"thread-icon"})],8,vy),G(J.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:x[7]||(x[7]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Ue=>F(J.id)}," Export chat ",8,yy),m("button",{class:"thread-menu-item",type:"button",onClick:Ue=>ae(J.id,J.title)}," Rename thread ",8,wy),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Ue=>Oe(J.id,J.title)}," Delete thread ",8,by)])):se("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Ue=>H(J.id)},[m("span",py,[m("span",my,ce(J.title),1),J.hasWorktree?(w(),yt(Co,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):se("",!0)])],8,hy)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),yt($r,{key:1,as:"p",class:"project-empty-row"},{left:pt(()=>[...x[14]||(x[14]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:pt(()=>[x[15]||(x[15]=m("span",{class:"project-empty"},"No threads",-1))]),_:1})),Is(O)?(w(),yt($r,{key:2,class:"thread-show-more-row"},{left:pt(()=>[...x[16]||(x[16]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:pt(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:J=>Me(O.projectName)},ce(rn(O.projectName)?"Show less":"Show more"),9,_y)]),_:2},1024)):se("",!0)],12,Yv))),128))],4)),(w(),yt($o,{to:"body"},[f.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:tt(he,["self"])},[m("div",ky,[x[17]||(x[17]=m("h3",{class:"rename-thread-title"},"Rename thread",-1)),x[18]||(x[18]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),tr(m("input",{ref_key:"renameThreadInputRef",ref:N,"onUpdate:modelValue":x[8]||(x[8]=O=>_.value=O),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Yt(tt(Se,["prevent"]),["enter"]),Yt(tt(he,["prevent"]),["esc"])]},null,40,Ty),[[nr,_.value]]),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:he},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Se},"Save")])])])):se("",!0)])),(w(),yt($o,{to:"body"},[I.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:tt(Ke,["self"])},[m("div",Iy,[x[19]||(x[19]=m("h3",{class:"rename-thread-title"},"Delete thread?",-1)),m("p",Sy,' This will archive the thread "'+ce(Y.value)+'". You can find it later in archived threads. ',1),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:Ke},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:xe},"Delete")])])])):se("",!0)]))]))}}),Ay=st(Cy,[["__scopeId","data-v-e2f8a8e1"]]),Ry={class:"content-header"},Py={class:"content-leading"},xy={class:"content-title"},Oy={class:"content-actions"},My=Lt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),T("header",Ry,[m("div",Py,[On(t.$slots,"leading",{},void 0)]),m("h1",xy,ce(e.title),1),m("div",Oy,[On(t.$slots,"actions",{},void 0)])]))}}),Ny=st(My,[["__scopeId","data-v-66ee223c"]]),$y={},Dy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ly(e,t){return w(),T("svg",Dy,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Ya=st($y,[["render",Ly]]),jy={},By={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Uy(e,t){return w(),T("svg",By,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const Fy=st(jy,[["render",Uy]]),Hy={},Vy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Wy(e,t){return w(),T("svg",Vy,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2zm-4 4a2 2 0 0 1-2-2V8m4 8h10"},null,-1)])])}const zy=st(Hy,[["render",Wy]]),qy={class:"conversation-root"},Gy={key:0,class:"conversation-loading"},Ky={key:1,class:"conversation-empty"},Jy={class:"message-row"},Yy={class:"message-stack"},Qy={class:"request-card"},Xy={class:"request-title"},Zy={class:"request-meta"},ew={key:0,class:"request-reason"},tw={key:1,class:"request-actions"},nw=["onClick"],rw=["onClick"],sw=["onClick"],ow=["onClick"],iw={key:2,class:"request-actions"},aw=["onClick"],lw=["onClick"],cw=["onClick"],uw=["onClick"],dw={key:3,class:"request-user-input"},fw={class:"request-question-title"},hw={key:0,class:"request-question-text"},pw=["value","onChange"],mw=["value"],gw=["value","onInput"],vw=["onClick"],yw={key:4,class:"request-actions"},ww=["onClick"],bw=["onClick"],_w={key:5,class:"request-actions"},kw=["onClick"],Tw=["onClick"],Iw=["data-role","data-message-type"],Sw={key:0,class:"message-row","data-role":"system"},Ew={class:"message-stack","data-role":"system"},Cw=["onClick"],Aw={class:"cmd-label"},Rw={class:"cmd-status"},Pw={class:"cmd-output-inner"},xw={class:"cmd-output"},Ow=["data-role","data-message-type"],Mw=["data-role"],Nw=["data-role"],$w=["data-role"],Dw=["onClick"],Lw=["src"],jw={key:1,class:"message-file-attachments"},Bw=["href","title"],Uw=["data-role"],Fw={key:0,class:"worked-separator-wrap","aria-live":"polite"},Hw=["onClick"],Vw={class:"worked-separator-text"},Ww={key:0,class:"worked-details"},zw=["onClick"],qw={class:"cmd-label"},Gw={class:"cmd-status"},Kw={class:"cmd-output-inner"},Jw={class:"cmd-output"},Yw={key:1,class:"message-text-flow"},Qw={key:0,class:"message-text"},Xw={key:0},Zw={key:1,class:"message-bold-text"},eb=["href","title"],tb=["href","title"],nb={key:4,class:"message-inline-code"},rb={key:1,class:"message-text"},sb=["onClick"],ob=["src","alt","onError"],ib={key:0,class:"message-actions"},ab=["onClick"],lb=["onClick"],cb={key:0,class:"conversation-item conversation-item-overlay"},ub={class:"message-row"},db={class:"message-stack"},fb={class:"live-overlay-inline","aria-live":"polite"},hb={class:"live-overlay-label"},pb={key:1,class:"live-overlay-error"},mb=["src"],gb=16,vb=Lt({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=D(new Set),r=D(new Set),s=D(new Set),o=D({});function i(b){return b.messageType==="commandExecution"&&!!b.commandExecution}function a(b){var S;return((S=b.commandExecution)==null?void 0:S.status)==="inProgress"||r.value.has(b.id)?!0:n.value.has(b.id)}function l(b){return r.value.has(b.id)}function u(b){var E;if(((E=b.commandExecution)==null?void 0:E.status)==="inProgress")return;const S=new Set(n.value);S.has(b.id)?S.delete(b.id):S.add(b.id),n.value=S}function c(b){const S=new Set(s.value);S.has(b.id)?S.delete(b.id):S.add(b.id),s.value=S}function f(b){return s.value.has(b.id)}function p(b){const S=b.commandExecution;if(!S)return"";switch(S.status){case"inProgress":return"⟳ Running";case"completed":return S.exitCode===0?"✓ Completed":`✗ Exit ${S.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function _(b){var E,z;const S=(E=b.commandExecution)==null?void 0:E.status;return S==="inProgress"?"cmd-status-running":S==="completed"&&((z=b.commandExecution)==null?void 0:z.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function N(b){const S=new Set(r.value);S.add(b),r.value=S,setTimeout(()=>{const E=new Set(r.value);E.delete(b),r.value=E},1e3)}function I(b,S){const E=[];for(let z=S-1;z>=0;z--){const ge=b[z];if(ge.messageType==="commandExecution")E.unshift(ge);else if(ge.role==="user"||ge.messageType==="worked")break}return E}const M=e,Y=t,j=D(null),q=D(null),B=D(null),oe=D(""),de=D({}),ve=D({});let Ie=0,re=0,ee=0;const ye=new WeakSet,te=D(new Set);function je(b){if(!b||/\s/u.test(b)||b.endsWith("/")||b.endsWith("\\"))return!1;if(b.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(b))return!1;const S=b.startsWith("/"),E=/^[A-Za-z]:[\\/]/u.test(b),z=b.startsWith("./")||b.startsWith("../")||b.startsWith("~/"),ge=b.includes("/")||b.includes("\\");return S||E||z||ge}function Be(b){return b.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||b}function Qe(b){return b.replace(/\\/gu,"/")}function Re(b){if(!b.startsWith("file://"))return b;let S=b.replace(/^file:\/\//u,"");try{S=decodeURIComponent(S)}catch{}return/^\/[A-Za-z]:\//u.test(S)&&(S=S.slice(1)),S}function Te(b){const S=Qe(b),E=S.match(/^\/Users\/([^/]+)/u);if(E)return`/Users/${E[1]}`;const z=S.match(/^\/home\/([^/]+)/u);return z?`/home/${z[1]}`:""}function $e(b){const S=Qe(b);if(!S)return S;let E="",z=S;const ge=z.match(/^([A-Za-z]:)(\/.*)?$/u);ge?(E=`${ge[1]}/`,z=(ge[2]??"").replace(/^\/+/u,"")):z.startsWith("/")&&(E="/",z=z.slice(1));const le=z.split("/").filter(Boolean),Ae=[];for(const We of le)if(We!=="."){if(We===".."){Ae.length>0&&Ae.pop();continue}Ae.push(We)}const ke=Ae.join("/");return E?`${E}${ke}`.replace(/\/+$/u,"")||E:ke||S}function It(b,S){const E=Qe(Re(b.trim()));if(!E)return"";if(E.startsWith("/")||/^[A-Za-z]:\//u.test(E))return $e(E);if(E.startsWith("~/")){const le=Te(S);if(le)return $e(`${le}/${E.slice(2)}`)}const ge=Qe(S.trim());return $e(ge?`${ge.replace(/\/+$/u,"")}/${E}`:E)}function nt(b){if(!b)return null;let S=b.trim();S=Xe(S).core.trim();let z=null;const ge=S.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(ge)S=ge[1],z=Number(ge[2]);else{const le=S.match(/^(.*):(\d+)(?::\d+)?$/u);le&&(S=le[1],z=Number(le[2]))}return S=Re(S),je(S)?{path:S,line:z}:null}function Xe(b){let S=b,E="",z="";for(;/^[('"`[{<“‘]/u.test(S);)E+=S[0],S=S.slice(1);for(;/[)"'`\]}>”’]$/u.test(S);)z=S.slice(-1)+z,S=S.slice(0,-1);return{core:S,leading:E,trailing:z}}function Ze(b){const E=b.trim().match(/^\[([^\]\n]+)\]\(([^)\n]+)\)$/u);if(!E)return null;const z=(E[1]??"").trim(),ge=(E[2]??"").trim(),le=Xe(z).core.trim()||z,Ae=Xe(ge).core.trim();return Ae?{label:le,target:Ae}:null}function ht(b){const S=[],E=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let z=0;for(const ge of b.matchAll(E)){if(typeof ge.index!="number")continue;const le=ge.index,Ae=le+ge[0].length;le>z&&S.push({kind:"text",value:b.slice(z,le)});let ke=ge[0],We="";for(;/[.,;:]$/u.test(ke);)We=ke.slice(-1)+We,ke=ke.slice(0,-1);const at=Xe(ke);ke=at.core;const lt=at.leading,xt=at.trailing+We;if(lt&&S.push({kind:"text",value:lt}),ke.startsWith("**")&&ke.endsWith("**")&&ke.length>4)S.push({kind:"bold",value:ke.slice(2,-2)}),xt&&S.push({kind:"text",value:xt});else if(/^https?:\/\//u.test(ke))S.push({kind:"url",value:ke,href:ke}),xt&&S.push({kind:"text",value:xt});else{const Ot=nt(ke);Ot?(S.push({kind:"file",value:ke,path:Ot.path,displayPath:ke,downloadName:Be(Ot.path)}),xt&&S.push({kind:"text",value:xt})):S.push({kind:"text",value:ge[0]})}z=Ae}return z<b.length&&S.push({kind:"text",value:b.slice(z)}),Rt(S)}function Rt(b){const S=[];let E=!1,z="";const ge=le=>{le&&S.push({kind:"text",value:le})};for(const le of b){if(le.kind!=="text"){E&&(ge(`**${z}`),E=!1,z=""),S.push(le);continue}let Ae=le.value;for(;Ae.length>0;){const ke=Ae.indexOf("**");if(ke<0){E?z+=Ae:ge(Ae);break}const We=Ae.slice(0,ke);E?z+=We:ge(We),Ae=Ae.slice(ke+2),E?(z.length>0?S.push({kind:"bold",value:z}):ge("****"),z="",E=!1):E=!0}}return E&&ge(`**${z}`),S}function Ge(b){const S=/\[([^\]\n]+)\]\(([^)\n]+)\)/gu,E=[];let z=0;for(const ge of b.matchAll(S)){if(typeof ge.index!="number")continue;const[le,Ae,ke]=ge,We=ge.index,at=We+le.length;We>z&&E.push(...ht(b.slice(z,We)));const lt=Ze(`[${Ae??""}](${ke??""})`),xt=(lt==null?void 0:lt.label)??(Ae??"").trim(),Ot=(lt==null?void 0:lt.target)??(ke??"").trim();if(/^https?:\/\//u.test(Ot))E.push({kind:"url",value:xt||Ot,href:Ot});else{const sn=nt(Ot);sn?E.push({kind:"file",value:Ot,path:sn.path,displayPath:xt||Ot,downloadName:Be(sn.path)}):E.push({kind:"text",value:le})}z=at}return z<b.length&&E.push(...ht(b.slice(z))),E}function et(b){if(!b.includes("`"))return Ge(b);const S=[];let E=0,z=0;for(;E<b.length;){if(b[E]!=="`"){E+=1;continue}let ge=1;for(;E+ge<b.length&&b[E+ge]==="`";)ge+=1;const le="`".repeat(ge);let Ae=E+ge,ke=-1;for(;Ae<b.length;){const at=b.indexOf(le,Ae);if(at<0)break;const lt=at>0&&b[at-1]==="`",xt=at+ge<b.length&&b[at+ge]==="`",Ot=b.slice(E+ge,at).includes(`
26
+ `);if(!lt&&!xt&&!Ot){ke=at;break}Ae=at+1}if(ke<0){E+=ge;continue}E>z&&S.push(...Ge(b.slice(z,E)));const We=b.slice(E+ge,ke);if(We.length>0){const at=Ze(We);if(at)if(/^https?:\/\//u.test(at.target))S.push({kind:"url",value:at.label||at.target,href:at.target});else{const lt=nt(at.target);lt?S.push({kind:"file",value:at.target,path:lt.path,displayPath:at.label||at.target,downloadName:Be(lt.path)}):S.push({kind:"code",value:We})}else{const lt=nt(We);if(lt){const xt=lt.line?`${lt.path}:${String(lt.line)}`:lt.path;S.push({kind:"file",value:We,path:lt.path,displayPath:xt,downloadName:Be(lt.path)})}else S.push({kind:"code",value:We})}}else S.push({kind:"text",value:`${le}${le}`});E=ke+ge,z=E}return z<b.length&&S.push(...Ge(b.slice(z))),S}function W(b){const S=b.trim();if(!S)return"";if(S.startsWith("data:")||S.startsWith("blob:")||S.startsWith("http://")||S.startsWith("https://")||S.startsWith("/codex-local-image?"))return S;if(S.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(S)}`;const E=S.startsWith("/"),z=/^[A-Za-z]:[\\/]/u.test(S);return E||z?`/codex-local-image?path=${encodeURIComponent(S)}`:S}function me(b){const S=b.trim();if(!S)return"#";const E=Ae=>Ae.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(Ae),z=nt(S),ge=(z==null?void 0:z.path)??S,le=It(ge,M.cwd);if(E(le)){const Ae=le.startsWith("/")?le:`/${le}`;return`/codex-local-browse${encodeURI(Ae)}`}return"#"}function ie(b){if(!b.includes("![")||!b.includes("]("))return[{kind:"text",value:b}];const S=[],E=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let z=0;for(const ge of b.matchAll(E)){const[le,Ae,ke]=ge;if(typeof ge.index!="number")continue;const We=ge.index,at=We+le.length,lt=W(ke.trim());lt&&(We>z&&S.push({kind:"text",value:b.slice(z,We)}),S.push({kind:"image",url:lt,alt:Ae.trim(),markdown:le}),z=at)}return z<b.length&&S.push({kind:"text",value:b.slice(z)}),S.length>0?S:[{kind:"text",value:b}]}function fe(b){return b!==null&&typeof b=="object"&&!Array.isArray(b)?b:null}function De(b){const S=new Date(b);return Number.isNaN(S.getTime())?b:S.toLocaleTimeString()}function g(b){const S=fe(b.params),E=S==null?void 0:S.reason;return typeof E=="string"?E.trim():""}function v(b,S){return`${String(b)}:${S}`}function A(b){const S=fe(b.params),E=Array.isArray(S==null?void 0:S.questions)?S.questions:[],z=[];for(const ge of E){const le=fe(ge);if(!le)continue;const Ae=typeof le.id=="string"?le.id:"";if(!Ae)continue;const ke=Array.isArray(le.options)?le.options.map(We=>fe(We)).map(We=>We==null?void 0:We.label).filter(We=>typeof We=="string"&&We.length>0):[];z.push({id:Ae,header:typeof le.header=="string"?le.header:"",question:typeof le.question=="string"?le.question:"",isOther:le.isOther===!0,options:ke})}return z}function H(b,S,E){const z=v(b,S),ge=de.value[z];return typeof ge=="string"&&ge.length>0?ge:E}function F(b,S){const E=v(b,S);return ve.value[E]??""}function P(b,S,E){const z=E.target;if(!(z instanceof HTMLSelectElement))return;const ge=v(b,S);de.value={...de.value,[ge]:z.value}}function $(b,S,E){const z=E.target;if(!(z instanceof HTMLInputElement))return;const ge=v(b,S);ve.value={...ve.value,[ge]:z.value}}function L(b,S){Y("respondServerRequest",{id:b,result:{decision:S}})}function G(b){const S=A(b),E={};for(const z of S){const ge=H(b.id,z.id,z.options[0]||""),le=F(b.id,z.id).trim(),Ae=[ge,le].map(ke=>ke.trim()).filter(ke=>ke.length>0);E[z.id]={answers:Ae}}Y("respondServerRequest",{id:b.id,result:{answers:E}})}function V(b){Y("respondServerRequest",{id:b,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function be(b){Y("respondServerRequest",{id:b,result:{success:!0,contentItems:[]}})}function ae(b){Y("respondServerRequest",{id:b,result:{}})}function he(b){Y("respondServerRequest",{id:b,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function Se(b){return!(b.role!=="user"&&b.role!=="assistant"||typeof b.turnIndex!="number"||M.isTurnInProgress||M.isRollingBack)}function Oe(b){return b.role!=="user"&&b.role!=="assistant"?!1:b.text.trim().length>0}function Ke(b){return Oe(b)||Se(b)}async function xe(b){if(!Oe(b))return;const S=b.text.trim();try{await navigator.clipboard.writeText(S)}catch{const E=document.createElement("textarea");E.value=S,E.setAttribute("readonly","true"),E.style.position="fixed",E.style.opacity="0",document.body.appendChild(E),E.select(),document.execCommand("copy"),document.body.removeChild(E)}}function Ve(b){Se(b)&&Y("rollback",{turnIndex:b.turnIndex})}function _t(){const b=j.value,S=q.value;!b||!S||(b.scrollTop=b.scrollHeight,S.scrollIntoView({block:"end"}))}function U(b){return b.scrollHeight-(b.scrollTop+b.clientHeight)<=gb}function K(b){if(!M.activeThreadId)return;const S=Math.max(b.scrollHeight-b.clientHeight,0),E=S>0?Math.min(Math.max(b.scrollTop/S,0),1):1;Y("updateScrollState",{threadId:M.activeThreadId,state:{scrollTop:b.scrollTop,isAtBottom:U(b),scrollRatio:E}})}function ne(){const b=j.value;if(!b)return;const S=M.scrollState;if(!S||S.isAtBottom){Je();return}const E=Math.max(b.scrollHeight-b.clientHeight,0),z=typeof S.scrollRatio=="number"?S.scrollRatio*E:S.scrollTop;b.scrollTop=Math.min(Math.max(z,0),E),K(b)}function Je(){const b=j.value;b&&(_t(),K(b))}function it(){const b=M.scrollState;return!b||b.isAtBottom===!0}function kt(){if(!it()){ee=0,re=0;return}if(Je(),ee-=1,ee<=0){re=0;return}re=requestAnimationFrame(kt)}function Pt(b=6){it()&&(re&&(cancelAnimationFrame(re),re=0),ee=Math.max(b,1),re=requestAnimationFrame(kt))}function ln(){Pt(3)}function Sr(){if(!it())return;const b=j.value;if(!b)return;const S=b.querySelectorAll("img.message-image-preview");for(const E of S)E.complete||ye.has(E)||(ye.add(E),E.addEventListener("load",ln,{once:!0}),E.addEventListener("error",ln,{once:!0}))}async function rn(){await tn(),Ie&&cancelAnimationFrame(Ie),Ie=requestAnimationFrame(()=>{Ie=0,ne(),Sr(),Pt()})}mt(()=>M.messages,async b=>{if(!M.isLoading){for(const S of b){if(S.messageType!=="commandExecution"||!S.commandExecution)continue;const E=o.value[S.id],z=S.commandExecution.status;E==="inProgress"&&z!=="inProgress"&&N(S.id),o.value[S.id]=z}await rn()}}),mt(()=>M.liveOverlay,async b=>{b&&(await tn(),Je(),Pt(8))},{deep:!0}),mt(()=>M.isLoading,async b=>{b||await rn()}),mt(()=>M.activeThreadId,()=>{oe.value="",te.value=new Set},{flush:"post"});function Ne(){const b=j.value;!b||M.isLoading||K(b)}function Me(b){oe.value=W(b)}function fn(b,S){return`${b}:${String(S)}`}function jt(b,S){const E=new Set(te.value);E.add(fn(b,S)),te.value=E}function Er(b,S){return te.value.has(fn(b,S))}function _n(){oe.value=""}function kn(){const b=B.value;b&&(b.scrollTop=b.scrollHeight)}return mt(()=>{var b;return(b=M.liveOverlay)==null?void 0:b.reasoningText},async b=>{b&&(await tn(),kn())}),ar(()=>{Ie&&cancelAnimationFrame(Ie),re&&cancelAnimationFrame(re)}),(b,S)=>(w(),T("section",qy,[e.isLoading?(w(),T("p",Gy,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),T("p",Ky," No messages in this thread yet. ")):(w(),T("ul",{key:2,ref_key:"conversationListRef",ref:j,class:"conversation-list",onScroll:Ne},[(w(!0),T(He,null,Et(e.pendingRequests,E=>(w(),T("li",{key:`server-request:${E.id}`,class:"conversation-item conversation-item-request"},[m("div",Jy,[m("div",Yy,[m("article",Qy,[m("p",Xy,ce(E.method),1),m("p",Zy,"Request #"+ce(E.id)+" · "+ce(De(E.receivedAtIso)),1),g(E)?(w(),T("p",ew,ce(g(E)),1)):se("",!0),E.method==="item/commandExecution/requestApproval"?(w(),T("section",tw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>L(E.id,"accept")},"Accept",8,nw),m("button",{type:"button",class:"request-button",onClick:z=>L(E.id,"acceptForSession")},"Accept for Session",8,rw),m("button",{type:"button",class:"request-button",onClick:z=>L(E.id,"decline")},"Decline",8,sw),m("button",{type:"button",class:"request-button",onClick:z=>L(E.id,"cancel")},"Cancel",8,ow)])):E.method==="item/fileChange/requestApproval"?(w(),T("section",iw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>L(E.id,"accept")},"Accept",8,aw),m("button",{type:"button",class:"request-button",onClick:z=>L(E.id,"acceptForSession")},"Accept for Session",8,lw),m("button",{type:"button",class:"request-button",onClick:z=>L(E.id,"decline")},"Decline",8,cw),m("button",{type:"button",class:"request-button",onClick:z=>L(E.id,"cancel")},"Cancel",8,uw)])):E.method==="item/tool/requestUserInput"?(w(),T("section",dw,[(w(!0),T(He,null,Et(A(E),z=>(w(),T("div",{key:`${E.id}:${z.id}`,class:"request-question"},[m("p",fw,ce(z.header||z.question),1),z.header&&z.question?(w(),T("p",hw,ce(z.question),1)):se("",!0),m("select",{class:"request-select",value:H(E.id,z.id,z.options[0]||""),onChange:ge=>P(E.id,z.id,ge)},[(w(!0),T(He,null,Et(z.options,ge=>(w(),T("option",{key:`${E.id}:${z.id}:${ge}`,value:ge},ce(ge),9,mw))),128))],40,pw),z.isOther?(w(),T("input",{key:1,class:"request-input",type:"text",value:F(E.id,z.id),placeholder:"Other answer",onInput:ge=>$(E.id,z.id,ge)},null,40,gw)):se("",!0)]))),128)),m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>G(E)}," Submit Answers ",8,vw)])):E.method==="item/tool/call"?(w(),T("section",yw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>V(E.id)},"Fail Tool Call",8,ww),m("button",{type:"button",class:"request-button",onClick:z=>be(E.id)},"Success (Empty)",8,bw)])):(w(),T("section",_w,[m("button",{type:"button",class:"request-button request-button-primary",onClick:z=>ae(E.id)},"Return Empty Result",8,kw),m("button",{type:"button",class:"request-button",onClick:z=>he(E.id)},"Reject Request",8,Tw)]))])])])]))),128)),(w(!0),T(He,null,Et(e.messages,E=>{var z,ge;return w(),T("li",{key:E.id,class:gt(["conversation-item",{"conversation-item-actionable":Ke(E)}]),"data-role":E.role,"data-message-type":E.messageType||""},[i(E)?(w(),T("div",Sw,[m("div",Ew,[m("button",{type:"button",class:gt(["cmd-row",[_(E),{"cmd-expanded":a(E)}]]),onClick:le=>u(E)},[m("span",{class:gt(["cmd-chevron",{"cmd-chevron-open":a(E)}])},"▶",2),m("code",Aw,ce(((z=E.commandExecution)==null?void 0:z.command)||"(command)"),1),m("span",Rw,ce(p(E)),1)],10,Cw),m("div",{class:gt(["cmd-output-wrap",{"cmd-output-visible":a(E),"cmd-output-collapsing":l(E)}])},[m("div",Pw,[m("pre",xw,ce(((ge=E.commandExecution)==null?void 0:ge.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),T("div",{key:1,class:"message-row","data-role":E.role,"data-message-type":E.messageType||""},[m("div",{class:"message-stack","data-role":E.role},[m("article",{class:"message-body","data-role":E.role},[E.images&&E.images.length>0?(w(),T("ul",{key:0,class:"message-image-list","data-role":E.role},[(w(!0),T(He,null,Et(E.images,le=>(w(),T("li",{key:le,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:Ae=>Me(le)},[m("img",{class:"message-image-preview",src:W(le),alt:"Message image preview",loading:"lazy"},null,8,Lw)],8,Dw)]))),128))],8,$w)):se("",!0),E.fileAttachments&&E.fileAttachments.length>0?(w(),T("div",jw,[(w(!0),T(He,null,Et(E.fileAttachments,le=>(w(),T("span",{key:le.path,class:"message-file-chip"},[S[1]||(S[1]=m("span",{class:"message-file-chip-icon"},"📄",-1)),m("a",{class:"message-file-link message-file-chip-name",href:me(le.path),target:"_blank",rel:"noopener noreferrer",title:le.path},ce(le.path),9,Bw)]))),128))])):se("",!0),E.text.length>0?(w(),T("article",{key:2,class:"message-card","data-role":E.role},[E.messageType==="worked"?(w(),T("div",Fw,[m("button",{type:"button",class:"worked-separator",onClick:le=>c(E)},[S[2]||(S[2]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),m("span",{class:gt(["worked-chevron",{"worked-chevron-open":f(E)}])},"▶",2),m("p",Vw,ce(E.text),1),S[3]||(S[3]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Hw),f(E)?(w(),T("div",Ww,[(w(!0),T(He,null,Et(I(e.messages,e.messages.indexOf(E)),le=>{var Ae,ke;return w(),T("div",{key:`worked-cmd-${le.id}`,class:"worked-cmd-item"},[m("button",{type:"button",class:gt(["cmd-row",[_(le),{"cmd-expanded":a(le)}]]),onClick:We=>u(le)},[m("span",{class:gt(["cmd-chevron",{"cmd-chevron-open":a(le)}])},"▶",2),m("code",qw,ce(((Ae=le.commandExecution)==null?void 0:Ae.command)||"(command)"),1),m("span",Gw,ce(p(le)),1)],10,zw),m("div",{class:gt(["cmd-output-wrap",{"cmd-output-visible":a(le),"cmd-output-collapsing":l(le)}])},[m("div",Kw,[m("pre",Jw,ce(((ke=le.commandExecution)==null?void 0:ke.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):se("",!0)])):(w(),T("div",Yw,[(w(!0),T(He,null,Et(ie(E.text),(le,Ae)=>(w(),T(He,{key:`block-${Ae}`},[le.kind==="text"?(w(),T("p",Qw,[(w(!0),T(He,null,Et(et(le.value),(ke,We)=>(w(),T(He,{key:`seg-${Ae}-${We}`},[ke.kind==="text"?(w(),T("span",Xw,ce(ke.value),1)):ke.kind==="bold"?(w(),T("strong",Zw,ce(ke.value),1)):ke.kind==="file"?(w(),T("a",{key:2,class:"message-file-link",href:me(ke.path),target:"_blank",rel:"noopener noreferrer",title:ke.path},ce(ke.displayPath),9,eb)):ke.kind==="url"?(w(),T("a",{key:3,class:"message-file-link",href:ke.href,target:"_blank",rel:"noopener noreferrer",title:ke.href},ce(ke.value),9,tb)):(w(),T("code",nb,ce(ke.value),1))],64))),128))])):Er(E.id,Ae)?(w(),T("p",rb,ce(le.markdown),1)):(w(),T("button",{key:2,class:"message-image-button",type:"button",onClick:ke=>Me(le.url)},[m("img",{class:"message-image-preview message-markdown-image",src:le.url,alt:le.alt||"Embedded message image",loading:"lazy",onError:ke=>jt(E.id,Ae)},null,40,ob)],8,sb))],64))),128))]))],8,Uw)):se("",!0)],8,Nw),Ke(E)?(w(),T("div",ib,[Oe(E)?(w(),T("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:le=>xe(E)},[Ce(zy,{class:"message-action-icon"}),S[4]||(S[4]=m("span",{class:"message-action-label"},"Copy",-1))],8,ab)):se("",!0),Se(E)?(w(),T("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:le=>Ve(E)},[Ce(Fy,{class:"message-action-icon"}),S[5]||(S[5]=m("span",{class:"message-action-label"},"Rollback",-1))],8,lb)):se("",!0)])):se("",!0)],8,Mw)],8,Ow))],10,Iw)}),128)),e.liveOverlay?(w(),T("li",cb,[m("div",ub,[m("div",db,[m("article",fb,[m("p",hb,ce(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),T("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:B},ce(e.liveOverlay.reasoningText),513)):se("",!0),e.liveOverlay.errorText?(w(),T("p",pb,ce(e.liveOverlay.errorText),1)):se("",!0)])])])])):se("",!0),m("li",{ref_key:"bottomAnchorRef",ref:q,class:"conversation-bottom-anchor"},null,512)],544)),oe.value.length>0?(w(),T("div",{key:3,class:"image-modal-backdrop",onClick:_n},[m("div",{class:"image-modal-content",onClick:S[0]||(S[0]=tt(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:_n},[Ce(Ya,{class:"icon-svg"})]),m("img",{class:"image-modal-image",src:oe.value,alt:"Expanded message image"},null,8,mb)])])):se("",!0)]))}}),yb=st(vb,[["__scopeId","data-v-b2208f01"]]);function wb(e){var c;const t=D("idle"),n=D(typeof navigator<"u"&&!!((c=navigator.mediaDevices)!=null&&c.getUserMedia));let r=null,s=null,o=[];async function i(){var f;if(!(t.value!=="idle"||!n.value))try{s=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),o=[],r=new MediaRecorder(s),r.ondataavailable=p=>{p.data.size>0&&o.push(p.data)},r.onstop=()=>{var N;const p=o,_=(r==null?void 0:r.mimeType)||((N=p[0])==null?void 0:N.type)||"audio/webm";u(),t.value="idle",l(p,_)},r.start(),t.value="recording"}catch(p){u(),(f=e.onError)==null||f.call(e,p)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,p){var N;if(f.length===0)return;const _=new Blob(f,{type:p});try{const I=p.split(/[/;]/)[1]??"webm",M=`----codex-transcribe-${crypto.randomUUID()}`,Y=new Uint8Array(await _.arrayBuffer()),j=new TextEncoder,q=[];q.push(j.encode(`--${M}\r
27
+ `)),q.push(j.encode(`Content-Disposition: form-data; name="file"; filename="codex.${I}"\r
28
+ `)),q.push(j.encode(`Content-Type: ${p}\r
29
+ \r
30
+ `)),q.push(Y),q.push(j.encode(`\r
31
+ --${M}--\r
32
+ `));let B=0;for(const ee of q)B+=ee.byteLength;const oe=new Uint8Array(B);let de=0;for(const ee of q)oe.set(ee,de),de+=ee.byteLength;const ve=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${M}`},body:oe});if(!ve.ok)throw new Error(`Transcription failed: ${ve.status}`);const re=((await ve.json()).text??"").trim();re.length>0&&e.onTranscript(re)}catch(I){(N=e.onError)==null||N.call(e,I)}finally{t.value!=="recording"&&(t.value="idle")}}function u(){r&&(r.ondataavailable=null,r.onstop=null,r=null),s&&(s.getTracks().forEach(f=>f.stop()),s=null),o=[]}return ar(u),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Rc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Qn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Qa(e,t){const n=Rc(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Rc(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function ws(e,t,n){return e instanceof Qn?e:e instanceof Error?new Qn(e.message||t,{code:"unknown_error",method:n}):new Qn(t,{code:"unknown_error",method:n})}function Yd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function bb(e,t){const n={method:e,params:t??null};let r;try{r=await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(i){throw new Qn(i instanceof Error?i.message:`RPC ${e} failed before request was sent`,{code:"network_error",method:e})}let s=null;try{s=await r.json()}catch{s=null}if(!r.ok)throw new Qn(Qa(s,`RPC ${e} failed with HTTP ${r.status}`),{code:"http_error",method:e,status:r.status});const o=s;if(!o||typeof o!="object"||!("result"in o))throw new Qn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Pc(e){const t=Yd(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 _b(e){if(typeof window>"u")return()=>{};let t=null,n=!1;const r=()=>{if(typeof EventSource>"u"||n)return;const s=new EventSource("/codex-api/events");s.onmessage=o=>{try{const i=JSON.parse(o.data),a=Pc(i);a&&e(a)}catch{}},t=()=>s.close()};if(typeof WebSocket<"u"){const s=window.location.protocol==="https:"?"wss:":"ws:",o=new WebSocket(`${s}//${window.location.host}/codex-api/ws`);let i=!1,a=window.setTimeout(()=>{i||n||(o.close(),r())},2500);o.onopen=()=>{i=!0,a!==null&&(window.clearTimeout(a),a=null)},o.onmessage=l=>{try{const u=JSON.parse(String(l.data)),c=Pc(u);c&&e(c)}catch{}},o.onerror=()=>{!i&&!n&&r()},o.onclose=()=>{a!==null&&(window.clearTimeout(a),a=null),!i&&!n&&r()},t=()=>o.close()}else r();return()=>{n=!0,t==null||t()}}async function kb(e){let t;try{t=await fetch("/codex-api/server-requests/respond",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(r){throw new Qn(r instanceof Error?r.message:"Failed to reply to server request",{code:"network_error",method:"server-requests/respond"})}let n=null;try{n=await t.json()}catch{n=null}if(!t.ok)throw new Qn(Qa(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Tb(){const e=await fetch("/codex-api/server-requests/pending");let t=null;try{t=await e.json()}catch{t=null}if(!e.ok)throw new Qn(Qa(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Yd(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function xc(e){return new Date(e*1e3).toISOString()}function Ib(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Sb(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Eb=/^##\s+(.+?):\s+(.+?)\s*$/,Cb=/^#\s*files mentioned by the user\s*:?\s*$/i;function Ab(e){var s,o;const t=e.split(`
33
+ `).findIndex(i=>Cb.test(i.trim()));if(t<0)return[];const n=e.split(`
34
+ `).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(Eb);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 Rb(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 Pb(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:Sb(l),isUnhandled:!0});const o=n.join(`
35
+ `),i=Ab(o);return{text:Rb(o),images:r,fileAttachments:i,rawBlocks:s}}function xb(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Pb(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=Ob(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 Ob(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Mb(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Nb(e){const t=Mb(e);return t.length>0?t:"Untitled thread"}function Qd(e){return(e==null?void 0:e.status)==="inProgress"}function $b(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 Qd(r)}function Db(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:Nb(e),projectName:Ib(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:xc(e.createdAt),updatedAtIso:xc(e.updatedAt),preview:e.preview,unread:!1,inProgress:$b(e)}}function Lb(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 jb(e){const t=e.data.map(Db);return Lb(t)}function Xd(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 xb(i))n.push({...a,turnIndex:r})}return n}function Bb(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return Qd(t.at(-1))}async function nn(e,t){try{return await bb(e,t)}catch(n){throw ws(n,`RPC ${e} failed`,e)}}function Ub(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Fb(){const e=await nn("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return jb(e)}async function Hb(e){const t=await nn("thread/read",{threadId:e,includeTurns:!0});return{messages:Xd(t),inProgress:Bb(t)}}async function Vb(){try{return await Fb()}catch(e){throw ws(e,"Failed to load thread groups","thread/list")}}async function Wb(e){try{return await Hb(e)}catch(t){throw ws(t,`Failed to load thread ${e}`,"thread/read")}}function zb(e){return _b(e)}async function qb(e,t){await kb({id:e,...t})}async function Gb(){return Tb()}async function Mi(e){await nn("thread/resume",{threadId:e})}async function Kb(e){await nn("thread/archive",{threadId:e})}async function Jb(e,t){await nn("thread/name/set",{threadId:e,name:t})}async function Oc(e,t){const n=await nn("thread/rollback",{threadId:e,numTurns:t});return Xd(n)}function Yb(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 Mc(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=Yb(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw ws(n,"Failed to start a new thread","thread/start")}}function Qb(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
36
+ `;for(const r of t)n+=`
37
+ ## ${r.label}: ${r.path}
38
+ `;return`${n}
39
+ ## My request for Codex:
40
+
41
+ ${e}
42
+ `}async function Ni(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:Qb(t,i)}];for(const f of n){const p=f.trim();p&&l.push({type:"image",url:p,image_url:p})}if(o)for(const f of o)l.push({type:"skill",name:f.name,path:f.path});const u=i.map(f=>({label:f.label,path:f.path,fsPath:f.fsPath})),c={threadId:e,input:l};u.length>0&&(c.attachments=u),typeof r=="string"&&r.length>0&&(c.model=r),typeof s=="string"&&s.length>0&&(c.effort=s),await nn("turn/start",c)}catch(a){throw ws(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function Xb(e,t){const n=e.trim(),r=(t==null?void 0:t.trim())||"";if(n)try{if(!r)throw new Error("turn/interrupt requires turnId");await nn("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw ws(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function Zb(e){await nn("setDefaultModel",{model:e})}async function e_(){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 t_(){const e=await nn("config/read",{}),t=e.config.model??"",n=Ub(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function n_(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 pa(){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 n_(n.data)}async function r_(e){const t=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e})}),n=await t.json();if(!t.ok||!n.data)throw new Error(n.error||"Failed to create worktree");return n.data}async function Nc(){const e=await fetch("/codex-api/home-directory"),t=await e.json();if(!e.ok)throw new Error("Failed to load home directory");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return typeof r.path=="string"?r.path.trim():""}async function s_(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 o_(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=Xa(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 i_(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=Xa(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 a_(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=Xa(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,p=typeof f=="string"?f.trim():"";p&&l.push({path:p})}return l}async function l_(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 Xa(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 c_(){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 $i(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 u_(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 d_(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 f_(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 h_={},p_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function m_(e,t){return w(),T("svg",p_,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 5l0 14m-6-8l6-6l6 6"},null,-1)])])}const g_=st(h_,[["render",m_]]),v_={},y_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function w_(e,t){return w(),T("svg",y_,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 2m0 3a3 3 0 0 1 3-3h0a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h0a3 3 0 0 1-3-3zM5 10a7 7 0 0 0 14 0M8 21h8M12 17v4"},null,-1)])])}const b_=st(v_,[["render",w_]]),__={},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 w(),T("svg",k_,[...t[0]||(t[0]=[m("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),m("path",{fill:"currentColor",d:"M8 5a3 3 0 0 0 -3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3 -3v-8a3 3 0 0 0 -3 -3h-8z"},null,-1)])])}const I_=st(__,[["render",T_]]),S_=["disabled"],E_={class:"composer-dropdown-value"},C_={class:"composer-dropdown-menu"},A_={key:0,class:"composer-dropdown-search-wrap"},R_=["placeholder","onKeydown"],P_={class:"composer-dropdown-options",role:"listbox"},x_=["onClick"],O_={key:0,class:"composer-dropdown-empty"},M_={key:1,class:"composer-dropdown-add-wrap"},N_=["placeholder","onKeydown"],$_=Lt({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(null),a=D(!1),l=D(""),u=D(!1),c=D(""),f=pe(()=>{var ye;const ee=n.options.find(te=>te.value===n.modelValue);return ee?ee.label:((ye=n.placeholder)==null?void 0:ye.trim())||""}),p=pe(()=>n.openDirection??"down"),_=pe(()=>n.enableSearch===!0),N=pe(()=>n.showAddAction===!0),I=pe(()=>{var ee;return((ee=n.searchPlaceholder)==null?void 0:ee.trim())||"Quick search projects"}),M=pe(()=>{var ee;return((ee=n.addActionLabel)==null?void 0:ee.trim())||"Add new project"}),Y=pe(()=>{var ee;return((ee=n.addPlaceholder)==null?void 0:ee.trim())||"Project name or absolute path"}),j=pe(()=>{const ee=l.value.trim().toLowerCase();return ee?n.options.filter(ye=>ye.label.toLowerCase().includes(ee)||ye.value.toLowerCase().includes(ee)):n.options});function q(){n.disabled||(a.value=!a.value)}function B(ee){r("update:modelValue",ee),a.value=!1,l.value=""}function oe(){var ee;u.value=!0,c.value=((ee=n.defaultAddValue)==null?void 0:ee.trim())||"",tn(()=>{var ye;return(ye=i.value)==null?void 0:ye.focus()})}function de(){if(l.value.length>0){l.value="";return}a.value=!1}function ve(){const ee=c.value.trim();ee&&(r("add",ee),u.value=!1,c.value="",a.value=!1,l.value="")}function Ie(){u.value=!1,c.value="",a.value=!1,l.value=""}function re(ee){if(!a.value)return;const ye=s.value;if(!ye)return;const te=ee.target;te instanceof Node&&(ye.contains(te)||(a.value=!1,l.value="",u.value=!1,c.value=""))}return mt(a,ee=>{if(!ee){u.value=!1,c.value="";return}_.value&&tn(()=>{var ye;return(ye=o.value)==null?void 0:ye.focus()})}),ir(()=>{window.addEventListener("pointerdown",re)}),ar(()=>{window.removeEventListener("pointerdown",re)}),(ee,ye)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:q},[m("span",E_,ce(f.value),1),Ce(ci,{class:"composer-dropdown-chevron"})],8,S_),a.value?(w(),T("div",{key:0,class:gt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":p.value==="up","composer-dropdown-menu-wrap-down":p.value==="down"}])},[m("div",C_,[_.value?(w(),T("div",A_,[tr(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ye[0]||(ye[0]=te=>l.value=te),class:"composer-dropdown-search-input",type:"text",placeholder:I.value,onKeydown:Yt(tt(de,["prevent"]),["esc"])},null,40,R_),[[nr,l.value]])])):se("",!0),m("ul",P_,[(w(!0),T(He,null,Et(j.value,te=>(w(),T("li",{key:te.value},[m("button",{class:gt(["composer-dropdown-option",{"is-selected":te.value===e.modelValue}]),type:"button",onClick:je=>B(te.value)},ce(te.label),11,x_)]))),128)),j.value.length===0?(w(),T("li",O_," No matching projects ")):se("",!0)]),N.value?(w(),T("div",M_,[u.value?(w(),T(He,{key:0},[tr(m("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ye[1]||(ye[1]=te=>c.value=te),class:"composer-dropdown-add-input",type:"text",placeholder:Y.value,onKeydown:[Yt(tt(ve,["prevent"]),["enter"]),Yt(tt(Ie,["prevent"]),["esc"])]},null,40,N_),[[nr,c.value]]),m("div",{class:"composer-dropdown-add-actions"},[m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ve},"Open"),m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Ie},"Cancel")])],64)):(w(),T("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:oe},ce(M.value),1))])):se("",!0)])],2)):se("",!0)],512))}}),ma=st($_,[["__scopeId","data-v-7cfa2012"]]),D_=["disabled"],L_={class:"search-dropdown-value"},j_={class:"search-dropdown-search-wrap"},B_=["placeholder","onKeydown"],U_={key:0,class:"search-dropdown-list",role:"listbox"},F_=["onClick","onPointerenter"],H_={class:"search-dropdown-option-check"},V_={class:"search-dropdown-option-label"},W_={key:0,class:"search-dropdown-option-desc"},z_={key:1,class:"search-dropdown-empty"},q_=Lt({__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=pe(()=>n.openDirection??"down"),c=pe(()=>new Set(n.selectedValues)),f=pe(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const j=n.options.find(q=>q.value===n.selectedValues[0]);return(j==null?void 0:j.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),p=pe(()=>{const j=a.value.toLowerCase().trim();return j?n.options.filter(q=>{var B;return q.label.toLowerCase().includes(j)||(((B=q.description)==null?void 0:B.toLowerCase().includes(j))??!1)}):n.options});function _(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,tn(()=>{var j;return(j=o.value)==null?void 0:j.focus()})))}function N(j){r("toggle",j.value,!c.value.has(j.value))}function I(j){p.value.length!==0&&(l.value=(l.value+j+p.value.length)%p.value.length)}function M(){const j=p.value[l.value];j&&N(j)}function Y(j){if(!i.value)return;const q=s.value;if(!q)return;const B=j.target;B instanceof Node&&(q.contains(B)||(i.value=!1))}return mt(a,()=>{l.value=0}),ir(()=>window.addEventListener("pointerdown",Y)),ar(()=>window.removeEventListener("pointerdown",Y)),(j,q)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:_},[m("span",L_,ce(f.value),1),Ce(ci,{class:"search-dropdown-chevron"})],8,D_),i.value?(w(),T("div",{key:0,class:gt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":u.value==="up","search-dropdown-menu-wrap-down":u.value==="down"}])},[m("div",j_,[tr(m("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":q[0]||(q[0]=B=>a.value=B),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[q[1]||(q[1]=Yt(tt(B=>i.value=!1,["prevent"]),["escape"])),Yt(tt(M,["prevent"]),["enter"]),q[2]||(q[2]=Yt(tt(B=>I(1),["prevent"]),["arrow-down"])),q[3]||(q[3]=Yt(tt(B=>I(-1),["prevent"]),["arrow-up"]))]},null,40,B_),[[nr,a.value]])]),p.value.length>0?(w(),T("ul",U_,[(w(!0),T(He,null,Et(p.value,(B,oe)=>(w(),T("li",{key:B.value},[m("button",{class:gt(["search-dropdown-option",{"is-selected":c.value.has(B.value),"is-highlighted":oe===l.value}]),type:"button",onClick:de=>N(B),onPointerenter:de=>l.value=oe},[m("span",H_,ce(c.value.has(B.value)?"✓":""),1),m("span",V_,ce(B.label),1),B.description?(w(),T("span",W_,ce(B.description),1)):se("",!0)],42,F_)]))),128))])):(w(),T("div",z_,"No results"))],2)):se("",!0)],512))}}),G_=st(q_,[["__scopeId","data-v-a0f2edd4"]]),K_={class:"skill-picker-header"},J_=["onKeydown"],Y_={key:0,class:"skill-picker-list",role:"listbox"},Q_=["onClick","onPointerenter"],X_={class:"skill-picker-name"},Z_={key:0,class:"skill-picker-desc"},ek={key:1,class:"skill-picker-empty"},tk=Lt({__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=pe(()=>{const p=i.value.toLowerCase().trim();return p?n.skills.filter(_=>_.name.toLowerCase().includes(p)||_.description.toLowerCase().includes(p)):n.skills}),u=pe(()=>{const p={};return n.anchorBottom!=null&&(p.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(p.left=`${n.anchorLeft}px`),p});function c(p){l.value.length!==0&&(a.value=(a.value+p+l.value.length)%l.value.length)}function f(){const p=l.value[a.value];p&&r("select",p)}return mt(()=>n.visible,p=>{p&&(i.value="",a.value=0,tn(()=>{var _;return(_=o.value)==null?void 0:_.focus()}))}),mt(i,()=>{a.value=0}),(p,_)=>e.visible?(w(),T("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:zr(u.value)},[m("div",K_,[tr(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":_[0]||(_[0]=N=>i.value=N),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[_[1]||(_[1]=Yt(tt(N=>p.$emit("close"),["prevent"]),["escape"])),Yt(tt(f,["prevent"]),["enter"]),_[2]||(_[2]=Yt(tt(N=>c(1),["prevent"]),["arrow-down"])),_[3]||(_[3]=Yt(tt(N=>c(-1),["prevent"]),["arrow-up"]))]},null,40,J_),[[nr,i.value]])]),l.value.length>0?(w(),T("ul",Y_,[(w(!0),T(He,null,Et(l.value,(N,I)=>(w(),T("li",{key:N.path},[m("button",{class:gt(["skill-picker-item",{"is-highlighted":I===a.value}]),type:"button",onClick:M=>p.$emit("select",N),onPointerenter:M=>a.value=I},[m("span",X_,ce(N.name),1),N.description?(w(),T("span",Z_,ce(N.description),1)):se("",!0)],42,Q_)]))),128))])):(w(),T("div",ek,"No skills found"))],4)):se("",!0)}}),nk=st(tk,[["__scopeId","data-v-ff3fb7dc"]]),rk={key:0,class:"thread-composer-attachments"},sk=["src","alt"],ok=["aria-label","disabled","onClick"],ik={key:1,class:"thread-composer-file-chips"},ak=["title"],lk=["aria-label","disabled","onClick"],ck={key:2,class:"thread-composer-skill-chips"},uk={class:"thread-composer-skill-chip-name"},dk=["aria-label","onClick"],fk={class:"thread-composer-input-wrap"},hk={key:0,class:"thread-composer-file-mentions"},pk=["onMousedown"],mk={key:1,class:"thread-composer-file-mention-icon-markdown"},gk={class:"thread-composer-file-mention-text"},vk={class:"thread-composer-file-mention-name"},yk={key:0,class:"thread-composer-file-mention-dir"},wk={key:1,class:"thread-composer-file-mention-empty"},bk=["placeholder","disabled"],_k={class:"thread-composer-controls"},kk=["disabled"],Tk={key:0,class:"thread-composer-attach-menu"},Ik=["disabled"],Sk=["disabled"],Ek={class:"thread-composer-actions"},Ck=["aria-label","title","disabled"],Ak=["disabled"],Rk=["aria-label","title","disabled"],Pk=["disabled"],xk=["disabled"],Ok=Lt({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=D(""),o=D([]),i=D([]),a=D([]),{state:l,isSupported:u,startRecording:c,stopRecording:f}=wb({onTranscript:U=>{s.value=s.value?`${s.value}
43
+ ${U}`:U}}),p=D(null),_=D(null),N=D(null),I=D(null),M=D(!1),Y=D(!1),j=D(null),q=D(""),B=D([]),oe=D(!1),de=D(0);let ve=0,Ie=null;const re=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),ee=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],ye=pe(()=>n.models.map(U=>({value:U,label:U}))),te=pe(()=>n.skills??[]),je=pe(()=>i.value.map(U=>U.path)),Be=pe(()=>(n.skills??[]).map(U=>({value:U.path,label:U.name,description:U.description}))),Qe=pe(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Re=pe(()=>n.disabled||!n.activeThreadId),Te=pe(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),$e=pe(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function It(U="steer"){var ne;const K=s.value.trim();if(Qe.value){if(r("submit",{text:K,imageUrls:o.value.map(Je=>Je.url),fileAttachments:[...a.value],skills:i.value.map(Je=>({name:Je.name,path:Je.path})),mode:U}),s.value="",o.value=[],i.value=[],a.value=[],M.value=!1,Y.value=!1,$(),re){(ne=I.value)==null||ne.blur();return}tn(()=>{var Je;return(Je=I.value)==null?void 0:Je.focus()})}}function nt(){r("interrupt")}function Xe(U){r("update:selected-model",U)}function Ze(U){r("update:selected-reasoning-effort",U)}function ht(){Re.value||(M.value=!M.value)}function Rt(){var U;(U=_.value)==null||U.click()}function Ge(){var U;(U=N.value)==null||U.click()}function et(U){o.value=o.value.filter(K=>K.id!==U)}function W(U){i.value=i.value.filter(K=>K.path!==U)}function me(U){a.value=a.value.filter(K=>K.fsPath!==U)}function ie(U){const K=U.replace(/\\/g,"/");if(a.value.some(it=>it.fsPath===K))return;const ne=K.split("/").filter(Boolean),Je=ne[ne.length-1]??K;a.value=[...a.value,{label:Je,path:K,fsPath:K}]}function fe(U){return U.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(U.name)}function De(U){if(!(!U||U.length===0))for(const K of Array.from(U))if(fe(K)){const ne=new FileReader;ne.onload=()=>{typeof ne.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:K.name,url:ne.result})},ne.readAsDataURL(K)}else f_(K).then(ne=>{ne&&ie(ne)}).catch(()=>{})}function g(U){U&&(U.value="")}function v(U){const K=U.target;De((K==null?void 0:K.files)??null),g(K),M.value=!1}function A(U){const K=U.target;De((K==null?void 0:K.files)??null),g(K),M.value=!1}function H(){const K=s.value.startsWith("/");K!==Y.value&&(Y.value=K),L()}function F(U){if(oe.value){if(U.key==="Escape"){U.preventDefault(),$();return}if(U.key==="ArrowDown"){U.preventDefault(),B.value.length>0&&(de.value=(de.value+1)%B.value.length);return}if(U.key==="ArrowUp"){if(U.preventDefault(),B.value.length>0){const ne=B.value.length;de.value=(de.value+ne-1)%ne}return}if(U.key==="Enter"||U.key==="Tab"){U.preventDefault();const ne=B.value[de.value];ne?V(ne):$();return}}if(n.sendWithEnter!==!1?U.key==="Enter"&&!U.shiftKey:U.key==="Enter"&&(U.metaKey||U.ctrlKey)){U.preventDefault(),It(n.isTurnInProgress?Te.value:"steer");return}if(Y.value){if(U.key==="Escape"){U.preventDefault(),P();return}if(U.key==="ArrowDown"||U.key==="ArrowUp"){U.preventDefault();return}}}function P(){var U;Y.value=!1,(U=I.value)==null||U.focus()}function $(){oe.value=!1,j.value=null,q.value="",B.value=[],de.value=0}function L(){const U=I.value;if(!U){$();return}const K=U.selectionStart??s.value.length,Je=s.value.slice(0,K).match(/(^|\s)(@[^\s@]*)$/);if(!Je){$();return}const it=Je[2]??"",kt=it.length,Pt=K-kt;j.value=Pt,q.value=it.slice(1),oe.value=!0,G()}async function G(){if(!oe.value)return;const U=(n.cwd??"").trim();if(!U){B.value=[];return}Ie&&clearTimeout(Ie);const K=++ve;Ie=setTimeout(async()=>{try{const ne=await a_(U,q.value,20);if(!oe.value||K!==ve)return;B.value=ne,de.value=0}catch{if(!oe.value||K!==ve)return;B.value=[]}},120)}function V(U){const K=I.value,ne=j.value;if(ne!==null&&K){const Je=K.selectionStart??s.value.length;s.value=`${s.value.slice(0,ne)}${s.value.slice(Je)}`.trimEnd()}ie(U.path),$(),tn(()=>K==null?void 0:K.focus())}function be(U){const K=U.lastIndexOf("/");return K<0?U:U.slice(K+1)}function ae(U){const K=U.lastIndexOf("/");return K<=0?"":U.slice(0,K)}function he(U){const K=be(U),ne=K.lastIndexOf(".");return ne<=0?"":K.slice(ne+1).toLowerCase()}function Se(U){const K=he(U);return K==="ts"?"TS":K==="tsx"?"TSX":K==="js"?"JS":K==="jsx"?"JSX":K==="json"?"{}":""}function Oe(U){const K=he(U);return K.startsWith("ts")?"ts":K.startsWith("js")?"js":K==="json"?"json":"default"}function Ke(U){const K=he(U);return K==="md"||K==="mdx"}function xe(U){var K;i.value.some(ne=>ne.path===U.path)||(i.value=[...i.value,U]),s.value=s.value.startsWith("/")?"":s.value,Y.value=!1,(K=I.value)==null||K.focus()}function Ve(U,K){if(K){const ne=(n.skills??[]).find(Je=>Je.path===U);ne&&!i.value.some(Je=>Je.path===U)&&(i.value=[...i.value,ne])}else i.value=i.value.filter(ne=>ne.path!==U)}function _t(U){if(!M.value)return;const K=p.value;if(!K)return;const ne=U.target;!ne||K.contains(ne)||(M.value=!1)}return ir(()=>{document.addEventListener("click",_t)}),ar(()=>{document.removeEventListener("click",_t),Ie&&clearTimeout(Ie)}),mt(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],M.value=!1,Y.value=!1,$()}),mt(()=>n.cwd,()=>{oe.value&&G()}),(U,K)=>(w(),T("form",{class:"thread-composer",onSubmit:K[7]||(K[7]=tt(ne=>It("steer"),["prevent"]))},[m("div",{class:gt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(w(),T("div",rk,[(w(!0),T(He,null,Et(o.value,ne=>(w(),T("div",{key:ne.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:ne.url,alt:ne.name||"Selected image"},null,8,sk),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${ne.name||"image"}`,disabled:Re.value,onClick:Je=>et(ne.id)}," x ",8,ok)]))),128))])):se("",!0),a.value.length>0?(w(),T("div",ik,[(w(!0),T(He,null,Et(a.value,ne=>(w(),T("span",{key:ne.fsPath,class:"thread-composer-file-chip"},[Ce(Uo,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:ne.fsPath},ce(ne.label),9,ak),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${ne.label}`,disabled:Re.value,onClick:Je=>me(ne.fsPath)},"×",8,lk)]))),128))])):se("",!0),i.value.length>0?(w(),T("div",ck,[(w(!0),T(He,null,Et(i.value,ne=>(w(),T("span",{key:ne.path,class:"thread-composer-skill-chip"},[m("span",uk,ce(ne.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${ne.name}`,onClick:Je=>W(ne.path)},"×",8,dk)]))),128))])):se("",!0),m("div",fk,[oe.value?(w(),T("div",hk,[B.value.length>0?(w(!0),T(He,{key:0},Et(B.value,(ne,Je)=>(w(),T("button",{key:ne.path,class:gt(["thread-composer-file-mention-row",{"is-active":Je===de.value}]),type:"button",onMousedown:tt(it=>V(ne),["prevent"])},[Se(ne.path)?(w(),T("span",{key:0,class:gt(["thread-composer-file-mention-icon-badge",`is-${Oe(ne.path)}`])},ce(Se(ne.path)),3)):Ke(ne.path)?(w(),T("span",mk,"↓")):(w(),yt(Uo,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",gk,[m("span",vk,ce(be(ne.path)),1),ae(ne.path)?(w(),T("span",yk,ce(ae(ne.path)),1)):se("",!0)])],42,pk))),128)):(w(),T("div",wk,"No matching files"))])):se("",!0),tr(m("textarea",{ref_key:"inputRef",ref:I,"onUpdate:modelValue":K[0]||(K[0]=ne=>s.value=ne),class:"thread-composer-input",placeholder:$e.value,disabled:Re.value,onInput:H,onKeydown:F},null,40,bk),[[nr,s.value]]),Ce(nk,{skills:te.value,visible:Y.value,"anchor-bottom":44,"anchor-left":0,onSelect:xe,onClose:P},null,8,["skills","visible"])]),m("div",_k,[m("div",{ref_key:"attachMenuRootRef",ref:p,class:"thread-composer-attach"},[m("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Re.value,onClick:ht}," + ",8,kk),M.value?(w(),T("div",Tk,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:Re.value,onClick:Rt}," Add photos & files ",8,Ik),m("button",{class:"thread-composer-attach-item",type:"button",disabled:Re.value,onClick:Ge}," Take photo ",8,Sk)])):se("",!0)],512),Ce(ma,{class:"thread-composer-control","model-value":e.selectedModel,options:ye.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":Xe},null,8,["model-value","options","disabled"]),Ce(G_,{class:"thread-composer-control",options:Be.value,"selected-values":je.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:Ve},null,8,["options","selected-values","disabled"]),Ce(ma,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:ee,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":Ze},null,8,["model-value","disabled"]),m("div",Ek,[ue(u)&&!e.isTurnInProgress?(w(),T("button",{key:0,class:gt(["thread-composer-mic",{"thread-composer-mic--active":ue(l)!=="idle"}]),type:"button","aria-label":ue(l)==="recording"?"Stop dictation":"Hold to dictate",title:ue(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Re.value,onMousedown:K[1]||(K[1]=tt((...ne)=>ue(c)&&ue(c)(...ne),["prevent"])),onMouseup:K[2]||(K[2]=(...ne)=>ue(f)&&ue(f)(...ne)),onMouseleave:K[3]||(K[3]=ne=>ue(l)==="recording"&&ue(f)()),onTouchstart:K[4]||(K[4]=tt((...ne)=>ue(c)&&ue(c)(...ne),["prevent"])),onTouchend:K[5]||(K[5]=(...ne)=>ue(f)&&ue(f)(...ne))},[Ce(b_,{class:"thread-composer-mic-icon"})],42,Ck)):se("",!0),e.isTurnInProgress?(w(),T("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:nt},[Ce(I_,{class:"thread-composer-stop-icon"})],8,Ak)):se("",!0),m("button",{class:gt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&Te.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&Te.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${Te.value}`:"Send",disabled:!Qe.value,onClick:K[6]||(K[6]=ne=>It(e.isTurnInProgress?Te.value:"steer"))},[Ce(g_,{class:"thread-composer-submit-icon"})],10,Rk)])])],2),m("input",{ref_key:"photoLibraryInputRef",ref:_,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Re.value,onChange:v},null,40,Pk),m("input",{ref_key:"cameraCaptureInputRef",ref:N,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Re.value,onChange:A},null,40,xk)],32))}}),$c=st(Ok,[["__scopeId","data-v-983e7906"]]),Mk={key:0,class:"queued-messages"},Nk={class:"queued-messages-inner"},$k={class:"queued-row-text"},Dk={class:"queued-row-actions"},Lk=["onClick"],jk=["onClick"],Bk=Lt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(w(),T("div",Mk,[m("div",Nk,[(w(!0),T(He,null,Et(e.messages,r=>(w(),T("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=m("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),m("span",$k,ce(r.text),1),m("div",Dk,[m("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Lk),m("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:s=>t.$emit("delete",r.id)},[...n[0]||(n[0]=[m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,jk)])]))),128))])])):se("",!0)}}),Uk=st(Bk,[["__scopeId","data-v-ea583733"]]),Fk={class:"runtime-dropdown-trigger-label"},Hk={key:0,class:"runtime-dropdown-menu-wrap"},Vk={class:"runtime-dropdown-menu"},Wk=["onClick"],zk={class:"runtime-dropdown-option-label"},qk={key:0,class:"runtime-dropdown-option-check"},Gk=Lt({__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:Jd},{value:"worktree",label:"New worktree",icon:Co}],a=pe(()=>i.find(c=>c.value===n.modelValue)??i[0]);function l(c){r("update:modelValue",c),o.value=!1}function u(c){if(!o.value)return;const f=s.value;if(!f)return;const p=c.target;p instanceof Node&&(f.contains(p)||(o.value=!1))}return ir(()=>{window.addEventListener("pointerdown",u)}),ar(()=>{window.removeEventListener("pointerdown",u)}),(c,f)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[m("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=p=>o.value=!o.value)},[(w(),yt(na(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),m("span",Fk,ce(a.value.label),1),Ce(ci,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),T("div",Hk,[m("div",Vk,[f[1]||(f[1]=m("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),T(He,null,Et(i,p=>m("button",{key:p.value,class:gt(["runtime-dropdown-option",{"is-selected":e.modelValue===p.value}]),type:"button",onClick:_=>l(p.value)},[(w(),yt(na(p.icon),{class:"runtime-dropdown-option-icon"})),m("span",zk,ce(p.label),1),e.modelValue===p.value?(w(),T("span",qk,"✓")):se("",!0)],10,Wk)),64))])])):se("",!0)],512))}}),Kk=st(Gk,[["__scopeId","data-v-9c9b71e5"]]),Jk={},Yk={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Qk(e,t){return w(),T("svg",Yk,[...t[0]||(t[0]=[m("circle",{cx:"11",cy:"11",r:"8"},null,-1),m("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const ga=st(Jk,[["render",Qk]]),Xk={class:"skill-card-top"},Zk=["src","alt"],e0={key:1,class:"skill-card-avatar-fallback"},t0={class:"skill-card-info"},n0={class:"skill-card-header"},r0={class:"skill-card-name"},s0={key:0,class:"skill-card-badge-disabled"},o0={key:1,class:"skill-card-badge"},i0={class:"skill-card-owner"},a0={key:0,class:"skill-card-desc"},l0={key:1,class:"skill-card-date"},c0=Lt({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=pe(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function r(s){const o=s.target;o.style.display="none"}return(s,o)=>(w(),T("button",{class:gt(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[m("div",Xk,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,Zk)):(w(),T("div",e0,ce(e.skill.owner.charAt(0)),1)),m("div",t0,[m("div",n0,[m("span",r0,ce(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),T("span",s0,"Disabled")):e.skill.installed?(w(),T("span",o0,"Installed")):se("",!0)]),m("span",i0,ce(e.skill.owner),1)])]),e.skill.description?(w(),T("p",a0,ce(e.skill.description),1)):se("",!0),n.value?(w(),T("span",l0,ce(n.value),1)):se("",!0)],2))}}),Dc=st(c0,[["__scopeId","data-v-2a1e8196"]]),u0={class:"sdm-panel"},d0={class:"sdm-header"},f0={class:"sdm-title-area"},h0=["src","alt"],p0={class:"sdm-title-col"},m0={class:"sdm-title-row"},g0={class:"sdm-title"},v0={key:0,class:"sdm-badge-disabled"},y0={class:"sdm-owner"},w0={class:"sdm-body"},b0={key:0,class:"sdm-desc"},_0={key:1,class:"sdm-readme-loading"},k0=["innerHTML"],T0=["href"],I0={class:"sdm-footer"},S0={class:"sdm-footer-actions"},E0=["disabled"],C0=["disabled"],A0=["disabled"],R0=Lt({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(""),i=D(!1),a=pe(()=>s.value??n.skill.enabled??!0),l=pe(()=>n.isInstalling===!0||n.isUninstalling===!0),u=pe(()=>{const I=o.value;if(!I)return"";const M=I.replace(/^---[\s\S]*?---\s*/,"");return c(M)});function c(I){return I.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function f(){if(!(!n.skill.owner||!n.skill.name)){i.value=!0,o.value="";try{const I=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),M=await fetch(`/codex-api/skills-hub/readme?${I}`);if(!M.ok)return;const Y=await M.json();o.value=Y.content??""}catch{}finally{i.value=!1}}}mt(()=>n.visible,I=>{I&&(s.value=null,o.value="",f())});function p(){r("install",n.skill)}function _(){r("uninstall",n.skill)}function N(){const I=!a.value;s.value=I,r("toggle-enabled",n.skill,I)}return(I,M)=>(w(),yt($o,{to:"body"},[e.visible?(w(),T("div",{key:0,class:"sdm-overlay",onClick:M[1]||(M[1]=tt(Y=>I.$emit("close"),["self"]))},[m("div",u0,[m("div",d0,[m("div",f0,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,h0)):se("",!0),m("div",p0,[m("div",m0,[m("h3",g0,ce(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),T("span",v0,"Disabled")):se("",!0)]),m("span",y0,ce(e.skill.owner),1)])]),m("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:M[0]||(M[0]=Y=>I.$emit("close"))},[Ce(Ya,{class:"sdm-close-icon"})])]),m("div",w0,[e.skill.description?(w(),T("p",b0,ce(e.skill.description),1)):se("",!0),i.value?(w(),T("div",_0,"Loading skill contents...")):o.value?(w(),T("div",{key:2,class:"sdm-readme",innerHTML:u.value},null,8,k0)):se("",!0),m("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,T0)]),m("div",I0,[m("div",S0,[e.skill.installed?(w(),T("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:_},ce(n.isUninstalling?"Uninstalling...":"Uninstall"),9,E0)):(w(),T("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:p},ce(n.isInstalling?"Installing...":"Install"),9,C0)),e.skill.installed?(w(),T("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:N},ce(a.value?"Disable":"Enable"),9,A0)):se("",!0)])])])])):se("",!0)]))}}),P0=st(R0,[["__scopeId","data-v-19a385ca"]]),x0=()=>{};var Lc={};/**
44
+ * @license
45
+ * Copyright 2017 Google LLC
46
+ *
47
+ * Licensed under the Apache License, Version 2.0 (the "License");
48
+ * you may not use this file except in compliance with the License.
49
+ * You may obtain a copy of the License at
50
+ *
51
+ * http://www.apache.org/licenses/LICENSE-2.0
52
+ *
53
+ * Unless required by applicable law or agreed to in writing, software
54
+ * distributed under the License is distributed on an "AS IS" BASIS,
55
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
56
+ * See the License for the specific language governing permissions and
57
+ * limitations under the License.
58
+ */const Zd=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},O0=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("")},ef={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 p=(a&15)<<2|u>>6,_=u&63;l||(_=64,i||(p=64)),r.push(n[c],n[f],n[p],n[_])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Zd(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):O0(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 M0;const p=o<<2|a>>4;if(r.push(p),u!==64){const _=a<<4&240|u>>2;if(r.push(_),f!==64){const N=u<<6&192|f;r.push(N)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class M0 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const N0=function(e){const t=Zd(e);return ef.encodeByteArray(t,!0)},tf=function(e){return N0(e).replace(/\./g,"")},nf=function(e){try{return ef.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
59
+ * @license
60
+ * Copyright 2022 Google LLC
61
+ *
62
+ * Licensed under the Apache License, Version 2.0 (the "License");
63
+ * you may not use this file except in compliance with the License.
64
+ * You may obtain a copy of the License at
65
+ *
66
+ * http://www.apache.org/licenses/LICENSE-2.0
67
+ *
68
+ * Unless required by applicable law or agreed to in writing, software
69
+ * distributed under the License is distributed on an "AS IS" BASIS,
70
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
71
+ * See the License for the specific language governing permissions and
72
+ * limitations under the License.
73
+ */function $0(){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.")}/**
74
+ * @license
75
+ * Copyright 2022 Google LLC
76
+ *
77
+ * Licensed under the Apache License, Version 2.0 (the "License");
78
+ * you may not use this file except in compliance with the License.
79
+ * You may obtain a copy of the License at
80
+ *
81
+ * http://www.apache.org/licenses/LICENSE-2.0
82
+ *
83
+ * Unless required by applicable law or agreed to in writing, software
84
+ * distributed under the License is distributed on an "AS IS" BASIS,
85
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
86
+ * See the License for the specific language governing permissions and
87
+ * limitations under the License.
88
+ */const D0=()=>$0().__FIREBASE_DEFAULTS__,L0=()=>{if(typeof process>"u"||typeof Lc>"u")return;const e=Lc.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},j0=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&nf(e[1]);return t&&JSON.parse(t)},Za=()=>{try{return x0()||D0()||L0()||j0()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},B0=e=>{var t,n;return(n=(t=Za())==null?void 0:t.emulatorHosts)==null?void 0:n[e]},rf=()=>{var e;return(e=Za())==null?void 0:e.config},sf=e=>{var t;return(t=Za())==null?void 0:t[`_${e}`]};/**
89
+ * @license
90
+ * Copyright 2017 Google LLC
91
+ *
92
+ * Licensed under the Apache License, Version 2.0 (the "License");
93
+ * you may not use this file except in compliance with the License.
94
+ * You may obtain a copy of the License at
95
+ *
96
+ * http://www.apache.org/licenses/LICENSE-2.0
97
+ *
98
+ * Unless required by applicable law or agreed to in writing, software
99
+ * distributed under the License is distributed on an "AS IS" BASIS,
100
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
101
+ * See the License for the specific language governing permissions and
102
+ * limitations under the License.
103
+ */class U0{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))}}}/**
104
+ * @license
105
+ * Copyright 2017 Google LLC
106
+ *
107
+ * Licensed under the Apache License, Version 2.0 (the "License");
108
+ * you may not use this file except in compliance with the License.
109
+ * You may obtain a copy of the License at
110
+ *
111
+ * http://www.apache.org/licenses/LICENSE-2.0
112
+ *
113
+ * Unless required by applicable law or agreed to in writing, software
114
+ * distributed under the License is distributed on an "AS IS" BASIS,
115
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
116
+ * See the License for the specific language governing permissions and
117
+ * limitations under the License.
118
+ */function Xt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function F0(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Xt())}function H0(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function V0(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function W0(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function z0(){const e=Xt();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function q0(){try{return typeof indexedDB=="object"}catch{return!1}}function G0(){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)}})}/**
119
+ * @license
120
+ * Copyright 2017 Google LLC
121
+ *
122
+ * Licensed under the Apache License, Version 2.0 (the "License");
123
+ * you may not use this file except in compliance with the License.
124
+ * You may obtain a copy of the License at
125
+ *
126
+ * http://www.apache.org/licenses/LICENSE-2.0
127
+ *
128
+ * Unless required by applicable law or agreed to in writing, software
129
+ * distributed under the License is distributed on an "AS IS" BASIS,
130
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131
+ * See the License for the specific language governing permissions and
132
+ * limitations under the License.
133
+ */const K0="FirebaseError";class Ir extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=K0,Object.setPrototypeOf(this,Ir.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,oo.prototype.create)}}class oo{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?J0(o,r):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new Ir(s,a,r)}}function J0(e,t){return e.replace(Y0,(n,r)=>{const s=t[r];return s!=null?String(s):`<${r}?>`})}const Y0=/\{\$([^}]+)}/g;function Q0(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function gs(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const s of n){if(!r.includes(s))return!1;const o=e[s],i=t[s];if(jc(o)&&jc(i)){if(!gs(o,i))return!1}else if(o!==i)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function jc(e){return e!==null&&typeof e=="object"}/**
134
+ * @license
135
+ * Copyright 2017 Google LLC
136
+ *
137
+ * Licensed under the Apache License, Version 2.0 (the "License");
138
+ * you may not use this file except in compliance with the License.
139
+ * You may obtain a copy of the License at
140
+ *
141
+ * http://www.apache.org/licenses/LICENSE-2.0
142
+ *
143
+ * Unless required by applicable law or agreed to in writing, software
144
+ * distributed under the License is distributed on an "AS IS" BASIS,
145
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
146
+ * See the License for the specific language governing permissions and
147
+ * limitations under the License.
148
+ */function io(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 X0(e,t){const n=new Z0(e,t);return n.subscribe.bind(n)}class Z0{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.");eT(t,["next","error","complete"])?s=t:s={next:t,error:n,complete:r},s.next===void 0&&(s.next=Di),s.error===void 0&&(s.error=Di),s.complete===void 0&&(s.complete=Di);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 eT(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 Di(){}/**
149
+ * @license
150
+ * Copyright 2021 Google LLC
151
+ *
152
+ * Licensed under the Apache License, Version 2.0 (the "License");
153
+ * you may not use this file except in compliance with the License.
154
+ * You may obtain a copy of the License at
155
+ *
156
+ * http://www.apache.org/licenses/LICENSE-2.0
157
+ *
158
+ * Unless required by applicable law or agreed to in writing, software
159
+ * distributed under the License is distributed on an "AS IS" BASIS,
160
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
161
+ * See the License for the specific language governing permissions and
162
+ * limitations under the License.
163
+ */function bs(e){return e&&e._delegate?e._delegate:e}/**
164
+ * @license
165
+ * Copyright 2025 Google LLC
166
+ *
167
+ * Licensed under the Apache License, Version 2.0 (the "License");
168
+ * you may not use this file except in compliance with the License.
169
+ * You may obtain a copy of the License at
170
+ *
171
+ * http://www.apache.org/licenses/LICENSE-2.0
172
+ *
173
+ * Unless required by applicable law or agreed to in writing, software
174
+ * distributed under the License is distributed on an "AS IS" BASIS,
175
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
176
+ * See the License for the specific language governing permissions and
177
+ * limitations under the License.
178
+ */function el(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function tT(e){return(await fetch(e,{credentials:"include"})).ok}class vs{constructor(t,n,r){this.name=t,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
179
+ * @license
180
+ * Copyright 2019 Google LLC
181
+ *
182
+ * Licensed under the Apache License, Version 2.0 (the "License");
183
+ * you may not use this file except in compliance with the License.
184
+ * You may obtain a copy of the License at
185
+ *
186
+ * http://www.apache.org/licenses/LICENSE-2.0
187
+ *
188
+ * Unless required by applicable law or agreed to in writing, software
189
+ * distributed under the License is distributed on an "AS IS" BASIS,
190
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
191
+ * See the License for the specific language governing permissions and
192
+ * limitations under the License.
193
+ */const Lr="[DEFAULT]";/**
194
+ * @license
195
+ * Copyright 2019 Google LLC
196
+ *
197
+ * Licensed under the Apache License, Version 2.0 (the "License");
198
+ * you may not use this file except in compliance with the License.
199
+ * You may obtain a copy of the License at
200
+ *
201
+ * http://www.apache.org/licenses/LICENSE-2.0
202
+ *
203
+ * Unless required by applicable law or agreed to in writing, software
204
+ * distributed under the License is distributed on an "AS IS" BASIS,
205
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
206
+ * See the License for the specific language governing permissions and
207
+ * limitations under the License.
208
+ */class nT{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 U0;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(sT(t))try{this.getOrInitializeService({instanceIdentifier:Lr})}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=Lr){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=Lr){return this.instances.has(t)}getOptions(t=Lr){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:rT(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=Lr){return this.component?this.component.multipleInstances?t:Lr:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function rT(e){return e===Lr?void 0:e}function sT(e){return e.instantiationMode==="EAGER"}/**
209
+ * @license
210
+ * Copyright 2019 Google LLC
211
+ *
212
+ * Licensed under the Apache License, Version 2.0 (the "License");
213
+ * you may not use this file except in compliance with the License.
214
+ * You may obtain a copy of the License at
215
+ *
216
+ * http://www.apache.org/licenses/LICENSE-2.0
217
+ *
218
+ * Unless required by applicable law or agreed to in writing, software
219
+ * distributed under the License is distributed on an "AS IS" BASIS,
220
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
221
+ * See the License for the specific language governing permissions and
222
+ * limitations under the License.
223
+ */class oT{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 nT(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
224
+ * @license
225
+ * Copyright 2017 Google LLC
226
+ *
227
+ * Licensed under the Apache License, Version 2.0 (the "License");
228
+ * you may not use this file except in compliance with the License.
229
+ * You may obtain a copy of the License at
230
+ *
231
+ * http://www.apache.org/licenses/LICENSE-2.0
232
+ *
233
+ * Unless required by applicable law or agreed to in writing, software
234
+ * distributed under the License is distributed on an "AS IS" BASIS,
235
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
236
+ * See the License for the specific language governing permissions and
237
+ * limitations under the License.
238
+ */var wt;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(wt||(wt={}));const iT={debug:wt.DEBUG,verbose:wt.VERBOSE,info:wt.INFO,warn:wt.WARN,error:wt.ERROR,silent:wt.SILENT},aT=wt.INFO,lT={[wt.DEBUG]:"log",[wt.VERBOSE]:"log",[wt.INFO]:"info",[wt.WARN]:"warn",[wt.ERROR]:"error"},cT=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),s=lT[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 of{constructor(t){this.name=t,this._logLevel=aT,this._logHandler=cT,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in wt))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?iT[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,wt.DEBUG,...t),this._logHandler(this,wt.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,wt.VERBOSE,...t),this._logHandler(this,wt.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,wt.INFO,...t),this._logHandler(this,wt.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,wt.WARN,...t),this._logHandler(this,wt.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,wt.ERROR,...t),this._logHandler(this,wt.ERROR,...t)}}const uT=(e,t)=>t.some(n=>e instanceof n);let Bc,Uc;function dT(){return Bc||(Bc=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function fT(){return Uc||(Uc=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const af=new WeakMap,va=new WeakMap,lf=new WeakMap,Li=new WeakMap,tl=new WeakMap;function hT(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(br(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&af.set(n,e)}).catch(()=>{}),tl.set(t,e),t}function pT(e){if(va.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)});va.set(e,t)}let ya={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return va.get(e);if(t==="objectStoreNames")return e.objectStoreNames||lf.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return br(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function mT(e){ya=e(ya)}function gT(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(ji(this),t,...n);return lf.set(r,t.sort?t.sort():[t]),br(r)}:fT().includes(e)?function(...t){return e.apply(ji(this),t),br(af.get(this))}:function(...t){return br(e.apply(ji(this),t))}}function vT(e){return typeof e=="function"?gT(e):(e instanceof IDBTransaction&&pT(e),uT(e,dT())?new Proxy(e,ya):e)}function br(e){if(e instanceof IDBRequest)return hT(e);if(Li.has(e))return Li.get(e);const t=vT(e);return t!==e&&(Li.set(e,t),tl.set(t,e)),t}const ji=e=>tl.get(e);function yT(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=br(i);return r&&i.addEventListener("upgradeneeded",l=>{r(br(i.result),l.oldVersion,l.newVersion,br(i.transaction),l)}),n&&i.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{o&&l.addEventListener("close",()=>o()),s&&l.addEventListener("versionchange",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),a}const wT=["get","getKey","getAll","getAllKeys","count"],bT=["put","add","delete","clear"],Bi=new Map;function Fc(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Bi.get(t))return Bi.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=bT.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||wT.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 Bi.set(t,o),o}mT(e=>({...e,get:(t,n,r)=>Fc(t,n)||e.get(t,n,r),has:(t,n)=>!!Fc(t,n)||e.has(t,n)}));/**
239
+ * @license
240
+ * Copyright 2019 Google LLC
241
+ *
242
+ * Licensed under the Apache License, Version 2.0 (the "License");
243
+ * you may not use this file except in compliance with the License.
244
+ * You may obtain a copy of the License at
245
+ *
246
+ * http://www.apache.org/licenses/LICENSE-2.0
247
+ *
248
+ * Unless required by applicable law or agreed to in writing, software
249
+ * distributed under the License is distributed on an "AS IS" BASIS,
250
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
251
+ * See the License for the specific language governing permissions and
252
+ * limitations under the License.
253
+ */class _T{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(kT(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function kT(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const wa="@firebase/app",Hc="0.14.10";/**
254
+ * @license
255
+ * Copyright 2019 Google LLC
256
+ *
257
+ * Licensed under the Apache License, Version 2.0 (the "License");
258
+ * you may not use this file except in compliance with the License.
259
+ * You may obtain a copy of the License at
260
+ *
261
+ * http://www.apache.org/licenses/LICENSE-2.0
262
+ *
263
+ * Unless required by applicable law or agreed to in writing, software
264
+ * distributed under the License is distributed on an "AS IS" BASIS,
265
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
266
+ * See the License for the specific language governing permissions and
267
+ * limitations under the License.
268
+ */const rr=new of("@firebase/app"),TT="@firebase/app-compat",IT="@firebase/analytics-compat",ST="@firebase/analytics",ET="@firebase/app-check-compat",CT="@firebase/app-check",AT="@firebase/auth",RT="@firebase/auth-compat",PT="@firebase/database",xT="@firebase/data-connect",OT="@firebase/database-compat",MT="@firebase/functions",NT="@firebase/functions-compat",$T="@firebase/installations",DT="@firebase/installations-compat",LT="@firebase/messaging",jT="@firebase/messaging-compat",BT="@firebase/performance",UT="@firebase/performance-compat",FT="@firebase/remote-config",HT="@firebase/remote-config-compat",VT="@firebase/storage",WT="@firebase/storage-compat",zT="@firebase/firestore",qT="@firebase/ai",GT="@firebase/firestore-compat",KT="firebase",JT="12.11.0";/**
269
+ * @license
270
+ * Copyright 2019 Google LLC
271
+ *
272
+ * Licensed under the Apache License, Version 2.0 (the "License");
273
+ * you may not use this file except in compliance with the License.
274
+ * You may obtain a copy of the License at
275
+ *
276
+ * http://www.apache.org/licenses/LICENSE-2.0
277
+ *
278
+ * Unless required by applicable law or agreed to in writing, software
279
+ * distributed under the License is distributed on an "AS IS" BASIS,
280
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
281
+ * See the License for the specific language governing permissions and
282
+ * limitations under the License.
283
+ */const ba="[DEFAULT]",YT={[wa]:"fire-core",[TT]:"fire-core-compat",[ST]:"fire-analytics",[IT]:"fire-analytics-compat",[CT]:"fire-app-check",[ET]:"fire-app-check-compat",[AT]:"fire-auth",[RT]:"fire-auth-compat",[PT]:"fire-rtdb",[xT]:"fire-data-connect",[OT]:"fire-rtdb-compat",[MT]:"fire-fn",[NT]:"fire-fn-compat",[$T]:"fire-iid",[DT]:"fire-iid-compat",[LT]:"fire-fcm",[jT]:"fire-fcm-compat",[BT]:"fire-perf",[UT]:"fire-perf-compat",[FT]:"fire-rc",[HT]:"fire-rc-compat",[VT]:"fire-gcs",[WT]:"fire-gcs-compat",[zT]:"fire-fst",[GT]:"fire-fst-compat",[qT]:"fire-vertex","fire-js":"fire-js",[KT]:"fire-js-all"};/**
284
+ * @license
285
+ * Copyright 2019 Google LLC
286
+ *
287
+ * Licensed under the Apache License, Version 2.0 (the "License");
288
+ * you may not use this file except in compliance with the License.
289
+ * You may obtain a copy of the License at
290
+ *
291
+ * http://www.apache.org/licenses/LICENSE-2.0
292
+ *
293
+ * Unless required by applicable law or agreed to in writing, software
294
+ * distributed under the License is distributed on an "AS IS" BASIS,
295
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
296
+ * See the License for the specific language governing permissions and
297
+ * limitations under the License.
298
+ */const Xs=new Map,QT=new Map,_a=new Map;function Vc(e,t){try{e.container.addComponent(t)}catch(n){rr.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function Zs(e){const t=e.name;if(_a.has(t))return rr.debug(`There were multiple attempts to register component ${t}.`),!1;_a.set(t,e);for(const n of Xs.values())Vc(n,e);for(const n of QT.values())Vc(n,e);return!0}function cf(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function Pn(e){return e==null?!1:e.settings!==void 0}/**
299
+ * @license
300
+ * Copyright 2019 Google LLC
301
+ *
302
+ * Licensed under the Apache License, Version 2.0 (the "License");
303
+ * you may not use this file except in compliance with the License.
304
+ * You may obtain a copy of the License at
305
+ *
306
+ * http://www.apache.org/licenses/LICENSE-2.0
307
+ *
308
+ * Unless required by applicable law or agreed to in writing, software
309
+ * distributed under the License is distributed on an "AS IS" BASIS,
310
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
311
+ * See the License for the specific language governing permissions and
312
+ * limitations under the License.
313
+ */const XT={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},_r=new oo("app","Firebase",XT);/**
314
+ * @license
315
+ * Copyright 2019 Google LLC
316
+ *
317
+ * Licensed under the Apache License, Version 2.0 (the "License");
318
+ * you may not use this file except in compliance with the License.
319
+ * You may obtain a copy of the License at
320
+ *
321
+ * http://www.apache.org/licenses/LICENSE-2.0
322
+ *
323
+ * Unless required by applicable law or agreed to in writing, software
324
+ * distributed under the License is distributed on an "AS IS" BASIS,
325
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
326
+ * See the License for the specific language governing permissions and
327
+ * limitations under the License.
328
+ */class ZT{constructor(t,n,r){this._isDeleted=!1,this._options={...t},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new vs("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw _r.create("app-deleted",{appName:this._name})}}/**
329
+ * @license
330
+ * Copyright 2019 Google LLC
331
+ *
332
+ * Licensed under the Apache License, Version 2.0 (the "License");
333
+ * you may not use this file except in compliance with the License.
334
+ * You may obtain a copy of the License at
335
+ *
336
+ * http://www.apache.org/licenses/LICENSE-2.0
337
+ *
338
+ * Unless required by applicable law or agreed to in writing, software
339
+ * distributed under the License is distributed on an "AS IS" BASIS,
340
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
341
+ * See the License for the specific language governing permissions and
342
+ * limitations under the License.
343
+ */const ao=JT;function uf(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:ba,automaticDataCollectionEnabled:!0,...t},s=r.name;if(typeof s!="string"||!s)throw _r.create("bad-app-name",{appName:String(s)});if(n||(n=rf()),!n)throw _r.create("no-options");const o=Xs.get(s);if(o){if(gs(n,o.options)&&gs(r,o.config))return o;throw _r.create("duplicate-app",{appName:s})}const i=new oT(s);for(const l of _a.values())i.addComponent(l);const a=new ZT(n,r,i);return Xs.set(s,a),a}function df(e=ba){const t=Xs.get(e);if(!t&&e===ba&&rf())return uf();if(!t)throw _r.create("no-app",{appName:e});return t}function eI(){return Array.from(Xs.values())}function cs(e,t,n){let r=YT[e]??e;n&&(r+=`-${n}`);const s=r.match(/\s|\//),o=t.match(/\s|\//);if(s||o){const i=[`Unable to register library "${r}" with version "${t}":`];s&&i.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&i.push("and"),o&&i.push(`version name "${t}" contains illegal characters (whitespace or "/")`),rr.warn(i.join(" "));return}Zs(new vs(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/**
344
+ * @license
345
+ * Copyright 2021 Google LLC
346
+ *
347
+ * Licensed under the Apache License, Version 2.0 (the "License");
348
+ * you may not use this file except in compliance with the License.
349
+ * You may obtain a copy of the License at
350
+ *
351
+ * http://www.apache.org/licenses/LICENSE-2.0
352
+ *
353
+ * Unless required by applicable law or agreed to in writing, software
354
+ * distributed under the License is distributed on an "AS IS" BASIS,
355
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
356
+ * See the License for the specific language governing permissions and
357
+ * limitations under the License.
358
+ */const tI="firebase-heartbeat-database",nI=1,eo="firebase-heartbeat-store";let Ui=null;function ff(){return Ui||(Ui=yT(tI,nI,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(eo)}catch(n){console.warn(n)}}}}).catch(e=>{throw _r.create("idb-open",{originalErrorMessage:e.message})})),Ui}async function rI(e){try{const n=(await ff()).transaction(eo),r=await n.objectStore(eo).get(hf(e));return await n.done,r}catch(t){if(t instanceof Ir)rr.warn(t.message);else{const n=_r.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});rr.warn(n.message)}}}async function Wc(e,t){try{const r=(await ff()).transaction(eo,"readwrite");await r.objectStore(eo).put(t,hf(e)),await r.done}catch(n){if(n instanceof Ir)rr.warn(n.message);else{const r=_r.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});rr.warn(r.message)}}}function hf(e){return`${e.name}!${e.options.appId}`}/**
359
+ * @license
360
+ * Copyright 2021 Google LLC
361
+ *
362
+ * Licensed under the Apache License, Version 2.0 (the "License");
363
+ * you may not use this file except in compliance with the License.
364
+ * You may obtain a copy of the License at
365
+ *
366
+ * http://www.apache.org/licenses/LICENSE-2.0
367
+ *
368
+ * Unless required by applicable law or agreed to in writing, software
369
+ * distributed under the License is distributed on an "AS IS" BASIS,
370
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
371
+ * See the License for the specific language governing permissions and
372
+ * limitations under the License.
373
+ */const sI=1024,oI=30;class iI{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new lI(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var t,n;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=zc();if(((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(i=>i.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:s}),this._heartbeatsCache.heartbeats.length>oI){const i=cI(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){rr.warn(r)}}async getHeartbeatsHeader(){var t;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=zc(),{heartbeatsToSend:r,unsentEntries:s}=aI(this._heartbeatsCache.heartbeats),o=tf(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(n){return rr.warn(n),""}}}function zc(){return new Date().toISOString().substring(0,10)}function aI(e,t=sI){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),qc(n)>t){o.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),qc(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class lI{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return q0()?G0().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await rI(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 Wc(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 Wc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...t.heartbeats]})}else return}}function qc(e){return tf(JSON.stringify({version:2,heartbeats:e})).length}function cI(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}/**
374
+ * @license
375
+ * Copyright 2019 Google LLC
376
+ *
377
+ * Licensed under the Apache License, Version 2.0 (the "License");
378
+ * you may not use this file except in compliance with the License.
379
+ * You may obtain a copy of the License at
380
+ *
381
+ * http://www.apache.org/licenses/LICENSE-2.0
382
+ *
383
+ * Unless required by applicable law or agreed to in writing, software
384
+ * distributed under the License is distributed on an "AS IS" BASIS,
385
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
386
+ * See the License for the specific language governing permissions and
387
+ * limitations under the License.
388
+ */function uI(e){Zs(new vs("platform-logger",t=>new _T(t),"PRIVATE")),Zs(new vs("heartbeat",t=>new iI(t),"PRIVATE")),cs(wa,Hc,e),cs(wa,Hc,"esm2020"),cs("fire-js","")}uI("");var dI="firebase",fI="12.11.0";/**
389
+ * @license
390
+ * Copyright 2020 Google LLC
391
+ *
392
+ * Licensed under the Apache License, Version 2.0 (the "License");
393
+ * you may not use this file except in compliance with the License.
394
+ * You may obtain a copy of the License at
395
+ *
396
+ * http://www.apache.org/licenses/LICENSE-2.0
397
+ *
398
+ * Unless required by applicable law or agreed to in writing, software
399
+ * distributed under the License is distributed on an "AS IS" BASIS,
400
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
401
+ * See the License for the specific language governing permissions and
402
+ * limitations under the License.
403
+ */cs(dI,fI,"app");function pf(){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 hI=pf,mf=new oo("auth","Firebase",pf());/**
404
+ * @license
405
+ * Copyright 2020 Google LLC
406
+ *
407
+ * Licensed under the Apache License, Version 2.0 (the "License");
408
+ * you may not use this file except in compliance with the License.
409
+ * You may obtain a copy of the License at
410
+ *
411
+ * http://www.apache.org/licenses/LICENSE-2.0
412
+ *
413
+ * Unless required by applicable law or agreed to in writing, software
414
+ * distributed under the License is distributed on an "AS IS" BASIS,
415
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
416
+ * See the License for the specific language governing permissions and
417
+ * limitations under the License.
418
+ */const Fo=new of("@firebase/auth");function pI(e,...t){Fo.logLevel<=wt.WARN&&Fo.warn(`Auth (${ao}): ${e}`,...t)}function Ao(e,...t){Fo.logLevel<=wt.ERROR&&Fo.error(`Auth (${ao}): ${e}`,...t)}/**
419
+ * @license
420
+ * Copyright 2020 Google LLC
421
+ *
422
+ * Licensed under the Apache License, Version 2.0 (the "License");
423
+ * you may not use this file except in compliance with the License.
424
+ * You may obtain a copy of the License at
425
+ *
426
+ * http://www.apache.org/licenses/LICENSE-2.0
427
+ *
428
+ * Unless required by applicable law or agreed to in writing, software
429
+ * distributed under the License is distributed on an "AS IS" BASIS,
430
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
431
+ * See the License for the specific language governing permissions and
432
+ * limitations under the License.
433
+ */function $n(e,...t){throw rl(e,...t)}function gn(e,...t){return rl(e,...t)}function nl(e,t,n){const r={...hI(),[t]:n};return new oo("auth","Firebase",r).create(t,{appName:e.name})}function Wr(e){return nl(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function mI(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&$n(e,"argument-error"),nl(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function rl(e,...t){if(typeof e!="string"){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return mf.create(e,...t)}function Fe(e,t,...n){if(!e)throw rl(t,...n)}function Jn(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Ao(t),new Error(t)}function sr(e,t){e||Jn(t)}/**
434
+ * @license
435
+ * Copyright 2020 Google LLC
436
+ *
437
+ * Licensed under the Apache License, Version 2.0 (the "License");
438
+ * you may not use this file except in compliance with the License.
439
+ * You may obtain a copy of the License at
440
+ *
441
+ * http://www.apache.org/licenses/LICENSE-2.0
442
+ *
443
+ * Unless required by applicable law or agreed to in writing, software
444
+ * distributed under the License is distributed on an "AS IS" BASIS,
445
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
446
+ * See the License for the specific language governing permissions and
447
+ * limitations under the License.
448
+ */function ka(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function gI(){return Gc()==="http:"||Gc()==="https:"}function Gc(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
449
+ * @license
450
+ * Copyright 2020 Google LLC
451
+ *
452
+ * Licensed under the Apache License, Version 2.0 (the "License");
453
+ * you may not use this file except in compliance with the License.
454
+ * You may obtain a copy of the License at
455
+ *
456
+ * http://www.apache.org/licenses/LICENSE-2.0
457
+ *
458
+ * Unless required by applicable law or agreed to in writing, software
459
+ * distributed under the License is distributed on an "AS IS" BASIS,
460
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
461
+ * See the License for the specific language governing permissions and
462
+ * limitations under the License.
463
+ */function vI(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(gI()||V0()||"connection"in navigator)?navigator.onLine:!0}function yI(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
464
+ * @license
465
+ * Copyright 2020 Google LLC
466
+ *
467
+ * Licensed under the Apache License, Version 2.0 (the "License");
468
+ * you may not use this file except in compliance with the License.
469
+ * You may obtain a copy of the License at
470
+ *
471
+ * http://www.apache.org/licenses/LICENSE-2.0
472
+ *
473
+ * Unless required by applicable law or agreed to in writing, software
474
+ * distributed under the License is distributed on an "AS IS" BASIS,
475
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
476
+ * See the License for the specific language governing permissions and
477
+ * limitations under the License.
478
+ */class lo{constructor(t,n){this.shortDelay=t,this.longDelay=n,sr(n>t,"Short delay should be less than long delay!"),this.isMobile=F0()||W0()}get(){return vI()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
479
+ * @license
480
+ * Copyright 2020 Google LLC
481
+ *
482
+ * Licensed under the Apache License, Version 2.0 (the "License");
483
+ * you may not use this file except in compliance with the License.
484
+ * You may obtain a copy of the License at
485
+ *
486
+ * http://www.apache.org/licenses/LICENSE-2.0
487
+ *
488
+ * Unless required by applicable law or agreed to in writing, software
489
+ * distributed under the License is distributed on an "AS IS" BASIS,
490
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
491
+ * See the License for the specific language governing permissions and
492
+ * limitations under the License.
493
+ */function sl(e,t){sr(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
494
+ * @license
495
+ * Copyright 2020 Google LLC
496
+ *
497
+ * Licensed under the Apache License, Version 2.0 (the "License");
498
+ * you may not use this file except in compliance with the License.
499
+ * You may obtain a copy of the License at
500
+ *
501
+ * http://www.apache.org/licenses/LICENSE-2.0
502
+ *
503
+ * Unless required by applicable law or agreed to in writing, software
504
+ * distributed under the License is distributed on an "AS IS" BASIS,
505
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
506
+ * See the License for the specific language governing permissions and
507
+ * limitations under the License.
508
+ */class gf{static initialize(t,n,r){this.fetchImpl=t,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Jn("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Jn("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Jn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
509
+ * @license
510
+ * Copyright 2020 Google LLC
511
+ *
512
+ * Licensed under the Apache License, Version 2.0 (the "License");
513
+ * you may not use this file except in compliance with the License.
514
+ * You may obtain a copy of the License at
515
+ *
516
+ * http://www.apache.org/licenses/LICENSE-2.0
517
+ *
518
+ * Unless required by applicable law or agreed to in writing, software
519
+ * distributed under the License is distributed on an "AS IS" BASIS,
520
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
521
+ * See the License for the specific language governing permissions and
522
+ * limitations under the License.
523
+ */const wI={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"};/**
524
+ * @license
525
+ * Copyright 2020 Google LLC
526
+ *
527
+ * Licensed under the Apache License, Version 2.0 (the "License");
528
+ * you may not use this file except in compliance with the License.
529
+ * You may obtain a copy of the License at
530
+ *
531
+ * http://www.apache.org/licenses/LICENSE-2.0
532
+ *
533
+ * Unless required by applicable law or agreed to in writing, software
534
+ * distributed under the License is distributed on an "AS IS" BASIS,
535
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
536
+ * See the License for the specific language governing permissions and
537
+ * limitations under the License.
538
+ */const bI=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],_I=new lo(3e4,6e4);function ol(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function _s(e,t,n,r,s={}){return vf(e,s,async()=>{let o={},i={};r&&(t==="GET"?i=r:o={body:JSON.stringify(r)});const a=io({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 H0()||(u.referrerPolicy="no-referrer"),e.emulatorConfig&&el(e.emulatorConfig.host)&&(u.credentials="include"),gf.fetch()(await yf(e,e.config.apiHost,n,a),u)})}async function vf(e,t,n){e._canInitEmulator=!1;const r={...wI,...t};try{const s=new TI(e),o=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw vo(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 vo(e,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw vo(e,"email-already-in-use",i);if(l==="USER_DISABLED")throw vo(e,"user-disabled",i);const c=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw nl(e,c,u);$n(e,c)}}catch(s){if(s instanceof Ir)throw s;$n(e,"network-request-failed",{message:String(s)})}}async function kI(e,t,n,r,s={}){const o=await _s(e,t,n,r,s);return"mfaPendingCredential"in o&&$n(e,"multi-factor-auth-required",{_serverResponse:o}),o}async function yf(e,t,n,r){const s=`${t}${n}?${r}`,o=e,i=o.config.emulator?sl(e.config,s):`${e.config.apiScheme}://${s}`;return bI.includes(n)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(i).toString():i}class TI{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(gn(this.auth,"network-request-failed")),_I.get())})}}function vo(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=gn(e,t,r);return s.customData._tokenResponse=n,s}/**
539
+ * @license
540
+ * Copyright 2020 Google LLC
541
+ *
542
+ * Licensed under the Apache License, Version 2.0 (the "License");
543
+ * you may not use this file except in compliance with the License.
544
+ * You may obtain a copy of the License at
545
+ *
546
+ * http://www.apache.org/licenses/LICENSE-2.0
547
+ *
548
+ * Unless required by applicable law or agreed to in writing, software
549
+ * distributed under the License is distributed on an "AS IS" BASIS,
550
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
551
+ * See the License for the specific language governing permissions and
552
+ * limitations under the License.
553
+ */async function II(e,t){return _s(e,"POST","/v1/accounts:delete",t)}async function Ho(e,t){return _s(e,"POST","/v1/accounts:lookup",t)}/**
554
+ * @license
555
+ * Copyright 2020 Google LLC
556
+ *
557
+ * Licensed under the Apache License, Version 2.0 (the "License");
558
+ * you may not use this file except in compliance with the License.
559
+ * You may obtain a copy of the License at
560
+ *
561
+ * http://www.apache.org/licenses/LICENSE-2.0
562
+ *
563
+ * Unless required by applicable law or agreed to in writing, software
564
+ * distributed under the License is distributed on an "AS IS" BASIS,
565
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
566
+ * See the License for the specific language governing permissions and
567
+ * limitations under the License.
568
+ */function Hs(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function SI(e,t=!1){const n=bs(e),r=await n.getIdToken(t),s=il(r);Fe(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const o=typeof s.firebase=="object"?s.firebase:void 0,i=o==null?void 0:o.sign_in_provider;return{claims:s,token:r,authTime:Hs(Fi(s.auth_time)),issuedAtTime:Hs(Fi(s.iat)),expirationTime:Hs(Fi(s.exp)),signInProvider:i||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function Fi(e){return Number(e)*1e3}function il(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return Ao("JWT malformed, contained fewer than 3 sections"),null;try{const s=nf(n);return s?JSON.parse(s):(Ao("Failed to decode base64 JWT payload"),null)}catch(s){return Ao("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function Kc(e){const t=il(e);return Fe(t,"internal-error"),Fe(typeof t.exp<"u","internal-error"),Fe(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
569
+ * @license
570
+ * Copyright 2020 Google LLC
571
+ *
572
+ * Licensed under the Apache License, Version 2.0 (the "License");
573
+ * you may not use this file except in compliance with the License.
574
+ * You may obtain a copy of the License at
575
+ *
576
+ * http://www.apache.org/licenses/LICENSE-2.0
577
+ *
578
+ * Unless required by applicable law or agreed to in writing, software
579
+ * distributed under the License is distributed on an "AS IS" BASIS,
580
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
581
+ * See the License for the specific language governing permissions and
582
+ * limitations under the License.
583
+ */async function to(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof Ir&&EI(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function EI({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
584
+ * @license
585
+ * Copyright 2020 Google LLC
586
+ *
587
+ * Licensed under the Apache License, Version 2.0 (the "License");
588
+ * you may not use this file except in compliance with the License.
589
+ * You may obtain a copy of the License at
590
+ *
591
+ * http://www.apache.org/licenses/LICENSE-2.0
592
+ *
593
+ * Unless required by applicable law or agreed to in writing, software
594
+ * distributed under the License is distributed on an "AS IS" BASIS,
595
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
596
+ * See the License for the specific language governing permissions and
597
+ * limitations under the License.
598
+ */class CI{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()}}/**
599
+ * @license
600
+ * Copyright 2020 Google LLC
601
+ *
602
+ * Licensed under the Apache License, Version 2.0 (the "License");
603
+ * you may not use this file except in compliance with the License.
604
+ * You may obtain a copy of the License at
605
+ *
606
+ * http://www.apache.org/licenses/LICENSE-2.0
607
+ *
608
+ * Unless required by applicable law or agreed to in writing, software
609
+ * distributed under the License is distributed on an "AS IS" BASIS,
610
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
611
+ * See the License for the specific language governing permissions and
612
+ * limitations under the License.
613
+ */class Ta{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Hs(this.lastLoginAt),this.creationTime=Hs(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
614
+ * @license
615
+ * Copyright 2019 Google LLC
616
+ *
617
+ * Licensed under the Apache License, Version 2.0 (the "License");
618
+ * you may not use this file except in compliance with the License.
619
+ * You may obtain a copy of the License at
620
+ *
621
+ * http://www.apache.org/licenses/LICENSE-2.0
622
+ *
623
+ * Unless required by applicable law or agreed to in writing, software
624
+ * distributed under the License is distributed on an "AS IS" BASIS,
625
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
626
+ * See the License for the specific language governing permissions and
627
+ * limitations under the License.
628
+ */async function Vo(e){var f;const t=e.auth,n=await e.getIdToken(),r=await to(e,Ho(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?wf(s.providerUserInfo):[],i=RI(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 Ta(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(e,c)}async function AI(e){const t=bs(e);await Vo(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function RI(e,t){return[...e.filter(r=>!t.some(s=>s.providerId===r.providerId)),...t]}function wf(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}))}/**
629
+ * @license
630
+ * Copyright 2020 Google LLC
631
+ *
632
+ * Licensed under the Apache License, Version 2.0 (the "License");
633
+ * you may not use this file except in compliance with the License.
634
+ * You may obtain a copy of the License at
635
+ *
636
+ * http://www.apache.org/licenses/LICENSE-2.0
637
+ *
638
+ * Unless required by applicable law or agreed to in writing, software
639
+ * distributed under the License is distributed on an "AS IS" BASIS,
640
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
641
+ * See the License for the specific language governing permissions and
642
+ * limitations under the License.
643
+ */async function PI(e,t){const n=await vf(e,{},async()=>{const r=io({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:o}=e.config,i=await yf(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&&el(e.emulatorConfig.host)&&(l.credentials="include"),gf.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function xI(e,t){return _s(e,"POST","/v2/accounts:revokeToken",ol(e,t))}/**
644
+ * @license
645
+ * Copyright 2020 Google LLC
646
+ *
647
+ * Licensed under the Apache License, Version 2.0 (the "License");
648
+ * you may not use this file except in compliance with the License.
649
+ * You may obtain a copy of the License at
650
+ *
651
+ * http://www.apache.org/licenses/LICENSE-2.0
652
+ *
653
+ * Unless required by applicable law or agreed to in writing, software
654
+ * distributed under the License is distributed on an "AS IS" BASIS,
655
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
656
+ * See the License for the specific language governing permissions and
657
+ * limitations under the License.
658
+ */class us{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Fe(t.idToken,"internal-error"),Fe(typeof t.idToken<"u","internal-error"),Fe(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):Kc(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){Fe(t.length!==0,"internal-error");const n=Kc(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 PI(t,n);this.updateTokensAndExpiration(r,s,Number(o))}updateTokensAndExpiration(t,n,r){this.refreshToken=n||null,this.accessToken=t||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(t,n){const{refreshToken:r,accessToken:s,expirationTime:o}=n,i=new us;return r&&(Fe(typeof r=="string","internal-error",{appName:t}),i.refreshToken=r),s&&(Fe(typeof s=="string","internal-error",{appName:t}),i.accessToken=s),o&&(Fe(typeof o=="number","internal-error",{appName:t}),i.expirationTime=o),i}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new us,this.toJSON())}_performRefresh(){return Jn("not implemented")}}/**
659
+ * @license
660
+ * Copyright 2020 Google LLC
661
+ *
662
+ * Licensed under the Apache License, Version 2.0 (the "License");
663
+ * you may not use this file except in compliance with the License.
664
+ * You may obtain a copy of the License at
665
+ *
666
+ * http://www.apache.org/licenses/LICENSE-2.0
667
+ *
668
+ * Unless required by applicable law or agreed to in writing, software
669
+ * distributed under the License is distributed on an "AS IS" BASIS,
670
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
671
+ * See the License for the specific language governing permissions and
672
+ * limitations under the License.
673
+ */function fr(e,t){Fe(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class hn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new CI(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 Ta(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await to(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 SI(this,t)}reload(){return AI(this)}_assign(t){this!==t&&(Fe(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(n=>({...n})),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const n=new hn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){Fe(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,n=!1){let r=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),n&&await Vo(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Pn(this.auth.app))return Promise.reject(Wr(this.auth));const t=await this.getIdToken();return await to(this,II(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:p,isAnonymous:_,providerData:N,stsTokenManager:I}=n;Fe(f&&I,t,"internal-error");const M=us.fromJSON(this.name,I);Fe(typeof f=="string",t,"internal-error"),fr(r,t.name),fr(s,t.name),Fe(typeof p=="boolean",t,"internal-error"),Fe(typeof _=="boolean",t,"internal-error"),fr(o,t.name),fr(i,t.name),fr(a,t.name),fr(l,t.name),fr(u,t.name),fr(c,t.name);const Y=new hn({uid:f,auth:t,email:s,emailVerified:p,displayName:r,isAnonymous:_,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:M,createdAt:u,lastLoginAt:c});return N&&Array.isArray(N)&&(Y.providerData=N.map(j=>({...j}))),l&&(Y._redirectEventId=l),Y}static async _fromIdTokenResponse(t,n,r=!1){const s=new us;s.updateFromServerResponse(n);const o=new hn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await Vo(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?wf(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new us;a.updateFromIdToken(r);const l=new hn({uid:s.localId,auth:t,stsTokenManager:a,isAnonymous:i}),u={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:o,metadata:new Ta(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,u),l}}/**
674
+ * @license
675
+ * Copyright 2020 Google LLC
676
+ *
677
+ * Licensed under the Apache License, Version 2.0 (the "License");
678
+ * you may not use this file except in compliance with the License.
679
+ * You may obtain a copy of the License at
680
+ *
681
+ * http://www.apache.org/licenses/LICENSE-2.0
682
+ *
683
+ * Unless required by applicable law or agreed to in writing, software
684
+ * distributed under the License is distributed on an "AS IS" BASIS,
685
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
686
+ * See the License for the specific language governing permissions and
687
+ * limitations under the License.
688
+ */const Jc=new Map;function Yn(e){sr(e instanceof Function,"Expected a class definition");let t=Jc.get(e);return t?(sr(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Jc.set(e,t),t)}/**
689
+ * @license
690
+ * Copyright 2019 Google LLC
691
+ *
692
+ * Licensed under the Apache License, Version 2.0 (the "License");
693
+ * you may not use this file except in compliance with the License.
694
+ * You may obtain a copy of the License at
695
+ *
696
+ * http://www.apache.org/licenses/LICENSE-2.0
697
+ *
698
+ * Unless required by applicable law or agreed to in writing, software
699
+ * distributed under the License is distributed on an "AS IS" BASIS,
700
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
701
+ * See the License for the specific language governing permissions and
702
+ * limitations under the License.
703
+ */class bf{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){}}bf.type="NONE";const Yc=bf;/**
704
+ * @license
705
+ * Copyright 2019 Google LLC
706
+ *
707
+ * Licensed under the Apache License, Version 2.0 (the "License");
708
+ * you may not use this file except in compliance with the License.
709
+ * You may obtain a copy of the License at
710
+ *
711
+ * http://www.apache.org/licenses/LICENSE-2.0
712
+ *
713
+ * Unless required by applicable law or agreed to in writing, software
714
+ * distributed under the License is distributed on an "AS IS" BASIS,
715
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
716
+ * See the License for the specific language governing permissions and
717
+ * limitations under the License.
718
+ */function Ro(e,t,n){return`firebase:${e}:${t}:${n}`}class ds{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=Ro(this.userKey,s.apiKey,o),this.fullPersistenceKey=Ro("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 Ho(this.auth,{idToken:t}).catch(()=>{});return n?hn._fromGetAccountInfoResponse(this.auth,n,t):null}return hn._fromJSON(this.auth,t)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=t,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,n,r="authUser"){if(!n.length)return new ds(Yn(Yc),t,r);const s=(await Promise.all(n.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let o=s[0]||Yn(Yc);const i=Ro(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 p=await Ho(t,{idToken:c}).catch(()=>{});if(!p)break;f=await hn._fromGetAccountInfoResponse(t,p,c)}else f=hn._fromJSON(t,c);u!==o&&(a=f),o=u;break}}catch{}const l=s.filter(u=>u._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new ds(o,t,r):(o=l[0],a&&await o._set(i,a.toJSON()),await Promise.all(n.map(async u=>{if(u!==o)try{await u._remove(i)}catch{}})),new ds(o,t,r))}}/**
719
+ * @license
720
+ * Copyright 2020 Google LLC
721
+ *
722
+ * Licensed under the Apache License, Version 2.0 (the "License");
723
+ * you may not use this file except in compliance with the License.
724
+ * You may obtain a copy of the License at
725
+ *
726
+ * http://www.apache.org/licenses/LICENSE-2.0
727
+ *
728
+ * Unless required by applicable law or agreed to in writing, software
729
+ * distributed under the License is distributed on an "AS IS" BASIS,
730
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
731
+ * See the License for the specific language governing permissions and
732
+ * limitations under the License.
733
+ */function Qc(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(If(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(_f(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Ef(t))return"Blackberry";if(Cf(t))return"Webos";if(kf(t))return"Safari";if((t.includes("chrome/")||Tf(t))&&!t.includes("edge/"))return"Chrome";if(Sf(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 _f(e=Xt()){return/firefox\//i.test(e)}function kf(e=Xt()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Tf(e=Xt()){return/crios\//i.test(e)}function If(e=Xt()){return/iemobile/i.test(e)}function Sf(e=Xt()){return/android/i.test(e)}function Ef(e=Xt()){return/blackberry/i.test(e)}function Cf(e=Xt()){return/webos/i.test(e)}function al(e=Xt()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function OI(e=Xt()){var t;return al(e)&&!!((t=window.navigator)!=null&&t.standalone)}function MI(){return z0()&&document.documentMode===10}function Af(e=Xt()){return al(e)||Sf(e)||Cf(e)||Ef(e)||/windows phone/i.test(e)||If(e)}/**
734
+ * @license
735
+ * Copyright 2020 Google LLC
736
+ *
737
+ * Licensed under the Apache License, Version 2.0 (the "License");
738
+ * you may not use this file except in compliance with the License.
739
+ * You may obtain a copy of the License at
740
+ *
741
+ * http://www.apache.org/licenses/LICENSE-2.0
742
+ *
743
+ * Unless required by applicable law or agreed to in writing, software
744
+ * distributed under the License is distributed on an "AS IS" BASIS,
745
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
746
+ * See the License for the specific language governing permissions and
747
+ * limitations under the License.
748
+ */function Rf(e,t=[]){let n;switch(e){case"Browser":n=Qc(Xt());break;case"Worker":n=`${Qc(Xt())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${ao}/${r}`}/**
749
+ * @license
750
+ * Copyright 2022 Google LLC
751
+ *
752
+ * Licensed under the Apache License, Version 2.0 (the "License");
753
+ * you may not use this file except in compliance with the License.
754
+ * You may obtain a copy of the License at
755
+ *
756
+ * http://www.apache.org/licenses/LICENSE-2.0
757
+ *
758
+ * Unless required by applicable law or agreed to in writing, software
759
+ * distributed under the License is distributed on an "AS IS" BASIS,
760
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
761
+ * See the License for the specific language governing permissions and
762
+ * limitations under the License.
763
+ */class NI{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})}}}/**
764
+ * @license
765
+ * Copyright 2023 Google LLC
766
+ *
767
+ * Licensed under the Apache License, Version 2.0 (the "License");
768
+ * you may not use this file except in compliance with the License.
769
+ * You may obtain a copy of the License at
770
+ *
771
+ * http://www.apache.org/licenses/LICENSE-2.0
772
+ *
773
+ * Unless required by applicable law or agreed to in writing, software
774
+ * distributed under the License is distributed on an "AS IS" BASIS,
775
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
776
+ * See the License for the specific language governing permissions and
777
+ * limitations under the License.
778
+ */async function $I(e,t={}){return _s(e,"GET","/v2/passwordPolicy",ol(e,t))}/**
779
+ * @license
780
+ * Copyright 2023 Google LLC
781
+ *
782
+ * Licensed under the Apache License, Version 2.0 (the "License");
783
+ * you may not use this file except in compliance with the License.
784
+ * You may obtain a copy of the License at
785
+ *
786
+ * http://www.apache.org/licenses/LICENSE-2.0
787
+ *
788
+ * Unless required by applicable law or agreed to in writing, software
789
+ * distributed under the License is distributed on an "AS IS" BASIS,
790
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
791
+ * See the License for the specific language governing permissions and
792
+ * limitations under the License.
793
+ */const DI=6;class LI{constructor(t){var r;const n=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??DI,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))}}/**
794
+ * @license
795
+ * Copyright 2020 Google LLC
796
+ *
797
+ * Licensed under the Apache License, Version 2.0 (the "License");
798
+ * you may not use this file except in compliance with the License.
799
+ * You may obtain a copy of the License at
800
+ *
801
+ * http://www.apache.org/licenses/LICENSE-2.0
802
+ *
803
+ * Unless required by applicable law or agreed to in writing, software
804
+ * distributed under the License is distributed on an "AS IS" BASIS,
805
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
806
+ * See the License for the specific language governing permissions and
807
+ * limitations under the License.
808
+ */class jI{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 Xc(this),this.idTokenSubscription=new Xc(this),this.beforeStateQueue=new NI(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=mf,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(o=>this._resolvePersistenceManagerAvailable=o)}_initializeWithPersistence(t,n){return n&&(this._popupRedirectResolver=Yn(n)),this._initializationPromise=this.queue(async()=>{var r,s,o;if(!this._deleted&&(this.persistenceManager=await ds.create(this,t),(r=this._resolvePersistenceManagerAvailable)==null||r.call(this),!this._deleted)){if((s=this._popupRedirectResolver)!=null&&s._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((o=this.currentUser)==null?void 0:o.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUserFromIdToken(t){try{const n=await Ho(this,{idToken:t}),r=await hn._fromGetAccountInfoResponse(this,n,t);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var o;if(Pn(this.app)){const i=this.app.settings.authIdToken;return i?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(i).then(a,a))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,s=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const i=(o=this.redirectUser)==null?void 0:o._redirectEventId,a=r==null?void 0:r._redirectEventId,l=await this.tryRedirectSignIn(t);(!i||i===a)&&(l!=null&&l.user)&&(r=l.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(i){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(i))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return Fe(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(t){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(t){try{await Vo(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=yI()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(Pn(this.app))return Promise.reject(Wr(this));const n=t?bs(t):null;return n&&Fe(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(t,n=!1){if(!this._deleted)return t&&Fe(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return Pn(this.app)?Promise.reject(Wr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return Pn(this.app)?Promise.reject(Wr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Yn(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await $I(this),n=new LI(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 oo("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 xI(this,r)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)==null?void 0:t.toJSON()}}async _setRedirectUser(t,n){const r=await this.getOrInitRedirectPersistenceManager(n);return t===null?r.removeCurrentUser():r.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const n=t&&Yn(t)||this._popupRedirectResolver;Fe(n,this,"argument-error"),this.redirectPersistenceManager=await ds.create(this,[Yn(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)==null?void 0:n._redirectEventId)===t?this._currentUser:((r=this.redirectUser)==null?void 0:r._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const t=((n=this.currentUser)==null?void 0:n.uid)??null;this.lastNotifiedUid!==t&&(this.lastNotifiedUid=t,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,n,r,s){if(this._deleted)return()=>{};const o=typeof n=="function"?n:n.next.bind(n);let i=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Fe(a,this,"internal-error"),a.then(()=>{i||o(this.currentUser)}),typeof n=="function"){const l=t.addObserver(n,r,s);return()=>{i=!0,l()}}else{const l=t.addObserver(n);return()=>{i=!0,l()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Fe(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Rf(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var s;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await((s=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:s.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var n;if(Pn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await((n=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:n.getToken());return t!=null&&t.error&&pI(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function ui(e){return bs(e)}class Xc{constructor(t){this.auth=t,this.observer=null,this.addObserver=X0(n=>this.observer=n)}get next(){return Fe(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
809
+ * @license
810
+ * Copyright 2020 Google LLC
811
+ *
812
+ * Licensed under the Apache License, Version 2.0 (the "License");
813
+ * you may not use this file except in compliance with the License.
814
+ * You may obtain a copy of the License at
815
+ *
816
+ * http://www.apache.org/licenses/LICENSE-2.0
817
+ *
818
+ * Unless required by applicable law or agreed to in writing, software
819
+ * distributed under the License is distributed on an "AS IS" BASIS,
820
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
821
+ * See the License for the specific language governing permissions and
822
+ * limitations under the License.
823
+ */let ll={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function BI(e){ll=e}function UI(e){return ll.loadJS(e)}function FI(){return ll.gapiScript}function HI(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
824
+ * @license
825
+ * Copyright 2020 Google LLC
826
+ *
827
+ * Licensed under the Apache License, Version 2.0 (the "License");
828
+ * you may not use this file except in compliance with the License.
829
+ * You may obtain a copy of the License at
830
+ *
831
+ * http://www.apache.org/licenses/LICENSE-2.0
832
+ *
833
+ * Unless required by applicable law or agreed to in writing, software
834
+ * distributed under the License is distributed on an "AS IS" BASIS,
835
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
836
+ * See the License for the specific language governing permissions and
837
+ * limitations under the License.
838
+ */function VI(e,t){const n=cf(e,"auth");if(n.isInitialized()){const s=n.getImmediate(),o=n.getOptions();if(gs(o,t??{}))return s;$n(s,"already-initialized")}return n.initialize({options:t})}function WI(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Yn);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function zI(e,t,n){const r=ui(e);Fe(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const s=!1,o=Pf(t),{host:i,port:a}=qI(t),l=a===null?"":`:${a}`,u={url:`${o}//${i}${l}/`},c=Object.freeze({host:i,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){Fe(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Fe(gs(u,r.config.emulator)&&gs(c,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=c,r.settings.appVerificationDisabledForTesting=!0,el(i)?tT(`${o}//${i}${l}`):GI()}function Pf(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function qI(e){const t=Pf(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:Zc(r.substr(o.length+1))}}else{const[o,i]=r.split(":");return{host:o,port:Zc(i)}}}function Zc(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function GI(){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())}/**
839
+ * @license
840
+ * Copyright 2020 Google LLC
841
+ *
842
+ * Licensed under the Apache License, Version 2.0 (the "License");
843
+ * you may not use this file except in compliance with the License.
844
+ * You may obtain a copy of the License at
845
+ *
846
+ * http://www.apache.org/licenses/LICENSE-2.0
847
+ *
848
+ * Unless required by applicable law or agreed to in writing, software
849
+ * distributed under the License is distributed on an "AS IS" BASIS,
850
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
851
+ * See the License for the specific language governing permissions and
852
+ * limitations under the License.
853
+ */class xf{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return Jn("not implemented")}_getIdTokenResponse(t){return Jn("not implemented")}_linkToIdToken(t,n){return Jn("not implemented")}_getReauthenticationResolver(t){return Jn("not implemented")}}/**
854
+ * @license
855
+ * Copyright 2020 Google LLC
856
+ *
857
+ * Licensed under the Apache License, Version 2.0 (the "License");
858
+ * you may not use this file except in compliance with the License.
859
+ * You may obtain a copy of the License at
860
+ *
861
+ * http://www.apache.org/licenses/LICENSE-2.0
862
+ *
863
+ * Unless required by applicable law or agreed to in writing, software
864
+ * distributed under the License is distributed on an "AS IS" BASIS,
865
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
866
+ * See the License for the specific language governing permissions and
867
+ * limitations under the License.
868
+ */async function fs(e,t){return kI(e,"POST","/v1/accounts:signInWithIdp",ol(e,t))}/**
869
+ * @license
870
+ * Copyright 2020 Google LLC
871
+ *
872
+ * Licensed under the Apache License, Version 2.0 (the "License");
873
+ * you may not use this file except in compliance with the License.
874
+ * You may obtain a copy of the License at
875
+ *
876
+ * http://www.apache.org/licenses/LICENSE-2.0
877
+ *
878
+ * Unless required by applicable law or agreed to in writing, software
879
+ * distributed under the License is distributed on an "AS IS" BASIS,
880
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
881
+ * See the License for the specific language governing permissions and
882
+ * limitations under the License.
883
+ */const KI="http://localhost";class qr extends xf{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new qr(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):$n("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:s,...o}=n;if(!r||!s)return null;const i=new qr(r,s);return i.idToken=o.idToken||void 0,i.accessToken=o.accessToken||void 0,i.secret=o.secret,i.nonce=o.nonce,i.pendingToken=o.pendingToken||null,i}_getIdTokenResponse(t){const n=this.buildRequest();return fs(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,fs(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,fs(t,n)}buildRequest(){const t={requestUri:KI,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=io(n)}return t}}/**
884
+ * @license
885
+ * Copyright 2020 Google LLC
886
+ *
887
+ * Licensed under the Apache License, Version 2.0 (the "License");
888
+ * you may not use this file except in compliance with the License.
889
+ * You may obtain a copy of the License at
890
+ *
891
+ * http://www.apache.org/licenses/LICENSE-2.0
892
+ *
893
+ * Unless required by applicable law or agreed to in writing, software
894
+ * distributed under the License is distributed on an "AS IS" BASIS,
895
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
896
+ * See the License for the specific language governing permissions and
897
+ * limitations under the License.
898
+ */class cl{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/**
899
+ * @license
900
+ * Copyright 2019 Google LLC
901
+ *
902
+ * Licensed under the Apache License, Version 2.0 (the "License");
903
+ * you may not use this file except in compliance with the License.
904
+ * You may obtain a copy of the License at
905
+ *
906
+ * http://www.apache.org/licenses/LICENSE-2.0
907
+ *
908
+ * Unless required by applicable law or agreed to in writing, software
909
+ * distributed under the License is distributed on an "AS IS" BASIS,
910
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
911
+ * See the License for the specific language governing permissions and
912
+ * limitations under the License.
913
+ */class co extends cl{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
914
+ * @license
915
+ * Copyright 2020 Google LLC
916
+ *
917
+ * Licensed under the Apache License, Version 2.0 (the "License");
918
+ * you may not use this file except in compliance with the License.
919
+ * You may obtain a copy of the License at
920
+ *
921
+ * http://www.apache.org/licenses/LICENSE-2.0
922
+ *
923
+ * Unless required by applicable law or agreed to in writing, software
924
+ * distributed under the License is distributed on an "AS IS" BASIS,
925
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
926
+ * See the License for the specific language governing permissions and
927
+ * limitations under the License.
928
+ */class vr extends co{constructor(){super("facebook.com")}static credential(t){return qr._fromParams({providerId:vr.PROVIDER_ID,signInMethod:vr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return vr.credentialFromTaggedObject(t)}static credentialFromError(t){return vr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return vr.credential(t.oauthAccessToken)}catch{return null}}}vr.FACEBOOK_SIGN_IN_METHOD="facebook.com";vr.PROVIDER_ID="facebook.com";/**
929
+ * @license
930
+ * Copyright 2020 Google LLC
931
+ *
932
+ * Licensed under the Apache License, Version 2.0 (the "License");
933
+ * you may not use this file except in compliance with the License.
934
+ * You may obtain a copy of the License at
935
+ *
936
+ * http://www.apache.org/licenses/LICENSE-2.0
937
+ *
938
+ * Unless required by applicable law or agreed to in writing, software
939
+ * distributed under the License is distributed on an "AS IS" BASIS,
940
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
941
+ * See the License for the specific language governing permissions and
942
+ * limitations under the License.
943
+ */class yr extends co{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return qr._fromParams({providerId:yr.PROVIDER_ID,signInMethod:yr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return yr.credentialFromTaggedObject(t)}static credentialFromError(t){return yr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return yr.credential(n,r)}catch{return null}}}yr.GOOGLE_SIGN_IN_METHOD="google.com";yr.PROVIDER_ID="google.com";/**
944
+ * @license
945
+ * Copyright 2020 Google LLC
946
+ *
947
+ * Licensed under the Apache License, Version 2.0 (the "License");
948
+ * you may not use this file except in compliance with the License.
949
+ * You may obtain a copy of the License at
950
+ *
951
+ * http://www.apache.org/licenses/LICENSE-2.0
952
+ *
953
+ * Unless required by applicable law or agreed to in writing, software
954
+ * distributed under the License is distributed on an "AS IS" BASIS,
955
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
956
+ * See the License for the specific language governing permissions and
957
+ * limitations under the License.
958
+ */class xn extends co{constructor(){super("github.com")}static credential(t){return qr._fromParams({providerId:xn.PROVIDER_ID,signInMethod:xn.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return xn.credentialFromTaggedObject(t)}static credentialFromError(t){return xn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return xn.credential(t.oauthAccessToken)}catch{return null}}}xn.GITHUB_SIGN_IN_METHOD="github.com";xn.PROVIDER_ID="github.com";/**
959
+ * @license
960
+ * Copyright 2020 Google LLC
961
+ *
962
+ * Licensed under the Apache License, Version 2.0 (the "License");
963
+ * you may not use this file except in compliance with the License.
964
+ * You may obtain a copy of the License at
965
+ *
966
+ * http://www.apache.org/licenses/LICENSE-2.0
967
+ *
968
+ * Unless required by applicable law or agreed to in writing, software
969
+ * distributed under the License is distributed on an "AS IS" BASIS,
970
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
971
+ * See the License for the specific language governing permissions and
972
+ * limitations under the License.
973
+ */class wr extends co{constructor(){super("twitter.com")}static credential(t,n){return qr._fromParams({providerId:wr.PROVIDER_ID,signInMethod:wr.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return wr.credentialFromTaggedObject(t)}static credentialFromError(t){return wr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return wr.credential(n,r)}catch{return null}}}wr.TWITTER_SIGN_IN_METHOD="twitter.com";wr.PROVIDER_ID="twitter.com";/**
974
+ * @license
975
+ * Copyright 2020 Google LLC
976
+ *
977
+ * Licensed under the Apache License, Version 2.0 (the "License");
978
+ * you may not use this file except in compliance with the License.
979
+ * You may obtain a copy of the License at
980
+ *
981
+ * http://www.apache.org/licenses/LICENSE-2.0
982
+ *
983
+ * Unless required by applicable law or agreed to in writing, software
984
+ * distributed under the License is distributed on an "AS IS" BASIS,
985
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
986
+ * See the License for the specific language governing permissions and
987
+ * limitations under the License.
988
+ */class ys{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,n,r,s=!1){const o=await hn._fromIdTokenResponse(t,r,s),i=eu(r);return new ys({user:o,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const s=eu(r);return new ys({user:t,providerId:s,_tokenResponse:r,operationType:n})}}function eu(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
989
+ * @license
990
+ * Copyright 2020 Google LLC
991
+ *
992
+ * Licensed under the Apache License, Version 2.0 (the "License");
993
+ * you may not use this file except in compliance with the License.
994
+ * You may obtain a copy of the License at
995
+ *
996
+ * http://www.apache.org/licenses/LICENSE-2.0
997
+ *
998
+ * Unless required by applicable law or agreed to in writing, software
999
+ * distributed under the License is distributed on an "AS IS" BASIS,
1000
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1001
+ * See the License for the specific language governing permissions and
1002
+ * limitations under the License.
1003
+ */class Wo extends Ir{constructor(t,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,Wo.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 Wo(t,n,r,s)}}function Of(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?Wo._fromErrorAndOperation(e,o,t,r):o})}async function JI(e,t,n=!1){const r=await to(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return ys._forOperation(e,"link",r)}/**
1004
+ * @license
1005
+ * Copyright 2019 Google LLC
1006
+ *
1007
+ * Licensed under the Apache License, Version 2.0 (the "License");
1008
+ * you may not use this file except in compliance with the License.
1009
+ * You may obtain a copy of the License at
1010
+ *
1011
+ * http://www.apache.org/licenses/LICENSE-2.0
1012
+ *
1013
+ * Unless required by applicable law or agreed to in writing, software
1014
+ * distributed under the License is distributed on an "AS IS" BASIS,
1015
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1016
+ * See the License for the specific language governing permissions and
1017
+ * limitations under the License.
1018
+ */async function YI(e,t,n=!1){const{auth:r}=e;if(Pn(r.app))return Promise.reject(Wr(r));const s="reauthenticate";try{const o=await to(e,Of(r,s,t,e),n);Fe(o.idToken,r,"internal-error");const i=il(o.idToken);Fe(i,r,"internal-error");const{sub:a}=i;return Fe(e.uid===a,r,"user-mismatch"),ys._forOperation(e,s,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&$n(r,"user-mismatch"),o}}/**
1019
+ * @license
1020
+ * Copyright 2020 Google LLC
1021
+ *
1022
+ * Licensed under the Apache License, Version 2.0 (the "License");
1023
+ * you may not use this file except in compliance with the License.
1024
+ * You may obtain a copy of the License at
1025
+ *
1026
+ * http://www.apache.org/licenses/LICENSE-2.0
1027
+ *
1028
+ * Unless required by applicable law or agreed to in writing, software
1029
+ * distributed under the License is distributed on an "AS IS" BASIS,
1030
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1031
+ * See the License for the specific language governing permissions and
1032
+ * limitations under the License.
1033
+ */async function QI(e,t,n=!1){if(Pn(e.app))return Promise.reject(Wr(e));const r="signIn",s=await Of(e,r,t),o=await ys._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(o.user),o}function XI(e,t,n,r){return bs(e).onIdTokenChanged(t,n,r)}function ZI(e,t,n){return bs(e).beforeAuthStateChanged(t,n)}const zo="__sak";/**
1034
+ * @license
1035
+ * Copyright 2019 Google LLC
1036
+ *
1037
+ * Licensed under the Apache License, Version 2.0 (the "License");
1038
+ * you may not use this file except in compliance with the License.
1039
+ * You may obtain a copy of the License at
1040
+ *
1041
+ * http://www.apache.org/licenses/LICENSE-2.0
1042
+ *
1043
+ * Unless required by applicable law or agreed to in writing, software
1044
+ * distributed under the License is distributed on an "AS IS" BASIS,
1045
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1046
+ * See the License for the specific language governing permissions and
1047
+ * limitations under the License.
1048
+ */class Mf{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(zo,"1"),this.storage.removeItem(zo),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,n){return this.storage.setItem(t,JSON.stringify(n)),Promise.resolve()}_get(t){const n=this.storage.getItem(t);return Promise.resolve(n?JSON.parse(n):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1049
+ * @license
1050
+ * Copyright 2020 Google LLC
1051
+ *
1052
+ * Licensed under the Apache License, Version 2.0 (the "License");
1053
+ * you may not use this file except in compliance with the License.
1054
+ * You may obtain a copy of the License at
1055
+ *
1056
+ * http://www.apache.org/licenses/LICENSE-2.0
1057
+ *
1058
+ * Unless required by applicable law or agreed to in writing, software
1059
+ * distributed under the License is distributed on an "AS IS" BASIS,
1060
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1061
+ * See the License for the specific language governing permissions and
1062
+ * limitations under the License.
1063
+ */const eS=1e3,tS=10;class Nf extends Mf{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Af(),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);MI()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,tS):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)})},eS)}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]}}Nf.type="LOCAL";const nS=Nf;/**
1064
+ * @license
1065
+ * Copyright 2020 Google LLC
1066
+ *
1067
+ * Licensed under the Apache License, Version 2.0 (the "License");
1068
+ * you may not use this file except in compliance with the License.
1069
+ * You may obtain a copy of the License at
1070
+ *
1071
+ * http://www.apache.org/licenses/LICENSE-2.0
1072
+ *
1073
+ * Unless required by applicable law or agreed to in writing, software
1074
+ * distributed under the License is distributed on an "AS IS" BASIS,
1075
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1076
+ * See the License for the specific language governing permissions and
1077
+ * limitations under the License.
1078
+ */class $f extends Mf{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}$f.type="SESSION";const Df=$f;/**
1079
+ * @license
1080
+ * Copyright 2019 Google LLC
1081
+ *
1082
+ * Licensed under the Apache License, Version 2.0 (the "License");
1083
+ * you may not use this file except in compliance with the License.
1084
+ * You may obtain a copy of the License at
1085
+ *
1086
+ * http://www.apache.org/licenses/LICENSE-2.0
1087
+ *
1088
+ * Unless required by applicable law or agreed to in writing, software
1089
+ * distributed under the License is distributed on an "AS IS" BASIS,
1090
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1091
+ * See the License for the specific language governing permissions and
1092
+ * limitations under the License.
1093
+ */function rS(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
1094
+ * @license
1095
+ * Copyright 2019 Google LLC
1096
+ *
1097
+ * Licensed under the Apache License, Version 2.0 (the "License");
1098
+ * you may not use this file except in compliance with the License.
1099
+ * You may obtain a copy of the License at
1100
+ *
1101
+ * http://www.apache.org/licenses/LICENSE-2.0
1102
+ *
1103
+ * Unless required by applicable law or agreed to in writing, software
1104
+ * distributed under the License is distributed on an "AS IS" BASIS,
1105
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1106
+ * See the License for the specific language governing permissions and
1107
+ * limitations under the License.
1108
+ */class di{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 di(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 rS(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)}}di.receivers=[];/**
1109
+ * @license
1110
+ * Copyright 2020 Google LLC
1111
+ *
1112
+ * Licensed under the Apache License, Version 2.0 (the "License");
1113
+ * you may not use this file except in compliance with the License.
1114
+ * You may obtain a copy of the License at
1115
+ *
1116
+ * http://www.apache.org/licenses/LICENSE-2.0
1117
+ *
1118
+ * Unless required by applicable law or agreed to in writing, software
1119
+ * distributed under the License is distributed on an "AS IS" BASIS,
1120
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1121
+ * See the License for the specific language governing permissions and
1122
+ * limitations under the License.
1123
+ */function ul(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
1124
+ * @license
1125
+ * Copyright 2019 Google LLC
1126
+ *
1127
+ * Licensed under the Apache License, Version 2.0 (the "License");
1128
+ * you may not use this file except in compliance with the License.
1129
+ * You may obtain a copy of the License at
1130
+ *
1131
+ * http://www.apache.org/licenses/LICENSE-2.0
1132
+ *
1133
+ * Unless required by applicable law or agreed to in writing, software
1134
+ * distributed under the License is distributed on an "AS IS" BASIS,
1135
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1136
+ * See the License for the specific language governing permissions and
1137
+ * limitations under the License.
1138
+ */class sS{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,n,r=50){const s=typeof MessageChannel<"u"?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let o,i;return new Promise((a,l)=>{const u=ul("",20);s.port1.start();const c=setTimeout(()=>{l(new Error("unsupported_event"))},r);i={messageChannel:s,onMessage(f){const p=f;if(p.data.eventId===u)switch(p.data.status){case"ack":clearTimeout(c),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(p.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)})}}/**
1139
+ * @license
1140
+ * Copyright 2020 Google LLC
1141
+ *
1142
+ * Licensed under the Apache License, Version 2.0 (the "License");
1143
+ * you may not use this file except in compliance with the License.
1144
+ * You may obtain a copy of the License at
1145
+ *
1146
+ * http://www.apache.org/licenses/LICENSE-2.0
1147
+ *
1148
+ * Unless required by applicable law or agreed to in writing, software
1149
+ * distributed under the License is distributed on an "AS IS" BASIS,
1150
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1151
+ * See the License for the specific language governing permissions and
1152
+ * limitations under the License.
1153
+ */function Nn(){return window}function oS(e){Nn().location.href=e}/**
1154
+ * @license
1155
+ * Copyright 2020 Google LLC.
1156
+ *
1157
+ * Licensed under the Apache License, Version 2.0 (the "License");
1158
+ * you may not use this file except in compliance with the License.
1159
+ * You may obtain a copy of the License at
1160
+ *
1161
+ * http://www.apache.org/licenses/LICENSE-2.0
1162
+ *
1163
+ * Unless required by applicable law or agreed to in writing, software
1164
+ * distributed under the License is distributed on an "AS IS" BASIS,
1165
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1166
+ * See the License for the specific language governing permissions and
1167
+ * limitations under the License.
1168
+ */function Lf(){return typeof Nn().WorkerGlobalScope<"u"&&typeof Nn().importScripts=="function"}async function iS(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function aS(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function lS(){return Lf()?self:null}/**
1169
+ * @license
1170
+ * Copyright 2019 Google LLC
1171
+ *
1172
+ * Licensed under the Apache License, Version 2.0 (the "License");
1173
+ * you may not use this file except in compliance with the License.
1174
+ * You may obtain a copy of the License at
1175
+ *
1176
+ * http://www.apache.org/licenses/LICENSE-2.0
1177
+ *
1178
+ * Unless required by applicable law or agreed to in writing, software
1179
+ * distributed under the License is distributed on an "AS IS" BASIS,
1180
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1181
+ * See the License for the specific language governing permissions and
1182
+ * limitations under the License.
1183
+ */const jf="firebaseLocalStorageDb",cS=1,qo="firebaseLocalStorage",Bf="fbase_key";class uo{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 fi(e,t){return e.transaction([qo],t?"readwrite":"readonly").objectStore(qo)}function uS(){const e=indexedDB.deleteDatabase(jf);return new uo(e).toPromise()}function Ia(){const e=indexedDB.open(jf,cS);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(qo,{keyPath:Bf})}catch(s){n(s)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(qo)?t(r):(r.close(),await uS(),t(await Ia()))})})}async function tu(e,t,n){const r=fi(e,!0).put({[Bf]:t,value:n});return new uo(r).toPromise()}async function dS(e,t){const n=fi(e,!1).get(t),r=await new uo(n).toPromise();return r===void 0?null:r.value}function nu(e,t){const n=fi(e,!0).delete(t);return new uo(n).toPromise()}const fS=800,hS=3;class Uf{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 Ia(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>hS)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Lf()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=di._getInstance(lS()),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 iS(),!this.activeServiceWorker)return;this.sender=new sS(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||aS()!==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 Ia();return await tu(t,zo,"1"),await nu(t,zo),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>tu(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>dS(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>nu(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(s=>{const o=fi(s,!1).getAll();return new uo(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(),fS)}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()}}Uf.type="LOCAL";const pS=Uf;new lo(3e4,6e4);/**
1184
+ * @license
1185
+ * Copyright 2021 Google LLC
1186
+ *
1187
+ * Licensed under the Apache License, Version 2.0 (the "License");
1188
+ * you may not use this file except in compliance with the License.
1189
+ * You may obtain a copy of the License at
1190
+ *
1191
+ * http://www.apache.org/licenses/LICENSE-2.0
1192
+ *
1193
+ * Unless required by applicable law or agreed to in writing, software
1194
+ * distributed under the License is distributed on an "AS IS" BASIS,
1195
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1196
+ * See the License for the specific language governing permissions and
1197
+ * limitations under the License.
1198
+ */function Ff(e,t){return t?Yn(t):(Fe(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
1199
+ * @license
1200
+ * Copyright 2019 Google LLC
1201
+ *
1202
+ * Licensed under the Apache License, Version 2.0 (the "License");
1203
+ * you may not use this file except in compliance with the License.
1204
+ * You may obtain a copy of the License at
1205
+ *
1206
+ * http://www.apache.org/licenses/LICENSE-2.0
1207
+ *
1208
+ * Unless required by applicable law or agreed to in writing, software
1209
+ * distributed under the License is distributed on an "AS IS" BASIS,
1210
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1211
+ * See the License for the specific language governing permissions and
1212
+ * limitations under the License.
1213
+ */class dl extends xf{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return fs(t,this._buildIdpRequest())}_linkToIdToken(t,n){return fs(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return fs(t,this._buildIdpRequest())}_buildIdpRequest(t){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(n.idToken=t),n}}function mS(e){return QI(e.auth,new dl(e),e.bypassAuthState)}function gS(e){const{auth:t,user:n}=e;return Fe(n,t,"internal-error"),YI(n,new dl(e),e.bypassAuthState)}async function vS(e){const{auth:t,user:n}=e;return Fe(n,t,"internal-error"),JI(n,new dl(e),e.bypassAuthState)}/**
1214
+ * @license
1215
+ * Copyright 2020 Google LLC
1216
+ *
1217
+ * Licensed under the Apache License, Version 2.0 (the "License");
1218
+ * you may not use this file except in compliance with the License.
1219
+ * You may obtain a copy of the License at
1220
+ *
1221
+ * http://www.apache.org/licenses/LICENSE-2.0
1222
+ *
1223
+ * Unless required by applicable law or agreed to in writing, software
1224
+ * distributed under the License is distributed on an "AS IS" BASIS,
1225
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1226
+ * See the License for the specific language governing permissions and
1227
+ * limitations under the License.
1228
+ */class Hf{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 mS;case"linkViaPopup":case"linkViaRedirect":return vS;case"reauthViaPopup":case"reauthViaRedirect":return gS;default:$n(this.auth,"internal-error")}}resolve(t){sr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){sr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1229
+ * @license
1230
+ * Copyright 2020 Google LLC
1231
+ *
1232
+ * Licensed under the Apache License, Version 2.0 (the "License");
1233
+ * you may not use this file except in compliance with the License.
1234
+ * You may obtain a copy of the License at
1235
+ *
1236
+ * http://www.apache.org/licenses/LICENSE-2.0
1237
+ *
1238
+ * Unless required by applicable law or agreed to in writing, software
1239
+ * distributed under the License is distributed on an "AS IS" BASIS,
1240
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1241
+ * See the License for the specific language governing permissions and
1242
+ * limitations under the License.
1243
+ */const yS=new lo(2e3,1e4);async function wS(e,t,n){if(Pn(e.app))return Promise.reject(gn(e,"operation-not-supported-in-this-environment"));const r=ui(e);mI(e,t,cl);const s=Ff(r,n);return new Fr(r,"signInViaPopup",t,s).executeNotNull()}class Fr extends Hf{constructor(t,n,r,s,o){super(t,n,s,o),this.provider=r,this.authWindow=null,this.pollId=null,Fr.currentPopupAction&&Fr.currentPopupAction.cancel(),Fr.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Fe(t,this.auth,"internal-error"),t}async onExecution(){sr(this.filter.length===1,"Popup operations only handle one event");const t=ul();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(gn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(gn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Fr.currentPopupAction=null}pollUserCancellation(){const t=()=>{var n,r;if((r=(n=this.authWindow)==null?void 0:n.window)!=null&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(gn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,yS.get())};t()}}Fr.currentPopupAction=null;/**
1244
+ * @license
1245
+ * Copyright 2020 Google LLC
1246
+ *
1247
+ * Licensed under the Apache License, Version 2.0 (the "License");
1248
+ * you may not use this file except in compliance with the License.
1249
+ * You may obtain a copy of the License at
1250
+ *
1251
+ * http://www.apache.org/licenses/LICENSE-2.0
1252
+ *
1253
+ * Unless required by applicable law or agreed to in writing, software
1254
+ * distributed under the License is distributed on an "AS IS" BASIS,
1255
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1256
+ * See the License for the specific language governing permissions and
1257
+ * limitations under the License.
1258
+ */const bS="pendingRedirect",Po=new Map;class _S extends Hf{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=Po.get(this.auth._key());if(!t){try{const r=await kS(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}Po.set(this.auth._key(),t)}return this.bypassAuthState||Po.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const n=await this.auth._redirectUserForId(t.eventId);if(n)return this.user=n,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function kS(e,t){const n=SS(t),r=IS(e);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function TS(e,t){Po.set(e._key(),t)}function IS(e){return Yn(e._redirectPersistence)}function SS(e){return Ro(bS,e.config.apiKey,e.name)}async function ES(e,t,n=!1){if(Pn(e.app))return Promise.reject(Wr(e));const r=ui(e),s=Ff(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}/**
1259
+ * @license
1260
+ * Copyright 2020 Google LLC
1261
+ *
1262
+ * Licensed under the Apache License, Version 2.0 (the "License");
1263
+ * you may not use this file except in compliance with the License.
1264
+ * You may obtain a copy of the License at
1265
+ *
1266
+ * http://www.apache.org/licenses/LICENSE-2.0
1267
+ *
1268
+ * Unless required by applicable law or agreed to in writing, software
1269
+ * distributed under the License is distributed on an "AS IS" BASIS,
1270
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1271
+ * See the License for the specific language governing permissions and
1272
+ * limitations under the License.
1273
+ */const CS=600*1e3;class AS{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||!RS(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!Vf(t)){const s=((r=t.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(gn(this.auth,s))}else n.onAuthEvent(t)}isEventForConsumer(t,n){const r=n.eventId===null||!!t.eventId&&t.eventId===n.eventId;return n.filter.includes(t.type)&&r}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=CS&&this.cachedEventUids.clear(),this.cachedEventUids.has(ru(t))}saveEventToCache(t){this.cachedEventUids.add(ru(t)),this.lastProcessedEventTime=Date.now()}}function ru(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function Vf({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function RS(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Vf(e);default:return!1}}/**
1274
+ * @license
1275
+ * Copyright 2020 Google LLC
1276
+ *
1277
+ * Licensed under the Apache License, Version 2.0 (the "License");
1278
+ * you may not use this file except in compliance with the License.
1279
+ * You may obtain a copy of the License at
1280
+ *
1281
+ * http://www.apache.org/licenses/LICENSE-2.0
1282
+ *
1283
+ * Unless required by applicable law or agreed to in writing, software
1284
+ * distributed under the License is distributed on an "AS IS" BASIS,
1285
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1286
+ * See the License for the specific language governing permissions and
1287
+ * limitations under the License.
1288
+ */async function PS(e,t={}){return _s(e,"GET","/v1/projects",t)}/**
1289
+ * @license
1290
+ * Copyright 2020 Google LLC
1291
+ *
1292
+ * Licensed under the Apache License, Version 2.0 (the "License");
1293
+ * you may not use this file except in compliance with the License.
1294
+ * You may obtain a copy of the License at
1295
+ *
1296
+ * http://www.apache.org/licenses/LICENSE-2.0
1297
+ *
1298
+ * Unless required by applicable law or agreed to in writing, software
1299
+ * distributed under the License is distributed on an "AS IS" BASIS,
1300
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1301
+ * See the License for the specific language governing permissions and
1302
+ * limitations under the License.
1303
+ */const xS=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,OS=/^https?/;async function MS(e){if(e.config.emulator)return;const{authorizedDomains:t}=await PS(e);for(const n of t)try{if(NS(n))return}catch{}$n(e,"unauthorized-domain")}function NS(e){const t=ka(),{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(!OS.test(n))return!1;if(xS.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
1304
+ * @license
1305
+ * Copyright 2020 Google LLC.
1306
+ *
1307
+ * Licensed under the Apache License, Version 2.0 (the "License");
1308
+ * you may not use this file except in compliance with the License.
1309
+ * You may obtain a copy of the License at
1310
+ *
1311
+ * http://www.apache.org/licenses/LICENSE-2.0
1312
+ *
1313
+ * Unless required by applicable law or agreed to in writing, software
1314
+ * distributed under the License is distributed on an "AS IS" BASIS,
1315
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1316
+ * See the License for the specific language governing permissions and
1317
+ * limitations under the License.
1318
+ */const $S=new lo(3e4,6e4);function su(){const e=Nn().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}}function DS(e){return new Promise((t,n)=>{var s,o,i;function r(){su(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{su(),n(gn(e,"network-request-failed"))},timeout:$S.get()})}if((o=(s=Nn().gapi)==null?void 0:s.iframes)!=null&&o.Iframe)t(gapi.iframes.getContext());else if((i=Nn().gapi)!=null&&i.load)r();else{const a=HI("iframefcb");return Nn()[a]=()=>{gapi.load?r():n(gn(e,"network-request-failed"))},UI(`${FI()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw xo=null,t})}let xo=null;function LS(e){return xo=xo||DS(e),xo}/**
1319
+ * @license
1320
+ * Copyright 2020 Google LLC.
1321
+ *
1322
+ * Licensed under the Apache License, Version 2.0 (the "License");
1323
+ * you may not use this file except in compliance with the License.
1324
+ * You may obtain a copy of the License at
1325
+ *
1326
+ * http://www.apache.org/licenses/LICENSE-2.0
1327
+ *
1328
+ * Unless required by applicable law or agreed to in writing, software
1329
+ * distributed under the License is distributed on an "AS IS" BASIS,
1330
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1331
+ * See the License for the specific language governing permissions and
1332
+ * limitations under the License.
1333
+ */const jS=new lo(5e3,15e3),BS="__/auth/iframe",US="emulator/auth/iframe",FS={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},HS=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function VS(e){const t=e.config;Fe(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?sl(t,US):`https://${e.config.authDomain}/${BS}`,r={apiKey:t.apiKey,appName:e.name,v:ao},s=HS.get(e.config.apiHost);s&&(r.eid=s);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${io(r).slice(1)}`}async function WS(e){const t=await LS(e),n=Nn().gapi;return Fe(n,e,"internal-error"),t.open({where:document.body,url:VS(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:FS,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const i=gn(e,"network-request-failed"),a=Nn().setTimeout(()=>{o(i)},jS.get());function l(){Nn().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{o(i)})}))}/**
1334
+ * @license
1335
+ * Copyright 2020 Google LLC.
1336
+ *
1337
+ * Licensed under the Apache License, Version 2.0 (the "License");
1338
+ * you may not use this file except in compliance with the License.
1339
+ * You may obtain a copy of the License at
1340
+ *
1341
+ * http://www.apache.org/licenses/LICENSE-2.0
1342
+ *
1343
+ * Unless required by applicable law or agreed to in writing, software
1344
+ * distributed under the License is distributed on an "AS IS" BASIS,
1345
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1346
+ * See the License for the specific language governing permissions and
1347
+ * limitations under the License.
1348
+ */const zS={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},qS=500,GS=600,KS="_blank",JS="http://localhost";class ou{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function YS(e,t,n,r=qS,s=GS){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={...zS,width:r.toString(),height:s.toString(),top:o,left:i},u=Xt().toLowerCase();n&&(a=Tf(u)?KS:n),_f(u)&&(t=t||JS,l.scrollbars="yes");const c=Object.entries(l).reduce((p,[_,N])=>`${p}${_}=${N},`,"");if(OI(u)&&a!=="_self")return QS(t||"",a),new ou(null);const f=window.open(t||"",a,c);Fe(f,e,"popup-blocked");try{f.focus()}catch{}return new ou(f)}function QS(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)}/**
1349
+ * @license
1350
+ * Copyright 2021 Google LLC
1351
+ *
1352
+ * Licensed under the Apache License, Version 2.0 (the "License");
1353
+ * you may not use this file except in compliance with the License.
1354
+ * You may obtain a copy of the License at
1355
+ *
1356
+ * http://www.apache.org/licenses/LICENSE-2.0
1357
+ *
1358
+ * Unless required by applicable law or agreed to in writing, software
1359
+ * distributed under the License is distributed on an "AS IS" BASIS,
1360
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1361
+ * See the License for the specific language governing permissions and
1362
+ * limitations under the License.
1363
+ */const XS="__/auth/handler",ZS="emulator/auth/handler",eE=encodeURIComponent("fac");async function iu(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:ao,eventId:s};if(t instanceof cl){t.setDefaultLanguage(e.languageCode),i.providerId=t.providerId||"",Q0(t.getCustomParameters())||(i.customParameters=JSON.stringify(t.getCustomParameters()));for(const[c,f]of Object.entries({}))i[c]=f}if(t instanceof co){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?`#${eE}=${encodeURIComponent(l)}`:"";return`${tE(e)}?${io(a).slice(1)}${u}`}function tE({config:e}){return e.emulator?sl(e,ZS):`https://${e.authDomain}/${XS}`}/**
1364
+ * @license
1365
+ * Copyright 2020 Google LLC
1366
+ *
1367
+ * Licensed under the Apache License, Version 2.0 (the "License");
1368
+ * you may not use this file except in compliance with the License.
1369
+ * You may obtain a copy of the License at
1370
+ *
1371
+ * http://www.apache.org/licenses/LICENSE-2.0
1372
+ *
1373
+ * Unless required by applicable law or agreed to in writing, software
1374
+ * distributed under the License is distributed on an "AS IS" BASIS,
1375
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1376
+ * See the License for the specific language governing permissions and
1377
+ * limitations under the License.
1378
+ */const Hi="webStorageSupport";class nE{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Df,this._completeRedirectFn=ES,this._overrideRedirectResult=TS}async _openPopup(t,n,r,s){var i;sr((i=this.eventManagers[t._key()])==null?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await iu(t,n,r,ka(),s);return YS(t,o,ul())}async _openRedirect(t,n,r,s){await this._originValidation(t);const o=await iu(t,n,r,ka(),s);return oS(o),new Promise(()=>{})}_initialize(t){const n=t._key();if(this.eventManagers[n]){const{manager:s,promise:o}=this.eventManagers[n];return s?Promise.resolve(s):(sr(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(t);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(t){const n=await WS(t),r=new AS(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(Hi,{type:Hi},s=>{var i;const o=(i=s==null?void 0:s[0])==null?void 0:i[Hi];o!==void 0&&n(!!o),$n(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=MS(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return Af()||kf()||al()}}const rE=nE;var au="@firebase/auth",lu="1.12.2";/**
1379
+ * @license
1380
+ * Copyright 2020 Google LLC
1381
+ *
1382
+ * Licensed under the Apache License, Version 2.0 (the "License");
1383
+ * you may not use this file except in compliance with the License.
1384
+ * You may obtain a copy of the License at
1385
+ *
1386
+ * http://www.apache.org/licenses/LICENSE-2.0
1387
+ *
1388
+ * Unless required by applicable law or agreed to in writing, software
1389
+ * distributed under the License is distributed on an "AS IS" BASIS,
1390
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1391
+ * See the License for the specific language governing permissions and
1392
+ * limitations under the License.
1393
+ */class sE{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()}}/**
1394
+ * @license
1395
+ * Copyright 2020 Google LLC
1396
+ *
1397
+ * Licensed under the Apache License, Version 2.0 (the "License");
1398
+ * you may not use this file except in compliance with the License.
1399
+ * You may obtain a copy of the License at
1400
+ *
1401
+ * http://www.apache.org/licenses/LICENSE-2.0
1402
+ *
1403
+ * Unless required by applicable law or agreed to in writing, software
1404
+ * distributed under the License is distributed on an "AS IS" BASIS,
1405
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1406
+ * See the License for the specific language governing permissions and
1407
+ * limitations under the License.
1408
+ */function oE(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 iE(e){Zs(new vs("auth",(t,{options:n})=>{const r=t.getProvider("app").getImmediate(),s=t.getProvider("heartbeat"),o=t.getProvider("app-check-internal"),{apiKey:i,authDomain:a}=r.options;Fe(i&&!i.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:i,authDomain:a,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Rf(e)},u=new jI(r,s,o,l);return WI(u,n),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),Zs(new vs("auth-internal",t=>{const n=ui(t.getProvider("auth").getImmediate());return(r=>new sE(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),cs(au,lu,oE(e)),cs(au,lu,"esm2020")}/**
1409
+ * @license
1410
+ * Copyright 2021 Google LLC
1411
+ *
1412
+ * Licensed under the Apache License, Version 2.0 (the "License");
1413
+ * you may not use this file except in compliance with the License.
1414
+ * You may obtain a copy of the License at
1415
+ *
1416
+ * http://www.apache.org/licenses/LICENSE-2.0
1417
+ *
1418
+ * Unless required by applicable law or agreed to in writing, software
1419
+ * distributed under the License is distributed on an "AS IS" BASIS,
1420
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1421
+ * See the License for the specific language governing permissions and
1422
+ * limitations under the License.
1423
+ */const aE=300,lE=sf("authIdTokenMaxAge")||aE;let cu=null;const cE=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>lE)return;const s=n==null?void 0:n.token;cu!==s&&(cu=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function uE(e=df()){const t=cf(e,"auth");if(t.isInitialized())return t.getImmediate();const n=VI(e,{popupRedirectResolver:rE,persistence:[pS,nS,Df]}),r=sf("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=cE(o.toString());ZI(n,i,()=>i(n.currentUser)),XI(n,a=>i(a))}}const s=B0("auth");return s&&zI(n,`http://${s}`),n}function dE(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}BI({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=gn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",dE().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="});iE("Browser");const fE={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 hE(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=pe(()=>s.value==="pull"),a=pe(()=>s.value==="push"),l=pe(()=>s.value!=="");async function u(){try{const I=await fetch("/codex-api/skills-sync/status");if(!I.ok)return;const M=await I.json();M.data&&(o.value=M.data)}catch{}}async function c(){try{const I=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),M=await I.json();if(!I.ok||!M.data)throw new Error("Failed to start GitHub login");t.value=M.data;const Y=30,j=Math.max((M.data.interval??5)*1e3,3e3);let q=!1;for(let B=0;B<Y;B++){await new Promise(ve=>setTimeout(ve,j));const oe=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:M.data.device_code})}),de=await oe.json();if(!oe.ok)throw new Error(de.error||"Failed to complete GitHub login");if(de.ok){q=!0;break}if(!de.pending)throw new Error(de.error||"Failed to complete GitHub login")}if(!q)throw new Error("GitHub login timed out. Please retry.");t.value=null,await u(),e.showToast("GitHub login successful")}catch(I){e.showToast(I instanceof Error?I.message:"Failed GitHub login","error")}}async function f(){try{const I=eI().length>0?df():uf(fE),M=uE(I),Y=new xn;Y.addScope("repo");const j=await wS(M,Y),q=xn.credentialFromResult(j),B=(q==null?void 0:q.accessToken)??"";if(!B)throw new Error("GitHub access token missing from Firebase login");const oe=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:B})}),de=await oe.json();if(!oe.ok||!de.ok)throw new Error(de.error||"Failed to login with GitHub token");await u(),e.showToast("GitHub login successful")}catch(I){const M=I instanceof Error?I.message:"Failed Firebase GitHub login";e.showToast(M,"error")}}async function p(){r.value="",n.value="pull-started",s.value="pull";try{const I=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),M=await I.json();if(!I.ok||!M.ok)throw new Error(M.error||"Failed to pull synced skills");await e.onPulled(),n.value="pull-success",e.showToast(o.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(I){const M=I instanceof Error?I.message:"Failed to pull sync";r.value=M,n.value="pull-failed",e.showToast(M,"error")}finally{s.value=""}}async function _(){r.value="",n.value="push-started",s.value="push";try{const I=await fetch("/codex-api/skills-sync/push",{method:"POST"}),M=await I.json();if(!I.ok||!M.ok)throw new Error(M.error||"Failed to push synced skills");n.value="push-success",e.showToast("Pushed skills to private sync repo")}catch(I){const M=I instanceof Error?I.message:"Failed to push sync";r.value=M,n.value="push-failed",e.showToast(M,"error")}finally{s.value=""}}async function N(){try{const I=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),M=await I.json();if(!I.ok||!M.ok)throw new Error(M.error||"Failed to logout GitHub");await u(),e.showToast("Logged out from GitHub")}catch(I){e.showToast(I instanceof Error?I.message:"Failed to logout GitHub","error")}}return{deviceLogin:t,isPullInFlight:i,isPushInFlight:a,isSyncActionInFlight:l,loadSyncStatus:u,logoutGithub:N,pullSkillsSync:p,pushSkillsSync:_,startGithubFirebaseLogin:f,startGithubLogin:c,syncActionError:r,syncActionStatus:n,syncStatus:o}}const pE={class:"skills-hub"},mE={class:"skills-sync-panel"},gE={class:"skills-sync-header"},vE={key:0,class:"skills-sync-badge"},yE={key:1,class:"skills-sync-badge"},wE={key:2,class:"skills-sync-badge"},bE={class:"skills-sync-meta"},_E={key:0,class:"skills-sync-error"},kE={key:1,class:"skills-sync-meta"},TE={key:2,class:"skills-sync-error"},IE={key:3,class:"skills-sync-device"},SE=["href"],EE={class:"skills-sync-actions"},CE=["disabled"],AE=["disabled"],RE=["disabled"],PE={key:1,class:"skills-hub-section"},xE={class:"skills-hub-section-title"},OE={key:0,class:"skills-hub-grid"},ME={class:"skills-hub-toolbar"},NE={class:"skills-hub-search-wrap"},$E={key:0,class:"skills-hub-count"},DE={class:"skills-hub-section"},LE={key:0,class:"skills-hub-loading"},jE={key:1,class:"skills-hub-error"},BE={key:0,class:"skills-hub-grid"},UE={key:1,class:"skills-hub-empty"},yo="codex-web-local.skills-hub.cache.v1",FE=Lt({__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),p=D(!1),_=D(n),N=D(null),I=D(""),M=D(!1),Y=D(!1);let j=null,q=null;const B=t,oe=pe(()=>o.value==="date"?"Newest":"A-Z"),de=pe(()=>{var P;return((P=N.value)==null?void 0:P.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),ve=pe(()=>`${_.value.owner}/${_.value.name}`),Ie=pe(()=>M.value&&I.value===ve.value),re=pe(()=>Y.value&&I.value===ve.value),ee=pe(()=>{const P=s.value.toLowerCase().trim();return P?a.value.filter($=>$.name.toLowerCase().includes(P)||$.owner.toLowerCase().includes(P)||($.displayName??"").toLowerCase().includes(P)):a.value});function ye(P,$="success"){N.value={text:P,type:$},q&&clearTimeout(q),q=setTimeout(()=>{N.value=null},3e3)}function te(){o.value=o.value==="date"?"name":"date",$e(s.value)}function je(P){return`${o.value}::${P.trim().toLowerCase()}`}function Be(P){var $;if(typeof window>"u")return null;try{const L=window.localStorage.getItem(yo);return L?(($=JSON.parse(L).byKey)==null?void 0:$[P])??null:null}catch{return null}}function Qe(P,$){if(!(typeof window>"u"))try{const L=window.localStorage.getItem(yo),V=(L?JSON.parse(L):{}).byKey??{};V[P]=$,window.localStorage.setItem(yo,JSON.stringify({byKey:V}))}catch{}}function Re(){if(!(typeof window>"u"))try{window.localStorage.removeItem(yo)}catch{}}function Te(P){const $=P.installed??[];a.value=$;const L=new Set($.map(G=>G.name));i.value=P.data.map(G=>{if(G.installed||L.has(G.name)){const V=$.find(be=>be.name===G.name);return{...G,installed:!0,path:(V==null?void 0:V.path)??G.path,enabled:(V==null?void 0:V.enabled)??G.enabled}}return G}).filter(G=>!G.installed),l.value=P.total}async function $e(P){const $=je(P),L=Be($);L&&Te(L),u.value=!L,c.value="";try{const G=new URLSearchParams;P.trim()&&G.set("q",P.trim()),G.set("limit","100"),G.set("sort",o.value);const V=await fetch(`/codex-api/skills-hub?${G}`);if(!V.ok)throw new Error(`HTTP ${V.status}`);const be=await V.json();Te(be),Qe($,be)}catch(G){c.value=G instanceof Error?G.message:"Failed to load skills"}finally{u.value=!1}}function It(){j&&clearTimeout(j),j=setTimeout(()=>$e(s.value),300)}function nt(P){_.value=P,p.value=!0}async function Xe(P){I.value=`${P.owner}/${P.name}`,M.value=!0;try{const L=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:P.owner,name:P.name})})).json();if(!L.ok)throw new Error(L.error||"Install failed");const G={...P,installed:!0,path:L.path,enabled:!0};a.value=[...a.value,G],i.value=i.value.filter(V=>V.name!==P.name),_.value=G,ye(`${P.displayName||P.name} skill installed`),p.value=!1,Re(),B("skills-changed")}catch($){ye($ instanceof Error?$.message:"Failed to install skill","error")}finally{M.value=!1}}async function Ze(P){I.value=`${P.owner}/${P.name}`,Y.value=!0;try{const L=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:P.name,path:P.path})})).json();if(!L.ok)throw new Error(L.error||"Uninstall failed");a.value=a.value.filter(G=>G.name!==P.name),P.owner!=="local"&&(i.value=[...i.value,{...P,installed:!1,path:void 0,enabled:void 0}]),ye(`${P.displayName||P.name} skill uninstalled`),p.value=!1,Re(),B("skills-changed")}catch($){ye($ instanceof Error?$.message:"Failed to uninstall skill","error")}finally{Y.value=!1}}async function ht(P,$){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:P.path,enabled:$}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),ye(`${P.displayName||P.name} skill ${$?"enabled":"disabled"}`),await $e(s.value)}catch(L){ye(L instanceof Error?L.message:"Failed to update skill","error")}}const{deviceLogin:Rt,isPullInFlight:Ge,isPushInFlight:et,isSyncActionInFlight:W,loadSyncStatus:me,logoutGithub:ie,pullSkillsSync:fe,pushSkillsSync:De,startGithubFirebaseLogin:g,startGithubLogin:v,syncActionError:A,syncActionStatus:H,syncStatus:F}=hE({showToast:ye,onPulled:async()=>{await $e(s.value),B("skills-changed")}});return ir(()=>{$e(""),me()}),(P,$)=>(w(),T("div",pE,[$[11]||($[11]=m("div",{class:"skills-hub-header"},[m("h2",{class:"skills-hub-title"},"Skills Hub"),m("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),m("div",mE,[m("div",gE,[$[8]||($[8]=m("strong",null,"Skills Sync (GitHub)",-1)),ue(F).configured?(w(),T("span",vE,"Connected: "+ce(ue(F).repoOwner)+"/"+ce(ue(F).repoName),1)):ue(F).loggedIn?(w(),T("span",yE,"Logged in as "+ce(ue(F).githubUsername),1)):(w(),T("span",wE,"Not connected"))]),m("div",bE,[m("span",null,"Startup: "+ce(ue(F).startup.mode),1),m("span",null,"Branch: "+ce(ue(F).startup.branch),1),m("span",null,"Action: "+ce(ue(F).startup.lastAction),1)]),ue(F).startup.lastError?(w(),T("div",_E,ce(ue(F).startup.lastError),1)):se("",!0),ue(H)?(w(),T("div",kE,[m("span",null,"Manual sync: "+ce(ue(H)),1)])):se("",!0),ue(A)?(w(),T("div",TE,ce(ue(A)),1)):se("",!0),ue(Rt)?(w(),T("div",IE,[m("span",null,[$[9]||($[9]=aa("Open ",-1)),m("a",{href:ue(Rt).verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,SE),$[10]||($[10]=aa(" and enter code:",-1))]),m("code",null,ce(ue(Rt).user_code),1)])):se("",!0),m("div",EE,[ue(F).loggedIn?se("",!0):(w(),T("button",{key:0,class:"skills-hub-sort",type:"button",onClick:$[0]||($[0]=(...L)=>ue(g)&&ue(g)(...L))},"Login with GitHub")),ue(F).loggedIn?se("",!0):(w(),T("button",{key:1,class:"skills-hub-sort",type:"button",onClick:$[1]||($[1]=(...L)=>ue(v)&&ue(v)(...L))},"Device Login")),ue(F).loggedIn?(w(),T("button",{key:2,class:"skills-hub-sort",type:"button",onClick:$[2]||($[2]=(...L)=>ue(ie)&&ue(ie)(...L)),disabled:ue(W)},"Logout GitHub",8,CE)):se("",!0),m("button",{class:"skills-hub-sort",type:"button",onClick:$[3]||($[3]=(...L)=>ue(fe)&&ue(fe)(...L)),disabled:ue(W)},ce(ue(Ge)?"Pulling...":"Pull"),9,AE),ue(F).loggedIn?(w(),T("button",{key:3,class:"skills-hub-sort",type:"button",onClick:$[4]||($[4]=(...L)=>ue(De)&&ue(De)(...L)),disabled:!ue(F).configured||ue(W)},ce(ue(et)?"Pushing...":"Push"),9,RE)):se("",!0)])]),N.value?(w(),T("div",{key:0,class:gt(["skills-hub-toast",de.value])},ce(N.value.text),3)):se("",!0),ee.value.length>0?(w(),T("div",PE,[m("button",{class:"skills-hub-section-toggle",type:"button",onClick:$[5]||($[5]=L=>f.value=!f.value)},[m("span",xE,"Installed ("+ce(ee.value.length)+")",1),Ce(Kd,{class:gt(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),T("div",OE,[(w(!0),T(He,null,Et(ee.value,L=>(w(),yt(Dc,{key:L.name,skill:L,onSelect:G=>nt(G)},null,8,["skill","onSelect"]))),128))])):se("",!0)])):se("",!0),m("div",ME,[m("div",NE,[Ce(ga,{class:"skills-hub-search-icon"}),tr(m("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":$[6]||($[6]=L=>s.value=L),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:It},null,544),[[nr,s.value]]),l.value>0?(w(),T("span",$E,ce(l.value)+" skills",1)):se("",!0)]),m("button",{class:"skills-hub-sort",type:"button",onClick:te},ce(oe.value),1)]),m("div",DE,[u.value?(w(),T("div",LE,"Loading skills...")):c.value?(w(),T("div",jE,ce(c.value),1)):(w(),T(He,{key:2},[i.value.length>0?(w(),T("div",BE,[(w(!0),T(He,null,Et(i.value,L=>(w(),yt(Dc,{key:L.url,skill:L,onSelect:G=>nt(G)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),T("div",UE,'No skills found for "'+ce(s.value)+'"',1)):se("",!0)],64))]),Ce(P0,{skill:_.value,visible:p.value,"is-installing":Ie.value,"is-uninstalling":re.value,onClose:$[7]||($[7]=L=>p.value=!1),onInstall:Xe,onUninstall:Ze,onToggleEnabled:ht},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),HE=st(FE,[["__scopeId","data-v-2f6920be"]]),VE={},WE={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 zE(e,t){return w(),T("svg",WE,[...t[0]||(t[0]=[m("path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"},null,-1),m("path",{d:"M9 4l0 16"},null,-1)])])}const qE=st(VE,[["render",zE]]),GE={},KE={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function JE(e,t){return w(),T("svg",KE,[...t[0]||(t[0]=[m("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm12 -16h-8v14h8a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1"},null,-1)])])}const YE=st(GE,[["render",JE]]),QE={class:"sidebar-thread-controls"},XE=["aria-label","title"],ZE=Lt({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(w(),T("div",QE,[m("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(w(),yt(YE,{key:0,class:"sidebar-thread-controls-icon"})):(w(),yt(qE,{key:1,class:"sidebar-thread-controls-icon"}))],8,XE),On(t.$slots,"default",{},void 0),e.showNewThreadButton?(w(),T("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[1]||(n[1]=r=>t.$emit("start-new-thread"))},[Ce(Uo,{class:"sidebar-thread-controls-icon"})])):se("",!0)]))}}),uu=st(ZE,[["__scopeId","data-v-46a10052"]]),eC={},tC={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function nC(e,t){return w(),T("svg",tC,[...t[0]||(t[0]=[m("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[m("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),m("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const rC=st(eC,[["render",nC]]);function gr(e){return e.flatMap(t=>t.threads)}const Wf="codex-web-local.thread-read-state.v1",zf="codex-web-local.thread-scroll-state.v1",Sa="codex-web-local.selected-thread-id.v1",qf="codex-web-local.project-order.v1",Gf="codex-web-local.project-display-name.v1",Vi=220,du=["none","minimal","low","medium","high","xhigh"],Os="__global__",un="gpt-5.2-codex";function sC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Wf);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function fu(e){typeof window>"u"||window.localStorage.setItem(Wf,JSON.stringify(e))}function Kf(e,t,n){return Math.min(Math.max(e,t),n)}function oC(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=Kf(t.scrollRatio,0,1)),n}function iC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(zf);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t)){if(!r)continue;const o=oC(s);o&&(n[r]=o)}return n}catch{return{}}}function hu(e){typeof window>"u"||window.localStorage.setItem(zf,JSON.stringify(e))}function aC(){return typeof window>"u"?"":window.localStorage.getItem(Sa)??""}function lC(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Sa);return}window.localStorage.setItem(Sa,e)}}function cC(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(qf);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t)typeof r=="string"&&r.length>0&&!n.includes(r)&&n.push(r);return n}catch{return[]}}function es(e){typeof window>"u"||window.localStorage.setItem(qf,JSON.stringify(e))}function uC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Gf);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t))typeof r=="string"&&r.length>0&&typeof s=="string"&&(n[r]=s);return n}catch{return{}}}function Wi(e){typeof window>"u"||window.localStorage.setItem(Gf,JSON.stringify(e))}function wo(e,t){const n=[];for(const r of e)n.includes(r)||n.push(r);for(const r of t)n.includes(r.projectName)||n.push(r.projectName);return Br(e,n)?e:n}function zi(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>n.get(s)??{projectName:s,threads:[]});for(const s of e)t.includes(s.projectName)||r.push(s);return r}function Br(e,t){const n=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(n.length!==r.length)return!1;for(let s=0;s<n.length;s+=1)if(n[s]!==r[s])return!1;return!0}function dC(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 fC(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function bo(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 Ea(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Br(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&fC(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Go(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 hC(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&&Ea(f,c)?f:c});if(n.preserveMissing!==!0)return Go(e,o)?e:o;const i=e.map(c=>{const f=s.get(c.id);return!f||Ea(c,f)?c:f}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),u=[...i,...l];return Go(e,u)?e:u}function Ca(e){return e.replace(/\s+/gu," ").trim()}function pC(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Ca(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=Ca(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function pu(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Ea(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const Jf="worked";function hr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function mC(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 gC(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function vC(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 yC(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${mC(e.durationMs)}`,messageType:Jf}}function wC(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function bC(e,t){const n=yC(t),r=e.filter(i=>i.messageType!==Jf),s=wC(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Bt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function _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 kC(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 TC(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Ft(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function _o(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&&kC(o.threads,a)?o:{projectName:s.projectName,threads:a}});return TC(e,r)?e:r}function IC(e,t,n){const r=new Set(gr(t).map(a=>a.id)),s=gr(e).filter(a=>n[a.id]===!0&&!r.has(a.id));if(s.length===0)return t;const o=new Map(t.map(a=>[a.projectName,a])),i=t.map(a=>({projectName:a.projectName,threads:[...a.threads]}));for(const a of s){if(o.get(a.projectName)){const u=i.findIndex(c=>c.projectName===a.projectName);u>=0&&(i[u]={projectName:i[u].projectName,threads:[a,...i[u].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function SC(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function qi(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function EC(e){const t=e.split(`
1424
+ `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function CC(){const e=D([]),t=D([]),n=D(aC()),r=D({}),s=D({}),o=D({}),i=D({}),a=D({}),l=D({}),u=D({}),c=D([]),f=D(""),p=D("medium"),_=D(sC()),N=D(iC()),I=D(cC()),M=D(uC()),Y=D({}),j=D({}),q=D({}),B=D({}),oe=D({}),de=D({}),ve=D({}),Ie=D({}),re=D({}),ee=D({}),ye=D([]),te=D(!1),je=D(!1),Be=D(!1),Qe=D(!1),Re=D(!1),Te=D(""),$e=D(!1),It=D(!1);let nt=null,Xe=null,Ze=!1;const ht=new Set;let Rt=!1,Ge=!1;const et=new Map,W=new Set,me=pe(()=>gr(e.value)),ie=pe(()=>me.value.find(d=>d.id===n.value)??null),fe=pe(()=>N.value[n.value]??null),De=pe(()=>{const d=[],h=n.value;return h&&Array.isArray(Ie.value[h])&&d.push(...Ie.value[h]),Array.isArray(Ie.value[Os])&&d.push(...Ie.value[Os]),d.sort((y,C)=>y.receivedAtIso.localeCompare(C.receivedAtIso))}),g=pe(()=>{var X;const d=n.value;if(!d)return null;const h=oe.value[d],y=(o.value[d]??"").trim(),C=(((X=de.value[d])==null?void 0:X.message)??"").trim();return!h&&!y&&!C?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:y,errorText:C}}),v=pe(()=>{const d=n.value;if(!d)return[];const h=r.value[d]??[],y=s.value[d]??[],C=i.value[d]??[],X=[...h,...C,...y],Q=B.value[d];return Q?bC(X,Q):X});function A(d){n.value!==d&&(n.value=d,lC(d),Ge=!1)}function H(d){f.value=d.trim()}async function F(){f.value=un,c.value.includes(un)||(c.value=[...c.value,un]);try{await Zb(un)}catch{}}function P(d,h){re.value={...re.value,[d]:h}}function $(d){re.value[d]&&(re.value=Bt(re.value,d))}async function L(d){if(W.has(d))return;const h=re.value[d];if(!(!h||h.fallbackRetried)){W.add(d),P(d,{...h,fallbackRetried:!0});try{await F();try{const y=await Oc(d,1);it(d,y),kt(d,[]),rn(d),i.value[d]&&(i.value=Bt(i.value,d))}catch{}K(d,null),Te.value="",xe(d,null),U(d,{label:"Thinking",details:V(un,h.effort)}),Ve(d,!0),q.value[d]!==!0&&await Mi(d),await Ni(d,h.text,h.imageUrls,un,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),q.value={...q.value,[d]:!0},ht.add(d),Ze=!0,await rt()}catch(y){const C=y instanceof Error?y.message:"Unknown application error";K(d,C),Te.value=C,Ve(d,!1),U(d,null)}finally{W.delete(d)}}}function G(d){d&&!du.includes(d)||(p.value=d)}function V(d,h){const y=d.trim()||"default",C=h||"default";return[`Model: ${y}`,`Thinking: ${C}`]}async function be(){try{const[d,h]=await Promise.all([e_(),t_()]);c.value=d,f.value.length>0&&d.includes(f.value)||(h.model&&d.includes(h.model)?f.value=h.model:d.length>0?f.value=d[0]:f.value=""),h.reasoningEffort&&du.includes(h.reasoningEffort)&&(p.value=h.reasoningEffort)}catch{}}function ae(d){const h=ee.value;return Object.keys(h).length===0?d:d.map(y=>({projectName:y.projectName,threads:y.threads.map(C=>{const X=h[C.id];return X?{...C,title:X}:C})}))}function he(){const h=ae(t.value).map(y=>({projectName:y.projectName,threads:y.threads.map(C=>{const X=a.value[C.id]===!0,Q=n.value===C.id,_e=_.value[C.id],Pe=u.value[C.id]===!0,we=!Q&&!X&&(Pe||_e!==C.updatedAtIso);return{...C,inProgress:X,unread:we}})}));e.value=_o(e.value,h)}function Se(d,h,y){const C=new Date().toISOString(),X=h.trim(),Q=SC(X),_e={id:d,title:EC(y),projectName:Q,cwd:X,hasWorktree:X.includes("/.codex/worktrees/")||X.includes("/.git/worktrees/"),createdAtIso:C,updatedAtIso:C,preview:y,unread:!1,inProgress:!1},Pe=t.value.findIndex(ot=>ot.projectName===Q);if(Pe>=0){const St=t.value[Pe].threads.filter(cr=>cr.id!==d),Xr={projectName:Q,threads:[_e,...St]},Fn=[...t.value];Fn.splice(Pe,1,Xr),t.value=Fn}else t.value=[{projectName:Q,threads:[_e]},...t.value];const we=wo(I.value,t.value);Br(I.value,we)||(I.value=we,es(I.value)),he()}function Oe(d){const h=new Set(d.map(Q=>Q.id)),y=Ft(_.value,h);y!==_.value&&(_.value=y,fu(y));const C=Ft(N.value,h);C!==N.value&&(N.value=C,hu(C)),j.value=Ft(j.value,h),Y.value=Ft(Y.value,h),q.value=Ft(q.value,h),r.value=Ft(r.value,h),s.value=Ft(s.value,h),o.value=Ft(o.value,h),i.value=Ft(i.value,h),B.value=Ft(B.value,h),oe.value=Ft(oe.value,h),de.value=Ft(de.value,h),ve.value=Ft(ve.value,h),u.value=Ft(u.value,h),a.value=Ft(a.value,h);const X={};for(const[Q,_e]of Object.entries(Ie.value))(Q===Os||h.has(Q))&&(X[Q]=_e);Ie.value=X}function Ke(d){const h=gr(t.value).find(y=>y.id===d);h&&(_.value={..._.value,[d]:h.updatedAtIso},fu(_.value),u.value[d]&&(u.value=Bt(u.value,d)),he())}function xe(d,h){if(!d)return;const y=B.value[d];if(h){if(gC(y,h))return;B.value={...B.value,[d]:h}}else y&&(B.value=Bt(B.value,d))}function Ve(d,h){!d||a.value[d]===!0===h||(h?a.value={...a.value,[d]:!0}:a.value=Bt(a.value,d),he())}function _t(d){d&&d!==n.value&&u.value[d]!==!0&&(u.value={...u.value,[d]:!0},he())}function U(d,h){if(!d)return;const y=oe.value[d];if(!h){y&&(oe.value=Bt(oe.value,d));return}const C=z(h.label)||"Thinking",X=h.details.map(Pe=>z(Pe)).filter(Pe=>Pe.length>0&&Pe!==C),Q=Array.from(new Set([...(y==null?void 0:y.details)??[],...X])).slice(-3),_e={label:C,details:Q};vC(y,_e)||(oe.value={...oe.value,[d]:_e})}function K(d,h){if(!d)return;const y=de.value[d],C=h?Ca(h):"";if(!C){y&&(de.value=Bt(de.value,d));return}(y==null?void 0:y.message)!==C&&(de.value={...de.value,[d]:{message:C}})}function ne(d){const h=gr(t.value).find(y=>y.id===d);return(h==null?void 0:h.updatedAtIso)??""}function Je(d,h){if(!d)return;const y={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(y.scrollRatio=Kf(h.scrollRatio,0,1));const C=N.value[d];C&&C.scrollTop===y.scrollTop&&C.isAtBottom===y.isAtBottom&&C.scrollRatio===y.scrollRatio||(N.value={...N.value,[d]:y},hu(N.value))}function it(d,h){const y=r.value[d]??[];Go(y,h)||(r.value={...r.value,[d]:h})}function kt(d,h){const y=s.value[d]??[];Go(y,h)||(s.value={...s.value,[d]:h})}function Pt(d,h){const y=s.value[d]??[],C=pu(y,h);kt(d,C)}function ln(d,h){if(!d)return;const y=h.trim(),C=o.value[d]??"";if(y.length===0){if(!C)return;o.value=Bt(o.value,d);return}C!==y&&(o.value={...o.value,[d]:y})}function Sr(d,h){if(!d)return;const y=o.value[d]??"";ln(d,`${y}${h}`)}function rn(d){d&&d in o.value&&(o.value=Bt(o.value,d))}function Ne(d){return d!==null&&typeof d=="object"&&!Array.isArray(d)?d:null}function Me(d){return typeof d=="string"?d:""}function fn(d){return typeof d=="number"&&Number.isFinite(d)?d:null}function jt(d){const h=Ne(d.params);if(!h)return"";const y=Me(h.threadId);if(y)return y;const C=Me(h.thread_id);if(C)return C;const X=Me(h.conversationId);if(X)return X;const Q=Me(h.conversation_id);if(Q)return Q;const _e=Ne(h.thread),Pe=Me(_e==null?void 0:_e.id);if(Pe)return Pe;const we=Ne(h.turn),ot=Me(we==null?void 0:we.threadId);if(ot)return ot;const St=Me(we==null?void 0:we.thread_id);return St||""}function Er(d){if(d.method!=="turn/completed")return"";const h=Ne(d.params),y=Ne(h==null?void 0:h.turn);if(!y||y.status!=="failed")return"";const C=Ne(y.error);return Me(C==null?void 0:C.message)}function _n(d){var y;if(d.method!=="error")return"";const h=Ne(d.params);return Me(h==null?void 0:h.message)||Me((y=Ne(h==null?void 0:h.error))==null?void 0:y.message)}function kn(d){const h=Ne(d);if(!h)return null;const y=h.id,C=Me(h.method),X=h.params;if(typeof y!="number"||!Number.isInteger(y)||!C)return null;const Q=Ne(X),_e=Me(Q==null?void 0:Q.threadId)||Os,Pe=Me(Q==null?void 0:Q.turnId),we=Me(Q==null?void 0:Q.itemId),ot=Me(h.receivedAtIso)||new Date().toISOString();return{id:y,method:C,threadId:_e,turnId:Pe,itemId:we,receivedAtIso:ot,params:X??null}}function b(d){const h=d.threadId||Os,y=Ie.value[h]??[],C=y.findIndex(Q=>Q.id===d.id),X=[...y];C>=0?X.splice(C,1,d):X.push(d),Ie.value={...Ie.value,[h]:X.sort((Q,_e)=>Q.receivedAtIso.localeCompare(_e.receivedAtIso))}}function S(d){const h={};for(const[y,C]of Object.entries(Ie.value)){const X=C.filter(Q=>Q.id!==d);X.length>0&&(h[y]=X)}Ie.value=h}function E(d){if(d.method==="server/request"){const h=kn(d.params);return h&&b(h),!0}if(d.method==="server/request/resolved"){const h=Ne(d.params),y=h==null?void 0:h.id;return typeof y=="number"&&Number.isInteger(y)&&S(y),!0}return!1}function z(d){return d.replace(/\s+/gu," ").trim()}function ge(d){const h=jt(d);if(!h)return null;if(d.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(d.method==="item/started"){const y=Ne(d.params),C=Ne(y==null?void 0:y.item),X=Me(C==null?void 0:C.type).toLowerCase();if(X==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(X==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(X==="commandexecution"){const Q=Me(C==null?void 0:C.command);return{threadId:h,activity:{label:"Running command",details:Q?[Q]:[]}}}}return d.method==="item/commandExecution/outputDelta"?{threadId:h,activity:{label:"Running command",details:[]}}:d.method==="item/reasoning/summaryTextDelta"||d.method==="item/reasoning/summaryPartAdded"?{threadId:h,activity:{label:"Thinking",details:[]}}:d.method==="item/agentMessage/delta"?{threadId:h,activity:{label:"Writing response",details:[]}}:null}function le(d){if(d.method!=="turn/started")return null;const h=Ne(d.params);if(!h)return null;const y=jt(d);if(!y)return null;const C=Ne(h.turn),X=Me(C==null?void 0:C.id)||Me(h.turnId)||`${y}:unknown`;if(!X)return null;const Q=hr(Me(C==null?void 0:C.startedAt))??hr(Me(h.startedAt))??hr(d.atIso)??Date.now();return{threadId:y,turnId:X,startedAtMs:Q}}function Ae(d){if(d.method!=="turn/completed")return null;const h=Ne(d.params);if(!h)return null;const y=jt(d);if(!y)return null;const C=Ne(h.turn),X=Me(C==null?void 0:C.id)||Me(h.turnId)||`${y}:unknown`;if(!X)return null;const Q=hr(Me(C==null?void 0:C.completedAt))??hr(Me(h.completedAt))??hr(d.atIso)??Date.now(),_e=hr(Me(C==null?void 0:C.startedAt))??hr(Me(h.startedAt))??void 0;return{threadId:y,turnId:X,completedAtMs:Q,startedAtMs:_e}}function ke(d){return`${d}:live-reasoning`}function We(d){const h=Ne(d.params);if(!h)return"";if(d.method==="item/started"){const y=Ne(h.item);return!y||y.type!=="reasoning"?"":Me(y.id)}return""}function at(d){const h=Ne(d.params);if(!h)return null;if(d.method==="item/reasoning/summaryTextDelta"){const y=Me(h.itemId),C=Me(h.delta);return!y||!C?null:{messageId:ke(y),delta:C}}return null}function lt(d){const h=Ne(d.params);if(!h)return"";if(d.method==="item/reasoning/summaryPartAdded"){const y=Me(h.itemId);return y?ke(y):""}return""}function xt(d){const h=Ne(d.params);if(!h)return"";if(d.method==="item/completed"){const y=Ne(h.item);return!y||y.type!=="reasoning"?"":ke(Me(y.id))}return""}function Ot(d){const h=Ne(d.params);if(!h)return"";if(d.method==="item/started"){const y=Ne(h.item);return!y||y.type!=="agentMessage"?"":Me(y.id)}return""}function sn(d){const h=Ne(d.params);if(!h)return null;if(d.method==="item/agentMessage/delta"){const y=Me(h.itemId),C=Me(h.delta);return!y||!C?null:{messageId:y,delta:C}}return null}function Dn(d){const h=Ne(d.params);if(!h)return null;if(d.method==="item/completed"){const y=Ne(h.item);if(!y||y.type!=="agentMessage")return null;const C=Me(y.id),X=Me(y.text);return!C||!X?null:{id:C,role:"assistant",text:X,messageType:"agentMessage.live"}}return null}function ks(d){if(d.method!=="item/started")return null;const h=Ne(d.params),y=Ne(h==null?void 0:h.item);if(!y||y.type!=="commandExecution")return null;const C=Me(y.id),X=Me(y.command);if(!C)return null;const Q=typeof y.cwd=="string"?y.cwd:null;return{id:C,role:"system",text:X,messageType:"commandExecution",commandExecution:{command:X,cwd:Q,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function Cr(d){if(d.method!=="item/commandExecution/outputDelta")return null;const h=Ne(d.params);if(!h)return null;const y=Me(h.itemId),C=Me(h.delta);return!y||!C?null:{itemId:y,delta:C}}function Gr(d){if(d.method!=="item/completed")return null;const h=Ne(d.params),y=Ne(h==null?void 0:h.item);if(!y||y.type!=="commandExecution")return null;const C=Me(y.id),X=Me(y.command);if(!C)return null;const Q=typeof y.cwd=="string"?y.cwd:null,_e=Me(y.status),Pe=_e==="failed"?"failed":_e==="declined"?"declined":_e==="interrupted"?"interrupted":"completed",we=typeof y.aggregatedOutput=="string"?y.aggregatedOutput:"",ot=typeof y.exitCode=="number"?y.exitCode:null;return{id:C,role:"system",text:X,messageType:"commandExecution",commandExecution:{command:X,cwd:Q,status:Pe,aggregatedOutput:we,exitCode:ot}}}function Ln(d,h){const y=i.value[d]??[],C=pu(y,h);C!==y&&(i.value={...i.value,[d]:C})}function Kr(d,h){const y=i.value[d];if(!y||y.length===0)return;const C=new Set(h.map(Q=>Q.id)),X=y.filter(Q=>!C.has(Q.id));X.length!==y.length&&(X.length===0?i.value=Bt(i.value,d):i.value={...i.value,[d]:X})}function Jr(d){if(d.method==="item/agentMessage/delta")return!0;const h=Ne(d.params);if(!h)return!1;if(d.method==="item/completed"){const y=Ne(h.item);return(y==null?void 0:y.type)==="agentMessage"}return!1}function jn(d){var pl,ml,gl,vl;if(E(d))return;if(d.method==="thread/name/updated"){const qe=Ne(d.params),Tn=Me(qe==null?void 0:qe.threadId),Pr=Me(qe==null?void 0:qe.threadName);Tn&&Pr&&(ee.value={...ee.value,[Tn]:Pr},he(),$i(Tn,Pr))}const h=ge(d);h&&U(h.threadId,h.activity);const y=le(d);y&&(et.set(y.turnId,y),ve.value={...ve.value,[y.threadId]:y.turnId},xe(y.threadId,null),K(y.threadId,null),Ve(y.threadId,!0),u.value[y.threadId]&&(u.value=Bt(u.value,y.threadId)));const C=Ae(d),X=Er(d),_e=!!((C==null?void 0:C.threadId)??jt(d))&&!!X&&f.value!==un&&bo(new Error(X));if(C){const qe=et.get(C.turnId);qe&&et.delete(C.turnId);const Tn=fn((pl=Ne(d.params))==null?void 0:pl.durationMs)??fn((gl=Ne((ml=Ne(d.params))==null?void 0:ml.turn))==null?void 0:gl.durationMs)??(typeof C.startedAtMs=="number"?C.completedAtMs-C.startedAtMs:null)??(qe?C.completedAtMs-qe.startedAtMs:null),Pr=typeof Tn=="number"?Math.max(0,Tn):0;xe(C.threadId,{turnId:C.turnId,durationMs:Pr}),ve.value[C.threadId]&&(ve.value=Bt(ve.value,C.threadId)),Ve(C.threadId,!1),U(C.threadId,null),_t(C.threadId),_e||($(C.threadId),on(C.threadId))}if(X){const qe=(C==null?void 0:C.threadId)||jt(d);qe&&K(qe,X),Te.value=X,qe&&_e&&L(qe)}else C&&K(C.threadId,null);const Pe=_n(d);if(Pe){const qe=jt(d);qe&&K(qe,Pe),Te.value=Pe,f.value!==un&&bo(new Error(Pe))&&(qe?L(qe):F())}const we=jt(d);if(!we||we!==n.value)return;Ot(d);const ot=sn(d);if(ot){const qe=(s.value[we]??[]).find(Pr=>Pr.id===ot.messageId),Tn=`${(qe==null?void 0:qe.text)??""}${ot.delta}`;Pt(we,{id:ot.messageId,role:"assistant",text:Tn,messageType:"agentMessage.live"})}const St=Dn(d);St&&Pt(we,St),We(d);const Xr=at(d);if(Xr&&Sr(we,Xr.delta),lt(d)){const qe=o.value[we]??"";qe.trim().length>0&&!qe.endsWith(`
1425
+
1426
+ `)&&ln(we,`${qe}
1427
+
1428
+ `)}xt(d);const cr=ks(d);cr&&(Ln(we,cr),U(we,{label:"Running command",details:[((vl=cr.commandExecution)==null?void 0:vl.command)??""]}));const pi=Cr(d);if(pi){const qe=(i.value[we]??[]).find(Tn=>Tn.id===pi.itemId);qe!=null&&qe.commandExecution&&Ln(we,{...qe,commandExecution:{...qe.commandExecution,aggregatedOutput:`${qe.commandExecution.aggregatedOutput}${pi.delta}`}})}const hl=Gr(d);if(hl&&Ln(we,hl),Jr(d)&&(Ge&&n.value&&Je(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),rn(we)),d.method==="turn/completed"){Ge=!1,rn(we),i.value[we]&&(i.value=Bt(i.value,we));const qe=jt(d);qe&&(Ve(qe,!1),U(qe,null),_t(qe),_e||($(qe),on(qe)))}}function Ts(d){const h=jt(d);h&&ht.add(h);const y=d.method;(y.startsWith("thread/")||y.startsWith("turn/")||y.startsWith("item/"))&&(Ze=!0),!(Xe!==null||typeof window>"u")&&(Xe=window.setTimeout(()=>{Xe=null,rt()},Vi))}async function Is(d){if(!Rt){Rt=!0;try{const h=await pa(),y=[];for(const C of h.order){const X=qi(C);y.includes(X)||y.push(X)}if(y.length>0){const C=wo(y,d);Br(I.value,C)||(I.value=C,es(I.value))}if(Object.keys(h.labels).length>0){const C={...M.value};let X=!1;for(const[Q,_e]of Object.entries(h.labels)){const Pe=qi(Q);C[Pe]!==_e&&(C[Pe]=_e,X=!0)}X&&(M.value=C,Wi(C))}}catch{}}}async function Ss(){if(!(Object.keys(ee.value).length>0))try{const d=await c_();Object.keys(d.titles).length>0&&(ee.value=d.titles)}catch{}}async function Ar(d,h,y){if(ee.value[d])return;const C=h.trim();if(!C)return;const X=C.length>300?C.slice(0,300):C;try{const Q=await u_(X,y);if(!Q||ee.value[d])return;ee.value={...ee.value,[d]:Q},he(),$i(d,Q)}catch{}}async function Rr(){var d;It.value||(te.value=!0);try{const[h]=await Promise.all([Vb(),Ss()]);await Is(h);const y=wo(I.value,h);Br(I.value,y)||(I.value=y,es(I.value));const C=zi(h,I.value),X=IC(t.value,C,a.value);t.value=_o(t.value,X),a.value=Ft(a.value,new Set(gr(t.value).map(Pe=>Pe.id))),he(),It.value=!0;const Q=gr(e.value);Oe(Q),Q.some(Pe=>Pe.id===n.value)||A(((d=Q[0])==null?void 0:d.id)??"")}finally{te.value=!1}}async function k(d,h={}){if(!d)return;const y=j.value[d]===!0,C=h.silent!==!0&&!y;C&&(je.value=!0);try{q.value[d]!==!0&&(await Mi(d),q.value={...q.value,[d]:!0});const{messages:X,inProgress:Q}=await Wb(d),_e=r.value[d]??[],Pe=hC(_e,X,{preserveMissing:h.silent===!0});it(d,Pe);const we=s.value[d]??[],ot=pC(we,X);kt(d,ot),Kr(d,X),j.value={...j.value,[d]:!0};const St=ne(d);St&&(Y.value={...Y.value,[d]:St}),Ve(d,Q),Ke(d)}finally{C&&(je.value=!1)}}async function x(){try{const d=t.value.flatMap(h=>h.threads.map(y=>y.cwd)).filter(Boolean);ye.value=await d_(d.length>0?[...new Set(d)]:void 0)}catch{}}async function O(){Te.value="";try{await Rr(),await Promise.all([be(),x()]),await k(n.value)}catch(d){Te.value=d instanceof Error?d.message:"Unknown application error"}}async function J(d){A(d);try{await k(d)}catch(h){Te.value=h instanceof Error?h.message:"Unknown application error"}}async function Ue(d){try{await Kb(d),await Rr(),n.value===d&&await k(n.value)}catch(h){Te.value=h instanceof Error?h.message:"Unknown application error"}}async function Mt(d,h){const y=h.trim();if(!(!d||!y))try{await Jb(d,y),ee.value={...ee.value,[d]:y},he(),$i(d,y)}catch(C){Te.value=C instanceof Error?C.message:"Unknown application error"}}async function Zt(d,h=[],y=[],C="steer",X=[]){const Q=n.value,_e=d.trim();if(!Q||!_e&&h.length===0&&X.length===0)return;const Pe=a.value[Q]===!0;if(Pe&&C==="queue"){const we=l.value[Q]??[],ot=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[Q]:[...we,{id:ot,text:_e,imageUrls:h,skills:y,fileAttachments:X}]};return}if(Pe){Ge=!0,Un(Q,_e,h,y,X).catch(we=>{const ot=we instanceof Error?we.message:"Unknown application error";K(Q,ot),Te.value=ot});return}Te.value="",Ge=!0,xe(Q,null),U(Q,{label:"Thinking",details:V(f.value,p.value)}),K(Q,null),Ve(Q,!0);try{await Un(Q,_e,h,y,X)}catch(we){Ge=!1,Ve(Q,!1),U(Q,null);const ot=we instanceof Error?we.message:"Unknown application error";throw K(Q,ot),Te.value=ot,we}}async function Bn(d,h,y=[],C=[],X=[]){const Q=d.trim(),_e=h.trim(),Pe=f.value.trim();if(!Q&&y.length===0&&X.length===0)return"";Be.value=!0,Te.value="";let we="";try{try{we=await Mc(_e||void 0,Pe||void 0)}catch(Fn){if(Pe&&Pe!==un&&bo(Fn))await F(),we=await Mc(_e||void 0,un);else throw Fn}if(!we)return"";Se(we,_e,Q||"[Image]"),q.value={...q.value,[we]:!0},A(we),Ge=!0,xe(we,null),U(we,{label:"Thinking",details:V(f.value,p.value)}),K(we,null),Ve(we,!0);const ot=we,St=_e||null,Xr=Q;return Un(we,Q,y,C,X).catch(Fn=>{Ge=!1,Ve(we,!1),U(we,null);const cr=Fn instanceof Error?Fn.message:"Unknown application error";K(we,cr),Te.value=cr}).finally(()=>{Be.value=!1}),Ar(ot,Xr,St),we}catch(ot){Ge=!1,we&&(Ve(we,!1),U(we,null));const St=ot instanceof Error?ot.message:"Unknown application error";throw we&&K(we,St),Te.value=St,Be.value=!1,ot}}async function Un(d,h,y=[],C=[],X=[]){const Q=f.value.trim(),_e=p.value,Pe=h.trim(),we=C.map(St=>({name:St.name,path:St.path})),ot=X.map(St=>({...St}));P(d,{text:Pe,imageUrls:[...y],skills:we,fileAttachments:ot,effort:_e,fallbackRetried:!1});try{q.value[d]!==!0&&await Mi(d);try{await Ni(d,h,y,Q||void 0,_e||void 0,C.length>0?C:void 0,X)}catch(St){if(Q&&Q!==un&&bo(St))await F(),P(d,{text:Pe,imageUrls:[...y],skills:we,fileAttachments:ot,effort:_e,fallbackRetried:!0}),await Ni(d,h,y,un,_e||void 0,C.length>0?C:void 0,X);else throw St}q.value={...q.value,[d]:!0},ht.add(d),Ze=!0,await rt()}catch(St){throw St}}async function on(d){const h=l.value[d];if(!h||h.length===0)return;const[y,...C]=h;l.value=C.length>0?{...l.value,[d]:C}:Bt(l.value,d),Be.value=!0,Te.value="",Ge=!0,xe(d,null),U(d,{label:"Thinking",details:V(f.value,p.value)}),K(d,null),Ve(d,!0);try{await Un(d,y.text,y.imageUrls,y.skills,y.fileAttachments)}catch{Ve(d,!1),U(d,null)}finally{Be.value=!1}}async function lr(){const d=n.value;if(!d||a.value[d]!==!0)return;const h=ve.value[d];Qe.value=!0,Te.value="";try{await Xb(d,h),Ve(d,!1),U(d,null),K(d,null),ve.value[d]&&(ve.value=Bt(ve.value,d)),ht.add(d),Ze=!0,await rt()}catch(y){const C=y instanceof Error?y.message:"Failed to interrupt active turn";K(d,C),Te.value=C}finally{Qe.value=!1}}async function Yr(d){const h=n.value;if(!h||Re.value)return;const C=(r.value[h]??[]).reduce((Q,_e)=>typeof _e.turnIndex=="number"&&_e.turnIndex>Q?_e.turnIndex:Q,-1);if(C<0||d>C)return;const X=C-d+1;if(!(X<1)){Re.value=!0,Te.value="";try{const Q=await Oc(h,X);it(h,Q),kt(h,[]),rn(h),i.value[h]&&(i.value=Bt(i.value,h)),xe(h,null),U(h,null),K(h,null),Ze=!0,await rt()}catch(Q){Te.value=Q instanceof Error?Q.message:"Failed to rollback thread"}finally{Re.value=!1}}}function Qr(d,h){d.length===0||(M.value[d]??"")===h||(M.value={...M.value,[d]:h},Wi(M.value))}function hi(d){var X;if(d.length===0)return;const h=I.value.filter(Q=>Q!==d);if(Br(I.value,h)||(I.value=h,es(I.value)),t.value=t.value.filter(Q=>Q.projectName!==d),M.value[d]!==void 0){const Q={...M.value};delete Q[d],M.value=Q,Wi(Q)}he();const y=gr(e.value);Oe(y),y.some(Q=>Q.id===n.value)||A(((X=y[0])==null?void 0:X.id)??""),Ee()}function R(d,h){if(d.length===0||t.value.length===0)return;const y=t.value.map(we=>we.projectName),C=y.indexOf(d);if(C===-1)return;const X=Math.max(0,Math.min(h,y.length-1)),Q=dC(y,C,X);if(Q===y)return;const _e=wo(Q,t.value);I.value=_e,es(I.value);const Pe=zi(t.value,I.value);t.value=_o(t.value,Pe),he(),Ee()}function Z(d){const h=d.trim();if(!h)return;const y=[h,...I.value.filter(X=>X!==h)];if(Br(I.value,y))return;I.value=y,es(I.value);const C=zi(t.value,I.value);t.value=_o(t.value,C),he(),Ee()}async function Ee(){var d,h;try{const y=await pa(),C=new Map;for(const _e of y.order){const Pe=qi(_e);C.has(Pe)||C.set(Pe,_e)}for(const _e of t.value){const Pe=((h=(d=_e.threads[0])==null?void 0:d.cwd)==null?void 0:h.trim())??"";Pe&&C.set(_e.projectName,Pe)}const X=[];for(const _e of I.value){const Pe=C.get(_e);Pe&&!X.includes(Pe)&&X.push(Pe)}for(const _e of y.order)X.includes(_e)||X.push(_e);const Q=y.active.filter(_e=>X.includes(_e));Q.length===0&&X.length>0&&Q.push(X[0]),await s_({order:X,labels:y.labels,active:Q})}catch{}}async function rt(){if($e.value){typeof window<"u"&&Xe===null&&(Xe=window.setTimeout(()=>{Xe=null,rt()},Vi));return}$e.value=!0;const d=Ze,h=new Set(ht);Ze=!1,ht.clear();try{d&&await Rr();const y=n.value;if(!y)return;const C=h.has(y),X=a.value[y]===!0,Q=ne(y),_e=Y.value[y]??"",Pe=Q.length>0&&Q!==_e;(C||X||Pe||d)&&await k(y,{silent:!0})}catch{}finally{$e.value=!1,(Ze||ht.size>0)&&typeof window<"u"&&Xe===null&&(Xe=window.setTimeout(()=>{Xe=null,rt()},Vi))}}function vt(){typeof window>"u"||nt||(Ye(),nt=zb(d=>{jn(d),Ts(d)}))}async function Ye(){try{const d=await Gb();for(const h of d){const y=kn(h);y&&b(y)}}catch{}}async function Dt(d){try{await qb(d.id,{result:d.result,error:d.error}),S(d.id)}catch(h){Te.value=h instanceof Error?h.message:"Failed to reply to server request"}}function fo(){nt&&(nt(),nt=null),Ze=!1,ht.clear(),et.clear(),Xe!==null&&typeof window<"u"&&(window.clearTimeout(Xe),Xe=null),Ge=!1,r.value={},s.value={},o.value={},i.value={},oe.value={},B.value={},de.value={},ve.value={},l.value={}}const Es=pe(()=>{const d=n.value;return d?l.value[d]??[]:[]});function fl(d){const h=n.value;if(!h)return;const y=l.value[h];if(!y)return;const C=y.filter(X=>X.id!==d);l.value=C.length>0?{...l.value,[h]:C}:Bt(l.value,h)}function Yf(d){const h=n.value;if(!h)return;const y=l.value[h];if(!y)return;const C=y.find(X=>X.id===d);C&&(fl(d),Zt(C.text,C.imageUrls,C.skills,"steer",C.fileAttachments))}return{projectGroups:e,projectDisplayNameById:M,selectedThread:ie,selectedThreadScrollState:fe,selectedThreadServerRequests:De,selectedLiveOverlay:g,selectedThreadId:n,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:p,installedSkills:ye,messages:v,isLoadingThreads:te,isLoadingMessages:je,isSendingMessage:Be,isInterruptingTurn:Qe,error:Te,refreshAll:O,refreshSkills:x,selectThread:J,setThreadScrollState:Je,archiveThreadById:Ue,renameThreadById:Mt,sendMessageToSelectedThread:Zt,sendMessageToNewThread:Bn,interruptSelectedThreadTurn:lr,rollbackSelectedThread:Yr,isRollingBack:Re,selectedThreadQueuedMessages:Es,removeQueuedMessage:fl,steerQueuedMessage:Yf,setSelectedModelId:H,setSelectedReasoningEffort:G,respondToPendingServerRequest:Dt,renameProject:Qr,removeProject:hi,reorderProject:R,pinProjectToTop:Z,startPolling:vt,stopPolling:fo}}const AC={class:"sidebar-root"},RC={class:"sidebar-scrollable"},PC=["aria-pressed"],xC={key:1,class:"sidebar-search-bar"},OC={key:0,class:"sidebar-settings-area"},MC={key:0,class:"sidebar-settings-panel"},NC={class:"sidebar-settings-value"},$C={class:"sidebar-settings-value"},DC={class:"content-root"},LC={class:"content-body"},jC={key:1,class:"content-grid"},BC={class:"new-thread-empty"},UC={class:"worktree-init-status-title"},FC={class:"worktree-init-status-message"},HC={key:2,class:"content-grid"},VC={class:"content-thread"},WC={class:"composer-with-queue"},zC={class:"build-badge","aria-label":"Worktree name and version"},mu="codex-web-local.sidebar-collapsed.v1",gu="codex-web-local.send-with-enter.v1",vu="codex-web-local.in-progress-send-mode.v1",yu="codex-web-local.dark-mode.v1",qC=Lt({__name:"App",setup(e){const t="850f",n="0.1.37",{projectGroups:r,projectDisplayNameById:s,selectedThread:o,selectedThreadScrollState:i,selectedThreadServerRequests:a,selectedLiveOverlay:l,selectedThreadId:u,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:p,installedSkills:_,messages:N,isLoadingThreads:I,isLoadingMessages:M,isInterruptingTurn:Y,refreshAll:j,refreshSkills:q,selectThread:B,setThreadScrollState:oe,archiveThreadById:de,renameThreadById:ve,sendMessageToSelectedThread:Ie,sendMessageToNewThread:re,interruptSelectedThreadTurn:ee,rollbackSelectedThread:ye,isRollingBack:te,selectedThreadQueuedMessages:je,removeQueuedMessage:Be,steerQueuedMessage:Qe,setSelectedModelId:Re,setSelectedReasoningEffort:Te,respondToPendingServerRequest:$e,renameProject:It,removeProject:nt,reorderProject:Xe,pinProjectToTop:Ze,startPolling:ht,stopPolling:Rt}=CC(),Ge=Mg(),et=Og(),{isMobile:W}=Gd(),me=D(!1),ie=D(!1),fe=D(""),De=D("local"),g=D({order:[],labels:{}}),v=D({phase:"idle",title:"",message:""}),A=D(Un()),H=D(""),F=D(!1),P=D(null),$=D(null);let L=null;const G=D("New Project (1)"),V=D(""),be=D(!1),ae=D(x(gu,!0)),he=D(J()),Se=D(O()),Oe=pe(()=>{const R=Ge.params.threadId;return typeof R=="string"?R:""}),Ke=pe(()=>{const R=new Set;for(const Z of r.value)for(const Ee of Z.threads)R.add(Ee.id);return R}),xe=pe(()=>Ge.name==="home"),Ve=pe(()=>Ge.name==="skills"),_t=pe(()=>{var R;return Ve.value?"Skills":xe.value?"New thread":((R=o.value)==null?void 0:R.title)??"Choose a thread"}),U=pe(()=>N.value.filter(R=>{const Z=lr(R.messageType,R.role);return Z==="worked"?!0:!(Z==="turnActivity.live"||Z==="turnError.live"||Z==="agentReasoning.live")})),K=pe(()=>l.value),ne=pe(()=>xe.value?"__new-thread__":u.value),Je=pe(()=>{var R,Z;return xe.value?fe.value.trim():((Z=(R=o.value)==null?void 0:R.cwd)==null?void 0:Z.trim())??""}),it=pe(()=>{var R;return!xe.value&&((R=o.value)==null?void 0:R.inProgress)===!0}),kt=pe(()=>{var rt,vt;const R=[],Z=new Set;for(const Ye of g.value.order){const Dt=Ye.trim();!Dt||Z.has(Dt)||(Z.add(Dt),R.push({value:Dt,label:g.value.labels[Dt]||Ln(Dt)}))}for(const Ye of r.value){const Dt=((vt=(rt=Ye.threads[0])==null?void 0:rt.cwd)==null?void 0:vt.trim())??"";!Dt||Z.has(Dt)||(Z.add(Dt),R.push({value:Dt,label:s.value[Ye.projectName]??Ye.projectName}))}const Ee=fe.value.trim();return Ee&&!Z.has(Ee)&&R.unshift({value:Ee,label:Ln(Ee)}),R}),Pt=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;ir(()=>{window.addEventListener("keydown",ke),Bn(),Pt==null||Pt.addEventListener("change",Bn),Yr(),ks(),Cr(),sn()}),ri(()=>{window.removeEventListener("keydown",ke),Pt==null||Pt.removeEventListener("change",Bn),L&&(clearTimeout(L),L=null),Rt()}),mt(H,R=>{const Z=R.trim();if(L&&(clearTimeout(L),L=null),!Z){$.value=null;return}L=setTimeout(()=>{l_(Z,1e3).then(Ee=>{H.value.trim()===Z&&($.value=Ee.threadIds)}).catch(()=>{H.value.trim()===Z&&($.value=null)})},220)});function ln(){q()}function Sr(){F.value=!F.value,F.value?tn(()=>{var R;return(R=P.value)==null?void 0:R.focus()}):H.value=""}function rn(){var R;H.value="",(R=P.value)==null||R.focus()}function Ne(R){R.key==="Escape"&&(F.value=!1,H.value="")}function Me(R){R&&(Ge.name==="thread"&&Oe.value===R||(et.push({name:"thread",params:{threadId:R}}),W.value&&Ae(!0)))}async function fn(R){R&&(u.value!==R&&(await B(R),await et.push({name:"thread",params:{threadId:R}})),await tn(),Ss())}function jt(R){de(R)}function Er(R){var rt,vt;const Z=r.value.find(Ye=>Ye.projectName===R),Ee=((vt=(rt=Z==null?void 0:Z.threads[0])==null?void 0:rt.cwd)==null?void 0:vt.trim())??"";Ee&&(fe.value=Ee),W.value&&Ae(!0),!xe.value&&et.push({name:"home"})}function _n(R){var rt,vt;const Z=r.value.find(Ye=>Ye.projectName===R),Ee=((vt=(rt=Z==null?void 0:Z.threads[0])==null?void 0:rt.cwd)==null?void 0:vt.trim())??"";!Ee||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(Ee)}`,"_blank","noopener,noreferrer")}function kn(){var Z,Ee;const R=((Ee=(Z=o.value)==null?void 0:Z.cwd)==null?void 0:Ee.trim())??"";R&&(fe.value=R),W.value&&Ae(!0),!xe.value&&et.push({name:"home"})}function b(R){It(R.projectName,R.displayName)}function S(R){ve(R.threadId,R.title)}function E(R){nt(R)}function z(R){Xe(R.projectName,R.toIndex)}function ge(R){oe(R.threadId,R.state)}function le(R){$e(R)}function Ae(R){A.value!==R&&(A.value=R,on(R))}function ke(R){R.defaultPrevented||!R.ctrlKey&&!R.metaKey||R.shiftKey||R.altKey||R.key.toLowerCase()==="b"&&(R.preventDefault(),Ae(!A.value))}function We(R){const Z=R.text;if(xe.value){hi(Z,R.imageUrls,R.skills,R.fileAttachments);return}Ie(Z,R.imageUrls,R.skills,R.mode,R.fileAttachments)}function at(R){fe.value=R.trim()}async function lt(R){const Z=R.trim();if(!Z)return;const Ee=Ot(Z),rt=await xt(),vt=Ee?Z:Kr(rt,Z);if(vt)try{const Ye=await o_(vt,{createIfMissing:!Ee,label:Ee?"":Z});Ye&&(fe.value=Ye,Ze(Ln(Ye)),Cr(),sn())}catch{}}async function xt(){const R=Dn();if(R)return R;try{const Z=await Nc();if(Z)return V.value=Z,Z}catch{}return""}function Ot(R){return R?R.startsWith("~/")||R.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(R):!1}async function sn(){const R=Dn();if(!R){G.value="New Project (1)";return}try{const Z=await i_(R);G.value=Z.name||"New Project (1)"}catch{G.value="New Project (1)"}}function Dn(){var Ee,rt;const R=fe.value.trim();if(R)return Gr(R);const Z=((rt=(Ee=kt.value[0])==null?void 0:Ee.value)==null?void 0:rt.trim())??"";return Z?Gr(Z):V.value.trim()}async function ks(){try{V.value=await Nc()}catch{V.value=""}}async function Cr(){try{const R=await pa();g.value={order:[...R.order],labels:{...R.labels}}}catch{g.value={order:[],labels:{}}}}function Gr(R){const Z=R.trim().replace(/\/+$/,"");if(!Z)return"";const Ee=Z.lastIndexOf("/");return Ee<=0?"":Z.slice(0,Ee)}function Ln(R){const Z=R.trim().replace(/\/+$/,"");if(!Z)return"";const Ee=Z.lastIndexOf("/");return Ee<0?Z:Z.slice(Ee+1)}function Kr(R,Z){const Ee=R.trim().replace(/\/+$/,""),rt=Z.trim().replace(/^\/+/,"");return!Ee||!rt?"":`${Ee}/${rt}`}function Jr(R){Re(R)}function jn(R){Te(R)}function Ts(){ee()}function Is(R){ye(R.turnIndex)}function Ss(){if(xe.value||Ve.value||typeof document>"u"||!o.value||U.value.length===0)return;const R=Ar(),Z=Rr(),Ee=new Blob([R],{type:"text/markdown;charset=utf-8"}),rt=URL.createObjectURL(Ee),vt=document.createElement("a");vt.href=rt,vt.download=Z,document.body.appendChild(vt),vt.click(),document.body.removeChild(vt),window.setTimeout(()=>URL.revokeObjectURL(rt),0)}function Ar(){var Ee,rt,vt;const R=[],Z=((rt=(Ee=o.value)==null?void 0:Ee.title)==null?void 0:rt.trim())||"Untitled thread";R.push(`# ${k(Z)}`),R.push(""),R.push(`- Exported: ${new Date().toISOString()}`),R.push(`- Thread ID: ${((vt=o.value)==null?void 0:vt.id)??""}`),R.push(""),R.push("---"),R.push("");for(const Ye of U.value){const Dt=Ye.role?Ye.role.toUpperCase():"MESSAGE";R.push(`## ${Dt}`),R.push("");const fo=Ye.text.trim();if(fo&&(R.push(fo),R.push("")),Ye.commandExecution&&(R.push("```text"),R.push(`command: ${Ye.commandExecution.command}`),R.push(`status: ${Ye.commandExecution.status}`),Ye.commandExecution.cwd&&R.push(`cwd: ${Ye.commandExecution.cwd}`),Ye.commandExecution.exitCode!==null&&R.push(`exitCode: ${Ye.commandExecution.exitCode}`),R.push(Ye.commandExecution.aggregatedOutput||"(no output)"),R.push("```"),R.push("")),Ye.fileAttachments&&Ye.fileAttachments.length>0){R.push("Attachments:");for(const Es of Ye.fileAttachments)R.push(`- ${Es.path}`);R.push("")}if(Ye.images&&Ye.images.length>0){R.push("Images:");for(const Es of Ye.images)R.push(`- ${Es}`);R.push("")}}return`${R.join(`
1429
+ `).trimEnd()}
1430
+ `}function Rr(){var vt,Ye;const Ee=(((Ye=(vt=o.value)==null?void 0:vt.title)==null?void 0:Ye.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",rt=new Date().toISOString().replace(/[:.]/g,"-");return`${Ee}-${rt}.md`}function k(R){return R.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function x(R,Z){if(typeof window>"u")return Z;const Ee=window.localStorage.getItem(R);return Ee===null?Z:Ee==="1"}function O(){if(typeof window>"u")return"system";const R=window.localStorage.getItem(yu);return R==="light"||R==="dark"?R:"system"}function J(){return typeof window>"u"?"queue":window.localStorage.getItem(vu)==="steer"?"steer":"queue"}function Ue(){ae.value=!ae.value,window.localStorage.setItem(gu,ae.value?"1":"0")}function Mt(){he.value=he.value==="steer"?"queue":"steer",window.localStorage.setItem(vu,he.value)}function Zt(){const R=["system","light","dark"],Z=R.indexOf(Se.value);Se.value=R[(Z+1)%R.length],window.localStorage.setItem(yu,Se.value),Bn()}function Bn(){const R=document.documentElement;if(Se.value==="dark")R.classList.add("dark");else if(Se.value==="light")R.classList.remove("dark");else{const Z=window.matchMedia("(prefers-color-scheme: dark)").matches;R.classList.toggle("dark",Z)}}function Un(){return typeof window>"u"?!1:window.localStorage.getItem(mu)==="1"}function on(R){typeof window>"u"||window.localStorage.setItem(mu,R?"1":"0")}function lr(R,Z){const Ee=(R??"").trim();return Ee.length>0?Ee:Z.trim()||"message"}async function Yr(){await j(),ie.value=!0,await Qr(),ht()}async function Qr(){if(!me.value){me.value=!0;try{if(Ge.name==="home"||Ge.name==="skills"){u.value!==""&&await B("");return}if(Ge.name==="thread"){const R=Oe.value;if(!R)return;if(!Ke.value.has(R)){await et.replace({name:"home"});return}u.value!==R&&await B(R);return}}finally{me.value=!1}}}mt(()=>[Ge.name,Oe.value,I.value,Ke.value.has(Oe.value),u.value],async()=>{ie.value&&await Qr()}),mt(()=>u.value,async R=>{if(ie.value&&!me.value&&!(xe.value||Ve.value)){if(!R){Ge.name!=="home"&&await et.replace({name:"home"});return}Ge.name==="thread"&&Oe.value===R||await et.replace({name:"thread",params:{threadId:R}})}}),mt(()=>kt.value,R=>{if(R.length===0){fe.value="";return}R.some(Ee=>Ee.value===fe.value)||(fe.value=R[0].value),sn()},{immediate:!0}),mt(()=>fe.value,()=>{v.value={phase:"idle",title:"",message:""},sn()}),mt(()=>De.value,R=>{R==="local"&&(v.value={phase:"idle",title:"",message:""})}),mt(()=>Ge.name,R=>{R!=="home"&&(v.value={phase:"idle",title:"",message:""})}),mt(()=>u.value,()=>{v.value={phase:"idle",title:"",message:""}}),mt(W,R=>{R&&!A.value&&Ae(!0)});async function hi(R,Z=[],Ee=[],rt=[]){try{v.value={phase:"idle",title:"",message:""};let vt=fe.value;if(De.value==="worktree"){v.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const Dt=await r_(fe.value);vt=Dt.cwd,fe.value=Dt.cwd,v.value={phase:"idle",title:"",message:""}}catch{v.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Ye=await re(R,vt,Z,Ee,rt);if(!Ye)return;await et.replace({name:"thread",params:{threadId:Ye}})}catch{}}return(R,Z)=>(w(),T(He,null,[Ce(Bg,{"is-sidebar-collapsed":A.value,onCloseSidebar:Z[6]||(Z[6]=Ee=>Ae(!0))},{sidebar:pt(()=>[m("section",AC,[m("div",RC,[A.value?se("",!0):(w(),yt(uu,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":A.value,"show-new-thread-button":!0,onToggleSidebar:Z[0]||(Z[0]=Ee=>Ae(!A.value)),onStartNewThread:kn},{default:pt(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":F.value,"aria-label":"Search threads",title:"Search threads",onClick:Sr},[Ce(ga,{class:"sidebar-search-toggle-icon"})],8,PC)]),_:1},8,["is-sidebar-collapsed"])),!A.value&&F.value?(w(),T("div",xC,[Ce(ga,{class:"sidebar-search-bar-icon"}),tr(m("input",{ref_key:"sidebarSearchInputRef",ref:P,"onUpdate:modelValue":Z[1]||(Z[1]=Ee=>H.value=Ee),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Ne},null,544),[[nr,H.value]]),H.value.length>0?(w(),T("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:rn},[Ce(Ya,{class:"sidebar-search-clear-icon"})])):se("",!0)])):se("",!0),A.value?se("",!0):(w(),T("button",{key:2,class:gt(["sidebar-skills-link",{"is-active":Ve.value}]),type:"button",onClick:Z[2]||(Z[2]=Ee=>{ue(et).push({name:"skills"}),ue(W)&&Ae(!0)})}," Skills Hub ",2)),A.value?se("",!0):(w(),yt(Ay,{key:3,groups:ue(r),"project-display-name-by-id":ue(s),"selected-thread-id":ue(u),"is-loading":ue(I),"search-query":H.value,"search-matched-thread-ids":$.value,onSelect:Me,onArchive:jt,onStartNewThread:Er,onRenameProject:b,onBrowseProjectFiles:_n,onRenameThread:S,onRemoveProject:E,onReorderProject:z,onExportThread:fn},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),A.value?se("",!0):(w(),T("div",OC,[Ce(Nd,{name:"settings-panel"},{default:pt(()=>[be.value?(w(),T("div",MC,[m("button",{class:"sidebar-settings-row",type:"button",onClick:Ue},[Z[7]||(Z[7]=m("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),m("span",{class:gt(["sidebar-settings-toggle",{"is-on":!ae.value}])},null,2)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Mt},[Z[8]||(Z[8]=m("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),m("span",NC,ce(he.value==="steer"?"Steer":"Queue"),1)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Zt},[Z[9]||(Z[9]=m("span",{class:"sidebar-settings-label"},"Appearance",-1)),m("span",$C,ce(Se.value==="system"?"System":Se.value==="dark"?"Dark":"Light"),1)])])):se("",!0)]),_:1}),m("button",{class:"sidebar-settings-button",type:"button",onClick:Z[3]||(Z[3]=Ee=>be.value=!be.value)},[Ce(rC,{class:"sidebar-settings-icon"}),Z[10]||(Z[10]=m("span",null,"Settings",-1))])]))])]),content:pt(()=>[m("section",DC,[Ce(Ny,{title:_t.value},{leading:pt(()=>[A.value||ue(W)?(w(),yt(uu,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":A.value,"show-new-thread-button":!0,onToggleSidebar:Z[4]||(Z[4]=Ee=>Ae(!A.value)),onStartNewThread:kn},null,8,["is-sidebar-collapsed"])):se("",!0)]),_:1},8,["title"]),m("section",LC,[Ve.value?(w(),yt(HE,{key:0,onSkillsChanged:ln})):xe.value?(w(),T("div",jC,[m("div",BC,[Z[11]||(Z[11]=m("p",{class:"new-thread-hero"},"Let's build",-1)),Ce(ma,{class:"new-thread-folder-dropdown","model-value":fe.value,options:kt.value,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project","show-add-action":!0,"add-action-label":"+ Add new project","default-add-value":G.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":at,onAdd:lt},null,8,["model-value","options","default-add-value"]),Ce(Kk,{class:"new-thread-runtime-dropdown",modelValue:De.value,"onUpdate:modelValue":Z[5]||(Z[5]=Ee=>De.value=Ee)},null,8,["modelValue"]),v.value.phase!=="idle"?(w(),T("div",{key:0,class:gt(["worktree-init-status",{"is-running":v.value.phase==="running","is-error":v.value.phase==="error"}])},[m("strong",UC,ce(v.value.title),1),m("span",FC,ce(v.value.message),1)],2)):se("",!0)]),Ce($c,{"active-thread-id":ne.value,cwd:Je.value,models:ue(c),"selected-model":ue(f),"selected-reasoning-effort":ue(p),skills:ue(_),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":ae.value,"in-progress-submit-mode":he.value,onSubmit:We,"onUpdate:selectedModel":Jr,"onUpdate:selectedReasoningEffort":jn},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(w(),T("div",HC,[m("div",VC,[Ce(yb,{messages:U.value,"is-loading":ue(M),"active-thread-id":ne.value,cwd:Je.value,"scroll-state":ue(i),"live-overlay":K.value,"pending-requests":ue(a),"is-turn-in-progress":it.value,"is-rolling-back":ue(te),onUpdateScrollState:ge,onRespondServerRequest:le,onRollback:Is},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),m("div",WC,[Ce(Uk,{messages:ue(je),onSteer:ue(Qe),onDelete:ue(Be)},null,8,["messages","onSteer","onDelete"]),Ce($c,{"active-thread-id":ne.value,cwd:Je.value,models:ue(c),"selected-model":ue(f),"selected-reasoning-effort":ue(p),skills:ue(_),"is-turn-in-progress":it.value,"is-interrupting-turn":ue(Y),"has-queue-above":ue(je).length>0,"send-with-enter":ae.value,"in-progress-submit-mode":he.value,onSubmit:We,"onUpdate:selectedModel":Jr,"onUpdate:selectedReasoningEffort":jn,onInterrupt:Ts},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),m("div",zC," WT "+ce(ue(t))+" · v"+ce(ue(n)),1)],64))}}),GC=st(qC,[["__scopeId","data-v-f2b7f06b"]]),Gi={render:()=>null},KC=xg({history:cg(),routes:[{path:"/",name:"home",component:Gi},{path:"/thread/:threadId",name:"thread",component:Gi},{path:"/skills",name:"skills",component:Gi},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");km(GC).use(KC).mount("#app");