text: import { Component, Injectable, Input, NgModule, ViewEncapsulation } from '@angular/core';
  
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  this file except in compliance with the License. You may obtain a copy of the
  License at http://www.apache.org/licenses/LICENSE-2.0
  
  THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  MERCHANTABLITY OR NON-INFRINGEMENT.
  
  See the Apache Version 2.0 License for specific language governing permissions
  and limitations under the License.
  ***************************************************************************** */
  /* global Reflect, Promise */
  
  
  
  
  
  
  
  function __decorate(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
      else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
      return c > 3 && r && Object.defineProperty(target, key, r), r;
  }
  
  
  
  function __metadata(metadataKey, metadataValue) {
      if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  }
  
  var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  
  
  
  
  
  function createCommonjsModule(fn, module) {
  	return module = { exports: {} }, fn(module, module.exports), module.exports;
  }
  
  // CommonJS / Node have global context exposed as "global" variable.
  // We don't want to include the whole node.d.ts this this compilation unit so we'll just fake
  // the global "global" var for now.
  var __window = typeof window !== 'undefined' && window;
  var __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
      self instanceof WorkerGlobalScope && self;
  var __global = typeof commonjsGlobal !== 'undefined' && commonjsGlobal;
  var _root = __window || __global || __self;
  var root_1 = _root;
  // Workaround Closure Compiler restriction: The body of a goog.module cannot use throw.
  // This is needed when used with angular/tsickle which inserts a goog.module statement.
  // Wrap in IIFE
  (function () {
      if (!_root) {
          throw new Error('RxJS could not find any global context (window, self, global)');
      }
  })();
  
  
  var root = {
  	root: root_1
  };
  
  function isFunction(x) {
      return typeof x === 'function';
  }
  var isFunction_2 = isFunction;
  
  
  var isFunction_1 = {
  	isFunction: isFunction_2
  };
  
  var isArray_1 = Array.isArray || (function (x) { return x && typeof x.length === 'number'; });
  
  
  var isArray = {
  	isArray: isArray_1
  };
  
  function isObject(x) {
      return x != null && typeof x === 'object';
  }
  var isObject_2 = isObject;
  
  
  var isObject_1 = {
  	isObject: isObject_2
  };
  
  // typeof any so that it we don't have to cast when comparing a result to the error object
  var errorObject_1 = { e: {} };
  
  
  var errorObject = {
  	errorObject: errorObject_1
  };
  
  var tryCatchTarget;
  function tryCatcher() {
      try {
          return tryCatchTarget.apply(this, arguments);
      }
      catch (e) {
          errorObject.errorObject.e = e;
          return errorObject.errorObject;
      }
  }
  function tryCatch(fn) {
      tryCatchTarget = fn;
      return tryCatcher;
  }
  var tryCatch_2 = tryCatch;
  
  
  
  var tryCatch_1 = {
  	tryCatch: tryCatch_2
  };
  
  var __extends$2 = (commonjsGlobal && commonjsGlobal.__extends) || function (d, b) {
      for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
      function __() { this.constructor = d; }
      d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
  /**
   * An error thrown when one or more errors have occurred during the
   * `unsubscribe` of a {@link Subscription}.
   */
  var UnsubscriptionError = (function (_super) {
      __extends$2(UnsubscriptionError, _super);
      function UnsubscriptionError(errors) {
          _super.call(this);
          this.errors = errors;
          var err = Error.call(this, errors ?
              errors.length + " errors occurred during unsubscription:\n  " + errors.map(function (err, i) { return ((i + 1) + ") " + err.toString()); }).join('\n  ') : '');
          this.name = err.name = 'UnsubscriptionError';
          this.stack = err.stack;
          this.message = err.message;
      }
      return UnsubscriptionError;
  }(Error));
  var UnsubscriptionError_2 = UnsubscriptionError;
  
  
  var UnsubscriptionError_1 = {
  	UnsubscriptionError: UnsubscriptionError_2
  };
  
  /**
   * Represents a disposable resource, such as the execution of an Observable. A
   * Subscription has one important method, `unsubscribe`, that takes no argument
   * and just disposes the resource held by the subscription.
   *
   * Additionally, subscriptions may be grouped together through the `add()`
   * method, which will attach a child Subscription to the current Subscription.
   * When a Subscription is unsubscribed, all its children (and its grandchildren)
   * will be unsubscribed as well.
   *
   * @class Subscription
   */
  var Subscription = (function () {
      /**
       * @param {function(): void} [unsubscribe] A function describing how to
       * perform the disposal of resources when the `unsubscribe` method is called.
       */
      function Subscription(unsubscribe) {
          /**
           * A flag to indicate whether this Subscription has already been unsubscribed.
           * @type {boolean}
           */
          this.closed = false;
          this._parent = null;
          this._parents = null;
          this._subscriptions = null;
          if (unsubscribe) {
              this._unsubscribe = unsubscribe;
          }
      }
      /**
       * Disposes the resources held by the subscription. May, for instance, cancel
       * an ongoing Observable execution or cancel any other type of work that
       * started when the Subscription was created.
       * @return {void}
       */
      Subscription.prototype.unsubscribe = function () {
          var hasErrors = false;
          var errors;
          if (this.closed) {
              return;
          }
          var _a = this, _parent = _a._parent, _parents = _a._parents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
          this.closed = true;
          this._parent = null;
          this._parents = null;
          // null out _subscriptions first so any child subscriptions that attempt
          // to remove themselves from this subscription will noop
          this._subscriptions = null;
          var index = -1;
          var len = _parents ? _parents.length : 0;
          // if this._parent is null, then so is this._parents, and we
          // don't have to remove ourselves from any parent subscriptions.
          while (_parent) {
              _parent.remove(this);
              // if this._parents is null or index >= len,
              // then _parent is set to null, and the loop exits
              _parent = ++index < len && _parents[index] || null;
          }
          if (isFunction_1.isFunction(_unsubscribe)) {
              var trial = tryCatch_1.tryCatch(_unsubscribe).call(this);
              if (trial === errorObject.errorObject) {
                  hasErrors = true;
                  errors = errors || (errorObject.errorObject.e instanceof UnsubscriptionError_1.UnsubscriptionError ?
                      flattenUnsubscriptionErrors(errorObject.errorObject.e.errors) : [errorObject.errorObject.e]);
              }
          }
          if (isArray.isArray(_subscriptions)) {
              index = -1;
              len = _subscriptions.length;
              while (++index < len) {
                  var sub = _subscriptions[index];
                  if (isObject_1.isObject(sub)) {
                      var trial = tryCatch_1.tryCatch(sub.unsubscribe).call(sub);
                      if (trial === errorObject.errorObject) {
                          hasErrors = true;
                          errors = errors || [];
                          var err = errorObject.errorObject.e;
                          if (err instanceof UnsubscriptionError_1.UnsubscriptionError) {
                              errors = errors.concat(flattenUnsubscriptionErrors(err.errors));
                          }
                          else {
                              errors.push(err);
                          }
                      }
                  }
              }
          }
          if (hasErrors) {
              throw new UnsubscriptionError_1.UnsubscriptionError(errors);
          }
      };
      /**
       * Adds a tear down to be called during the unsubscribe() of this
       * Subscription.
       *
       * If the tear down being added is a subscription that is already
       * unsubscribed, is the same reference `add` is being called on, or is
       * `Subscription.EMPTY`, it will not be added.
       *
       * If this subscription is already in an `closed` state, the passed
       * tear down logic will be executed immediately.
       *
       * @param {TeardownLogic} teardown The additional logic to execute on
       * teardown.
       * @return {Subscription} Returns the Subscription used or created to be
       * added to the inner subscriptions list. This Subscription can be used with
       * `remove()` to remove the passed teardown logic from the inner subscriptions
       * list.
       */
      Subscription.prototype.add = function (teardown) {
          if (!teardown || (teardown === Subscription.EMPTY)) {
              return Subscription.EMPTY;
          }
          if (teardown === this) {
              return this;
          }
          var subscription = teardown;
          switch (typeof teardown) {
              case 'function':
                  subscription = new Subscription(teardown);
              case 'object':
                  if (subscription.closed || typeof subscription.unsubscribe !== 'function') {
                      return subscription;
                  }
                  else if (this.closed) {
                      subscription.unsubscribe();
                      return subscription;
                  }
                  else if (typeof subscription._addParent !== 'function' /* quack quack */) {
                      var tmp = subscription;
                      subscription = new Subscription();
                      subscription._subscriptions = [tmp];
                  }
                  break;
              default:
                  throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
          }
          var subscriptions = this._subscriptions || (this._subscriptions = []);
          subscriptions.push(subscription);
          subscription._addParent(this);
          return subscription;
      };
      /**
       * Removes a Subscription from the internal list of subscriptions that will
       * unsubscribe during the unsubscribe process of this Subscription.
       * @param {Subscription} subscription The subscription to remove.
       * @return {void}
       */
      Subscription.prototype.remove = function (subscription) {
          var subscriptions = this._subscriptions;
          if (subscriptions) {
              var subscriptionIndex = subscriptions.indexOf(subscription);
              if (subscriptionIndex !== -1) {
                  subscriptions.splice(subscriptionIndex, 1);
              }
          }
      };
      Subscription.prototype._addParent = function (parent) {
          var _a = this, _parent = _a._parent, _parents = _a._parents;
          if (!_parent || _parent === parent) {
              // If we don't have a parent, or the new parent is the same as the
              // current parent, then set this._parent to the new parent.
              this._parent = parent;
          }
          else if (!_parents) {
              // If there's already one parent, but not multiple, allocate an Array to
              // store the rest of the parent Subscriptions.
              this._parents = [parent];
          }
          else if (_parents.indexOf(parent) === -1) {
              // Only add the new parent to the _parents list if it's not already there.
              _parents.push(parent);
          }
      };
      Subscription.EMPTY = (function (empty) {
          empty.closed = true;
          return empty;
      }(new Subscription()));
      return Subscription;
  }());
  var Subscription_2 = Subscription;
  function flattenUnsubscriptionErrors(errors) {
      return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError_1.UnsubscriptionError) ? err.errors : err); }, []);
  }
  
  
  var Subscription_1 = {
  	Subscription: Subscription_2
  };
  
  var empty = {
      closed: true,
      next: function (value) { },
      error: function (err) { throw err; },
      complete: function () { }
  };
  
  
  var Observer = {
  	empty: empty
  };
  
  var rxSubscriber = createCommonjsModule(function (module, exports) {
  "use strict";
  
  var Symbol = root.root.Symbol;
  exports.rxSubscriber = (typeof Symbol === 'function' && typeof Symbol.for === 'function') ?
      Symbol.for('rxSubscriber') : '@@rxSubscriber';
  /**
   * @deprecated use rxSubscriber instead
   */
  exports.$$rxSubscriber = exports.rxSubscriber;
  
  });
  
  var __extends$1 = (commonjsGlobal && commonjsGlobal.__extends) || function (d, b) {
      for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
      function __() { this.constructor = d; }
      d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
  
  
  
  
  /**
   * Implements the {@link Observer} interface and extends the
   * {@link Subscription} class. While the {@link Observer} is the public API for
   * consuming the values of an {@link Observable}, all Observers get converted to
   * a Subscriber, in order to provide Subscription-like capabilities such as
   * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for
   * implementing operators, but it is rarely used as a public API.
   *
   * @class Subscriber<T>
   */
  var Subscriber = (function (_super) {
      __extends$1(Subscriber, _super);
      /**
       * @param {Observer|function(value: T): void} [destinationOrNext] A partially
       * defined Observer or a `next` callback function.
       * @param {function(e: ?any): void} [error] The `error` callback of an
       * Observer.
       * @param {function(): void} [complete] The `complete` callback of an
       * Observer.
       */
      function Subscriber(destinationOrNext, error, complete) {
          _super.call(this);
          this.syncErrorValue = null;
          this.syncErrorThrown = false;
          this.syncErrorThrowable = false;
          this.isStopped = false;
          switch (arguments.length) {
              case 0:
                  this.destination = Observer.empty;
                  break;
              case 1:
                  if (!destinationOrNext) {
                      this.destination = Observer.empty;
                      break;
                  }
                  if (typeof destinationOrNext === 'object') {
                      if (destinationOrNext instanceof Subscriber) {
                          this.destination = destinationOrNext;
                          this.destination.add(this);
                      }
                      else {
                          this.syncErrorThrowable = true;
                          this.destination = new SafeSubscriber(this, destinationOrNext);
                      }
                      break;
                  }
              default:
                  this.syncErrorThrowable = true;
                  this.destination = new SafeSubscriber(this, destinationOrNext, error, complete);
                  break;
          }
      }
      Subscriber.prototype[rxSubscriber.rxSubscriber] = function () { return this; };
      /**
       * A static factory for a Subscriber, given a (potentially partial) definition
       * of an Observer.
       * @param {function(x: ?T): void} [next] The `next` callback of an Observer.
       * @param {function(e: ?any): void} [error] The `error` callback of an
       * Observer.
       * @param {function(): void} [complete] The `complete` callback of an
       * Observer.
       * @return {Subscriber<T>} A Subscriber wrapping the (partially defined)
       * Observer represented by the given arguments.
       */
      Subscriber.create = function (next, error, complete) {
          var subscriber = new Subscriber(next, error, complete);
          subscriber.syncErrorThrowable = false;
          return subscriber;
      };
      /**
       * The {@link Observer} callback to receive notifications of type `next` from
       * the Observable, with a value. The Observable may call this method 0 or more
       * times.
       * @param {T} [value] The `next` value.
       * @return {void}
       */
      Subscriber.prototype.next = function (value) {
          if (!this.isStopped) {
              this._next(value);
          }
      };
      /**
       * The {@link Observer} callback to receive notifications of type `error` from
       * the Observable, with an attached {@link Error}. Notifies the Observer that
       * the Observable has experienced an error condition.
       * @param {any} [err] The `error` exception.
       * @return {void}
       */
      Subscriber.prototype.error = function (err) {
          if (!this.isStopped) {
              this.isStopped = true;
              this._error(err);
          }
      };
      /**
       * The {@link Observer} callback to receive a valueless notification of type
       * `complete` from the Observable. Notifies the Observer that the Observable
       * has finished sending push-based notifications.
       * @return {void}
       */
      Subscriber.prototype.complete = function () {
          if (!this.isStopped) {
              this.isStopped = true;
              this._complete();
          }
      };
      Subscriber.prototype.unsubscribe = function () {
          if (this.closed) {
              return;
          }
          this.isStopped = true;
          _super.prototype.unsubscribe.call(this);
      };
      Subscriber.prototype._next = function (value) {
          this.destination.next(value);
      };
      Subscriber.prototype._error = function (err) {
          this.destination.error(err);
          this.unsubscribe();
      };
      Subscriber.prototype._complete = function () {
          this.destination.complete();
          this.unsubscribe();
      };
      Subscriber.prototype._unsubscribeAndRecycle = function () {
          var _a = this, _parent = _a._parent, _parents = _a._parents;
          this._parent = null;
          this._parents = null;
          this.unsubscribe();
          this.closed = false;
          this.isStopped = false;
          this._parent = _parent;
          this._parents = _parents;
          return this;
      };
      return Subscriber;
  }(Subscription_1.Subscription));
  var Subscriber_2 = Subscriber;
  /**
   * We need this JSDoc comment for affecting ESDoc.
   * @ignore
   * @extends {Ignored}
   */
  var SafeSubscriber = (function (_super) {
      __extends$1(SafeSubscriber, _super);
      function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {
          _super.call(this);
          this._parentSubscriber = _parentSubscriber;
          var next;
          var context = this;
          if (isFunction_1.isFunction(observerOrNext)) {
              next = observerOrNext;
          }
          else if (observerOrNext) {
              next = observerOrNext.next;
              error = observerOrNext.error;
              complete = observerOrNext.complete;
              if (observerOrNext !== Observer.empty) {
                  context = Object.create(observerOrNext);
                  if (isFunction_1.isFunction(context.unsubscribe)) {
                      this.add(context.unsubscribe.bind(context));
                  }
                  context.unsubscribe = this.unsubscribe.bind(this);
              }
          }
          this._context = context;
          this._next = next;
          this._error = error;
          this._complete = complete;
      }
      SafeSubscriber.prototype.next = function (value) {
          if (!this.isStopped && this._next) {
              var _parentSubscriber = this._parentSubscriber;
              if (!_parentSubscriber.syncErrorThrowable) {
                  this.__tryOrUnsub(this._next, value);
              }
              else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
                  this.unsubscribe();
              }
          }
      };
      SafeSubscriber.prototype.error = function (err) {
          if (!this.isStopped) {
              var _parentSubscriber = this._parentSubscriber;
              if (this._error) {
                  if (!_parentSubscriber.syncErrorThrowable) {
                      this.__tryOrUnsub(this._error, err);
                      this.unsubscribe();
                  }
                  else {
                      this.__tryOrSetError(_parentSubscriber, this._error, err);
                      this.unsubscribe();
                  }
              }
              else if (!_parentSubscriber.syncErrorThrowable) {
                  this.unsubscribe();
                  throw err;
              }
              else {
                  _parentSubscriber.syncErrorValue = err;
                  _parentSubscriber.syncErrorThrown = true;
                  this.unsubscribe();
              }
          }
      };
      SafeSubscriber.prototype.complete = function () {
          var _this = this;
          if (!this.isStopped) {
              var _parentSubscriber = this._parentSubscriber;
              if (this._complete) {
                  var wrappedComplete = function () { return _this._complete.call(_this._context); };
                  if (!_parentSubscriber.syncErrorThrowable) {
                      this.__tryOrUnsub(wrappedComplete);
                      this.unsubscribe();
                  }
                  else {
                      this.__tryOrSetError(_parentSubscriber, wrappedComplete);
                      this.unsubscribe();
                  }
              }
              else {
                  this.unsubscribe();
              }
          }
      };
      SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
          try {
              fn.call(this._context, value);
          }
          catch (err) {
              this.unsubscribe();
              throw err;
          }
      };
      SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {
          try {
              fn.call(this._context, value);
          }
          catch (err) {
              parent.syncErrorValue = err;
              parent.syncErrorThrown = true;
              return true;
          }
          return false;
      };
      SafeSubscriber.prototype._unsubscribe = function () {
          var _parentSubscriber = this._parentSubscriber;
          this._context = null;
          this._parentSubscriber = null;
          _parentSubscriber.unsubscribe();
      };
      return SafeSubscriber;
  }(Subscriber));
  
  
  var Subscriber_1 = {
  	Subscriber: Subscriber_2
  };
  
  function toSubscriber(nextOrObserver, error, complete) {
      if (nextOrObserver) {
          if (nextOrObserver instanceof Subscriber_1.Subscriber) {
              return nextOrObserver;
          }
          if (nextOrObserver[rxSubscriber.rxSubscriber]) {
              return nextOrObserver[rxSubscriber.rxSubscriber]();
          }
      }
      if (!nextOrObserver && !error && !complete) {
          return new Subscriber_1.Subscriber(Observer.empty);
      }
      return new Subscriber_1.Subscriber(nextOrObserver, error, complete);
  }
  var toSubscriber_2 = toSubscriber;
  
  
  var toSubscriber_1 = {
  	toSubscriber: toSubscriber_2
  };
  
  var observable = createCommonjsModule(function (module, exports) {
  "use strict";
  
  function getSymbolObservable(context) {
      var $$observable;
      var Symbol = context.Symbol;
      if (typeof Symbol === 'function') {
          if (Symbol.observable) {
              $$observable = Symbol.observable;
          }
          else {
              $$observable = Symbol('observable');
              Symbol.observable = $$observable;
          }
      }
      else {
          $$observable = '@@observable';
      }
      return $$observable;
  }
  exports.getSymbolObservable = getSymbolObservable;
  exports.observable = getSymbolObservable(root.root);
  /**
   * @deprecated use observable instead
   */
  exports.$$observable = exports.observable;
  
  });
  
  /**
   * A representation of any set of values over any amount of time. This the most basic building block
   * of RxJS.
   *
   * @class Observable<T>
   */
  var Observable = (function () {
      /**
       * @constructor
       * @param {Function} subscribe the function that is  called when the Observable is
       * initially subscribed to. This function is given a Subscriber, to which new values
       * can be `next`ed, or an `error` method can be called to raise an error, or
       * `complete` can be called to notify of a successful completion.
       */
      function Observable(subscribe) {
          this._isScalar = false;
          if (subscribe) {
              this._subscribe = subscribe;
          }
      }
      /**
       * Creates a new Observable, with this Observable as the source, and the passed
       * operator defined as the new observable's operator.
       * @method lift
       * @param {Operator} operator the operator defining the operation to take on the observable
       * @return {Observable} a new observable with the Operator applied
       */
      Observable.prototype.lift = function (operator) {
          var observable$$1 = new Observable();
          observable$$1.source = this;
          observable$$1.operator = operator;
          return observable$$1;
      };
      /**
       * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.
       *
       * <span class="informal">Use it when you have all these Observables, but still nothing is happening.</span>
       *
       * `subscribe` is not a regular operator, but a method that calls Observables internal `subscribe` function. It
       * might be for example a function that you passed to a {@link create} static factory, but most of the time it is
       * a library implementation, which defines what and when will be emitted by an Observable. This means that calling
       * `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often
       * thought.
       *
       * Apart from starting the execution of an Observable, this method allows you to listen for values
       * that an Observable emits, as well as for when it completes or errors. You can achieve this in two
       * following ways.
       *
       * The first way is creating an object that implements {@link Observer} interface. It should have methods
       * defined by that interface, but note that it should be just a regular JavaScript object, which you can create
       * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular do
       * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also
       * that your object does not have to implement all methods. If you find yourself creating a method that doesn't
       * do anything, you can simply omit it. Note however, that if `error` method is not provided, all errors will
       * be left uncaught.
       *
       * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.
       * This means you can provide three functions as arguments to `subscribe`, where first function is equivalent
       * of a `next` method, second of an `error` method and third of a `complete` method. Just as in case of Observer,
       * if you do not need to listen for something, you can omit a function, preferably by passing `undefined` or `null`,
       * since `subscribe` recognizes these functions by where they were placed in function call. When it comes
       * to `error` function, just as before, if not provided, errors emitted by an Observable will be thrown.
       *
       * Whatever style of calling `subscribe` you use, in both cases it returns a Subscription object.
       * This object allows you to call `unsubscribe` on it, which in turn will stop work that an Observable does and will clean
       * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback
       * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.
       *
       * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.
       * It is an Observable itself that decides when these functions will be called. For example {@link of}
       * by default emits all its values synchronously. Always check documentation for how given Observable
       * will behave when subscribed and if its default behavior can be modified with a {@link Scheduler}.
       *
       * @example <caption>Subscribe with an Observer</caption>
       * const sumObserver = {
       *   sum: 0,
       *   next(value) {
       *     console.log('Adding: ' + value);
       *     this.sum = this.sum + value;
       *   },
       *   error() { // We actually could just remote this method,
       *   },        // since we do not really care about errors right now.
       *   complete() {
       *     console.log('Sum equals: ' + this.sum);
       *   }
       * };
       *
       * Rx.Observable.of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.
       * .subscribe(sumObserver);
       *
       * // Logs:
       * // "Adding: 1"
       * // "Adding: 2"
       * // "Adding: 3"
       * // "Sum equals: 6"
       *
       *
       * @example <caption>Subscribe with functions</caption>
       * let sum = 0;
       *
       * Rx.Observable.of(1, 2, 3)
       * .subscribe(
       *   function(value) {
       *     console.log('Adding: ' + value);
       *     sum = sum + value;
       *   },
       *   undefined,
       *   function() {
       *     console.log('Sum equals: ' + sum);
       *   }
       * );
       *
       * // Logs:
       * // "Adding: 1"
       * // "Adding: 2"
       * // "Adding: 3"
       * // "Sum equals: 6"
       *
       *
       * @example <caption>Cancel a subscription</caption>
       * const subscription = Rx.Observable.interval(1000).subscribe(
       *   num => console.log(num),
       *   undefined,
       *   () => console.log('completed!') // Will not be called, even
       * );                                // when cancelling subscription
       *
       *
       * setTimeout(() => {
       *   subscription.unsubscribe();
       *   console.log('unsubscribed!');
       * }, 2500);
       *
       * // Logs:
       * // 0 after 1s
       * // 1 after 2s
       * // "unsubscribed!" after 2,5s
       *
       *
       * @param {Observer|Function} observerOrNext (optional) Either an observer with methods to be called,
       *  or the first of three possible handlers, which is the handler for each value emitted from the subscribed
       *  Observable.
       * @param {Function} error (optional) A handler for a terminal event resulting from an error. If no error handler is provided,
       *  the error will be thrown as unhandled.
       * @param {Function} complete (optional) A handler for a terminal event resulting from successful completion.
       * @return {ISubscription} a subscription reference to the registered handlers
       * @method subscribe
       */
      Observable.prototype.subscribe = function (observerOrNext, error, complete) {
          var operator = this.operator;
          var sink = toSubscriber_1.toSubscriber(observerOrNext, error, complete);
          if (operator) {
              operator.call(sink, this.source);
          }
          else {
              sink.add(this.source ? this._subscribe(sink) : this._trySubscribe(sink));
          }
          if (sink.syncErrorThrowable) {
              sink.syncErrorThrowable = false;
              if (sink.syncErrorThrown) {
                  throw sink.syncErrorValue;
              }
          }
          return sink;
      };
      Observable.prototype._trySubscribe = function (sink) {
          try {
              return this._subscribe(sink);
          }
          catch (err) {
              sink.syncErrorThrown = true;
              sink.syncErrorValue = err;
              sink.error(err);
          }
      };
      /**
       * @method forEach
       * @param {Function} next a handler for each value emitted by the observable
       * @param {PromiseConstructor} [PromiseCtor] a constructor function used to instantiate the Promise
       * @return {Promise} a promise that either resolves on observable completion or
       *  rejects with the handled error
       */
      Observable.prototype.forEach = function (next, PromiseCtor) {
          var _this = this;
          if (!PromiseCtor) {
              if (root.root.Rx && root.root.Rx.config && root.root.Rx.config.Promise) {
                  PromiseCtor = root.root.Rx.config.Promise;
              }
              else if (root.root.Promise) {
                  PromiseCtor = root.root.Promise;
              }
          }
          if (!PromiseCtor) {
              throw new Error('no Promise impl found');
          }
          return new PromiseCtor(function (resolve, reject) {
              // Must be declared in a separate statement to avoid a RefernceError when
              // accessing subscription below in the closure due to Temporal Dead Zone.
              var subscription;
              subscription = _this.subscribe(function (value) {
                  if (subscription) {
                      // if there is a subscription, then we can surmise
                      // the next handling is asynchronous. Any errors thrown
                      // need to be rejected explicitly and unsubscribe must be
                      // called manually
                      try {
                          next(value);
                      }
                      catch (err) {
                          reject(err);
                          subscription.unsubscribe();
                      }
                  }
                  else {
                      // if there is NO subscription, then we're getting a nexted
                      // value synchronously during subscription. We can just call it.
                      // If it errors, Observable's `subscribe` will ensure the
                      // unsubscription logic is called, then synchronously rethrow the error.
                      // After that, Promise will trap the error and send it
                      // down the rejection path.
                      next(value);
                  }
              }, reject, resolve);
          });
      };
      Observable.prototype._subscribe = function (subscriber) {
          return this.source.subscribe(subscriber);
      };
      /**
       * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable
       * @method Symbol.observable
       * @return {Observable} this instance of the observable
       */
      Observable.prototype[observable.observable] = function () {
          return this;
      };
      // HACK: Since TypeScript inherits static properties too, we have to
      // fight against TypeScript here so Subject can have a different static create signature
      /**
       * Creates a new cold Observable by calling the Observable constructor
       * @static true
       * @owner Observable
       * @method create
       * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor
       * @return {Observable} a new cold observable
       */
      Observable.create = function (subscribe) {
          return new Observable(subscribe);
      };
      return Observable;
  }());
  var Observable_2 = Observable;
  
  
  var Observable_1 = {
  	Observable: Observable_2
  };
  
  var __extends$5 = (commonjsGlobal && commonjsGlobal.__extends) || function (d, b) {
      for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
      function __() { this.constructor = d; }
      d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
  /**
   * An error thrown when an action is invalid because the object has been
   * unsubscribed.
   *
   * @see {@link Subject}
   * @see {@link BehaviorSubject}
   *
   * @class ObjectUnsubscribedError
   */
  var ObjectUnsubscribedError = (function (_super) {
      __extends$5(ObjectUnsubscribedError, _super);
      function ObjectUnsubscribedError() {
          var err = _super.call(this, 'object unsubscribed');
          this.name = err.name = 'ObjectUnsubscribedError';
          this.stack = err.stack;
          this.message = err.message;
      }
      return ObjectUnsubscribedError;
  }(Error));
  var ObjectUnsubscribedError_2 = ObjectUnsubscribedError;
  
  
  var ObjectUnsubscribedError_1 = {
  	ObjectUnsubscribedError: ObjectUnsubscribedError_2
  };
  
  var __extends$6 = (commonjsGlobal && commonjsGlobal.__extends) || function (d, b) {
      for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
      function __() { this.constructor = d; }
      d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
  
  /**
   * We need this JSDoc comment for affecting ESDoc.
   * @ignore
   * @extends {Ignored}
   */
  var SubjectSubscription = (function (_super) {
      __extends$6(SubjectSubscription, _super);
      function SubjectSubscription(subject, subscriber) {
          _super.call(this);
          this.subject = subject;
          this.subscriber = subscriber;
          this.closed = false;
      }
      SubjectSubscription.prototype.unsubscribe = function () {
          if (this.closed) {
              return;
          }
          this.closed = true;
          var subject = this.subject;
          var observers = subject.observers;
          this.subject = null;
          if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
              return;
          }
          var subscriberIndex = observers.indexOf(this.subscriber);
          if (subscriberIndex !== -1) {
              observers.splice(subscriberIndex, 1);
          }
      };
      return SubjectSubscription;
  }(Subscription_1.Subscription));
  var SubjectSubscription_2 = SubjectSubscription;
  
  
  var SubjectSubscription_1 = {
  	SubjectSubscription: SubjectSubscription_2
  };
  
  var __extends$4 = (commonjsGlobal && commonjsGlobal.__extends) || function (d, b) {
      for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
      function __() { this.constructor = d; }
      d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
  
  
  
  
  
  
  /**
   * @class SubjectSubscriber<T>
   */
  var SubjectSubscriber = (function (_super) {
      __extends$4(SubjectSubscriber, _super);
      function SubjectSubscriber(destination) {
          _super.call(this, destination);
          this.destination = destination;
      }
      return SubjectSubscriber;
  }(Subscriber_1.Subscriber));
  var SubjectSubscriber_1 = SubjectSubscriber;
  /**
   * @class Subject<T>
   */
  var Subject = (function (_super) {
      __extends$4(Subject, _super);
      function Subject() {
          _super.call(this);
          this.observers = [];
          this.closed = false;
          this.isStopped = false;
          this.hasError = false;
          this.thrownError = null;
      }
      Subject.prototype[rxSubscriber.rxSubscriber] = function () {
          return new SubjectSubscriber(this);
      };
      Subject.prototype.lift = function (operator) {
          var subject = new AnonymousSubject(this, this);
          subject.operator = operator;
          return subject;
      };
      Subject.prototype.next = function (value) {
          if (this.closed) {
              throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
          }
          if (!this.isStopped) {
              var observers = this.observers;
              var len = observers.length;
              var copy = observers.slice();
              for (var i = 0; i < len; i++) {
                  copy[i].next(value);
              }
          }
      };
      Subject.prototype.error = function (err) {
          if (this.closed) {
              throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
          }
          this.hasError = true;
          this.thrownError = err;
          this.isStopped = true;
          var observers = this.observers;
          var len = observers.length;
          var copy = observers.slice();
          for (var i = 0; i < len; i++) {
              copy[i].error(err);
          }
          this.observers.length = 0;
      };
      Subject.prototype.complete = function () {
          if (this.closed) {
              throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
          }
          this.isStopped = true;
          var observers = this.observers;
          var len = observers.length;
          var copy = observers.slice();
          for (var i = 0; i < len; i++) {
              copy[i].complete();
          }
          this.observers.length = 0;
      };
      Subject.prototype.unsubscribe = function () {
          this.isStopped = true;
          this.closed = true;
          this.observers = null;
      };
      Subject.prototype._trySubscribe = function (subscriber) {
          if (this.closed) {
              throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
          }
          else {
              return _super.prototype._trySubscribe.call(this, subscriber);
          }
      };
      Subject.prototype._subscribe = function (subscriber) {
          if (this.closed) {
              throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
          }
          else if (this.hasError) {
              subscriber.error(this.thrownError);
              return Subscription_1.Subscription.EMPTY;
          }
          else if (this.isStopped) {
              subscriber.complete();
              return Subscription_1.Subscription.EMPTY;
          }
          else {
              this.observers.push(subscriber);
              return new SubjectSubscription_1.SubjectSubscription(this, subscriber);
          }
      };
      Subject.prototype.asObservable = function () {
          var observable = new Observable_1.Observable();
          observable.source = this;
          return observable;
      };
      Subject.create = function (destination, source) {
          return new AnonymousSubject(destination, source);
      };
      return Subject;
  }(Observable_1.Observable));
  var Subject_2 = Subject;
  /**
   * @class AnonymousSubject<T>
   */
  var AnonymousSubject = (function (_super) {
      __extends$4(AnonymousSubject, _super);
      function AnonymousSubject(destination, source) {
          _super.call(this);
          this.destination = destination;
          this.source = source;
      }
      AnonymousSubject.prototype.next = function (value) {
          var destination = this.destination;
          if (destination && destination.next) {
              destination.next(value);
          }
      };
      AnonymousSubject.prototype.error = function (err) {
          var destination = this.destination;
          if (destination && destination.error) {
              this.destination.error(err);
          }
      };
      AnonymousSubject.prototype.complete = function () {
          var destination = this.destination;
          if (destination && destination.complete) {
              this.destination.complete();
          }
      };
      AnonymousSubject.prototype._subscribe = function (subscriber) {
          var source = this.source;
          if (source) {
              return this.source.subscribe(subscriber);
          }
          else {
              return Subscription_1.Subscription.EMPTY;
          }
      };
      return AnonymousSubject;
  }(Subject));
  var AnonymousSubject_1 = AnonymousSubject;
  
  
  var Subject_1 = {
  	SubjectSubscriber: SubjectSubscriber_1,
  	Subject: Subject_2,
  	AnonymousSubject: AnonymousSubject_1
  };
  
  var __extends$3 = (commonjsGlobal && commonjsGlobal.__extends) || function (d, b) {
      for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
      function __() { this.constructor = d; }
      d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
  
  
  
  
  /**
   * @class ConnectableObservable<T>
   */
  var ConnectableObservable = (function (_super) {
      __extends$3(ConnectableObservable, _super);
      function ConnectableObservable(source, subjectFactory) {
          _super.call(this);
          this.source = source;
          this.subjectFactory = subjectFactory;
          this._refCount = 0;
          this._isComplete = false;
      }
      ConnectableObservable.prototype._subscribe = function (subscriber) {
          return this.getSubject().subscribe(subscriber);
      };
      ConnectableObservable.prototype.getSubject = function () {
          var subject = this._subject;
          if (!subject || subject.isStopped) {
              this._subject = this.subjectFactory();
          }
          return this._subject;
      };
      ConnectableObservable.prototype.connect = function () {
          var connection = this._connection;
          if (!connection) {
              this._isComplete = false;
              connection = this._connection = new Subscription_1.Subscription();
              connection.add(this.source
                  .subscribe(new ConnectableSubscriber(this.getSubject(), this)));
              if (connection.closed) {
                  this._connection = null;
                  connection = Subscription_1.Subscription.EMPTY;
              }
              else {
                  this._connection = connection;
              }
          }
          return connection;
      };
      ConnectableObservable.prototype.refCount = function () {
          return this.lift(new RefCountOperator(this));
      };
      return ConnectableObservable;
  }(Observable_1.Observable));
  var ConnectableObservable_2 = ConnectableObservable;
  var connectableProto = ConnectableObservable.prototype;
  var connectableObservableDescriptor = {
      operator: { value: null },
      _refCount: { value: 0, writable: true },
      _subject: { value: null, writable: true },
      _connection: { value: null, writable: true },
      _subscribe: { value: connectableProto._subscribe },
      _isComplete: { value: connectableProto._isComplete, writable: true },
      getSubject: { value: connectableProto.getSubject },
      connect: { value: connectableProto.connect },
      refCount: { value: connectableProto.refCount }
  };
  var ConnectableSubscriber = (function (_super) {
      __extends$3(ConnectableSubscriber, _super);
      function ConnectableSubscriber(destination, connectable) {
          _super.call(this, destination);
          this.connectable = connectable;
      }
      ConnectableSubscriber.prototype._error = function (err) {
          this._unsubscribe();
          _super.prototype._error.call(this, err);
      };
      ConnectableSubscriber.prototype._complete = function () {
          this.connectable._isComplete = true;
          this._unsubscribe();
          _super.prototype._complete.call(this);
      };
      ConnectableSubscriber.prototype._unsubscribe = function () {
          var connectable = this.connectable;
          if (connectable) {
              this.connectable = null;
              var connection = connectable._connection;
              connectable._refCount = 0;
              connectable._subject = null;
              connectable._connection = null;
              if (connection) {
                  connection.unsubscribe();
              }
          }
      };
      return ConnectableSubscriber;
  }(Subject_1.SubjectSubscriber));
  var RefCountOperator = (function () {
      function RefCountOperator(connectable) {
          this.connectable = connectable;
      }
      RefCountOperator.prototype.call = function (subscriber, source) {
          var connectable = this.connectable;
          connectable._refCount++;
          var refCounter = new RefCountSubscriber(subscriber, connectable);
          var subscription = source.subscribe(refCounter);
          if (!refCounter.closed) {
              refCounter.connection = connectable.connect();
          }
          return subscription;
      };
      return RefCountOperator;
  }());
  var RefCountSubscriber = (function (_super) {
      __extends$3(RefCountSubscriber, _super);
      function RefCountSubscriber(destination, connectable) {
          _super.call(this, destination);
          this.connectable = connectable;
      }
      RefCountSubscriber.prototype._unsubscribe = function () {
          var connectable = this.connectable;
          if (!connectable) {
              this.connection = null;
              return;
          }
          this.connectable = null;
          var refCount = connectable._refCount;
          if (refCount <= 0) {
              this.connection = null;
              return;
          }
          connectable._refCount = refCount - 1;
          if (refCount > 1) {
              this.connection = null;
              return;
          }
          ///
          // Compare the local RefCountSubscriber's connection Subscription to the
          // connection Subscription on the shared ConnectableObservable. In cases
          // where the ConnectableObservable source synchronously emits values, and
          // the RefCountSubscriber's downstream Observers synchronously unsubscribe,
          // execution continues to here before the RefCountOperator has a chance to
          // supply the RefCountSubscriber with the shared connection Subscription.
          // For example:
          // ```
          // Observable.range(0, 10)
          //   .publish()
          //   .refCount()
          //   .take(5)
          //   .subscribe();
          // ```
          // In order to account for this case, RefCountSubscriber should only dispose
          // the ConnectableObservable's shared connection Subscription if the
          // connection Subscription exists, *and* either:
          //   a. RefCountSubscriber doesn't have a reference to the shared connection
          //      Subscription yet, or,
          //   b. RefCountSubscriber's connection Subscription reference is identical
          //      to the shared connection Subscription
          ///
          var connection = this.connection;
          var sharedConnection = connectable._connection;
          this.connection = null;
          if (sharedConnection && (!connection || sharedConnection === connection)) {
              sharedConnection.unsubscribe();
          }
      };
      return RefCountSubscriber;
  }(Subscriber_1.Subscriber));
  
  
  var ConnectableObservable_1 = {
  	ConnectableObservable: ConnectableObservable_2,
  	connectableObservableDescriptor: connectableObservableDescriptor
  };
  
  /* tslint:enable:max-line-length */
  /**
   * Returns an Observable that emits the results of invoking a specified selector on items
   * emitted by a ConnectableObservable that shares a single subscription to the underlying stream.
   *
   * <img src="./img/multicast.png" width="100%">
   *
   * @param {Function|Subject} subjectOrSubjectFactory - Factory function to create an intermediate subject through
   * which the source sequence's elements will be multicast to the selector function
   * or Subject to push source elements into.
   * @param {Function} [selector] - Optional selector function that can use the multicasted source stream
   * as many times as needed, without causing multiple subscriptions to the source stream.
   * Subscribers to the given source will receive all notifications of the source from the
   * time of the subscription forward.
   * @return {Observable} An Observable that emits the results of invoking the selector
   * on the items emitted by a `ConnectableObservable` that shares a single subscription to
   * the underlying stream.
   * @method multicast
   * @owner Observable
   */
  function multicast(subjectOrSubjectFactory, selector) {
      var subjectFactory;
      if (typeof subjectOrSubjectFactory === 'function') {
          subjectFactory = subjectOrSubjectFactory;
      }
      else {
          subjectFactory = function subjectFactory() {
              return subjectOrSubjectFactory;
          };
      }
      if (typeof selector === 'function') {
          return this.lift(new MulticastOperator(subjectFactory, selector));
      }
      var connectable = Object.create(this, ConnectableObservable_1.connectableObservableDescriptor);
      connectable.source = this;
      connectable.subjectFactory = subjectFactory;
      return connectable;
  }
  var multicast_2 = multicast;
  var MulticastOperator = (function () {
      function MulticastOperator(subjectFactory, selector) {
          this.subjectFactory = subjectFactory;
          this.selector = selector;
      }
      MulticastOperator.prototype.call = function (subscriber, source) {
          var selector = this.selector;
          var subject = this.subjectFactory();
          var subscription = selector(subject).subscribe(subscriber);
          subscription.add(source.subscribe(subject));
          return subscription;
      };
      return MulticastOperator;
  }());
  var MulticastOperator_1 = MulticastOperator;
  
  
  var multicast_1 = {
  	multicast: multicast_2,
  	MulticastOperator: MulticastOperator_1
  };
  
  function shareSubjectFactory() {
      return new Subject_1.Subject();
  }
  /**
   * Returns a new Observable that multicasts (shares) the original Observable. As long as there is at least one
   * Subscriber this Observable will be subscribed and emitting data. When all subscribers have unsubscribed it will
   * unsubscribe from the source Observable. Because the Observable is multicasting it makes the stream `hot`.
   * This is an alias for .publish().refCount().
   *
   * <img src="./img/share.png" width="100%">
   *
   * @return {Observable<T>} An Observable that upon connection causes the source Observable to emit items to its Observers.
   * @method share
   * @owner Observable
   */
  function share$2() {
      return multicast_1.multicast.call(this, shareSubjectFactory).refCount();
  }
  var share_2 = share$2;
  
  
  
  var share_1 = {
  	share: share_2
  };
  
  Observable_1.Observable.prototype.share = share_1.share;
  
  /**
   * Injectable service
   * @export
   * @class Ng4LoadingSpinnerService
   */
  var Ng4LoadingSpinnerService = (function () {
      /**
       * Creates an instance of Ng4LoadingSpinnerService.
       * @memberof Ng4LoadingSpinnerService
       */
      function Ng4LoadingSpinnerService() {
          var _this = this;
          this.spinnerObservable = new Observable_2(function (observer) {
              _this.spinnerObserver = observer;
          }).share();
      }
      /**
       * To show spinner
       * @memberof Ng4LoadingSpinnerService
       */
      Ng4LoadingSpinnerService.prototype.show = function () {
          if (this.spinnerObserver) {
              this.spinnerObserver.next(true);
          }
      };
      /**
       * To hide spinner
       * @memberof Ng4LoadingSpinnerService
       */
      Ng4LoadingSpinnerService.prototype.hide = function () {
          if (this.spinnerObserver) {
              this.spinnerObserver.next(false);
          }
      };
      Ng4LoadingSpinnerService = __decorate([
          Injectable(),
          __metadata("design:paramtypes", [])
      ], Ng4LoadingSpinnerService);
      return Ng4LoadingSpinnerService;
  }());
  
  /**
   * Component
   * @export
   * @class Ng4LoadingSpinnerComponent
   * @implements {OnInit}
   * @implements {OnDestroy}
   */
  var Ng4LoadingSpinnerComponent = (function () {
      /**
       * Constructor
       * @param {Ng4LoadingSpinnerService} spinnerService Spinner Service
       * @memberof Ng4LoadingSpinnerComponent
       */
      function Ng4LoadingSpinnerComponent(spinnerService) {
          this.spinnerService = spinnerService;
          this._template = "\n  <div style=\"color: #64d6e2\" class=\"la-ball-clip-rotate-multiple la-3x\">\n    <div></div>\n    <div></div>\n    <div></div>\n  </div>";
          this._loadingText = '';
          /**
           *
           * @type {Number}
           * @memberof Ng4LoadingSpinnerComponent
           */
          this._threshold = 500;
          /**
           * Enable/Disable spinner
           * @memberof Ng4LoadingSpinnerComponent
           */
          this.showSpinner = false;
      }
      Object.defineProperty(Ng4LoadingSpinnerComponent.prototype, "template", {
          /**
           * @readonly
           * @type {String}
           * @memberof Ng4LoadingSpinnerComponent
           */
          get: function () {
              return this._template;
          },
          /**
           * @memberof Ng4LoadingSpinnerComponent
           */
          set: function (value) {
              this._template = value;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(Ng4LoadingSpinnerComponent.prototype, "loadingText", {
          /**
           *
           * @readonly
           * @type {String}
           * @memberof Ng4LoadingSpinnerComponent
           */
          get: function () {
              return this._loadingText;
          },
          /**
           *
           * @memberof Ng4LoadingSpinnerComponent
           */
          set: function (value) {
              this._loadingText = value;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(Ng4LoadingSpinnerComponent.prototype, "threshold", {
          /**
           *
           * @readonly
           * @type {Number}
           * @memberof Ng4LoadingSpinnerComponent
           */
          get: function () {
              return this._threshold;
          },
          /**
           *
           * @memberof Ng4LoadingSpinnerComponent
           */
          set: function (value) {
              this._threshold = value;
          },
          enumerable: true,
          configurable: true
      });
      /**
       * Init function
       * @memberof Ng4LoadingSpinnerComponent
       */
      Ng4LoadingSpinnerComponent.prototype.ngOnInit = function () {
          this.createServiceSubscription();
      };
      /**
       * Destroy function
       * @memberof Ng4LoadingSpinnerComponent
       */
      Ng4LoadingSpinnerComponent.prototype.ngOnDestroy = function () {
          this.subscription.unsubscribe();
      };
      /**
       * Create service subscription
       * @memberof Ng4LoadingSpinnerComponent
       */
      Ng4LoadingSpinnerComponent.prototype.createServiceSubscription = function () {
          var _this = this;
          var timer;
          this.subscription =
              this.spinnerService.spinnerObservable.subscribe(function (show) {
                  if (show) {
                      timer = setTimeout(function () {
                          this.showSpinner = show;
                      }.bind(_this), _this._threshold);
                  }
                  else {
                      clearTimeout(timer);
                      _this.showSpinner = false;
                  }
              });
      };
      __decorate([
          Input(),
          __metadata("design:type", String),
          __metadata("design:paramtypes", [String])
      ], Ng4LoadingSpinnerComponent.prototype, "template", null);
      __decorate([
          Input(),
          __metadata("design:type", String),
          __metadata("design:paramtypes", [String])
      ], Ng4LoadingSpinnerComponent.prototype, "loadingText", null);
      __decorate([
          Input(),
          __metadata("design:type", Number),
          __metadata("design:paramtypes", [Number])
      ], Ng4LoadingSpinnerComponent.prototype, "threshold", null);
      Ng4LoadingSpinnerComponent = __decorate([
          Component({
              selector: 'app-spinner',
              template: "<div [class]=\"showSpinner ? 'visible spinner center' : 'hidden spinner center'\" [innerHTML]=\"_template\">    \n</div>\n<h1 [class]=\"showSpinner ? 'visible loading-text' : 'hidden loading-text'\"> {{_loadingText}} </h1>\n\n\n",
              styles: [".spinner {\n  position: fixed;\n  padding: 0px;\n  top: 0;\n  left: 0;\n  height: 100%;\n  width: 100%;\n  z-index: 9;\n  background: #000;\n  opacity: 0.6;\n  transition: opacity 0.3s linear; }\n\n.center {\n  margin: auto;\n  width: 100%; }\n\n.loading-text {\n  position: fixed;\n  top: 0;\n  width: 100%;\n  height: 100%;\n  left: 0;\n  padding: 0;\n  margin: 0;\n  color: #333;\n  background: transparent;\n  text-align: center;\n  padding-top: 33%; }\n\n.spinner img {\n  position: fixed;\n  top: 0;\n  left: 0;\n  padding: 0px;\n  height: 100%;\n  width: 100%;\n  z-index: 10;\n  background: #000;\n  opacity: 0.6;\n  transition: opacity 0.3s linear; }\n\n.hidden {\n  visibility: hidden;\n  opacity: 0;\n  transition: visibility 0s 0.3s, opacity 0.3s linear; }\n\n.visible {\n  visibility: visible; }\n\n.la-ball-clip-rotate-multiple, .la-ball-clip-rotate-multiple > div {\n  position: relative;\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box; }\n\n.la-ball-clip-rotate-multiple {\n  display: block;\n  font-size: 0;\n  color: #fff; }\n\n.la-ball-clip-rotate-multiple.la-dark {\n  color: #333; }\n\n.la-ball-clip-rotate-multiple > div {\n  display: inline-block;\n  float: none;\n  background-color: currentColor;\n  border: 0 solid currentColor; }\n\n.la-ball-clip-rotate-multiple {\n  width: 32px;\n  height: 32px; }\n\n.la-ball-clip-rotate-multiple > div {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  background: transparent;\n  border-style: solid;\n  border-width: 2px;\n  border-radius: 100%;\n  -webkit-animation: ball-clip-rotate-multiple-rotate 1s ease-in-out infinite;\n  -moz-animation: ball-clip-rotate-multiple-rotate 1s ease-in-out infinite;\n  -o-animation: ball-clip-rotate-multiple-rotate 1s ease-in-out infinite;\n  animation: ball-clip-rotate-multiple-rotate 1s ease-in-out infinite; }\n\n.la-ball-clip-rotate-multiple > div:first-child {\n  position: absolute;\n  width: 32px;\n  height: 32px;\n  border-right-color: transparent;\n  border-left-color: transparent; }\n\n.la-ball-clip-rotate-multiple > div:last-child {\n  width: 16px;\n  height: 16px;\n  border-top-color: transparent;\n  border-bottom-color: transparent;\n  -webkit-animation-duration: .5s;\n  -moz-animation-duration: .5s;\n  -o-animation-duration: .5s;\n  animation-duration: .5s;\n  -webkit-animation-direction: reverse;\n  -moz-animation-direction: reverse;\n  -o-animation-direction: reverse;\n  animation-direction: reverse; }\n\n.la-ball-clip-rotate-multiple.la-sm {\n  width: 16px;\n  height: 16px; }\n\n.la-ball-clip-rotate-multiple.la-sm > div {\n  border-width: 1px; }\n\n.la-ball-clip-rotate-multiple.la-sm > div:first-child {\n  width: 16px;\n  height: 16px; }\n\n.la-ball-clip-rotate-multiple.la-sm > div:last-child {\n  width: 8px;\n  height: 8px; }\n\n.la-ball-clip-rotate-multiple.la-2x {\n  width: 64px;\n  height: 64px; }\n\n.la-ball-clip-rotate-multiple.la-2x > div {\n  border-width: 4px; }\n\n.la-ball-clip-rotate-multiple.la-2x > div:first-child {\n  width: 64px;\n  height: 64px; }\n\n.la-ball-clip-rotate-multiple.la-2x > div:last-child {\n  width: 32px;\n  height: 32px; }\n\n.la-ball-clip-rotate-multiple.la-3x {\n  width: 96px;\n  height: 96px;\n  top: 40%;\n  left: 46%; }\n\n.la-ball-clip-rotate-multiple.la-3x > div {\n  border-width: 6px; }\n\n.la-ball-clip-rotate-multiple.la-3x > div:first-child {\n  width: 120px;\n  height: 120px; }\n\n.la-ball-clip-rotate-multiple.la-3x > div:last-child {\n  width: 88px;\n  height: 88px; }\n\n.la-ball-clip-rotate-multiple.la-3x > div:nth-child(2) {\n  width: 48px;\n  height: 48px; }\n\n@-webkit-keyframes ball-clip-rotate-multiple-rotate {\n  0% {\n    -webkit-transform: translate(-50%, -50%) rotate(0deg);\n    transform: translate(-50%, -50%) rotate(0deg); }\n  50% {\n    -webkit-transform: translate(-50%, -50%) rotate(180deg);\n    transform: translate(-50%, -50%) rotate(180deg); }\n  100% {\n    -webkit-transform: translate(-50%, -50%) rotate(360deg);\n    transform: translate(-50%, -50%) rotate(360deg); } }\n\n@-moz-keyframes ball-clip-rotate-multiple-rotate {\n  0% {\n    -moz-transform: translate(-50%, -50%) rotate(0deg);\n    transform: translate(-50%, -50%) rotate(0deg); }\n  50% {\n    -moz-transform: translate(-50%, -50%) rotate(180deg);\n    transform: translate(-50%, -50%) rotate(180deg); }\n  100% {\n    -moz-transform: translate(-50%, -50%) rotate(360deg);\n    transform: translate(-50%, -50%) rotate(360deg); } }\n\n@-o-keyframes ball-clip-rotate-multiple-rotate {\n  0% {\n    -o-transform: translate(-50%, -50%) rotate(0deg);\n    transform: translate(-50%, -50%) rotate(0deg); }\n  50% {\n    -o-transform: translate(-50%, -50%) rotate(180deg);\n    transform: translate(-50%, -50%) rotate(180deg); }\n  100% {\n    -o-transform: translate(-50%, -50%) rotate(360deg);\n    transform: translate(-50%, -50%) rotate(360deg); } }\n\n@keyframes ball-clip-rotate-multiple-rotate {\n  0% {\n    -webkit-transform: translate(-50%, -50%) rotate(0deg);\n    -moz-transform: translate(-50%, -50%) rotate(0deg);\n    -o-transform: translate(-50%, -50%) rotate(0deg);\n    transform: translate(-50%, -50%) rotate(0deg); }\n  50% {\n    -webkit-transform: translate(-50%, -50%) rotate(180deg);\n    -moz-transform: translate(-50%, -50%) rotate(180deg);\n    -o-transform: translate(-50%, -50%) rotate(180deg);\n    transform: translate(-50%, -50%) rotate(180deg); }\n  100% {\n    -webkit-transform: translate(-50%, -50%) rotate(360deg);\n    -moz-transform: translate(-50%, -50%) rotate(360deg);\n    -o-transform: translate(-50%, -50%) rotate(360deg);\n    transform: translate(-50%, -50%) rotate(360deg); } }\n"],
              inputs: ['template', 'loadingText'],
              encapsulation: ViewEncapsulation.Native // Use the native Shadow DOM to encapsulate our CSS
          }),
          __metadata("design:paramtypes", [Ng4LoadingSpinnerService])
      ], Ng4LoadingSpinnerComponent);
      return Ng4LoadingSpinnerComponent;
  }());
  
  // import { CommonModule } from '@angular/common';
  var Ng4LoadingSpinnerModule = (function () {
      function Ng4LoadingSpinnerModule() {
      }
      Ng4LoadingSpinnerModule = __decorate([
          NgModule({
              imports: [],
              declarations: [Ng4LoadingSpinnerComponent],
              exports: [Ng4LoadingSpinnerComponent],
              providers: [Ng4LoadingSpinnerService]
          })
      ], Ng4LoadingSpinnerModule);
      return Ng4LoadingSpinnerModule;
  }());
  
  export { Ng4LoadingSpinnerModule, Ng4LoadingSpinnerComponent, Ng4LoadingSpinnerService };
  //# sourceMappingURL=ng4-loading-spinner.esm.js.map
  