import{a as vi,b as Ii,f as lo,h as ce,i as a}from"./chunk-66YHNWRR.js";var sn={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"};var ho=function(n,e){if(!n)throw fo(e)},fo=function(n){return new Error("Firebase Database ("+sn.SDK_VERSION+") INTERNAL ASSERT FAILED: "+n)};var bi=function(n){let e=[],t=0;for(let r=0;r>6|192,e[t++]=i&63|128):(i&64512)===55296&&r+1>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},po=function(n){let e=[],t=0,r=0;for(;t191&&i<224){let s=n[t++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){let s=n[t++],o=n[t++],c=n[t++],u=((i&7)<<18|(s&63)<<12|(o&63)<<6|c&63)-65536;e[r++]=String.fromCharCode(55296+(u>>10)),e[r++]=String.fromCharCode(56320+(u&1023))}else{let s=n[t++],o=n[t++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},Ti={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(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();let t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>2,d=(s&3)<<4|c>>4,p=(c&15)<<2|l>>6,m=l&63;u||(m=64,o||(p=64)),r.push(t[f],t[d],t[p],t[m])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(bi(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):po(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();let t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4;if(r.push(p),l!==64){let m=c<<4&240|l>>2;if(r.push(m),d!==64){let R=l<<6&192|d;r.push(R)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},on=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},mo=function(n){let e=bi(n);return Ti.encodeByteArray(e,!0)},Ve=function(n){return mo(n).replace(/\./g,"")},We=function(n){try{return Ti.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function Pl(n){return be(void 0,n)}function be(n,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:let t=e;return new Date(t.getTime());case Object:n===void 0&&(n={});break;case Array:n=[];break;default:return e}for(let t in e)!e.hasOwnProperty(t)||!go(t)||(n[t]=be(n[t],e[t]));return n}function go(n){return n!=="__proto__"}function cn(){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.")}var _o=()=>cn().__FIREBASE_DEFAULTS__,vo=()=>{if(typeof process>"u"||typeof process.env>"u")return;let n=process.env.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Io=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=n&&We(n[1]);return e&&JSON.parse(e)},un=()=>{try{return _o()||vo()||Io()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}};var ln=()=>{var n;return(n=un())===null||n===void 0?void 0:n.config},Ai=n=>{var e;return(e=un())===null||e===void 0?void 0:e[`_${n}`]};var mt=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}};function Rl(n,e){if(n.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');let t={alg:"none",type:"JWT"},r=e||"demo-project",i=n.iat||0,s=n.sub||n.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");let o=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},n);return[Ve(JSON.stringify(t)),Ve(JSON.stringify(o)),""].join(".")}function w(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Si(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(w())}function dn(){var n;let e=(n=un())===null||n===void 0?void 0:n.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function Pi(){return typeof window<"u"||hn()}function hn(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Ri(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function gt(){let n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function He(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function _t(){let n=w();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Ol(){return sn.NODE_CLIENT===!0||sn.NODE_ADMIN===!0}function Te(){try{return typeof indexedDB=="object"}catch{return!1}}function Oi(){return new Promise((n,e)=>{try{let t=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}var yo="FirebaseError",S=class n extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=yo,Object.setPrototypeOf(this,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,D.prototype.create)}},D=class{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){let r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?Eo(s,r):"Error",c=`${this.serviceName}: ${o} (${i}).`;return new S(i,c,r)}};function Eo(n,e){return n.replace(wo,(t,r)=>{let i=e[r];return i!=null?String(i):`<${r}?>`})}var wo=/\{\$([^}]+)}/g;function yi(n){return JSON.parse(n)}function Cl(n){return JSON.stringify(n)}var Ci=function(n){let e={},t={},r={},i="";try{let s=n.split(".");e=yi(We(s[0])||""),t=yi(We(s[1])||""),i=s[2],r=t.d||{},delete t.d}catch{}return{header:e,claims:t,data:r,signature:i}};var kl=function(n){let e=Ci(n),t=e.claims;return!!t&&typeof t=="object"&&t.hasOwnProperty("iat")},Nl=function(n){let e=Ci(n).claims;return typeof e=="object"&&e.admin===!0};function fn(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Dl(n,e){if(Object.prototype.hasOwnProperty.call(n,e))return n[e]}function ki(n){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function Ll(n,e,t){let r={};for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=e.call(t,n[i],i,n));return r}function Be(n,e){if(n===e)return!0;let t=Object.keys(n),r=Object.keys(e);for(let i of t){if(!r.includes(i))return!1;let s=n[i],o=e[i];if(Ei(s)&&Ei(o)){if(!Be(s,o))return!1}else if(s!==o)return!1}for(let i of r)if(!t.includes(i))return!1;return!0}function Ei(n){return n!==null&&typeof n=="object"}function ue(n){let e=[];for(let[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function Z(n){let e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){let[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function Ae(n){let e=n.indexOf("?");if(!e)return"";let t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}var wi=class{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=512/8,this.pad_[0]=128;for(let e=1;e>>31)&4294967295}let i=this.chain_[0],s=this.chain_[1],o=this.chain_[2],c=this.chain_[3],u=this.chain_[4],l,f;for(let d=0;d<80;d++){d<40?d<20?(l=c^s&(o^c),f=1518500249):(l=s^o^c,f=1859775393):d<60?(l=s&o|c&(s|o),f=2400959708):(l=s^o^c,f=3395469782);let p=(i<<5|i>>>27)+l+u+f+r[d]&4294967295;u=c,c=o,o=(s<<30|s>>>2)&4294967295,s=i,i=p}this.chain_[0]=this.chain_[0]+i&4294967295,this.chain_[1]=this.chain_[1]+s&4294967295,this.chain_[2]=this.chain_[2]+o&4294967295,this.chain_[3]=this.chain_[3]+c&4294967295,this.chain_[4]=this.chain_[4]+u&4294967295}update(e,t){if(e==null)return;t===void 0&&(t=e.length);let r=t-this.blockSize,i=0,s=this.buf_,o=this.inbuf_;for(;i=56;i--)this.buf_[i]=t&255,t/=256;this.compress_(this.buf_);let r=0;for(let i=0;i<5;i++)for(let s=24;s>=0;s-=8)e[r]=this.chain_[i]>>s&255,++r;return e}};function vt(n,e){let t=new an(n,e);return t.subscribe.bind(t)}var an=class{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");bo(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=rn),i.error===void 0&&(i.error=rn),i.complete===void 0&&(i.complete=rn);let s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};function bo(n,e){if(typeof n!="object"||n===null)return!1;for(let t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function rn(){}var xl=function(n,e,t,r){let i;if(rt&&(i=t===0?"none":"no more than "+t),i){let s=n+" failed: Was called with "+r+(r===1?" argument.":" arguments.")+" Expects "+i+".";throw new Error(s)}};function Ni(n,e){return`${n} failed: ${e} argument `}function Ml(n,e,t,r){if(!(r&&!t)&&typeof t!="function")throw new Error(Ni(n,e)+"must be a valid function.")}function Ul(n,e,t,r){if(!(r&&!t)&&(typeof t!="object"||t===null))throw new Error(Ni(n,e)+"must be a valid context object.")}var Fl=function(n){let e=[],t=0;for(let r=0;r=55296&&i<=56319){let s=i-55296;r++,ho(r>6|192,e[t++]=i&63|128):i<65536?(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},Vl=function(n){let e=0;for(let t=0;t=55296&&r<=56319?(e+=4,t++):e+=3}return e};var Wl=4*60*60*1e3;function g(n){return n&&n._delegate?n._delegate:n}var C=class{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};var le="[DEFAULT]";var pn=class{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let r=new mt;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{let i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;let r=this.normalizeInstanceIdentifier(e?.identifier),i=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(Ao(e))try{this.getOrInitializeService({instanceIdentifier:le})}catch{}for(let[t,r]of this.instancesDeferred.entries()){let i=this.normalizeInstanceIdentifier(t);try{let s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=le){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}delete(){return a(this,null,function*(){let e=Array.from(this.instances.values());yield Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])})}isComponentSet(){return this.component!=null}isInitialized(e=le){return this.instances.has(e)}getOptions(e=le){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.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`);let i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(let[s,o]of this.instancesDeferred.entries()){let c=this.normalizeInstanceIdentifier(s);r===c&&o.resolve(i)}return i}onInit(e,t){var r;let i=this.normalizeInstanceIdentifier(t),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);let o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){let r=this.onInitCallbacks.get(t);if(r)for(let i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:To(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=le){return this.component?this.component.multipleInstances?e:le:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function To(n){return n===le?void 0:n}function Ao(n){return n.instantiationMode==="EAGER"}var je=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new pn(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}};var kn={};lo(kn,{FirebaseError:()=>S,SDK_VERSION:()=>J,_DEFAULT_ENTRY_NAME:()=>H,_addComponent:()=>Re,_addOrOverwriteComponent:()=>Pn,_apps:()=>te,_clearComponents:()=>pa,_components:()=>Pe,_getProvider:()=>Rn,_isFirebaseApp:()=>Gi,_isFirebaseServerApp:()=>I,_registerComponent:()=>K,_removeServiceInstance:()=>fa,_serverApps:()=>Se,deleteApp:()=>bt,getApp:()=>qi,getApps:()=>_a,initializeApp:()=>wt,initializeServerApp:()=>ga,onLog:()=>On,registerVersion:()=>x,setLogLevel:()=>Cn});var mn=[],_=function(n){return n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT",n}(_||{}),Di={debug:_.DEBUG,verbose:_.VERBOSE,info:_.INFO,warn:_.WARN,error:_.ERROR,silent:_.SILENT},So=_.INFO,Po={[_.DEBUG]:"log",[_.VERBOSE]:"log",[_.INFO]:"info",[_.WARN]:"warn",[_.ERROR]:"error"},Ro=(n,e,...t)=>{if(e{e.setLogLevel(n)})}function xi(n,e){for(let t of mn){let r=null;e&&e.level&&(r=Di[e.level]),n===null?t.userLogHandler=null:t.userLogHandler=(i,s,...o)=>{let c=o.map(u=>{if(u==null)return null;if(typeof u=="string")return u;if(typeof u=="number"||typeof u=="boolean")return u.toString();if(u instanceof Error)return u.message;try{return JSON.stringify(u)}catch{return null}}).filter(u=>u).join(" ");s>=(r??i.logLevel)&&n({level:_[s].toLowerCase(),message:c,args:o,type:i.name})}}}var Oo=(n,e)=>e.some(t=>n instanceof t),Mi,Ui;function Co(){return Mi||(Mi=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ko(){return Ui||(Ui=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var Fi=new WeakMap,_n=new WeakMap,Vi=new WeakMap,gn=new WeakMap,In=new WeakMap;function No(n){let e=new Promise((t,r)=>{let i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(W(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Fi.set(t,n)}).catch(()=>{}),In.set(e,n),e}function Do(n){if(_n.has(n))return;let e=new Promise((t,r)=>{let i=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),i()},o=()=>{r(n.error||new DOMException("AbortError","AbortError")),i()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});_n.set(n,e)}var vn={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return _n.get(n);if(e==="objectStoreNames")return n.objectStoreNames||Vi.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return W(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function Wi(n){vn=n(vn)}function Lo(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){let r=n.call(It(this),e,...t);return Vi.set(r,e.sort?e.sort():[e]),W(r)}:ko().includes(n)?function(...e){return n.apply(It(this),e),W(Fi.get(this))}:function(...e){return W(n.apply(It(this),e))}}function xo(n){return typeof n=="function"?Lo(n):(n instanceof IDBTransaction&&Do(n),Oo(n,Co())?new Proxy(n,vn):n)}function W(n){if(n instanceof IDBRequest)return No(n);if(gn.has(n))return gn.get(n);let e=xo(n);return e!==n&&(gn.set(n,e),In.set(e,n)),e}var It=n=>In.get(n);function Bi(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){let o=indexedDB.open(n,e),c=W(o);return r&&o.addEventListener("upgradeneeded",u=>{r(W(o.result),u.oldVersion,u.newVersion,W(o.transaction),u)}),t&&o.addEventListener("blocked",u=>t(u.oldVersion,u.newVersion,u)),c.then(u=>{s&&u.addEventListener("close",()=>s()),i&&u.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}var Mo=["get","getKey","getAll","getAllKeys","count"],Uo=["put","add","delete","clear"],yn=new Map;function Hi(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(yn.get(e))return yn.get(e);let t=e.replace(/FromIndex$/,""),r=e!==t,i=Uo.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Mo.includes(t)))return;let s=function(o,...c){return a(this,null,function*(){let u=this.transaction(o,i?"readwrite":"readonly"),l=u.store;return r&&(l=l.index(c.shift())),(yield Promise.all([l[t](...c),i&&u.done]))[0]})};return yn.set(e,s),s}Wi(n=>Ii(vi({},n),{get:(e,t,r)=>Hi(e,t)||n.get(e,t,r),has:(e,t)=>!!Hi(e,t)||n.has(e,t)}));var wn=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(Fo(t)){let r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}};function Fo(n){let e=n.getComponent();return e?.type==="VERSION"}var yt="@firebase/app",bn="0.10.13";var q=new ee("@firebase/app"),Vo="@firebase/app-compat",Wo="@firebase/analytics-compat",Ho="@firebase/analytics",Bo="@firebase/app-check-compat",jo="@firebase/app-check",zo="@firebase/auth",$o="@firebase/auth-compat",Go="@firebase/database",qo="@firebase/data-connect",Ko="@firebase/database-compat",Jo="@firebase/functions",Yo="@firebase/functions-compat",Xo="@firebase/installations",Qo="@firebase/installations-compat",Zo="@firebase/messaging",ea="@firebase/messaging-compat",ta="@firebase/performance",na="@firebase/performance-compat",ra="@firebase/remote-config",ia="@firebase/remote-config-compat",sa="@firebase/storage",oa="@firebase/storage-compat",aa="@firebase/firestore",ca="@firebase/vertexai-preview",ua="@firebase/firestore-compat",la="firebase",da="10.14.1";var H="[DEFAULT]",ha={[yt]:"fire-core",[Vo]:"fire-core-compat",[Ho]:"fire-analytics",[Wo]:"fire-analytics-compat",[jo]:"fire-app-check",[Bo]:"fire-app-check-compat",[zo]:"fire-auth",[$o]:"fire-auth-compat",[Go]:"fire-rtdb",[qo]:"fire-data-connect",[Ko]:"fire-rtdb-compat",[Jo]:"fire-fn",[Yo]:"fire-fn-compat",[Xo]:"fire-iid",[Qo]:"fire-iid-compat",[Zo]:"fire-fcm",[ea]:"fire-fcm-compat",[ta]:"fire-perf",[na]:"fire-perf-compat",[ra]:"fire-rc",[ia]:"fire-rc-compat",[sa]:"fire-gcs",[oa]:"fire-gcs-compat",[aa]:"fire-fst",[ua]:"fire-fst-compat",[ca]:"fire-vertex","fire-js":"fire-js",[la]:"fire-js-all"};var te=new Map,Se=new Map,Pe=new Map;function Re(n,e){try{n.container.addComponent(e)}catch(t){q.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function Pn(n,e){n.container.addOrOverwriteComponent(e)}function K(n){let e=n.name;if(Pe.has(e))return q.debug(`There were multiple attempts to register component ${e}.`),!1;Pe.set(e,n);for(let t of te.values())Re(t,n);for(let t of Se.values())Re(t,n);return!0}function Rn(n,e){let t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function fa(n,e,t=H){Rn(n,e).clearInstance(t)}function Gi(n){return n.options!==void 0}function I(n){return n.settings!==void 0}function pa(){Pe.clear()}var ma={"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."},L=new D("app","Firebase",ma);var Et=class{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new C("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}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(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw L.create("app-deleted",{appName:this._name})}};var Tn=class extends Et{constructor(e,t,r,i){let s=t.automaticDataCollectionEnabled!==void 0?t.automaticDataCollectionEnabled:!1,o={name:r,automaticDataCollectionEnabled:s};if(e.apiKey!==void 0)super(e,o,i);else{let c=e;super(c.options,o,i)}this._serverConfig=Object.assign({automaticDataCollectionEnabled:s},t),this._finalizationRegistry=null,typeof FinalizationRegistry<"u"&&(this._finalizationRegistry=new FinalizationRegistry(()=>{this.automaticCleanup()})),this._refCount=0,this.incRefCount(this._serverConfig.releaseOnDeref),this._serverConfig.releaseOnDeref=void 0,t.releaseOnDeref=void 0,x(yt,bn,"serverapp")}toJSON(){}get refCount(){return this._refCount}incRefCount(e){this.isDeleted||(this._refCount++,e!==void 0&&this._finalizationRegistry!==null&&this._finalizationRegistry.register(e,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){bt(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw L.create("server-app-deleted")}};var J=da;function wt(n,e={}){let t=n;typeof e!="object"&&(e={name:e});let r=Object.assign({name:H,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw L.create("bad-app-name",{appName:String(i)});if(t||(t=ln()),!t)throw L.create("no-options");let s=te.get(i);if(s){if(Be(t,s.options)&&Be(r,s.config))return s;throw L.create("duplicate-app",{appName:i})}let o=new je(i);for(let u of Pe.values())o.addComponent(u);let c=new Et(t,r,o);return te.set(i,c),c}function ga(n,e){if(Pi()&&!hn())throw L.create("invalid-server-app-environment");e.automaticDataCollectionEnabled===void 0&&(e.automaticDataCollectionEnabled=!1);let t;Gi(n)?t=n.options:t=n;let r=Object.assign(Object.assign({},e),t);r.releaseOnDeref!==void 0&&delete r.releaseOnDeref;let i=l=>[...l].reduce((f,d)=>Math.imul(31,f)+d.charCodeAt(0)|0,0);if(e.releaseOnDeref!==void 0&&typeof FinalizationRegistry>"u")throw L.create("finalization-registry-not-supported",{});let s=""+i(JSON.stringify(r)),o=Se.get(s);if(o)return o.incRefCount(e.releaseOnDeref),o;let c=new je(s);for(let l of Pe.values())c.addComponent(l);let u=new Tn(t,e,s,c);return Se.set(s,u),u}function qi(n=H){let e=te.get(n);if(!e&&n===H&&ln())return wt();if(!e)throw L.create("no-app",{appName:n});return e}function _a(){return Array.from(te.values())}function bt(n){return a(this,null,function*(){let e=!1,t=n.name;te.has(t)?(e=!0,te.delete(t)):Se.has(t)&&n.decRefCount()<=0&&(Se.delete(t),e=!0),e&&(yield Promise.all(n.container.getProviders().map(r=>r.delete())),n.isDeleted=!0)})}function x(n,e,t){var r;let i=(r=ha[n])!==null&&r!==void 0?r:n;t&&(i+=`-${t}`);let s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){let c=[`Unable to register library "${i}" with version "${e}":`];s&&c.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&c.push("and"),o&&c.push(`version name "${e}" contains illegal characters (whitespace or "/")`),q.warn(c.join(" "));return}K(new C(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}function On(n,e){if(n!==null&&typeof n!="function")throw L.create("invalid-log-argument");xi(n,e)}function Cn(n){Li(n)}var va="firebase-heartbeat-database",Ia=1,ze="firebase-heartbeat-store",En=null;function Ki(){return En||(En=Bi(va,Ia,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(ze)}catch(t){console.warn(t)}}}}).catch(n=>{throw L.create("idb-open",{originalErrorMessage:n.message})})),En}function ya(n){return a(this,null,function*(){try{let t=(yield Ki()).transaction(ze),r=yield t.objectStore(ze).get(Ji(n));return yield t.done,r}catch(e){if(e instanceof S)q.warn(e.message);else{let t=L.create("idb-get",{originalErrorMessage:e?.message});q.warn(t.message)}}})}function ji(n,e){return a(this,null,function*(){try{let r=(yield Ki()).transaction(ze,"readwrite");yield r.objectStore(ze).put(e,Ji(n)),yield r.done}catch(t){if(t instanceof S)q.warn(t.message);else{let r=L.create("idb-set",{originalErrorMessage:t?.message});q.warn(r.message)}}})}function Ji(n){return`${n.name}!${n.options.appId}`}var Ea=1024,wa=30*24*60*60*1e3,An=class{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new Sn(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}triggerHeartbeat(){return a(this,null,function*(){var e,t;try{let i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=zi();return((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=yield this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s)?void 0:(this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{let c=new Date(o.date).valueOf();return Date.now()-c<=wa}),this._storage.overwrite(this._heartbeatsCache))}catch(r){q.warn(r)}})}getHeartbeatsHeader(){return a(this,null,function*(){var e;try{if(this._heartbeatsCache===null&&(yield this._heartbeatsCachePromise),((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";let t=zi(),{heartbeatsToSend:r,unsentEntries:i}=ba(this._heartbeatsCache.heartbeats),s=Ve(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,i.length>0?(this._heartbeatsCache.heartbeats=i,yield this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(t){return q.warn(t),""}})}};function zi(){return new Date().toISOString().substring(0,10)}function ba(n,e=Ea){let t=[],r=n.slice();for(let i of n){let s=t.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),$i(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),$i(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}var Sn=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}runIndexedDBEnvironmentCheck(){return a(this,null,function*(){return Te()?Oi().then(()=>!0).catch(()=>!1):!1})}read(){return a(this,null,function*(){if(yield this._canUseIndexedDBPromise){let t=yield ya(this.app);return t?.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}})}overwrite(e){return a(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let i=yield this.read();return ji(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return})}add(e){return a(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let i=yield this.read();return ji(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return})}};function $i(n){return Ve(JSON.stringify({version:2,heartbeats:n})).length}function Ta(n){K(new C("platform-logger",e=>new wn(e),"PRIVATE")),K(new C("heartbeat",e=>new An(e),"PRIVATE")),x(yt,bn,n),x(yt,bn,"esm2017"),x("fire-js","")}Ta("");var Nn=class{constructor(e,t){this._delegate=e,this.firebase=t,Re(e,new C("app-compat",()=>this,"PUBLIC")),this.container=e.container}get automaticDataCollectionEnabled(){return this._delegate.automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this._delegate.automaticDataCollectionEnabled=e}get name(){return this._delegate.name}get options(){return this._delegate.options}delete(){return new Promise(e=>{this._delegate.checkDestroyed(),e()}).then(()=>(this.firebase.INTERNAL.removeApp(this.name),bt(this._delegate)))}_getService(e,t=H){var r;this._delegate.checkDestroyed();let i=this._delegate.container.getProvider(e);return!i.isInitialized()&&((r=i.getComponent())===null||r===void 0?void 0:r.instantiationMode)==="EXPLICIT"&&i.initialize(),i.getImmediate({identifier:t})}_removeServiceInstance(e,t=H){this._delegate.container.getProvider(e).clearInstance(t)}_addComponent(e){Re(this._delegate,e)}_addOrOverwriteComponent(e){Pn(this._delegate,e)}toJSON(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}}};var Aa={"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance."},Yi=new D("app-compat","Firebase",Aa);function Sa(n){let e={},t={__esModule:!0,initializeApp:s,app:i,registerVersion:x,setLogLevel:Cn,onLog:On,apps:null,SDK_VERSION:J,INTERNAL:{registerComponent:c,removeApp:r,useAsService:u,modularAPIs:kn}};t.default=t,Object.defineProperty(t,"apps",{get:o});function r(l){delete e[l]}function i(l){if(l=l||H,!fn(e,l))throw Yi.create("no-app",{appName:l});return e[l]}i.App=n;function s(l,f={}){let d=wt(l,f);if(fn(e,d.name))return e[d.name];let p=new n(d,t);return e[d.name]=p,p}function o(){return Object.keys(e).map(l=>e[l])}function c(l){let f=l.name,d=f.replace("-compat","");if(K(l)&&l.type==="PUBLIC"){let p=(m=i())=>{if(typeof m[d]!="function")throw Yi.create("invalid-app-argument",{appName:f});return m[d]()};l.serviceProps!==void 0&&be(p,l.serviceProps),t[d]=p,n.prototype[d]=function(...m){return this._getService.bind(this,f).apply(this,l.multipleInstances?m:[])}}return l.type==="PUBLIC"?t[d]:null}function u(l,f){return f==="serverAuth"?null:f}return t}function Qi(){let n=Sa(Nn);n.INTERNAL=Object.assign(Object.assign({},n.INTERNAL),{createFirebaseNamespace:Qi,extendNamespace:e,createSubscribe:vt,ErrorFactory:D,deepExtend:be});function e(t){be(n,t)}return n}var Pa=Qi();var Xi=new ee("@firebase/app-compat"),Ra="@firebase/app-compat",Oa="0.2.43";function Ca(n){x(Ra,Oa,n)}try{let n=cn();if(n.firebase!==void 0){Xi.warn(` Warning: Firebase is already defined in the global scope. Please make sure Firebase library is only loaded once. `);let e=n.firebase.SDK_VERSION;e&&e.indexOf("LITE")>=0&&Xi.warn(` Warning: You are trying to load Firebase while using Firebase Performance standalone script. You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code. `)}}catch{}var Tt=Pa;Ca();function At(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function ud(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function ld(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function c(f){try{l(r.next(f))}catch(d){o(d)}}function u(f){try{l(r.throw(f))}catch(d){o(d)}}function l(f){f.done?s(f.value):i(f.value).then(c,u)}l((r=r.apply(n,e||[])).next())})}function Zi(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Dn(n){return this instanceof Dn?(this.v=n,this):new Dn(n)}function dd(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(m){return function(R){return Promise.resolve(R).then(m,d)}}function c(m,R){r[m]&&(i[m]=function(ae){return new Promise(function(Fe,pt){s.push([m,ae,Fe,pt])>1||u(m,ae)})},R&&(i[m]=R(i[m])))}function u(m,R){try{l(r[m](R))}catch(ae){p(s[0][3],ae)}}function l(m){m.value instanceof Dn?Promise.resolve(m.value.v).then(f,d):p(s[0][2],m)}function f(m){u("next",m)}function d(m){u("throw",m)}function p(m,R){m(R),s.shift(),s.length&&u(s[0][0],s[0][1])}}function hd(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof Zi=="function"?Zi(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(o){return new Promise(function(c,u){o=n[s](o),i(c,u,o.done,o.value)})}}function i(s,o,c,u){Promise.resolve(u).then(function(l){s({value:l,done:c})},o)}}var ge={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"};var oe={EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"};function ka(){return{"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","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.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","emulator-config-failed":'Auth instance has already been used to make a network call. Auth can no longer be configured to use the emulator. Try calling "connectAuthEmulator()" sooner.',"expired-action-code":"The action code has expired.","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal AuthError has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registered for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is incorrect, malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-password":"A non-empty password must be provided","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance.","missing-recaptcha-token":"The reCAPTCHA token is missing when sending request to the backend.","invalid-recaptcha-token":"The reCAPTCHA token is invalid when sending request to the backend.","invalid-recaptcha-action":"The reCAPTCHA action is invalid when sending request to the backend.","recaptcha-not-enabled":"reCAPTCHA Enterprise integration is not enabled for this project.","missing-client-type":"The reCAPTCHA client type is missing when sending request to the backend.","missing-recaptcha-version":"The reCAPTCHA version is missing when sending request to the backend.","invalid-req-type":"Invalid request parameters.","invalid-recaptcha-version":"The reCAPTCHA version is invalid when sending request to the backend.","unsupported-password-policy-schema-version":"The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.","password-does-not-meet-requirements":"The password does not meet the requirements."}}function ms(){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."}}var lr=ka,gs=ms,_s=new D("auth","Firebase",ms());var Ot=new ee("@firebase/auth");function Na(n,...e){Ot.logLevel<=_.WARN&&Ot.warn(`Auth (${J}): ${n}`,...e)}function Pt(n,...e){Ot.logLevel<=_.ERROR&&Ot.error(`Auth (${J}): ${n}`,...e)}function A(n,...e){throw hr(n,...e)}function T(n,...e){return hr(n,...e)}function dr(n,e,t){let r=Object.assign(Object.assign({},gs()),{[e]:t});return new D("auth","Firebase",r).create(e,{appName:n.name})}function P(n){return dr(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function ke(n,e,t){let r=t;if(!(e instanceof r))throw r.name!==e.constructor.name&&A(n,"argument-error"),dr(n,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function hr(n,...e){if(typeof n!="string"){let t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return _s.create(n,...e)}function h(n,e,...t){if(!n)throw hr(e,...t)}function B(n){let e="INTERNAL ASSERTION FAILED: "+n;throw Pt(e),new Error(e)}function M(n,e){n||B(e)}function Je(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function fr(){return es()==="http:"||es()==="https:"}function es(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}function Da(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(fr()||gt()||"connection"in navigator)?navigator.onLine:!0}function La(){if(typeof navigator>"u")return null;let n=navigator;return n.languages&&n.languages[0]||n.language||null}var de=class{constructor(e,t){this.shortDelay=e,this.longDelay=t,M(t>e,"Short delay should be less than long delay!"),this.isMobile=Si()||He()}get(){return Da()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}};function pr(n,e){M(n.emulator,"Emulator should always be set here");let{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}var Ye=class{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),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;B("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;B("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;B("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}};var xa={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"};var Ma=new de(3e4,6e4);function y(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}function E(s,o,c,u){return a(this,arguments,function*(n,e,t,r,i={}){return vs(n,i,()=>a(this,null,function*(){let l={},f={};r&&(e==="GET"?f=r:l={body:JSON.stringify(r)});let d=ue(Object.assign({key:n.config.apiKey},f)).slice(1),p=yield n._getAdditionalHeaders();p["Content-Type"]="application/json",n.languageCode&&(p["X-Firebase-Locale"]=n.languageCode);let m=Object.assign({method:e,headers:p},l);return Ri()||(m.referrerPolicy="no-referrer"),Ye.fetch()(Is(n,n.config.apiHost,t,d),m)}))})}function vs(n,e,t){return a(this,null,function*(){n._canInitEmulator=!1;let r=Object.assign(Object.assign({},xa),e);try{let i=new Fn(n),s=yield Promise.race([t(),i.promise]);i.clearNetworkTimeout();let o=yield s.json();if("needConfirmation"in o)throw $e(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{let c=s.ok?o.errorMessage:o.error.message,[u,l]=c.split(" : ");if(u==="FEDERATED_USER_ID_ALREADY_LINKED")throw $e(n,"credential-already-in-use",o);if(u==="EMAIL_EXISTS")throw $e(n,"email-already-in-use",o);if(u==="USER_DISABLED")throw $e(n,"user-disabled",o);let f=r[u]||u.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw dr(n,f,l);A(n,f)}}catch(i){if(i instanceof S)throw i;A(n,"network-request-failed",{message:String(i)})}})}function Q(s,o,c,u){return a(this,arguments,function*(n,e,t,r,i={}){let l=yield E(n,e,t,r,i);return"mfaPendingCredential"in l&&A(n,"multi-factor-auth-required",{_serverResponse:l}),l})}function Is(n,e,t,r){let i=`${e}${t}?${r}`;return n.config.emulator?pr(n.config,i):`${n.config.apiScheme}://${i}`}function Ua(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}var Fn=class{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(T(this.auth,"network-request-failed")),Ma.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}};function $e(n,e,t){let r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);let i=T(n,e,r);return i.customData._tokenResponse=t,i}function ts(n){return n!==void 0&&n.getResponse!==void 0}function ns(n){return n!==void 0&&n.enterprise!==void 0}var Vn=class{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(let t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return Ua(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}};function Fa(n){return a(this,null,function*(){return(yield E(n,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""})}function Va(n,e){return a(this,null,function*(){return E(n,"GET","/v2/recaptchaConfig",y(n,e))})}function Wa(n,e){return a(this,null,function*(){return E(n,"POST","/v1/accounts:delete",e)})}function Ha(n,e){return a(this,null,function*(){return E(n,"POST","/v1/accounts:update",e)})}function ys(n,e){return a(this,null,function*(){return E(n,"POST","/v1/accounts:lookup",e)})}function Ge(n){if(n)try{let e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}function Es(n,e=!1){return a(this,null,function*(){let t=g(n),r=yield t.getIdToken(e),i=Wt(r);h(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");let s=typeof i.firebase=="object"?i.firebase:void 0,o=s?.sign_in_provider;return{claims:i,token:r,authTime:Ge(Ln(i.auth_time)),issuedAtTime:Ge(Ln(i.iat)),expirationTime:Ge(Ln(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}})}function Ln(n){return Number(n)*1e3}function Wt(n){let[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return Pt("JWT malformed, contained fewer than 3 sections"),null;try{let i=We(t);return i?JSON.parse(i):(Pt("Failed to decode base64 JWT payload"),null)}catch(i){return Pt("Caught error parsing JWT payload as JSON",i?.toString()),null}}function rs(n){let e=Wt(n);return h(e,"internal-error"),h(typeof e.exp<"u","internal-error"),h(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}function X(n,e,t=!1){return a(this,null,function*(){if(t)return e;try{return yield e}catch(r){throw r instanceof S&&Ba(r)&&n.auth.currentUser===n&&(yield n.auth.signOut()),r}})}function Ba({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}var Wn=class{constructor(e){this.user=e,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(e){var t;if(e){let r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;let i=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;let t=this.getInterval(e);this.timerId=setTimeout(()=>a(this,null,function*(){yield this.iteration()}),t)}iteration(){return a(this,null,function*(){try{yield this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()})}};var Xe=class{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=Ge(this.lastLoginAt),this.creationTime=Ge(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}};function Qe(n){return a(this,null,function*(){var e;let t=n.auth,r=yield n.getIdToken(),i=yield X(n,ys(t,{idToken:r}));h(i?.users.length,t,"internal-error");let s=i.users[0];n._notifyReloadListener(s);let o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?bs(s.providerUserInfo):[],c=ja(n.providerData,o),u=n.isAnonymous,l=!(n.email&&s.passwordHash)&&!c?.length,f=u?l:!1,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:c,metadata:new Xe(s.createdAt,s.lastLoginAt),isAnonymous:f};Object.assign(n,d)})}function ws(n){return a(this,null,function*(){let e=g(n);yield Qe(e),yield e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)})}function ja(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function bs(n){return n.map(e=>{var{providerId:t}=e,r=At(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}function za(n,e){return a(this,null,function*(){let t=yield vs(n,{},()=>a(this,null,function*(){let r=ue({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=Is(n,i,"/v1/token",`key=${s}`),c=yield n._getAdditionalHeaders();return c["Content-Type"]="application/x-www-form-urlencoded",Ye.fetch()(o,{method:"POST",headers:c,body:r})}));return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}})}function $a(n,e){return a(this,null,function*(){return E(n,"POST","/v2/accounts:revokeToken",y(n,e))})}var qe=class n{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){h(e.idToken,"internal-error"),h(typeof e.idToken<"u","internal-error"),h(typeof e.refreshToken<"u","internal-error");let t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):rs(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){h(e.length!==0,"internal-error");let t=rs(e);this.updateTokensAndExpiration(e,null,t)}getToken(e,t=!1){return a(this,null,function*(){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(h(this.refreshToken,e,"user-token-expired"),this.refreshToken?(yield this.refresh(e,this.refreshToken),this.accessToken):null)})}clearRefreshToken(){this.refreshToken=null}refresh(e,t){return a(this,null,function*(){let{accessToken:r,refreshToken:i,expiresIn:s}=yield za(e,t);this.updateTokensAndExpiration(r,i,Number(s))})}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){let{refreshToken:r,accessToken:i,expirationTime:s}=t,o=new n;return r&&(h(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(h(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(h(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new n,this.toJSON())}_performRefresh(){return B("not implemented")}};function ne(n,e){h(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}var he=class n{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=At(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Wn(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.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 Xe(s.createdAt||void 0,s.lastLoginAt||void 0)}getIdToken(e){return a(this,null,function*(){let t=yield X(this,this.stsTokenManager.getToken(this.auth,e));return h(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,yield this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t})}getIdTokenResult(e){return Es(this,e)}reload(){return ws(this)}_assign(e){this!==e&&(h(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let t=new n(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){h(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}_updateTokensIfNecessary(e,t=!1){return a(this,null,function*(){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&(yield Qe(this)),yield this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)})}delete(){return a(this,null,function*(){if(I(this.auth.app))return Promise.reject(P(this.auth));let e=yield this.getIdToken();return yield X(this,Wa(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()})}toJSON(){return Object.assign(Object.assign({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(e=>Object.assign({},e)),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(e,t){var r,i,s,o,c,u,l,f;let d=(r=t.displayName)!==null&&r!==void 0?r:void 0,p=(i=t.email)!==null&&i!==void 0?i:void 0,m=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,R=(o=t.photoURL)!==null&&o!==void 0?o:void 0,ae=(c=t.tenantId)!==null&&c!==void 0?c:void 0,Fe=(u=t._redirectEventId)!==null&&u!==void 0?u:void 0,pt=(l=t.createdAt)!==null&&l!==void 0?l:void 0,pi=(f=t.lastLoginAt)!==null&&f!==void 0?f:void 0,{uid:en,emailVerified:mi,isAnonymous:gi,providerData:tn,stsTokenManager:_i}=t;h(en&&_i,e,"internal-error");let co=qe.fromJSON(this.name,_i);h(typeof en=="string",e,"internal-error"),ne(d,e.name),ne(p,e.name),h(typeof mi=="boolean",e,"internal-error"),h(typeof gi=="boolean",e,"internal-error"),ne(m,e.name),ne(R,e.name),ne(ae,e.name),ne(Fe,e.name),ne(pt,e.name),ne(pi,e.name);let nn=new n({uid:en,auth:e,email:p,emailVerified:mi,displayName:d,isAnonymous:gi,photoURL:R,phoneNumber:m,tenantId:ae,stsTokenManager:co,createdAt:pt,lastLoginAt:pi});return tn&&Array.isArray(tn)&&(nn.providerData=tn.map(uo=>Object.assign({},uo))),Fe&&(nn._redirectEventId=Fe),nn}static _fromIdTokenResponse(e,t,r=!1){return a(this,null,function*(){let i=new qe;i.updateFromServerResponse(t);let s=new n({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return yield Qe(s),s})}static _fromGetAccountInfoResponse(e,t,r){return a(this,null,function*(){let i=t.users[0];h(i.localId!==void 0,"internal-error");let s=i.providerUserInfo!==void 0?bs(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!s?.length,c=new qe;c.updateFromIdToken(r);let u=new n({uid:i.localId,auth:e,stsTokenManager:c,isAnonymous:o}),l={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new Xe(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!s?.length};return Object.assign(u,l),u})}};var is=new Map;function O(n){M(n instanceof Function,"Expected a class definition");let e=is.get(n);return e?(M(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,is.set(n,e),e)}var Ga=(()=>{class n{constructor(){this.type="NONE",this.storage={}}_isAvailable(){return a(this,null,function*(){return!0})}_set(t,r){return a(this,null,function*(){this.storage[t]=r})}_get(t){return a(this,null,function*(){let r=this.storage[t];return r===void 0?null:r})}_remove(t){return a(this,null,function*(){delete this.storage[t]})}_addListener(t,r){}_removeListener(t,r){}}return n.type="NONE",n})(),ie=Ga;function j(n,e,t){return`firebase:${n}:${e}:${t}`}var Ct=class n{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;let{config:i,name:s}=this.auth;this.fullUserKey=j(this.userKey,i.apiKey,s),this.fullPersistenceKey=j("persistence",i.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}getCurrentUser(){return a(this,null,function*(){let e=yield this.persistence._get(this.fullUserKey);return e?he._fromJSON(this.auth,e):null})}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}setPersistence(e){return a(this,null,function*(){if(this.persistence===e)return;let t=yield this.getCurrentUser();if(yield this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)})}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static create(e,t,r="authUser"){return a(this,null,function*(){if(!t.length)return new n(O(ie),e,r);let i=(yield Promise.all(t.map(l=>a(this,null,function*(){if(yield l._isAvailable())return l})))).filter(l=>l),s=i[0]||O(ie),o=j(r,e.config.apiKey,e.name),c=null;for(let l of t)try{let f=yield l._get(o);if(f){let d=he._fromJSON(e,f);l!==s&&(c=d),s=l;break}}catch{}let u=i.filter(l=>l._shouldAllowMigration);return!s._shouldAllowMigration||!u.length?new n(s,e,r):(s=u[0],c&&(yield s._set(o,c.toJSON())),yield Promise.all(t.map(l=>a(this,null,function*(){if(l!==s)try{yield l._remove(o)}catch{}}))),new n(s,e,r))})}};function ss(n){let e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Ps(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Ts(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Rs(e))return"Blackberry";if(Os(e))return"Webos";if(As(e))return"Safari";if((e.includes("chrome/")||Ss(e))&&!e.includes("edge/"))return"Chrome";if(Ne(e))return"Android";{let t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=n.match(t);if(r?.length===2)return r[1]}return"Other"}function Ts(n=w()){return/firefox\//i.test(n)}function As(n=w()){let e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Ss(n=w()){return/crios\//i.test(n)}function Ps(n=w()){return/iemobile/i.test(n)}function Ne(n=w()){return/android/i.test(n)}function Rs(n=w()){return/blackberry/i.test(n)}function Os(n=w()){return/webos/i.test(n)}function De(n=w()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function Cs(n=w()){return/(iPad|iPhone|iPod).*OS 7_\d/i.test(n)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(n)}function qa(n=w()){var e;return De(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function Ka(){return _t()&&document.documentMode===10}function ks(n=w()){return De(n)||Ne(n)||Os(n)||Rs(n)||/windows phone/i.test(n)||Ps(n)}function mr(n,e=[]){let t;switch(n){case"Browser":t=ss(w());break;case"Worker":t=`${ss(w())}-${n}`;break;default:t=n}let r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${J}/${r}`}var Hn=class{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let r=s=>new Promise((o,c)=>{try{let u=e(s);o(u)}catch(u){c(u)}});r.onAbort=t,this.queue.push(r);let i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}runMiddleware(e){return a(this,null,function*(){if(this.auth.currentUser===e)return;let t=[];try{for(let r of this.queue)yield r(e),r.onAbort&&t.push(r.onAbort)}catch(r){t.reverse();for(let i of t)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}})}};function Ja(t){return a(this,arguments,function*(n,e={}){return E(n,"GET","/v2/passwordPolicy",y(n,e))})}var Ya=6,Bn=class{constructor(e){var t,r,i,s;let o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(t=o.minPasswordLength)!==null&&t!==void 0?t:Ya,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),o.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),o.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),o.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),o.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(s=e.forceUpgradeOnSignin)!==null&&s!==void 0?s:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,r,i,s,o,c;let u={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,u),this.validatePasswordCharacterOptions(e,u),u.isValid&&(u.isValid=(t=u.meetsMinPasswordLength)!==null&&t!==void 0?t:!0),u.isValid&&(u.isValid=(r=u.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),u.isValid&&(u.isValid=(i=u.containsLowercaseLetter)!==null&&i!==void 0?i:!0),u.isValid&&(u.isValid=(s=u.containsUppercaseLetter)!==null&&s!==void 0?s:!0),u.isValid&&(u.isValid=(o=u.containsNumericCharacter)!==null&&o!==void 0?o:!0),u.isValid&&(u.isValid=(c=u.containsNonAlphanumericCharacter)!==null&&c!==void 0?c:!0),u}validatePasswordLengthOptions(e,t){let r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let r;for(let i=0;i="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}};var kt=class{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Nt(this),this.idTokenSubscription=new Nt(this),this.beforeStateQueue=new Hn(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=_s,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=O(t)),this._initializationPromise=this.queue(()=>a(this,null,function*(){var r,i;if(!this._deleted&&(this.persistenceManager=yield Ct.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{yield this._popupRedirectResolver._initialize(this)}catch{}yield this.initializeCurrentUser(t),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}})),this._initializationPromise}_onStorageEvent(){return a(this,null,function*(){if(this._deleted)return;let e=yield this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),yield this.currentUser.getIdToken();return}yield this._updateCurrentUser(e,!0)}})}initializeCurrentUserFromIdToken(e){return a(this,null,function*(){try{let t=yield ys(this,{idToken:e}),r=yield he._fromGetAccountInfoResponse(this,t,e);yield this.directlySetCurrentUser(r)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),yield this.directlySetCurrentUser(null)}})}initializeCurrentUser(e){return a(this,null,function*(){var t;if(I(this.app)){let o=this.app.settings.authIdToken;return o?new Promise(c=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(c,c))}):this.directlySetCurrentUser(null)}let r=yield this.assertedPersistence.getCurrentUser(),i=r,s=!1;if(e&&this.config.authDomain){yield this.getOrInitRedirectPersistenceManager();let o=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,c=i?._redirectEventId,u=yield this.tryRedirectSignIn(e);(!o||o===c)&&u?.user&&(i=u.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{yield this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return h(this._popupRedirectResolver,this,"argument-error"),yield this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)})}tryRedirectSignIn(e){return a(this,null,function*(){let t=null;try{t=yield this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{yield this._setRedirectUser(null)}return t})}reloadAndSetCurrentUserOrClear(e){return a(this,null,function*(){try{yield Qe(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)})}useDeviceLanguage(){this.languageCode=La()}_delete(){return a(this,null,function*(){this._deleted=!0})}updateCurrentUser(e){return a(this,null,function*(){if(I(this.app))return Promise.reject(P(this));let t=e?g(e):null;return t&&h(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))})}_updateCurrentUser(e,t=!1){return a(this,null,function*(){if(!this._deleted)return e&&h(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||(yield this.beforeStateQueue.runMiddleware(e)),this.queue(()=>a(this,null,function*(){yield this.directlySetCurrentUser(e),this.notifyAuthListeners()}))})}signOut(){return a(this,null,function*(){return I(this.app)?Promise.reject(P(this)):(yield this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&(yield this._setRedirectUser(null)),this._updateCurrentUser(null,!0))})}setPersistence(e){return I(this.app)?Promise.reject(P(this)):this.queue(()=>a(this,null,function*(){yield this.assertedPersistence.setPersistence(O(e))}))}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}validatePassword(e){return a(this,null,function*(){this._getPasswordPolicyInternal()||(yield this._updatePasswordPolicy());let t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)})}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}_updatePasswordPolicy(){return a(this,null,function*(){let e=yield Ja(this),t=new Bn(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t})}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new D("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{let r=this.onAuthStateChanged(()=>{r(),e()},t)}})}revokeAccessToken(e){return a(this,null,function*(){if(this.currentUser){let t=yield this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(r.tenantId=this.tenantId),yield $a(this,r)}})}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}_setRedirectUser(e,t){return a(this,null,function*(){let r=yield this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)})}getOrInitRedirectPersistenceManager(e){return a(this,null,function*(){if(!this.redirectPersistenceManager){let t=e&&O(e)||this._popupRedirectResolver;h(t,this,"argument-error"),this.redirectPersistenceManager=yield Ct.create(this,[O(t._redirectPersistence)],"redirectUser"),this.redirectUser=yield this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager})}_redirectUserForId(e){return a(this,null,function*(){var t,r;return this._isInitialized&&(yield this.queue(()=>a(this,null,function*(){}))),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null})}_persistUserIfCurrent(e){return a(this,null,function*(){if(e===this.currentUser)return this.queue(()=>a(this,null,function*(){return this.directlySetCurrentUser(e)}))})}_notifyListenersIfCurrent(e){e===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 e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let r=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};let s=typeof t=="function"?t:t.next.bind(t),o=!1,c=this._isInitialized?Promise.resolve():this._initializationPromise;if(h(c,this,"internal-error"),c.then(()=>{o||s(this.currentUser)}),typeof t=="function"){let u=e.addObserver(t,r,i);return()=>{o=!0,u()}}else{let u=e.addObserver(t);return()=>{o=!0,u()}}}directlySetCurrentUser(e){return a(this,null,function*(){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?yield this.assertedPersistence.setCurrentUser(e):yield this.assertedPersistence.removeCurrentUser()})}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return h(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=mr(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}_getAdditionalHeaders(){return a(this,null,function*(){var e;let t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);let r=yield(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader();r&&(t["X-Firebase-Client"]=r);let i=yield this._getAppCheckToken();return i&&(t["X-Firebase-AppCheck"]=i),t})}_getAppCheckToken(){return a(this,null,function*(){var e;let t=yield(e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken();return t?.error&&Na(`Error while retrieving App Check token: ${t.error}`),t?.token})}};function v(n){return g(n)}var Nt=class{constructor(e){this.auth=e,this.observer=null,this.addObserver=vt(t=>this.observer=t)}get next(){return h(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}};var ct={loadJS(){return a(this,null,function*(){throw new Error("Unable to load external scripts")})},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Xa(n){ct=n}function gr(n){return ct.loadJS(n)}function Qa(){return ct.recaptchaV2Script}function Za(){return ct.recaptchaEnterpriseScript}function ec(){return ct.gapiScript}function Ns(n){return`__${n}${Math.floor(Math.random()*1e6)}`}var tc="recaptcha-enterprise",nc="NO_RECAPTCHA",jn=class{constructor(e){this.type=tc,this.auth=v(e)}verify(e="verify",t=!1){return a(this,null,function*(){function r(s){return a(this,null,function*(){if(!t){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise((o,c)=>a(this,null,function*(){Va(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(u=>{if(u.recaptchaKey===void 0)c(new Error("recaptcha Enterprise site key undefined"));else{let l=new Vn(u);return s.tenantId==null?s._agentRecaptchaConfig=l:s._tenantRecaptchaConfigs[s.tenantId]=l,o(l.siteKey)}}).catch(u=>{c(u)})}))})}function i(s,o,c){let u=window.grecaptcha;ns(u)?u.enterprise.ready(()=>{u.enterprise.execute(s,{action:e}).then(l=>{o(l)}).catch(()=>{o(nc)})}):c(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((s,o)=>{r(this.auth).then(c=>{if(!t&&ns(window.grecaptcha))i(c,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let u=Za();u.length!==0&&(u+=c),gr(u).then(()=>{i(c,s,o)}).catch(l=>{o(l)})}}).catch(c=>{o(c)})})})}};function os(n,e,t,r=!1){return a(this,null,function*(){let i=new jn(n),s;try{s=yield i.verify(t)}catch{s=yield i.verify(t,!0)}let o=Object.assign({},e);return r?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o})}function Ze(n,e,t,r){return a(this,null,function*(){var i;if(!((i=n._getRecaptchaConfig())===null||i===void 0)&&i.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){let s=yield os(n,e,t,t==="getOobCode");return r(n,s)}else return r(n,e).catch(s=>a(this,null,function*(){if(s.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);let o=yield os(n,e,t,t==="getOobCode");return r(n,o)}else return Promise.reject(s)}))})}function rc(n,e){let t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(O);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}function _r(n,e,t){let r=v(n);h(r._canInitEmulator,r,"emulator-config-failed"),h(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");let i=!!t?.disableWarnings,s=Ds(e),{host:o,port:c}=ic(e),u=c===null?"":`:${c}`;r.config.emulator={url:`${s}//${o}${u}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:c,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||sc()}function Ds(n){let e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function ic(n){let e=Ds(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};let r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){let s=i[1];return{host:s,port:as(r.substr(s.length+1))}}else{let[s,o]=r.split(":");return{host:s,port:as(o)}}}function as(n){if(!n)return null;let e=Number(n);return isNaN(e)?null:e}function sc(){function n(){let e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}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",n):n())}var z=class{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return B("not implemented")}_getIdTokenResponse(e){return B("not implemented")}_linkToIdToken(e,t){return B("not implemented")}_getReauthenticationResolver(e){return B("not implemented")}};function Ls(n,e){return a(this,null,function*(){return E(n,"POST","/v1/accounts:resetPassword",y(n,e))})}function oc(n,e){return a(this,null,function*(){return E(n,"POST","/v1/accounts:update",e)})}function ac(n,e){return a(this,null,function*(){return E(n,"POST","/v1/accounts:signUp",e)})}function cc(n,e){return a(this,null,function*(){return E(n,"POST","/v1/accounts:update",y(n,e))})}function uc(n,e){return a(this,null,function*(){return Q(n,"POST","/v1/accounts:signInWithPassword",y(n,e))})}function Ht(n,e){return a(this,null,function*(){return E(n,"POST","/v1/accounts:sendOobCode",y(n,e))})}function lc(n,e){return a(this,null,function*(){return Ht(n,e)})}function dc(n,e){return a(this,null,function*(){return Ht(n,e)})}function hc(n,e){return a(this,null,function*(){return Ht(n,e)})}function fc(n,e){return a(this,null,function*(){return Ht(n,e)})}function pc(n,e){return a(this,null,function*(){return Q(n,"POST","/v1/accounts:signInWithEmailLink",y(n,e))})}function mc(n,e){return a(this,null,function*(){return Q(n,"POST","/v1/accounts:signInWithEmailLink",y(n,e))})}var et=class n extends z{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new n(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new n(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}_getIdTokenResponse(e){return a(this,null,function*(){switch(this.signInMethod){case"password":let t={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Ze(e,t,"signInWithPassword",uc);case"emailLink":return pc(e,{email:this._email,oobCode:this._password});default:A(e,"internal-error")}})}_linkToIdToken(e,t){return a(this,null,function*(){switch(this.signInMethod){case"password":let r={idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Ze(e,r,"signUpPassword",ac);case"emailLink":return mc(e,{idToken:t,email:this._email,oobCode:this._password});default:A(e,"internal-error")}})}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}};function Y(n,e){return a(this,null,function*(){return Q(n,"POST","/v1/accounts:signInWithIdp",y(n,e))})}var gc="http://localhost",U=class n extends z{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let t=new n(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):A("argument-error"),t}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(e){let t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,s=At(t,["providerId","signInMethod"]);if(!r||!i)return null;let o=new n(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){let t=this.buildRequest();return Y(e,t)}_linkToIdToken(e,t){let r=this.buildRequest();return r.idToken=t,Y(e,r)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,Y(e,t)}buildRequest(){let e={requestUri:gc,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=ue(t)}return e}};function _c(n,e){return a(this,null,function*(){return E(n,"POST","/v1/accounts:sendVerificationCode",y(n,e))})}function vc(n,e){return a(this,null,function*(){return Q(n,"POST","/v1/accounts:signInWithPhoneNumber",y(n,e))})}function Ic(n,e){return a(this,null,function*(){let t=yield Q(n,"POST","/v1/accounts:signInWithPhoneNumber",y(n,e));if(t.temporaryProof)throw $e(n,"account-exists-with-different-credential",t);return t})}var yc={USER_NOT_FOUND:"user-not-found"};function Ec(n,e){return a(this,null,function*(){let t=Object.assign(Object.assign({},e),{operation:"REAUTH"});return Q(n,"POST","/v1/accounts:signInWithPhoneNumber",y(n,t),yc)})}var Oe=class n extends z{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new n({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new n({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return vc(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return Ic(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return Ec(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:t,verificationId:r,verificationCode:i}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:r,code:i}}toJSON(){let e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){typeof e=="string"&&(e=JSON.parse(e));let{verificationId:t,verificationCode:r,phoneNumber:i,temporaryProof:s}=e;return!r&&!t&&!i&&!s?null:new n({verificationId:t,verificationCode:r,phoneNumber:i,temporaryProof:s})}};function wc(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function bc(n){let e=Z(Ae(n)).link,t=e?Z(Ae(e)).deep_link_id:null,r=Z(Ae(n)).deep_link_id;return(r?Z(Ae(r)).link:null)||r||t||e||n}var tt=class n{constructor(e){var t,r,i,s,o,c;let u=Z(Ae(e)),l=(t=u.apiKey)!==null&&t!==void 0?t:null,f=(r=u.oobCode)!==null&&r!==void 0?r:null,d=wc((i=u.mode)!==null&&i!==void 0?i:null);h(l&&f&&d,"argument-error"),this.apiKey=l,this.operation=d,this.code=f,this.continueUrl=(s=u.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=u.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(c=u.tenantId)!==null&&c!==void 0?c:null}static parseLink(e){let t=bc(e);try{return new n(t)}catch{return null}}};var ut=(()=>{class n{constructor(){this.providerId=n.PROVIDER_ID}static credential(t,r){return et._fromEmailAndPassword(t,r)}static credentialWithLink(t,r){let i=tt.parseLink(r);return h(i,"argument-error"),et._fromEmailAndCode(t,i.code,i.tenantId)}}n.PROVIDER_ID="password",n.EMAIL_PASSWORD_SIGN_IN_METHOD="password",n.EMAIL_LINK_SIGN_IN_METHOD="emailLink";return n})(),F=class{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}};var se=class extends F{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}},Ce=class n extends se{static credentialFromJSON(e){let t=typeof e=="string"?JSON.parse(e):e;return h("providerId"in t&&"signInMethod"in t,"argument-error"),U._fromParams(t)}credential(e){return this._credential(Object.assign(Object.assign({},e),{nonce:e.rawNonce}))}_credential(e){return h(e.idToken||e.accessToken,"argument-error"),U._fromParams(Object.assign(Object.assign({},e),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(e){return n.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return n.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:r,oauthTokenSecret:i,pendingToken:s,nonce:o,providerId:c}=e;if(!r&&!i&&!t&&!s||!c)return null;try{return new n(c)._credential({idToken:t,accessToken:r,nonce:o,pendingToken:s})}catch{return null}}};var Bt=(()=>{class n extends se{constructor(){super("facebook.com")}static credential(t){return U._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return n.credential(t.oauthAccessToken)}catch{return null}}}n.FACEBOOK_SIGN_IN_METHOD="facebook.com",n.PROVIDER_ID="facebook.com";return n})(),jt=(()=>{class n extends se{constructor(){super("google.com"),this.addScope("profile")}static credential(t,r){return U._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:r})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;let{oauthIdToken:r,oauthAccessToken:i}=t;if(!r&&!i)return null;try{return n.credential(r,i)}catch{return null}}}n.GOOGLE_SIGN_IN_METHOD="google.com",n.PROVIDER_ID="google.com";return n})(),zt=(()=>{class n extends se{constructor(){super("github.com")}static credential(t){return U._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return n.credential(t.oauthAccessToken)}catch{return null}}}n.GITHUB_SIGN_IN_METHOD="github.com",n.PROVIDER_ID="github.com";return n})(),Tc="http://localhost",fe=class n extends z{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){let t=this.buildRequest();return Y(e,t)}_linkToIdToken(e,t){let r=this.buildRequest();return r.idToken=t,Y(e,r)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,Y(e,t)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){let t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,pendingToken:s}=t;return!r||!i||!s||r!==i?null:new n(r,s)}static _create(e,t){return new n(e,t)}buildRequest(){return{requestUri:Tc,returnSecureToken:!0,pendingToken:this.pendingToken}}};var Ac="saml.",nt=class n extends F{constructor(e){h(e.startsWith(Ac),"argument-error"),super(e)}static credentialFromResult(e){return n.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return n.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){let t=fe.fromJSON(e);return h(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{pendingToken:t,providerId:r}=e;if(!t||!r)return null;try{return fe._create(r,t)}catch{return null}}};var $t=(()=>{class n extends se{constructor(){super("twitter.com")}static credential(t,r){return U._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:r})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;let{oauthAccessToken:r,oauthTokenSecret:i}=t;if(!r||!i)return null;try{return n.credential(r,i)}catch{return null}}}n.TWITTER_SIGN_IN_METHOD="twitter.com",n.PROVIDER_ID="twitter.com";return n})();function xs(n,e){return a(this,null,function*(){return Q(n,"POST","/v1/accounts:signUp",y(n,e))})}var V=class n{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static _fromIdTokenResponse(e,t,r,i=!1){return a(this,null,function*(){let s=yield he._fromIdTokenResponse(e,r,i),o=cs(r);return new n({user:s,providerId:o,_tokenResponse:r,operationType:t})})}static _forOperation(e,t,r){return a(this,null,function*(){yield e._updateTokensIfNecessary(r,!0);let i=cs(r);return new n({user:e,providerId:i,_tokenResponse:r,operationType:t})})}};function cs(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}function vr(n){return a(this,null,function*(){var e;if(I(n.app))return Promise.reject(P(n));let t=v(n);if(yield t._initializationPromise,!((e=t.currentUser)===null||e===void 0)&&e.isAnonymous)return new V({user:t.currentUser,providerId:null,operationType:"signIn"});let r=yield xs(t,{returnSecureToken:!0}),i=yield V._fromIdTokenResponse(t,"signIn",r,!0);return yield t._updateCurrentUser(i.user),i})}var zn=class n extends S{constructor(e,t,r,i){var s;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,n.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new n(e,t,r,i)}};function Ms(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?zn._fromErrorAndOperation(n,s,e,r):s})}function Us(n){return new Set(n.map(({providerId:e})=>e).filter(e=>!!e))}function Ir(n,e){return a(this,null,function*(){let t=g(n);yield Gt(!0,t,e);let{providerUserInfo:r}=yield Ha(t.auth,{idToken:yield t.getIdToken(),deleteProvider:[e]}),i=Us(r||[]);return t.providerData=t.providerData.filter(s=>i.has(s.providerId)),i.has("phone")||(t.phoneNumber=null),yield t.auth._persistUserIfCurrent(t),t})}function yr(n,e,t=!1){return a(this,null,function*(){let r=yield X(n,e._linkToIdToken(n.auth,yield n.getIdToken()),t);return V._forOperation(n,"link",r)})}function Gt(n,e,t){return a(this,null,function*(){yield Qe(e);let r=Us(e.providerData),i=n===!1?"provider-already-linked":"no-such-provider";h(r.has(t)===n,e.auth,i)})}function Fs(n,e,t=!1){return a(this,null,function*(){let{auth:r}=n;if(I(r.app))return Promise.reject(P(r));let i="reauthenticate";try{let s=yield X(n,Ms(r,i,e,n),t);h(s.idToken,r,"internal-error");let o=Wt(s.idToken);h(o,r,"internal-error");let{sub:c}=o;return h(n.uid===c,r,"user-mismatch"),V._forOperation(n,i,s)}catch(s){throw s?.code==="auth/user-not-found"&&A(r,"user-mismatch"),s}})}function Vs(n,e,t=!1){return a(this,null,function*(){if(I(n.app))return Promise.reject(P(n));let r="signIn",i=yield Ms(n,r,e),s=yield V._fromIdTokenResponse(n,r,i);return t||(yield n._updateCurrentUser(s.user)),s})}function Le(n,e){return a(this,null,function*(){return Vs(v(n),e)})}function qt(n,e){return a(this,null,function*(){let t=g(n);return yield Gt(!1,t,e.providerId),yr(t,e)})}function Kt(n,e){return a(this,null,function*(){return Fs(g(n),e)})}function Sc(n,e){return a(this,null,function*(){return Q(n,"POST","/v1/accounts:signInWithCustomToken",y(n,e))})}function Er(n,e){return a(this,null,function*(){if(I(n.app))return Promise.reject(P(n));let t=v(n),r=yield Sc(t,{token:e,returnSecureToken:!0}),i=yield V._fromIdTokenResponse(t,"signIn",r);return yield t._updateCurrentUser(i.user),i})}var pe=class{constructor(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}static _fromServerResponse(e,t){return"phoneInfo"in t?$n._fromServerResponse(e,t):"totpInfo"in t?Gn._fromServerResponse(e,t):A(e,"internal-error")}},$n=class n extends pe{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new n(t)}},Gn=class n extends pe{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new n(t)}};function Jt(n,e,t){var r;h(((r=t.url)===null||r===void 0?void 0:r.length)>0,n,"invalid-continue-uri"),h(typeof t.dynamicLinkDomain>"u"||t.dynamicLinkDomain.length>0,n,"invalid-dynamic-link-domain"),e.continueUrl=t.url,e.dynamicLinkDomain=t.dynamicLinkDomain,e.canHandleCodeInApp=t.handleCodeInApp,t.iOS&&(h(t.iOS.bundleId.length>0,n,"missing-ios-bundle-id"),e.iOSBundleId=t.iOS.bundleId),t.android&&(h(t.android.packageName.length>0,n,"missing-android-pkg-name"),e.androidInstallApp=t.android.installApp,e.androidMinimumVersionCode=t.android.minimumVersion,e.androidPackageName=t.android.packageName)}function wr(n){return a(this,null,function*(){let e=v(n);e._getPasswordPolicyInternal()&&(yield e._updatePasswordPolicy())})}function br(n,e,t){return a(this,null,function*(){let r=v(n),i={requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"};t&&Jt(r,i,t),yield Ze(r,i,"getOobCode",dc)})}function Tr(n,e,t){return a(this,null,function*(){yield Ls(g(n),{oobCode:e,newPassword:t}).catch(r=>a(this,null,function*(){throw r.code==="auth/password-does-not-meet-requirements"&&wr(n),r}))})}function Ar(n,e){return a(this,null,function*(){yield cc(g(n),{oobCode:e})})}function Yt(n,e){return a(this,null,function*(){let t=g(n),r=yield Ls(t,{oobCode:e}),i=r.requestType;switch(h(i,t,"internal-error"),i){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":h(r.newEmail,t,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":h(r.mfaInfo,t,"internal-error");default:h(r.email,t,"internal-error")}let s=null;return r.mfaInfo&&(s=pe._fromServerResponse(v(t),r.mfaInfo)),{data:{email:(r.requestType==="VERIFY_AND_CHANGE_EMAIL"?r.newEmail:r.email)||null,previousEmail:(r.requestType==="VERIFY_AND_CHANGE_EMAIL"?r.email:r.newEmail)||null,multiFactorInfo:s},operation:i}})}function Sr(n,e){return a(this,null,function*(){let{data:t}=yield Yt(g(n),e);return t.email})}function Pr(n,e,t){return a(this,null,function*(){if(I(n.app))return Promise.reject(P(n));let r=v(n),o=yield Ze(r,{returnSecureToken:!0,email:e,password:t,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",xs).catch(u=>{throw u.code==="auth/password-does-not-meet-requirements"&&wr(n),u}),c=yield V._fromIdTokenResponse(r,"signIn",o);return yield r._updateCurrentUser(c.user),c})}function Rr(n,e,t){return I(n.app)?Promise.reject(P(n)):Le(g(n),ut.credential(e,t)).catch(r=>a(this,null,function*(){throw r.code==="auth/password-does-not-meet-requirements"&&wr(n),r}))}function Or(n,e,t){return a(this,null,function*(){let r=v(n),i={requestType:"EMAIL_SIGNIN",email:e,clientType:"CLIENT_TYPE_WEB"};function s(o,c){h(c.handleCodeInApp,r,"argument-error"),c&&Jt(r,o,c)}s(i,t),yield Ze(r,i,"getOobCode",hc)})}function Cr(n,e){let t=tt.parseLink(e);return t?.operation==="EMAIL_SIGNIN"}function kr(n,e,t){return a(this,null,function*(){if(I(n.app))return Promise.reject(P(n));let r=g(n),i=ut.credentialWithLink(e,t||Je());return h(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),Le(r,i)})}function Pc(n,e){return a(this,null,function*(){return E(n,"POST","/v1/accounts:createAuthUri",y(n,e))})}function Nr(n,e){return a(this,null,function*(){let t=fr()?Je():"http://localhost",r={identifier:e,continueUri:t},{signinMethods:i}=yield Pc(g(n),r);return i||[]})}function Dr(n,e){return a(this,null,function*(){let t=g(n),i={requestType:"VERIFY_EMAIL",idToken:yield n.getIdToken()};e&&Jt(t.auth,i,e);let{email:s}=yield lc(t.auth,i);s!==n.email&&(yield n.reload())})}function Lr(n,e,t){return a(this,null,function*(){let r=g(n),s={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:yield n.getIdToken(),newEmail:e};t&&Jt(r.auth,s,t);let{email:o}=yield fc(r.auth,s);o!==n.email&&(yield n.reload())})}function Rc(n,e){return a(this,null,function*(){return E(n,"POST","/v1/accounts:update",e)})}function xr(r,i){return a(this,arguments,function*(n,{displayName:e,photoURL:t}){if(e===void 0&&t===void 0)return;let s=g(n),c={idToken:yield s.getIdToken(),displayName:e,photoUrl:t,returnSecureToken:!0},u=yield X(s,Rc(s.auth,c));s.displayName=u.displayName||null,s.photoURL=u.photoUrl||null;let l=s.providerData.find(({providerId:f})=>f==="password");l&&(l.displayName=s.displayName,l.photoURL=s.photoURL),yield s._updateTokensIfNecessary(u)})}function Mr(n,e){let t=g(n);return I(t.auth.app)?Promise.reject(P(t.auth)):Ws(t,e,null)}function Ur(n,e){return Ws(g(n),null,e)}function Ws(n,e,t){return a(this,null,function*(){let{auth:r}=n,s={idToken:yield n.getIdToken(),returnSecureToken:!0};e&&(s.email=e),t&&(s.password=t);let o=yield X(n,oc(r,s));yield n._updateTokensIfNecessary(o,!0)})}function Oc(n){var e,t;if(!n)return null;let{providerId:r}=n,i=n.rawUserInfo?JSON.parse(n.rawUserInfo):{},s=n.isNewUser||n.kind==="identitytoolkit#SignupNewUserResponse";if(!r&&n?.idToken){let o=(t=(e=Wt(n.idToken))===null||e===void 0?void 0:e.firebase)===null||t===void 0?void 0:t.sign_in_provider;if(o){let c=o!=="anonymous"&&o!=="custom"?o:null;return new re(s,c)}}if(!r)return null;switch(r){case"facebook.com":return new qn(s,i);case"github.com":return new Kn(s,i);case"google.com":return new Jn(s,i);case"twitter.com":return new Yn(s,i,n.screenName||null);case"custom":case"anonymous":return new re(s,null);default:return new re(s,r,i)}}var re=class{constructor(e,t,r={}){this.isNewUser=e,this.providerId=t,this.profile=r}},Dt=class extends re{constructor(e,t,r,i){super(e,t,r),this.username=i}},qn=class extends re{constructor(e,t){super(e,"facebook.com",t)}},Kn=class extends Dt{constructor(e,t){super(e,"github.com",t,typeof t?.login=="string"?t?.login:null)}},Jn=class extends re{constructor(e,t){super(e,"google.com",t)}},Yn=class extends Dt{constructor(e,t,r){super(e,"twitter.com",t,r)}};function Fr(n){let{user:e,_tokenResponse:t}=n;return e.isAnonymous&&!t?{providerId:null,isNewUser:!1,profile:null}:Oc(t)}var Lt=class n{constructor(e,t,r){this.type=e,this.credential=t,this.user=r}static _fromIdtoken(e,t){return new n("enroll",e,t)}static _fromMfaPendingCredential(e){return new n("signin",e)}toJSON(){return{multiFactorSession:{[this.type==="enroll"?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){var t,r;if(e?.multiFactorSession){if(!((t=e.multiFactorSession)===null||t===void 0)&&t.pendingCredential)return n._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(!((r=e.multiFactorSession)===null||r===void 0)&&r.idToken)return n._fromIdtoken(e.multiFactorSession.idToken)}return null}};var Xn=class n{constructor(e,t,r){this.session=e,this.hints=t,this.signInResolver=r}static _fromError(e,t){let r=v(e),i=t.customData._serverResponse,s=(i.mfaInfo||[]).map(c=>pe._fromServerResponse(r,c));h(i.mfaPendingCredential,r,"internal-error");let o=Lt._fromMfaPendingCredential(i.mfaPendingCredential);return new n(o,s,c=>a(this,null,function*(){let u=yield c._process(r,o);delete i.mfaInfo,delete i.mfaPendingCredential;let l=Object.assign(Object.assign({},i),{idToken:u.idToken,refreshToken:u.refreshToken});switch(t.operationType){case"signIn":let f=yield V._fromIdTokenResponse(r,t.operationType,l);return yield r._updateCurrentUser(f.user),f;case"reauthenticate":return h(t.user,r,"internal-error"),V._forOperation(t.user,t.operationType,l);default:A(r,"internal-error")}}))}resolveSignIn(e){return a(this,null,function*(){let t=e;return this.signInResolver(t)})}};function Vr(n,e){var t;let r=g(n),i=e;return h(e.customData.operationType,r,"argument-error"),h((t=i.customData._serverResponse)===null||t===void 0?void 0:t.mfaPendingCredential,r,"argument-error"),Xn._fromError(r,i)}function Cc(n,e){return E(n,"POST","/v2/accounts/mfaEnrollment:start",y(n,e))}function kc(n,e){return E(n,"POST","/v2/accounts/mfaEnrollment:finalize",y(n,e))}function Nc(n,e){return E(n,"POST","/v2/accounts/mfaEnrollment:withdraw",y(n,e))}var Qn=class n{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map(r=>pe._fromServerResponse(e.auth,r)))})}static _fromUser(e){return new n(e)}getSession(){return a(this,null,function*(){return Lt._fromIdtoken(yield this.user.getIdToken(),this.user)})}enroll(e,t){return a(this,null,function*(){let r=e,i=yield this.getSession(),s=yield X(this.user,r._process(this.user.auth,i,t));return yield this.user._updateTokensIfNecessary(s),this.user.reload()})}unenroll(e){return a(this,null,function*(){let t=typeof e=="string"?e:e.uid,r=yield this.user.getIdToken();try{let i=yield X(this.user,Nc(this.user.auth,{idToken:r,mfaEnrollmentId:t}));this.enrolledFactors=this.enrolledFactors.filter(({uid:s})=>s!==t),yield this.user._updateTokensIfNecessary(i),yield this.user.reload()}catch(i){throw i}})}},xn=new WeakMap;function Wr(n){let e=g(n);return xn.has(e)||xn.set(e,Qn._fromUser(e)),xn.get(e)}var xt="__sak";var Mt=class{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(xt,"1"),this.storage.removeItem(xt),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){let t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}};var Dc=1e3,Lc=10,xc=(()=>{class n extends Mt{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,r)=>this.onStorageEvent(t,r),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=ks(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(let r of Object.keys(this.listeners)){let i=this.storage.getItem(r),s=this.localCache[r];i!==s&&t(r,s,i)}}onStorageEvent(t,r=!1){if(!t.key){this.forAllChangedKeys((c,u,l)=>{this.notifyListeners(c,l)});return}let i=t.key;r?this.detachListener():this.stopPolling();let s=()=>{let c=this.storage.getItem(i);!r&&this.localCache[i]===c||this.notifyListeners(i,c)},o=this.storage.getItem(i);Ka()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,Lc):s()}notifyListeners(t,r){this.localCache[t]=r;let i=this.listeners[t];if(i)for(let s of Array.from(i))s(r&&JSON.parse(r))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,r,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:r,newValue:i}),!0)})},Dc)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,r){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(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}_set(t,r){return a(this,null,function*(){yield ce(n.prototype,this,"_set").call(this,t,r),this.localCache[t]=JSON.stringify(r)})}_get(t){return a(this,null,function*(){let r=yield ce(n.prototype,this,"_get").call(this,t);return this.localCache[t]=JSON.stringify(r),r})}_remove(t){return a(this,null,function*(){yield ce(n.prototype,this,"_remove").call(this,t),delete this.localCache[t]})}}return n.type="LOCAL",n})(),xe=xc;var Mc=(()=>{class n extends Mt{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,r){}_removeListener(t,r){}}return n.type="SESSION",n})(),$=Mc;function Uc(n){return Promise.all(n.map(e=>a(this,null,function*(){try{return{fulfilled:!0,value:yield e}}catch(t){return{fulfilled:!1,reason:t}}})))}var Fc=(()=>{class n{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){let r=this.receivers.find(s=>s.isListeningto(t));if(r)return r;let i=new n(t);return this.receivers.push(i),i}isListeningto(t){return this.eventTarget===t}handleEvent(t){return a(this,null,function*(){let r=t,{eventId:i,eventType:s,data:o}=r.data,c=this.handlersMap[s];if(!c?.size)return;r.ports[0].postMessage({status:"ack",eventId:i,eventType:s});let u=Array.from(c).map(f=>a(this,null,function*(){return f(r.origin,o)})),l=yield Uc(u);r.ports[0].postMessage({status:"done",eventId:i,eventType:s,response:l})})}_subscribe(t,r){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(r)}_unsubscribe(t,r){this.handlersMap[t]&&r&&this.handlersMap[t].delete(r),(!r||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}n.receivers=[];return n})();function _e(n="",e=10){let t="";for(let r=0;r{let l=_e("",20);i.port1.start();let f=setTimeout(()=>{u(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(d){let p=d;if(p.data.eventId===l)switch(p.data.status){case"ack":clearTimeout(f),s=setTimeout(()=>{u(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),c(p.data.response);break;default:clearTimeout(f),clearTimeout(s),u(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})})}};function b(){return window}function Vc(n){b().location.href=n}function Hr(){return typeof b().WorkerGlobalScope<"u"&&typeof b().importScripts=="function"}function Wc(){return a(this,null,function*(){if(!navigator?.serviceWorker)return null;try{return(yield navigator.serviceWorker.ready).active}catch{return null}})}function Hc(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function Bc(){return Hr()?self:null}var Hs="firebaseLocalStorageDb",jc=1,Ut="firebaseLocalStorage",Bs="fbase_key",me=class{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}};function Xt(n,e){return n.transaction([Ut],e?"readwrite":"readonly").objectStore(Ut)}function zc(){let n=indexedDB.deleteDatabase(Hs);return new me(n).toPromise()}function er(){let n=indexedDB.open(Hs,jc);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{let r=n.result;try{r.createObjectStore(Ut,{keyPath:Bs})}catch(i){t(i)}}),n.addEventListener("success",()=>a(this,null,function*(){let r=n.result;r.objectStoreNames.contains(Ut)?e(r):(r.close(),yield zc(),e(yield er()))}))})}function us(n,e,t){return a(this,null,function*(){let r=Xt(n,!0).put({[Bs]:e,value:t});return new me(r).toPromise()})}function $c(n,e){return a(this,null,function*(){let t=Xt(n,!1).get(e),r=yield new me(t).toPromise();return r===void 0?null:r.value})}function ls(n,e){let t=Xt(n,!0).delete(e);return new me(t).toPromise()}var Gc=800,qc=3,Kc=(()=>{class n{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(()=>{},()=>{})}_openDb(){return a(this,null,function*(){return this.db?this.db:(this.db=yield er(),this.db)})}_withRetries(t){return a(this,null,function*(){let r=0;for(;;)try{let i=yield this._openDb();return yield t(i)}catch(i){if(r++>qc)throw i;this.db&&(this.db.close(),this.db=void 0)}})}initializeServiceWorkerMessaging(){return a(this,null,function*(){return Hr()?this.initializeReceiver():this.initializeSender()})}initializeReceiver(){return a(this,null,function*(){this.receiver=Fc._getInstance(Bc()),this.receiver._subscribe("keyChanged",(t,r)=>a(this,null,function*(){return{keyProcessed:(yield this._poll()).includes(r.key)}})),this.receiver._subscribe("ping",(t,r)=>a(this,null,function*(){return["keyChanged"]}))})}initializeSender(){return a(this,null,function*(){var t,r;if(this.activeServiceWorker=yield Wc(),!this.activeServiceWorker)return;this.sender=new Zn(this.activeServiceWorker);let i=yield this.sender._send("ping",{},800);i&&!((t=i[0])===null||t===void 0)&&t.fulfilled&&!((r=i[0])===null||r===void 0)&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)})}notifyServiceWorker(t){return a(this,null,function*(){if(!(!this.sender||!this.activeServiceWorker||Hc()!==this.activeServiceWorker))try{yield this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}})}_isAvailable(){return a(this,null,function*(){try{if(!indexedDB)return!1;let t=yield er();return yield us(t,xt,"1"),yield ls(t,xt),!0}catch{}return!1})}_withPendingWrite(t){return a(this,null,function*(){this.pendingWrites++;try{yield t()}finally{this.pendingWrites--}})}_set(t,r){return a(this,null,function*(){return this._withPendingWrite(()=>a(this,null,function*(){return yield this._withRetries(i=>us(i,t,r)),this.localCache[t]=r,this.notifyServiceWorker(t)}))})}_get(t){return a(this,null,function*(){let r=yield this._withRetries(i=>$c(i,t));return this.localCache[t]=r,r})}_remove(t){return a(this,null,function*(){return this._withPendingWrite(()=>a(this,null,function*(){return yield this._withRetries(r=>ls(r,t)),delete this.localCache[t],this.notifyServiceWorker(t)}))})}_poll(){return a(this,null,function*(){let t=yield this._withRetries(s=>{let o=Xt(s,!1).getAll();return new me(o).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];let r=[],i=new Set;if(t.length!==0)for(let{fbase_key:s,value:o}of t)i.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(o)&&(this.notifyListeners(s,o),r.push(s));for(let s of Object.keys(this.localCache))this.localCache[s]&&!i.has(s)&&(this.notifyListeners(s,null),r.push(s));return r})}notifyListeners(t,r){this.localCache[t]=r;let i=this.listeners[t];if(i)for(let s of Array.from(i))s(r)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>a(this,null,function*(){return this._poll()}),Gc)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,r){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}return n.type="LOCAL",n})(),ve=Kc;function Jc(n,e){return E(n,"POST","/v2/accounts/mfaSignIn:start",y(n,e))}function Yc(n,e){return E(n,"POST","/v2/accounts/mfaSignIn:finalize",y(n,e))}var Xc=500,Qc=6e4,St=1e12,tr=class{constructor(e){this.auth=e,this.counter=St,this._widgets=new Map}render(e,t){let r=this.counter;return this._widgets.set(r,new nr(e,this.auth.name,t||{})),this.counter++,r}reset(e){var t;let r=e||St;(t=this._widgets.get(r))===null||t===void 0||t.delete(),this._widgets.delete(r)}getResponse(e){var t;let r=e||St;return((t=this._widgets.get(r))===null||t===void 0?void 0:t.getResponse())||""}execute(e){return a(this,null,function*(){var t;let r=e||St;return(t=this._widgets.get(r))===null||t===void 0||t.execute(),""})}},nr=class{constructor(e,t,r){this.params=r,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};let i=typeof e=="string"?document.getElementById(e):e;h(i,"argument-error",{appName:t}),this.container=i,this.isVisible=this.params.size!=="invisible",this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),!this.timerId&&(this.timerId=window.setTimeout(()=>{this.responseToken=Zc(50);let{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch{}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch{}this.isVisible&&this.execute()},Qc)},Xc))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}};function Zc(n){let e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=0;r{let s=b().setTimeout(()=>{i(T(e,"network-request-failed"))},eu.get());b()[Mn]=()=>{b().clearTimeout(s),delete b()[Mn];let c=b().grecaptcha;if(!c||!ts(c)){i(T(e,"internal-error"));return}let u=c.render;c.render=(l,f)=>{let d=u(l,f);return this.counter++,d},this.hostLanguage=t,r(c)};let o=`${Qa()}?${ue({onload:Mn,render:"explicit",hl:t})}`;gr(o).catch(()=>{clearTimeout(s),i(T(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){var t;return!!(!((t=b().grecaptcha)===null||t===void 0)&&t.render)&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}};function tu(n){return n.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(n)}var ir=class{load(e){return a(this,null,function*(){return new tr(e)})}clearedOneInstance(){}};var js="recaptcha",nu={theme:"light",type:"image"},rt=class{constructor(e,t,r=Object.assign({},nu)){this.parameters=r,this.type=js,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=v(e),this.isInvisible=this.parameters.size==="invisible",h(typeof document<"u",this.auth,"operation-not-supported-in-this-environment");let i=typeof t=="string"?document.getElementById(t):t;h(i,this.auth,"argument-error"),this.container=i,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new ir:new rr,this.validateStartingState()}verify(){return a(this,null,function*(){this.assertNotDestroyed();let e=yield this.render(),t=this.getAssertedRecaptcha(),r=t.getResponse(e);return r||new Promise(i=>{let s=o=>{o&&(this.tokenChangeListeners.delete(s),i(o))};this.tokenChangeListeners.add(s),this.isInvisible&&t.execute(e)})})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise?this.renderPromise:(this.renderPromise=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e}),this.renderPromise)}_reset(){this.assertNotDestroyed(),this.widgetId!==null&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach(e=>{this.container.removeChild(e)})}validateStartingState(){h(!this.parameters.sitekey,this.auth,"argument-error"),h(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),h(typeof document<"u",this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach(r=>r(t)),typeof e=="function")e(t);else if(typeof e=="string"){let r=b()[e];typeof r=="function"&&r(t)}}}assertNotDestroyed(){h(!this.destroyed,this.auth,"internal-error")}makeRenderPromise(){return a(this,null,function*(){if(yield this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){let t=document.createElement("div");e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId})}init(){return a(this,null,function*(){h(fr()&&!Hr(),this.auth,"internal-error"),yield ru(),this.recaptcha=yield this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);let e=yield Fa(this.auth);h(e,this.auth,"internal-error"),this.parameters.sitekey=e})}getAssertedRecaptcha(){return h(this.recaptcha,this.auth,"internal-error"),this.recaptcha}};function ru(){let n=null;return new Promise(e=>{if(document.readyState==="complete"){e();return}n=()=>e(),window.addEventListener("load",n)}).catch(e=>{throw n&&window.removeEventListener("load",n),e})}var it=class{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){let t=Oe._fromVerification(this.verificationId,e);return this.onConfirmation(t)}};function Br(n,e,t){return a(this,null,function*(){if(I(n.app))return Promise.reject(P(n));let r=v(n),i=yield Qt(r,e,g(t));return new it(i,s=>Le(r,s))})}function jr(n,e,t){return a(this,null,function*(){let r=g(n);yield Gt(!1,r,"phone");let i=yield Qt(r.auth,e,g(t));return new it(i,s=>qt(r,s))})}function zr(n,e,t){return a(this,null,function*(){let r=g(n);if(I(r.auth.app))return Promise.reject(P(r.auth));let i=yield Qt(r.auth,e,g(t));return new it(i,s=>Kt(r,s))})}function Qt(n,e,t){return a(this,null,function*(){var r;let i=yield t.verify();try{h(typeof i=="string",n,"argument-error"),h(t.type===js,n,"argument-error");let s;if(typeof e=="string"?s={phoneNumber:e}:s=e,"session"in s){let o=s.session;if("phoneNumber"in s)return h(o.type==="enroll",n,"internal-error"),(yield Cc(n,{idToken:o.credential,phoneEnrollmentInfo:{phoneNumber:s.phoneNumber,recaptchaToken:i}})).phoneSessionInfo.sessionInfo;{h(o.type==="signin",n,"internal-error");let c=((r=s.multiFactorHint)===null||r===void 0?void 0:r.uid)||s.multiFactorUid;return h(c,n,"missing-multi-factor-info"),(yield Jc(n,{mfaPendingCredential:o.credential,mfaEnrollmentId:c,phoneSignInInfo:{recaptchaToken:i}})).phoneResponseInfo.sessionInfo}}else{let{sessionInfo:o}=yield _c(n,{phoneNumber:s.phoneNumber,recaptchaToken:i});return o}}finally{t._reset()}})}function $r(n,e){return a(this,null,function*(){let t=g(n);if(I(t.auth.app))return Promise.reject(P(t.auth));yield yr(t,e)})}var Ie=(()=>{class n{constructor(t){this.providerId=n.PROVIDER_ID,this.auth=v(t)}verifyPhoneNumber(t,r){return Qt(this.auth,t,g(r))}static credential(t,r){return Oe._fromVerification(t,r)}static credentialFromResult(t){let r=t;return n.credentialFromTaggedObject(r)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;let{phoneNumber:r,temporaryProof:i}=t;return r&&i?Oe._fromTokenResponse(r,i):null}}n.PROVIDER_ID="phone",n.PHONE_SIGN_IN_METHOD="phone";return n})();function ye(n,e){return e?O(e):(h(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}var st=class extends z{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Y(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Y(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Y(e,this._buildIdpRequest())}_buildIdpRequest(e){let t={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 e&&(t.idToken=e),t}};function iu(n){return Vs(n.auth,new st(n),n.bypassAuthState)}function su(n){let{auth:e,user:t}=n;return h(t,e,"internal-error"),Fs(t,new st(n),n.bypassAuthState)}function ou(n){return a(this,null,function*(){let{auth:e,user:t}=n;return h(t,e,"internal-error"),yr(t,new st(n),n.bypassAuthState)})}var Ft=class{constructor(e,t,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise((e,t)=>a(this,null,function*(){this.pendingPromise={resolve:e,reject:t};try{this.eventManager=yield this.resolver._initialize(this.auth),yield this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}}))}onAuthEvent(e){return a(this,null,function*(){let{urlResponse:t,sessionId:r,postBody:i,tenantId:s,error:o,type:c}=e;if(o){this.reject(o);return}let u={auth:this.auth,requestUri:t,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(yield this.getIdpTask(c)(u))}catch(l){this.reject(l)}})}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return iu;case"linkViaPopup":case"linkViaRedirect":return ou;case"reauthViaPopup":case"reauthViaRedirect":return su;default:A(this.auth,"internal-error")}}resolve(e){M(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){M(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}};var au=new de(2e3,1e4);function Gr(n,e,t){return a(this,null,function*(){if(I(n.app))return Promise.reject(T(n,"operation-not-supported-in-this-environment"));let r=v(n);ke(n,e,F);let i=ye(r,t);return new Jr(r,"signInViaPopup",e,i).executeNotNull()})}function qr(n,e,t){return a(this,null,function*(){let r=g(n);if(I(r.auth.app))return Promise.reject(T(r.auth,"operation-not-supported-in-this-environment"));ke(r.auth,e,F);let i=ye(r.auth,t);return new Jr(r.auth,"reauthViaPopup",e,i,r).executeNotNull()})}function Kr(n,e,t){return a(this,null,function*(){let r=g(n);ke(r.auth,e,F);let i=ye(r.auth,t);return new Jr(r.auth,"linkViaPopup",e,i,r).executeNotNull()})}var Jr=(()=>{class n extends Ft{constructor(t,r,i,s,o){super(t,r,s,o),this.provider=i,this.authWindow=null,this.pollId=null,n.currentPopupAction&&n.currentPopupAction.cancel(),n.currentPopupAction=this}executeNotNull(){return a(this,null,function*(){let t=yield this.execute();return h(t,this.auth,"internal-error"),t})}onExecution(){return a(this,null,function*(){M(this.filter.length===1,"Popup operations only handle one event");let t=_e();this.authWindow=yield this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(r=>{this.reject(r)}),this.resolver._isIframeWebStorageSupported(this.auth,r=>{r||this.reject(T(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()})}get eventId(){var t;return((t=this.authWindow)===null||t===void 0?void 0:t.associatedEvent)||null}cancel(){this.reject(T(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,n.currentPopupAction=null}pollUserCancellation(){let t=()=>{var r,i;if(!((i=(r=this.authWindow)===null||r===void 0?void 0:r.window)===null||i===void 0)&&i.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(T(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,au.get())};t()}}n.currentPopupAction=null;return n})(),cu="pendingRedirect",Ke=new Map,sr=class n extends Ft{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}execute(){return a(this,null,function*(){let e=Ke.get(this.auth._key());if(!e){try{let r=(yield uu(this.resolver,this.auth))?yield ce(n.prototype,this,"execute").call(this):null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}Ke.set(this.auth._key(),e)}return this.bypassAuthState||Ke.set(this.auth._key(),()=>Promise.resolve(null)),e()})}onAuthEvent(e){return a(this,null,function*(){if(e.type==="signInViaRedirect")return ce(n.prototype,this,"onAuthEvent").call(this,e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){let t=yield this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,ce(n.prototype,this,"onAuthEvent").call(this,e);this.resolve(null)}})}onExecution(){return a(this,null,function*(){})}cleanUp(){}};function uu(n,e){return a(this,null,function*(){let t=Gs(e),r=$s(n);if(!(yield r._isAvailable()))return!1;let i=(yield r._get(t))==="true";return yield r._remove(t),i})}function Yr(n,e){return a(this,null,function*(){return $s(n)._set(Gs(e),"true")})}function zs(){Ke.clear()}function Me(n,e){Ke.set(n._key(),e)}function $s(n){return O(n._redirectPersistence)}function Gs(n){return j(cu,n.config.apiKey,n.name)}function Xr(n,e,t){return lu(n,e,t)}function lu(n,e,t){return a(this,null,function*(){if(I(n.app))return Promise.reject(P(n));let r=v(n);ke(n,e,F),yield r._initializationPromise;let i=ye(r,t);return yield Yr(i,r),i._openRedirect(r,e,"signInViaRedirect")})}function Qr(n,e,t){return du(n,e,t)}function du(n,e,t){return a(this,null,function*(){let r=g(n);if(ke(r.auth,e,F),I(r.auth.app))return Promise.reject(P(r.auth));yield r.auth._initializationPromise;let i=ye(r.auth,t);yield Yr(i,r.auth);let s=yield qs(r);return i._openRedirect(r.auth,e,"reauthViaRedirect",s)})}function Zr(n,e,t){return hu(n,e,t)}function hu(n,e,t){return a(this,null,function*(){let r=g(n);ke(r.auth,e,F),yield r.auth._initializationPromise;let i=ye(r.auth,t);yield Gt(!1,r,e.providerId),yield Yr(i,r.auth);let s=yield qs(r);return i._openRedirect(r.auth,e,"linkViaRedirect",s)})}function ei(n,e){return a(this,null,function*(){return yield v(n)._initializationPromise,Ee(n,e,!1)})}function Ee(n,e,t=!1){return a(this,null,function*(){if(I(n.app))return Promise.reject(P(n));let r=v(n),i=ye(r,e),o=yield new sr(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,yield r._persistUserIfCurrent(o.user),yield r._setRedirectUser(null,e)),o})}function qs(n){return a(this,null,function*(){let e=_e(`${n.uid}:::`);return n._redirectEventId=e,yield n.auth._setRedirectUser(n),yield n.auth._persistUserIfCurrent(n),e})}var fu=10*60*1e3,ot=class{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!pu(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!Ks(e)){let i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";t.onError(T(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){let r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=fu&&this.cachedEventUids.clear(),this.cachedEventUids.has(ds(e))}saveEventToCache(e){this.cachedEventUids.add(ds(e)),this.lastProcessedEventTime=Date.now()}};function ds(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function Ks({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function pu(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Ks(n);default:return!1}}function ti(t){return a(this,arguments,function*(n,e={}){return E(n,"GET","/v1/projects",e)})}var mu=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,gu=/^https?/;function _u(n){return a(this,null,function*(){if(n.config.emulator)return;let{authorizedDomains:e}=yield ti(n);for(let t of e)try{if(vu(t))return}catch{}A(n,"unauthorized-domain")})}function vu(n){let e=Je(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){let o=new URL(n);return o.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===r}if(!gu.test(t))return!1;if(mu.test(n))return r===n;let i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}var Iu=new de(3e4,6e4);function hs(){let n=b().___jsl;if(n?.H){for(let e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t{var r,i,s;function o(){hs(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{hs(),t(T(n,"network-request-failed"))},timeout:Iu.get()})}if(!((i=(r=b().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=b().gapi)===null||s===void 0)&&s.load)o();else{let c=Ns("iframefcb");return b()[c]=()=>{gapi.load?o():t(T(n,"network-request-failed"))},gr(`${ec()}?onload=${c}`).catch(u=>t(u))}}).catch(e=>{throw Rt=null,e})}var Rt=null;function Eu(n){return Rt=Rt||yu(n),Rt}var wu=new de(5e3,15e3),bu="__/auth/iframe",Tu="emulator/auth/iframe",Au={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Su=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Pu(n){let e=n.config;h(e.authDomain,n,"auth-domain-config-required");let t=e.emulator?pr(e,Tu):`https://${n.config.authDomain}/${bu}`,r={apiKey:e.apiKey,appName:n.name,v:J},i=Su.get(n.config.apiHost);i&&(r.eid=i);let s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${ue(r).slice(1)}`}function Ru(n){return a(this,null,function*(){let e=yield Eu(n),t=b().gapi;return h(t,n,"internal-error"),e.open({where:document.body,url:Pu(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Au,dontclear:!0},r=>new Promise((i,s)=>a(this,null,function*(){yield r.restyle({setHideOnLeave:!1});let o=T(n,"network-request-failed"),c=b().setTimeout(()=>{s(o)},wu.get());function u(){b().clearTimeout(c),i(r)}r.ping(u).then(u,()=>{s(o)})})))})}var Ou={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Cu=500,ku=600,Nu="_blank",Du="http://localhost",at=class{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}};function Lu(n,e,t,r=Cu,i=ku){let s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString(),c="",u=Object.assign(Object.assign({},Ou),{width:r.toString(),height:i.toString(),top:s,left:o}),l=w().toLowerCase();t&&(c=Ss(l)?Nu:t),Ts(l)&&(e=e||Du,u.scrollbars="yes");let f=Object.entries(u).reduce((p,[m,R])=>`${p}${m}=${R},`,"");if(qa(l)&&c!=="_self")return xu(e||"",c),new at(null);let d=window.open(e||"",c,f);h(d,n,"popup-blocked");try{d.focus()}catch{}return new at(d)}function xu(n,e){let t=document.createElement("a");t.href=n,t.target=e;let r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}var Mu="__/auth/handler",Uu="emulator/auth/handler",Fu=encodeURIComponent("fac");function Vt(n,e,t,r,i,s){return a(this,null,function*(){h(n.config.authDomain,n,"auth-domain-config-required"),h(n.config.apiKey,n,"invalid-api-key");let o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:J,eventId:i};if(e instanceof F){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",ki(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(let[f,d]of Object.entries(s||{}))o[f]=d}if(e instanceof se){let f=e.getScopes().filter(d=>d!=="");f.length>0&&(o.scopes=f.join(","))}n.tenantId&&(o.tid=n.tenantId);let c=o;for(let f of Object.keys(c))c[f]===void 0&&delete c[f];let u=yield n._getAppCheckToken(),l=u?`#${Fu}=${encodeURIComponent(u)}`:"";return`${Vu(n)}?${ue(c).slice(1)}${l}`})}function Vu({config:n}){return n.emulator?pr(n,Uu):`https://${n.authDomain}/${Mu}`}var Un="webStorageSupport",or=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=$,this._completeRedirectFn=Ee,this._overrideRedirectResult=Me}_openPopup(e,t,r,i){return a(this,null,function*(){var s;M((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");let o=yield Vt(e,t,r,Je(),i);return Lu(e,o,_e())})}_openRedirect(e,t,r,i){return a(this,null,function*(){yield this._originValidation(e);let s=yield Vt(e,t,r,Je(),i);return Vc(s),new Promise(()=>{})})}_initialize(e){let t=e._key();if(this.eventManagers[t]){let{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(M(s,"If manager is not set, promise should be"),s)}let r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}initAndGetManager(e){return a(this,null,function*(){let t=yield Ru(e),r=new ot(e);return t.register("authEvent",i=>(h(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r})}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Un,{type:Un},i=>{var s;let o=(s=i?.[0])===null||s===void 0?void 0:s[Un];o!==void 0&&t(!!o),A(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=_u(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return ks()||As()||De()}},ni=or,ar=class{constructor(e){this.factorId=e}_process(e,t,r){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,r);case"signin":return this._finalizeSignIn(e,t.credential);default:return B("unexpected MultiFactorSessionType")}}},cr=class n extends ar{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new n(e)}_finalizeEnroll(e,t,r){return kc(e,{idToken:t,displayName:r,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,t){return Yc(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}},ri=(()=>{class n{constructor(){}static assertion(t){return cr._fromCredential(t)}}return n.FACTOR_ID="phone",n})();var fs="@firebase/auth",ps="1.7.9";var ur=class{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}getToken(e){return a(this,null,function*(){return this.assertAuthConfigured(),yield this.auth._initializationPromise,this.auth.currentUser?{accessToken:yield this.auth.currentUser.getIdToken(e)}:null})}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;let t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){h(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}};function Wu(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Hu(n){K(new C("auth",(e,{options:t})=>{let r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:c}=r.options;h(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});let u={apiKey:o,authDomain:c,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:mr(n)},l=new kt(r,i,s,u);return rc(l,t),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),K(new C("auth-internal",e=>{let t=v(e.getProvider("auth").getImmediate());return(r=>new ur(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),x(fs,ps,Wu(n)),x(fs,ps,"esm2017")}var Bu=5*60,yd=Ai("authIdTokenMaxAge")||Bu;function ju(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}Xa({loadJS(n){return new Promise((e,t)=>{let r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{let s=T("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",ju().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="});Hu("Browser");function we(){return window}var zu=2e3;function $u(n,e,t){return a(this,null,function*(){var r;let{BuildInfo:i}=we();M(e.sessionId,"AuthEvent did not contain a session ID");let s=yield Yu(e.sessionId),o={};return De()?o.ibi=i.packageName:Ne()?o.apn=i.packageName:A(n,"operation-not-supported-in-this-environment"),i.displayName&&(o.appDisplayName=i.displayName),o.sessionId=s,Vt(n,t,e.type,void 0,(r=e.eventId)!==null&&r!==void 0?r:void 0,o)})}function Gu(n){return a(this,null,function*(){let{BuildInfo:e}=we(),t={};De()?t.iosBundleId=e.packageName:Ne()?t.androidPackageName=e.packageName:A(n,"operation-not-supported-in-this-environment"),yield ti(n,t)})}function qu(n){let{cordova:e}=we();return new Promise(t=>{e.plugins.browsertab.isAvailable(r=>{let i=null;r?e.plugins.browsertab.openUrl(n):i=e.InAppBrowser.open(n,Cs()?"_blank":"_system","location=yes"),t(i)})})}function Ku(n,e,t){return a(this,null,function*(){let{cordova:r}=we(),i=()=>{};try{yield new Promise((s,o)=>{let c=null;function u(){var d;s();let p=(d=r.plugins.browsertab)===null||d===void 0?void 0:d.close;typeof p=="function"&&p(),typeof t?.close=="function"&&t.close()}function l(){c||(c=window.setTimeout(()=>{o(T(n,"redirect-cancelled-by-user"))},zu))}function f(){document?.visibilityState==="visible"&&l()}e.addPassiveListener(u),document.addEventListener("resume",l,!1),Ne()&&document.addEventListener("visibilitychange",f,!1),i=()=>{e.removePassiveListener(u),document.removeEventListener("resume",l,!1),document.removeEventListener("visibilitychange",f,!1),c&&window.clearTimeout(c)}})}finally{i()}})}function Ju(n){var e,t,r,i,s,o,c,u,l,f;let d=we();h(typeof((e=d?.universalLinks)===null||e===void 0?void 0:e.subscribe)=="function",n,"invalid-cordova-configuration",{missingPlugin:"cordova-universal-links-plugin-fix"}),h(typeof((t=d?.BuildInfo)===null||t===void 0?void 0:t.packageName)<"u",n,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-buildInfo"}),h(typeof((s=(i=(r=d?.cordova)===null||r===void 0?void 0:r.plugins)===null||i===void 0?void 0:i.browsertab)===null||s===void 0?void 0:s.openUrl)=="function",n,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),h(typeof((u=(c=(o=d?.cordova)===null||o===void 0?void 0:o.plugins)===null||c===void 0?void 0:c.browsertab)===null||u===void 0?void 0:u.isAvailable)=="function",n,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),h(typeof((f=(l=d?.cordova)===null||l===void 0?void 0:l.InAppBrowser)===null||f===void 0?void 0:f.open)=="function",n,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-inappbrowser"})}function Yu(n){return a(this,null,function*(){let e=Xu(n),t=yield crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map(i=>i.toString(16).padStart(2,"0")).join("")})}function Xu(n){if(M(/[0-9a-zA-Z]+/.test(n),"Can only convert alpha-numeric strings"),typeof TextEncoder<"u")return new TextEncoder().encode(n);let e=new ArrayBuffer(n.length),t=new Uint8Array(e);for(let r=0;r{this.resolveInitialized=e})}addPassiveListener(e){this.passiveListeners.add(e)}removePassiveListener(e){this.passiveListeners.delete(e)}resetRedirect(){this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1}onEvent(e){return this.resolveInitialized(),this.passiveListeners.forEach(t=>t(e)),super.onEvent(e)}initialized(){return a(this,null,function*(){yield this.initPromise})}};function Zu(n,e,t=null){return{type:e,eventId:t,urlResponse:null,sessionId:nl(),postBody:null,tenantId:n.tenantId,error:T(n,"no-auth-event")}}function el(n,e){return si()._set(oi(n),e)}function Js(n){return a(this,null,function*(){let e=yield si()._get(oi(n));return e&&(yield si()._remove(oi(n))),e})}function tl(n,e){var t,r;let i=il(e);if(i.includes("/__/auth/callback")){let s=Zt(i),o=s.firebaseError?rl(decodeURIComponent(s.firebaseError)):null,c=(r=(t=o?.code)===null||t===void 0?void 0:t.split("auth/"))===null||r===void 0?void 0:r[1],u=c?T(c):null;return u?{type:n.type,eventId:n.eventId,tenantId:n.tenantId,error:u,urlResponse:null,sessionId:null,postBody:null}:{type:n.type,eventId:n.eventId,tenantId:n.tenantId,sessionId:n.sessionId,urlResponse:i,postBody:null}}return null}function nl(){let n=[],e="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let t=0;ta(this,null,function*(){yield Js(e),t.onEvent(Ys())}),sl),c=f=>a(this,null,function*(){clearTimeout(o);let d=yield Js(e),p=null;d&&f?.url&&(p=tl(d,f.url)),t.onEvent(p||Ys())});typeof r<"u"&&typeof r.subscribe=="function"&&r.subscribe(null,c);let u=i,l=`${s.packageName.toLowerCase()}://`;we().handleOpenURL=f=>a(this,null,function*(){if(f.toLowerCase().startsWith(l)&&c({url:f}),typeof u=="function")try{u(f)}catch(d){console.error(d)}})}},Xs=ai;function Ys(){return{type:"unknown",eventId:null,sessionId:null,urlResponse:null,postBody:null,tenantId:null,error:T("no-auth-event")}}function Qs(n,e){v(n)._logFramework(e)}var al="@firebase/auth-compat",cl="0.5.14";var ul=1e3;function ht(){var n;return((n=self?.location)===null||n===void 0?void 0:n.protocol)||null}function ll(){return ht()==="http:"||ht()==="https:"}function to(n=w()){return!!((ht()==="file:"||ht()==="ionic:"||ht()==="capacitor:")&&n.toLowerCase().match(/iphone|ipad|ipod|android/))}function dl(){return He()||dn()}function hl(){return _t()&&document?.documentMode===11}function fl(n=w()){return/Edge\/\d+/.test(n)}function pl(n=w()){return hl()||fl(n)}function no(){try{let n=self.localStorage,e=_e();if(n)return n.setItem(e,"1"),n.removeItem(e),pl()?Te():!0}catch{return fi()&&Te()}return!1}function fi(){return typeof global<"u"&&"WorkerGlobalScope"in global&&"importScripts"in global}function ci(){return(ll()||gt()||to())&&!dl()&&no()&&!fi()}function ro(){return to()&&typeof document<"u"}function ml(){return a(this,null,function*(){return ro()?new Promise(n=>{let e=setTimeout(()=>{n(!1)},ul);document.addEventListener("deviceready",()=>{clearTimeout(e),n(!0)})}):!1})}function gl(){return typeof window<"u"?window:null}var N={LOCAL:"local",NONE:"none",SESSION:"session"},lt=h,io="persistence";function _l(n,e){if(lt(Object.values(N).includes(e),n,"invalid-persistence-type"),He()){lt(e!==N.SESSION,n,"unsupported-persistence-type");return}if(dn()){lt(e===N.NONE,n,"unsupported-persistence-type");return}if(fi()){lt(e===N.NONE||e===N.LOCAL&&Te(),n,"unsupported-persistence-type");return}lt(e===N.NONE||no(),n,"unsupported-persistence-type")}function ui(n){return a(this,null,function*(){yield n._initializationPromise;let e=so(),t=j(io,n.config.apiKey,n.name);e&&e.setItem(t,n._getPersistence())})}function vl(n,e){let t=so();if(!t)return[];let r=j(io,n,e);switch(t.getItem(r)){case N.NONE:return[ie];case N.LOCAL:return[ve,$];case N.SESSION:return[$];default:return[]}}function so(){var n;try{return((n=gl())===null||n===void 0?void 0:n.sessionStorage)||null}catch{return null}}var Il=h,G=class{constructor(){this.browserResolver=O(ni),this.cordovaResolver=O(Xs),this.underlyingResolver=null,this._redirectPersistence=$,this._completeRedirectFn=Ee,this._overrideRedirectResult=Me}_initialize(e){return a(this,null,function*(){return yield this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._initialize(e)})}_openPopup(e,t,r,i){return a(this,null,function*(){return yield this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openPopup(e,t,r,i)})}_openRedirect(e,t,r,i){return a(this,null,function*(){return yield this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openRedirect(e,t,r,i)})}_isIframeWebStorageSupported(e,t){this.assertedUnderlyingResolver._isIframeWebStorageSupported(e,t)}_originValidation(e){return this.assertedUnderlyingResolver._originValidation(e)}get _shouldInitProactively(){return ro()||this.browserResolver._shouldInitProactively}get assertedUnderlyingResolver(){return Il(this.underlyingResolver,"internal-error"),this.underlyingResolver}selectUnderlyingResolver(){return a(this,null,function*(){if(this.underlyingResolver)return;let e=yield ml();this.underlyingResolver=e?this.cordovaResolver:this.browserResolver})}};function oo(n){return n.unwrap()}function yl(n){return n.wrapped()}function El(n){return ao(n)}function wl(n,e){var t;let r=(t=e.customData)===null||t===void 0?void 0:t._tokenResponse;if(e?.code==="auth/multi-factor-auth-required"){let i=e;i.resolver=new di(n,Vr(n,e))}else if(r){let i=ao(e),s=e;i&&(s.credential=i,s.tenantId=r.tenantId||void 0,s.email=r.email||void 0,s.phoneNumber=r.phoneNumber||void 0)}}function ao(n){let{_tokenResponse:e}=n instanceof S?n.customData:n;if(!e)return null;if(!(n instanceof S)&&"temporaryProof"in e&&"phoneNumber"in e)return Ie.credentialFromResult(n);let t=e.providerId;if(!t||t===ge.PASSWORD)return null;let r;switch(t){case ge.GOOGLE:r=jt;break;case ge.FACEBOOK:r=Bt;break;case ge.GITHUB:r=zt;break;case ge.TWITTER:r=$t;break;default:let{oauthIdToken:i,oauthAccessToken:s,oauthTokenSecret:o,pendingToken:c,nonce:u}=e;return!s&&!o&&!i&&!c?null:c?t.startsWith("saml.")?fe._create(t,c):U._fromParams({providerId:t,signInMethod:t,pendingToken:c,idToken:i,accessToken:s}):new Ce(t).credential({idToken:i,accessToken:s,rawNonce:u})}return n instanceof S?r.credentialFromError(n):r.credentialFromResult(n)}function k(n,e){return e.catch(t=>{throw t instanceof S&&wl(n,t),t}).then(t=>{let r=t.operationType,i=t.user;return{operationType:r,credential:El(t),additionalUserInfo:Fr(t),user:Ue.getOrCreate(i)}})}function li(n,e){return a(this,null,function*(){let t=yield e;return{verificationId:t.verificationId,confirm:r=>k(n,t.confirm(r))}})}var di=class{constructor(e,t){this.resolver=t,this.auth=yl(e)}get session(){return this.resolver.session}get hints(){return this.resolver.hints}resolveSignIn(e){return k(oo(this.auth),this.resolver.resolveSignIn(e))}};var Ue=class n{constructor(e){this._delegate=e,this.multiFactor=Wr(e)}static getOrCreate(e){return n.USER_MAP.has(e)||n.USER_MAP.set(e,new n(e)),n.USER_MAP.get(e)}delete(){return this._delegate.delete()}reload(){return this._delegate.reload()}toJSON(){return this._delegate.toJSON()}getIdTokenResult(e){return this._delegate.getIdTokenResult(e)}getIdToken(e){return this._delegate.getIdToken(e)}linkAndRetrieveDataWithCredential(e){return this.linkWithCredential(e)}linkWithCredential(e){return a(this,null,function*(){return k(this.auth,qt(this._delegate,e))})}linkWithPhoneNumber(e,t){return a(this,null,function*(){return li(this.auth,jr(this._delegate,e,t))})}linkWithPopup(e){return a(this,null,function*(){return k(this.auth,Kr(this._delegate,e,G))})}linkWithRedirect(e){return a(this,null,function*(){return yield ui(v(this.auth)),Zr(this._delegate,e,G)})}reauthenticateAndRetrieveDataWithCredential(e){return this.reauthenticateWithCredential(e)}reauthenticateWithCredential(e){return a(this,null,function*(){return k(this.auth,Kt(this._delegate,e))})}reauthenticateWithPhoneNumber(e,t){return li(this.auth,zr(this._delegate,e,t))}reauthenticateWithPopup(e){return k(this.auth,qr(this._delegate,e,G))}reauthenticateWithRedirect(e){return a(this,null,function*(){return yield ui(v(this.auth)),Qr(this._delegate,e,G)})}sendEmailVerification(e){return Dr(this._delegate,e)}unlink(e){return a(this,null,function*(){return yield Ir(this._delegate,e),this})}updateEmail(e){return Mr(this._delegate,e)}updatePassword(e){return Ur(this._delegate,e)}updatePhoneNumber(e){return $r(this._delegate,e)}updateProfile(e){return xr(this._delegate,e)}verifyBeforeUpdateEmail(e,t){return Lr(this._delegate,e,t)}get emailVerified(){return this._delegate.emailVerified}get isAnonymous(){return this._delegate.isAnonymous}get metadata(){return this._delegate.metadata}get phoneNumber(){return this._delegate.phoneNumber}get providerData(){return this._delegate.providerData}get refreshToken(){return this._delegate.refreshToken}get tenantId(){return this._delegate.tenantId}get displayName(){return this._delegate.displayName}get email(){return this._delegate.email}get photoURL(){return this._delegate.photoURL}get providerId(){return this._delegate.providerId}get uid(){return this._delegate.uid}get auth(){return this._delegate.auth}};Ue.USER_MAP=new WeakMap;var dt=h,Zs=(()=>{class n{constructor(t,r){if(this.app=t,r.isInitialized()){this._delegate=r.getImmediate(),this.linkUnderlyingAuth();return}let{apiKey:i}=t.options;dt(i,"invalid-api-key",{appName:t.name}),dt(i,"invalid-api-key",{appName:t.name});let s=typeof window<"u"?G:void 0;this._delegate=r.initialize({options:{persistence:bl(i,t.name),popupRedirectResolver:s}}),this._delegate._updateErrorMap(lr),this.linkUnderlyingAuth()}get emulatorConfig(){return this._delegate.emulatorConfig}get currentUser(){return this._delegate.currentUser?Ue.getOrCreate(this._delegate.currentUser):null}get languageCode(){return this._delegate.languageCode}set languageCode(t){this._delegate.languageCode=t}get settings(){return this._delegate.settings}get tenantId(){return this._delegate.tenantId}set tenantId(t){this._delegate.tenantId=t}useDeviceLanguage(){this._delegate.useDeviceLanguage()}signOut(){return this._delegate.signOut()}useEmulator(t,r){_r(this._delegate,t,r)}applyActionCode(t){return Ar(this._delegate,t)}checkActionCode(t){return Yt(this._delegate,t)}confirmPasswordReset(t,r){return Tr(this._delegate,t,r)}createUserWithEmailAndPassword(t,r){return a(this,null,function*(){return k(this._delegate,Pr(this._delegate,t,r))})}fetchProvidersForEmail(t){return this.fetchSignInMethodsForEmail(t)}fetchSignInMethodsForEmail(t){return Nr(this._delegate,t)}isSignInWithEmailLink(t){return Cr(this._delegate,t)}getRedirectResult(){return a(this,null,function*(){dt(ci(),this._delegate,"operation-not-supported-in-this-environment");let t=yield ei(this._delegate,G);return t?k(this._delegate,Promise.resolve(t)):{credential:null,user:null}})}addFrameworkForLogging(t){Qs(this._delegate,t)}onAuthStateChanged(t,r,i){let{next:s,error:o,complete:c}=eo(t,r,i);return this._delegate.onAuthStateChanged(s,o,c)}onIdTokenChanged(t,r,i){let{next:s,error:o,complete:c}=eo(t,r,i);return this._delegate.onIdTokenChanged(s,o,c)}sendSignInLinkToEmail(t,r){return Or(this._delegate,t,r)}sendPasswordResetEmail(t,r){return br(this._delegate,t,r||void 0)}setPersistence(t){return a(this,null,function*(){_l(this._delegate,t);let r;switch(t){case N.SESSION:r=$;break;case N.LOCAL:r=(yield O(ve)._isAvailable())?ve:xe;break;case N.NONE:r=ie;break;default:return A("argument-error",{appName:this._delegate.name})}return this._delegate.setPersistence(r)})}signInAndRetrieveDataWithCredential(t){return this.signInWithCredential(t)}signInAnonymously(){return k(this._delegate,vr(this._delegate))}signInWithCredential(t){return k(this._delegate,Le(this._delegate,t))}signInWithCustomToken(t){return k(this._delegate,Er(this._delegate,t))}signInWithEmailAndPassword(t,r){return k(this._delegate,Rr(this._delegate,t,r))}signInWithEmailLink(t,r){return k(this._delegate,kr(this._delegate,t,r))}signInWithPhoneNumber(t,r){return li(this._delegate,Br(this._delegate,t,r))}signInWithPopup(t){return a(this,null,function*(){return dt(ci(),this._delegate,"operation-not-supported-in-this-environment"),k(this._delegate,Gr(this._delegate,t,G))})}signInWithRedirect(t){return a(this,null,function*(){return dt(ci(),this._delegate,"operation-not-supported-in-this-environment"),yield ui(this._delegate),Xr(this._delegate,t,G)})}updateCurrentUser(t){return this._delegate.updateCurrentUser(t)}verifyPasswordResetCode(t){return Sr(this._delegate,t)}unwrap(){return this._delegate}_delete(){return this._delegate._delete()}linkUnderlyingAuth(){this._delegate.wrapped=()=>this}}return n.Persistence=N,n})();function eo(n,e,t){let r=n;typeof n!="function"&&({next:r,error:e,complete:t}=n);let i=r;return{next:o=>i(o&&Ue.getOrCreate(o)),error:e,complete:t}}function bl(n,e){let t=vl(n,e);if(typeof self<"u"&&!t.includes(ve)&&t.push(ve),typeof window<"u")for(let r of[xe,$])t.includes(r)||t.push(r);return t.includes(ie)||t.push(ie),t}var ft=class{constructor(){this.providerId="phone",this._delegate=new Ie(oo(Tt.auth()))}static credential(e,t){return Ie.credential(e,t)}verifyPhoneNumber(e,t){return this._delegate.verifyPhoneNumber(e,t)}unwrap(){return this._delegate}};ft.PHONE_SIGN_IN_METHOD=Ie.PHONE_SIGN_IN_METHOD;ft.PROVIDER_ID=Ie.PROVIDER_ID;var Tl=h,hi=class{constructor(e,t,r=Tt.app()){var i;Tl((i=r.options)===null||i===void 0?void 0:i.apiKey,"invalid-api-key",{appName:r.name}),this._delegate=new rt(r.auth(),e,t),this.type=this._delegate.type}clear(){this._delegate.clear()}render(){return this._delegate.render()}verify(){return this._delegate.verify()}};var Al="auth-compat";function Sl(n){n.INTERNAL.registerComponent(new C(Al,e=>{let t=e.getProvider("app-compat").getImmediate(),r=e.getProvider("auth");return new Zs(t,r)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:oe.EMAIL_SIGNIN,PASSWORD_RESET:oe.PASSWORD_RESET,RECOVER_EMAIL:oe.RECOVER_EMAIL,REVERT_SECOND_FACTOR_ADDITION:oe.REVERT_SECOND_FACTOR_ADDITION,VERIFY_AND_CHANGE_EMAIL:oe.VERIFY_AND_CHANGE_EMAIL,VERIFY_EMAIL:oe.VERIFY_EMAIL}},EmailAuthProvider:ut,FacebookAuthProvider:Bt,GithubAuthProvider:zt,GoogleAuthProvider:jt,OAuthProvider:Ce,SAMLAuthProvider:nt,PhoneAuthProvider:ft,PhoneMultiFactorGenerator:ri,RecaptchaVerifier:hi,TwitterAuthProvider:$t,Auth:Zs,AuthCredential:z,Error:S}).setInstantiationMode("LAZY").setMultipleInstances(!1)),n.registerVersion(al,cl)}Sl(Tt);export{cd as a,ud as b,ld as c,Dn as d,dd as e,hd as f,ho as g,fo as h,Ti as i,mo as j,Pl as k,mt as l,Rl as m,Si as n,He as o,Ol as p,Te as q,D as r,yi as s,Cl as t,kl as u,Nl as v,fn as w,Dl as x,ki as y,Ll as z,ue as A,wi as B,xl as C,Ni as D,Ml as E,Ul as F,Fl as G,Vl as H,g as I,C as J,pn as K,je as L,_ as M,ee as N,K as O,J as P,_a as Q,x as R,Tt as S};