codexapp 0.1.46 → 0.1.47

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,1442 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();/**
2
+ * @vue/shared v3.5.28
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/function za(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const _t={},ns=[],xn=()=>{},Wu=()=>!1,Zo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),qa=e=>e.startsWith("onUpdate:"),Nt=Object.assign,Ga=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},wh=Object.prototype.hasOwnProperty,dt=(e,t)=>wh.call(e,t),Be=Array.isArray,rs=e=>so(e)==="[object Map]",zu=e=>so(e)==="[object Set]",Nl=e=>so(e)==="[object Date]",Ge=e=>typeof e=="function",It=e=>typeof e=="string",wn=e=>typeof e=="symbol",pt=e=>e!==null&&typeof e=="object",qu=e=>(pt(e)||Ge(e))&&Ge(e.then)&&Ge(e.catch),Gu=Object.prototype.toString,so=e=>Gu.call(e),bh=e=>so(e).slice(8,-1),Ku=e=>so(e)==="[object Object]",Ka=e=>It(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ns=za(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ei=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},_h=/-\w/g,fn=ei(e=>e.replace(_h,t=>t.slice(1).toUpperCase())),kh=/\B([A-Z])/g,Sr=ei(e=>e.replace(kh,"-$1").toLowerCase()),ti=ei(e=>e.charAt(0).toUpperCase()+e.slice(1)),Pi=ei(e=>e?`on${ti(e)}`:""),br=(e,t)=>!Object.is(e,t),Eo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Ju=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Ja=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Th=e=>{const t=It(e)?Number(e):NaN;return isNaN(t)?e:t};let $l;const ni=()=>$l||($l=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Hr(e){if(Be(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=It(r)?Ch(r):Hr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(It(e)||pt(e))return e}const Sh=/;(?![^(]*\))/g,Ih=/:([^]+)/,Eh=/\/\*[^]*?\*\//g;function Ch(e){const t={};return e.replace(Eh,"").split(Sh).forEach(n=>{if(n){const r=n.split(Ih);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ot(e){let t="";if(It(e))t=e;else if(Be(e))for(let n=0;n<e.length;n++){const r=ot(e[n]);r&&(t+=r+" ")}else if(pt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Ah="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Rh=za(Ah);function Yu(e){return!!e||e===""}function Ph(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Ya(e[r],t[r]);return n}function Ya(e,t){if(e===t)return!0;let n=Nl(e),r=Nl(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=wn(e),r=wn(t),n||r)return e===t;if(n=Be(e),r=Be(t),n||r)return n&&r?Ph(e,t):!1;if(n=pt(e),r=pt(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||!Ya(e[i],t[i]))return!1}}return String(e)===String(t)}const Xu=e=>!!(e&&e.__v_isRef===!0),se=e=>It(e)?e:e==null?"":Be(e)||pt(e)&&(e.toString===Gu||!Ge(e.toString))?Xu(e)?se(e.value):JSON.stringify(e,Qu,2):String(e),Qu=(e,t)=>Xu(t)?Qu(e,t.value):rs(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[xi(r,o)+" =>"]=s,n),{})}:zu(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>xi(n))}:wn(t)?xi(t):pt(t)&&!Be(t)&&!Ku(t)?String(t):t,xi=(e,t="")=>{var n;return wn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
+ * @vue/reactivity v3.5.28
7
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
+ * @license MIT
9
+ **/let sn;class xh{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=sn,!t&&sn&&(this.index=(sn.scopes||(sn.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=sn;try{return sn=this,t()}finally{sn=n}}}on(){++this._on===1&&(this.prevScope=sn,sn=this)}off(){this._on>0&&--this._on===0&&(sn=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 Mh(){return sn}let Tt;const Mi=new WeakSet;class Zu{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,sn&&sn.active&&sn.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Mi.has(this)&&(Mi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||td(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Dl(this),nd(this);const t=Tt,n=gn;Tt=this,gn=!0;try{return this.fn()}finally{rd(this),Tt=t,gn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Za(t);this.deps=this.depsTail=void 0,Dl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Mi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){da(this)&&this.run()}get dirty(){return da(this)}}let ed=0,$s,Ds;function td(e,t=!1){if(e.flags|=8,t){e.next=Ds,Ds=e;return}e.next=$s,$s=e}function Xa(){ed++}function Qa(){if(--ed>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 nd(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function rd(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Za(r),Oh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function da(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(sd(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function sd(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ws)||(e.globalVersion=Ws,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!da(e))))return;e.flags|=2;const t=e.dep,n=Tt,r=gn;Tt=e,gn=!0;try{nd(e);const s=e.fn(e._value);(t.version===0||br(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Tt=n,gn=r,rd(e),e.flags&=-3}}function Za(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)Za(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Oh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let gn=!0;const od=[];function Kn(){od.push(gn),gn=!1}function Jn(){const e=od.pop();gn=e===void 0?!0:e}function Dl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Tt;Tt=void 0;try{t()}finally{Tt=n}}}let Ws=0;class Nh{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 el{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||!gn||Tt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Tt)n=this.activeLink=new Nh(Tt,this),Tt.deps?(n.prevDep=Tt.depsTail,Tt.depsTail.nextDep=n,Tt.depsTail=n):Tt.deps=Tt.depsTail=n,id(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=Tt.depsTail,n.nextDep=void 0,Tt.depsTail.nextDep=n,Tt.depsTail=n,Tt.deps===n&&(Tt.deps=r)}return n}trigger(t){this.version++,Ws++,this.notify(t)}notify(t){Xa();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Qa()}}}function id(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)id(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const fa=new WeakMap,Br=Symbol(""),ha=Symbol(""),zs=Symbol("");function Vt(e,t,n){if(gn&&Tt){let r=fa.get(e);r||fa.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new el),s.map=r,s.key=n),s.track()}}function Vn(e,t,n,r,s,o){const i=fa.get(e);if(!i){Ws++;return}const a=l=>{l&&l.trigger()};if(Xa(),t==="clear")i.forEach(a);else{const l=Be(e),d=l&&Ka(n);if(l&&n==="length"){const u=Number(r);i.forEach((p,g)=>{(g==="length"||g===zs||!wn(g)&&g>=u)&&a(p)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(zs)),t){case"add":l?d&&a(i.get("length")):(a(i.get(Br)),rs(e)&&a(i.get(ha)));break;case"delete":l||(a(i.get(Br)),rs(e)&&a(i.get(ha)));break;case"set":rs(e)&&a(i.get(Br));break}}Qa()}function Xr(e){const t=lt(e);return t===e?t:(Vt(t,"iterate",zs),dn(e)?t:t.map(bn))}function ri(e){return Vt(e=lt(e),"iterate",zs),e}function hr(e,t){return Yn(e)?ds(Ur(e)?bn(t):t):bn(t)}const $h={__proto__:null,[Symbol.iterator](){return Oi(this,Symbol.iterator,e=>hr(this,e))},concat(...e){return Xr(this).concat(...e.map(t=>Be(t)?Xr(t):t))},entries(){return Oi(this,"entries",e=>(e[1]=hr(this,e[1]),e))},every(e,t){return jn(this,"every",e,t,void 0,arguments)},filter(e,t){return jn(this,"filter",e,t,n=>n.map(r=>hr(this,r)),arguments)},find(e,t){return jn(this,"find",e,t,n=>hr(this,n),arguments)},findIndex(e,t){return jn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return jn(this,"findLast",e,t,n=>hr(this,n),arguments)},findLastIndex(e,t){return jn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return jn(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ni(this,"includes",e)},indexOf(...e){return Ni(this,"indexOf",e)},join(e){return Xr(this).join(e)},lastIndexOf(...e){return Ni(this,"lastIndexOf",e)},map(e,t){return jn(this,"map",e,t,void 0,arguments)},pop(){return Cs(this,"pop")},push(...e){return Cs(this,"push",e)},reduce(e,...t){return Ll(this,"reduce",e,t)},reduceRight(e,...t){return Ll(this,"reduceRight",e,t)},shift(){return Cs(this,"shift")},some(e,t){return jn(this,"some",e,t,void 0,arguments)},splice(...e){return Cs(this,"splice",e)},toReversed(){return Xr(this).toReversed()},toSorted(e){return Xr(this).toSorted(e)},toSpliced(...e){return Xr(this).toSpliced(...e)},unshift(...e){return Cs(this,"unshift",e)},values(){return Oi(this,"values",e=>hr(this,e))}};function Oi(e,t,n){const r=ri(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 Dh=Array.prototype;function jn(e,t,n,r,s,o){const i=ri(e),a=i!==e&&!dn(e),l=i[t];if(l!==Dh[t]){const p=l.apply(e,o);return a?bn(p):p}let d=n;i!==e&&(a?d=function(p,g){return n.call(this,hr(e,p),g,e)}:n.length>2&&(d=function(p,g){return n.call(this,p,g,e)}));const u=l.call(i,d,r);return a&&s?s(u):u}function Ll(e,t,n,r){const s=ri(e);let o=n;return s!==e&&(dn(e)?n.length>3&&(o=function(i,a,l){return n.call(this,i,a,l,e)}):o=function(i,a,l){return n.call(this,i,hr(e,a),l,e)}),s[t](o,...r)}function Ni(e,t,n){const r=lt(e);Vt(r,"iterate",zs);const s=r[t](...n);return(s===-1||s===!1)&&rl(n[0])?(n[0]=lt(n[0]),r[t](...n)):s}function Cs(e,t,n=[]){Kn(),Xa();const r=lt(e)[t].apply(e,n);return Qa(),Jn(),r}const Lh=za("__proto__,__v_isRef,__isVue"),ad=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(wn));function jh(e){wn(e)||(e=String(e));const t=lt(this);return Vt(t,"has",e),t.hasOwnProperty(e)}class ld{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?Kh:fd:o?dd:ud).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Be(t);if(!s){let l;if(i&&(l=$h[n]))return l;if(n==="hasOwnProperty")return jh}const a=Reflect.get(t,n,Gt(t)?t:r);if((wn(n)?ad.has(n):Lh(n))||(s||Vt(t,"get",n),o))return a;if(Gt(a)){const l=i&&Ka(n)?a:a.value;return s&&pt(l)?ma(l):l}return pt(a)?s?ma(a):si(a):a}}class cd extends ld{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Be(t)&&Ka(n);if(!this._isShallow){const d=Yn(o);if(!dn(r)&&!Yn(r)&&(o=lt(o),r=lt(r)),!i&&Gt(o)&&!Gt(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:dt(t,n),l=Reflect.set(t,n,r,Gt(t)?t:s);return t===lt(s)&&(a?br(r,o)&&Vn(t,"set",n,r):Vn(t,"add",n,r)),l}deleteProperty(t,n){const r=dt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&Vn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!wn(n)||!ad.has(n))&&Vt(t,"has",n),r}ownKeys(t){return Vt(t,"iterate",Be(t)?"length":Br),Reflect.ownKeys(t)}}class Bh extends ld{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Uh=new cd,Fh=new Bh,Hh=new cd(!0);const pa=e=>e,vo=e=>Reflect.getPrototypeOf(e);function Vh(e,t,n){return function(...r){const s=this.__v_raw,o=lt(s),i=rs(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),u=n?pa:t?ds:bn;return!t&&Vt(o,"iterate",l?ha:Br),Nt(Object.create(d),{next(){const{value:p,done:g}=d.next();return g?{value:p,done:g}:{value:a?[u(p[0]),u(p[1])]:u(p),done:g}}})}}function yo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Wh(e,t){const n={get(s){const o=this.__v_raw,i=lt(o),a=lt(s);e||(br(s,a)&&Vt(i,"get",s),Vt(i,"get",a));const{has:l}=vo(i),d=t?pa:e?ds:bn;if(l.call(i,s))return d(o.get(s));if(l.call(i,a))return d(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Vt(lt(s),"iterate",Br),s.size},has(s){const o=this.__v_raw,i=lt(o),a=lt(s);return e||(br(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=lt(a),d=t?pa:e?ds:bn;return!e&&Vt(l,"iterate",Br),a.forEach((u,p)=>s.call(o,d(u),d(p),i))}};return Nt(n,e?{add:yo("add"),set:yo("set"),delete:yo("delete"),clear:yo("clear")}:{add(s){!t&&!dn(s)&&!Yn(s)&&(s=lt(s));const o=lt(this);return vo(o).has.call(o,s)||(o.add(s),Vn(o,"add",s,s)),this},set(s,o){!t&&!dn(o)&&!Yn(o)&&(o=lt(o));const i=lt(this),{has:a,get:l}=vo(i);let d=a.call(i,s);d||(s=lt(s),d=a.call(i,s));const u=l.call(i,s);return i.set(s,o),d?br(o,u)&&Vn(i,"set",s,o):Vn(i,"add",s,o),this},delete(s){const o=lt(this),{has:i,get:a}=vo(o);let l=i.call(o,s);l||(s=lt(s),l=i.call(o,s)),a&&a.call(o,s);const d=o.delete(s);return l&&Vn(o,"delete",s,void 0),d},clear(){const s=lt(this),o=s.size!==0,i=s.clear();return o&&Vn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Vh(s,e,t)}),n}function tl(e,t){const n=Wh(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 zh={get:tl(!1,!1)},qh={get:tl(!1,!0)},Gh={get:tl(!0,!1)};const ud=new WeakMap,dd=new WeakMap,fd=new WeakMap,Kh=new WeakMap;function Jh(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Yh(e){return e.__v_skip||!Object.isExtensible(e)?0:Jh(bh(e))}function si(e){return Yn(e)?e:nl(e,!1,Uh,zh,ud)}function hd(e){return nl(e,!1,Hh,qh,dd)}function ma(e){return nl(e,!0,Fh,Gh,fd)}function nl(e,t,n,r,s){if(!pt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Yh(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 Ur(e){return Yn(e)?Ur(e.__v_raw):!!(e&&e.__v_isReactive)}function Yn(e){return!!(e&&e.__v_isReadonly)}function dn(e){return!!(e&&e.__v_isShallow)}function rl(e){return e?!!e.__v_raw:!1}function lt(e){const t=e&&e.__v_raw;return t?lt(t):e}function Xh(e){return!dt(e,"__v_skip")&&Object.isExtensible(e)&&Ju(e,"__v_skip",!0),e}const bn=e=>pt(e)?si(e):e,ds=e=>pt(e)?ma(e):e;function Gt(e){return e?e.__v_isRef===!0:!1}function L(e){return pd(e,!1)}function Qh(e){return pd(e,!0)}function pd(e,t){return Gt(e)?e:new Zh(e,t)}class Zh{constructor(t,n){this.dep=new el,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:lt(t),this._value=n?t:bn(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)||Yn(t);t=r?t:lt(t),br(t,n)&&(this._rawValue=t,this._value=r?t:bn(t),this.dep.trigger())}}function ve(e){return Gt(e)?e.value:e}const ep={get:(e,t,n)=>t==="__v_raw"?e:ve(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Gt(s)&&!Gt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function md(e){return Ur(e)?e:new Proxy(e,ep)}class tp{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new el(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ws-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Tt!==this)return td(this,!0),!0}get value(){const t=this.dep.track();return sd(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function np(e,t,n=!1){let r,s;return Ge(e)?r=e:(r=e.get,s=e.set),new tp(r,s,n)}const wo={},Do=new WeakMap;let Or;function rp(e,t=!1,n=Or){if(n){let r=Do.get(n);r||Do.set(n,r=[]),r.push(e)}}function sp(e,t,n=_t){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=H=>s?H:dn(H)||s===!1||s===0?Wn(H,1):Wn(H);let u,p,g,T,j=!1,R=!1;if(Gt(e)?(p=()=>e.value,j=dn(e)):Ur(e)?(p=()=>d(e),j=!0):Be(e)?(R=!0,j=e.some(H=>Ur(H)||dn(H)),p=()=>e.map(H=>{if(Gt(H))return H.value;if(Ur(H))return d(H);if(Ge(H))return l?l(H,2):H()})):Ge(e)?t?p=l?()=>l(e,2):e:p=()=>{if(g){Kn();try{g()}finally{Jn()}}const H=Or;Or=u;try{return l?l(e,3,[T]):e(T)}finally{Or=H}}:p=xn,t&&s){const H=p,oe=s===!0?1/0:s;p=()=>Wn(H(),oe)}const B=Mh(),N=()=>{u.stop(),B&&B.active&&Ga(B.effects,u)};if(o&&t){const H=t;t=(...oe)=>{H(...oe),N()}}let P=R?new Array(e.length).fill(wo):wo;const D=H=>{if(!(!(u.flags&1)||!u.dirty&&!H))if(t){const oe=u.run();if(s||j||(R?oe.some((ae,pe)=>br(ae,P[pe])):br(oe,P))){g&&g();const ae=Or;Or=u;try{const pe=[oe,P===wo?void 0:R&&P[0]===wo?[]:P,T];P=oe,l?l(t,3,pe):t(...pe)}finally{Or=ae}}}else u.run()};return a&&a(D),u=new Zu(p),u.scheduler=i?()=>i(D,!1):D,T=H=>rp(H,!1,u),g=u.onStop=()=>{const H=Do.get(u);if(H){if(l)l(H,4);else for(const oe of H)oe();Do.delete(u)}},t?r?D(!0):P=u.run():i?i(D.bind(null,!0),!0):u.run(),N.pause=u.pause.bind(u),N.resume=u.resume.bind(u),N.stop=N,N}function Wn(e,t=1/0,n){if(t<=0||!pt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Gt(e))Wn(e.value,t,n);else if(Be(e))for(let r=0;r<e.length;r++)Wn(e[r],t,n);else if(zu(e)||rs(e))e.forEach(r=>{Wn(r,t,n)});else if(Ku(e)){for(const r in e)Wn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Wn(e[r],t,n)}return e}/**
10
+ * @vue/runtime-core v3.5.28
11
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
+ * @license MIT
13
+ **/function oo(e,t,n,r){try{return r?e(...r):e()}catch(s){oi(s,t,n)}}function _n(e,t,n,r){if(Ge(e)){const s=oo(e,t,n,r);return s&&qu(s)&&s.catch(o=>{oi(o,t,n)}),s}if(Be(e)){const s=[];for(let o=0;o<e.length;o++)s.push(_n(e[o],t,n,r));return s}}function oi(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||_t;if(t){let a=t.parent;const l=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let p=0;p<u.length;p++)if(u[p](e,l,d)===!1)return}a=a.parent}if(o){Kn(),oo(o,null,10,[e,l,d]),Jn();return}}op(e,n,s,r,i)}function op(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Qt=[];let In=-1;const ss=[];let pr=null,Zr=0;const gd=Promise.resolve();let Lo=null;function qt(e){const t=Lo||gd;return e?t.then(this?e.bind(this):e):t}function ip(e){let t=In+1,n=Qt.length;for(;t<n;){const r=t+n>>>1,s=Qt[r],o=qs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function sl(e){if(!(e.flags&1)){const t=qs(e),n=Qt[Qt.length-1];!n||!(e.flags&2)&&t>=qs(n)?Qt.push(e):Qt.splice(ip(t),0,e),e.flags|=1,vd()}}function vd(){Lo||(Lo=gd.then(wd))}function ap(e){Be(e)?ss.push(...e):pr&&e.id===-1?pr.splice(Zr+1,0,e):e.flags&1||(ss.push(e),e.flags|=1),vd()}function jl(e,t,n=In+1){for(;n<Qt.length;n++){const r=Qt[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Qt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function yd(e){if(ss.length){const t=[...new Set(ss)].sort((n,r)=>qs(n)-qs(r));if(ss.length=0,pr){pr.push(...t);return}for(pr=t,Zr=0;Zr<pr.length;Zr++){const n=pr[Zr];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}pr=null,Zr=0}}const qs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function wd(e){try{for(In=0;In<Qt.length;In++){const t=Qt[In];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),oo(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;In<Qt.length;In++){const t=Qt[In];t&&(t.flags&=-2)}In=-1,Qt.length=0,yd(),Lo=null,(Qt.length||ss.length)&&wd()}}let jt=null,bd=null;function jo(e){const t=jt;return jt=e,bd=e&&e.type.__scopeId||null,t}function gt(e,t=jt,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Ho(-1);const o=jo(t);let i;try{i=e(...s)}finally{jo(o),r._d&&Ho(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Xn(e,t){if(jt===null)return e;const n=di(jt),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=_t]=t[s];o&&(Ge(o)&&(o={mounted:o,updated:o}),o.deep&&Wn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Ar(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&&(Kn(),_n(l,n,8,[e.el,a,e,t]),Jn())}}function Co(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 vn(e,t,n=!1){const r=cl();if(r||is){let s=is?is._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&&Ge(t)?t.call(r&&r.proxy):t}}const lp=Symbol.for("v-scx"),cp=()=>vn(lp);function ht(e,t,n){return _d(e,t,n)}function _d(e,t,n=_t){const{immediate:r,deep:s,flush:o,once:i}=n,a=Nt({},n),l=t&&r||!t&&o!=="post";let d;if(Xs){if(o==="sync"){const T=cp();d=T.__watcherHandles||(T.__watcherHandles=[])}else if(!l){const T=()=>{};return T.stop=xn,T.resume=xn,T.pause=xn,T}}const u=zt;a.call=(T,j,R)=>_n(T,u,j,R);let p=!1;o==="post"?a.scheduler=T=>{Ht(T,u&&u.suspense)}:o!=="sync"&&(p=!0,a.scheduler=(T,j)=>{j?T():sl(T)}),a.augmentJob=T=>{t&&(T.flags|=4),p&&(T.flags|=2,u&&(T.id=u.uid,T.i=u))};const g=sp(e,t,a);return Xs&&(d?d.push(g):l&&g()),g}function up(e,t,n){const r=this.proxy,s=It(e)?e.includes(".")?kd(r,e):()=>r[e]:e.bind(r,r);let o;Ge(t)?o=t:(o=t.handler,n=t);const i=io(this),a=_d(s,o.bind(r),n);return i(),a}function kd(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 Td=Symbol("_vte"),Sd=e=>e.__isTeleport,Ls=e=>e&&(e.disabled||e.disabled===""),Bl=e=>e&&(e.defer||e.defer===""),Ul=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Fl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ga=(e,t)=>{const n=e&&e.to;return It(n)?t?t(n):null:n},Id={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,d){const{mc:u,pc:p,pbc:g,o:{insert:T,querySelector:j,createText:R,createComment:B}}=d,N=Ls(t.props);let{shapeFlag:P,children:D,dynamicChildren:H}=t;if(e==null){const oe=t.el=R(""),ae=t.anchor=R("");T(oe,n,r),T(ae,n,r);const pe=(ce,te)=>{P&16&&u(D,ce,te,s,o,i,a,l)},Te=()=>{const ce=t.target=ga(t.props,j),te=va(ce,t,R,T);ce&&(i!=="svg"&&Ul(ce)?i="svg":i!=="mathml"&&Fl(ce)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(ce),N||(pe(ce,te),Ao(t,!1)))};N&&(pe(n,ae),Ao(t,!0)),Bl(t.props)?(t.el.__isMounted=!1,Ht(()=>{Te(),delete t.el.__isMounted},o)):Te()}else{if(Bl(t.props)&&e.el.__isMounted===!1){Ht(()=>{Id.process(e,t,n,r,s,o,i,a,l,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const oe=t.anchor=e.anchor,ae=t.target=e.target,pe=t.targetAnchor=e.targetAnchor,Te=Ls(e.props),ce=Te?n:ae,te=Te?oe:pe;if(i==="svg"||Ul(ae)?i="svg":(i==="mathml"||Fl(ae))&&(i="mathml"),H?(g(e.dynamicChildren,H,ce,s,o,i,a),al(e,t,!0)):l||p(e,t,ce,te,s,o,i,a,!1),N)Te?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):bo(t,n,oe,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ie=t.target=ga(t.props,j);ie&&bo(t,ie,null,d,0)}else Te&&bo(t,ae,pe,d,1);Ao(t,N)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:d,targetAnchor:u,target:p,props:g}=e;if(p&&(s(d),s(u)),o&&s(l),i&16){const T=o||!Ls(g);for(let j=0;j<a.length;j++){const R=a[j];r(R,t,n,T,!!R.dynamicChildren)}}},move:bo,hydrate:dp};function bo(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:d,props:u}=e,p=o===2;if(p&&r(i,t,n),(!p||Ls(u))&&l&16)for(let g=0;g<d.length;g++)s(d[g],t,n,2);p&&r(a,t,n)}function dp(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:u}},p){function g(B,N){let P=N;for(;P;){if(P&&P.nodeType===8){if(P.data==="teleport start anchor")t.targetStart=P;else if(P.data==="teleport anchor"){t.targetAnchor=P,B._lpa=t.targetAnchor&&i(t.targetAnchor);break}}P=i(P)}}function T(B,N){N.anchor=p(i(B),N,a(B),n,r,s,o)}const j=t.target=ga(t.props,l),R=Ls(t.props);if(j){const B=j._lpa||j.firstChild;t.shapeFlag&16&&(R?(T(e,t),g(j,B),t.targetAnchor||va(j,t,u,d,a(e)===j?e:null)):(t.anchor=i(e),g(j,B),t.targetAnchor||va(j,t,u,d),p(B&&i(B),t,j,n,r,s,o))),Ao(t,R)}else R&&t.shapeFlag&16&&(T(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Bo=Id;function Ao(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 va(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Td]=i,e&&(r(o,e,s),r(i,e,s)),i}const En=Symbol("_leaveCb"),As=Symbol("_enterCb");function fp(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return nr(()=>{e.isMounted=!0}),rr(()=>{e.isUnmounting=!0}),e}const cn=[Function,Array],Ed={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},Cd=e=>{const t=e.subTree;return t.component?Cd(t.component):t},hp={name:"BaseTransition",props:Ed,setup(e,{slots:t}){const n=cl(),r=fp();return()=>{const s=t.default&&Pd(t.default(),!0);if(!s||!s.length)return;const o=Ad(s),i=lt(e),{mode:a}=i;if(r.isLeaving)return $i(o);const l=Hl(o);if(!l)return $i(o);let d=ya(l,i,r,n,p=>d=p);l.type!==Wt&&Gs(l,d);let u=n.subTree&&Hl(n.subTree);if(u&&u.type!==Wt&&!$r(u,l)&&Cd(n).type!==Wt){let p=ya(u,i,r,n);if(Gs(u,p),a==="out-in"&&l.type!==Wt)return r.isLeaving=!0,p.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete p.afterLeave,u=void 0},$i(o);a==="in-out"&&l.type!==Wt?p.delayLeave=(g,T,j)=>{const R=Rd(r,u);R[String(u.key)]=u,g[En]=()=>{T(),g[En]=void 0,delete d.delayedLeave,u=void 0},d.delayedLeave=()=>{j(),delete d.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function Ad(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Wt){t=n;break}}return t}const pp=hp;function Rd(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 ya(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:u,onEnterCancelled:p,onBeforeLeave:g,onLeave:T,onAfterLeave:j,onLeaveCancelled:R,onBeforeAppear:B,onAppear:N,onAfterAppear:P,onAppearCancelled:D}=t,H=String(e.key),oe=Rd(n,e),ae=(ce,te)=>{ce&&_n(ce,r,9,te)},pe=(ce,te)=>{const ie=te[1];ae(ce,te),Be(ce)?ce.every(Y=>Y.length<=1)&&ie():ce.length<=1&&ie()},Te={mode:i,persisted:a,beforeEnter(ce){let te=l;if(!n.isMounted)if(o)te=B||l;else return;ce[En]&&ce[En](!0);const ie=oe[H];ie&&$r(e,ie)&&ie.el[En]&&ie.el[En](),ae(te,[ce])},enter(ce){let te=d,ie=u,Y=p;if(!n.isMounted)if(o)te=N||d,ie=P||u,Y=D||p;else return;let Ae=!1;ce[As]=Me=>{Ae||(Ae=!0,Me?ae(Y,[ce]):ae(ie,[ce]),Te.delayedLeave&&Te.delayedLeave(),ce[As]=void 0)};const Se=ce[As].bind(null,!1);te?pe(te,[ce,Se]):Se()},leave(ce,te){const ie=String(e.key);if(ce[As]&&ce[As](!0),n.isUnmounting)return te();ae(g,[ce]);let Y=!1;ce[En]=Se=>{Y||(Y=!0,te(),Se?ae(R,[ce]):ae(j,[ce]),ce[En]=void 0,oe[ie]===e&&delete oe[ie])};const Ae=ce[En].bind(null,!1);oe[ie]=e,T?pe(T,[ce,Ae]):Ae()},clone(ce){const te=ya(ce,t,n,r,s);return s&&s(te),te}};return Te}function $i(e){if(ii(e))return e=Tr(e),e.children=null,e}function Hl(e){if(!ii(e))return Sd(e.type)&&e.children?Ad(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&&Ge(n.default))return n.default()}}function Gs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Gs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Pd(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===Le?(i.patchFlag&128&&s++,r=r.concat(Pd(i.children,t,a))):(t||i.type!==Wt)&&r.push(a!=null?Tr(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function $t(e,t){return Ge(e)?Nt({name:e.name},t,{setup:e}):e}function xd(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Vl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Uo=new WeakMap;function js(e,t,n,r,s=!1){if(Be(e)){e.forEach((R,B)=>js(R,t&&(Be(t)?t[B]:t),n,r,s));return}if(os(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?di(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,u=a.refs===_t?a.refs={}:a.refs,p=a.setupState,g=lt(p),T=p===_t?Wu:R=>Vl(u,R)?!1:dt(g,R),j=(R,B)=>!(B&&Vl(u,B));if(d!=null&&d!==l){if(Wl(t),It(d))u[d]=null,T(d)&&(p[d]=null);else if(Gt(d)){const R=t;j(d,R.k)&&(d.value=null),R.k&&(u[R.k]=null)}}if(Ge(l))oo(l,a,12,[i,u]);else{const R=It(l),B=Gt(l);if(R||B){const N=()=>{if(e.f){const P=R?T(l)?p[l]:u[l]:j()||!e.k?l.value:u[e.k];if(s)Be(P)&&Ga(P,o);else if(Be(P))P.includes(o)||P.push(o);else if(R)u[l]=[o],T(l)&&(p[l]=u[l]);else{const D=[o];j(l,e.k)&&(l.value=D),e.k&&(u[e.k]=D)}}else R?(u[l]=i,T(l)&&(p[l]=i)):B&&(j(l,e.k)&&(l.value=i),e.k&&(u[e.k]=i))};if(i){const P=()=>{N(),Uo.delete(e)};P.id=-1,Uo.set(e,P),Ht(P,n)}else Wl(e),N()}}}function Wl(e){const t=Uo.get(e);t&&(t.flags|=8,Uo.delete(e))}ni().requestIdleCallback;ni().cancelIdleCallback;const os=e=>!!e.type.__asyncLoader,ii=e=>e.type.__isKeepAlive;function mp(e,t){Md(e,"a",t)}function gp(e,t){Md(e,"da",t)}function Md(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(ai(t,r,n),n){let s=n.parent;for(;s&&s.parent;)ii(s.parent.vnode)&&vp(r,t,n,s),s=s.parent}}function vp(e,t,n,r){const s=ai(t,e,r,!0);li(()=>{Ga(r[t],s)},n)}function ai(e,t,n=zt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Kn();const a=io(n),l=_n(t,n,e,i);return a(),Jn(),l});return r?s.unshift(o):s.push(o),o}}const tr=e=>(t,n=zt)=>{(!Xs||e==="sp")&&ai(e,(...r)=>t(...r),n)},yp=tr("bm"),nr=tr("m"),wp=tr("bu"),bp=tr("u"),rr=tr("bum"),li=tr("um"),_p=tr("sp"),kp=tr("rtg"),Tp=tr("rtc");function Sp(e,t=zt){ai("ec",e,t)}const Ip="components",Od=Symbol.for("v-ndc");function wa(e){return It(e)?Ep(Ip,e,!1)||e:e||Od}function Ep(e,t,n=!0,r=!1){const s=jt||zt;if(s){const o=s.type;{const a=um(o,!1);if(a&&(a===t||a===fn(t)||a===ti(fn(t))))return o}const i=zl(s[e]||o[e],t)||zl(s.appContext[e],t);return!i&&r?o:i}}function zl(e,t){return e&&(e[t]||e[fn(t)]||e[ti(fn(t))])}function bt(e,t,n,r){let s;const o=n,i=Be(e);if(i||It(e)){const a=i&&Ur(e);let l=!1,d=!1;a&&(l=!dn(e),d=Yn(e),e=ri(e)),s=new Array(e.length);for(let u=0,p=e.length;u<p;u++)s[u]=t(l?d?ds(bn(e[u])):bn(e[u]):e[u],u,void 0,o)}else if(typeof e=="number"){s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,o)}else if(pt(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,d=a.length;l<d;l++){const u=a[l];s[l]=t(e[u],u,l,o)}}else s=[];return s}function Pn(e,t,n={},r,s){if(jt.ce||jt.parent&&os(jt.parent)&&jt.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),b(),ft(Le,null,[Ie("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),b();const i=o&&Nd(o(n)),a=n.key||i&&i.key,l=ft(Le,{key:(a&&!wn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function Nd(e){return e.some(t=>Js(t)?!(t.type===Wt||t.type===Le&&!Nd(t.children)):!0)?e:null}const ba=e=>e?ef(e)?di(e):ba(e.parent):null,Bs=Nt(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=>ba(e.parent),$root:e=>ba(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Dd(e),$forceUpdate:e=>e.f||(e.f=()=>{sl(e.update)}),$nextTick:e=>e.n||(e.n=qt.bind(e.proxy)),$watch:e=>up.bind(e)}),Di=(e,t)=>e!==_t&&!e.__isScriptSetup&&dt(e,t),Cp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:o,accessCache:i,type:a,appContext:l}=e;if(t[0]!=="$"){const g=i[t];if(g!==void 0)switch(g){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(Di(r,t))return i[t]=1,r[t];if(s!==_t&&dt(s,t))return i[t]=2,s[t];if(dt(o,t))return i[t]=3,o[t];if(n!==_t&&dt(n,t))return i[t]=4,n[t];_a&&(i[t]=0)}}const d=Bs[t];let u,p;if(d)return t==="$attrs"&&Vt(e.attrs,"get",""),d(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==_t&&dt(n,t))return i[t]=4,n[t];if(p=l.config.globalProperties,dt(p,t))return p[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return Di(s,t)?(s[t]=n,!0):r!==_t&&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!==_t&&a[0]!=="$"&&dt(e,a)||Di(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 Ap(){return Rp().slots}function Rp(e){const t=cl();return t.setupContext||(t.setupContext=nf(t))}function ql(e){return Be(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let _a=!0;function Pp(e){const t=Dd(e),n=e.proxy,r=e.ctx;_a=!1,t.beforeCreate&&Gl(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:d,created:u,beforeMount:p,mounted:g,beforeUpdate:T,updated:j,activated:R,deactivated:B,beforeDestroy:N,beforeUnmount:P,destroyed:D,unmounted:H,render:oe,renderTracked:ae,renderTriggered:pe,errorCaptured:Te,serverPrefetch:ce,expose:te,inheritAttrs:ie,components:Y,directives:Ae,filters:Se}=t;if(d&&xp(d,r,null),i)for(const Oe in i){const me=i[Oe];Ge(me)&&(r[Oe]=me.bind(n))}if(s){const Oe=s.call(n,n);pt(Oe)&&(e.data=si(Oe))}if(_a=!0,o)for(const Oe in o){const me=o[Oe],at=Ge(me)?me.bind(n,n):Ge(me.get)?me.get.bind(n,n):xn,Ye=!Ge(me)&&Ge(me.set)?me.set.bind(n):xn,Xe=ue({get:at,set:Ye});Object.defineProperty(r,Oe,{enumerable:!0,configurable:!0,get:()=>Xe.value,set:We=>Xe.value=We})}if(a)for(const Oe in a)$d(a[Oe],r,n,Oe);if(l){const Oe=Ge(l)?l.call(n):l;Reflect.ownKeys(Oe).forEach(me=>{Co(me,Oe[me])})}u&&Gl(u,e,"c");function Re(Oe,me){Be(me)?me.forEach(at=>Oe(at.bind(n))):me&&Oe(me.bind(n))}if(Re(yp,p),Re(nr,g),Re(wp,T),Re(bp,j),Re(mp,R),Re(gp,B),Re(Sp,Te),Re(Tp,ae),Re(kp,pe),Re(rr,P),Re(li,H),Re(_p,ce),Be(te))if(te.length){const Oe=e.exposed||(e.exposed={});te.forEach(me=>{Object.defineProperty(Oe,me,{get:()=>n[me],set:at=>n[me]=at,enumerable:!0})})}else e.exposed||(e.exposed={});oe&&e.render===xn&&(e.render=oe),ie!=null&&(e.inheritAttrs=ie),Y&&(e.components=Y),Ae&&(e.directives=Ae),ce&&xd(e)}function xp(e,t,n=xn){Be(e)&&(e=ka(e));for(const r in e){const s=e[r];let o;pt(s)?"default"in s?o=vn(s.from||r,s.default,!0):o=vn(s.from||r):o=vn(s),Gt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function Gl(e,t,n){_n(Be(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function $d(e,t,n,r){let s=r.includes(".")?kd(n,r):()=>n[r];if(It(e)){const o=t[e];Ge(o)&&ht(s,o)}else if(Ge(e))ht(s,e.bind(n));else if(pt(e))if(Be(e))e.forEach(o=>$d(o,t,n,r));else{const o=Ge(e.handler)?e.handler.bind(n):t[e.handler];Ge(o)&&ht(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(d=>Fo(l,d,i,!0)),Fo(l,t,i)),pt(t)&&o.set(t,l),l}function Fo(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Fo(e,o,n,!0),s&&s.forEach(i=>Fo(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=Mp[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const Mp={data:Kl,props:Jl,emits:Jl,methods:Os,computed:Os,beforeCreate:Yt,created:Yt,beforeMount:Yt,mounted:Yt,beforeUpdate:Yt,updated:Yt,beforeDestroy:Yt,beforeUnmount:Yt,destroyed:Yt,unmounted:Yt,activated:Yt,deactivated:Yt,errorCaptured:Yt,serverPrefetch:Yt,components:Os,directives:Os,watch:Np,provide:Kl,inject:Op};function Kl(e,t){return t?e?function(){return Nt(Ge(e)?e.call(this,this):e,Ge(t)?t.call(this,this):t)}:t:e}function Op(e,t){return Os(ka(e),ka(t))}function ka(e){if(Be(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Yt(e,t){return e?[...new Set([].concat(e,t))]:t}function Os(e,t){return e?Nt(Object.create(null),e,t):t}function Jl(e,t){return e?Be(e)&&Be(t)?[...new Set([...e,...t])]:Nt(Object.create(null),ql(e),ql(t??{})):t}function Np(e,t){if(!e)return t;if(!t)return e;const n=Nt(Object.create(null),e);for(const r in t)n[r]=Yt(e[r],t[r]);return n}function Ld(){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 $p=0;function Dp(e,t){return function(r,s=null){Ge(r)||(r=Nt({},r)),s!=null&&!pt(s)&&(s=null);const o=Ld(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:$p++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:fm,get config(){return o.config},set config(u){},use(u,...p){return i.has(u)||(u&&Ge(u.install)?(i.add(u),u.install(d,...p)):Ge(u)&&(i.add(u),u(d,...p))),d},mixin(u){return o.mixins.includes(u)||o.mixins.push(u),d},component(u,p){return p?(o.components[u]=p,d):o.components[u]},directive(u,p){return p?(o.directives[u]=p,d):o.directives[u]},mount(u,p,g){if(!l){const T=d._ceVNode||Ie(r,s);return T.appContext=o,g===!0?g="svg":g===!1&&(g=void 0),e(T,u,g),l=!0,d._container=u,u.__vue_app__=d,di(T.component)}},onUnmount(u){a.push(u)},unmount(){l&&(_n(a,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(u,p){return o.provides[u]=p,d},runWithContext(u){const p=is;is=d;try{return u()}finally{is=p}}};return d}}let is=null;const Lp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${fn(t)}Modifiers`]||e[`${Sr(t)}Modifiers`];function jp(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||_t;let s=n;const o=t.startsWith("update:"),i=o&&Lp(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>It(u)?u.trim():u)),i.number&&(s=n.map(Ja)));let a,l=r[a=Pi(t)]||r[a=Pi(fn(t))];!l&&o&&(l=r[a=Pi(Sr(t))]),l&&_n(l,e,6,s);const d=r[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,_n(d,e,6,s)}}const Bp=new WeakMap;function jd(e,t,n=!1){const r=n?Bp:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Ge(e)){const l=d=>{const u=jd(d,t,!0);u&&(a=!0,Nt(i,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(pt(e)&&r.set(e,null),null):(Be(o)?o.forEach(l=>i[l]=null):Nt(i,o),pt(e)&&r.set(e,i),i)}function ci(e,t){return!e||!Zo(t)?!1:(t=t.slice(2).replace(/Once$/,""),dt(e,t[0].toLowerCase()+t.slice(1))||dt(e,Sr(t))||dt(e,t))}function Yl(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:d,renderCache:u,props:p,data:g,setupState:T,ctx:j,inheritAttrs:R}=e,B=jo(e);let N,P;try{if(n.shapeFlag&4){const H=s||r,oe=H;N=Cn(d.call(oe,H,u,p,T,g,j)),P=a}else{const H=t;N=Cn(H.length>1?H(p,{attrs:a,slots:i,emit:l}):H(p,null)),P=t.props?a:Up(a)}}catch(H){Us.length=0,oi(H,e,1),N=Ie(Wt)}let D=N;if(P&&R!==!1){const H=Object.keys(P),{shapeFlag:oe}=D;H.length&&oe&7&&(o&&H.some(qa)&&(P=Fp(P,o)),D=Tr(D,P,!1,!0))}return n.dirs&&(D=Tr(D,null,!1,!0),D.dirs=D.dirs?D.dirs.concat(n.dirs):n.dirs),n.transition&&Gs(D,n.transition),N=D,jo(B),N}const Up=e=>{let t;for(const n in e)(n==="class"||n==="style"||Zo(n))&&((t||(t={}))[n]=e[n]);return t},Fp=(e,t)=>{const n={};for(const r in e)(!qa(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Hp(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Xl(r,i,d):!!i;if(l&8){const u=t.dynamicProps;for(let p=0;p<u.length;p++){const g=u[p];if(Bd(i,r,g)&&!ci(d,g))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Xl(r,i,d):!0:!!i;return!1}function Xl(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(Bd(t,e,o)&&!ci(n,o))return!0}return!1}function Bd(e,t,n){const r=e[n],s=t[n];return n==="style"&&pt(r)&&pt(s)?!Ya(r,s):r!==s}function Vp({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 Ud={},Fd=()=>Object.create(Ud),Hd=e=>Object.getPrototypeOf(e)===Ud;function Wp(e,t,n,r=!1){const s={},o=Fd();e.propsDefaults=Object.create(null),Vd(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:hd(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function zp(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=lt(s),[l]=e.propsOptions;let d=!1;if((r||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let p=0;p<u.length;p++){let g=u[p];if(ci(e.emitsOptions,g))continue;const T=t[g];if(l)if(dt(o,g))T!==o[g]&&(o[g]=T,d=!0);else{const j=fn(g);s[j]=Ta(l,a,j,T,e,!1)}else T!==o[g]&&(o[g]=T,d=!0)}}}else{Vd(e,t,s,o)&&(d=!0);let u;for(const p in a)(!t||!dt(t,p)&&((u=Sr(p))===p||!dt(t,u)))&&(l?n&&(n[p]!==void 0||n[u]!==void 0)&&(s[p]=Ta(l,a,p,void 0,e,!0)):delete s[p]);if(o!==a)for(const p in o)(!t||!dt(t,p))&&(delete o[p],d=!0)}d&&Vn(e.attrs,"set","")}function Vd(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Ns(l))continue;const d=t[l];let u;s&&dt(s,u=fn(l))?!o||!o.includes(u)?n[u]=d:(a||(a={}))[u]=d:ci(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=lt(n),d=a||_t;for(let u=0;u<o.length;u++){const p=o[u];n[p]=Ta(s,l,p,d[p],e,!dt(d,p))}}return i}function Ta(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&&Ge(l)){const{propsDefaults:d}=s;if(n in d)r=d[n];else{const u=io(s);r=d[n]=l.call(null,t),u()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===Sr(n))&&(r=!0))}return r}const qp=new WeakMap;function Wd(e,t,n=!1){const r=n?qp:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Ge(e)){const u=p=>{l=!0;const[g,T]=Wd(p,t,!0);Nt(i,g),T&&a.push(...T)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!o&&!l)return pt(e)&&r.set(e,ns),ns;if(Be(o))for(let u=0;u<o.length;u++){const p=fn(o[u]);Ql(p)&&(i[p]=_t)}else if(o)for(const u in o){const p=fn(u);if(Ql(p)){const g=o[u],T=i[p]=Be(g)||Ge(g)?{type:g}:Nt({},g),j=T.type;let R=!1,B=!0;if(Be(j))for(let N=0;N<j.length;++N){const P=j[N],D=Ge(P)&&P.name;if(D==="Boolean"){R=!0;break}else D==="String"&&(B=!1)}else R=Ge(j)&&j.name==="Boolean";T[0]=R,T[1]=B,(R||dt(T,"default"))&&a.push(p)}}const d=[i,a];return pt(e)&&r.set(e,d),d}function Ql(e){return e[0]!=="$"&&!Ns(e)}const ol=e=>e==="_"||e==="_ctx"||e==="$stable",il=e=>Be(e)?e.map(Cn):[Cn(e)],Gp=(e,t,n)=>{if(t._n)return t;const r=gt((...s)=>il(t(...s)),n);return r._c=!1,r},zd=(e,t,n)=>{const r=e._ctx;for(const s in e){if(ol(s))continue;const o=e[s];if(Ge(o))t[s]=Gp(s,o,r);else if(o!=null){const i=il(o);t[s]=()=>i}}},qd=(e,t)=>{const n=il(t);e.slots.default=()=>n},Gd=(e,t,n)=>{for(const r in t)(n||!ol(r))&&(e[r]=t[r])},Kp=(e,t,n)=>{const r=e.slots=Fd();if(e.vnode.shapeFlag&32){const s=t._;s?(Gd(r,t,n),n&&Ju(r,"_",s,!0)):zd(t,r)}else t&&qd(e,t)},Jp=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=_t;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:Gd(s,t,n):(o=!t.$stable,zd(t,s)),i=t}else t&&(qd(e,t),i={default:1});if(o)for(const a in s)!ol(a)&&i[a]==null&&delete s[a]},Ht=em;function Yp(e){return Xp(e)}function Xp(e,t){const n=ni();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:d,setElementText:u,parentNode:p,nextSibling:g,setScopeId:T=xn,insertStaticContent:j}=e,R=(w,k,M,W=null,F=null,x=null,U=void 0,q=null,K=!!k.dynamicChildren)=>{if(w===k)return;w&&!$r(w,k)&&(W=V(w),We(w,F,x,!0),w=null),k.patchFlag===-2&&(K=!1,k.dynamicChildren=null);const{type:G,ref:ge,shapeFlag:fe}=k;switch(G){case ui:B(w,k,M,W);break;case Wt:N(w,k,M,W);break;case ji:w==null&&P(k,M,W,U);break;case Le:Y(w,k,M,W,F,x,U,q,K);break;default:fe&1?oe(w,k,M,W,F,x,U,q,K):fe&6?Ae(w,k,M,W,F,x,U,q,K):(fe&64||fe&128)&&G.process(w,k,M,W,F,x,U,q,K,we)}ge!=null&&F?js(ge,w&&w.ref,x,k||w,!k):ge==null&&w&&w.ref!=null&&js(w.ref,null,x,w,!0)},B=(w,k,M,W)=>{if(w==null)r(k.el=a(k.children),M,W);else{const F=k.el=w.el;k.children!==w.children&&d(F,k.children)}},N=(w,k,M,W)=>{w==null?r(k.el=l(k.children||""),M,W):k.el=w.el},P=(w,k,M,W)=>{[w.el,w.anchor]=j(w.children,k,M,W,w.el,w.anchor)},D=({el:w,anchor:k},M,W)=>{let F;for(;w&&w!==k;)F=g(w),r(w,M,W),w=F;r(k,M,W)},H=({el:w,anchor:k})=>{let M;for(;w&&w!==k;)M=g(w),s(w),w=M;s(k)},oe=(w,k,M,W,F,x,U,q,K)=>{if(k.type==="svg"?U="svg":k.type==="math"&&(U="mathml"),w==null)ae(k,M,W,F,x,U,q,K);else{const G=w.el&&w.el._isVueCE?w.el:null;try{G&&G._beginPatch(),ce(w,k,F,x,U,q,K)}finally{G&&G._endPatch()}}},ae=(w,k,M,W,F,x,U,q)=>{let K,G;const{props:ge,shapeFlag:fe,transition:be,dirs:Ee}=w;if(K=w.el=i(w.type,x,ge&&ge.is,ge),fe&8?u(K,w.children):fe&16&&Te(w.children,K,null,W,F,Li(w,x),U,q),Ee&&Ar(w,null,W,"created"),pe(K,w,w.scopeId,U,W),ge){for(const Ve in ge)Ve!=="value"&&!Ns(Ve)&&o(K,Ve,null,ge[Ve],x,W);"value"in ge&&o(K,"value",null,ge.value,x),(G=ge.onVnodeBeforeMount)&&Sn(G,W,w)}Ee&&Ar(w,null,W,"beforeMount");const Ne=Qp(F,be);Ne&&be.beforeEnter(K),r(K,k,M),((G=ge&&ge.onVnodeMounted)||Ne||Ee)&&Ht(()=>{G&&Sn(G,W,w),Ne&&be.enter(K),Ee&&Ar(w,null,W,"mounted")},F)},pe=(w,k,M,W,F)=>{if(M&&T(w,M),W)for(let x=0;x<W.length;x++)T(w,W[x]);if(F){let x=F.subTree;if(k===x||Yd(x.type)&&(x.ssContent===k||x.ssFallback===k)){const U=F.vnode;pe(w,U,U.scopeId,U.slotScopeIds,F.parent)}}},Te=(w,k,M,W,F,x,U,q,K=0)=>{for(let G=K;G<w.length;G++){const ge=w[G]=q?Hn(w[G]):Cn(w[G]);R(null,ge,k,M,W,F,x,U,q)}},ce=(w,k,M,W,F,x,U)=>{const q=k.el=w.el;let{patchFlag:K,dynamicChildren:G,dirs:ge}=k;K|=w.patchFlag&16;const fe=w.props||_t,be=k.props||_t;let Ee;if(M&&Rr(M,!1),(Ee=be.onVnodeBeforeUpdate)&&Sn(Ee,M,k,w),ge&&Ar(k,w,M,"beforeUpdate"),M&&Rr(M,!0),(fe.innerHTML&&be.innerHTML==null||fe.textContent&&be.textContent==null)&&u(q,""),G?te(w.dynamicChildren,G,q,M,W,Li(k,F),x):U||me(w,k,q,null,M,W,Li(k,F),x,!1),K>0){if(K&16)ie(q,fe,be,M,F);else if(K&2&&fe.class!==be.class&&o(q,"class",null,be.class,F),K&4&&o(q,"style",fe.style,be.style,F),K&8){const Ne=k.dynamicProps;for(let Ve=0;Ve<Ne.length;Ve++){const Ue=Ne[Ve],Je=fe[Ue],vt=be[Ue];(vt!==Je||Ue==="value")&&o(q,Ue,Je,vt,F,M)}}K&1&&w.children!==k.children&&u(q,k.children)}else!U&&G==null&&ie(q,fe,be,M,F);((Ee=be.onVnodeUpdated)||ge)&&Ht(()=>{Ee&&Sn(Ee,M,k,w),ge&&Ar(k,w,M,"updated")},W)},te=(w,k,M,W,F,x,U)=>{for(let q=0;q<k.length;q++){const K=w[q],G=k[q],ge=K.el&&(K.type===Le||!$r(K,G)||K.shapeFlag&198)?p(K.el):M;R(K,G,ge,null,W,F,x,U,!0)}},ie=(w,k,M,W,F)=>{if(k!==M){if(k!==_t)for(const x in k)!Ns(x)&&!(x in M)&&o(w,x,k[x],null,F,W);for(const x in M){if(Ns(x))continue;const U=M[x],q=k[x];U!==q&&x!=="value"&&o(w,x,q,U,F,W)}"value"in M&&o(w,"value",k.value,M.value,F)}},Y=(w,k,M,W,F,x,U,q,K)=>{const G=k.el=w?w.el:a(""),ge=k.anchor=w?w.anchor:a("");let{patchFlag:fe,dynamicChildren:be,slotScopeIds:Ee}=k;Ee&&(q=q?q.concat(Ee):Ee),w==null?(r(G,M,W),r(ge,M,W),Te(k.children||[],M,ge,F,x,U,q,K)):fe>0&&fe&64&&be&&w.dynamicChildren&&w.dynamicChildren.length===be.length?(te(w.dynamicChildren,be,M,F,x,U,q),(k.key!=null||F&&k===F.subTree)&&al(w,k,!0)):me(w,k,M,ge,F,x,U,q,K)},Ae=(w,k,M,W,F,x,U,q,K)=>{k.slotScopeIds=q,w==null?k.shapeFlag&512?F.ctx.activate(k,M,W,U,K):Se(k,M,W,F,x,U,K):Me(w,k,K)},Se=(w,k,M,W,F,x,U)=>{const q=w.component=im(w,W,F);if(ii(w)&&(q.ctx.renderer=we),am(q,!1,U),q.asyncDep){if(F&&F.registerDep(q,Re,U),!w.el){const K=q.subTree=Ie(Wt);N(null,K,k,M),w.placeholder=K.el}}else Re(q,w,k,M,F,x,U)},Me=(w,k,M)=>{const W=k.component=w.component;if(Hp(w,k,M))if(W.asyncDep&&!W.asyncResolved){Oe(W,k,M);return}else W.next=k,W.update();else k.el=w.el,W.vnode=k},Re=(w,k,M,W,F,x,U)=>{const q=()=>{if(w.isMounted){let{next:fe,bu:be,u:Ee,parent:Ne,vnode:Ve}=w;{const kt=Kd(w);if(kt){fe&&(fe.el=Ve.el,Oe(w,fe,U)),kt.asyncDep.then(()=>{Ht(()=>{w.isUnmounted||G()},F)});return}}let Ue=fe,Je;Rr(w,!1),fe?(fe.el=Ve.el,Oe(w,fe,U)):fe=Ve,be&&Eo(be),(Je=fe.props&&fe.props.onVnodeBeforeUpdate)&&Sn(Je,Ne,fe,Ve),Rr(w,!0);const vt=Yl(w),it=w.subTree;w.subTree=vt,R(it,vt,p(it.el),V(it),w,F,x),fe.el=vt.el,Ue===null&&Vp(w,vt.el),Ee&&Ht(Ee,F),(Je=fe.props&&fe.props.onVnodeUpdated)&&Ht(()=>Sn(Je,Ne,fe,Ve),F)}else{let fe;const{el:be,props:Ee}=k,{bm:Ne,m:Ve,parent:Ue,root:Je,type:vt}=w,it=os(k);Rr(w,!1),Ne&&Eo(Ne),!it&&(fe=Ee&&Ee.onVnodeBeforeMount)&&Sn(fe,Ue,k),Rr(w,!0);{Je.ce&&Je.ce._hasShadowRoot()&&Je.ce._injectChildStyle(vt);const kt=w.subTree=Yl(w);R(null,kt,M,W,w,F,x),k.el=kt.el}if(Ve&&Ht(Ve,F),!it&&(fe=Ee&&Ee.onVnodeMounted)){const kt=k;Ht(()=>Sn(fe,Ue,kt),F)}(k.shapeFlag&256||Ue&&os(Ue.vnode)&&Ue.vnode.shapeFlag&256)&&w.a&&Ht(w.a,F),w.isMounted=!0,k=M=W=null}};w.scope.on();const K=w.effect=new Zu(q);w.scope.off();const G=w.update=K.run.bind(K),ge=w.job=K.runIfDirty.bind(K);ge.i=w,ge.id=w.uid,K.scheduler=()=>sl(ge),Rr(w,!0),G()},Oe=(w,k,M)=>{k.component=w;const W=w.vnode.props;w.vnode=k,w.next=null,zp(w,k.props,W,M),Jp(w,k.children,M),Kn(),jl(w),Jn()},me=(w,k,M,W,F,x,U,q,K=!1)=>{const G=w&&w.children,ge=w?w.shapeFlag:0,fe=k.children,{patchFlag:be,shapeFlag:Ee}=k;if(be>0){if(be&128){Ye(G,fe,M,W,F,x,U,q,K);return}else if(be&256){at(G,fe,M,W,F,x,U,q,K);return}}Ee&8?(ge&16&&ze(G,F,x),fe!==G&&u(M,fe)):ge&16?Ee&16?Ye(G,fe,M,W,F,x,U,q,K):ze(G,F,x,!0):(ge&8&&u(M,""),Ee&16&&Te(fe,M,W,F,x,U,q,K))},at=(w,k,M,W,F,x,U,q,K)=>{w=w||ns,k=k||ns;const G=w.length,ge=k.length,fe=Math.min(G,ge);let be;for(be=0;be<fe;be++){const Ee=k[be]=K?Hn(k[be]):Cn(k[be]);R(w[be],Ee,M,null,F,x,U,q,K)}G>ge?ze(w,F,x,!0,!1,fe):Te(k,M,W,F,x,U,q,K,fe)},Ye=(w,k,M,W,F,x,U,q,K)=>{let G=0;const ge=k.length;let fe=w.length-1,be=ge-1;for(;G<=fe&&G<=be;){const Ee=w[G],Ne=k[G]=K?Hn(k[G]):Cn(k[G]);if($r(Ee,Ne))R(Ee,Ne,M,null,F,x,U,q,K);else break;G++}for(;G<=fe&&G<=be;){const Ee=w[fe],Ne=k[be]=K?Hn(k[be]):Cn(k[be]);if($r(Ee,Ne))R(Ee,Ne,M,null,F,x,U,q,K);else break;fe--,be--}if(G>fe){if(G<=be){const Ee=be+1,Ne=Ee<ge?k[Ee].el:W;for(;G<=be;)R(null,k[G]=K?Hn(k[G]):Cn(k[G]),M,Ne,F,x,U,q,K),G++}}else if(G>be)for(;G<=fe;)We(w[G],F,x,!0),G++;else{const Ee=G,Ne=G,Ve=new Map;for(G=Ne;G<=be;G++){const yt=k[G]=K?Hn(k[G]):Cn(k[G]);yt.key!=null&&Ve.set(yt.key,G)}let Ue,Je=0;const vt=be-Ne+1;let it=!1,kt=0;const Et=new Array(vt);for(G=0;G<vt;G++)Et[G]=0;for(G=Ee;G<=fe;G++){const yt=w[G];if(Je>=vt){We(yt,F,x,!0);continue}let qe;if(yt.key!=null)qe=Ve.get(yt.key);else for(Ue=Ne;Ue<=be;Ue++)if(Et[Ue-Ne]===0&&$r(yt,k[Ue])){qe=Ue;break}qe===void 0?We(yt,F,x,!0):(Et[qe-Ne]=G+1,qe>=kt?kt=qe:it=!0,R(yt,k[qe],M,null,F,x,U,q,K),Je++)}const mt=it?Zp(Et):ns;for(Ue=mt.length-1,G=vt-1;G>=0;G--){const yt=Ne+G,qe=k[yt],nt=k[yt+1],Bt=yt+1<ge?nt.el||Jd(nt):W;Et[G]===0?R(null,qe,M,Bt,F,x,U,q,K):it&&(Ue<0||G!==mt[Ue]?Xe(qe,M,Bt,2):Ue--)}}},Xe=(w,k,M,W,F=null)=>{const{el:x,type:U,transition:q,children:K,shapeFlag:G}=w;if(G&6){Xe(w.component.subTree,k,M,W);return}if(G&128){w.suspense.move(k,M,W);return}if(G&64){U.move(w,k,M,we);return}if(U===Le){r(x,k,M);for(let fe=0;fe<K.length;fe++)Xe(K[fe],k,M,W);r(w.anchor,k,M);return}if(U===ji){D(w,k,M);return}if(W!==2&&G&1&&q)if(W===0)q.beforeEnter(x),r(x,k,M),Ht(()=>q.enter(x),F);else{const{leave:fe,delayLeave:be,afterLeave:Ee}=q,Ne=()=>{w.ctx.isUnmounted?s(x):r(x,k,M)},Ve=()=>{x._isLeaving&&x[En](!0),fe(x,()=>{Ne(),Ee&&Ee()})};be?be(x,Ne,Ve):Ve()}else r(x,k,M)},We=(w,k,M,W=!1,F=!1)=>{const{type:x,props:U,ref:q,children:K,dynamicChildren:G,shapeFlag:ge,patchFlag:fe,dirs:be,cacheIndex:Ee}=w;if(fe===-2&&(F=!1),q!=null&&(Kn(),js(q,null,M,w,!0),Jn()),Ee!=null&&(k.renderCache[Ee]=void 0),ge&256){k.ctx.deactivate(w);return}const Ne=ge&1&&be,Ve=!os(w);let Ue;if(Ve&&(Ue=U&&U.onVnodeBeforeUnmount)&&Sn(Ue,k,w),ge&6)je(w.component,M,W);else{if(ge&128){w.suspense.unmount(M,W);return}Ne&&Ar(w,null,k,"beforeUnmount"),ge&64?w.type.remove(w,k,M,we,W):G&&!G.hasOnce&&(x!==Le||fe>0&&fe&64)?ze(G,k,M,!1,!0):(x===Le&&fe&384||!F&&ge&16)&&ze(K,k,M),W&&Qe(w)}(Ve&&(Ue=U&&U.onVnodeUnmounted)||Ne)&&Ht(()=>{Ue&&Sn(Ue,k,w),Ne&&Ar(w,null,k,"unmounted")},M)},Qe=w=>{const{type:k,el:M,anchor:W,transition:F}=w;if(k===Le){tt(M,W);return}if(k===ji){H(w);return}const x=()=>{s(M),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(w.shapeFlag&1&&F&&!F.persisted){const{leave:U,delayLeave:q}=F,K=()=>U(M,x);q?q(w.el,x,K):K()}else x()},tt=(w,k)=>{let M;for(;w!==k;)M=g(w),s(w),w=M;s(k)},je=(w,k,M)=>{const{bum:W,scope:F,job:x,subTree:U,um:q,m:K,a:G}=w;Zl(K),Zl(G),W&&Eo(W),F.stop(),x&&(x.flags|=8,We(U,w,k,M)),q&&Ht(q,k),Ht(()=>{w.isUnmounted=!0},k)},ze=(w,k,M,W=!1,F=!1,x=0)=>{for(let U=x;U<w.length;U++)We(w[U],k,M,W,F)},V=w=>{if(w.shapeFlag&6)return V(w.component.subTree);if(w.shapeFlag&128)return w.suspense.next();const k=g(w.anchor||w.el),M=k&&k[Td];return M?g(M):k};let ne=!1;const le=(w,k,M)=>{let W;w==null?k._vnode&&(We(k._vnode,null,null,!0),W=k._vnode.component):R(k._vnode||null,w,k,null,null,null,M),k._vnode=w,ne||(ne=!0,jl(W),yd(),ne=!1)},we={p:R,um:We,m:Xe,r:Qe,mt:Se,mc:Te,pc:me,pbc:te,n:V,o:e};return{render:le,hydrate:void 0,createApp:Dp(le)}}function Li({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 Rr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Qp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function al(e,t,n=!1){const r=e.children,s=t.children;if(Be(r)&&Be(s))for(let o=0;o<r.length;o++){const i=r[o];let a=s[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[o]=Hn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&al(i,a)),a.type===ui&&(a.patchFlag===-1&&(a=s[o]=Hn(a)),a.el=i.el),a.type===Wt&&!a.el&&(a.el=i.el)}}function Zp(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const d=e[r];if(d!==0){if(s=n[n.length-1],e[s]<d){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<d?o=a+1:i=a;d<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function Kd(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Kd(t)}function Zl(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Jd(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Jd(t.subTree):null}const Yd=e=>e.__isSuspense;function em(e,t){t&&t.pendingBranch?Be(e)?t.effects.push(...e):t.effects.push(e):ap(e)}const Le=Symbol.for("v-fgt"),ui=Symbol.for("v-txt"),Wt=Symbol.for("v-cmt"),ji=Symbol.for("v-stc"),Us=[];let ln=null;function b(e=!1){Us.push(ln=e?null:[])}function tm(){Us.pop(),ln=Us[Us.length-1]||null}let Ks=1;function Ho(e,t=!1){Ks+=e,e<0&&ln&&t&&(ln.hasOnce=!0)}function Xd(e){return e.dynamicChildren=Ks>0?ln||ns:null,tm(),Ks>0&&ln&&ln.push(e),e}function I(e,t,n,r,s,o){return Xd(y(e,t,n,r,s,o,!0))}function ft(e,t,n,r,s){return Xd(Ie(e,t,n,r,s,!0))}function Js(e){return e?e.__v_isVNode===!0:!1}function $r(e,t){return e.type===t.type&&e.key===t.key}const Qd=({key:e})=>e??null,Ro=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?It(e)||Gt(e)||Ge(e)?{i:jt,r:e,k:t,f:!!n}:e:null);function y(e,t=null,n=null,r=0,s=null,o=e===Le?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Qd(t),ref:t&&Ro(t),scopeId:bd,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:jt};return a?(ll(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=It(n)?8:16),Ks>0&&!i&&ln&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&ln.push(l),l}const Ie=nm;function nm(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===Od)&&(e=Wt),Js(e)){const a=Tr(e,t,!0);return n&&ll(a,n),Ks>0&&!o&&ln&&(a.shapeFlag&6?ln[ln.indexOf(e)]=a:ln.push(a)),a.patchFlag=-2,a}if(dm(e)&&(e=e.__vccOpts),t){t=rm(t);let{class:a,style:l}=t;a&&!It(a)&&(t.class=ot(a)),pt(l)&&(rl(l)&&!Be(l)&&(l=Nt({},l)),t.style=Hr(l))}const i=It(e)?1:Yd(e)?128:Sd(e)?64:pt(e)?4:Ge(e)?2:0;return y(e,t,n,r,s,i,o,!0)}function rm(e){return e?rl(e)||Hd(e)?Nt({},e):e:null}function Tr(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?Zd(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Qd(d),ref:t&&t.ref?n&&o?Be(o)?o.concat(Ro(t)):[o,Ro(t)]:Ro(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Le?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Tr(e.ssContent),ssFallback:e.ssFallback&&Tr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Gs(u,l.clone(u)),u}function Ys(e=" ",t=0){return Ie(ui,null,e,t)}function re(e="",t=!1){return t?(b(),ft(Wt,null,e)):Ie(Wt,null,e)}function Cn(e){return e==null||typeof e=="boolean"?Ie(Wt):Be(e)?Ie(Le,null,e.slice()):Js(e)?Hn(e):Ie(ui,null,String(e))}function Hn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Tr(e)}function ll(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Be(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),ll(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Hd(t)?t._ctx=jt:s===3&&jt&&(jt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ge(t)?(t={default:t,_ctx:jt},n=32):(t=String(t),r&64?(n=16,t=[Ys(t)]):n=8);e.children=t,e.shapeFlag|=n}function Zd(...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=ot([t.class,r.class]));else if(s==="style")t.style=Hr([t.style,r.style]);else if(Zo(s)){const o=t[s],i=r[s];i&&o!==i&&!(Be(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function Sn(e,t,n,r=null){_n(e,t,7,[n,r])}const sm=Ld();let om=0;function im(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||sm,o={uid:om++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new xh(!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:jd(r,s),emit:null,emitted:null,propsDefaults:_t,inheritAttrs:r.inheritAttrs,ctx:_t,data:_t,props:_t,attrs:_t,slots:_t,refs:_t,setupState:_t,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=jp.bind(null,o),e.ce&&e.ce(o),o}let zt=null;const cl=()=>zt||jt;let Vo,Sa;{const e=ni(),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)}};Vo=t("__VUE_INSTANCE_SETTERS__",n=>zt=n),Sa=t("__VUE_SSR_SETTERS__",n=>Xs=n)}const io=e=>{const t=zt;return Vo(e),e.scope.on(),()=>{e.scope.off(),Vo(t)}},ec=()=>{zt&&zt.scope.off(),Vo(null)};function ef(e){return e.vnode.shapeFlag&4}let Xs=!1;function am(e,t=!1,n=!1){t&&Sa(t);const{props:r,children:s}=e.vnode,o=ef(e);Wp(e,r,o,t),Kp(e,s,n||t);const i=o?lm(e,t):void 0;return t&&Sa(!1),i}function lm(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Cp);const{setup:r}=n;if(r){Kn();const s=e.setupContext=r.length>1?nf(e):null,o=io(e),i=oo(r,e,0,[e.props,s]),a=qu(i);if(Jn(),o(),(a||e.sp)&&!os(e)&&xd(e),a){if(i.then(ec,ec),t)return i.then(l=>{tc(e,l)}).catch(l=>{oi(l,e,0)});e.asyncDep=i}else tc(e,i)}else tf(e)}function tc(e,t,n){Ge(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:pt(t)&&(e.setupState=md(t)),tf(e)}function tf(e,t,n){const r=e.type;e.render||(e.render=r.render||xn);{const s=io(e);Kn();try{Pp(e)}finally{Jn(),s()}}}const cm={get(e,t){return Vt(e,"get",""),e[t]}};function nf(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,cm),slots:e.slots,emit:e.emit,expose:t}}function di(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(md(Xh(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Bs)return Bs[n](e)},has(t,n){return n in t||n in Bs}})):e.proxy}function um(e,t=!0){return Ge(e)?e.displayName||e.name:e.name||t&&e.__name}function dm(e){return Ge(e)&&"__vccOpts"in e}const ue=(e,t)=>np(e,t,Xs);function ul(e,t,n){try{Ho(-1);const r=arguments.length;return r===2?pt(t)&&!Be(t)?Js(t)?Ie(e,null,[t]):Ie(e,t):Ie(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Js(n)&&(n=[n]),Ie(e,t,n))}finally{Ho(1)}}const fm="3.5.28";/**
14
+ * @vue/runtime-dom v3.5.28
15
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
+ * @license MIT
17
+ **/let Ia;const nc=typeof window<"u"&&window.trustedTypes;if(nc)try{Ia=nc.createPolicy("vue",{createHTML:e=>e})}catch{}const rf=Ia?e=>Ia.createHTML(e):e=>e,hm="http://www.w3.org/2000/svg",pm="http://www.w3.org/1998/Math/MathML",Fn=typeof document<"u"?document:null,rc=Fn&&Fn.createElement("template"),mm={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"?Fn.createElementNS(hm,e):t==="mathml"?Fn.createElementNS(pm,e):n?Fn.createElement(e,{is:n}):Fn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Fn.createTextNode(e),createComment:e=>Fn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Fn.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{rc.innerHTML=rf(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=rc.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},cr="transition",Rs="animation",Qs=Symbol("_vtc"),sf={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},gm=Nt({},Ed,sf),vm=e=>(e.displayName="Transition",e.props=gm,e),of=vm((e,{slots:t})=>ul(pp,ym(e),t)),Pr=(e,t=[])=>{Be(e)?e.forEach(n=>n(...t)):e&&e(...t)},sc=e=>e?Be(e)?e.some(t=>t.length>1):e.length>1:!1;function ym(e){const t={};for(const Y in e)Y in sf||(t[Y]=e[Y]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:d=i,appearToClass:u=a,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:g=`${n}-leave-active`,leaveToClass:T=`${n}-leave-to`}=e,j=wm(s),R=j&&j[0],B=j&&j[1],{onBeforeEnter:N,onEnter:P,onEnterCancelled:D,onLeave:H,onLeaveCancelled:oe,onBeforeAppear:ae=N,onAppear:pe=P,onAppearCancelled:Te=D}=t,ce=(Y,Ae,Se,Me)=>{Y._enterCancelled=Me,xr(Y,Ae?u:a),xr(Y,Ae?d:i),Se&&Se()},te=(Y,Ae)=>{Y._isLeaving=!1,xr(Y,p),xr(Y,T),xr(Y,g),Ae&&Ae()},ie=Y=>(Ae,Se)=>{const Me=Y?pe:P,Re=()=>ce(Ae,Y,Se);Pr(Me,[Ae,Re]),oc(()=>{xr(Ae,Y?l:o),Bn(Ae,Y?u:a),sc(Me)||ic(Ae,r,R,Re)})};return Nt(t,{onBeforeEnter(Y){Pr(N,[Y]),Bn(Y,o),Bn(Y,i)},onBeforeAppear(Y){Pr(ae,[Y]),Bn(Y,l),Bn(Y,d)},onEnter:ie(!1),onAppear:ie(!0),onLeave(Y,Ae){Y._isLeaving=!0;const Se=()=>te(Y,Ae);Bn(Y,p),Y._enterCancelled?(Bn(Y,g),cc(Y)):(cc(Y),Bn(Y,g)),oc(()=>{Y._isLeaving&&(xr(Y,p),Bn(Y,T),sc(H)||ic(Y,r,B,Se))}),Pr(H,[Y,Se])},onEnterCancelled(Y){ce(Y,!1,void 0,!0),Pr(D,[Y])},onAppearCancelled(Y){ce(Y,!0,void 0,!0),Pr(Te,[Y])},onLeaveCancelled(Y){te(Y),Pr(oe,[Y])}})}function wm(e){if(e==null)return null;if(pt(e))return[Bi(e.enter),Bi(e.leave)];{const t=Bi(e);return[t,t]}}function Bi(e){return Th(e)}function Bn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Qs]||(e[Qs]=new Set)).add(t)}function xr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Qs];n&&(n.delete(t),n.size||(e[Qs]=void 0))}function oc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let bm=0;function ic(e,t,n,r){const s=e._endId=++bm,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=_m(e,t);if(!i)return r();const d=i+"end";let u=0;const p=()=>{e.removeEventListener(d,g),o()},g=T=>{T.target===e&&++u>=l&&p()};setTimeout(()=>{u<l&&p()},a+1),e.addEventListener(d,g)}function _m(e,t){const n=window.getComputedStyle(e),r=j=>(n[j]||"").split(", "),s=r(`${cr}Delay`),o=r(`${cr}Duration`),i=ac(s,o),a=r(`${Rs}Delay`),l=r(`${Rs}Duration`),d=ac(a,l);let u=null,p=0,g=0;t===cr?i>0&&(u=cr,p=i,g=o.length):t===Rs?d>0&&(u=Rs,p=d,g=l.length):(p=Math.max(i,d),u=p>0?i>d?cr:Rs:null,g=u?u===cr?o.length:l.length:0);const T=u===cr&&/\b(?:transform|all)(?:,|$)/.test(r(`${cr}Property`).toString());return{type:u,timeout:p,propCount:g,hasTransform:T}}function ac(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>lc(n)+lc(e[r])))}function lc(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function cc(e){return(e?e.ownerDocument:document).body.offsetHeight}function km(e,t,n){const r=e[Qs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const uc=Symbol("_vod"),Tm=Symbol("_vsh"),Sm=Symbol(""),Im=/(?:^|;)\s*display\s*:/;function Em(e,t,n){const r=e.style,s=It(n);let o=!1;if(n&&!s){if(t)if(It(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Po(r,a,"")}else for(const i in t)n[i]==null&&Po(r,i,"");for(const i in n)i==="display"&&(o=!0),Po(r,i,n[i])}else if(s){if(t!==n){const i=r[Sm];i&&(n+=";"+i),r.cssText=n,o=Im.test(n)}}else t&&e.removeAttribute("style");uc in e&&(e[uc]=o?r.display:"",e[Tm]&&(r.display="none"))}const dc=/\s*!important$/;function Po(e,t,n){if(Be(n))n.forEach(r=>Po(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Cm(e,t);dc.test(n)?e.setProperty(Sr(r),n.replace(dc,""),"important"):e[r]=n}}const fc=["Webkit","Moz","ms"],Ui={};function Cm(e,t){const n=Ui[t];if(n)return n;let r=fn(t);if(r!=="filter"&&r in e)return Ui[t]=r;r=ti(r);for(let s=0;s<fc.length;s++){const o=fc[s]+r;if(o in e)return Ui[t]=o}return t}const hc="http://www.w3.org/1999/xlink";function pc(e,t,n,r,s,o=Rh(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(hc,t.slice(6,t.length)):e.setAttributeNS(hc,t,n):n==null||o&&!Yu(n)?e.removeAttribute(t):e.setAttribute(t,o?"":wn(n)?String(n):n)}function mc(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?rf(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=Yu(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 es(e,t,n,r){e.addEventListener(t,n,r)}function Am(e,t,n,r){e.removeEventListener(t,n,r)}const gc=Symbol("_vei");function Rm(e,t,n,r,s=null){const o=e[gc]||(e[gc]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=Pm(t);if(r){const d=o[t]=Om(r,s);es(e,a,d,l)}else i&&(Am(e,a,i,l),o[t]=void 0)}}const vc=/(?:Once|Passive|Capture)$/;function Pm(e){let t;if(vc.test(e)){t={};let r;for(;r=e.match(vc);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Sr(e.slice(2)),t]}let Fi=0;const xm=Promise.resolve(),Mm=()=>Fi||(xm.then(()=>Fi=0),Fi=Date.now());function Om(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;_n(Nm(r,n.value),t,5,[r])};return n.value=e,n.attached=Mm(),n}function Nm(e,t){if(Be(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>s=>!s._stopped&&r&&r(s))}else return t}const yc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,$m=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?km(e,r,i):t==="style"?Em(e,n,r):Zo(t)?qa(t)||Rm(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Dm(e,t,r,i))?(mc(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&pc(e,t,r,i,o,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!It(r))?mc(e,fn(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),pc(e,t,r,i))};function Dm(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&yc(t)&&Ge(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 yc(t)&&It(n)?!1:t in e}const wc=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Be(t)?n=>Eo(t,n):t};function Lm(e){e.target.composing=!0}function bc(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Hi=Symbol("_assign");function _c(e,t,n){return t&&(e=e.trim()),n&&(e=Ja(e)),e}const Qn={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Hi]=wc(s);const o=r||s.props&&s.props.type==="number";es(e,t?"change":"input",i=>{i.target.composing||e[Hi](_c(e.value,n,o))}),(n||o)&&es(e,"change",()=>{e.value=_c(e.value,n,o)}),t||(es(e,"compositionstart",Lm),es(e,"compositionend",bc),es(e,"change",bc))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Hi]=wc(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Ja(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))}},jm=["ctrl","shift","alt","meta"],Bm={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>jm.some(n=>e[`${n}Key`]&&!t.includes(n))},st=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i<t.length;i++){const a=Bm[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Um={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Zt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Sr(s.key);if(t.some(i=>i===o||Um[i]===o))return e(s)}))},Fm=Nt({patchProp:$m},mm);let kc;function Hm(){return kc||(kc=Yp(Fm))}const Vm=((...e)=>{const t=Hm().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=zm(r);if(!s)return;const o=t._component;!Ge(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Wm(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Wm(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function zm(e){return It(e)?document.querySelector(e):e}/*!
18
+ * vue-router v4.6.4
19
+ * (c) 2025 Eduardo San Martin Morote
20
+ * @license MIT
21
+ */const ts=typeof document<"u";function af(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function qm(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&af(e.default)}const ut=Object.assign;function Vi(e,t){const n={};for(const r in t){const s=t[r];n[r]=kn(s)?s.map(e):e(s)}return n}const Fs=()=>{},kn=Array.isArray;function Tc(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const lf=/#/g,Gm=/&/g,Km=/\//g,Jm=/=/g,Ym=/\?/g,cf=/\+/g,Xm=/%5B/g,Qm=/%5D/g,uf=/%5E/g,Zm=/%60/g,df=/%7B/g,eg=/%7C/g,ff=/%7D/g,tg=/%20/g;function dl(e){return e==null?"":encodeURI(""+e).replace(eg,"|").replace(Xm,"[").replace(Qm,"]")}function ng(e){return dl(e).replace(df,"{").replace(ff,"}").replace(uf,"^")}function Ea(e){return dl(e).replace(cf,"%2B").replace(tg,"+").replace(lf,"%23").replace(Gm,"%26").replace(Zm,"`").replace(df,"{").replace(ff,"}").replace(uf,"^")}function rg(e){return Ea(e).replace(Jm,"%3D")}function sg(e){return dl(e).replace(lf,"%23").replace(Ym,"%3F")}function og(e){return sg(e).replace(Km,"%2F")}function Zs(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const ig=/\/$/,ag=e=>e.replace(ig,"");function Wi(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=dg(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:Zs(i)}}function lg(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Sc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function cg(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&fs(t.matched[r],n.matched[s])&&hf(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function fs(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function hf(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!ug(e[n],t[n]))return!1;return!0}function ug(e,t){return kn(e)?Ic(e,t):kn(t)?Ic(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Ic(e,t){return kn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function dg(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let o=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i).join("/")}const ur={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ca=(function(e){return e.pop="pop",e.push="push",e})({}),zi=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function fg(e){if(!e)if(ts){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),ag(e)}const hg=/^[^#]+#/;function pg(e,t){return e.replace(hg,"#")+t}function mg(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 fi=()=>({left:window.scrollX,top:window.scrollY});function gg(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=mg(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 Ec(e,t){return(history.state?history.state.position-t:-1)+e}const Aa=new Map;function vg(e,t){Aa.set(e,t)}function yg(e){const t=Aa.get(e);return Aa.delete(e),t}function wg(e){return typeof e=="string"||e&&typeof e=="object"}function pf(e){return typeof e=="string"||typeof e=="symbol"}let Ct=(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 mf=Symbol("");Ct.MATCHER_NOT_FOUND+"",Ct.NAVIGATION_GUARD_REDIRECT+"",Ct.NAVIGATION_ABORTED+"",Ct.NAVIGATION_CANCELLED+"",Ct.NAVIGATION_DUPLICATED+"";function hs(e,t){return ut(new Error,{type:e,[mf]:!0},t)}function Un(e,t){return e instanceof Error&&mf in e&&(t==null||!!(e.type&t))}const bg=["params","query","hash"];function _g(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of bg)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function kg(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(cf," "),o=s.indexOf("="),i=Zs(o<0?s:s.slice(0,o)),a=o<0?null:Zs(s.slice(o+1));if(i in t){let l=t[i];kn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function Cc(e){let t="";for(let n in e){const r=e[n];if(n=rg(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(kn(r)?r.map(s=>s&&Ea(s)):[r&&Ea(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function Tg(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=kn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const Sg=Symbol(""),Ac=Symbol(""),hi=Symbol(""),fl=Symbol(""),Ra=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 d=g=>{g===!1?l(hs(Ct.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?l(g):wg(g)?l(hs(Ct.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(i&&r.enterCallbacks[s]===i&&typeof g=="function"&&i.push(g),a())},u=o(()=>e.call(r&&r.instances[s],t,n,d));let p=Promise.resolve(u);e.length<3&&(p=p.then(d)),p.catch(g=>l(g))})}function qi(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(af(l)){const d=(l.__vccOpts||l)[t];d&&o.push(mr(d,n,r,i,a,s))}else{let d=l();o.push(()=>d.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const p=qm(u)?u.default:u;i.mods[a]=u,i.components[a]=p;const g=(p.__vccOpts||p)[t];return g&&mr(g,n,r,i,a,s)()}))}}return o}function Ig(e,t){const n=[],r=[],s=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;i<o;i++){const a=t.matched[i];a&&(e.matched.find(d=>fs(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>fs(d,l))||s.push(l))}return[n,r,s]}/*!
22
+ * vue-router v4.6.4
23
+ * (c) 2025 Eduardo San Martin Morote
24
+ * @license MIT
25
+ */let Eg=()=>location.protocol+"//"+location.host;function gf(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),Sc(a,"")}return Sc(n,e)+r+s}function Cg(e,t,n,r){let s=[],o=[],i=null;const a=({state:g})=>{const T=gf(e,location),j=n.value,R=t.value;let B=0;if(g){if(n.value=T,t.value=g,i&&i===j){i=null;return}B=R?g.position-R.position:0}else r(T);s.forEach(N=>{N(n.value,j,{delta:B,type:Ca.pop,direction:B?B>0?zi.forward:zi.back:zi.unknown})})};function l(){i=n.value}function d(g){s.push(g);const T=()=>{const j=s.indexOf(g);j>-1&&s.splice(j,1)};return o.push(T),T}function u(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(ut({},g.state,{scroll:fi()}),"")}}function p(){for(const g of o)g();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:d,destroy:p}}function Rc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?fi():null}}function Ag(e){const{history:t,location:n}=window,r={value:gf(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(l,d,u){const p=e.indexOf("#"),g=p>-1?(n.host&&document.querySelector("base")?e:e.slice(p))+l:Eg()+e+l;try{t[u?"replaceState":"pushState"](d,"",g),s.value=d}catch(T){console.error(T),n[u?"replace":"assign"](g)}}function i(l,d){o(l,ut({},t.state,Rc(s.value.back,l,s.value.forward,!0),d,{position:s.value.position}),!0),r.value=l}function a(l,d){const u=ut({},s.value,t.state,{forward:l,scroll:fi()});o(u.current,u,!0),o(l,ut({},Rc(r.value,l,null),{position:u.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function Rg(e){e=fg(e);const t=Ag(e),n=Cg(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:pg.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 Pg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Rg(e)}let Lr=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Ot=(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})(Ot||{});const xg={type:Lr.Static,value:""},Mg=/[a-zA-Z0-9_]/;function Og(e){if(!e)return[[]];if(e==="/")return[[xg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(T){throw new Error(`ERR (${n})/"${d}": ${T}`)}let n=Ot.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",u="";function p(){d&&(n===Ot.Static?o.push({type:Lr.Static,value:d}):n===Ot.Param||n===Ot.ParamRegExp||n===Ot.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Lr.Param,value:d,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),d="")}function g(){d+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Ot.ParamRegExp){r=n,n=Ot.EscapeNext;continue}switch(n){case Ot.Static:l==="/"?(d&&p(),i()):l===":"?(p(),n=Ot.Param):g();break;case Ot.EscapeNext:g(),n=r;break;case Ot.Param:l==="("?n=Ot.ParamRegExp:Mg.test(l)?g():(p(),n=Ot.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Ot.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=Ot.ParamRegExpEnd:u+=l;break;case Ot.ParamRegExpEnd:p(),n=Ot.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===Ot.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),p(),i(),s}const Pc="[^/]+?",Ng={sensitive:!1,strict:!1,start:!0,end:!0};var Xt=(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})(Xt||{});const $g=/[.+*?^${}()[\]/\\]/g;function Dg(e,t){const n=ut({},Ng,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const u=d.length?[]:[Xt.Root];n.strict&&!d.length&&(s+="/");for(let p=0;p<d.length;p++){const g=d[p];let T=Xt.Segment+(n.sensitive?Xt.BonusCaseSensitive:0);if(g.type===Lr.Static)p||(s+="/"),s+=g.value.replace($g,"\\$&"),T+=Xt.Static;else if(g.type===Lr.Param){const{value:j,repeatable:R,optional:B,regexp:N}=g;o.push({name:j,repeatable:R,optional:B});const P=N||Pc;if(P!==Pc){T+=Xt.BonusCustomRegExp;try{`${P}`}catch(H){throw new Error(`Invalid custom RegExp for param "${j}" (${P}): `+H.message)}}let D=R?`((?:${P})(?:/(?:${P}))*)`:`(${P})`;p||(D=B&&d.length<2?`(?:/${D})`:"/"+D),B&&(D+="?"),s+=D,T+=Xt.Dynamic,B&&(T+=Xt.BonusOptional),R&&(T+=Xt.BonusRepeatable),P===".*"&&(T+=Xt.BonusWildcard)}u.push(T)}r.push(u)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=Xt.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(d){const u=d.match(i),p={};if(!u)return null;for(let g=1;g<u.length;g++){const T=u[g]||"",j=o[g-1];p[j.name]=T&&j.repeatable?T.split("/"):T}return p}function l(d){let u="",p=!1;for(const g of e){(!p||!u.endsWith("/"))&&(u+="/"),p=!1;for(const T of g)if(T.type===Lr.Static)u+=T.value;else if(T.type===Lr.Param){const{value:j,repeatable:R,optional:B}=T,N=j in d?d[j]:"";if(kn(N)&&!R)throw new Error(`Provided param "${j}" is an array but it is not repeatable (* or + modifiers)`);const P=kn(N)?N.join("/"):N;if(!P)if(B)g.length<2&&(u.endsWith("/")?u=u.slice(0,-1):p=!0);else throw new Error(`Missing required param "${j}"`);u+=P}}return u||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function Lg(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]===Xt.Static+Xt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Xt.Static+Xt.Segment?1:-1:0}function vf(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=Lg(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(xc(r))return 1;if(xc(s))return-1}return s.length-r.length}function xc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const jg={strict:!1,end:!0,sensitive:!1};function Bg(e,t,n){const r=Dg(Og(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 Ug(e,t){const n=[],r=new Map;t=Tc(jg,t);function s(p){return r.get(p)}function o(p,g,T){const j=!T,R=Oc(p);R.aliasOf=T&&T.record;const B=Tc(t,p),N=[R];if("alias"in p){const H=typeof p.alias=="string"?[p.alias]:p.alias;for(const oe of H)N.push(Oc(ut({},R,{components:T?T.record.components:R.components,path:oe,aliasOf:T?T.record:R})))}let P,D;for(const H of N){const{path:oe}=H;if(g&&oe[0]!=="/"){const ae=g.record.path,pe=ae[ae.length-1]==="/"?"":"/";H.path=g.record.path+(oe&&pe+oe)}if(P=Bg(H,g,B),T?T.alias.push(P):(D=D||P,D!==P&&D.alias.push(P),j&&p.name&&!Nc(P)&&i(p.name)),yf(P)&&l(P),R.children){const ae=R.children;for(let pe=0;pe<ae.length;pe++)o(ae[pe],P,T&&T.children[pe])}T=T||P}return D?()=>{i(D)}:Fs}function i(p){if(pf(p)){const g=r.get(p);g&&(r.delete(p),n.splice(n.indexOf(g),1),g.children.forEach(i),g.alias.forEach(i))}else{const g=n.indexOf(p);g>-1&&(n.splice(g,1),p.record.name&&r.delete(p.record.name),p.children.forEach(i),p.alias.forEach(i))}}function a(){return n}function l(p){const g=Vg(p,n);n.splice(g,0,p),p.record.name&&!Nc(p)&&r.set(p.record.name,p)}function d(p,g){let T,j={},R,B;if("name"in p&&p.name){if(T=r.get(p.name),!T)throw hs(Ct.MATCHER_NOT_FOUND,{location:p});B=T.record.name,j=ut(Mc(g.params,T.keys.filter(D=>!D.optional).concat(T.parent?T.parent.keys.filter(D=>D.optional):[]).map(D=>D.name)),p.params&&Mc(p.params,T.keys.map(D=>D.name))),R=T.stringify(j)}else if(p.path!=null)R=p.path,T=n.find(D=>D.re.test(R)),T&&(j=T.parse(R),B=T.record.name);else{if(T=g.name?r.get(g.name):n.find(D=>D.re.test(g.path)),!T)throw hs(Ct.MATCHER_NOT_FOUND,{location:p,currentLocation:g});B=T.record.name,j=ut({},g.params,p.params),R=T.stringify(j)}const N=[];let P=T;for(;P;)N.unshift(P.record),P=P.parent;return{name:B,path:R,params:j,matched:N,meta:Hg(N)}}e.forEach(p=>o(p));function u(){n.length=0,r.clear()}return{addRoute:o,resolve:d,removeRoute:i,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function Mc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Oc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Fg(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 Fg(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 Nc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Hg(e){return e.reduce((t,n)=>ut(t,n.meta),{})}function Vg(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;vf(e,t[o])<0?r=o:n=o+1}const s=Wg(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Wg(e){let t=e;for(;t=t.parent;)if(yf(t)&&vf(e,t)===0)return t}function yf({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function $c(e){const t=vn(hi),n=vn(fl),r=ue(()=>{const l=ve(e.to);return t.resolve(l)}),s=ue(()=>{const{matched:l}=r.value,{length:d}=l,u=l[d-1],p=n.matched;if(!u||!p.length)return-1;const g=p.findIndex(fs.bind(null,u));if(g>-1)return g;const T=Dc(l[d-2]);return d>1&&Dc(u)===T&&p[p.length-1].path!==T?p.findIndex(fs.bind(null,l[d-2])):g}),o=ue(()=>s.value>-1&&Jg(n.params,r.value.params)),i=ue(()=>s.value>-1&&s.value===n.matched.length-1&&hf(n.params,r.value.params));function a(l={}){if(Kg(l)){const d=t[ve(e.replace)?"replace":"push"](ve(e.to)).catch(Fs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:r,href:ue(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function zg(e){return e.length===1?e[0]:e}const qg=$t({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:$c,setup(e,{slots:t}){const n=si($c(e)),{options:r}=vn(hi),s=ue(()=>({[Lc(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Lc(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&zg(t.default(n));return e.custom?o:ul("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Gg=qg;function Kg(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 Jg(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(!kn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Dc(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Lc=(e,t,n)=>e??t??n,Yg=$t({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=vn(Ra),s=ue(()=>e.route||r.value),o=vn(Ac,0),i=ue(()=>{let d=ve(o);const{matched:u}=s.value;let p;for(;(p=u[d])&&!p.components;)d++;return d}),a=ue(()=>s.value.matched[i.value]);Co(Ac,ue(()=>i.value+1)),Co(Sg,a),Co(Ra,s);const l=L();return ht(()=>[l.value,a.value,e.name],([d,u,p],[g,T,j])=>{u&&(u.instances[p]=d,T&&T!==u&&d&&d===g&&(u.leaveGuards.size||(u.leaveGuards=T.leaveGuards),u.updateGuards.size||(u.updateGuards=T.updateGuards))),d&&u&&(!T||!fs(u,T)||!g)&&(u.enterCallbacks[p]||[]).forEach(R=>R(d))},{flush:"post"}),()=>{const d=s.value,u=e.name,p=a.value,g=p&&p.components[u];if(!g)return jc(n.default,{Component:g,route:d});const T=p.props[u],j=T?T===!0?d.params:typeof T=="function"?T(d):T:null,B=ul(g,ut({},j,t,{onVnodeUnmounted:N=>{N.component.isUnmounted&&(p.instances[u]=null)},ref:l}));return jc(n.default,{Component:B,route:d})||B}}});function jc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Xg=Yg;function Qg(e){const t=Ug(e.routes,e),n=e.parseQuery||kg,r=e.stringifyQuery||Cc,s=e.history,o=Ps(),i=Ps(),a=Ps(),l=Qh(ur);let d=ur;ts&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Vi.bind(null,V=>""+V),p=Vi.bind(null,og),g=Vi.bind(null,Zs);function T(V,ne){let le,we;return pf(V)?(le=t.getRecordMatcher(V),we=ne):we=V,t.addRoute(we,le)}function j(V){const ne=t.getRecordMatcher(V);ne&&t.removeRoute(ne)}function R(){return t.getRoutes().map(V=>V.record)}function B(V){return!!t.getRecordMatcher(V)}function N(V,ne){if(ne=ut({},ne||l.value),typeof V=="string"){const M=Wi(n,V,ne.path),W=t.resolve({path:M.path},ne),F=s.createHref(M.fullPath);return ut(M,W,{params:g(W.params),hash:Zs(M.hash),redirectedFrom:void 0,href:F})}let le;if(V.path!=null)le=ut({},V,{path:Wi(n,V.path,ne.path).path});else{const M=ut({},V.params);for(const W in M)M[W]==null&&delete M[W];le=ut({},V,{params:p(M)}),ne.params=p(ne.params)}const we=t.resolve(le,ne),$e=V.hash||"";we.params=u(g(we.params));const w=lg(r,ut({},V,{hash:ng($e),path:we.path})),k=s.createHref(w);return ut({fullPath:w,hash:$e,query:r===Cc?Tg(V.query):V.query||{}},we,{redirectedFrom:void 0,href:k})}function P(V){return typeof V=="string"?Wi(n,V,l.value.path):ut({},V)}function D(V,ne){if(d!==V)return hs(Ct.NAVIGATION_CANCELLED,{from:ne,to:V})}function H(V){return pe(V)}function oe(V){return H(ut(P(V),{replace:!0}))}function ae(V,ne){const le=V.matched[V.matched.length-1];if(le&&le.redirect){const{redirect:we}=le;let $e=typeof we=="function"?we(V,ne):we;return typeof $e=="string"&&($e=$e.includes("?")||$e.includes("#")?$e=P($e):{path:$e},$e.params={}),ut({query:V.query,hash:V.hash,params:$e.path!=null?{}:V.params},$e)}}function pe(V,ne){const le=d=N(V),we=l.value,$e=V.state,w=V.force,k=V.replace===!0,M=ae(le,we);if(M)return pe(ut(P(M),{state:typeof M=="object"?ut({},$e,M.state):$e,force:w,replace:k}),ne||le);const W=le;W.redirectedFrom=ne;let F;return!w&&cg(r,we,le)&&(F=hs(Ct.NAVIGATION_DUPLICATED,{to:W,from:we}),Xe(we,we,!0,!1)),(F?Promise.resolve(F):te(W,we)).catch(x=>Un(x)?Un(x,Ct.NAVIGATION_GUARD_REDIRECT)?x:Ye(x):me(x,W,we)).then(x=>{if(x){if(Un(x,Ct.NAVIGATION_GUARD_REDIRECT))return pe(ut({replace:k},P(x.to),{state:typeof x.to=="object"?ut({},$e,x.to.state):$e,force:w}),ne||W)}else x=Y(W,we,!0,k,$e);return ie(W,we,x),x})}function Te(V,ne){const le=D(V,ne);return le?Promise.reject(le):Promise.resolve()}function ce(V){const ne=tt.values().next().value;return ne&&typeof ne.runWithContext=="function"?ne.runWithContext(V):V()}function te(V,ne){let le;const[we,$e,w]=Ig(V,ne);le=qi(we.reverse(),"beforeRouteLeave",V,ne);for(const M of we)M.leaveGuards.forEach(W=>{le.push(mr(W,V,ne))});const k=Te.bind(null,V,ne);return le.push(k),ze(le).then(()=>{le=[];for(const M of o.list())le.push(mr(M,V,ne));return le.push(k),ze(le)}).then(()=>{le=qi($e,"beforeRouteUpdate",V,ne);for(const M of $e)M.updateGuards.forEach(W=>{le.push(mr(W,V,ne))});return le.push(k),ze(le)}).then(()=>{le=[];for(const M of w)if(M.beforeEnter)if(kn(M.beforeEnter))for(const W of M.beforeEnter)le.push(mr(W,V,ne));else le.push(mr(M.beforeEnter,V,ne));return le.push(k),ze(le)}).then(()=>(V.matched.forEach(M=>M.enterCallbacks={}),le=qi(w,"beforeRouteEnter",V,ne,ce),le.push(k),ze(le))).then(()=>{le=[];for(const M of i.list())le.push(mr(M,V,ne));return le.push(k),ze(le)}).catch(M=>Un(M,Ct.NAVIGATION_CANCELLED)?M:Promise.reject(M))}function ie(V,ne,le){a.list().forEach(we=>ce(()=>we(V,ne,le)))}function Y(V,ne,le,we,$e){const w=D(V,ne);if(w)return w;const k=ne===ur,M=ts?history.state:{};le&&(we||k?s.replace(V.fullPath,ut({scroll:k&&M&&M.scroll},$e)):s.push(V.fullPath,$e)),l.value=V,Xe(V,ne,le,k),Ye()}let Ae;function Se(){Ae||(Ae=s.listen((V,ne,le)=>{if(!je.listening)return;const we=N(V),$e=ae(we,je.currentRoute.value);if($e){pe(ut($e,{replace:!0,force:!0}),we).catch(Fs);return}d=we;const w=l.value;ts&&vg(Ec(w.fullPath,le.delta),fi()),te(we,w).catch(k=>Un(k,Ct.NAVIGATION_ABORTED|Ct.NAVIGATION_CANCELLED)?k:Un(k,Ct.NAVIGATION_GUARD_REDIRECT)?(pe(ut(P(k.to),{force:!0}),we).then(M=>{Un(M,Ct.NAVIGATION_ABORTED|Ct.NAVIGATION_DUPLICATED)&&!le.delta&&le.type===Ca.pop&&s.go(-1,!1)}).catch(Fs),Promise.reject()):(le.delta&&s.go(-le.delta,!1),me(k,we,w))).then(k=>{k=k||Y(we,w,!1),k&&(le.delta&&!Un(k,Ct.NAVIGATION_CANCELLED)?s.go(-le.delta,!1):le.type===Ca.pop&&Un(k,Ct.NAVIGATION_ABORTED|Ct.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ie(we,w,k)}).catch(Fs)}))}let Me=Ps(),Re=Ps(),Oe;function me(V,ne,le){Ye(V);const we=Re.list();return we.length?we.forEach($e=>$e(V,ne,le)):console.error(V),Promise.reject(V)}function at(){return Oe&&l.value!==ur?Promise.resolve():new Promise((V,ne)=>{Me.add([V,ne])})}function Ye(V){return Oe||(Oe=!V,Se(),Me.list().forEach(([ne,le])=>V?le(V):ne()),Me.reset()),V}function Xe(V,ne,le,we){const{scrollBehavior:$e}=e;if(!ts||!$e)return Promise.resolve();const w=!le&&yg(Ec(V.fullPath,0))||(we||!le)&&history.state&&history.state.scroll||null;return qt().then(()=>$e(V,ne,w)).then(k=>k&&gg(k)).catch(k=>me(k,V,ne))}const We=V=>s.go(V);let Qe;const tt=new Set,je={currentRoute:l,listening:!0,addRoute:T,removeRoute:j,clearRoutes:t.clearRoutes,hasRoute:B,getRoutes:R,resolve:N,options:e,push:H,replace:oe,go:We,back:()=>We(-1),forward:()=>We(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Re.add,isReady:at,install(V){V.component("RouterLink",Gg),V.component("RouterView",Xg),V.config.globalProperties.$router=je,Object.defineProperty(V.config.globalProperties,"$route",{enumerable:!0,get:()=>ve(l)}),ts&&!Qe&&l.value===ur&&(Qe=!0,H(s.location).catch(we=>{}));const ne={};for(const we in ur)Object.defineProperty(ne,we,{get:()=>l.value[we],enumerable:!0});V.provide(hi,je),V.provide(fl,hd(ne)),V.provide(Ra,l);const le=V.unmount;tt.add(V),V.unmount=function(){tt.delete(V),tt.size<1&&(d=ur,Ae&&Ae(),Ae=null,l.value=ur,Qe=!1,Oe=!1),le()}}};function ze(V){return V.reduce((ne,le)=>ne.then(()=>ce(le)),Promise.resolve())}return je}function Zg(){return vn(hi)}function ev(e){return vn(fl)}const Bc=768;function wf(){const e=L(typeof window<"u"?window.innerWidth<Bc:!1);let t=null;function n(r){e.value=r.matches}return nr(()=>{t=window.matchMedia(`(max-width: ${Bc-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),li(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const tv={key:0,class:"desktop-sidebar"},nv={class:"desktop-main"},Uc="codex-web-local.sidebar-width.v1",rv=260,sv=620,Fc=320,ov=$t({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=wf();function r(d){return Math.min(sv,Math.max(rv,d))}function s(){if(typeof window>"u")return Fc;const d=window.localStorage.getItem(Uc),u=Number(d);return Number.isFinite(u)?r(u):Fc}const o=L(s()),i=ue(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${o.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(d){typeof window>"u"||window.localStorage.setItem(Uc,String(d))}function l(d){d.preventDefault();const u=d.clientX,p=o.value,g=j=>{const R=j.clientX-u;o.value=r(p+R)},T=()=>{a(o.value),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",T)};window.addEventListener("mousemove",g),window.addEventListener("mouseup",T)}return(d,u)=>(b(),I("div",{class:ot(["desktop-layout",{"is-mobile":ve(n)}]),style:Hr(i.value)},[ve(n)?(b(),ft(Bo,{key:0,to:"body"},[Ie(of,{name:"drawer"},{default:gt(()=>[e.isSidebarCollapsed?re("",!0):(b(),I("div",{key:0,class:"mobile-drawer-backdrop",onClick:u[1]||(u[1]=p=>d.$emit("close-sidebar"))},[y("aside",{class:"mobile-drawer",onClick:u[0]||(u[0]=st(()=>{},["stop"]))},[Pn(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):re("",!0),ve(n)?re("",!0):(b(),I(Le,{key:1},[e.isSidebarCollapsed?re("",!0):(b(),I("aside",tv,[Pn(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?re("",!0):(b(),I("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),y("section",nv,[Pn(d.$slots,"content",{},void 0)])],6))}}),et=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},iv=et(ov,[["__scopeId","data-v-df29c633"]]),av={},lv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function cv(e,t){return b(),I("svg",lv,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const pi=et(av,[["render",cv]]),uv={},dv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function fv(e,t){return b(),I("svg",dv,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const bf=et(uv,[["render",fv]]),hv={},pv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function mv(e,t){return b(),I("svg",pv,[...t[0]||(t[0]=[y("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=et(hv,[["render",mv]]),gv={},vv={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function yv(e,t){return b(),I("svg",vv,[...t[0]||(t[0]=[y("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 Wo=et(gv,[["render",yv]]),wv={},bv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function _v(e,t){return b(),I("svg",bv,[...t[0]||(t[0]=[y("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 hl=et(wv,[["render",_v]]),kv={},Tv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Sv(e,t){return b(),I("svg",Tv,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const Iv=et(kv,[["render",Sv]]),Ev={},Cv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Av(e,t){return b(),I("svg",Cv,[...t[0]||(t[0]=[y("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 xo=et(Ev,[["render",Av]]),Rv={},Pv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function xv(e,t){return b(),I("svg",Pv,[...t[0]||(t[0]=[y("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 Gi=et(Rv,[["render",xv]]),Mv={key:0,class:"sidebar-menu-row-left"},Ov={class:"sidebar-menu-row-main"},Nv={key:1,class:"sidebar-menu-row-right"},$v={key:0,class:"sidebar-menu-row-right-default"},Dv={key:1,class:"sidebar-menu-row-right-hover"},Lv=$t({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=Ap(),r=ue(()=>!!n.left),s=ue(()=>!!n.right),o=ue(()=>!!n["right-hover"]),i=ue(()=>s.value||o.value);return(a,l)=>(b(),ft(wa(t.as),Zd({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:gt(()=>[r.value?(b(),I("span",Mv,[Pn(a.$slots,"left",{},void 0,!0)])):re("",!0),y("span",Ov,[Pn(a.$slots,"default",{},void 0,!0)]),i.value?(b(),I("span",Nv,[s.value?(b(),I("span",$v,[Pn(a.$slots,"right",{},void 0,!0)])):re("",!0),o.value?(b(),I("span",Dv,[Pn(a.$slots,"right-hover",{},void 0,!0)])):re("",!0)])):re("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Mr=et(Lv,[["__scopeId","data-v-daeca4df"]]),jv={class:"thread-tree-root"},Bv={key:0,class:"pinned-section"},Uv={class:"thread-list"},Fv={class:"thread-left-stack"},Hv=["data-state"],Vv=["onClick"],Wv=["onClick"],zv={class:"thread-row-title-wrap"},qv={class:"thread-row-title"},Gv={class:"thread-row-time"},Kv=["onClick"],Jv=["onClick"],Yv=["onClick"],Xv=["onClick"],Qv=["aria-expanded"],Zv=["data-active"],ey={key:0},ty=["data-active"],ny={key:0},ry={key:1,class:"thread-tree-no-results"},sy={key:2,class:"thread-tree-loading"},oy={key:3,class:"thread-list thread-list-global"},iy={class:"thread-left-stack"},ay=["data-state"],ly=["onClick"],cy=["onClick"],uy={class:"thread-row-title-wrap"},dy={class:"thread-row-title"},fy={class:"thread-row-time"},hy=["onClick"],py=["onClick"],my=["onClick"],gy=["onClick"],vy=["data-project-name","data-expanded","data-dragging"],yy={class:"project-icon-stack"},wy={class:"project-icon-folder"},by={class:"project-icon-chevron"},_y=["data-dragging-handle","onMousedown"],ky={class:"project-title"},Ty={class:"project-hover-controls"},Sy=["onClick"],Iy=["onClick"],Ey=["onClick"],Cy=["onClick"],Ay=["onInput"],Ry=["aria-label","title","onClick"],Py={key:0,class:"thread-list"},xy={class:"thread-left-stack"},My=["data-state"],Oy=["onClick"],Ny=["onClick"],$y={class:"thread-row-title-wrap"},Dy={class:"thread-row-title"},Ly={class:"thread-row-time"},jy=["onClick"],By=["onClick"],Uy=["onClick"],Fy=["onClick"],Hy=["onClick"],Vy={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Wy=["onKeydown"],zy={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},qy={class:"rename-thread-subtitle"},Gy=4,Hc=6,Vc="codex-web-local.thread-view-mode.v1",Wc="codex-web-local.collapsed-projects.v1",Ky=$t({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project","export-thread"],setup(e,{emit:t}){const n=e,r=t,s=L({}),o=L({}),i=L([]),a=L(""),l=L(""),d=L("actions"),u=L(""),p=L(!1),g=L(""),T=L(""),j=L(null),R=L(!1),B=L(""),N=L(""),P=L(null),D=L(null),H=L(null);let oe=null,ae=null;const pe=L(""),Te=L({}),ce=new Map,te=new Map,ie=new Map,Y=new WeakMap,Ae=L(null),Se=L(!1),Me=L(me()),Re=typeof window<"u"?new ResizeObserver(A=>{for(const O of A){const $=O.target,Q=Y.get($);Q&&S(Q,$)}}):null;function Oe(){if(typeof window>"u")return{};try{const A=window.localStorage.getItem(Wc);if(!A)return{};const O=JSON.parse(A);return!O||typeof O!="object"||Array.isArray(O)?{}:O}catch{return{}}}function me(){return typeof window>"u"?"project":window.localStorage.getItem(Vc)==="chronological"?"chronological":"project"}o.value=Oe(),ht(o,A=>{typeof window>"u"||window.localStorage.setItem(Wc,JSON.stringify(A))},{deep:!0}),ht(Me,A=>{typeof window>"u"||window.localStorage.setItem(Vc,A)});const at=ue(()=>n.searchQuery.trim().toLowerCase()),Ye=ue(()=>at.value.length>0),Xe=ue(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function We(A){if(!Ye.value)return!0;if(Xe.value)return Xe.value.has(A.id);const O=at.value;return A.title.toLowerCase().includes(O)||A.preview.toLowerCase().includes(O)}const Qe=ue(()=>Ye.value?n.groups.map(A=>({...A,threads:A.threads.filter(We)})).filter(A=>A.threads.length>0):n.groups),tt=ue(()=>Me.value==="chronological"),je=ue(()=>{const A=Qe.value,O=[];for(const $ of A)for(const Q of $.threads)k(Q.id)||O.push(Q);return O.sort(($,Q)=>{const Fe=new Date($.updatedAtIso||$.createdAtIso).getTime();return new Date(Q.updatedAtIso||Q.createdAtIso).getTime()-Fe})}),ze=ue(()=>{const A=new Map;for(const O of n.groups)for(const $ of O.threads)A.set($.id,$);return A}),V=ue(()=>i.value.map(A=>ze.value.get(A)??null).filter(A=>A!==null).filter(We)),ne=ue(()=>{const A=H.value;if(!A||A.dropTargetIndexFull===null||n.groups.length===0)return null;const O=Math.max(0,Math.min(A.dropTargetIndexFull,n.groups.length)),$=O>A.fromIndex?O-1:O,Q=Math.max(0,Math.min($,n.groups.length-1));return Q===A.fromIndex?null:Q}),le=ue(()=>{const O=(Ye.value?Qe.value:n.groups).map(an=>an.projectName),$=H.value,Q=ne.value;if(!$||Q===null)return O;const Fe=[...O],[Rt]=Fe.splice($.fromIndex,1);return Rt?(Fe.splice(Q,0,Rt),Fe):O}),we=ue(()=>{const A={};let O=0;for(const $ of le.value)A[$]=O,O+=nn($);return A}),$e=ue(()=>{let A=0;for(const O of le.value)A+=nn(O);return{height:`${Math.max(0,A)}px`}});function w(A){const O=new Date(A).getTime();if(Number.isNaN(O))return"n/a";const $=Math.abs(Date.now()-O);if($<6e4)return"now";const Q=Math.floor($/6e4);if(Q<60)return`${Q}m`;const Fe=Math.floor(Q/60);return Fe<24?`${Fe}h`:`${Math.floor(Fe/24)}d`}function k(A){return i.value.includes(A)}function M(A){if(k(A)){i.value=i.value.filter(O=>O!==A);return}i.value=[A,...i.value]}function W(A){r("select",A)}function F(A){r("export-thread",A),G()}function x(A){return`start new thread ${Je(A)}`}function U(A){r("start-new-thread",A)}function q(A){l.value===A&&G()}function K(A){return l.value===A}function G(){l.value=""}function ge(A){if(l.value===A){G();return}l.value=A}function fe(A,O){g.value=A,T.value=O,p.value=!0,G(),qt(()=>{var $,Q;($=j.value)==null||$.focus(),(Q=j.value)==null||Q.select()})}function be(){p.value=!1,g.value="",T.value=""}function Ee(){const A=g.value,O=T.value.trim();!A||!O||(r("rename-thread",{threadId:A,title:O}),be())}function Ne(A,O){B.value=A,N.value=O,R.value=!0,G()}function Ve(){R.value=!1,B.value="",N.value=""}function Ue(){const A=B.value;A&&(i.value=i.value.filter(O=>O!==A),r("archive",A),Ve())}function Je(A){return n.projectDisplayNameById[A]??A}function vt(A){return a.value===A}function it(){a.value="",d.value="actions",u.value=""}function kt(){Se.value=!Se.value}function Et(A){Me.value=A,Se.value=!1}function mt(A){if(a.value===A){it();return}a.value=A,d.value="actions",u.value=Je(A)}function yt(A){a.value=A,d.value="rename",u.value=Je(A)}function qe(A){r("rename-project",{projectName:A,displayName:u.value})}function nt(A){r("remove-project",A),it()}function Bt(A){r("browse-project-files",A),it()}function Pt(A,O){if(!A.altKey||A.key!=="ArrowUp"&&A.key!=="ArrowDown")return;const $=n.groups.findIndex(Rt=>Rt.projectName===O);if($<0)return;const Q=A.key==="ArrowUp"?-1:1,Fe=Math.max(0,Math.min($+Q,n.groups.length-1));Fe!==$&&(A.preventDefault(),r("reorder-project",{projectName:O,toIndex:Fe}))}function Kt(A){return s.value[A]===!0}function At(A){return o.value[A]===!0}function on(A){s.value={...s.value,[A]:!Kt(A)}}function Ut(A){if(pe.value===A){pe.value="";return}o.value={...o.value,[A]:!At(A)}}function nn(A){const O=Te.value[A]??0,$=H.value,Fe=(($==null?void 0:$.projectName)===A?$.groupHeight:null)??O,Rt=At(A)?0:Hc;return Math.max(0,Fe+Rt)}function Dt(A,O){const $=O instanceof HTMLElement?O:O&&"$el"in O&&O.$el instanceof HTMLElement?O.$el:null;if($){te.set(A,$);return}te.delete(A)}function Ce(A,O){const $=O instanceof HTMLElement?O:O&&"$el"in O&&O.$el instanceof HTMLElement?O.$el:null;if($){ie.set(A,$);return}ie.delete(A)}function Pe(A){const O=a.value;if(!O)return!1;const $=te.get(O);if(!$)return!1;if((typeof A.composedPath=="function"?A.composedPath():[]).includes($))return!0;const Fe=A.target;return Fe instanceof Node?$.contains(Fe):!1}function rn(A){const O=l.value;if(!O)return!1;const $=ie.get(O);if(!$)return!1;if((typeof A.composedPath=="function"?A.composedPath():[]).includes($))return!0;const Fe=A.target;return Fe instanceof Node?$.contains(Fe):!1}function hn(A){if(Se.value){const O=Ae.value,$=typeof A.composedPath=="function"?A.composedPath():[];!!O&&($.includes(O)||A.target instanceof Node&&O.contains(A.target))||(Se.value=!1)}a.value&&(Pe(A)||it(),l.value&&(rn(A)||G()))}function pn(A){a.value&&!Pe(A)&&it(),l.value&&!rn(A)&&G()}function _(){Se.value&&(Se.value=!1),a.value&&it(),l.value&&G()}function f(){window.addEventListener("pointerdown",hn,{capture:!0}),window.addEventListener("focusin",pn,{capture:!0}),window.addEventListener("blur",_)}function m(){window.removeEventListener("pointerdown",hn,{capture:!0}),window.removeEventListener("focusin",pn,{capture:!0}),window.removeEventListener("blur",_)}function S(A,O){const $=O.getBoundingClientRect().height;if(!Number.isFinite($)||$<=0)return;const Q=Te.value[A];Q!==void 0&&Math.abs(Q-$)<.5||(Te.value={...Te.value,[A]:$})}function J(A,O){const $=ce.get(A);$&&$!==O&&Re&&Re.unobserve($);const Q=O instanceof HTMLElement?O:O&&"$el"in O&&O.$el instanceof HTMLElement?O.$el:null;if(Q){ce.set(A,Q),Y.set(Q,A),S(A,Q),Re==null||Re.observe(Q);return}$&&(Re==null||Re.unobserve($)),ce.delete(A)}function ee(A,O){if(A.button!==0||D.value||H.value)return;const $=n.groups.findIndex(an=>an.projectName===O),Q=ce.get(O);if($<0||!Q)return;const Fe=Q.getBoundingClientRect(),Rt=At(O)?0:Hc;D.value={projectName:O,fromIndex:$,startClientX:A.clientX,startClientY:A.clientY,pointerOffsetY:A.clientY-Fe.top,groupLeft:Fe.left,groupWidth:Fe.width,groupHeight:Fe.height,groupOuterHeight:Fe.height+Rt},A.preventDefault(),_e()}function _e(){window.addEventListener("mousemove",De),window.addEventListener("mouseup",Ze),window.addEventListener("keydown",ct)}function de(){window.removeEventListener("mousemove",De),window.removeEventListener("mouseup",Ze),window.removeEventListener("keydown",ct)}function De(A){oe={clientX:A.clientX,clientY:A.clientY},Mt()}function Ze(A){Nn({clientX:A.clientX,clientY:A.clientY});const O=H.value;if(O&&ne.value!==null){const $=n.groups.findIndex(Q=>Q.projectName===O.projectName);if($>=0){const Q=ne.value;Q!==$&&r("reorder-project",{projectName:O.projectName,toIndex:Q})}}xt()}function ct(A){A.key==="Escape"&&(!D.value&&!H.value||(A.preventDefault(),xt()))}function xt(){ae!==null&&(window.cancelAnimationFrame(ae),ae=null),oe=null,D.value=null,H.value=null,pe.value="",de()}function Mt(){ae===null&&(ae=window.requestAnimationFrame(()=>{if(ae=null,!oe)return;const A=oe;oe=null,Nn(A)}))}function Nn(A){const O=D.value;if(!H.value&&O){const $=A.clientX-O.startClientX,Q=A.clientY-O.startClientY;if(Math.hypot($,Q)<Gy)return;it(),pe.value=O.projectName,H.value={projectName:O.projectName,fromIndex:O.fromIndex,pointerOffsetY:O.pointerOffsetY,groupLeft:O.groupLeft,groupWidth:O.groupWidth,groupHeight:O.groupHeight,groupOuterHeight:O.groupOuterHeight,ghostTop:A.clientY-O.pointerOffsetY,dropTargetIndexFull:null}}H.value&&Wr(A)}function Wr(A){const O=H.value;if(!O)return;if(O.ghostTop=A.clientY-O.pointerOffsetY,!bs(A)){O.dropTargetIndexFull=null;return}const $=A.clientY,Q=P.value;if(!Q){O.dropTargetIndexFull=null;return}const Fe=Q.getBoundingClientRect(),Rt=new Map(n.groups.map((Jt,$n)=>[Jt.projectName,$n])),an=n.groups.map(Jt=>Jt.projectName).filter(Jt=>Jt!==O.projectName);let qr=0,ar=n.groups.length;for(const Jt of an){const $n=Rt.get(Jt);if($n===void 0)continue;const Gr=nn(Jt),Er=Fe.top+qr+Gr/2;if($<Er){ar=$n;break}qr+=Gr}O.dropTargetIndexFull=ar}function bs(A){const O=P.value;if(!O)return!1;const $=O.getBoundingClientRect(),Q=A.clientX>=$.left&&A.clientX<=$.right,Fe=A.clientY>=$.top-32&&A.clientY<=$.bottom+32;return Q&&Fe}function zr(A){var O;return((O=H.value)==null?void 0:O.projectName)===A}function _s(A){const O=H.value,$=we.value[A]??0,Q=a.value===A;return!O||O.projectName!==A?{position:"absolute",top:"0",left:"0",right:"0",zIndex:Q?"40":"1",transform:`translate3d(0, ${$}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${O.groupLeft}px`,width:`${O.groupWidth}px`,height:`${O.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${O.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function sr(A){return A.threads.filter(O=>!k(O.id))}function ks(A){if(Ye.value)return sr(A);if(At(A.projectName))return[];const O=sr(A);return Kt(A.projectName)?O:O.slice(0,10)}function Ts(A){return Ye.value?!1:!At(A.projectName)&&sr(A).length>10}function or(A){return sr(A).length>0}function ir(A){return A.inProgress?"working":A.unread?"unread":"idle"}ht(()=>n.groups.map(A=>A.projectName),A=>{var Fe,Rt;const O=((Fe=H.value)==null?void 0:Fe.projectName)??((Rt=D.value)==null?void 0:Rt.projectName)??"";O&&!n.groups.some(an=>an.projectName===O)&&xt();const $=new Set(A),Q=Object.fromEntries(Object.entries(Te.value).filter(([an])=>$.has(an)));Object.keys(Q).length!==Object.keys(Te.value).length&&(Te.value=Q)});const Ss=ue(()=>Se.value||a.value!=="");return ht(Ss,A=>{if(A){f();return}m()}),rr(()=>{for(const A of ce.values())Re==null||Re.unobserve(A);ce.clear(),te.clear(),m(),xt()}),(A,O)=>(b(),I("section",jv,[V.value.length>0?(b(),I("section",Bv,[y("ul",Uv,[(b(!0),I(Le,null,bt(V.value,$=>(b(),I("li",{key:$.id,class:"thread-row-item"},[Ie(Mr,{class:"thread-row","data-active":$.id===e.selectedThreadId,"data-pinned":k($.id),onMouseleave:Q=>q($.id)},{left:gt(()=>[y("span",Fv,[$.inProgress||$.unread?(b(),I("span",{key:0,class:"thread-status-indicator","data-state":ir($)},null,8,Hv)):re("",!0),y("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Q=>M($.id)},[Ie(Gi,{class:"thread-icon"})],8,Vv)])]),right:gt(()=>[y("span",Gv,se(w($.createdAtIso||$.updatedAtIso)),1)]),"right-hover":gt(()=>[y("div",{ref_for:!0,ref:Q=>Ce($.id,Q),class:"thread-menu-wrap"},[y("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:st(Q=>ge($.id),["stop"])},[Ie(xs,{class:"thread-icon"})],8,Kv),K($.id)?(b(),I("div",{key:0,class:"thread-menu-panel",onClick:O[0]||(O[0]=st(()=>{},["stop"]))},[y("button",{class:"thread-menu-item",type:"button",onClick:Q=>F($.id)}," Export chat ",8,Jv),y("button",{class:"thread-menu-item",type:"button",onClick:Q=>fe($.id,$.title)}," Rename thread ",8,Yv),y("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Q=>Ne($.id,$.title)}," Delete thread ",8,Xv)])):re("",!0)],512)]),default:gt(()=>[y("button",{class:"thread-main-button",type:"button",onClick:Q=>W($.id)},[y("span",zv,[y("span",qv,se($.title),1),$.hasWorktree?(b(),ft(xo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):re("",!0)])],8,Wv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):re("",!0),Ie(Mr,{as:"header",class:"thread-tree-header-row"},{right:gt(()=>[y("div",{ref_key:"organizeMenuWrapRef",ref:Ae,class:"organize-menu-wrap"},[y("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Se.value,"aria-label":"Organize threads",title:"Organize threads",onClick:kt},[Ie(xs,{class:"thread-icon"})],8,Qv),Se.value?(b(),I("div",{key:0,class:"organize-menu-panel",onClick:O[3]||(O[3]=st(()=>{},["stop"]))},[O[11]||(O[11]=y("p",{class:"organize-menu-title"},"Organize",-1)),y("button",{class:"organize-menu-item","data-active":Me.value==="project",type:"button",onClick:O[1]||(O[1]=$=>Et("project"))},[O[9]||(O[9]=y("span",null,"By project",-1)),Me.value==="project"?(b(),I("span",ey,"✓")):re("",!0)],8,Zv),y("button",{class:"organize-menu-item","data-active":Me.value==="chronological",type:"button",onClick:O[2]||(O[2]=$=>Et("chronological"))},[O[10]||(O[10]=y("span",null,"Chronological list",-1)),Me.value==="chronological"?(b(),I("span",ny,"✓")):re("",!0)],8,ty)])):re("",!0)],512)]),default:gt(()=>[O[12]||(O[12]=y("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Ye.value&&Qe.value.length===0?(b(),I("p",ry,"No matching threads")):e.isLoading&&e.groups.length===0?(b(),I("p",sy,"Loading threads...")):tt.value?(b(),I("ul",oy,[(b(!0),I(Le,null,bt(je.value,$=>(b(),I("li",{key:$.id,class:"thread-row-item"},[Ie(Mr,{class:"thread-row","data-active":$.id===e.selectedThreadId,"data-pinned":k($.id),onMouseleave:Q=>q($.id)},{left:gt(()=>[y("span",iy,[$.inProgress||$.unread?(b(),I("span",{key:0,class:"thread-status-indicator","data-state":ir($)},null,8,ay)):re("",!0),y("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Q=>M($.id)},[Ie(Gi,{class:"thread-icon"})],8,ly)])]),right:gt(()=>[y("span",fy,se(w($.createdAtIso||$.updatedAtIso)),1)]),"right-hover":gt(()=>[y("div",{ref_for:!0,ref:Q=>Ce($.id,Q),class:"thread-menu-wrap"},[y("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:st(Q=>ge($.id),["stop"])},[Ie(xs,{class:"thread-icon"})],8,hy),K($.id)?(b(),I("div",{key:0,class:"thread-menu-panel",onClick:O[4]||(O[4]=st(()=>{},["stop"]))},[y("button",{class:"thread-menu-item",type:"button",onClick:Q=>F($.id)}," Export chat ",8,py),y("button",{class:"thread-menu-item",type:"button",onClick:Q=>fe($.id,$.title)}," Rename thread ",8,my),y("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Q=>Ne($.id,$.title)}," Delete thread ",8,gy)])):re("",!0)],512)]),default:gt(()=>[y("button",{class:"thread-main-button",type:"button",onClick:Q=>W($.id)},[y("span",uy,[y("span",dy,se($.title),1),$.hasWorktree?(b(),ft(xo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):re("",!0)])],8,cy)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(b(),I("div",{key:4,ref_key:"groupsContainerRef",ref:P,class:"thread-tree-groups",style:Hr($e.value)},[(b(!0),I(Le,null,bt(Qe.value,$=>(b(),I("article",{key:$.projectName,ref_for:!0,ref:Q=>J($.projectName,Q),class:"project-group","data-project-name":$.projectName,"data-expanded":!At($.projectName),"data-dragging":zr($.projectName),style:Hr(_s($.projectName))},[Ie(Mr,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:Q=>Ut($.projectName),onKeydown:[Q=>Pt(Q,$.projectName),Zt(st(Q=>Ut($.projectName),["prevent"]),["enter"]),Zt(st(Q=>Ut($.projectName),["prevent"]),["space"])]},{left:gt(()=>[y("span",yy,[y("span",wy,[At($.projectName)?(b(),ft(hl,{key:0,class:"thread-icon"})):(b(),ft(Iv,{key:1,class:"thread-icon"}))]),y("span",by,[At($.projectName)?(b(),ft(bf,{key:0,class:"thread-icon"})):(b(),ft(pi,{key:1,class:"thread-icon"}))])])]),right:gt(()=>[y("div",Ty,[y("div",{ref_for:!0,ref:Q=>Dt($.projectName,Q),class:"project-menu-wrap"},[y("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:st(Q=>mt($.projectName),["stop"])},[Ie(xs,{class:"thread-icon"})],8,Sy),vt($.projectName)?(b(),I("div",{key:0,class:"project-menu-panel",onClick:O[6]||(O[6]=st(()=>{},["stop"]))},[d.value==="actions"?(b(),I(Le,{key:0},[y("button",{class:"project-menu-item",type:"button",onClick:Q=>Bt($.projectName)}," Browse files ",8,Iy),y("button",{class:"project-menu-item",type:"button",onClick:Q=>yt($.projectName)}," Edit name ",8,Ey),y("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:Q=>nt($.projectName)}," Remove ",8,Cy)],64)):(b(),I(Le,{key:1},[O[13]||(O[13]=y("label",{class:"project-menu-label"},"Project name",-1)),Xn(y("input",{"onUpdate:modelValue":O[5]||(O[5]=Q=>u.value=Q),class:"project-menu-input",type:"text",onInput:Q=>qe($.projectName)},null,40,Ay),[[Qn,u.value]])],64))])):re("",!0)],512),y("button",{class:"thread-start-button",type:"button","aria-label":x($.projectName),title:x($.projectName),onClick:st(Q=>U($.projectName),["stop"])},[Ie(Wo,{class:"thread-icon"})],8,Ry)])]),default:gt(()=>[y("span",{class:"project-main-button","data-dragging-handle":zr($.projectName),onMousedown:st(Q=>ee(Q,$.projectName),["left"])},[y("span",ky,se(Je($.projectName)),1)],40,_y)]),_:2},1032,["onClick","onKeydown"]),or($)?(b(),I("ul",Py,[(b(!0),I(Le,null,bt(ks($),Q=>(b(),I("li",{key:Q.id,class:"thread-row-item"},[Ie(Mr,{class:"thread-row","data-active":Q.id===e.selectedThreadId,"data-pinned":k(Q.id),onMouseleave:Fe=>q(Q.id)},{left:gt(()=>[y("span",xy,[Q.inProgress||Q.unread?(b(),I("span",{key:0,class:"thread-status-indicator","data-state":ir(Q)},null,8,My)):re("",!0),y("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Fe=>M(Q.id)},[Ie(Gi,{class:"thread-icon"})],8,Oy)])]),right:gt(()=>[y("span",Ly,se(w(Q.createdAtIso||Q.updatedAtIso)),1)]),"right-hover":gt(()=>[y("div",{ref_for:!0,ref:Fe=>Ce(Q.id,Fe),class:"thread-menu-wrap"},[y("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:st(Fe=>ge(Q.id),["stop"])},[Ie(xs,{class:"thread-icon"})],8,jy),K(Q.id)?(b(),I("div",{key:0,class:"thread-menu-panel",onClick:O[7]||(O[7]=st(()=>{},["stop"]))},[y("button",{class:"thread-menu-item",type:"button",onClick:Fe=>F(Q.id)}," Export chat ",8,By),y("button",{class:"thread-menu-item",type:"button",onClick:Fe=>fe(Q.id,Q.title)}," Rename thread ",8,Uy),y("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Fe=>Ne(Q.id,Q.title)}," Delete thread ",8,Fy)])):re("",!0)],512)]),default:gt(()=>[y("button",{class:"thread-main-button",type:"button",onClick:Fe=>W(Q.id)},[y("span",$y,[y("span",Dy,se(Q.title),1),Q.hasWorktree?(b(),ft(xo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):re("",!0)])],8,Ny)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(b(),ft(Mr,{key:1,as:"p",class:"project-empty-row"},{left:gt(()=>[...O[14]||(O[14]=[y("span",{class:"project-empty-spacer"},null,-1)])]),default:gt(()=>[O[15]||(O[15]=y("span",{class:"project-empty"},"No threads",-1))]),_:1})),Ts($)?(b(),ft(Mr,{key:2,class:"thread-show-more-row"},{left:gt(()=>[...O[16]||(O[16]=[y("span",{class:"thread-show-more-spacer"},null,-1)])]),default:gt(()=>[y("button",{class:"thread-show-more-button",type:"button",onClick:Q=>on($.projectName)},se(Kt($.projectName)?"Show less":"Show more"),9,Hy)]),_:2},1024)):re("",!0)],12,vy))),128))],4)),(b(),ft(Bo,{to:"body"},[p.value?(b(),I("div",{key:0,class:"rename-thread-overlay",onClick:st(be,["self"])},[y("div",Vy,[O[17]||(O[17]=y("h3",{class:"rename-thread-title"},"Rename thread",-1)),O[18]||(O[18]=y("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Xn(y("input",{ref_key:"renameThreadInputRef",ref:j,"onUpdate:modelValue":O[8]||(O[8]=$=>T.value=$),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Zt(st(Ee,["prevent"]),["enter"]),Zt(st(be,["prevent"]),["esc"])]},null,40,Wy),[[Qn,T.value]]),y("div",{class:"rename-thread-actions"},[y("button",{class:"rename-thread-button",type:"button",onClick:be},"Cancel"),y("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Ee},"Save")])])])):re("",!0)])),(b(),ft(Bo,{to:"body"},[R.value?(b(),I("div",{key:0,class:"rename-thread-overlay",onClick:st(Ve,["self"])},[y("div",zy,[O[19]||(O[19]=y("h3",{class:"rename-thread-title"},"Delete thread?",-1)),y("p",qy,' This will archive the thread "'+se(N.value)+'". You can find it later in archived threads. ',1),y("div",{class:"rename-thread-actions"},[y("button",{class:"rename-thread-button",type:"button",onClick:Ve},"Cancel"),y("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Ue},"Delete")])])])):re("",!0)]))]))}}),Jy=et(Ky,[["__scopeId","data-v-e2f8a8e1"]]),Yy={class:"content-header"},Xy={class:"content-leading"},Qy={class:"content-title"},Zy={class:"content-actions"},ew=$t({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(b(),I("header",Yy,[y("div",Xy,[Pn(t.$slots,"leading",{},void 0)]),y("h1",Qy,se(e.title),1),y("div",Zy,[Pn(t.$slots,"actions",{},void 0)])]))}}),tw=et(ew,[["__scopeId","data-v-66ee223c"]]),nw={},rw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function sw(e,t){return b(),I("svg",rw,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const pl=et(nw,[["render",sw]]),ow={},iw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function aw(e,t){return b(),I("svg",iw,[...t[0]||(t[0]=[y("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 lw=et(ow,[["render",aw]]),cw={},uw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function dw(e,t){return b(),I("svg",uw,[...t[0]||(t[0]=[y("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 fw=et(cw,[["render",dw]]),hw={class:"conversation-root"},pw={key:0,class:"conversation-loading"},mw={key:1,class:"conversation-empty"},gw={class:"message-row"},vw={class:"message-stack"},yw={class:"request-card"},ww={class:"request-title"},bw={class:"request-meta"},_w={key:0,class:"request-reason"},kw={key:1,class:"request-actions"},Tw=["onClick"],Sw=["onClick"],Iw=["onClick"],Ew=["onClick"],Cw={key:2,class:"request-actions"},Aw=["onClick"],Rw=["onClick"],Pw=["onClick"],xw=["onClick"],Mw={key:3,class:"request-user-input"},Ow={class:"request-question-title"},Nw={key:0,class:"request-question-text"},$w=["value","onChange"],Dw=["value"],Lw=["value","onInput"],jw=["onClick"],Bw={key:4,class:"request-actions"},Uw=["onClick"],Fw=["onClick"],Hw={key:5,class:"request-actions"},Vw=["onClick"],Ww=["onClick"],zw=["data-role","data-message-type"],qw={key:0,class:"message-row","data-role":"system"},Gw={class:"message-stack","data-role":"system"},Kw=["onClick"],Jw={class:"cmd-label"},Yw={class:"cmd-status"},Xw={class:"cmd-output-inner"},Qw={class:"cmd-output"},Zw=["data-role","data-message-type"],eb=["data-role"],tb=["data-role"],nb=["data-role"],rb=["onClick"],sb=["src"],ob={key:1,class:"message-file-attachments"},ib={class:"message-file-link-wrap"},ab=["href","title"],lb=["href","title"],cb=["data-role"],ub={key:0,class:"worked-separator-wrap","aria-live":"polite"},db=["onClick"],fb={class:"worked-separator-text"},hb={key:0,class:"worked-details"},pb=["onClick"],mb={class:"cmd-label"},gb={class:"cmd-status"},vb={class:"cmd-output-inner"},yb={class:"cmd-output"},wb={key:1,class:"message-text-flow"},bb={key:0,class:"message-text"},_b={key:0},kb={key:1,class:"message-bold-text"},Tb={key:2,class:"message-file-link-wrap"},Sb=["href","title"],Ib=["href","title"],Eb=["href","title"],Cb={key:4,class:"message-inline-code"},Ab={key:1,class:"message-text"},Rb=["onClick"],Pb=["src","alt","onError"],xb={key:0,class:"message-actions"},Mb=["onClick"],Ob=["onClick"],Nb={key:0,class:"conversation-item conversation-item-overlay"},$b={class:"message-row"},Db={class:"message-stack"},Lb={class:"live-overlay-inline","aria-live":"polite"},jb={class:"live-overlay-label"},Bb={key:1,class:"live-overlay-error"},Ub=["src"],Fb=16,Hb=$t({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=L(new Set),r=L(new Set),s=L(new Set),o=L({});function i(_){return _.messageType==="commandExecution"&&!!_.commandExecution}function a(_){var f;return((f=_.commandExecution)==null?void 0:f.status)==="inProgress"||r.value.has(_.id)?!0:n.value.has(_.id)}function l(_){return r.value.has(_.id)}function d(_){var m;if(((m=_.commandExecution)==null?void 0:m.status)==="inProgress")return;const f=new Set(n.value);f.has(_.id)?f.delete(_.id):f.add(_.id),n.value=f}function u(_){const f=new Set(s.value);f.has(_.id)?f.delete(_.id):f.add(_.id),s.value=f}function p(_){return s.value.has(_.id)}function g(_){const f=_.commandExecution;if(!f)return"";switch(f.status){case"inProgress":return"⟳ Running";case"completed":return f.exitCode===0?"✓ Completed":`✗ Exit ${f.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function T(_){var m,S;const f=(m=_.commandExecution)==null?void 0:m.status;return f==="inProgress"?"cmd-status-running":f==="completed"&&((S=_.commandExecution)==null?void 0:S.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function j(_){const f=new Set(r.value);f.add(_),r.value=f,setTimeout(()=>{const m=new Set(r.value);m.delete(_),r.value=m},1e3)}function R(_,f){const m=[];for(let S=f-1;S>=0;S--){const J=_[S];if(J.messageType==="commandExecution")m.unshift(J);else if(J.role==="user"||J.messageType==="worked")break}return m}const B=e,N=t,P=L(null),D=L(null),H=L(null),oe=L(""),ae=L({}),pe=L({});let Te=0,ce=0,te=0;const ie=new WeakSet,Y=L(new Set);function Ae(_){if(!_||_.endsWith("/")||_.endsWith("\\"))return!1;if(_.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(_))return!1;const f=_.startsWith("/"),m=/^[A-Za-z]:[\\/]/u.test(_),S=_.startsWith("./")||_.startsWith("../")||_.startsWith("~/"),J=_.includes("/")||_.includes("\\");return f||m||S||J}function Se(_){return _.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||_}function Me(_){return _.replace(/\\/gu,"/")}function Re(_){if(!_.startsWith("file://"))return _;let f=_.replace(/^file:\/\//u,"");try{f=decodeURIComponent(f)}catch{}return/^\/[A-Za-z]:\//u.test(f)&&(f=f.slice(1)),f}function Oe(_){const f=Me(_),m=f.match(/^\/Users\/([^/]+)/u);if(m)return`/Users/${m[1]}`;const S=f.match(/^\/home\/([^/]+)/u);return S?`/home/${S[1]}`:""}function me(_){const f=Me(_);if(!f)return f;let m="",S=f;const J=S.match(/^([A-Za-z]:)(\/.*)?$/u);J?(m=`${J[1]}/`,S=(J[2]??"").replace(/^\/+/u,"")):S.startsWith("/")&&(m="/",S=S.slice(1));const ee=S.split("/").filter(Boolean),_e=[];for(const De of ee)if(De!=="."){if(De===".."){_e.length>0&&_e.pop();continue}_e.push(De)}const de=_e.join("/");return m?`${m}${de}`.replace(/\/+$/u,"")||m:de||f}function at(_,f){const m=Me(Re(_.trim()));if(!m)return"";if(m.startsWith("/")||/^[A-Za-z]:\//u.test(m))return me(m);if(m.startsWith("~/")){const ee=Oe(f);if(ee)return me(`${ee}/${m.slice(2)}`)}const J=Me(f.trim());return me(J?`${J.replace(/\/+$/u,"")}/${m}`:m)}function Ye(_){if(!_)return null;let f=_.trim();f=Xe(f).core.trim();let S=null;const J=f.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(J)f=J[1],S=Number(J[2]);else{const ee=f.match(/^(.*):(\d+)(?::\d+)?$/u);ee&&(f=ee[1],S=Number(ee[2]))}return f=Re(f),Ae(f)?{path:f,line:S}:null}function Xe(_){let f=_,m="",S="";for(;/^['"`“‘]/u.test(f);)m+=f[0],f=f.slice(1);for(;/['"`”’]$/u.test(f);)S=f.slice(-1)+S,f=f.slice(0,-1);return{core:f,leading:m,trailing:S}}function We(_){const f=_.trim(),m=Qe(f,0);if(!m||m.end!==f.length)return null;const S=m.label.trim(),J=m.target.trim(),ee=Xe(S).core.trim()||S,_e=Xe(J).core.trim();return _e?{label:ee,target:_e}:null}function Qe(_,f){if(_[f]!=="[")return null;const m=_.indexOf("](",f+1);if(m<0)return null;const S=_.slice(f+1,m);if(!S||S.includes(`
26
+ `))return null;let J=m+2,ee=1;for(;J<_.length;){const _e=_[J];if(_e===`
27
+ `)return null;if(_e==="(")ee+=1;else if(_e===")"&&(ee-=1,ee===0)){const de=_.slice(m+2,J);return de.trim()?{label:S,target:de,end:J+1}:null}J+=1}return null}function tt(_){const f=[],m=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let S=0;for(const J of _.matchAll(m)){if(typeof J.index!="number")continue;const ee=J.index,_e=ee+J[0].length;ee>S&&f.push({kind:"text",value:_.slice(S,ee)});let de=J[0],De="";for(;/[.,;:]$/u.test(de);)De=de.slice(-1)+De,de=de.slice(0,-1);const Ze=Xe(de);de=Ze.core;const ct=Ze.leading,xt=Ze.trailing+De;if(ct&&f.push({kind:"text",value:ct}),de.startsWith("**")&&de.endsWith("**")&&de.length>4)f.push({kind:"bold",value:de.slice(2,-2)}),xt&&f.push({kind:"text",value:xt});else if(/^https?:\/\//u.test(de))f.push({kind:"url",value:de,href:de}),xt&&f.push({kind:"text",value:xt});else{const Mt=Ye(de);Mt?(f.push({kind:"file",value:de,path:Mt.path,displayPath:de,downloadName:Se(Mt.path)}),xt&&f.push({kind:"text",value:xt})):f.push({kind:"text",value:J[0]})}S=_e}return S<_.length&&f.push({kind:"text",value:_.slice(S)}),je(f)}function je(_){const f=[];let m=!1,S="";const J=ee=>{ee&&f.push({kind:"text",value:ee})};for(const ee of _){if(ee.kind!=="text"){m&&(J(`**${S}`),m=!1,S=""),f.push(ee);continue}let _e=ee.value;for(;_e.length>0;){const de=_e.indexOf("**");if(de<0){m?S+=_e:J(_e);break}const De=_e.slice(0,de);m?S+=De:J(De),_e=_e.slice(de+2),m?(S.length>0?f.push({kind:"bold",value:S}):J("****"),S="",m=!1):m=!0}}return m&&J(`**${S}`),f}function ze(_){const f=[];let m=0;for(;m<_.length;){const S=_.indexOf("[",m);if(S<0)break;const J=Qe(_,S);if(!J){m=S+1;continue}S>m&&f.push(...tt(_.slice(m,S)));const ee=Xe(J.label.trim()).core.trim()||J.label.trim(),_e=Xe(J.target.trim()).core.trim();if(/^https?:\/\//u.test(_e))f.push({kind:"url",value:ee||_e,href:_e});else{const de=Ye(_e);de?f.push({kind:"file",value:_e,path:de.path,displayPath:ee||_e,downloadName:Se(de.path)}):f.push({kind:"text",value:_.slice(S,J.end)})}m=J.end}return m<_.length&&f.push(...tt(_.slice(m))),f}function V(_){if(!_.includes("`"))return ze(_);const f=[];let m=0,S=0;for(;m<_.length;){if(_[m]!=="`"){m+=1;continue}let J=1;for(;m+J<_.length&&_[m+J]==="`";)J+=1;const ee="`".repeat(J);let _e=m+J,de=-1;for(;_e<_.length;){const Ze=_.indexOf(ee,_e);if(Ze<0)break;const ct=Ze>0&&_[Ze-1]==="`",xt=Ze+J<_.length&&_[Ze+J]==="`",Mt=_.slice(m+J,Ze).includes(`
28
+ `);if(!ct&&!xt&&!Mt){de=Ze;break}_e=Ze+1}if(de<0){m+=J;continue}m>S&&f.push(...ze(_.slice(S,m)));const De=_.slice(m+J,de);if(De.length>0){const Ze=We(De);if(Ze)if(/^https?:\/\//u.test(Ze.target))f.push({kind:"url",value:Ze.label||Ze.target,href:Ze.target});else{const ct=Ye(Ze.target);ct?f.push({kind:"file",value:Ze.target,path:ct.path,displayPath:Ze.label||Ze.target,downloadName:Se(ct.path)}):f.push({kind:"code",value:De})}else{const ct=Ye(De);if(ct){const xt=ct.line?`${ct.path}:${String(ct.line)}`:ct.path;f.push({kind:"file",value:De,path:ct.path,displayPath:xt,downloadName:Se(ct.path)})}else f.push({kind:"code",value:De})}}else f.push({kind:"text",value:`${ee}${ee}`});m=de+J,S=m}return S<_.length&&f.push(...ze(_.slice(S))),f}function ne(_){const f=_.trim();if(!f)return"";if(f.startsWith("data:")||f.startsWith("blob:")||f.startsWith("http://")||f.startsWith("https://")||f.startsWith("/codex-local-image?"))return f;if(f.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(f)}`;const m=f.startsWith("/"),S=/^[A-Za-z]:[\\/]/u.test(f);return m||S?`/codex-local-image?path=${encodeURIComponent(f)}`:f}function le(_){const f=_.trim();if(!f)return"#";const m=_e=>_e.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(_e),S=Ye(f),J=(S==null?void 0:S.path)??f,ee=at(J,B.cwd);if(m(ee)){const _e=ee.startsWith("/")?ee:`/${ee}`;return`/codex-local-browse${encodeURI(_e)}`}return"#"}function we(_){return $e(_)!=="#"}function $e(_){const f=_.trim();if(!f)return"#";const m=Ye(f),S=(m==null?void 0:m.path)??f,J=at(S,B.cwd);if(!(de=>de.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(de))(J))return"#";const _e=J.startsWith("/")?J:`/${J}`;return`/codex-local-edit${encodeURI(_e)}`}function w(_){if(!_.includes("![")||!_.includes("]("))return[{kind:"text",value:_}];const f=[],m=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let S=0;for(const J of _.matchAll(m)){const[ee,_e,de]=J;if(typeof J.index!="number")continue;const De=J.index,Ze=De+ee.length,ct=ne(de.trim());ct&&(De>S&&f.push({kind:"text",value:_.slice(S,De)}),f.push({kind:"image",url:ct,alt:_e.trim(),markdown:ee}),S=Ze)}return S<_.length&&f.push({kind:"text",value:_.slice(S)}),f.length>0?f:[{kind:"text",value:_}]}function k(_){return _!==null&&typeof _=="object"&&!Array.isArray(_)?_:null}function M(_){const f=new Date(_);return Number.isNaN(f.getTime())?_:f.toLocaleTimeString()}function W(_){const f=k(_.params),m=f==null?void 0:f.reason;return typeof m=="string"?m.trim():""}function F(_,f){return`${String(_)}:${f}`}function x(_){const f=k(_.params),m=Array.isArray(f==null?void 0:f.questions)?f.questions:[],S=[];for(const J of m){const ee=k(J);if(!ee)continue;const _e=typeof ee.id=="string"?ee.id:"";if(!_e)continue;const de=Array.isArray(ee.options)?ee.options.map(De=>k(De)).map(De=>De==null?void 0:De.label).filter(De=>typeof De=="string"&&De.length>0):[];S.push({id:_e,header:typeof ee.header=="string"?ee.header:"",question:typeof ee.question=="string"?ee.question:"",isOther:ee.isOther===!0,options:de})}return S}function U(_,f,m){const S=F(_,f),J=ae.value[S];return typeof J=="string"&&J.length>0?J:m}function q(_,f){const m=F(_,f);return pe.value[m]??""}function K(_,f,m){const S=m.target;if(!(S instanceof HTMLSelectElement))return;const J=F(_,f);ae.value={...ae.value,[J]:S.value}}function G(_,f,m){const S=m.target;if(!(S instanceof HTMLInputElement))return;const J=F(_,f);pe.value={...pe.value,[J]:S.value}}function ge(_,f){N("respondServerRequest",{id:_,result:{decision:f}})}function fe(_){const f=x(_),m={};for(const S of f){const J=U(_.id,S.id,S.options[0]||""),ee=q(_.id,S.id).trim(),_e=[J,ee].map(de=>de.trim()).filter(de=>de.length>0);m[S.id]={answers:_e}}N("respondServerRequest",{id:_.id,result:{answers:m}})}function be(_){N("respondServerRequest",{id:_,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function Ee(_){N("respondServerRequest",{id:_,result:{success:!0,contentItems:[]}})}function Ne(_){N("respondServerRequest",{id:_,result:{}})}function Ve(_){N("respondServerRequest",{id:_,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function Ue(_){return!(_.role!=="user"&&_.role!=="assistant"||typeof _.turnIndex!="number"||B.isTurnInProgress||B.isRollingBack)}function Je(_){return _.role!=="user"&&_.role!=="assistant"?!1:_.text.trim().length>0}function vt(_){return Je(_)||Ue(_)}async function it(_){if(!Je(_))return;const f=_.text.trim();try{await navigator.clipboard.writeText(f)}catch{const m=document.createElement("textarea");m.value=f,m.setAttribute("readonly","true"),m.style.position="fixed",m.style.opacity="0",document.body.appendChild(m),m.select(),document.execCommand("copy"),document.body.removeChild(m)}}function kt(_){if(!Ue(_))return;const f=_.role==="user"?_.text.trim():"";N("rollback",{turnIndex:_.turnIndex,prependText:f.length>0?f:void 0})}function Et(){const _=P.value,f=D.value;!_||!f||(_.scrollTop=_.scrollHeight,f.scrollIntoView({block:"end"}))}function mt(_){return _.scrollHeight-(_.scrollTop+_.clientHeight)<=Fb}function yt(_){if(!B.activeThreadId)return;const f=Math.max(_.scrollHeight-_.clientHeight,0),m=f>0?Math.min(Math.max(_.scrollTop/f,0),1):1;N("updateScrollState",{threadId:B.activeThreadId,state:{scrollTop:_.scrollTop,isAtBottom:mt(_),scrollRatio:m}})}function qe(){const _=P.value;if(!_)return;const f=B.scrollState;if(!f||f.isAtBottom){nt();return}const m=Math.max(_.scrollHeight-_.clientHeight,0),S=typeof f.scrollRatio=="number"?f.scrollRatio*m:f.scrollTop;_.scrollTop=Math.min(Math.max(S,0),m),yt(_)}function nt(){const _=P.value;_&&(Et(),yt(_))}function Bt(){const _=B.scrollState;return!_||_.isAtBottom===!0}function Pt(){if(!Bt()){te=0,ce=0;return}if(nt(),te-=1,te<=0){ce=0;return}ce=requestAnimationFrame(Pt)}function Kt(_=6){Bt()&&(ce&&(cancelAnimationFrame(ce),ce=0),te=Math.max(_,1),ce=requestAnimationFrame(Pt))}function At(){Kt(3)}function on(){if(!Bt())return;const _=P.value;if(!_)return;const f=_.querySelectorAll("img.message-image-preview");for(const m of f)m.complete||ie.has(m)||(ie.add(m),m.addEventListener("load",At,{once:!0}),m.addEventListener("error",At,{once:!0}))}async function Ut(){await qt(),Te&&cancelAnimationFrame(Te),Te=requestAnimationFrame(()=>{Te=0,qe(),on(),Kt()})}ht(()=>B.messages,async _=>{if(!B.isLoading){for(const f of _){if(f.messageType!=="commandExecution"||!f.commandExecution)continue;const m=o.value[f.id],S=f.commandExecution.status;m==="inProgress"&&S!=="inProgress"&&j(f.id),o.value[f.id]=S}await Ut()}}),ht(()=>B.liveOverlay,async _=>{_&&(await qt(),nt(),Kt(8))},{deep:!0}),ht(()=>B.isLoading,async _=>{_||await Ut()}),ht(()=>B.activeThreadId,()=>{oe.value="",Y.value=new Set},{flush:"post"});function nn(){const _=P.value;!_||B.isLoading||yt(_)}function Dt(_){oe.value=ne(_)}function Ce(_,f){return`${_}:${String(f)}`}function Pe(_,f){const m=new Set(Y.value);m.add(Ce(_,f)),Y.value=m}function rn(_,f){return Y.value.has(Ce(_,f))}function hn(){oe.value=""}function pn(){const _=H.value;_&&(_.scrollTop=_.scrollHeight)}return ht(()=>{var _;return(_=B.liveOverlay)==null?void 0:_.reasoningText},async _=>{_&&(await qt(),pn())}),rr(()=>{Te&&cancelAnimationFrame(Te),ce&&cancelAnimationFrame(ce)}),(_,f)=>(b(),I("section",hw,[e.isLoading?(b(),I("p",pw,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(b(),I("p",mw," No messages in this thread yet. ")):(b(),I("ul",{key:2,ref_key:"conversationListRef",ref:P,class:"conversation-list",onScroll:nn},[(b(!0),I(Le,null,bt(e.pendingRequests,m=>(b(),I("li",{key:`server-request:${m.id}`,class:"conversation-item conversation-item-request"},[y("div",gw,[y("div",vw,[y("article",yw,[y("p",ww,se(m.method),1),y("p",bw,"Request #"+se(m.id)+" · "+se(M(m.receivedAtIso)),1),W(m)?(b(),I("p",_w,se(W(m)),1)):re("",!0),m.method==="item/commandExecution/requestApproval"?(b(),I("section",kw,[y("button",{type:"button",class:"request-button request-button-primary",onClick:S=>ge(m.id,"accept")},"Accept",8,Tw),y("button",{type:"button",class:"request-button",onClick:S=>ge(m.id,"acceptForSession")},"Accept for Session",8,Sw),y("button",{type:"button",class:"request-button",onClick:S=>ge(m.id,"decline")},"Decline",8,Iw),y("button",{type:"button",class:"request-button",onClick:S=>ge(m.id,"cancel")},"Cancel",8,Ew)])):m.method==="item/fileChange/requestApproval"?(b(),I("section",Cw,[y("button",{type:"button",class:"request-button request-button-primary",onClick:S=>ge(m.id,"accept")},"Accept",8,Aw),y("button",{type:"button",class:"request-button",onClick:S=>ge(m.id,"acceptForSession")},"Accept for Session",8,Rw),y("button",{type:"button",class:"request-button",onClick:S=>ge(m.id,"decline")},"Decline",8,Pw),y("button",{type:"button",class:"request-button",onClick:S=>ge(m.id,"cancel")},"Cancel",8,xw)])):m.method==="item/tool/requestUserInput"?(b(),I("section",Mw,[(b(!0),I(Le,null,bt(x(m),S=>(b(),I("div",{key:`${m.id}:${S.id}`,class:"request-question"},[y("p",Ow,se(S.header||S.question),1),S.header&&S.question?(b(),I("p",Nw,se(S.question),1)):re("",!0),y("select",{class:"request-select",value:U(m.id,S.id,S.options[0]||""),onChange:J=>K(m.id,S.id,J)},[(b(!0),I(Le,null,bt(S.options,J=>(b(),I("option",{key:`${m.id}:${S.id}:${J}`,value:J},se(J),9,Dw))),128))],40,$w),S.isOther?(b(),I("input",{key:1,class:"request-input",type:"text",value:q(m.id,S.id),placeholder:"Other answer",onInput:J=>G(m.id,S.id,J)},null,40,Lw)):re("",!0)]))),128)),y("button",{type:"button",class:"request-button request-button-primary",onClick:S=>fe(m)}," Submit Answers ",8,jw)])):m.method==="item/tool/call"?(b(),I("section",Bw,[y("button",{type:"button",class:"request-button request-button-primary",onClick:S=>be(m.id)},"Fail Tool Call",8,Uw),y("button",{type:"button",class:"request-button",onClick:S=>Ee(m.id)},"Success (Empty)",8,Fw)])):(b(),I("section",Hw,[y("button",{type:"button",class:"request-button request-button-primary",onClick:S=>Ne(m.id)},"Return Empty Result",8,Vw),y("button",{type:"button",class:"request-button",onClick:S=>Ve(m.id)},"Reject Request",8,Ww)]))])])])]))),128)),(b(!0),I(Le,null,bt(e.messages,m=>{var S,J;return b(),I("li",{key:m.id,class:ot(["conversation-item",{"conversation-item-actionable":vt(m)}]),"data-role":m.role,"data-message-type":m.messageType||""},[i(m)?(b(),I("div",qw,[y("div",Gw,[y("button",{type:"button",class:ot(["cmd-row",[T(m),{"cmd-expanded":a(m)}]]),onClick:ee=>d(m)},[y("span",{class:ot(["cmd-chevron",{"cmd-chevron-open":a(m)}])},"▶",2),y("code",Jw,se(((S=m.commandExecution)==null?void 0:S.command)||"(command)"),1),y("span",Yw,se(g(m)),1)],10,Kw),y("div",{class:ot(["cmd-output-wrap",{"cmd-output-visible":a(m),"cmd-output-collapsing":l(m)}])},[y("div",Xw,[y("pre",Qw,se(((J=m.commandExecution)==null?void 0:J.aggregatedOutput)||"(no output)"),1)])],2)])])):(b(),I("div",{key:1,class:"message-row","data-role":m.role,"data-message-type":m.messageType||""},[y("div",{class:"message-stack","data-role":m.role},[y("article",{class:"message-body","data-role":m.role},[m.images&&m.images.length>0?(b(),I("ul",{key:0,class:"message-image-list","data-role":m.role},[(b(!0),I(Le,null,bt(m.images,ee=>(b(),I("li",{key:ee,class:"message-image-item"},[y("button",{class:"message-image-button",type:"button",onClick:_e=>Dt(ee)},[y("img",{class:"message-image-preview",src:ne(ee),alt:"Message image preview",loading:"lazy"},null,8,sb)],8,rb)]))),128))],8,nb)):re("",!0),m.fileAttachments&&m.fileAttachments.length>0?(b(),I("div",ob,[(b(!0),I(Le,null,bt(m.fileAttachments,ee=>(b(),I("span",{key:ee.path,class:"message-file-chip"},[f[1]||(f[1]=y("span",{class:"message-file-chip-icon"},"📄",-1)),y("span",ib,[y("a",{class:"message-file-link message-file-chip-name",href:le(ee.path),target:"_blank",rel:"noopener noreferrer",title:ee.path},se(ee.path),9,ab),we(ee.path)?(b(),I("a",{key:0,class:"message-file-edit-link",href:$e(ee.path),target:"_blank",rel:"noopener noreferrer",title:`Edit ${ee.path}`,"aria-label":"Edit file"}," Edit ",8,lb)):re("",!0)])]))),128))])):re("",!0),m.text.length>0?(b(),I("article",{key:2,class:"message-card","data-role":m.role},[m.messageType==="worked"?(b(),I("div",ub,[y("button",{type:"button",class:"worked-separator",onClick:ee=>u(m)},[f[2]||(f[2]=y("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),y("span",{class:ot(["worked-chevron",{"worked-chevron-open":p(m)}])},"▶",2),y("p",fb,se(m.text),1),f[3]||(f[3]=y("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,db),p(m)?(b(),I("div",hb,[(b(!0),I(Le,null,bt(R(e.messages,e.messages.indexOf(m)),ee=>{var _e,de;return b(),I("div",{key:`worked-cmd-${ee.id}`,class:"worked-cmd-item"},[y("button",{type:"button",class:ot(["cmd-row",[T(ee),{"cmd-expanded":a(ee)}]]),onClick:De=>d(ee)},[y("span",{class:ot(["cmd-chevron",{"cmd-chevron-open":a(ee)}])},"▶",2),y("code",mb,se(((_e=ee.commandExecution)==null?void 0:_e.command)||"(command)"),1),y("span",gb,se(g(ee)),1)],10,pb),y("div",{class:ot(["cmd-output-wrap",{"cmd-output-visible":a(ee),"cmd-output-collapsing":l(ee)}])},[y("div",vb,[y("pre",yb,se(((de=ee.commandExecution)==null?void 0:de.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):re("",!0)])):(b(),I("div",wb,[(b(!0),I(Le,null,bt(w(m.text),(ee,_e)=>(b(),I(Le,{key:`block-${_e}`},[ee.kind==="text"?(b(),I("p",bb,[(b(!0),I(Le,null,bt(V(ee.value),(de,De)=>(b(),I(Le,{key:`seg-${_e}-${De}`},[de.kind==="text"?(b(),I("span",_b,se(de.value),1)):de.kind==="bold"?(b(),I("strong",kb,se(de.value),1)):de.kind==="file"?(b(),I("span",Tb,[y("a",{class:"message-file-link",href:le(de.path),target:"_blank",rel:"noopener noreferrer",title:de.path},se(de.displayPath),9,Sb),we(de.path)?(b(),I("a",{key:0,class:"message-file-edit-link",href:$e(de.path),target:"_blank",rel:"noopener noreferrer",title:`Edit ${de.path}`,"aria-label":"Edit file"}," Edit ",8,Ib)):re("",!0)])):de.kind==="url"?(b(),I("a",{key:3,class:"message-file-link",href:de.href,target:"_blank",rel:"noopener noreferrer",title:de.href},se(de.value),9,Eb)):(b(),I("code",Cb,se(de.value),1))],64))),128))])):rn(m.id,_e)?(b(),I("p",Ab,se(ee.markdown),1)):(b(),I("button",{key:2,class:"message-image-button",type:"button",onClick:de=>Dt(ee.url)},[y("img",{class:"message-image-preview message-markdown-image",src:ee.url,alt:ee.alt||"Embedded message image",loading:"lazy",onError:de=>Pe(m.id,_e)},null,40,Pb)],8,Rb))],64))),128))]))],8,cb)):re("",!0)],8,tb),vt(m)?(b(),I("div",xb,[Je(m)?(b(),I("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:ee=>it(m)},[Ie(fw,{class:"message-action-icon"}),f[4]||(f[4]=y("span",{class:"message-action-label"},"Copy",-1))],8,Mb)):re("",!0),Ue(m)?(b(),I("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:ee=>kt(m)},[Ie(lw,{class:"message-action-icon"}),f[5]||(f[5]=y("span",{class:"message-action-label"},"Rollback",-1))],8,Ob)):re("",!0)])):re("",!0)],8,eb)],8,Zw))],10,zw)}),128)),e.liveOverlay?(b(),I("li",Nb,[y("div",$b,[y("div",Db,[y("article",Lb,[y("p",jb,se(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(b(),I("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:H},se(e.liveOverlay.reasoningText),513)):re("",!0),e.liveOverlay.errorText?(b(),I("p",Bb,se(e.liveOverlay.errorText),1)):re("",!0)])])])])):re("",!0),y("li",{ref_key:"bottomAnchorRef",ref:D,class:"conversation-bottom-anchor"},null,512)],544)),oe.value.length>0?(b(),I("div",{key:3,class:"image-modal-backdrop",onClick:hn},[y("div",{class:"image-modal-content",onClick:f[0]||(f[0]=st(()=>{},["stop"]))},[y("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:hn},[Ie(pl,{class:"icon-svg"})]),y("img",{class:"image-modal-image",src:oe.value,alt:"Expanded message image"},null,8,Ub)])])):re("",!0)]))}}),Vb=et(Hb,[["__scopeId","data-v-bc40021f"]]),zc=.0025,Ki=3,qc=2,Wb=256;function zb(e){var te;const t=L("idle"),n=L(typeof navigator<"u"&&!!((te=navigator.mediaDevices)!=null&&te.getUserMedia)),r=L(0),s=L(null);let o=null,i=null,a=[],l=null,d=null,u=null,p=null,g=[],T=!1,j=!1,R=null;function B(){R&&(R.abort(),R=null),t.value==="transcribing"&&(t.value="idle")}function N(){const ie=s.value;if(!ie||typeof window>"u")return;const Y=ie.getContext("2d");if(!Y)return;const Ae=Math.max(1,Math.floor(ie.clientWidth)),Se=Math.max(1,Math.floor(ie.clientHeight||36)),Me=window.devicePixelRatio||1,Re=Math.max(1,Math.floor(Ae*Me)),Oe=Math.max(1,Math.floor(Se*Me));(ie.width!==Re||ie.height!==Oe)&&(ie.width=Re,ie.height=Oe),Y.setTransform(Me,0,0,Me,0,0),Y.clearRect(0,0,Ae,Se);const me=Math.max(12,Math.floor(Ae/(Ki+qc))),at=g.slice(-me),Ye=Math.max(0,me-at.length),Xe=Se/2,We=getComputedStyle(ie).color||"#000000";for(let Qe=0;Qe<me;Qe+=1){const tt=at[Qe-Ye]??0,ze=Math.max(.08,Math.min(1,tt*18))*Xe,V=Qe*(Ki+qc);Y.globalAlpha=tt<=zc?.35:1,Y.fillStyle=We,Y.fillRect(V,Xe-ze,Ki,ze*2)}Y.globalAlpha=1}function P(){g=[],r.value=0,N()}function D(){u&&(u.disconnect(),u.onaudioprocess=null,u=null),d&&(d.disconnect(),d=null),l&&(l.close(),l=null),p=null}function H(ie){if(typeof window>"u")return;const Y=window.webkitAudioContext,Ae=window.AudioContext??Y;Ae&&(D(),P(),l=new Ae,d=l.createMediaStreamSource(ie),u=l.createScriptProcessor(2048,1,1),p=performance.now(),u.onaudioprocess=Se=>{const Me=Se.inputBuffer.getChannelData(0);let Re=0;for(let Oe=0;Oe<Me.length;Oe+=1){const me=Math.abs(Me[Oe]??0);Re+=me<zc?0:me}g.push(Re/Me.length),g.length>Wb&&g.shift(),p!==null&&(r.value=Math.max(0,performance.now()-p)),N()},d.connect(u),u.connect(l.destination),N())}async function oe(){var ie;if(t.value==="transcribing"&&B(),!(t.value!=="idle"||!n.value||T)){T=!0,j=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),a=[],o=new MediaRecorder(i),o.ondataavailable=Y=>{Y.data.size>0&&a.push(Y.data)},o.onstop=()=>{var Se;const Y=a,Ae=(o==null?void 0:o.mimeType)||((Se=Y[0])==null?void 0:Se.type)||"audio/webm";Te(),pe(Y,Ae)},H(i),o.start(250),t.value="recording",j&&ae()}catch(Y){Te(),t.value="idle",(ie=e.onError)==null||ie.call(e,Y)}finally{T=!1}}}function ae(){if(T&&t.value==="idle"){j=!0;return}if(!(t.value!=="recording"||!o)&&o.state!=="inactive"){t.value="transcribing";try{o.requestData()}catch{}o.stop()}}async function pe(ie,Y){var Me,Re,Oe,me,at;if(ie.length===0){(Me=e.onEmpty)==null||Me.call(e),t.value="idle";return}const Ae=new Blob(ie,{type:Y});t.value="transcribing";let Se=null;try{const Ye=Y.split(/[/;]/)[1]??"webm",Xe=new FormData;Xe.append("file",Ae,`codex.${Ye}`);const We=((Re=e.getLanguage)==null?void 0:Re.call(e).trim())??"";We&&We.toLowerCase()!=="auto"&&Xe.append("language",We),Se=new AbortController,R=Se;const Qe=await fetch("/codex-api/transcribe",{method:"POST",body:Xe,signal:Se.signal}),tt=await Qe.text();let je=null;try{je=tt.trim()?JSON.parse(tt):null}catch{je=null}if(!Qe.ok){const V=(Oe=je==null?void 0:je.error)==null?void 0:Oe.trim(),ne=tt.trim();throw new Error(V||ne||`Transcription failed: ${Qe.status}`)}const ze=((je==null?void 0:je.text)??"").trim();ze.length>0?e.onTranscript(ze):(me=e.onEmpty)==null||me.call(e)}catch(Ye){if(Ye instanceof DOMException&&Ye.name==="AbortError")return;(at=e.onError)==null||at.call(e,Ye)}finally{Se&&R===Se&&(R=null),t.value==="transcribing"&&(t.value="idle")}}function Te(){D(),P(),o&&(o.ondataavailable=null,o.onstop=null,o=null),i&&(i.getTracks().forEach(ie=>ie.stop()),i=null),a=[]}rr(()=>{B(),Te()});function ce(){if(t.value==="recording"){ae();return}(t.value==="idle"||t.value==="transcribing")&&oe()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:s,startRecording:oe,stopRecording:ae,toggleRecording:ce}}function Gc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Gn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function ml(e,t){const n=Gc(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Gc(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function vs(e,t,n){return e instanceof Gn?e:e instanceof Error?new Gn(e.message||t,{code:"unknown_error",method:n}):new Gn(t,{code:"unknown_error",method:n})}function _f(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function qb(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 Gn(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 Gn(ml(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 Gn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Kc(e){const t=_f(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 Gb(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=Kc(i);a&&e(a)}catch{}},t=()=>s.close()};if(typeof WebSocket<"u"){const s=window.location.protocol==="https:"?"wss:":"ws:",o=new WebSocket(`${s}//${window.location.host}/codex-api/ws`);let i=!1,a=window.setTimeout(()=>{i||n||(o.close(),r())},2500);o.onopen=()=>{i=!0,a!==null&&(window.clearTimeout(a),a=null)},o.onmessage=l=>{try{const d=JSON.parse(String(l.data)),u=Kc(d);u&&e(u)}catch{}},o.onerror=()=>{!i&&!n&&r()},o.onclose=()=>{a!==null&&(window.clearTimeout(a),a=null),!i&&!n&&r()},t=()=>o.close()}else r();return()=>{n=!0,t==null||t()}}async function 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 Gn(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 Gn(ml(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Jb(){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 Gn(ml(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=_f(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Jc(e){return new Date(e*1e3).toISOString()}function Yb(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Xb(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Qb=/^##\s+(.+?):\s+(.+?)\s*$/,Zb=/^#\s*files mentioned by the user\s*:?\s*$/i;function e_(e){var s,o;const t=e.split(`
29
+ `).findIndex(i=>Zb.test(i.trim()));if(t<0)return[];const n=e.split(`
30
+ `).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(Qb);if(!l)break;const d=(s=l[1])==null?void 0:s.trim(),u=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");d&&u&&r.push({label:d,path:u})}return r}function t_(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 n_(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:Xb(l),isUnhandled:!0});const o=n.join(`
31
+ `),i=e_(o);return{text:t_(o),images:r,fileAttachments:i,rawBlocks:s}}function r_(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=n_(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=s_(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 s_(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function o_(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function i_(e){const t=o_(e);return t.length>0?t:"Untitled thread"}function kf(e){return(e==null?void 0:e.status)==="inProgress"}function a_(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 kf(r)}function l_(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:i_(e),projectName:Yb(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:Jc(e.createdAt),updatedAtIso:Jc(e.updatedAt),preview:e.preview,unread:!1,inProgress:a_(e)}}function c_(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 u_(e){const t=e.data.map(l_);return c_(t)}function Tf(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 r_(i))n.push({...a,turnIndex:r})}return n}function d_(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return kf(t.at(-1))}async function tn(e,t){try{return await qb(e,t)}catch(n){throw vs(n,`RPC ${e} failed`,e)}}function f_(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function h_(){const e=await tn("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return u_(e)}async function p_(e){const t=await tn("thread/read",{threadId:e,includeTurns:!0});return{messages:Tf(t),inProgress:d_(t)}}async function m_(){try{return await h_()}catch(e){throw vs(e,"Failed to load thread groups","thread/list")}}async function g_(e){try{return await p_(e)}catch(t){throw vs(t,`Failed to load thread ${e}`,"thread/read")}}function v_(e){return Gb(e)}async function y_(e,t){await Kb({id:e,...t})}async function w_(){return Jb()}async function Ji(e){await tn("thread/resume",{threadId:e})}async function b_(e){await tn("thread/archive",{threadId:e})}async function __(e,t){await tn("thread/name/set",{threadId:e,name:t})}async function Yc(e,t){const n=await tn("thread/rollback",{threadId:e,numTurns:t});return Tf(n)}function k_(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 Xc(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 tn("thread/start",n),s=k_(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw vs(n,"Failed to start a new thread","thread/start")}}function T_(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
32
+ `;for(const r of t)n+=`
33
+ ## ${r.label}: ${r.path}
34
+ `;return`${n}
35
+ ## My request for Codex:
36
+
37
+ ${e}
38
+ `}async function Yi(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:T_(t,i)}];for(const p of n){const g=p.trim();g&&l.push({type:"image",url:g,image_url:g})}if(o)for(const p of o)l.push({type:"skill",name:p.name,path:p.path});const d=i.map(p=>({label:p.label,path:p.path,fsPath:p.fsPath})),u={threadId:e,input:l};d.length>0&&(u.attachments=d),typeof r=="string"&&r.length>0&&(u.model=r),typeof s=="string"&&s.length>0&&(u.effort=s),await tn("turn/start",u)}catch(a){throw vs(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function S_(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 tn("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw vs(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function I_(e){await tn("setDefaultModel",{model:e})}async function E_(){const e=await tn("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 C_(){const e=await tn("config/read",{}),t=e.config.model??"",n=f_(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}async function A_(){return await tn("account/rateLimits/read")}function R_(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 R_(n.data)}async function P_(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 Qc(){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 x_(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 Zc(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=gl(r,"Failed to open project root");throw new Error(a)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return typeof o.path=="string"?o.path.trim():""}async function M_(e){const t=new URLSearchParams({basePath:e}),n=await fetch(`/codex-api/project-root-suggestion?${t.toString()}`),r=await n.json();if(!n.ok){const i=gl(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 O_(e,t,n=20){const r=e.trim();if(!r)return[];const s=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:t.trim(),limit:n})}),o=await s.json();if(!s.ok){const d=gl(o,"Failed to search files");throw new Error(d)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const d of a){if(!d||typeof d!="object"||Array.isArray(d))continue;const p=d.path,g=typeof p=="string"?p.trim():"";g&&l.push({path:g})}return l}async function N_(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 gl(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 $_(){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 Xi(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 D_(e,t){var n;try{return((n=(await tn("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function L_(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await tn("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 eu(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 j_={},B_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function U_(e,t){return b(),I("svg",B_,[...t[0]||(t[0]=[y("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 F_=et(j_,[["render",U_]]),H_={},V_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function W_(e,t){return b(),I("svg",V_,[...t[0]||(t[0]=[y("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 z_=et(H_,[["render",W_]]),q_={},G_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function K_(e,t){return b(),I("svg",G_,[...t[0]||(t[0]=[y("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),y("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 tu=et(q_,[["render",K_]]),J_=["disabled"],Y_={class:"composer-dropdown-value"},X_={class:"composer-dropdown-menu"},Q_={key:0,class:"composer-dropdown-search-wrap"},Z_=["placeholder","onKeydown"],ek={class:"composer-dropdown-options",role:"listbox"},tk=["onClick"],nk={key:0,class:"composer-dropdown-empty"},rk={key:1,class:"composer-dropdown-add-wrap"},sk=["placeholder","onKeydown"],ok=$t({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(null),a=L(!1),l=L(""),d=L(!1),u=L(""),p=ue(()=>{var ie;const te=n.options.find(Y=>Y.value===n.modelValue);return te?te.label:((ie=n.placeholder)==null?void 0:ie.trim())||""}),g=ue(()=>n.openDirection??"down"),T=ue(()=>n.enableSearch===!0),j=ue(()=>n.showAddAction===!0),R=ue(()=>{var te;return((te=n.searchPlaceholder)==null?void 0:te.trim())||"Quick search projects"}),B=ue(()=>{var te;return((te=n.addActionLabel)==null?void 0:te.trim())||"Add new project"}),N=ue(()=>{var te;return((te=n.addPlaceholder)==null?void 0:te.trim())||"Project name or absolute path"}),P=ue(()=>{const te=l.value.trim().toLowerCase();return te?n.options.filter(ie=>ie.label.toLowerCase().includes(te)||ie.value.toLowerCase().includes(te)):n.options});function D(){n.disabled||(a.value=!a.value)}function H(te){r("update:modelValue",te),a.value=!1,l.value=""}function oe(){var te;d.value=!0,u.value=((te=n.defaultAddValue)==null?void 0:te.trim())||"",qt(()=>{var ie;return(ie=i.value)==null?void 0:ie.focus()})}function ae(){if(l.value.length>0){l.value="";return}a.value=!1}function pe(){const te=u.value.trim();te&&(r("add",te),d.value=!1,u.value="",a.value=!1,l.value="")}function Te(){d.value=!1,u.value="",a.value=!1,l.value=""}function ce(te){if(!a.value)return;const ie=s.value;if(!ie)return;const Y=te.target;Y instanceof Node&&(ie.contains(Y)||(a.value=!1,l.value="",d.value=!1,u.value=""))}return ht(a,te=>{if(!te){d.value=!1,u.value="";return}T.value&&qt(()=>{var ie;return(ie=o.value)==null?void 0:ie.focus()})}),nr(()=>{window.addEventListener("pointerdown",ce)}),rr(()=>{window.removeEventListener("pointerdown",ce)}),(te,ie)=>(b(),I("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[y("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:D},[y("span",Y_,se(p.value),1),Ie(pi,{class:"composer-dropdown-chevron"})],8,J_),a.value?(b(),I("div",{key:0,class:ot(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":g.value==="up","composer-dropdown-menu-wrap-down":g.value==="down"}])},[y("div",X_,[T.value?(b(),I("div",Q_,[Xn(y("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ie[0]||(ie[0]=Y=>l.value=Y),class:"composer-dropdown-search-input",type:"text",placeholder:R.value,onKeydown:Zt(st(ae,["prevent"]),["esc"])},null,40,Z_),[[Qn,l.value]])])):re("",!0),y("ul",ek,[(b(!0),I(Le,null,bt(P.value,Y=>(b(),I("li",{key:Y.value},[y("button",{class:ot(["composer-dropdown-option",{"is-selected":Y.value===e.modelValue}]),type:"button",onClick:Ae=>H(Y.value)},se(Y.label),11,tk)]))),128)),P.value.length===0?(b(),I("li",nk," No matching projects ")):re("",!0)]),j.value?(b(),I("div",rk,[d.value?(b(),I(Le,{key:0},[Xn(y("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ie[1]||(ie[1]=Y=>u.value=Y),class:"composer-dropdown-add-input",type:"text",placeholder:N.value,onKeydown:[Zt(st(pe,["prevent"]),["enter"]),Zt(st(Te,["prevent"]),["esc"])]},null,40,sk),[[Qn,u.value]]),y("div",{class:"composer-dropdown-add-actions"},[y("button",{type:"button",class:"composer-dropdown-add-btn",onClick:pe},"Open"),y("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Te},"Cancel")])],64)):(b(),I("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:oe},se(B.value),1))])):re("",!0)])],2)):re("",!0)],512))}}),zo=et(ok,[["__scopeId","data-v-7cfa2012"]]),ik=["disabled"],ak={class:"search-dropdown-value"},lk={class:"search-dropdown-search-wrap"},ck=["placeholder","onKeydown"],uk={key:0,class:"search-dropdown-list",role:"listbox"},dk=["onClick","onPointerenter"],fk={class:"search-dropdown-option-check"},hk={class:"search-dropdown-option-label"},pk={key:0,class:"search-dropdown-option-desc"},mk={key:1,class:"search-dropdown-empty"},gk=$t({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(!1),a=L(""),l=L(0),d=ue(()=>n.openDirection??"down"),u=ue(()=>new Set(n.selectedValues)),p=ue(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const P=n.options.find(D=>D.value===n.selectedValues[0]);return(P==null?void 0:P.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),g=ue(()=>{const P=a.value.toLowerCase().trim();return P?n.options.filter(D=>{var H;return D.label.toLowerCase().includes(P)||(((H=D.description)==null?void 0:H.toLowerCase().includes(P))??!1)}):n.options});function T(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,qt(()=>{var P;return(P=o.value)==null?void 0:P.focus()})))}function j(P){r("toggle",P.value,!u.value.has(P.value))}function R(P){g.value.length!==0&&(l.value=(l.value+P+g.value.length)%g.value.length)}function B(){const P=g.value[l.value];P&&j(P)}function N(P){if(!i.value)return;const D=s.value;if(!D)return;const H=P.target;H instanceof Node&&(D.contains(H)||(i.value=!1))}return ht(a,()=>{l.value=0}),nr(()=>window.addEventListener("pointerdown",N)),rr(()=>window.removeEventListener("pointerdown",N)),(P,D)=>(b(),I("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[y("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:T},[y("span",ak,se(p.value),1),Ie(pi,{class:"search-dropdown-chevron"})],8,ik),i.value?(b(),I("div",{key:0,class:ot(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[y("div",lk,[Xn(y("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":D[0]||(D[0]=H=>a.value=H),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[D[1]||(D[1]=Zt(st(H=>i.value=!1,["prevent"]),["escape"])),Zt(st(B,["prevent"]),["enter"]),D[2]||(D[2]=Zt(st(H=>R(1),["prevent"]),["arrow-down"])),D[3]||(D[3]=Zt(st(H=>R(-1),["prevent"]),["arrow-up"]))]},null,40,ck),[[Qn,a.value]])]),g.value.length>0?(b(),I("ul",uk,[(b(!0),I(Le,null,bt(g.value,(H,oe)=>(b(),I("li",{key:H.value},[y("button",{class:ot(["search-dropdown-option",{"is-selected":u.value.has(H.value),"is-highlighted":oe===l.value}]),type:"button",onClick:ae=>j(H),onPointerenter:ae=>l.value=oe},[y("span",fk,se(u.value.has(H.value)?"✓":""),1),y("span",hk,se(H.label),1),H.description?(b(),I("span",pk,se(H.description),1)):re("",!0)],42,dk)]))),128))])):(b(),I("div",mk,"No results"))],2)):re("",!0)],512))}}),vk=et(gk,[["__scopeId","data-v-a0f2edd4"]]),yk={class:"skill-picker-header"},wk=["onKeydown"],bk={key:0,class:"skill-picker-list",role:"listbox"},_k=["onClick","onPointerenter"],kk={class:"skill-picker-name"},Tk={key:0,class:"skill-picker-desc"},Sk={key:1,class:"skill-picker-empty"},Ik=$t({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(""),a=L(0),l=ue(()=>{const g=i.value.toLowerCase().trim();return g?n.skills.filter(T=>T.name.toLowerCase().includes(g)||T.description.toLowerCase().includes(g)):n.skills}),d=ue(()=>{const g={};return n.anchorBottom!=null&&(g.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(g.left=`${n.anchorLeft}px`),g});function u(g){l.value.length!==0&&(a.value=(a.value+g+l.value.length)%l.value.length)}function p(){const g=l.value[a.value];g&&r("select",g)}return ht(()=>n.visible,g=>{g&&(i.value="",a.value=0,qt(()=>{var T;return(T=o.value)==null?void 0:T.focus()}))}),ht(i,()=>{a.value=0}),(g,T)=>e.visible?(b(),I("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:Hr(d.value)},[y("div",yk,[Xn(y("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":T[0]||(T[0]=j=>i.value=j),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[T[1]||(T[1]=Zt(st(j=>g.$emit("close"),["prevent"]),["escape"])),Zt(st(p,["prevent"]),["enter"]),T[2]||(T[2]=Zt(st(j=>u(1),["prevent"]),["arrow-down"])),T[3]||(T[3]=Zt(st(j=>u(-1),["prevent"]),["arrow-up"]))]},null,40,wk),[[Qn,i.value]])]),l.value.length>0?(b(),I("ul",bk,[(b(!0),I(Le,null,bt(l.value,(j,R)=>(b(),I("li",{key:j.path},[y("button",{class:ot(["skill-picker-item",{"is-highlighted":R===a.value}]),type:"button",onClick:B=>g.$emit("select",j),onPointerenter:B=>a.value=R},[y("span",kk,se(j.name),1),j.description?(b(),I("span",Tk,se(j.description),1)):re("",!0)],42,_k)]))),128))])):(b(),I("div",Sk,"No skills found"))],4)):re("",!0)}}),Ek=et(Ik,[["__scopeId","data-v-ff3fb7dc"]]),Ck={key:0,class:"thread-composer-dictation-error"},Ak={key:0,class:"thread-composer-attachments"},Rk=["src","alt"],Pk=["aria-label","disabled","onClick"],xk={key:1,class:"thread-composer-folder-chips"},Mk=["title"],Ok={class:"thread-composer-folder-chip-meta"},Nk=["aria-label","disabled","onClick"],$k={key:2,class:"thread-composer-file-chips"},Dk=["title"],Lk=["aria-label","disabled","onClick"],jk={key:3,class:"thread-composer-skill-chips"},Bk={class:"thread-composer-skill-chip-name"},Uk=["aria-label","onClick"],Fk={class:"thread-composer-input-wrap"},Hk={key:0,class:"thread-composer-file-mentions"},Vk=["onMousedown"],Wk={key:1,class:"thread-composer-file-mention-icon-markdown"},zk={class:"thread-composer-file-mention-text"},qk={class:"thread-composer-file-mention-name"},Gk={key:0,class:"thread-composer-file-mention-dir"},Kk={key:1,class:"thread-composer-file-mention-empty"},Jk=["placeholder","disabled"],Yk=["disabled"],Xk={key:0,class:"thread-composer-attach-menu"},Qk=["disabled"],Zk=["disabled"],e0=["disabled"],t0={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},n0={key:1,class:"thread-composer-dictation-timer"},r0=["aria-label","title","disabled"],s0=["disabled"],o0=["aria-label","title","disabled"],i0=["disabled"],a0=["disabled"],l0=["disabled"],c0=$t({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{},dictationClickToToggle:{type:Boolean},prependDraftRequest:{},dictationAutoSend:{type:Boolean},dictationLanguage:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=L(""),o=L([]),i=L([]),a=L([]),l=L([]),d=L(""),{state:u,isSupported:p,recordingDurationMs:g,waveformCanvasRef:T,startRecording:j,stopRecording:R,toggleRecording:B}=zb({getLanguage:()=>n.dictationLanguage??"auto",onTranscript:f=>{if(s.value=s.value?`${s.value}
39
+ ${f}`:f,d.value="",n.dictationAutoSend!==!1){const m=n.isTurnInProgress?ze.value:"steer";w(m,{rollbackLatestUserTurn:m==="steer"&&Re}),Re=!1;return}qt(()=>{var m;return(m=oe.value)==null?void 0:m.focus()})},onEmpty:()=>{d.value=n.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:f=>{if(f instanceof DOMException&&f.name==="NotAllowedError"){d.value="Microphone access was denied.";return}d.value=f instanceof Error?f.message:"Dictation failed."}}),N=L(null),P=L(null),D=L(null),H=L(null),oe=L(null),ae=L(!1),pe=L(!1),Te=L(null),ce=L(""),te=L([]),ie=L(!1),Y=L(0);let Ae=0,Se=null,Me=!1,Re=!1;const Oe=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),me=[{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"}],at=ue(()=>n.models.map(f=>({value:f,label:f}))),Ye=ue(()=>n.skills??[]),Xe=ue(()=>i.value.map(f=>f.path)),We=ue(()=>(n.skills??[]).map(f=>({value:f.path,label:f.name,description:f.description}))),Qe=ue(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),tt=ue(()=>{const f=new Set;for(const m of l.value)for(const S of m.filePaths)f.add(S);return a.value.filter(m=>!f.has(m.fsPath))}),je=ue(()=>n.disabled||!n.activeThreadId),ze=ue(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),V=ue(()=>u.value==="recording"),ne=ue(()=>u.value==="recording"?"Stop dictation":n.dictationClickToToggle?"Click to dictate":"Hold to dictate"),le=ue(()=>u.value==="idle"?d.value.trim():""),we=ue(()=>{const f=Math.max(0,Math.floor(g.value/1e3)),m=Math.floor(f/60),S=f%60;return`${m}:${String(S).padStart(2,"0")}`}),$e=ue(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function w(f="steer",m){var J;const S=s.value.trim();if(Qe.value){if(r("submit",{text:S,imageUrls:o.value.map(ee=>ee.url),fileAttachments:[...a.value],skills:i.value.map(ee=>({name:ee.name,path:ee.path})),mode:f,rollbackLatestUserTurn:(m==null?void 0:m.rollbackLatestUserTurn)===!0}),s.value="",o.value=[],i.value=[],a.value=[],l.value=[],ae.value=!1,pe.value=!1,Pt(),Oe){(J=oe.value)==null||J.blur();return}qt(()=>{var ee;return(ee=oe.value)==null?void 0:ee.focus()})}}function k(){r("interrupt")}function M(f){r("update:selected-model",f)}function W(f){r("update:selected-reasoning-effort",f)}function F(){n.dictationClickToToggle&&(d.value&&(d.value=""),u.value==="idle"&&(Re=n.isTurnInProgress===!0&&n.inProgressSubmitMode==="steer"),B())}function x(f){if(n.dictationClickToToggle||(f.preventDefault(),Me))return;Me=!0;const m=f.currentTarget;if(m)try{m.setPointerCapture(f.pointerId)}catch{}d.value&&(d.value=""),Re=n.isTurnInProgress===!0&&n.inProgressSubmitMode==="steer",window.addEventListener("pointerup",U),window.addEventListener("pointercancel",U),window.addEventListener("blur",U),j()}function U(){n.dictationClickToToggle||Me&&(Me=!1,window.removeEventListener("pointerup",U),window.removeEventListener("pointercancel",U),window.removeEventListener("blur",U),R())}function q(){je.value||(ae.value=!ae.value)}function K(){var f;(f=P.value)==null||f.click()}function G(){var f;(f=D.value)==null||f.click()}function ge(){var f;(f=H.value)==null||f.click()}function fe(f){o.value=o.value.filter(m=>m.id!==f)}function be(f){i.value=i.value.filter(m=>m.path!==f)}function Ee(f){a.value=a.value.filter(m=>m.fsPath!==f)}function Ne(f){const m=l.value.find(J=>J.id===f);if(!m)return;const S=new Set(m.filePaths);a.value=a.value.filter(J=>!S.has(J.fsPath)),l.value=l.value.filter(J=>J.id!==f)}function Ve(f){return f.total<=0?0:Math.round(f.processed/f.total*100)}function Ue(f,m){const S=f.replace(/\\/g,"/");if(a.value.some(_e=>_e.fsPath===S))return;const J=S.split("/").filter(Boolean),ee=(m==null?void 0:m.trim())||J[J.length-1]||S;a.value=[...a.value,{label:ee,path:S,fsPath:S}]}function Je(f){return f.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(f.name)}function vt(f){if(!(!f||f.length===0))for(const m of Array.from(f))if(Je(m)){const S=new FileReader;S.onload=()=>{typeof S.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:m.name,url:S.result})},S.readAsDataURL(m)}else eu(m).then(S=>{S&&Ue(S)}).catch(()=>{})}async function it(f){if(!f||f.length===0)return;const m=Array.from(f),J=(m[0].webkitRelativePath||m[0].name).split("/").filter(Boolean)[0]||"Folder",ee=`${Date.now()}-${Math.random().toString(36).slice(2)}`;l.value=[...l.value,{id:ee,name:J,total:m.length,processed:0,filePaths:[],isUploading:!0}];const _e=de=>{l.value=l.value.map(De=>De.id===ee?de(De):De)};for(const de of m)try{const De=await eu(de);if(De){const Ze=de.webkitRelativePath||de.name;Ue(De,Ze),_e(ct=>({...ct,processed:ct.processed+1,filePaths:[...ct.filePaths,De]}));continue}_e(Ze=>({...Ze,processed:Ze.processed+1}))}catch{_e(De=>({...De,processed:De.processed+1}))}_e(de=>({...de,isUploading:!1}))}function kt(f){f&&(f.value="")}function Et(f){const m=f.target;vt((m==null?void 0:m.files)??null),kt(m),ae.value=!1}function mt(f){const m=f.target;vt((m==null?void 0:m.files)??null),kt(m),ae.value=!1}function yt(f){const m=f.target;it((m==null?void 0:m.files)??null),kt(m),ae.value=!1}function qe(){d.value&&(d.value="");const m=s.value.startsWith("/");m!==pe.value&&(pe.value=m),Kt()}function nt(f){if(ie.value){if(f.key==="Escape"){f.preventDefault(),Pt();return}if(f.key==="ArrowDown"){f.preventDefault(),te.value.length>0&&(Y.value=(Y.value+1)%te.value.length);return}if(f.key==="ArrowUp"){if(f.preventDefault(),te.value.length>0){const S=te.value.length;Y.value=(Y.value+S-1)%S}return}if(f.key==="Enter"||f.key==="Tab"){f.preventDefault();const S=te.value[Y.value];S?on(S):Pt();return}}if(n.sendWithEnter!==!1?f.key==="Enter"&&!f.shiftKey:f.key==="Enter"&&(f.metaKey||f.ctrlKey)){f.preventDefault(),w(n.isTurnInProgress?ze.value:"steer");return}if(pe.value){if(f.key==="Escape"){f.preventDefault(),Bt();return}if(f.key==="ArrowDown"||f.key==="ArrowUp"){f.preventDefault();return}}}function Bt(){var f;pe.value=!1,(f=oe.value)==null||f.focus()}function Pt(){ie.value=!1,Te.value=null,ce.value="",te.value=[],Y.value=0}function Kt(){const f=oe.value;if(!f){Pt();return}const m=f.selectionStart??s.value.length,J=s.value.slice(0,m).match(/(^|\s)(@[^\s@]*)$/);if(!J){Pt();return}const ee=J[2]??"",_e=ee.length,de=m-_e;Te.value=de,ce.value=ee.slice(1),ie.value=!0,At()}async function At(){if(!ie.value)return;const f=(n.cwd??"").trim();if(!f){te.value=[];return}Se&&clearTimeout(Se);const m=++Ae;Se=setTimeout(async()=>{try{const S=await O_(f,ce.value,20);if(!ie.value||m!==Ae)return;te.value=S,Y.value=0}catch{if(!ie.value||m!==Ae)return;te.value=[]}},120)}function on(f){const m=oe.value,S=Te.value;if(S!==null&&m){const J=m.selectionStart??s.value.length;s.value=`${s.value.slice(0,S)}${s.value.slice(J)}`.trimEnd()}Ue(f.path),Pt(),qt(()=>m==null?void 0:m.focus())}function Ut(f){const m=f.lastIndexOf("/");return m<0?f:f.slice(m+1)}function nn(f){const m=f.lastIndexOf("/");return m<=0?"":f.slice(0,m)}function Dt(f){const m=Ut(f),S=m.lastIndexOf(".");return S<=0?"":m.slice(S+1).toLowerCase()}function Ce(f){const m=Dt(f);return m==="ts"?"TS":m==="tsx"?"TSX":m==="js"?"JS":m==="jsx"?"JSX":m==="json"?"{}":""}function Pe(f){const m=Dt(f);return m.startsWith("ts")?"ts":m.startsWith("js")?"js":m==="json"?"json":"default"}function rn(f){const m=Dt(f);return m==="md"||m==="mdx"}function hn(f){var m;i.value.some(S=>S.path===f.path)||(i.value=[...i.value,f]),s.value=s.value.startsWith("/")?"":s.value,pe.value=!1,(m=oe.value)==null||m.focus()}function pn(f,m){if(m){const S=(n.skills??[]).find(J=>J.path===f);S&&!i.value.some(J=>J.path===f)&&(i.value=[...i.value,S])}else i.value=i.value.filter(S=>S.path!==f)}function _(f){if(!ae.value)return;const m=N.value;if(!m)return;const S=f.target;!S||m.contains(S)||(ae.value=!1)}return nr(()=>{document.addEventListener("click",_)}),rr(()=>{document.removeEventListener("click",_),window.removeEventListener("pointerup",U),window.removeEventListener("pointercancel",U),window.removeEventListener("blur",U),Se&&clearTimeout(Se)}),ht(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],l.value=[],d.value="",ae.value=!1,pe.value=!1,Pt()}),ht(()=>n.cwd,()=>{ie.value&&At()}),ht(()=>{var f;return(f=n.prependDraftRequest)==null?void 0:f.id},()=>{var m,S;const f=((S=(m=n.prependDraftRequest)==null?void 0:m.text)==null?void 0:S.trim())??"";f&&(s.value=s.value?`${f}
40
+ ${s.value}`:f,qe(),qt(()=>{var J;return(J=oe.value)==null?void 0:J.focus()}))}),(f,m)=>(b(),I("form",{class:"thread-composer",onSubmit:m[2]||(m[2]=st(S=>w("steer"),["prevent"]))},[le.value?(b(),I("p",Ck,se(le.value),1)):re("",!0),y("div",{class:ot(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(b(),I("div",Ak,[(b(!0),I(Le,null,bt(o.value,S=>(b(),I("div",{key:S.id,class:"thread-composer-attachment"},[y("img",{class:"thread-composer-attachment-image",src:S.url,alt:S.name||"Selected image"},null,8,Rk),y("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${S.name||"image"}`,disabled:je.value,onClick:J=>fe(S.id)}," x ",8,Pk)]))),128))])):re("",!0),l.value.length>0?(b(),I("div",xk,[(b(!0),I(Le,null,bt(l.value,S=>(b(),I("span",{key:S.id,class:"thread-composer-folder-chip"},[Ie(hl,{class:"thread-composer-folder-chip-icon"}),y("span",{class:"thread-composer-folder-chip-name",title:S.name},se(S.name),9,Mk),y("span",Ok,[S.isUploading?(b(),I(Le,{key:0},[Ys(se(Ve(S))+"% uploading ("+se(S.processed)+"/"+se(S.total)+") ",1)],64)):(b(),I(Le,{key:1},[Ys(se(S.filePaths.length)+" file"+se(S.filePaths.length===1?"":"s"),1)],64))]),y("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${S.name}`,disabled:je.value,onClick:J=>Ne(S.id)},"×",8,Nk)]))),128))])):re("",!0),tt.value.length>0?(b(),I("div",$k,[(b(!0),I(Le,null,bt(tt.value,S=>(b(),I("span",{key:S.fsPath,class:"thread-composer-file-chip"},[Ie(Wo,{class:"thread-composer-file-chip-icon"}),y("span",{class:"thread-composer-file-chip-name",title:S.fsPath},se(S.label),9,Dk),y("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${S.label}`,disabled:je.value,onClick:J=>Ee(S.fsPath)},"×",8,Lk)]))),128))])):re("",!0),i.value.length>0?(b(),I("div",jk,[(b(!0),I(Le,null,bt(i.value,S=>(b(),I("span",{key:S.path,class:"thread-composer-skill-chip"},[y("span",Bk,se(S.name),1),y("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${S.name}`,onClick:J=>be(S.path)},"×",8,Uk)]))),128))])):re("",!0),y("div",Fk,[ie.value?(b(),I("div",Hk,[te.value.length>0?(b(!0),I(Le,{key:0},bt(te.value,(S,J)=>(b(),I("button",{key:S.path,class:ot(["thread-composer-file-mention-row",{"is-active":J===Y.value}]),type:"button",onMousedown:st(ee=>on(S),["prevent"])},[Ce(S.path)?(b(),I("span",{key:0,class:ot(["thread-composer-file-mention-icon-badge",`is-${Pe(S.path)}`])},se(Ce(S.path)),3)):rn(S.path)?(b(),I("span",Wk,"↓")):(b(),ft(Wo,{key:2,class:"thread-composer-file-mention-icon-file"})),y("span",zk,[y("span",qk,se(Ut(S.path)),1),nn(S.path)?(b(),I("span",Gk,se(nn(S.path)),1)):re("",!0)])],42,Vk))),128)):(b(),I("div",Kk,"No matching files"))])):re("",!0),Xn(y("textarea",{ref_key:"inputRef",ref:oe,"onUpdate:modelValue":m[0]||(m[0]=S=>s.value=S),class:"thread-composer-input",placeholder:$e.value,disabled:je.value,onInput:qe,onKeydown:nt},null,40,Jk),[[Qn,s.value]]),Ie(Ek,{skills:Ye.value,visible:pe.value,"anchor-bottom":44,"anchor-left":0,onSelect:hn,onClose:Bt},null,8,["skills","visible"])]),y("div",{class:ot(["thread-composer-controls",{"thread-composer-controls--recording":V.value}])},[y("div",{ref_key:"attachMenuRootRef",ref:N,class:"thread-composer-attach"},[y("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:je.value,onClick:q}," + ",8,Yk),ae.value?(b(),I("div",Xk,[y("button",{class:"thread-composer-attach-item",type:"button",disabled:je.value,onClick:K}," Add photos & files ",8,Qk),y("button",{class:"thread-composer-attach-item",type:"button",disabled:je.value,onClick:ge}," Add folder ",8,Zk),y("button",{class:"thread-composer-attach-item",type:"button",disabled:je.value,onClick:G}," Take photo ",8,e0)])):re("",!0)],512),V.value?re("",!0):(b(),I(Le,{key:0},[Ie(zo,{class:"thread-composer-control","model-value":e.selectedModel,options:at.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":M},null,8,["model-value","options","disabled"]),Ie(vk,{class:"thread-composer-control",options:We.value,"selected-values":Xe.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:pn},null,8,["options","selected-values","disabled"]),Ie(zo,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:me,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":W},null,8,["model-value","disabled"])],64)),y("div",{class:ot(["thread-composer-actions",{"thread-composer-actions--recording":V.value}])},[ve(u)==="recording"?(b(),I("div",t0,[y("canvas",{ref_key:"dictationWaveformCanvasRef",ref:T,class:"thread-composer-dictation-waveform"},null,512)])):re("",!0),ve(u)==="recording"?(b(),I("span",n0,se(we.value),1)):re("",!0),ve(p)?(b(),I("button",{key:2,class:ot(["thread-composer-mic",{"thread-composer-mic--active":ve(u)==="recording"}]),type:"button","aria-label":ne.value,title:ne.value,disabled:je.value,onClick:F,onPointerdown:x,onPointerup:U,onPointercancel:U},[ve(u)==="recording"?(b(),ft(tu,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(b(),ft(z_,{key:1,class:"thread-composer-mic-icon"}))],42,r0)):re("",!0),e.isTurnInProgress?(b(),I("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:k},[Ie(tu,{class:"thread-composer-stop-icon"})],8,s0)):(b(),I("button",{key:4,class:ot(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&ze.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&ze.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${ze.value}`:"Send",disabled:!Qe.value,onClick:m[1]||(m[1]=S=>w(e.isTurnInProgress?ze.value:"steer"))},[Ie(F_,{class:"thread-composer-submit-icon"})],10,o0))],2)],2)],2),y("input",{ref_key:"photoLibraryInputRef",ref:P,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:je.value,onChange:Et},null,40,i0),y("input",{ref_key:"cameraCaptureInputRef",ref:D,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:je.value,onChange:mt},null,40,a0),y("input",{ref_key:"folderPickerInputRef",ref:H,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:je.value,onChange:yt},null,40,l0)],32))}}),nu=et(c0,[["__scopeId","data-v-c1acf67b"]]),u0={key:0,class:"queued-messages"},d0={class:"queued-messages-inner"},f0={class:"queued-row-text"},h0={class:"queued-row-actions"},p0=["onClick"],m0=["onClick"],g0=$t({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(b(),I("div",u0,[y("div",d0,[(b(!0),I(Le,null,bt(e.messages,r=>(b(),I("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=y("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[y("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)),y("span",f0,se(r.text),1),y("div",h0,[y("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,p0),y("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]=[y("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[y("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,m0)])]))),128))])])):re("",!0)}}),v0=et(g0,[["__scopeId","data-v-ea583733"]]),y0={key:0,class:"rate-limit-status","aria-live":"polite"},w0=["title"],b0={class:"rate-limit-card-header"},_0={class:"rate-limit-card-title"},k0={key:0,class:"rate-limit-card-plan"},T0={class:"rate-limit-card-metrics"},S0={key:0,class:"rate-limit-card-footer"},I0=$t({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){function t(N){var P,D;return((P=N.limitId)==null?void 0:P.trim())||((D=N.limitName)==null?void 0:D.trim())||"__default__"}function n(N){var P,D;return((P=N.limitName)==null?void 0:P.trim())||((D=N.limitId)==null?void 0:D.trim())||"Rate limits"}function r(N){const P=N.trim();return P?P.replace(/[_-]+/g," ").replace(/\b\w/g,D=>D.toUpperCase()):""}function s(N){return!N||N<=0?"Window":N%1440===0?`${N/1440}d`:N%60===0?`${N/60}h`:N<60?`${N}m`:`${Math.round(N/60*10)/10}h`}function o(N){const P=Math.max(0,Math.min(100,100-N));return`${Math.round(P)}% left`}function i(N){return`${Math.round(N)}%`}function a(N,P){return{key:P,label:`${s(N.windowDurationMins)} ${o(N.usedPercent)}`}}function l(N){const P=[];return N.primary&&P.push(a(N.primary,"primary")),N.secondary&&P.push(a(N.secondary,"secondary")),P}function d(N){if(!N)return"";const P=new Date(N*1e3),D=P.getMonth()+1,H=String(P.getDate()).padStart(2,"0"),oe=String(P.getHours()).padStart(2,"0"),ae=String(P.getMinutes()).padStart(2,"0");return`${D}.${H} ${oe}:${ae}`}function u(N){if(!(N!=null&&N.resetsAt))return"";const P=N.resetsAt*1e3-Date.now();if(P<=0)return"Resetting now";const D=Math.round(P/6e4);if(D<60)return`Resets in ${D}m`;const H=Math.round(D/60);return H<24?`Resets in ${H}h`:`Resets in ${Math.round(H/24)}d`}function p(N){return[N.primary,N.secondary].filter(P=>P!==null)}function g(N){const P=p(N);return P.length===0?null:[...P].sort((D,H)=>{const oe=D.windowDurationMins??Number.MAX_SAFE_INTEGER,ae=H.windowDurationMins??Number.MAX_SAFE_INTEGER;return oe!==ae?oe-ae:(D.resetsAt??Number.MAX_SAFE_INTEGER)-(H.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function T(N){const P=p(N);if(P.length===0)return"";const D=[...P].sort((oe,ae)=>{const pe=oe.windowDurationMins??-1,Te=ae.windowDurationMins??-1;return pe!==Te?Te-pe:(ae.resetsAt??-1)-(oe.resetsAt??-1)})[0],H=d(D.resetsAt);return H||""}function j(N){const P=N.credits;return P?P.unlimited?"Unlimited credits":P.balance?`Credits ${P.balance}`:P.hasCredits?"Credits available":"":""}function R(N){return[u(g(N)),T(N),j(N)].filter(P=>P.length>0)}function B(N){const P=[n(N)];for(const D of l(N))P.push(D.label);for(const D of p(N))P.push(`${s(D.windowDurationMins)} used ${i(D.usedPercent)}`);for(const D of R(N))P.push(D);return P.join(`
41
+ `)}return(N,P)=>e.snapshots.length>0?(b(),I("aside",y0,[(b(!0),I(Le,null,bt(e.snapshots,D=>(b(),I("div",{key:t(D),class:"rate-limit-card",title:B(D)},[y("div",b0,[y("span",_0,se(n(D)),1),D.planType?(b(),I("span",k0,se(r(D.planType)),1)):re("",!0)]),y("div",T0,[(b(!0),I(Le,null,bt(l(D),H=>(b(),I("span",{key:H.key,class:"rate-limit-card-metric"},se(H.label),1))),128))]),R(D).length>0?(b(),I("div",S0,se(R(D).join(" | ")),1)):re("",!0)],8,w0))),128))])):re("",!0)}}),E0=et(I0,[["__scopeId","data-v-df88906b"]]),C0={class:"runtime-dropdown-trigger-label"},A0={key:0,class:"runtime-dropdown-menu-wrap"},R0={class:"runtime-dropdown-menu"},P0=["onClick"],x0={class:"runtime-dropdown-option-label"},M0={key:0,class:"runtime-dropdown-option-check"},O0=$t({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(!1),i=[{value:"local",label:"Local project",icon:hl},{value:"worktree",label:"New worktree",icon:xo}],a=ue(()=>i.find(u=>u.value===n.modelValue)??i[0]);function l(u){r("update:modelValue",u),o.value=!1}function d(u){if(!o.value)return;const p=s.value;if(!p)return;const g=u.target;g instanceof Node&&(p.contains(g)||(o.value=!1))}return nr(()=>{window.addEventListener("pointerdown",d)}),rr(()=>{window.removeEventListener("pointerdown",d)}),(u,p)=>(b(),I("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[y("button",{class:"runtime-dropdown-trigger",type:"button",onClick:p[0]||(p[0]=g=>o.value=!o.value)},[(b(),ft(wa(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),y("span",C0,se(a.value.label),1),Ie(pi,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(b(),I("div",A0,[y("div",R0,[p[1]||(p[1]=y("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(b(),I(Le,null,bt(i,g=>y("button",{key:g.value,class:ot(["runtime-dropdown-option",{"is-selected":e.modelValue===g.value}]),type:"button",onClick:T=>l(g.value)},[(b(),ft(wa(g.icon),{class:"runtime-dropdown-option-icon"})),y("span",x0,se(g.label),1),e.modelValue===g.value?(b(),I("span",M0,"✓")):re("",!0)],10,P0)),64))])])):re("",!0)],512))}}),N0=et(O0,[["__scopeId","data-v-9c9b71e5"]]),$0={},D0={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function L0(e,t){return b(),I("svg",D0,[...t[0]||(t[0]=[y("circle",{cx:"11",cy:"11",r:"8"},null,-1),y("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const xa=et($0,[["render",L0]]),j0={class:"skill-card-top"},B0=["src","alt"],U0={key:1,class:"skill-card-avatar-fallback"},F0={class:"skill-card-info"},H0={class:"skill-card-header"},V0={class:"skill-card-name"},W0={key:0,class:"skill-card-badge-disabled"},z0={key:1,class:"skill-card-badge"},q0={class:"skill-card-owner"},G0={key:0,class:"skill-card-desc"},K0={key:1,class:"skill-card-date"},J0=$t({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=ue(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function r(s){const o=s.target;o.style.display="none"}return(s,o)=>(b(),I("button",{class:ot(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[y("div",j0,[e.skill.avatarUrl?(b(),I("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,B0)):(b(),I("div",U0,se(e.skill.owner.charAt(0)),1)),y("div",F0,[y("div",H0,[y("span",V0,se(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(b(),I("span",W0,"Disabled")):e.skill.installed?(b(),I("span",z0,"Installed")):re("",!0)]),y("span",q0,se(e.skill.owner),1)])]),e.skill.description?(b(),I("p",G0,se(e.skill.description),1)):re("",!0),n.value?(b(),I("span",K0,se(n.value),1)):re("",!0)],2))}}),ru=et(J0,[["__scopeId","data-v-2a1e8196"]]),Y0={class:"sdm-panel"},X0={class:"sdm-header"},Q0={class:"sdm-title-area"},Z0=["src","alt"],eT={class:"sdm-title-col"},tT={class:"sdm-title-row"},nT={class:"sdm-title"},rT={key:0,class:"sdm-badge-disabled"},sT={class:"sdm-owner"},oT={class:"sdm-body"},iT={key:0,class:"sdm-desc"},aT={key:1,class:"sdm-readme-loading"},lT=["innerHTML"],cT=["href"],uT={class:"sdm-footer"},dT={class:"sdm-footer-actions"},fT=["disabled"],hT=["disabled"],pT=["disabled"],mT=$t({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(""),i=L(!1),a=ue(()=>s.value??n.skill.enabled??!0),l=ue(()=>n.isInstalling===!0||n.isUninstalling===!0),d=ue(()=>{const R=o.value;if(!R)return"";const B=R.replace(/^---[\s\S]*?---\s*/,"");return u(B)});function u(R){return R.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 p(){if(!(!n.skill.owner||!n.skill.name)){i.value=!0,o.value="";try{const R=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),B=await fetch(`/codex-api/skills-hub/readme?${R}`);if(!B.ok)return;const N=await B.json();o.value=N.content??""}catch{}finally{i.value=!1}}}ht(()=>n.visible,R=>{R&&(s.value=null,o.value="",p())});function g(){r("install",n.skill)}function T(){r("uninstall",n.skill)}function j(){const R=!a.value;s.value=R,r("toggle-enabled",n.skill,R)}return(R,B)=>(b(),ft(Bo,{to:"body"},[e.visible?(b(),I("div",{key:0,class:"sdm-overlay",onClick:B[1]||(B[1]=st(N=>R.$emit("close"),["self"]))},[y("div",Y0,[y("div",X0,[y("div",Q0,[e.skill.avatarUrl?(b(),I("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,Z0)):re("",!0),y("div",eT,[y("div",tT,[y("h3",nT,se(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(b(),I("span",rT,"Disabled")):re("",!0)]),y("span",sT,se(e.skill.owner),1)])]),y("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:B[0]||(B[0]=N=>R.$emit("close"))},[Ie(pl,{class:"sdm-close-icon"})])]),y("div",oT,[e.skill.description?(b(),I("p",iT,se(e.skill.description),1)):re("",!0),i.value?(b(),I("div",aT,"Loading skill contents...")):o.value?(b(),I("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,lT)):re("",!0),y("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,cT)]),y("div",uT,[y("div",dT,[e.skill.installed?(b(),I("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:T},se(n.isUninstalling?"Uninstalling...":"Uninstall"),9,fT)):(b(),I("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:g},se(n.isInstalling?"Installing...":"Install"),9,hT)),e.skill.installed?(b(),I("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:j},se(a.value?"Disable":"Enable"),9,pT)):re("",!0)])])])])):re("",!0)]))}}),gT=et(mT,[["__scopeId","data-v-19a385ca"]]),vT=()=>{};var su={};/**
42
+ * @license
43
+ * Copyright 2017 Google LLC
44
+ *
45
+ * Licensed under the Apache License, Version 2.0 (the "License");
46
+ * you may not use this file except in compliance with the License.
47
+ * You may obtain a copy of the License at
48
+ *
49
+ * http://www.apache.org/licenses/LICENSE-2.0
50
+ *
51
+ * Unless required by applicable law or agreed to in writing, software
52
+ * distributed under the License is distributed on an "AS IS" BASIS,
53
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54
+ * See the License for the specific language governing permissions and
55
+ * limitations under the License.
56
+ */const Sf=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},yT=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("")},If={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,d=l?e[s+2]:0,u=o>>2,p=(o&3)<<4|a>>4;let g=(a&15)<<2|d>>6,T=d&63;l||(T=64,i||(g=64)),r.push(n[u],n[p],n[g],n[T])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Sf(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):yT(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 d=s<e.length?n[e.charAt(s)]:64;++s;const p=s<e.length?n[e.charAt(s)]:64;if(++s,o==null||a==null||d==null||p==null)throw new wT;const g=o<<2|a>>4;if(r.push(g),d!==64){const T=a<<4&240|d>>2;if(r.push(T),p!==64){const j=d<<6&192|p;r.push(j)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class wT extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const bT=function(e){const t=Sf(e);return If.encodeByteArray(t,!0)},Ef=function(e){return bT(e).replace(/\./g,"")},Cf=function(e){try{return If.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
57
+ * @license
58
+ * Copyright 2022 Google LLC
59
+ *
60
+ * Licensed under the Apache License, Version 2.0 (the "License");
61
+ * you may not use this file except in compliance with the License.
62
+ * You may obtain a copy of the License at
63
+ *
64
+ * http://www.apache.org/licenses/LICENSE-2.0
65
+ *
66
+ * Unless required by applicable law or agreed to in writing, software
67
+ * distributed under the License is distributed on an "AS IS" BASIS,
68
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
69
+ * See the License for the specific language governing permissions and
70
+ * limitations under the License.
71
+ */function _T(){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.")}/**
72
+ * @license
73
+ * Copyright 2022 Google LLC
74
+ *
75
+ * Licensed under the Apache License, Version 2.0 (the "License");
76
+ * you may not use this file except in compliance with the License.
77
+ * You may obtain a copy of the License at
78
+ *
79
+ * http://www.apache.org/licenses/LICENSE-2.0
80
+ *
81
+ * Unless required by applicable law or agreed to in writing, software
82
+ * distributed under the License is distributed on an "AS IS" BASIS,
83
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
84
+ * See the License for the specific language governing permissions and
85
+ * limitations under the License.
86
+ */const kT=()=>_T().__FIREBASE_DEFAULTS__,TT=()=>{if(typeof process>"u"||typeof su>"u")return;const e=su.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},ST=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&Cf(e[1]);return t&&JSON.parse(t)},vl=()=>{try{return vT()||kT()||TT()||ST()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},IT=e=>{var t,n;return(n=(t=vl())==null?void 0:t.emulatorHosts)==null?void 0:n[e]},Af=()=>{var e;return(e=vl())==null?void 0:e.config},Rf=e=>{var t;return(t=vl())==null?void 0:t[`_${e}`]};/**
87
+ * @license
88
+ * Copyright 2017 Google LLC
89
+ *
90
+ * Licensed under the Apache License, Version 2.0 (the "License");
91
+ * you may not use this file except in compliance with the License.
92
+ * You may obtain a copy of the License at
93
+ *
94
+ * http://www.apache.org/licenses/LICENSE-2.0
95
+ *
96
+ * Unless required by applicable law or agreed to in writing, software
97
+ * distributed under the License is distributed on an "AS IS" BASIS,
98
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99
+ * See the License for the specific language governing permissions and
100
+ * limitations under the License.
101
+ */class ET{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(n,r))}}}/**
102
+ * @license
103
+ * Copyright 2025 Google LLC
104
+ *
105
+ * Licensed under the Apache License, Version 2.0 (the "License");
106
+ * you may not use this file except in compliance with the License.
107
+ * You may obtain a copy of the License at
108
+ *
109
+ * http://www.apache.org/licenses/LICENSE-2.0
110
+ *
111
+ * Unless required by applicable law or agreed to in writing, software
112
+ * distributed under the License is distributed on an "AS IS" BASIS,
113
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
114
+ * See the License for the specific language governing permissions and
115
+ * limitations under the License.
116
+ */function mi(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function CT(e){return(await fetch(e,{credentials:"include"})).ok}const Hs={};function AT(){const e={prod:[],emulator:[]};for(const t of Object.keys(Hs))Hs[t]?e.emulator.push(t):e.prod.push(t);return e}function RT(e){let t=document.getElementById(e),n=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),n=!0),{created:n,element:t}}let ou=!1;function PT(e,t){if(typeof window>"u"||typeof document>"u"||!mi(window.location.host)||Hs[e]===t||Hs[e]||ou)return;Hs[e]=t;function n(g){return`__firebase__banner__${g}`}const r="__firebase__banner",o=AT().prod.length>0;function i(){const g=document.getElementById(r);g&&g.remove()}function a(g){g.style.display="flex",g.style.background="#7faaf0",g.style.position="fixed",g.style.bottom="5px",g.style.left="5px",g.style.padding=".5em",g.style.borderRadius="5px",g.style.alignItems="center"}function l(g,T){g.setAttribute("width","24"),g.setAttribute("id",T),g.setAttribute("height","24"),g.setAttribute("viewBox","0 0 24 24"),g.setAttribute("fill","none"),g.style.marginLeft="-6px"}function d(){const g=document.createElement("span");return g.style.cursor="pointer",g.style.marginLeft="16px",g.style.fontSize="24px",g.innerHTML=" &times;",g.onclick=()=>{ou=!0,i()},g}function u(g,T){g.setAttribute("id",T),g.innerText="Learn more",g.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",g.setAttribute("target","__blank"),g.style.paddingLeft="5px",g.style.textDecoration="underline"}function p(){const g=RT(r),T=n("text"),j=document.getElementById(T)||document.createElement("span"),R=n("learnmore"),B=document.getElementById(R)||document.createElement("a"),N=n("preprendIcon"),P=document.getElementById(N)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(g.created){const D=g.element;a(D),u(B,R);const H=d();l(P,N),D.append(P,j,B,H),document.body.appendChild(D)}o?(j.innerText="Preview backend disconnected.",P.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
117
+ <path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
118
+ </g>
119
+ <defs>
120
+ <clipPath id="clip0_6013_33858">
121
+ <rect width="24" height="24" fill="white"/>
122
+ </clipPath>
123
+ </defs>`):(P.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
124
+ <path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
125
+ </g>
126
+ <defs>
127
+ <clipPath id="clip0_6083_34804">
128
+ <rect width="24" height="24" fill="white"/>
129
+ </clipPath>
130
+ </defs>`,j.innerText="Preview backend running in this workspace."),j.setAttribute("id",T)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",p):p()}/**
131
+ * @license
132
+ * Copyright 2017 Google LLC
133
+ *
134
+ * Licensed under the Apache License, Version 2.0 (the "License");
135
+ * you may not use this file except in compliance with the License.
136
+ * You may obtain a copy of the License at
137
+ *
138
+ * http://www.apache.org/licenses/LICENSE-2.0
139
+ *
140
+ * Unless required by applicable law or agreed to in writing, software
141
+ * distributed under the License is distributed on an "AS IS" BASIS,
142
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
143
+ * See the License for the specific language governing permissions and
144
+ * limitations under the License.
145
+ */function en(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function xT(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(en())}function MT(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function OT(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function NT(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function $T(){const e=en();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function DT(){try{return typeof indexedDB=="object"}catch{return!1}}function LT(){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)}})}/**
146
+ * @license
147
+ * Copyright 2017 Google LLC
148
+ *
149
+ * Licensed under the Apache License, Version 2.0 (the "License");
150
+ * you may not use this file except in compliance with the License.
151
+ * You may obtain a copy of the License at
152
+ *
153
+ * http://www.apache.org/licenses/LICENSE-2.0
154
+ *
155
+ * Unless required by applicable law or agreed to in writing, software
156
+ * distributed under the License is distributed on an "AS IS" BASIS,
157
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
158
+ * See the License for the specific language governing permissions and
159
+ * limitations under the License.
160
+ */const jT="FirebaseError";class Ir extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=jT,Object.setPrototypeOf(this,Ir.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ao.prototype.create)}}class ao{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?BT(o,r):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new Ir(s,a,r)}}function BT(e,t){return e.replace(UT,(n,r)=>{const s=t[r];return s!=null?String(s):`<${r}?>`})}const UT=/\{\$([^}]+)}/g;function FT(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function ps(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(iu(o)&&iu(i)){if(!ps(o,i))return!1}else if(o!==i)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function iu(e){return e!==null&&typeof e=="object"}/**
161
+ * @license
162
+ * Copyright 2017 Google LLC
163
+ *
164
+ * Licensed under the Apache License, Version 2.0 (the "License");
165
+ * you may not use this file except in compliance with the License.
166
+ * You may obtain a copy of the License at
167
+ *
168
+ * http://www.apache.org/licenses/LICENSE-2.0
169
+ *
170
+ * Unless required by applicable law or agreed to in writing, software
171
+ * distributed under the License is distributed on an "AS IS" BASIS,
172
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
173
+ * See the License for the specific language governing permissions and
174
+ * limitations under the License.
175
+ */function lo(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 HT(e,t){const n=new VT(e,t);return n.subscribe.bind(n)}class VT{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.");WT(t,["next","error","complete"])?s=t:s={next:t,error:n,complete:r},s.next===void 0&&(s.next=Qi),s.error===void 0&&(s.error=Qi),s.complete===void 0&&(s.complete=Qi);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 WT(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 Qi(){}/**
176
+ * @license
177
+ * Copyright 2021 Google LLC
178
+ *
179
+ * Licensed under the Apache License, Version 2.0 (the "License");
180
+ * you may not use this file except in compliance with the License.
181
+ * You may obtain a copy of the License at
182
+ *
183
+ * http://www.apache.org/licenses/LICENSE-2.0
184
+ *
185
+ * Unless required by applicable law or agreed to in writing, software
186
+ * distributed under the License is distributed on an "AS IS" BASIS,
187
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
188
+ * See the License for the specific language governing permissions and
189
+ * limitations under the License.
190
+ */function ys(e){return e&&e._delegate?e._delegate:e}class ms{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}}/**
191
+ * @license
192
+ * Copyright 2019 Google LLC
193
+ *
194
+ * Licensed under the Apache License, Version 2.0 (the "License");
195
+ * you may not use this file except in compliance with the License.
196
+ * You may obtain a copy of the License at
197
+ *
198
+ * http://www.apache.org/licenses/LICENSE-2.0
199
+ *
200
+ * Unless required by applicable law or agreed to in writing, software
201
+ * distributed under the License is distributed on an "AS IS" BASIS,
202
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
203
+ * See the License for the specific language governing permissions and
204
+ * limitations under the License.
205
+ */const Nr="[DEFAULT]";/**
206
+ * @license
207
+ * Copyright 2019 Google LLC
208
+ *
209
+ * Licensed under the Apache License, Version 2.0 (the "License");
210
+ * you may not use this file except in compliance with the License.
211
+ * You may obtain a copy of the License at
212
+ *
213
+ * http://www.apache.org/licenses/LICENSE-2.0
214
+ *
215
+ * Unless required by applicable law or agreed to in writing, software
216
+ * distributed under the License is distributed on an "AS IS" BASIS,
217
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
218
+ * See the License for the specific language governing permissions and
219
+ * limitations under the License.
220
+ */class zT{constructor(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){const r=new ET;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:n});s&&r.resolve(s)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(t){const n=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),r=(t==null?void 0:t.optional)??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(s){if(r)return null;throw s}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(GT(t))try{this.getOrInitializeService({instanceIdentifier:Nr})}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=Nr){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=Nr){return this.instances.has(t)}getOptions(t=Nr){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:qT(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=Nr){return this.component?this.component.multipleInstances?t:Nr:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function qT(e){return e===Nr?void 0:e}function GT(e){return e.instantiationMode==="EAGER"}/**
221
+ * @license
222
+ * Copyright 2019 Google LLC
223
+ *
224
+ * Licensed under the Apache License, Version 2.0 (the "License");
225
+ * you may not use this file except in compliance with the License.
226
+ * You may obtain a copy of the License at
227
+ *
228
+ * http://www.apache.org/licenses/LICENSE-2.0
229
+ *
230
+ * Unless required by applicable law or agreed to in writing, software
231
+ * distributed under the License is distributed on an "AS IS" BASIS,
232
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
233
+ * See the License for the specific language governing permissions and
234
+ * limitations under the License.
235
+ */class KT{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 zT(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
236
+ * @license
237
+ * Copyright 2017 Google LLC
238
+ *
239
+ * Licensed under the Apache License, Version 2.0 (the "License");
240
+ * you may not use this file except in compliance with the License.
241
+ * You may obtain a copy of the License at
242
+ *
243
+ * http://www.apache.org/licenses/LICENSE-2.0
244
+ *
245
+ * Unless required by applicable law or agreed to in writing, software
246
+ * distributed under the License is distributed on an "AS IS" BASIS,
247
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
248
+ * See the License for the specific language governing permissions and
249
+ * limitations under the License.
250
+ */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 JT={debug:wt.DEBUG,verbose:wt.VERBOSE,info:wt.INFO,warn:wt.WARN,error:wt.ERROR,silent:wt.SILENT},YT=wt.INFO,XT={[wt.DEBUG]:"log",[wt.VERBOSE]:"log",[wt.INFO]:"info",[wt.WARN]:"warn",[wt.ERROR]:"error"},QT=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),s=XT[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 Pf{constructor(t){this.name=t,this._logLevel=YT,this._logHandler=QT,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"?JT[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 ZT=(e,t)=>t.some(n=>e instanceof n);let au,lu;function e1(){return au||(au=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function t1(){return lu||(lu=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const xf=new WeakMap,Ma=new WeakMap,Mf=new WeakMap,Zi=new WeakMap,yl=new WeakMap;function n1(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(_r(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&xf.set(n,e)}).catch(()=>{}),yl.set(t,e),t}function r1(e){if(Ma.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)});Ma.set(e,t)}let Oa={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Ma.get(e);if(t==="objectStoreNames")return e.objectStoreNames||Mf.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return _r(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 s1(e){Oa=e(Oa)}function o1(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(ea(this),t,...n);return Mf.set(r,t.sort?t.sort():[t]),_r(r)}:t1().includes(e)?function(...t){return e.apply(ea(this),t),_r(xf.get(this))}:function(...t){return _r(e.apply(ea(this),t))}}function i1(e){return typeof e=="function"?o1(e):(e instanceof IDBTransaction&&r1(e),ZT(e,e1())?new Proxy(e,Oa):e)}function _r(e){if(e instanceof IDBRequest)return n1(e);if(Zi.has(e))return Zi.get(e);const t=i1(e);return t!==e&&(Zi.set(e,t),yl.set(t,e)),t}const ea=e=>yl.get(e);function a1(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=_r(i);return r&&i.addEventListener("upgradeneeded",l=>{r(_r(i.result),l.oldVersion,l.newVersion,_r(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",d=>s(d.oldVersion,d.newVersion,d))}).catch(()=>{}),a}const l1=["get","getKey","getAll","getAllKeys","count"],c1=["put","add","delete","clear"],ta=new Map;function cu(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(ta.get(t))return ta.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=c1.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||l1.includes(n)))return;const o=async function(i,...a){const l=this.transaction(i,s?"readwrite":"readonly");let d=l.store;return r&&(d=d.index(a.shift())),(await Promise.all([d[n](...a),s&&l.done]))[0]};return ta.set(t,o),o}s1(e=>({...e,get:(t,n,r)=>cu(t,n)||e.get(t,n,r),has:(t,n)=>!!cu(t,n)||e.has(t,n)}));/**
251
+ * @license
252
+ * Copyright 2019 Google LLC
253
+ *
254
+ * Licensed under the Apache License, Version 2.0 (the "License");
255
+ * you may not use this file except in compliance with the License.
256
+ * You may obtain a copy of the License at
257
+ *
258
+ * http://www.apache.org/licenses/LICENSE-2.0
259
+ *
260
+ * Unless required by applicable law or agreed to in writing, software
261
+ * distributed under the License is distributed on an "AS IS" BASIS,
262
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
263
+ * See the License for the specific language governing permissions and
264
+ * limitations under the License.
265
+ */class u1{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(d1(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function d1(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const Na="@firebase/app",uu="0.14.9";/**
266
+ * @license
267
+ * Copyright 2019 Google LLC
268
+ *
269
+ * Licensed under the Apache License, Version 2.0 (the "License");
270
+ * you may not use this file except in compliance with the License.
271
+ * You may obtain a copy of the License at
272
+ *
273
+ * http://www.apache.org/licenses/LICENSE-2.0
274
+ *
275
+ * Unless required by applicable law or agreed to in writing, software
276
+ * distributed under the License is distributed on an "AS IS" BASIS,
277
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
278
+ * See the License for the specific language governing permissions and
279
+ * limitations under the License.
280
+ */const Zn=new Pf("@firebase/app"),f1="@firebase/app-compat",h1="@firebase/analytics-compat",p1="@firebase/analytics",m1="@firebase/app-check-compat",g1="@firebase/app-check",v1="@firebase/auth",y1="@firebase/auth-compat",w1="@firebase/database",b1="@firebase/data-connect",_1="@firebase/database-compat",k1="@firebase/functions",T1="@firebase/functions-compat",S1="@firebase/installations",I1="@firebase/installations-compat",E1="@firebase/messaging",C1="@firebase/messaging-compat",A1="@firebase/performance",R1="@firebase/performance-compat",P1="@firebase/remote-config",x1="@firebase/remote-config-compat",M1="@firebase/storage",O1="@firebase/storage-compat",N1="@firebase/firestore",$1="@firebase/ai",D1="@firebase/firestore-compat",L1="firebase",j1="12.10.0";/**
281
+ * @license
282
+ * Copyright 2019 Google LLC
283
+ *
284
+ * Licensed under the Apache License, Version 2.0 (the "License");
285
+ * you may not use this file except in compliance with the License.
286
+ * You may obtain a copy of the License at
287
+ *
288
+ * http://www.apache.org/licenses/LICENSE-2.0
289
+ *
290
+ * Unless required by applicable law or agreed to in writing, software
291
+ * distributed under the License is distributed on an "AS IS" BASIS,
292
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
293
+ * See the License for the specific language governing permissions and
294
+ * limitations under the License.
295
+ */const $a="[DEFAULT]",B1={[Na]:"fire-core",[f1]:"fire-core-compat",[p1]:"fire-analytics",[h1]:"fire-analytics-compat",[g1]:"fire-app-check",[m1]:"fire-app-check-compat",[v1]:"fire-auth",[y1]:"fire-auth-compat",[w1]:"fire-rtdb",[b1]:"fire-data-connect",[_1]:"fire-rtdb-compat",[k1]:"fire-fn",[T1]:"fire-fn-compat",[S1]:"fire-iid",[I1]:"fire-iid-compat",[E1]:"fire-fcm",[C1]:"fire-fcm-compat",[A1]:"fire-perf",[R1]:"fire-perf-compat",[P1]:"fire-rc",[x1]:"fire-rc-compat",[M1]:"fire-gcs",[O1]:"fire-gcs-compat",[N1]:"fire-fst",[D1]:"fire-fst-compat",[$1]:"fire-vertex","fire-js":"fire-js",[L1]:"fire-js-all"};/**
296
+ * @license
297
+ * Copyright 2019 Google LLC
298
+ *
299
+ * Licensed under the Apache License, Version 2.0 (the "License");
300
+ * you may not use this file except in compliance with the License.
301
+ * You may obtain a copy of the License at
302
+ *
303
+ * http://www.apache.org/licenses/LICENSE-2.0
304
+ *
305
+ * Unless required by applicable law or agreed to in writing, software
306
+ * distributed under the License is distributed on an "AS IS" BASIS,
307
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
308
+ * See the License for the specific language governing permissions and
309
+ * limitations under the License.
310
+ */const eo=new Map,U1=new Map,Da=new Map;function du(e,t){try{e.container.addComponent(t)}catch(n){Zn.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function to(e){const t=e.name;if(Da.has(t))return Zn.debug(`There were multiple attempts to register component ${t}.`),!1;Da.set(t,e);for(const n of eo.values())du(n,e);for(const n of U1.values())du(n,e);return!0}function Of(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function An(e){return e==null?!1:e.settings!==void 0}/**
311
+ * @license
312
+ * Copyright 2019 Google LLC
313
+ *
314
+ * Licensed under the Apache License, Version 2.0 (the "License");
315
+ * you may not use this file except in compliance with the License.
316
+ * You may obtain a copy of the License at
317
+ *
318
+ * http://www.apache.org/licenses/LICENSE-2.0
319
+ *
320
+ * Unless required by applicable law or agreed to in writing, software
321
+ * distributed under the License is distributed on an "AS IS" BASIS,
322
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
323
+ * See the License for the specific language governing permissions and
324
+ * limitations under the License.
325
+ */const F1={"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."},kr=new ao("app","Firebase",F1);/**
326
+ * @license
327
+ * Copyright 2019 Google LLC
328
+ *
329
+ * Licensed under the Apache License, Version 2.0 (the "License");
330
+ * you may not use this file except in compliance with the License.
331
+ * You may obtain a copy of the License at
332
+ *
333
+ * http://www.apache.org/licenses/LICENSE-2.0
334
+ *
335
+ * Unless required by applicable law or agreed to in writing, software
336
+ * distributed under the License is distributed on an "AS IS" BASIS,
337
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
338
+ * See the License for the specific language governing permissions and
339
+ * limitations under the License.
340
+ */class H1{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 ms("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 kr.create("app-deleted",{appName:this._name})}}/**
341
+ * @license
342
+ * Copyright 2019 Google LLC
343
+ *
344
+ * Licensed under the Apache License, Version 2.0 (the "License");
345
+ * you may not use this file except in compliance with the License.
346
+ * You may obtain a copy of the License at
347
+ *
348
+ * http://www.apache.org/licenses/LICENSE-2.0
349
+ *
350
+ * Unless required by applicable law or agreed to in writing, software
351
+ * distributed under the License is distributed on an "AS IS" BASIS,
352
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
353
+ * See the License for the specific language governing permissions and
354
+ * limitations under the License.
355
+ */const co=j1;function Nf(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:$a,automaticDataCollectionEnabled:!0,...t},s=r.name;if(typeof s!="string"||!s)throw kr.create("bad-app-name",{appName:String(s)});if(n||(n=Af()),!n)throw kr.create("no-options");const o=eo.get(s);if(o){if(ps(n,o.options)&&ps(r,o.config))return o;throw kr.create("duplicate-app",{appName:s})}const i=new KT(s);for(const l of Da.values())i.addComponent(l);const a=new H1(n,r,i);return eo.set(s,a),a}function $f(e=$a){const t=eo.get(e);if(!t&&e===$a&&Af())return Nf();if(!t)throw kr.create("no-app",{appName:e});return t}function V1(){return Array.from(eo.values())}function as(e,t,n){let r=B1[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 "/")`),Zn.warn(i.join(" "));return}to(new ms(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/**
356
+ * @license
357
+ * Copyright 2021 Google LLC
358
+ *
359
+ * Licensed under the Apache License, Version 2.0 (the "License");
360
+ * you may not use this file except in compliance with the License.
361
+ * You may obtain a copy of the License at
362
+ *
363
+ * http://www.apache.org/licenses/LICENSE-2.0
364
+ *
365
+ * Unless required by applicable law or agreed to in writing, software
366
+ * distributed under the License is distributed on an "AS IS" BASIS,
367
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
368
+ * See the License for the specific language governing permissions and
369
+ * limitations under the License.
370
+ */const W1="firebase-heartbeat-database",z1=1,no="firebase-heartbeat-store";let na=null;function Df(){return na||(na=a1(W1,z1,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(no)}catch(n){console.warn(n)}}}}).catch(e=>{throw kr.create("idb-open",{originalErrorMessage:e.message})})),na}async function q1(e){try{const n=(await Df()).transaction(no),r=await n.objectStore(no).get(Lf(e));return await n.done,r}catch(t){if(t instanceof Ir)Zn.warn(t.message);else{const n=kr.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});Zn.warn(n.message)}}}async function fu(e,t){try{const r=(await Df()).transaction(no,"readwrite");await r.objectStore(no).put(t,Lf(e)),await r.done}catch(n){if(n instanceof Ir)Zn.warn(n.message);else{const r=kr.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Zn.warn(r.message)}}}function Lf(e){return`${e.name}!${e.options.appId}`}/**
371
+ * @license
372
+ * Copyright 2021 Google LLC
373
+ *
374
+ * Licensed under the Apache License, Version 2.0 (the "License");
375
+ * you may not use this file except in compliance with the License.
376
+ * You may obtain a copy of the License at
377
+ *
378
+ * http://www.apache.org/licenses/LICENSE-2.0
379
+ *
380
+ * Unless required by applicable law or agreed to in writing, software
381
+ * distributed under the License is distributed on an "AS IS" BASIS,
382
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
383
+ * See the License for the specific language governing permissions and
384
+ * limitations under the License.
385
+ */const G1=1024,K1=30;class J1{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new X1(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=hu();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>K1){const i=Q1(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){Zn.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=hu(),{heartbeatsToSend:r,unsentEntries:s}=Y1(this._heartbeatsCache.heartbeats),o=Ef(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 Zn.warn(n),""}}}function hu(){return new Date().toISOString().substring(0,10)}function Y1(e,t=G1){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),pu(n)>t){o.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),pu(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class X1{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return DT()?LT().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await q1(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 fu(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 fu(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...t.heartbeats]})}else return}}function pu(e){return Ef(JSON.stringify({version:2,heartbeats:e})).length}function Q1(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}/**
386
+ * @license
387
+ * Copyright 2019 Google LLC
388
+ *
389
+ * Licensed under the Apache License, Version 2.0 (the "License");
390
+ * you may not use this file except in compliance with the License.
391
+ * You may obtain a copy of the License at
392
+ *
393
+ * http://www.apache.org/licenses/LICENSE-2.0
394
+ *
395
+ * Unless required by applicable law or agreed to in writing, software
396
+ * distributed under the License is distributed on an "AS IS" BASIS,
397
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
398
+ * See the License for the specific language governing permissions and
399
+ * limitations under the License.
400
+ */function Z1(e){to(new ms("platform-logger",t=>new u1(t),"PRIVATE")),to(new ms("heartbeat",t=>new J1(t),"PRIVATE")),as(Na,uu,e),as(Na,uu,"esm2020"),as("fire-js","")}Z1("");var eS="firebase",tS="12.10.0";/**
401
+ * @license
402
+ * Copyright 2020 Google LLC
403
+ *
404
+ * Licensed under the Apache License, Version 2.0 (the "License");
405
+ * you may not use this file except in compliance with the License.
406
+ * You may obtain a copy of the License at
407
+ *
408
+ * http://www.apache.org/licenses/LICENSE-2.0
409
+ *
410
+ * Unless required by applicable law or agreed to in writing, software
411
+ * distributed under the License is distributed on an "AS IS" BASIS,
412
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
413
+ * See the License for the specific language governing permissions and
414
+ * limitations under the License.
415
+ */as(eS,tS,"app");function jf(){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 nS=jf,Bf=new ao("auth","Firebase",jf());/**
416
+ * @license
417
+ * Copyright 2020 Google LLC
418
+ *
419
+ * Licensed under the Apache License, Version 2.0 (the "License");
420
+ * you may not use this file except in compliance with the License.
421
+ * You may obtain a copy of the License at
422
+ *
423
+ * http://www.apache.org/licenses/LICENSE-2.0
424
+ *
425
+ * Unless required by applicable law or agreed to in writing, software
426
+ * distributed under the License is distributed on an "AS IS" BASIS,
427
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
428
+ * See the License for the specific language governing permissions and
429
+ * limitations under the License.
430
+ */const qo=new Pf("@firebase/auth");function rS(e,...t){qo.logLevel<=wt.WARN&&qo.warn(`Auth (${co}): ${e}`,...t)}function Mo(e,...t){qo.logLevel<=wt.ERROR&&qo.error(`Auth (${co}): ${e}`,...t)}/**
431
+ * @license
432
+ * Copyright 2020 Google LLC
433
+ *
434
+ * Licensed under the Apache License, Version 2.0 (the "License");
435
+ * you may not use this file except in compliance with the License.
436
+ * You may obtain a copy of the License at
437
+ *
438
+ * http://www.apache.org/licenses/LICENSE-2.0
439
+ *
440
+ * Unless required by applicable law or agreed to in writing, software
441
+ * distributed under the License is distributed on an "AS IS" BASIS,
442
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
443
+ * See the License for the specific language governing permissions and
444
+ * limitations under the License.
445
+ */function On(e,...t){throw bl(e,...t)}function yn(e,...t){return bl(e,...t)}function wl(e,t,n){const r={...nS(),[t]:n};return new ao("auth","Firebase",r).create(t,{appName:e.name})}function Fr(e){return wl(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function sS(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&On(e,"argument-error"),wl(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function bl(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 Bf.create(e,...t)}function He(e,t,...n){if(!e)throw bl(t,...n)}function zn(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Mo(t),new Error(t)}function er(e,t){e||zn(t)}/**
446
+ * @license
447
+ * Copyright 2020 Google LLC
448
+ *
449
+ * Licensed under the Apache License, Version 2.0 (the "License");
450
+ * you may not use this file except in compliance with the License.
451
+ * You may obtain a copy of the License at
452
+ *
453
+ * http://www.apache.org/licenses/LICENSE-2.0
454
+ *
455
+ * Unless required by applicable law or agreed to in writing, software
456
+ * distributed under the License is distributed on an "AS IS" BASIS,
457
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
458
+ * See the License for the specific language governing permissions and
459
+ * limitations under the License.
460
+ */function La(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function oS(){return mu()==="http:"||mu()==="https:"}function mu(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
461
+ * @license
462
+ * Copyright 2020 Google LLC
463
+ *
464
+ * Licensed under the Apache License, Version 2.0 (the "License");
465
+ * you may not use this file except in compliance with the License.
466
+ * You may obtain a copy of the License at
467
+ *
468
+ * http://www.apache.org/licenses/LICENSE-2.0
469
+ *
470
+ * Unless required by applicable law or agreed to in writing, software
471
+ * distributed under the License is distributed on an "AS IS" BASIS,
472
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
473
+ * See the License for the specific language governing permissions and
474
+ * limitations under the License.
475
+ */function iS(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(oS()||OT()||"connection"in navigator)?navigator.onLine:!0}function aS(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
476
+ * @license
477
+ * Copyright 2020 Google LLC
478
+ *
479
+ * Licensed under the Apache License, Version 2.0 (the "License");
480
+ * you may not use this file except in compliance with the License.
481
+ * You may obtain a copy of the License at
482
+ *
483
+ * http://www.apache.org/licenses/LICENSE-2.0
484
+ *
485
+ * Unless required by applicable law or agreed to in writing, software
486
+ * distributed under the License is distributed on an "AS IS" BASIS,
487
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
488
+ * See the License for the specific language governing permissions and
489
+ * limitations under the License.
490
+ */class uo{constructor(t,n){this.shortDelay=t,this.longDelay=n,er(n>t,"Short delay should be less than long delay!"),this.isMobile=xT()||NT()}get(){return iS()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
491
+ * @license
492
+ * Copyright 2020 Google LLC
493
+ *
494
+ * Licensed under the Apache License, Version 2.0 (the "License");
495
+ * you may not use this file except in compliance with the License.
496
+ * You may obtain a copy of the License at
497
+ *
498
+ * http://www.apache.org/licenses/LICENSE-2.0
499
+ *
500
+ * Unless required by applicable law or agreed to in writing, software
501
+ * distributed under the License is distributed on an "AS IS" BASIS,
502
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
503
+ * See the License for the specific language governing permissions and
504
+ * limitations under the License.
505
+ */function _l(e,t){er(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
506
+ * @license
507
+ * Copyright 2020 Google LLC
508
+ *
509
+ * Licensed under the Apache License, Version 2.0 (the "License");
510
+ * you may not use this file except in compliance with the License.
511
+ * You may obtain a copy of the License at
512
+ *
513
+ * http://www.apache.org/licenses/LICENSE-2.0
514
+ *
515
+ * Unless required by applicable law or agreed to in writing, software
516
+ * distributed under the License is distributed on an "AS IS" BASIS,
517
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
518
+ * See the License for the specific language governing permissions and
519
+ * limitations under the License.
520
+ */class Uf{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;zn("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;zn("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;zn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
521
+ * @license
522
+ * Copyright 2020 Google LLC
523
+ *
524
+ * Licensed under the Apache License, Version 2.0 (the "License");
525
+ * you may not use this file except in compliance with the License.
526
+ * You may obtain a copy of the License at
527
+ *
528
+ * http://www.apache.org/licenses/LICENSE-2.0
529
+ *
530
+ * Unless required by applicable law or agreed to in writing, software
531
+ * distributed under the License is distributed on an "AS IS" BASIS,
532
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
533
+ * See the License for the specific language governing permissions and
534
+ * limitations under the License.
535
+ */const lS={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"};/**
536
+ * @license
537
+ * Copyright 2020 Google LLC
538
+ *
539
+ * Licensed under the Apache License, Version 2.0 (the "License");
540
+ * you may not use this file except in compliance with the License.
541
+ * You may obtain a copy of the License at
542
+ *
543
+ * http://www.apache.org/licenses/LICENSE-2.0
544
+ *
545
+ * Unless required by applicable law or agreed to in writing, software
546
+ * distributed under the License is distributed on an "AS IS" BASIS,
547
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
548
+ * See the License for the specific language governing permissions and
549
+ * limitations under the License.
550
+ */const cS=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],uS=new uo(3e4,6e4);function kl(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function ws(e,t,n,r,s={}){return Ff(e,s,async()=>{let o={},i={};r&&(t==="GET"?i=r:o={body:JSON.stringify(r)});const a=lo({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 d={method:t,headers:l,...o};return MT()||(d.referrerPolicy="no-referrer"),e.emulatorConfig&&mi(e.emulatorConfig.host)&&(d.credentials="include"),Uf.fetch()(await Hf(e,e.config.apiHost,n,a),d)})}async function Ff(e,t,n){e._canInitEmulator=!1;const r={...lS,...t};try{const s=new fS(e),o=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw _o(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,d]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw _o(e,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw _o(e,"email-already-in-use",i);if(l==="USER_DISABLED")throw _o(e,"user-disabled",i);const u=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(d)throw wl(e,u,d);On(e,u)}}catch(s){if(s instanceof Ir)throw s;On(e,"network-request-failed",{message:String(s)})}}async function dS(e,t,n,r,s={}){const o=await ws(e,t,n,r,s);return"mfaPendingCredential"in o&&On(e,"multi-factor-auth-required",{_serverResponse:o}),o}async function Hf(e,t,n,r){const s=`${t}${n}?${r}`,o=e,i=o.config.emulator?_l(e.config,s):`${e.config.apiScheme}://${s}`;return cS.includes(n)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(i).toString():i}class fS{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(yn(this.auth,"network-request-failed")),uS.get())})}}function _o(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=yn(e,t,r);return s.customData._tokenResponse=n,s}/**
551
+ * @license
552
+ * Copyright 2020 Google LLC
553
+ *
554
+ * Licensed under the Apache License, Version 2.0 (the "License");
555
+ * you may not use this file except in compliance with the License.
556
+ * You may obtain a copy of the License at
557
+ *
558
+ * http://www.apache.org/licenses/LICENSE-2.0
559
+ *
560
+ * Unless required by applicable law or agreed to in writing, software
561
+ * distributed under the License is distributed on an "AS IS" BASIS,
562
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
563
+ * See the License for the specific language governing permissions and
564
+ * limitations under the License.
565
+ */async function hS(e,t){return ws(e,"POST","/v1/accounts:delete",t)}async function Go(e,t){return ws(e,"POST","/v1/accounts:lookup",t)}/**
566
+ * @license
567
+ * Copyright 2020 Google LLC
568
+ *
569
+ * Licensed under the Apache License, Version 2.0 (the "License");
570
+ * you may not use this file except in compliance with the License.
571
+ * You may obtain a copy of the License at
572
+ *
573
+ * http://www.apache.org/licenses/LICENSE-2.0
574
+ *
575
+ * Unless required by applicable law or agreed to in writing, software
576
+ * distributed under the License is distributed on an "AS IS" BASIS,
577
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
578
+ * See the License for the specific language governing permissions and
579
+ * limitations under the License.
580
+ */function Vs(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function pS(e,t=!1){const n=ys(e),r=await n.getIdToken(t),s=Tl(r);He(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const o=typeof s.firebase=="object"?s.firebase:void 0,i=o==null?void 0:o.sign_in_provider;return{claims:s,token:r,authTime:Vs(ra(s.auth_time)),issuedAtTime:Vs(ra(s.iat)),expirationTime:Vs(ra(s.exp)),signInProvider:i||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function ra(e){return Number(e)*1e3}function Tl(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return Mo("JWT malformed, contained fewer than 3 sections"),null;try{const s=Cf(n);return s?JSON.parse(s):(Mo("Failed to decode base64 JWT payload"),null)}catch(s){return Mo("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function gu(e){const t=Tl(e);return He(t,"internal-error"),He(typeof t.exp<"u","internal-error"),He(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
581
+ * @license
582
+ * Copyright 2020 Google LLC
583
+ *
584
+ * Licensed under the Apache License, Version 2.0 (the "License");
585
+ * you may not use this file except in compliance with the License.
586
+ * You may obtain a copy of the License at
587
+ *
588
+ * http://www.apache.org/licenses/LICENSE-2.0
589
+ *
590
+ * Unless required by applicable law or agreed to in writing, software
591
+ * distributed under the License is distributed on an "AS IS" BASIS,
592
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
593
+ * See the License for the specific language governing permissions and
594
+ * limitations under the License.
595
+ */async function ro(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof Ir&&mS(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function mS({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
596
+ * @license
597
+ * Copyright 2020 Google LLC
598
+ *
599
+ * Licensed under the Apache License, Version 2.0 (the "License");
600
+ * you may not use this file except in compliance with the License.
601
+ * You may obtain a copy of the License at
602
+ *
603
+ * http://www.apache.org/licenses/LICENSE-2.0
604
+ *
605
+ * Unless required by applicable law or agreed to in writing, software
606
+ * distributed under the License is distributed on an "AS IS" BASIS,
607
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
608
+ * See the License for the specific language governing permissions and
609
+ * limitations under the License.
610
+ */class gS{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()}}/**
611
+ * @license
612
+ * Copyright 2020 Google LLC
613
+ *
614
+ * Licensed under the Apache License, Version 2.0 (the "License");
615
+ * you may not use this file except in compliance with the License.
616
+ * You may obtain a copy of the License at
617
+ *
618
+ * http://www.apache.org/licenses/LICENSE-2.0
619
+ *
620
+ * Unless required by applicable law or agreed to in writing, software
621
+ * distributed under the License is distributed on an "AS IS" BASIS,
622
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
623
+ * See the License for the specific language governing permissions and
624
+ * limitations under the License.
625
+ */class ja{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Vs(this.lastLoginAt),this.creationTime=Vs(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
626
+ * @license
627
+ * Copyright 2019 Google LLC
628
+ *
629
+ * Licensed under the Apache License, Version 2.0 (the "License");
630
+ * you may not use this file except in compliance with the License.
631
+ * You may obtain a copy of the License at
632
+ *
633
+ * http://www.apache.org/licenses/LICENSE-2.0
634
+ *
635
+ * Unless required by applicable law or agreed to in writing, software
636
+ * distributed under the License is distributed on an "AS IS" BASIS,
637
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
638
+ * See the License for the specific language governing permissions and
639
+ * limitations under the License.
640
+ */async function Ko(e){var p;const t=e.auth,n=await e.getIdToken(),r=await ro(e,Go(t,{idToken:n}));He(r==null?void 0:r.users.length,t,"internal-error");const s=r.users[0];e._notifyReloadListener(s);const o=(p=s.providerUserInfo)!=null&&p.length?Vf(s.providerUserInfo):[],i=yS(e.providerData,o),a=e.isAnonymous,l=!(e.email&&s.passwordHash)&&!(i!=null&&i.length),d=a?l:!1,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:i,metadata:new ja(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(e,u)}async function vS(e){const t=ys(e);await Ko(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function yS(e,t){return[...e.filter(r=>!t.some(s=>s.providerId===r.providerId)),...t]}function Vf(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}))}/**
641
+ * @license
642
+ * Copyright 2020 Google LLC
643
+ *
644
+ * Licensed under the Apache License, Version 2.0 (the "License");
645
+ * you may not use this file except in compliance with the License.
646
+ * You may obtain a copy of the License at
647
+ *
648
+ * http://www.apache.org/licenses/LICENSE-2.0
649
+ *
650
+ * Unless required by applicable law or agreed to in writing, software
651
+ * distributed under the License is distributed on an "AS IS" BASIS,
652
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
653
+ * See the License for the specific language governing permissions and
654
+ * limitations under the License.
655
+ */async function wS(e,t){const n=await Ff(e,{},async()=>{const r=lo({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:o}=e.config,i=await Hf(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&&mi(e.emulatorConfig.host)&&(l.credentials="include"),Uf.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function bS(e,t){return ws(e,"POST","/v2/accounts:revokeToken",kl(e,t))}/**
656
+ * @license
657
+ * Copyright 2020 Google LLC
658
+ *
659
+ * Licensed under the Apache License, Version 2.0 (the "License");
660
+ * you may not use this file except in compliance with the License.
661
+ * You may obtain a copy of the License at
662
+ *
663
+ * http://www.apache.org/licenses/LICENSE-2.0
664
+ *
665
+ * Unless required by applicable law or agreed to in writing, software
666
+ * distributed under the License is distributed on an "AS IS" BASIS,
667
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
668
+ * See the License for the specific language governing permissions and
669
+ * limitations under the License.
670
+ */class ls{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){He(t.idToken,"internal-error"),He(typeof t.idToken<"u","internal-error"),He(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):gu(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){He(t.length!==0,"internal-error");const n=gu(t);this.updateTokensAndExpiration(t,null,n)}async getToken(t,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(He(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 wS(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 ls;return r&&(He(typeof r=="string","internal-error",{appName:t}),i.refreshToken=r),s&&(He(typeof s=="string","internal-error",{appName:t}),i.accessToken=s),o&&(He(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 ls,this.toJSON())}_performRefresh(){return zn("not implemented")}}/**
671
+ * @license
672
+ * Copyright 2020 Google LLC
673
+ *
674
+ * Licensed under the Apache License, Version 2.0 (the "License");
675
+ * you may not use this file except in compliance with the License.
676
+ * You may obtain a copy of the License at
677
+ *
678
+ * http://www.apache.org/licenses/LICENSE-2.0
679
+ *
680
+ * Unless required by applicable law or agreed to in writing, software
681
+ * distributed under the License is distributed on an "AS IS" BASIS,
682
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
683
+ * See the License for the specific language governing permissions and
684
+ * limitations under the License.
685
+ */function dr(e,t){He(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class mn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new gS(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 ja(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await ro(this,this.stsTokenManager.getToken(this.auth,t));return He(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return pS(this,t)}reload(){return vS(this)}_assign(t){this!==t&&(He(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 mn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){He(!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 Ko(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(An(this.auth.app))return Promise.reject(Fr(this.auth));const t=await this.getIdToken();return await ro(this,hS(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,d=n.createdAt??void 0,u=n.lastLoginAt??void 0,{uid:p,emailVerified:g,isAnonymous:T,providerData:j,stsTokenManager:R}=n;He(p&&R,t,"internal-error");const B=ls.fromJSON(this.name,R);He(typeof p=="string",t,"internal-error"),dr(r,t.name),dr(s,t.name),He(typeof g=="boolean",t,"internal-error"),He(typeof T=="boolean",t,"internal-error"),dr(o,t.name),dr(i,t.name),dr(a,t.name),dr(l,t.name),dr(d,t.name),dr(u,t.name);const N=new mn({uid:p,auth:t,email:s,emailVerified:g,displayName:r,isAnonymous:T,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:B,createdAt:d,lastLoginAt:u});return j&&Array.isArray(j)&&(N.providerData=j.map(P=>({...P}))),l&&(N._redirectEventId=l),N}static async _fromIdTokenResponse(t,n,r=!1){const s=new ls;s.updateFromServerResponse(n);const o=new mn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await Ko(o),o}static async _fromGetAccountInfoResponse(t,n,r){const s=n.users[0];He(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?Vf(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new ls;a.updateFromIdToken(r);const l=new mn({uid:s.localId,auth:t,stsTokenManager:a,isAnonymous:i}),d={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 ja(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,d),l}}/**
686
+ * @license
687
+ * Copyright 2020 Google LLC
688
+ *
689
+ * Licensed under the Apache License, Version 2.0 (the "License");
690
+ * you may not use this file except in compliance with the License.
691
+ * You may obtain a copy of the License at
692
+ *
693
+ * http://www.apache.org/licenses/LICENSE-2.0
694
+ *
695
+ * Unless required by applicable law or agreed to in writing, software
696
+ * distributed under the License is distributed on an "AS IS" BASIS,
697
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
698
+ * See the License for the specific language governing permissions and
699
+ * limitations under the License.
700
+ */const vu=new Map;function qn(e){er(e instanceof Function,"Expected a class definition");let t=vu.get(e);return t?(er(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,vu.set(e,t),t)}/**
701
+ * @license
702
+ * Copyright 2019 Google LLC
703
+ *
704
+ * Licensed under the Apache License, Version 2.0 (the "License");
705
+ * you may not use this file except in compliance with the License.
706
+ * You may obtain a copy of the License at
707
+ *
708
+ * http://www.apache.org/licenses/LICENSE-2.0
709
+ *
710
+ * Unless required by applicable law or agreed to in writing, software
711
+ * distributed under the License is distributed on an "AS IS" BASIS,
712
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
713
+ * See the License for the specific language governing permissions and
714
+ * limitations under the License.
715
+ */class Wf{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){}}Wf.type="NONE";const yu=Wf;/**
716
+ * @license
717
+ * Copyright 2019 Google LLC
718
+ *
719
+ * Licensed under the Apache License, Version 2.0 (the "License");
720
+ * you may not use this file except in compliance with the License.
721
+ * You may obtain a copy of the License at
722
+ *
723
+ * http://www.apache.org/licenses/LICENSE-2.0
724
+ *
725
+ * Unless required by applicable law or agreed to in writing, software
726
+ * distributed under the License is distributed on an "AS IS" BASIS,
727
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
728
+ * See the License for the specific language governing permissions and
729
+ * limitations under the License.
730
+ */function Oo(e,t,n){return`firebase:${e}:${t}:${n}`}class cs{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=Oo(this.userKey,s.apiKey,o),this.fullPersistenceKey=Oo("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 Go(this.auth,{idToken:t}).catch(()=>{});return n?mn._fromGetAccountInfoResponse(this.auth,n,t):null}return mn._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 cs(qn(yu),t,r);const s=(await Promise.all(n.map(async d=>{if(await d._isAvailable())return d}))).filter(d=>d);let o=s[0]||qn(yu);const i=Oo(r,t.config.apiKey,t.name);let a=null;for(const d of n)try{const u=await d._get(i);if(u){let p;if(typeof u=="string"){const g=await Go(t,{idToken:u}).catch(()=>{});if(!g)break;p=await mn._fromGetAccountInfoResponse(t,g,u)}else p=mn._fromJSON(t,u);d!==o&&(a=p),o=d;break}}catch{}const l=s.filter(d=>d._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new cs(o,t,r):(o=l[0],a&&await o._set(i,a.toJSON()),await Promise.all(n.map(async d=>{if(d!==o)try{await d._remove(i)}catch{}})),new cs(o,t,r))}}/**
731
+ * @license
732
+ * Copyright 2020 Google LLC
733
+ *
734
+ * Licensed under the Apache License, Version 2.0 (the "License");
735
+ * you may not use this file except in compliance with the License.
736
+ * You may obtain a copy of the License at
737
+ *
738
+ * http://www.apache.org/licenses/LICENSE-2.0
739
+ *
740
+ * Unless required by applicable law or agreed to in writing, software
741
+ * distributed under the License is distributed on an "AS IS" BASIS,
742
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
743
+ * See the License for the specific language governing permissions and
744
+ * limitations under the License.
745
+ */function wu(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Kf(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(zf(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Yf(t))return"Blackberry";if(Xf(t))return"Webos";if(qf(t))return"Safari";if((t.includes("chrome/")||Gf(t))&&!t.includes("edge/"))return"Chrome";if(Jf(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 zf(e=en()){return/firefox\//i.test(e)}function qf(e=en()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Gf(e=en()){return/crios\//i.test(e)}function Kf(e=en()){return/iemobile/i.test(e)}function Jf(e=en()){return/android/i.test(e)}function Yf(e=en()){return/blackberry/i.test(e)}function Xf(e=en()){return/webos/i.test(e)}function Sl(e=en()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function _S(e=en()){var t;return Sl(e)&&!!((t=window.navigator)!=null&&t.standalone)}function kS(){return $T()&&document.documentMode===10}function Qf(e=en()){return Sl(e)||Jf(e)||Xf(e)||Yf(e)||/windows phone/i.test(e)||Kf(e)}/**
746
+ * @license
747
+ * Copyright 2020 Google LLC
748
+ *
749
+ * Licensed under the Apache License, Version 2.0 (the "License");
750
+ * you may not use this file except in compliance with the License.
751
+ * You may obtain a copy of the License at
752
+ *
753
+ * http://www.apache.org/licenses/LICENSE-2.0
754
+ *
755
+ * Unless required by applicable law or agreed to in writing, software
756
+ * distributed under the License is distributed on an "AS IS" BASIS,
757
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
758
+ * See the License for the specific language governing permissions and
759
+ * limitations under the License.
760
+ */function Zf(e,t=[]){let n;switch(e){case"Browser":n=wu(en());break;case"Worker":n=`${wu(en())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${co}/${r}`}/**
761
+ * @license
762
+ * Copyright 2022 Google LLC
763
+ *
764
+ * Licensed under the Apache License, Version 2.0 (the "License");
765
+ * you may not use this file except in compliance with the License.
766
+ * You may obtain a copy of the License at
767
+ *
768
+ * http://www.apache.org/licenses/LICENSE-2.0
769
+ *
770
+ * Unless required by applicable law or agreed to in writing, software
771
+ * distributed under the License is distributed on an "AS IS" BASIS,
772
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
773
+ * See the License for the specific language governing permissions and
774
+ * limitations under the License.
775
+ */class TS{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})}}}/**
776
+ * @license
777
+ * Copyright 2023 Google LLC
778
+ *
779
+ * Licensed under the Apache License, Version 2.0 (the "License");
780
+ * you may not use this file except in compliance with the License.
781
+ * You may obtain a copy of the License at
782
+ *
783
+ * http://www.apache.org/licenses/LICENSE-2.0
784
+ *
785
+ * Unless required by applicable law or agreed to in writing, software
786
+ * distributed under the License is distributed on an "AS IS" BASIS,
787
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
788
+ * See the License for the specific language governing permissions and
789
+ * limitations under the License.
790
+ */async function SS(e,t={}){return ws(e,"GET","/v2/passwordPolicy",kl(e,t))}/**
791
+ * @license
792
+ * Copyright 2023 Google LLC
793
+ *
794
+ * Licensed under the Apache License, Version 2.0 (the "License");
795
+ * you may not use this file except in compliance with the License.
796
+ * You may obtain a copy of the License at
797
+ *
798
+ * http://www.apache.org/licenses/LICENSE-2.0
799
+ *
800
+ * Unless required by applicable law or agreed to in writing, software
801
+ * distributed under the License is distributed on an "AS IS" BASIS,
802
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
803
+ * See the License for the specific language governing permissions and
804
+ * limitations under the License.
805
+ */const IS=6;class ES{constructor(t){var r;const n=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??IS,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))}}/**
806
+ * @license
807
+ * Copyright 2020 Google LLC
808
+ *
809
+ * Licensed under the Apache License, Version 2.0 (the "License");
810
+ * you may not use this file except in compliance with the License.
811
+ * You may obtain a copy of the License at
812
+ *
813
+ * http://www.apache.org/licenses/LICENSE-2.0
814
+ *
815
+ * Unless required by applicable law or agreed to in writing, software
816
+ * distributed under the License is distributed on an "AS IS" BASIS,
817
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
818
+ * See the License for the specific language governing permissions and
819
+ * limitations under the License.
820
+ */class CS{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 bu(this),this.idTokenSubscription=new bu(this),this.beforeStateQueue=new TS(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=Bf,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(o=>this._resolvePersistenceManagerAvailable=o)}_initializeWithPersistence(t,n){return n&&(this._popupRedirectResolver=qn(n)),this._initializationPromise=this.queue(async()=>{var r,s,o;if(!this._deleted&&(this.persistenceManager=await cs.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 Go(this,{idToken:t}),r=await mn._fromGetAccountInfoResponse(this,n,t);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var o;if(An(this.app)){const i=this.app.settings.authIdToken;return i?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(i).then(a,a))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,s=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const i=(o=this.redirectUser)==null?void 0:o._redirectEventId,a=r==null?void 0:r._redirectEventId,l=await this.tryRedirectSignIn(t);(!i||i===a)&&(l!=null&&l.user)&&(r=l.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(i){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(i))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return He(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 Ko(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=aS()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(An(this.app))return Promise.reject(Fr(this));const n=t?ys(t):null;return n&&He(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&&He(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return An(this.app)?Promise.reject(Fr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return An(this.app)?Promise.reject(Fr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(qn(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await SS(this),n=new ES(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 ao("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 bS(this,r)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)==null?void 0:t.toJSON()}}async _setRedirectUser(t,n){const r=await this.getOrInitRedirectPersistenceManager(n);return t===null?r.removeCurrentUser():r.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const n=t&&qn(t)||this._popupRedirectResolver;He(n,this,"argument-error"),this.redirectPersistenceManager=await cs.create(this,[qn(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)==null?void 0:n._redirectEventId)===t?this._currentUser:((r=this.redirectUser)==null?void 0:r._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const t=((n=this.currentUser)==null?void 0:n.uid)??null;this.lastNotifiedUid!==t&&(this.lastNotifiedUid=t,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,n,r,s){if(this._deleted)return()=>{};const o=typeof n=="function"?n:n.next.bind(n);let i=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(He(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 He(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Zf(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var s;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await((s=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:s.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var n;if(An(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await((n=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:n.getToken());return t!=null&&t.error&&rS(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function gi(e){return ys(e)}class bu{constructor(t){this.auth=t,this.observer=null,this.addObserver=HT(n=>this.observer=n)}get next(){return He(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
821
+ * @license
822
+ * Copyright 2020 Google LLC
823
+ *
824
+ * Licensed under the Apache License, Version 2.0 (the "License");
825
+ * you may not use this file except in compliance with the License.
826
+ * You may obtain a copy of the License at
827
+ *
828
+ * http://www.apache.org/licenses/LICENSE-2.0
829
+ *
830
+ * Unless required by applicable law or agreed to in writing, software
831
+ * distributed under the License is distributed on an "AS IS" BASIS,
832
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
833
+ * See the License for the specific language governing permissions and
834
+ * limitations under the License.
835
+ */let Il={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function AS(e){Il=e}function RS(e){return Il.loadJS(e)}function PS(){return Il.gapiScript}function xS(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
836
+ * @license
837
+ * Copyright 2020 Google LLC
838
+ *
839
+ * Licensed under the Apache License, Version 2.0 (the "License");
840
+ * you may not use this file except in compliance with the License.
841
+ * You may obtain a copy of the License at
842
+ *
843
+ * http://www.apache.org/licenses/LICENSE-2.0
844
+ *
845
+ * Unless required by applicable law or agreed to in writing, software
846
+ * distributed under the License is distributed on an "AS IS" BASIS,
847
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
848
+ * See the License for the specific language governing permissions and
849
+ * limitations under the License.
850
+ */function MS(e,t){const n=Of(e,"auth");if(n.isInitialized()){const s=n.getImmediate(),o=n.getOptions();if(ps(o,t??{}))return s;On(s,"already-initialized")}return n.initialize({options:t})}function OS(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(qn);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function NS(e,t,n){const r=gi(e);He(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const s=!1,o=eh(t),{host:i,port:a}=$S(t),l=a===null?"":`:${a}`,d={url:`${o}//${i}${l}/`},u=Object.freeze({host:i,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){He(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),He(ps(d,r.config.emulator)&&ps(u,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=d,r.emulatorConfig=u,r.settings.appVerificationDisabledForTesting=!0,mi(i)?(CT(`${o}//${i}${l}`),PT("Auth",!0)):DS()}function eh(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function $S(e){const t=eh(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:_u(r.substr(o.length+1))}}else{const[o,i]=r.split(":");return{host:o,port:_u(i)}}}function _u(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function DS(){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())}/**
851
+ * @license
852
+ * Copyright 2020 Google LLC
853
+ *
854
+ * Licensed under the Apache License, Version 2.0 (the "License");
855
+ * you may not use this file except in compliance with the License.
856
+ * You may obtain a copy of the License at
857
+ *
858
+ * http://www.apache.org/licenses/LICENSE-2.0
859
+ *
860
+ * Unless required by applicable law or agreed to in writing, software
861
+ * distributed under the License is distributed on an "AS IS" BASIS,
862
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
863
+ * See the License for the specific language governing permissions and
864
+ * limitations under the License.
865
+ */class th{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return zn("not implemented")}_getIdTokenResponse(t){return zn("not implemented")}_linkToIdToken(t,n){return zn("not implemented")}_getReauthenticationResolver(t){return zn("not implemented")}}/**
866
+ * @license
867
+ * Copyright 2020 Google LLC
868
+ *
869
+ * Licensed under the Apache License, Version 2.0 (the "License");
870
+ * you may not use this file except in compliance with the License.
871
+ * You may obtain a copy of the License at
872
+ *
873
+ * http://www.apache.org/licenses/LICENSE-2.0
874
+ *
875
+ * Unless required by applicable law or agreed to in writing, software
876
+ * distributed under the License is distributed on an "AS IS" BASIS,
877
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
878
+ * See the License for the specific language governing permissions and
879
+ * limitations under the License.
880
+ */async function us(e,t){return dS(e,"POST","/v1/accounts:signInWithIdp",kl(e,t))}/**
881
+ * @license
882
+ * Copyright 2020 Google LLC
883
+ *
884
+ * Licensed under the Apache License, Version 2.0 (the "License");
885
+ * you may not use this file except in compliance with the License.
886
+ * You may obtain a copy of the License at
887
+ *
888
+ * http://www.apache.org/licenses/LICENSE-2.0
889
+ *
890
+ * Unless required by applicable law or agreed to in writing, software
891
+ * distributed under the License is distributed on an "AS IS" BASIS,
892
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
893
+ * See the License for the specific language governing permissions and
894
+ * limitations under the License.
895
+ */const LS="http://localhost";class Vr extends th{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new Vr(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):On("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:s,...o}=n;if(!r||!s)return null;const i=new Vr(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 us(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,us(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,us(t,n)}buildRequest(){const t={requestUri:LS,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),t.postBody=lo(n)}return t}}/**
896
+ * @license
897
+ * Copyright 2020 Google LLC
898
+ *
899
+ * Licensed under the Apache License, Version 2.0 (the "License");
900
+ * you may not use this file except in compliance with the License.
901
+ * You may obtain a copy of the License at
902
+ *
903
+ * http://www.apache.org/licenses/LICENSE-2.0
904
+ *
905
+ * Unless required by applicable law or agreed to in writing, software
906
+ * distributed under the License is distributed on an "AS IS" BASIS,
907
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
908
+ * See the License for the specific language governing permissions and
909
+ * limitations under the License.
910
+ */class El{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}}/**
911
+ * @license
912
+ * Copyright 2019 Google LLC
913
+ *
914
+ * Licensed under the Apache License, Version 2.0 (the "License");
915
+ * you may not use this file except in compliance with the License.
916
+ * You may obtain a copy of the License at
917
+ *
918
+ * http://www.apache.org/licenses/LICENSE-2.0
919
+ *
920
+ * Unless required by applicable law or agreed to in writing, software
921
+ * distributed under the License is distributed on an "AS IS" BASIS,
922
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
923
+ * See the License for the specific language governing permissions and
924
+ * limitations under the License.
925
+ */class fo extends El{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
926
+ * @license
927
+ * Copyright 2020 Google LLC
928
+ *
929
+ * Licensed under the Apache License, Version 2.0 (the "License");
930
+ * you may not use this file except in compliance with the License.
931
+ * You may obtain a copy of the License at
932
+ *
933
+ * http://www.apache.org/licenses/LICENSE-2.0
934
+ *
935
+ * Unless required by applicable law or agreed to in writing, software
936
+ * distributed under the License is distributed on an "AS IS" BASIS,
937
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
938
+ * See the License for the specific language governing permissions and
939
+ * limitations under the License.
940
+ */class vr extends fo{constructor(){super("facebook.com")}static credential(t){return Vr._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";/**
941
+ * @license
942
+ * Copyright 2020 Google LLC
943
+ *
944
+ * Licensed under the Apache License, Version 2.0 (the "License");
945
+ * you may not use this file except in compliance with the License.
946
+ * You may obtain a copy of the License at
947
+ *
948
+ * http://www.apache.org/licenses/LICENSE-2.0
949
+ *
950
+ * Unless required by applicable law or agreed to in writing, software
951
+ * distributed under the License is distributed on an "AS IS" BASIS,
952
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
953
+ * See the License for the specific language governing permissions and
954
+ * limitations under the License.
955
+ */class yr extends fo{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return Vr._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";/**
956
+ * @license
957
+ * Copyright 2020 Google LLC
958
+ *
959
+ * Licensed under the Apache License, Version 2.0 (the "License");
960
+ * you may not use this file except in compliance with the License.
961
+ * You may obtain a copy of the License at
962
+ *
963
+ * http://www.apache.org/licenses/LICENSE-2.0
964
+ *
965
+ * Unless required by applicable law or agreed to in writing, software
966
+ * distributed under the License is distributed on an "AS IS" BASIS,
967
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
968
+ * See the License for the specific language governing permissions and
969
+ * limitations under the License.
970
+ */class Rn extends fo{constructor(){super("github.com")}static credential(t){return Vr._fromParams({providerId:Rn.PROVIDER_ID,signInMethod:Rn.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Rn.credentialFromTaggedObject(t)}static credentialFromError(t){return Rn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Rn.credential(t.oauthAccessToken)}catch{return null}}}Rn.GITHUB_SIGN_IN_METHOD="github.com";Rn.PROVIDER_ID="github.com";/**
971
+ * @license
972
+ * Copyright 2020 Google LLC
973
+ *
974
+ * Licensed under the Apache License, Version 2.0 (the "License");
975
+ * you may not use this file except in compliance with the License.
976
+ * You may obtain a copy of the License at
977
+ *
978
+ * http://www.apache.org/licenses/LICENSE-2.0
979
+ *
980
+ * Unless required by applicable law or agreed to in writing, software
981
+ * distributed under the License is distributed on an "AS IS" BASIS,
982
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
983
+ * See the License for the specific language governing permissions and
984
+ * limitations under the License.
985
+ */class wr extends fo{constructor(){super("twitter.com")}static credential(t,n){return Vr._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";/**
986
+ * @license
987
+ * Copyright 2020 Google LLC
988
+ *
989
+ * Licensed under the Apache License, Version 2.0 (the "License");
990
+ * you may not use this file except in compliance with the License.
991
+ * You may obtain a copy of the License at
992
+ *
993
+ * http://www.apache.org/licenses/LICENSE-2.0
994
+ *
995
+ * Unless required by applicable law or agreed to in writing, software
996
+ * distributed under the License is distributed on an "AS IS" BASIS,
997
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
998
+ * See the License for the specific language governing permissions and
999
+ * limitations under the License.
1000
+ */class gs{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 mn._fromIdTokenResponse(t,r,s),i=ku(r);return new gs({user:o,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const s=ku(r);return new gs({user:t,providerId:s,_tokenResponse:r,operationType:n})}}function ku(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
1001
+ * @license
1002
+ * Copyright 2020 Google LLC
1003
+ *
1004
+ * Licensed under the Apache License, Version 2.0 (the "License");
1005
+ * you may not use this file except in compliance with the License.
1006
+ * You may obtain a copy of the License at
1007
+ *
1008
+ * http://www.apache.org/licenses/LICENSE-2.0
1009
+ *
1010
+ * Unless required by applicable law or agreed to in writing, software
1011
+ * distributed under the License is distributed on an "AS IS" BASIS,
1012
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1013
+ * See the License for the specific language governing permissions and
1014
+ * limitations under the License.
1015
+ */class Jo extends Ir{constructor(t,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,Jo.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 Jo(t,n,r,s)}}function nh(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?Jo._fromErrorAndOperation(e,o,t,r):o})}async function jS(e,t,n=!1){const r=await ro(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return gs._forOperation(e,"link",r)}/**
1016
+ * @license
1017
+ * Copyright 2019 Google LLC
1018
+ *
1019
+ * Licensed under the Apache License, Version 2.0 (the "License");
1020
+ * you may not use this file except in compliance with the License.
1021
+ * You may obtain a copy of the License at
1022
+ *
1023
+ * http://www.apache.org/licenses/LICENSE-2.0
1024
+ *
1025
+ * Unless required by applicable law or agreed to in writing, software
1026
+ * distributed under the License is distributed on an "AS IS" BASIS,
1027
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1028
+ * See the License for the specific language governing permissions and
1029
+ * limitations under the License.
1030
+ */async function BS(e,t,n=!1){const{auth:r}=e;if(An(r.app))return Promise.reject(Fr(r));const s="reauthenticate";try{const o=await ro(e,nh(r,s,t,e),n);He(o.idToken,r,"internal-error");const i=Tl(o.idToken);He(i,r,"internal-error");const{sub:a}=i;return He(e.uid===a,r,"user-mismatch"),gs._forOperation(e,s,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&On(r,"user-mismatch"),o}}/**
1031
+ * @license
1032
+ * Copyright 2020 Google LLC
1033
+ *
1034
+ * Licensed under the Apache License, Version 2.0 (the "License");
1035
+ * you may not use this file except in compliance with the License.
1036
+ * You may obtain a copy of the License at
1037
+ *
1038
+ * http://www.apache.org/licenses/LICENSE-2.0
1039
+ *
1040
+ * Unless required by applicable law or agreed to in writing, software
1041
+ * distributed under the License is distributed on an "AS IS" BASIS,
1042
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1043
+ * See the License for the specific language governing permissions and
1044
+ * limitations under the License.
1045
+ */async function US(e,t,n=!1){if(An(e.app))return Promise.reject(Fr(e));const r="signIn",s=await nh(e,r,t),o=await gs._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(o.user),o}function FS(e,t,n,r){return ys(e).onIdTokenChanged(t,n,r)}function HS(e,t,n){return ys(e).beforeAuthStateChanged(t,n)}const Yo="__sak";/**
1046
+ * @license
1047
+ * Copyright 2019 Google LLC
1048
+ *
1049
+ * Licensed under the Apache License, Version 2.0 (the "License");
1050
+ * you may not use this file except in compliance with the License.
1051
+ * You may obtain a copy of the License at
1052
+ *
1053
+ * http://www.apache.org/licenses/LICENSE-2.0
1054
+ *
1055
+ * Unless required by applicable law or agreed to in writing, software
1056
+ * distributed under the License is distributed on an "AS IS" BASIS,
1057
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1058
+ * See the License for the specific language governing permissions and
1059
+ * limitations under the License.
1060
+ */class rh{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Yo,"1"),this.storage.removeItem(Yo),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()}}/**
1061
+ * @license
1062
+ * Copyright 2020 Google LLC
1063
+ *
1064
+ * Licensed under the Apache License, Version 2.0 (the "License");
1065
+ * you may not use this file except in compliance with the License.
1066
+ * You may obtain a copy of the License at
1067
+ *
1068
+ * http://www.apache.org/licenses/LICENSE-2.0
1069
+ *
1070
+ * Unless required by applicable law or agreed to in writing, software
1071
+ * distributed under the License is distributed on an "AS IS" BASIS,
1072
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1073
+ * See the License for the specific language governing permissions and
1074
+ * limitations under the License.
1075
+ */const VS=1e3,WS=10;class sh extends rh{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Qf(),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);kS()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,WS):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)})},VS)}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]}}sh.type="LOCAL";const zS=sh;/**
1076
+ * @license
1077
+ * Copyright 2020 Google LLC
1078
+ *
1079
+ * Licensed under the Apache License, Version 2.0 (the "License");
1080
+ * you may not use this file except in compliance with the License.
1081
+ * You may obtain a copy of the License at
1082
+ *
1083
+ * http://www.apache.org/licenses/LICENSE-2.0
1084
+ *
1085
+ * Unless required by applicable law or agreed to in writing, software
1086
+ * distributed under the License is distributed on an "AS IS" BASIS,
1087
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1088
+ * See the License for the specific language governing permissions and
1089
+ * limitations under the License.
1090
+ */class oh extends rh{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}oh.type="SESSION";const ih=oh;/**
1091
+ * @license
1092
+ * Copyright 2019 Google LLC
1093
+ *
1094
+ * Licensed under the Apache License, Version 2.0 (the "License");
1095
+ * you may not use this file except in compliance with the License.
1096
+ * You may obtain a copy of the License at
1097
+ *
1098
+ * http://www.apache.org/licenses/LICENSE-2.0
1099
+ *
1100
+ * Unless required by applicable law or agreed to in writing, software
1101
+ * distributed under the License is distributed on an "AS IS" BASIS,
1102
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1103
+ * See the License for the specific language governing permissions and
1104
+ * limitations under the License.
1105
+ */function qS(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
1106
+ * @license
1107
+ * Copyright 2019 Google LLC
1108
+ *
1109
+ * Licensed under the Apache License, Version 2.0 (the "License");
1110
+ * you may not use this file except in compliance with the License.
1111
+ * You may obtain a copy of the License at
1112
+ *
1113
+ * http://www.apache.org/licenses/LICENSE-2.0
1114
+ *
1115
+ * Unless required by applicable law or agreed to in writing, software
1116
+ * distributed under the License is distributed on an "AS IS" BASIS,
1117
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1118
+ * See the License for the specific language governing permissions and
1119
+ * limitations under the License.
1120
+ */class vi{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 vi(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 d=>d(n.origin,o)),l=await qS(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)}}vi.receivers=[];/**
1121
+ * @license
1122
+ * Copyright 2020 Google LLC
1123
+ *
1124
+ * Licensed under the Apache License, Version 2.0 (the "License");
1125
+ * you may not use this file except in compliance with the License.
1126
+ * You may obtain a copy of the License at
1127
+ *
1128
+ * http://www.apache.org/licenses/LICENSE-2.0
1129
+ *
1130
+ * Unless required by applicable law or agreed to in writing, software
1131
+ * distributed under the License is distributed on an "AS IS" BASIS,
1132
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1133
+ * See the License for the specific language governing permissions and
1134
+ * limitations under the License.
1135
+ */function Cl(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
1136
+ * @license
1137
+ * Copyright 2019 Google LLC
1138
+ *
1139
+ * Licensed under the Apache License, Version 2.0 (the "License");
1140
+ * you may not use this file except in compliance with the License.
1141
+ * You may obtain a copy of the License at
1142
+ *
1143
+ * http://www.apache.org/licenses/LICENSE-2.0
1144
+ *
1145
+ * Unless required by applicable law or agreed to in writing, software
1146
+ * distributed under the License is distributed on an "AS IS" BASIS,
1147
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1148
+ * See the License for the specific language governing permissions and
1149
+ * limitations under the License.
1150
+ */class GS{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 d=Cl("",20);s.port1.start();const u=setTimeout(()=>{l(new Error("unsupported_event"))},r);i={messageChannel:s,onMessage(p){const g=p;if(g.data.eventId===d)switch(g.data.status){case"ack":clearTimeout(u),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(g.data.response);break;default:clearTimeout(u),clearTimeout(o),l(new Error("invalid_response"));break}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:t,eventId:d,data:n},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}/**
1151
+ * @license
1152
+ * Copyright 2020 Google LLC
1153
+ *
1154
+ * Licensed under the Apache License, Version 2.0 (the "License");
1155
+ * you may not use this file except in compliance with the License.
1156
+ * You may obtain a copy of the License at
1157
+ *
1158
+ * http://www.apache.org/licenses/LICENSE-2.0
1159
+ *
1160
+ * Unless required by applicable law or agreed to in writing, software
1161
+ * distributed under the License is distributed on an "AS IS" BASIS,
1162
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1163
+ * See the License for the specific language governing permissions and
1164
+ * limitations under the License.
1165
+ */function Mn(){return window}function KS(e){Mn().location.href=e}/**
1166
+ * @license
1167
+ * Copyright 2020 Google LLC.
1168
+ *
1169
+ * Licensed under the Apache License, Version 2.0 (the "License");
1170
+ * you may not use this file except in compliance with the License.
1171
+ * You may obtain a copy of the License at
1172
+ *
1173
+ * http://www.apache.org/licenses/LICENSE-2.0
1174
+ *
1175
+ * Unless required by applicable law or agreed to in writing, software
1176
+ * distributed under the License is distributed on an "AS IS" BASIS,
1177
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1178
+ * See the License for the specific language governing permissions and
1179
+ * limitations under the License.
1180
+ */function ah(){return typeof Mn().WorkerGlobalScope<"u"&&typeof Mn().importScripts=="function"}async function JS(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function YS(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function XS(){return ah()?self:null}/**
1181
+ * @license
1182
+ * Copyright 2019 Google LLC
1183
+ *
1184
+ * Licensed under the Apache License, Version 2.0 (the "License");
1185
+ * you may not use this file except in compliance with the License.
1186
+ * You may obtain a copy of the License at
1187
+ *
1188
+ * http://www.apache.org/licenses/LICENSE-2.0
1189
+ *
1190
+ * Unless required by applicable law or agreed to in writing, software
1191
+ * distributed under the License is distributed on an "AS IS" BASIS,
1192
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1193
+ * See the License for the specific language governing permissions and
1194
+ * limitations under the License.
1195
+ */const lh="firebaseLocalStorageDb",QS=1,Xo="firebaseLocalStorage",ch="fbase_key";class ho{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 yi(e,t){return e.transaction([Xo],t?"readwrite":"readonly").objectStore(Xo)}function ZS(){const e=indexedDB.deleteDatabase(lh);return new ho(e).toPromise()}function Ba(){const e=indexedDB.open(lh,QS);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(Xo,{keyPath:ch})}catch(s){n(s)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(Xo)?t(r):(r.close(),await ZS(),t(await Ba()))})})}async function Tu(e,t,n){const r=yi(e,!0).put({[ch]:t,value:n});return new ho(r).toPromise()}async function eI(e,t){const n=yi(e,!1).get(t),r=await new ho(n).toPromise();return r===void 0?null:r.value}function Su(e,t){const n=yi(e,!0).delete(t);return new ho(n).toPromise()}const tI=800,nI=3;class uh{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 Ba(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>nI)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return ah()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=vi._getInstance(XS()),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 JS(),!this.activeServiceWorker)return;this.sender=new GS(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||YS()!==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 Ba();return await Tu(t,Yo,"1"),await Su(t,Yo),!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=>eI(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>Su(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(s=>{const o=yi(s,!1).getAll();return new ho(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(),tI)}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()}}uh.type="LOCAL";const rI=uh;new uo(3e4,6e4);/**
1196
+ * @license
1197
+ * Copyright 2021 Google LLC
1198
+ *
1199
+ * Licensed under the Apache License, Version 2.0 (the "License");
1200
+ * you may not use this file except in compliance with the License.
1201
+ * You may obtain a copy of the License at
1202
+ *
1203
+ * http://www.apache.org/licenses/LICENSE-2.0
1204
+ *
1205
+ * Unless required by applicable law or agreed to in writing, software
1206
+ * distributed under the License is distributed on an "AS IS" BASIS,
1207
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1208
+ * See the License for the specific language governing permissions and
1209
+ * limitations under the License.
1210
+ */function dh(e,t){return t?qn(t):(He(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
1211
+ * @license
1212
+ * Copyright 2019 Google LLC
1213
+ *
1214
+ * Licensed under the Apache License, Version 2.0 (the "License");
1215
+ * you may not use this file except in compliance with the License.
1216
+ * You may obtain a copy of the License at
1217
+ *
1218
+ * http://www.apache.org/licenses/LICENSE-2.0
1219
+ *
1220
+ * Unless required by applicable law or agreed to in writing, software
1221
+ * distributed under the License is distributed on an "AS IS" BASIS,
1222
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1223
+ * See the License for the specific language governing permissions and
1224
+ * limitations under the License.
1225
+ */class Al extends th{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return us(t,this._buildIdpRequest())}_linkToIdToken(t,n){return us(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return us(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 sI(e){return US(e.auth,new Al(e),e.bypassAuthState)}function oI(e){const{auth:t,user:n}=e;return He(n,t,"internal-error"),BS(n,new Al(e),e.bypassAuthState)}async function iI(e){const{auth:t,user:n}=e;return He(n,t,"internal-error"),jS(n,new Al(e),e.bypassAuthState)}/**
1226
+ * @license
1227
+ * Copyright 2020 Google LLC
1228
+ *
1229
+ * Licensed under the Apache License, Version 2.0 (the "License");
1230
+ * you may not use this file except in compliance with the License.
1231
+ * You may obtain a copy of the License at
1232
+ *
1233
+ * http://www.apache.org/licenses/LICENSE-2.0
1234
+ *
1235
+ * Unless required by applicable law or agreed to in writing, software
1236
+ * distributed under the License is distributed on an "AS IS" BASIS,
1237
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1238
+ * See the License for the specific language governing permissions and
1239
+ * limitations under the License.
1240
+ */class fh{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(d){this.reject(d)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return sI;case"linkViaPopup":case"linkViaRedirect":return iI;case"reauthViaPopup":case"reauthViaRedirect":return oI;default:On(this.auth,"internal-error")}}resolve(t){er(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){er(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()}}/**
1241
+ * @license
1242
+ * Copyright 2020 Google LLC
1243
+ *
1244
+ * Licensed under the Apache License, Version 2.0 (the "License");
1245
+ * you may not use this file except in compliance with the License.
1246
+ * You may obtain a copy of the License at
1247
+ *
1248
+ * http://www.apache.org/licenses/LICENSE-2.0
1249
+ *
1250
+ * Unless required by applicable law or agreed to in writing, software
1251
+ * distributed under the License is distributed on an "AS IS" BASIS,
1252
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1253
+ * See the License for the specific language governing permissions and
1254
+ * limitations under the License.
1255
+ */const aI=new uo(2e3,1e4);async function lI(e,t,n){if(An(e.app))return Promise.reject(yn(e,"operation-not-supported-in-this-environment"));const r=gi(e);sS(e,t,El);const s=dh(r,n);return new jr(r,"signInViaPopup",t,s).executeNotNull()}class jr extends fh{constructor(t,n,r,s,o){super(t,n,s,o),this.provider=r,this.authWindow=null,this.pollId=null,jr.currentPopupAction&&jr.currentPopupAction.cancel(),jr.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return He(t,this.auth,"internal-error"),t}async onExecution(){er(this.filter.length===1,"Popup operations only handle one event");const t=Cl();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(yn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(yn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,jr.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(yn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,aI.get())};t()}}jr.currentPopupAction=null;/**
1256
+ * @license
1257
+ * Copyright 2020 Google LLC
1258
+ *
1259
+ * Licensed under the Apache License, Version 2.0 (the "License");
1260
+ * you may not use this file except in compliance with the License.
1261
+ * You may obtain a copy of the License at
1262
+ *
1263
+ * http://www.apache.org/licenses/LICENSE-2.0
1264
+ *
1265
+ * Unless required by applicable law or agreed to in writing, software
1266
+ * distributed under the License is distributed on an "AS IS" BASIS,
1267
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1268
+ * See the License for the specific language governing permissions and
1269
+ * limitations under the License.
1270
+ */const cI="pendingRedirect",No=new Map;class uI extends fh{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=No.get(this.auth._key());if(!t){try{const r=await dI(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}No.set(this.auth._key(),t)}return this.bypassAuthState||No.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 dI(e,t){const n=pI(t),r=hI(e);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function fI(e,t){No.set(e._key(),t)}function hI(e){return qn(e._redirectPersistence)}function pI(e){return Oo(cI,e.config.apiKey,e.name)}async function mI(e,t,n=!1){if(An(e.app))return Promise.reject(Fr(e));const r=gi(e),s=dh(r,t),i=await new uI(r,s,n).execute();return i&&!n&&(delete i.user._redirectEventId,await r._persistUserIfCurrent(i.user),await r._setRedirectUser(null,t)),i}/**
1271
+ * @license
1272
+ * Copyright 2020 Google LLC
1273
+ *
1274
+ * Licensed under the Apache License, Version 2.0 (the "License");
1275
+ * you may not use this file except in compliance with the License.
1276
+ * You may obtain a copy of the License at
1277
+ *
1278
+ * http://www.apache.org/licenses/LICENSE-2.0
1279
+ *
1280
+ * Unless required by applicable law or agreed to in writing, software
1281
+ * distributed under the License is distributed on an "AS IS" BASIS,
1282
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1283
+ * See the License for the specific language governing permissions and
1284
+ * limitations under the License.
1285
+ */const gI=600*1e3;class vI{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||!yI(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!hh(t)){const s=((r=t.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(yn(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>=gI&&this.cachedEventUids.clear(),this.cachedEventUids.has(Iu(t))}saveEventToCache(t){this.cachedEventUids.add(Iu(t)),this.lastProcessedEventTime=Date.now()}}function Iu(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function hh({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function yI(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return hh(e);default:return!1}}/**
1286
+ * @license
1287
+ * Copyright 2020 Google LLC
1288
+ *
1289
+ * Licensed under the Apache License, Version 2.0 (the "License");
1290
+ * you may not use this file except in compliance with the License.
1291
+ * You may obtain a copy of the License at
1292
+ *
1293
+ * http://www.apache.org/licenses/LICENSE-2.0
1294
+ *
1295
+ * Unless required by applicable law or agreed to in writing, software
1296
+ * distributed under the License is distributed on an "AS IS" BASIS,
1297
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1298
+ * See the License for the specific language governing permissions and
1299
+ * limitations under the License.
1300
+ */async function wI(e,t={}){return ws(e,"GET","/v1/projects",t)}/**
1301
+ * @license
1302
+ * Copyright 2020 Google LLC
1303
+ *
1304
+ * Licensed under the Apache License, Version 2.0 (the "License");
1305
+ * you may not use this file except in compliance with the License.
1306
+ * You may obtain a copy of the License at
1307
+ *
1308
+ * http://www.apache.org/licenses/LICENSE-2.0
1309
+ *
1310
+ * Unless required by applicable law or agreed to in writing, software
1311
+ * distributed under the License is distributed on an "AS IS" BASIS,
1312
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
+ * See the License for the specific language governing permissions and
1314
+ * limitations under the License.
1315
+ */const bI=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,_I=/^https?/;async function kI(e){if(e.config.emulator)return;const{authorizedDomains:t}=await wI(e);for(const n of t)try{if(TI(n))return}catch{}On(e,"unauthorized-domain")}function TI(e){const t=La(),{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(!_I.test(n))return!1;if(bI.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
1316
+ * @license
1317
+ * Copyright 2020 Google LLC.
1318
+ *
1319
+ * Licensed under the Apache License, Version 2.0 (the "License");
1320
+ * you may not use this file except in compliance with the License.
1321
+ * You may obtain a copy of the License at
1322
+ *
1323
+ * http://www.apache.org/licenses/LICENSE-2.0
1324
+ *
1325
+ * Unless required by applicable law or agreed to in writing, software
1326
+ * distributed under the License is distributed on an "AS IS" BASIS,
1327
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1328
+ * See the License for the specific language governing permissions and
1329
+ * limitations under the License.
1330
+ */const SI=new uo(3e4,6e4);function Eu(){const e=Mn().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}}function II(e){return new Promise((t,n)=>{var s,o,i;function r(){Eu(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Eu(),n(yn(e,"network-request-failed"))},timeout:SI.get()})}if((o=(s=Mn().gapi)==null?void 0:s.iframes)!=null&&o.Iframe)t(gapi.iframes.getContext());else if((i=Mn().gapi)!=null&&i.load)r();else{const a=xS("iframefcb");return Mn()[a]=()=>{gapi.load?r():n(yn(e,"network-request-failed"))},RS(`${PS()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw $o=null,t})}let $o=null;function EI(e){return $o=$o||II(e),$o}/**
1331
+ * @license
1332
+ * Copyright 2020 Google LLC.
1333
+ *
1334
+ * Licensed under the Apache License, Version 2.0 (the "License");
1335
+ * you may not use this file except in compliance with the License.
1336
+ * You may obtain a copy of the License at
1337
+ *
1338
+ * http://www.apache.org/licenses/LICENSE-2.0
1339
+ *
1340
+ * Unless required by applicable law or agreed to in writing, software
1341
+ * distributed under the License is distributed on an "AS IS" BASIS,
1342
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1343
+ * See the License for the specific language governing permissions and
1344
+ * limitations under the License.
1345
+ */const CI=new uo(5e3,15e3),AI="__/auth/iframe",RI="emulator/auth/iframe",PI={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},xI=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function MI(e){const t=e.config;He(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?_l(t,RI):`https://${e.config.authDomain}/${AI}`,r={apiKey:t.apiKey,appName:e.name,v:co},s=xI.get(e.config.apiHost);s&&(r.eid=s);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${lo(r).slice(1)}`}async function OI(e){const t=await EI(e),n=Mn().gapi;return He(n,e,"internal-error"),t.open({where:document.body,url:MI(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:PI,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const i=yn(e,"network-request-failed"),a=Mn().setTimeout(()=>{o(i)},CI.get());function l(){Mn().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{o(i)})}))}/**
1346
+ * @license
1347
+ * Copyright 2020 Google LLC.
1348
+ *
1349
+ * Licensed under the Apache License, Version 2.0 (the "License");
1350
+ * you may not use this file except in compliance with the License.
1351
+ * You may obtain a copy of the License at
1352
+ *
1353
+ * http://www.apache.org/licenses/LICENSE-2.0
1354
+ *
1355
+ * Unless required by applicable law or agreed to in writing, software
1356
+ * distributed under the License is distributed on an "AS IS" BASIS,
1357
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1358
+ * See the License for the specific language governing permissions and
1359
+ * limitations under the License.
1360
+ */const NI={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},$I=500,DI=600,LI="_blank",jI="http://localhost";class Cu{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function BI(e,t,n,r=$I,s=DI){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={...NI,width:r.toString(),height:s.toString(),top:o,left:i},d=en().toLowerCase();n&&(a=Gf(d)?LI:n),zf(d)&&(t=t||jI,l.scrollbars="yes");const u=Object.entries(l).reduce((g,[T,j])=>`${g}${T}=${j},`,"");if(_S(d)&&a!=="_self")return UI(t||"",a),new Cu(null);const p=window.open(t||"",a,u);He(p,e,"popup-blocked");try{p.focus()}catch{}return new Cu(p)}function UI(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)}/**
1361
+ * @license
1362
+ * Copyright 2021 Google LLC
1363
+ *
1364
+ * Licensed under the Apache License, Version 2.0 (the "License");
1365
+ * you may not use this file except in compliance with the License.
1366
+ * You may obtain a copy of the License at
1367
+ *
1368
+ * http://www.apache.org/licenses/LICENSE-2.0
1369
+ *
1370
+ * Unless required by applicable law or agreed to in writing, software
1371
+ * distributed under the License is distributed on an "AS IS" BASIS,
1372
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1373
+ * See the License for the specific language governing permissions and
1374
+ * limitations under the License.
1375
+ */const FI="__/auth/handler",HI="emulator/auth/handler",VI=encodeURIComponent("fac");async function Au(e,t,n,r,s,o){He(e.config.authDomain,e,"auth-domain-config-required"),He(e.config.apiKey,e,"invalid-api-key");const i={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:co,eventId:s};if(t instanceof El){t.setDefaultLanguage(e.languageCode),i.providerId=t.providerId||"",FT(t.getCustomParameters())||(i.customParameters=JSON.stringify(t.getCustomParameters()));for(const[u,p]of Object.entries({}))i[u]=p}if(t instanceof fo){const u=t.getScopes().filter(p=>p!=="");u.length>0&&(i.scopes=u.join(","))}e.tenantId&&(i.tid=e.tenantId);const a=i;for(const u of Object.keys(a))a[u]===void 0&&delete a[u];const l=await e._getAppCheckToken(),d=l?`#${VI}=${encodeURIComponent(l)}`:"";return`${WI(e)}?${lo(a).slice(1)}${d}`}function WI({config:e}){return e.emulator?_l(e,HI):`https://${e.authDomain}/${FI}`}/**
1376
+ * @license
1377
+ * Copyright 2020 Google LLC
1378
+ *
1379
+ * Licensed under the Apache License, Version 2.0 (the "License");
1380
+ * you may not use this file except in compliance with the License.
1381
+ * You may obtain a copy of the License at
1382
+ *
1383
+ * http://www.apache.org/licenses/LICENSE-2.0
1384
+ *
1385
+ * Unless required by applicable law or agreed to in writing, software
1386
+ * distributed under the License is distributed on an "AS IS" BASIS,
1387
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1388
+ * See the License for the specific language governing permissions and
1389
+ * limitations under the License.
1390
+ */const sa="webStorageSupport";class zI{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ih,this._completeRedirectFn=mI,this._overrideRedirectResult=fI}async _openPopup(t,n,r,s){var i;er((i=this.eventManagers[t._key()])==null?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await Au(t,n,r,La(),s);return BI(t,o,Cl())}async _openRedirect(t,n,r,s){await this._originValidation(t);const o=await Au(t,n,r,La(),s);return KS(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):(er(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 OI(t),r=new vI(t);return n.register("authEvent",s=>(He(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(sa,{type:sa},s=>{var i;const o=(i=s==null?void 0:s[0])==null?void 0:i[sa];o!==void 0&&n(!!o),On(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=kI(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return Qf()||qf()||Sl()}}const qI=zI;var Ru="@firebase/auth",Pu="1.12.1";/**
1391
+ * @license
1392
+ * Copyright 2020 Google LLC
1393
+ *
1394
+ * Licensed under the Apache License, Version 2.0 (the "License");
1395
+ * you may not use this file except in compliance with the License.
1396
+ * You may obtain a copy of the License at
1397
+ *
1398
+ * http://www.apache.org/licenses/LICENSE-2.0
1399
+ *
1400
+ * Unless required by applicable law or agreed to in writing, software
1401
+ * distributed under the License is distributed on an "AS IS" BASIS,
1402
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1403
+ * See the License for the specific language governing permissions and
1404
+ * limitations under the License.
1405
+ */class GI{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(){He(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1406
+ * @license
1407
+ * Copyright 2020 Google LLC
1408
+ *
1409
+ * Licensed under the Apache License, Version 2.0 (the "License");
1410
+ * you may not use this file except in compliance with the License.
1411
+ * You may obtain a copy of the License at
1412
+ *
1413
+ * http://www.apache.org/licenses/LICENSE-2.0
1414
+ *
1415
+ * Unless required by applicable law or agreed to in writing, software
1416
+ * distributed under the License is distributed on an "AS IS" BASIS,
1417
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1418
+ * See the License for the specific language governing permissions and
1419
+ * limitations under the License.
1420
+ */function KI(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 JI(e){to(new ms("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;He(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:Zf(e)},d=new CS(r,s,o,l);return OS(d,n),d},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),to(new ms("auth-internal",t=>{const n=gi(t.getProvider("auth").getImmediate());return(r=>new GI(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),as(Ru,Pu,KI(e)),as(Ru,Pu,"esm2020")}/**
1421
+ * @license
1422
+ * Copyright 2021 Google LLC
1423
+ *
1424
+ * Licensed under the Apache License, Version 2.0 (the "License");
1425
+ * you may not use this file except in compliance with the License.
1426
+ * You may obtain a copy of the License at
1427
+ *
1428
+ * http://www.apache.org/licenses/LICENSE-2.0
1429
+ *
1430
+ * Unless required by applicable law or agreed to in writing, software
1431
+ * distributed under the License is distributed on an "AS IS" BASIS,
1432
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1433
+ * See the License for the specific language governing permissions and
1434
+ * limitations under the License.
1435
+ */const YI=300,XI=Rf("authIdTokenMaxAge")||YI;let xu=null;const QI=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>XI)return;const s=n==null?void 0:n.token;xu!==s&&(xu=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function ZI(e=$f()){const t=Of(e,"auth");if(t.isInitialized())return t.getImmediate();const n=MS(e,{popupRedirectResolver:qI,persistence:[rI,zS,ih]}),r=Rf("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=QI(o.toString());HS(n,i,()=>i(n.currentUser)),FS(n,a=>i(a))}}const s=IT("auth");return s&&NS(n,`http://${s}`),n}function eE(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}AS({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=yn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",eE().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="});JI("Browser");const tE={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 nE(e){const t=L(null),n=L(""),r=L(""),s=L(""),o=L({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),i=ue(()=>s.value==="pull"),a=ue(()=>s.value==="push"),l=ue(()=>s.value!=="");async function d(){try{const R=await fetch("/codex-api/skills-sync/status");if(!R.ok)return;const B=await R.json();B.data&&(o.value=B.data)}catch{}}async function u(){try{const R=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),B=await R.json();if(!R.ok||!B.data)throw new Error("Failed to start GitHub login");t.value=B.data;const N=30,P=Math.max((B.data.interval??5)*1e3,3e3);let D=!1;for(let H=0;H<N;H++){await new Promise(pe=>setTimeout(pe,P));const oe=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:B.data.device_code})}),ae=await oe.json();if(!oe.ok)throw new Error(ae.error||"Failed to complete GitHub login");if(ae.ok){D=!0;break}if(!ae.pending)throw new Error(ae.error||"Failed to complete GitHub login")}if(!D)throw new Error("GitHub login timed out. Please retry.");t.value=null,await d(),e.showToast("GitHub login successful")}catch(R){e.showToast(R instanceof Error?R.message:"Failed GitHub login","error")}}async function p(){try{const R=V1().length>0?$f():Nf(tE),B=ZI(R),N=new Rn;N.addScope("repo");const P=await lI(B,N),D=Rn.credentialFromResult(P),H=(D==null?void 0:D.accessToken)??"";if(!H)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:H})}),ae=await oe.json();if(!oe.ok||!ae.ok)throw new Error(ae.error||"Failed to login with GitHub token");await d(),e.showToast("GitHub login successful")}catch(R){const B=R instanceof Error?R.message:"Failed Firebase GitHub login";e.showToast(B,"error")}}async function g(){r.value="",n.value="pull-started",s.value="pull";try{const R=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),B=await R.json();if(!R.ok||!B.ok)throw new Error(B.error||"Failed to pull synced skills");await e.onPulled(),n.value="pull-success",e.showToast(o.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(R){const B=R instanceof Error?R.message:"Failed to pull sync";r.value=B,n.value="pull-failed",e.showToast(B,"error")}finally{s.value=""}}async function T(){r.value="",n.value="push-started",s.value="push";try{const R=await fetch("/codex-api/skills-sync/push",{method:"POST"}),B=await R.json();if(!R.ok||!B.ok)throw new Error(B.error||"Failed to push synced skills");n.value="push-success",e.showToast("Pushed skills to private sync repo")}catch(R){const B=R instanceof Error?R.message:"Failed to push sync";r.value=B,n.value="push-failed",e.showToast(B,"error")}finally{s.value=""}}async function j(){try{const R=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),B=await R.json();if(!R.ok||!B.ok)throw new Error(B.error||"Failed to logout GitHub");await d(),e.showToast("Logged out from GitHub")}catch(R){e.showToast(R instanceof Error?R.message:"Failed to logout GitHub","error")}}return{deviceLogin:t,isPullInFlight:i,isPushInFlight:a,isSyncActionInFlight:l,loadSyncStatus:d,logoutGithub:j,pullSkillsSync:g,pushSkillsSync:T,startGithubFirebaseLogin:p,startGithubLogin:u,syncActionError:r,syncActionStatus:n,syncStatus:o}}const rE={class:"skills-hub"},sE={class:"skills-sync-panel"},oE={class:"skills-sync-header"},iE={key:0,class:"skills-sync-badge"},aE={key:1,class:"skills-sync-badge"},lE={key:2,class:"skills-sync-badge"},cE={class:"skills-sync-meta"},uE={key:0,class:"skills-sync-error"},dE={key:1,class:"skills-sync-meta"},fE={key:2,class:"skills-sync-error"},hE={key:3,class:"skills-sync-device"},pE=["href"],mE={class:"skills-sync-actions"},gE=["disabled"],vE=["disabled"],yE=["disabled"],wE={key:1,class:"skills-hub-section"},bE={class:"skills-hub-section-title"},_E={key:0,class:"skills-hub-grid"},kE={class:"skills-hub-toolbar"},TE={class:"skills-hub-search-wrap"},SE={key:0,class:"skills-hub-count"},IE={class:"skills-hub-section"},EE={key:0,class:"skills-hub-loading"},CE={key:1,class:"skills-hub-error"},AE={key:0,class:"skills-hub-grid"},RE={key:1,class:"skills-hub-empty"},ko="codex-web-local.skills-hub.cache.v1",PE=$t({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=L(null),s=L(""),o=L("date"),i=L([]),a=L([]),l=L(0),d=L(!1),u=L(""),p=L(!0),g=L(!1),T=L(n),j=L(null),R=L(""),B=L(!1),N=L(!1);let P=null,D=null;const H=t,oe=ue(()=>o.value==="date"?"Newest":"A-Z"),ae=ue(()=>{var x;return((x=j.value)==null?void 0:x.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),pe=ue(()=>`${T.value.owner}/${T.value.name}`),Te=ue(()=>B.value&&R.value===pe.value),ce=ue(()=>N.value&&R.value===pe.value),te=ue(()=>{const x=s.value.toLowerCase().trim();return x?a.value.filter(U=>U.name.toLowerCase().includes(x)||U.owner.toLowerCase().includes(x)||(U.displayName??"").toLowerCase().includes(x)):a.value});function ie(x,U="success"){j.value={text:x,type:U},D&&clearTimeout(D),D=setTimeout(()=>{j.value=null},3e3)}function Y(){o.value=o.value==="date"?"name":"date",me(s.value)}function Ae(x){return`${o.value}::${x.trim().toLowerCase()}`}function Se(x){var U;if(typeof window>"u")return null;try{const q=window.localStorage.getItem(ko);return q?((U=JSON.parse(q).byKey)==null?void 0:U[x])??null:null}catch{return null}}function Me(x,U){if(!(typeof window>"u"))try{const q=window.localStorage.getItem(ko),G=(q?JSON.parse(q):{}).byKey??{};G[x]=U,window.localStorage.setItem(ko,JSON.stringify({byKey:G}))}catch{}}function Re(){if(!(typeof window>"u"))try{window.localStorage.removeItem(ko)}catch{}}function Oe(x){const U=x.installed??[];a.value=U;const q=new Set(U.map(K=>K.name));i.value=x.data.map(K=>{if(K.installed||q.has(K.name)){const G=U.find(ge=>ge.name===K.name);return{...K,installed:!0,path:(G==null?void 0:G.path)??K.path,enabled:(G==null?void 0:G.enabled)??K.enabled}}return K}).filter(K=>!K.installed),l.value=x.total}async function me(x){const U=Ae(x),q=Se(U);q&&Oe(q),d.value=!q,u.value="";try{const K=new URLSearchParams;x.trim()&&K.set("q",x.trim()),K.set("limit","100"),K.set("sort",o.value);const G=await fetch(`/codex-api/skills-hub?${K}`);if(!G.ok)throw new Error(`HTTP ${G.status}`);const ge=await G.json();Oe(ge),Me(U,ge)}catch(K){u.value=K instanceof Error?K.message:"Failed to load skills"}finally{d.value=!1}}function at(){P&&clearTimeout(P),P=setTimeout(()=>me(s.value),300)}function Ye(x){T.value=x,g.value=!0}async function Xe(x){R.value=`${x.owner}/${x.name}`,B.value=!0;try{const q=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:x.owner,name:x.name})})).json();if(!q.ok)throw new Error(q.error||"Install failed");const K={...x,installed:!0,path:q.path,enabled:!0};a.value=[...a.value,K],i.value=i.value.filter(G=>G.name!==x.name),T.value=K,ie(`${x.displayName||x.name} skill installed`),g.value=!1,Re(),H("skills-changed")}catch(U){ie(U instanceof Error?U.message:"Failed to install skill","error")}finally{B.value=!1}}async function We(x){R.value=`${x.owner}/${x.name}`,N.value=!0;try{const q=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:x.name,path:x.path})})).json();if(!q.ok)throw new Error(q.error||"Uninstall failed");a.value=a.value.filter(K=>K.name!==x.name),x.owner!=="local"&&(i.value=[...i.value,{...x,installed:!1,path:void 0,enabled:void 0}]),ie(`${x.displayName||x.name} skill uninstalled`),g.value=!1,Re(),H("skills-changed")}catch(U){ie(U instanceof Error?U.message:"Failed to uninstall skill","error")}finally{N.value=!1}}async function Qe(x,U){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:x.path,enabled:U}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),ie(`${x.displayName||x.name} skill ${U?"enabled":"disabled"}`),await me(s.value)}catch(q){ie(q instanceof Error?q.message:"Failed to update skill","error")}}const{deviceLogin:tt,isPullInFlight:je,isPushInFlight:ze,isSyncActionInFlight:V,loadSyncStatus:ne,logoutGithub:le,pullSkillsSync:we,pushSkillsSync:$e,startGithubFirebaseLogin:w,startGithubLogin:k,syncActionError:M,syncActionStatus:W,syncStatus:F}=nE({showToast:ie,onPulled:async()=>{await me(s.value),H("skills-changed")}});return nr(()=>{me(""),ne()}),(x,U)=>(b(),I("div",rE,[U[11]||(U[11]=y("div",{class:"skills-hub-header"},[y("h2",{class:"skills-hub-title"},"Skills Hub"),y("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),y("div",sE,[y("div",oE,[U[8]||(U[8]=y("strong",null,"Skills Sync (GitHub)",-1)),ve(F).configured?(b(),I("span",iE,"Connected: "+se(ve(F).repoOwner)+"/"+se(ve(F).repoName),1)):ve(F).loggedIn?(b(),I("span",aE,"Logged in as "+se(ve(F).githubUsername),1)):(b(),I("span",lE,"Not connected"))]),y("div",cE,[y("span",null,"Startup: "+se(ve(F).startup.mode),1),y("span",null,"Branch: "+se(ve(F).startup.branch),1),y("span",null,"Action: "+se(ve(F).startup.lastAction),1)]),ve(F).startup.lastError?(b(),I("div",uE,se(ve(F).startup.lastError),1)):re("",!0),ve(W)?(b(),I("div",dE,[y("span",null,"Manual sync: "+se(ve(W)),1)])):re("",!0),ve(M)?(b(),I("div",fE,se(ve(M)),1)):re("",!0),ve(tt)?(b(),I("div",hE,[y("span",null,[U[9]||(U[9]=Ys("Open ",-1)),y("a",{href:ve(tt).verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,pE),U[10]||(U[10]=Ys(" and enter code:",-1))]),y("code",null,se(ve(tt).user_code),1)])):re("",!0),y("div",mE,[ve(F).loggedIn?re("",!0):(b(),I("button",{key:0,class:"skills-hub-sort",type:"button",onClick:U[0]||(U[0]=(...q)=>ve(w)&&ve(w)(...q))},"Login with GitHub")),ve(F).loggedIn?re("",!0):(b(),I("button",{key:1,class:"skills-hub-sort",type:"button",onClick:U[1]||(U[1]=(...q)=>ve(k)&&ve(k)(...q))},"Device Login")),ve(F).loggedIn?(b(),I("button",{key:2,class:"skills-hub-sort",type:"button",onClick:U[2]||(U[2]=(...q)=>ve(le)&&ve(le)(...q)),disabled:ve(V)},"Logout GitHub",8,gE)):re("",!0),y("button",{class:"skills-hub-sort",type:"button",onClick:U[3]||(U[3]=(...q)=>ve(we)&&ve(we)(...q)),disabled:ve(V)},se(ve(je)?"Pulling...":"Pull"),9,vE),ve(F).loggedIn?(b(),I("button",{key:3,class:"skills-hub-sort",type:"button",onClick:U[4]||(U[4]=(...q)=>ve($e)&&ve($e)(...q)),disabled:!ve(F).configured||ve(V)},se(ve(ze)?"Pushing...":"Push"),9,yE)):re("",!0)])]),j.value?(b(),I("div",{key:0,class:ot(["skills-hub-toast",ae.value])},se(j.value.text),3)):re("",!0),te.value.length>0?(b(),I("div",wE,[y("button",{class:"skills-hub-section-toggle",type:"button",onClick:U[5]||(U[5]=q=>p.value=!p.value)},[y("span",bE,"Installed ("+se(te.value.length)+")",1),Ie(bf,{class:ot(["skills-hub-section-chevron",{"is-open":p.value}])},null,8,["class"])]),p.value?(b(),I("div",_E,[(b(!0),I(Le,null,bt(te.value,q=>(b(),ft(ru,{key:q.name,skill:q,onSelect:K=>Ye(K)},null,8,["skill","onSelect"]))),128))])):re("",!0)])):re("",!0),y("div",kE,[y("div",TE,[Ie(xa,{class:"skills-hub-search-icon"}),Xn(y("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":U[6]||(U[6]=q=>s.value=q),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:at},null,544),[[Qn,s.value]]),l.value>0?(b(),I("span",SE,se(l.value)+" skills",1)):re("",!0)]),y("button",{class:"skills-hub-sort",type:"button",onClick:Y},se(oe.value),1)]),y("div",IE,[d.value?(b(),I("div",EE,"Loading skills...")):u.value?(b(),I("div",CE,se(u.value),1)):(b(),I(Le,{key:2},[i.value.length>0?(b(),I("div",AE,[(b(!0),I(Le,null,bt(i.value,q=>(b(),ft(ru,{key:q.url,skill:q,onSelect:K=>Ye(K)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(b(),I("div",RE,'No skills found for "'+se(s.value)+'"',1)):re("",!0)],64))]),Ie(gT,{skill:T.value,visible:g.value,"is-installing":Te.value,"is-uninstalling":ce.value,onClose:U[7]||(U[7]=q=>g.value=!1),onInstall:Xe,onUninstall:We,onToggleEnabled:Qe},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),xE=et(PE,[["__scopeId","data-v-2f6920be"]]),ME={},OE={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 NE(e,t){return b(),I("svg",OE,[...t[0]||(t[0]=[y("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),y("path",{d:"M9 4l0 16"},null,-1)])])}const $E=et(ME,[["render",NE]]),DE={},LE={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 b(),I("svg",LE,[...t[0]||(t[0]=[y("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 BE=et(DE,[["render",jE]]),UE={class:"sidebar-thread-controls"},FE=["aria-label","title"],HE=$t({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(b(),I("div",UE,[y("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(b(),ft(BE,{key:0,class:"sidebar-thread-controls-icon"})):(b(),ft($E,{key:1,class:"sidebar-thread-controls-icon"}))],8,FE),Pn(t.$slots,"default",{},void 0),e.showNewThreadButton?(b(),I("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"))},[Ie(Wo,{class:"sidebar-thread-controls-icon"})])):re("",!0)]))}}),Mu=et(HE,[["__scopeId","data-v-46a10052"]]),VE={},WE={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function zE(e,t){return b(),I("svg",WE,[...t[0]||(t[0]=[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("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"}),y("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const qE=et(VE,[["render",zE]]);function gr(e){return e.flatMap(t=>t.threads)}const ph="codex-web-local.thread-read-state.v1",mh="codex-web-local.thread-scroll-state.v1",Ua="codex-web-local.selected-thread-id.v1",Fa="codex-web-local.selected-model-id.v1",gh="codex-web-local.project-order.v1",vh="codex-web-local.project-display-name.v1",oa=220,GE=500,Ou=["none","minimal","low","medium","high","xhigh"],Ms="__global__",un="gpt-5.2-codex";function KE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(ph);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function Nu(e){typeof window>"u"||window.localStorage.setItem(ph,JSON.stringify(e))}function Ha(e,t,n){return Math.min(Math.max(e,t),n)}function JE(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=Ha(t.scrollRatio,0,1)),n}function YE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(mh);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=JE(s);o&&(n[r]=o)}return n}catch{return{}}}function $u(e){typeof window>"u"||window.localStorage.setItem(mh,JSON.stringify(e))}function XE(){return typeof window>"u"?"":window.localStorage.getItem(Ua)??""}function QE(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Ua);return}window.localStorage.setItem(Ua,e)}}function ZE(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(Fa))==null?void 0:e.trim())??""}function ia(e){if(typeof window>"u")return;const t=e.trim();if(!t){window.localStorage.removeItem(Fa);return}window.localStorage.setItem(Fa,t)}function eC(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(gh);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 Qr(e){typeof window>"u"||window.localStorage.setItem(gh,JSON.stringify(e))}function tC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(vh);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 aa(e){typeof window>"u"||window.localStorage.setItem(vh,JSON.stringify(e))}function To(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 Dr(e,n)?e:n}function la(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>n.get(s)??null).filter(s=>s!==null&&s.threads.length>0);for(const s of e)t.includes(s.projectName)||r.push(s);return r}function Dr(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 nC(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 rC(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function So(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 Va(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Dr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&rC(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Qo(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function sC(e,t,n={}){const r=new Map(e.map(u=>[u.id,u])),s=new Map(t.map(u=>[u.id,u])),o=t.map(u=>{const p=r.get(u.id);return p&&Va(p,u)?p:u});if(n.preserveMissing!==!0)return Qo(e,o)?e:o;const i=e.map(u=>{const p=s.get(u.id);return!p||Va(u,p)?u:p}),a=new Set(e.map(u=>u.id)),l=o.filter(u=>!a.has(u.id)),d=[...i,...l];return Qo(e,d)?e:d}function Wa(e){return e.replace(/\s+/gu," ").trim()}function oC(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Wa(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=Wa(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function Du(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Va(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const yh="worked";function fr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function iC(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 aC(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function lC(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 cC(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${iC(e.durationMs)}`,messageType:yh}}function uC(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function dC(e,t){const n=cC(t),r=e.filter(i=>i.messageType!==yh),s=uC(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Lt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function fC(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 hC(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 pC(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 Io(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>{const o=n.get(s.projectName),i=new Map((o==null?void 0:o.threads.map(l=>[l.id,l]))??[]),a=s.threads.map(l=>{const d=i.get(l.id);return d&&fC(d,l)?d:l});return o&&o.projectName===s.projectName&&hC(o.threads,a)?o:{projectName:s.projectName,threads:a}});return pC(e,r)?e:r}function mC(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 d=i.findIndex(u=>u.projectName===a.projectName);d>=0&&(i[d]={projectName:i[d].projectName,threads:[a,...i[d].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function gC(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function ca(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function vC(e){const t=e.split(`
1436
+ `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function yC(){const e=L([]),t=L([]),n=L(XE()),r=L({}),s=L({}),o=L({}),i=L({}),a=L({}),l=L({}),d=L({}),u=L([]),p=L(ZE()),g=L("medium"),T=L(KE()),j=L(YE()),R=L(eC()),B=L(tC()),N=L({}),P=L({}),D=L({}),H=L({}),oe=L({}),ae=L({}),pe=L({}),Te=L({}),ce=L({}),te=L({}),ie=L([]),Y=L([]),Ae=L(!1),Se=L(!1),Me=L(!1),Re=L(!1),Oe=L(!1),me=L(""),at=L(!1),Ye=L(!1);let Xe=null,We=null,Qe=null,tt=null,je=!1;const ze=new Set;let V=!1,ne=!1;const le=new Map,we=new Set,$e=ue(()=>gr(e.value)),w=ue(()=>$e.value.find(c=>c.id===n.value)??null),k=ue(()=>j.value[n.value]??null),M=ue(()=>{const c=[],h=n.value;return h&&Array.isArray(Te.value[h])&&c.push(...Te.value[h]),Array.isArray(Te.value[Ms])&&c.push(...Te.value[Ms]),c.sort((v,C)=>v.receivedAtIso.localeCompare(C.receivedAtIso))}),W=ue(()=>{var Z;const c=n.value;if(!c)return null;const h=oe.value[c],v=(o.value[c]??"").trim(),C=(((Z=ae.value[c])==null?void 0:Z.message)??"").trim();return!h&&!v&&!C?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:v,errorText:C}}),F=ue(()=>{const c=n.value;if(!c)return[];const h=r.value[c]??[],v=s.value[c]??[],C=i.value[c]??[],Z=[...h,...C,...v],X=H.value[c];return X?dC(Z,X):Z});function x(c){n.value!==c&&(n.value=c,QE(c),ne=!1)}function U(c){p.value=c.trim(),ia(p.value)}async function q(){p.value=un,ia(p.value),u.value.includes(un)||(u.value=[...u.value,un]);try{await I_(un)}catch{}}function K(c,h){ce.value={...ce.value,[c]:h}}function G(c){ce.value[c]&&(ce.value=Lt(ce.value,c))}async function ge(c){if(we.has(c))return;const h=ce.value[c];if(!(!h||h.fallbackRetried)){we.add(c),K(c,{...h,fallbackRetried:!0});try{await q();try{const v=await Yc(c,1);Kt(c,v),At(c,[]),Dt(c),i.value[c]&&(i.value=Lt(i.value,c))}catch{}nt(c,null),me.value="",Et(c,null),qe(c,{label:"Thinking",details:be(un,h.effort)}),mt(c,!0),D.value[c]!==!0&&await Ji(c),await Yi(c,h.text,h.imageUrls,un,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),D.value={...D.value,[c]:!0},Ve(),ze.add(c),je=!0,await Dn()}catch(v){const C=v instanceof Error?v.message:"Unknown application error";nt(c,C),me.value=C,mt(c,!1),qe(c,null)}finally{we.delete(c)}}}function fe(c){c&&!Ou.includes(c)||(g.value=c)}function be(c,h){const v=c.trim()||"default",C=h||"default";return[`Model: ${v}`,`Thinking: ${C}`]}async function Ee(){try{const[c,h]=await Promise.all([E_(),C_()]);u.value=c,p.value.length>0&&c.includes(p.value)||(h.model&&c.includes(h.model)?p.value=h.model:c.length>0?p.value=c[0]:p.value="",ia(p.value)),h.reasoningEffort&&Ou.includes(h.reasoningEffort)&&(g.value=h.reasoningEffort)}catch{}}async function Ne(){if(tt){await tt;return}tt=(async()=>{try{Y.value=f(await A_())}catch{}finally{tt=null}})(),await tt}function Ve(){if(typeof window>"u"){Ne();return}Qe!==null&&window.clearTimeout(Qe),Qe=window.setTimeout(()=>{Qe=null,Ne()},GE)}function Ue(c){const h=te.value;return Object.keys(h).length===0?c:c.map(v=>({projectName:v.projectName,threads:v.threads.map(C=>{const Z=h[C.id];return Z?{...C,title:Z}:C})}))}function Je(){const h=Ue(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(C=>{const Z=a.value[C.id]===!0,X=n.value===C.id,ye=T.value[C.id],xe=d.value[C.id]===!0,ke=!X&&!Z&&(xe||ye!==C.updatedAtIso);return{...C,inProgress:Z,unread:ke}})}));e.value=Io(e.value,h)}function vt(c,h,v){const C=new Date().toISOString(),Z=h.trim(),X=gC(Z),ye={id:c,title:vC(v),projectName:X,cwd:Z,hasWorktree:Z.includes("/.codex/worktrees/")||Z.includes("/.git/worktrees/"),createdAtIso:C,updatedAtIso:C,preview:v,unread:!1,inProgress:!1},xe=t.value.findIndex(rt=>rt.projectName===X);if(xe>=0){const St=t.value[xe].threads.filter(lr=>lr.id!==c),Yr={projectName:X,threads:[ye,...St]},Ln=[...t.value];Ln.splice(xe,1,Yr),t.value=Ln}else t.value=[{projectName:X,threads:[ye]},...t.value];const ke=To(R.value,t.value);Dr(R.value,ke)||(R.value=ke,Qr(R.value)),Je()}function it(c){const h=new Set(c.map(X=>X.id)),v=Ft(T.value,h);v!==T.value&&(T.value=v,Nu(v));const C=Ft(j.value,h);C!==j.value&&(j.value=C,$u(C)),P.value=Ft(P.value,h),N.value=Ft(N.value,h),D.value=Ft(D.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),H.value=Ft(H.value,h),oe.value=Ft(oe.value,h),ae.value=Ft(ae.value,h),pe.value=Ft(pe.value,h),d.value=Ft(d.value,h),a.value=Ft(a.value,h);const Z={};for(const[X,ye]of Object.entries(Te.value))(X===Ms||h.has(X))&&(Z[X]=ye);Te.value=Z}function kt(c){const h=gr(t.value).find(v=>v.id===c);h&&(T.value={...T.value,[c]:h.updatedAtIso},Nu(T.value),d.value[c]&&(d.value=Lt(d.value,c)),Je())}function Et(c,h){if(!c)return;const v=H.value[c];if(h){if(aC(v,h))return;H.value={...H.value,[c]:h}}else v&&(H.value=Lt(H.value,c))}function mt(c,h){!c||a.value[c]===!0===h||(h?a.value={...a.value,[c]:!0}:a.value=Lt(a.value,c),Je())}function yt(c){c&&c!==n.value&&d.value[c]!==!0&&(d.value={...d.value,[c]:!0},Je())}function qe(c,h){if(!c)return;const v=oe.value[c];if(!h){v&&(oe.value=Lt(oe.value,c));return}const C=Ze(h.label)||"Thinking",Z=h.details.map(xe=>Ze(xe)).filter(xe=>xe.length>0&&xe!==C),X=Array.from(new Set([...(v==null?void 0:v.details)??[],...Z])).slice(-3),ye={label:C,details:X};lC(v,ye)||(oe.value={...oe.value,[c]:ye})}function nt(c,h){if(!c)return;const v=ae.value[c],C=h?Wa(h):"";if(!C){v&&(ae.value=Lt(ae.value,c));return}(v==null?void 0:v.message)!==C&&(ae.value={...ae.value,[c]:{message:C}})}function Bt(c){const h=gr(t.value).find(v=>v.id===c);return(h==null?void 0:h.updatedAtIso)??""}function Pt(c,h){if(!c)return;const v={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(v.scrollRatio=Ha(h.scrollRatio,0,1));const C=j.value[c];C&&C.scrollTop===v.scrollTop&&C.isAtBottom===v.isAtBottom&&C.scrollRatio===v.scrollRatio||(j.value={...j.value,[c]:v},$u(j.value))}function Kt(c,h){const v=r.value[c]??[];Qo(v,h)||(r.value={...r.value,[c]:h})}function At(c,h){const v=s.value[c]??[];Qo(v,h)||(s.value={...s.value,[c]:h})}function on(c,h){const v=s.value[c]??[],C=Du(v,h);At(c,C)}function Ut(c,h){if(!c)return;const v=h.trim(),C=o.value[c]??"";if(v.length===0){if(!C)return;o.value=Lt(o.value,c);return}C!==v&&(o.value={...o.value,[c]:v})}function nn(c,h){if(!c)return;const v=o.value[c]??"";Ut(c,`${v}${h}`)}function Dt(c){c&&c in o.value&&(o.value=Lt(o.value,c))}function Ce(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function Pe(c){return typeof c=="string"?c:""}function rn(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function hn(c){var h,v;return((h=c.limitId)==null?void 0:h.trim())||((v=c.limitName)==null?void 0:v.trim())||"__default__"}function pn(c){const h=Ce(c);return h?{usedPercent:Ha(rn(h.usedPercent)??0,0,100),windowDurationMins:rn(h.windowDurationMins),resetsAt:rn(h.resetsAt)}:null}function _(c){const h=Ce(c);if(!h)return null;const v=Ce(h.credits);return{limitId:Pe(h.limitId)||null,limitName:Pe(h.limitName)||null,primary:pn(h.primary),secondary:pn(h.secondary),credits:v?{hasCredits:v.hasCredits===!0,unlimited:v.unlimited===!0,balance:Pe(v.balance)||null}:null,planType:Pe(h.planType)||null}}function f(c){const h=Ce(c);if(!h)return[];const v=[],C=new Set,Z=ye=>{if(!ye)return;const xe=hn(ye);C.has(xe)||(C.add(xe),v.push(ye))};Z(_(h.rateLimits));const X=Ce(h.rateLimitsByLimitId);if(X)for(const ye of Object.values(X))Z(_(ye));return v}function m(c){const h=Ce(c.params);if(!h)return"";const v=Pe(h.threadId);if(v)return v;const C=Pe(h.thread_id);if(C)return C;const Z=Pe(h.conversationId);if(Z)return Z;const X=Pe(h.conversation_id);if(X)return X;const ye=Ce(h.thread),xe=Pe(ye==null?void 0:ye.id);if(xe)return xe;const ke=Ce(h.turn),rt=Pe(ke==null?void 0:ke.threadId);if(rt)return rt;const St=Pe(ke==null?void 0:ke.thread_id);return St||""}function S(c){if(c.method!=="turn/completed")return"";const h=Ce(c.params),v=Ce(h==null?void 0:h.turn);if(!v||v.status!=="failed")return"";const C=Ce(v.error);return Pe(C==null?void 0:C.message)}function J(c){var v;if(c.method!=="error")return"";const h=Ce(c.params);return Pe(h==null?void 0:h.message)||Pe((v=Ce(h==null?void 0:h.error))==null?void 0:v.message)}function ee(c){const h=Ce(c);if(!h)return null;const v=h.id,C=Pe(h.method),Z=h.params;if(typeof v!="number"||!Number.isInteger(v)||!C)return null;const X=Ce(Z),ye=Pe(X==null?void 0:X.threadId)||Ms,xe=Pe(X==null?void 0:X.turnId),ke=Pe(X==null?void 0:X.itemId),rt=Pe(h.receivedAtIso)||new Date().toISOString();return{id:v,method:C,threadId:ye,turnId:xe,itemId:ke,receivedAtIso:rt,params:Z??null}}function _e(c){const h=c.threadId||Ms,v=Te.value[h]??[],C=v.findIndex(X=>X.id===c.id),Z=[...v];C>=0?Z.splice(C,1,c):Z.push(c),Te.value={...Te.value,[h]:Z.sort((X,ye)=>X.receivedAtIso.localeCompare(ye.receivedAtIso))}}function de(c){const h={};for(const[v,C]of Object.entries(Te.value)){const Z=C.filter(X=>X.id!==c);Z.length>0&&(h[v]=Z)}Te.value=h}function De(c){if(c.method==="server/request"){const h=ee(c.params);return h&&_e(h),!0}if(c.method==="server/request/resolved"){const h=Ce(c.params),v=h==null?void 0:h.id;return typeof v=="number"&&Number.isInteger(v)&&de(v),!0}return!1}function Ze(c){return c.replace(/\s+/gu," ").trim()}function ct(c){const h=m(c);if(!h)return null;if(c.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const v=Ce(c.params),C=Ce(v==null?void 0:v.item),Z=Pe(C==null?void 0:C.type).toLowerCase();if(Z==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(Z==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(Z==="commandexecution"){const X=Pe(C==null?void 0:C.command);return{threadId:h,activity:{label:"Running command",details:X?[X]:[]}}}}return c.method==="item/commandExecution/outputDelta"?{threadId:h,activity:{label:"Running command",details:[]}}:c.method==="item/reasoning/summaryTextDelta"||c.method==="item/reasoning/summaryPartAdded"?{threadId:h,activity:{label:"Thinking",details:[]}}:c.method==="item/agentMessage/delta"?{threadId:h,activity:{label:"Writing response",details:[]}}:null}function xt(c){if(c.method!=="turn/started")return null;const h=Ce(c.params);if(!h)return null;const v=m(c);if(!v)return null;const C=Ce(h.turn),Z=Pe(C==null?void 0:C.id)||Pe(h.turnId)||`${v}:unknown`;if(!Z)return null;const X=fr(Pe(C==null?void 0:C.startedAt))??fr(Pe(h.startedAt))??fr(c.atIso)??Date.now();return{threadId:v,turnId:Z,startedAtMs:X}}function Mt(c){if(c.method!=="turn/completed")return null;const h=Ce(c.params);if(!h)return null;const v=m(c);if(!v)return null;const C=Ce(h.turn),Z=Pe(C==null?void 0:C.id)||Pe(h.turnId)||`${v}:unknown`;if(!Z)return null;const X=fr(Pe(C==null?void 0:C.completedAt))??fr(Pe(h.completedAt))??fr(c.atIso)??Date.now(),ye=fr(Pe(C==null?void 0:C.startedAt))??fr(Pe(h.startedAt))??void 0;return{threadId:v,turnId:Z,completedAtMs:X,startedAtMs:ye}}function Nn(c){return`${c}:live-reasoning`}function Wr(c){const h=Ce(c.params);if(!h)return"";if(c.method==="item/started"){const v=Ce(h.item);return!v||v.type!=="reasoning"?"":Pe(v.id)}return""}function bs(c){const h=Ce(c.params);if(!h)return null;if(c.method==="item/reasoning/summaryTextDelta"){const v=Pe(h.itemId),C=Pe(h.delta);return!v||!C?null:{messageId:Nn(v),delta:C}}return null}function zr(c){const h=Ce(c.params);if(!h)return"";if(c.method==="item/reasoning/summaryPartAdded"){const v=Pe(h.itemId);return v?Nn(v):""}return""}function _s(c){const h=Ce(c.params);if(!h)return"";if(c.method==="item/completed"){const v=Ce(h.item);return!v||v.type!=="reasoning"?"":Nn(Pe(v.id))}return""}function sr(c){const h=Ce(c.params);if(!h)return"";if(c.method==="item/started"){const v=Ce(h.item);return!v||v.type!=="agentMessage"?"":Pe(v.id)}return""}function ks(c){const h=Ce(c.params);if(!h)return null;if(c.method==="item/agentMessage/delta"){const v=Pe(h.itemId),C=Pe(h.delta);return!v||!C?null:{messageId:v,delta:C}}return null}function Ts(c){const h=Ce(c.params);if(!h)return null;if(c.method==="item/completed"){const v=Ce(h.item);if(!v||v.type!=="agentMessage")return null;const C=Pe(v.id),Z=Pe(v.text);return!C||!Z?null:{id:C,role:"assistant",text:Z,messageType:"agentMessage.live"}}return null}function or(c){if(c.method!=="item/started")return null;const h=Ce(c.params),v=Ce(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const C=Pe(v.id),Z=Pe(v.command);if(!C)return null;const X=typeof v.cwd=="string"?v.cwd:null;return{id:C,role:"system",text:Z,messageType:"commandExecution",commandExecution:{command:Z,cwd:X,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function ir(c){if(c.method!=="item/commandExecution/outputDelta")return null;const h=Ce(c.params);if(!h)return null;const v=Pe(h.itemId),C=Pe(h.delta);return!v||!C?null:{itemId:v,delta:C}}function Ss(c){if(c.method!=="item/completed")return null;const h=Ce(c.params),v=Ce(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const C=Pe(v.id),Z=Pe(v.command);if(!C)return null;const X=typeof v.cwd=="string"?v.cwd:null,ye=Pe(v.status),xe=ye==="failed"?"failed":ye==="declined"?"declined":ye==="interrupted"?"interrupted":"completed",ke=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",rt=typeof v.exitCode=="number"?v.exitCode:null;return{id:C,role:"system",text:Z,messageType:"commandExecution",commandExecution:{command:Z,cwd:X,status:xe,aggregatedOutput:ke,exitCode:rt}}}function A(c,h){const v=i.value[c]??[],C=Du(v,h);C!==v&&(i.value={...i.value,[c]:C})}function O(c,h){const v=i.value[c];if(!v||v.length===0)return;const C=new Set(h.map(X=>X.id)),Z=v.filter(X=>!C.has(X.id));Z.length!==v.length&&(Z.length===0?i.value=Lt(i.value,c):i.value={...i.value,[c]:Z})}function $(c){if(c.method==="item/agentMessage/delta")return!0;const h=Ce(c.params);if(!h)return!1;if(c.method==="item/completed"){const v=Ce(h.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function Q(c){var Pl,xl,Ml,Ol;if(De(c))return;if(c.method==="account/rateLimits/updated"&&Ve(),c.method==="thread/name/updated"){const Ke=Ce(c.params),Tn=Pe(Ke==null?void 0:Ke.threadId),Cr=Pe(Ke==null?void 0:Ke.threadName);Tn&&Cr&&(te.value={...te.value,[Tn]:Cr},Je(),Xi(Tn,Cr))}const h=ct(c);h&&qe(h.threadId,h.activity);const v=xt(c);v&&(le.set(v.turnId,v),pe.value={...pe.value,[v.threadId]:v.turnId},Et(v.threadId,null),nt(v.threadId,null),mt(v.threadId,!0),d.value[v.threadId]&&(d.value=Lt(d.value,v.threadId)));const C=Mt(c),Z=S(c),ye=!!((C==null?void 0:C.threadId)??m(c))&&!!Z&&p.value!==un&&So(new Error(Z));if(C){const Ke=le.get(C.turnId);Ke&&le.delete(C.turnId);const Tn=rn((Pl=Ce(c.params))==null?void 0:Pl.durationMs)??rn((Ml=Ce((xl=Ce(c.params))==null?void 0:xl.turn))==null?void 0:Ml.durationMs)??(typeof C.startedAtMs=="number"?C.completedAtMs-C.startedAtMs:null)??(Ke?C.completedAtMs-Ke.startedAtMs:null),Cr=typeof Tn=="number"?Math.max(0,Tn):0;Et(C.threadId,{turnId:C.turnId,durationMs:Cr}),pe.value[C.threadId]&&(pe.value=Lt(pe.value,C.threadId)),mt(C.threadId,!1),qe(C.threadId,null),yt(C.threadId),ye||(G(C.threadId),mo(C.threadId))}if(Z){const Ke=(C==null?void 0:C.threadId)||m(c);Ke&&nt(Ke,Z),me.value=Z,Ke&&ye&&ge(Ke)}else C&&nt(C.threadId,null);const xe=J(c);if(xe){const Ke=m(c);Ke&&nt(Ke,xe),me.value=xe,p.value!==un&&So(new Error(xe))&&(Ke?ge(Ke):q())}const ke=m(c);if(!ke||ke!==n.value)return;sr(c);const rt=ks(c);if(rt){const Ke=(s.value[ke]??[]).find(Cr=>Cr.id===rt.messageId),Tn=`${(Ke==null?void 0:Ke.text)??""}${rt.delta}`;on(ke,{id:rt.messageId,role:"assistant",text:Tn,messageType:"agentMessage.live"})}const St=Ts(c);St&&on(ke,St),Wr(c);const Yr=bs(c);if(Yr&&nn(ke,Yr.delta),zr(c)){const Ke=o.value[ke]??"";Ke.trim().length>0&&!Ke.endsWith(`
1437
+
1438
+ `)&&Ut(ke,`${Ke}
1439
+
1440
+ `)}_s(c);const lr=or(c);lr&&(A(ke,lr),qe(ke,{label:"Running command",details:[((Ol=lr.commandExecution)==null?void 0:Ol.command)??""]}));const Ri=ir(c);if(Ri){const Ke=(i.value[ke]??[]).find(Tn=>Tn.id===Ri.itemId);Ke!=null&&Ke.commandExecution&&A(ke,{...Ke,commandExecution:{...Ke.commandExecution,aggregatedOutput:`${Ke.commandExecution.aggregatedOutput}${Ri.delta}`}})}const Rl=Ss(c);if(Rl&&A(ke,Rl),$(c)&&(ne&&n.value&&Pt(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),Dt(ke)),c.method==="turn/completed"){ne=!1,Dt(ke),i.value[ke]&&(i.value=Lt(i.value,ke));const Ke=m(c);Ke&&(mt(Ke,!1),qe(Ke,null),yt(Ke),ye||(G(Ke),mo(Ke)))}}function Fe(c){const h=m(c);h&&ze.add(h);const v=c.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(je=!0),!(We!==null||typeof window>"u")&&(We=window.setTimeout(()=>{We=null,Dn()},oa))}async function Rt(c){if(!V){V=!0;try{const h=await Pa(),v=[];for(const C of h.order){const Z=ca(C);v.includes(Z)||v.push(Z)}if(v.length>0){const C=To(v,c);Dr(R.value,C)||(R.value=C,Qr(R.value))}if(Object.keys(h.labels).length>0){const C={...B.value};let Z=!1;for(const[X,ye]of Object.entries(h.labels)){const xe=ca(X);C[xe]!==ye&&(C[xe]=ye,Z=!0)}Z&&(B.value=C,aa(C))}}catch{}}}async function an(){if(!(Object.keys(te.value).length>0))try{const c=await $_();Object.keys(c.titles).length>0&&(te.value=c.titles)}catch{}}async function qr(c,h,v){if(te.value[c])return;const C=h.trim();if(!C)return;const Z=C.length>300?C.slice(0,300):C;try{const X=await D_(Z,v);if(!X||te.value[c])return;te.value={...te.value,[c]:X},Je(),Xi(c,X)}catch{}}async function ar(){var c;Ye.value||(Ae.value=!0);try{const[h]=await Promise.all([m_(),an()]);await Rt(h);const v=To(R.value,h);Dr(R.value,v)||(R.value=v,Qr(R.value));const C=la(h,R.value),Z=mC(t.value,C,a.value);t.value=Io(t.value,Z),a.value=Ft(a.value,new Set(gr(t.value).map(xe=>xe.id))),Je(),Ye.value=!0;const X=gr(e.value);it(X),X.some(xe=>xe.id===n.value)||x(((c=X[0])==null?void 0:c.id)??"")}finally{Ae.value=!1}}async function Jt(c,h={}){if(!c)return;const v=P.value[c]===!0,C=h.silent!==!0&&!v;C&&(Se.value=!0);try{D.value[c]!==!0&&(await Ji(c),D.value={...D.value,[c]:!0});const{messages:Z,inProgress:X}=await g_(c),ye=r.value[c]??[],xe=sC(ye,Z,{preserveMissing:h.silent===!0});Kt(c,xe);const ke=s.value[c]??[],rt=oC(ke,Z);At(c,rt),O(c,Z),P.value={...P.value,[c]:!0};const St=Bt(c);St&&(N.value={...N.value,[c]:St}),mt(c,X),kt(c)}finally{C&&(Se.value=!1)}}async function $n(){try{const c=t.value.flatMap(h=>h.threads.map(v=>v.cwd)).filter(Boolean);ie.value=await L_(c.length>0?[...new Set(c)]:void 0)}catch{}}async function Gr(){me.value="";try{await ar(),await Promise.all([Ee(),Ne(),$n()]),await Jt(n.value)}catch(c){me.value=c instanceof Error?c.message:"Unknown application error"}}async function Er(c){x(c);try{await Jt(c)}catch(h){me.value=h instanceof Error?h.message:"Unknown application error"}}async function wi(c){try{await b_(c),await ar(),n.value===c&&await Jt(n.value)}catch(h){me.value=h instanceof Error?h.message:"Unknown application error"}}async function bi(c,h){const v=h.trim();if(!(!c||!v))try{await __(c,v),te.value={...te.value,[c]:v},Je(),Xi(c,v)}catch(C){me.value=C instanceof Error?C.message:"Unknown application error"}}async function po(c,h=[],v=[],C="steer",Z=[]){const X=n.value,ye=c.trim();if(!X||!ye&&h.length===0&&Z.length===0)return;const xe=a.value[X]===!0;if(xe&&C==="queue"){const ke=l.value[X]??[],rt=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[X]:[...ke,{id:rt,text:ye,imageUrls:h,skills:v,fileAttachments:Z}]};return}if(xe){ne=!0,Kr(X,ye,h,v,Z).catch(ke=>{const rt=ke instanceof Error?ke.message:"Unknown application error";nt(X,rt),me.value=rt});return}me.value="",ne=!0,Et(X,null),qe(X,{label:"Thinking",details:be(p.value,g.value)}),nt(X,null),mt(X,!0);try{await Kr(X,ye,h,v,Z)}catch(ke){ne=!1,mt(X,!1),qe(X,null);const rt=ke instanceof Error?ke.message:"Unknown application error";throw nt(X,rt),me.value=rt,ke}}async function _i(c,h,v=[],C=[],Z=[]){const X=c.trim(),ye=h.trim(),xe=p.value.trim();if(!X&&v.length===0&&Z.length===0)return"";Me.value=!0,me.value="";let ke="";try{try{ke=await Xc(ye||void 0,xe||void 0)}catch(Ln){if(xe&&xe!==un&&So(Ln))await q(),ke=await Xc(ye||void 0,un);else throw Ln}if(!ke)return"";vt(ke,ye,X||"[Image]"),D.value={...D.value,[ke]:!0},x(ke),ne=!0,Et(ke,null),qe(ke,{label:"Thinking",details:be(p.value,g.value)}),nt(ke,null),mt(ke,!0);const rt=ke,St=ye||null,Yr=X;return Kr(ke,X,v,C,Z).catch(Ln=>{ne=!1,mt(ke,!1),qe(ke,null);const lr=Ln instanceof Error?Ln.message:"Unknown application error";nt(ke,lr),me.value=lr}).finally(()=>{Me.value=!1}),qr(rt,Yr,St),ke}catch(rt){ne=!1,ke&&(mt(ke,!1),qe(ke,null));const St=rt instanceof Error?rt.message:"Unknown application error";throw ke&&nt(ke,St),me.value=St,Me.value=!1,rt}}async function Kr(c,h,v=[],C=[],Z=[]){const X=p.value.trim(),ye=g.value,xe=h.trim(),ke=C.map(St=>({name:St.name,path:St.path})),rt=Z.map(St=>({...St}));K(c,{text:xe,imageUrls:[...v],skills:ke,fileAttachments:rt,effort:ye,fallbackRetried:!1});try{D.value[c]!==!0&&await Ji(c);try{await Yi(c,h,v,X||void 0,ye||void 0,C.length>0?C:void 0,Z)}catch(St){if(X&&X!==un&&So(St))await q(),K(c,{text:xe,imageUrls:[...v],skills:ke,fileAttachments:rt,effort:ye,fallbackRetried:!0}),await Yi(c,h,v,un,ye||void 0,C.length>0?C:void 0,Z);else throw St}D.value={...D.value,[c]:!0},ze.add(c),je=!0,await Dn()}catch(St){throw St}}async function mo(c){const h=l.value[c];if(!h||h.length===0)return;const[v,...C]=h;l.value=C.length>0?{...l.value,[c]:C}:Lt(l.value,c),Me.value=!0,me.value="",ne=!0,Et(c,null),qe(c,{label:"Thinking",details:be(p.value,g.value)}),nt(c,null),mt(c,!0);try{await Kr(c,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{mt(c,!1),qe(c,null)}finally{Me.value=!1}}async function ki(){const c=n.value;if(!c||a.value[c]!==!0)return;const h=pe.value[c];Re.value=!0,me.value="";try{await S_(c,h),mt(c,!1),qe(c,null),nt(c,null),pe.value[c]&&(pe.value=Lt(pe.value,c)),ze.add(c),je=!0,await Dn()}catch(v){const C=v instanceof Error?v.message:"Failed to interrupt active turn";nt(c,C),me.value=C}finally{Re.value=!1}}async function Ti(c){const h=n.value;if(!h||Oe.value)return;const C=(r.value[h]??[]).reduce((X,ye)=>typeof ye.turnIndex=="number"&&ye.turnIndex>X?ye.turnIndex:X,-1);if(C<0||c>C)return;const Z=C-c+1;if(!(Z<1)){Oe.value=!0,me.value="";try{const X=await Yc(h,Z);Kt(h,X),At(h,[]),Dt(h),i.value[h]&&(i.value=Lt(i.value,h)),Et(h,null),qe(h,null),nt(h,null),je=!0,await Dn()}catch(X){me.value=X instanceof Error?X.message:"Failed to rollback thread"}finally{Oe.value=!1}}}function Si(c,h){c.length===0||(B.value[c]??"")===h||(B.value={...B.value,[c]:h},aa(B.value))}function Ii(c){var Z;if(c.length===0)return;const h=R.value.filter(X=>X!==c);if(Dr(R.value,h)||(R.value=h,Qr(R.value)),t.value=t.value.filter(X=>X.projectName!==c),B.value[c]!==void 0){const X={...B.value};delete X[c],B.value=X,aa(X)}Je();const v=gr(e.value);it(v),v.some(X=>X.id===n.value)||x(((Z=v[0])==null?void 0:Z.id)??""),Es()}function Is(c,h){if(c.length===0||t.value.length===0)return;const v=t.value.map(ke=>ke.projectName),C=v.indexOf(c);if(C===-1)return;const Z=Math.max(0,Math.min(h,v.length-1)),X=nC(v,C,Z);if(X===v)return;const ye=To(X,t.value);R.value=ye,Qr(R.value);const xe=la(t.value,R.value);t.value=Io(t.value,xe),Je(),Es()}function Jr(c){const h=c.trim();if(!h)return;const v=[h,...R.value.filter(Z=>Z!==h)];if(Dr(R.value,v))return;R.value=v,Qr(R.value);const C=la(t.value,R.value);t.value=Io(t.value,C),Je(),Es()}async function Es(){var c,h;try{const v=await Pa(),C=new Map;for(const ye of v.order){const xe=ca(ye);C.has(xe)||C.set(xe,ye)}for(const ye of t.value){const xe=((h=(c=ye.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";xe&&C.set(ye.projectName,xe)}const Z=[];for(const ye of R.value){const xe=C.get(ye);xe&&!Z.includes(xe)&&Z.push(xe)}for(const ye of v.order)Z.includes(ye)||Z.push(ye);const X=v.active.filter(ye=>Z.includes(ye));X.length===0&&Z.length>0&&X.push(Z[0]),await x_({order:Z,labels:v.labels,active:X})}catch{}}async function Dn(){if(at.value){typeof window<"u"&&We===null&&(We=window.setTimeout(()=>{We=null,Dn()},oa));return}at.value=!0;const c=je,h=new Set(ze);je=!1,ze.clear();try{c&&await ar();const v=n.value;if(!v)return;const C=h.has(v),Z=a.value[v]===!0,X=Bt(v),ye=N.value[v]??"",xe=X.length>0&&X!==ye;(C||Z||xe||c)&&await Jt(v,{silent:!0})}catch{}finally{at.value=!1,(je||ze.size>0)&&typeof window<"u"&&We===null&&(We=window.setTimeout(()=>{We=null,Dn()},oa))}}function Ei(){typeof window>"u"||Xe||(Ci(),Xe=v_(c=>{Q(c),Fe(c)}))}async function Ci(){try{const c=await w_();for(const h of c){const v=ee(h);v&&_e(v)}}catch{}}async function go(c){try{await y_(c.id,{result:c.result,error:c.error}),de(c.id)}catch(h){me.value=h instanceof Error?h.message:"Failed to reply to server request"}}function Ai(){Xe&&(Xe(),Xe=null),je=!1,ze.clear(),le.clear(),We!==null&&typeof window<"u"&&(window.clearTimeout(We),We=null),Qe!==null&&typeof window<"u"&&(window.clearTimeout(Qe),Qe=null),ne=!1,r.value={},s.value={},o.value={},i.value={},oe.value={},H.value={},ae.value={},pe.value={},l.value={}}const E=ue(()=>{const c=n.value;return c?l.value[c]??[]:[]});function z(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const C=v.filter(Z=>Z.id!==c);l.value=C.length>0?{...l.value,[h]:C}:Lt(l.value,h)}function he(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const C=v.find(Z=>Z.id===c);C&&(z(c),po(C.text,C.imageUrls,C.skills,"steer",C.fileAttachments))}return{projectGroups:e,projectDisplayNameById:B,selectedThread:w,selectedThreadScrollState:k,selectedThreadServerRequests:M,selectedLiveOverlay:W,selectedThreadId:n,availableModelIds:u,selectedModelId:p,selectedReasoningEffort:g,installedSkills:ie,accountRateLimitSnapshots:Y,messages:F,isLoadingThreads:Ae,isLoadingMessages:Se,isSendingMessage:Me,isInterruptingTurn:Re,error:me,refreshAll:Gr,refreshSkills:$n,selectThread:Er,setThreadScrollState:Pt,archiveThreadById:wi,renameThreadById:bi,sendMessageToSelectedThread:po,sendMessageToNewThread:_i,interruptSelectedThreadTurn:ki,rollbackSelectedThread:Ti,isRollingBack:Oe,selectedThreadQueuedMessages:E,removeQueuedMessage:z,steerQueuedMessage:he,setSelectedModelId:U,setSelectedReasoningEffort:fe,respondToPendingServerRequest:go,renameProject:Si,removeProject:Ii,reorderProject:Is,pinProjectToTop:Jr,startPolling:Ei,stopPolling:Ai}}const wC={class:"sidebar-root"},bC={class:"sidebar-scrollable"},_C=["aria-pressed"],kC={key:1,class:"sidebar-search-bar"},TC={key:0,class:"sidebar-settings-area"},SC={key:0,class:"sidebar-settings-panel"},IC={class:"sidebar-settings-value"},EC={class:"sidebar-settings-value"},CC={class:"sidebar-settings-row sidebar-settings-row--select"},AC={class:"sidebar-settings-rate-limits"},RC={class:"content-root"},PC={class:"content-body"},xC={key:1,class:"content-grid"},MC={class:"new-thread-empty"},OC={class:"worktree-init-status-title"},NC={class:"worktree-init-status-message"},$C={key:2,class:"content-grid"},DC={class:"content-thread"},LC={class:"composer-with-queue"},jC={class:"build-badge","aria-label":"Worktree name and version"},Lu="codex-web-local.sidebar-collapsed.v1",ju="codex-web-local.send-with-enter.v1",Bu="codex-web-local.in-progress-send-mode.v1",Uu="codex-web-local.dark-mode.v1",Fu="codex-web-local.dictation-click-to-toggle.v1",Hu="codex-web-local.dictation-auto-send.v1",Vu="codex-web-local.dictation-language.v1",BC=$t({__name:"App",setup(e){const t="codex-web-local",n="0.1.47",r={en:"english",zh:"chinese",de:"german",es:"spanish",ru:"russian",ko:"korean",fr:"french",ja:"japanese",pt:"portuguese",tr:"turkish",pl:"polish",ca:"catalan",nl:"dutch",ar:"arabic",sv:"swedish",it:"italian",id:"indonesian",hi:"hindi",fi:"finnish",vi:"vietnamese",he:"hebrew",uk:"ukrainian",el:"greek",ms:"malay",cs:"czech",ro:"romanian",da:"danish",hu:"hungarian",ta:"tamil",no:"norwegian",th:"thai",ur:"urdu",hr:"croatian",bg:"bulgarian",lt:"lithuanian",la:"latin",mi:"maori",ml:"malayalam",cy:"welsh",sk:"slovak",te:"telugu",fa:"persian",lv:"latvian",bn:"bengali",sr:"serbian",az:"azerbaijani",sl:"slovenian",kn:"kannada",et:"estonian",mk:"macedonian",br:"breton",eu:"basque",is:"icelandic",hy:"armenian",ne:"nepali",mn:"mongolian",bs:"bosnian",kk:"kazakh",sq:"albanian",sw:"swahili",gl:"galician",mr:"marathi",pa:"punjabi",si:"sinhala",km:"khmer",sn:"shona",yo:"yoruba",so:"somali",af:"afrikaans",oc:"occitan",ka:"georgian",be:"belarusian",tg:"tajik",sd:"sindhi",gu:"gujarati",am:"amharic",yi:"yiddish",lo:"lao",uz:"uzbek",fo:"faroese",ht:"haitian creole",ps:"pashto",tk:"turkmen",nn:"nynorsk",mt:"maltese",sa:"sanskrit",lb:"luxembourgish",my:"myanmar",bo:"tibetan",tl:"tagalog",mg:"malagasy",as:"assamese",tt:"tatar",haw:"hawaiian",ln:"lingala",ha:"hausa",ba:"bashkir",jw:"javanese",su:"sundanese",yue:"cantonese"},{projectGroups:s,projectDisplayNameById:o,selectedThread:i,selectedThreadScrollState:a,selectedThreadServerRequests:l,selectedLiveOverlay:d,selectedThreadId:u,availableModelIds:p,selectedModelId:g,selectedReasoningEffort:T,installedSkills:j,accountRateLimitSnapshots:R,messages:B,isLoadingThreads:N,isLoadingMessages:P,isInterruptingTurn:D,refreshAll:H,refreshSkills:oe,selectThread:ae,setThreadScrollState:pe,archiveThreadById:Te,renameThreadById:ce,sendMessageToSelectedThread:te,sendMessageToNewThread:ie,interruptSelectedThreadTurn:Y,rollbackSelectedThread:Ae,isRollingBack:Se,selectedThreadQueuedMessages:Me,removeQueuedMessage:Re,steerQueuedMessage:Oe,setSelectedModelId:me,setSelectedReasoningEffort:at,respondToPendingServerRequest:Ye,renameProject:Xe,removeProject:We,reorderProject:Qe,pinProjectToTop:tt,startPolling:je,stopPolling:ze}=yC(),V=ev(),ne=Zg(),{isMobile:le}=wf(),we=L(!1),$e=L(!1),w=L(""),k=L("local"),M=L({order:[],labels:{}}),W=L({phase:"idle",title:"",message:""}),F=L(Es()),x=L(""),U=L(!1),q=L(null),K=L(null);let G=null;const ge=L("New Project (1)"),fe=L(""),be=L(!1),Ee=L(Er(ju,!0)),Ne=L(bi()),Ve=L(wi()),Ue=L(Er(Fu,!1)),Je=L(null);let vt=0;const it=L(Er(Hu,!0)),kt=L(Si()),Et=ue(()=>Ii()),mt=ue(()=>{const E=V.params.threadId;return typeof E=="string"?E:""}),yt=ue(()=>{const E=new Set;for(const z of s.value)for(const he of z.threads)E.add(he.id);return E}),qe=ue(()=>V.name==="home"),nt=ue(()=>V.name==="skills"),Bt=ue(()=>{var E;return nt.value?"Skills":qe.value?"New thread":((E=i.value)==null?void 0:E.title)??"Choose a thread"}),Pt=ue(()=>B.value.filter(E=>{const z=Ei(E.messageType,E.role);return z==="worked"?!0:!(z==="turnActivity.live"||z==="turnError.live"||z==="agentReasoning.live")})),Kt=ue(()=>{let E=-1;for(const z of B.value)z.role==="user"&&typeof z.turnIndex=="number"&&z.turnIndex>E&&(E=z.turnIndex);return E}),At=ue(()=>d.value),on=ue(()=>qe.value?"__new-thread__":u.value),Ut=ue(()=>{var E,z;return qe.value?w.value.trim():((z=(E=i.value)==null?void 0:E.cwd)==null?void 0:z.trim())??""}),nn=ue(()=>{var E;return!qe.value&&((E=i.value)==null?void 0:E.inProgress)===!0}),Dt=ue(()=>{var c,h;const E=[],z=new Set;for(const v of M.value.order){const C=v.trim();!C||z.has(C)||(z.add(C),E.push({value:C,label:M.value.labels[C]||$(C)}))}for(const v of s.value){const C=((h=(c=v.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";!C||z.has(C)||(z.add(C),E.push({value:C,label:o.value[v.projectName]??v.projectName}))}const he=w.value.trim();return he&&!z.has(he)&&E.unshift({value:he,label:$(he)}),E}),Ce=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;nr(()=>{window.addEventListener("keydown",Nn),Jr(),Ce==null||Ce.addEventListener("change",Jr),Ci(),sr(),Ss(),A(),or()}),li(()=>{window.removeEventListener("keydown",Nn),Ce==null||Ce.removeEventListener("change",Jr),G&&(clearTimeout(G),G=null),ze()}),ht(x,E=>{const z=E.trim();if(G&&(clearTimeout(G),G=null),!z){K.value=null;return}G=setTimeout(()=>{N_(z,1e3).then(he=>{x.value.trim()===z&&(K.value=he.threadIds)}).catch(()=>{x.value.trim()===z&&(K.value=null)})},220)});function Pe(){oe()}function rn(){U.value=!U.value,U.value?qt(()=>{var E;return(E=q.value)==null?void 0:E.focus()}):x.value=""}function hn(){var E;x.value="",(E=q.value)==null||E.focus()}function pn(E){E.key==="Escape"&&(U.value=!1,x.value="")}function _(E){E&&(V.name==="thread"&&mt.value===E||(ne.push({name:"thread",params:{threadId:E}}),le.value&&Mt(!0)))}async function f(E){E&&(u.value!==E&&(await ae(E),await ne.push({name:"thread",params:{threadId:E}})),await qt(),ar())}function m(E){Te(E)}function S(E){var c,h;const z=s.value.find(v=>v.projectName===E),he=((h=(c=z==null?void 0:z.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";he&&(w.value=he),le.value&&Mt(!0),!qe.value&&ne.push({name:"home"})}function J(E){var c,h;const z=s.value.find(v=>v.projectName===E),he=((h=(c=z==null?void 0:z.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";!he||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(he)}`,"_blank","noopener,noreferrer")}function ee(){var z,he;const E=((he=(z=i.value)==null?void 0:z.cwd)==null?void 0:he.trim())??"";E&&(w.value=E),le.value&&Mt(!0),!qe.value&&ne.push({name:"home"})}function _e(E){Xe(E.projectName,E.displayName)}function de(E){ce(E.threadId,E.title)}function De(E){We(E)}function Ze(E){Qe(E.projectName,E.toIndex)}function ct(E){pe(E.threadId,E.state)}function xt(E){Ye(E)}function Mt(E){F.value!==E&&(F.value=E,Dn(E))}function Nn(E){E.defaultPrevented||!E.ctrlKey&&!E.metaKey||E.shiftKey||E.altKey||E.key.toLowerCase()==="b"&&(E.preventDefault(),Mt(!F.value))}function Wr(E){const z=E.text;if(qe.value){Ai(z,E.imageUrls,E.skills,E.fileAttachments);return}if(E.rollbackLatestUserTurn===!0){bs(E);return}te(z,E.imageUrls,E.skills,E.mode,E.fileAttachments)}async function bs(E){nn.value&&await Y();const z=Kt.value;z>=0&&await Ae(z),await te(E.text,E.imageUrls,E.skills,"steer",E.fileAttachments)}function zr(E){w.value=E.trim()}async function _s(E){const z=E.trim();if(!z)return;const he=Ts(z),c=await ks(),h=he?z:Q(c,z);if(h)try{const v=await Zc(h,{createIfMissing:!he,label:he?"":z});v&&(w.value=v,tt($(v)),A(),or())}catch{}}async function sr(){var z;if(typeof window>"u")return;const E=((z=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:z.trim())??"";if(E)try{const he=await Zc(E,{createIfMissing:!1,label:""});if(!he)return;w.value=he,tt($(he)),await ne.replace({name:"home"}),await A();const c=new URL(window.location.href);c.searchParams.delete("openProjectPath"),window.history.replaceState({},"",c.toString())}catch{}}async function ks(){const E=ir();if(E)return E;try{const z=await Qc();if(z)return fe.value=z,z}catch{}return""}function Ts(E){return E?E.startsWith("~/")||E.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(E):!1}async function or(){const E=ir();if(!E){ge.value="New Project (1)";return}try{const z=await M_(E);ge.value=z.name||"New Project (1)"}catch{ge.value="New Project (1)"}}function ir(){var he,c;const E=w.value.trim();if(E)return O(E);const z=((c=(he=Dt.value[0])==null?void 0:he.value)==null?void 0:c.trim())??"";return z?O(z):fe.value.trim()}async function Ss(){try{fe.value=await Qc()}catch{fe.value=""}}async function A(){try{const E=await Pa();M.value={order:[...E.order],labels:{...E.labels}}}catch{M.value={order:[],labels:{}}}}function O(E){const z=E.trim().replace(/\/+$/,"");if(!z)return"";const he=z.lastIndexOf("/");return he<=0?"":z.slice(0,he)}function $(E){const z=E.trim().replace(/\/+$/,"");if(!z)return"";const he=z.lastIndexOf("/");return he<0?z:z.slice(he+1)}function Q(E,z){const he=E.trim().replace(/\/+$/,""),c=z.trim().replace(/^\/+/,"");return!he||!c?"":`${he}/${c}`}function Fe(E){me(E)}function Rt(E){at(E)}function an(){Y()}function qr(E){var he;const z=((he=E.prependText)==null?void 0:he.trim())??"";z.length>0&&(vt+=1,Je.value={id:vt,text:z}),Ae(E.turnIndex)}function ar(){if(qe.value||nt.value||typeof document>"u"||!i.value||Pt.value.length===0)return;const E=Jt(),z=$n(),he=new Blob([E],{type:"text/markdown;charset=utf-8"}),c=URL.createObjectURL(he),h=document.createElement("a");h.href=c,h.download=z,document.body.appendChild(h),h.click(),document.body.removeChild(h),window.setTimeout(()=>URL.revokeObjectURL(c),0)}function Jt(){var he,c,h;const E=[],z=((c=(he=i.value)==null?void 0:he.title)==null?void 0:c.trim())||"Untitled thread";E.push(`# ${Gr(z)}`),E.push(""),E.push(`- Exported: ${new Date().toISOString()}`),E.push(`- Thread ID: ${((h=i.value)==null?void 0:h.id)??""}`),E.push(""),E.push("---"),E.push("");for(const v of Pt.value){const C=v.role?v.role.toUpperCase():"MESSAGE";E.push(`## ${C}`),E.push("");const Z=v.text.trim();if(Z&&(E.push(Z),E.push("")),v.commandExecution&&(E.push("```text"),E.push(`command: ${v.commandExecution.command}`),E.push(`status: ${v.commandExecution.status}`),v.commandExecution.cwd&&E.push(`cwd: ${v.commandExecution.cwd}`),v.commandExecution.exitCode!==null&&E.push(`exitCode: ${v.commandExecution.exitCode}`),E.push(v.commandExecution.aggregatedOutput||"(no output)"),E.push("```"),E.push("")),v.fileAttachments&&v.fileAttachments.length>0){E.push("Attachments:");for(const X of v.fileAttachments)E.push(`- ${X.path}`);E.push("")}if(v.images&&v.images.length>0){E.push("Images:");for(const X of v.images)E.push(`- ${X}`);E.push("")}}return`${E.join(`
1441
+ `).trimEnd()}
1442
+ `}function $n(){var h,v;const he=(((v=(h=i.value)==null?void 0:h.title)==null?void 0:v.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",c=new Date().toISOString().replace(/[:.]/g,"-");return`${he}-${c}.md`}function Gr(E){return E.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function Er(E,z){if(typeof window>"u")return z;const he=window.localStorage.getItem(E);return he===null?z:he==="1"}function wi(){if(typeof window>"u")return"system";const E=window.localStorage.getItem(Uu);return E==="light"||E==="dark"?E:"system"}function bi(){return typeof window>"u"?"steer":window.localStorage.getItem(Bu)==="queue"?"queue":"steer"}function po(){Ee.value=!Ee.value,window.localStorage.setItem(ju,Ee.value?"1":"0")}function _i(){Ne.value=Ne.value==="steer"?"queue":"steer",window.localStorage.setItem(Bu,Ne.value)}function Kr(){const E=["system","light","dark"],z=E.indexOf(Ve.value);Ve.value=E[(z+1)%E.length],window.localStorage.setItem(Uu,Ve.value),Jr()}function mo(){Ue.value=!Ue.value,window.localStorage.setItem(Fu,Ue.value?"1":"0")}function ki(){it.value=!it.value,window.localStorage.setItem(Hu,it.value?"1":"0")}function Ti(E){const he=Is(E.trim())||"auto";kt.value=he,window.localStorage.setItem(Vu,he)}function Si(){var he;if(typeof window>"u")return"auto";const E=((he=window.localStorage.getItem(Vu))==null?void 0:he.trim())||"auto";return Is(E)||"auto"}function Ii(){const E=[{value:"auto",label:"Auto-detect"}],z=new Set(["auto"]);function he(h){const v=r[h]||h;return`${v.charAt(0).toUpperCase()+v.slice(1)} (${h})`}for(const h of typeof navigator<"u"?navigator.languages??[]:[]){const v=Is(h);!v||z.has(v)||(z.add(v),E.push({value:v,label:`Preferred: ${he(v)}`}))}for(const h of Object.keys(r))z.has(h)||(z.add(h),E.push({value:h,label:he(h)}));const c=kt.value.trim();return c&&!z.has(c)&&E.push({value:c,label:he(c)}),E}function Is(E){const z=E.trim().toLowerCase();if(!z||z==="auto")return"";if(z in r)return z;const he=z.split("-")[0]??z;return he in r?he:""}function Jr(){const E=document.documentElement;if(Ve.value==="dark")E.classList.add("dark");else if(Ve.value==="light")E.classList.remove("dark");else{const z=window.matchMedia("(prefers-color-scheme: dark)").matches;E.classList.toggle("dark",z)}}function Es(){return typeof window>"u"?!1:window.localStorage.getItem(Lu)==="1"}function Dn(E){typeof window>"u"||window.localStorage.setItem(Lu,E?"1":"0")}function Ei(E,z){const he=(E??"").trim();return he.length>0?he:z.trim()||"message"}async function Ci(){await H(),$e.value=!0,await go(),je()}async function go(){if(!we.value){we.value=!0;try{if(V.name==="home"||V.name==="skills"){u.value!==""&&await ae("");return}if(V.name==="thread"){const E=mt.value;if(!E)return;if(!yt.value.has(E)){await ne.replace({name:"home"});return}u.value!==E&&await ae(E);return}}finally{we.value=!1}}}ht(()=>[V.name,mt.value,N.value,yt.value.has(mt.value),u.value],async()=>{$e.value&&await go()}),ht(()=>u.value,async E=>{if($e.value&&!we.value&&!(qe.value||nt.value)){if(!E){V.name!=="home"&&await ne.replace({name:"home"});return}V.name==="thread"&&mt.value===E||await ne.replace({name:"thread",params:{threadId:E}})}}),ht(()=>Dt.value,E=>{if(E.length===0){w.value="";return}E.some(he=>he.value===w.value)||(w.value=E[0].value),or()},{immediate:!0}),ht(()=>w.value,()=>{W.value={phase:"idle",title:"",message:""},or()}),ht(()=>k.value,E=>{E==="local"&&(W.value={phase:"idle",title:"",message:""})}),ht(()=>V.name,E=>{E!=="home"&&(W.value={phase:"idle",title:"",message:""})}),ht(()=>u.value,()=>{W.value={phase:"idle",title:"",message:""}}),ht(le,E=>{E&&!F.value&&Mt(!0)});async function Ai(E,z=[],he=[],c=[]){try{W.value={phase:"idle",title:"",message:""};let h=w.value;if(k.value==="worktree"){W.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const C=await P_(w.value);h=C.cwd,w.value=C.cwd,W.value={phase:"idle",title:"",message:""}}catch{W.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const v=await ie(E,h,z,he,c);if(!v)return;await ne.replace({name:"thread",params:{threadId:v}})}catch{}}return(E,z)=>(b(),I(Le,null,[Ie(iv,{"is-sidebar-collapsed":F.value,onCloseSidebar:z[6]||(z[6]=he=>Mt(!0))},{sidebar:gt(()=>[y("section",wC,[y("div",bC,[F.value?re("",!0):(b(),ft(Mu,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":F.value,"show-new-thread-button":!0,onToggleSidebar:z[0]||(z[0]=he=>Mt(!F.value)),onStartNewThread:ee},{default:gt(()=>[y("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":U.value,"aria-label":"Search threads",title:"Search threads",onClick:rn},[Ie(xa,{class:"sidebar-search-toggle-icon"})],8,_C)]),_:1},8,["is-sidebar-collapsed"])),!F.value&&U.value?(b(),I("div",kC,[Ie(xa,{class:"sidebar-search-bar-icon"}),Xn(y("input",{ref_key:"sidebarSearchInputRef",ref:q,"onUpdate:modelValue":z[1]||(z[1]=he=>x.value=he),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:pn},null,544),[[Qn,x.value]]),x.value.length>0?(b(),I("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:hn},[Ie(pl,{class:"sidebar-search-clear-icon"})])):re("",!0)])):re("",!0),F.value?re("",!0):(b(),I("button",{key:2,class:ot(["sidebar-skills-link",{"is-active":nt.value}]),type:"button",onClick:z[2]||(z[2]=he=>{ve(ne).push({name:"skills"}),ve(le)&&Mt(!0)})}," Skills Hub ",2)),F.value?re("",!0):(b(),ft(Jy,{key:3,groups:ve(s),"project-display-name-by-id":ve(o),"selected-thread-id":ve(u),"is-loading":ve(N),"search-query":x.value,"search-matched-thread-ids":K.value,onSelect:_,onArchive:m,onStartNewThread:S,onRenameProject:_e,onBrowseProjectFiles:J,onRenameThread:de,onRemoveProject:De,onReorderProject:Ze,onExportThread:f},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),F.value?re("",!0):(b(),I("div",TC,[Ie(of,{name:"settings-panel"},{default:gt(()=>[be.value?(b(),I("div",SC,[y("button",{class:"sidebar-settings-row",type:"button",onClick:po},[z[7]||(z[7]=y("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),y("span",{class:ot(["sidebar-settings-toggle",{"is-on":!Ee.value}])},null,2)]),y("button",{class:"sidebar-settings-row",type:"button",onClick:_i},[z[8]||(z[8]=y("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),y("span",IC,se(Ne.value==="steer"?"Steer":"Queue"),1)]),y("button",{class:"sidebar-settings-row",type:"button",onClick:Kr},[z[9]||(z[9]=y("span",{class:"sidebar-settings-label"},"Appearance",-1)),y("span",EC,se(Ve.value==="system"?"System":Ve.value==="dark"?"Dark":"Light"),1)]),y("button",{class:"sidebar-settings-row",type:"button",onClick:mo},[z[10]||(z[10]=y("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),y("span",{class:ot(["sidebar-settings-toggle",{"is-on":Ue.value}])},null,2)]),y("button",{class:"sidebar-settings-row",type:"button",onClick:ki},[z[11]||(z[11]=y("span",{class:"sidebar-settings-label"},"Auto send dictation",-1)),y("span",{class:ot(["sidebar-settings-toggle",{"is-on":it.value}])},null,2)]),y("div",CC,[z[12]||(z[12]=y("span",{class:"sidebar-settings-label"},"Dictation language",-1)),Ie(zo,{class:"sidebar-settings-language-dropdown","model-value":kt.value,options:Et.value,placeholder:"Auto-detect","open-direction":"up","enable-search":!0,"search-placeholder":"Search language...","onUpdate:modelValue":Ti},null,8,["model-value","options"])]),y("div",AC,[Ie(E0,{snapshots:ve(R)},null,8,["snapshots"])])])):re("",!0)]),_:1}),y("button",{class:"sidebar-settings-button",type:"button",onClick:z[3]||(z[3]=he=>be.value=!be.value)},[Ie(qE,{class:"sidebar-settings-icon"}),z[13]||(z[13]=y("span",null,"Settings",-1))])]))])]),content:gt(()=>[y("section",RC,[Ie(tw,{title:Bt.value},{leading:gt(()=>[F.value||ve(le)?(b(),ft(Mu,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":F.value,"show-new-thread-button":!0,onToggleSidebar:z[4]||(z[4]=he=>Mt(!F.value)),onStartNewThread:ee},null,8,["is-sidebar-collapsed"])):re("",!0)]),_:1},8,["title"]),y("section",PC,[nt.value?(b(),ft(xE,{key:0,onSkillsChanged:Pe})):qe.value?(b(),I("div",xC,[y("div",MC,[z[14]||(z[14]=y("p",{class:"new-thread-hero"},"Let's build",-1)),Ie(zo,{class:"new-thread-folder-dropdown","model-value":w.value,options:Dt.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":ge.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":zr,onAdd:_s},null,8,["model-value","options","default-add-value"]),Ie(N0,{class:"new-thread-runtime-dropdown",modelValue:k.value,"onUpdate:modelValue":z[5]||(z[5]=he=>k.value=he)},null,8,["modelValue"]),W.value.phase!=="idle"?(b(),I("div",{key:0,class:ot(["worktree-init-status",{"is-running":W.value.phase==="running","is-error":W.value.phase==="error"}])},[y("strong",OC,se(W.value.title),1),y("span",NC,se(W.value.message),1)],2)):re("",!0)]),Ie(nu,{"active-thread-id":on.value,cwd:Ut.value,models:ve(p),"selected-model":ve(g),"selected-reasoning-effort":ve(T),skills:ve(j),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":Ee.value,"in-progress-submit-mode":Ne.value,"dictation-click-to-toggle":Ue.value,"dictation-auto-send":it.value,"prepend-draft-request":Je.value,"dictation-language":kt.value,onSubmit:Wr,"onUpdate:selectedModel":Fe,"onUpdate:selectedReasoningEffort":Rt},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","prepend-draft-request","dictation-language"])])):(b(),I("div",$C,[y("div",DC,[Ie(Vb,{messages:Pt.value,"is-loading":ve(P),"active-thread-id":on.value,cwd:Ut.value,"scroll-state":ve(a),"live-overlay":At.value,"pending-requests":ve(l),"is-turn-in-progress":nn.value,"is-rolling-back":ve(Se),onUpdateScrollState:ct,onRespondServerRequest:xt,onRollback:qr},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),y("div",LC,[Ie(v0,{messages:ve(Me),onSteer:ve(Oe),onDelete:ve(Re)},null,8,["messages","onSteer","onDelete"]),Ie(nu,{"active-thread-id":on.value,cwd:Ut.value,models:ve(p),"selected-model":ve(g),"selected-reasoning-effort":ve(T),skills:ve(j),"is-turn-in-progress":nn.value,"is-interrupting-turn":ve(D),"has-queue-above":ve(Me).length>0,"send-with-enter":Ee.value,"in-progress-submit-mode":Ne.value,"dictation-click-to-toggle":Ue.value,"dictation-auto-send":it.value,"prepend-draft-request":Je.value,"dictation-language":kt.value,onSubmit:Wr,"onUpdate:selectedModel":Fe,"onUpdate:selectedReasoningEffort":Rt,onInterrupt:an},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","prepend-draft-request","dictation-language"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),y("div",jC," WT "+se(ve(t))+" · v"+se(ve(n)),1)],64))}}),UC=et(BC,[["__scopeId","data-v-5588f6ac"]]),ua={render:()=>null},FC=Qg({history:Pg(),routes:[{path:"/",name:"home",component:ua},{path:"/thread/:threadId",name:"thread",component:ua},{path:"/skills",name:"skills",component:ua},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Vm(UC).use(FC).mount("#app");