1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8535],{99692:(e,t,i)=>{i.d(t,{$:()=>t_,A:()=>l,H:()=>h,L:()=>eG,M:()=>eY,P:()=>iZ,Q:()=>tt,R:()=>iW,V:()=>ep,W:()=>tl,X:()=>tp,Y:()=>tm,Z:()=>tf,_:()=>td,a0:()=>tv,a1:()=>tT,a2:()=>tO,a3:()=>tN,a4:()=>tL,a5:()=>tU,a6:()=>tH,a7:()=>tq,a8:()=>tK,a9:()=>tW,aA:()=>rw,aB:()=>eS,aC:()=>g,aD:()=>y,aE:()=>r_,aF:()=>eh,aG:()=>em,aH:()=>rf,aI:()=>rs,aJ:()=>rn,aK:()=>eN,aO:()=>iT,aR:()=>tg,aa:()=>tz,ab:()=>t$,ac:()=>tG,ad:()=>tJ,ae:()=>tB,af:()=>tY,ag:()=>tZ,ah:()=>tX,ai:()=>t0,al:()=>t2,am:()=>t3,an:()=>t6,aq:()=>tb,ar:()=>ii,at:()=>ia,au:()=>iu,av:()=>E,aw:()=>ek,ax:()=>ey,ay:()=>f,az:()=>rD,b:()=>im,c:()=>iw,d:()=>i5,e:()=>i8,f:()=>i9,g:()=>rc,h:()=>rd,i:()=>iM,j:()=>ru,k:()=>rm,l:()=>iG,m:()=>rF,n:()=>rj,q:()=>c,r:()=>iJ,s:()=>i$,u:()=>iY});var r,n=i(45458),s=i(76653),a=i(29979),o=i(21610);let c={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},l={EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"};function u(){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."}}let h=function
vendor: 12,062 bytes, line 1
1(){return{"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","emulator-config-failed":'Auth instance has already been used to make a network call. Auth can no longer be configured to use the emulator. Try calling "connectAuthEmulator()" sooner.',"expired-action-code":"The action code has expired.","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal AuthError has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registered for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is incorrect, malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-password":"A non-empty password must be provided","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance.","missing-recaptcha-token":"The reCAPTCHA token is missing when sending request to the backend.","invalid-recaptcha-token":"The reCAPTCHA token is invalid when sending request to the backend.","invalid-recaptcha-action":"The reCAPTCHA action is invalid when sending request to the backend.","recaptcha-not-enabled":"reCAPTCHA Enterprise integration is not enabled for this project.","missing-client-type":"The reCAPTCHA client type is missing when sending request to the backend.","missing-recaptcha-version":"The reCAPTCHA version is missing when sending request to the backend.","invalid-req-type":"Invalid request parameters.","invalid-recaptcha-version":"The reCAPTCHA version is invalid when sending request to the backend.","unsupported-password-policy-schema-version":"The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.","password-does-not-meet-requirements":"The password does not meet the requirements.","invalid-hosting-link-domain":"The provided Hosting link domain is not configured in Firebase Hosting or is not owned by the current project. This cannot be a default Hosting domain (`web.app` or `firebaseapp.com`)."}},
1d=new s.FA("auth","Firebase",u()),p=new a.Vy("@firebase/auth");function m(e,...t){p.logLevel<=a.$b.ERROR&&p.error(`Auth (${n.SDK_VERSION}): ${e}`,...t)}function f(e,...t){throw w(e,...t)}function g(e,...t){return w(e,...t)}function _(e,t,i){let r={...u(),[t]:i};return new s.FA("auth","Firebase",r).create(t,{appName:e.name})}function v(e){return _(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function I(e,t,i){if(!(t instanceof i))throw i.name!==t.constructor.name&&f(e,"argument-error"),_(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function w(e,...t){if("string"!=typeof e){let i=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(i,...r)}return d.create(e,...t)}function y(e,t,...i){if(!e)throw w(t,...i)}function T(e){let t="INTERNAL ASSERTION FAILED: "+e;throw m(t),Error(t)}function E(e,t){e||T(t)}function k(){return"u">typeof self&&self.location?.href||""}function S(){return"http:"===b()||"https:"===b()}function b(){return"u">typeof self&&self.location?.protocol||null}class P{constructor(e,t){this.shortDelay=e,this.longDelay=t,E(t>e,"Short delay should be less than long delay!"),this.isMobile=(0,s.jZ)()||(0,s.lV)()}get(){return!("u">typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(S()||(0,s.sr)()||"connection"in navigator))||navigator.onLine?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function R(e,t){E(e.emulator,"Emulator should always be set here");let{url:i}=e.emulator;return t?`${i}${t.startsWith("/")?t.slice(1):t}`:i}class A{static initialize(e,t,i){this.fetchImpl=e,t&&(this.headersImpl=t),i&&(this.responseImpl=i)}static fetch(){return this.fetchImpl?this.fetchImpl:"u">typeof self&&"fetch"in self?self.fetch:"u">typeof globalThis&&globalThis.fetch?globalThis.fetch:"u">typeof fetch?fetch:void T("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"u">typeof self&&"Headers"in self?self.Headers:"u">typeof globalThis&&globalThis.Headers?globalThis.Headers:"u">typeof Headers?Headers:void T("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"u">typeof self&&"Response"in self?self.Response:"u">typeof globalThis&&globalThis.Response?globalThis.Response:"u">typeof Response?Response:void T("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}let C={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
1aptcha-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"},O=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],N=new P(3e4,6e4);function L(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function D(e,t,i,r,n={}){return U(e,n,async()=>{let n={},a={};r&&("GET"===t?a=r:n={body:JSON.stringify(r)});let o=(0,s.Am)({...a,key:e.config.apiKey}).slice(1),c=await e._getAdditionalHeaders();c["Content-Type"]="application/json",e.languageCode&&(c["X-Firebase-Locale"]=e.languageCode);let l={method:t,headers:c,...n};return(0,s.c1)()||(l.referrerPolicy="strict-origin-when-cross-origin"),e.emulatorConfig&&(0,s.zJ)(e.emulatorConfig.host)&&(l.credentials="include"),A.fetch()(await F(e,e.config.apiHost,i,o),l)})}async function U(e,t,i){e._canInitEmulator=!1;let r={...C,...t};try{let t=new V(e),n=await Promise.race([i(),t.promise]);t.clearNetworkTimeout();let s=await n.json();if("needConfirmation"in s)throw x(e,"account-exists-with-different-credential",s);if(n.ok&&!("errorMessage"in s))return s;{let[t,i]=(n.ok?s.errorMessage:s.error.message).split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===t)throw x(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===t)throw x(e,"email-already-in-use",s);if("USER_DISABLED"===t)throw x(e,"user-disabled",s);let a=r[t]||t.toLowerCase().replace(/[_\s]+/g,"-");if(i)throw _(e,a,i);f(e,a)}}catch(t){if(t instanceof s.g)throw t;f(e,"network-request-failed",{message:String(t)})}}async function M(e,t,i,r,n={}){let s=await D(e,t,i,r,n);return"mfaPendingCredential"in s&&f(e,"multi-factor-auth-required",{_serverResponse:s}),s}async function F(e,t,i,r){let n=`${t}${i}?${r}`,s=e.config.emulator?R(e.config,n):`${e.config.apiScheme}://${n}`;return O.includes(i)&&(await e._persistenceManagerAvailable,"COOKIE"===e._getPersistenceType())?e._getPersistence()._getFinalTarget(s).toString():s}class V{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(g(this.auth,"network-request-failed")),N.get())})}}function x(e,t,i){let r={appName:e.name};i.email&&(r.email=i.email),i.phoneNumber&&(r.phoneNumber=i.phoneNumber);let n=g(e,t,r);return n.customData._tokenResponse=i,n}function j(e){return void 0!==e&&void 0!==e.getResponse}function H(e){return void 0!==e&&void 0!==e.enterprise}class q{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw 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(let t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)switch(t.enforcementState){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}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 K(e){return(await D(e,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}async function W(e,t){return D(e,"GET","/v2/recaptchaConfig",L(e,t))}async function z(e,t){return D(e,"POST","/v1/accounts:delete",t)}async function $(e,t){return D(e,"POST","/v1/accounts:update",t)}async function G(e,t){return D(e,"POST","/v1/accounts:lookup",t)}function J(e){if(e)try{let t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}async function B(e,t=!1){let i=(0,s.Ku)(e),r=await i.getIdToken(t),n=Q(r);y(n&&n.exp&&n.auth_time&&n.iat,i.auth,"internal-error");let a="object"==typeof n.firebase?n.firebase:void 0,o=a?.sign_in_provider;return{claims:n,token:r,authTime:J(Y(n.auth_time)),issuedAtTime:J(Y(n.iat)),expirationTime:J(Y(n.exp)),signInProvider:o||null,signInSecondFactor:a?.sign_in_second_factor||null}}function Y(e){return 1e3*Number(e)}function Q(e){let[t,i,r]=e.split(".");if(void 0===t||void 0===i||void 0===r)return m("JWT malformed, contained fewer than 3 sections"),null;try{let e=(0,s.u)(i);if(!e)return m("Failed to decode base64 JWT payload"),null;return JSON.parse(e)}catch(e){return m("Caught error parsing JWT payload as JSON",e?.toString()),null}}function Z(e){let t=Q(e);return y(t,"internal-error"),y(void 0!==t.exp,"internal-error"),y(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function X(e,t,i=!1){if(i)return t;try{return await t}catch(t){throw t instanceof s.g&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}class ee{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)return this.errorBackoff=3e4,Math.max(0,(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5);{let e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}}schedule(e=!1){if(!this.isRunning)return;let t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}class et{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=J(this.lastLoginAt),this.creationTime=J(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function ei(e){var t,i;let r=e.auth,n=await e.getIdToken(),s=await X(e,G(r,{idToken:n}));y(s?.users.length,r,"internal-error");let a=s.users[0];e._notifyReloadListener(a);let o=a.providerUserInfo?.length?en(a.providerUserInfo):[],c=(t=e.providerData,i=o,[...t.filter(e=>!i.some(t=>t.providerId===e.providerId)),...i]),l=e.isAnonymous,u=!(e.email&&a.passwordHash)&&!c?.length;Object.assign(e,{uid:a.localId,displayName:a.displayName||null,photoURL:a.photoUrl||null,email:a.email||null,emailVerified:a.emailVerified||!1,phoneNumber:a.phoneNumber||null,tenantId:a.tenantId||null,providerData:c,metadata:new et(a.createdAt,a.lastLoginAt),isAnonymous:!!l&&u})}async function er(e){let t=(0,s.Ku)(e);await ei(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function en(e){return e.map(({providerId:e,...t})=>
1({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}async function es(e,t){let i=await U(e,{},async()=>{let i=(0,s.Am)({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:n}=e.config,a=await F(e,r,"/v1/token",`key=${n}`),o=await e._getAdditionalHeaders();o["Content-Type"]="application/x-www-form-urlencoded";let c={method:"POST",headers:o,body:i};return e.emulatorConfig&&(0,s.zJ)(e.emulatorConfig.host)&&(c.credentials="include"),A.fetch()(a,c)});return{accessToken:i.access_token,expiresIn:i.expires_in,refreshToken:i.refresh_token}}async function ea(e,t){return D(e,"POST","/v2/accounts:revokeToken",L(e,t))}class eo{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){y(e.idToken,"internal-error"),y(void 0!==e.idToken,"internal-error"),y(void 0!==e.refreshToken,"internal-error");let t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):Z(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){y(0!==e.length,"internal-error");let t=Z(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(y(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){let{accessToken:i,refreshToken:r,expiresIn:n}=await es(e,t);this.updateTokensAndExpiration(i,r,Number(n))}updateTokensAndExpiration(e,t,i){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*i}static fromJSON(e,t){let{refreshToken:i,accessToken:r,expirationTime:n}=t,s=new eo;return i&&(y("string"==typeof i,"internal-error",{appName:e}),s.refreshToken=i),r&&(y("string"==typeof r,"internal-error",{appName:e}),s.accessToken=r),n&&(y("number"==typeof n,"internal-error",{appName:e}),s.expirationTime=n),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 eo,this.toJSON())}_performRefresh(){return T("not implemented")}}function ec(e,t){y("string"==typeof e||void 0===e,"internal-error",{appName:t})}class el{constructor({uid:e,auth:t,stsTokenManager:i,...r}){this.providerId="firebase",this.proactiveRefresh=new ee(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=i,this.accessToken=i.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 et(r.createdAt||void 0,r.lastLoginAt||void 0)}async getIdToken(e){let t=await X(this,this.stsTokenManager.getToken(this.auth,e));return y(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return B(this,e)}reload(){return er(this)}_assign(e){this!==e&&(y(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){let t=new el({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){y(!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 i=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),i=!0),t&&await ei(this),await this.auth._persistUserIfCurrent(this),i&&this.auth._notifyListenersIfCurrent(this)}async delete(){if((0,n._isFirebaseServerApp)(this.auth.app))return Promise.reject(v(this.auth));let e=await this.getIdToken();return await X(this,z(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
1nonymous: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){let i=t.displayName??void 0,r=t.email??void 0,n=t.phoneNumber??void 0,s=t.photoURL??void 0,a=t.tenantId??void 0,o=t._redirectEventId??void 0,c=t.createdAt??void 0,l=t.lastLoginAt??void 0,{uid:u,emailVerified:h,isAnonymous:d,providerData:p,stsTokenManager:m}=t;y(u&&m,e,"internal-error");let f=eo.fromJSON(this.name,m);y("string"==typeof u,e,"internal-error"),ec(i,e.name),ec(r,e.name),y("boolean"==typeof h,e,"internal-error"),y("boolean"==typeof d,e,"internal-error"),ec(n,e.name),ec(s,e.name),ec(a,e.name),ec(o,e.name),ec(c,e.name),ec(l,e.name);let g=new el({uid:u,auth:e,email:r,emailVerified:h,displayName:i,isAnonymous:d,photoURL:s,phoneNumber:n,tenantId:a,stsTokenManager:f,createdAt:c,lastLoginAt:l});return p&&Array.isArray(p)&&(g.providerData=p.map(e=>({...e}))),o&&(g._redirectEventId=o),g}static async _fromIdTokenResponse(e,t,i=!1){let r=new eo;r.updateFromServerResponse(t);let n=new el({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:i});return await ei(n),n}static async _fromGetAccountInfoResponse(e,t,i){let r=t.users[0];y(void 0!==r.localId,"internal-error");let n=void 0!==r.providerUserInfo?en(r.providerUserInfo):[],s=!(r.email&&r.passwordHash)&&!n?.length,a=new eo;a.updateFromIdToken(i);let o=new el({uid:r.localId,auth:e,stsTokenManager:a,isAnonymous:s});return Object.assign(o,{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:n,metadata:new et(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash)&&!n?.length}),o}}let eu=new Map;function eh(e){E(e instanceof Function,"Expected a class definition");let t=eu.get(e);return t?E(t instanceof e,"Instance stored in cache mismatched with class"):(t=new e,eu.set(e,t)),t}class ed{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){let t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}ed.type="NONE";let ep=ed;function em(e,t,i){return`firebase:${e}:${t}:${i}`}class ef{constructor(e,t,i){this.persistence=e,this.auth=t,this.userKey=i;const{config:r,name:n}=this.auth;this.fullUserKey=em(this.userKey,r.apiKey,n),this.fullPersistenceKey=em("persistence",r.apiKey,n),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(){let e=await this.persistence._get(this.fullUserKey);if(!e)return null;if("string"==typeof e){let t=await G(this.auth,{idToken:e}).catch(()=>void 0);return t?el._fromGetAccountInfoResponse(this.auth,t,e):null}return el._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;let t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,i="authUser"){if(!t.length)return new ef(eh(ep),e,i);let r=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e),n=r[0]||eh(ep),s=em(i,e.config.apiKey,e.name),a=null;for(let i of t)try{let t=await i._get(s);if(t){let r;if("string"==typeof t){let i=await G(e,{idToken:t}).catch(()=>void 0);if(!i)break;r=await el._fromGetAccountInfoResponse(e,i,t)}else r=el._fromJSON(e,t);i!==n&&(a=r),n=i;break}}catch{}let o=r.filter(e=>e._shouldAllowMigration);return n._shouldAllowMigration&&o.length&&(n=o[0],a&&await n._set(s,a.toJSON()),await Promise.all(t.map(async e=>{if(e!==n)try{await e._remove(s)}catch{}}))),new ef(n,e,i)}}function eg(e){let t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";{if(ew(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(e_(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(eT(t))return"Blackberry";if(eE(t))return"Webos";if(ev(t))return"Safari";if((t.includes("chrome/")||eI(t))&&!t.includes("edge/"))return"Chrome";if(ey(t))return"Android";let i=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);if(i?.length===2)return i[1]}return"Other"}function e_(e=(0,s.ZQ)()){return/firefox\//i.test(e)}function ev(e=(0,s.ZQ)()){let t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function eI(e=(0,s.ZQ)()){return/crios\//i.test(e)}function ew(e=(0,s.ZQ)()){return/iemobile/i.test(e)}function ey(e=(0,s.ZQ)()){return/android/i.test(e)}function eT(e=(0,s.ZQ)()){return/blackberry/i.test(e)}function eE(e=(0,s.ZQ)()){return/webos/i.test(e)}function ek(e=(0,s.ZQ)()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function eS(e=(0,s.ZQ)()){return/(iPad|iPhone|iPod).*OS 7_\d/i.test(e)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(e)}function eb(e=(0,s.ZQ)()){return ek(e)||ey(e)||eE(e)||eT(e)||/windows phone/i.test(e)||ew(e)}function eP(e,t=[]){let i;switch(e){case"Browser":i=eg((0,s.ZQ)());break;case"Worker":i=`${eg((0,s.ZQ)())}-${e}`;break;default:i=e}let r=t.length?t.join(","):"FirebaseCore-web";return`${i}/JsCore/${n.SDK_VERSION}/${r}`}class eR{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let i=t=>new Promise((i,r)=>{try{let r=e(t);i(r)}catch(e){r(e)}});i.onAbort=t,this.queue.push(i);let r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;let t=[];try{for(let i of this.queue)await i(e),i.onAbort&&t.push(i.onAbort)}catch(e){for(let e of(t.reverse(),t))try{e()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:e?.message})}}}async function eA(e,t={}){return D(e,"GET","/v2/passwordPolicy",L(e,t))}class eC{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){let t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&
1(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){let i=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;i&&(t.meetsMinPasswordLength=e.length>=i),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){let i;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let r=0;r<e.length;r++)i=e.charAt(r),this.updatePasswordCharacterOptionsStatuses(t,i>="a"&&i<="z",i>="A"&&i<="Z",i>="0"&&i<="9",this.allowedNonAlphanumericCharacters.includes(i))}updatePasswordCharacterOptionsStatuses(e,t,i,r,n){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=i)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=n))}}class eO{constructor(e,t,i,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=i,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new eL(this),this.idTokenSubscription=new eL(this),this.beforeStateQueue=new eR(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=d,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=eh(t)),this._initializationPromise=this.queue(async()=>{if(!this._deleted){if(this.persistenceManager=await ef.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;let e=await this.assertedPersistence.getCurrentUser();if(this.currentUser||e){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{let t=await G(this,{idToken:e}),i=await el._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(i)}catch(e){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",e),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if((0,n._isFirebaseServerApp)(this.app)){let e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}let t=await this.assertedPersistence.getCurrentUser(),i=t,r=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let t=this.redirectUser?._redirectEventId,n=i?._redirectEventId,s=await this.tryRedirectSignIn(e);(!t||t===n)&&s?.user&&(i=s.user,r=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(r)try{await this.beforeStateQueue.runMiddleware(i)}catch(e){i=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return(y(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId)?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}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 ei(e)}catch(e){if(e?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("u"<typeof navigator)return null;let e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}
1async updateCurrentUser(e){if((0,n._isFirebaseServerApp)(this.app))return Promise.reject(v(this));let t=e?(0,s.Ku)(e):null;return t&&y(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&&y(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(0,n._isFirebaseServerApp)(this.app)?Promise.reject(v(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return(0,n._isFirebaseServerApp)(this.app)?Promise.reject(v(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(eh(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();let t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){let e=new eC(await eA(this));null===this.tenantId?this._projectPasswordPolicy=e:this._tenantPasswordPolicies[this.tenantId]=e}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new s.FA("auth","Firebase",e())}onAuthStateChanged(e,t,i){return this.registerStateListener(this.authStateSubscription,e,t,i)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,i){return this.registerStateListener(this.idTokenSubscription,e,t,i)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{let i=this.onAuthStateChanged(()=>{i(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){let t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await ea(this,t)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,t){let i=await this.getOrInitRedirectPersistenceManager(t);return null===e?i.removeCurrentUser():i.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){let t=e&&eh(e)||this._popupRedirectResolver;y(t,this,"argument-error"),this.redirectPersistenceManager=await ef.create(this,[eh(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);let e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,i,r){if(this._deleted)return()=>{};let n="function"==typeof t?t:t.next.bind(t),s=!1,a=this._isInitialized?Promise.resolve():this._initializationPromise;if(y(a,this,"internal-error"),a.then(()=>{s||n(this.currentUser)}),"function"==typeof t){let n=e.addObserver(t,i,r);return()=>{s=!0,n()}}{let i=e.addObserver(t);return()=>{s=!0,i()}}}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 y(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=eP(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){let e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);let t=await this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();t&&(e["X-Firebase-Client"]=t);let i=await this._getAppCheckToken();return i&&(e["X-Firebase-AppCheck"]=i),e}async _getAppCheckToken(){if((0,n._isFirebaseServerApp)(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let e=await this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return e?.error&&function(e,...t){p.logLevel<=a.$b.WARN&&p.warn(`Auth (${n.SDK_VERSION}): ${e}`,...t)}(`Error while retrieving App Check token: ${e.error}`),e?.token}}function eN(e){return(0,s.Ku)(e)}class eL{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,s.tD)(e=>this.observer=e)}get next(){return y(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let eD={async loadJS(){throw Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function eU(e){return eD.loadJS(e)}function eM(e){return`__${e}${Math.floor(1e6*Math.random())}`}class eF{constructor(e){this.auth=e,this.counter=1e12,this._widgets=new Map}render(e,t){let i=this.counter;return this._widgets.set(i,new ej(e,this.auth.name,t||{})),this.counter++,i}reset(e){let t=e||1e12;this._widgets.get(t)?.delete(),this._widgets.delete(t)}getResponse(e){return this._widgets.get(e||1e12)?.getResponse()||""}async execute(e){return this._widgets.get(e||1e12)?.execute(),""}}class eV{constructor(){this.enterprise=new ex}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class ex{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class ej{constructor(e,t,i){this.params=i,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};const r="string"==typeof e?document.getElementById(e):e;y(r,"argument-error",{appName:t}),this.container=r,this.isVisible="invisible"!==this.params.size,this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),this.timerId||(this.timerId=window.setTimeout(()=>{this.responseToken=function(){let e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let i=0;i<50;i++)e.push(t.charAt(Math.floor(Math.random()*t.length)));return e.join("")}();let{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch(e){}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch(e){}this.isVisible&&this.execute()},6e4)},500))}checkIfDeleted(){if(this.deleted)throw Error("reCAPTCHA mock was already deleted!")}}let eH="NO_RECAPTCHA",eq="onFirebaseAuthREInstanceReady";class eK{constructor(e){this.type="recaptcha-enterprise",this.auth=eN(e)}async verify(e="verify",t=!1){async function i(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,i)=>
1{W(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(r=>{if(void 0===r.recaptchaKey)i(Error("recaptcha Enterprise site key undefined"));else{let i=new q(r);return null==e.tenantId?e._agentRecaptchaConfig=i:e._tenantRecaptchaConfigs[e.tenantId]=i,t(i.siteKey)}}).catch(e=>{i(e)})})}function r(t,i,r){let n=window.grecaptcha;H(n)?n.enterprise.ready(()=>{n.enterprise.execute(t,{action:e}).then(e=>{i(e)}).catch(()=>{i(eH)})}):r(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new eV().execute("siteKey",{action:"verify"}):new Promise((e,n)=>{i(this.auth).then(async i=>{if(!t&&H(window.grecaptcha)&&eK.scriptInjectionDeferred)await eK.scriptInjectionDeferred.promise,r(i,e,n);else{if("u"<typeof window)return void n(Error("RecaptchaVerifier is only supported in browser"));let t=eD.recaptchaEnterpriseScript;0!==t.length&&(t+=i+`&onload=${eq}`),eK.scriptInjectionDeferred=new s.cY,window[eq]=()=>{eK.scriptInjectionDeferred?.resolve()},eU(t).then(()=>eK.scriptInjectionDeferred?.promise).then(()=>{r(i,e,n)}).catch(e=>{n(e)})}}).catch(e=>{n(e)})})}}async function eW(e,t,i,r=!1,n=!1){let s,a=new eK(e);if(n)s=eH;else try{s=await a.verify(i)}catch(e){s=await a.verify(i,!0)}let o={...t};if("mfaSmsEnrollment"===i||"mfaSmsSignIn"===i){if("phoneEnrollmentInfo"in o){let e=o.phoneEnrollmentInfo.phoneNumber,t=o.phoneEnrollmentInfo.recaptchaToken;Object.assign(o,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:t,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in o){let e=o.phoneSignInInfo.recaptchaToken;Object.assign(o,{phoneSignInInfo:{recaptchaToken:e,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return o}return r?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function ez(e,t,i,r,n){if("EMAIL_PASSWORD_PROVIDER"===n)if(!e._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER"))return r(e,t).catch(async n=>{if("auth/missing-recaptcha-token"!==n.code)return Promise.reject(n);{console.log(`${i} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);let n=await eW(e,t,i,"getOobCode"===i);return r(e,n)}});else{let n=await eW(e,t,i,"getOobCode"===i);return r(e,n)}if("PHONE_PROVIDER"!==n)return Promise.reject(n+" provider is not supported.");if(e._getRecaptchaConfig()?.isProviderEnabled("PHONE_PROVIDER")){let n=await eW(e,t,i);return r(e,n).catch(async n=>{if(e._getRecaptchaConfig()?.getProviderEnforcementState("PHONE_PROVIDER")==="AUDIT"&&("auth/missing-recaptcha-token"===n.code||"auth/invalid-app-credential"===n.code)){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${i} flow.`);let n=await eW(e,t,i,!1,!0);return r(e,n)}return Promise.reject(n)})}{let n=await eW(e,t,i,!1,!0);return r(e,n)}}async function e$(e){let t=eN(e),i=new q(await W(t,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}));null==t.tenantId?t._agentRecaptchaConfig=i:t._tenantRecaptchaConfigs[t.tenantId]=i,i.isAnyProviderEnabled()&&new eK(t).verify()}function eG(e,t,i){let r=eN(e);y(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");let n=!!i?.disableWarnings,a=eJ(t),{host:o,port:c}=function(e){let t=eJ(e),i=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!i)return{host:"",port:null};let r=i[2].split("@").pop()||"",n=/^(\[[^\]]+\])(:|$)/.exec(r);if(n){let e=n[1];return{host:e,port:eB(r.substr(e.length+1))}}{let[e,t]=r.split(":");return{host:e,port:eB(t)}}}(t),l=null===c?"":`:${c}`,u={url:`${a}//${o}${l}/`},h=Object.freeze({host:o,port:c,protocol:a.replace(":",""),options:Object.freeze({disableWarnings:n})});if(!r._canInitEmulator){y(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),y((0,s.bD)(u,r.config.emulator)&&(0,s.bD)(h,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=h,r.settings.appVerificationDisabledForTesting=!0,(0,s.zJ)(o)?(0,s.gE)(`${a}//${o}${l}`):n||function(){function e(){let e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"u">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."),"u">typeof window&&"u">typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function eJ(e){let t=e.indexOf(":");
1return t<0?"":e.substr(0,t+1)}function eB(e){if(!e)return null;let t=Number(e);return isNaN(t)?null:t}eK.scriptInjectionDeferred=null;class eY{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return T("not implemented")}_getIdTokenResponse(e){return T("not implemented")}_linkToIdToken(e,t){return T("not implemented")}_getReauthenticationResolver(e){return T("not implemented")}}async function eQ(e,t){return D(e,"POST","/v1/accounts:resetPassword",L(e,t))}async function eZ(e,t){return D(e,"POST","/v1/accounts:update",t)}async function eX(e,t){return D(e,"POST","/v1/accounts:signUp",t)}async function e0(e,t){return D(e,"POST","/v1/accounts:update",L(e,t))}async function e1(e,t){return M(e,"POST","/v1/accounts:signInWithPassword",L(e,t))}async function e2(e,t){return D(e,"POST","/v1/accounts:sendOobCode",L(e,t))}async function e3(e,t){return e2(e,t)}async function e6(e,t){return e2(e,t)}async function e4(e,t){return e2(e,t)}async function e5(e,t){return e2(e,t)}async function e9(e,t){return M(e,"POST","/v1/accounts:signInWithEmailLink",L(e,t))}async function e8(e,t){return M(e,"POST","/v1/accounts:signInWithEmailLink",L(e,t))}class e7 extends eY{constructor(e,t,i,r=null){super("password",i),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new e7(e,t,"password")}static _fromEmailAndCode(e,t,i=null){return new e7(e,t,"emailLink",i)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let t="string"==typeof e?JSON.parse(e):e;if(t?.email&&t?.password){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);else if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return ez(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",e1,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return e9(e,{email:this._email,oobCode:this._password});default:f(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return ez(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",eX,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return e8(e,{idToken:t,email:this._email,oobCode:this._password});default:f(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function te(e,t){return M(e,"POST","/v1/accounts:signInWithIdp",L(e,t))}class tt extends eY{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let t=new tt(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):f("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
1once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){let{providerId:t,signInMethod:i,...r}="string"==typeof e?JSON.parse(e):e;if(!t||!i)return null;let n=new tt(t,i);return n.idToken=r.idToken||void 0,n.accessToken=r.accessToken||void 0,n.secret=r.secret,n.nonce=r.nonce,n.pendingToken=r.pendingToken||null,n}_getIdTokenResponse(e){return te(e,this.buildRequest())}_linkToIdToken(e,t){let i=this.buildRequest();return i.idToken=t,te(e,i)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,te(e,t)}buildRequest(){let e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=(0,s.Am)(t)}return e}}async function ti(e,t){return D(e,"POST","/v1/accounts:sendVerificationCode",L(e,t))}async function tr(e,t){return M(e,"POST","/v1/accounts:signInWithPhoneNumber",L(e,t))}async function tn(e,t){let i=await M(e,"POST","/v1/accounts:signInWithPhoneNumber",L(e,t));if(i.temporaryProof)throw x(e,"account-exists-with-different-credential",i);return i}let ts={USER_NOT_FOUND:"user-not-found"};async function ta(e,t){return M(e,"POST","/v1/accounts:signInWithPhoneNumber",L(e,{...t,operation:"REAUTH"}),ts)}class to extends eY{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new to({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new to({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return tr(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return tn(e,{idToken:t,...this._makeVerificationRequest()})}_getReauthenticationResolver(e){return ta(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:t,verificationId:i,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:i,code:r}}toJSON(){let e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"==typeof e&&(e=JSON.parse(e));let{verificationId:t,verificationCode:i,phoneNumber:r,temporaryProof:n}=e;return i||t||r||n?new to({verificationId:t,verificationCode:i,phoneNumber:r,temporaryProof:n}):null}}class tc{constructor(e){const t=(0,s.I9)((0,s.hp)(e)),i=t.apiKey??null,r=t.oobCode??null,n=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);y(i&&r&&n,"argument-error"),this.apiKey=i,this.operation=n,this.code=r,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(e){let t,i,r,n=(i=(t=(0,s.I9)((0,s.hp)(e)).link)?(0,s.I9)((0,s.hp)(t)).deep_link_id:null,((r=(0,s.I9)((0,s.hp)(e)).deep_link_id)?(0,s.I9)((0,s.hp)(r)).link:null)||r||i||t||e);try{return new tc(n)}catch{return null}}}class tl{constructor(){this.providerId=tl.PROVIDER_ID}static credential(e,t){return e7._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){let i=tc.parseLink(t);return y(i,"argument-error"),e7._fromEmailAndCode(e,i.code,i.tenantId)}}tl.PROVIDER_ID="password",tl.EMAIL_PASSWORD_SIGN_IN_METHOD="password",tl.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class tu{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 th extends tu{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class td extends th{static credentialFromJSON(e){let t="string"==typeof e?JSON.parse(e):e;return y("providerId"in t&&"signInMethod"in t,"argument-error"),tt._fromParams(t)}credential(e){return this._credential({...e,nonce:e.rawNonce})}_credential(e){return y(e.idToken||e.accessToken,"argument-error"),tt._fromParams({...e,providerId:this.providerId,sign
1InMethod:this.providerId})}static credentialFromResult(e){return td.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return td.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:i,oauthTokenSecret:r,pendingToken:n,nonce:s,providerId:a}=e;if(!i&&!r&&!t&&!n||!a)return null;try{return new td(a)._credential({idToken:t,accessToken:i,nonce:s,pendingToken:n})}catch(e){return null}}}class tp extends th{constructor(){super("facebook.com")}static credential(e){return tt._fromParams({providerId:tp.PROVIDER_ID,signInMethod:tp.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return tp.credentialFromTaggedObject(e)}static credentialFromError(e){return tp.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return tp.credential(e.oauthAccessToken)}catch{return null}}}tp.FACEBOOK_SIGN_IN_METHOD="facebook.com",tp.PROVIDER_ID="facebook.com";class tm extends th{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return tt._fromParams({providerId:tm.PROVIDER_ID,signInMethod:tm.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return tm.credentialFromTaggedObject(e)}static credentialFromError(e){return tm.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:i}=e;if(!t&&!i)return null;try{return tm.credential(t,i)}catch{return null}}}tm.GOOGLE_SIGN_IN_METHOD="google.com",tm.PROVIDER_ID="google.com";class tf extends th{constructor(){super("github.com")}static credential(e){return tt._fromParams({providerId:tf.PROVIDER_ID,signInMethod:tf.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return tf.credentialFromTaggedObject(e)}static credentialFromError(e){return tf.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return tf.credential(e.oauthAccessToken)}catch{return null}}}tf.GITHUB_SIGN_IN_METHOD="github.com",tf.PROVIDER_ID="github.com";class tg extends eY{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){return te(e,this.buildRequest())}_linkToIdToken(e,t){let i=this.buildRequest();return i.idToken=t,te(e,i)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,te(e,t)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){let{providerId:t,signInMethod:i,pendingToken:r}="string"==typeof e?JSON.parse(e):e;return t&&i&&r&&t===i?new tg(t,r):null}static _create(e,t){return new tg(e,t)}buildRequest(){return{requestUri:"http://localhost",returnSecureToken:!0,pendingToken:this.pendingToken}}}class t_ extends tu{constructor(e){y(e.startsWith("saml."),"argument-error"),super(e)}static credentialFromResult(e){return t_.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return t_.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){let t=tg.fromJSON(e);return y(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{pendingToken:t,providerId:i}=e;if(!t||!i)return null;try{return tg._create(i,t)}catch(e){return null}}}class tv extends th{constructor(){super("twitter.com")}static credential(e,t){return tt._fromParams({providerId:tv.PROVIDER_ID,signInMethod:tv.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return tv.credentialFromTaggedObject(e)}static credentialFromError(e){return tv.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthAccessToken:t,oauthTokenSecret:i}=e;if(!t||!i)return null;try{return tv.credential(t,i)}catch{return null}}}async function tI(e,t){return M(e,"POST","/v1/accounts:signUp",L(e,t))}tv.TWITTER_SIGN_IN_METHOD="twitter.com",tv.PROVIDER_ID="twitter.com";class tw{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,i,r=!1){return new tw({user:await el._fromIdTokenResponse(e,i,r),providerId:ty(i),_tokenResponse:i,operationType:t})}static async _forOperation(e,t,i){return await e._updateTokensIfNecessary(i,!0),new tw({user:e,providerId:ty(i),_tokenResponse:i,operationType:t})}}function ty(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}async function tT(e){if((0,n._isFirebaseServerApp)(e.app))return Promise.reject(v(e));let t=eN(e);if(await t._initializationPromise,t.currentUser?.isAnonymous)return new tw({user:t.currentUser,providerId:null,operationType:"signIn"});let i=await tI(t,{returnSecureToken:!0}),r=await tw._fromIdTokenResponse(t,"signIn",i,!0);return await t._updateCurrentUser(r.user),r}class tE extends s.g{constructor(e,t,i,r){super(t.code,t.message),this.operationType=i,this.user=r,Object.setPrototypeOf(this,tE.prototype),this.customData={appName:e.n
1ame,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:i}}static _fromErrorAndOperation(e,t,i,r){return new tE(e,t,i,r)}}function tk(e,t,i,r){return("reauthenticate"===t?i._getReauthenticationResolver(e):i._getIdTokenResponse(e)).catch(i=>{if("auth/multi-factor-auth-required"===i.code)throw tE._fromErrorAndOperation(e,i,t,r);throw i})}function tS(e){return new Set(e.map(({providerId:e})=>e).filter(e=>!!e))}async function tb(e,t){let i=(0,s.Ku)(e);await tR(!0,i,t);let{providerUserInfo:r}=await $(i.auth,{idToken:await i.getIdToken(),deleteProvider:[t]}),n=tS(r||[]);return i.providerData=i.providerData.filter(e=>n.has(e.providerId)),n.has("phone")||(i.phoneNumber=null),await i.auth._persistUserIfCurrent(i),i}async function tP(e,t,i=!1){let r=await X(e,t._linkToIdToken(e.auth,await e.getIdToken()),i);return tw._forOperation(e,"link",r)}async function tR(e,t,i){await ei(t),y(tS(t.providerData).has(i)===e,t.auth,!1===e?"provider-already-linked":"no-such-provider")}async function tA(e,t,i=!1){let{auth:r}=e;if((0,n._isFirebaseServerApp)(r.app))return Promise.reject(v(r));let s="reauthenticate";try{let n=await X(e,tk(r,s,t,e),i);y(n.idToken,r,"internal-error");let a=Q(n.idToken);y(a,r,"internal-error");let{sub:o}=a;return y(e.uid===o,r,"user-mismatch"),tw._forOperation(e,s,n)}catch(e){throw e?.code==="auth/user-not-found"&&f(r,"user-mismatch"),e}}async function tC(e,t,i=!1){if((0,n._isFirebaseServerApp)(e.app))return Promise.reject(v(e));let r="signIn",s=await tk(e,r,t),a=await tw._fromIdTokenResponse(e,r,s);return i||await e._updateCurrentUser(a.user),a}async function tO(e,t){return tC(eN(e),t)}async function tN(e,t){let i=(0,s.Ku)(e);return await tR(!1,i,t.providerId),tP(i,t)}async function tL(e,t){return tA((0,s.Ku)(e),t)}async function tD(e,t){return M(e,"POST","/v1/accounts:signInWithCustomToken",L(e,t))}async function tU(e,t){if((0,n._isFirebaseServerApp)(e.app))return Promise.reject(v(e));let i=eN(e),r=await tD(i,{token:t,returnSecureToken:!0}),s=await tw._fromIdTokenResponse(i,"signIn",r);return await i._updateCurrentUser(s.user),s}class tM{constructor(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}static _fromServerResponse(e,t){return"phoneInfo"in t?tF._fromServerResponse(e,t):"totpInfo"in t?tV._fromServerResponse(e,t):f(e,"internal-error")}}class tF extends tM{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new tF(t)}}class tV extends tM{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new tV(t)}}function tx(e,t,i){y(i.url?.length>0,e,"invalid-continue-uri"),y(void 0===i.dynamicLinkDomain||i.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),y(void 0===i.linkDomain||i.linkDomain.length>0,e,"invalid-hosting-link-domain"),t.continueUrl=i.url,t.dynamicLinkDomain=i.dynamicLinkDomain,t.linkDomain=i.linkDomain,t.canHandleCodeInApp=i.handleCodeInApp,i.iOS&&(y(i.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=i.iOS.bundleId),i.android&&(y(i.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=i.android.installApp,t.androidMinimumVersionCode=i.android.minimumVersion,t.androidPackageName=i.android.packageName)}async function tj(e){let t=eN(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function tH(e,t,i){let r=eN(e),n={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};i&&tx(r,n,i),await ez(r,n,"getOobCode",e6,"EMAIL_PASSWORD_PROVIDER")}async function tq(e,t,i){await eQ((0,s.Ku)(e),{oobCode:t,newPassword:i}).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&tj(e),t})}async function tK(e,t){await e0((0,s.Ku)(e),{oobCode:t})}async function tW(e,t){let i=(0,s.Ku)(e),r=await eQ(i,{oobCode:t}),n=r.requestType;switch(y(n,i,"internal-error"),n){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":y(r.newEmail,i,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":y(r.mfaInfo,i,"internal-error");default:y(r.email,i,"internal-error")}let a=null;return r.mfaInfo&&(a=tM._fromServerResponse(eN(i),r.mfaInfo)),{data:{email:("VERIFY_AND_CHANGE_EMAIL"===r.requestType?r.newEmail:r.email)||null,previousEmail:("VERIFY_AND_CHANGE_EMAIL"===r.requestType?r.email:r.newEmail)||null,multiFactorInfo:a},operation:n}}async function tz(e,t){let{data:i}=await tW((0,s.Ku)(e),t);return i.email}async function t$(e,t,i){if((0,n._isFirebaseServerApp)(e.app))return Promise.reject(v(e));let r=eN(e),s=ez(r,{returnSecureToken:!0,email:t,password:i,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",tI,"EMAIL_PASSWORD_PROVIDER"),a=await s.catch(t=>{throw"auth/password-does-not-meet-requirements"===t.code&&tj(e),t}),o=await tw._fromIdTokenResponse(r,"signIn",a);return await r._updateCurrentUser(o.user),o}function tG(e,t,i){return(0,n._isFirebaseServerApp)(e.app)?Promise.reject(v(e)):tO((0,s.Ku)(e),tl.credential(t,i)).c
1atch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&tj(e),t})}async function tJ(e,t,i){let r=eN(e),n={requestType:"EMAIL_SIGNIN",email:t,clientType:"CLIENT_TYPE_WEB"};y(i.handleCodeInApp,r,"argument-error"),i&&tx(r,n,i),await ez(r,n,"getOobCode",e4,"EMAIL_PASSWORD_PROVIDER")}function tB(e,t){let i=tc.parseLink(t);return i?.operation==="EMAIL_SIGNIN"}async function tY(e,t,i){if((0,n._isFirebaseServerApp)(e.app))return Promise.reject(v(e));let r=(0,s.Ku)(e),a=tl.credentialWithLink(t,i||k());return y(a._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),tO(r,a)}async function tQ(e,t){return D(e,"POST","/v1/accounts:createAuthUri",L(e,t))}async function tZ(e,t){let i=S()?k():"http://localhost",{signinMethods:r}=await tQ((0,s.Ku)(e),{identifier:t,continueUri:i});return r||[]}async function tX(e,t){let i=(0,s.Ku)(e),r={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&tx(i.auth,r,t);let{email:n}=await e3(i.auth,r);n!==e.email&&await e.reload()}async function t0(e,t,i){let r=(0,s.Ku)(e),n={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await e.getIdToken(),newEmail:t};i&&tx(r.auth,n,i);let{email:a}=await e5(r.auth,n);a!==e.email&&await e.reload()}async function t1(e,t){return D(e,"POST","/v1/accounts:update",t)}async function t2(e,{displayName:t,photoURL:i}){if(void 0===t&&void 0===i)return;let r=(0,s.Ku)(e),n=await r.getIdToken(),a=await X(r,t1(r.auth,{idToken:n,displayName:t,photoUrl:i,returnSecureToken:!0}));r.displayName=a.displayName||null,r.photoURL=a.photoUrl||null;let o=r.providerData.find(({providerId:e})=>"password"===e);o&&(o.displayName=r.displayName,o.photoURL=r.photoURL),await r._updateTokensIfNecessary(a)}function t3(e,t){let i=(0,s.Ku)(e);return(0,n._isFirebaseServerApp)(i.auth.app)?Promise.reject(v(i.auth)):t4(i,t,null)}function t6(e,t){return t4((0,s.Ku)(e),null,t)}async function t4(e,t,i){let{auth:r}=e,n={idToken:await e.getIdToken(),returnSecureToken:!0};t&&(n.email=t),i&&(n.password=i);let s=await X(e,eZ(r,n));await e._updateTokensIfNecessary(s,!0)}class t5{constructor(e,t,i={}){this.isNewUser=e,this.providerId=t,this.profile=i}}class t9 extends t5{constructor(e,t,i,r){super(e,t,i),this.username=r}}class t8 extends t5{constructor(e,t){super(e,"facebook.com",t)}}class t7 extends t9{constructor(e,t){super(e,"github.com",t,"string"==typeof t?.login?t?.login:null)}}class ie extends t5{constructor(e,t){super(e,"google.com",t)}}class it extends t9{constructor(e,t,i){super(e,"twitter.com",t,i)}}function ii(e){let{user:t,_tokenResponse:i}=e;return t.isAnonymous&&!i?{providerId:null,isNewUser:!1,profile:null}:function(e){if(!e)return null;let{providerId:t}=e,i=e.rawUserInfo?JSON.parse(e.rawUserInfo):{},r=e.isNewUser||"identitytoolkit#SignupNewUserResponse"===e.kind;if(!t&&e?.idToken){let t=Q(e.idToken)?.firebase?.sign_in_provider;if(t)return new t5(r,"anonymous"!==t&&"custom"!==t?t:null)}if(!t)return null;switch(t){case"facebook.com":return new t8(r,i);case"github.com":return new t7(r,i);case"google.com":return new ie(r,i);case"twitter.com":return new it(r,i,e.screenName||null);case"custom":case"anonymous":return new t5(r,null);default:return new t5(r,t,i)}}(i)}class ir{constructor(e,t,i){this.type=e,this.credential=t,this.user=i}static _fromIdtoken(e,t){return new ir("enroll",e,t)}static _fromMfaPendingCredential(e){return new ir("signin",e)}toJSON(){return{multiFactorSession:{["enroll"===this.type?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){if(e?.multiFactorSession){if(e.multiFactorSession?.pendingCredential)return ir._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);else if(e.multiFactorSession?.idToken)return ir._fromIdtoken(e.multiFactorSession.idToken)}return null}}class is{constructor(e,t,i){this.session=e,this.hints=t,this.signInResolver=i}static _fromError(e,t){let i=eN(e),r=t.customData._serverResponse,n=(r.mfaInfo||[]).map(e=>tM._fromServerResponse(i,e));y(r.mfaPendingCredential,i,"internal-error");let s=ir._fromMfaPendingCredential(r.mfaPendingCredential);return new is(s,n,async e=>{let n=await e._process(i,s);delete r.mfaInfo,delete r.mfaPendingCredential;let a={...r,idToken:n.idToken,refreshToken:n.refreshToken};switch(t.operationType){case"signIn":let o=await tw._fromIdTokenResponse(i,t.operationType,a);return await i._updateCurrentUser(o.user),o;case"reauthenticate":return y(t.user,i,"internal-error"),tw._forOperation(t.user,t.operationType,a);default:f(i,"internal-error")}})}async resolveSignIn(e){return this.signInResolver(e)}}function ia(e,t){let i=(0,s.Ku)(e);return y(t.customData.operationType,i,"argument-error"),y(t.customData._serverResponse?.mfaPendingCredential,i,"argument-error"),is._fromError(i,t)}function io(e,t){return D(e,"POST","/v2/accounts/mfaEnrollment:start",L(e,t))}class ic{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map(t=>tM._fromServerResponse(e.auth,t)))})}static _fromUser(e){return new ic(e)}async getSession(){return ir._fromIdtoken(await this.user.getIdToken(),this.user)}
1async enroll(e,t){let i=await this.getSession(),r=await X(this.user,e._process(this.user.auth,i,t));return await this.user._updateTokensIfNecessary(r),this.user.reload()}async unenroll(e){let t="string"==typeof e?e:e.uid,i=await this.user.getIdToken();try{var r,n;let e=await X(this.user,(r=this.user.auth,n={idToken:i,mfaEnrollmentId:t},D(r,"POST","/v2/accounts/mfaEnrollment:withdraw",L(r,n))));this.enrolledFactors=this.enrolledFactors.filter(({uid:e})=>e!==t),await this.user._updateTokensIfNecessary(e),await this.user.reload()}catch(e){throw e}}}let il=new WeakMap;function iu(e){let t=(0,s.Ku)(e);return il.has(t)||il.set(t,ic._fromUser(t)),il.get(t)}let ih="__sak";class id{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{if(!this.storage)return Promise.resolve(!1);return this.storage.setItem(ih,"1"),this.storage.removeItem(ih),Promise.resolve(!0)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){let t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class ip extends id{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=eb(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(let t of Object.keys(this.listeners)){let i=this.storage.getItem(t),r=this.localCache[t];i!==r&&e(t,r,i)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys((e,t,i)=>{this.notifyListeners(e,i)});let i=e.key;t?this.detachListener():this.stopPolling();let r=()=>{let e=this.storage.getItem(i);(t||this.localCache[i]!==e)&&this.notifyListeners(i,e)},n=this.storage.getItem(i);(0,s.lT)()&&10===document.documentMode&&n!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,10):r()}notifyListeners(e,t){this.localCache[e]=t;let i=this.listeners[e];if(i)for(let e of Array.from(i))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:i}),!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){let t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}ip.type="LOCAL";let im=ip;function ig(e){let t=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),i=RegExp(`${t}=([^;]+)`);return document.cookie.match(i)?.[1]??null}function i_(e){let t="http:"===window.location.protocol;return`${t?"__dev_":"__HOST-"}FIREBASE_${e.split(":")[3]}`}class iv{constructor(){this.type="COOKIE",this.listenerUnsubscribes=new Map}_getFinalTarget(e){let t=new URL(`${window.location.origin}/__cookies__`);return t.searchParams.set("finalTarget",e),t}async _isAvailable(){return!("boolean"==typeof isSecureContext&&!isSecureContext||"u"<typeof navigator||"u"<typeof document)&&(navigator.cookieEnabled??!0)}async _set(e,t){}async _get(e){if(!this._isAvailable())return null;let t=i_(e);if(window.cookieStore){let e=await window.cookieStore.get(t);return e?.value}return ig(t)}async _remove(e){if(!this._isAvailable()||!await this._get(e))return;let t=i_(e);document.cookie=`${t}=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;
1Priority=High`,await fetch("/__cookies__",{method:"DELETE"}).catch(()=>void 0)}_addListener(e,t){if(!this._isAvailable())return;let i=i_(e);if(window.cookieStore){let e=e=>{let r=e.changed.find(e=>e.name===i);r&&t(r.value),e.deleted.find(e=>e.name===i)&&t(null)};return this.listenerUnsubscribes.set(t,()=>window.cookieStore.removeEventListener("change",e)),window.cookieStore.addEventListener("change",e)}let r=ig(i),n=setInterval(()=>{let e=ig(i);e!==r&&(t(e),r=e)},1e3);this.listenerUnsubscribes.set(t,()=>clearInterval(n))}_removeListener(e,t){let i=this.listenerUnsubscribes.get(t);i&&(i(),this.listenerUnsubscribes.delete(t))}}iv.type="COOKIE";class iI extends id{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}iI.type="SESSION";let iw=iI;class iy{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){let t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;let i=new iy(e);return this.receivers.push(i),i}isListeningto(e){return this.eventTarget===e}async handleEvent(e){let{eventId:t,eventType:i,data:r}=e.data,n=this.handlersMap[i];if(!n?.size)return;e.ports[0].postMessage({status:"ack",eventId:t,eventType:i});let s=Array.from(n).map(async t=>t(e.origin,r)),a=await Promise.all(s.map(async e=>{try{let t=await e;return{fulfilled:!0,value:t}}catch(e){return{fulfilled:!1,reason:e}}}));e.ports[0].postMessage({status:"done",eventId:t,eventType:i,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 iT(e="",t=10){let i="";for(let e=0;e<t;e++)i+=Math.floor(10*Math.random());return e+i}iy.receivers=[];class iE{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,i=50){let r,n,s="u">typeof MessageChannel?new MessageChannel:null;if(!s)throw Error("connection_unavailable");return new Promise((a,o)=>{let c=iT("",20);s.port1.start();let l=setTimeout(()=>{o(Error("unsupported_event"))},i);n={messageChannel:s,onMessage(e){if(e.data.eventId===c)switch(e.data.status){case"ack":clearTimeout(l),r=setTimeout(()=>{o(Error("timeout"))},3e3);break;case"done":clearTimeout(r),a(e.data.response);break;default:clearTimeout(l),clearTimeout(r),o(Error("invalid_response"))}}},this.handlers.add(n),s.port1.addEventListener("message",n.onMessage),this.target.postMessage({eventType:e,eventId:c,data:t},[s.port2])}).finally(()=>{n&&this.removeMessageHandler(n)})}}function ik(){return window}function iS(){return void 0!==ik().WorkerGlobalScope&&"function"==typeof ik().importScripts}async function ib(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}let iP="firebaseLocalStorageDb",iR="firebaseLocalStorage",iA="fbase_key";class iC{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 iO(e,t){return e.transaction([iR],t?"readwrite":"readonly").objectStore(iR)}async function iN(e,t,i){return new iC(iO(e,!0).put({[iA]:t,value:i})).toPromise()}async function iL(e,t){let i=iO(e,!1).get(t),r=await new iC(i).toPromise();return void 0===r?null:r.value}function iD(e,t){return new iC(iO(e,!0).delete(t)).toPromise()}class iU{constructor(){this.type="LOCAL",this.dbPromise=null,this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.dbPromise||(this.dbPromise=function e(){let t=indexedDB.open(iP,1);return new Promise((i,r)=>{t.addEventListener("error",()=>{r(t.error)}),t.addEventListener("upgradeneeded",()=>{let e=t.result;try{e.createObjectStore(iR,{keyPath:iA})}catch(e){r(e)}}),t.addEventListener("success",async()=>{let r=t.result;r.objectStoreNames.contains(iR)?i(r):(r.close(),await new iC(indexedDB.deleteDatabase(iP)).toPromise(),i(await e()))})})}(),this.dbPromise.catch(()=>{this.dbPromise=null})),this.dbPromise}async _withRetries(e){let t=0;for(;;)try{let t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;this.dbPromise&&((await this.dbPromise).close(),this.dbPromise=null)}}async initializeServiceWorkerMessaging(){return iS()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=iy._getInstance(iS()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}
1async initializeSender(){if(this.activeServiceWorker=await ib(),!this.activeServiceWorker)return;this.sender=new iE(this.activeServiceWorker);let 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{if(!indexedDB)return!1;return await this._withRetries(async e=>{await iN(e,ih,"1"),await iD(e,ih)}),!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(i=>iN(i,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){let t=await this._withRetries(t=>iL(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>iD(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){let e=await this._withRetries(e=>new iC(iO(e,!1).getAll()).toPromise());if(!e||0!==this.pendingWrites)return[];let t=[],i=new Set;if(0!==e.length)for(let{fbase_key:r,value:n}of e)i.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(n)&&(this.notifyListeners(r,n),t.push(r));for(let e of Object.keys(this.localCache))this.localCache[e]&&!i.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}notifyListeners(e,t){this.localCache[e]=t;let i=this.listeners[e];if(i)for(let e of Array.from(i))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.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()}}iU.type="LOCAL";let iM=iU;function iF(e,t){return D(e,"POST","/v2/accounts/mfaSignIn:start",L(e,t))}let iV=eM("rcb"),ix=new P(3e4,6e4);class ij{constructor(){this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!ik().grecaptcha?.render}load(e,t=""){var i;return(y((i=t).length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(i),e,"argument-error"),this.shouldResolveImmediately(t)&&j(ik().grecaptcha))?Promise.resolve(ik().grecaptcha):new Promise((i,r)=>{let n=ik().setTimeout(()=>{r(g(e,"network-request-failed"))},ix.get());ik()[iV]=()=>{ik().clearTimeout(n),delete ik()[iV];let s=ik().grecaptcha;if(!s||!j(s))return void r(g(e,"internal-error"));let a=s.render;s.render=(e,t)=>{let i=a(e,t);return this.counter++,i},this.hostLanguage=t,i(s)},eU(`${eD.recaptchaV2Script}?${(0,s.Am)({onload:iV,render:"explicit",hl:t})}`).catch(()=>{clearTimeout(n),r(g(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){return!!ik().grecaptcha?.render&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}class iH{async load(e){return new eF(e)}clearedOneInstance(){}}let iq="recaptcha",iK={theme:"light",type:"image"};class iW{constructor(e,t,i={...iK}){this.parameters=i,this.type=iq,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=eN(e),this.isInvisible="invisible"===this.parameters.size,y("u">typeof document,this.auth,"operation-not-supported-in-this-environment");const r="string"==typeof t?document.getElementById(t):t;y(r,this.auth,"argument-error"),this.container=r,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new iH:new ij,this.validateStartingState()}async verify(){this.assertNotDestroyed();let e=await this.render(),t=this.getAssertedRecaptcha(),i=t.getResponse(e);return i||new Promise(i=>{let r=e=>{e&&(this.tokenChangeListeners.delete(r),i(e))};this.tokenChangeListeners.add(r),this.isInvisible&&t.execute(e)})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise||(this.renderPromise=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e})),this.renderPromise}_reset(){this.assertNotDestroyed(),null!==this.widgetId&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEac
1h(e=>{this.container.removeChild(e)})}validateStartingState(){y(!this.parameters.sitekey,this.auth,"argument-error"),y(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),y("u">typeof document,this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach(e=>e(t)),"function"==typeof e)e(t);else if("string"==typeof e){let i=ik()[e];"function"==typeof i&&i(t)}}}assertNotDestroyed(){y(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){let t=document.createElement("div");e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}async init(){let e;y(S()&&!iS(),this.auth,"internal-error"),await (e=null,new Promise(t=>{"complete"===document.readyState?t():(e=()=>t(),window.addEventListener("load",e))}).catch(t=>{throw e&&window.removeEventListener("load",e),t})),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);let t=await K(this.auth);y(t,this.auth,"internal-error"),this.parameters.sitekey=t}getAssertedRecaptcha(){return y(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}class iz{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){let t=to._fromVerification(this.verificationId,e);return this.onConfirmation(t)}}async function i$(e,t,i){if((0,n._isFirebaseServerApp)(e.app))return Promise.reject(v(e));let r=eN(e);return new iz(await iB(r,t,(0,s.Ku)(i)),e=>tO(r,e))}async function iG(e,t,i){let r=(0,s.Ku)(e);return await tR(!1,r,"phone"),new iz(await iB(r.auth,t,(0,s.Ku)(i)),e=>tN(r,e))}async function iJ(e,t,i){let r=(0,s.Ku)(e);return(0,n._isFirebaseServerApp)(r.auth.app)?Promise.reject(v(r.auth)):new iz(await iB(r.auth,t,(0,s.Ku)(i)),e=>tL(r,e))}async function iB(e,t,i){if(!e._getRecaptchaConfig())try{await e$(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){let t=r.session;if("phoneNumber"in r){y("enroll"===t.type,e,"internal-error");let n={idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"}},s=async(e,t)=>{if(t.phoneEnrollmentInfo.captchaResponse===eH){y(i?.type===iq,e,"argument-error");let r=await iQ(e,t,i);return io(e,r)}return io(e,t)},a=ez(e,n,"mfaSmsEnrollment",s,"PHONE_PROVIDER");return(await a.catch(e=>Promise.reject(e))).phoneSessionInfo.sessionInfo}{y("signin"===t.type,e,"internal-error");let n=r.multiFactorHint?.uid||r.multiFactorUid;y(n,e,"missing-multi-factor-info");let s={mfaPendingCredential:t.credential,mfaEnrollmentId:n,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}},a=async(e,t)=>{if(t.phoneSignInInfo.captchaResponse===eH){y(i?.type===iq,e,"argument-error");let r=await iQ(e,t,i);return iF(e,r)}return iF(e,t)},o=ez(e,s,"mfaSmsSignIn",a,"PHONE_PROVIDER");return(await o.catch(e=>Promise.reject(e))).phoneResponseInfo.sessionInfo}}{let t={phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"},n=async(e,t)=>{if(t.captchaResponse===eH){y(i?.type===iq,e,"argument-error");let r=await iQ(e,t,i);return ti(e,r)}return ti(e,t)},s=ez(e,t,"sendVerificationCode",n,"PHONE_PROVIDER");return(await s.catch(e=>Promise.reject(e))).sessionInfo}}finally{i?._reset()}}async function iY(e,t){let i=(0,s.Ku)(e);if((0,n._isFirebaseServerApp)(i.auth.app))return Promise.reject(v(i.auth));await tP(i,t)}async function iQ(e,t,i){y(i.type===iq,e,"argument-error");let r=await i.verify();y("string"==typeof r,e,"argument-error");let n={...t};if("phoneEnrollmentInfo"in n){let e=n.phoneEnrollmentInfo.phoneNumber,t=n.phoneEnrollmentInfo.captchaResponse,i=n.phoneEnrollmentInfo.clientType,s=n.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(n,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:r,captchaResponse:t,clientType:i,recaptchaVersion:s}}),n}if(!("phoneSignInInfo"in n))return Object.assign(n,{recaptchaToken:r}),n;{let e=n.phoneSignInInfo.captchaResponse,t=n.phoneSignInInfo.clientType,i=n.phoneSignInInfo.recaptchaVersion;return Object.assign(n,{phoneSignInInfo:{recaptchaToken:r,captchaResponse:e,clientType:t,recaptchaVersion:i}}),n}}class iZ{constructor(e){this.providerId=iZ.PROVIDER_ID,this.auth=eN(e)}verifyPhoneNumber(e,t){return iB(this.auth,e,(0,s.Ku)(t))}static credential(e,t){return to._fromVerification(e,t)}static credentialFromResult(e){return iZ.credentialFromTaggedObject(e)}static credentialFromError(e){return iZ.credentialFromTaggedObject(e.customData||{})}
1static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{phoneNumber:t,temporaryProof:i}=e;return t&&i?to._fromTokenResponse(t,i):null}}function iX(e,t){return t?eh(t):(y(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}iZ.PROVIDER_ID="phone",iZ.PHONE_SIGN_IN_METHOD="phone";class i0 extends eY{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return te(e,this._buildIdpRequest())}_linkToIdToken(e,t){return te(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return te(e,this._buildIdpRequest())}_buildIdpRequest(e){let t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function i1(e){return tC(e.auth,new i0(e),e.bypassAuthState)}function i2(e){let{auth:t,user:i}=e;return y(i,t,"internal-error"),tA(i,new i0(e),e.bypassAuthState)}async function i3(e){let{auth:t,user:i}=e;return y(i,t,"internal-error"),tP(i,new i0(e),e.bypassAuthState)}class i6{constructor(e,t,i,r,n=!1){this.auth=e,this.resolver=i,this.user=r,this.bypassAuthState=n,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){let{urlResponse:t,sessionId:i,postBody:r,tenantId:n,error:s,type:a}=e;if(s)return void this.reject(s);let o={auth:this.auth,requestUri:t,sessionId:i,tenantId:n||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(o))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return i1;case"linkViaPopup":case"linkViaRedirect":return i3;case"reauthViaPopup":case"reauthViaRedirect":return i2;default:f(this.auth,"internal-error")}}resolve(e){E(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){E(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()}}let i4=new P(2e3,1e4);async function i5(e,t,i){if((0,n._isFirebaseServerApp)(e.app))return Promise.reject(g(e,"operation-not-supported-in-this-environment"));let r=eN(e);I(e,t,tu);let s=iX(r,i);return new i7(r,"signInViaPopup",t,s).executeNotNull()}async function i9(e,t,i){let r=(0,s.Ku)(e);if((0,n._isFirebaseServerApp)(r.auth.app))return Promise.reject(g(r.auth,"operation-not-supported-in-this-environment"));I(r.auth,t,tu);let a=iX(r.auth,i);return new i7(r.auth,"reauthViaPopup",t,a,r).executeNotNull()}async function i8(e,t,i){let r=(0,s.Ku)(e);I(r.auth,t,tu);let n=iX(r.auth,i);return new i7(r.auth,"linkViaPopup",t,n,r).executeNotNull()}class i7 extends i6{constructor(e,t,i,r,n){super(e,t,r,n),this.provider=i,this.authWindow=null,this.pollId=null,i7.currentPopupAction&&i7.currentPopupAction.cancel(),i7.currentPopupAction=this}async executeNotNull(){let e=await this.execute();return y(e,this.auth,"internal-error"),e}async onExecution(){E(1===this.filter.length,"Popup operations only handle one event");let e=iT();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(g(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(g(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,i7.currentPopupAction=null}pollUserCancellation(){let e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(g(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,i4.get())};e()}}i7.currentPopupAction=null;let re=new Map;class rt extends i6{constructor(e,t,i=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,i),this.eventId=null}async execute(){let e=re.get(this.auth._key());if(!e){try{let t=await ri(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}re.set(this.auth._key(),e)}return this.bypassAuthState||re.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);
1if("unknown"===e.type)return void this.resolve(null);if(e.eventId){let t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function ri(e,t){let i=ro(t),r=ra(e);if(!await r._isAvailable())return!1;let n=await r._get(i)==="true";return await r._remove(i),n}async function rr(e,t){return ra(e)._set(ro(t),"true")}function rn(){re.clear()}function rs(e,t){re.set(e._key(),t)}function ra(e){return eh(e._redirectPersistence)}function ro(e){return em("pendingRedirect",e.config.apiKey,e.name)}function rc(e,t,i){return rl(e,t,i)}async function rl(e,t,i){if((0,n._isFirebaseServerApp)(e.app))return Promise.reject(v(e));let r=eN(e);I(e,t,tu),await r._initializationPromise;let s=iX(r,i);return await rr(s,r),s._openRedirect(r,t,"signInViaRedirect")}function ru(e,t,i){return rh(e,t,i)}async function rh(e,t,i){let r=(0,s.Ku)(e);if(I(r.auth,t,tu),(0,n._isFirebaseServerApp)(r.auth.app))return Promise.reject(v(r.auth));await r.auth._initializationPromise;let a=iX(r.auth,i);await rr(a,r.auth);let o=await rg(r);return a._openRedirect(r.auth,t,"reauthViaRedirect",o)}function rd(e,t,i){return rp(e,t,i)}async function rp(e,t,i){let r=(0,s.Ku)(e);I(r.auth,t,tu),await r.auth._initializationPromise;let n=iX(r.auth,i);await tR(!1,r,t.providerId),await rr(n,r.auth);let a=await rg(r);return n._openRedirect(r.auth,t,"linkViaRedirect",a)}async function rm(e,t){return await eN(e)._initializationPromise,rf(e,t,!1)}async function rf(e,t,i=!1){if((0,n._isFirebaseServerApp)(e.app))return Promise.reject(v(e));let r=eN(e),s=iX(r,t),a=new rt(r,s,i),o=await a.execute();return o&&!i&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,t)),o}async function rg(e){let t=iT(`${e.uid}:::`);return e._redirectEventId=t,await e.auth._setRedirectUser(e),await e.auth._persistUserIfCurrent(e),t}class r_{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(i=>{this.isEventForConsumer(e,i)&&(t=!0,this.sendToConsumer(e,i),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return rI(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!rI(e)){let i=e.error.code?.split("auth/")[1]||"internal-error";t.onError(g(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){let i=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&i}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(rv(e))}saveEventToCache(e){this.cachedEventUids.add(rv(e)),this.lastProcessedEventTime=Date.now()}}function rv(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function rI({type:e,error:t}){return"unknown"===e&&t?.code==="auth/no-auth-event"}async function rw(e,t={}){return D(e,"GET","/v1/projects",t)}let ry=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,rT=/^https?/;async function rE(e){if(e.config.emulator)return;let{authorizedDomains:t}=await rw(e);for(let e of t)try{if(function(e){let t=k(),{protocol:i,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){let n=new URL(e);return""===n.hostname&&""===r?"chrome-extension:"===i&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===i&&n.hostname===r}if(!rT.test(i))return!1;if(ry.test(e))return r===e;let n=e.replace(/\./g,"\\.");return RegExp("^(.+\\."+n+"|"+n+")$","i").test(r)}(e))return}catch{}f(e,"unauthorized-domain")}let rk=new P(3e4,6e4);function rS(){let e=ik().___jsl;if(e?.H){for(let 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}}let rb=null,rP=new P(5e3,15e3),rR={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},rA=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);async function rC(e){let t,i,r,a,o,c=await (rb=rb||new Promise((t,i)=>{function r(){rS(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{rS(),i(g(e,"network-request-failed"))},timeout:rk.get()})}if(ik().gapi?.iframes?.Iframe)t(gapi.iframes.getContext());
1else if(ik().gapi?.load)r();else{let t=eM("iframefcb");return ik()[t]=()=>{gapi.load?r():i(g(e,"network-request-failed"))},eU(`${eD.gapiScript}?onload=${t}`).catch(e=>i(e))}}).catch(e=>{throw rb=null,e})),l=ik().gapi;return y(l,e,"internal-error"),c.open({where:document.body,url:(y((t=e.config).authDomain,e,"auth-domain-config-required"),i=t.emulator?R(t,"emulator/auth/iframe"):`https://${e.config.authDomain}/__/auth/iframe`,r={apiKey:t.apiKey,appName:e.name,v:n.SDK_VERSION},(a=rA.get(e.config.apiHost))&&(r.eid=a),(o=e._getFrameworks()).length&&(r.fw=o.join(",")),`${i}?${(0,s.Am)(r).slice(1)}`),messageHandlersFilter:l.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:rR,dontclear:!0},t=>new Promise(async(i,r)=>{await t.restyle({setHideOnLeave:!1});let n=g(e,"network-request-failed"),s=ik().setTimeout(()=>{r(n)},rP.get());function a(){ik().clearTimeout(s),i(t)}t.ping(a).then(a,()=>{r(n)})}))}let rO={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class rN{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}let rL=encodeURIComponent("fac");async function rD(e,t,i,r,a,o){y(e.config.authDomain,e,"auth-domain-config-required"),y(e.config.apiKey,e,"invalid-api-key");let c={apiKey:e.config.apiKey,appName:e.name,authType:i,redirectUrl:r,v:n.SDK_VERSION,eventId:a};if(t instanceof tu)for(let[i,r]of(t.setDefaultLanguage(e.languageCode),c.providerId=t.providerId||"",(0,s.Im)(t.getCustomParameters())||(c.customParameters=JSON.stringify(t.getCustomParameters())),Object.entries(o||{})))c[i]=r;if(t instanceof th){let e=t.getScopes().filter(e=>""!==e);e.length>0&&(c.scopes=e.join(","))}for(let t of(e.tenantId&&(c.tid=e.tenantId),Object.keys(c)))void 0===c[t]&&delete c[t];let l=await e._getAppCheckToken(),u=l?`#${rL}=${encodeURIComponent(l)}`:"";return`${function({config:e}){return e.emulator?R(e,"emulator/auth/handler"):`https://${e.authDomain}/__/auth/handler`}(e)}?${(0,s.Am)(c).slice(1)}${u}`}let rU="webStorageSupport";class rM{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=iw,this._completeRedirectFn=rf,this._overrideRedirectResult=rs}async _openPopup(e,t,i,r){E(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()");let n=await rD(e,t,i,k(),r);return function(e,t,i,r=500,n=600){let a=Math.max((window.screen.availHeight-n)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString(),c="",l={...rO,width:r.toString(),height:n.toString(),top:a,left:o},u=(0,s.ZQ)().toLowerCase();i&&(c=eI(u)?"_blank":i),e_(u)&&(t=t||"http://localhost",l.scrollbars="yes");let h=Object.entries(l).reduce((e,[t,i])=>`${e}${t}=${i},`,"");if(function(e=(0,s.ZQ)()){return ek(e)&&!!window.navigator?.standalone}(u)&&"_self"!==c){var d,p;let e,i;return d=t||"",p=c,(e=document.createElement("a")).href=d,e.target=p,(i=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),e.dispatchEvent(i),new rN(null)}let m=window.open(t||"",c,h);y(m,e,"popup-blocked");try{m.focus()}catch(e){}return new rN(m)}(e,n,iT())}async _openRedirect(e,t,i,r){var n;return await this._originValidation(e),n=await rD(e,t,i,k(),r),ik().location.href=n,new Promise(()=>{})}_initialize(e){let t=e._key();if(this.eventManagers[t]){let{manager:e,promise:i}=this.eventManagers[t];return e?Promise.resolve(e):(E(i,"If manager is not set, promise should be"),i)}let i=this.initAndGetManager(e);return this.eventManagers[t]={promise:i},i.catch(()=>{delete this.eventManagers[t]}),i}async initAndGetManager(e){let t=await rC(e),i=new r_(e);return t.register("authEvent",t=>(y(t?.authEvent,e,"invalid-auth-event"),{status:i.onEvent(t.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:i},this.iframes[e._key()]=t,i}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(rU,{type:rU},i=>{let r=i?.[0]?.[rU];void 0!==r&&t(!!r),f(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=rE(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return eb()||ev()||ek()}}let rF=rM;class rV{constructor(e){this.factorId=e}_process(e,t,i){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,i);case"signin":return this._finalizeSignIn(e,t.credential);default:return T("unexpected MultiFactorSessionType")}}}class rx extends rV{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new rx(e)}_finalizeEnroll(e,t,i){return D(e,"POST","/v2/accounts/mfaEnrollment:finalize",L(e,{idToken:t,displayName:i,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}_finalizeSignIn(e,t){return D(e,"POST","/v2/accounts/mfaSignIn:finalize",L(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}}class rj{static assertion(e){return rx._fromCredential(e)}}rj.FACTOR_ID="phone";class rH{static assertionForEnrollment(e,t){return rq._fromSecret(e,t)}static assertionForSignIn(e,t){return rq._fromEnrollmentId(e,t)}static async generateSecret(e){var t;y(void 0!==e.user?.auth,"internal-error");let i=await D(t=e.user.auth,"POST","/v2/accounts/mfaEnrollment:start",L(t,{idToken:e.credential,totpEnrollmentInfo:{}}));return rK._fromStartTotpMfaEnrollmentResponse(i,e.user.auth)}}rH.FACTOR_ID="totp";class rq extends rV{constructor(e,t,i){super("totp"),this.otp=e,this.enrollmentId=t,this.secret=i}
1static _fromSecret(e,t){return new rq(t,void 0,e)}static _fromEnrollmentId(e,t){return new rq(t,e)}async _finalizeEnroll(e,t,i){return y(void 0!==this.secret,e,"argument-error"),D(e,"POST","/v2/accounts/mfaEnrollment:finalize",L(e,{idToken:t,displayName:i,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)}))}async _finalizeSignIn(e,t){y(void 0!==this.enrollmentId&&void 0!==this.otp,e,"argument-error");let i={verificationCode:this.otp};return D(e,"POST","/v2/accounts/mfaSignIn:finalize",L(e,{mfaPendingCredential:t,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:i}))}}class rK{constructor(e,t,i,r,n,s,a){this.sessionInfo=s,this.auth=a,this.secretKey=e,this.hashingAlgorithm=t,this.codeLength=i,this.codeIntervalSeconds=r,this.enrollmentCompletionDeadline=n}static _fromStartTotpMfaEnrollmentResponse(e,t){return new rK(e.totpSessionInfo.sharedSecretKey,e.totpSessionInfo.hashingAlgorithm,e.totpSessionInfo.verificationCodeLength,e.totpSessionInfo.periodSec,new Date(e.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),e.totpSessionInfo.sessionInfo,t)}_makeTotpVerificationInfo(e){return{sessionInfo:this.sessionInfo,verificationCode:e}}generateQrCodeUrl(e,t){let i=!1;return(rW(e)||rW(t))&&(i=!0),i&&(rW(e)&&(e=this.auth.currentUser?.email||"unknownuser"),rW(t)&&(t=this.auth.name)),`otpauth://totp/${t}:${e}?secret=${this.secretKey}&issuer=${t}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}}function rW(e){return void 0===e||e?.length===0}var rz="@firebase/auth",r$="1.13.3";class rG{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;let t=this.auth.onIdTokenChanged(t=>{e(t?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){y(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}(0,s.XA)("authIdTokenMaxAge"),eD={loadJS:e=>new Promise((t,i)=>{let r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=e=>{let t=g("internal-error");t.customData=e,i(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="},r="Browser",(0,n._registerComponent)(new o.uA("auth",(e,{options:t})=>{let i,n,s=e.getProvider("app").getImmediate(),a=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:c,authDomain:l}=s.options;y(c&&!c.includes(":"),"invalid-api-key",{appName:s.name});let u=new eO(s,a,o,{apiKey:c,authDomain:l,clientPlatform:r,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:eP(r)});return n=(Array.isArray(i=t?.persistence||[])?i:[i]).map(eh),t?.errorMap&&u._updateErrorMap(t.errorMap),u._initializeWithPersistence(n,t?.popupRedirectResolver),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,i)=>{e.getProvider("auth-internal").initialize()})),(0,n._registerComponent)(new o.uA("auth-internal",e=>new rG(eN(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),(0,n.registerVersion)(rz,r$,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}}(r)),(0,n.registerVersion)(rz,r$,"esm2020")}}]);
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.