text: var __extends = (this && this.__extends) || (function () {
      var extendStatics = Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
          function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
      return function (d, b) {
          extendStatics(d, b);
          function __() { this.constructor = d; }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
  })();
  var __decorate = (this && this.__decorate) || function (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;
  };
  var __metadata = (this && this.__metadata) || function (k, v) {
      if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  };
  import { Injectable } from '@angular/core';
  import { Plugin, CordovaInstance, InstanceCheck, IonicNativePlugin } from '@ionic-native/core';
  import { Observable } from 'rxjs/Observable';
  /**
   * @hidden
   */
  var InAppBrowserObject = (function () {
      /**
       * Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
       * @param {string} url     The URL to load.
       * @param {string} [target="self"]  The target in which to load the URL, an optional parameter that defaults to _self.
       *                 _self: Opens in the WebView if the URL is in the white list, otherwise it opens in the InAppBrowser.
       *                 _blank: Opens in the InAppBrowser.
       *                 _system: Opens in the system's web browser.
       * @param {string | InAppBrowserOptions} [options] Options for the InAppBrowser. Optional, defaulting to: location=yes.
       *                 The options string must not contain any blank space, and each feature's
       *                 name/value pairs must be separated by a comma. Feature names are case insensitive.
       */
      function InAppBrowserObject(url, target, options) {
          try {
              if (options && typeof options !== 'string') {
                  options = Object.keys(options).map(function (key) { return key + "=" + options[key]; }).join(',');
              }
              this._objectInstance = cordova.InAppBrowser.open(url, target, options);
          }
          catch (e) {
              window.open(url, target);
              console.warn('Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open.');
          }
      }
      /**
       * Displays an InAppBrowser window that was opened hidden. Calling this has no effect
       * if the InAppBrowser was already visible.
       */
      InAppBrowserObject.prototype.show = function () { };
      /**
       * Closes the InAppBrowser window.
       */
      InAppBrowserObject.prototype.close = function () { };
      /**
       * Hides an InAppBrowser window that is currently shown. Calling this has no effect
       * if the InAppBrowser was already hidden.
       */
      InAppBrowserObject.prototype.hide = function () { };
      /**
       * Injects JavaScript code into the InAppBrowser window.
       * @param script {Object} Details of the script to run, specifying either a file or code key.
       * @returns {Promise<any>}
       */
      InAppBrowserObject.prototype.executeScript = function (script) { return; };
      /**
       * Injects CSS into the InAppBrowser window.
       * @param css {Object} Details of the script to run, specifying either a file or code key.
       * @returns {Promise<any>}
       */
      InAppBrowserObject.prototype.insertCSS = function (css) { return; };
      /**
       * A method that allows you to listen to events happening in the browser.
       * @param event {string} Name of the event
       * @returns {Observable<InAppBrowserEvent>} Returns back an observable that will listen to the event on subscribe, and will stop listening to the event on unsubscribe.
       */
      InAppBrowserObject.prototype.on = function (event) {
          var _this = this;
          return new Observable(function (observer) {
              _this._objectInstance.addEventListener(event, observer.next.bind(observer));
              return function () { return _this._objectInstance.removeEventListener(event, observer.next.bind(observer)); };
          });
      };
      __decorate([
          CordovaInstance({ sync: true }),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", []),
          __metadata("design:returntype", void 0)
      ], InAppBrowserObject.prototype, "show", null);
      __decorate([
          CordovaInstance({ sync: true }),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", []),
          __metadata("design:returntype", void 0)
      ], InAppBrowserObject.prototype, "close", null);
      __decorate([
          CordovaInstance({ sync: true }),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", []),
          __metadata("design:returntype", void 0)
      ], InAppBrowserObject.prototype, "hide", null);
      __decorate([
          CordovaInstance(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [Object]),
          __metadata("design:returntype", Promise)
      ], InAppBrowserObject.prototype, "executeScript", null);
      __decorate([
          CordovaInstance(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [Object]),
          __metadata("design:returntype", Promise)
      ], InAppBrowserObject.prototype, "insertCSS", null);
      __decorate([
          InstanceCheck(),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [String]),
          __metadata("design:returntype", Observable)
      ], InAppBrowserObject.prototype, "on", null);
      return InAppBrowserObject;
  }());
  export { InAppBrowserObject };
  /**
   * @name In App Browser
   * @description Launches in app Browser
   * @usage
   * ```typescript
   * import { InAppBrowser } from '@ionic-native/in-app-browser';
   *
   * constructor(private iab: InAppBrowser) { }
   *
   *
   * ...
   *
   *
   * const browser = this.iab.create('https://ionicframework.com/');
   *
   * browser.executeScript(...);
   * browser.insertCSS(...);
   * browser.close();
   *
   * ```
   * @classes
   * InAppBrowserObject
   * @interfaces
   * InAppBrowserEvent
   * InAppBrowserOptions
   */
  var InAppBrowser = (function (_super) {
      __extends(InAppBrowser, _super);
      function InAppBrowser() {
          return _super !== null && _super.apply(this, arguments) || this;
      }
      /**
       * Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
       * @param  url {string}     The URL to load.
       * @param  target {string}  The target in which to load the URL, an optional parameter that defaults to _self.
       * @param  options {string} Options for the InAppBrowser. Optional, defaulting to: location=yes.
       *                 The options string must not contain any blank space, and each feature's
       *                 name/value pairs must be separated by a comma. Feature names are case insensitive.
       * @returns {InAppBrowserObject}
       */
      InAppBrowser.prototype.create = function (url, target, options) {
          return new InAppBrowserObject(url, target, options);
      };
      InAppBrowser.decorators = [
          { type: Injectable },
      ];
      /** @nocollapse */
      InAppBrowser.ctorParameters = function () { return []; };
      InAppBrowser = __decorate([
          Plugin({
              pluginName: 'InAppBrowser',
              plugin: 'cordova-plugin-inappbrowser',
              pluginRef: 'cordova.InAppBrowser',
              repo: 'https://github.com/apache/cordova-plugin-inappbrowser',
              platforms: ['AmazonFire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'macOS', 'Ubuntu', 'Windows', 'Windows Phone']
          })
      ], InAppBrowser);
      return InAppBrowser;
  }(IonicNativePlugin));
  export { InAppBrowser };
  //# sourceMappingURL=index.js.map