text: import { __decorate, __metadata } from 'tslib';
  import { Injectable, Component, ChangeDetectionStrategy, ChangeDetectorRef, Input, Output, EventEmitter, NgModule } from '@angular/core';
  import { OnChange } from 'ngx-bootstrap/utils';
  import { CommonModule } from '@angular/common';
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  import * as ɵngcc0 from '@angular/core';
  import * as ɵngcc1 from '@angular/common';
  
  function AlertComponent_ng_template_0_ng_template_1_Template(rf, ctx) { if (rf & 1) {
      var _r33 = ɵngcc0.ɵɵgetCurrentView();
      ɵngcc0.ɵɵelementStart(0, "button", 2);
      ɵngcc0.ɵɵlistener("click", function AlertComponent_ng_template_0_ng_template_1_Template_button_click_0_listener() { ɵngcc0.ɵɵrestoreView(_r33); var ctx_r32 = ɵngcc0.ɵɵnextContext(2); return ctx_r32.close(); });
      ɵngcc0.ɵɵelementStart(1, "span", 3);
      ɵngcc0.ɵɵtext(2, "\u00D7");
      ɵngcc0.ɵɵelementEnd();
      ɵngcc0.ɵɵelementStart(3, "span", 4);
      ɵngcc0.ɵɵtext(4, "Close");
      ɵngcc0.ɵɵelementEnd();
      ɵngcc0.ɵɵelementEnd();
  } }
  function AlertComponent_ng_template_0_Template(rf, ctx) { if (rf & 1) {
      ɵngcc0.ɵɵelementStart(0, "div", 1);
      ɵngcc0.ɵɵtemplate(1, AlertComponent_ng_template_0_ng_template_1_Template, 5, 0, "ng-template", 0);
      ɵngcc0.ɵɵprojection(2);
      ɵngcc0.ɵɵelementEnd();
  } if (rf & 2) {
      var ctx_r30 = ɵngcc0.ɵɵnextContext();
      ɵngcc0.ɵɵclassMap("alert alert-" + ctx_r30.type);
      ɵngcc0.ɵɵproperty("ngClass", ctx_r30.classes);
      ɵngcc0.ɵɵadvance(1);
      ɵngcc0.ɵɵproperty("ngIf", ctx_r30.dismissible);
  } }
  var _c0 = ["*"];
  var AlertConfig = /** @class */ (function () {
      function AlertConfig() {
          /**
           * default alert type
           */
          this.type = 'warning';
          /**
           * is alerts are dismissible by default
           */
          this.dismissible = false;
          /**
           * default time before alert will dismiss
           */
          this.dismissOnTimeout = undefined;
      }
  AlertConfig.ɵfac = function AlertConfig_Factory(t) { return new (t || AlertConfig)(); };
  AlertConfig.ɵprov = ɵngcc0.ɵɵdefineInjectable({ token: AlertConfig, factory: function (t) { return AlertConfig.ɵfac(t); } });
  /*@__PURE__*/ (function () { ɵngcc0.ɵsetClassMetadata(AlertConfig, [{
          type: Injectable
      }], function () { return []; }, null); })();
      return AlertConfig;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  var AlertComponent = /** @class */ (function () {
      function AlertComponent(_config, changeDetection) {
          var _this = this;
          this.changeDetection = changeDetection;
          /**
           * Alert type.
           * Provides one of four bootstrap supported contextual classes:
           * `success`, `info`, `warning` and `danger`
           */
          this.type = 'warning';
          /**
           * If set, displays an inline "Close" button
           */
          this.dismissible = false;
          /**
           * Is alert visible
           */
          this.isOpen = true;
          /**
           * This event fires immediately after close instance method is called,
           * $event is an instance of Alert component.
           */
          this.onClose = new EventEmitter();
          /**
           * This event fires when alert closed, $event is an instance of Alert component
           */
          this.onClosed = new EventEmitter();
          this.classes = '';
          this.dismissibleChange = new EventEmitter();
          Object.assign(this, _config);
          this.dismissibleChange.subscribe((/**
           * @param {?} dismissible
           * @return {?}
           */
          function (dismissible) {
              _this.classes = _this.dismissible ? 'alert-dismissible' : '';
              _this.changeDetection.markForCheck();
          }));
      }
      /**
       * @return {?}
       */
      AlertComponent.prototype.ngOnInit = /**
       * @return {?}
       */
      function () {
          var _this = this;
          if (this.dismissOnTimeout) {
              // if dismissOnTimeout used as attr without binding, it will be a string
              setTimeout((/**
               * @return {?}
               */
              function () { return _this.close(); }), parseInt((/** @type {?} */ (this.dismissOnTimeout)), 10));
          }
      };
      // todo: animation ` If the .fade and .in classes are present on the element,
      // the alert will fade out before it is removed`
      /**
       * Closes an alert by removing it from the DOM.
       */
      // todo: animation ` If the .fade and .in classes are present on the element,
      // the alert will fade out before it is removed`
      /**
       * Closes an alert by removing it from the DOM.
       * @return {?}
       */
      AlertComponent.prototype.close = 
      // todo: animation ` If the .fade and .in classes are present on the element,
      // the alert will fade out before it is removed`
      /**
       * Closes an alert by removing it from the DOM.
       * @return {?}
       */
      function () {
          if (!this.isOpen) {
              return;
          }
          this.onClose.emit(this);
          this.isOpen = false;
          this.changeDetection.markForCheck();
          this.onClosed.emit(this);
      };
      /** @nocollapse */
      AlertComponent.ctorParameters = function () { return [
          { type: AlertConfig },
          { type: ChangeDetectorRef }
      ]; };
      AlertComponent.propDecorators = {
          type: [{ type: Input }],
          dismissible: [{ type: Input }],
          dismissOnTimeout: [{ type: Input }],
          isOpen: [{ type: Input }],
          onClose: [{ type: Output }],
          onClosed: [{ type: Output }]
      };
      __decorate([
          OnChange(),
          __metadata("design:type", Object)
      ], AlertComponent.prototype, "dismissible", void 0);
  AlertComponent.ɵfac = function AlertComponent_Factory(t) { return new (t || AlertComponent)(ɵngcc0.ɵɵdirectiveInject(AlertConfig), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ChangeDetectorRef)); };
  AlertComponent.ɵcmp = ɵngcc0.ɵɵdefineComponent({ type: AlertComponent, selectors: [["alert"], ["bs-alert"]], inputs: { type: "type", dismissible: "dismissible", isOpen: "isOpen", dismissOnTimeout: "dismissOnTimeout" }, outputs: { onClose: "onClose", onClosed: "onClosed" }, ngContentSelectors: _c0, decls: 1, vars: 1, consts: [[3, "ngIf"], ["role", "alert", 3, "ngClass"], ["type", "button", "aria-label", "Close", 1, "close", 3, "click"], ["aria-hidden", "true"], [1, "sr-only"]], template: function AlertComponent_Template(rf, ctx) { if (rf & 1) {
          ɵngcc0.ɵɵprojectionDef();
          ɵngcc0.ɵɵtemplate(0, AlertComponent_ng_template_0_Template, 3, 4, "ng-template", 0);
      } if (rf & 2) {
          ɵngcc0.ɵɵproperty("ngIf", ctx.isOpen);
      } }, directives: [ɵngcc1.NgIf, ɵngcc1.NgClass], encapsulation: 2, changeDetection: 0 });
  /*@__PURE__*/ (function () { ɵngcc0.ɵsetClassMetadata(AlertComponent, [{
          type: Component,
          args: [{
                  selector: 'alert,bs-alert',
                  template: "<ng-template [ngIf]=\"isOpen\">\n  <div [class]=\"'alert alert-' + type\" role=\"alert\" [ngClass]=\"classes\">\n    <ng-template [ngIf]=\"dismissible\">\n      <button type=\"button\" class=\"close\" aria-label=\"Close\" (click)=\"close()\">\n        <span aria-hidden=\"true\">&times;</span>\n        <span class=\"sr-only\">Close</span>\n      </button>\n    </ng-template>\n    <ng-content></ng-content>\n  </div>\n</ng-template>\n",
                  changeDetection: ChangeDetectionStrategy.OnPush
              }]
      }], function () { return [{ type: AlertConfig }, { type: ɵngcc0.ChangeDetectorRef }]; }, { type: [{
              type: Input
          }], dismissible: [{
              type: Input
          }], isOpen: [{
              type: Input
          }], onClose: [{
              type: Output
          }], onClosed: [{
              type: Output
          }], dismissOnTimeout: [{
              type: Input
          }] }); })();
      return AlertComponent;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
   */
  var AlertModule = /** @class */ (function () {
      function AlertModule() {
      }
      /**
       * @return {?}
       */
      AlertModule.forRoot = /**
       * @return {?}
       */
      function () {
          return { ngModule: AlertModule, providers: [AlertConfig] };
      };
  AlertModule.ɵmod = ɵngcc0.ɵɵdefineNgModule({ type: AlertModule });
  AlertModule.ɵinj = ɵngcc0.ɵɵdefineInjector({ factory: function AlertModule_Factory(t) { return new (t || AlertModule)(); }, imports: [[CommonModule]] });
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(AlertModule, { declarations: function () { return [AlertComponent]; }, imports: function () { return [CommonModule]; }, exports: function () { return [AlertComponent]; } }); })();
  /*@__PURE__*/ (function () { ɵngcc0.ɵsetClassMetadata(AlertModule, [{
          type: NgModule,
          args: [{
                  imports: [CommonModule],
                  declarations: [AlertComponent],
                  exports: [AlertComponent],
                  entryComponents: [AlertComponent]
              }]
      }], function () { return []; }, null); })();
      return AlertModule;
  }());
  
  export { AlertComponent, AlertConfig, AlertModule };
  
  //# sourceMappingURL=ngx-bootstrap-alert.js.map