@nervmor/codexui 1.0.1 → 1.0.3
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.
- package/README.md +9 -6
- package/dist/assets/index-BRHjQaZ8.css +1 -0
- package/dist/assets/index-C2tfimEi.js +1441 -0
- package/dist/index.html +2 -2
- package/dist-cli/index.js +904 -237
- package/dist-cli/index.js.map +1 -1
- package/package.json +1 -2
- package/dist/assets/index-BUh0F7vz.js +0 -1440
- package/dist/assets/index-IKfGXpjw.css +0 -1
|
@@ -1,1440 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();/**
|
|
2
|
-
* @vue/shared v3.5.30
|
|
3
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
-
* @license MIT
|
|
5
|
-
**/function rl(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const xt={},Ss=[],dr=()=>{},sd=()=>!1,yi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),sl=e=>e.startsWith("onUpdate:"),Kt=Object.assign,ol=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Bh=Object.prototype.hasOwnProperty,St=(e,t)=>Bh.call(e,t),Ge=Array.isArray,Is=e=>Co(e)==="[object Map]",od=e=>Co(e)==="[object Set]",Kl=e=>Co(e)==="[object Date]",Ze=e=>typeof e=="function",Bt=e=>typeof e=="string",Kn=e=>typeof e=="symbol",It=e=>e!==null&&typeof e=="object",id=e=>(It(e)||Ze(e))&&Ze(e.then)&&Ze(e.catch),ad=Object.prototype.toString,Co=e=>ad.call(e),Fh=e=>Co(e).slice(8,-1),ld=e=>Co(e)==="[object Object]",il=e=>Bt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,eo=rl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),wi=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Uh=/-\w/g,wn=wi(e=>e.replace(Uh,t=>t.slice(1).toUpperCase())),Hh=/\B([A-Z])/g,Qr=wi(e=>e.replace(Hh,"-$1").toLowerCase()),bi=wi(e=>e.charAt(0).toUpperCase()+e.slice(1)),Vi=wi(e=>e?`on${bi(e)}`:""),ar=(e,t)=>!Object.is(e,t),Go=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},cd=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},al=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Vh=e=>{const t=Bt(e)?Number(e):NaN;return isNaN(t)?e:t};let Jl;const _i=()=>Jl||(Jl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function qr(e){if(Ge(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=Bt(r)?qh(r):qr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(Bt(e)||It(e))return e}const Wh=/;(?![^(]*\))/g,zh=/:([^]+)/,Gh=/\/\*[^]*?\*\//g;function qh(e){const t={};return e.replace(Gh,"").split(Wh).forEach(n=>{if(n){const r=n.split(zh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ft(e){let t="";if(Bt(e))t=e;else if(Ge(e))for(let n=0;n<e.length;n++){const r=ft(e[n]);r&&(t+=r+" ")}else if(It(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Kh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Jh=rl(Kh);function ud(e){return!!e||e===""}function Yh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=ll(e[r],t[r]);return n}function ll(e,t){if(e===t)return!0;let n=Kl(e),r=Kl(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=Kn(e),r=Kn(t),n||r)return e===t;if(n=Ge(e),r=Ge(t),n||r)return n&&r?Yh(e,t):!1;if(n=It(e),r=It(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||!ll(e[i],t[i]))return!1}}return String(e)===String(t)}const dd=e=>!!(e&&e.__v_isRef===!0),W=e=>Bt(e)?e:e==null?"":Ge(e)||It(e)&&(e.toString===ad||!Ze(e.toString))?dd(e)?W(e.value):JSON.stringify(e,fd,2):String(e),fd=(e,t)=>dd(t)?fd(e,t.value):Is(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[Wi(r,o)+" =>"]=s,n),{})}:od(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Wi(n))}:Kn(t)?Wi(t):It(t)&&!Ge(t)&&!ld(t)?String(t):t,Wi=(e,t="")=>{var n;return Kn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
6
|
-
* @vue/reactivity v3.5.30
|
|
7
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
-
* @license MIT
|
|
9
|
-
**/let Sn;class Qh{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 Xh(){return Sn}let Rt;const zi=new WeakSet;class hd{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,zi.has(this)&&(zi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||md(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Yl(this),gd(this);const t=Rt,n=zn;Rt=this,zn=!0;try{return this.fn()}finally{vd(this),Rt=t,zn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)dl(t);this.deps=this.depsTail=void 0,Yl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?zi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ea(this)&&this.run()}get dirty(){return Ea(this)}}let pd=0,to,no;function md(e,t=!1){if(e.flags|=8,t){e.next=no,no=e;return}e.next=to,to=e}function cl(){pd++}function ul(){if(--pd>0)return;if(no){let t=no;for(no=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;to;){let t=to;for(to=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 gd(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function vd(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),dl(r),Zh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Ea(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(yd(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function yd(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===fo)||(e.globalVersion=fo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ea(e))))return;e.flags|=2;const t=e.dep,n=Rt,r=zn;Rt=e,zn=!0;try{gd(e);const s=e.fn(e._value);(t.version===0||ar(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Rt=n,zn=r,vd(e),e.flags&=-3}}function dl(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)dl(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Zh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let zn=!0;const wd=[];function Er(){wd.push(zn),zn=!1}function Cr(){const e=wd.pop();zn=e===void 0?!0:e}function Yl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Rt;Rt=void 0;try{t()}finally{Rt=n}}}let fo=0;class ep{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 fl{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(!Rt||!zn||Rt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Rt)n=this.activeLink=new ep(Rt,this),Rt.deps?(n.prevDep=Rt.depsTail,Rt.depsTail.nextDep=n,Rt.depsTail=n):Rt.deps=Rt.depsTail=n,bd(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=Rt.depsTail,n.nextDep=void 0,Rt.depsTail.nextDep=n,Rt.depsTail=n,Rt.deps===n&&(Rt.deps=r)}return n}trigger(t){this.version++,fo++,this.notify(t)}notify(t){cl();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ul()}}}function bd(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)bd(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ca=new WeakMap,fs=Symbol(""),Aa=Symbol(""),ho=Symbol("");function ln(e,t,n){if(zn&&Rt){let r=Ca.get(e);r||Ca.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new fl),s.map=r,s.key=n),s.track()}}function _r(e,t,n,r,s,o){const i=Ca.get(e);if(!i){fo++;return}const a=l=>{l&&l.trigger()};if(cl(),t==="clear")i.forEach(a);else{const l=Ge(e),d=l&&il(n);if(l&&n==="length"){const c=Number(r);i.forEach((h,b)=>{(b==="length"||b===ho||!Kn(b)&&b>=c)&&a(h)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(ho)),t){case"add":l?d&&a(i.get("length")):(a(i.get(fs)),Is(e)&&a(i.get(Aa)));break;case"delete":l||(a(i.get(fs)),Is(e)&&a(i.get(Aa)));break;case"set":Is(e)&&a(i.get(fs));break}}ul()}function vs(e){const t=bt(e);return t===e?t:(ln(t,"iterate",ho),jn(e)?t:t.map(Jn))}function ki(e){return ln(e=bt(e),"iterate",ho),e}function or(e,t){return Ar(e)?$s(hs(e)?Jn(t):t):Jn(t)}const tp={__proto__:null,[Symbol.iterator](){return Gi(this,Symbol.iterator,e=>or(this,e))},concat(...e){return vs(this).concat(...e.map(t=>Ge(t)?vs(t):t))},entries(){return Gi(this,"entries",e=>(e[1]=or(this,e[1]),e))},every(e,t){return gr(this,"every",e,t,void 0,arguments)},filter(e,t){return gr(this,"filter",e,t,n=>n.map(r=>or(this,r)),arguments)},find(e,t){return gr(this,"find",e,t,n=>or(this,n),arguments)},findIndex(e,t){return gr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return gr(this,"findLast",e,t,n=>or(this,n),arguments)},findLastIndex(e,t){return gr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return gr(this,"forEach",e,t,void 0,arguments)},includes(...e){return qi(this,"includes",e)},indexOf(...e){return qi(this,"indexOf",e)},join(e){return vs(this).join(e)},lastIndexOf(...e){return qi(this,"lastIndexOf",e)},map(e,t){return gr(this,"map",e,t,void 0,arguments)},pop(){return qs(this,"pop")},push(...e){return qs(this,"push",e)},reduce(e,...t){return Ql(this,"reduce",e,t)},reduceRight(e,...t){return Ql(this,"reduceRight",e,t)},shift(){return qs(this,"shift")},some(e,t){return gr(this,"some",e,t,void 0,arguments)},splice(...e){return qs(this,"splice",e)},toReversed(){return vs(this).toReversed()},toSorted(e){return vs(this).toSorted(e)},toSpliced(...e){return vs(this).toSpliced(...e)},unshift(...e){return qs(this,"unshift",e)},values(){return Gi(this,"values",e=>or(this,e))}};function Gi(e,t,n){const r=ki(e),s=r[t]();return r!==e&&!jn(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const np=Array.prototype;function gr(e,t,n,r,s,o){const i=ki(e),a=i!==e&&!jn(e),l=i[t];if(l!==np[t]){const h=l.apply(e,o);return a?Jn(h):h}let d=n;i!==e&&(a?d=function(h,b){return n.call(this,or(e,h),b,e)}:n.length>2&&(d=function(h,b){return n.call(this,h,b,e)}));const c=l.call(i,d,r);return a&&s?s(c):c}function Ql(e,t,n,r){const s=ki(e),o=s!==e&&!jn(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(d,c,h){return a&&(a=!1,d=or(e,d)),n.call(this,d,or(e,c),h,e)}):n.length>3&&(i=function(d,c,h){return n.call(this,d,c,h,e)}));const l=s[t](i,...r);return a?or(e,l):l}function qi(e,t,n){const r=bt(e);ln(r,"iterate",ho);const s=r[t](...n);return(s===-1||s===!1)&&ml(n[0])?(n[0]=bt(n[0]),r[t](...n)):s}function qs(e,t,n=[]){Er(),cl();const r=bt(e)[t].apply(e,n);return ul(),Cr(),r}const rp=rl("__proto__,__v_isRef,__isVue"),_d=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Kn));function sp(e){Kn(e)||(e=String(e));const t=bt(this);return ln(t,"has",e),t.hasOwnProperty(e)}class kd{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?pp:Ed:o?Id:Sd).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Ge(t);if(!s){let l;if(i&&(l=tp[n]))return l;if(n==="hasOwnProperty")return sp}const a=Reflect.get(t,n,dn(t)?t:r);if((Kn(n)?_d.has(n):rp(n))||(s||ln(t,"get",n),o))return a;if(dn(a)){const l=i&&il(n)?a:a.value;return s&&It(l)?Ra(l):l}return It(a)?s?Ra(a):Ti(a):a}}class Td extends kd{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Ge(t)&&il(n);if(!this._isShallow){const d=Ar(o);if(!jn(r)&&!Ar(r)&&(o=bt(o),r=bt(r)),!i&&dn(o)&&!dn(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:St(t,n),l=Reflect.set(t,n,r,dn(t)?t:s);return t===bt(s)&&(a?ar(r,o)&&_r(t,"set",n,r):_r(t,"add",n,r)),l}deleteProperty(t,n){const r=St(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&_r(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!Kn(n)||!_d.has(n))&&ln(t,"has",n),r}ownKeys(t){return ln(t,"iterate",Ge(t)?"length":fs),Reflect.ownKeys(t)}}class op extends kd{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const ip=new Td,ap=new op,lp=new Td(!0);const xa=e=>e,Lo=e=>Reflect.getPrototypeOf(e);function cp(e,t,n){return function(...r){const s=this.__v_raw,o=bt(s),i=Is(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),c=n?xa:t?$s:Jn;return!t&&ln(o,"iterate",l?Aa:fs),Kt(Object.create(d),{next(){const{value:h,done:b}=d.next();return b?{value:h,done:b}:{value:a?[c(h[0]),c(h[1])]:c(h),done:b}}})}}function jo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function up(e,t){const n={get(s){const o=this.__v_raw,i=bt(o),a=bt(s);e||(ar(s,a)&&ln(i,"get",s),ln(i,"get",a));const{has:l}=Lo(i),d=t?xa:e?$s:Jn;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&&ln(bt(s),"iterate",fs),s.size},has(s){const o=this.__v_raw,i=bt(o),a=bt(s);return e||(ar(s,a)&&ln(i,"has",s),ln(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=bt(a),d=t?xa:e?$s:Jn;return!e&&ln(l,"iterate",fs),a.forEach((c,h)=>s.call(o,d(c),d(h),i))}};return Kt(n,e?{add:jo("add"),set:jo("set"),delete:jo("delete"),clear:jo("clear")}:{add(s){const o=bt(this),i=Lo(o),a=bt(s),l=!t&&!jn(s)&&!Ar(s)?a:s;return i.has.call(o,l)||ar(s,l)&&i.has.call(o,s)||ar(a,l)&&i.has.call(o,a)||(o.add(l),_r(o,"add",l,l)),this},set(s,o){!t&&!jn(o)&&!Ar(o)&&(o=bt(o));const i=bt(this),{has:a,get:l}=Lo(i);let d=a.call(i,s);d||(s=bt(s),d=a.call(i,s));const c=l.call(i,s);return i.set(s,o),d?ar(o,c)&&_r(i,"set",s,o):_r(i,"add",s,o),this},delete(s){const o=bt(this),{has:i,get:a}=Lo(o);let l=i.call(o,s);l||(s=bt(s),l=i.call(o,s)),a&&a.call(o,s);const d=o.delete(s);return l&&_r(o,"delete",s,void 0),d},clear(){const s=bt(this),o=s.size!==0,i=s.clear();return o&&_r(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=cp(s,e,t)}),n}function hl(e,t){const n=up(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(St(n,s)&&s in r?n:r,s,o)}const dp={get:hl(!1,!1)},fp={get:hl(!1,!0)},hp={get:hl(!0,!1)};const Sd=new WeakMap,Id=new WeakMap,Ed=new WeakMap,pp=new WeakMap;function mp(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function gp(e){return e.__v_skip||!Object.isExtensible(e)?0:mp(Fh(e))}function Ti(e){return Ar(e)?e:pl(e,!1,ip,dp,Sd)}function Cd(e){return pl(e,!1,lp,fp,Id)}function Ra(e){return pl(e,!0,ap,hp,Ed)}function pl(e,t,n,r,s){if(!It(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=gp(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 hs(e){return Ar(e)?hs(e.__v_raw):!!(e&&e.__v_isReactive)}function Ar(e){return!!(e&&e.__v_isReadonly)}function jn(e){return!!(e&&e.__v_isShallow)}function ml(e){return e?!!e.__v_raw:!1}function bt(e){const t=e&&e.__v_raw;return t?bt(t):e}function vp(e){return!St(e,"__v_skip")&&Object.isExtensible(e)&&cd(e,"__v_skip",!0),e}const Jn=e=>It(e)?Ti(e):e,$s=e=>It(e)?Ra(e):e;function dn(e){return e?e.__v_isRef===!0:!1}function D(e){return Ad(e,!1)}function yp(e){return Ad(e,!0)}function Ad(e,t){return dn(e)?e:new wp(e,t)}class wp{constructor(t,n){this.dep=new fl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:bt(t),this._value=n?t:Jn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||jn(t)||Ar(t);t=r?t:bt(t),ar(t,n)&&(this._rawValue=t,this._value=r?t:Jn(t),this.dep.trigger())}}function ye(e){return dn(e)?e.value:e}const bp={get:(e,t,n)=>t==="__v_raw"?e:ye(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return dn(s)&&!dn(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function xd(e){return hs(e)?e:new Proxy(e,bp)}class _p{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new fl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=fo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Rt!==this)return md(this,!0),!0}get value(){const t=this.dep.track();return yd(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function kp(e,t,n=!1){let r,s;return Ze(e)?r=e:(r=e.get,s=e.set),new _p(r,s,n)}const Bo={},ri=new WeakMap;let is;function Tp(e,t=!1,n=is){if(n){let r=ri.get(n);r||ri.set(n,r=[]),r.push(e)}}function Sp(e,t,n=xt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=ne=>s?ne:jn(ne)||s===!1||s===0?kr(ne,1):kr(ne);let c,h,b,T,N=!1,O=!1;if(dn(e)?(h=()=>e.value,N=jn(e)):hs(e)?(h=()=>d(e),N=!0):Ge(e)?(O=!0,N=e.some(ne=>hs(ne)||jn(ne)),h=()=>e.map(ne=>{if(dn(ne))return ne.value;if(hs(ne))return d(ne);if(Ze(ne))return l?l(ne,2):ne()})):Ze(e)?t?h=l?()=>l(e,2):e:h=()=>{if(b){Er();try{b()}finally{Cr()}}const ne=is;is=c;try{return l?l(e,3,[T]):e(T)}finally{is=ne}}:h=dr,t&&s){const ne=h,we=s===!0?1/0:s;h=()=>kr(ne(),we)}const J=Xh(),ie=()=>{c.stop(),J&&J.active&&ol(J.effects,c)};if(o&&t){const ne=t;t=(...we)=>{ne(...we),ie()}}let L=O?new Array(e.length).fill(Bo):Bo;const se=ne=>{if(!(!(c.flags&1)||!c.dirty&&!ne))if(t){const we=c.run();if(s||N||(O?we.some((ce,me)=>ar(ce,L[me])):ar(we,L))){b&&b();const ce=is;is=c;try{const me=[we,L===Bo?void 0:O&&L[0]===Bo?[]:L,T];L=we,l?l(t,3,me):t(...me)}finally{is=ce}}}else c.run()};return a&&a(se),c=new hd(h),c.scheduler=i?()=>i(se,!1):se,T=ne=>Tp(ne,!1,c),b=c.onStop=()=>{const ne=ri.get(c);if(ne){if(l)l(ne,4);else for(const we of ne)we();ri.delete(c)}},t?r?se(!0):L=c.run():i?i(se.bind(null,!0),!0):c.run(),ie.pause=c.pause.bind(c),ie.resume=c.resume.bind(c),ie.stop=ie,ie}function kr(e,t=1/0,n){if(t<=0||!It(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,dn(e))kr(e.value,t,n);else if(Ge(e))for(let r=0;r<e.length;r++)kr(e[r],t,n);else if(od(e)||Is(e))e.forEach(r=>{kr(r,t,n)});else if(ld(e)){for(const r in e)kr(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&kr(e[r],t,n)}return e}/**
|
|
10
|
-
* @vue/runtime-core v3.5.30
|
|
11
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
-
* @license MIT
|
|
13
|
-
**/function Ao(e,t,n,r){try{return r?e(...r):e()}catch(s){Si(s,t,n)}}function Yn(e,t,n,r){if(Ze(e)){const s=Ao(e,t,n,r);return s&&id(s)&&s.catch(o=>{Si(o,t,n)}),s}if(Ge(e)){const s=[];for(let o=0;o<e.length;o++)s.push(Yn(e[o],t,n,r));return s}}function Si(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||xt;if(t){let a=t.parent;const l=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let h=0;h<c.length;h++)if(c[h](e,l,d)===!1)return}a=a.parent}if(o){Er(),Ao(o,null,10,[e,l,d]),Cr();return}}Ip(e,n,s,r,i)}function Ip(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const vn=[];let rr=-1;const Es=[];let Ur=null,_s=0;const Rd=Promise.resolve();let si=null;function qt(e){const t=si||Rd;return e?t.then(this?e.bind(this):e):t}function Ep(e){let t=rr+1,n=vn.length;for(;t<n;){const r=t+n>>>1,s=vn[r],o=po(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function gl(e){if(!(e.flags&1)){const t=po(e),n=vn[vn.length-1];!n||!(e.flags&2)&&t>=po(n)?vn.push(e):vn.splice(Ep(t),0,e),e.flags|=1,Pd()}}function Pd(){si||(si=Rd.then($d))}function Cp(e){Ge(e)?Es.push(...e):Ur&&e.id===-1?Ur.splice(_s+1,0,e):e.flags&1||(Es.push(e),e.flags|=1),Pd()}function Xl(e,t,n=rr+1){for(;n<vn.length;n++){const r=vn[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;vn.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Md(e){if(Es.length){const t=[...new Set(Es)].sort((n,r)=>po(n)-po(r));if(Es.length=0,Ur){Ur.push(...t);return}for(Ur=t,_s=0;_s<Ur.length;_s++){const n=Ur[_s];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Ur=null,_s=0}}const po=e=>e.id==null?e.flags&2?-1:1/0:e.id;function $d(e){try{for(rr=0;rr<vn.length;rr++){const t=vn[rr];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Ao(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;rr<vn.length;rr++){const t=vn[rr];t&&(t.flags&=-2)}rr=-1,vn.length=0,Md(),si=null,(vn.length||Es.length)&&$d()}}let nn=null,Od=null;function oi(e){const t=nn;return nn=e,Od=e&&e.type.__scopeId||null,t}function kt(e,t=nn,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&ci(-1);const o=oi(t);let i;try{i=e(...s)}finally{oi(o),r._d&&ci(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function xr(e,t){if(nn===null)return e;const n=Ri(nn),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=xt]=t[s];o&&(Ze(o)&&(o={mounted:o,updated:o}),o.deep&&kr(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function ts(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&&(Er(),Yn(l,n,8,[e.el,a,e,t]),Cr())}}function qo(e,t){if(un){let n=un.provides;const r=un.parent&&un.parent.provides;r===n&&(n=un.provides=Object.create(r)),n[e]=t}}function Gn(e,t,n=!1){const r=_l();if(r||As){let s=As?As._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Ze(t)?t.call(r&&r.proxy):t}}const Ap=Symbol.for("v-scx"),xp=()=>Gn(Ap);function mt(e,t,n){return Nd(e,t,n)}function Nd(e,t,n=xt){const{immediate:r,deep:s,flush:o,once:i}=n,a=Kt({},n),l=t&&r||!t&&o!=="post";let d;if(wo){if(o==="sync"){const T=xp();d=T.__watcherHandles||(T.__watcherHandles=[])}else if(!l){const T=()=>{};return T.stop=dr,T.resume=dr,T.pause=dr,T}}const c=un;a.call=(T,N,O)=>Yn(T,c,N,O);let h=!1;o==="post"?a.scheduler=T=>{an(T,c&&c.suspense)}:o!=="sync"&&(h=!0,a.scheduler=(T,N)=>{N?T():gl(T)}),a.augmentJob=T=>{t&&(T.flags|=4),h&&(T.flags|=2,c&&(T.id=c.uid,T.i=c))};const b=Sp(e,t,a);return wo&&(d?d.push(b):l&&b()),b}function Rp(e,t,n){const r=this.proxy,s=Bt(e)?e.includes(".")?Dd(r,e):()=>r[e]:e.bind(r,r);let o;Ze(t)?o=t:(o=t.handler,n=t);const i=xo(this),a=Nd(s,o.bind(r),n);return i(),a}function Dd(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}const Ld=Symbol("_vte"),jd=e=>e.__isTeleport,ro=e=>e&&(e.disabled||e.disabled===""),Zl=e=>e&&(e.defer||e.defer===""),ec=e=>typeof SVGElement<"u"&&e instanceof SVGElement,tc=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Pa=(e,t)=>{const n=e&&e.to;return Bt(n)?t?t(n):null:n},Bd={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,d){const{mc:c,pc:h,pbc:b,o:{insert:T,querySelector:N,createText:O,createComment:J}}=d,ie=ro(t.props);let{shapeFlag:L,children:se,dynamicChildren:ne}=t;if(e==null){const we=t.el=O(""),ce=t.anchor=O("");T(we,n,r),T(ce,n,r);const me=(ae,X)=>{L&16&&c(se,ae,X,s,o,i,a,l)},Oe=()=>{const ae=t.target=Pa(t.props,N),X=Ma(ae,t,O,T);ae&&(i!=="svg"&&ec(ae)?i="svg":i!=="mathml"&&tc(ae)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(ae),ie||(me(ae,X),Ko(t,!1)))};ie&&(me(n,ce),Ko(t,!0)),Zl(t.props)?(t.el.__isMounted=!1,an(()=>{Oe(),delete t.el.__isMounted},o)):Oe()}else{if(Zl(t.props)&&e.el.__isMounted===!1){an(()=>{Bd.process(e,t,n,r,s,o,i,a,l,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const we=t.anchor=e.anchor,ce=t.target=e.target,me=t.targetAnchor=e.targetAnchor,Oe=ro(e.props),ae=Oe?n:ce,X=Oe?we:me;if(i==="svg"||ec(ce)?i="svg":(i==="mathml"||tc(ce))&&(i="mathml"),ne?(b(e.dynamicChildren,ne,ae,s,o,i,a),wl(e,t,!0)):l||h(e,t,ae,X,s,o,i,a,!1),ie)Oe?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Fo(t,n,we,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const le=t.target=Pa(t.props,N);le&&Fo(t,le,null,d,0)}else Oe&&Fo(t,ce,me,d,1);Ko(t,ie)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:d,targetAnchor:c,target:h,props:b}=e;if(h&&(s(d),s(c)),o&&s(l),i&16){const T=o||!ro(b);for(let N=0;N<a.length;N++){const O=a[N];r(O,t,n,T,!!O.dynamicChildren)}}},move:Fo,hydrate:Pp};function Fo(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:d,props:c}=e,h=o===2;if(h&&r(i,t,n),(!h||ro(c))&&l&16)for(let b=0;b<d.length;b++)s(d[b],t,n,2);h&&r(a,t,n)}function Pp(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:c}},h){function b(J,ie){let L=ie;for(;L;){if(L&&L.nodeType===8){if(L.data==="teleport start anchor")t.targetStart=L;else if(L.data==="teleport anchor"){t.targetAnchor=L,J._lpa=t.targetAnchor&&i(t.targetAnchor);break}}L=i(L)}}function T(J,ie){ie.anchor=h(i(J),ie,a(J),n,r,s,o)}const N=t.target=Pa(t.props,l),O=ro(t.props);if(N){const J=N._lpa||N.firstChild;t.shapeFlag&16&&(O?(T(e,t),b(N,J),t.targetAnchor||Ma(N,t,c,d,a(e)===N?e:null)):(t.anchor=i(e),b(N,J),t.targetAnchor||Ma(N,t,c,d),h(J&&i(J),t,N,n,r,s,o))),Ko(t,O)}else O&&t.shapeFlag&16&&(T(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const so=Bd;function Ko(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 Ma(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Ld]=i,e&&(r(o,e,s),r(i,e,s)),i}const sr=Symbol("_leaveCb"),Ks=Symbol("_enterCb");function Mp(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Or(()=>{e.isMounted=!0}),Nr(()=>{e.isUnmounting=!0}),e}const Dn=[Function,Array],Fd={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Dn,onEnter:Dn,onAfterEnter:Dn,onEnterCancelled:Dn,onBeforeLeave:Dn,onLeave:Dn,onAfterLeave:Dn,onLeaveCancelled:Dn,onBeforeAppear:Dn,onAppear:Dn,onAfterAppear:Dn,onAppearCancelled:Dn},Ud=e=>{const t=e.subTree;return t.component?Ud(t.component):t},$p={name:"BaseTransition",props:Fd,setup(e,{slots:t}){const n=_l(),r=Mp();return()=>{const s=t.default&&Wd(t.default(),!0);if(!s||!s.length)return;const o=Hd(s),i=bt(e),{mode:a}=i;if(r.isLeaving)return Ki(o);const l=nc(o);if(!l)return Ki(o);let d=$a(l,i,r,n,h=>d=h);l.type!==cn&&mo(l,d);let c=n.subTree&&nc(n.subTree);if(c&&c.type!==cn&&!ls(c,l)&&Ud(n).type!==cn){let h=$a(c,i,r,n);if(mo(c,h),a==="out-in"&&l.type!==cn)return r.isLeaving=!0,h.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete h.afterLeave,c=void 0},Ki(o);a==="in-out"&&l.type!==cn?h.delayLeave=(b,T,N)=>{const O=Vd(r,c);O[String(c.key)]=c,b[sr]=()=>{T(),b[sr]=void 0,delete d.delayedLeave,c=void 0},d.delayedLeave=()=>{N(),delete d.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function Hd(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==cn){t=n;break}}return t}const Op=$p;function Vd(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 $a(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:c,onEnterCancelled:h,onBeforeLeave:b,onLeave:T,onAfterLeave:N,onLeaveCancelled:O,onBeforeAppear:J,onAppear:ie,onAfterAppear:L,onAppearCancelled:se}=t,ne=String(e.key),we=Vd(n,e),ce=(ae,X)=>{ae&&Yn(ae,r,9,X)},me=(ae,X)=>{const le=X[1];ce(ae,X),Ge(ae)?ae.every(te=>te.length<=1)&&le():ae.length<=1&&le()},Oe={mode:i,persisted:a,beforeEnter(ae){let X=l;if(!n.isMounted)if(o)X=J||l;else return;ae[sr]&&ae[sr](!0);const le=we[ne];le&&ls(e,le)&&le.el[sr]&&le.el[sr](),ce(X,[ae])},enter(ae){if(we[ne]===e)return;let X=d,le=c,te=h;if(!n.isMounted)if(o)X=ie||d,le=L||c,te=se||h;else return;let Me=!1;ae[Ks]=qe=>{Me||(Me=!0,qe?ce(te,[ae]):ce(le,[ae]),Oe.delayedLeave&&Oe.delayedLeave(),ae[Ks]=void 0)};const Ne=ae[Ks].bind(null,!1);X?me(X,[ae,Ne]):Ne()},leave(ae,X){const le=String(e.key);if(ae[Ks]&&ae[Ks](!0),n.isUnmounting)return X();ce(b,[ae]);let te=!1;ae[sr]=Ne=>{te||(te=!0,X(),Ne?ce(O,[ae]):ce(N,[ae]),ae[sr]=void 0,we[le]===e&&delete we[le])};const Me=ae[sr].bind(null,!1);we[le]=e,T?me(T,[ae,Me]):Me()},clone(ae){const X=$a(ae,t,n,r,s);return s&&s(X),X}};return Oe}function Ki(e){if(Ii(e))return e=Yr(e),e.children=null,e}function nc(e){if(!Ii(e))return jd(e.type)&&e.children?Hd(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Ze(n.default))return n.default()}}function mo(e,t){e.shapeFlag&6&&e.component?(e.transition=t,mo(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 Wd(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===$e?(i.patchFlag&128&&s++,r=r.concat(Wd(i.children,t,a))):(t||i.type!==cn)&&r.push(a!=null?Yr(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Zt(e,t){return Ze(e)?Kt({name:e.name},t,{setup:e}):e}function zd(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function rc(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const ii=new WeakMap;function oo(e,t,n,r,s=!1){if(Ge(e)){e.forEach((O,J)=>oo(O,t&&(Ge(t)?t[J]:t),n,r,s));return}if(Cs(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&oo(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?Ri(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,c=a.refs===xt?a.refs={}:a.refs,h=a.setupState,b=bt(h),T=h===xt?sd:O=>rc(c,O)?!1:St(b,O),N=(O,J)=>!(J&&rc(c,J));if(d!=null&&d!==l){if(sc(t),Bt(d))c[d]=null,T(d)&&(h[d]=null);else if(dn(d)){const O=t;N(d,O.k)&&(d.value=null),O.k&&(c[O.k]=null)}}if(Ze(l))Ao(l,a,12,[i,c]);else{const O=Bt(l),J=dn(l);if(O||J){const ie=()=>{if(e.f){const L=O?T(l)?h[l]:c[l]:N()||!e.k?l.value:c[e.k];if(s)Ge(L)&&ol(L,o);else if(Ge(L))L.includes(o)||L.push(o);else if(O)c[l]=[o],T(l)&&(h[l]=c[l]);else{const se=[o];N(l,e.k)&&(l.value=se),e.k&&(c[e.k]=se)}}else O?(c[l]=i,T(l)&&(h[l]=i)):J&&(N(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const L=()=>{ie(),ii.delete(e)};L.id=-1,ii.set(e,L),an(L,n)}else sc(e),ie()}}}function sc(e){const t=ii.get(e);t&&(t.flags|=8,ii.delete(e))}_i().requestIdleCallback;_i().cancelIdleCallback;const Cs=e=>!!e.type.__asyncLoader,Ii=e=>e.type.__isKeepAlive;function Np(e,t){Gd(e,"a",t)}function Dp(e,t){Gd(e,"da",t)}function Gd(e,t,n=un){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Ei(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Ii(s.parent.vnode)&&Lp(r,t,n,s),s=s.parent}}function Lp(e,t,n,r){const s=Ei(t,e,r,!0);Ci(()=>{ol(r[t],s)},n)}function Ei(e,t,n=un,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Er();const a=xo(n),l=Yn(t,n,e,i);return a(),Cr(),l});return r?s.unshift(o):s.push(o),o}}const $r=e=>(t,n=un)=>{(!wo||e==="sp")&&Ei(e,(...r)=>t(...r),n)},jp=$r("bm"),Or=$r("m"),Bp=$r("bu"),Fp=$r("u"),Nr=$r("bum"),Ci=$r("um"),Up=$r("sp"),Hp=$r("rtg"),Vp=$r("rtc");function Wp(e,t=un){Ei("ec",e,t)}const zp="components",qd=Symbol.for("v-ndc");function ai(e){return Bt(e)?Gp(zp,e,!1)||e:e||qd}function Gp(e,t,n=!0,r=!1){const s=nn||un;if(s){const o=s.type;{const a=Rm(o,!1);if(a&&(a===t||a===wn(t)||a===bi(wn(t))))return o}const i=oc(s[e]||o[e],t)||oc(s.appContext[e],t);return!i&&r?o:i}}function oc(e,t){return e&&(e[t]||e[wn(t)]||e[bi(wn(t))])}function dt(e,t,n,r){let s;const o=n,i=Ge(e);if(i||Bt(e)){const a=i&&hs(e);let l=!1,d=!1;a&&(l=!jn(e),d=Ar(e),e=ki(e)),s=new Array(e.length);for(let c=0,h=e.length;c<h;c++)s[c]=t(l?d?$s(Jn(e[c])):Jn(e[c]):e[c],c,void 0,o)}else if(typeof e=="number"){s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,o)}else if(It(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,d=a.length;l<d;l++){const c=a[l];s[l]=t(e[c],c,l,o)}}else s=[];return s}function ur(e,t,n={},r,s){if(nn.ce||nn.parent&&Cs(nn.parent)&&nn.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),p(),vt($e,null,[De("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),p();const i=o&&Kd(o(n)),a=n.key||i&&i.key,l=vt($e,{key:(a&&!Kn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function Kd(e){return e.some(t=>vo(t)?!(t.type===cn||t.type===$e&&!Kd(t.children)):!0)?e:null}const Oa=e=>e?mf(e)?Ri(e):Oa(e.parent):null,io=Kt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Oa(e.parent),$root:e=>Oa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Yd(e),$forceUpdate:e=>e.f||(e.f=()=>{gl(e.update)}),$nextTick:e=>e.n||(e.n=qt.bind(e.proxy)),$watch:e=>Rp.bind(e)}),Ji=(e,t)=>e!==xt&&!e.__isScriptSetup&&St(e,t),qp={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 b=i[t];if(b!==void 0)switch(b){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(Ji(r,t))return i[t]=1,r[t];if(s!==xt&&St(s,t))return i[t]=2,s[t];if(St(o,t))return i[t]=3,o[t];if(n!==xt&&St(n,t))return i[t]=4,n[t];Na&&(i[t]=0)}}const d=io[t];let c,h;if(d)return t==="$attrs"&&ln(e.attrs,"get",""),d(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==xt&&St(n,t))return i[t]=4,n[t];if(h=l.config.globalProperties,St(h,t))return h[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return Ji(s,t)?(s[t]=n,!0):r!==xt&&St(r,t)?(r[t]=n,!0):St(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!==xt&&a[0]!=="$"&&St(e,a)||Ji(t,a)||St(o,a)||St(r,a)||St(io,a)||St(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:St(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Kp(){return Jp().slots}function Jp(e){const t=_l();return t.setupContext||(t.setupContext=vf(t))}function ic(e){return Ge(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Na=!0;function Yp(e){const t=Yd(e),n=e.proxy,r=e.ctx;Na=!1,t.beforeCreate&&ac(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:d,created:c,beforeMount:h,mounted:b,beforeUpdate:T,updated:N,activated:O,deactivated:J,beforeDestroy:ie,beforeUnmount:L,destroyed:se,unmounted:ne,render:we,renderTracked:ce,renderTriggered:me,errorCaptured:Oe,serverPrefetch:ae,expose:X,inheritAttrs:le,components:te,directives:Me,filters:Ne}=t;if(d&&Qp(d,r,null),i)for(const Fe in i){const xe=i[Fe];Ze(xe)&&(r[Fe]=xe.bind(n))}if(s){const Fe=s.call(n,n);It(Fe)&&(e.data=Ti(Fe))}if(Na=!0,o)for(const Fe in o){const xe=o[Fe],nt=Ze(xe)?xe.bind(n,n):Ze(xe.get)?xe.get.bind(n,n):dr,ze=!Ze(xe)&&Ze(xe.set)?xe.set.bind(n):dr,Be=pe({get:nt,set:ze});Object.defineProperty(r,Fe,{enumerable:!0,configurable:!0,get:()=>Be.value,set:at=>Be.value=at})}if(a)for(const Fe in a)Jd(a[Fe],r,n,Fe);if(l){const Fe=Ze(l)?l.call(n):l;Reflect.ownKeys(Fe).forEach(xe=>{qo(xe,Fe[xe])})}c&&ac(c,e,"c");function He(Fe,xe){Ge(xe)?xe.forEach(nt=>Fe(nt.bind(n))):xe&&Fe(xe.bind(n))}if(He(jp,h),He(Or,b),He(Bp,T),He(Fp,N),He(Np,O),He(Dp,J),He(Wp,Oe),He(Vp,ce),He(Hp,me),He(Nr,L),He(Ci,ne),He(Up,ae),Ge(X))if(X.length){const Fe=e.exposed||(e.exposed={});X.forEach(xe=>{Object.defineProperty(Fe,xe,{get:()=>n[xe],set:nt=>n[xe]=nt,enumerable:!0})})}else e.exposed||(e.exposed={});we&&e.render===dr&&(e.render=we),le!=null&&(e.inheritAttrs=le),te&&(e.components=te),Me&&(e.directives=Me),ae&&zd(e)}function Qp(e,t,n=dr){Ge(e)&&(e=Da(e));for(const r in e){const s=e[r];let o;It(s)?"default"in s?o=Gn(s.from||r,s.default,!0):o=Gn(s.from||r):o=Gn(s),dn(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function ac(e,t,n){Yn(Ge(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Jd(e,t,n,r){let s=r.includes(".")?Dd(n,r):()=>n[r];if(Bt(e)){const o=t[e];Ze(o)&&mt(s,o)}else if(Ze(e))mt(s,e.bind(n));else if(It(e))if(Ge(e))e.forEach(o=>Jd(o,t,n,r));else{const o=Ze(e.handler)?e.handler.bind(n):t[e.handler];Ze(o)&&mt(s,o,e)}}function Yd(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=>li(l,d,i,!0)),li(l,t,i)),It(t)&&o.set(t,l),l}function li(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&li(e,o,n,!0),s&&s.forEach(i=>li(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=Xp[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const Xp={data:lc,props:cc,emits:cc,methods:Xs,computed:Xs,beforeCreate:mn,created:mn,beforeMount:mn,mounted:mn,beforeUpdate:mn,updated:mn,beforeDestroy:mn,beforeUnmount:mn,destroyed:mn,unmounted:mn,activated:mn,deactivated:mn,errorCaptured:mn,serverPrefetch:mn,components:Xs,directives:Xs,watch:em,provide:lc,inject:Zp};function lc(e,t){return t?e?function(){return Kt(Ze(e)?e.call(this,this):e,Ze(t)?t.call(this,this):t)}:t:e}function Zp(e,t){return Xs(Da(e),Da(t))}function Da(e){if(Ge(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function mn(e,t){return e?[...new Set([].concat(e,t))]:t}function Xs(e,t){return e?Kt(Object.create(null),e,t):t}function cc(e,t){return e?Ge(e)&&Ge(t)?[...new Set([...e,...t])]:Kt(Object.create(null),ic(e),ic(t??{})):t}function em(e,t){if(!e)return t;if(!t)return e;const n=Kt(Object.create(null),e);for(const r in t)n[r]=mn(e[r],t[r]);return n}function Qd(){return{app:null,config:{isNativeTag:sd,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 tm=0;function nm(e,t){return function(r,s=null){Ze(r)||(r=Kt({},r)),s!=null&&!It(s)&&(s=null);const o=Qd(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:tm++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:Mm,get config(){return o.config},set config(c){},use(c,...h){return i.has(c)||(c&&Ze(c.install)?(i.add(c),c.install(d,...h)):Ze(c)&&(i.add(c),c(d,...h))),d},mixin(c){return o.mixins.includes(c)||o.mixins.push(c),d},component(c,h){return h?(o.components[c]=h,d):o.components[c]},directive(c,h){return h?(o.directives[c]=h,d):o.directives[c]},mount(c,h,b){if(!l){const T=d._ceVNode||De(r,s);return T.appContext=o,b===!0?b="svg":b===!1&&(b=void 0),e(T,c,b),l=!0,d._container=c,c.__vue_app__=d,Ri(T.component)}},onUnmount(c){a.push(c)},unmount(){l&&(Yn(a,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(c,h){return o.provides[c]=h,d},runWithContext(c){const h=As;As=d;try{return c()}finally{As=h}}};return d}}let As=null;const rm=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${wn(t)}Modifiers`]||e[`${Qr(t)}Modifiers`];function sm(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||xt;let s=n;const o=t.startsWith("update:"),i=o&&rm(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>Bt(c)?c.trim():c)),i.number&&(s=n.map(al)));let a,l=r[a=Vi(t)]||r[a=Vi(wn(t))];!l&&o&&(l=r[a=Vi(Qr(t))]),l&&Yn(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,Yn(d,e,6,s)}}const om=new WeakMap;function Xd(e,t,n=!1){const r=n?om:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Ze(e)){const l=d=>{const c=Xd(d,t,!0);c&&(a=!0,Kt(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(It(e)&&r.set(e,null),null):(Ge(o)?o.forEach(l=>i[l]=null):Kt(i,o),It(e)&&r.set(e,i),i)}function Ai(e,t){return!e||!yi(t)?!1:(t=t.slice(2).replace(/Once$/,""),St(e,t[0].toLowerCase()+t.slice(1))||St(e,Qr(t))||St(e,t))}function uc(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:d,renderCache:c,props:h,data:b,setupState:T,ctx:N,inheritAttrs:O}=e,J=oi(e);let ie,L;try{if(n.shapeFlag&4){const ne=s||r,we=ne;ie=ir(d.call(we,ne,c,h,T,b,N)),L=a}else{const ne=t;ie=ir(ne.length>1?ne(h,{attrs:a,slots:i,emit:l}):ne(h,null)),L=t.props?a:im(a)}}catch(ne){ao.length=0,Si(ne,e,1),ie=De(cn)}let se=ie;if(L&&O!==!1){const ne=Object.keys(L),{shapeFlag:we}=se;ne.length&&we&7&&(o&&ne.some(sl)&&(L=am(L,o)),se=Yr(se,L,!1,!0))}return n.dirs&&(se=Yr(se,null,!1,!0),se.dirs=se.dirs?se.dirs.concat(n.dirs):n.dirs),n.transition&&mo(se,n.transition),ie=se,oi(J),ie}const im=e=>{let t;for(const n in e)(n==="class"||n==="style"||yi(n))&&((t||(t={}))[n]=e[n]);return t},am=(e,t)=>{const n={};for(const r in e)(!sl(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function lm(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?dc(r,i,d):!!i;if(l&8){const c=t.dynamicProps;for(let h=0;h<c.length;h++){const b=c[h];if(Zd(i,r,b)&&!Ai(d,b))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?dc(r,i,d):!0:!!i;return!1}function dc(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(Zd(t,e,o)&&!Ai(n,o))return!0}return!1}function Zd(e,t,n){const r=e[n],s=t[n];return n==="style"&&It(r)&&It(s)?!ll(r,s):r!==s}function cm({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 ef={},tf=()=>Object.create(ef),nf=e=>Object.getPrototypeOf(e)===ef;function um(e,t,n,r=!1){const s={},o=tf();e.propsDefaults=Object.create(null),rf(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Cd(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function dm(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=bt(s),[l]=e.propsOptions;let d=!1;if((r||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let h=0;h<c.length;h++){let b=c[h];if(Ai(e.emitsOptions,b))continue;const T=t[b];if(l)if(St(o,b))T!==o[b]&&(o[b]=T,d=!0);else{const N=wn(b);s[N]=La(l,a,N,T,e,!1)}else T!==o[b]&&(o[b]=T,d=!0)}}}else{rf(e,t,s,o)&&(d=!0);let c;for(const h in a)(!t||!St(t,h)&&((c=Qr(h))===h||!St(t,c)))&&(l?n&&(n[h]!==void 0||n[c]!==void 0)&&(s[h]=La(l,a,h,void 0,e,!0)):delete s[h]);if(o!==a)for(const h in o)(!t||!St(t,h))&&(delete o[h],d=!0)}d&&_r(e.attrs,"set","")}function rf(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(eo(l))continue;const d=t[l];let c;s&&St(s,c=wn(l))?!o||!o.includes(c)?n[c]=d:(a||(a={}))[c]=d:Ai(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=bt(n),d=a||xt;for(let c=0;c<o.length;c++){const h=o[c];n[h]=La(s,l,h,d[h],e,!St(d,h))}}return i}function La(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=St(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&Ze(l)){const{propsDefaults:d}=s;if(n in d)r=d[n];else{const c=xo(s);r=d[n]=l.call(null,t),c()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===Qr(n))&&(r=!0))}return r}const fm=new WeakMap;function sf(e,t,n=!1){const r=n?fm:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Ze(e)){const c=h=>{l=!0;const[b,T]=sf(h,t,!0);Kt(i,b),T&&a.push(...T)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return It(e)&&r.set(e,Ss),Ss;if(Ge(o))for(let c=0;c<o.length;c++){const h=wn(o[c]);fc(h)&&(i[h]=xt)}else if(o)for(const c in o){const h=wn(c);if(fc(h)){const b=o[c],T=i[h]=Ge(b)||Ze(b)?{type:b}:Kt({},b),N=T.type;let O=!1,J=!0;if(Ge(N))for(let ie=0;ie<N.length;++ie){const L=N[ie],se=Ze(L)&&L.name;if(se==="Boolean"){O=!0;break}else se==="String"&&(J=!1)}else O=Ze(N)&&N.name==="Boolean";T[0]=O,T[1]=J,(O||St(T,"default"))&&a.push(h)}}const d=[i,a];return It(e)&&r.set(e,d),d}function fc(e){return e[0]!=="$"&&!eo(e)}const vl=e=>e==="_"||e==="_ctx"||e==="$stable",yl=e=>Ge(e)?e.map(ir):[ir(e)],hm=(e,t,n)=>{if(t._n)return t;const r=kt((...s)=>yl(t(...s)),n);return r._c=!1,r},of=(e,t,n)=>{const r=e._ctx;for(const s in e){if(vl(s))continue;const o=e[s];if(Ze(o))t[s]=hm(s,o,r);else if(o!=null){const i=yl(o);t[s]=()=>i}}},af=(e,t)=>{const n=yl(t);e.slots.default=()=>n},lf=(e,t,n)=>{for(const r in t)(n||!vl(r))&&(e[r]=t[r])},pm=(e,t,n)=>{const r=e.slots=tf();if(e.vnode.shapeFlag&32){const s=t._;s?(lf(r,t,n),n&&cd(r,"_",s,!0)):of(t,r)}else t&&af(e,t)},mm=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=xt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:lf(s,t,n):(o=!t.$stable,of(t,s)),i=t}else t&&(af(e,t),i={default:1});if(o)for(const a in s)!vl(a)&&i[a]==null&&delete s[a]},an=bm;function gm(e){return vm(e)}function vm(e,t){const n=_i();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:d,setElementText:c,parentNode:h,nextSibling:b,setScopeId:T=dr,insertStaticContent:N}=e,O=(k,I,$,q=null,F=null,P=null,H=void 0,U=null,z=!!I.dynamicChildren)=>{if(k===I)return;k&&!ls(k,I)&&(q=V(k),at(k,F,P,!0),k=null),I.patchFlag===-2&&(z=!1,I.dynamicChildren=null);const{type:G,ref:Te,shapeFlag:ve}=I;switch(G){case xi:J(k,I,$,q);break;case cn:ie(k,I,$,q);break;case Qi:k==null&&L(I,$,q,H);break;case $e:te(k,I,$,q,F,P,H,U,z);break;default:ve&1?we(k,I,$,q,F,P,H,U,z):ve&6?Me(k,I,$,q,F,P,H,U,z):(ve&64||ve&128)&&G.process(k,I,$,q,F,P,H,U,z,Ae)}Te!=null&&F?oo(Te,k&&k.ref,P,I||k,!I):Te==null&&k&&k.ref!=null&&oo(k.ref,null,P,k,!0)},J=(k,I,$,q)=>{if(k==null)r(I.el=a(I.children),$,q);else{const F=I.el=k.el;I.children!==k.children&&d(F,I.children)}},ie=(k,I,$,q)=>{k==null?r(I.el=l(I.children||""),$,q):I.el=k.el},L=(k,I,$,q)=>{[k.el,k.anchor]=N(k.children,I,$,q,k.el,k.anchor)},se=({el:k,anchor:I},$,q)=>{let F;for(;k&&k!==I;)F=b(k),r(k,$,q),k=F;r(I,$,q)},ne=({el:k,anchor:I})=>{let $;for(;k&&k!==I;)$=b(k),s(k),k=$;s(I)},we=(k,I,$,q,F,P,H,U,z)=>{if(I.type==="svg"?H="svg":I.type==="math"&&(H="mathml"),k==null)ce(I,$,q,F,P,H,U,z);else{const G=k.el&&k.el._isVueCE?k.el:null;try{G&&G._beginPatch(),ae(k,I,F,P,H,U,z)}finally{G&&G._endPatch()}}},ce=(k,I,$,q,F,P,H,U)=>{let z,G;const{props:Te,shapeFlag:ve,transition:ke,dirs:Ie}=k;if(z=k.el=i(k.type,P,Te&&Te.is,Te),ve&8?c(z,k.children):ve&16&&Oe(k.children,z,null,q,F,Yi(k,P),H,U),Ie&&ts(k,null,q,"created"),me(z,k,k.scopeId,H,q),Te){for(const tt in Te)tt!=="value"&&!eo(tt)&&o(z,tt,null,Te[tt],P,q);"value"in Te&&o(z,"value",null,Te.value,P),(G=Te.onVnodeBeforeMount)&&nr(G,q,k)}Ie&&ts(k,null,q,"beforeMount");const Ue=ym(F,ke);Ue&&ke.beforeEnter(z),r(z,I,$),((G=Te&&Te.onVnodeMounted)||Ue||Ie)&&an(()=>{G&&nr(G,q,k),Ue&&ke.enter(z),Ie&&ts(k,null,q,"mounted")},F)},me=(k,I,$,q,F)=>{if($&&T(k,$),q)for(let P=0;P<q.length;P++)T(k,q[P]);if(F){let P=F.subTree;if(I===P||df(P.type)&&(P.ssContent===I||P.ssFallback===I)){const H=F.vnode;me(k,H,H.scopeId,H.slotScopeIds,F.parent)}}},Oe=(k,I,$,q,F,P,H,U,z=0)=>{for(let G=z;G<k.length;G++){const Te=k[G]=U?br(k[G]):ir(k[G]);O(null,Te,I,$,q,F,P,H,U)}},ae=(k,I,$,q,F,P,H)=>{const U=I.el=k.el;let{patchFlag:z,dynamicChildren:G,dirs:Te}=I;z|=k.patchFlag&16;const ve=k.props||xt,ke=I.props||xt;let Ie;if($&&ns($,!1),(Ie=ke.onVnodeBeforeUpdate)&&nr(Ie,$,I,k),Te&&ts(I,k,$,"beforeUpdate"),$&&ns($,!0),(ve.innerHTML&&ke.innerHTML==null||ve.textContent&&ke.textContent==null)&&c(U,""),G?X(k.dynamicChildren,G,U,$,q,Yi(I,F),P):H||xe(k,I,U,null,$,q,Yi(I,F),P,!1),z>0){if(z&16)le(U,ve,ke,$,F);else if(z&2&&ve.class!==ke.class&&o(U,"class",null,ke.class,F),z&4&&o(U,"style",ve.style,ke.style,F),z&8){const Ue=I.dynamicProps;for(let tt=0;tt<Ue.length;tt++){const Qe=Ue[tt],ct=ve[Qe],et=ke[Qe];(et!==ct||Qe==="value")&&o(U,Qe,ct,et,F,$)}}z&1&&k.children!==I.children&&c(U,I.children)}else!H&&G==null&&le(U,ve,ke,$,F);((Ie=ke.onVnodeUpdated)||Te)&&an(()=>{Ie&&nr(Ie,$,I,k),Te&&ts(I,k,$,"updated")},q)},X=(k,I,$,q,F,P,H)=>{for(let U=0;U<I.length;U++){const z=k[U],G=I[U],Te=z.el&&(z.type===$e||!ls(z,G)||z.shapeFlag&198)?h(z.el):$;O(z,G,Te,null,q,F,P,H,!0)}},le=(k,I,$,q,F)=>{if(I!==$){if(I!==xt)for(const P in I)!eo(P)&&!(P in $)&&o(k,P,I[P],null,F,q);for(const P in $){if(eo(P))continue;const H=$[P],U=I[P];H!==U&&P!=="value"&&o(k,P,U,H,F,q)}"value"in $&&o(k,"value",I.value,$.value,F)}},te=(k,I,$,q,F,P,H,U,z)=>{const G=I.el=k?k.el:a(""),Te=I.anchor=k?k.anchor:a("");let{patchFlag:ve,dynamicChildren:ke,slotScopeIds:Ie}=I;Ie&&(U=U?U.concat(Ie):Ie),k==null?(r(G,$,q),r(Te,$,q),Oe(I.children||[],$,Te,F,P,H,U,z)):ve>0&&ve&64&&ke&&k.dynamicChildren&&k.dynamicChildren.length===ke.length?(X(k.dynamicChildren,ke,$,F,P,H,U),(I.key!=null||F&&I===F.subTree)&&wl(k,I,!0)):xe(k,I,$,Te,F,P,H,U,z)},Me=(k,I,$,q,F,P,H,U,z)=>{I.slotScopeIds=U,k==null?I.shapeFlag&512?F.ctx.activate(I,$,q,H,z):Ne(I,$,q,F,P,H,z):qe(k,I,z)},Ne=(k,I,$,q,F,P,H)=>{const U=k.component=Em(k,q,F);if(Ii(k)&&(U.ctx.renderer=Ae),Cm(U,!1,H),U.asyncDep){if(F&&F.registerDep(U,He,H),!k.el){const z=U.subTree=De(cn);ie(null,z,I,$),k.placeholder=z.el}}else He(U,k,I,$,F,P,H)},qe=(k,I,$)=>{const q=I.component=k.component;if(lm(k,I,$))if(q.asyncDep&&!q.asyncResolved){Fe(q,I,$);return}else q.next=I,q.update();else I.el=k.el,q.vnode=I},He=(k,I,$,q,F,P,H)=>{const U=()=>{if(k.isMounted){let{next:ve,bu:ke,u:Ie,parent:Ue,vnode:tt}=k;{const Je=cf(k);if(Je){ve&&(ve.el=tt.el,Fe(k,ve,H)),Je.asyncDep.then(()=>{an(()=>{k.isUnmounted||G()},F)});return}}let Qe=ve,ct;ns(k,!1),ve?(ve.el=tt.el,Fe(k,ve,H)):ve=tt,ke&&Go(ke),(ct=ve.props&&ve.props.onVnodeBeforeUpdate)&&nr(ct,Ue,ve,tt),ns(k,!0);const et=uc(k),pt=k.subTree;k.subTree=et,O(pt,et,h(pt.el),V(pt),k,F,P),ve.el=et.el,Qe===null&&cm(k,et.el),Ie&&an(Ie,F),(ct=ve.props&&ve.props.onVnodeUpdated)&&an(()=>nr(ct,Ue,ve,tt),F)}else{let ve;const{el:ke,props:Ie}=I,{bm:Ue,m:tt,parent:Qe,root:ct,type:et}=k,pt=Cs(I);ns(k,!1),Ue&&Go(Ue),!pt&&(ve=Ie&&Ie.onVnodeBeforeMount)&&nr(ve,Qe,I),ns(k,!0);{ct.ce&&ct.ce._hasShadowRoot()&&ct.ce._injectChildStyle(et,k.parent?k.parent.type:void 0);const Je=k.subTree=uc(k);O(null,Je,$,q,k,F,P),I.el=Je.el}if(tt&&an(tt,F),!pt&&(ve=Ie&&Ie.onVnodeMounted)){const Je=I;an(()=>nr(ve,Qe,Je),F)}(I.shapeFlag&256||Qe&&Cs(Qe.vnode)&&Qe.vnode.shapeFlag&256)&&k.a&&an(k.a,F),k.isMounted=!0,I=$=q=null}};k.scope.on();const z=k.effect=new hd(U);k.scope.off();const G=k.update=z.run.bind(z),Te=k.job=z.runIfDirty.bind(z);Te.i=k,Te.id=k.uid,z.scheduler=()=>gl(Te),ns(k,!0),G()},Fe=(k,I,$)=>{I.component=k;const q=k.vnode.props;k.vnode=I,k.next=null,dm(k,I.props,q,$),mm(k,I.children,$),Er(),Xl(k),Cr()},xe=(k,I,$,q,F,P,H,U,z=!1)=>{const G=k&&k.children,Te=k?k.shapeFlag:0,ve=I.children,{patchFlag:ke,shapeFlag:Ie}=I;if(ke>0){if(ke&128){ze(G,ve,$,q,F,P,H,U,z);return}else if(ke&256){nt(G,ve,$,q,F,P,H,U,z);return}}Ie&8?(Te&16&&Ve(G,F,P),ve!==G&&c($,ve)):Te&16?Ie&16?ze(G,ve,$,q,F,P,H,U,z):Ve(G,F,P,!0):(Te&8&&c($,""),Ie&16&&Oe(ve,$,q,F,P,H,U,z))},nt=(k,I,$,q,F,P,H,U,z)=>{k=k||Ss,I=I||Ss;const G=k.length,Te=I.length,ve=Math.min(G,Te);let ke;for(ke=0;ke<ve;ke++){const Ie=I[ke]=z?br(I[ke]):ir(I[ke]);O(k[ke],Ie,$,null,F,P,H,U,z)}G>Te?Ve(k,F,P,!0,!1,ve):Oe(I,$,q,F,P,H,U,z,ve)},ze=(k,I,$,q,F,P,H,U,z)=>{let G=0;const Te=I.length;let ve=k.length-1,ke=Te-1;for(;G<=ve&&G<=ke;){const Ie=k[G],Ue=I[G]=z?br(I[G]):ir(I[G]);if(ls(Ie,Ue))O(Ie,Ue,$,null,F,P,H,U,z);else break;G++}for(;G<=ve&&G<=ke;){const Ie=k[ve],Ue=I[ke]=z?br(I[ke]):ir(I[ke]);if(ls(Ie,Ue))O(Ie,Ue,$,null,F,P,H,U,z);else break;ve--,ke--}if(G>ve){if(G<=ke){const Ie=ke+1,Ue=Ie<Te?I[Ie].el:q;for(;G<=ke;)O(null,I[G]=z?br(I[G]):ir(I[G]),$,Ue,F,P,H,U,z),G++}}else if(G>ke)for(;G<=ve;)at(k[G],F,P,!0),G++;else{const Ie=G,Ue=G,tt=new Map;for(G=Ue;G<=ke;G++){const ut=I[G]=z?br(I[G]):ir(I[G]);ut.key!=null&&tt.set(ut.key,G)}let Qe,ct=0;const et=ke-Ue+1;let pt=!1,Je=0;const Ot=new Array(et);for(G=0;G<et;G++)Ot[G]=0;for(G=Ie;G<=ve;G++){const ut=k[G];if(ct>=et){at(ut,F,P,!0);continue}let ot;if(ut.key!=null)ot=tt.get(ut.key);else for(Qe=Ue;Qe<=ke;Qe++)if(Ot[Qe-Ue]===0&&ls(ut,I[Qe])){ot=Qe;break}ot===void 0?at(ut,F,P,!0):(Ot[ot-Ue]=G+1,ot>=Je?Je=ot:pt=!0,O(ut,I[ot],$,null,F,P,H,U,z),ct++)}const hn=pt?wm(Ot):Ss;for(Qe=hn.length-1,G=et-1;G>=0;G--){const ut=Ue+G,ot=I[ut],_t=I[ut+1],Pt=ut+1<Te?_t.el||uf(_t):q;Ot[G]===0?O(null,ot,$,Pt,F,P,H,U,z):pt&&(Qe<0||G!==hn[Qe]?Be(ot,$,Pt,2):Qe--)}}},Be=(k,I,$,q,F=null)=>{const{el:P,type:H,transition:U,children:z,shapeFlag:G}=k;if(G&6){Be(k.component.subTree,I,$,q);return}if(G&128){k.suspense.move(I,$,q);return}if(G&64){H.move(k,I,$,Ae);return}if(H===$e){r(P,I,$);for(let ve=0;ve<z.length;ve++)Be(z[ve],I,$,q);r(k.anchor,I,$);return}if(H===Qi){se(k,I,$);return}if(q!==2&&G&1&&U)if(q===0)U.beforeEnter(P),r(P,I,$),an(()=>U.enter(P),F);else{const{leave:ve,delayLeave:ke,afterLeave:Ie}=U,Ue=()=>{k.ctx.isUnmounted?s(P):r(P,I,$)},tt=()=>{P._isLeaving&&P[sr](!0),ve(P,()=>{Ue(),Ie&&Ie()})};ke?ke(P,Ue,tt):tt()}else r(P,I,$)},at=(k,I,$,q=!1,F=!1)=>{const{type:P,props:H,ref:U,children:z,dynamicChildren:G,shapeFlag:Te,patchFlag:ve,dirs:ke,cacheIndex:Ie}=k;if(ve===-2&&(F=!1),U!=null&&(Er(),oo(U,null,$,k,!0),Cr()),Ie!=null&&(I.renderCache[Ie]=void 0),Te&256){I.ctx.deactivate(k);return}const Ue=Te&1&&ke,tt=!Cs(k);let Qe;if(tt&&(Qe=H&&H.onVnodeBeforeUnmount)&&nr(Qe,I,k),Te&6)lt(k.component,$,q);else{if(Te&128){k.suspense.unmount($,q);return}Ue&&ts(k,null,I,"beforeUnmount"),Te&64?k.type.remove(k,I,$,Ae,q):G&&!G.hasOnce&&(P!==$e||ve>0&&ve&64)?Ve(G,I,$,!1,!0):(P===$e&&ve&384||!F&&Te&16)&&Ve(z,I,$),q&&Dt(k)}(tt&&(Qe=H&&H.onVnodeUnmounted)||Ue)&&an(()=>{Qe&&nr(Qe,I,k),Ue&&ts(k,null,I,"unmounted")},$)},Dt=k=>{const{type:I,el:$,anchor:q,transition:F}=k;if(I===$e){it($,q);return}if(I===Qi){ne(k);return}const P=()=>{s($),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(k.shapeFlag&1&&F&&!F.persisted){const{leave:H,delayLeave:U}=F,z=()=>H($,P);U?U(k.el,P,z):z()}else P()},it=(k,I)=>{let $;for(;k!==I;)$=b(k),s(k),k=$;s(I)},lt=(k,I,$)=>{const{bum:q,scope:F,job:P,subTree:H,um:U,m:z,a:G}=k;hc(z),hc(G),q&&Go(q),F.stop(),P&&(P.flags|=8,at(H,k,I,$)),U&&an(U,I),an(()=>{k.isUnmounted=!0},I)},Ve=(k,I,$,q=!1,F=!1,P=0)=>{for(let H=P;H<k.length;H++)at(k[H],I,$,q,F)},V=k=>{if(k.shapeFlag&6)return V(k.component.subTree);if(k.shapeFlag&128)return k.suspense.next();const I=b(k.anchor||k.el),$=I&&I[Ld];return $?b($):I};let be=!1;const fe=(k,I,$)=>{let q;k==null?I._vnode&&(at(I._vnode,null,null,!0),q=I._vnode.component):O(I._vnode||null,k,I,null,null,null,$),I._vnode=k,be||(be=!0,Xl(q),Md(),be=!1)},Ae={p:O,um:at,m:Be,r:Dt,mt:Ne,mc:Oe,pc:xe,pbc:X,n:V,o:e};return{render:fe,hydrate:void 0,createApp:nm(fe)}}function Yi({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 ns({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ym(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function wl(e,t,n=!1){const r=e.children,s=t.children;if(Ge(r)&&Ge(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]=br(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&wl(i,a)),a.type===xi&&(a.patchFlag===-1&&(a=s[o]=br(a)),a.el=i.el),a.type===cn&&!a.el&&(a.el=i.el)}}function wm(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 cf(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:cf(t)}function hc(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function uf(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?uf(t.subTree):null}const df=e=>e.__isSuspense;function bm(e,t){t&&t.pendingBranch?Ge(e)?t.effects.push(...e):t.effects.push(e):Cp(e)}const $e=Symbol.for("v-fgt"),xi=Symbol.for("v-txt"),cn=Symbol.for("v-cmt"),Qi=Symbol.for("v-stc"),ao=[];let Rn=null;function p(e=!1){ao.push(Rn=e?null:[])}function _m(){ao.pop(),Rn=ao[ao.length-1]||null}let go=1;function ci(e,t=!1){go+=e,e<0&&Rn&&t&&(Rn.hasOnce=!0)}function ff(e){return e.dynamicChildren=go>0?Rn||Ss:null,_m(),go>0&&Rn&&Rn.push(e),e}function w(e,t,n,r,s,o){return ff(y(e,t,n,r,s,o,!0))}function vt(e,t,n,r,s){return ff(De(e,t,n,r,s,!0))}function vo(e){return e?e.__v_isVNode===!0:!1}function ls(e,t){return e.type===t.type&&e.key===t.key}const hf=({key:e})=>e??null,Jo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Bt(e)||dn(e)||Ze(e)?{i:nn,r:e,k:t,f:!!n}:e:null);function y(e,t=null,n=null,r=0,s=null,o=e===$e?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&hf(t),ref:t&&Jo(t),scopeId:Od,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:nn};return a?(bl(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=Bt(n)?8:16),go>0&&!i&&Rn&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Rn.push(l),l}const De=km;function km(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===qd)&&(e=cn),vo(e)){const a=Yr(e,t,!0);return n&&bl(a,n),go>0&&!o&&Rn&&(a.shapeFlag&6?Rn[Rn.indexOf(e)]=a:Rn.push(a)),a.patchFlag=-2,a}if(Pm(e)&&(e=e.__vccOpts),t){t=Tm(t);let{class:a,style:l}=t;a&&!Bt(a)&&(t.class=ft(a)),It(l)&&(ml(l)&&!Ge(l)&&(l=Kt({},l)),t.style=qr(l))}const i=Bt(e)?1:df(e)?128:jd(e)?64:It(e)?4:Ze(e)?2:0;return y(e,t,n,r,s,i,o,!0)}function Tm(e){return e?ml(e)||nf(e)?Kt({},e):e:null}function Yr(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?pf(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&hf(d),ref:t&&t.ref?n&&o?Ge(o)?o.concat(Jo(t)):[o,Jo(t)]:Jo(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!==$e?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&&Yr(e.ssContent),ssFallback:e.ssFallback&&Yr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&mo(c,l.clone(c)),c}function yo(e=" ",t=0){return De(xi,null,e,t)}function ue(e="",t=!1){return t?(p(),vt(cn,null,e)):De(cn,null,e)}function ir(e){return e==null||typeof e=="boolean"?De(cn):Ge(e)?De($e,null,e.slice()):vo(e)?br(e):De(xi,null,String(e))}function br(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Yr(e)}function bl(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Ge(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),bl(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!nf(t)?t._ctx=nn:s===3&&nn&&(nn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ze(t)?(t={default:t,_ctx:nn},n=32):(t=String(t),r&64?(n=16,t=[yo(t)]):n=8);e.children=t,e.shapeFlag|=n}function pf(...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=ft([t.class,r.class]));else if(s==="style")t.style=qr([t.style,r.style]);else if(yi(s)){const o=t[s],i=r[s];i&&o!==i&&!(Ge(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function nr(e,t,n,r=null){Yn(e,t,7,[n,r])}const Sm=Qd();let Im=0;function Em(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Sm,o={uid:Im++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Qh(!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:sf(r,s),emitsOptions:Xd(r,s),emit:null,emitted:null,propsDefaults:xt,inheritAttrs:r.inheritAttrs,ctx:xt,data:xt,props:xt,attrs:xt,slots:xt,refs:xt,setupState:xt,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=sm.bind(null,o),e.ce&&e.ce(o),o}let un=null;const _l=()=>un||nn;let ui,ja;{const e=_i(),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)}};ui=t("__VUE_INSTANCE_SETTERS__",n=>un=n),ja=t("__VUE_SSR_SETTERS__",n=>wo=n)}const xo=e=>{const t=un;return ui(e),e.scope.on(),()=>{e.scope.off(),ui(t)}},pc=()=>{un&&un.scope.off(),ui(null)};function mf(e){return e.vnode.shapeFlag&4}let wo=!1;function Cm(e,t=!1,n=!1){t&&ja(t);const{props:r,children:s}=e.vnode,o=mf(e);um(e,r,o,t),pm(e,s,n||t);const i=o?Am(e,t):void 0;return t&&ja(!1),i}function Am(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,qp);const{setup:r}=n;if(r){Er();const s=e.setupContext=r.length>1?vf(e):null,o=xo(e),i=Ao(r,e,0,[e.props,s]),a=id(i);if(Cr(),o(),(a||e.sp)&&!Cs(e)&&zd(e),a){if(i.then(pc,pc),t)return i.then(l=>{mc(e,l)}).catch(l=>{Si(l,e,0)});e.asyncDep=i}else mc(e,i)}else gf(e)}function mc(e,t,n){Ze(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:It(t)&&(e.setupState=xd(t)),gf(e)}function gf(e,t,n){const r=e.type;e.render||(e.render=r.render||dr);{const s=xo(e);Er();try{Yp(e)}finally{Cr(),s()}}}const xm={get(e,t){return ln(e,"get",""),e[t]}};function vf(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,xm),slots:e.slots,emit:e.emit,expose:t}}function Ri(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(xd(vp(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in io)return io[n](e)},has(t,n){return n in t||n in io}})):e.proxy}function Rm(e,t=!0){return Ze(e)?e.displayName||e.name:e.name||t&&e.__name}function Pm(e){return Ze(e)&&"__vccOpts"in e}const pe=(e,t)=>kp(e,t,wo);function kl(e,t,n){try{ci(-1);const r=arguments.length;return r===2?It(t)&&!Ge(t)?vo(t)?De(e,null,[t]):De(e,t):De(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&vo(n)&&(n=[n]),De(e,t,n))}finally{ci(1)}}const Mm="3.5.30";/**
|
|
14
|
-
* @vue/runtime-dom v3.5.30
|
|
15
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
-
* @license MIT
|
|
17
|
-
**/let Ba;const gc=typeof window<"u"&&window.trustedTypes;if(gc)try{Ba=gc.createPolicy("vue",{createHTML:e=>e})}catch{}const yf=Ba?e=>Ba.createHTML(e):e=>e,$m="http://www.w3.org/2000/svg",Om="http://www.w3.org/1998/Math/MathML",wr=typeof document<"u"?document:null,vc=wr&&wr.createElement("template"),Nm={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"?wr.createElementNS($m,e):t==="mathml"?wr.createElementNS(Om,e):n?wr.createElement(e,{is:n}):wr.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>wr.createTextNode(e),createComment:e=>wr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>wr.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{vc.innerHTML=yf(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=vc.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Lr="transition",Js="animation",bo=Symbol("_vtc"),wf={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},Dm=Kt({},Fd,wf),Lm=e=>(e.displayName="Transition",e.props=Dm,e),bf=Lm((e,{slots:t})=>kl(Op,jm(e),t)),rs=(e,t=[])=>{Ge(e)?e.forEach(n=>n(...t)):e&&e(...t)},yc=e=>e?Ge(e)?e.some(t=>t.length>1):e.length>1:!1;function jm(e){const t={};for(const te in e)te in wf||(t[te]=e[te]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:d=i,appearToClass:c=a,leaveFromClass:h=`${n}-leave-from`,leaveActiveClass:b=`${n}-leave-active`,leaveToClass:T=`${n}-leave-to`}=e,N=Bm(s),O=N&&N[0],J=N&&N[1],{onBeforeEnter:ie,onEnter:L,onEnterCancelled:se,onLeave:ne,onLeaveCancelled:we,onBeforeAppear:ce=ie,onAppear:me=L,onAppearCancelled:Oe=se}=t,ae=(te,Me,Ne,qe)=>{te._enterCancelled=qe,ss(te,Me?c:a),ss(te,Me?d:i),Ne&&Ne()},X=(te,Me)=>{te._isLeaving=!1,ss(te,h),ss(te,T),ss(te,b),Me&&Me()},le=te=>(Me,Ne)=>{const qe=te?me:L,He=()=>ae(Me,te,Ne);rs(qe,[Me,He]),wc(()=>{ss(Me,te?l:o),vr(Me,te?c:a),yc(qe)||bc(Me,r,O,He)})};return Kt(t,{onBeforeEnter(te){rs(ie,[te]),vr(te,o),vr(te,i)},onBeforeAppear(te){rs(ce,[te]),vr(te,l),vr(te,d)},onEnter:le(!1),onAppear:le(!0),onLeave(te,Me){te._isLeaving=!0;const Ne=()=>X(te,Me);vr(te,h),te._enterCancelled?(vr(te,b),Tc(te)):(Tc(te),vr(te,b)),wc(()=>{te._isLeaving&&(ss(te,h),vr(te,T),yc(ne)||bc(te,r,J,Ne))}),rs(ne,[te,Ne])},onEnterCancelled(te){ae(te,!1,void 0,!0),rs(se,[te])},onAppearCancelled(te){ae(te,!0,void 0,!0),rs(Oe,[te])},onLeaveCancelled(te){X(te),rs(we,[te])}})}function Bm(e){if(e==null)return null;if(It(e))return[Xi(e.enter),Xi(e.leave)];{const t=Xi(e);return[t,t]}}function Xi(e){return Vh(e)}function vr(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[bo]||(e[bo]=new Set)).add(t)}function ss(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[bo];n&&(n.delete(t),n.size||(e[bo]=void 0))}function wc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Fm=0;function bc(e,t,n,r){const s=e._endId=++Fm,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=Um(e,t);if(!i)return r();const d=i+"end";let c=0;const h=()=>{e.removeEventListener(d,b),o()},b=T=>{T.target===e&&++c>=l&&h()};setTimeout(()=>{c<l&&h()},a+1),e.addEventListener(d,b)}function Um(e,t){const n=window.getComputedStyle(e),r=N=>(n[N]||"").split(", "),s=r(`${Lr}Delay`),o=r(`${Lr}Duration`),i=_c(s,o),a=r(`${Js}Delay`),l=r(`${Js}Duration`),d=_c(a,l);let c=null,h=0,b=0;t===Lr?i>0&&(c=Lr,h=i,b=o.length):t===Js?d>0&&(c=Js,h=d,b=l.length):(h=Math.max(i,d),c=h>0?i>d?Lr:Js:null,b=c?c===Lr?o.length:l.length:0);const T=c===Lr&&/\b(?:transform|all)(?:,|$)/.test(r(`${Lr}Property`).toString());return{type:c,timeout:h,propCount:b,hasTransform:T}}function _c(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>kc(n)+kc(e[r])))}function kc(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Tc(e){return(e?e.ownerDocument:document).body.offsetHeight}function Hm(e,t,n){const r=e[bo];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Sc=Symbol("_vod"),Vm=Symbol("_vsh"),Wm=Symbol(""),zm=/(?:^|;)\s*display\s*:/;function Gm(e,t,n){const r=e.style,s=Bt(n);let o=!1;if(n&&!s){if(t)if(Bt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Yo(r,a,"")}else for(const i in t)n[i]==null&&Yo(r,i,"");for(const i in n)i==="display"&&(o=!0),Yo(r,i,n[i])}else if(s){if(t!==n){const i=r[Wm];i&&(n+=";"+i),r.cssText=n,o=zm.test(n)}}else t&&e.removeAttribute("style");Sc in e&&(e[Sc]=o?r.display:"",e[Vm]&&(r.display="none"))}const Ic=/\s*!important$/;function Yo(e,t,n){if(Ge(n))n.forEach(r=>Yo(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=qm(e,t);Ic.test(n)?e.setProperty(Qr(r),n.replace(Ic,""),"important"):e[r]=n}}const Ec=["Webkit","Moz","ms"],Zi={};function qm(e,t){const n=Zi[t];if(n)return n;let r=wn(t);if(r!=="filter"&&r in e)return Zi[t]=r;r=bi(r);for(let s=0;s<Ec.length;s++){const o=Ec[s]+r;if(o in e)return Zi[t]=o}return t}const Cc="http://www.w3.org/1999/xlink";function Ac(e,t,n,r,s,o=Jh(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Cc,t.slice(6,t.length)):e.setAttributeNS(Cc,t,n):n==null||o&&!ud(n)?e.removeAttribute(t):e.setAttribute(t,o?"":Kn(n)?String(n):n)}function xc(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?yf(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=ud(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 ks(e,t,n,r){e.addEventListener(t,n,r)}function Km(e,t,n,r){e.removeEventListener(t,n,r)}const Rc=Symbol("_vei");function Jm(e,t,n,r,s=null){const o=e[Rc]||(e[Rc]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=Ym(t);if(r){const d=o[t]=Zm(r,s);ks(e,a,d,l)}else i&&(Km(e,a,i,l),o[t]=void 0)}}const Pc=/(?:Once|Passive|Capture)$/;function Ym(e){let t;if(Pc.test(e)){t={};let r;for(;r=e.match(Pc);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Qr(e.slice(2)),t]}let ea=0;const Qm=Promise.resolve(),Xm=()=>ea||(Qm.then(()=>ea=0),ea=Date.now());function Zm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Yn(eg(r,n.value),t,5,[r])};return n.value=e,n.attached=Xm(),n}function eg(e,t){if(Ge(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 Mc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,tg=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?Hm(e,r,i):t==="style"?Gm(e,n,r):yi(t)?sl(t)||Jm(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ng(e,t,r,i))?(xc(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Ac(e,t,r,i,o,t!=="value")):e._isVueCE&&(rg(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Bt(r)))?xc(e,wn(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Ac(e,t,r,i))};function ng(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Mc(t)&&Ze(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Mc(t)&&Bt(n)?!1:t in e}function rg(e,t){const n=e._def.props;if(!n)return!1;const r=wn(t);return Array.isArray(n)?n.some(s=>wn(s)===r):Object.keys(n).some(s=>wn(s)===r)}const $c=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ge(t)?n=>Go(t,n):t};function sg(e){e.target.composing=!0}function Oc(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ta=Symbol("_assign");function Nc(e,t,n){return t&&(e=e.trim()),n&&(e=al(e)),e}const Rr={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[ta]=$c(s);const o=r||s.props&&s.props.type==="number";ks(e,t?"change":"input",i=>{i.target.composing||e[ta](Nc(e.value,n,o))}),(n||o)&&ks(e,"change",()=>{e.value=Nc(e.value,n,o)}),t||(ks(e,"compositionstart",sg),ks(e,"compositionend",Oc),ks(e,"change",Oc))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[ta]=$c(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?al(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))}},og=["ctrl","shift","alt","meta"],ig={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)=>og.some(n=>e[`${n}Key`]&&!t.includes(n))},wt=(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=ig[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},ag={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},yn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Qr(s.key);if(t.some(i=>i===o||ag[i]===o))return e(s)}))},lg=Kt({patchProp:tg},Nm);let Dc;function cg(){return Dc||(Dc=gm(lg))}const ug=((...e)=>{const t=cg().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=fg(r);if(!s)return;const o=t._component;!Ze(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,dg(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function dg(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function fg(e){return Bt(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 _f(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function hg(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&_f(e.default)}const Tt=Object.assign;function na(e,t){const n={};for(const r in t){const s=t[r];n[r]=Qn(s)?s.map(e):e(s)}return n}const lo=()=>{},Qn=Array.isArray;function Lc(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const kf=/#/g,pg=/&/g,mg=/\//g,gg=/=/g,vg=/\?/g,Tf=/\+/g,yg=/%5B/g,wg=/%5D/g,Sf=/%5E/g,bg=/%60/g,If=/%7B/g,_g=/%7C/g,Ef=/%7D/g,kg=/%20/g;function Tl(e){return e==null?"":encodeURI(""+e).replace(_g,"|").replace(yg,"[").replace(wg,"]")}function Tg(e){return Tl(e).replace(If,"{").replace(Ef,"}").replace(Sf,"^")}function Fa(e){return Tl(e).replace(Tf,"%2B").replace(kg,"+").replace(kf,"%23").replace(pg,"%26").replace(bg,"`").replace(If,"{").replace(Ef,"}").replace(Sf,"^")}function Sg(e){return Fa(e).replace(gg,"%3D")}function Ig(e){return Tl(e).replace(kf,"%23").replace(vg,"%3F")}function Eg(e){return Ig(e).replace(mg,"%2F")}function _o(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Cg=/\/$/,Ag=e=>e.replace(Cg,"");function ra(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=Mg(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:_o(i)}}function xg(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function jc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Rg(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Os(t.matched[r],n.matched[s])&&Cf(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Os(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Cf(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Pg(e[n],t[n]))return!1;return!0}function Pg(e,t){return Qn(e)?Bc(e,t):Qn(t)?Bc(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Bc(e,t){return Qn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Mg(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 jr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ua=(function(e){return e.pop="pop",e.push="push",e})({}),sa=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function $g(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 Og=/^[^#]+#/;function Ng(e,t){return e.replace(Og,"#")+t}function Dg(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 Pi=()=>({left:window.scrollX,top:window.scrollY});function Lg(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=Dg(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 Fc(e,t){return(history.state?history.state.position-t:-1)+e}const Ha=new Map;function jg(e,t){Ha.set(e,t)}function Bg(e){const t=Ha.get(e);return Ha.delete(e),t}function Fg(e){return typeof e=="string"||e&&typeof e=="object"}function Af(e){return typeof e=="string"||typeof e=="symbol"}let Ut=(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 xf=Symbol("");Ut.MATCHER_NOT_FOUND+"",Ut.NAVIGATION_GUARD_REDIRECT+"",Ut.NAVIGATION_ABORTED+"",Ut.NAVIGATION_CANCELLED+"",Ut.NAVIGATION_DUPLICATED+"";function Ns(e,t){return Tt(new Error,{type:e,[xf]:!0},t)}function yr(e,t){return e instanceof Error&&xf in e&&(t==null||!!(e.type&t))}const Ug=["params","query","hash"];function Hg(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Ug)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Vg(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(Tf," "),o=s.indexOf("="),i=_o(o<0?s:s.slice(0,o)),a=o<0?null:_o(s.slice(o+1));if(i in t){let l=t[i];Qn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function Uc(e){let t="";for(let n in e){const r=e[n];if(n=Sg(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Qn(r)?r.map(s=>s&&Fa(s)):[r&&Fa(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function Wg(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Qn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const zg=Symbol(""),Hc=Symbol(""),Mi=Symbol(""),Sl=Symbol(""),Va=Symbol("");function Ys(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Hr(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const d=b=>{b===!1?l(Ns(Ut.NAVIGATION_ABORTED,{from:n,to:t})):b instanceof Error?l(b):Fg(b)?l(Ns(Ut.NAVIGATION_GUARD_REDIRECT,{from:t,to:b})):(i&&r.enterCallbacks[s]===i&&typeof b=="function"&&i.push(b),a())},c=o(()=>e.call(r&&r.instances[s],t,n,d));let h=Promise.resolve(c);e.length<3&&(h=h.then(d)),h.catch(b=>l(b))})}function oa(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(_f(l)){const d=(l.__vccOpts||l)[t];d&&o.push(Hr(d,n,r,i,a,s))}else{let d=l();o.push(()=>d.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const h=hg(c)?c.default:c;i.mods[a]=c,i.components[a]=h;const b=(h.__vccOpts||h)[t];return b&&Hr(b,n,r,i,a,s)()}))}}return o}function Gg(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=>Os(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>Os(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 qg=()=>location.protocol+"//"+location.host;function Rf(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),jc(a,"")}return jc(n,e)+r+s}function Kg(e,t,n,r){let s=[],o=[],i=null;const a=({state:b})=>{const T=Rf(e,location),N=n.value,O=t.value;let J=0;if(b){if(n.value=T,t.value=b,i&&i===N){i=null;return}J=O?b.position-O.position:0}else r(T);s.forEach(ie=>{ie(n.value,N,{delta:J,type:Ua.pop,direction:J?J>0?sa.forward:sa.back:sa.unknown})})};function l(){i=n.value}function d(b){s.push(b);const T=()=>{const N=s.indexOf(b);N>-1&&s.splice(N,1)};return o.push(T),T}function c(){if(document.visibilityState==="hidden"){const{history:b}=window;if(!b.state)return;b.replaceState(Tt({},b.state,{scroll:Pi()}),"")}}function h(){for(const b of o)b();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:d,destroy:h}}function Vc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?Pi():null}}function Jg(e){const{history:t,location:n}=window,r={value:Rf(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(l,d,c){const h=e.indexOf("#"),b=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+l:qg()+e+l;try{t[c?"replaceState":"pushState"](d,"",b),s.value=d}catch(T){console.error(T),n[c?"replace":"assign"](b)}}function i(l,d){o(l,Tt({},t.state,Vc(s.value.back,l,s.value.forward,!0),d,{position:s.value.position}),!0),r.value=l}function a(l,d){const c=Tt({},s.value,t.state,{forward:l,scroll:Pi()});o(c.current,c,!0),o(l,Tt({},Vc(r.value,l,null),{position:c.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function Yg(e){e=$g(e);const t=Jg(e),n=Kg(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=Tt({location:"",base:e,go:r,createHref:Ng.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 Qg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Yg(e)}let us=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Gt=(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})(Gt||{});const Xg={type:us.Static,value:""},Zg=/[a-zA-Z0-9_]/;function ev(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=Gt.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",c="";function h(){d&&(n===Gt.Static?o.push({type:us.Static,value:d}):n===Gt.Param||n===Gt.ParamRegExp||n===Gt.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:us.Param,value:d,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),d="")}function b(){d+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Gt.ParamRegExp){r=n,n=Gt.EscapeNext;continue}switch(n){case Gt.Static:l==="/"?(d&&h(),i()):l===":"?(h(),n=Gt.Param):b();break;case Gt.EscapeNext:b(),n=r;break;case Gt.Param:l==="("?n=Gt.ParamRegExp:Zg.test(l)?b():(h(),n=Gt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Gt.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=Gt.ParamRegExpEnd:c+=l;break;case Gt.ParamRegExpEnd:h(),n=Gt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Gt.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),h(),i(),s}const Wc="[^/]+?",tv={sensitive:!1,strict:!1,start:!0,end:!0};var gn=(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})(gn||{});const nv=/[.+*?^${}()[\]/\\]/g;function rv(e,t){const n=Tt({},tv,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const c=d.length?[]:[gn.Root];n.strict&&!d.length&&(s+="/");for(let h=0;h<d.length;h++){const b=d[h];let T=gn.Segment+(n.sensitive?gn.BonusCaseSensitive:0);if(b.type===us.Static)h||(s+="/"),s+=b.value.replace(nv,"\\$&"),T+=gn.Static;else if(b.type===us.Param){const{value:N,repeatable:O,optional:J,regexp:ie}=b;o.push({name:N,repeatable:O,optional:J});const L=ie||Wc;if(L!==Wc){T+=gn.BonusCustomRegExp;try{`${L}`}catch(ne){throw new Error(`Invalid custom RegExp for param "${N}" (${L}): `+ne.message)}}let se=O?`((?:${L})(?:/(?:${L}))*)`:`(${L})`;h||(se=J&&d.length<2?`(?:/${se})`:"/"+se),J&&(se+="?"),s+=se,T+=gn.Dynamic,J&&(T+=gn.BonusOptional),O&&(T+=gn.BonusRepeatable),L===".*"&&(T+=gn.BonusWildcard)}c.push(T)}r.push(c)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=gn.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(d){const c=d.match(i),h={};if(!c)return null;for(let b=1;b<c.length;b++){const T=c[b]||"",N=o[b-1];h[N.name]=T&&N.repeatable?T.split("/"):T}return h}function l(d){let c="",h=!1;for(const b of e){(!h||!c.endsWith("/"))&&(c+="/"),h=!1;for(const T of b)if(T.type===us.Static)c+=T.value;else if(T.type===us.Param){const{value:N,repeatable:O,optional:J}=T,ie=N in d?d[N]:"";if(Qn(ie)&&!O)throw new Error(`Provided param "${N}" is an array but it is not repeatable (* or + modifiers)`);const L=Qn(ie)?ie.join("/"):ie;if(!L)if(J)b.length<2&&(c.endsWith("/")?c=c.slice(0,-1):h=!0);else throw new Error(`Missing required param "${N}"`);c+=L}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function sv(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]===gn.Static+gn.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===gn.Static+gn.Segment?1:-1:0}function Pf(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=sv(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(zc(r))return 1;if(zc(s))return-1}return s.length-r.length}function zc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const ov={strict:!1,end:!0,sensitive:!1};function iv(e,t,n){const r=rv(ev(e.path),n),s=Tt(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function av(e,t){const n=[],r=new Map;t=Lc(ov,t);function s(h){return r.get(h)}function o(h,b,T){const N=!T,O=qc(h);O.aliasOf=T&&T.record;const J=Lc(t,h),ie=[O];if("alias"in h){const ne=typeof h.alias=="string"?[h.alias]:h.alias;for(const we of ne)ie.push(qc(Tt({},O,{components:T?T.record.components:O.components,path:we,aliasOf:T?T.record:O})))}let L,se;for(const ne of ie){const{path:we}=ne;if(b&&we[0]!=="/"){const ce=b.record.path,me=ce[ce.length-1]==="/"?"":"/";ne.path=b.record.path+(we&&me+we)}if(L=iv(ne,b,J),T?T.alias.push(L):(se=se||L,se!==L&&se.alias.push(L),N&&h.name&&!Kc(L)&&i(h.name)),Mf(L)&&l(L),O.children){const ce=O.children;for(let me=0;me<ce.length;me++)o(ce[me],L,T&&T.children[me])}T=T||L}return se?()=>{i(se)}:lo}function i(h){if(Af(h)){const b=r.get(h);b&&(r.delete(h),n.splice(n.indexOf(b),1),b.children.forEach(i),b.alias.forEach(i))}else{const b=n.indexOf(h);b>-1&&(n.splice(b,1),h.record.name&&r.delete(h.record.name),h.children.forEach(i),h.alias.forEach(i))}}function a(){return n}function l(h){const b=uv(h,n);n.splice(b,0,h),h.record.name&&!Kc(h)&&r.set(h.record.name,h)}function d(h,b){let T,N={},O,J;if("name"in h&&h.name){if(T=r.get(h.name),!T)throw Ns(Ut.MATCHER_NOT_FOUND,{location:h});J=T.record.name,N=Tt(Gc(b.params,T.keys.filter(se=>!se.optional).concat(T.parent?T.parent.keys.filter(se=>se.optional):[]).map(se=>se.name)),h.params&&Gc(h.params,T.keys.map(se=>se.name))),O=T.stringify(N)}else if(h.path!=null)O=h.path,T=n.find(se=>se.re.test(O)),T&&(N=T.parse(O),J=T.record.name);else{if(T=b.name?r.get(b.name):n.find(se=>se.re.test(b.path)),!T)throw Ns(Ut.MATCHER_NOT_FOUND,{location:h,currentLocation:b});J=T.record.name,N=Tt({},b.params,h.params),O=T.stringify(N)}const ie=[];let L=T;for(;L;)ie.unshift(L.record),L=L.parent;return{name:J,path:O,params:N,matched:ie,meta:cv(ie)}}e.forEach(h=>o(h));function c(){n.length=0,r.clear()}return{addRoute:o,resolve:d,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function Gc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function qc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:lv(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 lv(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 Kc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function cv(e){return e.reduce((t,n)=>Tt(t,n.meta),{})}function uv(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Pf(e,t[o])<0?r=o:n=o+1}const s=dv(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function dv(e){let t=e;for(;t=t.parent;)if(Mf(t)&&Pf(e,t)===0)return t}function Mf({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Jc(e){const t=Gn(Mi),n=Gn(Sl),r=pe(()=>{const l=ye(e.to);return t.resolve(l)}),s=pe(()=>{const{matched:l}=r.value,{length:d}=l,c=l[d-1],h=n.matched;if(!c||!h.length)return-1;const b=h.findIndex(Os.bind(null,c));if(b>-1)return b;const T=Yc(l[d-2]);return d>1&&Yc(c)===T&&h[h.length-1].path!==T?h.findIndex(Os.bind(null,l[d-2])):b}),o=pe(()=>s.value>-1&&gv(n.params,r.value.params)),i=pe(()=>s.value>-1&&s.value===n.matched.length-1&&Cf(n.params,r.value.params));function a(l={}){if(mv(l)){const d=t[ye(e.replace)?"replace":"push"](ye(e.to)).catch(lo);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:r,href:pe(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function fv(e){return e.length===1?e[0]:e}const hv=Zt({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:Jc,setup(e,{slots:t}){const n=Ti(Jc(e)),{options:r}=Gn(Mi),s=pe(()=>({[Qc(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Qc(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&fv(t.default(n));return e.custom?o:kl("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),pv=hv;function mv(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 gv(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(!Qn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Yc(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Qc=(e,t,n)=>e??t??n,vv=Zt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Gn(Va),s=pe(()=>e.route||r.value),o=Gn(Hc,0),i=pe(()=>{let d=ye(o);const{matched:c}=s.value;let h;for(;(h=c[d])&&!h.components;)d++;return d}),a=pe(()=>s.value.matched[i.value]);qo(Hc,pe(()=>i.value+1)),qo(zg,a),qo(Va,s);const l=D();return mt(()=>[l.value,a.value,e.name],([d,c,h],[b,T,N])=>{c&&(c.instances[h]=d,T&&T!==c&&d&&d===b&&(c.leaveGuards.size||(c.leaveGuards=T.leaveGuards),c.updateGuards.size||(c.updateGuards=T.updateGuards))),d&&c&&(!T||!Os(c,T)||!b)&&(c.enterCallbacks[h]||[]).forEach(O=>O(d))},{flush:"post"}),()=>{const d=s.value,c=e.name,h=a.value,b=h&&h.components[c];if(!b)return Xc(n.default,{Component:b,route:d});const T=h.props[c],N=T?T===!0?d.params:typeof T=="function"?T(d):T:null,J=kl(b,Tt({},N,t,{onVnodeUnmounted:ie=>{ie.component.isUnmounted&&(h.instances[c]=null)},ref:l}));return Xc(n.default,{Component:J,route:d})||J}}});function Xc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const yv=vv;function wv(e){const t=av(e.routes,e),n=e.parseQuery||Vg,r=e.stringifyQuery||Uc,s=e.history,o=Ys(),i=Ys(),a=Ys(),l=yp(jr);let d=jr;Ts&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=na.bind(null,V=>""+V),h=na.bind(null,Eg),b=na.bind(null,_o);function T(V,be){let fe,Ae;return Af(V)?(fe=t.getRecordMatcher(V),Ae=be):Ae=V,t.addRoute(Ae,fe)}function N(V){const be=t.getRecordMatcher(V);be&&t.removeRoute(be)}function O(){return t.getRoutes().map(V=>V.record)}function J(V){return!!t.getRecordMatcher(V)}function ie(V,be){if(be=Tt({},be||l.value),typeof V=="string"){const $=ra(n,V,be.path),q=t.resolve({path:$.path},be),F=s.createHref($.fullPath);return Tt($,q,{params:b(q.params),hash:_o($.hash),redirectedFrom:void 0,href:F})}let fe;if(V.path!=null)fe=Tt({},V,{path:ra(n,V.path,be.path).path});else{const $=Tt({},V.params);for(const q in $)$[q]==null&&delete $[q];fe=Tt({},V,{params:h($)}),be.params=h(be.params)}const Ae=t.resolve(fe,be),Re=V.hash||"";Ae.params=c(b(Ae.params));const k=xg(r,Tt({},V,{hash:Tg(Re),path:Ae.path})),I=s.createHref(k);return Tt({fullPath:k,hash:Re,query:r===Uc?Wg(V.query):V.query||{}},Ae,{redirectedFrom:void 0,href:I})}function L(V){return typeof V=="string"?ra(n,V,l.value.path):Tt({},V)}function se(V,be){if(d!==V)return Ns(Ut.NAVIGATION_CANCELLED,{from:be,to:V})}function ne(V){return me(V)}function we(V){return ne(Tt(L(V),{replace:!0}))}function ce(V,be){const fe=V.matched[V.matched.length-1];if(fe&&fe.redirect){const{redirect:Ae}=fe;let Re=typeof Ae=="function"?Ae(V,be):Ae;return typeof Re=="string"&&(Re=Re.includes("?")||Re.includes("#")?Re=L(Re):{path:Re},Re.params={}),Tt({query:V.query,hash:V.hash,params:Re.path!=null?{}:V.params},Re)}}function me(V,be){const fe=d=ie(V),Ae=l.value,Re=V.state,k=V.force,I=V.replace===!0,$=ce(fe,Ae);if($)return me(Tt(L($),{state:typeof $=="object"?Tt({},Re,$.state):Re,force:k,replace:I}),be||fe);const q=fe;q.redirectedFrom=be;let F;return!k&&Rg(r,Ae,fe)&&(F=Ns(Ut.NAVIGATION_DUPLICATED,{to:q,from:Ae}),Be(Ae,Ae,!0,!1)),(F?Promise.resolve(F):X(q,Ae)).catch(P=>yr(P)?yr(P,Ut.NAVIGATION_GUARD_REDIRECT)?P:ze(P):xe(P,q,Ae)).then(P=>{if(P){if(yr(P,Ut.NAVIGATION_GUARD_REDIRECT))return me(Tt({replace:I},L(P.to),{state:typeof P.to=="object"?Tt({},Re,P.to.state):Re,force:k}),be||q)}else P=te(q,Ae,!0,I,Re);return le(q,Ae,P),P})}function Oe(V,be){const fe=se(V,be);return fe?Promise.reject(fe):Promise.resolve()}function ae(V){const be=it.values().next().value;return be&&typeof be.runWithContext=="function"?be.runWithContext(V):V()}function X(V,be){let fe;const[Ae,Re,k]=Gg(V,be);fe=oa(Ae.reverse(),"beforeRouteLeave",V,be);for(const $ of Ae)$.leaveGuards.forEach(q=>{fe.push(Hr(q,V,be))});const I=Oe.bind(null,V,be);return fe.push(I),Ve(fe).then(()=>{fe=[];for(const $ of o.list())fe.push(Hr($,V,be));return fe.push(I),Ve(fe)}).then(()=>{fe=oa(Re,"beforeRouteUpdate",V,be);for(const $ of Re)$.updateGuards.forEach(q=>{fe.push(Hr(q,V,be))});return fe.push(I),Ve(fe)}).then(()=>{fe=[];for(const $ of k)if($.beforeEnter)if(Qn($.beforeEnter))for(const q of $.beforeEnter)fe.push(Hr(q,V,be));else fe.push(Hr($.beforeEnter,V,be));return fe.push(I),Ve(fe)}).then(()=>(V.matched.forEach($=>$.enterCallbacks={}),fe=oa(k,"beforeRouteEnter",V,be,ae),fe.push(I),Ve(fe))).then(()=>{fe=[];for(const $ of i.list())fe.push(Hr($,V,be));return fe.push(I),Ve(fe)}).catch($=>yr($,Ut.NAVIGATION_CANCELLED)?$:Promise.reject($))}function le(V,be,fe){a.list().forEach(Ae=>ae(()=>Ae(V,be,fe)))}function te(V,be,fe,Ae,Re){const k=se(V,be);if(k)return k;const I=be===jr,$=Ts?history.state:{};fe&&(Ae||I?s.replace(V.fullPath,Tt({scroll:I&&$&&$.scroll},Re)):s.push(V.fullPath,Re)),l.value=V,Be(V,be,fe,I),ze()}let Me;function Ne(){Me||(Me=s.listen((V,be,fe)=>{if(!lt.listening)return;const Ae=ie(V),Re=ce(Ae,lt.currentRoute.value);if(Re){me(Tt(Re,{replace:!0,force:!0}),Ae).catch(lo);return}d=Ae;const k=l.value;Ts&&jg(Fc(k.fullPath,fe.delta),Pi()),X(Ae,k).catch(I=>yr(I,Ut.NAVIGATION_ABORTED|Ut.NAVIGATION_CANCELLED)?I:yr(I,Ut.NAVIGATION_GUARD_REDIRECT)?(me(Tt(L(I.to),{force:!0}),Ae).then($=>{yr($,Ut.NAVIGATION_ABORTED|Ut.NAVIGATION_DUPLICATED)&&!fe.delta&&fe.type===Ua.pop&&s.go(-1,!1)}).catch(lo),Promise.reject()):(fe.delta&&s.go(-fe.delta,!1),xe(I,Ae,k))).then(I=>{I=I||te(Ae,k,!1),I&&(fe.delta&&!yr(I,Ut.NAVIGATION_CANCELLED)?s.go(-fe.delta,!1):fe.type===Ua.pop&&yr(I,Ut.NAVIGATION_ABORTED|Ut.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),le(Ae,k,I)}).catch(lo)}))}let qe=Ys(),He=Ys(),Fe;function xe(V,be,fe){ze(V);const Ae=He.list();return Ae.length?Ae.forEach(Re=>Re(V,be,fe)):console.error(V),Promise.reject(V)}function nt(){return Fe&&l.value!==jr?Promise.resolve():new Promise((V,be)=>{qe.add([V,be])})}function ze(V){return Fe||(Fe=!V,Ne(),qe.list().forEach(([be,fe])=>V?fe(V):be()),qe.reset()),V}function Be(V,be,fe,Ae){const{scrollBehavior:Re}=e;if(!Ts||!Re)return Promise.resolve();const k=!fe&&Bg(Fc(V.fullPath,0))||(Ae||!fe)&&history.state&&history.state.scroll||null;return qt().then(()=>Re(V,be,k)).then(I=>I&&Lg(I)).catch(I=>xe(I,V,be))}const at=V=>s.go(V);let Dt;const it=new Set,lt={currentRoute:l,listening:!0,addRoute:T,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:J,getRoutes:O,resolve:ie,options:e,push:ne,replace:we,go:at,back:()=>at(-1),forward:()=>at(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:He.add,isReady:nt,install(V){V.component("RouterLink",pv),V.component("RouterView",yv),V.config.globalProperties.$router=lt,Object.defineProperty(V.config.globalProperties,"$route",{enumerable:!0,get:()=>ye(l)}),Ts&&!Dt&&l.value===jr&&(Dt=!0,ne(s.location).catch(Ae=>{}));const be={};for(const Ae in jr)Object.defineProperty(be,Ae,{get:()=>l.value[Ae],enumerable:!0});V.provide(Mi,lt),V.provide(Sl,Cd(be)),V.provide(Va,l);const fe=V.unmount;it.add(V),V.unmount=function(){it.delete(V),it.size<1&&(d=jr,Me&&Me(),Me=null,l.value=jr,Dt=!1,Fe=!1),fe()}}};function Ve(V){return V.reduce((be,fe)=>be.then(()=>ae(fe)),Promise.resolve())}return lt}function bv(){return Gn(Mi)}function _v(e){return Gn(Sl)}const Zc=768;function $f(){const e=D(typeof window<"u"?window.innerWidth<Zc:!1);let t=null;function n(r){e.value=r.matches}return Or(()=>{t=window.matchMedia(`(max-width: ${Zc-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),Ci(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const kv={key:0,class:"desktop-sidebar"},Tv={class:"desktop-main"},eu="codex-web-local.sidebar-width.v1",Sv=260,Iv=620,tu=320,Ev=Zt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=$f();function r(d){return Math.min(Iv,Math.max(Sv,d))}function s(){if(typeof window>"u")return tu;const d=window.localStorage.getItem(eu),c=Number(d);return Number.isFinite(c)?r(c):tu}const o=D(s()),i=pe(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${o.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(d){typeof window>"u"||window.localStorage.setItem(eu,String(d))}function l(d){d.preventDefault();const c=d.clientX,h=o.value,b=N=>{const O=N.clientX-c;o.value=r(h+O)},T=()=>{a(o.value),window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",T)};window.addEventListener("mousemove",b),window.addEventListener("mouseup",T)}return(d,c)=>(p(),w("div",{class:ft(["desktop-layout",{"is-mobile":ye(n)}]),style:qr(i.value)},[ye(n)?(p(),vt(so,{key:0,to:"body"},[De(bf,{name:"drawer"},{default:kt(()=>[e.isSidebarCollapsed?ue("",!0):(p(),w("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=h=>d.$emit("close-sidebar"))},[y("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=wt(()=>{},["stop"]))},[ur(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ue("",!0),ye(n)?ue("",!0):(p(),w($e,{key:1},[e.isSidebarCollapsed?ue("",!0):(p(),w("aside",kv,[ur(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?ue("",!0):(p(),w("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),y("section",Tv,[ur(d.$slots,"content",{},void 0)])],6))}}),ht=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Cv=ht(Ev,[["__scopeId","data-v-068d06c5"]]),Av={},xv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Rv(e,t){return p(),w("svg",xv,[...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 $i=ht(Av,[["render",Rv]]),Pv={},Mv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function $v(e,t){return p(),w("svg",Mv,[...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 Of=ht(Pv,[["render",$v]]),Ov={},Nv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Dv(e,t){return p(),w("svg",Nv,[...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 Qs=ht(Ov,[["render",Dv]]),Lv={},jv={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Bv(e,t){return p(),w("svg",jv,[...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 di=ht(Lv,[["render",Bv]]),Fv={},Uv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Hv(e,t){return p(),w("svg",Uv,[...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 Il=ht(Fv,[["render",Hv]]),Vv={},Wv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function zv(e,t){return p(),w("svg",Wv,[...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 Gv=ht(Vv,[["render",zv]]),qv={},Kv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Jv(e,t){return p(),w("svg",Kv,[...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 Qo=ht(qv,[["render",Jv]]),Yv={},Qv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Xv(e,t){return p(),w("svg",Qv,[...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 ia=ht(Yv,[["render",Xv]]),Zv={key:0,class:"sidebar-menu-row-left"},ey={class:"sidebar-menu-row-main"},ty={key:1,class:"sidebar-menu-row-right"},ny={key:0,class:"sidebar-menu-row-right-default"},ry={key:1,class:"sidebar-menu-row-right-hover"},sy=Zt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=Kp(),r=pe(()=>!!n.left),s=pe(()=>!!n.right),o=pe(()=>!!n["right-hover"]),i=pe(()=>s.value||o.value);return(a,l)=>(p(),vt(ai(t.as),pf({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:kt(()=>[r.value?(p(),w("span",Zv,[ur(a.$slots,"left",{},void 0,!0)])):ue("",!0),y("span",ey,[ur(a.$slots,"default",{},void 0,!0)]),i.value?(p(),w("span",ty,[s.value?(p(),w("span",ny,[ur(a.$slots,"right",{},void 0,!0)])):ue("",!0),o.value?(p(),w("span",ry,[ur(a.$slots,"right-hover",{},void 0,!0)])):ue("",!0)])):ue("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),os=ht(sy,[["__scopeId","data-v-36239f39"]]),oy={class:"thread-tree-root"},iy={key:0,class:"pinned-section"},ay={class:"thread-list"},ly=["data-menu-open"],cy={class:"thread-left-stack"},uy=["data-state"],dy=["onClick"],fy=["onClick"],hy={class:"thread-row-title-wrap"},py={class:"thread-row-title"},my={class:"thread-row-time"},gy=["onClick"],vy=["aria-expanded"],yy=["data-active"],wy={key:0},by=["data-active"],_y={key:0},ky={key:1,class:"thread-tree-no-results"},Ty={key:2,class:"thread-tree-loading"},Sy={key:3,class:"thread-list thread-list-global"},Iy=["data-menu-open"],Ey={class:"thread-left-stack"},Cy=["data-state"],Ay=["onClick"],xy=["onClick"],Ry={class:"thread-row-title-wrap"},Py={class:"thread-row-title"},My={class:"thread-row-time"},$y=["onClick"],Oy=["data-project-name","data-expanded","data-dragging"],Ny={class:"project-icon-stack"},Dy={class:"project-icon-folder"},Ly={class:"project-icon-chevron"},jy=["data-dragging-handle","onMousedown"],By={class:"project-title"},Fy={class:"project-hover-controls"},Uy=["onClick"],Hy=["data-open-direction"],Vy=["onClick"],Wy=["onClick"],zy=["onClick"],Gy=["onInput"],qy=["aria-label","title","onClick"],Ky={key:0,class:"thread-list"},Jy=["data-menu-open"],Yy={class:"thread-left-stack"},Qy=["data-state"],Xy=["onClick"],Zy=["onClick"],ew={class:"thread-row-title-wrap"},tw={class:"thread-row-title"},nw={class:"thread-row-time"},rw=["onClick"],sw=["onClick"],ow=["data-open-direction"],iw={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},aw=["onKeydown"],lw={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},cw={class:"rename-thread-subtitle"},uw=4,nu=6,ru="codex-web-local.thread-view-mode.v1",su="codex-web-local.collapsed-projects.v1",dw=Zt({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project","export-thread"],setup(e,{emit:t}){const n=e,r=t,s=D({}),o=D({}),i=D([]),a=D(""),l=D(""),d=D({}),c=D({}),h=D({}),b=D("actions"),T=D(""),N=D(!1),O=D(""),J=D(""),ie=D(null),L=D(!1),se=D(""),ne=D(""),we=D(null),ce=D(null),me=D(null);let Oe=null,ae=null;const X=D(""),le=D({}),te=new Map,Me=new Map,Ne=new Map,qe=new WeakMap,He=D(null),Fe=D(null),xe=D(!1),nt=D(at()),ze=typeof window<"u"?new ResizeObserver(S=>{for(const x of S){const M=x.target,Z=qe.get(M);Z&&xn(Z,M)}}):null;function Be(){if(typeof window>"u")return{};try{const S=window.localStorage.getItem(su);if(!S)return{};const x=JSON.parse(S);return!x||typeof x!="object"||Array.isArray(x)?{}:x}catch{return{}}}function at(){return typeof window>"u"?"project":window.localStorage.getItem(ru)==="chronological"?"chronological":"project"}o.value=Be(),mt(o,S=>{typeof window>"u"||window.localStorage.setItem(su,JSON.stringify(S))},{deep:!0}),mt(nt,S=>{typeof window>"u"||window.localStorage.setItem(ru,S)});const Dt=pe(()=>n.searchQuery.trim().toLowerCase()),it=pe(()=>Dt.value.length>0),lt=pe(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function Ve(S){if(!it.value)return!0;if(lt.value)return lt.value.has(S.id);const x=Dt.value;return S.title.toLowerCase().includes(x)||S.preview.toLowerCase().includes(x)}const V=pe(()=>it.value?n.groups.map(S=>({...S,threads:S.threads.filter(Ve)})).filter(S=>S.threads.length>0):n.groups),be=pe(()=>nt.value==="chronological"),fe=pe(()=>{const S=V.value,x=[];for(const M of S)for(const Z of M.threads)H(Z.id)||x.push(Z);return x.sort((M,Z)=>{const We=new Date(M.updatedAtIso||M.createdAtIso).getTime();return new Date(Z.updatedAtIso||Z.createdAtIso).getTime()-We})}),Ae=pe(()=>{const S=new Map;for(const x of n.groups)for(const M of x.threads)S.set(M.id,M);return S}),Re=pe(()=>{const S=l.value;return S?Ae.value.get(S)??null:null}),k=pe(()=>i.value.map(S=>Ae.value.get(S)??null).filter(S=>S!==null).filter(Ve)),I=pe(()=>{const S=me.value;if(!S||S.dropTargetIndexFull===null||n.groups.length===0)return null;const x=Math.max(0,Math.min(S.dropTargetIndexFull,n.groups.length)),M=x>S.fromIndex?x-1:x,Z=Math.max(0,Math.min(M,n.groups.length-1));return Z===S.fromIndex?null:Z}),$=pe(()=>{const x=(it.value?V.value:n.groups).map(tn=>tn.projectName),M=me.value,Z=I.value;if(!M||Z===null)return x;const We=[...x],[$t]=We.splice(M.fromIndex,1);return $t?(We.splice(Z,0,$t),We):x}),q=pe(()=>{const S={};let x=0;for(const M of $.value)S[M]=x,x+=$n(M);return S}),F=pe(()=>{let S=0;for(const x of $.value)S+=$n(x);return{height:`${Math.max(0,S)}px`}});function P(S){const x=new Date(S).getTime();if(Number.isNaN(x))return"n/a";const M=Math.abs(Date.now()-x);if(M<6e4)return"now";const Z=Math.floor(M/6e4);if(Z<60)return`${Z}m`;const We=Math.floor(Z/60);return We<24?`${We}h`:`${Math.floor(We/24)}d`}function H(S){return i.value.includes(S)}function U(S){if(H(S)){i.value=i.value.filter(x=>x!==S);return}i.value=[S,...i.value]}function z(S){r("select",S)}function G(S){r("export-thread",S),Ie()}function Te(S){return`start new thread ${Ot(S)}`}function ve(S){r("start-new-thread",S)}function ke(S){return l.value===S}function Ie(){l.value="",h.value={}}function Ue(S){if(l.value===S){Ie();return}ut(),xe.value=!1,l.value=S,qt(()=>{Pe(S)})}function tt(S,x){O.value=S,J.value=x,N.value=!0,Ie(),qt(()=>{var M,Z;(M=ie.value)==null||M.focus(),(Z=ie.value)==null||Z.select()})}function Qe(){N.value=!1,O.value="",J.value=""}function ct(){const S=O.value,x=J.value.trim();!S||!x||(r("rename-thread",{threadId:S,title:x}),Qe())}function et(S,x){se.value=S,ne.value=x,L.value=!0,Ie()}function pt(){L.value=!1,se.value="",ne.value=""}function Je(){const S=se.value;S&&(i.value=i.value.filter(x=>x!==S),r("archive",S),pt())}function Ot(S){return n.projectDisplayNameById[S]??S}function hn(S){return a.value===S}function ut(){a.value="",b.value="actions",T.value=""}function ot(){const S=!xe.value;S&&(ut(),Ie()),xe.value=S}function _t(S){nt.value=S,xe.value=!1}function Pt(S){if(a.value===S){ut();return}Ie(),xe.value=!1,a.value=S,b.value="actions",T.value=Ot(S),qt(()=>{Un(S)})}function Et(S){Ie(),a.value=S,b.value="rename",T.value=Ot(S),qt(()=>{Un(S)})}function Mt(S){r("rename-project",{projectName:S,displayName:T.value})}function In(S){r("remove-project",S),ut()}function Pn(S){r("browse-project-files",S),ut()}function _n(S,x){if(!S.altKey||S.key!=="ArrowUp"&&S.key!=="ArrowDown")return;const M=n.groups.findIndex($t=>$t.projectName===x);if(M<0)return;const Z=S.key==="ArrowUp"?-1:1,We=Math.max(0,Math.min(M+Z,n.groups.length-1));We!==M&&(S.preventDefault(),r("reorder-project",{projectName:x,toIndex:We}))}function Lt(S){return s.value[S]===!0}function Vt(S){return o.value[S]===!0}function Mn(S){s.value={...s.value,[S]:!Lt(S)}}function en(S){if(X.value===S){X.value="";return}o.value={...o.value,[S]:!Vt(S)}}function $n(S){const x=le.value[S]??0,M=me.value,We=((M==null?void 0:M.projectName)===S?M.groupHeight:null)??x,$t=Vt(S)?0:nu;return Math.max(0,We+$t)}function Bn(S,x){const M=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(M){Me.set(S,M);return}Me.delete(S)}function rn(S,x){const M=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(M){Ne.set(S,M);return}Ne.delete(S)}function kn(S){let x=S.parentElement;for(;x;){const M=window.getComputedStyle(x),Z=M.overflowY||M.overflow;if(Z==="auto"||Z==="scroll"||Z==="hidden"||Z==="clip")return x.getBoundingClientRect();x=x.parentElement}return new DOMRect(0,0,window.innerWidth,window.innerHeight)}function Fn(S,x){const M=S.getBoundingClientRect(),Z=kn(S),We=6,$t=Z.bottom-M.bottom,tn=M.top-Z.top;return $t>=x+We?"down":tn>$t?"up":"down"}function pr(S,x){const M=Ne.get(S);if(!M)return"down";const Z=Fn(M,x);return c.value={...c.value,[S]:Z},Z}function mr(S){return c.value[S]??"down"}function Un(S){const x=Me.get(S);x&&(d.value={...d.value,[S]:Fn(x,112)})}function Le(S,x,M){return Math.min(Math.max(S,x),M)}function Pe(S){const x=Ne.get(S);if(!x)return;const M=Fe.value,Z=M==null?void 0:M.getBoundingClientRect(),We=(Z==null?void 0:Z.height)||(M==null?void 0:M.offsetHeight)||112,$t=(Z==null?void 0:Z.width)||(M==null?void 0:M.offsetWidth)||160,tn=pr(S,We),Zn=x.getBoundingClientRect(),sn=8,Jt=4,Hn=Math.max(sn,window.innerWidth-$t-sn),Dr=Le(Zn.right-$t,sn,Hn),er=Le(tn==="up"?Zn.top-We-Jt:Zn.bottom+Jt,sn,Math.max(sn,window.innerHeight-We-sn));h.value={left:`${Math.round(Dr)}px`,top:`${Math.round(er)}px`}}function Tn(){const S=l.value;S&&Pe(S)}function Ft(){window.addEventListener("resize",Tn),document.addEventListener("scroll",Tn,!0)}function En(){window.removeEventListener("resize",Tn),document.removeEventListener("scroll",Tn,!0)}function On(S){const x=a.value;if(!x)return!1;const M=Me.get(x);if(!M)return!1;if((typeof S.composedPath=="function"?S.composedPath():[]).includes(M))return!0;const We=S.target;return We instanceof Node?M.contains(We):!1}function pn(S){const x=l.value;if(!x)return!1;const M=Ne.get(x);if(!M)return!1;if((typeof S.composedPath=="function"?S.composedPath():[]).includes(M))return!0;const We=S.target;return We instanceof Node?M.contains(We):!1}function Nn(S){if(xe.value){const x=He.value,M=typeof S.composedPath=="function"?S.composedPath():[];!!x&&(M.includes(x)||S.target instanceof Node&&x.contains(S.target))||(xe.value=!1)}a.value&&(On(S)||ut(),l.value&&(pn(S)||Ie()))}function Wt(S){a.value&&!On(S)&&ut(),l.value&&!pn(S)&&Ie()}function Cn(){xe.value&&(xe.value=!1),a.value&&ut(),l.value&&Ie()}function Xn(){window.addEventListener("pointerdown",Nn,{capture:!0}),window.addEventListener("focusin",Wt,{capture:!0}),window.addEventListener("blur",Cn)}function An(){window.removeEventListener("pointerdown",Nn,{capture:!0}),window.removeEventListener("focusin",Wt,{capture:!0}),window.removeEventListener("blur",Cn)}function xn(S,x){const M=x.getBoundingClientRect().height;if(!Number.isFinite(M)||M<=0)return;const Z=le.value[S];Z!==void 0&&Math.abs(Z-M)<.5||(le.value={...le.value,[S]:M})}function A(S,x){const M=te.get(S);M&&M!==x&&ze&&ze.unobserve(M);const Z=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(Z){te.set(S,Z),qe.set(Z,S),xn(S,Z),ze==null||ze.observe(Z);return}M&&(ze==null||ze.unobserve(M)),te.delete(S)}function j(S,x){if(S.button!==0||ce.value||me.value)return;const M=n.groups.findIndex(tn=>tn.projectName===x),Z=te.get(x);if(M<0||!Z)return;const We=Z.getBoundingClientRect(),$t=Vt(x)?0:nu;ce.value={projectName:x,fromIndex:M,startClientX:S.clientX,startClientY:S.clientY,pointerOffsetY:S.clientY-We.top,groupLeft:We.left,groupWidth:We.width,groupHeight:We.height,groupOuterHeight:We.height+$t},S.preventDefault(),re()}function re(){window.addEventListener("mousemove",g),window.addEventListener("mouseup",m),window.addEventListener("keydown",v)}function je(){window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",m),window.removeEventListener("keydown",v)}function g(S){Oe={clientX:S.clientX,clientY:S.clientY},B()}function m(S){K({clientX:S.clientX,clientY:S.clientY});const x=me.value;if(x&&I.value!==null){const M=n.groups.findIndex(Z=>Z.projectName===x.projectName);if(M>=0){const Z=I.value;Z!==M&&r("reorder-project",{projectName:x.projectName,toIndex:Z})}}R()}function v(S){S.key==="Escape"&&(!ce.value&&!me.value||(S.preventDefault(),R()))}function R(){ae!==null&&(window.cancelAnimationFrame(ae),ae=null),Oe=null,ce.value=null,me.value=null,X.value="",je()}function B(){ae===null&&(ae=window.requestAnimationFrame(()=>{if(ae=null,!Oe)return;const S=Oe;Oe=null,K(S)}))}function K(S){const x=ce.value;if(!me.value&&x){const M=S.clientX-x.startClientX,Z=S.clientY-x.startClientY;if(Math.hypot(M,Z)<uw)return;ut(),X.value=x.projectName,me.value={projectName:x.projectName,fromIndex:x.fromIndex,pointerOffsetY:x.pointerOffsetY,groupLeft:x.groupLeft,groupWidth:x.groupWidth,groupHeight:x.groupHeight,groupOuterHeight:x.groupOuterHeight,ghostTop:S.clientY-x.pointerOffsetY,dropTargetIndexFull:null}}me.value&&Ee(S)}function Ee(S){const x=me.value;if(!x)return;if(x.ghostTop=S.clientY-x.pointerOffsetY,!Q(S)){x.dropTargetIndexFull=null;return}const M=S.clientY,Z=we.value;if(!Z){x.dropTargetIndexFull=null;return}const We=Z.getBoundingClientRect(),$t=new Map(n.groups.map((Jt,Hn)=>[Jt.projectName,Hn])),tn=n.groups.map(Jt=>Jt.projectName).filter(Jt=>Jt!==x.projectName);let Zn=0,sn=n.groups.length;for(const Jt of tn){const Hn=$t.get(Jt);if(Hn===void 0)continue;const Dr=$n(Jt),er=We.top+Zn+Dr/2;if(M<er){sn=Hn;break}Zn+=Dr}x.dropTargetIndexFull=sn}function Q(S){const x=we.value;if(!x)return!1;const M=x.getBoundingClientRect(),Z=S.clientX>=M.left&&S.clientX<=M.right,We=S.clientY>=M.top-32&&S.clientY<=M.bottom+32;return Z&&We}function _e(S){var x;return((x=me.value)==null?void 0:x.projectName)===S}function he(S){const x=me.value,M=q.value[S]??0,Z=a.value===S;return!x||x.projectName!==S?{position:"absolute",top:"0",left:"0",right:"0",zIndex:Z?"40":"1",transform:`translate3d(0, ${M}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${x.groupLeft}px`,width:`${x.groupWidth}px`,height:`${x.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${x.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function Ke(S){return S.threads.filter(x=>!H(x.id))}function jt(S){if(it.value)return Ke(S);if(Vt(S.projectName))return[];const x=Ke(S);return Lt(S.projectName)?x:x.slice(0,10)}function Ht(S){return it.value?!1:!Vt(S.projectName)&&Ke(S).length>10}function Ct(S){return Ke(S).length>0}function zt(S){return S.inProgress?"working":S.unread?"unread":"idle"}mt(()=>n.groups.map(S=>S.projectName),S=>{var We,$t;const x=((We=me.value)==null?void 0:We.projectName)??(($t=ce.value)==null?void 0:$t.projectName)??"";x&&!n.groups.some(tn=>tn.projectName===x)&&R();const M=new Set(S),Z=Object.fromEntries(Object.entries(le.value).filter(([tn])=>M.has(tn)));Object.keys(Z).length!==Object.keys(le.value).length&&(le.value=Z)});const Us=pe(()=>xe.value||a.value!==""||l.value!=="");return mt(Us,S=>{if(S){Xn();return}An()}),mt(l,S=>{if(!S){En();return}Ft(),qt(()=>{Pe(S)})}),Nr(()=>{for(const S of te.values())ze==null||ze.unobserve(S);te.clear(),Me.clear(),En(),An(),R()}),(S,x)=>(p(),w("section",oy,[k.value.length>0?(p(),w("section",iy,[y("ul",ay,[(p(!0),w($e,null,dt(k.value,M=>(p(),w("li",{key:M.id,class:"thread-row-item","data-menu-open":ke(M.id)?"true":"false"},[De(os,{class:"thread-row","data-active":M.id===e.selectedThreadId,"data-pinned":H(M.id),"data-menu-open":ke(M.id)?"true":"false","force-right-hover":ke(M.id)},{left:kt(()=>[y("span",cy,[M.inProgress||M.unread?(p(),w("span",{key:0,class:"thread-status-indicator","data-state":zt(M)},null,8,uy)):ue("",!0),y("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Z=>U(M.id)},[De(ia,{class:"thread-icon"})],8,dy)])]),right:kt(()=>[y("span",my,W(P(M.createdAtIso||M.updatedAtIso)),1)]),"right-hover":kt(()=>[y("div",{ref_for:!0,ref:Z=>rn(M.id,Z),class:"thread-menu-wrap"},[y("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:wt(Z=>Ue(M.id),["stop"])},[De(Qs,{class:"thread-icon"})],8,gy)],512)]),default:kt(()=>[y("button",{class:"thread-main-button",type:"button",onClick:Z=>z(M.id)},[y("span",hy,[y("span",py,W(M.title),1),M.hasWorktree?(p(),vt(Qo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ue("",!0)])],8,fy)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover"])],8,ly))),128))])])):ue("",!0),De(os,{as:"header",class:"thread-tree-header-row"},{right:kt(()=>[y("div",{ref_key:"organizeMenuWrapRef",ref:He,class:"organize-menu-wrap"},[y("button",{class:"organize-menu-trigger",type:"button","aria-expanded":xe.value,"aria-label":"Organize threads",title:"Organize threads",onClick:ot},[De(Qs,{class:"thread-icon"})],8,vy),xe.value?(p(),w("div",{key:0,class:"organize-menu-panel",onClick:x[2]||(x[2]=wt(()=>{},["stop"]))},[x[12]||(x[12]=y("p",{class:"organize-menu-title"},"Organize",-1)),y("button",{class:"organize-menu-item","data-active":nt.value==="project",type:"button",onClick:x[0]||(x[0]=M=>_t("project"))},[x[10]||(x[10]=y("span",null,"By project",-1)),nt.value==="project"?(p(),w("span",wy,"✓")):ue("",!0)],8,yy),y("button",{class:"organize-menu-item","data-active":nt.value==="chronological",type:"button",onClick:x[1]||(x[1]=M=>_t("chronological"))},[x[11]||(x[11]=y("span",null,"Chronological list",-1)),nt.value==="chronological"?(p(),w("span",_y,"✓")):ue("",!0)],8,by)])):ue("",!0)],512)]),default:kt(()=>[x[13]||(x[13]=y("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),it.value&&V.value.length===0?(p(),w("p",ky,"No matching threads")):e.isLoading&&e.groups.length===0?(p(),w("p",Ty,"Loading threads...")):be.value?(p(),w("ul",Sy,[(p(!0),w($e,null,dt(fe.value,M=>(p(),w("li",{key:M.id,class:"thread-row-item","data-menu-open":ke(M.id)?"true":"false"},[De(os,{class:"thread-row","data-active":M.id===e.selectedThreadId,"data-pinned":H(M.id),"data-menu-open":ke(M.id)?"true":"false","force-right-hover":ke(M.id)},{left:kt(()=>[y("span",Ey,[M.inProgress||M.unread?(p(),w("span",{key:0,class:"thread-status-indicator","data-state":zt(M)},null,8,Cy)):ue("",!0),y("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Z=>U(M.id)},[De(ia,{class:"thread-icon"})],8,Ay)])]),right:kt(()=>[y("span",My,W(P(M.createdAtIso||M.updatedAtIso)),1)]),"right-hover":kt(()=>[y("div",{ref_for:!0,ref:Z=>rn(M.id,Z),class:"thread-menu-wrap"},[y("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:wt(Z=>Ue(M.id),["stop"])},[De(Qs,{class:"thread-icon"})],8,$y)],512)]),default:kt(()=>[y("button",{class:"thread-main-button",type:"button",onClick:Z=>z(M.id)},[y("span",Ry,[y("span",Py,W(M.title),1),M.hasWorktree?(p(),vt(Qo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ue("",!0)])],8,xy)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover"])],8,Iy))),128))])):(p(),w("div",{key:4,ref_key:"groupsContainerRef",ref:we,class:"thread-tree-groups",style:qr(F.value)},[(p(!0),w($e,null,dt(V.value,M=>(p(),w("article",{key:M.projectName,ref_for:!0,ref:Z=>A(M.projectName,Z),class:"project-group","data-project-name":M.projectName,"data-expanded":!Vt(M.projectName),"data-dragging":_e(M.projectName),style:qr(he(M.projectName))},[De(os,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:Z=>en(M.projectName),onKeydown:[Z=>_n(Z,M.projectName),yn(wt(Z=>en(M.projectName),["prevent"]),["enter"]),yn(wt(Z=>en(M.projectName),["prevent"]),["space"])]},{left:kt(()=>[y("span",Ny,[y("span",Dy,[Vt(M.projectName)?(p(),vt(Il,{key:0,class:"thread-icon"})):(p(),vt(Gv,{key:1,class:"thread-icon"}))]),y("span",Ly,[Vt(M.projectName)?(p(),vt(Of,{key:0,class:"thread-icon"})):(p(),vt($i,{key:1,class:"thread-icon"}))])])]),right:kt(()=>[y("div",Fy,[y("div",{ref_for:!0,ref:Z=>Bn(M.projectName,Z),class:"project-menu-wrap"},[y("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:wt(Z=>Pt(M.projectName),["stop"])},[De(Qs,{class:"thread-icon"})],8,Uy),hn(M.projectName)?(p(),w("div",{key:0,class:"project-menu-panel","data-open-direction":d.value[M.projectName]??"down",onClick:x[4]||(x[4]=wt(()=>{},["stop"]))},[b.value==="actions"?(p(),w($e,{key:0},[y("button",{class:"project-menu-item",type:"button",onClick:Z=>Pn(M.projectName)}," Browse files ",8,Vy),y("button",{class:"project-menu-item",type:"button",onClick:Z=>Et(M.projectName)}," Edit name ",8,Wy),y("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:Z=>In(M.projectName)}," Remove ",8,zy)],64)):(p(),w($e,{key:1},[x[14]||(x[14]=y("label",{class:"project-menu-label"},"Project name",-1)),xr(y("input",{"onUpdate:modelValue":x[3]||(x[3]=Z=>T.value=Z),class:"project-menu-input",type:"text",onInput:Z=>Mt(M.projectName)},null,40,Gy),[[Rr,T.value]])],64))],8,Hy)):ue("",!0)],512),y("button",{class:"thread-start-button",type:"button","aria-label":Te(M.projectName),title:Te(M.projectName),onClick:wt(Z=>ve(M.projectName),["stop"])},[De(di,{class:"thread-icon"})],8,qy)])]),default:kt(()=>[y("span",{class:"project-main-button","data-dragging-handle":_e(M.projectName),onMousedown:wt(Z=>j(Z,M.projectName),["left"])},[y("span",By,W(Ot(M.projectName)),1)],40,jy)]),_:2},1032,["onClick","onKeydown"]),Ct(M)?(p(),w("ul",Ky,[(p(!0),w($e,null,dt(jt(M),Z=>(p(),w("li",{key:Z.id,class:"thread-row-item","data-menu-open":ke(Z.id)?"true":"false"},[De(os,{class:"thread-row","data-active":Z.id===e.selectedThreadId,"data-pinned":H(Z.id),"data-menu-open":ke(Z.id)?"true":"false","force-right-hover":ke(Z.id)},{left:kt(()=>[y("span",Yy,[Z.inProgress||Z.unread?(p(),w("span",{key:0,class:"thread-status-indicator","data-state":zt(Z)},null,8,Qy)):ue("",!0),y("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:We=>U(Z.id)},[De(ia,{class:"thread-icon"})],8,Xy)])]),right:kt(()=>[y("span",nw,W(P(Z.createdAtIso||Z.updatedAtIso)),1)]),"right-hover":kt(()=>[y("div",{ref_for:!0,ref:We=>rn(Z.id,We),class:"thread-menu-wrap"},[y("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:wt(We=>Ue(Z.id),["stop"])},[De(Qs,{class:"thread-icon"})],8,rw)],512)]),default:kt(()=>[y("button",{class:"thread-main-button",type:"button",onClick:We=>z(Z.id)},[y("span",ew,[y("span",tw,W(Z.title),1),Z.hasWorktree?(p(),vt(Qo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ue("",!0)])],8,Zy)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover"])],8,Jy))),128))])):(p(),vt(os,{key:1,as:"p",class:"project-empty-row"},{left:kt(()=>[...x[15]||(x[15]=[y("span",{class:"project-empty-spacer"},null,-1)])]),default:kt(()=>[x[16]||(x[16]=y("span",{class:"project-empty"},"No threads",-1))]),_:1})),Ht(M)?(p(),vt(os,{key:2,class:"thread-show-more-row"},{left:kt(()=>[...x[17]||(x[17]=[y("span",{class:"thread-show-more-spacer"},null,-1)])]),default:kt(()=>[y("button",{class:"thread-show-more-button",type:"button",onClick:Z=>Mn(M.projectName)},W(Lt(M.projectName)?"Show less":"Show more"),9,sw)]),_:2},1024)):ue("",!0)],12,Oy))),128))],4)),(p(),vt(so,{to:"body"},[Re.value?(p(),w("div",{key:0,ref_key:"openThreadMenuPanelRef",ref:Fe,class:"thread-menu-panel thread-menu-panel-fixed",style:qr(h.value),"data-open-direction":mr(Re.value.id),onClick:x[8]||(x[8]=wt(()=>{},["stop"]))},[y("button",{class:"thread-menu-item",type:"button",onClick:x[5]||(x[5]=M=>G(Re.value.id))}," Export chat "),y("button",{class:"thread-menu-item",type:"button",onClick:x[6]||(x[6]=M=>tt(Re.value.id,Re.value.title))}," Rename thread "),y("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:x[7]||(x[7]=M=>et(Re.value.id,Re.value.title))}," Delete thread ")],12,ow)):ue("",!0)])),(p(),vt(so,{to:"body"},[N.value?(p(),w("div",{key:0,class:"rename-thread-overlay",onClick:wt(Qe,["self"])},[y("div",iw,[x[18]||(x[18]=y("h3",{class:"rename-thread-title"},"Rename thread",-1)),x[19]||(x[19]=y("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),xr(y("input",{ref_key:"renameThreadInputRef",ref:ie,"onUpdate:modelValue":x[9]||(x[9]=M=>J.value=M),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[yn(wt(ct,["prevent"]),["enter"]),yn(wt(Qe,["prevent"]),["esc"])]},null,40,aw),[[Rr,J.value]]),y("div",{class:"rename-thread-actions"},[y("button",{class:"rename-thread-button",type:"button",onClick:Qe},"Cancel"),y("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:ct},"Save")])])])):ue("",!0)])),(p(),vt(so,{to:"body"},[L.value?(p(),w("div",{key:0,class:"rename-thread-overlay",onClick:wt(pt,["self"])},[y("div",lw,[x[20]||(x[20]=y("h3",{class:"rename-thread-title"},"Delete thread?",-1)),y("p",cw,' This will archive the thread "'+W(ne.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:pt},"Cancel"),y("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Je},"Delete")])])])):ue("",!0)]))]))}}),fw=ht(dw,[["__scopeId","data-v-2e1439c4"]]),hw={class:"content-header"},pw={class:"content-leading"},mw={class:"content-title"},gw={class:"content-actions"},vw=Zt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(p(),w("header",hw,[y("div",pw,[ur(t.$slots,"leading",{},void 0)]),y("h1",mw,W(e.title),1),y("div",gw,[ur(t.$slots,"actions",{},void 0)])]))}}),yw=ht(vw,[["__scopeId","data-v-66ee223c"]]),ww={},bw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function _w(e,t){return p(),w("svg",bw,[...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 El=ht(ww,[["render",_w]]),kw={},Tw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Sw(e,t){return p(),w("svg",Tw,[...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 Iw=ht(kw,[["render",Sw]]),Ew={},Cw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Aw(e,t){return p(),w("svg",Cw,[...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 xw=ht(Ew,[["render",Aw]]),Rw={class:"conversation-root"},Pw={key:0,class:"conversation-loading"},Mw={key:1,class:"conversation-empty"},$w=["data-role","data-message-type"],Ow={key:0,class:"message-row","data-role":"system"},Nw={class:"message-stack","data-role":"system"},Dw=["onClick"],Lw={class:"cmd-label"},jw={class:"cmd-status"},Bw={class:"cmd-output-inner"},Fw={class:"cmd-output"},Uw=["data-role","data-message-type"],Hw=["data-role"],Vw=["data-role"],Ww=["data-role"],zw=["onClick"],Gw=["src"],qw={key:1,class:"message-file-attachments"},Kw=["href","title"],Jw=["data-role"],Yw={key:0,class:"worked-separator-wrap","aria-live":"polite"},Qw=["onClick"],Xw={class:"worked-separator-text"},Zw={key:0,class:"worked-details"},eb=["onClick"],tb={class:"cmd-label"},nb={class:"cmd-status"},rb={class:"cmd-output-inner"},sb={class:"cmd-output"},ob=["data-streaming"],ib={class:"plan-card-header"},ab={key:0,class:"plan-card-badge"},lb=["innerHTML"],cb={key:1,class:"plan-step-list"},ub=["data-status"],db=["data-status"],fb=["innerHTML"],hb=["innerHTML"],pb={key:2,class:"message-text-flow"},mb={key:0,class:"message-text"},gb={key:0},vb={key:1,class:"message-bold-text"},yb={key:2,class:"message-italic-text"},wb={key:3,class:"message-strikethrough-text"},bb=["href","title"],_b=["href","title"],kb={key:6,class:"message-inline-code"},Tb={key:0},Sb={key:1,class:"message-bold-text"},Ib={key:2,class:"message-italic-text"},Eb={key:3,class:"message-strikethrough-text"},Cb=["href","title"],Ab=["href","title"],xb={key:6,class:"message-inline-code"},Rb={key:2,class:"message-blockquote"},Pb={key:0},Mb={key:1,class:"message-bold-text"},$b={key:2,class:"message-italic-text"},Ob={key:3,class:"message-strikethrough-text"},Nb=["href","title"],Db=["href","title"],Lb={key:6,class:"message-inline-code"},jb={key:3,class:"message-list message-list-unordered"},Bb={class:"message-list-item-text"},Fb={key:0},Ub={key:1,class:"message-bold-text"},Hb={key:2,class:"message-italic-text"},Vb={key:3,class:"message-strikethrough-text"},Wb=["href","title"],zb=["href","title"],Gb={key:6,class:"message-inline-code"},qb={key:4,class:"message-list message-task-list"},Kb=["data-checked"],Jb={class:"message-list-item-text"},Yb={key:0},Qb={key:1,class:"message-bold-text"},Xb={key:2,class:"message-italic-text"},Zb={key:3,class:"message-strikethrough-text"},e_=["href","title"],t_=["href","title"],n_={key:6,class:"message-inline-code"},r_={key:5,class:"message-list message-list-ordered"},s_={class:"message-list-item-text"},o_={key:0},i_={key:1,class:"message-bold-text"},a_={key:2,class:"message-italic-text"},l_={key:3,class:"message-strikethrough-text"},c_=["href","title"],u_=["href","title"],d_={key:6,class:"message-inline-code"},f_={key:6,class:"message-code-block"},h_={key:0,class:"message-code-language"},p_={class:"message-code-pre"},m_={key:7,class:"message-divider"},g_={key:8,class:"message-text"},v_=["onClick"],y_=["src","alt","onError"],w_={key:0,class:"message-actions"},b_=["onClick"],__=["onClick"],k_={key:0,class:"conversation-item conversation-item-overlay"},T_={class:"message-row"},S_={class:"message-stack"},I_={class:"live-overlay-inline","aria-live":"polite"},E_={class:"live-overlay-label"},C_={key:1,class:"live-overlay-error"},A_={class:"message-row"},x_={class:"message-stack"},R_={class:"request-card"},P_={class:"request-title"},M_={class:"request-meta"},$_={key:0,class:"request-reason"},O_={key:1,class:"request-actions"},N_=["onClick"],D_=["onClick"],L_=["onClick"],j_=["onClick"],B_={key:2,class:"request-actions"},F_=["onClick"],U_=["onClick"],H_=["onClick"],V_=["onClick"],W_={key:3,class:"request-user-input"},z_={class:"request-question-title"},G_={key:0,class:"request-question-text"},q_=["value","onChange"],K_=["value"],J_={key:2,class:"request-question-option-description"},Y_=["type","value","placeholder","onInput"],Q_=["type","value","onInput"],X_=["onClick"],Z_={key:4,class:"request-actions"},ek=["onClick"],tk=["onClick"],nk={key:5,class:"request-actions"},rk=["onClick"],sk=["onClick"],ok=["src"],ik=16,ak=Zt({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=D(new Set),r=D(new Set),s=D(new Set),o=D({});function i(g){var B;const m=g.replace(/\r\n/g,`
|
|
26
|
-
`).trim();if(!m)return null;const v=[],R=[];for(const K of m.split(`
|
|
27
|
-
`)){const Ee=K.trim();if(!Ee){v.length===0&&R.push("");continue}const Q=Ee.match(/^[-*]\s+\[([ xX~>|-])\]\s+(.+)$/);if(Q){const _e=(Q[1]??" ").toLowerCase();let he="pending";_e==="x"&&(he="completed"),(_e==="~"||_e===">"||_e==="-")&&(he="inProgress"),v.push({step:((B=Q[2])==null?void 0:B.trim())??"",status:he});continue}R.push(Ee)}return v.length===0?null:{explanation:R.join(`
|
|
28
|
-
`).trim(),steps:v.filter(K=>K.step.length>0)}}function a(g){var m;return g.plan&&g.plan.steps.length>0?{explanation:((m=g.plan.explanation)==null?void 0:m.trim())??"",steps:g.plan.steps}:i(g.text)}function l(g){return g.messageType==="commandExecution"&&!!g.commandExecution}function d(g){return g.messageType==="plan"||g.messageType==="plan.live"}function c(g){var m;return((m=a(g))==null?void 0:m.explanation)??""}function h(g){var m;return((m=a(g))==null?void 0:m.steps)??[]}function b(g){switch(g){case"completed":return"✓";case"inProgress":return"•";default:return"○"}}function T(g){var m;return((m=g.commandExecution)==null?void 0:m.status)==="inProgress"||r.value.has(g.id)?!0:n.value.has(g.id)}function N(g){return r.value.has(g.id)}function O(g){var v;if(((v=g.commandExecution)==null?void 0:v.status)==="inProgress")return;const m=new Set(n.value);m.has(g.id)?m.delete(g.id):m.add(g.id),n.value=m}function J(g){const m=new Set(s.value);m.has(g.id)?m.delete(g.id):m.add(g.id),s.value=m}function ie(g){return s.value.has(g.id)}function L(g){const m=g.commandExecution;if(!m)return"";switch(m.status){case"inProgress":return"⟳ Running";case"completed":return m.exitCode===0?"✓ Completed":`✗ Exit ${m.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function se(g){var v,R;const m=(v=g.commandExecution)==null?void 0:v.status;return m==="inProgress"?"cmd-status-running":m==="completed"&&((R=g.commandExecution)==null?void 0:R.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function ne(g){const m=new Set(r.value);m.add(g),r.value=m,setTimeout(()=>{const v=new Set(r.value);v.delete(g),r.value=v},1e3)}function we(g,m){const v=[];for(let R=m-1;R>=0;R--){const B=g[R];if(B.messageType==="commandExecution")v.unshift(B);else if(B.role==="user"||B.messageType==="worked")break}return v}const ce=e,me=t,Oe=D(null),ae=D(null),X=D(null),le=D(""),te=D({}),Me=D({});let Ne=0,qe=0,He=0;const Fe=new WeakSet,xe=D(new Set);function nt(g){if(!g||/\s/u.test(g)||g.endsWith("/")||g.endsWith("\\"))return!1;if(g.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(g))return!1;const m=g.startsWith("/"),v=/^[A-Za-z]:[\\/]/u.test(g),R=g.startsWith("./")||g.startsWith("../")||g.startsWith("~/"),B=g.includes("/")||g.includes("\\");return m||v||R||B}function ze(g){return g.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||g}function Be(g){return g.replace(/\\/gu,"/")}function at(g){if(!g.startsWith("file://"))return g;let m=g.replace(/^file:\/\//u,"");try{m=decodeURIComponent(m)}catch{}return/^\/[A-Za-z]:\//u.test(m)&&(m=m.slice(1)),m}function Dt(g){const m=Be(g),v=m.match(/^\/Users\/([^/]+)/u);if(v)return`/Users/${v[1]}`;const R=m.match(/^\/home\/([^/]+)/u);return R?`/home/${R[1]}`:""}function it(g){const m=Be(g);if(!m)return m;let v="",R=m;const B=R.match(/^([A-Za-z]:)(\/.*)?$/u);B?(v=`${B[1]}/`,R=(B[2]??"").replace(/^\/+/u,"")):R.startsWith("/")&&(v="/",R=R.slice(1));const K=R.split("/").filter(Boolean),Ee=[];for(const _e of K)if(_e!=="."){if(_e===".."){Ee.length>0&&Ee.pop();continue}Ee.push(_e)}const Q=Ee.join("/");return v?`${v}${Q}`.replace(/\/+$/u,"")||v:Q||m}function lt(g,m){const v=Be(at(g.trim()));if(!v)return"";if(v.startsWith("/")||/^[A-Za-z]:\//u.test(v))return it(v);if(v.startsWith("~/")){const K=Dt(m);if(K)return it(`${K}/${v.slice(2)}`)}const B=Be(m.trim());return it(B?`${B.replace(/\/+$/u,"")}/${v}`:v)}function Ve(g){if(!g)return null;let m=g.trim();m=V(m).core.trim();let R=null;const B=m.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(B)m=B[1],R=Number(B[2]);else{const K=m.match(/^(.*):(\d+)(?::\d+)?$/u);K&&(m=K[1],R=Number(K[2]))}return m=at(m),nt(m)?{path:m,line:R}:null}function V(g){let m=g,v="",R="";for(;/^[('"`[{<“‘]/u.test(m);)v+=m[0],m=m.slice(1);for(;/[)"'`\]}>”’]$/u.test(m);)R=m.slice(-1)+R,m=m.slice(0,-1);return{core:m,leading:v,trailing:R}}function be(g){const v=g.trim().match(/^\[([^\]\n]+)\]\(([^)\n]+)\)$/u);if(!v)return null;const R=(v[1]??"").trim(),B=(v[2]??"").trim(),K=V(R).core.trim()||R,Ee=V(B).core.trim();return Ee?{label:K,target:Ee}:null}function fe(g){const m=Math.min(6,Math.max(1,Math.trunc(g)));return`h${String(m)}`}function Ae(g){switch(Math.min(6,Math.max(1,Math.trunc(g)))){case 1:return"message-heading-h1";case 2:return"message-heading-h2";case 3:return"message-heading-h3";case 4:return"message-heading-h4";case 5:return"message-heading-h5";default:return"message-heading-h6"}}function Re(g){const m=[],v=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let R=0;for(const B of g.matchAll(v)){if(typeof B.index!="number")continue;const K=B.index,Ee=K+B[0].length;K>R&&m.push({kind:"text",value:g.slice(R,K)});let Q=B[0],_e="";for(;/[.,;:]$/u.test(Q);)_e=Q.slice(-1)+_e,Q=Q.slice(0,-1);const he=V(Q);Q=he.core;const Ke=he.leading,jt=he.trailing+_e;if(Ke&&m.push({kind:"text",value:Ke}),Q.startsWith("**")&&Q.endsWith("**")&&Q.length>4)m.push({kind:"bold",value:Q.slice(2,-2)}),jt&&m.push({kind:"text",value:jt});else if(/^https?:\/\//u.test(Q))m.push({kind:"url",value:Q,href:Q}),jt&&m.push({kind:"text",value:jt});else{const Ht=Ve(Q);Ht?(m.push({kind:"file",value:Q,path:Ht.path,displayPath:Q,downloadName:ze(Ht.path)}),jt&&m.push({kind:"text",value:jt})):m.push({kind:"text",value:B[0]})}R=Ee}return R<g.length&&m.push({kind:"text",value:g.slice(R)}),I(m)}function k(g,m){const v=[];let R=!1,B="";const K=Ee=>{Ee&&v.push({kind:"text",value:Ee})};for(const Ee of g){if(Ee.kind!=="text"){R&&(K(`${m.marker}${B}`),R=!1,B=""),v.push(Ee);continue}let Q=Ee.value;for(;Q.length>0;){const _e=Q.indexOf(m.marker);if(_e<0){R?B+=Q:K(Q);break}const he=Q.slice(0,_e);if(R?B+=he:K(he),Q=Q.slice(_e+m.marker.length),R){const Ke=B;Ke.length>0&&(!m.isValidContent||m.isValidContent(Ke))?v.push({kind:m.kind,value:Ke}):K(`${m.marker}${Ke}${m.marker}`),B="",R=!1}else R=!0}}return R&&K(`${m.marker}${B}`),v}function I(g){const m=R=>R.trim().length>0&&!/^\s/u.test(R)&&!/\s$/u.test(R);let v=k(g,{marker:"**",kind:"bold",isValidContent:m});return v=k(v,{marker:"~~",kind:"strikethrough",isValidContent:m}),v=k(v,{marker:"*",kind:"italic",isValidContent:m}),v}function $(g){const m=/\[([^\]\n]+)\]\(([^)\n]+)\)/gu,v=[];let R=0;for(const B of g.matchAll(m)){if(typeof B.index!="number")continue;const[K,Ee,Q]=B,_e=B.index,he=_e+K.length;_e>R&&v.push(...Re(g.slice(R,_e)));const Ke=be(`[${Ee??""}](${Q??""})`),jt=(Ke==null?void 0:Ke.label)??(Ee??"").trim(),Ht=(Ke==null?void 0:Ke.target)??(Q??"").trim();if(/^https?:\/\//u.test(Ht))v.push({kind:"url",value:jt||Ht,href:Ht});else{const Ct=Ve(Ht);Ct?v.push({kind:"file",value:Ht,path:Ct.path,displayPath:jt||Ht,downloadName:ze(Ct.path)}):v.push({kind:"text",value:K})}R=he}return R<g.length&&v.push(...Re(g.slice(R))),v}function q(g){if(!g.includes("`"))return $(g);const m=[];let v=0,R=0;for(;v<g.length;){if(g[v]!=="`"){v+=1;continue}let B=1;for(;v+B<g.length&&g[v+B]==="`";)B+=1;const K="`".repeat(B);let Ee=v+B,Q=-1;for(;Ee<g.length;){const he=g.indexOf(K,Ee);if(he<0)break;const Ke=he>0&&g[he-1]==="`",jt=he+B<g.length&&g[he+B]==="`",Ht=g.slice(v+B,he).includes(`
|
|
29
|
-
`);if(!Ke&&!jt&&!Ht){Q=he;break}Ee=he+1}if(Q<0){v+=B;continue}v>R&&m.push(...$(g.slice(R,v)));const _e=g.slice(v+B,Q);if(_e.length>0){const he=be(_e);if(he)if(/^https?:\/\//u.test(he.target))m.push({kind:"url",value:he.label||he.target,href:he.target});else{const Ke=Ve(he.target);Ke?m.push({kind:"file",value:he.target,path:Ke.path,displayPath:he.label||he.target,downloadName:ze(Ke.path)}):m.push({kind:"code",value:_e})}else{const Ke=Ve(_e);if(Ke){const jt=Ke.line?`${Ke.path}:${String(Ke.line)}`:Ke.path;m.push({kind:"file",value:_e,path:Ke.path,displayPath:jt,downloadName:ze(Ke.path)})}else m.push({kind:"code",value:_e})}}else m.push({kind:"text",value:`${K}${K}`});v=Q+B,R=v}return R<g.length&&m.push(...$(g.slice(R))),m}function F(g){const m=g.trim();if(!m)return"";if(m.startsWith("data:")||m.startsWith("blob:")||m.startsWith("http://")||m.startsWith("https://")||m.startsWith("/codex-local-image?"))return m;if(m.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(m)}`;const v=m.startsWith("/"),R=/^[A-Za-z]:[\\/]/u.test(m);return v||R?`/codex-local-image?path=${encodeURIComponent(m)}`:m}function P(g){const m=g.trim();if(!m)return"#";const v=Ee=>Ee.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(Ee),R=Ve(m),B=(R==null?void 0:R.path)??m,K=lt(B,ce.cwd);if(v(K)){const Ee=K.startsWith("/")?K:`/${K}`;return`/codex-local-browse${encodeURI(Ee)}`}return"#"}function H(g){return g.replace(/\r\n/gu,`
|
|
30
|
-
`)}function U(g){return g.trim().length===0}function z(g){const m=g.match(/^\s{0,3}(#{1,6})\s+(.+)$/u);return m?{level:m[1].length,value:m[2].trim()}:null}function G(g){const m=g.match(/^\s{0,3}>\s?(.*)$/u);return m?m[1]??"":null}function Te(g){var v;const m=g.match(/^\s*[-*+]\s+(.+)$/u);return((v=m==null?void 0:m[1])==null?void 0:v.trim())??null}function ve(g){var v;const m=g.match(/^\s*[-*+]\s+\[([ xX])\]\s+(.+)$/u);return m?{checked:(m[1]??" ").toLowerCase()==="x",text:((v=m[2])==null?void 0:v.trim())??""}:null}function ke(g){var v;const m=g.match(/^\s*\d+[.)]\s+(.+)$/u);return((v=m==null?void 0:m[1])==null?void 0:v.trim())??null}function Ie(g){return/^\s{0,3}(?:-{3,}|\*{3,}|_{3,})\s*$/u.test(g.trim())}function Ue(g){const m=g.match(/^\s{0,3}(```+|~~~+)\s*([^\s`~][^`]*)?\s*$/u);return m?{marker:m[1],language:(m[2]??"").trim()}:null}function tt(g){const v=H(g).split(`
|
|
31
|
-
`),R=[];let B=0;for(;B<v.length;){if(U(v[B])){B+=1;continue}const K=Ue(v[B]);if(K){B+=1;const Ct=[];for(;B<v.length;){if(v[B].trim()===K.marker){B+=1;break}Ct.push(v[B]),B+=1}R.push({kind:"codeBlock",language:K.language,value:Ct.join(`
|
|
32
|
-
`)});continue}if(Ie(v[B])){R.push({kind:"thematicBreak"}),B+=1;continue}const Ee=z(v[B]);if(Ee){R.push({kind:"heading",level:Ee.level,value:Ee.value}),B+=1;continue}if(G(v[B])!==null){const Ct=[];for(;B<v.length;){const zt=G(v[B]);if(zt===null)break;Ct.push(zt),B+=1}R.push({kind:"blockquote",value:Ct.join(`
|
|
33
|
-
`).trim()});continue}if(ve(v[B])!==null){const Ct=[];for(;B<v.length;){const zt=ve(v[B]);if(zt===null)break;Ct.push(zt),B+=1}if(Ct.length>0){R.push({kind:"taskList",items:Ct});continue}}if(Te(v[B])!==null){const Ct=[];for(;B<v.length;){const zt=Te(v[B]);if(zt===null)break;Ct.push(zt),B+=1}if(Ct.length>0){R.push({kind:"unorderedList",items:Ct});continue}}if(ke(v[B])!==null){const Ct=[];for(;B<v.length;){const zt=ke(v[B]);if(zt===null)break;Ct.push(zt),B+=1}if(Ct.length>0){R.push({kind:"orderedList",items:Ct});continue}}const jt=[];for(;B<v.length&&!(U(v[B])||Ue(v[B])||Ie(v[B])||z(v[B])||G(v[B])!==null||ve(v[B])!==null||Te(v[B])!==null||ke(v[B])!==null);)jt.push(v[B]),B+=1;const Ht=jt.join(`
|
|
34
|
-
`).trim();Ht&&R.push({kind:"paragraph",value:Ht})}return R}function Qe(g){if(!g.includes(")return tt(g);const m=[],v=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let R=0;for(const B of g.matchAll(v)){const[K,Ee,Q]=B;if(typeof B.index!="number")continue;const _e=B.index,he=_e+K.length,Ke=F(Q.trim());Ke&&(_e>R&&m.push(...tt(g.slice(R,_e))),m.push({kind:"image",url:Ke,alt:Ee.trim(),markdown:K}),R=he)}return R<g.length&&m.push(...tt(g.slice(R))),m}function ct(g){const v=H(g).split(`
|
|
35
|
-
`),R=[];let B=0,K=0;const Ee=Q=>{if(Q<=K)return;const _e=v.slice(K,Q).join(`
|
|
36
|
-
`);R.push(...Qe(_e))};for(;B<v.length;){const Q=Ue(v[B]);if(!Q){B+=1;continue}Ee(B),B+=1;const _e=[];for(;B<v.length;){if(v[B].trim()===Q.marker){B+=1;break}_e.push(v[B]),B+=1}R.push({kind:"codeBlock",language:Q.language,value:_e.join(`
|
|
37
|
-
`)}),K=B}return Ee(v.length),R.length>0?R:[{kind:"paragraph",value:g}]}function et(g){return g.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/"/gu,""").replace(/'/gu,"'")}function pt(g){return q(g).map(m=>m.kind==="text"?et(m.value):m.kind==="bold"?`<strong class="message-bold-text">${et(m.value)}</strong>`:m.kind==="italic"?`<em class="message-italic-text">${et(m.value)}</em>`:m.kind==="strikethrough"?`<s class="message-strikethrough-text">${et(m.value)}</s>`:m.kind==="file"?`<a class="message-file-link" href="${et(P(m.path))}" target="_blank" rel="noopener noreferrer" title="${et(m.path)}">${et(m.displayPath)}</a>`:m.kind==="url"?`<a class="message-file-link" href="${et(m.href)}" target="_blank" rel="noopener noreferrer" title="${et(m.href)}">${et(m.value)}</a>`:`<code class="message-inline-code">${et(m.value)}</code>`).join("")}function Je(g){return ct(g).map(m=>{if(m.kind==="paragraph")return`<p class="message-text">${pt(m.value)}</p>`;if(m.kind==="heading"){const v=Math.min(6,Math.max(1,Math.trunc(m.level))),R=fe(v),B=`message-heading ${Ae(v)}`;return`<${R} class="${B}">${pt(m.value)}</${R}>`}return m.kind==="blockquote"?`<blockquote class="message-blockquote">${pt(m.value)}</blockquote>`:m.kind==="unorderedList"?`<ul class="message-list message-list-unordered">${m.items.map(R=>`<li class="message-list-item"><div class="message-list-item-text">${pt(R)}</div></li>`).join("")}</ul>`:m.kind==="taskList"?`<ul class="message-list message-task-list">${m.items.map(R=>`<li class="message-task-item"><span class="message-task-checkbox" data-checked="${R.checked?"true":"false"}">${R.checked?"☑":"☐"}</span><div class="message-list-item-text">${pt(R.text)}</div></li>`).join("")}</ul>`:m.kind==="orderedList"?`<ol class="message-list message-list-ordered">${m.items.map(R=>`<li class="message-list-item"><div class="message-list-item-text">${pt(R)}</div></li>`).join("")}</ol>`:m.kind==="codeBlock"?`<div class="message-code-block">${m.language?`<div class="message-code-language">${et(m.language)}</div>`:""}<pre class="message-code-pre"><code>${et(m.value)}</code></pre></div>`:m.kind==="thematicBreak"?'<hr class="message-divider">':`<img class="message-image-preview message-markdown-image" src="${et(m.url)}" alt="${et(m.alt||"Embedded message image")}" loading="lazy">`}).join("")}function Ot(g){return g!==null&&typeof g=="object"&&!Array.isArray(g)?g:null}function hn(g){const m=new Date(g);return Number.isNaN(m.getTime())?g:m.toLocaleTimeString()}function ut(g){const m=Ot(g.params),v=m==null?void 0:m.reason;return typeof v=="string"?v.trim():""}function ot(g,m){return`${String(g)}:${m}`}function _t(g){const m=Ot(g.params),v=Array.isArray(m==null?void 0:m.questions)?m.questions:[],R=[];for(const B of v){const K=Ot(B);if(!K)continue;const Ee=typeof K.id=="string"?K.id:"";if(!Ee)continue;const Q=Array.isArray(K.options)?K.options.map(_e=>Ot(_e)).map(_e=>({label:typeof(_e==null?void 0:_e.label)=="string"?_e.label:"",description:typeof(_e==null?void 0:_e.description)=="string"?_e.description:""})).filter(_e=>_e.label.length>0):[];R.push({id:Ee,header:typeof K.header=="string"?K.header:"",question:typeof K.question=="string"?K.question:"",isSecret:K.isSecret===!0,isOther:K.isOther===!0,options:Q})}return R}function Pt(g,m,v){const R=ot(g,m),B=te.value[R];return typeof B=="string"&&B.length>0?B:v}function Et(g,m,v){const R=v.target;if(!(R instanceof HTMLInputElement))return;const B=ot(g,m);te.value={...te.value,[B]:R.value}}function Mt(g,m){var B;const v=Pt(g,m.id,((B=m.options[0])==null?void 0:B.label)||""),R=m.options.find(K=>K.label===v);return(R==null?void 0:R.description)??""}function In(g,m){const v=ot(g,m);return Me.value[v]??""}function Pn(g,m,v){const R=v.target;if(!(R instanceof HTMLSelectElement))return;const B=ot(g,m);te.value={...te.value,[B]:R.value}}function _n(g,m,v){const R=v.target;if(!(R instanceof HTMLInputElement))return;const B=ot(g,m);Me.value={...Me.value,[B]:R.value}}function Lt(g,m){me("respondServerRequest",{id:g,result:{decision:m}})}function Vt(g){var R;const m=_t(g),v={};for(const B of m){const K=Pt(g.id,B.id,((R=B.options[0])==null?void 0:R.label)||""),Ee=In(g.id,B.id).trim(),Q=[K,Ee].map(_e=>_e.trim()).filter(_e=>_e.length>0);v[B.id]={answers:Q}}me("respondServerRequest",{id:g.id,result:{answers:v}})}function Mn(g){me("respondServerRequest",{id:g,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function en(g){me("respondServerRequest",{id:g,result:{success:!0,contentItems:[]}})}function $n(g){me("respondServerRequest",{id:g,result:{}})}function Bn(g){me("respondServerRequest",{id:g,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function rn(g){return!(g.role!=="user"&&g.role!=="assistant"||typeof g.turnIndex!="number"||ce.isTurnInProgress||ce.isRollingBack)}function kn(g){return g.role!=="user"&&g.role!=="assistant"?!1:g.text.trim().length>0}function Fn(g){return kn(g)||rn(g)}async function pr(g){if(!kn(g))return;const m=g.text.trim();try{await navigator.clipboard.writeText(m)}catch{const v=document.createElement("textarea");v.value=m,v.setAttribute("readonly","true"),v.style.position="fixed",v.style.opacity="0",document.body.appendChild(v),v.select(),document.execCommand("copy"),document.body.removeChild(v)}}function mr(g){rn(g)&&me("rollback",{turnIndex:g.turnIndex})}function Un(){const g=Oe.value,m=ae.value;!g||!m||(g.scrollTop=g.scrollHeight,m.scrollIntoView({block:"end"}))}function Le(g){return g.scrollHeight-(g.scrollTop+g.clientHeight)<=ik}function Pe(g){if(!ce.activeThreadId)return;const m=Math.max(g.scrollHeight-g.clientHeight,0),v=m>0?Math.min(Math.max(g.scrollTop/m,0),1):1;me("updateScrollState",{threadId:ce.activeThreadId,state:{scrollTop:g.scrollTop,isAtBottom:Le(g),scrollRatio:v}})}function Tn(){const g=Oe.value;if(!g)return;const m=ce.scrollState;if(!m||m.isAtBottom){Ft();return}const v=Math.max(g.scrollHeight-g.clientHeight,0),R=typeof m.scrollRatio=="number"?m.scrollRatio*v:m.scrollTop;g.scrollTop=Math.min(Math.max(R,0),v),Pe(g)}function Ft(){const g=Oe.value;g&&(Un(),Pe(g))}function En(){const g=ce.scrollState;return!g||g.isAtBottom===!0}function On(){if(!En()){He=0,qe=0;return}if(Ft(),He-=1,He<=0){qe=0;return}qe=requestAnimationFrame(On)}function pn(g=6){En()&&(qe&&(cancelAnimationFrame(qe),qe=0),He=Math.max(g,1),qe=requestAnimationFrame(On))}function Nn(){pn(3)}function Wt(){if(!En())return;const g=Oe.value;if(!g)return;const m=g.querySelectorAll("img.message-image-preview");for(const v of m)v.complete||Fe.has(v)||(Fe.add(v),v.addEventListener("load",Nn,{once:!0}),v.addEventListener("error",Nn,{once:!0}))}async function Cn(){await qt(),Ne&&cancelAnimationFrame(Ne),Ne=requestAnimationFrame(()=>{Ne=0,Tn(),Wt(),pn()})}mt(()=>ce.messages,async g=>{if(!ce.isLoading){for(const m of g){if(m.messageType!=="commandExecution"||!m.commandExecution)continue;const v=o.value[m.id],R=m.commandExecution.status;v==="inProgress"&&R!=="inProgress"&&ne(m.id),o.value[m.id]=R}await Cn()}}),mt(()=>ce.pendingRequests,async()=>{ce.isLoading||await Cn()},{deep:!0}),mt(()=>ce.liveOverlay,async g=>{g&&(await qt(),Ft(),pn(8))},{deep:!0}),mt(()=>ce.isLoading,async g=>{g||await Cn()}),mt(()=>ce.activeThreadId,()=>{le.value="",xe.value=new Set},{flush:"post"});function Xn(){const g=Oe.value;!g||ce.isLoading||Pe(g)}function An(g){le.value=F(g)}function xn(g,m){return`${g}:${String(m)}`}function A(g,m){const v=new Set(xe.value);v.add(xn(g,m)),xe.value=v}function j(g,m){return xe.value.has(xn(g,m))}function re(){le.value=""}function je(){const g=X.value;g&&(g.scrollTop=g.scrollHeight)}return mt(()=>{var g;return(g=ce.liveOverlay)==null?void 0:g.reasoningText},async g=>{g&&(await qt(),je())}),Nr(()=>{Ne&&cancelAnimationFrame(Ne),qe&&cancelAnimationFrame(qe)}),(g,m)=>(p(),w("section",Rw,[e.isLoading?(p(),w("p",Pw,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(p(),w("p",Mw," No messages in this thread yet. ")):(p(),w("ul",{key:2,ref_key:"conversationListRef",ref:Oe,class:"conversation-list",onScroll:Xn},[(p(!0),w($e,null,dt(e.messages,v=>{var R,B;return p(),w("li",{key:v.id,class:ft(["conversation-item",{"conversation-item-actionable":Fn(v)}]),"data-role":v.role,"data-message-type":v.messageType||""},[l(v)?(p(),w("div",Ow,[y("div",Nw,[y("button",{type:"button",class:ft(["cmd-row",[se(v),{"cmd-expanded":T(v)}]]),onClick:K=>O(v)},[y("span",{class:ft(["cmd-chevron",{"cmd-chevron-open":T(v)}])},"▶",2),y("code",Lw,W(((R=v.commandExecution)==null?void 0:R.command)||"(command)"),1),y("span",jw,W(L(v)),1)],10,Dw),y("div",{class:ft(["cmd-output-wrap",{"cmd-output-visible":T(v),"cmd-output-collapsing":N(v)}])},[y("div",Bw,[y("pre",Fw,W(((B=v.commandExecution)==null?void 0:B.aggregatedOutput)||"(no output)"),1)])],2)])])):(p(),w("div",{key:1,class:"message-row","data-role":v.role,"data-message-type":v.messageType||""},[y("div",{class:"message-stack","data-role":v.role},[y("article",{class:"message-body","data-role":v.role},[v.images&&v.images.length>0?(p(),w("ul",{key:0,class:"message-image-list","data-role":v.role},[(p(!0),w($e,null,dt(v.images,K=>(p(),w("li",{key:K,class:"message-image-item"},[y("button",{class:"message-image-button",type:"button",onClick:Ee=>An(K)},[y("img",{class:"message-image-preview",src:F(K),alt:"Message image preview",loading:"lazy"},null,8,Gw)],8,zw)]))),128))],8,Ww)):ue("",!0),v.fileAttachments&&v.fileAttachments.length>0?(p(),w("div",qw,[(p(!0),w($e,null,dt(v.fileAttachments,K=>(p(),w("span",{key:K.path,class:"message-file-chip"},[m[1]||(m[1]=y("span",{class:"message-file-chip-icon"},"📄",-1)),y("a",{class:"message-file-link message-file-chip-name",href:P(K.path),target:"_blank",rel:"noopener noreferrer",title:K.path},W(K.path),9,Kw)]))),128))])):ue("",!0),v.text.length>0?(p(),w("article",{key:2,class:"message-card","data-role":v.role},[v.messageType==="worked"?(p(),w("div",Yw,[y("button",{type:"button",class:"worked-separator",onClick:K=>J(v)},[m[2]||(m[2]=y("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),y("span",{class:ft(["worked-chevron",{"worked-chevron-open":ie(v)}])},"▶",2),y("p",Xw,W(v.text),1),m[3]||(m[3]=y("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Qw),ie(v)?(p(),w("div",Zw,[(p(!0),w($e,null,dt(we(e.messages,e.messages.indexOf(v)),K=>{var Ee,Q;return p(),w("div",{key:`worked-cmd-${K.id}`,class:"worked-cmd-item"},[y("button",{type:"button",class:ft(["cmd-row",[se(K),{"cmd-expanded":T(K)}]]),onClick:_e=>O(K)},[y("span",{class:ft(["cmd-chevron",{"cmd-chevron-open":T(K)}])},"▶",2),y("code",tb,W(((Ee=K.commandExecution)==null?void 0:Ee.command)||"(command)"),1),y("span",nb,W(L(K)),1)],10,eb),y("div",{class:ft(["cmd-output-wrap",{"cmd-output-visible":T(K),"cmd-output-collapsing":N(K)}])},[y("div",rb,[y("pre",sb,W(((Q=K.commandExecution)==null?void 0:Q.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):ue("",!0)])):d(v)?(p(),w("div",{key:1,class:"plan-card","data-streaming":v.messageType==="plan.live"},[y("div",ib,[m[4]||(m[4]=y("p",{class:"plan-card-title"},"Plan",-1)),v.messageType==="plan.live"?(p(),w("span",ab,"Updating")):ue("",!0)]),c(v)?(p(),w("div",{key:0,class:"plan-card-explanation plan-card-markdown",innerHTML:Je(c(v))},null,8,lb)):ue("",!0),h(v).length>0?(p(),w("ol",cb,[(p(!0),w($e,null,dt(h(v),(K,Ee)=>(p(),w("li",{key:`${v.id}:plan-step:${Ee}`,class:"plan-step-item","data-status":K.status},[y("span",{class:"plan-step-status","data-status":K.status},W(b(K.status)),9,db),y("div",{class:"plan-step-text plan-card-markdown",innerHTML:Je(K.step)},null,8,fb)],8,ub))),128))])):(p(),w("div",{key:2,class:"plan-card-markdown",innerHTML:Je(v.text)},null,8,hb))],8,ob)):(p(),w("div",pb,[(p(!0),w($e,null,dt(ct(v.text),(K,Ee)=>(p(),w($e,{key:`block-${Ee}`},[K.kind==="paragraph"?(p(),w("p",mb,[(p(!0),w($e,null,dt(q(K.value),(Q,_e)=>(p(),w($e,{key:`seg-${Ee}-${_e}`},[Q.kind==="text"?(p(),w("span",gb,W(Q.value),1)):Q.kind==="bold"?(p(),w("strong",vb,W(Q.value),1)):Q.kind==="italic"?(p(),w("em",yb,W(Q.value),1)):Q.kind==="strikethrough"?(p(),w("s",wb,W(Q.value),1)):Q.kind==="file"?(p(),w("a",{key:4,class:"message-file-link",href:P(Q.path),target:"_blank",rel:"noopener noreferrer",title:Q.path},W(Q.displayPath),9,bb)):Q.kind==="url"?(p(),w("a",{key:5,class:"message-file-link",href:Q.href,target:"_blank",rel:"noopener noreferrer",title:Q.href},W(Q.value),9,_b)):(p(),w("code",kb,W(Q.value),1))],64))),128))])):K.kind==="heading"?(p(),vt(ai(fe(K.level)),{key:1,class:ft(["message-heading",Ae(K.level)])},{default:kt(()=>[(p(!0),w($e,null,dt(q(K.value),(Q,_e)=>(p(),w($e,{key:`heading-seg-${Ee}-${_e}`},[Q.kind==="text"?(p(),w("span",Tb,W(Q.value),1)):Q.kind==="bold"?(p(),w("strong",Sb,W(Q.value),1)):Q.kind==="italic"?(p(),w("em",Ib,W(Q.value),1)):Q.kind==="strikethrough"?(p(),w("s",Eb,W(Q.value),1)):Q.kind==="file"?(p(),w("a",{key:4,class:"message-file-link",href:P(Q.path),target:"_blank",rel:"noopener noreferrer",title:Q.path},W(Q.displayPath),9,Cb)):Q.kind==="url"?(p(),w("a",{key:5,class:"message-file-link",href:Q.href,target:"_blank",rel:"noopener noreferrer",title:Q.href},W(Q.value),9,Ab)):(p(),w("code",xb,W(Q.value),1))],64))),128))]),_:2},1032,["class"])):K.kind==="blockquote"?(p(),w("blockquote",Rb,[(p(!0),w($e,null,dt(q(K.value),(Q,_e)=>(p(),w($e,{key:`quote-seg-${Ee}-${_e}`},[Q.kind==="text"?(p(),w("span",Pb,W(Q.value),1)):Q.kind==="bold"?(p(),w("strong",Mb,W(Q.value),1)):Q.kind==="italic"?(p(),w("em",$b,W(Q.value),1)):Q.kind==="strikethrough"?(p(),w("s",Ob,W(Q.value),1)):Q.kind==="file"?(p(),w("a",{key:4,class:"message-file-link",href:P(Q.path),target:"_blank",rel:"noopener noreferrer",title:Q.path},W(Q.displayPath),9,Nb)):Q.kind==="url"?(p(),w("a",{key:5,class:"message-file-link",href:Q.href,target:"_blank",rel:"noopener noreferrer",title:Q.href},W(Q.value),9,Db)):(p(),w("code",Lb,W(Q.value),1))],64))),128))])):K.kind==="unorderedList"?(p(),w("ul",jb,[(p(!0),w($e,null,dt(K.items,(Q,_e)=>(p(),w("li",{key:`ul-${Ee}-${_e}`,class:"message-list-item"},[y("div",Bb,[(p(!0),w($e,null,dt(q(Q),(he,Ke)=>(p(),w($e,{key:`ul-seg-${Ee}-${_e}-${Ke}`},[he.kind==="text"?(p(),w("span",Fb,W(he.value),1)):he.kind==="bold"?(p(),w("strong",Ub,W(he.value),1)):he.kind==="italic"?(p(),w("em",Hb,W(he.value),1)):he.kind==="strikethrough"?(p(),w("s",Vb,W(he.value),1)):he.kind==="file"?(p(),w("a",{key:4,class:"message-file-link",href:P(he.path),target:"_blank",rel:"noopener noreferrer",title:he.path},W(he.displayPath),9,Wb)):he.kind==="url"?(p(),w("a",{key:5,class:"message-file-link",href:he.href,target:"_blank",rel:"noopener noreferrer",title:he.href},W(he.value),9,zb)):(p(),w("code",Gb,W(he.value),1))],64))),128))])]))),128))])):K.kind==="taskList"?(p(),w("ul",qb,[(p(!0),w($e,null,dt(K.items,(Q,_e)=>(p(),w("li",{key:`task-${Ee}-${_e}`,class:"message-task-item"},[y("span",{class:"message-task-checkbox","data-checked":Q.checked},W(Q.checked?"☑":"☐"),9,Kb),y("div",Jb,[(p(!0),w($e,null,dt(q(Q.text),(he,Ke)=>(p(),w($e,{key:`task-seg-${Ee}-${_e}-${Ke}`},[he.kind==="text"?(p(),w("span",Yb,W(he.value),1)):he.kind==="bold"?(p(),w("strong",Qb,W(he.value),1)):he.kind==="italic"?(p(),w("em",Xb,W(he.value),1)):he.kind==="strikethrough"?(p(),w("s",Zb,W(he.value),1)):he.kind==="file"?(p(),w("a",{key:4,class:"message-file-link",href:P(he.path),target:"_blank",rel:"noopener noreferrer",title:he.path},W(he.displayPath),9,e_)):he.kind==="url"?(p(),w("a",{key:5,class:"message-file-link",href:he.href,target:"_blank",rel:"noopener noreferrer",title:he.href},W(he.value),9,t_)):(p(),w("code",n_,W(he.value),1))],64))),128))])]))),128))])):K.kind==="orderedList"?(p(),w("ol",r_,[(p(!0),w($e,null,dt(K.items,(Q,_e)=>(p(),w("li",{key:`ol-${Ee}-${_e}`,class:"message-list-item"},[y("div",s_,[(p(!0),w($e,null,dt(q(Q),(he,Ke)=>(p(),w($e,{key:`ol-seg-${Ee}-${_e}-${Ke}`},[he.kind==="text"?(p(),w("span",o_,W(he.value),1)):he.kind==="bold"?(p(),w("strong",i_,W(he.value),1)):he.kind==="italic"?(p(),w("em",a_,W(he.value),1)):he.kind==="strikethrough"?(p(),w("s",l_,W(he.value),1)):he.kind==="file"?(p(),w("a",{key:4,class:"message-file-link",href:P(he.path),target:"_blank",rel:"noopener noreferrer",title:he.path},W(he.displayPath),9,c_)):he.kind==="url"?(p(),w("a",{key:5,class:"message-file-link",href:he.href,target:"_blank",rel:"noopener noreferrer",title:he.href},W(he.value),9,u_)):(p(),w("code",d_,W(he.value),1))],64))),128))])]))),128))])):K.kind==="codeBlock"?(p(),w("div",f_,[K.language?(p(),w("div",h_,W(K.language),1)):ue("",!0),y("pre",p_,[y("code",null,W(K.value),1)])])):K.kind==="thematicBreak"?(p(),w("hr",m_)):j(v.id,Ee)?(p(),w("p",g_,W(K.markdown),1)):(p(),w("button",{key:9,class:"message-image-button",type:"button",onClick:Q=>An(K.url)},[y("img",{class:"message-image-preview message-markdown-image",src:K.url,alt:K.alt||"Embedded message image",loading:"lazy",onError:Q=>A(v.id,Ee)},null,40,y_)],8,v_))],64))),128))]))],8,Jw)):ue("",!0)],8,Vw),Fn(v)?(p(),w("div",w_,[kn(v)?(p(),w("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:K=>pr(v)},[De(xw,{class:"message-action-icon"}),m[5]||(m[5]=y("span",{class:"message-action-label"},"Copy",-1))],8,b_)):ue("",!0),rn(v)?(p(),w("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:K=>mr(v)},[De(Iw,{class:"message-action-icon"}),m[6]||(m[6]=y("span",{class:"message-action-label"},"Rollback",-1))],8,__)):ue("",!0)])):ue("",!0)],8,Hw)],8,Uw))],10,$w)}),128)),e.liveOverlay?(p(),w("li",k_,[y("div",T_,[y("div",S_,[y("article",I_,[y("p",E_,W(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(p(),w("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:X},W(e.liveOverlay.reasoningText),513)):ue("",!0),e.liveOverlay.errorText?(p(),w("p",C_,W(e.liveOverlay.errorText),1)):ue("",!0)])])])])):ue("",!0),(p(!0),w($e,null,dt(e.pendingRequests,v=>(p(),w("li",{key:`server-request:${v.id}`,class:"conversation-item conversation-item-request"},[y("div",A_,[y("div",x_,[y("article",R_,[y("p",P_,W(v.method),1),y("p",M_,"Request #"+W(v.id)+" · "+W(hn(v.receivedAtIso)),1),ut(v)?(p(),w("p",$_,W(ut(v)),1)):ue("",!0),v.method==="item/commandExecution/requestApproval"?(p(),w("section",O_,[y("button",{type:"button",class:"request-button request-button-primary",onClick:R=>Lt(v.id,"accept")},"Accept",8,N_),y("button",{type:"button",class:"request-button",onClick:R=>Lt(v.id,"acceptForSession")},"Accept for Session",8,D_),y("button",{type:"button",class:"request-button",onClick:R=>Lt(v.id,"decline")},"Decline",8,L_),y("button",{type:"button",class:"request-button",onClick:R=>Lt(v.id,"cancel")},"Cancel",8,j_)])):v.method==="item/fileChange/requestApproval"?(p(),w("section",B_,[y("button",{type:"button",class:"request-button request-button-primary",onClick:R=>Lt(v.id,"accept")},"Accept",8,F_),y("button",{type:"button",class:"request-button",onClick:R=>Lt(v.id,"acceptForSession")},"Accept for Session",8,U_),y("button",{type:"button",class:"request-button",onClick:R=>Lt(v.id,"decline")},"Decline",8,H_),y("button",{type:"button",class:"request-button",onClick:R=>Lt(v.id,"cancel")},"Cancel",8,V_)])):v.method==="item/tool/requestUserInput"?(p(),w("section",W_,[(p(!0),w($e,null,dt(_t(v),R=>{var B;return p(),w("div",{key:`${v.id}:${R.id}`,class:"request-question"},[y("p",z_,W(R.header||R.question),1),R.header&&R.question?(p(),w("p",G_,W(R.question),1)):ue("",!0),R.options.length>0?(p(),w("select",{key:1,class:"request-select",value:Pt(v.id,R.id,((B=R.options[0])==null?void 0:B.label)||""),onChange:K=>Pn(v.id,R.id,K)},[(p(!0),w($e,null,dt(R.options,K=>(p(),w("option",{key:`${v.id}:${R.id}:${K.label}`,value:K.label},W(K.label),9,K_))),128))],40,q_)):ue("",!0),R.options.length>0&&Mt(v.id,R)?(p(),w("p",J_,W(Mt(v.id,R)),1)):(p(),w("input",{key:3,class:"request-input",type:R.isSecret?"password":"text",value:Pt(v.id,R.id,""),placeholder:R.isSecret?"Enter secret answer":"Enter answer",onInput:K=>Et(v.id,R.id,K)},null,40,Y_)),R.isOther?(p(),w("input",{key:4,class:"request-input",type:R.isSecret?"password":"text",value:In(v.id,R.id),placeholder:"Other answer",onInput:K=>_n(v.id,R.id,K)},null,40,Q_)):ue("",!0)])}),128)),y("button",{type:"button",class:"request-button request-button-primary",onClick:R=>Vt(v)}," Submit Answers ",8,X_)])):v.method==="item/tool/call"?(p(),w("section",Z_,[y("button",{type:"button",class:"request-button request-button-primary",onClick:R=>Mn(v.id)},"Fail Tool Call",8,ek),y("button",{type:"button",class:"request-button",onClick:R=>en(v.id)},"Success (Empty)",8,tk)])):(p(),w("section",nk,[y("button",{type:"button",class:"request-button request-button-primary",onClick:R=>$n(v.id)},"Return Empty Result",8,rk),y("button",{type:"button",class:"request-button",onClick:R=>Bn(v.id)},"Reject Request",8,sk)]))])])])]))),128)),y("li",{ref_key:"bottomAnchorRef",ref:ae,class:"conversation-bottom-anchor"},null,512)],544)),le.value.length>0?(p(),w("div",{key:3,class:"image-modal-backdrop",onClick:re},[y("div",{class:"image-modal-content",onClick:m[0]||(m[0]=wt(()=>{},["stop"]))},[y("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:re},[De(El,{class:"icon-svg"})]),y("img",{class:"image-modal-image",src:le.value,alt:"Expanded message image"},null,8,ok)])])):ue("",!0)]))}}),lk=ht(ak,[["__scopeId","data-v-98e78ec9"]]),ou=.0025,aa=3,iu=2,ck=256;function uk(e){var Oe;const t=D("idle"),n=D(typeof navigator<"u"&&!!((Oe=navigator.mediaDevices)!=null&&Oe.getUserMedia)),r=D(0),s=D(null);let o=null,i=null,a=[],l=null,d=null,c=null,h=null,b=[],T=!1,N=!1;function O(){const ae=s.value;if(!ae||typeof window>"u")return;const X=ae.getContext("2d");if(!X)return;const le=Math.max(1,Math.floor(ae.clientWidth)),te=Math.max(1,Math.floor(ae.clientHeight||36)),Me=window.devicePixelRatio||1,Ne=Math.max(1,Math.floor(le*Me)),qe=Math.max(1,Math.floor(te*Me));(ae.width!==Ne||ae.height!==qe)&&(ae.width=Ne,ae.height=qe),X.setTransform(Me,0,0,Me,0,0),X.clearRect(0,0,le,te);const He=Math.max(12,Math.floor(le/(aa+iu))),Fe=b.slice(-He),xe=Math.max(0,He-Fe.length),nt=te/2,ze=getComputedStyle(ae).color||"#000000";for(let Be=0;Be<He;Be+=1){const at=Fe[Be-xe]??0,it=Math.max(.08,Math.min(1,at*18))*nt,lt=Be*(aa+iu);X.globalAlpha=at<=ou?.35:1,X.fillStyle=ze,X.fillRect(lt,nt-it,aa,it*2)}X.globalAlpha=1}function J(){b=[],r.value=0,O()}function ie(){c&&(c.disconnect(),c.onaudioprocess=null,c=null),d&&(d.disconnect(),d=null),l&&(l.close(),l=null),h=null}function L(ae){if(typeof window>"u")return;const X=window.webkitAudioContext,le=window.AudioContext??X;le&&(ie(),J(),l=new le,d=l.createMediaStreamSource(ae),c=l.createScriptProcessor(2048,1,1),h=performance.now(),c.onaudioprocess=te=>{const Me=te.inputBuffer.getChannelData(0);let Ne=0;for(let qe=0;qe<Me.length;qe+=1){const He=Math.abs(Me[qe]??0);Ne+=He<ou?0:He}b.push(Ne/Me.length),b.length>ck&&b.shift(),h!==null&&(r.value=Math.max(0,performance.now()-h)),O()},d.connect(c),c.connect(l.destination),O())}async function se(){var ae;if(!(t.value!=="idle"||!n.value||T)){T=!0,N=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),a=[],o=new MediaRecorder(i),o.ondataavailable=X=>{X.data.size>0&&a.push(X.data)},o.onstop=()=>{var te;const X=a,le=(o==null?void 0:o.mimeType)||((te=X[0])==null?void 0:te.type)||"audio/webm";ce(),we(X,le)},L(i),o.start(250),t.value="recording",N&&ne()}catch(X){ce(),t.value="idle",(ae=e.onError)==null||ae.call(e,X)}finally{T=!1}}}function ne(){if(T&&t.value==="idle"){N=!0;return}if(!(t.value!=="recording"||!o)&&o.state!=="inactive"){t.value="transcribing";try{o.requestData()}catch{}o.stop()}}async function we(ae,X){var te,Me,Ne,qe;if(ae.length===0){(te=e.onEmpty)==null||te.call(e),t.value="idle";return}const le=new Blob(ae,{type:X});t.value="transcribing";try{const He=X.split(/[/;]/)[1]??"webm",Fe=new FormData;Fe.append("file",le,`codex.${He}`);const xe=await fetch("/codex-api/transcribe",{method:"POST",body:Fe}),nt=await xe.text();let ze=null;try{ze=nt.trim()?JSON.parse(nt):null}catch{ze=null}if(!xe.ok){const at=(Me=ze==null?void 0:ze.error)==null?void 0:Me.trim(),Dt=nt.trim();throw new Error(at||Dt||`Transcription failed: ${xe.status}`)}const Be=((ze==null?void 0:ze.text)??"").trim();Be.length>0?e.onTranscript(Be):(Ne=e.onEmpty)==null||Ne.call(e)}catch(He){(qe=e.onError)==null||qe.call(e,He)}finally{t.value="idle"}}function ce(){ie(),J(),o&&(o.ondataavailable=null,o.onstop=null,o=null),i&&(i.getTracks().forEach(ae=>ae.stop()),i=null),a=[]}Nr(ce);function me(){if(t.value==="recording"){ne();return}t.value==="idle"&&se()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:s,startRecording:se,stopRecording:ne,toggleRecording:me}}function au(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Ir extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Cl(e,t){const n=au(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=au(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function gs(e,t,n){return e instanceof Ir?e:e instanceof Error?new Ir(e.message||t,{code:"unknown_error",method:n}):new Ir(t,{code:"unknown_error",method:n})}function Nf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function dk(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 Ir(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 Ir(Cl(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 Ir(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function fk(e){const t=Nf(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 lu(e,t={ok:!0}){e({method:"ready",params:t,atIso:new Date().toISOString()})}function hk(e){if(typeof window>"u")return()=>{};let t=null,n=!1,r=null;const s=()=>{r!==null&&(window.clearTimeout(r),r=null)},o=(d,c)=>{if(n||r!==null)return;const h=Math.min(1e3*2**c,1e4);r=window.setTimeout(()=>{r=null,!n&&d()},h)},i=d=>{const c=fk(d);c&&e(c)},a=(d=0)=>{if(typeof EventSource>"u"||n)return;t==null||t();const c=new EventSource("/codex-api/events");let h=!1;c.onmessage=b=>{try{i(JSON.parse(b.data))}catch{}},c.addEventListener("ready",b=>{try{const T=b.data?JSON.parse(b.data):{ok:!0};lu(e,T)}catch{lu(e)}}),c.onerror=()=>{n||h||c.readyState===EventSource.CLOSED&&(h=!0,c.close(),o(()=>a(d+1),d))},t=()=>{h=!0,c.close()}},l=(d=0)=>{if(typeof WebSocket>"u"||n){a();return}t==null||t();const c=window.location.protocol==="https:"?"wss:":"ws:",h=new WebSocket(`${c}//${window.location.host}/codex-api/ws`);let b=!1,T=!1,N=window.setTimeout(()=>{b||n||T||(T=!0,h.close(),a())},2500);h.onopen=()=>{b=!0,s(),N!==null&&(window.clearTimeout(N),N=null)},h.onmessage=O=>{try{i(JSON.parse(String(O.data)))}catch{}},h.onerror=()=>{},h.onclose=()=>{if(N!==null&&(window.clearTimeout(N),N=null),!(n||T)){if(!b){a();return}o(()=>l(d+1),d)}},t=()=>{T=!0,N!==null&&(window.clearTimeout(N),N=null),h.close()}};return typeof WebSocket<"u"?l():a(),()=>{n=!0,s(),t==null||t()}}async function pk(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 Ir(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 Ir(Cl(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function mk(){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 Ir(Cl(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Nf(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function cu(e){return new Date(e*1e3).toISOString()}function gk(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function vk(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const yk=/^##\s+(.+?):\s+(.+?)\s*$/,wk=/^#\s*files mentioned by the user\s*:?\s*$/i;function bk(e){var s,o;const t=e.split(`
|
|
38
|
-
`).findIndex(i=>wk.test(i.trim()));if(t<0)return[];const n=e.split(`
|
|
39
|
-
`).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(yk);if(!l)break;const d=(s=l[1])==null?void 0:s.trim(),c=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");d&&c&&r.push({label:d,path:c})}return r}function _k(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 kk(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:vk(l),isUnhandled:!0});const o=n.join(`
|
|
40
|
-
`),i=bk(o);return{text:_k(o),images:r,fileAttachments:i,rawBlocks:s}}function Tk(e){var o;const t=e.replace(/\r\n/g,`
|
|
41
|
-
`).trim();if(!t)return null;const n=t.split(`
|
|
42
|
-
`),r=[],s=[];for(const i of n){const a=i.trim();if(!a){r.length===0&&s.push("");continue}const l=a.match(/^[-*]\s+\[([ xX~>|-])\]\s+(.+)$/);if(l){const d=(l[1]??" ").toLowerCase(),c=(o=l[2])==null?void 0:o.trim();if(!c)continue;let h="pending";d==="x"&&(h="completed"),(d==="~"||d===">"||d==="-")&&(h="inProgress"),r.push({step:c,status:h});continue}s.push(a)}return r.length===0?null:{explanation:s.join(`
|
|
43
|
-
`).trim()||void 0,steps:r}}function Sk(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=kk(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==="plan"){const t=typeof e.text=="string"?e.text:"";return[{id:e.id,role:"assistant",text:t,messageType:"plan",plan:Tk(t)??void 0}]}if(e.type==="commandExecution"){const t=e,n=Ik(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 Ik(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Ek(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Ck(e){const t=Ek(e);return t.length>0?t:"Untitled thread"}function Df(e){return(e==null?void 0:e.status)==="inProgress"}function Ak(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 Df(r)}function xk(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:Ck(e),projectName:gk(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:cu(e.createdAt),updatedAtIso:cu(e.updatedAt),preview:e.preview,unread:!1,inProgress:Ak(e)}}function Rk(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 Pk(e){const t=e.data.map(xk);return Rk(t)}function Lf(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const s=t[r],o=Array.isArray(s.items)?s.items:[];for(const i of o)for(const a of Sk(i))n.push({...a,turnIndex:r})}return n}function Mk(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return Df(t.at(-1))}function la(e){return e&&e.length>0?e:null}const uu=[{value:"default",label:"Default"},{value:"plan",label:"Plan"}];function ko(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function Xo(e){return typeof e=="string"&&e.length>0?e:null}function ca(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function du(e){return typeof e=="boolean"?e:null}function fu(e){const t=ko(e);if(!t)return null;const n=ca(t.usedPercent??t.used_percent);return n===null?null:{usedPercent:n,windowMinutes:ca(t.windowDurationMins??t.window_minutes),resetsAt:ca(t.resetsAt??t.resets_at)}}function $k(e){const t=ko(e);if(!t)return null;const n=du(t.hasCredits??t.has_credits),r=du(t.unlimited);return n===null||r===null?null:{hasCredits:n,unlimited:r,balance:Xo(t.balance)}}function hu(e){const t=ko(e);if(!t)return null;const n=fu(t.primary),r=fu(t.secondary),s=$k(t.credits);return!n&&!r&&!s?null:{limitId:Xo(t.limitId??t.limit_id),limitName:Xo(t.limitName??t.limit_name),primary:n,secondary:r,credits:s,planType:Xo(t.planType??t.plan_type)}}function jf(e){const t=ko(e);if(!t)return null;const n=ko(t.rateLimitsByLimitId??t.rate_limits_by_limit_id),r=hu(n==null?void 0:n.codex);return r||hu(t.rateLimits??t.rate_limits)}async function fn(e,t){try{return await dk(e,t)}catch(n){throw gs(n,`RPC ${e} failed`,e)}}function Ok(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Nk(){const e=await fn("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return Pk(e)}async function Dk(e){const t=await fn("thread/read",{threadId:e,includeTurns:!0});return{messages:Lf(t),inProgress:Mk(t)}}async function Lk(){try{return await Nk()}catch(e){throw gs(e,"Failed to load thread groups","thread/list")}}async function jk(e){try{return await Dk(e)}catch(t){throw gs(t,`Failed to load thread ${e}`,"thread/read")}}function Bk(e){return hk(e)}async function Fk(e,t){await pk({id:e,...t})}async function Uk(){return mk()}async function Hk(){try{const e=await fn("account/rateLimits/read");return jf(e)}catch(e){throw gs(e,"Failed to load account rate limits","account/rateLimits/read")}}async function ua(e){await fn("thread/resume",{threadId:e})}async function Vk(e){await fn("thread/archive",{threadId:e})}async function Wk(e,t){await fn("thread/name/set",{threadId:e,name:t})}async function pu(e,t){const n=await fn("thread/rollback",{threadId:e,numTurns:t});return Lf(n)}function zk(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 mu(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 fn("thread/start",n),s=zk(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw gs(n,"Failed to start a new thread","thread/start")}}function Gk(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
|
|
44
|
-
`;for(const r of t)n+=`
|
|
45
|
-
## ${r.label}: ${r.path}
|
|
46
|
-
`;return`${n}
|
|
47
|
-
## My request for Codex:
|
|
48
|
-
|
|
49
|
-
${e}
|
|
50
|
-
`}async function qk(e,t){var a;const n=(e==null?void 0:e.trim())??"";if(n)return{model:n,reasoningEffort:la(t)};let r=null;try{r=await Ff()}catch{r=null}const s=(r==null?void 0:r.model.trim())??"";if(s)return{model:s,reasoningEffort:la(t??(r==null?void 0:r.reasoningEffort))};let o=[];try{o=await Bf()}catch{o=[]}const i=((a=o.find(l=>l.trim().length>0))==null?void 0:a.trim())??"";if(i)return{model:i,reasoningEffort:la(t??(r==null?void 0:r.reasoningEffort))};throw new Error("Plan mode requires an available model. Wait for models to load and try again.")}async function da(e,t,n=[],r,s,o,i=[],a){try{const l=(r==null?void 0:r.trim())??"",c=[{type:"text",text:Gk(t,i)}];for(const T of n){const N=T.trim();N&&c.push({type:"image",url:N,image_url:N})}if(o)for(const T of o)c.push({type:"skill",name:T.name,path:T.path});const h=i.map(T=>({label:T.label,path:T.path,fsPath:T.fsPath})),b={threadId:e,input:c};if(h.length>0&&(b.attachments=h),l&&(b.model=l),typeof s=="string"&&s.length>0&&(b.effort=s),a==="plan"){const T=await qk(l,s);b.collaborationMode={mode:"plan",settings:{model:T.model,reasoning_effort:T.reasoningEffort,developer_instructions:null}}}await fn("turn/start",b)}catch(l){throw gs(l,`Failed to start turn for thread ${e}`,"turn/start")}}async function Kk(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 fn("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw gs(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function Jk(e){await fn("setDefaultModel",{model:e})}async function Bf(){const e=await fn("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 Ff(){const e=await fn("config/read",{}),t=e.config.model??"",n=Ok(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function Yk(e){const t=e.trim();return t?t.replace(/[_-]+/g," ").replace(/\b\w/g,n=>n.toUpperCase()):""}async function Qk(){try{const e=await fn("collaborationMode/list",{}),t=new Set,n=[];for(const r of e.data){const s=r.mode;s!=="default"&&s!=="plan"||t.has(s)||(t.add(s),n.push({value:s,label:Yk(r.name||s)||(s==="plan"?"Plan":"Default")}))}if(n.length>0){for(const r of uu)t.has(r.value)||n.push(r);return n.sort((r,s)=>r.value===s.value?0:r.value==="default"?-1:1)}}catch{}return uu}function Xk(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 Zs(){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 Xk(n.data)}async function Zk(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 gu(){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 vu(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 e0(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=Al(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 t0(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=Al(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 n0(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=Al(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 h=d.path,b=typeof h=="string"?h.trim():"";b&&l.push({path:b})}return l}async function r0(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 Al(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 s0(){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 fa(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 o0(e,t){var n;try{return((n=(await fn("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function i0(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await fn("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 yu(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 a0={},l0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function c0(e,t){return p(),w("svg",l0,[...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 u0=ht(a0,[["render",c0]]),d0={},f0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function h0(e,t){return p(),w("svg",f0,[...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 p0=ht(d0,[["render",h0]]),m0={},g0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function v0(e,t){return p(),w("svg",g0,[...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 wu=ht(m0,[["render",v0]]),y0=["disabled"],w0={class:"composer-dropdown-value"},b0={class:"composer-dropdown-menu"},_0={key:0,class:"composer-dropdown-search-wrap"},k0=["placeholder","onKeydown"],T0={class:"composer-dropdown-options",role:"listbox"},S0=["onClick"],I0={key:0,class:"composer-dropdown-empty"},E0={key:1,class:"composer-dropdown-add-wrap"},C0=["placeholder","onKeydown"],A0=Zt({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(null),a=D(!1),l=D(""),d=D(!1),c=D(""),h=pe(()=>{var le;const X=n.options.find(te=>te.value===n.modelValue);return X?X.label:((le=n.placeholder)==null?void 0:le.trim())||""}),b=pe(()=>n.openDirection??"down"),T=pe(()=>n.enableSearch===!0),N=pe(()=>n.showAddAction===!0),O=pe(()=>{var X;return((X=n.searchPlaceholder)==null?void 0:X.trim())||"Quick search projects"}),J=pe(()=>{var X;return((X=n.addActionLabel)==null?void 0:X.trim())||"Add new project"}),ie=pe(()=>{var X;return((X=n.addPlaceholder)==null?void 0:X.trim())||"Project name or absolute path"}),L=pe(()=>{const X=l.value.trim().toLowerCase();return X?n.options.filter(le=>le.label.toLowerCase().includes(X)||le.value.toLowerCase().includes(X)):n.options});function se(){n.disabled||(a.value=!a.value)}function ne(X){r("update:modelValue",X),a.value=!1,l.value=""}function we(){var X;d.value=!0,c.value=((X=n.defaultAddValue)==null?void 0:X.trim())||"",qt(()=>{var le;return(le=i.value)==null?void 0:le.focus()})}function ce(){if(l.value.length>0){l.value="";return}a.value=!1}function me(){const X=c.value.trim();X&&(r("add",X),d.value=!1,c.value="",a.value=!1,l.value="")}function Oe(){d.value=!1,c.value="",a.value=!1,l.value=""}function ae(X){if(!a.value)return;const le=s.value;if(!le)return;const te=X.target;te instanceof Node&&(le.contains(te)||(a.value=!1,l.value="",d.value=!1,c.value=""))}return mt(a,X=>{if(!X){d.value=!1,c.value="";return}T.value&&qt(()=>{var le;return(le=o.value)==null?void 0:le.focus()})}),Or(()=>{window.addEventListener("pointerdown",ae)}),Nr(()=>{window.removeEventListener("pointerdown",ae)}),(X,le)=>(p(),w("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[y("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:se},[y("span",w0,W(h.value),1),De($i,{class:"composer-dropdown-chevron"})],8,y0),a.value?(p(),w("div",{key:0,class:ft(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":b.value==="up","composer-dropdown-menu-wrap-down":b.value==="down"}])},[y("div",b0,[T.value?(p(),w("div",_0,[xr(y("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":le[0]||(le[0]=te=>l.value=te),class:"composer-dropdown-search-input",type:"text",placeholder:O.value,onKeydown:yn(wt(ce,["prevent"]),["esc"])},null,40,k0),[[Rr,l.value]])])):ue("",!0),y("ul",T0,[(p(!0),w($e,null,dt(L.value,te=>(p(),w("li",{key:te.value},[y("button",{class:ft(["composer-dropdown-option",{"is-selected":te.value===e.modelValue}]),type:"button",onClick:Me=>ne(te.value)},W(te.label),11,S0)]))),128)),L.value.length===0?(p(),w("li",I0," No matching projects ")):ue("",!0)]),N.value?(p(),w("div",E0,[d.value?(p(),w($e,{key:0},[xr(y("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":le[1]||(le[1]=te=>c.value=te),class:"composer-dropdown-add-input",type:"text",placeholder:ie.value,onKeydown:[yn(wt(me,["prevent"]),["enter"]),yn(wt(Oe,["prevent"]),["esc"])]},null,40,C0),[[Rr,c.value]]),y("div",{class:"composer-dropdown-add-actions"},[y("button",{type:"button",class:"composer-dropdown-add-btn",onClick:me},"Open"),y("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Oe},"Cancel")])],64)):(p(),w("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:we},W(J.value),1))])):ue("",!0)])],2)):ue("",!0)],512))}}),Wa=ht(A0,[["__scopeId","data-v-7cfa2012"]]),x0=["disabled"],R0={class:"search-dropdown-value"},P0={class:"search-dropdown-search-wrap"},M0=["placeholder","onKeydown"],$0={key:0,class:"search-dropdown-list",role:"listbox"},O0=["onClick","onPointerenter"],N0={class:"search-dropdown-option-check"},D0={class:"search-dropdown-option-label"},L0={key:0,class:"search-dropdown-option-desc"},j0={key:1,class:"search-dropdown-empty"},B0=Zt({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(!1),a=D(""),l=D(0),d=pe(()=>n.openDirection??"down"),c=pe(()=>new Set(n.selectedValues)),h=pe(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const L=n.options.find(se=>se.value===n.selectedValues[0]);return(L==null?void 0:L.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),b=pe(()=>{const L=a.value.toLowerCase().trim();return L?n.options.filter(se=>{var ne;return se.label.toLowerCase().includes(L)||(((ne=se.description)==null?void 0:ne.toLowerCase().includes(L))??!1)}):n.options});function T(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,qt(()=>{var L;return(L=o.value)==null?void 0:L.focus()})))}function N(L){r("toggle",L.value,!c.value.has(L.value))}function O(L){b.value.length!==0&&(l.value=(l.value+L+b.value.length)%b.value.length)}function J(){const L=b.value[l.value];L&&N(L)}function ie(L){if(!i.value)return;const se=s.value;if(!se)return;const ne=L.target;ne instanceof Node&&(se.contains(ne)||(i.value=!1))}return mt(a,()=>{l.value=0}),Or(()=>window.addEventListener("pointerdown",ie)),Nr(()=>window.removeEventListener("pointerdown",ie)),(L,se)=>(p(),w("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[y("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:T},[y("span",R0,W(h.value),1),De($i,{class:"search-dropdown-chevron"})],8,x0),i.value?(p(),w("div",{key:0,class:ft(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[y("div",P0,[xr(y("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":se[0]||(se[0]=ne=>a.value=ne),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[se[1]||(se[1]=yn(wt(ne=>i.value=!1,["prevent"]),["escape"])),yn(wt(J,["prevent"]),["enter"]),se[2]||(se[2]=yn(wt(ne=>O(1),["prevent"]),["arrow-down"])),se[3]||(se[3]=yn(wt(ne=>O(-1),["prevent"]),["arrow-up"]))]},null,40,M0),[[Rr,a.value]])]),b.value.length>0?(p(),w("ul",$0,[(p(!0),w($e,null,dt(b.value,(ne,we)=>(p(),w("li",{key:ne.value},[y("button",{class:ft(["search-dropdown-option",{"is-selected":c.value.has(ne.value),"is-highlighted":we===l.value}]),type:"button",onClick:ce=>N(ne),onPointerenter:ce=>l.value=we},[y("span",N0,W(c.value.has(ne.value)?"✓":""),1),y("span",D0,W(ne.label),1),ne.description?(p(),w("span",L0,W(ne.description),1)):ue("",!0)],42,O0)]))),128))])):(p(),w("div",j0,"No results"))],2)):ue("",!0)],512))}}),F0=ht(B0,[["__scopeId","data-v-a0f2edd4"]]),U0={class:"skill-picker-header"},H0=["onKeydown"],V0={key:0,class:"skill-picker-list",role:"listbox"},W0=["onClick","onPointerenter"],z0={class:"skill-picker-name"},G0={key:0,class:"skill-picker-desc"},q0={key:1,class:"skill-picker-empty"},K0=Zt({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(""),a=D(0),l=pe(()=>{const b=i.value.toLowerCase().trim();return b?n.skills.filter(T=>T.name.toLowerCase().includes(b)||T.description.toLowerCase().includes(b)):n.skills}),d=pe(()=>{const b={};return n.anchorBottom!=null&&(b.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(b.left=`${n.anchorLeft}px`),b});function c(b){l.value.length!==0&&(a.value=(a.value+b+l.value.length)%l.value.length)}function h(){const b=l.value[a.value];b&&r("select",b)}return mt(()=>n.visible,b=>{b&&(i.value="",a.value=0,qt(()=>{var T;return(T=o.value)==null?void 0:T.focus()}))}),mt(i,()=>{a.value=0}),(b,T)=>e.visible?(p(),w("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:qr(d.value)},[y("div",U0,[xr(y("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":T[0]||(T[0]=N=>i.value=N),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[T[1]||(T[1]=yn(wt(N=>b.$emit("close"),["prevent"]),["escape"])),yn(wt(h,["prevent"]),["enter"]),T[2]||(T[2]=yn(wt(N=>c(1),["prevent"]),["arrow-down"])),T[3]||(T[3]=yn(wt(N=>c(-1),["prevent"]),["arrow-up"]))]},null,40,H0),[[Rr,i.value]])]),l.value.length>0?(p(),w("ul",V0,[(p(!0),w($e,null,dt(l.value,(N,O)=>(p(),w("li",{key:N.path},[y("button",{class:ft(["skill-picker-item",{"is-highlighted":O===a.value}]),type:"button",onClick:J=>b.$emit("select",N),onPointerenter:J=>a.value=O},[y("span",z0,W(N.name),1),N.description?(p(),w("span",G0,W(N.description),1)):ue("",!0)],42,W0)]))),128))])):(p(),w("div",q0,"No skills found"))],4)):ue("",!0)}}),J0=ht(K0,[["__scopeId","data-v-ff3fb7dc"]]),Y0={key:0,class:"thread-composer-dictation-error"},Q0={key:0,class:"thread-composer-attachments"},X0=["src","alt"],Z0=["aria-label","disabled","onClick"],eT={key:1,class:"thread-composer-folder-chips"},tT=["title"],nT={class:"thread-composer-folder-chip-meta"},rT=["aria-label","disabled","onClick"],sT={key:2,class:"thread-composer-file-chips"},oT=["title"],iT=["aria-label","disabled","onClick"],aT={key:3,class:"thread-composer-skill-chips"},lT={class:"thread-composer-skill-chip-name"},cT=["aria-label","onClick"],uT=["title"],dT={class:"thread-composer-rate-limit-row"},fT={class:"thread-composer-rate-limit-value"},hT={key:0,class:"thread-composer-rate-limit-refresh"},pT={class:"thread-composer-input-wrap"},mT={key:0,class:"thread-composer-file-mentions"},gT=["onMousedown"],vT={key:1,class:"thread-composer-file-mention-icon-markdown"},yT={class:"thread-composer-file-mention-text"},wT={class:"thread-composer-file-mention-name"},bT={key:0,class:"thread-composer-file-mention-dir"},_T={key:1,class:"thread-composer-file-mention-empty"},kT=["placeholder","disabled"],TT=["disabled"],ST={key:0,class:"thread-composer-attach-menu"},IT=["disabled"],ET=["disabled"],CT=["disabled"],AT=["aria-label","aria-pressed","disabled"],xT={class:"thread-composer-plan-toggle-state"},RT={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},PT={key:1,class:"thread-composer-dictation-timer"},MT=["aria-label","title","disabled"],$T={key:1,class:"thread-composer-mic-spinner","aria-hidden":"true"},OT=["disabled"],NT=["aria-label","title","disabled"],DT=["disabled"],LT=["disabled"],jT=["disabled"],BT=Zt({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},collaborationModes:{},selectedCollaborationMode:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},codexQuota:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{},dictationClickToToggle:{type:Boolean}},emits:["submit","interrupt","update:selected-collaboration-mode","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=D(""),o=D([]),i=D([]),a=D([]),l=D([]),d=D(""),{state:c,isSupported:h,recordingDurationMs:b,waveformCanvasRef:T,startRecording:N,stopRecording:O,toggleRecording:J}=uk({onTranscript:A=>{s.value=s.value?`${s.value}
|
|
51
|
-
${A}`:A,d.value="",qt(()=>{var j;return(j=we.value)==null?void 0:j.focus()})},onEmpty:()=>{d.value=n.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:A=>{if(A instanceof DOMException&&A.name==="NotAllowedError"){d.value="Microphone access was denied.";return}d.value=A instanceof Error?A.message:"Dictation failed."}}),ie=D(null),L=D(null),se=D(null),ne=D(null),we=D(null),ce=D(!1),me=D(!1),Oe=D(null),ae=D(""),X=D([]),le=D(!1),te=D(0);let Me=0,Ne=null,qe=!1;const He=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),Fe=[{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"}],xe=pe(()=>n.models.map(A=>({value:A,label:A}))),nt=pe(()=>n.selectedCollaborationMode==="plan"),ze=pe(()=>n.selectedCollaborationMode==="plan"&&n.selectedModel.trim().length===0),Be=pe(()=>n.skills??[]),at=pe(()=>i.value.map(A=>A.path)),Dt=pe(()=>(n.skills??[]).map(A=>({value:A.path,label:A.name,description:A.description}))),it=pe(()=>n.disabled||!n.activeThreadId||ze.value?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),lt=pe(()=>{const A=new Set;for(const j of l.value)for(const re of j.filePaths)A.add(re);return a.value.filter(j=>!A.has(j.fsPath))}),Ve=pe(()=>n.disabled||!n.activeThreadId),V=pe(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),be=pe(()=>c.value==="recording"),fe=pe(()=>c.value==="recording"?"Stop dictation":c.value==="transcribing"?"Transcribing dictation":n.dictationClickToToggle?"Click to dictate":"Hold to dictate"),Ae=pe(()=>c.value==="idle"?d.value.trim():""),Re=pe(()=>{const A=Math.max(0,Math.floor(b.value/1e3)),j=Math.floor(A/60),re=A%60;return`${j}:${String(re).padStart(2,"0")}`}),k=pe(()=>n.activeThreadId?ze.value?"Loading models for plan mode...":"Type a message... (@ for files, / for skills)":"Select a thread to send a message"),I=pe(()=>ve(n.codexQuota??null)),$=pe(()=>""),q=pe(()=>ke(n.codexQuota??null));function F(A){return!A||A==="unknown"?"":A==="edu"?"Education":`${A.slice(0,1).toUpperCase()}${A.slice(1)}`}function P(A){return typeof A!="number"||!Number.isFinite(A)||A<=0?"":A%1440===0?`${A/1440}d`:A%60===0?`${A/60}h`:`${A}m`}function H(A){if(typeof A!="number"||!Number.isFinite(A))return"";const re=A*1e3-Date.now();if(re<=0)return"resetting now";const je=Math.round(re/6e4);if(je<60)return`resets in ${Math.max(1,je)}m`;const g=Math.round(je/60);if(g<48)return`resets in ${Math.max(1,g)}h`;const m=Math.round(g/24);return`resets in ${Math.max(1,m)}d`}function U(A){return typeof A!="number"||!Number.isFinite(A)?"":new Intl.DateTimeFormat(void 0,{weekday:"short",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(A*1e3))}function z(A){if(typeof A!="number"||!Number.isFinite(A))return"";const j=new Date(A*1e3);return`${j.getMonth()+1}月${j.getDate()}日`}function G(A){const j=[A.primary,A.secondary].filter(g=>g!==null),re=j.find(g=>g.windowMinutes===10080);return re||(j.filter(g=>typeof g.windowMinutes=="number"&&g.windowMinutes>=10080).sort((g,m)=>(g.windowMinutes??0)-(m.windowMinutes??0))[0]??null)}function Te(A){const j=Math.max(0,Math.min(100,100-Math.round(A.usedPercent))),re=P(A.windowMinutes);return re?`${j}% / ${re}`:`${j}%`}function ve(A){var m,v;if(!A)return"";const j=[],re=F(A.planType);re&&j.push(re),A.primary&&j.push(Te(A.primary)),A.secondary&&j.push(Te(A.secondary));const je=G(A),g=z((je==null?void 0:je.resetsAt)??null);return g&&j.push(g),j.length===0&&((m=A.credits)!=null&&m.unlimited)?j.push("Unlimited credits"):j.length===0&&((v=A.credits)!=null&&v.hasCredits)&&A.credits.balance&&j.push(`${A.credits.balance} credits`),j.join(" · ")}function ke(A){var g,m;if(!A)return"";const j=[],re=F(A.planType);if(re&&j.push(`Plan: ${re}`),A.primary){const v=H(A.primary.resetsAt);j.push(`Primary window: ${Te(A.primary)}${v?`, ${v}`:""}`)}if(A.secondary){const v=H(A.secondary.resetsAt);j.push(`Secondary window: ${Te(A.secondary)}${v?`, ${v}`:""}`)}(g=A.credits)!=null&&g.unlimited?j.push("Credits: unlimited"):(m=A.credits)!=null&&m.hasCredits&&A.credits.balance&&j.push(`Credits: ${A.credits.balance}`);const je=G(A);if(je){const v=U(je.resetsAt);v&&j.push(`Weekly refresh: ${v}`)}return j.join(`
|
|
52
|
-
`)}function Ie(A="steer"){var re;const j=s.value.trim();if(it.value){if(r("submit",{text:j,imageUrls:o.value.map(je=>je.url),fileAttachments:[...a.value],skills:i.value.map(je=>({name:je.name,path:je.path})),mode:A}),s.value="",o.value=[],i.value=[],a.value=[],l.value=[],ce.value=!1,me.value=!1,Le(),He){(re=we.value)==null||re.blur();return}qt(()=>{var je;return(je=we.value)==null?void 0:je.focus()})}}function Ue(){r("interrupt")}function tt(A){r("update:selected-model",A)}function Qe(){r("update:selected-collaboration-mode",nt.value?"default":"plan")}function ct(A){r("update:selected-reasoning-effort",A)}function et(){n.dictationClickToToggle&&(d.value&&(d.value=""),J())}function pt(A){if(n.dictationClickToToggle||(A.preventDefault(),qe))return;qe=!0;const j=A.currentTarget;if(j)try{j.setPointerCapture(A.pointerId)}catch{}d.value&&(d.value=""),window.addEventListener("pointerup",Je),window.addEventListener("pointercancel",Je),window.addEventListener("blur",Je),N()}function Je(){n.dictationClickToToggle||qe&&(qe=!1,window.removeEventListener("pointerup",Je),window.removeEventListener("pointercancel",Je),window.removeEventListener("blur",Je),O())}function Ot(){Ve.value||(ce.value=!ce.value)}function hn(){var A;(A=L.value)==null||A.click()}function ut(){var A;(A=se.value)==null||A.click()}function ot(){var A;(A=ne.value)==null||A.click()}function _t(A){o.value=o.value.filter(j=>j.id!==A)}function Pt(A){i.value=i.value.filter(j=>j.path!==A)}function Et(A){a.value=a.value.filter(j=>j.fsPath!==A)}function Mt(A){const j=l.value.find(je=>je.id===A);if(!j)return;const re=new Set(j.filePaths);a.value=a.value.filter(je=>!re.has(je.fsPath)),l.value=l.value.filter(je=>je.id!==A)}function In(A){return A.total<=0?0:Math.round(A.processed/A.total*100)}function Pn(A,j){const re=A.replace(/\\/g,"/");if(a.value.some(m=>m.fsPath===re))return;const je=re.split("/").filter(Boolean),g=(j==null?void 0:j.trim())||je[je.length-1]||re;a.value=[...a.value,{label:g,path:re,fsPath:re}]}function _n(A){return A.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(A.name)}function Lt(A){const j=new FileReader;j.onload=()=>{typeof j.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:A.name||`Pasted image ${o.value.length+1}`,url:j.result})},j.readAsDataURL(A)}function Vt(A){if(!(!A||A.length===0))for(const j of Array.from(A)){if(_n(j)){Lt(j);continue}yu(j).then(re=>{re&&Pn(re)}).catch(()=>{})}}function Mn(A){var je,g;const j=(je=A.clipboardData)==null?void 0:je.items;if(j&&j.length>0){const m=[];for(const v of Array.from(j)){if(v.kind!=="file"||!v.type.startsWith("image/"))continue;const R=v.getAsFile();R&&m.push(R)}if(m.length>0)return m}const re=(g=A.clipboardData)==null?void 0:g.files;return!re||re.length===0?[]:Array.from(re).filter(m=>_n(m))}function en(A){if(Ve.value)return;const j=Mn(A);j.length!==0&&(A.preventDefault(),Vt(j),ce.value=!1,d.value&&(d.value=""))}async function $n(A){if(!A||A.length===0)return;const j=Array.from(A),je=(j[0].webkitRelativePath||j[0].name).split("/").filter(Boolean)[0]||"Folder",g=`${Date.now()}-${Math.random().toString(36).slice(2)}`;l.value=[...l.value,{id:g,name:je,total:j.length,processed:0,filePaths:[],isUploading:!0}];const m=v=>{l.value=l.value.map(R=>R.id===g?v(R):R)};for(const v of j)try{const R=await yu(v);if(R){const B=v.webkitRelativePath||v.name;Pn(R,B),m(K=>({...K,processed:K.processed+1,filePaths:[...K.filePaths,R]}));continue}m(B=>({...B,processed:B.processed+1}))}catch{m(R=>({...R,processed:R.processed+1}))}m(v=>({...v,isUploading:!1}))}function Bn(A){A&&(A.value="")}function rn(A){const j=A.target;Vt((j==null?void 0:j.files)??null),Bn(j),ce.value=!1}function kn(A){const j=A.target;Vt((j==null?void 0:j.files)??null),Bn(j),ce.value=!1}function Fn(A){const j=A.target;$n((j==null?void 0:j.files)??null),Bn(j),ce.value=!1}function pr(){d.value&&(d.value="");const j=s.value.startsWith("/");j!==me.value&&(me.value=j),Pe()}function mr(A){if(le.value){if(A.key==="Escape"){A.preventDefault(),Le();return}if(A.key==="ArrowDown"){A.preventDefault(),X.value.length>0&&(te.value=(te.value+1)%X.value.length);return}if(A.key==="ArrowUp"){if(A.preventDefault(),X.value.length>0){const re=X.value.length;te.value=(te.value+re-1)%re}return}if(A.key==="Enter"||A.key==="Tab"){A.preventDefault();const re=X.value[te.value];re?Ft(re):Le();return}}if(n.sendWithEnter!==!1?A.key==="Enter"&&!A.shiftKey:A.key==="Enter"&&(A.metaKey||A.ctrlKey)){A.preventDefault(),Ie(n.isTurnInProgress?V.value:"steer");return}if(me.value){if(A.key==="Escape"){A.preventDefault(),Un();return}if(A.key==="ArrowDown"||A.key==="ArrowUp"){A.preventDefault();return}}}function Un(){var A;me.value=!1,(A=we.value)==null||A.focus()}function Le(){le.value=!1,Oe.value=null,ae.value="",X.value=[],te.value=0}function Pe(){const A=we.value;if(!A){Le();return}const j=A.selectionStart??s.value.length,je=s.value.slice(0,j).match(/(^|\s)(@[^\s@]*)$/);if(!je){Le();return}const g=je[2]??"",m=g.length,v=j-m;Oe.value=v,ae.value=g.slice(1),le.value=!0,Tn()}async function Tn(){if(!le.value)return;const A=(n.cwd??"").trim();if(!A){X.value=[];return}Ne&&clearTimeout(Ne);const j=++Me;Ne=setTimeout(async()=>{try{const re=await n0(A,ae.value,20);if(!le.value||j!==Me)return;X.value=re,te.value=0}catch{if(!le.value||j!==Me)return;X.value=[]}},120)}function Ft(A){const j=we.value,re=Oe.value;if(re!==null&&j){const je=j.selectionStart??s.value.length;s.value=`${s.value.slice(0,re)}${s.value.slice(je)}`.trimEnd()}Pn(A.path),Le(),qt(()=>j==null?void 0:j.focus())}function En(A){const j=A.lastIndexOf("/");return j<0?A:A.slice(j+1)}function On(A){const j=A.lastIndexOf("/");return j<=0?"":A.slice(0,j)}function pn(A){const j=En(A),re=j.lastIndexOf(".");return re<=0?"":j.slice(re+1).toLowerCase()}function Nn(A){const j=pn(A);return j==="ts"?"TS":j==="tsx"?"TSX":j==="js"?"JS":j==="jsx"?"JSX":j==="json"?"{}":""}function Wt(A){const j=pn(A);return j.startsWith("ts")?"ts":j.startsWith("js")?"js":j==="json"?"json":"default"}function Cn(A){const j=pn(A);return j==="md"||j==="mdx"}function Xn(A){var j;i.value.some(re=>re.path===A.path)||(i.value=[...i.value,A]),s.value=s.value.startsWith("/")?"":s.value,me.value=!1,(j=we.value)==null||j.focus()}function An(A,j){if(j){const re=(n.skills??[]).find(je=>je.path===A);re&&!i.value.some(je=>je.path===A)&&(i.value=[...i.value,re])}else i.value=i.value.filter(re=>re.path!==A)}function xn(A){if(!ce.value)return;const j=ie.value;if(!j)return;const re=A.target;!re||j.contains(re)||(ce.value=!1)}return Or(()=>{document.addEventListener("click",xn)}),Nr(()=>{document.removeEventListener("click",xn),window.removeEventListener("pointerup",Je),window.removeEventListener("pointercancel",Je),window.removeEventListener("blur",Je),Ne&&clearTimeout(Ne)}),mt(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],l.value=[],d.value="",ce.value=!1,me.value=!1,Le()}),mt(()=>n.cwd,()=>{le.value&&Tn()}),(A,j)=>(p(),w("form",{class:"thread-composer",onSubmit:j[2]||(j[2]=wt(re=>Ie("steer"),["prevent"]))},[Ae.value?(p(),w("p",Y0,W(Ae.value),1)):ue("",!0),y("div",{class:ft(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(p(),w("div",Q0,[(p(!0),w($e,null,dt(o.value,re=>(p(),w("div",{key:re.id,class:"thread-composer-attachment"},[y("img",{class:"thread-composer-attachment-image",src:re.url,alt:re.name||"Selected image"},null,8,X0),y("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${re.name||"image"}`,disabled:Ve.value,onClick:je=>_t(re.id)}," x ",8,Z0)]))),128))])):ue("",!0),l.value.length>0?(p(),w("div",eT,[(p(!0),w($e,null,dt(l.value,re=>(p(),w("span",{key:re.id,class:"thread-composer-folder-chip"},[De(Il,{class:"thread-composer-folder-chip-icon"}),y("span",{class:"thread-composer-folder-chip-name",title:re.name},W(re.name),9,tT),y("span",nT,[re.isUploading?(p(),w($e,{key:0},[yo(W(In(re))+"% uploading ("+W(re.processed)+"/"+W(re.total)+") ",1)],64)):(p(),w($e,{key:1},[yo(W(re.filePaths.length)+" file"+W(re.filePaths.length===1?"":"s"),1)],64))]),y("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${re.name}`,disabled:Ve.value,onClick:je=>Mt(re.id)},"×",8,rT)]))),128))])):ue("",!0),lt.value.length>0?(p(),w("div",sT,[(p(!0),w($e,null,dt(lt.value,re=>(p(),w("span",{key:re.fsPath,class:"thread-composer-file-chip"},[De(di,{class:"thread-composer-file-chip-icon"}),y("span",{class:"thread-composer-file-chip-name",title:re.fsPath},W(re.label),9,oT),y("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${re.label}`,disabled:Ve.value,onClick:je=>Et(re.fsPath)},"×",8,iT)]))),128))])):ue("",!0),i.value.length>0?(p(),w("div",aT,[(p(!0),w($e,null,dt(i.value,re=>(p(),w("span",{key:re.path,class:"thread-composer-skill-chip"},[y("span",lT,W(re.name),1),y("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${re.name}`,onClick:je=>Pt(re.path)},"×",8,cT)]))),128))])):ue("",!0),I.value?(p(),w("div",{key:4,class:"thread-composer-rate-limit",title:q.value,"aria-live":"polite"},[y("span",dT,[j[3]||(j[3]=y("span",{class:"thread-composer-rate-limit-label"},"Codex quota",-1)),y("span",fT,W(I.value),1)]),$.value?(p(),w("span",hT,W($.value),1)):ue("",!0)],8,uT)):ue("",!0),y("div",pT,[le.value?(p(),w("div",mT,[X.value.length>0?(p(!0),w($e,{key:0},dt(X.value,(re,je)=>(p(),w("button",{key:re.path,class:ft(["thread-composer-file-mention-row",{"is-active":je===te.value}]),type:"button",onMousedown:wt(g=>Ft(re),["prevent"])},[Nn(re.path)?(p(),w("span",{key:0,class:ft(["thread-composer-file-mention-icon-badge",`is-${Wt(re.path)}`])},W(Nn(re.path)),3)):Cn(re.path)?(p(),w("span",vT,"↓")):(p(),vt(di,{key:2,class:"thread-composer-file-mention-icon-file"})),y("span",yT,[y("span",wT,W(En(re.path)),1),On(re.path)?(p(),w("span",bT,W(On(re.path)),1)):ue("",!0)])],42,gT))),128)):(p(),w("div",_T,"No matching files"))])):ue("",!0),xr(y("textarea",{ref_key:"inputRef",ref:we,"onUpdate:modelValue":j[0]||(j[0]=re=>s.value=re),class:"thread-composer-input",placeholder:k.value,disabled:Ve.value,onInput:pr,onKeydown:mr,onPaste:en},null,40,kT),[[Rr,s.value]]),De(J0,{skills:Be.value,visible:me.value,"anchor-bottom":44,"anchor-left":0,onSelect:Xn,onClose:Un},null,8,["skills","visible"])]),y("div",{class:ft(["thread-composer-controls",{"thread-composer-controls--recording":be.value}])},[y("div",{ref_key:"attachMenuRootRef",ref:ie,class:"thread-composer-attach"},[y("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Ve.value,onClick:Ot}," + ",8,TT),ce.value?(p(),w("div",ST,[y("button",{class:"thread-composer-attach-item",type:"button",disabled:Ve.value,onClick:hn}," Add photos & files ",8,IT),y("button",{class:"thread-composer-attach-item",type:"button",disabled:Ve.value,onClick:ot}," Add folder ",8,ET),y("button",{class:"thread-composer-attach-item",type:"button",disabled:Ve.value,onClick:ut}," Take photo ",8,CT)])):ue("",!0)],512),be.value?ue("",!0):(p(),w($e,{key:0},[y("button",{class:ft(["thread-composer-plan-toggle",{"is-active":nt.value}]),type:"button","aria-label":nt.value?"Disable plan mode":"Enable plan mode","aria-pressed":nt.value,disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onClick:Qe},[j[4]||(j[4]=y("span",{class:"thread-composer-plan-toggle-label"},"Plan",-1)),y("span",xT,W(nt.value?"On":"Off"),1)],10,AT),De(Wa,{class:"thread-composer-control","model-value":e.selectedModel,options:xe.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":tt},null,8,["model-value","options","disabled"]),De(F0,{class:"thread-composer-control",options:Dt.value,"selected-values":at.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:An},null,8,["options","selected-values","disabled"]),De(Wa,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:Fe,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":ct},null,8,["model-value","disabled"])],64)),y("div",{class:ft(["thread-composer-actions",{"thread-composer-actions--recording":be.value}])},[ye(c)==="recording"?(p(),w("div",RT,[y("canvas",{ref_key:"dictationWaveformCanvasRef",ref:T,class:"thread-composer-dictation-waveform"},null,512)])):ue("",!0),ye(c)==="recording"?(p(),w("span",PT,W(Re.value),1)):ue("",!0),ye(h)&&!e.isTurnInProgress?(p(),w("button",{key:2,class:ft(["thread-composer-mic",{"thread-composer-mic--active":ye(c)==="recording","thread-composer-mic--transcribing":ye(c)==="transcribing"}]),type:"button","aria-label":fe.value,title:fe.value,disabled:Ve.value||ye(c)==="transcribing",onClick:et,onPointerdown:pt,onPointerup:Je,onPointercancel:Je},[ye(c)==="recording"?(p(),vt(wu,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):ye(c)==="transcribing"?(p(),w("span",$T)):(p(),vt(p0,{key:2,class:"thread-composer-mic-icon"}))],42,MT)):ue("",!0),e.isTurnInProgress?(p(),w("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:Ue},[De(wu,{class:"thread-composer-stop-icon"})],8,OT)):ue("",!0),y("button",{class:ft(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&V.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&V.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${V.value}`:"Send",disabled:!it.value,onClick:j[1]||(j[1]=re=>Ie(e.isTurnInProgress?V.value:"steer"))},[De(u0,{class:"thread-composer-submit-icon"})],10,NT)],2)],2)],2),y("input",{ref_key:"photoLibraryInputRef",ref:L,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Ve.value,onChange:rn},null,40,DT),y("input",{ref_key:"cameraCaptureInputRef",ref:se,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Ve.value,onChange:kn},null,40,LT),y("input",{ref_key:"folderPickerInputRef",ref:ne,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:Ve.value,onChange:Fn},null,40,jT)],32))}}),bu=ht(BT,[["__scopeId","data-v-5c9f8046"]]),FT={key:0,class:"queued-messages"},UT={class:"queued-messages-inner"},HT={class:"queued-row-text"},VT={class:"queued-row-actions"},WT=["onClick"],zT=["onClick"],GT=Zt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(p(),w("div",FT,[y("div",UT,[(p(!0),w($e,null,dt(e.messages,r=>(p(),w("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",HT,W(r.text),1),y("div",VT,[y("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,WT),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,zT)])]))),128))])])):ue("",!0)}}),qT=ht(GT,[["__scopeId","data-v-ea583733"]]),KT={class:"runtime-dropdown-trigger-label"},JT={key:0,class:"runtime-dropdown-menu-wrap"},YT={class:"runtime-dropdown-menu"},QT=["onClick"],XT={class:"runtime-dropdown-option-label"},ZT={key:0,class:"runtime-dropdown-option-check"},eS=Zt({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(!1),i=[{value:"local",label:"Local project",icon:Il},{value:"worktree",label:"New worktree",icon:Qo}],a=pe(()=>i.find(c=>c.value===n.modelValue)??i[0]);function l(c){r("update:modelValue",c),o.value=!1}function d(c){if(!o.value)return;const h=s.value;if(!h)return;const b=c.target;b instanceof Node&&(h.contains(b)||(o.value=!1))}return Or(()=>{window.addEventListener("pointerdown",d)}),Nr(()=>{window.removeEventListener("pointerdown",d)}),(c,h)=>(p(),w("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[y("button",{class:"runtime-dropdown-trigger",type:"button",onClick:h[0]||(h[0]=b=>o.value=!o.value)},[(p(),vt(ai(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),y("span",KT,W(a.value.label),1),De($i,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(p(),w("div",JT,[y("div",YT,[h[1]||(h[1]=y("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(p(),w($e,null,dt(i,b=>y("button",{key:b.value,class:ft(["runtime-dropdown-option",{"is-selected":e.modelValue===b.value}]),type:"button",onClick:T=>l(b.value)},[(p(),vt(ai(b.icon),{class:"runtime-dropdown-option-icon"})),y("span",XT,W(b.label),1),e.modelValue===b.value?(p(),w("span",ZT,"✓")):ue("",!0)],10,QT)),64))])])):ue("",!0)],512))}}),tS=ht(eS,[["__scopeId","data-v-9c9b71e5"]]),nS={},rS={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function sS(e,t){return p(),w("svg",rS,[...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 za=ht(nS,[["render",sS]]),oS={class:"skill-card-top"},iS=["src","alt"],aS={key:1,class:"skill-card-avatar-fallback"},lS={class:"skill-card-info"},cS={class:"skill-card-header"},uS={class:"skill-card-name"},dS={key:0,class:"skill-card-badge-disabled"},fS={key:1,class:"skill-card-badge"},hS={class:"skill-card-owner"},pS={key:0,class:"skill-card-desc"},mS={key:1,class:"skill-card-date"},gS=Zt({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=pe(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function r(s){const o=s.target;o.style.display="none"}return(s,o)=>(p(),w("button",{class:ft(["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",oS,[e.skill.avatarUrl?(p(),w("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,iS)):(p(),w("div",aS,W(e.skill.owner.charAt(0)),1)),y("div",lS,[y("div",cS,[y("span",uS,W(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(p(),w("span",dS,"Disabled")):e.skill.installed?(p(),w("span",fS,"Installed")):ue("",!0)]),y("span",hS,W(e.skill.owner),1)])]),e.skill.description?(p(),w("p",pS,W(e.skill.description),1)):ue("",!0),n.value?(p(),w("span",mS,W(n.value),1)):ue("",!0)],2))}}),_u=ht(gS,[["__scopeId","data-v-2a1e8196"]]),vS={class:"sdm-panel"},yS={class:"sdm-header"},wS={class:"sdm-title-area"},bS=["src","alt"],_S={class:"sdm-title-col"},kS={class:"sdm-title-row"},TS={class:"sdm-title"},SS={key:0,class:"sdm-badge-disabled"},IS={class:"sdm-owner"},ES={class:"sdm-body"},CS={key:0,class:"sdm-desc"},AS={key:1,class:"sdm-readme-loading"},xS=["innerHTML"],RS=["href"],PS={class:"sdm-footer"},MS={class:"sdm-footer-actions"},$S=["disabled"],OS=["disabled"],NS=["disabled"],DS=Zt({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(""),i=D(!1),a=pe(()=>s.value??n.skill.enabled??!0),l=pe(()=>n.isInstalling===!0||n.isUninstalling===!0),d=pe(()=>{const O=o.value;if(!O)return"";const J=O.replace(/^---[\s\S]*?---\s*/,"");return c(J)});function c(O){return O.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").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 h(){if(!(!n.skill.owner||!n.skill.name)){i.value=!0,o.value="";try{const O=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),J=await fetch(`/codex-api/skills-hub/readme?${O}`);if(!J.ok)return;const ie=await J.json();o.value=ie.content??""}catch{}finally{i.value=!1}}}mt(()=>n.visible,O=>{O&&(s.value=null,o.value="",h())});function b(){r("install",n.skill)}function T(){r("uninstall",n.skill)}function N(){const O=!a.value;s.value=O,r("toggle-enabled",n.skill,O)}return(O,J)=>(p(),vt(so,{to:"body"},[e.visible?(p(),w("div",{key:0,class:"sdm-overlay",onClick:J[1]||(J[1]=wt(ie=>O.$emit("close"),["self"]))},[y("div",vS,[y("div",yS,[y("div",wS,[e.skill.avatarUrl?(p(),w("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,bS)):ue("",!0),y("div",_S,[y("div",kS,[y("h3",TS,W(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(p(),w("span",SS,"Disabled")):ue("",!0)]),y("span",IS,W(e.skill.owner),1)])]),y("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:J[0]||(J[0]=ie=>O.$emit("close"))},[De(El,{class:"sdm-close-icon"})])]),y("div",ES,[e.skill.description?(p(),w("p",CS,W(e.skill.description),1)):ue("",!0),i.value?(p(),w("div",AS,"Loading skill contents...")):o.value?(p(),w("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,xS)):ue("",!0),y("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,RS)]),y("div",PS,[y("div",MS,[e.skill.installed?(p(),w("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:T},W(n.isUninstalling?"Uninstalling...":"Uninstall"),9,$S)):(p(),w("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:b},W(n.isInstalling?"Installing...":"Install"),9,OS)),e.skill.installed?(p(),w("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:N},W(a.value?"Disable":"Enable"),9,NS)):ue("",!0)])])])])):ue("",!0)]))}}),LS=ht(DS,[["__scopeId","data-v-19a385ca"]]),jS=()=>{};var ku={};/**
|
|
53
|
-
* @license
|
|
54
|
-
* Copyright 2017 Google LLC
|
|
55
|
-
*
|
|
56
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
57
|
-
* you may not use this file except in compliance with the License.
|
|
58
|
-
* You may obtain a copy of the License at
|
|
59
|
-
*
|
|
60
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
61
|
-
*
|
|
62
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
63
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
64
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
65
|
-
* See the License for the specific language governing permissions and
|
|
66
|
-
* limitations under the License.
|
|
67
|
-
*/const Uf=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},BS=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("")},Hf={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,c=o>>2,h=(o&3)<<4|a>>4;let b=(a&15)<<2|d>>6,T=d&63;l||(T=64,i||(b=64)),r.push(n[c],n[h],n[b],n[T])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Uf(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):BS(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 h=s<e.length?n[e.charAt(s)]:64;if(++s,o==null||a==null||d==null||h==null)throw new FS;const b=o<<2|a>>4;if(r.push(b),d!==64){const T=a<<4&240|d>>2;if(r.push(T),h!==64){const N=d<<6&192|h;r.push(N)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class FS extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const US=function(e){const t=Uf(e);return Hf.encodeByteArray(t,!0)},Vf=function(e){return US(e).replace(/\./g,"")},Wf=function(e){try{return Hf.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
|
|
68
|
-
* @license
|
|
69
|
-
* Copyright 2022 Google LLC
|
|
70
|
-
*
|
|
71
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
72
|
-
* you may not use this file except in compliance with the License.
|
|
73
|
-
* You may obtain a copy of the License at
|
|
74
|
-
*
|
|
75
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
76
|
-
*
|
|
77
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
78
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
79
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
80
|
-
* See the License for the specific language governing permissions and
|
|
81
|
-
* limitations under the License.
|
|
82
|
-
*/function HS(){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.")}/**
|
|
83
|
-
* @license
|
|
84
|
-
* Copyright 2022 Google LLC
|
|
85
|
-
*
|
|
86
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
87
|
-
* you may not use this file except in compliance with the License.
|
|
88
|
-
* You may obtain a copy of the License at
|
|
89
|
-
*
|
|
90
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
91
|
-
*
|
|
92
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
93
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
94
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
95
|
-
* See the License for the specific language governing permissions and
|
|
96
|
-
* limitations under the License.
|
|
97
|
-
*/const VS=()=>HS().__FIREBASE_DEFAULTS__,WS=()=>{if(typeof process>"u"||typeof ku>"u")return;const e=ku.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},zS=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&Wf(e[1]);return t&&JSON.parse(t)},xl=()=>{try{return jS()||VS()||WS()||zS()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},GS=e=>{var t,n;return(n=(t=xl())==null?void 0:t.emulatorHosts)==null?void 0:n[e]},zf=()=>{var e;return(e=xl())==null?void 0:e.config},Gf=e=>{var t;return(t=xl())==null?void 0:t[`_${e}`]};/**
|
|
98
|
-
* @license
|
|
99
|
-
* Copyright 2017 Google LLC
|
|
100
|
-
*
|
|
101
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
102
|
-
* you may not use this file except in compliance with the License.
|
|
103
|
-
* You may obtain a copy of the License at
|
|
104
|
-
*
|
|
105
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
106
|
-
*
|
|
107
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
108
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
109
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
110
|
-
* See the License for the specific language governing permissions and
|
|
111
|
-
* limitations under the License.
|
|
112
|
-
*/class qS{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))}}}/**
|
|
113
|
-
* @license
|
|
114
|
-
* Copyright 2017 Google LLC
|
|
115
|
-
*
|
|
116
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
117
|
-
* you may not use this file except in compliance with the License.
|
|
118
|
-
* You may obtain a copy of the License at
|
|
119
|
-
*
|
|
120
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
121
|
-
*
|
|
122
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
123
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
124
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
125
|
-
* See the License for the specific language governing permissions and
|
|
126
|
-
* limitations under the License.
|
|
127
|
-
*/function bn(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function KS(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(bn())}function JS(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function YS(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function QS(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function XS(){const e=bn();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function ZS(){try{return typeof indexedDB=="object"}catch{return!1}}function eI(){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)}})}/**
|
|
128
|
-
* @license
|
|
129
|
-
* Copyright 2017 Google LLC
|
|
130
|
-
*
|
|
131
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
132
|
-
* you may not use this file except in compliance with the License.
|
|
133
|
-
* You may obtain a copy of the License at
|
|
134
|
-
*
|
|
135
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
136
|
-
*
|
|
137
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
138
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
139
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
140
|
-
* See the License for the specific language governing permissions and
|
|
141
|
-
* limitations under the License.
|
|
142
|
-
*/const tI="FirebaseError";class Xr extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=tI,Object.setPrototypeOf(this,Xr.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Ro.prototype.create)}}class Ro{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?nI(o,r):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new Xr(s,a,r)}}function nI(e,t){return e.replace(rI,(n,r)=>{const s=t[r];return s!=null?String(s):`<${r}?>`})}const rI=/\{\$([^}]+)}/g;function sI(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Ds(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const s of n){if(!r.includes(s))return!1;const o=e[s],i=t[s];if(Tu(o)&&Tu(i)){if(!Ds(o,i))return!1}else if(o!==i)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function Tu(e){return e!==null&&typeof e=="object"}/**
|
|
143
|
-
* @license
|
|
144
|
-
* Copyright 2017 Google LLC
|
|
145
|
-
*
|
|
146
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
147
|
-
* you may not use this file except in compliance with the License.
|
|
148
|
-
* You may obtain a copy of the License at
|
|
149
|
-
*
|
|
150
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
151
|
-
*
|
|
152
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
153
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
154
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
155
|
-
* See the License for the specific language governing permissions and
|
|
156
|
-
* limitations under the License.
|
|
157
|
-
*/function Po(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 oI(e,t){const n=new iI(e,t);return n.subscribe.bind(n)}class iI{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.");aI(t,["next","error","complete"])?s=t:s={next:t,error:n,complete:r},s.next===void 0&&(s.next=ha),s.error===void 0&&(s.error=ha),s.complete===void 0&&(s.complete=ha);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 aI(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 ha(){}/**
|
|
158
|
-
* @license
|
|
159
|
-
* Copyright 2021 Google LLC
|
|
160
|
-
*
|
|
161
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
162
|
-
* you may not use this file except in compliance with the License.
|
|
163
|
-
* You may obtain a copy of the License at
|
|
164
|
-
*
|
|
165
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
166
|
-
*
|
|
167
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
168
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
169
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
170
|
-
* See the License for the specific language governing permissions and
|
|
171
|
-
* limitations under the License.
|
|
172
|
-
*/function Bs(e){return e&&e._delegate?e._delegate:e}/**
|
|
173
|
-
* @license
|
|
174
|
-
* Copyright 2025 Google LLC
|
|
175
|
-
*
|
|
176
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
177
|
-
* you may not use this file except in compliance with the License.
|
|
178
|
-
* You may obtain a copy of the License at
|
|
179
|
-
*
|
|
180
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
181
|
-
*
|
|
182
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
183
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
184
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
185
|
-
* See the License for the specific language governing permissions and
|
|
186
|
-
* limitations under the License.
|
|
187
|
-
*/function Rl(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function lI(e){return(await fetch(e,{credentials:"include"})).ok}class Ls{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}}/**
|
|
188
|
-
* @license
|
|
189
|
-
* Copyright 2019 Google LLC
|
|
190
|
-
*
|
|
191
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
* you may not use this file except in compliance with the License.
|
|
193
|
-
* You may obtain a copy of the License at
|
|
194
|
-
*
|
|
195
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
*
|
|
197
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
* See the License for the specific language governing permissions and
|
|
201
|
-
* limitations under the License.
|
|
202
|
-
*/const as="[DEFAULT]";/**
|
|
203
|
-
* @license
|
|
204
|
-
* Copyright 2019 Google LLC
|
|
205
|
-
*
|
|
206
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
207
|
-
* you may not use this file except in compliance with the License.
|
|
208
|
-
* You may obtain a copy of the License at
|
|
209
|
-
*
|
|
210
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
211
|
-
*
|
|
212
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
213
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
214
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
215
|
-
* See the License for the specific language governing permissions and
|
|
216
|
-
* limitations under the License.
|
|
217
|
-
*/class cI{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 qS;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(dI(t))try{this.getOrInitializeService({instanceIdentifier:as})}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=as){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=as){return this.instances.has(t)}getOptions(t=as){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:uI(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=as){return this.component?this.component.multipleInstances?t:as:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function uI(e){return e===as?void 0:e}function dI(e){return e.instantiationMode==="EAGER"}/**
|
|
218
|
-
* @license
|
|
219
|
-
* Copyright 2019 Google LLC
|
|
220
|
-
*
|
|
221
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
222
|
-
* you may not use this file except in compliance with the License.
|
|
223
|
-
* You may obtain a copy of the License at
|
|
224
|
-
*
|
|
225
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
226
|
-
*
|
|
227
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
228
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
229
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
230
|
-
* See the License for the specific language governing permissions and
|
|
231
|
-
* limitations under the License.
|
|
232
|
-
*/class fI{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 cI(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
|
|
233
|
-
* @license
|
|
234
|
-
* Copyright 2017 Google LLC
|
|
235
|
-
*
|
|
236
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
237
|
-
* you may not use this file except in compliance with the License.
|
|
238
|
-
* You may obtain a copy of the License at
|
|
239
|
-
*
|
|
240
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
241
|
-
*
|
|
242
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
243
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
244
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
245
|
-
* See the License for the specific language governing permissions and
|
|
246
|
-
* limitations under the License.
|
|
247
|
-
*/var At;(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"})(At||(At={}));const hI={debug:At.DEBUG,verbose:At.VERBOSE,info:At.INFO,warn:At.WARN,error:At.ERROR,silent:At.SILENT},pI=At.INFO,mI={[At.DEBUG]:"log",[At.VERBOSE]:"log",[At.INFO]:"info",[At.WARN]:"warn",[At.ERROR]:"error"},gI=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),s=mI[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 qf{constructor(t){this.name=t,this._logLevel=pI,this._logHandler=gI,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in At))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?hI[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,At.DEBUG,...t),this._logHandler(this,At.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,At.VERBOSE,...t),this._logHandler(this,At.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,At.INFO,...t),this._logHandler(this,At.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,At.WARN,...t),this._logHandler(this,At.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,At.ERROR,...t),this._logHandler(this,At.ERROR,...t)}}const vI=(e,t)=>t.some(n=>e instanceof n);let Su,Iu;function yI(){return Su||(Su=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function wI(){return Iu||(Iu=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Kf=new WeakMap,Ga=new WeakMap,Jf=new WeakMap,pa=new WeakMap,Pl=new WeakMap;function bI(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(Kr(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&Kf.set(n,e)}).catch(()=>{}),Pl.set(t,e),t}function _I(e){if(Ga.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)});Ga.set(e,t)}let qa={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Ga.get(e);if(t==="objectStoreNames")return e.objectStoreNames||Jf.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Kr(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 kI(e){qa=e(qa)}function TI(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(ma(this),t,...n);return Jf.set(r,t.sort?t.sort():[t]),Kr(r)}:wI().includes(e)?function(...t){return e.apply(ma(this),t),Kr(Kf.get(this))}:function(...t){return Kr(e.apply(ma(this),t))}}function SI(e){return typeof e=="function"?TI(e):(e instanceof IDBTransaction&&_I(e),vI(e,yI())?new Proxy(e,qa):e)}function Kr(e){if(e instanceof IDBRequest)return bI(e);if(pa.has(e))return pa.get(e);const t=SI(e);return t!==e&&(pa.set(e,t),Pl.set(t,e)),t}const ma=e=>Pl.get(e);function II(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=Kr(i);return r&&i.addEventListener("upgradeneeded",l=>{r(Kr(i.result),l.oldVersion,l.newVersion,Kr(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 EI=["get","getKey","getAll","getAllKeys","count"],CI=["put","add","delete","clear"],ga=new Map;function Eu(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(ga.get(t))return ga.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=CI.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||EI.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 ga.set(t,o),o}kI(e=>({...e,get:(t,n,r)=>Eu(t,n)||e.get(t,n,r),has:(t,n)=>!!Eu(t,n)||e.has(t,n)}));/**
|
|
248
|
-
* @license
|
|
249
|
-
* Copyright 2019 Google LLC
|
|
250
|
-
*
|
|
251
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
252
|
-
* you may not use this file except in compliance with the License.
|
|
253
|
-
* You may obtain a copy of the License at
|
|
254
|
-
*
|
|
255
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
256
|
-
*
|
|
257
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
258
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
259
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
260
|
-
* See the License for the specific language governing permissions and
|
|
261
|
-
* limitations under the License.
|
|
262
|
-
*/class AI{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(xI(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function xI(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const Ka="@firebase/app",Cu="0.14.10";/**
|
|
263
|
-
* @license
|
|
264
|
-
* Copyright 2019 Google LLC
|
|
265
|
-
*
|
|
266
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
267
|
-
* you may not use this file except in compliance with the License.
|
|
268
|
-
* You may obtain a copy of the License at
|
|
269
|
-
*
|
|
270
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
271
|
-
*
|
|
272
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
273
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
274
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
275
|
-
* See the License for the specific language governing permissions and
|
|
276
|
-
* limitations under the License.
|
|
277
|
-
*/const Pr=new qf("@firebase/app"),RI="@firebase/app-compat",PI="@firebase/analytics-compat",MI="@firebase/analytics",$I="@firebase/app-check-compat",OI="@firebase/app-check",NI="@firebase/auth",DI="@firebase/auth-compat",LI="@firebase/database",jI="@firebase/data-connect",BI="@firebase/database-compat",FI="@firebase/functions",UI="@firebase/functions-compat",HI="@firebase/installations",VI="@firebase/installations-compat",WI="@firebase/messaging",zI="@firebase/messaging-compat",GI="@firebase/performance",qI="@firebase/performance-compat",KI="@firebase/remote-config",JI="@firebase/remote-config-compat",YI="@firebase/storage",QI="@firebase/storage-compat",XI="@firebase/firestore",ZI="@firebase/ai",eE="@firebase/firestore-compat",tE="firebase",nE="12.11.0";/**
|
|
278
|
-
* @license
|
|
279
|
-
* Copyright 2019 Google LLC
|
|
280
|
-
*
|
|
281
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
282
|
-
* you may not use this file except in compliance with the License.
|
|
283
|
-
* You may obtain a copy of the License at
|
|
284
|
-
*
|
|
285
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
286
|
-
*
|
|
287
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
288
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
289
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
290
|
-
* See the License for the specific language governing permissions and
|
|
291
|
-
* limitations under the License.
|
|
292
|
-
*/const Ja="[DEFAULT]",rE={[Ka]:"fire-core",[RI]:"fire-core-compat",[MI]:"fire-analytics",[PI]:"fire-analytics-compat",[OI]:"fire-app-check",[$I]:"fire-app-check-compat",[NI]:"fire-auth",[DI]:"fire-auth-compat",[LI]:"fire-rtdb",[jI]:"fire-data-connect",[BI]:"fire-rtdb-compat",[FI]:"fire-fn",[UI]:"fire-fn-compat",[HI]:"fire-iid",[VI]:"fire-iid-compat",[WI]:"fire-fcm",[zI]:"fire-fcm-compat",[GI]:"fire-perf",[qI]:"fire-perf-compat",[KI]:"fire-rc",[JI]:"fire-rc-compat",[YI]:"fire-gcs",[QI]:"fire-gcs-compat",[XI]:"fire-fst",[eE]:"fire-fst-compat",[ZI]:"fire-vertex","fire-js":"fire-js",[tE]:"fire-js-all"};/**
|
|
293
|
-
* @license
|
|
294
|
-
* Copyright 2019 Google LLC
|
|
295
|
-
*
|
|
296
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
297
|
-
* you may not use this file except in compliance with the License.
|
|
298
|
-
* You may obtain a copy of the License at
|
|
299
|
-
*
|
|
300
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
301
|
-
*
|
|
302
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
303
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
304
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
305
|
-
* See the License for the specific language governing permissions and
|
|
306
|
-
* limitations under the License.
|
|
307
|
-
*/const To=new Map,sE=new Map,Ya=new Map;function Au(e,t){try{e.container.addComponent(t)}catch(n){Pr.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function So(e){const t=e.name;if(Ya.has(t))return Pr.debug(`There were multiple attempts to register component ${t}.`),!1;Ya.set(t,e);for(const n of To.values())Au(n,e);for(const n of sE.values())Au(n,e);return!0}function Yf(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function lr(e){return e==null?!1:e.settings!==void 0}/**
|
|
308
|
-
* @license
|
|
309
|
-
* Copyright 2019 Google LLC
|
|
310
|
-
*
|
|
311
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
312
|
-
* you may not use this file except in compliance with the License.
|
|
313
|
-
* You may obtain a copy of the License at
|
|
314
|
-
*
|
|
315
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
316
|
-
*
|
|
317
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
318
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
319
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
320
|
-
* See the License for the specific language governing permissions and
|
|
321
|
-
* limitations under the License.
|
|
322
|
-
*/const oE={"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."},Jr=new Ro("app","Firebase",oE);/**
|
|
323
|
-
* @license
|
|
324
|
-
* Copyright 2019 Google LLC
|
|
325
|
-
*
|
|
326
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
327
|
-
* you may not use this file except in compliance with the License.
|
|
328
|
-
* You may obtain a copy of the License at
|
|
329
|
-
*
|
|
330
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
331
|
-
*
|
|
332
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
333
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
334
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
335
|
-
* See the License for the specific language governing permissions and
|
|
336
|
-
* limitations under the License.
|
|
337
|
-
*/class iE{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 Ls("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 Jr.create("app-deleted",{appName:this._name})}}/**
|
|
338
|
-
* @license
|
|
339
|
-
* Copyright 2019 Google LLC
|
|
340
|
-
*
|
|
341
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
342
|
-
* you may not use this file except in compliance with the License.
|
|
343
|
-
* You may obtain a copy of the License at
|
|
344
|
-
*
|
|
345
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
346
|
-
*
|
|
347
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
348
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
349
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
350
|
-
* See the License for the specific language governing permissions and
|
|
351
|
-
* limitations under the License.
|
|
352
|
-
*/const Mo=nE;function Qf(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:Ja,automaticDataCollectionEnabled:!0,...t},s=r.name;if(typeof s!="string"||!s)throw Jr.create("bad-app-name",{appName:String(s)});if(n||(n=zf()),!n)throw Jr.create("no-options");const o=To.get(s);if(o){if(Ds(n,o.options)&&Ds(r,o.config))return o;throw Jr.create("duplicate-app",{appName:s})}const i=new fI(s);for(const l of Ya.values())i.addComponent(l);const a=new iE(n,r,i);return To.set(s,a),a}function Xf(e=Ja){const t=To.get(e);if(!t&&e===Ja&&zf())return Qf();if(!t)throw Jr.create("no-app",{appName:e});return t}function aE(){return Array.from(To.values())}function xs(e,t,n){let r=rE[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 "/")`),Pr.warn(i.join(" "));return}So(new Ls(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/**
|
|
353
|
-
* @license
|
|
354
|
-
* Copyright 2021 Google LLC
|
|
355
|
-
*
|
|
356
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
357
|
-
* you may not use this file except in compliance with the License.
|
|
358
|
-
* You may obtain a copy of the License at
|
|
359
|
-
*
|
|
360
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
361
|
-
*
|
|
362
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
363
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
364
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
365
|
-
* See the License for the specific language governing permissions and
|
|
366
|
-
* limitations under the License.
|
|
367
|
-
*/const lE="firebase-heartbeat-database",cE=1,Io="firebase-heartbeat-store";let va=null;function Zf(){return va||(va=II(lE,cE,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Io)}catch(n){console.warn(n)}}}}).catch(e=>{throw Jr.create("idb-open",{originalErrorMessage:e.message})})),va}async function uE(e){try{const n=(await Zf()).transaction(Io),r=await n.objectStore(Io).get(eh(e));return await n.done,r}catch(t){if(t instanceof Xr)Pr.warn(t.message);else{const n=Jr.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});Pr.warn(n.message)}}}async function xu(e,t){try{const r=(await Zf()).transaction(Io,"readwrite");await r.objectStore(Io).put(t,eh(e)),await r.done}catch(n){if(n instanceof Xr)Pr.warn(n.message);else{const r=Jr.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Pr.warn(r.message)}}}function eh(e){return`${e.name}!${e.options.appId}`}/**
|
|
368
|
-
* @license
|
|
369
|
-
* Copyright 2021 Google LLC
|
|
370
|
-
*
|
|
371
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
372
|
-
* you may not use this file except in compliance with the License.
|
|
373
|
-
* You may obtain a copy of the License at
|
|
374
|
-
*
|
|
375
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
376
|
-
*
|
|
377
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
378
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
379
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
380
|
-
* See the License for the specific language governing permissions and
|
|
381
|
-
* limitations under the License.
|
|
382
|
-
*/const dE=1024,fE=30;class hE{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new mE(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=Ru();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>fE){const i=gE(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){Pr.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=Ru(),{heartbeatsToSend:r,unsentEntries:s}=pE(this._heartbeatsCache.heartbeats),o=Vf(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 Pr.warn(n),""}}}function Ru(){return new Date().toISOString().substring(0,10)}function pE(e,t=dE){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 mE{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return ZS()?eI().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await uE(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 xu(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 xu(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...t.heartbeats]})}else return}}function Pu(e){return Vf(JSON.stringify({version:2,heartbeats:e})).length}function gE(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}/**
|
|
383
|
-
* @license
|
|
384
|
-
* Copyright 2019 Google LLC
|
|
385
|
-
*
|
|
386
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
387
|
-
* you may not use this file except in compliance with the License.
|
|
388
|
-
* You may obtain a copy of the License at
|
|
389
|
-
*
|
|
390
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
391
|
-
*
|
|
392
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
393
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
394
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
395
|
-
* See the License for the specific language governing permissions and
|
|
396
|
-
* limitations under the License.
|
|
397
|
-
*/function vE(e){So(new Ls("platform-logger",t=>new AI(t),"PRIVATE")),So(new Ls("heartbeat",t=>new hE(t),"PRIVATE")),xs(Ka,Cu,e),xs(Ka,Cu,"esm2020"),xs("fire-js","")}vE("");var yE="firebase",wE="12.11.0";/**
|
|
398
|
-
* @license
|
|
399
|
-
* Copyright 2020 Google LLC
|
|
400
|
-
*
|
|
401
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
402
|
-
* you may not use this file except in compliance with the License.
|
|
403
|
-
* You may obtain a copy of the License at
|
|
404
|
-
*
|
|
405
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
406
|
-
*
|
|
407
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
408
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
409
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
410
|
-
* See the License for the specific language governing permissions and
|
|
411
|
-
* limitations under the License.
|
|
412
|
-
*/xs(yE,wE,"app");function th(){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 bE=th,nh=new Ro("auth","Firebase",th());/**
|
|
413
|
-
* @license
|
|
414
|
-
* Copyright 2020 Google LLC
|
|
415
|
-
*
|
|
416
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
417
|
-
* you may not use this file except in compliance with the License.
|
|
418
|
-
* You may obtain a copy of the License at
|
|
419
|
-
*
|
|
420
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
421
|
-
*
|
|
422
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
423
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
424
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
425
|
-
* See the License for the specific language governing permissions and
|
|
426
|
-
* limitations under the License.
|
|
427
|
-
*/const fi=new qf("@firebase/auth");function _E(e,...t){fi.logLevel<=At.WARN&&fi.warn(`Auth (${Mo}): ${e}`,...t)}function Zo(e,...t){fi.logLevel<=At.ERROR&&fi.error(`Auth (${Mo}): ${e}`,...t)}/**
|
|
428
|
-
* @license
|
|
429
|
-
* Copyright 2020 Google LLC
|
|
430
|
-
*
|
|
431
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
432
|
-
* you may not use this file except in compliance with the License.
|
|
433
|
-
* You may obtain a copy of the License at
|
|
434
|
-
*
|
|
435
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
436
|
-
*
|
|
437
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
438
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
439
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
440
|
-
* See the License for the specific language governing permissions and
|
|
441
|
-
* limitations under the License.
|
|
442
|
-
*/function hr(e,...t){throw $l(e,...t)}function qn(e,...t){return $l(e,...t)}function Ml(e,t,n){const r={...bE(),[t]:n};return new Ro("auth","Firebase",r).create(t,{appName:e.name})}function ps(e){return Ml(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function kE(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&hr(e,"argument-error"),Ml(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function $l(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 nh.create(e,...t)}function Ye(e,t,...n){if(!e)throw $l(t,...n)}function Tr(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Zo(t),new Error(t)}function Mr(e,t){e||Tr(t)}/**
|
|
443
|
-
* @license
|
|
444
|
-
* Copyright 2020 Google LLC
|
|
445
|
-
*
|
|
446
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
447
|
-
* you may not use this file except in compliance with the License.
|
|
448
|
-
* You may obtain a copy of the License at
|
|
449
|
-
*
|
|
450
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
451
|
-
*
|
|
452
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
453
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
454
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
455
|
-
* See the License for the specific language governing permissions and
|
|
456
|
-
* limitations under the License.
|
|
457
|
-
*/function Qa(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function TE(){return Mu()==="http:"||Mu()==="https:"}function Mu(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
|
|
458
|
-
* @license
|
|
459
|
-
* Copyright 2020 Google LLC
|
|
460
|
-
*
|
|
461
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
462
|
-
* you may not use this file except in compliance with the License.
|
|
463
|
-
* You may obtain a copy of the License at
|
|
464
|
-
*
|
|
465
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
466
|
-
*
|
|
467
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
468
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
469
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
470
|
-
* See the License for the specific language governing permissions and
|
|
471
|
-
* limitations under the License.
|
|
472
|
-
*/function SE(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(TE()||YS()||"connection"in navigator)?navigator.onLine:!0}function IE(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
|
|
473
|
-
* @license
|
|
474
|
-
* Copyright 2020 Google LLC
|
|
475
|
-
*
|
|
476
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
477
|
-
* you may not use this file except in compliance with the License.
|
|
478
|
-
* You may obtain a copy of the License at
|
|
479
|
-
*
|
|
480
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
481
|
-
*
|
|
482
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
483
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
484
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
485
|
-
* See the License for the specific language governing permissions and
|
|
486
|
-
* limitations under the License.
|
|
487
|
-
*/class $o{constructor(t,n){this.shortDelay=t,this.longDelay=n,Mr(n>t,"Short delay should be less than long delay!"),this.isMobile=KS()||QS()}get(){return SE()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
|
|
488
|
-
* @license
|
|
489
|
-
* Copyright 2020 Google LLC
|
|
490
|
-
*
|
|
491
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
492
|
-
* you may not use this file except in compliance with the License.
|
|
493
|
-
* You may obtain a copy of the License at
|
|
494
|
-
*
|
|
495
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
496
|
-
*
|
|
497
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
498
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
499
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
500
|
-
* See the License for the specific language governing permissions and
|
|
501
|
-
* limitations under the License.
|
|
502
|
-
*/function Ol(e,t){Mr(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
|
|
503
|
-
* @license
|
|
504
|
-
* Copyright 2020 Google LLC
|
|
505
|
-
*
|
|
506
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
507
|
-
* you may not use this file except in compliance with the License.
|
|
508
|
-
* You may obtain a copy of the License at
|
|
509
|
-
*
|
|
510
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
511
|
-
*
|
|
512
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
513
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
514
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
515
|
-
* See the License for the specific language governing permissions and
|
|
516
|
-
* limitations under the License.
|
|
517
|
-
*/class rh{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;Tr("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;Tr("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;Tr("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
|
|
518
|
-
* @license
|
|
519
|
-
* Copyright 2020 Google LLC
|
|
520
|
-
*
|
|
521
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
522
|
-
* you may not use this file except in compliance with the License.
|
|
523
|
-
* You may obtain a copy of the License at
|
|
524
|
-
*
|
|
525
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
526
|
-
*
|
|
527
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
528
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
529
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
530
|
-
* See the License for the specific language governing permissions and
|
|
531
|
-
* limitations under the License.
|
|
532
|
-
*/const EE={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"};/**
|
|
533
|
-
* @license
|
|
534
|
-
* Copyright 2020 Google LLC
|
|
535
|
-
*
|
|
536
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
537
|
-
* you may not use this file except in compliance with the License.
|
|
538
|
-
* You may obtain a copy of the License at
|
|
539
|
-
*
|
|
540
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
541
|
-
*
|
|
542
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
543
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
544
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
545
|
-
* See the License for the specific language governing permissions and
|
|
546
|
-
* limitations under the License.
|
|
547
|
-
*/const CE=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],AE=new $o(3e4,6e4);function Nl(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function Fs(e,t,n,r,s={}){return sh(e,s,async()=>{let o={},i={};r&&(t==="GET"?i=r:o={body:JSON.stringify(r)});const a=Po({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 JS()||(d.referrerPolicy="no-referrer"),e.emulatorConfig&&Rl(e.emulatorConfig.host)&&(d.credentials="include"),rh.fetch()(await oh(e,e.config.apiHost,n,a),d)})}async function sh(e,t,n){e._canInitEmulator=!1;const r={...EE,...t};try{const s=new RE(e),o=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw Uo(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 Uo(e,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw Uo(e,"email-already-in-use",i);if(l==="USER_DISABLED")throw Uo(e,"user-disabled",i);const c=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(d)throw Ml(e,c,d);hr(e,c)}}catch(s){if(s instanceof Xr)throw s;hr(e,"network-request-failed",{message:String(s)})}}async function xE(e,t,n,r,s={}){const o=await Fs(e,t,n,r,s);return"mfaPendingCredential"in o&&hr(e,"multi-factor-auth-required",{_serverResponse:o}),o}async function oh(e,t,n,r){const s=`${t}${n}?${r}`,o=e,i=o.config.emulator?Ol(e.config,s):`${e.config.apiScheme}://${s}`;return CE.includes(n)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(i).toString():i}class RE{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(qn(this.auth,"network-request-failed")),AE.get())})}}function Uo(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=qn(e,t,r);return s.customData._tokenResponse=n,s}/**
|
|
548
|
-
* @license
|
|
549
|
-
* Copyright 2020 Google LLC
|
|
550
|
-
*
|
|
551
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
552
|
-
* you may not use this file except in compliance with the License.
|
|
553
|
-
* You may obtain a copy of the License at
|
|
554
|
-
*
|
|
555
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
556
|
-
*
|
|
557
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
558
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
559
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
560
|
-
* See the License for the specific language governing permissions and
|
|
561
|
-
* limitations under the License.
|
|
562
|
-
*/async function PE(e,t){return Fs(e,"POST","/v1/accounts:delete",t)}async function hi(e,t){return Fs(e,"POST","/v1/accounts:lookup",t)}/**
|
|
563
|
-
* @license
|
|
564
|
-
* Copyright 2020 Google LLC
|
|
565
|
-
*
|
|
566
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
567
|
-
* you may not use this file except in compliance with the License.
|
|
568
|
-
* You may obtain a copy of the License at
|
|
569
|
-
*
|
|
570
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
571
|
-
*
|
|
572
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
573
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
574
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
575
|
-
* See the License for the specific language governing permissions and
|
|
576
|
-
* limitations under the License.
|
|
577
|
-
*/function co(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function ME(e,t=!1){const n=Bs(e),r=await n.getIdToken(t),s=Dl(r);Ye(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:co(ya(s.auth_time)),issuedAtTime:co(ya(s.iat)),expirationTime:co(ya(s.exp)),signInProvider:i||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function ya(e){return Number(e)*1e3}function Dl(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return Zo("JWT malformed, contained fewer than 3 sections"),null;try{const s=Wf(n);return s?JSON.parse(s):(Zo("Failed to decode base64 JWT payload"),null)}catch(s){return Zo("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function $u(e){const t=Dl(e);return Ye(t,"internal-error"),Ye(typeof t.exp<"u","internal-error"),Ye(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
|
|
578
|
-
* @license
|
|
579
|
-
* Copyright 2020 Google LLC
|
|
580
|
-
*
|
|
581
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
582
|
-
* you may not use this file except in compliance with the License.
|
|
583
|
-
* You may obtain a copy of the License at
|
|
584
|
-
*
|
|
585
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
586
|
-
*
|
|
587
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
588
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
589
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
590
|
-
* See the License for the specific language governing permissions and
|
|
591
|
-
* limitations under the License.
|
|
592
|
-
*/async function Eo(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof Xr&&$E(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function $E({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
|
|
593
|
-
* @license
|
|
594
|
-
* Copyright 2020 Google LLC
|
|
595
|
-
*
|
|
596
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
597
|
-
* you may not use this file except in compliance with the License.
|
|
598
|
-
* You may obtain a copy of the License at
|
|
599
|
-
*
|
|
600
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
601
|
-
*
|
|
602
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
603
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
604
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
605
|
-
* See the License for the specific language governing permissions and
|
|
606
|
-
* limitations under the License.
|
|
607
|
-
*/class OE{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()}}/**
|
|
608
|
-
* @license
|
|
609
|
-
* Copyright 2020 Google LLC
|
|
610
|
-
*
|
|
611
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
612
|
-
* you may not use this file except in compliance with the License.
|
|
613
|
-
* You may obtain a copy of the License at
|
|
614
|
-
*
|
|
615
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
616
|
-
*
|
|
617
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
618
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
619
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
620
|
-
* See the License for the specific language governing permissions and
|
|
621
|
-
* limitations under the License.
|
|
622
|
-
*/class Xa{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=co(this.lastLoginAt),this.creationTime=co(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
|
|
623
|
-
* @license
|
|
624
|
-
* Copyright 2019 Google LLC
|
|
625
|
-
*
|
|
626
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
627
|
-
* you may not use this file except in compliance with the License.
|
|
628
|
-
* You may obtain a copy of the License at
|
|
629
|
-
*
|
|
630
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
631
|
-
*
|
|
632
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
633
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
634
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
635
|
-
* See the License for the specific language governing permissions and
|
|
636
|
-
* limitations under the License.
|
|
637
|
-
*/async function pi(e){var h;const t=e.auth,n=await e.getIdToken(),r=await Eo(e,hi(t,{idToken:n}));Ye(r==null?void 0:r.users.length,t,"internal-error");const s=r.users[0];e._notifyReloadListener(s);const o=(h=s.providerUserInfo)!=null&&h.length?ih(s.providerUserInfo):[],i=DE(e.providerData,o),a=e.isAnonymous,l=!(e.email&&s.passwordHash)&&!(i!=null&&i.length),d=a?l:!1,c={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:i,metadata:new Xa(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(e,c)}async function NE(e){const t=Bs(e);await pi(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function DE(e,t){return[...e.filter(r=>!t.some(s=>s.providerId===r.providerId)),...t]}function ih(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}))}/**
|
|
638
|
-
* @license
|
|
639
|
-
* Copyright 2020 Google LLC
|
|
640
|
-
*
|
|
641
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
642
|
-
* you may not use this file except in compliance with the License.
|
|
643
|
-
* You may obtain a copy of the License at
|
|
644
|
-
*
|
|
645
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
646
|
-
*
|
|
647
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
648
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
649
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
650
|
-
* See the License for the specific language governing permissions and
|
|
651
|
-
* limitations under the License.
|
|
652
|
-
*/async function LE(e,t){const n=await sh(e,{},async()=>{const r=Po({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:o}=e.config,i=await oh(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&&Rl(e.emulatorConfig.host)&&(l.credentials="include"),rh.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function jE(e,t){return Fs(e,"POST","/v2/accounts:revokeToken",Nl(e,t))}/**
|
|
653
|
-
* @license
|
|
654
|
-
* Copyright 2020 Google LLC
|
|
655
|
-
*
|
|
656
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
657
|
-
* you may not use this file except in compliance with the License.
|
|
658
|
-
* You may obtain a copy of the License at
|
|
659
|
-
*
|
|
660
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
661
|
-
*
|
|
662
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
663
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
664
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
665
|
-
* See the License for the specific language governing permissions and
|
|
666
|
-
* limitations under the License.
|
|
667
|
-
*/class Rs{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Ye(t.idToken,"internal-error"),Ye(typeof t.idToken<"u","internal-error"),Ye(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):$u(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){Ye(t.length!==0,"internal-error");const n=$u(t);this.updateTokensAndExpiration(t,null,n)}async getToken(t,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Ye(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 LE(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 Rs;return r&&(Ye(typeof r=="string","internal-error",{appName:t}),i.refreshToken=r),s&&(Ye(typeof s=="string","internal-error",{appName:t}),i.accessToken=s),o&&(Ye(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 Rs,this.toJSON())}_performRefresh(){return Tr("not implemented")}}/**
|
|
668
|
-
* @license
|
|
669
|
-
* Copyright 2020 Google LLC
|
|
670
|
-
*
|
|
671
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
672
|
-
* you may not use this file except in compliance with the License.
|
|
673
|
-
* You may obtain a copy of the License at
|
|
674
|
-
*
|
|
675
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
676
|
-
*
|
|
677
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
678
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
679
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
680
|
-
* See the License for the specific language governing permissions and
|
|
681
|
-
* limitations under the License.
|
|
682
|
-
*/function Br(e,t){Ye(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class Wn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new OE(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 Xa(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await Eo(this,this.stsTokenManager.getToken(this.auth,t));return Ye(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return ME(this,t)}reload(){return NE(this)}_assign(t){this!==t&&(Ye(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 Wn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){Ye(!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 pi(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(lr(this.auth.app))return Promise.reject(ps(this.auth));const t=await this.getIdToken();return await Eo(this,PE(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,c=n.lastLoginAt??void 0,{uid:h,emailVerified:b,isAnonymous:T,providerData:N,stsTokenManager:O}=n;Ye(h&&O,t,"internal-error");const J=Rs.fromJSON(this.name,O);Ye(typeof h=="string",t,"internal-error"),Br(r,t.name),Br(s,t.name),Ye(typeof b=="boolean",t,"internal-error"),Ye(typeof T=="boolean",t,"internal-error"),Br(o,t.name),Br(i,t.name),Br(a,t.name),Br(l,t.name),Br(d,t.name),Br(c,t.name);const ie=new Wn({uid:h,auth:t,email:s,emailVerified:b,displayName:r,isAnonymous:T,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:J,createdAt:d,lastLoginAt:c});return N&&Array.isArray(N)&&(ie.providerData=N.map(L=>({...L}))),l&&(ie._redirectEventId=l),ie}static async _fromIdTokenResponse(t,n,r=!1){const s=new Rs;s.updateFromServerResponse(n);const o=new Wn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await pi(o),o}static async _fromGetAccountInfoResponse(t,n,r){const s=n.users[0];Ye(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?ih(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new Rs;a.updateFromIdToken(r);const l=new Wn({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 Xa(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,d),l}}/**
|
|
683
|
-
* @license
|
|
684
|
-
* Copyright 2020 Google LLC
|
|
685
|
-
*
|
|
686
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
687
|
-
* you may not use this file except in compliance with the License.
|
|
688
|
-
* You may obtain a copy of the License at
|
|
689
|
-
*
|
|
690
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
691
|
-
*
|
|
692
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
693
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
694
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
695
|
-
* See the License for the specific language governing permissions and
|
|
696
|
-
* limitations under the License.
|
|
697
|
-
*/const Ou=new Map;function Sr(e){Mr(e instanceof Function,"Expected a class definition");let t=Ou.get(e);return t?(Mr(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Ou.set(e,t),t)}/**
|
|
698
|
-
* @license
|
|
699
|
-
* Copyright 2019 Google LLC
|
|
700
|
-
*
|
|
701
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
702
|
-
* you may not use this file except in compliance with the License.
|
|
703
|
-
* You may obtain a copy of the License at
|
|
704
|
-
*
|
|
705
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
706
|
-
*
|
|
707
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
708
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
709
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
710
|
-
* See the License for the specific language governing permissions and
|
|
711
|
-
* limitations under the License.
|
|
712
|
-
*/class ah{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){}}ah.type="NONE";const Nu=ah;/**
|
|
713
|
-
* @license
|
|
714
|
-
* Copyright 2019 Google LLC
|
|
715
|
-
*
|
|
716
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
717
|
-
* you may not use this file except in compliance with the License.
|
|
718
|
-
* You may obtain a copy of the License at
|
|
719
|
-
*
|
|
720
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
721
|
-
*
|
|
722
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
723
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
724
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
725
|
-
* See the License for the specific language governing permissions and
|
|
726
|
-
* limitations under the License.
|
|
727
|
-
*/function ei(e,t,n){return`firebase:${e}:${t}:${n}`}class Ps{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=ei(this.userKey,s.apiKey,o),this.fullPersistenceKey=ei("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 hi(this.auth,{idToken:t}).catch(()=>{});return n?Wn._fromGetAccountInfoResponse(this.auth,n,t):null}return Wn._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 Ps(Sr(Nu),t,r);const s=(await Promise.all(n.map(async d=>{if(await d._isAvailable())return d}))).filter(d=>d);let o=s[0]||Sr(Nu);const i=ei(r,t.config.apiKey,t.name);let a=null;for(const d of n)try{const c=await d._get(i);if(c){let h;if(typeof c=="string"){const b=await hi(t,{idToken:c}).catch(()=>{});if(!b)break;h=await Wn._fromGetAccountInfoResponse(t,b,c)}else h=Wn._fromJSON(t,c);d!==o&&(a=h),o=d;break}}catch{}const l=s.filter(d=>d._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new Ps(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 Ps(o,t,r))}}/**
|
|
728
|
-
* @license
|
|
729
|
-
* Copyright 2020 Google LLC
|
|
730
|
-
*
|
|
731
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
732
|
-
* you may not use this file except in compliance with the License.
|
|
733
|
-
* You may obtain a copy of the License at
|
|
734
|
-
*
|
|
735
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
736
|
-
*
|
|
737
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
738
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
739
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
740
|
-
* See the License for the specific language governing permissions and
|
|
741
|
-
* limitations under the License.
|
|
742
|
-
*/function Du(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(dh(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(lh(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(hh(t))return"Blackberry";if(ph(t))return"Webos";if(ch(t))return"Safari";if((t.includes("chrome/")||uh(t))&&!t.includes("edge/"))return"Chrome";if(fh(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 lh(e=bn()){return/firefox\//i.test(e)}function ch(e=bn()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function uh(e=bn()){return/crios\//i.test(e)}function dh(e=bn()){return/iemobile/i.test(e)}function fh(e=bn()){return/android/i.test(e)}function hh(e=bn()){return/blackberry/i.test(e)}function ph(e=bn()){return/webos/i.test(e)}function Ll(e=bn()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function BE(e=bn()){var t;return Ll(e)&&!!((t=window.navigator)!=null&&t.standalone)}function FE(){return XS()&&document.documentMode===10}function mh(e=bn()){return Ll(e)||fh(e)||ph(e)||hh(e)||/windows phone/i.test(e)||dh(e)}/**
|
|
743
|
-
* @license
|
|
744
|
-
* Copyright 2020 Google LLC
|
|
745
|
-
*
|
|
746
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
747
|
-
* you may not use this file except in compliance with the License.
|
|
748
|
-
* You may obtain a copy of the License at
|
|
749
|
-
*
|
|
750
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
751
|
-
*
|
|
752
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
753
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
754
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
755
|
-
* See the License for the specific language governing permissions and
|
|
756
|
-
* limitations under the License.
|
|
757
|
-
*/function gh(e,t=[]){let n;switch(e){case"Browser":n=Du(bn());break;case"Worker":n=`${Du(bn())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${Mo}/${r}`}/**
|
|
758
|
-
* @license
|
|
759
|
-
* Copyright 2022 Google LLC
|
|
760
|
-
*
|
|
761
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
762
|
-
* you may not use this file except in compliance with the License.
|
|
763
|
-
* You may obtain a copy of the License at
|
|
764
|
-
*
|
|
765
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
766
|
-
*
|
|
767
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
768
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
769
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
770
|
-
* See the License for the specific language governing permissions and
|
|
771
|
-
* limitations under the License.
|
|
772
|
-
*/class UE{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})}}}/**
|
|
773
|
-
* @license
|
|
774
|
-
* Copyright 2023 Google LLC
|
|
775
|
-
*
|
|
776
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
777
|
-
* you may not use this file except in compliance with the License.
|
|
778
|
-
* You may obtain a copy of the License at
|
|
779
|
-
*
|
|
780
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
781
|
-
*
|
|
782
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
783
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
784
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
785
|
-
* See the License for the specific language governing permissions and
|
|
786
|
-
* limitations under the License.
|
|
787
|
-
*/async function HE(e,t={}){return Fs(e,"GET","/v2/passwordPolicy",Nl(e,t))}/**
|
|
788
|
-
* @license
|
|
789
|
-
* Copyright 2023 Google LLC
|
|
790
|
-
*
|
|
791
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
792
|
-
* you may not use this file except in compliance with the License.
|
|
793
|
-
* You may obtain a copy of the License at
|
|
794
|
-
*
|
|
795
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
796
|
-
*
|
|
797
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
798
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
799
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
800
|
-
* See the License for the specific language governing permissions and
|
|
801
|
-
* limitations under the License.
|
|
802
|
-
*/const VE=6;class WE{constructor(t){var r;const n=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??VE,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))}}/**
|
|
803
|
-
* @license
|
|
804
|
-
* Copyright 2020 Google LLC
|
|
805
|
-
*
|
|
806
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
807
|
-
* you may not use this file except in compliance with the License.
|
|
808
|
-
* You may obtain a copy of the License at
|
|
809
|
-
*
|
|
810
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
811
|
-
*
|
|
812
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
813
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
814
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
815
|
-
* See the License for the specific language governing permissions and
|
|
816
|
-
* limitations under the License.
|
|
817
|
-
*/class zE{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 Lu(this),this.idTokenSubscription=new Lu(this),this.beforeStateQueue=new UE(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=nh,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=Sr(n)),this._initializationPromise=this.queue(async()=>{var r,s,o;if(!this._deleted&&(this.persistenceManager=await Ps.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 hi(this,{idToken:t}),r=await Wn._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(lr(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 Ye(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 pi(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=IE()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(lr(this.app))return Promise.reject(ps(this));const n=t?Bs(t):null;return n&&Ye(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&&Ye(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 lr(this.app)?Promise.reject(ps(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return lr(this.app)?Promise.reject(ps(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Sr(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 HE(this),n=new WE(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 Ro("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 jE(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&&Sr(t)||this._popupRedirectResolver;Ye(n,this,"argument-error"),this.redirectPersistenceManager=await Ps.create(this,[Sr(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(Ye(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 Ye(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=gh(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(lr(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&&_E(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function Oi(e){return Bs(e)}class Lu{constructor(t){this.auth=t,this.observer=null,this.addObserver=oI(n=>this.observer=n)}get next(){return Ye(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
|
|
818
|
-
* @license
|
|
819
|
-
* Copyright 2020 Google LLC
|
|
820
|
-
*
|
|
821
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
822
|
-
* you may not use this file except in compliance with the License.
|
|
823
|
-
* You may obtain a copy of the License at
|
|
824
|
-
*
|
|
825
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
826
|
-
*
|
|
827
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
828
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
829
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
830
|
-
* See the License for the specific language governing permissions and
|
|
831
|
-
* limitations under the License.
|
|
832
|
-
*/let jl={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function GE(e){jl=e}function qE(e){return jl.loadJS(e)}function KE(){return jl.gapiScript}function JE(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
|
|
833
|
-
* @license
|
|
834
|
-
* Copyright 2020 Google LLC
|
|
835
|
-
*
|
|
836
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
837
|
-
* you may not use this file except in compliance with the License.
|
|
838
|
-
* You may obtain a copy of the License at
|
|
839
|
-
*
|
|
840
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
841
|
-
*
|
|
842
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
843
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
844
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
845
|
-
* See the License for the specific language governing permissions and
|
|
846
|
-
* limitations under the License.
|
|
847
|
-
*/function YE(e,t){const n=Yf(e,"auth");if(n.isInitialized()){const s=n.getImmediate(),o=n.getOptions();if(Ds(o,t??{}))return s;hr(s,"already-initialized")}return n.initialize({options:t})}function QE(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Sr);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function XE(e,t,n){const r=Oi(e);Ye(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const s=!1,o=vh(t),{host:i,port:a}=ZE(t),l=a===null?"":`:${a}`,d={url:`${o}//${i}${l}/`},c=Object.freeze({host:i,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){Ye(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Ye(Ds(d,r.config.emulator)&&Ds(c,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=d,r.emulatorConfig=c,r.settings.appVerificationDisabledForTesting=!0,Rl(i)?lI(`${o}//${i}${l}`):e1()}function vh(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function ZE(e){const t=vh(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:ju(r.substr(o.length+1))}}else{const[o,i]=r.split(":");return{host:o,port:ju(i)}}}function ju(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function e1(){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())}/**
|
|
848
|
-
* @license
|
|
849
|
-
* Copyright 2020 Google LLC
|
|
850
|
-
*
|
|
851
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
852
|
-
* you may not use this file except in compliance with the License.
|
|
853
|
-
* You may obtain a copy of the License at
|
|
854
|
-
*
|
|
855
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
856
|
-
*
|
|
857
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
858
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
859
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
860
|
-
* See the License for the specific language governing permissions and
|
|
861
|
-
* limitations under the License.
|
|
862
|
-
*/class yh{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return Tr("not implemented")}_getIdTokenResponse(t){return Tr("not implemented")}_linkToIdToken(t,n){return Tr("not implemented")}_getReauthenticationResolver(t){return Tr("not implemented")}}/**
|
|
863
|
-
* @license
|
|
864
|
-
* Copyright 2020 Google LLC
|
|
865
|
-
*
|
|
866
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
867
|
-
* you may not use this file except in compliance with the License.
|
|
868
|
-
* You may obtain a copy of the License at
|
|
869
|
-
*
|
|
870
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
871
|
-
*
|
|
872
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
873
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
874
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
875
|
-
* See the License for the specific language governing permissions and
|
|
876
|
-
* limitations under the License.
|
|
877
|
-
*/async function Ms(e,t){return xE(e,"POST","/v1/accounts:signInWithIdp",Nl(e,t))}/**
|
|
878
|
-
* @license
|
|
879
|
-
* Copyright 2020 Google LLC
|
|
880
|
-
*
|
|
881
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
882
|
-
* you may not use this file except in compliance with the License.
|
|
883
|
-
* You may obtain a copy of the License at
|
|
884
|
-
*
|
|
885
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
886
|
-
*
|
|
887
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
888
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
889
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
890
|
-
* See the License for the specific language governing permissions and
|
|
891
|
-
* limitations under the License.
|
|
892
|
-
*/const t1="http://localhost";class ms extends yh{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new ms(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):hr("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 ms(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 Ms(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,Ms(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,Ms(t,n)}buildRequest(){const t={requestUri:t1,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=Po(n)}return t}}/**
|
|
893
|
-
* @license
|
|
894
|
-
* Copyright 2020 Google LLC
|
|
895
|
-
*
|
|
896
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
897
|
-
* you may not use this file except in compliance with the License.
|
|
898
|
-
* You may obtain a copy of the License at
|
|
899
|
-
*
|
|
900
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
901
|
-
*
|
|
902
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
903
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
904
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
905
|
-
* See the License for the specific language governing permissions and
|
|
906
|
-
* limitations under the License.
|
|
907
|
-
*/class Bl{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}}/**
|
|
908
|
-
* @license
|
|
909
|
-
* Copyright 2019 Google LLC
|
|
910
|
-
*
|
|
911
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
912
|
-
* you may not use this file except in compliance with the License.
|
|
913
|
-
* You may obtain a copy of the License at
|
|
914
|
-
*
|
|
915
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
916
|
-
*
|
|
917
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
918
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
919
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
920
|
-
* See the License for the specific language governing permissions and
|
|
921
|
-
* limitations under the License.
|
|
922
|
-
*/class Oo extends Bl{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
|
|
923
|
-
* @license
|
|
924
|
-
* Copyright 2020 Google LLC
|
|
925
|
-
*
|
|
926
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
927
|
-
* you may not use this file except in compliance with the License.
|
|
928
|
-
* You may obtain a copy of the License at
|
|
929
|
-
*
|
|
930
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
931
|
-
*
|
|
932
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
933
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
934
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
935
|
-
* See the License for the specific language governing permissions and
|
|
936
|
-
* limitations under the License.
|
|
937
|
-
*/class Wr extends Oo{constructor(){super("facebook.com")}static credential(t){return ms._fromParams({providerId:Wr.PROVIDER_ID,signInMethod:Wr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Wr.credentialFromTaggedObject(t)}static credentialFromError(t){return Wr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Wr.credential(t.oauthAccessToken)}catch{return null}}}Wr.FACEBOOK_SIGN_IN_METHOD="facebook.com";Wr.PROVIDER_ID="facebook.com";/**
|
|
938
|
-
* @license
|
|
939
|
-
* Copyright 2020 Google LLC
|
|
940
|
-
*
|
|
941
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
942
|
-
* you may not use this file except in compliance with the License.
|
|
943
|
-
* You may obtain a copy of the License at
|
|
944
|
-
*
|
|
945
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
946
|
-
*
|
|
947
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
948
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
949
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
950
|
-
* See the License for the specific language governing permissions and
|
|
951
|
-
* limitations under the License.
|
|
952
|
-
*/class zr extends Oo{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return ms._fromParams({providerId:zr.PROVIDER_ID,signInMethod:zr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return zr.credentialFromTaggedObject(t)}static credentialFromError(t){return zr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return zr.credential(n,r)}catch{return null}}}zr.GOOGLE_SIGN_IN_METHOD="google.com";zr.PROVIDER_ID="google.com";/**
|
|
953
|
-
* @license
|
|
954
|
-
* Copyright 2020 Google LLC
|
|
955
|
-
*
|
|
956
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
957
|
-
* you may not use this file except in compliance with the License.
|
|
958
|
-
* You may obtain a copy of the License at
|
|
959
|
-
*
|
|
960
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
961
|
-
*
|
|
962
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
963
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
964
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
965
|
-
* See the License for the specific language governing permissions and
|
|
966
|
-
* limitations under the License.
|
|
967
|
-
*/class cr extends Oo{constructor(){super("github.com")}static credential(t){return ms._fromParams({providerId:cr.PROVIDER_ID,signInMethod:cr.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return cr.credentialFromTaggedObject(t)}static credentialFromError(t){return cr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return cr.credential(t.oauthAccessToken)}catch{return null}}}cr.GITHUB_SIGN_IN_METHOD="github.com";cr.PROVIDER_ID="github.com";/**
|
|
968
|
-
* @license
|
|
969
|
-
* Copyright 2020 Google LLC
|
|
970
|
-
*
|
|
971
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
972
|
-
* you may not use this file except in compliance with the License.
|
|
973
|
-
* You may obtain a copy of the License at
|
|
974
|
-
*
|
|
975
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
976
|
-
*
|
|
977
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
978
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
979
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
980
|
-
* See the License for the specific language governing permissions and
|
|
981
|
-
* limitations under the License.
|
|
982
|
-
*/class Gr extends Oo{constructor(){super("twitter.com")}static credential(t,n){return ms._fromParams({providerId:Gr.PROVIDER_ID,signInMethod:Gr.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return Gr.credentialFromTaggedObject(t)}static credentialFromError(t){return Gr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return Gr.credential(n,r)}catch{return null}}}Gr.TWITTER_SIGN_IN_METHOD="twitter.com";Gr.PROVIDER_ID="twitter.com";/**
|
|
983
|
-
* @license
|
|
984
|
-
* Copyright 2020 Google LLC
|
|
985
|
-
*
|
|
986
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
987
|
-
* you may not use this file except in compliance with the License.
|
|
988
|
-
* You may obtain a copy of the License at
|
|
989
|
-
*
|
|
990
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
991
|
-
*
|
|
992
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
993
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
994
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
995
|
-
* See the License for the specific language governing permissions and
|
|
996
|
-
* limitations under the License.
|
|
997
|
-
*/class js{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 Wn._fromIdTokenResponse(t,r,s),i=Bu(r);return new js({user:o,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const s=Bu(r);return new js({user:t,providerId:s,_tokenResponse:r,operationType:n})}}function Bu(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
|
|
998
|
-
* @license
|
|
999
|
-
* Copyright 2020 Google LLC
|
|
1000
|
-
*
|
|
1001
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1002
|
-
* you may not use this file except in compliance with the License.
|
|
1003
|
-
* You may obtain a copy of the License at
|
|
1004
|
-
*
|
|
1005
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1006
|
-
*
|
|
1007
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1008
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1009
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1010
|
-
* See the License for the specific language governing permissions and
|
|
1011
|
-
* limitations under the License.
|
|
1012
|
-
*/class mi extends Xr{constructor(t,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,mi.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 mi(t,n,r,s)}}function wh(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?mi._fromErrorAndOperation(e,o,t,r):o})}async function n1(e,t,n=!1){const r=await Eo(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return js._forOperation(e,"link",r)}/**
|
|
1013
|
-
* @license
|
|
1014
|
-
* Copyright 2019 Google LLC
|
|
1015
|
-
*
|
|
1016
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1017
|
-
* you may not use this file except in compliance with the License.
|
|
1018
|
-
* You may obtain a copy of the License at
|
|
1019
|
-
*
|
|
1020
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1021
|
-
*
|
|
1022
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1023
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1024
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1025
|
-
* See the License for the specific language governing permissions and
|
|
1026
|
-
* limitations under the License.
|
|
1027
|
-
*/async function r1(e,t,n=!1){const{auth:r}=e;if(lr(r.app))return Promise.reject(ps(r));const s="reauthenticate";try{const o=await Eo(e,wh(r,s,t,e),n);Ye(o.idToken,r,"internal-error");const i=Dl(o.idToken);Ye(i,r,"internal-error");const{sub:a}=i;return Ye(e.uid===a,r,"user-mismatch"),js._forOperation(e,s,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&hr(r,"user-mismatch"),o}}/**
|
|
1028
|
-
* @license
|
|
1029
|
-
* Copyright 2020 Google LLC
|
|
1030
|
-
*
|
|
1031
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1032
|
-
* you may not use this file except in compliance with the License.
|
|
1033
|
-
* You may obtain a copy of the License at
|
|
1034
|
-
*
|
|
1035
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1036
|
-
*
|
|
1037
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1038
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1039
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1040
|
-
* See the License for the specific language governing permissions and
|
|
1041
|
-
* limitations under the License.
|
|
1042
|
-
*/async function s1(e,t,n=!1){if(lr(e.app))return Promise.reject(ps(e));const r="signIn",s=await wh(e,r,t),o=await js._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(o.user),o}function o1(e,t,n,r){return Bs(e).onIdTokenChanged(t,n,r)}function i1(e,t,n){return Bs(e).beforeAuthStateChanged(t,n)}const gi="__sak";/**
|
|
1043
|
-
* @license
|
|
1044
|
-
* Copyright 2019 Google LLC
|
|
1045
|
-
*
|
|
1046
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1047
|
-
* you may not use this file except in compliance with the License.
|
|
1048
|
-
* You may obtain a copy of the License at
|
|
1049
|
-
*
|
|
1050
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1051
|
-
*
|
|
1052
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1053
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1054
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1055
|
-
* See the License for the specific language governing permissions and
|
|
1056
|
-
* limitations under the License.
|
|
1057
|
-
*/class bh{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(gi,"1"),this.storage.removeItem(gi),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()}}/**
|
|
1058
|
-
* @license
|
|
1059
|
-
* Copyright 2020 Google LLC
|
|
1060
|
-
*
|
|
1061
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1062
|
-
* you may not use this file except in compliance with the License.
|
|
1063
|
-
* You may obtain a copy of the License at
|
|
1064
|
-
*
|
|
1065
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1066
|
-
*
|
|
1067
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1068
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1069
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1070
|
-
* See the License for the specific language governing permissions and
|
|
1071
|
-
* limitations under the License.
|
|
1072
|
-
*/const a1=1e3,l1=10;class _h extends bh{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=mh(),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);FE()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,l1):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)})},a1)}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]}}_h.type="LOCAL";const c1=_h;/**
|
|
1073
|
-
* @license
|
|
1074
|
-
* Copyright 2020 Google LLC
|
|
1075
|
-
*
|
|
1076
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1077
|
-
* you may not use this file except in compliance with the License.
|
|
1078
|
-
* You may obtain a copy of the License at
|
|
1079
|
-
*
|
|
1080
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1081
|
-
*
|
|
1082
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1083
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1084
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1085
|
-
* See the License for the specific language governing permissions and
|
|
1086
|
-
* limitations under the License.
|
|
1087
|
-
*/class kh extends bh{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}kh.type="SESSION";const Th=kh;/**
|
|
1088
|
-
* @license
|
|
1089
|
-
* Copyright 2019 Google LLC
|
|
1090
|
-
*
|
|
1091
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1092
|
-
* you may not use this file except in compliance with the License.
|
|
1093
|
-
* You may obtain a copy of the License at
|
|
1094
|
-
*
|
|
1095
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1096
|
-
*
|
|
1097
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1098
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1099
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1100
|
-
* See the License for the specific language governing permissions and
|
|
1101
|
-
* limitations under the License.
|
|
1102
|
-
*/function u1(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
|
|
1103
|
-
* @license
|
|
1104
|
-
* Copyright 2019 Google LLC
|
|
1105
|
-
*
|
|
1106
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1107
|
-
* you may not use this file except in compliance with the License.
|
|
1108
|
-
* You may obtain a copy of the License at
|
|
1109
|
-
*
|
|
1110
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1111
|
-
*
|
|
1112
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1113
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1114
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1115
|
-
* See the License for the specific language governing permissions and
|
|
1116
|
-
* limitations under the License.
|
|
1117
|
-
*/class Ni{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 Ni(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 u1(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)}}Ni.receivers=[];/**
|
|
1118
|
-
* @license
|
|
1119
|
-
* Copyright 2020 Google LLC
|
|
1120
|
-
*
|
|
1121
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1122
|
-
* you may not use this file except in compliance with the License.
|
|
1123
|
-
* You may obtain a copy of the License at
|
|
1124
|
-
*
|
|
1125
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1126
|
-
*
|
|
1127
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1128
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1129
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1130
|
-
* See the License for the specific language governing permissions and
|
|
1131
|
-
* limitations under the License.
|
|
1132
|
-
*/function Fl(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
|
|
1133
|
-
* @license
|
|
1134
|
-
* Copyright 2019 Google LLC
|
|
1135
|
-
*
|
|
1136
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1137
|
-
* you may not use this file except in compliance with the License.
|
|
1138
|
-
* You may obtain a copy of the License at
|
|
1139
|
-
*
|
|
1140
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1141
|
-
*
|
|
1142
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1143
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1144
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1145
|
-
* See the License for the specific language governing permissions and
|
|
1146
|
-
* limitations under the License.
|
|
1147
|
-
*/class d1{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=Fl("",20);s.port1.start();const c=setTimeout(()=>{l(new Error("unsupported_event"))},r);i={messageChannel:s,onMessage(h){const b=h;if(b.data.eventId===d)switch(b.data.status){case"ack":clearTimeout(c),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(b.data.response);break;default:clearTimeout(c),clearTimeout(o),l(new Error("invalid_response"));break}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:t,eventId:d,data:n},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}/**
|
|
1148
|
-
* @license
|
|
1149
|
-
* Copyright 2020 Google LLC
|
|
1150
|
-
*
|
|
1151
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1152
|
-
* you may not use this file except in compliance with the License.
|
|
1153
|
-
* You may obtain a copy of the License at
|
|
1154
|
-
*
|
|
1155
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1156
|
-
*
|
|
1157
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1158
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1159
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1160
|
-
* See the License for the specific language governing permissions and
|
|
1161
|
-
* limitations under the License.
|
|
1162
|
-
*/function fr(){return window}function f1(e){fr().location.href=e}/**
|
|
1163
|
-
* @license
|
|
1164
|
-
* Copyright 2020 Google LLC.
|
|
1165
|
-
*
|
|
1166
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1167
|
-
* you may not use this file except in compliance with the License.
|
|
1168
|
-
* You may obtain a copy of the License at
|
|
1169
|
-
*
|
|
1170
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1171
|
-
*
|
|
1172
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1173
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1174
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1175
|
-
* See the License for the specific language governing permissions and
|
|
1176
|
-
* limitations under the License.
|
|
1177
|
-
*/function Sh(){return typeof fr().WorkerGlobalScope<"u"&&typeof fr().importScripts=="function"}async function h1(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function p1(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function m1(){return Sh()?self:null}/**
|
|
1178
|
-
* @license
|
|
1179
|
-
* Copyright 2019 Google LLC
|
|
1180
|
-
*
|
|
1181
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1182
|
-
* you may not use this file except in compliance with the License.
|
|
1183
|
-
* You may obtain a copy of the License at
|
|
1184
|
-
*
|
|
1185
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1186
|
-
*
|
|
1187
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1188
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1189
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1190
|
-
* See the License for the specific language governing permissions and
|
|
1191
|
-
* limitations under the License.
|
|
1192
|
-
*/const Ih="firebaseLocalStorageDb",g1=1,vi="firebaseLocalStorage",Eh="fbase_key";class No{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 Di(e,t){return e.transaction([vi],t?"readwrite":"readonly").objectStore(vi)}function v1(){const e=indexedDB.deleteDatabase(Ih);return new No(e).toPromise()}function Za(){const e=indexedDB.open(Ih,g1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(vi,{keyPath:Eh})}catch(s){n(s)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(vi)?t(r):(r.close(),await v1(),t(await Za()))})})}async function Fu(e,t,n){const r=Di(e,!0).put({[Eh]:t,value:n});return new No(r).toPromise()}async function y1(e,t){const n=Di(e,!1).get(t),r=await new No(n).toPromise();return r===void 0?null:r.value}function Uu(e,t){const n=Di(e,!0).delete(t);return new No(n).toPromise()}const w1=800,b1=3;class Ch{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 Za(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>b1)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Sh()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Ni._getInstance(m1()),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 h1(),!this.activeServiceWorker)return;this.sender=new d1(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||p1()!==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 Za();return await Fu(t,gi,"1"),await Uu(t,gi),!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=>Fu(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>y1(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>Uu(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(s=>{const o=Di(s,!1).getAll();return new No(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(),w1)}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()}}Ch.type="LOCAL";const _1=Ch;new $o(3e4,6e4);/**
|
|
1193
|
-
* @license
|
|
1194
|
-
* Copyright 2021 Google LLC
|
|
1195
|
-
*
|
|
1196
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1197
|
-
* you may not use this file except in compliance with the License.
|
|
1198
|
-
* You may obtain a copy of the License at
|
|
1199
|
-
*
|
|
1200
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1201
|
-
*
|
|
1202
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1203
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1204
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1205
|
-
* See the License for the specific language governing permissions and
|
|
1206
|
-
* limitations under the License.
|
|
1207
|
-
*/function Ah(e,t){return t?Sr(t):(Ye(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
|
|
1208
|
-
* @license
|
|
1209
|
-
* Copyright 2019 Google LLC
|
|
1210
|
-
*
|
|
1211
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1212
|
-
* you may not use this file except in compliance with the License.
|
|
1213
|
-
* You may obtain a copy of the License at
|
|
1214
|
-
*
|
|
1215
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1216
|
-
*
|
|
1217
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1218
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1219
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1220
|
-
* See the License for the specific language governing permissions and
|
|
1221
|
-
* limitations under the License.
|
|
1222
|
-
*/class Ul extends yh{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return Ms(t,this._buildIdpRequest())}_linkToIdToken(t,n){return Ms(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return Ms(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 k1(e){return s1(e.auth,new Ul(e),e.bypassAuthState)}function T1(e){const{auth:t,user:n}=e;return Ye(n,t,"internal-error"),r1(n,new Ul(e),e.bypassAuthState)}async function S1(e){const{auth:t,user:n}=e;return Ye(n,t,"internal-error"),n1(n,new Ul(e),e.bypassAuthState)}/**
|
|
1223
|
-
* @license
|
|
1224
|
-
* Copyright 2020 Google LLC
|
|
1225
|
-
*
|
|
1226
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1227
|
-
* you may not use this file except in compliance with the License.
|
|
1228
|
-
* You may obtain a copy of the License at
|
|
1229
|
-
*
|
|
1230
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1231
|
-
*
|
|
1232
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1233
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1234
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1235
|
-
* See the License for the specific language governing permissions and
|
|
1236
|
-
* limitations under the License.
|
|
1237
|
-
*/class xh{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 k1;case"linkViaPopup":case"linkViaRedirect":return S1;case"reauthViaPopup":case"reauthViaRedirect":return T1;default:hr(this.auth,"internal-error")}}resolve(t){Mr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){Mr(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()}}/**
|
|
1238
|
-
* @license
|
|
1239
|
-
* Copyright 2020 Google LLC
|
|
1240
|
-
*
|
|
1241
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1242
|
-
* you may not use this file except in compliance with the License.
|
|
1243
|
-
* You may obtain a copy of the License at
|
|
1244
|
-
*
|
|
1245
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1246
|
-
*
|
|
1247
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1248
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1249
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1250
|
-
* See the License for the specific language governing permissions and
|
|
1251
|
-
* limitations under the License.
|
|
1252
|
-
*/const I1=new $o(2e3,1e4);async function E1(e,t,n){if(lr(e.app))return Promise.reject(qn(e,"operation-not-supported-in-this-environment"));const r=Oi(e);kE(e,t,Bl);const s=Ah(r,n);return new ds(r,"signInViaPopup",t,s).executeNotNull()}class ds extends xh{constructor(t,n,r,s,o){super(t,n,s,o),this.provider=r,this.authWindow=null,this.pollId=null,ds.currentPopupAction&&ds.currentPopupAction.cancel(),ds.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Ye(t,this.auth,"internal-error"),t}async onExecution(){Mr(this.filter.length===1,"Popup operations only handle one event");const t=Fl();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(qn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(qn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,ds.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(qn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,I1.get())};t()}}ds.currentPopupAction=null;/**
|
|
1253
|
-
* @license
|
|
1254
|
-
* Copyright 2020 Google LLC
|
|
1255
|
-
*
|
|
1256
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1257
|
-
* you may not use this file except in compliance with the License.
|
|
1258
|
-
* You may obtain a copy of the License at
|
|
1259
|
-
*
|
|
1260
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1261
|
-
*
|
|
1262
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1263
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1264
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1265
|
-
* See the License for the specific language governing permissions and
|
|
1266
|
-
* limitations under the License.
|
|
1267
|
-
*/const C1="pendingRedirect",ti=new Map;class A1 extends xh{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=ti.get(this.auth._key());if(!t){try{const r=await x1(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}ti.set(this.auth._key(),t)}return this.bypassAuthState||ti.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 x1(e,t){const n=M1(t),r=P1(e);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function R1(e,t){ti.set(e._key(),t)}function P1(e){return Sr(e._redirectPersistence)}function M1(e){return ei(C1,e.config.apiKey,e.name)}async function $1(e,t,n=!1){if(lr(e.app))return Promise.reject(ps(e));const r=Oi(e),s=Ah(r,t),i=await new A1(r,s,n).execute();return i&&!n&&(delete i.user._redirectEventId,await r._persistUserIfCurrent(i.user),await r._setRedirectUser(null,t)),i}/**
|
|
1268
|
-
* @license
|
|
1269
|
-
* Copyright 2020 Google LLC
|
|
1270
|
-
*
|
|
1271
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1272
|
-
* you may not use this file except in compliance with the License.
|
|
1273
|
-
* You may obtain a copy of the License at
|
|
1274
|
-
*
|
|
1275
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1276
|
-
*
|
|
1277
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1278
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1279
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1280
|
-
* See the License for the specific language governing permissions and
|
|
1281
|
-
* limitations under the License.
|
|
1282
|
-
*/const O1=600*1e3;class N1{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||!D1(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!Rh(t)){const s=((r=t.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(qn(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>=O1&&this.cachedEventUids.clear(),this.cachedEventUids.has(Hu(t))}saveEventToCache(t){this.cachedEventUids.add(Hu(t)),this.lastProcessedEventTime=Date.now()}}function Hu(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function Rh({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function D1(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Rh(e);default:return!1}}/**
|
|
1283
|
-
* @license
|
|
1284
|
-
* Copyright 2020 Google LLC
|
|
1285
|
-
*
|
|
1286
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1287
|
-
* you may not use this file except in compliance with the License.
|
|
1288
|
-
* You may obtain a copy of the License at
|
|
1289
|
-
*
|
|
1290
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1291
|
-
*
|
|
1292
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1293
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1294
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1295
|
-
* See the License for the specific language governing permissions and
|
|
1296
|
-
* limitations under the License.
|
|
1297
|
-
*/async function L1(e,t={}){return Fs(e,"GET","/v1/projects",t)}/**
|
|
1298
|
-
* @license
|
|
1299
|
-
* Copyright 2020 Google LLC
|
|
1300
|
-
*
|
|
1301
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1302
|
-
* you may not use this file except in compliance with the License.
|
|
1303
|
-
* You may obtain a copy of the License at
|
|
1304
|
-
*
|
|
1305
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1306
|
-
*
|
|
1307
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1308
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1309
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1310
|
-
* See the License for the specific language governing permissions and
|
|
1311
|
-
* limitations under the License.
|
|
1312
|
-
*/const j1=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,B1=/^https?/;async function F1(e){if(e.config.emulator)return;const{authorizedDomains:t}=await L1(e);for(const n of t)try{if(U1(n))return}catch{}hr(e,"unauthorized-domain")}function U1(e){const t=Qa(),{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(!B1.test(n))return!1;if(j1.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
|
|
1313
|
-
* @license
|
|
1314
|
-
* Copyright 2020 Google LLC.
|
|
1315
|
-
*
|
|
1316
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1317
|
-
* you may not use this file except in compliance with the License.
|
|
1318
|
-
* You may obtain a copy of the License at
|
|
1319
|
-
*
|
|
1320
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1321
|
-
*
|
|
1322
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1323
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1324
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1325
|
-
* See the License for the specific language governing permissions and
|
|
1326
|
-
* limitations under the License.
|
|
1327
|
-
*/const H1=new $o(3e4,6e4);function Vu(){const e=fr().___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 V1(e){return new Promise((t,n)=>{var s,o,i;function r(){Vu(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Vu(),n(qn(e,"network-request-failed"))},timeout:H1.get()})}if((o=(s=fr().gapi)==null?void 0:s.iframes)!=null&&o.Iframe)t(gapi.iframes.getContext());else if((i=fr().gapi)!=null&&i.load)r();else{const a=JE("iframefcb");return fr()[a]=()=>{gapi.load?r():n(qn(e,"network-request-failed"))},qE(`${KE()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw ni=null,t})}let ni=null;function W1(e){return ni=ni||V1(e),ni}/**
|
|
1328
|
-
* @license
|
|
1329
|
-
* Copyright 2020 Google LLC.
|
|
1330
|
-
*
|
|
1331
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1332
|
-
* you may not use this file except in compliance with the License.
|
|
1333
|
-
* You may obtain a copy of the License at
|
|
1334
|
-
*
|
|
1335
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1336
|
-
*
|
|
1337
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1338
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1339
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1340
|
-
* See the License for the specific language governing permissions and
|
|
1341
|
-
* limitations under the License.
|
|
1342
|
-
*/const z1=new $o(5e3,15e3),G1="__/auth/iframe",q1="emulator/auth/iframe",K1={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},J1=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Y1(e){const t=e.config;Ye(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?Ol(t,q1):`https://${e.config.authDomain}/${G1}`,r={apiKey:t.apiKey,appName:e.name,v:Mo},s=J1.get(e.config.apiHost);s&&(r.eid=s);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${Po(r).slice(1)}`}async function Q1(e){const t=await W1(e),n=fr().gapi;return Ye(n,e,"internal-error"),t.open({where:document.body,url:Y1(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:K1,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const i=qn(e,"network-request-failed"),a=fr().setTimeout(()=>{o(i)},z1.get());function l(){fr().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{o(i)})}))}/**
|
|
1343
|
-
* @license
|
|
1344
|
-
* Copyright 2020 Google LLC.
|
|
1345
|
-
*
|
|
1346
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1347
|
-
* you may not use this file except in compliance with the License.
|
|
1348
|
-
* You may obtain a copy of the License at
|
|
1349
|
-
*
|
|
1350
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1351
|
-
*
|
|
1352
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1353
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1354
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1355
|
-
* See the License for the specific language governing permissions and
|
|
1356
|
-
* limitations under the License.
|
|
1357
|
-
*/const X1={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Z1=500,eC=600,tC="_blank",nC="http://localhost";class Wu{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function rC(e,t,n,r=Z1,s=eC){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={...X1,width:r.toString(),height:s.toString(),top:o,left:i},d=bn().toLowerCase();n&&(a=uh(d)?tC:n),lh(d)&&(t=t||nC,l.scrollbars="yes");const c=Object.entries(l).reduce((b,[T,N])=>`${b}${T}=${N},`,"");if(BE(d)&&a!=="_self")return sC(t||"",a),new Wu(null);const h=window.open(t||"",a,c);Ye(h,e,"popup-blocked");try{h.focus()}catch{}return new Wu(h)}function sC(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)}/**
|
|
1358
|
-
* @license
|
|
1359
|
-
* Copyright 2021 Google LLC
|
|
1360
|
-
*
|
|
1361
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1362
|
-
* you may not use this file except in compliance with the License.
|
|
1363
|
-
* You may obtain a copy of the License at
|
|
1364
|
-
*
|
|
1365
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1366
|
-
*
|
|
1367
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1368
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1369
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1370
|
-
* See the License for the specific language governing permissions and
|
|
1371
|
-
* limitations under the License.
|
|
1372
|
-
*/const oC="__/auth/handler",iC="emulator/auth/handler",aC=encodeURIComponent("fac");async function zu(e,t,n,r,s,o){Ye(e.config.authDomain,e,"auth-domain-config-required"),Ye(e.config.apiKey,e,"invalid-api-key");const i={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:Mo,eventId:s};if(t instanceof Bl){t.setDefaultLanguage(e.languageCode),i.providerId=t.providerId||"",sI(t.getCustomParameters())||(i.customParameters=JSON.stringify(t.getCustomParameters()));for(const[c,h]of Object.entries({}))i[c]=h}if(t instanceof Oo){const c=t.getScopes().filter(h=>h!=="");c.length>0&&(i.scopes=c.join(","))}e.tenantId&&(i.tid=e.tenantId);const a=i;for(const c of Object.keys(a))a[c]===void 0&&delete a[c];const l=await e._getAppCheckToken(),d=l?`#${aC}=${encodeURIComponent(l)}`:"";return`${lC(e)}?${Po(a).slice(1)}${d}`}function lC({config:e}){return e.emulator?Ol(e,iC):`https://${e.authDomain}/${oC}`}/**
|
|
1373
|
-
* @license
|
|
1374
|
-
* Copyright 2020 Google LLC
|
|
1375
|
-
*
|
|
1376
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1377
|
-
* you may not use this file except in compliance with the License.
|
|
1378
|
-
* You may obtain a copy of the License at
|
|
1379
|
-
*
|
|
1380
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1381
|
-
*
|
|
1382
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1383
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1384
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1385
|
-
* See the License for the specific language governing permissions and
|
|
1386
|
-
* limitations under the License.
|
|
1387
|
-
*/const wa="webStorageSupport";class cC{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Th,this._completeRedirectFn=$1,this._overrideRedirectResult=R1}async _openPopup(t,n,r,s){var i;Mr((i=this.eventManagers[t._key()])==null?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await zu(t,n,r,Qa(),s);return rC(t,o,Fl())}async _openRedirect(t,n,r,s){await this._originValidation(t);const o=await zu(t,n,r,Qa(),s);return f1(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):(Mr(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 Q1(t),r=new N1(t);return n.register("authEvent",s=>(Ye(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(wa,{type:wa},s=>{var i;const o=(i=s==null?void 0:s[0])==null?void 0:i[wa];o!==void 0&&n(!!o),hr(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=F1(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return mh()||ch()||Ll()}}const uC=cC;var Gu="@firebase/auth",qu="1.12.2";/**
|
|
1388
|
-
* @license
|
|
1389
|
-
* Copyright 2020 Google LLC
|
|
1390
|
-
*
|
|
1391
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1392
|
-
* you may not use this file except in compliance with the License.
|
|
1393
|
-
* You may obtain a copy of the License at
|
|
1394
|
-
*
|
|
1395
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1396
|
-
*
|
|
1397
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1398
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1399
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1400
|
-
* See the License for the specific language governing permissions and
|
|
1401
|
-
* limitations under the License.
|
|
1402
|
-
*/class dC{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(){Ye(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
|
|
1403
|
-
* @license
|
|
1404
|
-
* Copyright 2020 Google LLC
|
|
1405
|
-
*
|
|
1406
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1407
|
-
* you may not use this file except in compliance with the License.
|
|
1408
|
-
* You may obtain a copy of the License at
|
|
1409
|
-
*
|
|
1410
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1411
|
-
*
|
|
1412
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1413
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1414
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1415
|
-
* See the License for the specific language governing permissions and
|
|
1416
|
-
* limitations under the License.
|
|
1417
|
-
*/function fC(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 hC(e){So(new Ls("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;Ye(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:gh(e)},d=new zE(r,s,o,l);return QE(d,n),d},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),So(new Ls("auth-internal",t=>{const n=Oi(t.getProvider("auth").getImmediate());return(r=>new dC(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),xs(Gu,qu,fC(e)),xs(Gu,qu,"esm2020")}/**
|
|
1418
|
-
* @license
|
|
1419
|
-
* Copyright 2021 Google LLC
|
|
1420
|
-
*
|
|
1421
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1422
|
-
* you may not use this file except in compliance with the License.
|
|
1423
|
-
* You may obtain a copy of the License at
|
|
1424
|
-
*
|
|
1425
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1426
|
-
*
|
|
1427
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1428
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1429
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1430
|
-
* See the License for the specific language governing permissions and
|
|
1431
|
-
* limitations under the License.
|
|
1432
|
-
*/const pC=300,mC=Gf("authIdTokenMaxAge")||pC;let Ku=null;const gC=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>mC)return;const s=n==null?void 0:n.token;Ku!==s&&(Ku=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function vC(e=Xf()){const t=Yf(e,"auth");if(t.isInitialized())return t.getImmediate();const n=YE(e,{popupRedirectResolver:uC,persistence:[_1,c1,Th]}),r=Gf("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=gC(o.toString());i1(n,i,()=>i(n.currentUser)),o1(n,a=>i(a))}}const s=GS("auth");return s&&XE(n,`http://${s}`),n}function yC(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}GE({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=qn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",yC().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="});hC("Browser");const wC={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 bC(e){const t=D(null),n=D(""),r=D(""),s=D(""),o=D({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),i=pe(()=>s.value==="pull"),a=pe(()=>s.value==="push"),l=pe(()=>s.value!=="");async function d(){try{const O=await fetch("/codex-api/skills-sync/status");if(!O.ok)return;const J=await O.json();J.data&&(o.value=J.data)}catch{}}async function c(){try{const O=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),J=await O.json();if(!O.ok||!J.data)throw new Error("Failed to start GitHub login");t.value=J.data;const ie=30,L=Math.max((J.data.interval??5)*1e3,3e3);let se=!1;for(let ne=0;ne<ie;ne++){await new Promise(me=>setTimeout(me,L));const we=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:J.data.device_code})}),ce=await we.json();if(!we.ok)throw new Error(ce.error||"Failed to complete GitHub login");if(ce.ok){se=!0;break}if(!ce.pending)throw new Error(ce.error||"Failed to complete GitHub login")}if(!se)throw new Error("GitHub login timed out. Please retry.");t.value=null,await d(),e.showToast("GitHub login successful")}catch(O){e.showToast(O instanceof Error?O.message:"Failed GitHub login","error")}}async function h(){try{const O=aE().length>0?Xf():Qf(wC),J=vC(O),ie=new cr;ie.addScope("repo");const L=await E1(J,ie),se=cr.credentialFromResult(L),ne=(se==null?void 0:se.accessToken)??"";if(!ne)throw new Error("GitHub access token missing from Firebase login");const we=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:ne})}),ce=await we.json();if(!we.ok||!ce.ok)throw new Error(ce.error||"Failed to login with GitHub token");await d(),e.showToast("GitHub login successful")}catch(O){const J=O instanceof Error?O.message:"Failed Firebase GitHub login";e.showToast(J,"error")}}async function b(){r.value="",n.value="pull-started",s.value="pull";try{const O=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),J=await O.json();if(!O.ok||!J.ok)throw new Error(J.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(O){const J=O instanceof Error?O.message:"Failed to pull sync";r.value=J,n.value="pull-failed",e.showToast(J,"error")}finally{s.value=""}}async function T(){r.value="",n.value="push-started",s.value="push";try{const O=await fetch("/codex-api/skills-sync/push",{method:"POST"}),J=await O.json();if(!O.ok||!J.ok)throw new Error(J.error||"Failed to push synced skills");n.value="push-success",e.showToast("Pushed skills to private sync repo")}catch(O){const J=O instanceof Error?O.message:"Failed to push sync";r.value=J,n.value="push-failed",e.showToast(J,"error")}finally{s.value=""}}async function N(){try{const O=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),J=await O.json();if(!O.ok||!J.ok)throw new Error(J.error||"Failed to logout GitHub");await d(),e.showToast("Logged out from GitHub")}catch(O){e.showToast(O instanceof Error?O.message:"Failed to logout GitHub","error")}}return{deviceLogin:t,isPullInFlight:i,isPushInFlight:a,isSyncActionInFlight:l,loadSyncStatus:d,logoutGithub:N,pullSkillsSync:b,pushSkillsSync:T,startGithubFirebaseLogin:h,startGithubLogin:c,syncActionError:r,syncActionStatus:n,syncStatus:o}}const _C={class:"skills-hub"},kC={class:"skills-sync-panel"},TC={class:"skills-sync-header"},SC={key:0,class:"skills-sync-badge"},IC={key:1,class:"skills-sync-badge"},EC={key:2,class:"skills-sync-badge"},CC={class:"skills-sync-meta"},AC={key:0,class:"skills-sync-error"},xC={key:1,class:"skills-sync-meta"},RC={key:2,class:"skills-sync-error"},PC={key:3,class:"skills-sync-device"},MC=["href"],$C={class:"skills-sync-actions"},OC=["disabled"],NC=["disabled"],DC=["disabled"],LC={key:1,class:"skills-hub-section"},jC={class:"skills-hub-section-title"},BC={key:0,class:"skills-hub-grid"},FC={class:"skills-hub-toolbar"},UC={class:"skills-hub-search-wrap"},HC={key:0,class:"skills-hub-count"},VC={class:"skills-hub-section"},WC={key:0,class:"skills-hub-loading"},zC={key:1,class:"skills-hub-error"},GC={key:0,class:"skills-hub-grid"},qC={key:1,class:"skills-hub-empty"},Ho="codex-web-local.skills-hub.cache.v1",KC=Zt({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=D(null),s=D(""),o=D("date"),i=D([]),a=D([]),l=D(0),d=D(!1),c=D(""),h=D(!0),b=D(!1),T=D(n),N=D(null),O=D(""),J=D(!1),ie=D(!1);let L=null,se=null;const ne=t,we=pe(()=>o.value==="date"?"Newest":"A-Z"),ce=pe(()=>{var P;return((P=N.value)==null?void 0:P.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),me=pe(()=>`${T.value.owner}/${T.value.name}`),Oe=pe(()=>J.value&&O.value===me.value),ae=pe(()=>ie.value&&O.value===me.value),X=pe(()=>{const P=s.value.toLowerCase().trim();return P?a.value.filter(H=>H.name.toLowerCase().includes(P)||H.owner.toLowerCase().includes(P)||(H.displayName??"").toLowerCase().includes(P)):a.value});function le(P,H="success"){N.value={text:P,type:H},se&&clearTimeout(se),se=setTimeout(()=>{N.value=null},3e3)}function te(){o.value=o.value==="date"?"name":"date",xe(s.value)}function Me(P){return`${o.value}::${P.trim().toLowerCase()}`}function Ne(P){var H;if(typeof window>"u")return null;try{const U=window.localStorage.getItem(Ho);return U?((H=JSON.parse(U).byKey)==null?void 0:H[P])??null:null}catch{return null}}function qe(P,H){if(!(typeof window>"u"))try{const U=window.localStorage.getItem(Ho),G=(U?JSON.parse(U):{}).byKey??{};G[P]=H,window.localStorage.setItem(Ho,JSON.stringify({byKey:G}))}catch{}}function He(){if(!(typeof window>"u"))try{window.localStorage.removeItem(Ho)}catch{}}function Fe(P){const H=P.installed??[];a.value=H;const U=new Set(H.map(z=>z.name));i.value=P.data.map(z=>{if(z.installed||U.has(z.name)){const G=H.find(Te=>Te.name===z.name);return{...z,installed:!0,path:(G==null?void 0:G.path)??z.path,enabled:(G==null?void 0:G.enabled)??z.enabled}}return z}).filter(z=>!z.installed),l.value=P.total}async function xe(P){const H=Me(P),U=Ne(H);U&&Fe(U),d.value=!U,c.value="";try{const z=new URLSearchParams;P.trim()&&z.set("q",P.trim()),z.set("limit","100"),z.set("sort",o.value);const G=await fetch(`/codex-api/skills-hub?${z}`);if(!G.ok)throw new Error(`HTTP ${G.status}`);const Te=await G.json();Fe(Te),qe(H,Te)}catch(z){c.value=z instanceof Error?z.message:"Failed to load skills"}finally{d.value=!1}}function nt(){L&&clearTimeout(L),L=setTimeout(()=>xe(s.value),300)}function ze(P){T.value=P,b.value=!0}async function Be(P){O.value=`${P.owner}/${P.name}`,J.value=!0;try{const U=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:P.owner,name:P.name})})).json();if(!U.ok)throw new Error(U.error||"Install failed");const z={...P,installed:!0,path:U.path,enabled:!0};a.value=[...a.value,z],i.value=i.value.filter(G=>G.name!==P.name),T.value=z,le(`${P.displayName||P.name} skill installed`),b.value=!1,He(),ne("skills-changed")}catch(H){le(H instanceof Error?H.message:"Failed to install skill","error")}finally{J.value=!1}}async function at(P){O.value=`${P.owner}/${P.name}`,ie.value=!0;try{const U=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:P.name,path:P.path})})).json();if(!U.ok)throw new Error(U.error||"Uninstall failed");a.value=a.value.filter(z=>z.name!==P.name),P.owner!=="local"&&(i.value=[...i.value,{...P,installed:!1,path:void 0,enabled:void 0}]),le(`${P.displayName||P.name} skill uninstalled`),b.value=!1,He(),ne("skills-changed")}catch(H){le(H instanceof Error?H.message:"Failed to uninstall skill","error")}finally{ie.value=!1}}async function Dt(P,H){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:P.path,enabled:H}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),le(`${P.displayName||P.name} skill ${H?"enabled":"disabled"}`),await xe(s.value)}catch(U){le(U instanceof Error?U.message:"Failed to update skill","error")}}const{deviceLogin:it,isPullInFlight:lt,isPushInFlight:Ve,isSyncActionInFlight:V,loadSyncStatus:be,logoutGithub:fe,pullSkillsSync:Ae,pushSkillsSync:Re,startGithubFirebaseLogin:k,startGithubLogin:I,syncActionError:$,syncActionStatus:q,syncStatus:F}=bC({showToast:le,onPulled:async()=>{await xe(s.value),ne("skills-changed")}});return Or(()=>{xe(""),be()}),(P,H)=>(p(),w("div",_C,[H[11]||(H[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",kC,[y("div",TC,[H[8]||(H[8]=y("strong",null,"Skills Sync (GitHub)",-1)),ye(F).configured?(p(),w("span",SC,"Connected: "+W(ye(F).repoOwner)+"/"+W(ye(F).repoName),1)):ye(F).loggedIn?(p(),w("span",IC,"Logged in as "+W(ye(F).githubUsername),1)):(p(),w("span",EC,"Not connected"))]),y("div",CC,[y("span",null,"Startup: "+W(ye(F).startup.mode),1),y("span",null,"Branch: "+W(ye(F).startup.branch),1),y("span",null,"Action: "+W(ye(F).startup.lastAction),1)]),ye(F).startup.lastError?(p(),w("div",AC,W(ye(F).startup.lastError),1)):ue("",!0),ye(q)?(p(),w("div",xC,[y("span",null,"Manual sync: "+W(ye(q)),1)])):ue("",!0),ye($)?(p(),w("div",RC,W(ye($)),1)):ue("",!0),ye(it)?(p(),w("div",PC,[y("span",null,[H[9]||(H[9]=yo("Open ",-1)),y("a",{href:ye(it).verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,MC),H[10]||(H[10]=yo(" and enter code:",-1))]),y("code",null,W(ye(it).user_code),1)])):ue("",!0),y("div",$C,[ye(F).loggedIn?ue("",!0):(p(),w("button",{key:0,class:"skills-hub-sort",type:"button",onClick:H[0]||(H[0]=(...U)=>ye(k)&&ye(k)(...U))},"Login with GitHub")),ye(F).loggedIn?ue("",!0):(p(),w("button",{key:1,class:"skills-hub-sort",type:"button",onClick:H[1]||(H[1]=(...U)=>ye(I)&&ye(I)(...U))},"Device Login")),ye(F).loggedIn?(p(),w("button",{key:2,class:"skills-hub-sort",type:"button",onClick:H[2]||(H[2]=(...U)=>ye(fe)&&ye(fe)(...U)),disabled:ye(V)},"Logout GitHub",8,OC)):ue("",!0),y("button",{class:"skills-hub-sort",type:"button",onClick:H[3]||(H[3]=(...U)=>ye(Ae)&&ye(Ae)(...U)),disabled:ye(V)},W(ye(lt)?"Pulling...":"Pull"),9,NC),ye(F).loggedIn?(p(),w("button",{key:3,class:"skills-hub-sort",type:"button",onClick:H[4]||(H[4]=(...U)=>ye(Re)&&ye(Re)(...U)),disabled:!ye(F).configured||ye(V)},W(ye(Ve)?"Pushing...":"Push"),9,DC)):ue("",!0)])]),N.value?(p(),w("div",{key:0,class:ft(["skills-hub-toast",ce.value])},W(N.value.text),3)):ue("",!0),X.value.length>0?(p(),w("div",LC,[y("button",{class:"skills-hub-section-toggle",type:"button",onClick:H[5]||(H[5]=U=>h.value=!h.value)},[y("span",jC,"Installed ("+W(X.value.length)+")",1),De(Of,{class:ft(["skills-hub-section-chevron",{"is-open":h.value}])},null,8,["class"])]),h.value?(p(),w("div",BC,[(p(!0),w($e,null,dt(X.value,U=>(p(),vt(_u,{key:U.name,skill:U,onSelect:z=>ze(z)},null,8,["skill","onSelect"]))),128))])):ue("",!0)])):ue("",!0),y("div",FC,[y("div",UC,[De(za,{class:"skills-hub-search-icon"}),xr(y("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":H[6]||(H[6]=U=>s.value=U),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:nt},null,544),[[Rr,s.value]]),l.value>0?(p(),w("span",HC,W(l.value)+" skills",1)):ue("",!0)]),y("button",{class:"skills-hub-sort",type:"button",onClick:te},W(we.value),1)]),y("div",VC,[d.value?(p(),w("div",WC,"Loading skills...")):c.value?(p(),w("div",zC,W(c.value),1)):(p(),w($e,{key:2},[i.value.length>0?(p(),w("div",GC,[(p(!0),w($e,null,dt(i.value,U=>(p(),vt(_u,{key:U.url,skill:U,onSelect:z=>ze(z)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(p(),w("div",qC,'No skills found for "'+W(s.value)+'"',1)):ue("",!0)],64))]),De(LS,{skill:T.value,visible:b.value,"is-installing":Oe.value,"is-uninstalling":ae.value,onClose:H[7]||(H[7]=U=>b.value=!1),onInstall:Be,onUninstall:at,onToggleEnabled:Dt},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),JC=ht(KC,[["__scopeId","data-v-2f6920be"]]),YC={},QC={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 XC(e,t){return p(),w("svg",QC,[...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 ZC=ht(YC,[["render",XC]]),eA={},tA={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function nA(e,t){return p(),w("svg",tA,[...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 rA=ht(eA,[["render",nA]]),sA={class:"sidebar-thread-controls"},oA=["aria-label","title"],iA=Zt({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(p(),w("div",sA,[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?(p(),vt(rA,{key:0,class:"sidebar-thread-controls-icon"})):(p(),vt(ZC,{key:1,class:"sidebar-thread-controls-icon"}))],8,oA),ur(t.$slots,"default",{},void 0),e.showNewThreadButton?(p(),w("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"))},[De(di,{class:"sidebar-thread-controls-icon"})])):ue("",!0)]))}}),Ju=ht(iA,[["__scopeId","data-v-46a10052"]]),aA={},lA={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function cA(e,t){return p(),w("svg",lA,[...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 uA=ht(aA,[["render",cA]]);function Vr(e){return e.flatMap(t=>t.threads)}const Ph="codex-web-local.thread-read-state.v1",Mh="codex-web-local.thread-scroll-state.v1",el="codex-web-local.selected-thread-id.v1",$h="codex-web-local.project-order.v1",Oh="codex-web-local.project-display-name.v1",Nh="codex-web-local.collaboration-mode.v1",ba=220,Yu=["none","minimal","low","medium","high","xhigh"],ys="__global__",Ln="gpt-5.2-codex";function dA(){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 Qu(e){typeof window>"u"||window.localStorage.setItem(Ph,JSON.stringify(e))}function fA(){return typeof window>"u"?"default":window.localStorage.getItem(Nh)==="plan"?"plan":"default"}function hA(e){typeof window>"u"||window.localStorage.setItem(Nh,e)}function Dh(e,t,n){return Math.min(Math.max(e,t),n)}function pA(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=Dh(t.scrollRatio,0,1)),n}function mA(){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=pA(s);o&&(n[r]=o)}return n}catch{return{}}}function Xu(e){typeof window>"u"||window.localStorage.setItem(Mh,JSON.stringify(e))}function gA(){return typeof window>"u"?"":window.localStorage.getItem(el)??""}function vA(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(el);return}window.localStorage.setItem(el,e)}}function yA(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem($h);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 ws(e){typeof window>"u"||window.localStorage.setItem($h,JSON.stringify(e))}function wA(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Oh);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 _a(e){typeof window>"u"||window.localStorage.setItem(Oh,JSON.stringify(e))}function Vo(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 cs(e,n)?e:n}function ka(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>n.get(s)??{projectName:s,threads:[]});for(const s of e)t.includes(s.projectName)||r.push(s);return r}function cs(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 bA(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 _A(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function kA(e=[],t=[]){var n,r,s,o;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(((n=e[i])==null?void 0:n.step)!==((r=t[i])==null?void 0:r.step)||((s=e[i])==null?void 0:s.status)!==((o=t[i])==null?void 0:o.status))return!1;return!0}function TA(e,t){return!e&&!t?!0:!e||!t?!1:e.explanation===t.explanation&&e.isStreaming===t.isStreaming&&kA(e.steps,t.steps)}function Wo(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 tl(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&cs(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&_A(e.commandExecution,t.commandExecution)&&TA(e.plan,t.plan)&&e.turnIndex===t.turnIndex}function uo(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 SA(e,t,n={}){const r=new Map(e.map(c=>[c.id,c])),s=new Map(t.map(c=>[c.id,c])),o=t.map(c=>{const h=r.get(c.id);return h&&tl(h,c)?h:c});if(n.preserveMissing!==!0)return uo(e,o)?e:o;const i=e.map(c=>{const h=s.get(c.id);return!h||tl(c,h)?c:h}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),d=[...i,...l];return uo(e,d)?e:d}function nl(e){return e.replace(/\s+/gu," ").trim()}function IA(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>nl(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=nl(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function Ta(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(tl(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const Lh="worked";function Fr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function EA(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 CA(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function AA(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 xA(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${EA(e.durationMs)}`,messageType:Lh}}function RA(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function PA(e,t){const n=xA(t),r=e.filter(i=>i.messageType!==Lh),s=RA(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Xt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function MA(e,t){if(t.size===0)return e;let n=!1;const r={};for(const[s,o]of Object.entries(e)){if(t.has(s)){n=!0;continue}r[s]=o}return n?r:e}function $A(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 OA(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 NA(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 on(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function zo(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&&$A(d,l)?d:l});return o&&o.projectName===s.projectName&&OA(o.threads,a)?o:{projectName:s.projectName,threads:a}});return NA(e,r)?e:r}function DA(e,t,n){const r=new Set(Vr(t).map(a=>a.id)),s=Vr(e).filter(a=>n[a.id]===!0&&!r.has(a.id));if(s.length===0)return t;const o=new Map(t.map(a=>[a.projectName,a])),i=t.map(a=>({projectName:a.projectName,threads:[...a.threads]}));for(const a of s){if(o.get(a.projectName)){const d=i.findIndex(c=>c.projectName===a.projectName);d>=0&&(i[d]={projectName:i[d].projectName,threads:[a,...i[d].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function LA(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function bs(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function jA(e){const t=e.split(`
|
|
1433
|
-
`).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function BA(){const e=D([]),t=D([]),n=D(gA()),r=D({}),s=D({}),o=D({}),i=D({}),a=D({}),l=D({}),d=D({}),c=D({}),h=D([]),b=D([{value:"default",label:"Default"},{value:"plan",label:"Plan"}]),T=D(fA()),N=D(""),O=D("medium"),J=D(dA()),ie=D(mA()),L=D(yA()),se=D(wA()),ne=D({}),we=D({}),ce=D({}),me=D({}),Oe=D({}),ae=D({}),X=D({}),le=D({}),te=D({}),Me=D(null),Ne=D({}),qe=D([]),He=D(!1),Fe=D(!1),xe=D(!1),nt=D(!1),ze=D(!1),Be=D(""),at=D(!1),Dt=D(!1);let it=null,lt=null,Ve=!1;const V=new Set;let be=!1,fe=!1;const Ae=new Map,Re=new Set,k=pe(()=>Vr(e.value)),I=pe(()=>k.value.find(u=>u.id===n.value)??null),$=pe(()=>ie.value[n.value]??null),q=pe(()=>{const u=[],f=n.value;return f&&Array.isArray(le.value[f])&&u.push(...le.value[f]),Array.isArray(le.value[ys])&&u.push(...le.value[ys]),u.sort((_,C)=>_.receivedAtIso.localeCompare(C.receivedAtIso))}),F=pe(()=>{var Y;const u=n.value;if(!u)return null;const f=Oe.value[u],_=(i.value[u]??"").trim(),C=(((Y=ae.value[u])==null?void 0:Y.message)??"").trim();return!f&&!_&&!C?null:{activityLabel:(f==null?void 0:f.label)||"Thinking",activityDetails:(f==null?void 0:f.details)??[],reasoningText:_,errorText:C}}),P=pe(()=>Me.value),H=pe(()=>{const u=n.value;if(!u)return[];const f=r.value[u]??[],_=s.value[u]??[],C=o.value[u]??[],Y=a.value[u]??[],oe=[...f,..._,...Y,...C],de=me.value[u];return de?PA(oe,de):oe});function U(u){n.value!==u&&(n.value=u,vA(u),fe=!1)}function z(u){N.value=u.trim()}function G(u){const f=u==="plan"?"plan":"default";T.value!==f&&(T.value=f,hA(f))}function Te(u){Me.value=u}async function ve(){N.value=Ln,h.value.includes(Ln)||(h.value=[...h.value,Ln]);try{await Jk(Ln)}catch{}}function ke(u,f){te.value={...te.value,[u]:f}}function Ie(u){te.value[u]&&(te.value=Xt(te.value,u))}async function Ue(u){if(Re.has(u))return;const f=te.value[u];if(!(!f||f.fallbackRetried)){Re.add(u),ke(u,{...f,fallbackRetried:!0});try{await ve();try{const _=await pu(u,1);_n(u,_),kn(u),Lt(u,[]),rn(u),a.value[u]&&(a.value=Xt(a.value,u))}catch{}Mt(u,null),Be.value="",ot(u,null),Et(u,{label:"Thinking",details:ct(Ln,f.effort,f.collaborationMode)}),_t(u,!0),ce.value[u]!==!0&&await ua(u),await da(u,f.text,f.imageUrls,Ln,f.effort||void 0,f.skills.length>0?f.skills:void 0,f.fileAttachments,f.collaborationMode),ce.value={...ce.value,[u]:!0},V.add(u),Ve=!0,await E()}catch(_){const C=_ instanceof Error?_.message:"Unknown application error";Mt(u,C),Be.value=C,_t(u,!1),Et(u,null)}finally{Re.delete(u)}}}function tt(u){u&&!Yu.includes(u)||(O.value=u)}async function Qe(){try{const u=await Qk();b.value=u,u.some(f=>f.value===T.value)||G("default")}catch{}}function ct(u,f,_=T.value){const C=u.trim()||"default",Y=f||"default";return[`Mode: ${_==="plan"?"Plan":"Default"}`,`Model: ${C}`,`Thinking: ${Y}`]}async function et(){try{const[u,f]=await Promise.all([Bf(),Ff()]);h.value=u,N.value.length>0&&u.includes(N.value)||(f.model&&u.includes(f.model)?N.value=f.model:u.length>0?N.value=u[0]:N.value=""),f.reasoningEffort&&Yu.includes(f.reasoningEffort)&&(O.value=f.reasoningEffort)}catch{}}function pt(u){const f=Ne.value;return Object.keys(f).length===0?u:u.map(_=>({projectName:_.projectName,threads:_.threads.map(C=>{const Y=f[C.id];return Y?{...C,title:Y}:C})}))}function Je(){const f=pt(t.value).map(_=>({projectName:_.projectName,threads:_.threads.map(C=>{const Y=l.value[C.id]===!0,oe=n.value===C.id,de=J.value[C.id],Se=c.value[C.id]===!0,ge=!oe&&!Y&&(Se||de!==C.updatedAtIso);return{...C,inProgress:Y,unread:ge}})}));e.value=zo(e.value,f)}function Ot(u,f,_){const C=new Date().toISOString(),Y=f.trim(),oe=LA(Y),de={id:u,title:jA(_),projectName:oe,cwd:Y,hasWorktree:Y.includes("/.codex/worktrees/")||Y.includes("/.git/worktrees/"),createdAtIso:C,updatedAtIso:C,preview:_,unread:!1,inProgress:!1},Se=t.value.findIndex(st=>st.projectName===oe);if(Se>=0){const Nt=t.value[Se].threads.filter(Zr=>Zr.id!==u),Qt={projectName:oe,threads:[de,...Nt]},Vn=[...t.value];Vn.splice(Se,1,Qt),t.value=Vn}else t.value=[{projectName:oe,threads:[de]},...t.value];const ge=Vo(L.value,t.value);cs(L.value,ge)||(L.value=ge,ws(L.value)),Je()}function hn(u){const f=new Set(u.map(oe=>oe.id)),_=on(J.value,f);_!==J.value&&(J.value=_,Qu(_));const C=on(ie.value,f);C!==ie.value&&(ie.value=C,Xu(C)),we.value=on(we.value,f),ne.value=on(ne.value,f),ce.value=on(ce.value,f),r.value=on(r.value,f),o.value=on(o.value,f),i.value=on(i.value,f),a.value=on(a.value,f),me.value=on(me.value,f),Oe.value=on(Oe.value,f),ae.value=on(ae.value,f),X.value=on(X.value,f),c.value=on(c.value,f),l.value=on(l.value,f);const Y={};for(const[oe,de]of Object.entries(le.value))(oe===ys||f.has(oe))&&(Y[oe]=de);le.value=Y}function ut(u){const f=Vr(t.value).find(_=>_.id===u);f&&(J.value={...J.value,[u]:f.updatedAtIso},Qu(J.value),c.value[u]&&(c.value=Xt(c.value,u)),Je())}function ot(u,f){if(!u)return;const _=me.value[u];if(f){if(CA(_,f))return;me.value={...me.value,[u]:f}}else _&&(me.value=Xt(me.value,u))}function _t(u,f){!u||l.value[u]===!0===f||(f?l.value={...l.value,[u]:!0}:l.value=Xt(l.value,u),Je())}function Pt(u){u&&u!==n.value&&c.value[u]!==!0&&(c.value={...c.value,[u]:!0},Je())}function Et(u,f){if(!u)return;const _=Oe.value[u];if(!f){_&&(Oe.value=Xt(Oe.value,u));return}const C=An(f.label)||"Thinking",Y=f.details.map(Se=>An(Se)).filter(Se=>Se.length>0&&Se!==C),oe=Array.from(new Set([...(_==null?void 0:_.details)??[],...Y])).slice(-3),de={label:C,details:oe};AA(_,de)||(Oe.value={...Oe.value,[u]:de})}function Mt(u,f){if(!u)return;const _=ae.value[u],C=f?nl(f):"";if(!C){_&&(ae.value=Xt(ae.value,u));return}(_==null?void 0:_.message)!==C&&(ae.value={...ae.value,[u]:{message:C}})}function In(u){const f=Vr(t.value).find(_=>_.id===u);return(f==null?void 0:f.updatedAtIso)??""}function Pn(u,f){if(!u)return;const _={scrollTop:Math.max(0,f.scrollTop),isAtBottom:f.isAtBottom===!0};typeof f.scrollRatio=="number"&&Number.isFinite(f.scrollRatio)&&(_.scrollRatio=Dh(f.scrollRatio,0,1));const C=ie.value[u];C&&C.scrollTop===_.scrollTop&&C.isAtBottom===_.isAtBottom&&C.scrollRatio===_.scrollRatio||(ie.value={...ie.value,[u]:_},Xu(ie.value))}function _n(u,f){const _=r.value[u]??[];uo(_,f)||(r.value={...r.value,[u]:f})}function Lt(u,f){const _=o.value[u]??[];uo(_,f)||(o.value={...o.value,[u]:f})}function Vt(u,f){const _=s.value[u]??[];uo(_,f)||(s.value={...s.value,[u]:f})}function Mn(u,f){const _=s.value[u]??[],C=Ta(_,f);Vt(u,C)}function en(u,f){const _=o.value[u]??[],C=Ta(_,f);Lt(u,C)}function $n(u,f){if(!u)return;const _=f.trim(),C=i.value[u]??"";if(_.length===0){if(!C)return;i.value=Xt(i.value,u);return}C!==_&&(i.value={...i.value,[u]:_})}function Bn(u,f){if(!u)return;const _=i.value[u]??"";$n(u,`${_}${f}`)}function rn(u){u&&u in i.value&&(i.value=Xt(i.value,u))}function kn(u){u&&u in s.value&&(s.value=Xt(s.value,u))}function Fn(u){return u==="completed"?"completed":u==="inProgress"||u==="in_progress"?"inProgress":"pending"}function pr(u){var _;const f=[];(_=u.explanation)!=null&&_.trim()&&f.push(u.explanation.trim());for(const C of u.steps){const Y=C.status==="completed"?"x":C.status==="inProgress"?"~":" ";f.push(`- [${Y}] ${C.step}`)}return f.join(`
|
|
1434
|
-
`).trim()}function mr(u){if(u.method!=="turn/plan/updated")return null;const f=Le(u.params),_=Ft(u),C=Pe(f==null?void 0:f.turnId)||Pe(f==null?void 0:f.turn_id),oe=(Array.isArray(f==null?void 0:f.plan)?f==null?void 0:f.plan:[]).map(ge=>Le(ge)).map(ge=>({step:Pe(ge==null?void 0:ge.step),status:Fn(ge==null?void 0:ge.status)})).filter(ge=>ge.step.length>0);if(!_||!C)return null;const Se={explanation:Pe(f==null?void 0:f.explanation).trim()||void 0,steps:oe,isStreaming:!0};return{threadId:_,message:{id:`${C}:plan`,role:"assistant",text:pr(Se),messageType:"plan.live",plan:Se}}}function Un(u){if(u.method!=="item/plan/delta")return null;const f=Le(u.params),_=Ft(u),C=Pe(f==null?void 0:f.turnId)||Pe(f==null?void 0:f.turn_id),Y=Pe(f==null?void 0:f.delta);if(!_||!C||!Y)return null;const oe=`${C}:plan`,de=(s.value[_]??[]).find(st=>st.id===oe),Se=`${(de==null?void 0:de.text)??""}${Y}`,ge=de!=null&&de.plan?{...de.plan,isStreaming:!0}:void 0;return{threadId:_,message:{id:oe,role:"assistant",text:Se,messageType:"plan.live",plan:ge}}}function Le(u){return u!==null&&typeof u=="object"&&!Array.isArray(u)?u:null}function Pe(u){return typeof u=="string"?u:""}function Tn(u){return typeof u=="number"&&Number.isFinite(u)?u:null}function Ft(u){const f=Le(u.params);if(!f)return"";const _=Pe(f.threadId);if(_)return _;const C=Pe(f.thread_id);if(C)return C;const Y=Pe(f.conversationId);if(Y)return Y;const oe=Pe(f.conversation_id);if(oe)return oe;const de=Le(f.thread),Se=Pe(de==null?void 0:de.id);if(Se)return Se;const ge=Le(f.turn),st=Pe(ge==null?void 0:ge.threadId);if(st)return st;const Nt=Pe(ge==null?void 0:ge.thread_id);return Nt||""}function En(u){if(u.method!=="turn/completed")return"";const f=Le(u.params),_=Le(f==null?void 0:f.turn);if(!_||_.status!=="failed")return"";const C=Le(_.error);return Pe(C==null?void 0:C.message)}function On(u){var _;if(u.method!=="error")return"";const f=Le(u.params);return Pe(f==null?void 0:f.message)||Pe((_=Le(f==null?void 0:f.error))==null?void 0:_.message)}function pn(u){const f=Le(u);if(!f)return null;const _=f.id,C=Pe(f.method),Y=f.params;if(typeof _!="number"||!Number.isInteger(_)||!C)return null;const oe=Le(Y),de=Pe(oe==null?void 0:oe.threadId)||ys,Se=Pe(oe==null?void 0:oe.turnId),ge=Pe(oe==null?void 0:oe.itemId),st=Pe(f.receivedAtIso)||new Date().toISOString();return{id:_,method:C,threadId:de,turnId:Se,itemId:ge,receivedAtIso:st,params:Y??null}}function Nn(u){const f=u.threadId||ys,_=le.value[f]??[],C=_.findIndex(oe=>oe.id===u.id),Y=[..._];C>=0?Y.splice(C,1,u):Y.push(u),le.value={...le.value,[f]:Y.sort((oe,de)=>oe.receivedAtIso.localeCompare(de.receivedAtIso))}}function Wt(u){const f={};for(const[_,C]of Object.entries(le.value)){const Y=C.filter(oe=>oe.id!==u);Y.length>0&&(f[_]=Y)}le.value=f}function Cn(u){const f={};for(const _ of u){const C=_.threadId||ys,Y=f[C]??[];Y.push(_),f[C]=Y}for(const _ of Object.values(f))_.sort((C,Y)=>C.receivedAtIso.localeCompare(Y.receivedAtIso));le.value=f}function Xn(u){if(u.method==="server/request"){const f=pn(u.params);return f&&Nn(f),!0}if(u.method==="server/request/resolved"){const f=Le(u.params),_=f==null?void 0:f.id;return typeof _=="number"&&Number.isInteger(_)&&Wt(_),!0}return!1}function An(u){return u.replace(/\s+/gu," ").trim()}function xn(u){const f=Ft(u);if(!f)return null;if(u.method==="turn/started")return{threadId:f,activity:{label:"Thinking",details:[]}};if(u.method==="item/started"){const _=Le(u.params),C=Le(_==null?void 0:_.item),Y=Pe(C==null?void 0:C.type).toLowerCase();if(Y==="reasoning")return{threadId:f,activity:{label:"Thinking",details:[]}};if(Y==="agentmessage")return{threadId:f,activity:{label:"Writing response",details:[]}};if(Y==="commandexecution"){const oe=Pe(C==null?void 0:C.command);return{threadId:f,activity:{label:"Running command",details:oe?[oe]:[]}}}}return u.method==="item/commandExecution/outputDelta"?{threadId:f,activity:{label:"Running command",details:[]}}:u.method==="item/reasoning/summaryTextDelta"||u.method==="item/reasoning/summaryPartAdded"?{threadId:f,activity:{label:"Thinking",details:[]}}:u.method==="item/agentMessage/delta"?{threadId:f,activity:{label:"Writing response",details:[]}}:null}function A(u){if(u.method!=="turn/started")return null;const f=Le(u.params);if(!f)return null;const _=Ft(u);if(!_)return null;const C=Le(f.turn),Y=Pe(C==null?void 0:C.id)||Pe(f.turnId)||`${_}:unknown`;if(!Y)return null;const oe=Fr(Pe(C==null?void 0:C.startedAt))??Fr(Pe(f.startedAt))??Fr(u.atIso)??Date.now();return{threadId:_,turnId:Y,startedAtMs:oe}}function j(u){if(u.method!=="turn/completed")return null;const f=Le(u.params);if(!f)return null;const _=Ft(u);if(!_)return null;const C=Le(f.turn),Y=Pe(C==null?void 0:C.id)||Pe(f.turnId)||`${_}:unknown`;if(!Y)return null;const oe=Fr(Pe(C==null?void 0:C.completedAt))??Fr(Pe(f.completedAt))??Fr(u.atIso)??Date.now(),de=Fr(Pe(C==null?void 0:C.startedAt))??Fr(Pe(f.startedAt))??void 0;return{threadId:_,turnId:Y,completedAtMs:oe,startedAtMs:de}}function re(u){return`${u}:live-reasoning`}function je(u){const f=Le(u.params);if(!f)return"";if(u.method==="item/started"){const _=Le(f.item);return!_||_.type!=="reasoning"?"":Pe(_.id)}return""}function g(u){const f=Le(u.params);if(!f)return null;if(u.method==="item/reasoning/summaryTextDelta"){const _=Pe(f.itemId),C=Pe(f.delta);return!_||!C?null:{messageId:re(_),delta:C}}return null}function m(u){const f=Le(u.params);if(!f)return"";if(u.method==="item/reasoning/summaryPartAdded"){const _=Pe(f.itemId);return _?re(_):""}return""}function v(u){const f=Le(u.params);if(!f)return"";if(u.method==="item/completed"){const _=Le(f.item);return!_||_.type!=="reasoning"?"":re(Pe(_.id))}return""}function R(u){const f=Le(u.params);if(!f)return"";if(u.method==="item/started"){const _=Le(f.item);return!_||_.type!=="agentMessage"?"":Pe(_.id)}return""}function B(u){const f=Le(u.params);if(!f)return null;if(u.method==="item/agentMessage/delta"){const _=Pe(f.itemId),C=Pe(f.delta);return!_||!C?null:{messageId:_,delta:C}}return null}function K(u){const f=Le(u.params);if(!f)return null;if(u.method==="item/completed"){const _=Le(f.item);if(!_||_.type!=="agentMessage")return null;const C=Pe(_.id),Y=Pe(_.text);return!C||!Y?null:{id:C,role:"assistant",text:Y,messageType:"agentMessage.live"}}return null}function Ee(u){if(u.method!=="item/started")return null;const f=Le(u.params),_=Le(f==null?void 0:f.item);if(!_||_.type!=="commandExecution")return null;const C=Pe(_.id),Y=Pe(_.command);if(!C)return null;const oe=typeof _.cwd=="string"?_.cwd:null;return{id:C,role:"system",text:Y,messageType:"commandExecution",commandExecution:{command:Y,cwd:oe,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function Q(u){if(u.method!=="item/commandExecution/outputDelta")return null;const f=Le(u.params);if(!f)return null;const _=Pe(f.itemId),C=Pe(f.delta);return!_||!C?null:{itemId:_,delta:C}}function _e(u){if(u.method!=="item/completed")return null;const f=Le(u.params),_=Le(f==null?void 0:f.item);if(!_||_.type!=="commandExecution")return null;const C=Pe(_.id),Y=Pe(_.command);if(!C)return null;const oe=typeof _.cwd=="string"?_.cwd:null,de=Pe(_.status),Se=de==="failed"?"failed":de==="declined"?"declined":de==="interrupted"?"interrupted":"completed",ge=typeof _.aggregatedOutput=="string"?_.aggregatedOutput:"",st=typeof _.exitCode=="number"?_.exitCode:null;return{id:C,role:"system",text:Y,messageType:"commandExecution",commandExecution:{command:Y,cwd:oe,status:Se,aggregatedOutput:ge,exitCode:st}}}function he(u,f){const _=a.value[u]??[],C=Ta(_,f);C!==_&&(a.value={...a.value,[u]:C})}function Ke(u,f){const _=a.value[u];if(!_||_.length===0)return;const C=new Set(f.map(oe=>oe.id)),Y=_.filter(oe=>!C.has(oe.id));Y.length!==_.length&&(Y.length===0?a.value=Xt(a.value,u):a.value={...a.value,[u]:Y})}function jt(u){if(u.method==="item/agentMessage/delta")return!0;const f=Le(u.params);if(!f)return!1;if(u.method==="item/completed"){const _=Le(f.item);return(_==null?void 0:_.type)==="agentMessage"}return!1}function Ht(u){var Vl,Wl,zl,Gl,ql;if(Xn(u))return;if(u.method==="thread/name/updated"){const Xe=Le(u.params),tr=Pe(Xe==null?void 0:Xe.threadId),es=Pe(Xe==null?void 0:Xe.threadName);tr&&es&&(Ne.value={...Ne.value,[tr]:es},Je(),fa(tr,es))}if(u.method==="account/rateLimits/updated"){Te(jf(u.params));return}const f=xn(u);f&&Et(f.threadId,f.activity);const _=A(u);_&&(Ae.set(_.turnId,_),X.value={...X.value,[_.threadId]:_.turnId},kn(_.threadId),ot(_.threadId,null),Mt(_.threadId,null),_t(_.threadId,!0),c.value[_.threadId]&&(c.value=Xt(c.value,_.threadId)));const C=j(u),Y=En(u),de=!!((C==null?void 0:C.threadId)??Ft(u))&&!!Y&&N.value!==Ln&&Wo(new Error(Y));if(C){const Xe=Ae.get(C.turnId);Xe&&Ae.delete(C.turnId);const tr=Tn((Vl=Le(u.params))==null?void 0:Vl.durationMs)??Tn((zl=Le((Wl=Le(u.params))==null?void 0:Wl.turn))==null?void 0:zl.durationMs)??(typeof C.startedAtMs=="number"?C.completedAtMs-C.startedAtMs:null)??(Xe?C.completedAtMs-Xe.startedAtMs:null),es=typeof tr=="number"?Math.max(0,tr):0;ot(C.threadId,{turnId:C.turnId,durationMs:es}),X.value[C.threadId]&&(X.value=Xt(X.value,C.threadId)),_t(C.threadId,!1),Et(C.threadId,null),Pt(C.threadId),de||(Ie(C.threadId),Hs(C.threadId))}if(Y){const Xe=(C==null?void 0:C.threadId)||Ft(u);Xe&&Mt(Xe,Y),Be.value=Y,Xe&&de&&Ue(Xe)}else C&&Mt(C.threadId,null);const Se=On(u);if(Se){const Xe=Ft(u);Xe&&Mt(Xe,Se),Be.value=Se,N.value!==Ln&&Wo(new Error(Se))&&(Xe?Ue(Xe):ve())}const ge=Ft(u),st=mr(u);st&&(Mn(st.threadId,st.message),Et(st.threadId,{label:"Planning",details:((Gl=st.message.plan)==null?void 0:Gl.steps.map(Xe=>Xe.step).slice(0,2))??[]}));const Nt=Un(u);if(Nt&&(Mn(Nt.threadId,Nt.message),Et(Nt.threadId,{label:"Planning",details:[]})),!ge||ge!==n.value)return;R(u);const Qt=B(u);if(Qt){const Xe=(o.value[ge]??[]).find(es=>es.id===Qt.messageId),tr=`${(Xe==null?void 0:Xe.text)??""}${Qt.delta}`;en(ge,{id:Qt.messageId,role:"assistant",text:tr,messageType:"agentMessage.live"})}const Vn=K(u);Vn&&en(ge,Vn),je(u);const Zr=g(u);if(Zr&&Bn(ge,Zr.delta),m(u)){const Xe=i.value[ge]??"";Xe.trim().length>0&&!Xe.endsWith(`
|
|
1435
|
-
|
|
1436
|
-
`)&&$n(ge,`${Xe}
|
|
1437
|
-
|
|
1438
|
-
`)}v(u);const Ui=Ee(u);Ui&&(he(ge,Ui),Et(ge,{label:"Running command",details:[((ql=Ui.commandExecution)==null?void 0:ql.command)??""]}));const Hi=Q(u);if(Hi){const Xe=(a.value[ge]??[]).find(tr=>tr.id===Hi.itemId);Xe!=null&&Xe.commandExecution&&he(ge,{...Xe,commandExecution:{...Xe.commandExecution,aggregatedOutput:`${Xe.commandExecution.aggregatedOutput}${Hi.delta}`}})}const Hl=_e(u);if(Hl&&he(ge,Hl),jt(u)&&(fe&&n.value&&Pn(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),rn(ge)),u.method==="turn/completed"){fe=!1,rn(ge),a.value[ge]&&(a.value=Xt(a.value,ge));const Xe=Ft(u);Xe&&(_t(Xe,!1),Et(Xe,null),Pt(Xe),de||(Ie(Xe),Hs(Xe)))}}function Ct(u){const f=Ft(u);f&&V.add(f);const _=u.method;(_.startsWith("thread/")||_.startsWith("turn/")||_.startsWith("item/"))&&(Ve=!0),!(lt!==null||typeof window>"u")&&(lt=window.setTimeout(()=>{lt=null,E()},ba))}async function zt(u){if(!be){be=!0;try{const f=await Zs(),_=[];for(const C of f.order){const Y=bs(C);_.includes(Y)||_.push(Y)}if(_.length>0){const C=Vo(_,u);cs(L.value,C)||(L.value=C,ws(L.value))}if(Object.keys(f.labels).length>0){const C={...se.value};let Y=!1;for(const[oe,de]of Object.entries(f.labels)){const Se=bs(oe);C[Se]!==de&&(C[Se]=de,Y=!0)}Y&&(se.value=C,_a(C))}}catch{}}}async function Us(){if(!(Object.keys(Ne.value).length>0))try{const u=await s0();Object.keys(u.titles).length>0&&(Ne.value=u.titles)}catch{}}async function S(u,f,_){if(Ne.value[u])return;const C=f.trim();if(!C)return;const Y=C.length>300?C.slice(0,300):C;try{const oe=await o0(Y,_);if(!oe||Ne.value[u])return;Ne.value={...Ne.value,[u]:oe},Je(),fa(u,oe)}catch{}}async function x(){var u;Dt.value||(He.value=!0);try{const[f]=await Promise.all([Lk(),Us()]);await zt(f);const _=Vo(L.value,f);cs(L.value,_)||(L.value=_,ws(L.value));const C=ka(f,L.value),Y=DA(t.value,C,l.value);t.value=zo(t.value,Y),l.value=on(l.value,new Set(Vr(t.value).map(Se=>Se.id))),Je(),Dt.value=!0;const oe=Vr(e.value);hn(oe),oe.some(Se=>Se.id===n.value)||U(((u=oe[0])==null?void 0:u.id)??"")}finally{He.value=!1}}async function M(u,f={}){if(!u)return;const _=we.value[u]===!0,C=f.silent!==!0&&!_;C&&(Fe.value=!0);try{ce.value[u]!==!0&&(await ua(u),ce.value={...ce.value,[u]:!0});const{messages:Y,inProgress:oe}=await jk(u),de=r.value[u]??[],Se=SA(de,Y,{preserveMissing:f.silent===!0});_n(u,Se);const ge=o.value[u]??[],st=IA(ge,Y);Lt(u,st),Ke(u,Y),we.value={...we.value,[u]:!0};const Nt=In(u);Nt&&(ne.value={...ne.value,[u]:Nt}),_t(u,oe),oe||kn(u),ut(u)}finally{C&&(Fe.value=!1)}}async function Z(u,f={}){u&&we.value[u]!==!0&&await M(u,f)}async function We(){try{const u=t.value.flatMap(f=>f.threads.map(_=>_.cwd)).filter(Boolean);qe.value=await i0(u.length>0?[...new Set(u)]:void 0)}catch{}}async function $t(){try{Te(await Hk())}catch{}}async function tn(u={}){Be.value="";const f=u.includeSelectedThreadMessages!==!1,_=u.awaitAncillaryRefreshes===!0;try{await x();const C=Promise.allSettled([et(),Qe(),We(),$t()]).then(()=>{});f&&await M(n.value),_&&await C}catch(C){Be.value=C instanceof Error?C.message:"Unknown application error"}}async function Zn(u){U(u);try{await M(u)}catch(f){Be.value=f instanceof Error?f.message:"Unknown application error"}}async function sn(u){try{await Vk(u),await x(),n.value===u&&await M(n.value)}catch(f){Be.value=f instanceof Error?f.message:"Unknown application error"}}async function Jt(u,f){const _=f.trim();if(!(!u||!_))try{await Wk(u,_),Ne.value={...Ne.value,[u]:_},Je(),fa(u,_)}catch(C){Be.value=C instanceof Error?C.message:"Unknown application error"}}async function Hn(u,f=[],_=[],C="steer",Y=[]){const oe=n.value,de=u.trim();if(!oe||!de&&f.length===0&&Y.length===0)return;const Se=l.value[oe]===!0;if(Se&&C==="queue"){const ge=d.value[oe]??[],st=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;d.value={...d.value,[oe]:[...ge,{id:st,text:de,imageUrls:f,skills:_,fileAttachments:Y,collaborationMode:T.value}]};return}if(Se){fe=!0,er(oe,de,f,_,Y).catch(ge=>{const st=ge instanceof Error?ge.message:"Unknown application error";Mt(oe,st),Be.value=st});return}Be.value="",fe=!0,ot(oe,null),Et(oe,{label:"Thinking",details:ct(N.value,O.value,T.value)}),Mt(oe,null),_t(oe,!0);try{await er(oe,de,f,_,Y)}catch(ge){fe=!1,_t(oe,!1),Et(oe,null);const st=ge instanceof Error?ge.message:"Unknown application error";throw Mt(oe,st),Be.value=st,ge}}async function Dr(u,f,_=[],C=[],Y=[]){const oe=u.trim(),de=f.trim(),Se=N.value.trim();if(!oe&&_.length===0&&Y.length===0)return"";xe.value=!0,Be.value="";let ge="";try{try{ge=await mu(de||void 0,Se||void 0)}catch(Vn){if(Se&&Se!==Ln&&Wo(Vn))await ve(),ge=await mu(de||void 0,Ln);else throw Vn}if(!ge)return"";Ot(ge,de,oe||"[Image]"),ce.value={...ce.value,[ge]:!0},U(ge),fe=!0,ot(ge,null),Et(ge,{label:"Thinking",details:ct(N.value,O.value,T.value)}),Mt(ge,null),_t(ge,!0);const st=ge,Nt=de||null,Qt=oe;return er(ge,oe,_,C,Y).catch(Vn=>{fe=!1,_t(ge,!1),Et(ge,null);const Zr=Vn instanceof Error?Vn.message:"Unknown application error";Mt(ge,Zr),Be.value=Zr}).finally(()=>{xe.value=!1}),S(st,Qt,Nt),ge}catch(st){fe=!1,ge&&(_t(ge,!1),Et(ge,null));const Nt=st instanceof Error?st.message:"Unknown application error";throw ge&&Mt(ge,Nt),Be.value=Nt,xe.value=!1,st}}async function er(u,f,_=[],C=[],Y=[]){const oe=N.value.trim(),de=O.value,Se=T.value,ge=f.trim(),st=C.map(Qt=>({name:Qt.name,path:Qt.path})),Nt=Y.map(Qt=>({...Qt}));ke(u,{text:ge,imageUrls:[..._],skills:st,fileAttachments:Nt,effort:de,collaborationMode:Se,fallbackRetried:!1});try{ce.value[u]!==!0&&await ua(u);try{await da(u,f,_,oe||void 0,de||void 0,C.length>0?C:void 0,Y,Se)}catch(Qt){if(oe&&oe!==Ln&&Wo(Qt))await ve(),ke(u,{text:ge,imageUrls:[..._],skills:st,fileAttachments:Nt,effort:de,collaborationMode:Se,fallbackRetried:!0}),await da(u,f,_,Ln,de||void 0,C.length>0?C:void 0,Y,Se);else throw Qt}ce.value={...ce.value,[u]:!0},V.add(u),Ve=!0,await E()}catch(Qt){throw Qt}}async function Hs(u){const f=d.value[u];if(!f||f.length===0)return;const[_,...C]=f;d.value=C.length>0?{...d.value,[u]:C}:Xt(d.value,u),xe.value=!0,Be.value="",fe=!0,ot(u,null),Et(u,{label:"Thinking",details:ct(N.value,O.value,_.collaborationMode)}),Mt(u,null),_t(u,!0);try{G(_.collaborationMode),await er(u,_.text,_.imageUrls,_.skills,_.fileAttachments)}catch{_t(u,!1),Et(u,null)}finally{xe.value=!1}}async function Li(){const u=n.value;if(!u||l.value[u]!==!0)return;const f=X.value[u];nt.value=!0,Be.value="";try{await Kk(u,f),_t(u,!1),Et(u,null),Mt(u,null),X.value[u]&&(X.value=Xt(X.value,u)),V.add(u),Ve=!0,await E()}catch(_){const C=_ instanceof Error?_.message:"Failed to interrupt active turn";Mt(u,C),Be.value=C}finally{nt.value=!1}}async function ji(u){const f=n.value;if(!f||ze.value)return;const C=(r.value[f]??[]).reduce((oe,de)=>typeof de.turnIndex=="number"&&de.turnIndex>oe?de.turnIndex:oe,-1);if(C<0||u>C)return;const Y=C-u+1;if(!(Y<1)){ze.value=!0,Be.value="";try{const oe=await pu(f,Y);_n(f,oe),kn(f),Lt(f,[]),rn(f),a.value[f]&&(a.value=Xt(a.value,f)),ot(f,null),Et(f,null),Mt(f,null),Ve=!0,await E()}catch(oe){Be.value=oe instanceof Error?oe.message:"Failed to rollback thread"}finally{ze.value=!1}}}function Bi(u,f){u.length===0||(se.value[u]??"")===f||(se.value={...se.value,[u]:f},_a(se.value))}async function Fi(u){var oe;if(u.length===0)return;const f=L.value.filter(de=>de!==u);if(cs(L.value,f)||(L.value=f,ws(L.value)),t.value=t.value.filter(de=>de.projectName!==u),se.value[u]!==void 0){const de={...se.value};delete de[u],se.value=de,_a(de)}Je();const _=Vr(e.value);hn(_),_.some(de=>de.id===n.value)||U(((oe=_[0])==null?void 0:oe.id)??"");const Y=new Set;try{const de=await Zs();for(const Se of de.order)bs(Se)===u&&Y.add(Se);for(const Se of de.active)bs(Se)===u&&Y.add(Se);for(const Se of Object.keys(de.labels))bs(Se)===u&&Y.add(Se)}catch{}if(Y.size>0)try{const de=await Zs(),Se=de.order.filter(Nt=>!Y.has(Nt)),ge=de.active.filter(Nt=>!Y.has(Nt)),st=ge.length===0&&Se.length>0?[Se[0]]:ge;await vu({order:Se,labels:MA(de.labels,Y),active:st});return}catch{}await Ws()}function Do(u,f){if(u.length===0||t.value.length===0)return;const _=t.value.map(ge=>ge.projectName),C=_.indexOf(u);if(C===-1)return;const Y=Math.max(0,Math.min(f,_.length-1)),oe=bA(_,C,Y);if(oe===_)return;const de=Vo(oe,t.value);L.value=de,ws(L.value);const Se=ka(t.value,L.value);t.value=zo(t.value,Se),Je(),Ws()}function Vs(u){const f=u.trim();if(!f)return;const _=[f,...L.value.filter(Y=>Y!==f)];if(cs(L.value,_))return;L.value=_,ws(L.value);const C=ka(t.value,L.value);t.value=zo(t.value,C),Je(),Ws()}async function Ws(){var u,f;try{const _=await Zs(),C=new Map;for(const de of _.order){const Se=bs(de);C.has(Se)||C.set(Se,de)}for(const de of t.value){const Se=((f=(u=de.threads[0])==null?void 0:u.cwd)==null?void 0:f.trim())??"";Se&&C.set(de.projectName,Se)}const Y=[];for(const de of L.value){const Se=C.get(de);Se&&!Y.includes(Se)&&Y.push(Se)}for(const de of _.order)Y.includes(de)||Y.push(de);const oe=_.active.filter(de=>Y.includes(de));oe.length===0&&Y.length>0&&oe.push(Y[0]),await vu({order:Y,labels:_.labels,active:oe})}catch{}}async function E(){if(at.value){typeof window<"u"&<===null&&(lt=window.setTimeout(()=>{lt=null,E()},ba));return}at.value=!0;const u=Ve,f=new Set(V);Ve=!1,V.clear();try{u&&await x();const _=n.value;if(!_)return;const C=f.has(_),Y=l.value[_]===!0,oe=In(_),de=ne.value[_]??"",Se=oe.length>0&&oe!==de;(C||Y||Se||u)&&await M(_,{silent:!0})}catch{}finally{at.value=!1,(Ve||V.size>0)&&typeof window<"u"&<===null&&(lt=window.setTimeout(()=>{lt=null,E()},ba))}}async function ee(){await yt(),Ve=!0,n.value&&V.add(n.value),await E()}function Ce(){typeof window>"u"||it||(yt(),it=Bk(u=>{if(u.method==="ready"){ee();return}Ht(u),Ct(u)}))}async function yt(){try{const f=(await Uk()).map(_=>pn(_)).filter(_=>_!==null);Cn(f)}catch{}}async function gt(u){try{await Fk(u.id,{result:u.result,error:u.error}),Wt(u.id)}catch(f){Be.value=f instanceof Error?f.message:"Failed to reply to server request"}}function rt(){it&&(it(),it=null),Ve=!1,V.clear(),Ae.clear(),lt!==null&&typeof window<"u"&&(window.clearTimeout(lt),lt=null),fe=!1,r.value={},s.value={},o.value={},i.value={},a.value={},Oe.value={},me.value={},ae.value={},X.value={},d.value={},Me.value=null}const Yt=pe(()=>{const u=n.value;return u?d.value[u]??[]:[]});function zs(u){const f=n.value;if(!f)return;const _=d.value[f];if(!_)return;const C=_.filter(Y=>Y.id!==u);d.value=C.length>0?{...d.value,[f]:C}:Xt(d.value,f)}function Gs(u){const f=n.value;if(!f)return;const _=d.value[f];if(!_)return;const C=_.find(Y=>Y.id===u);C&&(zs(u),G(C.collaborationMode),Hn(C.text,C.imageUrls,C.skills,"steer",C.fileAttachments))}function jh(u){U(u)}return{projectGroups:e,projectDisplayNameById:se,selectedThread:I,selectedThreadScrollState:$,selectedThreadServerRequests:q,selectedLiveOverlay:F,codexQuota:P,selectedThreadId:n,availableCollaborationModes:b,availableModelIds:h,selectedCollaborationMode:T,selectedModelId:N,selectedReasoningEffort:O,installedSkills:qe,messages:H,isLoadingThreads:He,isLoadingMessages:Fe,isSendingMessage:xe,isInterruptingTurn:nt,error:Be,refreshAll:tn,refreshSkills:We,selectThread:Zn,loadMessages:M,ensureThreadMessagesLoaded:Z,setThreadScrollState:Pn,archiveThreadById:sn,renameThreadById:Jt,sendMessageToSelectedThread:Hn,sendMessageToNewThread:Dr,interruptSelectedThreadTurn:Li,rollbackSelectedThread:ji,isRollingBack:ze,selectedThreadQueuedMessages:Yt,removeQueuedMessage:zs,steerQueuedMessage:Gs,setSelectedCollaborationMode:G,setSelectedModelId:z,setSelectedReasoningEffort:tt,respondToPendingServerRequest:gt,renameProject:Bi,removeProject:Fi,reorderProject:Do,pinProjectToTop:Vs,startPolling:Ce,stopPolling:rt,primeSelectedThread:jh}}const FA={class:"sidebar-root"},UA={class:"sidebar-scrollable"},HA=["aria-pressed"],VA={key:1,class:"sidebar-search-bar"},WA={key:0,class:"sidebar-settings-area"},zA={key:0,class:"sidebar-settings-panel"},GA={class:"sidebar-settings-value"},qA={class:"sidebar-settings-value"},KA={class:"content-root"},JA={class:"content-body"},YA={key:1,class:"content-grid"},QA={class:"new-thread-empty"},XA={class:"worktree-init-status-title"},ZA={class:"worktree-init-status-message"},ex={key:2,class:"content-grid"},tx={class:"content-thread"},nx={class:"composer-with-queue"},rx={class:"build-badge","aria-label":"Author name, worktree name, and version"},Zu="codex-web-local.sidebar-collapsed.v1",Sa="codex-web-local.last-active-thread-route.v1",ed="codex-web-local.send-with-enter.v1",td="codex-web-local.in-progress-send-mode.v1",nd="codex-web-local.dark-mode.v1",rd="codex-web-local.dictation-click-to-toggle.v1",sx=400,ox=Zt({__name:"App",setup(e){const t="codexui",n="1.0.1",{projectGroups:r,projectDisplayNameById:s,selectedThread:o,selectedThreadScrollState:i,selectedThreadServerRequests:a,selectedLiveOverlay:l,codexQuota:d,selectedThreadId:c,availableCollaborationModes:h,availableModelIds:b,selectedCollaborationMode:T,selectedModelId:N,selectedReasoningEffort:O,installedSkills:J,messages:ie,isLoadingThreads:L,isLoadingMessages:se,isInterruptingTurn:ne,refreshAll:we,refreshSkills:ce,selectThread:me,ensureThreadMessagesLoaded:Oe,setThreadScrollState:ae,archiveThreadById:X,renameThreadById:le,sendMessageToSelectedThread:te,sendMessageToNewThread:Me,interruptSelectedThreadTurn:Ne,rollbackSelectedThread:qe,isRollingBack:He,selectedThreadQueuedMessages:Fe,removeQueuedMessage:xe,steerQueuedMessage:nt,setSelectedCollaborationMode:ze,setSelectedModelId:Be,setSelectedReasoningEffort:at,respondToPendingServerRequest:Dt,renameProject:it,removeProject:lt,reorderProject:Ve,pinProjectToTop:V,startPolling:be,stopPolling:fe,primeSelectedThread:Ae}=BA(),Re=_v(),k=bv(),{isMobile:I}=$f(),$=D(!1),q=D(!1),F=D(""),P=D("local"),H=D({order:[],labels:{}}),U=D({phase:"idle",title:"",message:""}),z=D(Hn()),G=D(""),Te=D(!1),ve=D(null),ke=D(null);let Ie=null;const Ue=D("New Project (1)"),tt=D(""),Qe=D(!1),ct=D(M(ed,!0)),et=D(We()),pt=D(Z()),Je=D(M(rd,!1)),Ot=D(null),hn=D(!1),ut=D(!1),ot=pe(()=>{const E=Re.params.threadId;return typeof E=="string"?E:""}),_t=pe(()=>{const E=new Set;for(const ee of r.value)for(const Ce of ee.threads)E.add(Ce.id);return E}),Pt=pe(()=>Re.name==="home"),Et=pe(()=>Re.name==="skills"),Mt=pe(()=>{var E;return Et.value?"Skills":Pt.value?"New thread":((E=o.value)==null?void 0:E.title)??"Choose a thread"}),In=pe(()=>ie.value.filter(E=>{const ee=er(E.messageType,E.role);return ee==="worked"?!0:!(ee==="turnActivity.live"||ee==="turnError.live"||ee==="agentReasoning.live")})),Pn=pe(()=>l.value),_n=pe(()=>Pt.value?"__new-thread__":c.value),Lt=pe(()=>{var E,ee;return Pt.value?F.value.trim():((ee=(E=o.value)==null?void 0:E.cwd)==null?void 0:ee.trim())??""}),Vt=pe(()=>{var E;return!Pt.value&&((E=o.value)==null?void 0:E.inProgress)===!0}),Mn=pe(()=>{var yt,gt;const E=[],ee=new Set;for(const rt of H.value.order){const Yt=rt.trim();!Yt||ee.has(Yt)||(ee.add(Yt),E.push({value:Yt,label:H.value.labels[Yt]||_e(Yt)}))}for(const rt of r.value){const Yt=((gt=(yt=rt.threads[0])==null?void 0:yt.cwd)==null?void 0:gt.trim())??"";!Yt||ee.has(Yt)||(ee.add(Yt),E.push({value:Yt,label:s.value[rt.projectName]??rt.projectName}))}const Ce=F.value.trim();return Ce&&!ee.has(Ce)&&E.unshift({value:Ce,label:_e(Ce)}),E}),en=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;Or(()=>{window.addEventListener("keydown",Cn),document.addEventListener("visibilitychange",Xn),window.addEventListener("pageshow",An),window.addEventListener("focus",xn),Jt(),en==null||en.addEventListener("change",Jt),Li(),K(),Ee(),R()}),Ci(()=>{window.removeEventListener("keydown",Cn),document.removeEventListener("visibilitychange",Xn),window.removeEventListener("pageshow",An),window.removeEventListener("focus",xn),en==null||en.removeEventListener("change",Jt),Ie&&(clearTimeout(Ie),Ie=null),fe()}),mt(G,E=>{const ee=E.trim();if(Ie&&(clearTimeout(Ie),Ie=null),!ee){ke.value=null;return}Ie=setTimeout(()=>{r0(ee,1e3).then(Ce=>{G.value.trim()===ee&&(ke.value=Ce.threadIds)}).catch(()=>{G.value.trim()===ee&&(ke.value=null)})},220)});function $n(){ce()}function Bn(){Te.value=!Te.value,Te.value?qt(()=>{var E;return(E=ve.value)==null?void 0:E.focus()}):G.value=""}function rn(){var E;G.value="",(E=ve.value)==null||E.focus()}function kn(E){E.key==="Escape"&&(Te.value=!1,G.value="")}function Fn(E){E&&(Re.name==="thread"&&ot.value===E||(k.push({name:"thread",params:{threadId:E}}),I.value&&Wt(!0)))}async function pr(E){E&&(c.value!==E&&(await me(E),await k.push({name:"thread",params:{threadId:E}})),await qt(),zt())}function mr(E){X(E)}function Un(E){var yt,gt;const ee=r.value.find(rt=>rt.projectName===E),Ce=((gt=(yt=ee==null?void 0:ee.threads[0])==null?void 0:yt.cwd)==null?void 0:gt.trim())??"";Ce&&(F.value=Ce),I.value&&Wt(!0),!Pt.value&&k.push({name:"home"})}function Le(E){var yt,gt;const ee=r.value.find(rt=>rt.projectName===E),Ce=((gt=(yt=ee==null?void 0:ee.threads[0])==null?void 0:yt.cwd)==null?void 0:gt.trim())??"";!Ce||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(Ce)}`,"_blank","noopener,noreferrer")}function Pe(){var ee,Ce;const E=((Ce=(ee=o.value)==null?void 0:ee.cwd)==null?void 0:Ce.trim())??"";E&&(F.value=E),I.value&&Wt(!0),!Pt.value&&k.push({name:"home"})}function Tn(E){it(E.projectName,E.displayName)}function Ft(E){le(E.threadId,E.title)}async function En(E){await lt(E),await Ee(),R()}function On(E){Ve(E.projectName,E.toIndex)}function pn(E){ae(E.threadId,E.state)}function Nn(E){Dt(E)}function Wt(E){z.value!==E&&(z.value=E,Dr(E))}function Cn(E){E.defaultPrevented||!E.ctrlKey&&!E.metaKey||E.shiftKey||E.altKey||E.key.toLowerCase()==="b"&&(E.preventDefault(),Wt(!z.value))}function Xn(){if(!(typeof document>"u")&&I.value){if(document.visibilityState==="hidden"){Ot.value=Date.now(),hn.value=!1;return}A()}}function An(E){E.persisted&&A()}function xn(){A()}function A(){typeof window>"u"||typeof document>"u"||!I.value||document.visibilityState!=="visible"||hn.value||Ot.value===null||Date.now()-Ot.value<sx||(hn.value=!0,Ot.value=null,j())}async function j(){if(!ut.value){ut.value=!0;try{await we({includeSelectedThreadMessages:!0,awaitAncillaryRefreshes:!0}),await Do(),await Vs()}finally{ut.value=!1}}}function re(E){const ee=E.text;if(Pt.value){Ws(ee,E.imageUrls,E.skills,E.fileAttachments);return}te(ee,E.imageUrls,E.skills,E.mode,E.fileAttachments)}function je(E){F.value=E.trim()}async function g(E){const ee=E.trim();if(!ee)return;const Ce=v(ee),yt=await m(),gt=Ce?ee:he(yt,ee);if(gt)try{const rt=await e0(gt,{createIfMissing:!Ce,label:Ce?"":ee});rt&&(F.value=rt,V(_e(rt)),Ee(),R())}catch{}}async function m(){const E=B();if(E)return E;try{const ee=await gu();if(ee)return tt.value=ee,ee}catch{}return""}function v(E){return E?E.startsWith("~/")||E.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(E):!1}async function R(){const E=B();if(!E){Ue.value="New Project (1)";return}try{const ee=await t0(E);Ue.value=ee.name||"New Project (1)"}catch{Ue.value="New Project (1)"}}function B(){var Ce,yt;const E=F.value.trim();if(E)return Q(E);const ee=((yt=(Ce=Mn.value[0])==null?void 0:Ce.value)==null?void 0:yt.trim())??"";return ee?Q(ee):tt.value.trim()}async function K(){try{tt.value=await gu()}catch{tt.value=""}}async function Ee(){try{const E=await Zs();H.value={order:[...E.order],labels:{...E.labels}}}catch{H.value={order:[],labels:{}}}}function Q(E){const ee=E.trim().replace(/\/+$/,"");if(!ee)return"";const Ce=ee.lastIndexOf("/");return Ce<=0?"":ee.slice(0,Ce)}function _e(E){const ee=E.trim().replace(/\/+$/,"");if(!ee)return"";const Ce=ee.lastIndexOf("/");return Ce<0?ee:ee.slice(Ce+1)}function he(E,ee){const Ce=E.trim().replace(/\/+$/,""),yt=ee.trim().replace(/^\/+/,"");return!Ce||!yt?"":`${Ce}/${yt}`}function Ke(E){Be(E)}function jt(E){at(E)}function Ht(){Ne()}function Ct(E){qe(E.turnIndex)}function zt(){if(Pt.value||Et.value||typeof document>"u"||!o.value||In.value.length===0)return;const E=Us(),ee=S(),Ce=new Blob([E],{type:"text/markdown;charset=utf-8"}),yt=URL.createObjectURL(Ce),gt=document.createElement("a");gt.href=yt,gt.download=ee,document.body.appendChild(gt),gt.click(),document.body.removeChild(gt),window.setTimeout(()=>URL.revokeObjectURL(yt),0)}function Us(){var Ce,yt,gt;const E=[],ee=((yt=(Ce=o.value)==null?void 0:Ce.title)==null?void 0:yt.trim())||"Untitled thread";E.push(`# ${x(ee)}`),E.push(""),E.push(`- Exported: ${new Date().toISOString()}`),E.push(`- Thread ID: ${((gt=o.value)==null?void 0:gt.id)??""}`),E.push(""),E.push("---"),E.push("");for(const rt of In.value){const Yt=rt.role?rt.role.toUpperCase():"MESSAGE";E.push(`## ${Yt}`),E.push("");const zs=rt.text.trim();if(zs&&(E.push(zs),E.push("")),rt.commandExecution&&(E.push("```text"),E.push(`command: ${rt.commandExecution.command}`),E.push(`status: ${rt.commandExecution.status}`),rt.commandExecution.cwd&&E.push(`cwd: ${rt.commandExecution.cwd}`),rt.commandExecution.exitCode!==null&&E.push(`exitCode: ${rt.commandExecution.exitCode}`),E.push(rt.commandExecution.aggregatedOutput||"(no output)"),E.push("```"),E.push("")),rt.fileAttachments&&rt.fileAttachments.length>0){E.push("Attachments:");for(const Gs of rt.fileAttachments)E.push(`- ${Gs.path}`);E.push("")}if(rt.images&&rt.images.length>0){E.push("Images:");for(const Gs of rt.images)E.push(`- ${Gs}`);E.push("")}}return`${E.join(`
|
|
1439
|
-
`).trimEnd()}
|
|
1440
|
-
`}function S(){var gt,rt;const Ce=(((rt=(gt=o.value)==null?void 0:gt.title)==null?void 0:rt.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",yt=new Date().toISOString().replace(/[:.]/g,"-");return`${Ce}-${yt}.md`}function x(E){return E.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function M(E,ee){if(typeof window>"u")return ee;const Ce=window.localStorage.getItem(E);return Ce===null?ee:Ce==="1"}function Z(){if(typeof window>"u")return"system";const E=window.localStorage.getItem(nd);return E==="light"||E==="dark"?E:"system"}function We(){return typeof window>"u"?"queue":window.localStorage.getItem(td)==="steer"?"steer":"queue"}function $t(){ct.value=!ct.value,window.localStorage.setItem(ed,ct.value?"1":"0")}function tn(){et.value=et.value==="steer"?"queue":"steer",window.localStorage.setItem(td,et.value)}function Zn(){const E=["system","light","dark"],ee=E.indexOf(pt.value);pt.value=E[(ee+1)%E.length],window.localStorage.setItem(nd,pt.value),Jt()}function sn(){Je.value=!Je.value,window.localStorage.setItem(rd,Je.value?"1":"0")}function Jt(){const E=document.documentElement;if(pt.value==="dark")E.classList.add("dark");else if(pt.value==="light")E.classList.remove("dark");else{const ee=window.matchMedia("(prefers-color-scheme: dark)").matches;E.classList.toggle("dark",ee)}}function Hn(){return typeof window>"u"?!1:window.localStorage.getItem(Zu)==="1"}function Dr(E){typeof window>"u"||window.localStorage.setItem(Zu,E?"1":"0")}function er(E,ee){const Ce=(E??"").trim();return Ce.length>0?Ce:ee.trim()||"message"}function Hs(E){ze(E)}async function Li(){await k.isReady(),Re.name==="thread"&&ot.value&&Ae(ot.value),be(),await we({includeSelectedThreadMessages:!0}),await Do(),q.value=!0,await Vs()}function ji(){if(typeof window>"u")return null;try{const E=window.localStorage.getItem(Sa);if(!E)return null;const ee=JSON.parse(E);return!ee||ee.routeName!=="thread"||typeof ee.threadId!="string"||ee.threadId.trim().length===0||typeof ee.updatedAtIso!="string"||ee.updatedAtIso.trim().length===0?null:{routeName:"thread",threadId:ee.threadId.trim(),updatedAtIso:ee.updatedAtIso}}catch{return null}}function Bi(E){if(typeof window>"u")return;const ee=E.trim();if(!ee)return;const Ce={routeName:"thread",threadId:ee,updatedAtIso:new Date().toISOString()};window.localStorage.setItem(Sa,JSON.stringify(Ce))}function Fi(){typeof window>"u"||window.localStorage.removeItem(Sa)}async function Do(){if(Re.name!=="home")return!1;const E=ji(),ee=c.value.trim(),Ce=(E==null?void 0:E.threadId)??ee;return Ce?_t.value.has(Ce)?(await k.replace({name:"thread",params:{threadId:Ce}}),!0):((E==null?void 0:E.threadId)===Ce&&Fi(),!1):!1}async function Vs(){if(!$.value){$.value=!0;try{if(Re.name==="home"||Re.name==="skills"){c.value!==""&&await me("");return}if(Re.name==="thread"){const E=ot.value;if(!E)return;if(!_t.value.has(E)){await k.replace({name:"home"});return}c.value!==E?await me(E):Oe(E,{silent:!0});return}}finally{$.value=!1}}}mt(()=>[Re.name,ot.value,c.value,q.value],([E,ee,Ce,yt])=>{if(!yt||E!=="thread")return;const gt=(ee||Ce).trim();gt&&_t.value.has(gt)&&Bi(gt)}),mt(()=>[Re.name,ot.value,L.value,_t.value.has(ot.value),c.value],async()=>{q.value&&await Vs()}),mt(()=>c.value,async E=>{if(q.value&&!$.value&&!(Pt.value||Et.value)){if(!E){Re.name!=="home"&&await k.replace({name:"home"});return}Re.name==="thread"&&ot.value===E||await k.replace({name:"thread",params:{threadId:E}})}}),mt(()=>[q.value,Re.name,c.value],([E,ee,Ce])=>{E&&ee==="thread"&&Ce&&Oe(Ce,{silent:!0})}),mt(()=>Mn.value,E=>{if(E.length===0){F.value="";return}E.some(Ce=>Ce.value===F.value)||(F.value=E[0].value),R()},{immediate:!0}),mt(()=>F.value,()=>{U.value={phase:"idle",title:"",message:""},R()}),mt(()=>P.value,E=>{E==="local"&&(U.value={phase:"idle",title:"",message:""})}),mt(()=>Re.name,E=>{E!=="home"&&(U.value={phase:"idle",title:"",message:""})}),mt(()=>c.value,()=>{U.value={phase:"idle",title:"",message:""}}),mt(I,E=>{E&&!z.value&&Wt(!0)});async function Ws(E,ee=[],Ce=[],yt=[]){try{U.value={phase:"idle",title:"",message:""};let gt=F.value;if(P.value==="worktree"){U.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const Yt=await Zk(F.value);gt=Yt.cwd,F.value=Yt.cwd,U.value={phase:"idle",title:"",message:""}}catch{U.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const rt=await Me(E,gt,ee,Ce,yt);if(!rt)return;await k.replace({name:"thread",params:{threadId:rt}})}catch{}}return(E,ee)=>(p(),w($e,null,[De(Cv,{"is-sidebar-collapsed":z.value,onCloseSidebar:ee[6]||(ee[6]=Ce=>Wt(!0))},{sidebar:kt(()=>[y("section",FA,[y("div",UA,[z.value?ue("",!0):(p(),vt(Ju,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":z.value,"show-new-thread-button":!0,onToggleSidebar:ee[0]||(ee[0]=Ce=>Wt(!z.value)),onStartNewThread:Pe},{default:kt(()=>[y("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":Te.value,"aria-label":"Search threads",title:"Search threads",onClick:Bn},[De(za,{class:"sidebar-search-toggle-icon"})],8,HA)]),_:1},8,["is-sidebar-collapsed"])),!z.value&&Te.value?(p(),w("div",VA,[De(za,{class:"sidebar-search-bar-icon"}),xr(y("input",{ref_key:"sidebarSearchInputRef",ref:ve,"onUpdate:modelValue":ee[1]||(ee[1]=Ce=>G.value=Ce),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:kn},null,544),[[Rr,G.value]]),G.value.length>0?(p(),w("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:rn},[De(El,{class:"sidebar-search-clear-icon"})])):ue("",!0)])):ue("",!0),z.value?ue("",!0):(p(),w("button",{key:2,class:ft(["sidebar-skills-link",{"is-active":Et.value}]),type:"button",onClick:ee[2]||(ee[2]=Ce=>{ye(k).push({name:"skills"}),ye(I)&&Wt(!0)})}," Skills Hub ",2)),z.value?ue("",!0):(p(),vt(fw,{key:3,groups:ye(r),"project-display-name-by-id":ye(s),"selected-thread-id":ye(c),"is-loading":ye(L),"search-query":G.value,"search-matched-thread-ids":ke.value,onSelect:Fn,onArchive:mr,onStartNewThread:Un,onRenameProject:Tn,onBrowseProjectFiles:Le,onRenameThread:Ft,onRemoveProject:En,onReorderProject:On,onExportThread:pr},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),z.value?ue("",!0):(p(),w("div",WA,[De(bf,{name:"settings-panel"},{default:kt(()=>[Qe.value?(p(),w("div",zA,[y("button",{class:"sidebar-settings-row",type:"button",onClick:$t},[ee[7]||(ee[7]=y("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),y("span",{class:ft(["sidebar-settings-toggle",{"is-on":!ct.value}])},null,2)]),y("button",{class:"sidebar-settings-row",type:"button",onClick:tn},[ee[8]||(ee[8]=y("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),y("span",GA,W(et.value==="steer"?"Steer":"Queue"),1)]),y("button",{class:"sidebar-settings-row",type:"button",onClick:Zn},[ee[9]||(ee[9]=y("span",{class:"sidebar-settings-label"},"Appearance",-1)),y("span",qA,W(pt.value==="system"?"System":pt.value==="dark"?"Dark":"Light"),1)]),y("button",{class:"sidebar-settings-row",type:"button",onClick:sn},[ee[10]||(ee[10]=y("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),y("span",{class:ft(["sidebar-settings-toggle",{"is-on":Je.value}])},null,2)])])):ue("",!0)]),_:1}),y("button",{class:"sidebar-settings-button",type:"button",onClick:ee[3]||(ee[3]=Ce=>Qe.value=!Qe.value)},[De(uA,{class:"sidebar-settings-icon"}),ee[11]||(ee[11]=y("span",null,"Settings",-1))])]))])]),content:kt(()=>[y("section",KA,[De(yw,{title:Mt.value},{leading:kt(()=>[z.value||ye(I)?(p(),vt(Ju,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":z.value,"show-new-thread-button":!0,onToggleSidebar:ee[4]||(ee[4]=Ce=>Wt(!z.value)),onStartNewThread:Pe},null,8,["is-sidebar-collapsed"])):ue("",!0)]),_:1},8,["title"]),y("section",JA,[Et.value?(p(),vt(JC,{key:0,onSkillsChanged:$n})):Pt.value?(p(),w("div",YA,[y("div",QA,[ee[12]||(ee[12]=y("p",{class:"new-thread-hero"},"Let's build",-1)),De(Wa,{class:"new-thread-folder-dropdown","model-value":F.value,options:Mn.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":Ue.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":je,onAdd:g},null,8,["model-value","options","default-add-value"]),De(tS,{class:"new-thread-runtime-dropdown",modelValue:P.value,"onUpdate:modelValue":ee[5]||(ee[5]=Ce=>P.value=Ce)},null,8,["modelValue"]),U.value.phase!=="idle"?(p(),w("div",{key:0,class:ft(["worktree-init-status",{"is-running":U.value.phase==="running","is-error":U.value.phase==="error"}])},[y("strong",XA,W(U.value.title),1),y("span",ZA,W(U.value.message),1)],2)):ue("",!0)]),De(bu,{"active-thread-id":_n.value,cwd:Lt.value,"collaboration-modes":ye(h),"selected-collaboration-mode":ye(T),models:ye(b),"selected-model":ye(N),"selected-reasoning-effort":ye(O),skills:ye(J),"codex-quota":ye(d),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":ct.value,"in-progress-submit-mode":et.value,"dictation-click-to-toggle":Je.value,onSubmit:re,"onUpdate:selectedCollaborationMode":Hs,"onUpdate:selectedModel":Ke,"onUpdate:selectedReasoningEffort":jt},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","skills","codex-quota","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle"])])):(p(),w("div",ex,[y("div",tx,[De(lk,{messages:In.value,"is-loading":ye(se),"active-thread-id":_n.value,cwd:Lt.value,"scroll-state":ye(i),"live-overlay":Pn.value,"pending-requests":ye(a),"is-turn-in-progress":Vt.value,"is-rolling-back":ye(He),onUpdateScrollState:pn,onRespondServerRequest:Nn,onRollback:Ct},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),y("div",nx,[De(qT,{messages:ye(Fe),onSteer:ye(nt),onDelete:ye(xe)},null,8,["messages","onSteer","onDelete"]),De(bu,{"active-thread-id":_n.value,cwd:Lt.value,"collaboration-modes":ye(h),"selected-collaboration-mode":ye(T),models:ye(b),"selected-model":ye(N),"selected-reasoning-effort":ye(O),skills:ye(J),"codex-quota":ye(d),"is-turn-in-progress":Vt.value,"is-interrupting-turn":ye(ne),"has-queue-above":ye(Fe).length>0,"send-with-enter":ct.value,"in-progress-submit-mode":et.value,"dictation-click-to-toggle":Je.value,"onUpdate:selectedCollaborationMode":Hs,onSubmit:re,"onUpdate:selectedModel":Ke,"onUpdate:selectedReasoningEffort":jt,onInterrupt:Ht},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","skills","codex-quota","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),y("div",rx," nervmor "+W(ye(t))+" · v"+W(ye(n)),1)],64))}}),ix=ht(ox,[["__scopeId","data-v-07673db6"]]),Ia={render:()=>null},ax=wv({history:Qg(),routes:[{path:"/",name:"home",component:Ia},{path:"/thread/:threadId",name:"thread",component:Ia},{path:"/skills",name:"skills",component:Ia},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexui. npm: https://www.npmjs.com/package/@nervmor/codexui");ug(ix).use(ax).mount("#app");"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>{console.error("Service worker registration failed.",e)})});
|