PageSourceSearch

https://www.asuntomessut.fi/cccc6244-61229be50e3da4d7ea27.js

js asuntomessut.fi collected 2026-10-02 05:29:12 UTC 185,436 bytes, 3 lines download raw bytes

1/*! For license information please see cccc6244-61229be50e3da4d7ea27.js.LICENSE.txt */
2"use strict";(self.webpackChunkAsuntomessut=self.webpackChunkAsuntomessut||[]).push([[8247],{65498:function(e,t,n){n.d(t,{$:function(){return Dn},A:function(){return N},B:function(){return Kr},C:function(){return qr},D:function(){return O},E:function(){return C},F:function(){return T},G:function(){return D},H:function(){return gt},I:function(){return yt},J:function(){return _t},K:function(){return Gt},L:function(){return Jt},M:function(){return tn},N:function(){return je},O:function(){return R},P:function(){return na},Q:function(){return an},R:function(){return qi},S:function(){return x},T:function(){return gs},U:function(){return cn},V:function(){return ln},W:function(){return hn},X:function(){return un},Y:function(){return dn},Z:function(){return fn},_:function(){return yn},a:function(){return si},a0:function(){return Mn},a1:function(){return Fn},a2:function(){return Kn},a3:function(){return Jn},a4:function(){return Qn},a5:function(){return Zn},a6:function(){return er},a7:function(){return nr},a8:function(){return ir},a9:function(){return sr},aA:function(){return q},aB:function(){return Ha},aC:function(){return Ve},aD:function(){return Ke},aE:function(){return Ma},aF:function(){return Ta},aG:function(){return ba},aH:function(){return mt},aL:function(){return ci},aO:function(){return pn},aa:function(){return or},ab:function(){return cr},ac:function(){return lr},ad:function(){return fr},ae:function(){return mr},af:function(){return gr},ag:function(){return nn},ah:function(){return rn},ai:function(){return _r},aj:function(){return br},ak:function(){return Tr},al:function(){return ke},am:function(){return ge},an:function(){return bn},ao:function(){return Dr},ap:function(){return Ne},aq:function(){return Br},ar:function(){return ei},as:function(){return G},at:function(){return Ze},au:function(){return Ye},av:function(){return F},aw:function(){return cs},ax:function(){return qa},ay:function(){return $e},az:function(){return V},b:function(){return ii},c:function(){return ha},d:function(){return va},e:function(){return da},f:function(){return Ra},g:function(){return Ca},h:function(){return Sa},i:function(){return Oi},j:function(){return Da},k:function(){return fs},l:function(){return Ji},m:function(){return ks},n:function(){return As},o:function(){return Ns},p:function(){return E},q:function(){return Lr},r:function(){return Qi},s:function(){return Wi},t:function(){return Mr},u:function(){return ea},v:function(){return Ur},w:function(){return Fr},x:function(){return Vr},y:function(){return Hr},z:function(){return jr}});var r,i=n(90991),a=n(9417),s=n(85501),o=n(56822),u=n(53954),c=n(5544),l=n(10467),h=n(23029),p=n(92901),d=n(60436),f=n(64467),v=(n(9391),n(54756)),m=n.n(v),k=n(32090),g=n(42932),y=n(62449),A=n(84734),I=n(94963);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=(0,u.A)(e);if(t){var i=(0,u.A)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,o.A)(this,n)}}function w(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e}
2,f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var T={PHONE:"phone",TOTP:"totp"},E={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},x={EMAIL_LINK:"emailLink",EMAIL_PASSWORD:"password",FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PHONE:"phone",TWITTER:"twitter.com"},R={LINK:"link",REAUTHENTICATE:"reauthenticate",SIGN_IN:"signIn"},N={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 S(){return(0,f.A)({},"dependent-sdk-initialized-before-auth","Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK.")}var O=function(){var e;return e={},(0,f.A)(e,"admin-restricted-operation","This operation is restricted to administrators only."),(0,f.A)(e,"argument-error",""),(0,f.A)(e,"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."),(0,f.A)(e,"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."),(0,f.A)(e,"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."),(0,f.A)(e,"code-expired","The SMS code has expired. Please re-send the verification code to try again."),(0,f.A)(e,"cordova-not-ready","Cordova framework is not ready."),(0,f.A)(e,"cors-unsupported","This browser is not supported."),(0,f.A)(e,"credential-already-in-use","This credential is already associated with a different user account."),(0,f.A)(e,"custom-token-mismatch","The custom token corresponds to a different audience."),(0,f.A)(e,"requires-recent-login","This operation is sensitive and requires recent authentication. Log in again before retrying this request."),(0,f.A)(e,"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."),(0,f.A)(e,"dynamic-link-not-activated","Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions."),(0,f.A)(e,"email-change-needs-verification","Multi-factor users must al
2ways have a verified email."),(0,f.A)(e,"email-already-in-use","The email address is already in use by another account."),(0,f.A)(e,"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.'),(0,f.A)(e,"expired-action-code","The action code has expired."),(0,f.A)(e,"cancelled-popup-request","This operation has been cancelled due to another conflicting popup being opened."),(0,f.A)(e,"internal-error","An internal AuthError has occurred."),(0,f.A)(e,"invalid-app-credential","The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired."),(0,f.A)(e,"invalid-app-id","The mobile app identifier is not registed for the current project."),(0,f.A)(e,"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."),(0,f.A)(e,"invalid-auth-event","An internal AuthError has occurred."),(0,f.A)(e,"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."),(0,f.A)(e,"invalid-continue-uri","The continue URL provided in the request is invalid."),(0,f.A)(e,"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."),(0,f.A)(e,"invalid-custom-token","The custom token format is incorrect. Please check the documentation."),(0,f.A)(e,"invalid-dynamic-link-domain","The provided dynamic link domain is not configured or authorized for the current project."),(0,f.A)(e,"invalid-email","The email address is badly formatted."),(0,f.A)(e,"invalid-emulator-scheme","Emulator URL must start with a valid scheme (http:// or https://)."),(0,f.A)(e,"invalid-api-key","Your API key is invalid, please check you have copied it correctly."),(0,f.A)(e,"invalid-cert-hash","The SHA-1 certificate hash provided is invalid."),(0,f.A)(e,"invalid-credential","The supplied auth credential is malformed or has expired."),(0,f.A)(e,"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."),(0,f.A)(e,"invalid-multi-factor-session","The request does not contain a valid proof of first factor successful sign-in."),(0,f.A)(e,"invalid-oauth-provider","EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers."),(0,f.A)(e,"invalid-oauth-client-id","The OAuth client ID provided is either invalid or does not match the specified API key."),(0,f.A)(e,"unauthorized-domain","This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console."),(0,f.A)(e,"invalid-action-code","The action code is invalid. This can happen if the code is malformed, expired, or has already been used."),(0,f.A)(e,"wrong-password","The password is invalid or the user does not have a password."),(0,f.A)(e,"invalid-persistence-type","The specified persistence type is invalid. It can only be local, session or none."),(0,f.A)(e,"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]."),(0,f.A)(e,"invalid-provider-id","The specified provider ID is invali
2d."),(0,f.A)(e,"invalid-recipient-email","The email corresponding to this action failed to send as the provided recipient email address is invalid."),(0,f.A)(e,"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."),(0,f.A)(e,"invalid-verification-id","The verification ID used to create the phone auth credential is invalid."),(0,f.A)(e,"invalid-tenant-id","The Auth instance's tenant ID is invalid."),(0,f.A)(e,"login-blocked","Login blocked by user-provided method: {$originalMessage}"),(0,f.A)(e,"missing-android-pkg-name","An Android Package Name must be provided if the Android App is required to be installed."),(0,f.A)(e,"auth-domain-config-required","Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console."),(0,f.A)(e,"missing-app-credential","The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided."),(0,f.A)(e,"missing-verification-code","The phone auth credential was created with an empty SMS verification code."),(0,f.A)(e,"missing-continue-uri","A continue URL must be provided in the request."),(0,f.A)(e,"missing-iframe-start","An internal AuthError has occurred."),(0,f.A)(e,"missing-ios-bundle-id","An iOS Bundle ID must be provided if an App Store ID is provided."),(0,f.A)(e,"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."),(0,f.A)(e,"missing-password","A non-empty password must be provided"),(0,f.A)(e,"missing-multi-factor-info","No second factor identifier is provided."),(0,f.A)(e,"missing-multi-factor-session","The request is missing proof of first factor successful sign-in."),(0,f.A)(e,"missing-phone-number","To send verification codes, provide a phone number for the recipient."),(0,f.A)(e,"missing-verification-id","The phone auth credential was created with an empty verification ID."),(0,f.A)(e,"app-deleted","This instance of FirebaseApp has been deleted."),(0,f.A)(e,"multi-factor-info-not-found","The user does not have a second factor matching the identifier provided."),(0,f.A)(e,"multi-factor-auth-required","Proof of ownership of a second factor is required to complete sign-in."),(0,f.A)(e,"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."),(0,f.A)(e,"network-request-failed","A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred."),(0,f.A)(e,"no-auth-event","An internal AuthError has occurred."),(0,f.A)(e,"no-such-provider","User was not linked to an account with the given provider."),(0,f.A)(e,"null-user","A null user object was provided as the argument for an operation which requires a non-null user object."),(0,f.A)(e,"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."),(0,f.A)(e,"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.'),(0,f.A)(e,"popup-blocked","Unable to establish a connection with the popup. It may have been blocked by the browser."),(0,f.A)(e,"popup-closed-by-user","The popup has been closed by the user before finalizing the operation."),(0,f.A)(e,"provider-already-linked","User can only be linked to one identity for the given provider."),(0,f.A)(e,"quota-exceeded","The project's quota for this operation has been exceeded."),(0,f.A)(e,"redirect-cancelled-by-user","The redirect operation has been cancelled by the user before finalizing."),(0,f.A)(e,"redirect-operation-pending","A redirect sign-in operation is already pending."),(0,f.A)(e,"rejected-credential","The request contains malformed or mismatching credentials."),
2(0,f.A)(e,"second-factor-already-in-use","The second factor is already enrolled on this account."),(0,f.A)(e,"maximum-second-factor-count-exceeded","The maximum allowed number of second factors on a user has been exceeded."),(0,f.A)(e,"tenant-id-mismatch","The provided tenant ID does not match the Auth instance's tenant ID"),(0,f.A)(e,"timeout","The operation has timed out."),(0,f.A)(e,"user-token-expired","The user's credential is no longer valid. The user must sign in again."),(0,f.A)(e,"too-many-requests","We have blocked all requests from this device due to unusual activity. Try again later."),(0,f.A)(e,"unauthorized-continue-uri","The domain of the continue URL is not whitelisted.  Please whitelist the domain in the Firebase console."),(0,f.A)(e,"unsupported-first-factor","Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor."),(0,f.A)(e,"unsupported-persistence-type","The current environment does not support the specified persistence type."),(0,f.A)(e,"unsupported-tenant-operation","This operation is not supported in a multi-tenant context."),(0,f.A)(e,"unverified-email","The operation requires a verified email."),(0,f.A)(e,"user-cancelled","The user did not grant your application the permissions it requested."),(0,f.A)(e,"user-not-found","There is no user record corresponding to this identifier. The user may have been deleted."),(0,f.A)(e,"user-disabled","The user account has been disabled by an administrator."),(0,f.A)(e,"user-mismatch","The supplied credentials do not correspond to the previously signed in user."),(0,f.A)(e,"user-signed-out",""),(0,f.A)(e,"weak-password","The password must be 6 characters long or more."),(0,f.A)(e,"web-storage-unsupported","This browser is not supported or 3rd party cookies and data may be disabled."),(0,f.A)(e,"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."),(0,f.A)(e,"missing-recaptcha-token","The reCAPTCHA token is missing when sending request to the backend."),(0,f.A)(e,"invalid-recaptcha-token","The reCAPTCHA token is invalid when sending request to the backend."),(0,f.A)(e,"invalid-recaptcha-action","The reCAPTCHA action is invalid when sending request to the backend."),(0,f.A)(e,"recaptcha-not-enabled","reCAPTCHA Enterprise integration is not enabled for this project."),(0,f.A)(e,"missing-client-type","The reCAPTCHA client type is missing when sending request to the backend."),(0,f.A)(e,"missing-recaptcha-version","The reCAPTCHA version is missing when sending request to the backend."),(0,f.A)(e,"invalid-req-type","Invalid request parameters."),(0,f.A)(e,"invalid-recaptcha-version","The reCAPTCHA version is invalid when sending request to the backend."),e},C=S,P=new k.FA("auth","Firebase",S()),D={ADMIN_ONLY_OPERATION:"auth/admin-restricted-operation",ARGUMENT_ERROR:"auth/argument-error",APP_NOT_AUTHORIZED:"auth/app-not-authorized",APP_NOT_INSTALLED:"auth/app-not-installed",CAPTCHA_CHECK_FAILED:"auth/captcha-check-failed",CODE_EXPIRED:"auth/code-expired",CORDOVA_NOT_READY:"auth/cordova-not-ready",CORS_UNSUPPORTED:"auth/cors-unsupported",CREDENTIAL_ALREADY_IN_USE:"auth/credential-already-in-use",CREDENTIAL_MISMATCH:"auth/custom-token-mismatch",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"auth/requires-recent-login",DEPENDENT_SDK_INIT_BEFORE_AUTH:"auth/dependent-sdk-initialized-before-auth",DYNAMIC_LINK_NOT_ACTIVATED:"auth/dynamic-link-not-activated",EMAIL_CHANGE_NEEDS_VERIFICATION:"auth/email-change-needs-verification",EMAIL_EXISTS:"auth/email-already-in-use",EMULATOR_CONFIG_FAILED:"auth/emulator-config-failed",EXPIRED_OOB_CODE:"auth/expired-action-code",EXPIRED_POPUP_REQUEST:"auth/cancelled-popup-request",INTERNAL_ERROR:"auth/internal-error",INVALID_API_KEY:"auth/invalid-api-key",INVALID_APP_CREDENTIAL:"auth/invalid-app-credential",INVALID_APP_ID:"auth/invalid-app-id",INVALID_AUTH:"auth/invalid-user-token",INVALID_AUTH_EVENT:"auth/invalid-auth-event",INVA
2LID_CERT_HASH:"auth/invalid-cert-hash",INVALID_CODE:"auth/invalid-verification-code",INVALID_CONTINUE_URI:"auth/invalid-continue-uri",INVALID_CORDOVA_CONFIGURATION:"auth/invalid-cordova-configuration",INVALID_CUSTOM_TOKEN:"auth/invalid-custom-token",INVALID_DYNAMIC_LINK_DOMAIN:"auth/invalid-dynamic-link-domain",INVALID_EMAIL:"auth/invalid-email",INVALID_EMULATOR_SCHEME:"auth/invalid-emulator-scheme",INVALID_IDP_RESPONSE:"auth/invalid-credential",INVALID_MESSAGE_PAYLOAD:"auth/invalid-message-payload",INVALID_MFA_SESSION:"auth/invalid-multi-factor-session",INVALID_OAUTH_CLIENT_ID:"auth/invalid-oauth-client-id",INVALID_OAUTH_PROVIDER:"auth/invalid-oauth-provider",INVALID_OOB_CODE:"auth/invalid-action-code",INVALID_ORIGIN:"auth/unauthorized-domain",INVALID_PASSWORD:"auth/wrong-password",INVALID_PERSISTENCE:"auth/invalid-persistence-type",INVALID_PHONE_NUMBER:"auth/invalid-phone-number",INVALID_PROVIDER_ID:"auth/invalid-provider-id",INVALID_RECIPIENT_EMAIL:"auth/invalid-recipient-email",INVALID_SENDER:"auth/invalid-sender",INVALID_SESSION_INFO:"auth/invalid-verification-id",INVALID_TENANT_ID:"auth/invalid-tenant-id",MFA_INFO_NOT_FOUND:"auth/multi-factor-info-not-found",MFA_REQUIRED:"auth/multi-factor-auth-required",MISSING_ANDROID_PACKAGE_NAME:"auth/missing-android-pkg-name",MISSING_APP_CREDENTIAL:"auth/missing-app-credential",MISSING_AUTH_DOMAIN:"auth/auth-domain-config-required",MISSING_CODE:"auth/missing-verification-code",MISSING_CONTINUE_URI:"auth/missing-continue-uri",MISSING_IFRAME_START:"auth/missing-iframe-start",MISSING_IOS_BUNDLE_ID:"auth/missing-ios-bundle-id",MISSING_OR_INVALID_
2NONCE:"auth/missing-or-invalid-nonce",MISSING_MFA_INFO:"auth/missing-multi-factor-info",MISSING_MFA_SESSION:"auth/missing-multi-factor-session",MISSING_PHONE_NUMBER:"auth/missing-phone-number",MISSING_SESSION_INFO:"auth/missing-verification-id",MODULE_DESTROYED:"auth/app-deleted",NEED_CONFIRMATION:"auth/account-exists-with-different-credential",NETWORK_REQUEST_FAILED:"auth/network-request-failed",NULL_USER:"auth/null-user",NO_AUTH_EVENT:"auth/no-auth-event",NO_SUCH_PROVIDER:"auth/no-such-provider",OPERATION_NOT_ALLOWED:"auth/operation-not-allowed",OPERATION_NOT_SUPPORTED:"auth/operation-not-supported-in-this-environment",POPUP_BLOCKED:"auth/popup-blocked",POPUP_CLOSED_BY_USER:"auth/popup-closed-by-user",PROVIDER_ALREADY_LINKED:"auth/provider-already-linked",QUOTA_EXCEEDED:"auth/quota-exceeded",REDIRECT_CANCELLED_BY_USER:"auth/redirect-cancelled-by-user",REDIRECT_OPERATION_PENDING:"auth/redirect-operation-pending",REJECTED_CREDENTIAL:"auth/rejected-credential",SECOND_FACTOR_ALREADY_ENROLLED:"auth/second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"auth/maximum-second-factor-count-exceeded",TENANT_ID_MISMATCH:"auth/tenant-id-mismatch",TIMEOUT:"auth/timeout",TOKEN_EXPIRED:"auth/user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"auth/too-many-requests",UNAUTHORIZED_DOMAIN:"auth/unauthorized-continue-uri",UNSUPPORTED_FIRST_FACTOR:"auth/unsupported-first-factor",UNSUPPORTED_PERSISTENCE:"auth/unsupported-persistence-type",UNSUPPORTED_TENANT_OPERATION:"auth/unsupported-tenant-operation",UNVERIFIED_EMAIL:"auth/unverified-email",USER_CANCELLED:"auth/user-cancelled",USER_DELETED:"auth/user-not-found",USER_DISABLED:"auth/user-disabled",USER_MISMATCH:"auth/user-mismatch",USER_SIGNED_OUT:"auth/user-signed-out",WEAK_PASSWORD:"auth/weak-password",WEB_STORAGE_UNSUPPORTED:"auth/web-storage-unsupported",ALREADY_INITIALIZED:"auth/already-initialized",RECAPTCHA_NOT_ENABLED:"auth/recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"auth/missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"auth/invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"auth/invalid-recaptcha-action",MISSING_CLIENT_TYPE:"auth/missing-client-type",MISSING_RECAPTCHA_VERSION:"auth/missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"auth/invalid-recaptcha-version",INVALID_REQ_TYPE:"auth/invalid-req-type"},L=new A.Vy("@firebase/auth");function M(e){if(L.logLevel<=A.$b.WARN){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];L.warn.apply(L,["Auth (".concat(g.MF,"): ").concat(e)].concat(n))}}function U(e){if(L.logLevel<=A.$b.ERROR){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];L.error.apply(L,["Auth (".concat(g.MF,"): ").concat(e)].concat(n))}}function F(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw K.apply(void 0,[e].concat(n))}function V(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return K.apply(void 0,[e].concat(n))}function H(e,t,n){var r=Object.assign(Object.assign({},C()),(0,f.A)({},t,n));return new k.FA("auth","Firebase",r).create(t,{appName:e.name})}function j(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&F(e,"argument-error"),H(e,"argument-error","Type of ".concat(t.constructor.name," does not match expected instance.")+"Did you pass a reference from a different Auth SDK?")}function K(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if("string"!=typeof e){var i,a=n[0],s=(0,d.A)(n.slice(1));return s[0]&&(s[0].appName=e.name),(i=e._errorFactory).create.apply(i,[a].concat((0,d.A)(s)))}return P.create.apply(P,[e].concat(n))}function q(e,t){if(!e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];throw K.apply(void 0,[t].concat(r))}}function z(e){var t="INTERNAL ASSERTION FAILED: "+e;throw U(t),new Error(t)}function G(e,t){e||z(t)}function W(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function B(){return"http:"===J()||"https:"===J()}function J(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}var Y=function(){function e(t,n){(0,h.A)(this,e),this.shortDelay=t,this.longDelay=n,G(n>
2t,"Short delay should be less than long delay!"),this.isMobile=(0,k.jZ)()||(0,k.lV)()}return(0,p.A)(e,[{key:"get",value:function(){return"undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(B()||(0,k.sr)()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}]),e}();function Q(e,t){G(e.emulator,"Emulator should always be set here");var n=e.emulator.url;return t?"".concat(n).concat(t.startsWith("/")?t.slice(1):t):n}var X=function(){function e(){(0,h.A)(this,e)}return(0,p.A)(e,null,[{key:"initialize",value:function(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}},{key:"fetch",value:function(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:void z("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}},{key:"headers",value:function(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:void z("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}},{key:"response",value:function(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:void z("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}]),e}(),Z=(r={},(0,f.A)(r,"CREDENTIAL_MISMATCH","custom-token-mismatch"),(0,f.A)(r,"MISSING_CUSTOM_TOKEN","internal-error"),(0,f.A)(r,"INVALID_IDENTIFIER","invalid-email"),(0,f.A)(r,"MISSING_CONTINUE_URI","internal-error"),(0,f.A)(r,"INVALID_PASSWORD","wrong-password"),(0,f.A)(r,"MISSING_PASSWORD","missing-password"),(0,f.A)(r,"EMAIL_EXISTS","email-already-in-use"),(0,f.A)(r,"PASSWORD_LOGIN_DISABLED","operation-not-allowed"),(0,f.A)(r,"INVALID_IDP_RESPONSE","invalid-credential"),(0,f.A)(r,"INVALID_PENDING_TOKEN","invalid-credential"),(0,f.A)(r,"FEDERATED_USER_ID_ALREADY_LINKED","credential-already-in-use"),(0,f.A)(r,"MISSING_REQ_TYPE","internal-error"),(0,f.A)(r,"EMAIL_NOT_FOUND","user-not-found"),(0,f.A)(r,"RESET_PASSWORD_EXCEED_LIMIT","too-many-requests"),(0,f.A)(r,"EXPIRED_OOB_CODE","expired-action-code"),(0,f.A)(r,"INVALID_OOB_CODE","invalid-action-code"),(0,f.A)(r,"MISSING_OOB_CODE","internal-error"),(0,f.A)(r,"CREDENTIAL_TOO_OLD_LOGIN_AGAIN","requires-recent-login"),(0,f.A)(r,"INVALID_ID_TOKEN","invalid-user-token"),(0,f.A)(r,"TOKEN_EXPIRED","user-token-expired"),(0,f.A)(r,"USER_NOT_FOUND","user-token-expired"),(0,f.A)(r,"TOO_MANY_ATTEMPTS_TRY_LATER","too-many-requests"),(0,f.A)(r,"INVALID_CODE","invalid-verification-code"),(0,f.A)(r,"INVALID_SESSION_INFO","invalid-verification-id"),(0,f.A)(r,"INVALID_TEMPORARY_PROOF","invalid-credential"),(0,f.A)(r,"MISSING_SESSION_INFO","missing-verification-id"),(0,f.A)(r,"SESSION_EXPIRED","code-expired"),(0,f.A)(r,"MISSING_ANDROID_PACKAGE_NAME","missing-android-pkg-name"),(0,f.A)(r,"UNAUTHORIZED_DOMAIN","unauthorized-continue-uri"),(0,f.A)(r,"INVALID_OAUTH_CLIENT_ID","invalid-oauth-client-id"),(0,f.A)(r,"ADMIN_ONLY_OPERATION","admin-restricted-operation"),(0,f.A)(r,"INVALID_MFA_PENDING_CREDENTIAL","invalid-multi-factor-session"),(0,f.A)(r,"MFA_ENROLLMENT_NOT_FOUND","multi-factor-info-not-found"),(0,f.A)(r,"MISSING_MFA_ENROLLMENT_ID","missing-multi-factor-info"),(0,f.A)(r,"MISSING_MFA_PENDING_CREDENTIAL","missing-multi-factor-session"),(0,f.A)(r,"SECOND_FACTOR_EXISTS","second-factor-already-in-use"),(0,f.A)(r,"SECOND_FACTOR_LIMIT_EXCEEDED","maximum-second-factor-count-exceeded"),(0,f.A)(r,"BLOCKING_FUNCTION_ERROR_RESPONSE","internal-error"),(0,f.A)(r,"RECAPTCHA_NOT_ENABLED","recaptcha-not-enabled"),(0,f.A)(r,"MISSING_RECAPTCHA_TOKEN","missing-recaptcha-token"),(0,f.A)(r,"INVALID_RECAPTCHA_TOKEN","invalid-recaptcha-token"),(0,f.A)(r,"INVALID_RECAPTCHA_ACTION","invalid-recaptcha-action"),(0,f.A)(r,"MISSING_CLIENT_TYPE","missing-client-type"),(0,f.A)(r,"MISSING_RECAPTCHA_VERSION","missing-recaptcha-version"),(0,f.A)(r,"INVALID_RECAPTCHA_VERSION","invali
2d-recaptcha-version"),(0,f.A)(r,"INVALID_REQ_TYPE","invalid-req-type"),r),$=new Y(3e4,6e4);function ee(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}function te(e,t,n,r){return ne.apply(this,arguments)}function ne(){return ne=(0,l.A)(m().mark(function e(t,n,r,i){var a,s=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=s.length>4&&void 0!==s[4]?s[4]:{},e.abrupt("return",re(t,a,(0,l.A)(m().mark(function e(){var a,s,o,u;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a={},s={},i&&("GET"===n?s=i:a={body:JSON.stringify(i)}),o=(0,k.Am)(Object.assign({key:t.config.apiKey},s)).slice(1),e.next=6,t._getAdditionalHeaders();case 6:return(u=e.sent)["Content-Type"]="application/json",t.languageCode&&(u["X-Firebase-Locale"]=t.languageCode),e.abrupt("return",X.fetch()(oe(t,t.config.apiHost,r,o),Object.assign({method:n,headers:u,referrerPolicy:"no-referrer"},a)));case 10:case"end":return e.stop()}},e)}))));case 2:case"end":return e.stop()}},e)})),ne.apply(this,arguments)}function re(e,t,n){return ie.apply(this,arguments)}function ie(){return(ie=(0,l.A)(m().mark(function e(t,n,r){var i,a,s,o,u,l,h,p,d,f;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t._canInitEmulator=!1,i=Object.assign(Object.assign({},Z),n),e.prev=2,a=new ue(t),e.next=6,Promise.race([r(),a.promise]);case 6:return s=e.sent,a.clearNetworkTimeout(),e.next=10,s.json();case 10:if(!("needConfirmation"in(o=e.sent))){e.next=13;break}throw ce(t,"account-exists-with-different-credential",o);case 13:if(!s.ok||"errorMessage"in o){e.next=17;break}return e.abrupt("return",o);case 17:if(u=s.ok?o.errorMessage:o.error.message,l=u.split(" : "),h=(0,c.A)(l,2),p=h[0],d=h[1],"FEDERATED_USER_ID_ALREADY_LINKED"!==p){e.next=23;break}throw ce(t,"credential-already-in-use",o);case 23:if("EMAIL_EXISTS"!==p){e.next=27;break}throw ce(t,"email-already-in-use",o);case 27:if("USER_DISABLED"!==p){e.next=29;break}throw ce(t,"user-disabled",o);case 29:if(f=i[p]||p.toLowerCase().replace(/[_\s]+/g,"-"),!d){e.next=34;break}throw H(t,f,d);case 34:F(t,f);case 35:e.next=42;break;case 37:if(e.prev=37,e.t0=e.catch(2),!(e.t0 instanceof k.g)){e.next=41;break}throw e.t0;case 41:F(t,"network-request-failed",{message:String(e.t0)});case 42:case"end":return e.stop()}},e,null,[[2,37]])}))).apply(this,arguments)}function ae(e,t,n,r){return se.apply(this,arguments)}function se(){return se=(0,l.A)(m().mark(function e(t,n,r,i){var a,s,o=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=o.length>4&&void 0!==o[4]?o[4]:{},e.next=3,te(t,n,r,i,a);case 3:return"mfaPendingCredential"in(s=e.sent)&&F(t,"multi-factor-auth-required",{_serverResponse:s}),e.abrupt("return",s);case 6:case"end":return e.stop()}},e)})),se.apply(this,arguments)}function oe(e,t,n,r){var i="".concat(t).concat(n,"?").concat(r);return e.config.emulator?Q(e.config,i):"".concat(e.config.apiScheme,"://").concat(i)}var ue=function(){function e(t){var n=this;(0,h.A)(this,e),this.auth=t,this.timer=null,this.promise=new Promise(function(e,t){n.timer=setTimeout(function(){return t(V(n.auth,"network-request-failed"))},$.get())})}return(0,p.A)(e,[{key:"clearNetworkTimeout",value:function(){clearTimeout(this.timer)}}]),e}();function ce(e,t,n){var r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);var i=V(e,t,r);return i.customData._tokenResponse=n,i}function le(e,t){return he.apply(this,arguments)}function he(){return(he=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",te(t,"POST","/v1/accounts:delete",n));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function pe(e,t){return de.apply(this,arguments)}function de(){return(de=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",te(t,"POST","/v1/accounts:update",n));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function fe(e,t){return ve.apply(this,arguments)}function ve(){return(ve=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",te(t,"POST","/v1/accounts:lookup",n));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function me(e){if(e)try{var t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(n){}}function ke(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,k.Ku)(e).getIdToken(t)}function ge(e){return ye.apply(this,arguments)}function ye(){return ye=(0,l.A)(m().mark(function e(t){var n,r,i,a,s,o,u=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]&&u[1],r=(0,k.Ku)(t),e.next=4,r.getIdToken(n);case 4:return i=e.sent,q((a=Ie(i))&&a.exp&&a.auth_time&&a.iat,r.auth,"internal-error"),s="object"==typeof a.firebase?a.firebase:void 0,o=null==s?void 0:s.sign_in_provider,e.abrupt("return",{claims:a,token:i,authTime:me(Ae(a.auth_time)),issuedAtTime:me(Ae(a.iat)),expirationTime:me(Ae(a.exp)),signInProvider:o||null,signInSecondFactor:(null==s?void 0:s.sign_in_second_factor)||null});case 10:case"end":return e.stop()}},e)})),ye.apply(this,arguments)}function Ae(e){return 1e3*Number(e)}function Ie(e){var t=e.split("."),n=(0,c.A)(t,3),r=n[0],i=n[1],a=n[2];if(void 0===r||void 0===i||void 0===a)return U("JWT malformed, contained fewer than 3 sections"),null;try{var s=(0,k.u)(i);return s?JSON.parse(s):(U("Failed to decode base64 JWT payload"),null)}catch(o){return U("Caught error parsing JWT payload as JSON",null==o?void 0:o.toString()),null}}function _e(e,t){return we.apply(this,arguments)}function we(){return we=(0,l.A)(m().mark(function e(t,n){var r=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r.length>
22&&void 0!==r[2]&&r[2])){e.next=3;break}return e.abrupt("return",n);case 3:return e.prev=3,e.next=6,n;case 6:return e.abrupt("return",e.sent);case 9:if(e.prev=9,e.t0=e.catch(3),!(e.t0 instanceof k.g&&be(e.t0))){e.next=15;break}if(t.auth.currentUser!==t){e.next=15;break}return e.next=15,t.auth.signOut();case 15:throw e.t0;case 16:case"end":return e.stop()}},e,null,[[3,9]])})),we.apply(this,arguments)}function be(e){var t=e.code;return t==="auth/".concat("user-disabled")||t==="auth/".concat("user-token-expired")}var Te=function(){function e(t){(0,h.A)(this,e),this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}var t;return(0,p.A)(e,[{key:"_start",value:function(){this.isRunning||(this.isRunning=!0,this.schedule())}},{key:"_stop",value:function(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}},{key:"getInterval",value:function(e){var t;if(e){var n=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),n}this.errorBackoff=3e4;var r=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,r)}},{key:"schedule",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isRunning){var n=this.getInterval(t);this.timerId=setTimeout((0,l.A)(m().mark(function t(){return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.iteration();case 2:case"end":return t.stop()}},t)})),n)}}},{key:"iteration",value:(t=(0,l.A)(m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.user.getIdToken(!0);case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),(null===e.t0||void 0===e.t0?void 0:e.t0.code)==="auth/".concat("network-request-failed")&&this.schedule(!0),e.abrupt("return");case 9:this.schedule();case 10:case"end":return e.stop()}},e,this,[[0,5]])})),function(){return t.apply(this,arguments)})}]),e}(),Ee=function(){function e(t,n){(0,h.A)(this,e),this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}return(0,p.A)(e,[{key:"_initializeTime",value:function(){this.lastSignInTime=me(this.lastLoginAt),this.creationTime=me(this.createdAt)}},{key:"_copy",value:function(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}},{key:"toJSON",value:function(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}]),e}();function xe(e){return Re.apply(this,arguments)}function Re(){return(Re=(0,l.A)(m().mark(function e(t){var n,r,i,a,s,o,u,c,l,h,p;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.auth,e.next=3,t.getIdToken();case 3:return i=e.sent,e.next=6,_e(t,fe(r,{idToken:i}));case 6:q(null==(a=e.sent)?void 0:a.users.length,r,"internal-error"),s=a.users[0],t._notifyReloadListener(s),o=(null===(n=s.providerUserInfo)||void 0===n?void 0:n.length)?Ce(s.providerUserInfo):[],u=Oe(t.providerData,o),c=t.isAnonymous,l=!(t.email&&s.passwordHash||(null==u?void 0:u.length)),h=!!c&&l,p={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:u,metadata:new Ee(s.createdAt,s.lastLoginAt),isAnonymous:h},Object.assign(t,p);case 17:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ne(e){return Se.apply(this,arguments)}function Se(){return(Se=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,k.Ku)(t),e.next=3,xe(n);case 3:return e.next=5,n.auth._persistUserIfCurrent(n);case 5:n.auth._notifyListenersIfCurrent(n);case 6:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Oe(e,t){var n=e.filter(function(e){return!t.some(function(t){return t.providerId===e.providerId})});return[].concat((0,d.A)(n),(0,d.A)(t))}function Ce(e){return e.map(function(e){var t=e.providerId,n=(0,y.Tt)(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})}function Pe(e,t){return De.apply(this,arguments)}function De(){return(De=(0,l.A)(m().mark(function e(t,n){var r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,re(t,{},(0,l.A)(m().mark(function e(){var r,i,a,s,o,u;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=(0,k.Am)({grant_type:"refresh_token",refresh_token:n}).slice(1),i=t.config,a=i.tokenApiHost,s=i.apiKey,o=oe(t,a,"/v1/token","key=".concat(s)),e.next=5,t._getAdditionalHeaders();case 5:return(u=e.sent)["Content-Type"]="application/x-www-form-urlencoded",e.abrupt("return",X.fetch()(o,{method:"POST",headers:u,body:r}));case 8:case"end":return e.stop()}},e)})));case 2:return r=e.sent,e.abrupt("return",{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Le=function(){function e(){(0,h.A)(this,e),this.refreshToken=null,this.accessToken=null,this.expirationTime=null}var t,n;return(0,p.A)(e,[{key:"isExpired",get:function(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}},{key:"updateFromServerResponse",value:function(e){q(e.idToken,"internal-error"),q(void 0!==e.idToken,"internal-error"),q(void 0!==e.refreshToken,"internal-error");
2var t,n,r="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):(t=e.idToken,q(n=Ie(t),"internal-error"),q(void 0!==n.exp,"internal-error"),q(void 0!==n.iat,"internal-error"),Number(n.exp)-Number(n.iat));this.updateTokensAndExpiration(e.idToken,e.refreshToken,r)}},{key:"getToken",value:(n=(0,l.A)(m().mark(function e(t){var n,r=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.length>1&&void 0!==r[1]&&r[1],q(!this.accessToken||this.refreshToken,t,"user-token-expired"),n||!this.accessToken||this.isExpired){e.next=4;break}return e.abrupt("return",this.accessToken);case 4:if(!this.refreshToken){e.next=8;break}return e.next=7,this.refresh(t,this.refreshToken);case 7:return e.abrupt("return",this.accessToken);case 8:return e.abrupt("return",null);case 9:case"end":return e.stop()}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"clearRefreshToken",value:function(){this.refreshToken=null}},{key:"refresh",value:(t=(0,l.A)(m().mark(function e(t,n){var r,i,a,s;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pe(t,n);case 2:r=e.sent,i=r.accessToken,a=r.refreshToken,s=r.expiresIn,this.updateTokensAndExpiration(i,a,Number(s));case 7:case"end":return e.stop()}},e,this)})),function(e,n){return t.apply(this,arguments)})},{key:"updateTokensAndExpiration",value:function(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}},{key:"toJSON",value:function(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}},{key:"_assign",value:function(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}},{key:"_clone",value:function(){return Object.assign(new e,this.toJSON())}},{key:"_performRefresh",value:function(){return z("not implemented")}}],[{key:"fromJSON",value:function(t,n){var r=n.refreshToken,i=n.accessToken,a=n.expirationTime,s=new e;return r&&(q("string"==typeof r,"internal-error",{appName:t}),s.refreshToken=r),i&&(q("string"==typeof i,"internal-error",{appName:t}),s.accessToken=i),a&&(q("number"==typeof a,"internal-error",{appName:t}),s.expirationTime=a),s}}]),e}();function Me(e,t){q("string"==typeof e||void 0===e,"internal-error",{appName:t})}var Ue=function(){function e(t){(0,h.A)(this,e);var n=t.uid,r=t.auth,i=t.stsTokenManager,a=(0,y.Tt)(t,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Te(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=a.displayName||null,this.email=a.email||null,this.emailVerified=a.emailVerified||!1,this.phoneNumber=a.phoneNumber||null,this.photoURL=a.photoURL||null,this.isAnonymous=a.isAnonymous||!1,this.tenantId=a.tenantId||null,this.providerData=a.providerData?(0,d.A)(a.providerData):[],this.metadata=new Ee(a.createdAt||void 0,a.lastLoginAt||void 0)}var t,n,r,i;return(0,p.A)(e,[{key:"getIdToken",value:(i=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_e(this,this.stsTokenManager.getToken(this.auth,t));case 2:if(q(n=e.sent,this.auth,"internal-error"),this.accessToken===n){e.next=9;break}return this.accessToken=n,e.next=8,this.auth._persistUserIfCurrent(this);case 8:this.auth._notifyListenersIfCurrent(this);case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"getIdTokenResult",value:function(e){return ge(this,e)}},{key:"reload",value:function(){return Ne(this)}},{key:"_assign",value:function(e){this!==e&&(q(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(function(e){return Object.assign({},e)}),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}},{key:"_clone",value:function(t){var n=new e(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}},{key:"_onReload",value:function(e){q(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}},{key:"_notifyReloadListener",value:function(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}},{key:"_startProactiveRefresh",value:function(){this.proactiveRefresh._start()}},{key:"_stopProactiveRefresh",value:function(){this.proactiveRefresh._stop()}},{key:"_updateTokensIfNecessary",value:(r=(0,l.A)(m().mark(function e(t){var n,r,i=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>1&&void 0!==i[1]&&i[1],r=!1,t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),!n){e.next=6;break}return e.next=6,xe(this);case 6:return e.next=8,this.auth._persistUserIfCurrent(this);case 8:r&&this.auth._notifyListenersIfCurrent(this);case 9:case"end":return e.stop()}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"delete",value:(n=(0,l.A)(m().mark(function e(){var t;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getIdToken();case 2:return t=e.sent,e.next=5,_e(this,le(this.auth,{idToken:t}));case 5:return this.stsTokenManager.clearRefreshToken(),e.abrupt("return",this.auth.signOut());case 7:case"end":return e.stop()}},e,this)})),function(){return n.apply(this,arguments)})},{key:"toJSON",value:function(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isA
2nonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(function(e){return Object.assign({},e)}),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}},{key:"refreshToken",get:function(){return this.stsTokenManager.refreshToken||""}}],[{key:"_fromJSON",value:function(t,n){var r,i,a,s,o,u,c,l,h=null!==(r=n.displayName)&&void 0!==r?r:void 0,p=null!==(i=n.email)&&void 0!==i?i:void 0,d=null!==(a=n.phoneNumber)&&void 0!==a?a:void 0,f=null!==(s=n.photoURL)&&void 0!==s?s:void 0,v=null!==(o=n.tenantId)&&void 0!==o?o:void 0,m=null!==(u=n._redirectEventId)&&void 0!==u?u:void 0,k=null!==(c=n.createdAt)&&void 0!==c?c:void 0,g=null!==(l=n.lastLoginAt)&&void 0!==l?l:void 0,y=n.uid,A=n.emailVerified,I=n.isAnonymous,_=n.providerData,w=n.stsTokenManager;q(y&&w,t,"internal-error");var b=Le.fromJSON(this.name,w);q("string"==typeof y,t,"internal-error"),Me(h,t.name),Me(p,t.name),q("boolean"==typeof A,t,"internal-error"),q("boolean"==typeof I,t,"internal-error"),Me(d,t.name),Me(f,t.name),Me(v,t.name),Me(m,t.name),Me(k,t.name),Me(g,t.name);var T=new e({uid:y,auth:t,email:p,emailVerified:A,displayName:h,isAnonymous:I,photoURL:f,phoneNumber:d,tenantId:v,stsTokenManager:b,createdAt:k,lastLoginAt:g});return _&&Array.isArray(_)&&(T.providerData=_.map(function(e){return Object.assign({},e)})),m&&(T._redirectEventId=m),T}},{key:"_fromIdTokenResponse",value:(t=(0,l.A)(m().mark(function t(n,r){var i,a,s,o=arguments;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=o.length>2&&void 0!==o[2]&&o[2],(a=new Le).updateFromServerResponse(r),s=new e({uid:r.localId,auth:n,stsTokenManager:a,isAnonymous:i}),t.next=6,xe(s);case 6:return t.abrupt("return",s);case 7:case"end":return t.stop()}},t)})),function(e,n){return t.apply(this,arguments)})}]),e}(),Fe=new Map;function Ve(e){G(e instanceof Function,"Expected a class definition");var t=Fe.get(e);return t?(G(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Fe.set(e,t),t)}var He=function(){function e(){(0,h.A)(this,e),this.type="NONE",this.storage={}}var t,n,r,i;return(0,p.A)(e,[{key:"_isAvailable",value:(i=(0,l.A)(m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!0);case 1:case"end":return e.stop()}},e)})),function(){return i.apply(this,arguments)})},{key:"_set",value:(r=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.storage[t]=n;case 1:case"end":return e.stop()}},e,this)})),function(e,t){return r.apply(this,arguments)})},{key:"_get",value:(n=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.storage[t],e.abrupt("return",void 0===n?null:n);case 2:case"end":return e.stop()}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"_remove",value:(t=(0,l.A)(m().mark(function e(t){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:delete this.storage[t];case 1:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"_addListener",value:function(e,t){}},{key:"_removeListener",value:function(e,t){}}]),e}();He.type="NONE";var je=He;function Ke(e,t,n){return"firebase".concat(":",e,":").concat(t,":").concat(n)}var qe=function(){function e(t,n,r){(0,h.A)(this,e),this.persistence=t,this.auth=n,this.userKey=r;var i=this.auth,a=i.config,s=i.name;this.fullUserKey=Ke(this.userKey,a.apiKey,s),this.fullPersistenceKey=Ke("persistence",a.apiKey,s),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}var t,n,r;return(0,p.A)(e,[{key:"setCurrentUser",value:function(e){return this.persistence._set(this.fullUserKey,e.toJSON())}},{key:"getCurrentUser",value:(r=(0,l.A)(m().mark(function e(){var t;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.persistence._get(this.fullUserKey);case 2:return t=e.sent,e.abrupt("return",t?Ue._fromJSON(this.auth,t):null);case 4:case"end":return e.stop()}},e,this)})),function(){return r.apply(this,arguments)})},{key:"removeCurrentUser",value:function(){return this.persistence._remove(this.fullUserKey)}},{key:"savePersistenceForRedirect",value:function(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}},{key:"setPersistence",value:(n=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.persistence!==t){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.getCurrentUser();case 4:return n=e.sent,e.next=7,this.removeCurrentUser();case 7:if(this.persistence=t,!n){e.next=10;break}return e.abrupt("return",this.setCurrentUser(n));case 10:case"end":return e.stop()}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"delete",value:function(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}}],[{key:"create",value:(t=(0,l.A)(m().mark(function t(n,r){var i,a,s,o,u,c,h,p,d,f,v,k=arguments;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=k.length>2&&void 0!==k[2]?k[2]:"authUser",r.length){t.next=3;break}return t.abrupt("return",new e(Ve(je),n,i));case 3:return t.next=5,Promise.all(r.map(function(){var e=(0,l.A)(m().mark(function e(t){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t._isAvailable();case 2:if(!e.sent){e.next=4;break}return e.abrupt("return",t);case 4:return e.abrupt("return",void 0);case 5:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()));case 5:a=t.sent.filter(function(e){return e}
2),s=a[0]||Ve(je),o=Ke(i,n.config.apiKey,n.name),u=null,c=w(r),t.prev=10,c.s();case 12:if((h=c.n()).done){t.next=29;break}return p=h.value,t.prev=14,t.next=17,p._get(o);case 17:if(!(d=t.sent)){t.next=23;break}return f=Ue._fromJSON(n,d),p!==s&&(u=f),s=p,t.abrupt("break",29);case 23:t.next=27;break;case 25:t.prev=25,t.t0=t.catch(14);case 27:t.next=12;break;case 29:t.next=34;break;case 31:t.prev=31,t.t1=t.catch(10),c.e(t.t1);case 34:return t.prev=34,c.f(),t.finish(34);case 37:if(v=a.filter(function(e){return e._shouldAllowMigration}),s._shouldAllowMigration&&v.length){t.next=40;break}return t.abrupt("return",new e(s,n,i));case 40:if(s=v[0],!u){t.next=44;break}return t.next=44,s._set(o,u.toJSON());case 44:return t.next=46,Promise.all(r.map(function(){var e=(0,l.A)(m().mark(function e(t){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t===s){e.next=8;break}return e.prev=1,e.next=4,t._remove(o);case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:case"end":return e.stop()}},e,null,[[1,6]])}));return function(t){return e.apply(this,arguments)}}()));case 46:return t.abrupt("return",new e(s,n,i));case 47:case"end":return t.stop()}},t,null,[[10,31,34,37],[14,25]])})),function(e,n){return t.apply(this,arguments)})}]),e}();function ze(e){var t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Je(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Ge(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Qe(t))return"Blackberry";if(Xe(t))return"Webos";if(We(t))return"Safari";if((t.includes("chrome/")||Be(t))&&!t.includes("edge/"))return"Chrome";if(Ye(t))return"Android";var n=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);return 2===(null==n?void 0:n.length)?n[1]:"Other"}function Ge(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,k.ZQ)();return/firefox\//i.test(e)}function We(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,k.ZQ)()).toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Be(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,k.ZQ)();return/crios\//i.test(e)}function Je(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,k.ZQ)();return/iemobile/i.test(e)}function Ye(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,k.ZQ)();return/android/i.test(e)}function Qe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,k.ZQ)();return/blackberry/i.test(e)}function Xe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,k.ZQ)();return/webos/i.test(e)}function Ze(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,k.ZQ)();return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function $e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,k.ZQ)();return/(iPad|iPhone|iPod).*OS 7_\d/i.test(e)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(e)}function et(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,k.ZQ)();return Ze(e)||Ye(e)||Xe(e)||Qe(e)||/windows phone/i.test(e)||Je(e)}function tt(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];switch(e){case"Browser":t=ze((0,k.ZQ)());break;case"Worker":t="".concat(ze((0,k.ZQ)()),"-").concat(e);break;default:t=e}var r=n.length?n.join(","):"FirebaseCore-web";return"".concat(t,"/","JsCore","/").concat(g.MF,"/").concat(r)}function nt(e){return rt.apply(this,arguments)}function rt(){return(rt=(0,l.A)(m().mark(function e(t){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,te(t,"GET","/v1/recaptchaParams");case 2:if(e.t0=e.sent.recaptchaSiteKey,e.t0){e.next=5;break}e.t0="";case 5:return e.abrupt("return",e.t0);case 6:case"end":return e.stop()}},e)}))).apply(this,arguments)}
2function it(e,t){return at.apply(this,arguments)}function at(){return(at=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",te(t,"GET","/v2/recaptchaConfig",ee(t,n)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function st(e){return void 0!==e&&void 0!==e.getResponse}function ot(e){return void 0!==e&&void 0!==e.enterprise}var ut=(0,p.A)(function e(t){if((0,h.A)(this,e),this.siteKey="",this.emailPasswordEnabled=!1,void 0===t.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=t.recaptchaKey.split("/")[3],this.emailPasswordEnabled=t.recaptchaEnforcementState.some(function(e){return"EMAIL_PASSWORD_PROVIDER"===e.provider&&"OFF"!==e.enforcementState})});function ct(e){return new Promise(function(t,n){var r,i,a=document.createElement("script");a.setAttribute("src",e),a.onload=t,a.onerror=function(e){var t=V("internal-error");t.customData=e,n(t)},a.type="text/javascript",a.charset="UTF-8",(null!==(i=null===(r=document.getElementsByTagName("head"))||void 0===r?void 0:r[0])&&void 0!==i?i:document).appendChild(a)})}function lt(e){return"__".concat(e).concat(Math.floor(1e6*Math.random()))}var ht=function(){function e(t){(0,h.A)(this,e),this.type="recaptcha-enterprise",this.auth=mt(t)}var t;return(0,p.A)(e,[{key:"verify",value:(t=(0,l.A)(m().mark(function e(){var t,n,r,i,a,s=this,o=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=function(e,n,r){var i=window.grecaptcha;ot(i)?i.enterprise.ready(function(){i.enterprise.execute(e,{action:t}).then(function(e){n(e)}).catch(function(){n("NO_RECAPTCHA")})}):r(Error("No reCAPTCHA enterprise script loaded."))},i=function(){return i=(0,l.A)(m().mark(function e(t){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=5;break}if(null!=t.tenantId||null==t._agentRecaptchaConfig){e.next=3;break}return e.abrupt("return",t._agentRecaptchaConfig.siteKey);case 3:if(null==t.tenantId||void 0===t._tenantRecaptchaConfigs[t.tenantId]){e.next=5;break}return e.abrupt("return",t._tenantRecaptchaConfigs[t.tenantId].siteKey);case 5:return e.abrupt("return",new Promise(function(){var e=(0,l.A)(m().mark(function e(n,r){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:it(t,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(function(e){if(void 0!==e.recaptchaKey){var i=new ut(e);return null==t.tenantId?t._agentRecaptchaConfig=i:t._tenantRecaptchaConfigs[t.tenantId]=i,n(i.siteKey)}r(new Error("recaptcha Enterprise site key undefined"))}).catch(function(e){r(e)});case 1:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}()));case 6:case"end":return e.stop()}},e)})),i.apply(this,arguments)},r=function(e){return i.apply(this,arguments)},t=o.length>0&&void 0!==o[0]?o[0]:"verify",n=o.length>1&&void 0!==o[1]&&o[1],e.abrupt("return",new Promise(function(e,t){r(s.auth).then(function(r){if(!n&&ot(window.grecaptcha))a(r,e,t);else{if("undefined"==typeof window)return void t(new Error("RecaptchaVerifier is only supported in browser"));ct("https://www.google.com/recaptcha/enterprise.js?render="+r).then(function(){a(r,e,t)}).catch(function(e){t(e)})}}).catch(function(e){t(e)})}));case 6:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)})}]),e}();function pt(e,t,n){return dt.apply(this,arguments)}function dt(){return dt=(0,l.A)(m().mark(function e(t,n,r){var i,a,s,o,u=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=u.length>3&&void 0!==u[3]&&u[3],a=new ht(t),e.prev=2,e.next=5,a.verify(r);case 5:s=e.sent,e.next=13;break;case 8:return e.prev=8,e.t0=e.catch(2),e.next=12,a.verify(r,!0);case 12:s=e.sent;case 13:return o=Object.assign({},n),i?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),e.abrupt("return",o);case 18:case"end":return e.stop()}},e,null,[[2,8]])})),dt.apply(this,arguments)}var ft=function(){function e(t){(0,h.A)(this,e),this.auth=t,this.queue=[]}var t;return(0,p.A)(e,[{key:"pushCallback",value:function(e,t){var n=this,r=function(t){return new Promise(function(n,r){try{n(e(t))}catch(i){r(i)}})};r.onAbort=t,this.queue.push(r);var i=this.queue.length-1;return function(){n.queue[i]=function(){return Promise.resolve()}}}},{key:"runMiddleware",value:(t=(0,l.A)(m().mark(function e(t){var n,r,i,a,s,o,u;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.auth.currentUser!==t){e.next=2;break}return e.abrupt("return");case 2:n=[],e.prev=3,r=w(this.queue),e.prev=5,r.s();case 7:if((i=r.n()).done){e.next=14;break}return a=i.value,e.next=11,a(t);case 11:a.onAbort&&n.push(a.onAbort);case 12:e.next=7;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),r.e(e.t0);case 19:return e.prev=19,r.f(),e.finish(19);case 22:e.next=30;break;case 24:e.prev=24,e.t1=e.catch(3),n.reverse(),s=w(n);try{for(s.s();!(o=s.n()).done;){u=o.value;try{u()}catch(c){}}}catch(l){s.e(l)}finally{s.f()}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null===e.t1||void 0===e.t1?void 0:e.t1.message});case 30:case"end":return e.stop()}},e,this,[[3,24],[5,16,19,22]])})),function(e){return t.apply(this,arguments)})}]),e}(),vt=function(){function e(t,n,r,i){(0,h.A)(this,e),this.app=t,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new kt(this),this.idTokenSubscription=new kt(this),this.beforeStateQueue=new ft(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=P,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=i.sdkClientVersion}var t,n,r,i,a,s,o,u,c,d,v,g,y,A,I,_;return(0,p.A)(e,[{key:"_initializeWithPersistence",value:function(e,t){var n=this;return t&&(this._popupRedirectResolver=Ve(t)),this._initializationPromise=this.queue((0,l.A)(m().mark(function r(){var i,a;return m().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!n._deleted){r.next=2;break}return r.abrupt("return");case 2:return r.next=4,qe.create(n,e);case 4:if(n.persistenceManager=r.sent,!n._deleted){r.next=7;break}return r.abrupt("return");case 7:if(!(null===(i=n._popupRedirectResolver)||void 0===i?void 0:i._shouldInitProactively)){r.next=15;break}return r.prev=8,r.next=11,n._popupRedirectResolver._initialize(n);case 11:r.next=15;break;case 13:r.prev=13,r.t0=r.catch(8);case 15:return r.next=17,n.initializeCurrentUser(t);case 17:if(n.lastNotifiedUid=(null===(a=n.currentUser)||void 0===a?void 0:a.uid)||null,!n._deleted){r.next=20;break}return r.abrupt("return");case 20:n._isInitialized=!0;case 21:case"end":return r.stop()}},r,null,[[8,13]])}))),this._initializationPromise}},{key:"_onStorageEvent",value:(_=(0,l.A)(m().mark(function e(){var t;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._deleted){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.assertedPersistence.getCurrentUser();case 4:if(t=e.sent,this.currentUser||t){e.next=7;break}return e.abrupt("return");case 7:if(!this.currentUser||!t||this.currentUser.uid!==t.uid){e.next=12;break}return this._currentUser._assign(t),e.next=11,this.currentUser.getIdToken();case 11:return e.abrupt("return");case 12:return e.next=14,this._updateCurrentUser(t,!0);case 14:case"end":return e.stop()}},e,this)})),function(){return _.apply(this,arguments)})},{key:"initializeCurrentUser",value:(I=(0,l.A)(m().mark(function e(t){var n,r,i,a,s,o,u;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.assertedPersistence.getCurrentUser();case 2:if(r=e.sent,i=r,a=!1,!t||!this.config.authDomain){e.next=14;break}return e.next=8,this.getOrInitRedirectPersistenceManager();case 8:return s=null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId,o=null==i?void 0:i._redirectEventId,e.next=12,this.tryRedirectSignIn(t);case 12:u=e.sent,s&&s!==o||!(null==u?void 0:u.user)||(i=u.user,a=!0);case 14:if(i){e.next=16;break}return e.abrupt("return",this.directlySetCurrentUser(null));
2case 16:if(i._redirectEventId){e.next=32;break}if(!a){e.next=27;break}return e.prev=18,e.next=21,this.beforeStateQueue.runMiddleware(i);case 21:e.next=27;break;case 23:e.prev=23,e.t0=e.catch(18),i=r,this._popupRedirectResolver._overrideRedirectResult(this,function(){return Promise.reject(e.t0)});case 27:if(!i){e.next=31;break}return e.abrupt("return",this.reloadAndSetCurrentUserOrClear(i));case 31:return e.abrupt("return",this.directlySetCurrentUser(null));case 32:return q(this._popupRedirectResolver,this,"argument-error"),e.next=35,this.getOrInitRedirectPersistenceManager();case 35:if(!this.redirectUser||this.redirectUser._redirectEventId!==i._redirectEventId){e.next=37;break}return e.abrupt("return",this.directlySetCurrentUser(i));case 37:return e.abrupt("return",this.reloadAndSetCurrentUserOrClear(i));case 38:case"end":return e.stop()}},e,this,[[18,23]])})),function(e){return I.apply(this,arguments)})},{key:"tryRedirectSignIn",value:(A=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=null,e.prev=1,e.next=4,this._popupRedirectResolver._completeRedirectFn(this,t,!0);case 4:n=e.sent,e.next=11;break;case 7:return e.prev=7,e.t0=e.catch(1),e.next=11,this._setRedirectUser(null);case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}},e,this,[[1,7]])})),function(e){return A.apply(this,arguments)})},{key:"reloadAndSetCurrentUserOrClear",value:(y=(0,l.A)(m().mark(function e(t){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,xe(t);case 3:e.next=9;break;case 5:if(e.prev=5,e.t0=e.catch(0),(null===e.t0||void 0===e.t0?void 0:e.t0.code)==="auth/".concat("network-request-failed")){e.next=9;break}return e.abrupt("return",this.directlySetCurrentUser(null));case 9:return e.abrupt("return",this.directlySetCurrentUser(t));case 10:case"end":return e.stop()}},e,this,[[0,5]])})),function(e){return y.apply(this,arguments)})},{key:"useDeviceLanguage",value:function(){this.languageCode=function(){if("undefined"==typeof navigator)return null;var e=navigator;return e.languages&&e.languages[0]||e.language||null}()}},{key:"_delete",value:(g=(0,l.A)(m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this._deleted=!0;case 1:case"end":return e.stop()}},e,this)})),function(){return g.apply(this,arguments)})},{key:"updateCurrentUser",value:(v=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(n=t?(0,k.Ku)(t):null)&&q(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),e.abrupt("return",this._updateCurrentUser(n&&n._clone(this)));case 3:case"end":return e.stop()}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"_updateCurrentUser",value:(d=(0,l.A)(m().mark(function e(t){var n,r=this,i=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>1&&void 0!==i[1]&&i[1],!this._deleted){e.next=3;break}return e.abrupt("return");case 3:if(t&&q(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n){e.next=7;break}return e.next=7,this.beforeStateQueue.runMiddleware(t);case 7:return e.abrupt("return",this.queue((0,l.A)(m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.directlySetCurrentUser(t);case 2:r.notifyAuthListeners();case 3:case"end":return e.stop()}},e)}))));case 8:case"end":return e.stop()}},e,this)})),function(e){return d.apply(this,arguments)})},{key:"signOut",value:(c=(0,l.A)(m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.beforeStateQueue.runMiddleware(null);case 2:if(!this.redirectPersistenceManager&&!this._popupRedirectResolver){e.next=5;break}return e.next=5,this._setRedirectUser(null);case 5:return e.abrupt("return",this._updateCurrentUser(null,!0));case 6:case"end":return e.stop()}},e,this)})),function(){return c.apply(this,arguments)})},{key:"setPersistence",value:function(e){var t=this;return this.queue((0,l.A)(m().mark(function n(){return m().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.assertedPersistence.setPersistence(Ve(e));case 2:case"end":return n.stop()}},n)})))}},{key:"initializeRecaptchaConfig",value:(u=(0,l.A)(m().mark(function e(){var t,n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,it(this,{clientType:"CLIENT_TYPE_WEB",ver
2sion:"RECAPTCHA_ENTERPRISE"});case 2:t=e.sent,n=new ut(t),null==this.tenantId?this._agentRecaptchaConfig=n:this._tenantRecaptchaConfigs[this.tenantId]=n,n.emailPasswordEnabled&&new ht(this).verify();case 6:case"end":return e.stop()}},e,this)})),function(){return u.apply(this,arguments)})},{key:"_getRecaptchaConfig",value:function(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}},{key:"_getPersistence",value:function(){return this.assertedPersistence.persistence.type}},{key:"_updateErrorMap",value:function(e){this._errorFactory=new k.FA("auth","Firebase",e())}},{key:"onAuthStateChanged",value:function(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}},{key:"beforeAuthStateChanged",value:function(e,t){return this.beforeStateQueue.pushCallback(e,t)}},{key:"onIdTokenChanged",value:function(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}},{key:"toJSON",value:function(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}},{key:"_setRedirectUser",value:(o=(0,l.A)(m().mark(function e(t,n){var r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getOrInitRedirectPersistenceManager(n);case 2:return r=e.sent,e.abrupt("return",null===t?r.removeCurrentUser():r.setCurrentUser(t));case 4:case"end":return e.stop()}},e,this)})),function(e,t){return o.apply(this,arguments)})},{key:"getOrInitRedirectPersistenceManager",value:(s=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.redirectPersistenceManager){e.next=9;break}return q(n=t&&Ve(t)||this._popupRedirectResolver,this,"argument-error"),e.next=5,qe.create(this,[Ve(n._redirectPersistence)],"redirectUser");case 5:return this.redirectPersistenceManager=e.sent,e.next=8,this.redirectPersistenceManager.getCurrentUser();case 8:this.redirectUser=e.sent;case 9:return e.abrupt("return",this.redirectPersistenceManager);case 10:case"end":return e.stop()}},e,this)})),function(e){return s.apply(this,arguments)})},{key:"_redirectUserForId",value:(a=(0,l.A)(m().mark(function e(t){var n,r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isInitialized){e.next=3;break}return e.next=3,this.queue((0,l.A)(m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},e)})));case 3:if((null===(n=this._currentUser)||void 0===n?void 0:n._redirectEventId)!==t){e.next=5;break}return e.abrupt("return",this._currentUser);case 5:if((null===(r=this.redirectUser)||void 0===r?void 0:r._redirectEventId)!==t){e.next=7;break}return e.abrupt("return",this.redirectUser);case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}},e,this)})),function(e){return a.apply(this,arguments)})},{key:"_persistUserIfCurrent",value:(i=(0,l.A)(m().mark(function e(t){var n=this;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==this.currentUser){e.next=2;break}return e.abrupt("return",this.queue((0,l.A)(m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.directlySetCurrentUser(t));case 1:case"end":return e.stop()}},e)}))));case 2:case"end":return e.stop()}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"_notifyListenersIfCurrent",value:function(e){e===this.currentUser&&this.notifyAuthListeners()}},{key:"_key",value:function(){return"".concat(this.config.authDomain,":").concat(this.config.apiKey,":").concat(this.name)}},{key:"_startProactiveRefresh",value:function(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}},{key:"_stopProactiveRefresh",value:function(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}},{key:"_currentUser",get:function(){return this.currentUser}},{key:"notifyAuthListeners",value:function(){var e,t;if(this._isInitialized){this.idTokenSubscription.next(this.currentUser);var n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}}},{key:"registerStateListener",value:function(e,t,n,r){var i=this;if(this._deleted)return function(){};var a="function"==typeof t?t:t.next.bind(t),s=this._isInitialized?Promise.resolve():this._initializationPromise;return q(s,this,"internal-error"),s.then(function(){return a(i.currentUser)}),"function"==typeof t?e.addObserver(t,n,r):e.addObserver(t)}},{key:"directlySetCurrentUser",value:(r=(0,l.A)(m().mark(function e(t){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,!t){e.next=8;break}return e.next=6,this.assertedPersistence.setCurrentUser(t);case 6:e.next=10;break;case 8:return e.next=10,this.assertedPersistence.removeCurrentUser();case 10:case"end":return e.stop()}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"queue",value:function(e){return this.operations=this.operations.then(e,e),this.operations}},{key:"assertedPersistence",get:function(){return q(this.persistenceManager,this,"internal-error"),this.persistenceManager}},{key:"_logFramework",value:function(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=tt(this.config.clientPlatform,this._getFrameworks()))}},{key:"_getFrameworks",value:function(){return this.frameworks}},{key:"_getAdditionalHeaders",value:(n=(0,l.A)(m().mark(function e(){var t,n,r,i;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,f.A)({},"X-Client-Version",this.clientVersion),this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId),e.next=4,null===(t=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getHeartbeatsHeader();case 4:return(r=e.sent)&&(n["X-Firebase-Client"]=r),e.next=8,this._getAppCheckToken();case 8:return(i=e.sent)&&(n["X-Firebase-AppCheck"]=i),e.abrupt("return",n);case 11:case"end":return e.stop()}},e,this)})),function(){return n.apply(this,arguments)})},{key:"_getAppCheckToken",value:(t=(0,l.A)(m().mark(function e(){var t,n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(t=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getToken();case 2:return(null==(n=e.sent)?void 0:n.error)&&M("Error while retrieving App Check token: ".concat(n.error)),e.abrupt("return",null==n?void 0:n.token);case 5:case"end":return e.stop()}},e,this)})),function(){return t.apply(this,arguments)})}]),e}();function mt(e){return(0,k.Ku)(e)}var kt=function(){function e(t){var n=this;(0,h.A)(this,e),this.auth=t,this.observer=null,this.addObserver=(0,k.tD)(function(e){return n.observer=e})}return(0,p.A)(e,[{key:"next",get:function(){return q(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}]),e}();function gt(e,t){var n=(0,g.j6)(e,"auth");if(n.isInitialized()){var r=n.getImmediate(),i=n.getOptions();if((0,k.bD)(i,null!=t?t:{}))return r;F(r,"already-initialized")}return n.initialize({options:t})}function yt(e,t,n){var r=mt(e);q(r._canInitEmulator,r,"emulator-config-failed"),q(/^https?:\/\//.test(t),r,"invali
2d-emulator-scheme");var i=!!(null==n?void 0:n.disableWarnings),a=At(t),s=function(e){var t=At(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};var r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){var a=i[1];return{host:a,port:It(r.substr(a.length+1))}}var s=r.split(":"),o=(0,c.A)(s,2);return{host:o[0],port:It(o[1])}}(t),o=s.host,u=s.port,l=null===u?"":":".concat(u);r.config.emulator={url:"".concat(a,"//").concat(o).concat(l,"/")},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:u,protocol:a.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function(){function e(){var e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials.");"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function At(e){var t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function It(e){if(!e)return null;var t=Number(e);return isNaN(t)?null:t}var _t=function(){function e(t,n){(0,h.A)(this,e),this.providerId=t,this.signInMethod=n}return(0,p.A)(e,[{key:"toJSON",value:function(){return z("not implemented")}},{key:"_getIdTokenResponse",value:function(e){return z("not implemented")}},{key:"_linkToIdToken",value:function(e,t){return z("not implemented")}},{key:"_getReauthenticationResolver",value:function(e){return z("not implemented")}}]),e}();function wt(e,t){return bt.apply(this,arguments)}function bt(){return(bt=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",te(t,"POST","/v1/accounts:resetPassword",ee(t,n)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Tt(e,t){return Et.apply(this,arguments)}function Et(){return(Et=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",te(t,"POST","/v1/accounts:update",n));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function xt(e,t){return Rt.apply(this,arguments)}function Rt(){return(Rt=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",te(t,"POST","/v1/accounts:update",ee(t,n)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Nt(e,t){return St.apply(this,arguments)}function St(){return(St=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ae(t,"POST","/v1/accounts:signInWithPassword",ee(t,n)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ot(e,t){return Ct.apply(this,arguments)}function Ct(){return(Ct=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",te(t,"POST","/v1/accounts:sendOobCode",ee(t,n)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Pt(e,t){return Dt.apply(this,arguments)}function Dt(){return(Dt=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ot(t,n));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Lt(e,t){return Mt.apply(this,arguments)}function Mt(){return(Mt=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ot(t,n));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ut(e,t){return Ft.apply(this,arguments)}function Ft(){return(Ft=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ot(t,n));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Vt(e,t){return Ht.apply(this,arguments)}function Ht(){return(Ht=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ot(t,n));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function jt(e,t){return Kt.apply(this,arguments)}function Kt(){return(Kt=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ae(t,"POST","/v1/accounts:signInWithEmailLink",ee(t,n)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function qt(e,t){return zt.apply(this,arguments)}function zt(){return(zt=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ae(t,"POST","/v1/accounts:signInWithEmailLink",ee(t,n)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Gt=function(e){(0,s.A)(i,e);var t,n,r=_(i);function i(e,t,n){var a,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return(0,h.A)(this,i),(a=r.call(this,"password",n))._email=e,a._password=t,a._tenantId=s,a}return(0,p.A)(i,[{key:"toJSON",value:function(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}},{key:"_getIdTokenResponse",value:(n=(0,l.A)(m().mark(function e(t){var n,r,i;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.signInMethod,e.next="password"===e.t0?3:"emailLink"===e.t0?12:13;break;case 3:if(r={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},!(null===(n=t._getRecaptchaConfig())||void 0===n?void 0:n.emailPasswordEnabled)){e.next=11;break}return e.next=7,pt(t,r,"signInWithPassword");case 7:return i=e.sent,e.abrupt("return",Nt(t,i));case 11:return e.abrupt("return",Nt(t,r).catch(function(){var e=(0,l.A)(m().mark(function e(n){var i;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n.code!=="auth/".concat("missing-rec
2aptcha-token")){e.next=8;break}return console.log("Sign-in with email address and password is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow."),e.next=4,pt(t,r,"signInWithPassword");case 4:return i=e.sent,e.abrupt("return",Nt(t,i));case 8:return e.abrupt("return",Promise.reject(n));case 9:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()));case 12:return e.abrupt("return",jt(t,{email:this._email,oobCode:this._password}));case 13:F(t,"internal-error");case 14:case"end":return e.stop()}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"_linkToIdToken",value:(t=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.signInMethod,e.next="password"===e.t0?3:"emailLink"===e.t0?4:5;break;case 3:return e.abrupt("return",Tt(t,{idToken:n,returnSecureToken:!0,email:this._email,password:this._password}));case 4:return e.abrupt("return",qt(t,{idToken:n,email:this._email,oobCode:this._password}));case 5:F(t,"internal-error");case 6:case"end":return e.stop()}},e,this)})),function(e,n){return t.apply(this,arguments)})},{key:"_getReauthenticationResolver",value:function(e){return this._getIdTokenResponse(e)}}],[{key:"_fromEmailAndPassword",value:function(e,t){return new i(e,t,"password")}},{key:"_fromEmailAndCode",value:function(e,t){return new i(e,t,"emailLink",arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)}},{key:"fromJSON",value:function(e){var t="string"==typeof e?JSON.parse(e):e;if((null==t?void 0:t.email)&&(null==t?void 0:t.password)){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}}]),i}(_t);function Wt(e,t){return Bt.apply(this,arguments)}function Bt(){return(Bt=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ae(t,"POST","/v1/accounts:signInWithIdp",ee(t,n)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Jt=function(e){(0,s.A)(n,e);var t=_(n);function n(){var e;return(0,h.A)(this,n),(e=t.apply(this,arguments)).pendingToken=null,e}return(0,p.A)(n,[{key:"toJSON",value:function(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
2once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}},{key:"_getIdTokenResponse",value:function(e){return Wt(e,this.buildRequest())}},{key:"_linkToIdToken",value:function(e,t){var n=this.buildRequest();return n.idToken=t,Wt(e,n)}},{key:"_getReauthenticationResolver",value:function(e){var t=this.buildRequest();return t.autoCreate=!1,Wt(e,t)}},{key:"buildRequest",value:function(){var e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{var 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,k.Am)(t)}return e}}],[{key:"_fromParams",value:function(e){var t=new n(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):F("argument-error"),t}},{key:"fromJSON",value:function(e){var t="string"==typeof e?JSON.parse(e):e,r=t.providerId,i=t.signInMethod,a=(0,y.Tt)(t,["providerId","signInMethod"]);if(!r||!i)return null;var s=new n(r,i);return s.idToken=a.idToken||void 0,s.accessToken=a.accessToken||void 0,s.secret=a.secret,s.nonce=a.nonce,s.pendingToken=a.pendingToken||null,s}}]),n}(_t);function Yt(e,t){return Qt.apply(this,arguments)}function Qt(){return(Qt=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",te(t,"POST","/v1/accounts:sendVerificationCode",ee(t,n)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Xt(){return(Xt=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ae(t,"POST","/v1/accounts:signInWithPhoneNumber",ee(t,n)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Zt(){return(Zt=(0,l.A)(m().mark(function e(t,n){var r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ae(t,"POST","/v1/accounts:signInWithPhoneNumber",ee(t,n));case 2:if(!(r=e.sent).temporaryProof){e.next=5;break}throw ce(t,"account-exists-with-different-credential",r);case 5:return e.abrupt("return",r);case 6:case"end":return e.stop()}},e)}))).apply(this,arguments)}var $t=(0,f.A)({},"USER_NOT_FOUND","user-not-found");function en(){return(en=(0,l.A)(m().mark(function e(t,n){var r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.assign(Object.assign({},n),{operation:"REAUTH"}),e.abrupt("return",ae(t,"POST","/v1/accounts:signInWithPhoneNumber",ee(t,r),$t));case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}var tn=function(e){(0,s.A)(n,e);var t=_(n);function n(e){var r;return(0,h.A)(this,n),(r=t.call(this,"phone","phone")).params=e,r}return(0,p.A)(n,[{key:"_getIdTokenResponse",value:function(e){return function(e,t){return Xt.apply(this,arguments)}(e,this._makeVerificationRequest())}},{key:"_linkToIdToken",value:function(e,t){return function(e,t){return Zt.apply(this,arguments)}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}},{key:"_getReauthenticationResolver",value:function(e){return function(e,t){return en.apply(this,arguments)}(e,this._makeVerificationRequest())}},{key:"_makeVerificationRequest",value:function(){var e=this.params,t=e.temporaryProof,n=e.phoneNumber,r=e.verificationId,i=e.verificationCode;return t&&n?{temporaryProof:t,phoneNumber:n}:{sessionInfo:r,code:i}}},{key:"toJSON",value:function(){var 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}}],[{key:"_fromVerification",value:function(e,t){return new n({verificationId:e,verificationCode:t})}}
2,{key:"_fromTokenResponse",value:function(e,t){return new n({phoneNumber:e,temporaryProof:t})}},{key:"fromJSON",value:function(e){"string"==typeof e&&(e=JSON.parse(e));var t=e,r=t.verificationId,i=t.verificationCode,a=t.phoneNumber,s=t.temporaryProof;return i||r||a||s?new n({verificationId:r,verificationCode:i,phoneNumber:a,temporaryProof:s}):null}}]),n}(_t);var nn=function(){function e(t){var n,r,i,a,s,o;(0,h.A)(this,e);var u=(0,k.I9)((0,k.hp)(t)),c=null!==(n=u.apiKey)&&void 0!==n?n:null,l=null!==(r=u.oobCode)&&void 0!==r?r:null,p=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}}(null!==(i=u.mode)&&void 0!==i?i:null);q(c&&l&&p,"argument-error"),this.apiKey=c,this.operation=p,this.code=l,this.continueUrl=null!==(a=u.continueUrl)&&void 0!==a?a:null,this.languageCode=null!==(s=u.languageCode)&&void 0!==s?s:null,this.tenantId=null!==(o=u.tenantId)&&void 0!==o?o:null}return(0,p.A)(e,null,[{key:"parseLink",value:function(t){var n=function(e){var t=(0,k.I9)((0,k.hp)(e)).link,n=t?(0,k.I9)((0,k.hp)(t)).deep_link_id:null,r=(0,k.I9)((0,k.hp)(e)).deep_link_id;return(r?(0,k.I9)((0,k.hp)(r)).link:null)||r||n||t||e}(t);try{return new e(n)}catch(r){return null}}}]),e}();function rn(e){return nn.parseLink(e)}var an=function(){function e(){(0,h.A)(this,e),this.providerId=e.PROVIDER_ID}return(0,p.A)(e,null,[{key:"credential",value:function(e,t){return Gt._fromEmailAndPassword(e,t)}},{key:"credentialWithLink",value:function(e,t){var n=nn.parseLink(t);return q(n,"argument-error"),Gt._fromEmailAndCode(e,n.code,n.tenantId)}}]),e}();an.PROVIDER_ID="password",an.EMAIL_PASSWORD_SIGN_IN_METHOD="password",an.EMAIL_LINK_SIGN_IN_METHOD="emailLink";var sn=function(){function e(t){(0,h.A)(this,e),this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}return(0,p.A)(e,[{key:"setDefaultLanguage",value:function(e){this.defaultLanguageCode=e}},{key:"setCustomParameters",value:function(e){return this.customParameters=e,this}},{key:"getCustomParameters",value:function(){return this.customParameters}}]),e}(),on=function(e){(0,s.A)(n,e);var t=_(n);function n(){var e;return(0,h.A)(this,n),(e=t.apply(this,arguments)).scopes=[],e}return(0,p.A)(n,[{key:"addScope",value:function(e){return this.scopes.includes(e)||this.scopes.push(e),this}},{key:"getScopes",value:function(){return(0,d.A)(this.scopes)}}]),n}(sn),un=function(e){(0,s.A)(n,e);var t=_(n);function n(){return(0,h.A)(this,n),t.apply(this,arguments)}return(0,p.A)(n,[{key:"credential",value:function(e){return this._credential(Object.assign(Object.assign({},e),{nonce:e.rawNonce}))}},{key:"_credential",value:function(e){return q(e.idToken||e.accessToken,"argument-error"),Jt._fromParams(Object.assign(Object.assign({}
2,e),{providerId:this.providerId,signInMethod:this.providerId}))}}],[{key:"credentialFromJSON",value:function(e){var t="string"==typeof e?JSON.parse(e):e;return q("providerId"in t&&"signInMethod"in t,"argument-error"),Jt._fromParams(t)}},{key:"credentialFromResult",value:function(e){return n.oauthCredentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.oauthCredentialFromTaggedObject(e.customData||{})}},{key:"oauthCredentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t)return null;var r=t.oauthIdToken,i=t.oauthAccessToken,a=t.oauthTokenSecret,s=t.pendingToken,o=t.nonce,u=t.providerId;if(!(i||a||r||s))return null;if(!u)return null;try{return new n(u)._credential({idToken:r,accessToken:i,nonce:o,pendingToken:s})}catch(c){return null}}}]),n}(on),cn=function(e){(0,s.A)(n,e);var t=_(n);function n(){return(0,h.A)(this,n),t.call(this,"facebook.com")}return(0,p.A)(n,null,[{key:"credential",value:function(e){return Jt._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}},{key:"credentialFromResult",value:function(e){return n.credentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.credentialFromTaggedObject(e.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return n.credential(t.oauthAccessToken)}catch(r){return null}}}]),n}(on);cn.FACEBOOK_SIGN_IN_METHOD="facebook.com",cn.PROVIDER_ID="facebook.com";var ln=function(e){(0,s.A)(n,e);var t=_(n);function n(){var e;return(0,h.A)(this,n),(e=t.call(this,"google.com")).addScope("profile"),e}return(0,p.A)(n,null,[{key:"credential",value:function(e,t){return Jt._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}},{key:"credentialFromResult",value:function(e){return n.credentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.credentialFromTaggedObject(e.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t)return null;var r=t.oauthIdToken,i=t.oauthAccessToken;if(!r&&!i)return null;try{return n.credential(r,i)}catch(a){return null}}}]),n}(on);ln.GOOGLE_SIGN_IN_METHOD="google.com",ln.PROVIDER_ID="google.com";var hn=function(e){(0,s.A)(n,e);var t=_(n);function n(){return(0,h.A)(this,n),t.call(this,"github.com")}return(0,p.A)(n,null,[{key:"credential",value:function(e){return Jt._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GITHUB_SIGN_IN_METHOD,accessToken:e})}},{key:"credentialFromResult",value:function(e){return n.credentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.credentialFromTaggedObject(e.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return n.credential(t.oauthAccessToken)}catch(r){return null}}}]),n}(on);hn.GITHUB_SIGN_IN_METHOD="github.com",hn.PROVIDER_ID="github.com";var pn=function(e){(0,s.A)(n,e);var t=_(n);function n(e,r){var i;return(0,h.A)(this,n),(i=t.call(this,e,e)).pendingToken=r,i}return(0,p.A)(n,[{key:"_getIdTokenResponse",value:function(e){return Wt(e,this.buildRequest())}},{key:"_linkToIdToken",value:function(e,t){var n=this.buildRequest();return n.idToken=t,Wt(e,n)}},{key:"_getReauthenticationResolver",value:function(e){var t=this.buildRequest();return t.autoCreate=!1,Wt(e,t)}},{key:"toJSON",value:function(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}},{key:"buildRequest",value:function(){return{requestUri:"http://localhost",returnSecureToken:!0,pendingToken:this.pendingToken}}}],[{key:"fromJSON",value:function(e){var t="string"==typeof e?JSON.parse(e):e,r=t.providerId,i=t.signInMethod,a=t.pendingToken;return r&&i&&a&&r===i?new n(r,a):null}},{key:"_create",value:function(e,t){return new n(e,t)}}]),n}(_t),dn=function(e){(0,s.A)(n,e);var t=_(n);function n(e){return(0,h.A)(this,n),q(e.startsWith("saml."),"argument-error"),t.call(this,e)}return(0,p.A)(n,null,[{key:"credentialFromResult",value:function(e){return n.samlCredentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.samlCredentialFromTaggedObject(e.customData||{})}},{key:"credentialFromJSON",value:function(e){var t=pn.fromJSON(e);return q(t,"argument-error"),t}},{key:"samlCredentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t)return null;var n=t.pendingToken,r=t.providerId;if(!n||!r)return null;try{return pn._create(r,n)}catch(i){return null}}}]),n}(sn),fn=function(e){(0,s.A)(n,e);var t=_(n);function n(){return(0,h.A)(this,n),t.call(this,"twitter.com")}return(0,p.A)(n,null,[{key:"credential",value:function(e,t){return Jt._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}},{key:"credentialFromResult",value:function(e){return n.credentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.credentialFromTaggedObject(e.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t)return null;var r=t.oauthAccessToken,i=t.oauthTokenSecret;if(!r||!i)return null;try{return n.credential(r,i)}catch(a){return null}}}]),n}(on);function vn(e,t){return mn.apply(this,arguments)}function mn(){return(mn=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ae(t,"POST","/v1/accounts:signUp",ee(t,n)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}fn.TWITTER_SIGN_IN_METHOD="twitter.com",fn.PROVIDER_ID="twitter.com";var kn=function(){function e(t){(0,h.A)(this,e),this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._token
2Response,this.operationType=t.operationType}var t,n;return(0,p.A)(e,null,[{key:"_fromIdTokenResponse",value:(n=(0,l.A)(m().mark(function t(n,r,i){var a,s,o,u,c=arguments;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a=c.length>3&&void 0!==c[3]&&c[3],t.next=3,Ue._fromIdTokenResponse(n,i,a);case 3:return s=t.sent,o=gn(i),u=new e({user:s,providerId:o,_tokenResponse:i,operationType:r}),t.abrupt("return",u);case 7:case"end":return t.stop()}},t)})),function(e,t,r){return n.apply(this,arguments)})},{key:"_forOperation",value:(t=(0,l.A)(m().mark(function t(n,r,i){var a;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n._updateTokensIfNecessary(i,!0);case 2:return a=gn(i),t.abrupt("return",new e({user:n,providerId:a,_tokenResponse:i,operationType:r}));case 4:case"end":return t.stop()}},t)})),function(e,n,r){return t.apply(this,arguments)})}]),e}();function gn(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}function yn(e){return An.apply(this,arguments)}function An(){return(An=(0,l.A)(m().mark(function e(t){var n,r,i,a;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=mt(t),e.next=3,r._initializationPromise;case 3:if(!(null===(n=r.currentUser)||void 0===n?void 0:n.isAnonymous)){e.next=5;break}return e.abrupt("return",new kn({user:r.currentUser,providerId:null,operationType:"signIn"}));case 5:return e.next=7,vn(r,{returnSecureToken:!0});case 7:return i=e.sent,e.next=10,kn._fromIdTokenResponse(r,"signIn",i,!0);case 10:return a=e.sent,e.next=13,r._updateCurrentUser(a.user);case 13:return e.abrupt("return",a);case 14:case"end":return e.stop()}},e)}))).apply(this,arguments)}var In=function(e){(0,s.A)(n,e);var t=_(n);function n(e,r,i,s){var o,u;return(0,h.A)(this,n),(o=t.call(this,r.code,r.message)).operationType=i,o.user=s,Object.setPrototypeOf((0,a.A)(o),n.prototype),o.customData={appName:e.name,tenantId:null!==(u=e.tenantId)&&void 0!==u?u:void 0,_serverResponse:r.customData._serverResponse,operationType:i},o}return(0,p.A)(n,null,[{key:"_fromErrorAndOperation",value:function(e,t,r,i){return new n(e,t,r,i)}}]),n}(k.g);function _n(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(function(n){if(n.code==="auth/".concat("multi-factor-auth-required"))throw In._fromErrorAndOperation(e,n,t,r);throw n})}function wn(e){return new Set(e.map(function(e){return e.providerId}).filter(function(e){return!!e}))}function bn(e,t){return Tn.apply(this,arguments)}function Tn(){return(Tn=(0,l.A)(m().mark(function e(t,n){var r,i,a,s;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=(0,k.Ku)(t),e.next=3,Rn(!0,r,n);case 3:return e.t0=pe,e.t1=r.auth,e.next=7,r.getIdToken();case 7:return e.t2=e.sent,e.t3=[n],e.t4={idToken:e.t2,deleteProvider:e.t3},e.next=12,(0,e.t0)(e.t1,e.t4);case 12:return i=e.sent,a=i.providerUserInfo,s=wn(a||[]),r.providerData=r.providerData.filter(function(e){return s.has(e.providerId)}),s.has("phone")||(r.phoneNumber=null),e.next=19,r.auth._persistUserIfCurrent(r);case 19:return e.abrupt("return",r);case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function En(e,t){return xn.apply(this,arguments)}function xn(){return xn=(0,l.A)(m().mark(function e(t,n){var r,i,a=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>2&&void 0!==a[2]&&a[2],e.t0=_e,e.t1=t,e.t2=n,e.t3=t.auth,e.next=7,t.getIdToken();case 7:return e.t4=e.sent,e.t5=e.t2._linkToIdToken.call(e.t2,e.t3,e.t4),e.t6=r,e.next=12,(0,e.t0)(e.t1,e.t5,e.t6);case 12:return i=e.sent,e.abrupt("return",kn._forOperation(t,"link",i));case 14:case"end":return e.stop()}},e)})),xn.apply(this,arguments)}function Rn(e,t,n){return Nn.apply(this,arguments)}function Nn(){return(Nn=(0,l.A)(m().mark(function e(t,n,r){var i,a;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,xe(n);case 2:i=wn(n.providerData),a=!1===t?"provider-already-linked":"no-such-provider",q(i.has(r)===t,n.auth,a);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Sn(e,t){return On.apply(this,arguments)}function On(){return On=(0,l.A)(m().mark(function e(t,n){var r,i,a,s,o,u,c=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=c.length>2&&void 0!==c[2]&&c[2],i=t.auth,a="reauthenticate",e.prev=3,e.next=6,_e(t,_n(i,a,n,t),r);case 6:return q((s=e.sent).idToken,i,"internal-error"),q(o=Ie(s.idToken),i,"internal-error"),u=o.sub,q(t.uid===u,i,"user-mismatch"),e.abrupt("return",kn._forOperation(t,a,s));case 15:throw e.prev=15,e.t0=e.catch(3),(null===e.t0||void 0===e.t0?void 0:e.t0.code)==="auth/".concat("user-not-found")&&F(i,"user-mismatch"),e.t0;case 19:case"end":return e.stop()}},e,null,[[3,15]])})),On.apply(this,arguments)}function Cn(e,t){return Pn.apply(this,arguments)}function Pn(){return Pn=(0,l.A)(m().mark(function e(t,n){var r,i,a,s,o=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>2&&void 0!==o[2]&&o[2],i="signIn",e.next=4,_n(t,i,n);case 4:return a=e.sent,e.next=7,kn._fromIdTokenResponse(t,i,a);case 7:if(s=e.sent,r){e.next=11;break}return e.next=11,t._updateCurrentUser(s.user);case 11:return e.abrupt("return",s);case 12:case"end":return e.stop()}},e)})),Pn.apply(this,arguments)}function Dn(e,t){return Ln.apply(this,arguments)}function Ln(){return(Ln=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Cn(mt(t),n));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Mn(e,t){return Un.apply(this,arguments)}function Un(){return(Un=(0,l.A)(m().mark(function e(t,n){var r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=(0,k.Ku)(t),e.next=3,Rn(!1,r,n.providerId);case 3:return e.abrupt("return",En(r,n));case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Fn(e,t){return Vn.apply(this,arguments)}function Vn(){return(Vn=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Sn((0,k.Ku)(t),n));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Hn(e,t){return jn.apply(this,arguments)}function jn(){return(jn=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ae(t,"POST","/v1/accounts:signInWithCustomToken",ee(t,n)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Kn(e,t){return qn.apply(this,arguments)}function qn(){return(qn=(0,l.A)(m().mark(function e(t,n){var r,i,a;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=mt(t),e.next=3,Hn(r,{token:n,returnSecureToken:!0});case 3:return i=e.sent,e.next=6,kn._fromIdTokenResponse(r,"signIn",i);case 6:return a=e.sent,e.next=9,r._updateCurrentUser(a.user);case 9:return e.abrupt("return",a);case 10:case"end":return e.stop()}},e)}))).apply(this,arguments)}var zn=function(){function e(t,n){(0,h.A)(this,e),this.factorId=t,this.uid=n.mfaEnrollmentId,this.enrollmentTime=new Date(n.enrolledAt).toUTCString(),this.displayName=n.displayName}return(0,p.A)(e,null,[{key:"_fromServerResponse",value:function(e,t){return"phoneInfo"in t?Gn._fromServerResponse(e,t):"totpInfo"in t?Wn._fromServerResponse(e,t):F(e,"internal-error")}}]),e}(),Gn=function(e){(0,s.A)(n,e);var t=_(n);function n(e){var r;return(0,h.A)(this,n),(r=t.call(this,"phone",e)).phoneNumber=e.phoneInfo,r}return(0,p.A)(n,null,[{key:"_fromServerResponse",value:function(e,t){return new n(t)}}]),n}(zn),Wn=function(e){(0,s.A)(n,e);var t=_(n);function n(e){return(0,h.A)(this,n),t.call(this,"totp",e)}return(0,p.A)(n,null,[{key:"_fromServerResponse",value:function(e,t){return new n(t)}}]),n}(zn);function Bn(e,t,n){var r;q((null===(r=n.url)||void 0===r?void 0:r.length)>
20,e,"invalid-continue-uri"),q(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(q(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(q(n.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}function Jn(e,t,n){return Yn.apply(this,arguments)}function Yn(){return Yn=(0,l.A)(m().mark(function e(t,n,r){var i,a,s,o;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=mt(t),s={requestType:"PASSWORD_RESET",email:n,clientType:"CLIENT_TYPE_WEB"},!(null===(i=a._getRecaptchaConfig())||void 0===i?void 0:i.emailPasswordEnabled)){e.next=11;break}return e.next=5,pt(a,s,"getOobCode",!0);case 5:return o=e.sent,r&&Bn(a,o,r),e.next=9,Lt(a,o);case 9:e.next=14;break;case 11:return r&&Bn(a,s,r),e.next=14,Lt(a,s).catch(function(){var e=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.code!=="auth/".concat("missing-recaptcha-token")){e.next=10;break}return console.log("Password resets are protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the password reset flow."),e.next=4,pt(a,s,"getOobCode",!0);case 4:return n=e.sent,r&&Bn(a,n,r),e.next=8,Lt(a,n);case 8:e.next=11;break;case 10:return e.abrupt("return",Promise.reject(t));case 11:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}());case 14:case"end":return e.stop()}},e)})),Yn.apply(this,arguments)}function Qn(e,t,n){return Xn.apply(this,arguments)}function Xn(){return(Xn=(0,l.A)(m().mark(function e(t,n,r){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wt((0,k.Ku)(t),{oobCode:n,newPassword:r});case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Zn(e,t){return $n.apply(this,arguments)}function $n(){return($n=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,xt((0,k.Ku)(t),{oobCode:n});case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function er(e,t){return tr.apply(this,arguments)}function tr(){return(tr=(0,l.A)(m().mark(function e(t,n){var r,i,a,s;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=(0,k.Ku)(t),e.next=3,wt(r,{oobCode:n});case 3:i=e.sent,q(a=i.requestType,r,"internal-error"),e.t0=a,e.next="EMAIL_SIGNIN"===e.t0?9:"VERIFY_AND_CHANGE_EMAIL"===e.t0?10:"REVERT_SECOND_FACTOR_ADDITION"===e.t0?12:13;break;case 9:return e.abrupt("break",14);case 10:return q(i.newEmail,r,"internal-error"),e.abrupt("break",14);case 12:q(i.mfaInfo,r,"internal-error");case 13:q(i.email,r,"internal-error");case 14:return s=null,i.mfaInfo&&(s=zn._fromServerResponse(mt(r),i.mfaInfo)),e.abrupt("return",{data:{email:("VERIFY_AND_CHANGE_EMAIL"===i.requestType?i.newEmail:i.email)||null,previousEmail:("VERIFY_AND_CHANGE_EMAIL"===i.requestType?i.email:i.newEmail)||null,multiFactorInfo:s},operation:a});case 17:case"end":return e.stop()}},e)}))).apply(this,arguments)}function nr(e,t){return rr.apply(this,arguments)}function rr(){return(rr=(0,l.A)(m().mark(function e(t,n){var r,i;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,er((0,k.Ku)(t),n);case 2:return r=e.sent,i=r.data,e.abrupt("return",i.email);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ir(e,t,n){return ar.apply(this,arguments)}function ar(){return ar=(0,l.A)(m().mark(function e(t,n,r){var i,a,s,o,u,c,h;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=mt(t),s={returnSecureToken:!0,email:n,password:r,clientType:"CLIENT_TYPE_WEB"},!(null===(i=a._getRecaptchaConfig())||void 0===i?void 0:i.emailPasswordEnabled)){e.next=9;break}return e.next=5,pt(a,s,"signUpPassword");case 5:u=e.sent,o=vn(a,u),e.next=10;break;case 9:o=vn(a,s).catch(function(){var e=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.code!=="auth/".concat("missing-rec
2aptcha-token")){e.next=8;break}return console.log("Sign-up is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-up flow."),e.next=4,pt(a,s,"signUpPassword");case 4:return n=e.sent,e.abrupt("return",vn(a,n));case 8:return e.abrupt("return",Promise.reject(t));case 9:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}());case 10:return e.next=12,o.catch(function(e){return Promise.reject(e)});case 12:return c=e.sent,e.next=15,kn._fromIdTokenResponse(a,"signIn",c);case 15:return h=e.sent,e.next=18,a._updateCurrentUser(h.user);case 18:return e.abrupt("return",h);case 19:case"end":return e.stop()}},e)})),ar.apply(this,arguments)}function sr(e,t,n){return Dn((0,k.Ku)(e),an.credential(t,n))}function or(e,t,n){return ur.apply(this,arguments)}function ur(){return ur=(0,l.A)(m().mark(function e(t,n,r){var i,a,s,o,u;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=function(e,t){q(t.handleCodeInApp,a,"argument-error"),t&&Bn(a,e,t)},a=mt(t),s={requestType:"EMAIL_SIGNIN",email:n,clientType:"CLIENT_TYPE_WEB"},!(null===(i=a._getRecaptchaConfig())||void 0===i?void 0:i.emailPasswordEnabled)){e.next=12;break}return e.next=6,pt(a,s,"getOobCode",!0);case 6:return u=e.sent,o(u,r),e.next=10,Ut(a,u);case 10:e.next=15;break;case 12:return o(s,r),e.next=15,Ut(a,s).catch(function(){var e=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.code!=="auth/".concat("missing-recaptcha-token")){e.next=10;break}return console.log("Email link sign-in is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow."),e.next=4,pt(a,s,"getOobCode",!0);case 4:return n=e.sent,o(n,r),e.next=8,Ut(a,n);case 8:e.next=11;break;case 10:return e.abrupt("return",Promise.reject(t));case 11:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}());case 15:case"end":return e.stop()}},e)})),ur.apply(this,arguments)}function cr(e,t){var n=nn.parseLink(t);return"EMAIL_SIGNIN"===(null==n?void 0:n.operation)}function lr(e,t,n){return hr.apply(this,arguments)}function hr(){return(hr=(0,l.A)(m().mark(function e(t,n,r){var i,a;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=(0,k.Ku)(t),q((a=an.credentialWithLink(n,r||W()))._tenantId===(i.tenantId||null),i,"tenant-id-mismatch"),e.abrupt("return",Dn(i,a));case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function pr(e,t){return dr.apply(this,arguments)}function dr(){return(dr=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",te(t,"POST","/v1/accounts:createAuthUri",ee(t,n)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function fr(e,t){return vr.apply(this,arguments)}function vr(){return(vr=(0,l.A)(m().mark(function e(t,n){var r,i,a,s;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=B()?W():"http://localhost",i={identifier:n,continueUri:r},e.next=4,pr((0,k.Ku)(t),i);case 4:return a=e.sent,s=a.signinMethods,e.abrupt("return",s||[]);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function mr(e,t){return kr.apply(this,arguments)}function kr(){return(kr=(0,l.A)(m().mark(function e(t,n){var r,i,a,s;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=(0,k.Ku)(t),e.next=3,t.getIdToken();case 3:return i=e.sent,a={requestType:"VERIFY_EMAIL",idToken:i},n&&Bn(r.auth,a,n),e.next=8,Pt(r.auth,a);case 8:if(s=e.sent,s.email===t.email){e.next=13;break}return e.next=13,t.reload();case 13:case"end":return e.stop()}},e)}))).apply(this,arguments)}function gr(e,t,n){return yr.apply(this,arguments)}function yr(){return(yr=(0,l.A)(m().mark(function e(t,n,r){var i,a,s,o;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=(0,k.Ku)(t),e.next=3,t.getIdToken();case 3:return a=e.sent,s={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:a,newEmail:n},r&&Bn(i.auth,s,r),e.next=8,Vt(i.auth,s);case 8:if(o=e.sent,o.email===t.email){e.next=13;break}return e.next=13,t.reload();case 13:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ar(e,t){return Ir.apply(this,arguments)}function Ir(){return(Ir=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",te(t,"POST","/v1/accounts:update",n));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function _r(e,t){return wr.apply(this,arguments)}function wr(){return(wr=(0,l.A)(m().mark(function e(t,n){var r,i,a,s,o,u,c;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.displayName,i=n.photoURL,void 0!==r||void 0!==i){e.next=3;break}return e.abrupt("return");case 3:return a=(0,k.Ku)(t),e.next=6,a.getIdToken();case 6:return s=e.sent,o={idToken:s,displayName:r,photoUrl:i,returnSecureToken:!0},e.next=10,_e(a,Ar(a.auth,o));
2case 10:return u=e.sent,a.displayName=u.displayName||null,a.photoURL=u.photoUrl||null,(c=a.providerData.find(function(e){return"password"===e.providerId}))&&(c.displayName=a.displayName,c.photoURL=a.photoURL),e.next=17,a._updateTokensIfNecessary(u);case 17:case"end":return e.stop()}},e)}))).apply(this,arguments)}function br(e,t){return Er((0,k.Ku)(e),t,null)}function Tr(e,t){return Er((0,k.Ku)(e),null,t)}function Er(e,t,n){return xr.apply(this,arguments)}function xr(){return(xr=(0,l.A)(m().mark(function e(t,n,r){var i,a,s,o;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.auth,e.next=3,t.getIdToken();case 3:return a=e.sent,s={idToken:a,returnSecureToken:!0},n&&(s.email=n),r&&(s.password=r),e.next=9,_e(t,Tt(i,s));case 9:return o=e.sent,e.next=12,t._updateTokensIfNecessary(o,!0);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Rr=(0,p.A)(function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,h.A)(this,e),this.isNewUser=t,this.providerId=n,this.profile=r}),Nr=function(e){(0,s.A)(n,e);var t=_(n);function n(e,r,i,a){var s;return(0,h.A)(this,n),(s=t.call(this,e,r,i)).username=a,s}return(0,p.A)(n)}(Rr),Sr=function(e){(0,s.A)(n,e);var t=_(n);function n(e,r){return(0,h.A)(this,n),t.call(this,e,"facebook.com",r)}return(0,p.A)(n)}(Rr),Or=function(e){(0,s.A)(n,e);var t=_(n);function n(e,r){return(0,h.A)(this,n),t.call(this,e,"github.com",r,"string"==typeof(null==r?void 0:r.login)?null==r?void 0:r.login:null)}return(0,p.A)(n)}(Nr),Cr=function(e){(0,s.A)(n,e);var t=_(n);function n(e,r){return(0,h.A)(this,n),t.call(this,e,"google.com",r)}return(0,p.A)(n)}(Rr),Pr=function(e){(0,s.A)(n,e);var t=_(n);function n(e,r,i){return(0,h.A)(this,n),t.call(this,e,"twitter.com",r,i)}return(0,p.A)(n)}(Nr);function Dr(e){var t=e.user,n=e._tokenResponse;return t.isAnonymous&&!n?{providerId:null,isNewUser:!1,profile:null}:function(e){var t,n;if(!e)return null;var r=e.providerId,i=e.rawUserInfo?JSON.parse(e.rawUserInfo):{},a=e.isNewUser||"identitytoolkit#SignupNewUserResponse"===e.kind;if(!r&&(null==e?void 0:e.idToken)){var s=null===(n=null===(t=Ie(e.idToken))||void 0===t?void 0:t.firebase)||void 0===n?void 0:n.sign_in_provider;if(s)return new Rr(a,"anonymous"!==s&&"custom"!==s?s:null)}if(!r)return null;switch(r){case"facebook.com":return new Sr(a,i);case"github.com":return new Or(a,i);case"google.com":return new Cr(a,i);case"twitter.com":return new Pr(a,i,e.screenName||null);case"custom":case"anonymous":return new Rr(a,null);default:return new Rr(a,r,i)}}(n)}function Lr(e,t){return(0,k.Ku)(e).setPersistence(t)}function Mr(e){return mt(e).initializeRecaptchaConfig()}function Ur(e,t,n,r){return(0,k.Ku)(e).onIdTokenChanged(t,n,r)}function Fr(e,t,n){return(0,k.Ku)(e).beforeAuthStateChanged(t,n)}function Vr(e,t,n,r){return(0,k.Ku)(e).onAuthStateChanged(t,n,r)}function Hr(e){(0,k.Ku)(e).useDeviceLanguage()}function jr(e,t){return(0,k.Ku)(e).updateCurrentUser(t)}function Kr(e){return(0,k.Ku)(e).signOut()}function qr(e){return zr.apply(this,arguments)}function zr(){return(zr=(0,l.A)(m().mark(function e(t){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,k.Ku)(t).delete());case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Gr=function(){function e(t,n,r){(0,h.A)(this,e),this.type=t,this.credential=n,this.auth=r}return(0,p.A)(e,[{key:"toJSON",value:function(){var e="enroll"===this.type?"idToken":"pendingCredential";return{multiFactorSession:(0,f.A)({},e,this.credential)}}}],[{key:"_fromIdtoken",value:function(t,n){return new e("enroll",t,n)}},{key:"_fromMfaPendingCredential",value:function(t){return new e("signin",t)}},{key:"fromJSON",value:function(t){var n,r;if(null==t?void 0:t.multiFactorSession){if(null===(n=t.multiFactorSession)||void 0===n?void 0:n.pendingCredential)return e._fromMfaPendingCredential(t.multiFactorSession.pendingCredential);if(null===(r=t.multiFactorSession)||void 0===r?void 0:r.idToken)return e._fromIdtoken(t.multiFactorSession.idToken)}return null}}]),e}(),Wr=function(){function e(t,n,r){(0,h.A)(this,e),this.session=t,this.hints=n,this.signInResolver=r}var t;return(0,p.A)(e,[{key:"resolveSignIn",value:(t=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t,e.abrupt("return",this.signInResolver(n));case 2:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})}],[{key:"_fromError",value:function(t,n){var r=mt(t),i=n.customData._serverResponse,a=(i.mfaInfo||[]).map(function(e){return zn._fromServerResponse(r,e)});q(i.mfaPendingCredential,r,"internal-error");var s=Gr._fromMfaPendingCredential(i.mfaPendingCredential);return new e(s,a,function(){var e=(0,l.A)(m().mark(function e(t){var a,o,u;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t._process(r,s);case 2:a=e.sent,delete i.mfaInfo,delete i.mfaPendingCredential,o=Object.assign(Object.assign({},i),{idToken:a.idToken,refreshToken:a.refreshToken}),e.t0=n.operationType,e.next="signIn"===e.t0?9:"reauthenticate"===e.t0?15:17;break;case 9:return e.next=11,kn._fromIdTokenResponse(r,n.operationType,o);case 11:return u=e.sent,e.next=14,r._updateCurrentUser(u.user);case 14:return e.abrupt("return",u);case 15:return q(n.user,r,"internal-error"),e.abrupt("return",kn._forOperation(n.user,n.operationType,o));case 17:F(r,"internal-error");case 18:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}())}}]),e}();function Br(e,t){var n,r=(0,k.Ku)(e),i=t;return q(t.customData.operationType,r,"argument-error"),q(null===(n=i.customData._serverResponse)||void 0===n?void 0:n.mfaPendingCredential,r,"argument-error"),Wr._fromError(r,i)}function Jr(e,t){return te(e,"POST","/v2/accounts/mfaEnrollment:start",ee(e,t))}function Yr(e,t){return te(e,"POST","/v2/accounts/mfaEnrollment:start",ee(e,t))}function Qr(e,t){return te(e,"POST","/v2/accounts/mfaEnrollment:finalize",ee(e,t))}function Xr(e,t){return te(e,"POST","/v2/accounts/mfaEnrollment:withdraw",ee(e,t))}var Zr=function(){function e(t){var n=this;(0,h.A)(this,e),this.user=t,this.enrolledFactors=[],t._onReload(function(e){e.mfaInfo&&(n.enrolledFactors=e.mfaInfo.map(function(e){return zn._fromServerResponse(t.auth,e)}))})}var t,n,r;return(0,p.A)(e,[{key:"getSession",value:(r=(0,l.A)(m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Gr,e.next=3,this.user.getIdToken();case 3:return e.t1=e.sent,e.t2=this.user.auth,e.abrupt("return",e.t0._fromIdtoken.call(e.t0,e.t1,e.t2));case 6:case"end":return e.stop()}},e,this)})),function(){return r.apply(this,arguments)})},{key:"enroll",value:(n=(0,l.A)(m().mark(function e(t,n){var r,i,a;return m().wrap(function(e){for(;;
2)switch(e.prev=e.next){case 0:return r=t,e.next=3,this.getSession();case 3:return i=e.sent,e.next=6,_e(this.user,r._process(this.user.auth,i,n));case 6:return a=e.sent,e.next=9,this.user._updateTokensIfNecessary(a);case 9:return e.abrupt("return",this.user.reload());case 10:case"end":return e.stop()}},e,this)})),function(e,t){return n.apply(this,arguments)})},{key:"unenroll",value:(t=(0,l.A)(m().mark(function e(t){var n,r,i;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof t?t:t.uid,e.next=3,this.user.getIdToken();case 3:return r=e.sent,e.prev=4,e.next=7,_e(this.user,Xr(this.user.auth,{idToken:r,mfaEnrollmentId:n}));case 7:return i=e.sent,this.enrolledFactors=this.enrolledFactors.filter(function(e){return e.uid!==n}),e.next=11,this.user._updateTokensIfNecessary(i);case 11:return e.next=13,this.user.reload();case 13:e.next=18;break;case 15:throw e.prev=15,e.t0=e.catch(4),e.t0;case 18:case"end":return e.stop()}},e,this,[[4,15]])})),function(e){return t.apply(this,arguments)})}],[{key:"_fromUser",value:function(t){return new e(t)}}]),e}(),$r=new WeakMap;function ei(e){var t=(0,k.Ku)(e);return $r.has(t)||$r.set(t,Zr._fromUser(t)),$r.get(t)}var ti="__sak",ni=function(){function e(t,n){(0,h.A)(this,e),this.storageRetriever=t,this.type=n}return(0,p.A)(e,[{key:"_isAvailable",value:function(){try{return this.storage?(this.storage.setItem(ti,"1"),this.storage.removeItem(ti),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}},{key:"_set",value:function(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}},{key:"_get",value:function(e){var t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}},{key:"_remove",value:function(e){return this.storage.removeItem(e),Promise.resolve()}},{key:"storage",get:function(){return this.storageRetriever()}}]),e}();var ri=function(e){(0,s.A)(o,e);var t,n,r,a=_(o);function o(){var e,t;return(0,h.A)(this,o),(e=a.call(this,function(){return window.localStorage},"LOCAL")).boundEventHandler=function(t,n){return e.onStorageEvent(t,n)},e.listeners={},e.localCache={},e.pollTimer=null,e.safariLocalStorageNotSynced=(We(t=(0,k.ZQ)())||Ze(t))&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),e.fallbackToPolling=et(),e._shouldAllowMigration=!0,e}return(0,p.A)(o,[{key:"forAllChangedKeys",value:function(e){for(var t=0,n=Object.keys(this.listeners);t<n.length;t++){var r=n[t],i=this.storage.getItem(r),a=this.localCache[r];i!==a&&e(r,a,i)}}},{key:"onStorageEvent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.key){var r=e.key;if(n?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){var i=this.storage.getItem(r);if(e.newValue!==i)null!==e.newValue?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!n)return}var a=function(){var e=t.storage.getItem(r);(n||t.localCache[r]!==e)&&t.notifyListeners(r,e)},s=this.storage.getItem(r);(0,k.lT)()&&10===document.documentMode&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(a,10):a()}else this.forAllChangedKeys(function(e,n,r){t.notifyListeners(e,r)})}},{key:"notifyListeners",value:function(e,t){this.localCache[e]=t;var n=this.listeners[e];if(n)for(var r=0,i=Array.from(n);r<i.length;r++){(0,i[r])(t?JSON.parse(t):t)}}},{key:"startPolling",value:function(){var e=this;this.stopPolling(),this.pollTimer=setInterval(function(){e.forAllChangedKeys(function(t,n,r){e.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:n,newValue:r}),!0)})},1e3)}},{key:"stopPolling",value:function(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}},{key:"attachListener",value:function(){window.addEventListener("storage",this.boundEventHandler)}},{key:"detachListener",value:function(){window.removeEventListener("storage",this.boundEventHandler)}},{key:"_addListener",value:function(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)}},{key:"_removeListener",value:function(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())}},{key:"_set",value:(r=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.A)((0,u.A)(o.prototype),"_set",this).call(this,t,n);case 2:this.localCache[t]=JSON.stringify(n);case 3:case"end":return e.stop()}},e,this)})),function(e,t){return r.apply(this,arguments)})},{key:"_get",value:(n=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.A)((0,u.A)(o.prototype),"_get",this).call(this,t);case 2:return n=e.sent,this.localCache[t]=JSON.stringify(n),e.abrupt("return",n);case 5:case"end":return e.stop()}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"_remove",value:(t=(0,l.A)(m().mark(function e(t){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.A)((0,u.A)(o.prototype),"_remove",this).call(this,t);case 2:delete this.localCache[t];case 3:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})}]),o}(ni);ri.type="LOCAL";var ii=ri,ai=function(e){(0,s.A)(n,e);var t=_(n);function n(){return(0,h.A)(this,n),t.call(this,function(){return window.sessionStorage},"SESSION")}return(0,p.A)(n,[{key:"_addListener",value:function(e,t){}},{key:"_removeListener",value:function(e,t){}}]),n}(ni);ai.type="SESSION";var si=ai;function oi(e){return Promise.all(e.map(function(){var e=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t;case 3:return n=e.sent,e.abrupt("return",{fulfilled:!0,value:n});case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",{fulfilled:!1,reason:e.t0});case 10:case"end":return e.stop()}},e,null,[[0,7]])}));return function(t){return e.apply(this,arguments)}}()))}var ui=function(){function e(t){(0,h.A)(this,e),this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}var t;return(0,p.A)(e,[{key:"isListeningto",value:function(e){return this.eventTarget===e}},{key:"handleEvent",value:(t=(0,l.A)(m().mark(function e(t){var n,r,i,a,s,o,u,c;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(n=t).data,i=r.eventId,a=r.eventType,s=r.data,null==(o=this.handlersMap[a])?void 0:o.size){e.next=5;break}return e.abrupt("return");case 5:return n.ports[0].postMessage({status:"ack",eventId:i,eventType:a}),u=Array.from(o).map(function(){var e=(0,l.A)(m().mark(function e(t){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(n.origin,s));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),e.next=9,oi(u);case 9:c=e.sent,n.ports[0].postMessage({status:"done",eventId:i,eventType:a,response:c});case 11:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"_subscribe",value:function(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)}},{key:"_unsubscribe",value:function(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)}}],[{key:"_getInstance",value:function(t){var n=this.receivers.find(function(e){return e.isListeningto(t)});if(n)return n;var r=new e(t);return this.receivers.push(r),r}}]),e}();function ci(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n="",r=0;r<t;r++)n+=Math.floor(10*Math.random());return e+n}ui.receivers=[];var li=function(){function e(t){(0,h.A)(this,e),this.target=t,this.handlers=new Set}var t;return(0,p.A)(e,[{key:"removeMessageHandler",value:function(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}},{key:"_send",value:(t=(0,l.A)(m().mark(function e(t,n){var r,i,a,s,o=this,u=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=u.length>2&&void 0!==u[2]?u[2]:50,i="undefined"!=typeof MessageChannel?new MessageChannel:null){e.next=4;break}throw new Error("connection_unavailable");case 4:return e.abrupt("return",new Promise(function(e,u){var c=ci("",20);i.port1.start();var l=setTimeout(function(){u(new Error("unsupported_event"))},r);s={messageChannel:i,onMessage:function(t){var n=t;if(n.data.eventId===c)switch(n.data.status){case"ack":clearTimeout(l),a=setTimeout(function(){u(new Error("timeout"))},3e3);break;case"done":clearTimeout(a),e(n.data.response);break;default:clearTimeout(l),clearTimeout(a),u(new Error("invalid_response"))}}},o.handlers.add(s),i.port1.addEventListener("message",s.onMessage),o.target.postMessage({eventType:t,eventId:c,data:n},[i.port2])}).finally(function(){s&&o.removeMessageHandler(s)}));case 5:case"end":return e.stop()}},e)})),function(e,n){return t.apply(this,arguments)})}]),e}();function hi(){return window}
2function pi(e){hi().location.href=e}function di(){return void 0!==hi().WorkerGlobalScope&&"function"==typeof hi().importScripts}function fi(){return vi.apply(this,arguments)}function vi(){return(vi=(0,l.A)(m().mark(function e(){var t;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null===navigator||void 0===navigator?void 0:navigator.serviceWorker){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,navigator.serviceWorker.ready;case 5:return t=e.sent,e.abrupt("return",t.active);case 9:return e.prev=9,e.t0=e.catch(2),e.abrupt("return",null);case 12:case"end":return e.stop()}},e,null,[[2,9]])}))).apply(this,arguments)}function mi(){var e;return(null===(e=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===e?void 0:e.controller)||null}function ki(){return di()?self:null}var gi="firebaseLocalStorageDb",yi="firebaseLocalStorage",Ai="fbase_key",Ii=function(){function e(t){(0,h.A)(this,e),this.request=t}return(0,p.A)(e,[{key:"toPromise",value:function(){var e=this;return new Promise(function(t,n){e.request.addEventListener("success",function(){t(e.request.result)}),e.request.addEventListener("error",function(){n(e.request.error)})})}}]),e}();function _i(e,t){return e.transaction([yi],t?"readwrite":"readonly").objectStore(yi)}function wi(){var e=indexedDB.deleteDatabase(gi);return new Ii(e).toPromise()}function bi(){var e=indexedDB.open(gi,1);return new Promise(function(t,n){e.addEventListener("error",function(){n(e.error)}),e.addEventListener("upgradeneeded",function(){var t=e.result;try{t.createObjectStore(yi,{keyPath:Ai})}catch(r){n(r)}}),e.addEventListener("success",(0,l.A)(m().mark(function n(){var r;return m().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if((r=e.result).objectStoreNames.contains(yi)){n.next=12;break}return r.close(),n.next=5,wi();case 5:return n.t0=t,n.next=8,bi();case 8:n.t1=n.sent,(0,n.t0)(n.t1),n.next=13;break;case 12:t(r);case 13:case"end":return n.stop()}},n)})))})}function Ti(e,t,n){return Ei.apply(this,arguments)}function Ei(){return(Ei=(0,l.A)(m().mark(function e(t,n,r){var i,a;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=_i(t,!0).put((i={},(0,f.A)(i,Ai,n),(0,f.A)(i,"value",r),i)),e.abrupt("return",new Ii(a).toPromise());case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function xi(e,t){return Ri.apply(this,arguments)}function Ri(){return(Ri=(0,l.A)(m().mark(function e(t,n){var r,i;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=_i(t,!1).get(n),e.next=3,new Ii(r).toPromise();case 3:return i=e.sent,e.abrupt("return",void 0===i?null:i.value);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ni(e,t){var n=_i(e,!0).delete(t);return new Ii(n).toPromise()}var Si=function(){function e(){(0,h.A)(this,e),this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(function(){},function(){})}var t,n,r,i,a,s,o,u,c,d,f,v;return(0,p.A)(e,[{key:"_openDb",value:(v=(0,l.A)(m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.db){e.next=2;break}return e.abrupt("return",this.db);case 2:return e.next=4,bi();case 4:return this.db=e.sent,e.abrupt("return",this.db);case 6:case"end":return e.stop()}},e,this)})),function(){return v.apply(this,arguments)})},{key:"_withRetries",value:(f=(0,l.A)(m().mark(function e(t){var n,r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=0;case 1:return e.prev=2,e.next=5,this._openDb();case 5:return r=e.sent,e.next=8,t(r);case 8:return e.abrupt("return",e.sent);case 11:if(e.prev=11,e.t0=e.catch(2),!(n++>3)){e.next=15;break}throw e.t0;case 15:this.db&&(this.db.close(),this.db=void 0);case 16:e.next=1;break;case 18:case"end":return e.stop()}},e,this,[[2,11]])})),function(e){return f.apply(this,arguments)})},{key:"initializeServiceWorkerMessaging",value:(d=(0,l.A)(m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",di()?this.initializeReceiver():this.initializeSender());case 1:case"end":return e.stop()}},e,this)})),function(){return d.apply(this,arguments)})},{key:"initializeReceiver",value:(c=(0,l.A)(m().mark(function e(){var t=this;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.receiver=ui._getInstance(ki()),this.receiver._subscribe("keyChanged",function(){var e=(0,l.A)(m().mark(function e(n,r){var i;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t._poll();case 2:return i=e.sent,e.abrupt("return",{keyProcessed:i.includes(r.key)});case 4:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}()),this.receiver._subscribe("ping",function(){var e=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",["keyChanged"]);case 1:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}());case 3:case"end":return e.stop()}},e,this)})),function(){return c.apply(this,arguments)})},{key:"initializeSender",value:(u=(0,l.A)(m().mark(function e(){var t,n,r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fi();case 2:if(this.activeServiceWorker=e.sent,this.activeServiceWorker){e.next=5;break}return e.abrupt("return");case 5:return this.sender=new li(this.activeServiceWorker),e.next=8,this.sender._send("ping",{},800);case 8:if(r=e.sent){e.next=11;break}return e.abrupt("return");case 11:(null===(t=r[0])||void 0===t?void 0:t.fulfilled)&&(null===(n=r[0])||void 0===n?void 0:n.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0);case 12:case"end":return e.stop()}},e,this)})),function(){return u.apply(this,arguments)})},{key:"notifyServiceWorker",value:(o=(0,l.A)(m().mark(function e(t){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.sender&&this.activeServiceWorker&&mi()===this.activeServiceWorker){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50);case 5:e.next=9;break;case 7:e.prev=7,e.t0=e.catch(2);case 9:case"end":return e.stop()}},e,this,[[2,7]])})),function(e){return o.apply(this,arguments)})},{key:"_isAvailable",value:(s=(0,l.A)(m().mark(function e(){var t;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,indexedDB){e.next=3;break}return e.abrupt("return",!1);case 3:return e.next=5,bi();case 5:return t=e.sent,e.next=8,Ti(t,ti,"1");case 8:return e.next=10,Ni(t,ti);case 10:return e.abrupt("return",!0);case 13:e.prev=13,e.t0=e.catch(0);case 15:return e.abrupt("return",!1);case 16:case"end":return e.stop()}},e,null,[[0,13]])})),function(){return s.apply(this,arguments)})},{key:"_withPendingWrite",value:(a=(0,l.A)(m().mark(function e(t){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.pendingWrites++,e.prev=1,e.next=4,t();case 4:return e.prev=4,this.pendingWrites--,e.finish(4);case 7:case"end":return e.stop()}},e,this,[[1,,4,7]])})),function(e){return a.apply(this,arguments)})},{key:"_set",value:(i=(0,l.A)(m().mark(function e(t,n){var r=this;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._withPendingWrite((0,l.A)(m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r._withRetries(function(e){return Ti(e,t,n
2)});case 2:return r.localCache[t]=n,e.abrupt("return",r.notifyServiceWorker(t));case 4:case"end":return e.stop()}},e)}))));case 1:case"end":return e.stop()}},e,this)})),function(e,t){return i.apply(this,arguments)})},{key:"_get",value:(r=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._withRetries(function(e){return xi(e,t)});case 2:return n=e.sent,this.localCache[t]=n,e.abrupt("return",n);case 5:case"end":return e.stop()}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"_remove",value:(n=(0,l.A)(m().mark(function e(t){var n=this;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._withPendingWrite((0,l.A)(m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n._withRetries(function(e){return Ni(e,t)});case 2:return delete n.localCache[t],e.abrupt("return",n.notifyServiceWorker(t));case 4:case"end":return e.stop()}},e)}))));case 1:case"end":return e.stop()}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"_poll",value:(t=(0,l.A)(m().mark(function e(){var t,n,r,i,a,s,o,u,c,l,h;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._withRetries(function(e){var t=_i(e,!1).getAll();return new Ii(t).toPromise()});case 2:if(t=e.sent){e.next=5;break}return e.abrupt("return",[]);case 5:if(0===this.pendingWrites){e.next=7;break}return e.abrupt("return",[]);case 7:n=[],r=new Set,i=w(t);try{for(i.s();!(a=i.n()).done;)s=a.value,o=s.fbase_key,u=s.value,r.add(o),JSON.stringify(this.localCache[o])!==JSON.stringify(u)&&(this.notifyListeners(o,u),n.push(o))}catch(p){i.e(p)}finally{i.f()}for(c=0,l=Object.keys(this.localCache);c<l.length;c++)h=l[c],this.localCache[h]&&!r.has(h)&&(this.notifyListeners(h,null),n.push(h));return e.abrupt("return",n);case 13:case"end":return e.stop()}},e,this)})),function(){return t.apply(this,arguments)})},{key:"notifyListeners",value:function(e,t){this.localCache[e]=t;var n=this.listeners[e];if(n)for(var r=0,i=Array.from(n);r<i.length;r++){(0,i[r])(t)}}},{key:"startPolling",value:function(){var e=this;this.stopPolling(),this.pollTimer=setInterval((0,l.A)(m().mark(function t(){return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e._poll());case 1:case"end":return t.stop()}},t)})),800)}},{key:"stopPolling",value:function(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}},{key:"_addListener",value:function(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)}},{key:"_removeListener",value:function(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()}}]),e}();Si.type="LOCAL";var Oi=Si;function Ci(e,t){return te(e,"POST","/v2/accounts/mfaSignIn:start",ee(e,t))}function Pi(e,t){return te(e,"POST","/v2/accounts/mfaSignIn:finalize",ee(e,t))}var Di=1e12,Li=function(){function e(t){(0,h.A)(this,e),this.auth=t,this.counter=Di,this._widgets=new Map}var t;return(0,p.A)(e,[{key:"render",value:function(e,t){var n=this.counter;return this._widgets.set(n,new Mi(e,this.auth.name,t||{})),this.counter++,n}},{key:"reset",value:function(e){var t,n=e||Di;null===(t=this._widgets.get(n))||void 0===t||t.delete(),this._widgets.delete(n)}},{key:"getResponse",value:function(e){var t,n=e||Di;return(null===(t=this._widgets.get(n))||void 0===t?void 0:t.getResponse())||""}},{key:"execute",value:(t=(0,l.A)(m().mark(function e(t){var n,r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t||Di,null===(n=this._widgets.get(r))||void 0===n||n.execute(),e.abrupt("return","");case 3:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})}]),e}(),Mi=function(){function e(t,n,r){var i=this;(0,h.A)(this,e),this.params=r,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=function(){i.execute()};var a="string"==typeof t?document.getElementById(t):t;q(a,"argument-error",{appName:n}),this.container=a,this.isVisible="invisible"!==this.params.size,this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}return(0,p.A)(e,[{key:"getResponse",value:function(){return this.checkIfDeleted(),this.responseToken}},{key:"delete",value:function(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}},{key:"execute",value:function(){var e=this;this.checkIfDeleted(),this.timerId||(this.timerId=window.setTimeout(function(){e.responseToken=function(e){for(var t=[],n="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r=0;r<e;r++)t.push(n.charAt(Math.floor(Math.random()*n.length)));return t.join("")}(50);var t=e.params,n=t.callback,r=t["expired-callback"];if(n)try{n(e.responseToken)}catch(i){}e.timerId=window.setTimeout(function(){if(e.timerId=null,e.responseToken=null,r)try{r()}catch(i){}e.isVisible&&e.execute()},6e4)},500))}},{key:"checkIfDeleted",value:function(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}}]),e}();var Ui=lt("rcb"),Fi=new Y(3e4,6e4),Vi=function(){function e(){var t;(0,h.A)(this,e),this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!(null===(t=hi().grecaptcha)||void 0===t?void 0:t.render)}return(0,p.A)(e,[{key:"load",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return q(function(e){return e.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(e)}(n),e,"argument-error"),this.shouldResolveImmediately(n)&&st(hi().grecaptcha)?Promise.resolve(hi().grecaptcha):new Promise(function(r,i){var a=hi().setTimeout(function(){i(V(e,"network-request-failed"))},Fi.get());hi()[Ui]=function(){hi().clearTimeout(a),delete hi()[Ui];var s=hi().grecaptcha;if(s&&st(s)){var o=s.render;s.render=function(e,n){var r=o(e,n);return t.counter++,r},t.hostLanguage=n,r(s)}else i(V(e,"internal-error"))},ct("".concat("https://www.google.com/recaptcha/api.js?","?").concat((0,k.Am)({onload:Ui,render:"explicit",hl:n}
2))).catch(function(){clearTimeout(a),i(V(e,"internal-error"))})})}},{key:"clearedOneInstance",value:function(){this.counter--}},{key:"shouldResolveImmediately",value:function(e){var t;return!!(null===(t=hi().grecaptcha)||void 0===t?void 0:t.render)&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}]),e}();var Hi=function(){function e(){(0,h.A)(this,e)}var t;return(0,p.A)(e,[{key:"load",value:(t=(0,l.A)(m().mark(function e(t){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Li(t));case 1:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)})},{key:"clearedOneInstance",value:function(){}}]),e}(),ji="recaptcha",Ki={theme:"light",type:"image"},qi=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.assign({},Ki),r=arguments.length>2?arguments[2]:void 0;(0,h.A)(this,e),this.parameters=n,this.type=ji,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=mt(r),this.isInvisible="invisible"===this.parameters.size,q("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment");var i="string"==typeof t?document.getElementById(t):t;q(i,this.auth,"argument-error"),this.container=i,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new Hi:new Vi,this.validateStartingState()}var t,n,r;return(0,p.A)(e,[{key:"verify",value:(r=(0,l.A)(m().mark(function e(){var t,n,r,i=this;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertNotDestroyed(),e.next=3,this.render();case 3:if(t=e.sent,n=this.getAssertedRecaptcha(),!(r=n.getResponse(t))){e.next=8;break}return e.abrupt("return",r);case 8:return e.abrupt("return",new Promise(function(e){i.tokenChangeListeners.add(function t(n){n&&(i.tokenChangeListeners.delete(t),e(n))}),i.isInvisible&&n.execute(t)}));case 9:case"end":return e.stop()}},e,this)})),function(){return r.apply(this,arguments)})},{key:"render",value:function(){var e=this;try{this.assertNotDestroyed()}catch(t){return Promise.reject(t)}return this.renderPromise||(this.renderPromise=this.makeRenderPromise().catch(function(t){throw e.renderPromise=null,t})),this.renderPromise}},{key:"_reset",value:function(){this.assertNotDestroyed(),null!==this.widgetId&&this.getAssertedRecaptcha().reset(this.widgetId)}},{key:"clear",value:function(){var e=this;this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach(function(t){e.container.removeChild(t)})}},{key:"validateStartingState",value:function(){q(!this.parameters.sitekey,this.auth,"argument-error"),q(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),q("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment")}},{key:"makeTokenCallback",value:function(e){var t=this;return function(n){if(t.tokenChangeListeners.forEach(function(e){return e(n)}),"function"==typeof e)e(n);else if("string"==typeof e){var r=hi()[e];"function"==typeof r&&r(n)}}}},{key:"assertNotDestroyed",value:function(){q(!this.destroyed,this.auth,"internal-error")}},{key:"makeRenderPromise",value:(n=(0,l.A)(m().mark(function e(){var t,n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.init();case 2:return this.widgetId||(t=this.container,this.isInvisible||(n=document.createElement("div"),t.appendChild(n),t=n),this.widgetId=this.getAssertedRecaptcha().render(t,this.parameters)),e.abrupt("return",this.widgetId);case 4:case"end":return e.stop()}},e,this)})),function(){return n.apply(this,arguments)})},{key:"init",value:(t=(0,l.A)(m().mark(function e(){var t;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return q(B()&&!di(),this.auth,"internal-error"),e.next=3,zi();case 3:return e.next=5,this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);case 5:return this.recaptcha=e.sent,e.next=8,nt(this.auth);case 8:q(t=e.sent,this.auth,"internal-error"),this.parameters.sitekey=t;
2case 11:case"end":return e.stop()}},e,this)})),function(){return t.apply(this,arguments)})},{key:"getAssertedRecaptcha",value:function(){return q(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}]),e}();function zi(){var e=null;return new Promise(function(t){"complete"!==document.readyState?(e=function(){return t()},window.addEventListener("load",e)):t()}).catch(function(t){throw e&&window.removeEventListener("load",e),t})}var Gi=function(){function e(t,n){(0,h.A)(this,e),this.verificationId=t,this.onConfirmation=n}return(0,p.A)(e,[{key:"confirm",value:function(e){var t=tn._fromVerification(this.verificationId,e);return this.onConfirmation(t)}}]),e}();function Wi(e,t,n){return Bi.apply(this,arguments)}function Bi(){return(Bi=(0,l.A)(m().mark(function e(t,n,r){var i,a;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=mt(t),e.next=3,Zi(i,n,(0,k.Ku)(r));case 3:return a=e.sent,e.abrupt("return",new Gi(a,function(e){return Dn(i,e)}));case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ji(e,t,n){return Yi.apply(this,arguments)}function Yi(){return(Yi=(0,l.A)(m().mark(function e(t,n,r){var i,a;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=(0,k.Ku)(t),e.next=3,Rn(!1,i,"phone");case 3:return e.next=5,Zi(i.auth,n,(0,k.Ku)(r));case 5:return a=e.sent,e.abrupt("return",new Gi(a,function(e){return Mn(i,e)}));case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Qi(e,t,n){return Xi.apply(this,arguments)}function Xi(){return(Xi=(0,l.A)(m().mark(function e(t,n,r){var i,a;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=(0,k.Ku)(t),e.next=3,Zi(i.auth,n,(0,k.Ku)(r));case 3:return a=e.sent,e.abrupt("return",new Gi(a,function(e){return Fn(i,e)}));case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Zi(e,t,n){return $i.apply(this,arguments)}function $i(){return($i=(0,l.A)(m().mark(function e(t,n,r){var i,a,s,o,u,c,l,h,p;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.verify();case 2:if(a=e.sent,e.prev=3,q("string"==typeof a,t,"argument-error"),q(r.type===ji,t,"argument-error"),!("session"in(s="string"==typeof n?{phoneNumber:n}:n))){e.next=26;break}if(o=s.session,!("phoneNumber"in s)){e.next=17;break}return q("enroll"===o.type,t,"internal-error"),e.next=13,Jr(t,{idToken:o.credential,phoneEnrollmentInfo:{phoneNumber:s.phoneNumber,recaptchaToken:a}});case 13:return u=e.sent,e.abrupt("return",u.phoneSessionInfo.sessionInfo);case 17:return q("signin"===o.type,t,"internal-error"),q(c=(null===(i=s.multiFactorHint)||void 0===i?void 0:i.uid)||s.multiFactorUid,t,"missing-multi-factor-info"),e.next=22,Ci(t,{mfaPendingCredential:o.credential,mfaEnrollmentId:c,phoneSignInInfo:{recaptchaToken:a}});case 22:return l=e.sent,e.abrupt("return",l.phoneResponseInfo.sessionInfo);case 24:e.next=31;break;case 26:return e.next=28,Yt(t,{phoneNumber:s.phoneNumber,recaptchaToken:a});case 28:return h=e.sent,p=h.sessionInfo,e.abrupt("return",p);case 31:return e.prev=31,r._reset(),e.finish(31);case 34:case"end":return e.stop()}},e,null,[[3,,31,34]])}))).apply(this,arguments)}function ea(e,t){return ta.apply(this,arguments)}function ta(){return(ta=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,En((0,k.Ku)(t),n);case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}var na=function(){function e(t){(0,h.A)(this,e),this.providerId=e.PROVIDER_ID,this.auth=mt(t)}return(0,p.A)(e,[{key:"verifyPhoneNumber",value:function(e,t){return Zi(this.auth,e,(0,k.Ku)(t))}}],[{key:"credential",value:function(e,t){return tn._fromVerification(e,t)}},{key:"credentialFromResult",value:function(t){var n=t;return e.credentialFromTaggedObject(n)}},{key:"credentialFromError",value:function(t){return e.credentialFromTaggedObject(t.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t)return null;var n=t.phoneNumber,r=t.temporaryProof;return n&&r?tn._fromTokenResponse(n,r):null}}]),e}();function ra(e,t){return t?Ve(t):(q(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}
2na.PROVIDER_ID="phone",na.PHONE_SIGN_IN_METHOD="phone";var ia=function(e){(0,s.A)(n,e);var t=_(n);function n(e){var r;return(0,h.A)(this,n),(r=t.call(this,"custom","custom")).params=e,r}return(0,p.A)(n,[{key:"_getIdTokenResponse",value:function(e){return Wt(e,this._buildIdpRequest())}},{key:"_linkToIdToken",value:function(e,t){return Wt(e,this._buildIdpRequest(t))}},{key:"_getReauthenticationResolver",value:function(e){return Wt(e,this._buildIdpRequest())}},{key:"_buildIdpRequest",value:function(e){var 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}}]),n}(_t);function aa(e){return Cn(e.auth,new ia(e),e.bypassAuthState)}function sa(e){var t=e.auth,n=e.user;return q(n,t,"internal-error"),Sn(n,new ia(e),e.bypassAuthState)}function oa(e){return ua.apply(this,arguments)}function ua(){return(ua=(0,l.A)(m().mark(function e(t){var n,r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.auth,q(r=t.user,n,"internal-error"),e.abrupt("return",En(r,new ia(t),t.bypassAuthState));case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}var ca=function(){function e(t,n,r,i){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];(0,h.A)(this,e),this.auth=t,this.resolver=r,this.user=i,this.bypassAuthState=a,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}var t;return(0,p.A)(e,[{key:"execute",value:function(){var e=this;return new Promise(function(){var t=(0,l.A)(m().mark(function t(n,r){return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.pendingPromise={resolve:n,reject:r},t.prev=1,t.next=4,e.resolver._initialize(e.auth);case 4:return e.eventManager=t.sent,t.next=7,e.onExecution();case 7:e.eventManager.registerConsumer(e),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),e.reject(t.t0);case 13:case"end":return t.stop()}},t,null,[[1,10]])}));return function(e,n){return t.apply(this,arguments)}}())}},{key:"onAuthEvent",value:(t=(0,l.A)(m().mark(function e(t){var n,r,i,a,s,o,u;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.urlResponse,r=t.sessionId,i=t.postBody,a=t.tenantId,s=t.error,o=t.type,!s){e.next=4;break}return this.reject(s),e.abrupt("return");case 4:return u={auth:this.auth,requestUri:n,sessionId:r,tenantId:a||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState},e.prev=5,e.t0=this,e.next=9,this.getIdpTask(o)(u);case 9:e.t1=e.sent,e.t0.resolve.call(e.t0,e.t1),e.next=16;break;case 13:e.prev=13,e.t2=e.catch(5),this.reject(e.t2);case 16:case"end":return e.stop()}},e,this,[[5,13]])})),function(e){return t.apply(this,arguments)})},{key:"onError",value:function(e){this.reject(e)}},{key:"getIdpTask",value:function(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return aa;case"linkViaPopup":case"linkViaRedirect":return oa;case"reauthViaPopup":case"reauthViaRedirect":return sa;default:F(this.auth,"internal-error")}}},{key:"resolve",value:function(e){G(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}},{key:"reject",value:function(e){G(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}},{key:"unregisterAndCleanUp",value:function(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}]),e}(),la=new Y(2e3,1e4);function ha(e,t,n){return pa.apply(this,arguments)}function pa(){return(pa=(0,l.A)(m().mark(function e(t,n,r){var i,a,s;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=mt(t),j(t,n,sn),a=ra(i,r),s=new ka(i,"signInViaPopup",n,a),e.abrupt("return",s.executeNotNull());case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function da(e,t,n){return fa.apply(this,arguments)}function fa(){return(fa=(0,l.A)(m().mark(function e(t,n,r){var i,a,s;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return j((i=(0,k.Ku)(t)).auth,n,sn),a=ra(i.auth,r),s=new ka(i.auth,"reauthViaPopup",n,a,i),e.abrupt("return",s.executeNotNull());case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function va(e,t,n){return ma.apply(this,arguments)}function ma(){return(ma=(0,l.A)(m().mark(function e(t,n,r){var i,a,s;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return j((i=(0,k.Ku)(t)).auth,n,sn),a=ra(i.auth,r),s=new ka(i.auth,"linkViaPopup",n,a,i),e.abrupt("return",s.executeNotNull());case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}var ka=function(e){(0,s.A)(i,e);var t,n,r=_(i);function i(e,t,n,s,o){var u;return(0,h.A)(this,i),(u=r.call(this,e,t,s,o)).provider=n,u.authWindow=null,u.pollId=null,i.currentPopupAction&&i.currentPopupAction.cancel(),i.currentPopupAction=(0,a.A)(u),u}return(0,p.A)(i,[{key:"executeNotNull",value:(n=(0,l.A)(m().mark(function e(){var t;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.execute();case 2:return q(t=e.sent,this.auth,"internal-error"),e.abrupt("return",t);case 5:case"end":return e.stop()}},e,this)})),function(){return n.apply(this,arguments)})},{key:"onExecution",value:(t=(0,l.A)(m().mark(function e(){var t,n=this;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return G(1===this.filter.length,"Popup operations only handle one event"),t=ci(),e.next=4,this.resolver._openPopup(this.auth,this.provider,this.filter[0],t);case 4:this.authWindow=e.sent,this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(function(e){n.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,function(e){e||n.reject(V(n.auth,"web-storage-unsupported"))}),this.pollUserCancellation();case 9:case"end":return e.stop()}},e,this)})),function(){return t.apply(this,arguments)})},{key:"eventId",get:function(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}},{key:"cancel",value:function(){this.reject(V(this.auth,"cancelled-popup-request"))}},{key:"cleanUp",value:function(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,i.currentPopupAction=null}},{key:"pollUserCancellation",value:function(){var e=this;!function t(){var n,r;(null===(r=null===(n=e.authWindow)||void 0===n?void 0:n.window)||void 0===r?void 0:r.closed)?e.pollId=window.setTimeout(function(){e.pollId=null,e.reject(V(e.auth,"popup-closed-by-user"))},8e3):e.pollId=window.setTimeout(t,la.get())}()}}]),i}(ca);ka.currentPopupAction=null;var ga=new Map,ya=function(e){(0,s.A)(o,e);var t,n,r,a=_(o);function o(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,h.A)(this,o),(n=a.call(this,e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r)).eventId=null,n}return(0,p.A)(o,[{key:"execute",value:(r=(0,l.A)(m().mark(function e(){var t,n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=ga.get(this.auth._key())){e.next=21;break}return e.prev=2,e.next=5,Aa(this.resolver,this.auth);case 5:if(!e.sent){e.next=12;break}return e.next=9,(0,i.A)((0,u.A)(o.prototype),"execute",this).call(this);case 9:e.t0=e.sent,e.next=13;break;case 12:e.t0=null;case 13:n=e.t0,t=function(){return Promise.resolve(n)},e.next=20;break;case 17:e.prev=17,e.t1=e.catch(2),t=function(){return Promise.reject(e.t1)};case 20:ga.set(this.auth._key(),t);case 21:return this.bypassAuthState||ga.set(this.auth._key(),function(){return Promise.resolve(null)}),e.abrupt("return",t());case 23:case"end":return e.stop()}},e,this,[[2,17]])})),function(){return r.apply(this,arguments)})},{key:"onAuthEvent",value:(n=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("signInViaRedirect"!==t.type){e.next=4;break}return e.abrupt("return",(0,i.A)((0,u.A)(o.prototype),"onAuthEvent",this).call(this,t));case 4:if("unknown"!==t.type){e.next=7;break}return this.resolve(null),e.abrupt("return");
2case 7:if(!t.eventId){e.next=17;break}return e.next=10,this.auth._redirectUserForId(t.eventId);case 10:if(!(n=e.sent)){e.next=16;break}return this.user=n,e.abrupt("return",(0,i.A)((0,u.A)(o.prototype),"onAuthEvent",this).call(this,t));case 16:this.resolve(null);case 17:case"end":return e.stop()}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"onExecution",value:(t=(0,l.A)(m().mark(function e(){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)})},{key:"cleanUp",value:function(){}}]),o}(ca);function Aa(e,t){return Ia.apply(this,arguments)}function Ia(){return(Ia=(0,l.A)(m().mark(function e(t,n){var r,i,a;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=xa(n),i=Ea(t),e.next=4,i._isAvailable();case 4:if(e.sent){e.next=6;break}return e.abrupt("return",!1);case 6:return e.next=8,i._get(r);case 8:return e.t0=e.sent,a="true"===e.t0,e.next=12,i._remove(r);case 12:return e.abrupt("return",a);case 13:case"end":return e.stop()}},e)}))).apply(this,arguments)}function _a(e,t){return wa.apply(this,arguments)}function wa(){return(wa=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ea(t)._set(xa(n),"true"));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ba(){ga.clear()}function Ta(e,t){ga.set(e._key(),t)}function Ea(e){return Ve(e._redirectPersistence)}function xa(e){return Ke("pendingRedirect",e.config.apiKey,e.name)}function Ra(e,t,n){return function(e,t,n){return Na.apply(this,arguments)}(e,t,n)}function Na(){return(Na=(0,l.A)(m().mark(function e(t,n,r){var i,a;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=mt(t),j(t,n,sn),e.next=4,i._initializationPromise;case 4:return a=ra(i,r),e.next=7,_a(a,i);case 7:return e.abrupt("return",a._openRedirect(i,n,"signInViaRedirect"));case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Sa(e,t,n){return function(e,t,n){return Oa.apply(this,arguments)}(e,t,n)}function Oa(){return(Oa=(0,l.A)(m().mark(function e(t,n,r){var i,a,s;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return j((i=(0,k.Ku)(t)).auth,n,sn),e.next=4,i.auth._initializationPromise;case 4:return a=ra(i.auth,r),e.next=7,_a(a,i.auth);case 7:return e.next=9,Fa(i);case 9:return s=e.sent,e.abrupt("return",a._openRedirect(i.auth,n,"reauthViaRedirect",s));case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ca(e,t,n){return function(e,t,n){return Pa.apply(this,arguments)}(e,t,n)}function Pa(){return(Pa=(0,l.A)(m().mark(function e(t,n,r){var i,a,s;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return j((i=(0,k.Ku)(t)).auth,n,sn),e.next=4,i.auth._initializationPromise;case 4:return a=ra(i.auth,r),e.next=7,Rn(!1,i,n.providerId);case 7:return e.next=9,_a(a,i.auth);case 9:return e.next=11,Fa(i);case 11:return s=e.sent,e.abrupt("return",a._openRedirect(i.auth,n,"linkViaRedirect",s));case 13:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Da(e,t){return La.apply(this,arguments)}function La(){return(La=(0,l.A)(m().mark(function e(t,n){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mt(t)._initializationPromise;case 2:return e.abrupt("return",Ma(t,n,!1));case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ma(e,t){return Ua.apply(this,arguments)}function Ua(){return Ua=(0,l.A)(m().mark(function e(t,n){var r,i,a,s,o,u=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>2&&void 0!==u[2]&&u[2],i=mt(t),a=ra(i,n),s=new ya(i,a,r),e.next=6,s.execute();case 6:if(!(o=e.sent)||r){e.next=13;break}return delete o.user._redirectEventId,e.next=11,i._persistUserIfCurrent(o.user);case 11:return e.next=13,i._setRedirectUser(null,n);case 13:return e.abrupt("return",o);case 14:case"end":return e.stop()}},e)})),Ua.apply(this,arguments)}function Fa(e){return Va.apply(this,arguments)}function Va(){return(Va=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=ci("".concat(t.uid,":::")),t._redirectEventId=n,e.next=4,t.auth._setRedirectUser(t);case 4:return e.next=6,t.auth._persistUserIfCurrent(t);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Ha=function(){function e(t){(0,h.A)(this,e),this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=
2Date.now()}return(0,p.A)(e,[{key:"registerConsumer",value:function(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}},{key:"unregisterConsumer",value:function(e){this.consumers.delete(e)}},{key:"onEvent",value:function(e){var t=this;if(this.hasEventBeenHandled(e))return!1;var n=!1;return this.consumers.forEach(function(r){t.isEventForConsumer(e,r)&&(n=!0,t.sendToConsumer(e,r),t.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Ka(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}},{key:"sendToConsumer",value:function(e,t){var n;if(e.error&&!Ka(e)){var r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(V(this.auth,r))}else t.onAuthEvent(e)}},{key:"isEventForConsumer",value:function(e,t){var n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}},{key:"hasEventBeenHandled",value:function(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(ja(e))}},{key:"saveEventToCache",value:function(e){this.cachedEventUids.add(ja(e)),this.lastProcessedEventTime=Date.now()}}]),e}();function ja(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(function(e){return e}).join("-")}function Ka(e){var t=e.type,n=e.error;return"unknown"===t&&(null==n?void 0:n.code)==="auth/".concat("no-auth-event")}function qa(e){return za.apply(this,arguments)}function za(){return za=(0,l.A)(m().mark(function e(t){var n,r=arguments;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},e.abrupt("return",te(t,"GET","/v1/projects",n));case 2:case"end":return e.stop()}},e)})),za.apply(this,arguments)}var Ga=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Wa=/^https?/;function Ba(){return(Ba=(0,l.A)(m().mark(function e(t){var n,r,i,a,s;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.config.emulator){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,qa(t);case 4:n=e.sent,r=n.authorizedDomains,i=w(r),e.prev=7,i.s();case 9:if((a=i.n()).done){e.next=20;break}if(s=a.value,e.prev=11,!Ja(s)){e.next=14;break}return e.abrupt("return");case 14:e.next=18;break;case 16:e.prev=16,e.t0=e.catch(11);case 18:e.next=9;break;case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(7),i.e(e.t1);case 25:return e.prev=25,i.f(),e.finish(25);case 28:F(t,"unauthorized-domain");case 29:case"end":return e.stop()}},e,null,[[7,22,25,28],[11,16]])}))).apply(this,arguments)}function Ja(e){var t=W(),n=new URL(t),r=n.protocol,i=n.hostname;if(e.startsWith("chrome-extension://")){var a=new URL(e);return""===a.hostname&&""===i?"chrome-extension:"===r&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===r&&a.hostname===i}if(!Wa.test(r))return!1;if(Ga.test(e))return i===e;var s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(i)}var Ya=new Y(3e4,6e4);function Qa(){var e=hi().___jsl;if(null==e?void 0:e.H)for(var t=0,n=Object.keys(e.H);t<n.length;t++){var r=n[t];if(e.H[r].r=e.H[r].r||[],e.H[r].L=e.H[r].L||[],e.H[r].r=(0,d.A)(e.H[r].L),e.CP)for(var i=0;i<e.CP.length;i++)e.CP[i]=null}}var Xa=null;function Za(e){return Xa=Xa||function(e){return new Promise(function(t,n){var r,i,a;function s(){Qa(),gapi.load("gapi.iframes",{callback:function(){t(gapi.iframes.getContext())},ontimeout:function(){Qa(),n(V(e,"network-request-failed"))},timeout:Ya.get()})}if(null===(i=null===(r=hi().gapi)||void 0===r?void 0:r.iframes)||void 0===i?void 0:i.Iframe)t(gapi.iframes.getContext());else{if(!(null===(a=hi().gapi)||void 0===a?void 0:a.load)){var o=lt("iframefcb");return hi()[o]=function(){gapi.load?s():n(V(e,"network-request-failed"))},ct("https://apis.google.com/js/api.js?onload=".concat(o)).catch(function(e){return n(e)})}s()}}).catch(function(e){throw Xa=null,e})}(e),Xa}var $a=new Y(5e3,15e3),es={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},ts=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function ns(e){var t=e.config;q(t.authDomain,e,"auth-domain-config-required");var n=t.emulator?Q(t,"emulator/auth/iframe"):"https://".concat(e.config.authDomain,"/").concat("__/auth/iframe"),r={apiKey:t.apiKey,appName:e.n
2ame,v:g.MF},i=ts.get(e.config.apiHost);i&&(r.eid=i);var a=e._getFrameworks();return a.length&&(r.fw=a.join(",")),"".concat(n,"?").concat((0,k.Am)(r).slice(1))}function rs(e){return is.apply(this,arguments)}function is(){return is=(0,l.A)(m().mark(function e(t){var n,r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Za(t);case 2:return n=e.sent,q(r=hi().gapi,t,"internal-error"),e.abrupt("return",n.open({where:document.body,url:ns(t),messageHandlersFilter:r.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:es,dontclear:!0},function(e){return new Promise(function(){var n=(0,l.A)(m().mark(function n(r,i){var a,s,o;return m().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return o=function(){hi().clearTimeout(s),r(e)},n.next=3,e.restyle({setHideOnLeave:!1});case 3:a=V(t,"network-request-failed"),s=hi().setTimeout(function(){i(a)},$a.get()),e.ping(o).then(o,function(){i(a)});case 6:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())}));case 6:case"end":return e.stop()}},e)})),is.apply(this,arguments)}var as={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},ss=function(){function e(t){(0,h.A)(this,e),this.window=t,this.associatedEvent=null}return(0,p.A)(e,[{key:"close",value:function(){if(this.window)try{this.window.close()}catch(e){}}}]),e}();function os(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:500,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:600,a=Math.max((window.screen.availHeight-i)/2,0).toString(),s=Math.max((window.screen.availWidth-r)/2,0).toString(),o="",u=Object.assign(Object.assign({},as),{width:r.toString(),height:i.toString(),top:a,left:s}),l=(0,k.ZQ)().toLowerCase();n&&(o=Be(l)?"_blank":n),Ge(l)&&(t=t||"http://localhost",u.scrollbars="yes");var h=Object.entries(u).reduce(function(e,t){var n=(0,c.A)(t,2),r=n[0],i=n[1];return"".concat(e).concat(r,"=").concat(i,",")},"");if(function(){var e;return Ze(arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,k.ZQ)())&&!!(null===(e=window.navigator)||void 0===e?void 0:e.standalone)}(l)&&"_self"!==o)return function(e,t){var n=document.createElement("a");n.href=e,n.target=t;var r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}(t||"",o),new ss(null);var p=window.open(t||"",o,h);q(p,e,"popup-blocked");try{p.focus()}catch(d){}return new ss(p)}var us=encodeURIComponent("fac");function cs(e,t,n,r,i,a){return ls.apply(this,arguments)}function ls(){return(ls=(0,l.A)(m().mark(function e(t,n,r,i,a,s){var o,u,l,h,p,d,f,v,y,A,I,_,w;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(q(t.config.authDomain,t,"auth-domain-config-required"),q(t.config.apiKey,t,"invalid-api-key"),o={apiKey:t.config.apiKey,appName:t.name,authType:r,redirectUrl:i,v:g.MF,eventId:a},n instanceof sn)for(n.setDefaultLanguage(t.languageCode),o.providerId=n.providerId||"",(0,k.Im)(n.getCustomParameters())||(o.customParameters=JSON.stringify(n.getCustomParameters())),u=0,l=Object.entries(s||{});u<l.length;u++)h=(0,c.A)(l[u],2),p=h[0],d=h[1],o[p]=d;for(n instanceof on&&(f=n.getScopes().filter(function(e){return""!==e})).length>0&&(o.scopes=f.join(",")),t.tenantId&&(o.tid=t.tenantId),v=o,y=0,A=Object.keys(v);y<A.length;y++)I=A[y],void 0===v[I]&&delete v[I];return e.next=10,t._getAppCheckToken();case 10:return _=e.sent,w=_?"#".concat(us,"=").concat(encodeURIComponent(_)):"",e.abrupt("return","".concat(hs(t),"?").concat((0,k.Am)(v).slice(1)).concat(w));case 13:case"end":return e.stop()}},e)}))).apply(this,arguments)}function hs(e){var t=e.config;return t.emulator?Q(t,"emulator/auth/handler"):"https://".concat(t.authDomain,"/").concat("__/auth/handler")}var ps="webStorageSupport",ds=function(){function e(){(0,h.A)(this,e),this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=si,this._completeRedirectFn=Ma,this._overrideRedirectResult=Ta}var t,n,r;return(0,p.A)(e,[{key:"_openPopup",value:(r=(0,l.A)(m().mark(function e(t,n,r,i){var a,s;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return G(null===(a=this.eventManagers[t._key()])||void 0===a?void 0:a.manager,"_initialize() not called before _openPopup()"),e.next=3,cs(t,n,r,W(),i);case 3:return s=e.sent,e.abrupt("return",os(t,s,ci()));case 5:case"end":return e.stop()}},e,this)})),function(e,t,n,i){return r.apply(this,arguments)})},{key:"_openRedirect",value:(n=(0,l.A)(m().mark(function e(t,n,r,i){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._originValidation(t);case 2:return e.next=4,cs(t,n,r,W(),i);case 4:return pi(e.sent),e.abrupt("return",new Promise(function(){}));case 7:case"end":return e.stop()}},e,this)})),function(e,t,r,i){return n.apply(this,arguments)})},{key:"_initialize",value:function(e){var t=this,n=e._key();if(this.eventManagers[n]){var r=this.eventManagers[n],i=r.manager,a=r.promise;return i?Promise.resolve(i):(G(a,"If manager is not set, promise should be"),a)}var s=this.initAndGetManager(e);return this.eventManagers[n]={promise:s},s.catch(function(){delete t.eventManagers[n]}),s}},{key:"initAndGetManager",value:(t=(0,l.A)(m().mark(function e(t){var n,r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,rs(t);case 2:return n=e.sent,r=new Ha(t),n.register("authEvent",function(e){return q(null==e?void 0:e.authEvent,t,"invali
2d-auth-event"),{status:r.onEvent(e.authEvent)?"ACK":"ERROR"}},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:r},this.iframes[t._key()]=n,e.abrupt("return",r);case 8:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"_isIframeWebStorageSupported",value:function(e,t){this.iframes[e._key()].send(ps,{type:ps},function(n){var r,i=null===(r=null==n?void 0:n[0])||void 0===r?void 0:r[ps];void 0!==i&&t(!!i),F(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}},{key:"_originValidation",value:function(e){var t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=function(e){return Ba.apply(this,arguments)}(e)),this.originValidationPromises[t]}},{key:"_shouldInitProactively",get:function(){return et()||We()||Ze()}}]),e}(),fs=ds,vs=function(){function e(t){(0,h.A)(this,e),this.factorId=t}return(0,p.A)(e,[{key:"_process",value:function(e,t,n){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,n);case"signin":return this._finalizeSignIn(e,t.credential);default:return z("unexpected MultiFactorSessionType")}}}]),e}(),ms=function(e){(0,s.A)(n,e);var t=_(n);function n(e){var r;return(0,h.A)(this,n),(r=t.call(this,"phone")).credential=e,r}return(0,p.A)(n,[{key:"_finalizeEnroll",value:function(e,t,n){return function(e,t){return te(e,"POST","/v2/accounts/mfaEnrollment:finalize",ee(e,t))}(e,{idToken:t,displayName:n,phoneVerificationInfo:this.credential._makeVerificationRequest()})}},{key:"_finalizeSignIn",value:function(e,t){return function(e,t){return te(e,"POST","/v2/accounts/mfaSignIn:finalize",ee(e,t))}(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}}],[{key:"_fromCredential",value:function(e){return new n(e)}}]),n}(vs),ks=function(){function e(){(0,h.A)(this,e)}return(0,p.A)(e,null,[{key:"assertion",value:function(e){return ms._fromCredential(e)}}]),e}();ks.FACTOR_ID="phone";var gs=function(){function e(){(0,h.A)(this,e)}var t;return(0,p.A)(e,null,[{key:"assertionForEnrollment",value:function(e,t){return ys._fromSecret(e,t)}},{key:"assertionForSignIn",value:function(e,t){return ys._fromEnrollmentId(e,t)}},{key:"generateSecret",value:(t=(0,l.A)(m().mark(function e(t){var n,r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return q(void 0!==(n=t).auth,"internal-error"),e.next=4,Yr(n.auth,{idToken:n.credential,totpEnrollmentInfo:{}});case 4:return r=e.sent,e.abrupt("return",As._fromStartTotpMfaEnrollmentResponse(r,n.auth));case 6:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)})}]),e}();gs.FACTOR_ID="totp";var ys=function(e){(0,s.A)(i,e);var t,n,r=_(i);function i(e,t,n){var a;return(0,h.A)(this,i),(a=r.call(this,"totp")).otp=e,a.enrollmentId=t,a.secret=n,a}return(0,p.A)(i,[{key:"_finalizeEnroll",value:(n=(0,l.A)(m().mark(function e(t,n,r){return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return q(void 0!==this.secret,t,"argument-error"),e.abrupt("return",Qr(t,{idToken:n,displayName:r,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)}));case 2:case"end":return e.stop()}},e,this)})),function(e,t,r){return n.apply(this,arguments)})},{key:"_finalizeSignIn",value:(t=(0,l.A)(m().mark(function e(t,n){var r;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return q(void 0!==this.enrollmentId&&void 0!==this.otp,t,"argument-error"),r={verificationCode:this.otp},e.abrupt("return",Pi(t,{mfaPendingCredential:n,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:r}));case 3:case"end":return e.stop()}},e,this)})),function(e,n){return t.apply(this,arguments)})}],[{key:"_fromSecret",value:function(e,t){return new i(t,void 0,e)}},{key:"_fromEnrollmentId",value:function(e,t){return new i(t,e)}}]),i}(vs),As=function(){function e(t,n,r,i,a,s,o){(0,h.A)(this,e),this.sessionInfo=s,this.auth=o,this.secretKey=t,this.hashingAlgorithm=n,this.codeLength=r,this.codeIntervalSeconds=i,this.enrollmentCompletionDeadline=a}return(0,p.A)(e,[{key:"_makeTotpVerificationInfo",value:function(e){return{sessionInfo:this.sessionInfo,verificationCode:e}}},{key:"generateQrCodeUrl",value:function(e,t){var n,r=!1;return(Is(e)||Is(t))&&(r=!0),r&&(Is(e)&&(e=(null===(n=this.auth.currentUser)||void 0===n?void 0:n.email)||"unknownuser"),Is(t)&&(t=this.auth.name)),"otpauth://totp/".concat(t,":").concat(e,"?secret=").concat(this.secretKey,"&issuer=").concat(t,"&algorithm=").concat(this.hashingAlgorithm,"&digits=").concat(this.codeLength)}}],[{key:"_fromStartTotpMfaEnrollmentResponse",value:function(t,n){return new e(t.totpSessionInfo.sharedSecretKey,t.totpSessionInfo.hashingAlgorithm,t.totpSessionInfo.verificationCodeLength,t.totpSessionInfo.peri
2odSec,new Date(t.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),t.totpSessionInfo.sessionInfo,n)}}]),e}();function Is(e){return void 0===e||0===(null==e?void 0:e.length)}var _s="@firebase/auth",ws="0.23.2",bs=function(){function e(t){(0,h.A)(this,e),this.auth=t,this.internalListeners=new Map}var t;return(0,p.A)(e,[{key:"getUid",value:function(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}},{key:"getToken",value:(t=(0,l.A)(m().mark(function e(t){var n;return m().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertAuthConfigured(),e.next=3,this.auth._initializationPromise;case 3:if(this.auth.currentUser){e.next=5;break}return e.abrupt("return",null);case 5:return e.next=7,this.auth.currentUser.getIdToken(t);case 7:return n=e.sent,e.abrupt("return",{accessToken:n});case 9:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"addAuthTokenListener",value:function(e){if(this.assertAuthConfigured(),!this.internalListeners.has(e)){var t=this.auth.onIdTokenChanged(function(t){e((null==t?void 0:t.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}}},{key:"removeAuthTokenListener",value:function(e){this.assertAuthConfigured();var t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}},{key:"assertAuthConfigured",value:function(){q(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}},{key:"updateProactiveRefresh",value:function(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}]),e}();var Ts,Es=(0,k.XA)("authIdTokenMaxAge")||300,xs=null,Rs=function(e){return function(){var t=(0,l.A)(m().mark(function t(n){var r,i,a;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=n,!t.t0){t.next=5;break}return t.next=4,n.getIdTokenResult();case 4:t.t0=t.sent;case 5:if(r=t.t0,!((i=r&&((new Date).getTime()-Date.parse(r.issuedAtTime))/1e3)&&i>Es)){t.next=9;break}return t.abrupt("return");case 9:if(a=null==r?void 0:r.token,xs!==a){t.next=12;break}return t.abrupt("return");case 12:return xs=a,t.next=15,fetch(e,{method:a?"POST":"DELETE",headers:a?{Authorization:"Bearer ".concat(a)}:{}});case 15:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()};function Ns(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,g.Sx)(),t=(0,g.j6)(e,"auth");if(t.isInitialized())return t.getImmediate();var n=gt(e,{popupRedirectResolver:fs,persistence:[Oi,ii,si]}),r=(0,k.XA)("authTokenSyncURL");if(r){var i=Rs(r);Fr(n,i,function(){return i(n.currentUser)}),Ur(n,function(e){return i(e)})}var a=(0,k.Tj)("auth");return a&&yt(n,"http://".concat(a)),n}Ts="Browser",(0,g.om)(new I.uA("auth",function(e,t){var n=t.options,r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),a=e.getProvider("app-check-internal"),s=r.options,o=s.apiKey,u=s.authDomain;q(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});var c={apiKey:o,authDomain:u,clientPlatform:Ts,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:tt(Ts)},l=new vt(r,i,a,c);return function(e,t){var n=(null==t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Ve);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null==t?void 0:t.popupRedirectResolver)}(l,n),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(function(e,t,n){e.getProvider("auth-internal").initialize()})),(0,g.om)(new I.uA("auth-internal",function(e){return function(e){return new bs(e)}(mt(e.getProvider("auth").getImmediate()))},"PRIVATE").setInstantiationMode("EXPLICIT")),(0,g.KO)(_s,ws,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(Ts)),(0,g.KO)(_s,ws,"esm2017")}}]);
3//# sourceMappingURL=cccc6244-61229be50e3da4d7ea27.js.map

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.