text: 
  import { InjectionToken, Injectable, Inject, Optional, PLATFORM_ID, NgZone, ɵɵdefineInjectable, ɵɵinject, NgModule } from '@angular/core';
  import { Subject, of, Observable, from, merge } from 'rxjs';
  import { observeOn, switchMap, map, shareReplay, first, switchMapTo, subscribeOn, filter } from 'rxjs/operators';
  import { ɵAngularFireSchedulers, ɵkeepUnstableUntilFirstFactory, ɵfirebaseAppFactory, ɵfetchInstance, ɵlazySDKProxy, FIREBASE_OPTIONS, FIREBASE_APP_NAME, ɵapplyMixins } from '@angular/fire';
  import { isPlatformServer } from '@angular/common';
  
  /**
   * @fileoverview added by tsickle
   * Generated from: base.ts
   * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  /** @type {?} */
  const proxyPolyfillCompat = {
      app: null,
      applyActionCode: null,
      checkActionCode: null,
      confirmPasswordReset: null,
      createUserWithEmailAndPassword: null,
      currentUser: null,
      fetchSignInMethodsForEmail: null,
      isSignInWithEmailLink: null,
      getRedirectResult: null,
      languageCode: null,
      settings: null,
      onAuthStateChanged: null,
      onIdTokenChanged: null,
      sendSignInLinkToEmail: null,
      sendPasswordResetEmail: null,
      setPersistence: null,
      signInAndRetrieveDataWithCredential: null,
      signInAnonymously: null,
      signInWithCredential: null,
      signInWithCustomToken: null,
      signInWithEmailAndPassword: null,
      signInWithPhoneNumber: null,
      signInWithEmailLink: null,
      signInWithPopup: null,
      signInWithRedirect: null,
      signOut: null,
      tenantId: null,
      updateCurrentUser: null,
      useDeviceLanguage: null,
      useEmulator: null,
      verifyPasswordResetCode: null,
  };
  
  /**
   * @fileoverview added by tsickle
   * Generated from: auth.ts
   * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  // WARNING: interface has both a type and a value, skipping emit
  /** @type {?} */
  const USE_EMULATOR = new InjectionToken('angularfire2.auth.use-emulator');
  /** @type {?} */
  const SETTINGS = new InjectionToken('angularfire2.auth.settings');
  /** @type {?} */
  const TENANT_ID = new InjectionToken('angularfire2.auth.tenant-id');
  /** @type {?} */
  const LANGUAGE_CODE = new InjectionToken('angularfire2.auth.langugage-code');
  /** @type {?} */
  const USE_DEVICE_LANGUAGE = new InjectionToken('angularfire2.auth.use-device-language');
  /** @type {?} */
  const PERSISTENCE = new InjectionToken('angularfire.auth.persistence');
  class AngularFireAuth {
      /**
       * @param {?} options
       * @param {?} nameOrConfig
       * @param {?} platformId
       * @param {?} zone
       * @param {?} _useEmulator
       * @param {?} _settings
       * @param {?} tenantId
       * @param {?} languageCode
       * @param {?} useDeviceLanguage
       * @param {?} persistence
       */
      constructor(options, nameOrConfig, 
      // tslint:disable-next-line:ban-types
      platformId, zone, _useEmulator, // can't use the tuple here
      _settings, // can't use firebase.auth.AuthSettings here
      tenantId, languageCode, useDeviceLanguage, persistence) {
          /** @type {?} */
          const schedulers = new ɵAngularFireSchedulers(zone);
          /** @type {?} */
          const keepUnstableUntilFirst = ɵkeepUnstableUntilFirstFactory(schedulers);
          /** @type {?} */
          const logins = new Subject();
          /** @type {?} */
          const auth = of(undefined).pipe(observeOn(schedulers.outsideAngular), switchMap((/**
           * @return {?}
           */
          () => zone.runOutsideAngular((/**
           * @return {?}
           */
          () => import('firebase/auth'))))), map((/**
           * @return {?}
           */
          () => ɵfirebaseAppFactory(options, zone, nameOrConfig))), map((/**
           * @param {?} app
           * @return {?}
           */
          app => zone.runOutsideAngular((/**
           * @return {?}
           */
          () => {
              /** @type {?} */
              const useEmulator = _useEmulator;
              /** @type {?} */
              const settings = _settings;
              return ɵfetchInstance(`${app.name}.auth`, 'AngularFireAuth', app, (/**
               * @return {?}
               */
              () => {
                  /** @type {?} */
                  const auth = zone.runOutsideAngular((/**
                   * @return {?}
                   */
                  () => app.auth()));
                  if (useEmulator) {
                      // Firebase Auth doesn't conform to the useEmulator convention, let's smooth that over
                      auth.useEmulator(`http://${useEmulator.join(':')}`);
                  }
                  if (tenantId) {
                      auth.tenantId = tenantId;
                  }
                  auth.languageCode = languageCode;
                  if (useDeviceLanguage) {
                      auth.useDeviceLanguage();
                  }
                  if (settings) {
                      auth.settings = settings;
                  }
                  if (persistence) {
                      auth.setPersistence(persistence);
                  }
                  return auth;
              }), [useEmulator, tenantId, languageCode, useDeviceLanguage, settings, persistence]);
          })))), shareReplay({ bufferSize: 1, refCount: false }));
          if (isPlatformServer(platformId)) {
              this.authState = this.user = this.idToken = this.idTokenResult = this.credential = of(null);
          }
          else {
              // HACK, as we're exporting auth.Auth, rather than auth, developers importing firebase.auth
              //       (e.g, `import { auth } from 'firebase/app'`) are getting an undefined auth object unexpectedly
              //       as we're completely lazy. Let's eagerly load the Auth SDK here.
              //       There could potentially be race conditions still... but this greatly decreases the odds while
              //       we reevaluate the API.
              /** @type {?} */
              const _ = auth.pipe(first()).subscribe();
              /** @type {?} */
              const redirectResult = auth.pipe(switchMap((/**
               * @param {?} auth
               * @return {?}
               */
              auth => auth.getRedirectResult().then((/**
               * @param {?} it
               * @return {?}
               */
              it => it), (/**
               * @return {?}
               */
              () => null)))), keepUnstableUntilFirst, shareReplay({ bufferSize: 1, refCount: false }));
              /** @type {?} */
              const fromCallback = (/**
               * @template T
               * @param {?} cb
               * @return {?}
               */
              (cb) => new Observable((/**
               * @param {?} subscriber
               * @return {?}
               */
              subscriber => ({ unsubscribe: zone.runOutsideAngular((/**
                   * @return {?}
                   */
                  () => cb(subscriber))) }))));
              /** @type {?} */
              const authStateChanged = auth.pipe(switchMap((/**
               * @param {?} auth
               * @return {?}
               */
              auth => fromCallback(auth.onAuthStateChanged.bind(auth)))));
              /** @type {?} */
              const idTokenChanged = auth.pipe(switchMap((/**
               * @param {?} auth
               * @return {?}
               */
              auth => fromCallback(auth.onIdTokenChanged.bind(auth)))));
              this.authState = redirectResult.pipe(switchMapTo(authStateChanged), subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular));
              this.user = redirectResult.pipe(switchMapTo(idTokenChanged), subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular));
              this.idToken = this.user.pipe(switchMap((/**
               * @param {?} user
               * @return {?}
               */
              user => user ? from(user.getIdToken()) : of(null))));
              this.idTokenResult = this.user.pipe(switchMap((/**
               * @param {?} user
               * @return {?}
               */
              user => user ? from(user.getIdTokenResult()) : of(null))));
              this.credential = merge(redirectResult, logins, 
              // pipe in null authState to make credential zipable, just a weird devexp if
              // authState and user go null to still have a credential
              this.authState.pipe(filter((/**
               * @param {?} it
               * @return {?}
               */
              it => !it)))).pipe(
              // handle the { user: { } } when a user is already logged in, rather have null
              // TODO handle the type corcersion better
              map((/**
               * @param {?} credential
               * @return {?}
               */
              credential => (credential === null || credential === void 0 ? void 0 : credential.user) ? (/** @type {?} */ (credential)) : null)), subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular));
          }
          return ɵlazySDKProxy(this, auth, zone, { spy: {
                  apply: (/**
                   * @param {?} name
                   * @param {?} _
                   * @param {?} val
                   * @return {?}
                   */
                  (name, _, val) => {
                      // If they call a signIn or createUser function listen into the promise
                      // this will give us the user credential, push onto the logins Subject
                      // to be consumed in .credential
                      if (name.startsWith('signIn') || name.startsWith('createUser')) {
                          // TODO fix the types, the trouble is UserCredential has everything optional
                          val.then((/**
                           * @param {?} user
                           * @return {?}
                           */
                          (user) => logins.next((/** @type {?} */ (user)))));
                      }
                  })
              } });
      }
  }
  AngularFireAuth.decorators = [
      { type: Injectable, args: [{
                  providedIn: 'any'
              },] }
  ];
  /** @nocollapse */
  AngularFireAuth.ctorParameters = () => [
      { type: undefined, decorators: [{ type: Inject, args: [FIREBASE_OPTIONS,] }] },
      { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [FIREBASE_APP_NAME,] }] },
      { type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] },
      { type: NgZone },
      { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [USE_EMULATOR,] }] },
      { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [SETTINGS,] }] },
      { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TENANT_ID,] }] },
      { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [LANGUAGE_CODE,] }] },
      { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [USE_DEVICE_LANGUAGE,] }] },
      { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [PERSISTENCE,] }] }
  ];
  /** @nocollapse */ AngularFireAuth.ɵprov = ɵɵdefineInjectable({ factory: function AngularFireAuth_Factory() { return new AngularFireAuth(ɵɵinject(FIREBASE_OPTIONS), ɵɵinject(FIREBASE_APP_NAME, 8), ɵɵinject(PLATFORM_ID), ɵɵinject(NgZone), ɵɵinject(USE_EMULATOR, 8), ɵɵinject(SETTINGS, 8), ɵɵinject(TENANT_ID, 8), ɵɵinject(LANGUAGE_CODE, 8), ɵɵinject(USE_DEVICE_LANGUAGE, 8), ɵɵinject(PERSISTENCE, 8)); }, token: AngularFireAuth, providedIn: "any" });
  if (false) {
      /**
       * Observable of authentication state; as of Firebase 4.0 this is only triggered via sign-in/out
       * @type {?}
       */
      AngularFireAuth.prototype.authState;
      /**
       * Observable of the currently signed-in user's JWT token used to identify the user to a Firebase service (or null).
       * @type {?}
       */
      AngularFireAuth.prototype.idToken;
      /**
       * Observable of the currently signed-in user (or null).
       * @type {?}
       */
      AngularFireAuth.prototype.user;
      /**
       * Observable of the currently signed-in user's IdTokenResult object which contains the ID token JWT string and other
       * helper properties for getting different data associated with the token as well as all the decoded payload claims
       * (or null).
       * @type {?}
       */
      AngularFireAuth.prototype.idTokenResult;
      /**
       * Observable of the currently signed-in user's credential, or null
       * @type {?}
       */
      AngularFireAuth.prototype.credential;
  }
  ɵapplyMixins(AngularFireAuth, [proxyPolyfillCompat]);
  
  /**
   * @fileoverview added by tsickle
   * Generated from: auth.module.ts
   * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  class AngularFireAuthModule {
  }
  AngularFireAuthModule.decorators = [
      { type: NgModule, args: [{
                  providers: [AngularFireAuth]
              },] }
  ];
  
  /**
   * @fileoverview added by tsickle
   * Generated from: public_api.ts
   * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  
  /**
   * @fileoverview added by tsickle
   * Generated from: angular-fire-auth.ts
   * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  
  export { AngularFireAuth, AngularFireAuthModule, LANGUAGE_CODE, PERSISTENCE, SETTINGS, TENANT_ID, USE_DEVICE_LANGUAGE, USE_EMULATOR };
  //# sourceMappingURL=angular-fire-auth.js.map
  