PageSourceSearch

https://app.napkin.ai/bundle/auth-web-lib/auth/auth.bundle.js?t=1790233294

js napkin.ai collected 2026-09-24 09:24:36 UTC 130,685 bytes, 3 lines download raw bytes

1/*! For license information please see auth.bundle.js.LICENSE.txt */
2var auth;(()=>{"use strict";const e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let t={};e.r(t),e.d(t,{FirebaseInterop:()=>Ii,FirebaseOptions:()=>_i,FirebaseUser:()=>vi,GoogleAuthzInterop:()=>Ei});const n=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},r={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:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t<e.length;
vendor: 4,281 bytes, line 2
2t+=3){const i=e[t],s=t+1<e.length,o=s?e[t+1]:0,a=t+2<e.length,c=a?e[t+2]:0,l=i>>2,h=(3&i)<<4|o>>4;let u=(15&o)<<2|c>>6,d=63&c;a||(d=64,s||(u=64)),r.push(n[l],n[h],n[u],n[d])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(n(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&s)}else if(i>239&&i<365){const s=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(s>>10)),t[r++]=String.fromCharCode(56320+(1023&s))}else{const s=e[n++],o=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&s)<<6|63&o)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t<e.length;){const s=n[e.charAt(t++)],o=t<e.length?n[e.charAt(t)]:0;++t;const a=t<e.length?n[e.charAt(t)]:64;++t;const c=t<e.length?n[e.charAt(t)]:64;if(++t,null==s||null==o||null==a||null==c)throw new i;const l=s<<2|o>>4;if(r.push(l),64!==a){const e=o<<4&240|a>>2;if(r.push(e),64!==c){const e=a<<6&192|c;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class i extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const s=function(e){return function(e){const t=n(e);return r.encodeByteArray(t,!0)}(e).replace(/\./g,"")},o=function(e){try{return r.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null},a=()=>{try{return function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof globalThis)return globalThis;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__||(()=>{if("undefined"==typeof process||void 0===process.env)return;const e=process.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&o(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}},c=()=>a()?.config,l=e=>a()?.[`_${e}`];class h{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}}function u(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}class d extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,d.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,p.prototype.create)}}class p{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],s=i?function(e,t){try{let n=0,r="";for(;n<e.length;){const i=e.indexOf("{$",n);if(-1===i){r+=e.substring(n);break}const s=e.indexOf("}",i+2);if(-1===s){r+=e.substring(n);break}const o=e.substring(i+2,s),a=t[o];r+=e.substring(n,i)+(null!=a?String(a):`<${o}?>`),n=s+1}return r}catch(t){return e}}(i,n):"Error",o=`${this.serviceName}: ${s} (${r}).`;return new d(r,o,n)}}function g(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const n=e[i],s=t[i];if(f(n)&&f(s)){if(!g(n,s))return!1}else if(n!==s)return!1}for(const e of r)if(!n.includes(e))return!1;return!0}function f(e){return null!==e&&"object"==typeof e}function m(e){const t=[];
2for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function _(e){const t={};return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){const[n,r]=e.split("=");t[decodeURIComponent(n)]=decodeURIComponent(r)}}),t}function v(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}class I{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(e=>{this.error(e)})}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,n){let r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=function(e){if("object"!=typeof e||null===e)return!1;for(const t of["next","error","complete"])if(t in e&&"function"==typeof e[t])return!0;return!1}(e)?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=w),void 0===r.error&&(r.error=w),void 0===r.complete&&(r.complete=w);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}}),this.observers.push(r),i}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function w(){}function y(e){return e&&e._delegate?e._delegate:e}function b(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}class E{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,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}}const T="[DEFAULT]";class P{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){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new h;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){const t=this.normalizeInstanceIdentifier(e?.identifier),n=e?.optional??!1;if(!this.isInitialized(t)&&!this.shouldAutoInitialize()){if(n)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(n)return null;throw e}}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(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:T})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e=T){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=T){return this.instances.has(e)}getOptions(e=T){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries())n===this.normalizeInstanceIdentifier(e)&&t.resolve(r);return r}onInit(e,t){const n=this.normalizeInstanceIdentifier(t),r=this.onInitCallbacks.get(n)??new Set;r.add(e),this.onInitCallbacks.set(n,r);const i=this.instances.get(n);return i&&e(i,n),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const r of n)try{r(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e,r===T?void 0:r),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch{}var r;return n||null}normalizeInstanceIdentifier(e=T){return this.component?this.component.multipleInstances?e:T:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class S{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const 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);const t=new P(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const C=[];var k;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.E
2RROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(k||(k={}));const R={debug:k.DEBUG,verbose:k.VERBOSE,info:k.INFO,warn:k.WARN,error:k.ERROR,silent:k.SILENT},A=k.INFO,O={[k.DEBUG]:"log",[k.VERBOSE]:"log",[k.INFO]:"info",[k.WARN]:"warn",[k.ERROR]:"error"},N=(e,t,...n)=>{if(t<e.logLevel)return;const r=(new Date).toISOString(),i=O[t];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[i](`[${r}]  ${e.name}:`,...n)};class U{constructor(e){this.name=e,this._logLevel=A,this._logHandler=N,this._userLogHandler=null,C.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in k))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?R[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,k.DEBUG,...e),this._logHandler(this,k.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,k.VERBOSE,...e),this._logHandler(this,k.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,k.INFO,...e),this._logHandler(this,k.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,k.WARN,...e),this._logHandler(this,k.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,k.ERROR,...e),this._logHandler(this,k.ERROR,...e)}}let D,L;const F=new WeakMap,M=new WeakMap,x=new WeakMap,V=new WeakMap,W=new WeakMap;let j={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return M.get(e);if("objectStoreNames"===t)return e.objectStoreNames||x.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return B(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function H(e){return"function"==typeof e?(t=e)!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(L||(L=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply($(this),e),B(F.get(this))}:function(...e){return B(t.apply($(this),e))}:function(e,...n){const r=t.call($(this),e,...n);return x.set(r,e.sort?e.sort():[e]),B(r)}:(e instanceof IDBTransaction&&function(e){if(M.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",s),e.removeEventListener("abort",s)},i=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",s),e.addEventListener("abort",s)});M.set(e,t)}(e),n=e,(D||(D=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>n instanceof e)?new Proxy(e,j):e);var t,n}function B(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",s)},i=()=>{t(B(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&F.set(t,e)}).catch(()=>{}),W.set(t,e),t}(e);if(V.has(e))return V.get(e);const t=H(e);return t!==e&&(V.set(e,t),W.set(t,e)),t}const $=e=>W.get(e),z=["get","getKey","getAll","getAllKeys","count"],G=["put","add","delete","clear"],K=new Map;function J(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(K.get(t))return K.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=G.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!z.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,i?"readwrite":"readonly");let o=s.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&s.done]))[0]};return K.set(t,s),s}var q;q=j,j={...q,get:(e,t,n)=>J(e,t)||q.get(e,t,n),has:(e,t)=>!!J(e,t)||q.has(e,t)};class Y{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===t?.type}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null}).filter(e=>e).join(" ")}}const X="@firebase/app",Q="0.16.1",Z=new U("@firebase/app"),ee="@firebase/app-compat",te="@firebase/analytics-compat",ne="@firebase/analytics",re="@firebase/app-check-compat",ie="@firebase/app-check",se="@firebase/auth",oe="@firebase/auth-compat",ae="@firebase/database",ce="@firebase/data-connect",le="@firebase/database-compat",he="@firebase/functions",ue="@firebase/functions-compat",de="@firebase/installations",pe="@firebase/installations-compat",ge="@firebase/messaging",fe="@firebase/messaging-compat",me="@firebase/performance",_e="@firebase/performance-compat",ve="@firebase/remote-config",Ie="@firebase/remote-config-compat",we="@firebase/storage",ye="@firebase/storage-compat",be="@firebase/firestore",Ee="@firebase/ai",Te="@firebase/firestore-compat",Pe="firebase",Se="[DEFAULT]",Ce={[X]:"fire-core",[ee]:"fire-core-compat",[ne]:"fire-analytics",[te]:"fire-analytics-compat",[ie]:"fire-app-check",[re]:"fire-app-check-compat",[se]:"fire-auth",[oe]:"fire-auth-compat",[ae]:"fire-rtdb",[ce]:"fire-data-connect",[le]:"fire-rtdb-compat",[he]:"fire-fn",[ue]:"fire-fn-compat",[de]:"fire-iid",[pe]:"fire-iid-compat",[ge]:"fire-fcm",[fe]:"fire-fcm-compat",[me]:"fire-perf",[_e]:"fire-perf-compat",[ve]:"fire-rc",[Ie]:"fire-rc-compat",[we]:"fire-g
2cs",[ye]:"fire-gcs-compat",[be]:"fire-fst",[Te]:"fire-fst-compat",[Ee]:"fire-vertex","fire-js":"fire-js",[Pe]:"fire-js-all"},ke=new Map,Re=new Map,Ae=new Map;function Oe(e,t){try{e.container.addComponent(t)}catch(n){Z.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function Ne(e){const t=e.name;if(Ae.has(t))return Z.debug(`There were multiple attempts to register component ${t}.`),!1;Ae.set(t,e);for(const t of ke.values())Oe(t,e);for(const t of Re.values())Oe(t,e);return!0}function Ue(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function De(e){return null!=e&&void 0!==e.settings}const Le=new p("app","Firebase",{"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 {$mismatchedParam}. Existing: '{$oldValue}'. New: '{$newValue}'.","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.","invali
2d-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."});class Fe{constructor(e,t,n){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new E("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 Le.create("app-deleted",{appName:this._name})}}const Me="12.18.0";function xe(e,t={}){let n=e;"object"!=typeof t&&(t={name:t});const r={name:Se,automaticDataCollectionEnabled:!0,...t},i=r.name;if("string"!=typeof i||!i)throw Le.create("bad-app-name",{appName:String(i)});if(n||(n=c()),!n)throw Le.create("no-options");const s=ke.get(i);if(s){if(g(n,s.options)){if(g(r,s.config))return s;throw Le.create("duplicate-app",{appName:i,mismatchedParam:"config",oldValue:JSON.stringify(s.config),newValue:JSON.stringify(r)})}throw Le.create("duplicate-app",{appName:i,mismatchedParam:"options",oldValue:JSON.stringify(s.options),newValue:JSON.stringify(n)})}const o=new S(i);for(const e of Ae.values())o.addComponent(e);const a=new Fe(n,r,o);return ke.set(i,a),a}function Ve(e=Se){const t=ke.get(e);if(!t&&e===Se&&c())return xe();if(!t)throw Le.create("no-app",{appName:e});return t}function We(e,t,n){let r=Ce[e]??e;n&&(r+=`-${n}`);const i=r.match(/\s|\//),s=t.match(/\s|\//);if(i||s){const e=[`Unable to register library "${r}" with version "${t}":`];return i&&e.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&s&&e.push("and"),s&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void Z.warn(e.join(" "))}Ne(new E(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}const je="firebase-heartbeat-store";let He=null;function Be(){return He||(He=function(e,t,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(e,t),a=B(o);return r&&o.addEventListener("upgradeneeded",e=>{r(B(o.result),e.oldVersion,e.newVersion,B(o.transaction),e)}),n&&o.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),a.then(e=>{s&&e.addEventListener("close",()=>s()),i&&e.addEventListener("versionchange",e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(je)}catch(e){console.warn(e)}}}).catch(e=>{throw Le.create("idb-open",{originalErrorMessage:e.message})})),He}async function $e(e,t){try{const n=(await Be()).transaction(je,"readwrite"),r=n.objectStore(je);await r.put(t,ze(e)),await n.done}catch(e){if(e instanceof d)Z.warn(e.message);else{const t=Le.create("idb-set",{originalErrorMessage:e?.message});Z.warn(t.message)}}}function ze(e){return`${e.name}!${e.options.appId}`}class Ge{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Je(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){try{const e=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),t=Ke();if(null==this._heartbeatsCache?.heartbeats&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==this._heartbeatsCache?.heartbeats))return;if(this._heartbeatsCache.lastSentHeartbeatDate===t||this._heartbeatsCache.heartbeats.some(e=>e.date===t))return;if(this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats.length>30){const e=function(e){if(0===e.length)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){Z.warn(e)}}async getHeartbeatsHeader(){try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==this._heartbeatsCache?.heartbeats||0===this._heartbeatsCache.heartbeats.length)return"";const e=Ke(),{heartbeatsToSend:t,unsentEntries:n}=function(e,t=1024){const n=[];let r=e.slice();for(const i of e){const e=n.find(e=>e.agent===i.agent);if(e){if(e.dates.push(i.date),qe(n)>t){e.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),qe(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),r=s(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}catch(e){return Z.warn(e),""}}}function Ke(){return(new Date).toISOString().substring(0,10)}class Je{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!function(){try{return"object"==typeof indexedDB}catch(e){return!1}}()&&new Promise((e,t)=>
2{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{t(i.error?.message||"")}}catch(e){t(e)}}).then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await Be()).transaction(je),n=await t.objectStore(je).get(ze(e));return await t.done,n}catch(e){if(e instanceof d)Z.warn(e.message);else{const t=Le.create("idb-get",{originalErrorMessage:e?.message});Z.warn(t.message)}}}(this.app);return e?.heartbeats?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const t=await this.read();return $e(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){if(await this._canUseIndexedDBPromise){const t=await this.read();return $e(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:[...t.heartbeats,...e.heartbeats]})}}}function qe(e){return s(JSON.stringify({version:2,heartbeats:e})).length}Ne(new E("platform-logger",e=>new Y(e),"PRIVATE")),Ne(new E("heartbeat",e=>new Ge(e),"PRIVATE")),We(X,Q,""),We(X,Q,"esm2020"),We("fire-js",""),We("firebase","12.18.0","app");const Ye=function(){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."}},Xe=new p("auth","Firebase",{"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."}
vendor: 5,209 bytes, line 2
2),Qe=new U("@firebase/auth");function Ze(e,...t){Qe.logLevel<=k.WARN&&Qe.warn(`Auth (${Me}): ${e}`,...t)}function et(e,...t){Qe.logLevel<=k.ERROR&&Qe.error(`Auth (${Me}): ${e}`,...t)}function tt(e,...t){throw ot(e,...t)}function nt(e,...t){return ot(e,...t)}function rt(e,t,n){const r={...Ye(),[t]:n};return new p("auth","Firebase",r).create(t,{appName:e.name})}function it(e){return rt(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function st(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&tt(e,"argument-error"),rt(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function ot(e,...t){if("string"!=typeof e){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return Xe.create(e,...t)}function at(e,t,...n){if(!e)throw ot(t,...n)}function ct(e){const t="INTERNAL ASSERTION FAILED: "+e;throw et(t),new Error(t)}function lt(e,t){e||ct(t)}function ht(){return"undefined"!=typeof self&&self.location?.href||""}function ut(){return"undefined"!=typeof self&&self.location?.protocol||null}function dt(){return!("undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&("http:"===ut()||"https:"===ut()||function(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}()||"connection"in navigator))||navigator.onLine}class pt{constructor(e,t){this.shortDelay=e,this.longDelay=t,lt(t>e,"Short delay should be less than long delay!"),this.isMobile="undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(u())||"object"==typeof navigator&&"ReactNative"===navigator.product}get(){return dt()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function gt(e,t){lt(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}class ft{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void ct("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void ct("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void ct("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const mt={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-rec
2aptcha-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"},_t=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],vt=new pt(3e4,6e4);function It(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function wt(e,t,n,r,i={}){return yt(e,i,async()=>{let i={},s={};r&&("GET"===t?s=r:i={body:JSON.stringify(r)});const o=m({...s,key:e.config.apiKey}).slice(1),a=await e._getAdditionalHeaders();a["Content-Type"]="application/json",e.languageCode&&(a["X-Firebase-Locale"]=e.languageCode);const c={method:t,headers:a,...i};return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||(c.referrerPolicy="strict-origin-when-cross-origin"),e.emulatorConfig&&b(e.emulatorConfig.host)&&(c.credentials="include"),ft.fetch()(await Et(e,e.config.apiHost,n,o),c)})}async function yt(e,t,n){e._canInitEmulator=!1;const r={...mt,...t};try{const t=new Pt(e),i=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const s=await i.json();if("needConfirmation"in s)throw St(e,"account-exists-with-different-credential",s);if(i.ok&&!("errorMessage"in s))return s;{const t=i.ok?s.errorMessage:s.error.message,[n,o]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw St(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===n)throw St(e,"email-already-in-use",s);if("USER_DISABLED"===n)throw St(e,"user-disabled",s);const a=r[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(o)throw rt(e,a,o);tt(e,a)}}catch(t){if(t instanceof d)throw t;tt(e,"network-request-failed",{message:String(t)})}}async function bt(e,t,n,r,i={}){const s=await wt(e,t,n,r,i);return"mfaPendingCredential"in s&&tt(e,"multi-factor-auth-required",{_serverResponse:s}),s}async function Et(e,t,n,r){const i=`${t}${n}?${r}`,s=e,o=s.config.emulator?gt(e.config,i):`${e.config.apiScheme}://${i}`;return _t.includes(n)&&(await s._persistenceManagerAvailable,"COOKIE"===s._getPersistenceType())?s._getPersistence()._getFinalTarget(o).toString():o}function Tt(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Pt{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(nt(this.auth,"network-request-failed")),vt.get())})}}function St(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=nt(e,t,r);return i.customData._tokenResponse=n,i}function Ct(e){return void 0!==e&&void 0!==e.enterprise}class kt{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return Tt(t.enforcementState);return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function Rt(e,t){return wt(e,"GET","/v2/recaptchaConfig",It(e,t))}async function At(e,t){return wt(e,"POST","/v1/accounts:lookup",t)}function Ot(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}function Nt(e){return 1e3*Number(e)}function Ut(e){const[t,n,r]=e.split(".");if(void 0===t||void 0===n||void 0===r)return et("JWT malformed, contained fewer than 3 sections"),null;try{const e=o(n);return e?JSON.parse(e):(et("Failed to decode base64 JWT payload"),null)}catch(e){return et("Caught error parsing JWT payload as JSON",e?.toString()),null}}function Dt(e){const t=Ut(e);return at(t,"internal-error"),at(void 0!==t.exp,"internal-error"),at(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function Lt(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t instanceof d&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}class Ft{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,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,e)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void("auth/network-request-failed"===e?.code&&this.schedule(!0))}this.schedule()}}class Mt{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=Ot(this.lastLoginAt),this.creationTime=Ot(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function xt(e){const t=e.auth,n=await e.getIdToken(),r=await Lt(e,At(t,{idToken:n}));at(r?.users.length,t,"internal-error");const i=r.users[0];e._notifyReloadListener(i);const s=i.providerUserInfo?.length?Vt(i.providerUserInfo):[],o=(a=e.providerData,c=s,[...a.filter(e=>!c.some(t=>t.providerId===e.providerId)),...c]);var a,c;const l=e.isAnonymous,h=!(e.email&&i.passwordHash||o?.length),u=!!l&&h,d={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:o,metadata:new Mt(i.createdAt,i.lastLoginAt),isAnonymous:u};Object.assign(e,d)}function Vt(e){return e.map(({providerId:e,...t})=>
vendor: 5,438 bytes, line 2
2({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}class Wt{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){at(e.idToken,"internal-error"),at(void 0!==e.idToken,"internal-error"),at(void 0!==e.refreshToken,"internal-error");const t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):Dt(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){at(0!==e.length,"internal-error");const t=Dt(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(at(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:r,expiresIn:i}=await async function(e,t){const n=await yt(e,{},async()=>{const n=m({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:i}=e.config,s=await Et(e,r,"/v1/token",`key=${i}`),o=await e._getAdditionalHeaders();o["Content-Type"]="application/x-www-form-urlencoded";const a={method:"POST",headers:o,body:n};return e.emulatorConfig&&b(e.emulatorConfig.host)&&(a.credentials="include"),ft.fetch()(s,a)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,r,Number(i))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:r,expirationTime:i}=t,s=new Wt;return n&&(at("string"==typeof n,"internal-error",{appName:e}),s.refreshToken=n),r&&(at("string"==typeof r,"internal-error",{appName:e}),s.accessToken=r),i&&(at("number"==typeof i,"internal-error",{appName:e}),s.expirationTime=i),s}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 Wt,this.toJSON())}_performRefresh(){return ct("not implemented")}}function jt(e,t){at("string"==typeof e||void 0===e,"internal-error",{appName:t})}class Ht{constructor({uid:e,auth:t,stsTokenManager:n,...r}){this.providerId="firebase",this.proactiveRefresh=new Ft(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=n,this.accessToken=n.accessToken,this.displayName=r.displayName||null,this.email=r.email||null,this.emailVerified=r.emailVerified||!1,this.phoneNumber=r.phoneNumber||null,this.photoURL=r.photoURL||null,this.isAnonymous=r.isAnonymous||!1,this.tenantId=r.tenantId||null,this.providerData=r.providerData?[...r.providerData]:[],this.metadata=new Mt(r.createdAt||void 0,r.lastLoginAt||void 0)}async getIdToken(e){const t=await Lt(this,this.stsTokenManager.getToken(this.auth,e));return at(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e,t=!1){const n=y(e),r=await n.getIdToken(t),i=Ut(r);at(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const s="object"==typeof i.firebase?i.firebase:void 0,o=s?.sign_in_provider;return{claims:i,token:r,authTime:Ot(Nt(i.auth_time)),issuedAtTime:Ot(Nt(i.iat)),expirationTime:Ot(Nt(i.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}}(this,e)}reload(){return async function(e){const t=y(e);await xt(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(at(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(e=>({...e})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new Ht({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){at(!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()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await xt(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(De(this.auth.app))return Promise.reject(it(this.auth));const e=await this.getIdToken();return await Lt(this,async function(e,t){return wt(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isA
2nonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...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){const n=t.displayName??void 0,r=t.email??void 0,i=t.phoneNumber??void 0,s=t.photoURL??void 0,o=t.tenantId??void 0,a=t._redirectEventId??void 0,c=t.createdAt??void 0,l=t.lastLoginAt??void 0,{uid:h,emailVerified:u,isAnonymous:d,providerData:p,stsTokenManager:g}=t;at(h&&g,e,"internal-error");const f=Wt.fromJSON(this.name,g);at("string"==typeof h,e,"internal-error"),jt(n,e.name),jt(r,e.name),at("boolean"==typeof u,e,"internal-error"),at("boolean"==typeof d,e,"internal-error"),jt(i,e.name),jt(s,e.name),jt(o,e.name),jt(a,e.name),jt(c,e.name),jt(l,e.name);const m=new Ht({uid:h,auth:e,email:r,emailVerified:u,displayName:n,isAnonymous:d,photoURL:s,phoneNumber:i,tenantId:o,stsTokenManager:f,createdAt:c,lastLoginAt:l});return p&&Array.isArray(p)&&(m.providerData=p.map(e=>({...e}))),a&&(m._redirectEventId=a),m}static async _fromIdTokenResponse(e,t,n=!1){const r=new Wt;r.updateFromServerResponse(t);const i=new Ht({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:n});return await xt(i),i}static async _fromGetAccountInfoResponse(e,t,n){const r=t.users[0];at(void 0!==r.localId,"internal-error");const i=void 0!==r.providerUserInfo?Vt(r.providerUserInfo):[],s=!(r.email&&r.passwordHash||i?.length),o=new Wt;o.updateFromIdToken(n);const a=new Ht({uid:r.localId,auth:e,stsTokenManager:o,isAnonymous:s}),c={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:i,metadata:new Mt(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash||i?.length)};return Object.assign(a,c),a}}const Bt=new Map;function $t(e){lt(e instanceof Function,"Expected a class definition");let t=Bt.get(e);return t?(lt(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Bt.set(e,t),t)}class zt{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}zt.type="NONE";const Gt=zt;function Kt(e,t,n){return`firebase:${e}:${t}:${n}`}class Jt{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:r,name:i}=this.auth;this.fullUserKey=Kt(this.userKey,r.apiKey,i),this.fullPersistenceKey=Kt("persistence",r.apiKey,i),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if("string"==typeof e){const t=await At(this.auth,{idToken:e}).catch(()=>{});return t?Ht._fromGetAccountInfoResponse(this.auth,t,e):null}return Ht._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,n="authUser"){if(!t.length)return new Jt($t(Gt),e,n);const r=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e);let i=r[0]||$t(Gt);const s=Kt(n,e.config.apiKey,e.name);let o=null;for(const n of t)try{const t=await n._get(s);if(t){let r;if("string"==typeof t){const n=await At(e,{idToken:t}).catch(()=>{});if(!n)break;r=await Ht._fromGetAccountInfoResponse(e,n,t)}else r=Ht._fromJSON(e,t);n!==i&&(o=r),i=n;break}}catch{}const a=r.filter(e=>e._shouldAllowMigration);return i._shouldAllowMigration&&a.length?(i=a[0],o&&await i._set(s,o.toJSON()),await Promise.all(t.map(async e=>{if(e!==i)try{await e._remove(s)}catch{}})),new Jt(i,e,n)):new Jt(i,e,n)}}function qt(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Zt(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Yt(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(tn(t))return"Blackberry";if(nn(t))return"Webos";if(Xt(t))return"Safari";
vendor: 5,216 bytes, line 2
2if((t.includes("chrome/")||Qt(t))&&!t.includes("edge/"))return"Chrome";if(en(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===n?.length)return n[1]}return"Other"}function Yt(e=u()){return/firefox\//i.test(e)}function Xt(e=u()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Qt(e=u()){return/crios\//i.test(e)}function Zt(e=u()){return/iemobile/i.test(e)}function en(e=u()){return/android/i.test(e)}function tn(e=u()){return/blackberry/i.test(e)}function nn(e=u()){return/webos/i.test(e)}function rn(e=u()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function sn(e=u()){return rn(e)||en(e)||nn(e)||tn(e)||/windows phone/i.test(e)||Zt(e)}function on(e,t=[]){let n;switch(e){case"Browser":n=qt(u());break;case"Worker":n=`${qt(u())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${Me}/${r}`}class an{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise((n,r)=>{try{n(e(t))}catch(e){r(e)}});n.onAbort=t,this.queue.push(n);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(e){t.reverse();for(const e of t)try{e()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:e?.message})}}}class cn{constructor(e){const t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??6,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),void 0!==t.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),void 0!==t.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),void 0!==t.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),void 0!==t.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let r=0;r<e.length;r++)n=e.charAt(r),this.updatePasswordCharacterOptionsStatuses(t,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,r,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=i))}}class ln{constructor(e,t,n,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new un(this),this.idTokenSubscription=new un(this),this.beforeStateQueue=new an(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=Xe,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion,this._persistenceManagerAvailable=new Promise(e=>this._resolvePersistenceManagerAvailable=e)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=$t(t)),this._initializationPromise=this.queue(async()=>
2{if(!this._deleted&&(this.persistenceManager=await Jt.create(this,e),this._resolvePersistenceManagerAvailable?.(),!this._deleted)){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}await this.initializeCurrentUser(t),this.lastNotifiedUid=this.currentUser?.uid||null,this._deleted||(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0):void 0}async initializeCurrentUserFromIdToken(e){try{const t=await At(this,{idToken:e}),n=await Ht._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(n)}catch(e){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",e),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(De(this.app)){const e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}const t=await this.assertedPersistence.getCurrentUser();let n=t,r=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const t=this.redirectUser?._redirectEventId,i=n?._redirectEventId,s=await this.tryRedirectSignIn(e);t&&t!==i||!s?.user||(n=s.user,r=!0)}if(!n)return this.directlySetCurrentUser(null);if(!n._redirectEventId){if(r)try{await this.beforeStateQueue.runMiddleware(n)}catch(e){n=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return n?this.reloadAndSetCurrentUserOrClear(n):this.directlySetCurrentUser(null)}return at(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===n._redirectEventId?this.directlySetCurrentUser(n):this.reloadAndSetCurrentUserOrClear(n)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await xt(e)}catch(e){if("auth/network-request-failed"!==e?.code)return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(De(this.app))return Promise.reject(it(this));const t=e?y(e):null;return t&&at(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&at(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return De(this.app)?Promise.reject(it(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return De(this.app)?Promise.reject(it(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence($t(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const 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 null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e,t={}){return wt(e,"GET","/v2/passwordPolicy",It(e,t))}(this),t=new cn(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new p("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise((e,t)=>
2{if(this.currentUser)e();else{const n=this.onAuthStateChanged(()=>{n(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await async function(e,t){return wt(e,"POST","/v2/accounts:revokeToken",It(e,t))}(this,t)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&$t(e)||this._popupRedirectResolver;at(t,this,"argument-error"),this.redirectPersistenceManager=await Jt.create(this,[$t(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e?this._currentUser:this.redirectUser?._redirectEventId===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>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(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,r){if(this._deleted)return()=>{};const i="function"==typeof t?t:t.next.bind(t);let s=!1;const o=this._isInitialized?Promise.resolve():this._initializationPromise;if(at(o,this,"internal-error"),o.then(()=>{s||i(this.currentUser)}),"function"==typeof t){const i=e.addObserver(t,n,r);return()=>{s=!0,i()}}{const n=e.addObserver(t);return()=>{s=!0,n()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return at(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=on(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const t=await(this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader());t&&(e["X-Firebase-Client"]=t);const n=await this._getAppCheckToken();return n&&(e["X-Firebase-AppCheck"]=n),e}async _getAppCheckToken(){if(De(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await(this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken());return e?.error&&Ze(`Error while retrieving App Check token: ${e.error}`),e?.token}}function hn(e){return y(e)}class un{constructor(e){this.auth=e,this.observer=null,this.addObserver=function(e){const t=new I(e,void 0);return t.subscribe.bind(t)}(e=>this.observer=e)}get next(){return at(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let dn={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function pn(e){return dn.loadJS(e)}function gn(e){return`__${e}${Math.floor(1e6*Math.random())}`}class fn{constructor(){this.enterprise=new mn}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class mn{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}const _n="NO_RECAPTCHA",vn="onFirebaseAuthREInstanceReady";class In{constructor(e){this.type="recaptcha-enterprise",this.auth=hn(e)}async verify(e="verify",t=!1){function n(t,n,r){const i=window.grecaptcha;Ct(i)?i.enterprise.ready(()=>{i.enterprise.execute(t,{action:e}).then(e=>{n(e)}).catch(()=>{n(_n)})}):r(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?(new fn).execute("siteKey",{action:"verify"}):new Promise((e,r)=>{(async function(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,n)=>
2{Rt(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(r=>{if(void 0!==r.recaptchaKey){const n=new kt(r);return null==e.tenantId?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))}).catch(e=>{n(e)})})})(this.auth).then(async i=>{if(!t&&Ct(window.grecaptcha)&&In.scriptInjectionDeferred)await In.scriptInjectionDeferred.promise,n(i,e,r);else{if("undefined"==typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));let t=dn.recaptchaEnterpriseScript;0!==t.length&&(t+=i+`&onload=${vn}`),In.scriptInjectionDeferred=new h,window[vn]=()=>{In.scriptInjectionDeferred?.resolve()},pn(t).then(()=>In.scriptInjectionDeferred?.promise).then(()=>{n(i,e,r)}).catch(e=>{r(e)})}}).catch(e=>{r(e)})})}}async function wn(e,t,n,r=!1,i=!1){const s=new In(e);let o;if(i)o=_n;else try{o=await s.verify(n)}catch(e){o=await s.verify(n,!0)}const a={...t};if("mfaSmsEnrollment"===n||"mfaSmsSignIn"===n){if("phoneEnrollmentInfo"in a){const e=a.phoneEnrollmentInfo.phoneNumber,t=a.phoneEnrollmentInfo.recaptchaToken;Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:t,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in a){const e=a.phoneSignInInfo.recaptchaToken;Object.assign(a,{phoneSignInInfo:{recaptchaToken:e,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return a}return r?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function yn(e,t,n,r,i){if("EMAIL_PASSWORD_PROVIDER"===i){if(e._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const i=await wn(e,t,n,"getOobCode"===n);return r(e,i)}return r(e,t).catch(async i=>{if("auth/missing-recaptcha-token"===i.code){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const i=await wn(e,t,n,"getOobCode"===n);return r(e,i)}return Promise.reject(i)})}if("PHONE_PROVIDER"===i){if(e._getRecaptchaConfig()?.isProviderEnabled("PHONE_PROVIDER")){const i=await wn(e,t,n);return r(e,i).catch(async i=>{if("AUDIT"===e._getRecaptchaConfig()?.getProviderEnforcementState("PHONE_PROVIDER")&&("auth/missing-recaptcha-token"===i.code||"auth/invalid-app-credential"===i.code)){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${n} flow.`);const i=await wn(e,t,n,!1,!0);return r(e,i)}return Promise.reject(i)})}{const i=await wn(e,t,n,!1,!0);return r(e,i)}}return Promise.reject(i+" provider is not supported.")}function bn(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function En(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}In.scriptInjectionDeferred=null;class Tn{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return ct("not implemented")}_getIdTokenResponse(e){return ct("not implemented")}_linkToIdToken(e,t){return ct("not implemented")}_getReauthenticationResolver(e){return ct("not implemented")}}async function Pn(e,t){return wt(e,"POST","/v1/accounts:signUp",t)}async function Sn(e,t){return bt(e,"POST","/v1/accounts:signInWithPassword",It(e,t))}class Cn extends Tn{constructor(e,t,n,r=null){super("password",n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new Cn(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new Cn(e,t,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e;if(t?.email&&t?.password){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return yn(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",Sn,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return async function(e,t){return bt(e,"POST","/v1/accounts:signInWithEmailLink",It(e,t))}(e,{email:this._email,oobCode:this._password});default:tt(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return yn(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Pn,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return async function(e,t){return bt(e,"POST","/v1/accounts:signInWithEmailLink",It(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:tt(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function kn(e,t){return bt(e,"POST","/v1/accounts:signInWithIdp",It(e,t))}class Rn extends Tn{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Rn(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&&
vendor: 4,927 bytes, line 2
2(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):tt("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){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r,...i}=t;if(!n||!r)return null;const s=new Rn(n,r);return s.idToken=i.idToken||void 0,s.accessToken=i.accessToken||void 0,s.secret=i.secret,s.nonce=i.nonce,s.pendingToken=i.pendingToken||null,s}_getIdTokenResponse(e){return kn(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,kn(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,kn(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const 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=m(t)}return e}}async function An(e,t){return wt(e,"POST","/v1/accounts:sendVerificationCode",It(e,t))}const On={USER_NOT_FOUND:"user-not-found"};class Nn extends Tn{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new Nn({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new Nn({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return async function(e,t){return bt(e,"POST","/v1/accounts:signInWithPhoneNumber",It(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){const n=await bt(e,"POST","/v1/accounts:signInWithPhoneNumber",It(e,t));if(n.temporaryProof)throw St(e,"account-exists-with-different-credential",n);return n}(e,{idToken:t,...this._makeVerificationRequest()})}_getReauthenticationResolver(e){return async function(e,t){return bt(e,"POST","/v1/accounts:signInWithPhoneNumber",It(e,{...t,operation:"REAUTH"}),On)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:r}}toJSON(){const 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){"string"==typeof e&&(e=JSON.parse(e));const{verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}=e;return n||t||r||i?new Nn({verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}):null}}class Un{constructor(e){const t=_(v(e)),n=t.apiKey??null,r=t.oobCode??null,i=function(e){switch(e){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}}(t.mode??null);at(n&&r&&i,"argument-error"),this.apiKey=n,this.operation=i,this.code=r,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(e){const t=function(e){const t=_(v(e)).link,n=t?_(v(t)).deep_link_id:null,r=_(v(e)).deep_link_id;return(r?_(v(r)).link:null)||r||n||t||e}(e);try{return new Un(t)}catch{return null}}}class Dn{constructor(){this.providerId=Dn.PROVIDER_ID}static credential(e,t){return Cn._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=Un.parseLink(t);return at(n,"argument-error"),Cn._fromEmailAndCode(e,n.code,n.tenantId)}}Dn.PROVIDER_ID="password",Dn.EMAIL_PASSWORD_SIGN_IN_METHOD="password",Dn.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class Ln{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}}class Fn extends Ln{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class Mn extends Fn{static credentialFromJSON(e){const t="string"==typeof e?JSON.parse(e):e;return at("providerId"in t&&"signInMethod"in t,"argument-error"),Rn._fromParams(t)}credential(e){return this._credential({...e,nonce:e.rawNonce})}_credential(e){return at(e.idToken||e.accessToken,"argument-error"),Rn._fromParams({...e,providerId:this.providerId,sign
vendor: 4,334 bytes, line 2
2InMethod:this.providerId})}static credentialFromResult(e){return Mn.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return Mn.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n,oauthTokenSecret:r,pendingToken:i,nonce:s,providerId:o}=e;if(!(n||r||t||i))return null;if(!o)return null;try{return new Mn(o)._credential({idToken:t,accessToken:n,nonce:s,pendingToken:i})}catch(e){return null}}}class xn extends Fn{constructor(){super("facebook.com")}static credential(e){return Rn._fromParams({providerId:xn.PROVIDER_ID,signInMethod:xn.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return xn.credentialFromTaggedObject(e)}static credentialFromError(e){return xn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return xn.credential(e.oauthAccessToken)}catch{return null}}}xn.FACEBOOK_SIGN_IN_METHOD="facebook.com",xn.PROVIDER_ID="facebook.com";class Vn extends Fn{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Rn._fromParams({providerId:Vn.PROVIDER_ID,signInMethod:Vn.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return Vn.credentialFromTaggedObject(e)}static credentialFromError(e){return Vn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return Vn.credential(t,n)}catch{return null}}}Vn.GOOGLE_SIGN_IN_METHOD="google.com",Vn.PROVIDER_ID="google.com";class Wn extends Fn{constructor(){super("github.com")}static credential(e){return Rn._fromParams({providerId:Wn.PROVIDER_ID,signInMethod:Wn.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Wn.credentialFromTaggedObject(e)}static credentialFromError(e){return Wn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Wn.credential(e.oauthAccessToken)}catch{return null}}}Wn.GITHUB_SIGN_IN_METHOD="github.com",Wn.PROVIDER_ID="github.com";class jn extends Fn{constructor(){super("twitter.com")}static credential(e,t){return Rn._fromParams({providerId:jn.PROVIDER_ID,signInMethod:jn.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return jn.credentialFromTaggedObject(e)}static credentialFromError(e){return jn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return jn.credential(t,n)}catch{return null}}}async function Hn(e,t){return bt(e,"POST","/v1/accounts:signUp",It(e,t))}jn.TWITTER_SIGN_IN_METHOD="twitter.com",jn.PROVIDER_ID="twitter.com";class Bn{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n,r=!1){const i=await Ht._fromIdTokenResponse(e,n,r),s=$n(n);return new Bn({user:i,providerId:s,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const r=$n(n);return new Bn({user:e,providerId:r,_tokenResponse:n,operationType:t})}}function $n(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}class zn extends d{constructor(e,t,n,r){super(t.code,t.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,zn.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,r){return new zn(e,t,n,r)}}function Gn(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(n=>{if("auth/multi-factor-auth-required"===n.code)throw zn._fromErrorAndOperation(e,n,t,r);throw n})}function Kn(e){return new Set(e.map(({providerId:e})=>e).filter(e=>!!e))}async function Jn(e,t,n=!1){const r=await Lt(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return Bn._forOperation(e,"link",r)}
2async function qn(e,t,n){await xt(t);const r=!1===e?"provider-already-linked":"no-such-provider";at(Kn(t.providerData).has(n)===e,t.auth,r)}async function Yn(e,t,n=!1){if(De(e.app))return Promise.reject(it(e));const r="signIn",i=await Gn(e,r,t),s=await Bn._fromIdTokenResponse(e,r,i);return n||await e._updateCurrentUser(s.user),s}async function Xn(e){const t=hn(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}function Qn(e,t,n,r){return y(e).onIdTokenChanged(t,n,r)}function Zn(e,t,n,r){return y(e).onAuthStateChanged(t,n,r)}function er(e,t){return wt(e,"POST","/v2/accounts/mfaEnrollment:start",It(e,t))}new WeakMap;const tr="__sak";class nr{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(tr,"1"),this.storage.removeItem(tr),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){const 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()}}class rr extends nr{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=sn(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),r=this.localCache[t];n!==r&&e(t,r,n)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys((e,t,n)=>{this.notifyListeners(e,n)});const n=e.key;t?this.detachListener():this.stopPolling();const r=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},i=this.storage.getItem(n);!function(){const e=u();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}()||10!==document.documentMode||i===e.newValue||e.newValue===e.oldValue?r():setTimeout(r,10)}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}rr.type="LOCAL";const ir=rr;class sr extends nr{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}sr.type="SESSION";const or=sr;class ar{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;const n=new ar(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:r,data:i}=t.data,s=this.handlersMap[r];if(!s?.size)return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const o=Array.from(s).map(async e=>e(t.origin,i)),a=await function(e){return Promise.all(e.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(e){return{fulfilled:!1,reason:e}}}))}(o);t.ports[0].postMessage({status:"done",eventId:n,eventType:r,response:a})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function cr(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random());return e+n}ar.receivers=[];class lr{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,n=50){const r="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let i,s;return new Promise((o,a)=>{const c=cr("",20);r.port1.start();const l=setTimeout(()=>{a(new Error("unsupported_event"))},n);s={messageChannel:r,onMessage(e){const t=e;if(t.data.eventId===c)switch(t.data.status){case"ack":clearTimeout(l),i=setTimeout(()=>{a(new Error("timeout"))},3e3);break;case"done":clearTimeout(i),o(t.data.response);break;default:clearTimeout(l),clearTimeout(i),a(new Error("invalid_response"))}}},this.handlers.add(s),r.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:e,eventId:c,data:t},[r.port2])}).finally(()=>{s&&this.removeMessageHandler(s)})}}function hr(){return window}
2function ur(){return void 0!==hr().WorkerGlobalScope&&"function"==typeof hr().importScripts}const dr="firebaseLocalStorageDb",pr="firebaseLocalStorage",gr="fbase_key";class fr{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 mr(e,t){return e.transaction([pr],t?"readwrite":"readonly").objectStore(pr)}function _r(){const e=indexedDB.open(dr,1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const t=e.result;try{t.createObjectStore(pr,{keyPath:gr})}catch(e){n(e)}}),e.addEventListener("success",async()=>{const n=e.result;n.objectStoreNames.contains(pr)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(dr);return new fr(e).toPromise()}(),t(await _r()))})})}async function vr(e,t,n){const r=mr(e,!0).put({[gr]:t,value:n});return new fr(r).toPromise()}function Ir(e,t){const n=mr(e,!0).delete(t);return new fr(n).toPromise()}class wr{registerLifecycleListeners(){"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(window.addEventListener("pagehide",this.onPageHide),window.addEventListener("pageshow",this.onPageShow))}unregisterLifecycleListeners(){"undefined"!=typeof window&&"function"==typeof window.removeEventListener&&(window.removeEventListener("pagehide",this.onPageHide),window.removeEventListener("pageshow",this.onPageShow))}constructor(){this.type="LOCAL",this.dbPromise=null,this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.isClosing=!1,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this.onPageHide=()=>{this.isClosing=!0,this.stopPolling(),this.dbPromise&&(this.dbPromise.then(e=>e.close()).catch(()=>{}),this.dbPromise=null)},this.onPageShow=()=>{this.isClosing&&(this.isClosing=!1,Object.keys(this.listeners).length>0&&this.startPolling())},this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){if(this.isClosing)throw new Error("Database is closing");return this.dbPromise||(this.dbPromise=_r(),this.dbPromise.catch(()=>{this.dbPromise=null})),this.dbPromise}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(e){if(this.isClosing)throw e;if(t++>3)throw e;this.dbPromise&&((await this.dbPromise).close(),this.dbPromise=null)}}async initializeServiceWorkerMessaging(){return ur()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=ar._getInstance(ur()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await async function(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}(),!this.activeServiceWorker)return;this.sender=new lr(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(this.sender&&this.activeServiceWorker&&(navigator?.serviceWorker?.controller||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{return!!indexedDB&&(await this._withRetries(async e=>{await vr(e,tr,"1"),await Ir(e,tr)}),!0)}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(n=>vr(n,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(t=>async function(e,t){const n=mr(e,!1).get(t),r=await new fr(n).toPromise();return void 0===r?null:r.value}(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Ir(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){if(this.isClosing)return[];try{const e=await this._withRetries(e=>{const t=mr(e,!1).getAll();
2return new fr(t).toPromise()});if(this.isClosing)return[];if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;if(0!==e.length)for(const{fbase_key:r,value:i}of e)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(i)&&(this.notifyListeners(r,i),t.push(r));for(const e of Object.keys(this.localCache))this.localCache[e]&&!n.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}catch(e){return this.isClosing||Ze(`Firebase Auth cross-tab polling failed with error: ${e}`),[]}}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.startPolling(),this.registerLifecycleListeners()),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.stopPolling(),this.unregisterLifecycleListeners())}}wr.type="LOCAL";const yr=wr;function br(e,t){return wt(e,"POST","/v2/accounts/mfaSignIn:start",It(e,t))}gn("rcb"),new pt(3e4,6e4);const Er="recaptcha";async function Tr(e,t,n){if(!e._getRecaptchaConfig())try{await async function(e){const t=hn(e),n=await Rt(t,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),r=new kt(n);null==t.tenantId?t._agentRecaptchaConfig=r:t._tenantRecaptchaConfigs[t.tenantId]=r,r.isAnyProviderEnabled()&&new In(t).verify()}(e)}catch(e){console.log("Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.")}try{let r;if(r="string"==typeof t?{phoneNumber:t}:t,"session"in r){const t=r.session;if("phoneNumber"in r){at("enroll"===t.type,e,"internal-error");const i=yn(e,{idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"}},"mfaSmsEnrollment",async(e,t)=>t.phoneEnrollmentInfo.captchaResponse===_n?(at(n?.type===Er,e,"argument-error"),er(e,await Pr(e,t,n))):er(e,t),"PHONE_PROVIDER");return(await i.catch(e=>Promise.reject(e))).phoneSessionInfo.sessionInfo}{at("signin"===t.type,e,"internal-error");const i=r.multiFactorHint?.uid||r.multiFactorUid;at(i,e,"missing-multi-factor-info");const s=yn(e,{mfaPendingCredential:t.credential,mfaEnrollmentId:i,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}},"mfaSmsSignIn",async(e,t)=>t.phoneSignInInfo.captchaResponse===_n?(at(n?.type===Er,e,"argument-error"),br(e,await Pr(e,t,n))):br(e,t),"PHONE_PROVIDER");return(await s.catch(e=>Promise.reject(e))).phoneResponseInfo.sessionInfo}}{const t=yn(e,{phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"},"sendVerificationCode",async(e,t)=>t.captchaResponse===_n?(at(n?.type===Er,e,"argument-error"),An(e,await Pr(e,t,n))):An(e,t),"PHONE_PROVIDER");return(await t.catch(e=>Promise.reject(e))).sessionInfo}}finally{n?._reset()}}async function Pr(e,t,n){at(n.type===Er,e,"argument-error");const r=await n.verify();at("string"==typeof r,e,"argument-error");const i={...t};if("phoneEnrollmentInfo"in i){const e=i.phoneEnrollmentInfo.phoneNumber,t=i.phoneEnrollmentInfo.captchaResponse,n=i.phoneEnrollmentInfo.clientType,s=i.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(i,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:r,captchaResponse:t,clientType:n,recaptchaVersion:s}}),i}if("phoneSignInInfo"in i){const e=i.phoneSignInInfo.captchaResponse,t=i.phoneSignInInfo.clientType,n=i.phoneSignInInfo.recaptchaVersion;return Object.assign(i,{phoneSignInInfo:{recaptchaToken:r,captchaResponse:e,clientType:t,recaptchaVersion:n}}),i}return Object.assign(i,{recaptchaToken:r}),i}class Sr{constructor(e){this.providerId=Sr.PROVIDER_ID,this.auth=hn(e)}verifyPhoneNumber(e,t){return Tr(this.auth,e,y(t))}static credential(e,t){return Nn._fromVerification(e,t)}static credentialFromResult(e){const t=e;return Sr.credentialFromTaggedObject(t)}static credentialFromError(e){return Sr.credentialFromTaggedObject(e.customData||{})}
2static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{phoneNumber:t,temporaryProof:n}=e;return t&&n?Nn._fromTokenResponse(t,n):null}}function Cr(e,t){return t?$t(t):(at(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}Sr.PROVIDER_ID="phone",Sr.PHONE_SIGN_IN_METHOD="phone";class kr extends Tn{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return kn(e,this._buildIdpRequest())}_linkToIdToken(e,t){return kn(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return kn(e,this._buildIdpRequest())}_buildIdpRequest(e){const 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 Rr(e){return Yn(e.auth,new kr(e),e.bypassAuthState)}function Ar(e){const{auth:t,user:n}=e;return at(n,t,"internal-error"),async function(e,t,n=!1){const{auth:r}=e;if(De(r.app))return Promise.reject(it(r));const i="reauthenticate";try{const s=await Lt(e,Gn(r,i,t,e),n);at(s.idToken,r,"internal-error");const o=Ut(s.idToken);at(o,r,"internal-error");const{sub:a}=o;return at(e.uid===a,r,"user-mismatch"),Bn._forOperation(e,i,s)}catch(e){throw"auth/user-not-found"===e?.code&&tt(r,"user-mismatch"),e}}(n,new kr(e),e.bypassAuthState)}async function Or(e){const{auth:t,user:n}=e;return at(n,t,"internal-error"),Jn(n,new kr(e),e.bypassAuthState)}class Nr{constructor(e,t,n,r,i=!1){this.auth=e,this.resolver=n,this.user=r,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:r,tenantId:i,error:s,type:o}=e;if(s)return void this.reject(s);const a={auth:this.auth,requestUri:t,sessionId:n,tenantId:i||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(a))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Rr;case"linkViaPopup":case"linkViaRedirect":return Or;case"reauthViaPopup":case"reauthViaRedirect":return Ar;default:tt(this.auth,"internal-error")}}resolve(e){lt(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){lt(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()}}const Ur=new pt(2e3,1e4);class Dr extends Nr{constructor(e,t,n,r,i){super(e,t,r,i),this.provider=n,this.authWindow=null,this.pollId=null,Dr.currentPopupAction&&Dr.currentPopupAction.cancel(),Dr.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return at(e,this.auth,"internal-error"),e}async onExecution(){lt(1===this.filter.length,"Popup operations only handle one event");const e=cr();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(nt(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(nt(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Dr.currentPopupAction=null}pollUserCancellation(){const e=()=>{this.authWindow?.window?.closed?this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(nt(this.auth,"popup-closed-by-user"))},8e3):this.pollId=window.setTimeout(e,Ur.get())};e()}}Dr.currentPopupAction=null;const Lr=new Map;class Fr extends Nr{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=Lr.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=Vr(t),r=xr(e);if(!await r._isAvailable())return!1;const i="true"===await r._get(n);return await r._remove(n),i}(this.resolver,this.auth),n=t?await super.execute():null;e=()=>Promise.resolve(n)}catch(t){e=()=>Promise.reject(t)}Lr.set(this.auth._key(),e)}return this.bypassAuthState||Lr.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);
2if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function Mr(e,t){Lr.set(e._key(),t)}function xr(e){return $t(e._redirectPersistence)}function Vr(e){return Kt("pendingRedirect",e.config.apiKey,e.name)}function Wr(e,t,n){return async function(e,t,n){if(De(e.app))return Promise.reject(it(e));const r=hn(e);st(e,t,Ln),await r._initializationPromise;const i=Cr(r,n);return await async function(e,t){return xr(e)._set(Vr(t),"true")}(i,r),i._openRedirect(r,t,"signInViaRedirect")}(e,t,n)}async function jr(e,t,n=!1){if(De(e.app))return Promise.reject(it(e));const r=hn(e),i=Cr(r,t),s=new Fr(r,i,n),o=await s.execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,t)),o}class Hr{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(n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return $r(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!$r(e)){const n=e.error.code?.split("auth/")[1]||"internal-error";t.onError(nt(this.auth,n))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(Br(e))}saveEventToCache(e){this.cachedEventUids.add(Br(e)),this.lastProcessedEventTime=Date.now()}}function Br(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function $r({type:e,error:t}){return"unknown"===e&&"auth/no-auth-event"===t?.code}const zr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Gr=/^https?/;function Kr(e){const t=ht(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const i=new URL(e);return""===i.hostname&&""===r?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&i.hostname===r}if(!Gr.test(n))return!1;if(zr.test(e))return r===e;const i=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}const Jr=new pt(3e4,6e4);function qr(){const e=hr().___jsl;if(e?.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}function Yr(e){return new Promise((t,n)=>{function r(){qr(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{qr(),n(nt(e,"network-request-failed"))},timeout:Jr.get()})}if(hr().gapi?.iframes?.Iframe)t(gapi.iframes.getContext());else{if(!hr().gapi?.load){const t=gn("iframefcb");return hr()[t]=()=>{gapi.load?r():n(nt(e,"network-request-failed"))},pn(`${dn.gapiScript}?onload=${t}`).catch(e=>n(e))}r()}}).catch(e=>{throw Xr=null,e})}let Xr=null;const Qr=new pt(5e3,15e3),Zr={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},ei=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function ti(e){const t=e.config;at(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?gt(t,"emulator/auth/iframe"):`https://${e.config.authDomain}
2/__/auth/iframe`,r={apiKey:t.apiKey,appName:e.name,v:Me},i=ei.get(e.config.apiHost);i&&(r.eid=i);const s=e._getFrameworks();return s.length&&(r.fw=s.join(",")),`${n}?${m(r).slice(1)}`}const ni={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class ri{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}const ii=encodeURIComponent("fac");async function si(e,t,n,r,i,s){at(e.config.authDomain,e,"auth-domain-config-required"),at(e.config.apiKey,e,"invalid-api-key");const o={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:Me,eventId:i};if(t instanceof Ln){t.setDefaultLanguage(e.languageCode),o.providerId=t.providerId||"",function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(t.getCustomParameters())||(o.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries(s||{}))o[e]=t}if(t instanceof Fn){const e=t.getScopes().filter(e=>""!==e);e.length>0&&(o.scopes=e.join(","))}e.tenantId&&(o.tid=e.tenantId);const a=o;for(const e of Object.keys(a))void 0===a[e]&&delete a[e];const c=await e._getAppCheckToken(),l=c?`#${ii}=${encodeURIComponent(c)}`:"";return`${function({config:e}){return e.emulator?gt(e,"emulator/auth/handler"):`https://${e.authDomain}/__/auth/handler`}(e)}?${m(a).slice(1)}${l}`}const oi="webStorageSupport",ai=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=or,this._completeRedirectFn=jr,this._overrideRedirectResult=Mr}async _openPopup(e,t,n,r){return lt(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()"),function(e,t,n,r=500,i=600){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const c={...ni,width:r.toString(),height:i.toString(),top:s,left:o},l=u().toLowerCase();n&&(a=Qt(l)?"_blank":n),Yt(l)&&(t=t||"http://localhost",c.scrollbars="yes");const h=Object.entries(c).reduce((e,[t,n])=>`${e}${t}=${n},`,"");if(function(e=u()){return rn(e)&&!!window.navigator?.standalone}(l)&&"_self"!==a)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}(t||"",a),new ri(null);const d=window.open(t||"",a,h);at(d,e,"popup-blocked");try{d.focus()}catch(e){}return new ri(d)}(e,await si(e,t,n,ht(),r),cr())}async _openRedirect(e,t,n,r){return await this._originValidation(e),i=await si(e,t,n,ht(),r),hr().location.href=i,new Promise(()=>{});var i}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(lt(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){const t=await async function(e){const t=await function(e){return Xr=Xr||Yr(e),Xr}(e),n=hr().gapi;return at(n,e,"internal-error"),t.open({where:document.body,url:ti(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Zr,dontclear:!0},t=>new Promise(async(n,r)=>{await t.restyle({setHideOnLeave:!1});const i=nt(e,"network-request-failed"),s=hr().setTimeout(()=>{r(i)},Qr.get());function o(){hr().clearTimeout(s),n(t)}t.ping(o).then(o,()=>{r(i)})}))}(e),n=new Hr(e);return t.register("authEvent",t=>(at(t?.authEvent,e,"invalid-auth-event"),{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(oi,{type:oi},n=>{const r=n?.[0]?.[oi];void 0!==r&&t(!!r),tt(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=async function(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e,t={}){return wt(e,"GET","/v1/projects",t)}(e);for(const e of t)try{if(Kr(e))return}catch{}tt(e,"unauthorized-domain")}(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return sn()||Xt()||rn()}};var ci="@firebase/auth",li="1.13.5";class hi{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(t=>{e(t?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){at(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const ui=l("authIdTokenMaxAge")||300;let di=null;function pi(e=Ve()){const t=Ue(e,"auth");if(t.isInitialized())return t.getImmediate();const n=function(e,t){const n=Ue(e,"auth");if(n.isInitialized()){const e=n.getImmediate();if(g(n.getOptions(),t??{}))return e;tt(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:ai,persistence:[yr,ir,or]}),r=l("authTokenSyncURL");if(r&&"boolean"==typeof isSecureContext&&isSecureContext){const e=new URL(r,location.origin);if(location.origin===e.origin){const t=(i=e.toString(),async e=>{const t=e&&await e.getIdTokenResult(),n=t&&((new Date).getTime()-Date.parse(t.issuedAtTime))/1e3;if(n&&n>ui)return;const r=t?.token;di!==r&&(di=r,await fetch(i,{method:r?"POST":"DELETE",headers:r?{Authorization:`Bearer ${r}`}:{}}))});!function(e,t,n){y(e).beforeAuthStateChanged(t,n)}(n,t,()=>t(n.currentUser)),Qn(n,e=>t(e))}}var i;const s=(o="auth",a()?.emulatorHosts?.[o]);var o;return s&&function(e,t,n){const r=hn(e);
2at(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const i=!!n?.disableWarnings,s=bn(t),{host:o,port:a}=function(e){const t=bn(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const e=i[1];return{host:e,port:En(r.substr(e.length+1))}}{const[e,t]=r.split(":");return{host:e,port:En(t)}}}(t),c=null===a?"":`:${a}`,l={url:`${s}//${o}${c}/`},h=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!r._canInitEmulator)return at(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),void at(g(l,r.config.emulator)&&g(h,r.emulatorConfig),r,"emulator-config-failed");r.config.emulator=l,r.emulatorConfig=h,r.settings.appVerificationDisabledForTesting=!0,b(o)?async function(e){(await fetch(e,{credentials:"include"})).ok}(`${s}//${o}${c}`):i||function(){function e(){const 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)}"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}(n,`http://${s}`),n}var gi,fi;gi={loadJS:e=>new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=e=>{const t=nt("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",(document.getElementsByTagName("head")?.[0]??document).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="},dn=gi,fi="Browser",Ne(new E("auth",(e,{options:t})=>{const n=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),i=e.getProvider("app-check-internal"),{apiKey:s,authDomain:o}=n.options;at(s&&!s.includes(":"),"invalid-api-key",{appName:n.name});const a={apiKey:s,authDomain:o,clientPlatform:fi,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:on(fi)},c=new ln(n,r,i,a);return function(e,t){const n=t?.persistence||[],r=(Array.isArray(n)?n:[n]).map($t);t?.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t?.popupRedirectResolver)}(c,t),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider("auth-internal").initialize()})),Ne(new E("auth-internal",e=>(e=>new hi(e))(hn(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),We(ci,li,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(fi)),We(ci,li,"esm2020");const mi=["profile","email","openid"];class _i{constructor(e,t,n){this.apiKey=e,this.authDomain=t,this.ssoProviderId=n}}class vi{constructor(e){let t=e.uid,n=e.displayName,r=e.email,i=e.photoURL,s=e.providerData;this.uid=t,this.displayName=n,this.email=r,this.photoURL=i,this.providerData=s}}class Ii{constructor(e){this._app=this._initApp(e),this._auth=this._initAuth(),this._googleAuthProvider=this._initGoogleAuthProvider(),this._ssoProviderId=e.ssoProviderId,this._pendingUserCredential=this._loadPendingUserCredential(),this.getCurrentUser(),Zn(this._auth,async e=>{await this._waitForSignUp(),console.debug("Firebase: [onAuthStateChanged]",this._getUserDetail(e))})}_getUserDetail(e){return"_logUser: "+(null!=e&&e.email+" ("+e.displayName+")")}_initApp(e){console.debug("Firebase: [initApp] Initializing app with options (_initApp)",e);const t=Array.from(ke.values()).length>0?Ve():null;return null!=t?(t.options.apiKey===e.apiKey&&t.options.authDomain===e.authDomain||console.error("Firebase: [initApp] Existing app has different options, reusing it anyway",{existing:t.options,requested:e}),t):xe(e)}_initAuth(){return console.debug("Firebase: [initAuth] Initializing auth (_initAuth)"),pi()}_initGoogleAuthProvider(){console.debug("Firebase: [initAuthProvider] Initializing auth provider (_initAuthProvider)");const e=new Vn;
2return mi.forEach(t=>e.addScope(t)),e}_initSSOAuthProvider(e){console.debug("Firebase: [initSSOAuthProvider] Initializing SSO auth provider (_initSSOAuthProvider)",{email:e});const t=new Mn(this._ssoProviderId);return t.setCustomParameters({domain:e}),t}_signInWithRedirect(e){return console.debug("Firebase: [signInWithRedirect] Signing in with redirect (_signInWithRedirect)"),Wr(this._auth,e)}_signInWithPopup(e){return console.debug("Firebase: [signInWithPopup] Signing in with popup (_signInWithPopup)"),async function(e,t){if(De(e.app))return Promise.reject(nt(e,"operation-not-supported-in-this-environment"));const n=hn(e);st(e,t,Ln);const r=Cr(n,void 0);return new Dr(n,"signInViaPopup",t,r).executeNotNull()}(this._auth,e)}_singInWithCustomToken(e){return console.debug("Firebase: [signInWithCustomToken] Signing in with custom token (_singInWithCustomToken)"),async function(e,t){if(De(e.app))return Promise.reject(it(e));const n=hn(e),r=await async function(e,t){return bt(e,"POST","/v1/accounts:signInWithCustomToken",It(e,t))}(n,{token:t,returnSecureToken:!0}),i=await Bn._fromIdTokenResponse(n,"signIn",r);return await n._updateCurrentUser(i.user),i}(this._auth,e)}_startSignUp(){this._signUpPromise||(this._signUpPromise=new Promise(e=>{this._signUpPromiseResolver=e}))}_endSignUp(){this._signUpPromise&&this._signUpPromiseResolver&&(this._signUpPromiseResolver(),this._signUpPromiseResolver=null,this._signUpPromise=null)}async _waitForSignUp(){console.debug("Firebase: [waitForSignUp] Waiting for sign up to finish (_waitForSignUp)",this._signUpPromise),this._signUpPromise&&await this._signUpPromise}async signInWithGoogle(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(console.debug("Firebase: [signInWithGoogle] Signing in with Google (usePopup = "+e+")"),e)try{const e=(await this._signInWithPopup(this._googleAuthProvider)).user;return console.debug("Firebase: [signInWithGoogle] User signed in",this._getUserDetail(e)),new vi(e)}catch(t){throw console.error("Firebase: [signInWithGoogle] Error",t,{usePopup:e}),t}else try{await this._signInWithRedirect(this._googleAuthProvider)}catch(t){throw console.error("Firebase: [signInWithGoogle] Error",t,{usePopup:e}),t}return null}async signInWithSSO(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(console.debug("Firebase: [signInWithSSO] Signing in with SSO (usePopup = "+t+")"),t)try{const t=(await this._signInWithPopup(this._initSSOAuthProvider(e))).user;return console.debug("Firebase: [signInWithSSO] User signed in",this._getUserDetail(t)),new vi(t)}catch(e){throw console.error("Firebase: [signInWithSSO] Error",e,{usePopup:t}),this._savePendingUserCredential({provider:this._ssoProviderId,method:"sso",error:e}),e}else try{await this._signInWithRedirect(this._initSSOAuthProvider(e))}catch(e){throw console.error("Firebase: [signInWithSSO] Error",e,{usePopup:t}),e}return null}async signUpWithEmailAndPassword(e,t,n){console.debug("Firebase: [signUpWithEmailAndPassword] Signing up with email and password"),this._startSignUp();var r=null;try{const n=await async function(e,t,n){if(De(e.app))return Promise.reject(it(e));const r=hn(e),i=yn(r,{returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Hn,"EMAIL_PASSWORD_PROVIDER"),s=await i.catch(t=>{throw"auth/password-does-not-meet-requirements"===t.code&&Xn(e),t}),o=await Bn._fromIdTokenResponse(r,"signIn",s);return await r._updateCurrentUser(o.user),o}(this._auth,e,t);r=n.user,console.debug("Firebase: [signUpWithEmailAndPassword]",this._getUserDetail(r))}catch(e){throw console.error("Firebase: [signUpWithEmailAndPassword] Error",e),e}try{await async function(e,{displayName:t,photoURL:n}){if(void 0===t&&void 0===n)return;const r=y(e),i={idToken:await r.getIdToken(),displayName:t,photoUrl:n,returnSecureToken:!0},s=await Lt(r,async function(e,t){return wt(e,"POST","/v1/accounts:update",t)}(r.auth,i));r.displayName=s.displayName||null,r.photoURL=s.photoUrl||null;const o=r.providerData.find(({providerId:e})=>"password"===e);o&&(o.displayName=r.displayName,o.photoURL=r.photoURL),await r._updateTokensIfNecessary(s)}(r,{displayName:n})}
2catch(e){throw console.error("Firebase: [signUpWithEmailAndPassword] Error - updateProfile()",e),e}return await new Promise(e=>window.setTimeout(e,2e3)),this._endSignUp(),r?new vi(r):null}async signInWithEmailAndPassword(e,t){try{console.debug("Firebase: [signInWithEmailAndPassword] Signing in with email and password");const n=await function(e,t,n){return De(e.app)?Promise.reject(it(e)):async function(e,t){return Yn(hn(e),t)}(y(e),Dn.credential(t,n)).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&Xn(e),t})}(this._auth,e,t),r=n.user;return console.debug("Firebase: [signInWithEmailAndPassword]",this._getUserDetail(r)),new vi(r)}catch(e){throw console.error("Firebase: [signInWithEmailAndPassword] Error",e),e}}async signInWithCustomToken(e){console.debug("Firebase: Signing in with custom token (signInWithToken)");try{const t=(await this._singInWithCustomToken(e)).user;return console.debug("Firebase: [signInWithCustomToken]",this._getUserDetail(t)),new vi(t)}catch(e){throw console.error("Error in signInWithToken()",e),e}}async signInWithSSOFromConnectionId(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{console.debug("Firebase: [authenticateSSOWithConnectionId] Authenticating with connection ID (_authenticateSSOWithConnectionId)",{connectionId:e,usePopup:t});const n=new Mn(this._ssoProviderId);n.setCustomParameters({connection_id:e}),t?await this._signInWithPopup(n):await this._signInWithRedirect(n)}catch(n){throw console.error("Error in authenticateSSOWithConnectionId()",{error:n,connectionId:e}),t&&this._savePendingUserCredential({provider:this._ssoProviderId,method:"sso",error:n}),n}return null}async confirmPasswordReset(e,t){try{console.debug("Firebase: Confirming password reset (confirmPasswordReset)"),await async function(e,t,n){await async function(e,t){return wt(e,"POST","/v1/accounts:resetPassword",It(e,t))}(y(e),{oobCode:t,newPassword:n}).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&Xn(e),t})}(this._auth,e,t)}catch(e){throw console.error("Error in signInWithEmailAndPassword()",e),e}}async getRedirectResult(){console.debug("Firebase: [getRedirectResult] Getting redirect result (_getRedirectResult)");try{const e=await async function(e){return await hn(e)._initializationPromise,jr(e,void 0,!1)}(this._auth);if(e){const t=e.user;return console.debug("Firebase: [getRedirectResult] User signed in via redirect",this._getUserDetail(t)),new vi(t)}return console.debug("Firebase: [getRedirectResult] No redirect result available"),null}catch(t){var e;throw console.error("Firebase: [getRedirectResult] Error",t),"auth/account-exists-with-different-credential"===t.code&&null!==(e=t.customData)&&void 0!==e&&e.email&&(console.debug("Firebase: [getRedirectResult] Account exists with different credential, saving for linking"),this._savePendingUserCredential({provider:this._ssoProviderId,method:"sso",error:t})),t}}async signOut(){console.debug("Firebase: Signing out (signOut)");try{await function(e){return y(e).signOut()}(this._auth)}catch(e){console.error("Error in signOut()",e)}}async onAuthStateChanged(e){return console.debug("Firebase: On auth state changed (onAuthStateChanged)"),Zn(this._auth,async t=>{await this._waitForSignUp(),t?console.debug("Firebase: [onAuthStateChanged]",this._getUserDetail(t)):console.debug("Firebase: [onAuthStateChanged] No user"),e(t?new vi(t):null)})}async onIdTokenChanged(e){return console.debug("Firebase: On id token changed (onIdTokenChanged)"),Qn(this._auth,async t=>{await this._waitForSignUp(),console.debug("Firebase: [onIdTokenChanged]",this._getUserDetail(t));try{e(await this._idTokenOrNull(t))}catch(e){console.debug("Firebase: [onIdTokenChanged] getIdToken failed",e)}})}getCurrentUser(){const e=this._auth.currentUser;return e?new vi(e):null}_isTerminalCredentialError(e){const t=e&&e.code;return"auth/user-token-expired"===t||"auth/invalid-user-token"===t||"auth/user-disabled"===t||"auth/user-not-found"===t}async _idTokenOrNull(e){if(!e)return null;try{return await e.getIdToken()}catch(e){if(this._isTerminalCredentialError(e))return console.debug("Firebase: getIdToken failed (credential dead)",e),this.signOut(),null;throw e}}async getCurrentIdToken(){try{return await this._idTokenOrNull(this._auth.currentUser)}catch(e){return console.debug("Firebase: getCurrentIdToken failed",e),null}}_isPendingCredentialExpired(e){return!e||"number"!=typeof e.savedAt||!isFinite(e.savedAt)||Date.now()-e.savedAt>Ii.PENDING_CREDENTIAL_TTL_MS}_loadPendingUserCredential(){console.debug("Firebase: [loadPendingUserCredential] Loading pending user credential from local storage");try{const e=localStorage.getItem("firebase_pending_user_credential");if(e){const t=JSON.parse(e);return this._isPendingCredentialExpired(t)?(console.debug("Firebase: [loadPendingUserCredential] Pending user credential expired or missing savedAt, discarding"),localStorage.removeItem("firebase_pending_user_credential"),null):(console.debug("Firebase: [loadPendingUserCredential] Loaded pending user credential from local storage"),t)}console.debug("Firebase: [loadPendingUserCredential] No pending user credential found in local storage")}catch(e){console.error("Firebase: [loadPendingUserCredential] Error loading from local storage",e)}return null}_savePendingUserCredential(e){let t=e.provider,n=e.method,r=e.error;try{const e=Mn.credentialFromError(r);
2if(!e)return void console.debug("Firebase: [savePendingUserCredential] No credential available");const i=e.toJSON();this._pendingUserCredential={provider:t,method:n,email:r.customData.email,credentialJSON:i,savedAt:Date.now()},console.debug("Firebase: [savePendingUserCredential] Saved pending user credential",{provider:t,method:n}),localStorage.setItem("firebase_pending_user_credential",JSON.stringify(this._pendingUserCredential)),console.debug("Firebase: [savePendingUserCredential] Persisted pending user credential to local storage")}catch(r){console.error("Firebase: [savePendingUserCredential] Error creating and persisting credential",r)}}_clearPendingUserCredential(){this._pendingUserCredential=null;try{localStorage.removeItem("firebase_pending_user_credential"),console.debug("Firebase: [clearPendingUserCredential] Cleared pending user credential from memory and local storage")}catch(e){console.error("Firebase: [clearPendingUserCredential] Error clearing from local storage",e)}}hasPendingUserCredential(){var e,t;return this._pendingUserCredential||(this._pendingUserCredential=this._loadPendingUserCredential()),null!=this._pendingUserCredential&&this._isPendingCredentialExpired(this._pendingUserCredential)&&(console.debug("Firebase: [hasPendingUserCredential] In-memory pending credential expired, clearing"),this._clearPendingUserCredential()),null!=this._pendingUserCredential&&null!=this._pendingUserCredential.email&&null!=this._pendingUserCredential.credentialJSON?(console.debug("Firebase: [hasPendingUserCredential] Pending user credential present",{provider:this._pendingUserCredential.provider,method:this._pendingUserCredential.method,email:this._pendingUserCredential.email,savedAt:this._pendingUserCredential.savedAt}),!0):(console.debug("Firebase: [hasPendingUserCredential] No pending user credential",{inMemory:null!=this._pendingUserCredential,hasEmail:null!=(null===(e=this._pendingUserCredential)||void 0===e?void 0:e.email),hasCredentialJSON:null!=(null===(t=this._pe
2ndingUserCredential)||void 0===t?void 0:t.credentialJSON)}),!1)}hasPendingUserCredentialForCurrentUser(){try{if(!this.hasPendingUserCredential())return!1;const e=this.getCurrentUser();if(!e||!e.email)return console.debug("Firebase: [hasPendingUserCredentialForCurrentUser] No current user or user email"),!1;const t=this._pendingUserCredential.email;if(!t)return console.debug("Firebase: [hasPendingUserCredentialForCurrentUser] No pending credential email"),!1;return e.email.trim().toLowerCase()===t.trim().toLowerCase()||(console.debug("Firebase: [hasPendingUserCredentialForCurrentUser] Email mismatch",{pending:t,current:e.email}),!1)}catch(e){return console.error("Firebase: [hasPendingUserCredentialForCurrentUser] Error",e),!1}}hasPendingUserCredentialForSSO(){try{return this.hasPendingUserCredential()&&"sso"===this._pendingUserCredential.method}catch(e){return console.error("Firebase: [hasPendingUserCredentialForSSO] Error",e),!1}}async linkPendingUserCredential(){try{if(!this.hasPendingUserCredentialForCurrentUser())return console.debug("Firebase: [linkPendingUserCredential] No pending user credential to link"),null;const e=this._auth.currentUser;if(!e)return console.error("Firebase: [linkPendingUserCredential] No current user available"),null;if(!this._pendingUserCredential.credentialJSON)return console.error("Firebase: [linkPendingUserCredential] No credential JSON available"),null;console.debug("Firebase: [linkPendingUserCredential] Recreating credential from JSON");const t=Rn.fromJSON(this._pendingUserCredential.credentialJSON);return t?(console.debug("Firebase: [linkPendingUserCredential] Attempting to link credential",{providerId:t.providerId,sign
2InMethod:t.signInMethod,userEmail:e.email,pendingEmail:this._pendingUserCredential.email}),await async function(e,t){const n=y(e);return await qn(!1,n,t.providerId),Jn(n,t)}(e,t),console.debug("Firebase: [linkPendingUserCredential] Successfully linked pending user credential"),this._clearPendingUserCredential(),t.providerId):(console.error("Firebase: [linkPendingUserCredential] Failed to recreate credential from JSON, clearing pending credential"),this._clearPendingUserCredential(),null)}catch(e){return console.error("Firebase: [linkPendingUserCredential] Error linking credential",{error:e,errorCode:e.code,errorMessage:e.message,pendingCredential:this._pendingUserCredential}),"auth/credential-already-in-use"!==e.code&&"auth/provider-already-linked"!==e.code||(console.debug("Firebase: [linkPendingUserCredential] Terminal auth error, clearing pending credential",e.code),this._clearPendingUserCredential()),null}}async _unlinkUserProvider(e){try{const t=this._auth.currentUser;if(null==t)return void console.debug("Firebase: [unlink] No user to unlink");console.debug("Firebase: [unlink] Unlinking provider",e),await async function(e,t){const n=y(e);await qn(!0,n,t);const{providerUserInfo:r}=await async function(e,t){return wt(e,"POST","/v1/accounts:update",t)}(n.auth,{idToken:await n.getIdToken(),deleteProvider:[t]}),i=Kn(r||[]);return n.providerData=n.providerData.filter(e=>i.has(e.providerId)),i.has("phone")||(n.phoneNumber=null),await n.auth._persistUserIfCurrent(n),n}(t,e),console.debug("Firebase: [unlink] Unlinked provider",e)}catch(e){console.error("Firebase: [unlink] Error",e)}}async unlinkUserSSOProvider(){try{await this._unlinkUserProvider(this._ssoProviderId)}catch(e){console.error("Firebase: [unlinkUserSSOProvider] Error",e)}}async unlinkUserAllOtherProviders(e){try{const t=this.getCurrentUser();if(null==t)return void console.debug("Firebase: [unlinkUserAllOtherProviders] No user to unlink");console.debug("Firebase: [unlinkUserAllOtherProviders] Unlinking all other providers",{user:t,providerId:e});const n=t.providerData.map(e=>e.providerId),r=n.filter(t=>t!==e);if(0===r.length)return void console.debug("Firebase: [unlinkUserAllOtherProviders] No providers to unlink");for(const e of r)try{await this._unlinkUserProvider(e),console.debug(`Firebase: [unlinkUserAllOtherProviders] Unlinked provider: ${e}`)}catch(t){console.error(`Firebase: [unlinkUserAllOtherProviders] Error unlinking ${e}:`,t)}}catch(e){console.error("Firebase: [unlinkUserAllOtherProviders] Error",e)}}}var wi,yi,bi;wi=Ii,bi=9e5,(yi=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(yi="PENDING_CREDENTIAL_TTL_MS"))in wi?Object.defineProperty(wi,yi,{value:bi,enumerable:!0,configurable:!0,writable:!0}):wi[yi]=bi;class Ei{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e4;this._clientId=e,this._loadTimeoutMs=t,this._loadPromise=null}load(){return this._loadPromise??=this._injectScript().catch(e=>{throw this._loadPromise=null,e}),this._loadPromise}_injectScript(){var e;return null!==(e=window.google)&&void 0!==e&&null!==(e=e.accounts)&&void 0!==e&&e.oauth2?Promise.resolve():new Promise((e,t)=>{const n=document.createElement("script"),r=setTimeout(()=>s(),this._loadTimeoutMs),i=e=>{clearTimeout(r),e()},s=()=>i(()=>
2{n.remove(),t(new Error("script_unavailable"))});n.src="https://accounts.google.com/gsi/client",n.async=!0,n.defer=!0,n.addEventListener("load",()=>{var t;return null!==(t=window.google)&&void 0!==t&&null!==(t=t.accounts)&&void 0!==t&&t.oauth2?i(e):s()}),n.addEventListener("error",s),document.head.appendChild(n)})}async requestAccessToken(e,t){return await this.load(),new Promise((n,r)=>{window.google.accounts.oauth2.initTokenClient({client_id:this._clientId,scope:e,prompt:"",hint:t??void 0,callback:e=>{e.error?r(new Error(function(e){switch(e){case"access_denied":return"access_denied";case"admin_policy_enforced":case"org_internal":return"admin_blocked";case"interaction_required":return"interaction_required";default:return"unknown"}}(e.error))):n(JSON.stringify({access_token:e.access_token,expires_in:e.expires_in,scope:e.scope}))},error_callback:e=>r(new Error(function(e){switch(e){case"popup_closed":return"popup_closed";case"popup_failed_to_open":return"popup_blocked";default:return"unknown"}}(null==e?void 0:e.type)))}).requestAccessToken()})}}auth=t})();
3//# sourceMappingURL=auth.bundle.js.map?t=a10cff039

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.