text: function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  
  (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["main"], {
    /***/
    "./$$_lazy_route_resource lazy recursive":
    /*!******************************************************!*\
      !*** ./$$_lazy_route_resource lazy namespace object ***!
      \******************************************************/
  
    /*! no static exports found */
  
    /***/
    function $$_lazy_route_resourceLazyRecursive(module, exports) {
      function webpackEmptyAsyncContext(req) {
        // Here Promise.resolve().then() is used instead of new Promise() to prevent
        // uncaught exception popping up in devtools
        return Promise.resolve().then(function () {
          var e = new Error("Cannot find module '" + req + "'");
          e.code = 'MODULE_NOT_FOUND';
          throw e;
        });
      }
  
      webpackEmptyAsyncContext.keys = function () {
        return [];
      };
  
      webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
      module.exports = webpackEmptyAsyncContext;
      webpackEmptyAsyncContext.id = "./$$_lazy_route_resource lazy recursive";
      /***/
    },
  
    /***/
    "./src/app/app-routing.module.ts":
    /*!***************************************!*\
      !*** ./src/app/app-routing.module.ts ***!
      \***************************************/
  
    /*! exports provided: AppRoutingModule */
  
    /***/
    function srcAppAppRoutingModuleTs(module, __webpack_exports__, __webpack_require__) {
      "use strict";
  
      __webpack_require__.r(__webpack_exports__);
      /* harmony export (binding) */
  
  
      __webpack_require__.d(__webpack_exports__, "AppRoutingModule", function () {
        return AppRoutingModule;
      });
      /* harmony import */
  
  
      var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
      /*! @angular/core */
      "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
      /* harmony import */
  
  
      var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
      /*! @angular/router */
      "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
  
      var routes = [];
  
      var AppRoutingModule = function AppRoutingModule() {
        _classCallCheck(this, AppRoutingModule);
      };
  
      AppRoutingModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
        type: AppRoutingModule
      });
      AppRoutingModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
        factory: function AppRoutingModule_Factory(t) {
          return new (t || AppRoutingModule)();
        },
        imports: [[_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"].forRoot(routes)], _angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"]]
      });
  
      (function () {
        (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsetNgModuleScope"](AppRoutingModule, {
          imports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"]],
          exports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"]]
        });
      })();
      /*@__PURE__*/
  
  
      (function () {
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AppRoutingModule, [{
          type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"],
          args: [{
            imports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"].forRoot(routes)],
            exports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"]]
          }]
        }], null, null);
      })();
      /***/
  
    },
  
    /***/
    "./src/app/app.component.ts":
    /*!**********************************!*\
      !*** ./src/app/app.component.ts ***!
      \**********************************/
  
    /*! exports provided: AppComponent */
  
    /***/
    function srcAppAppComponentTs(module, __webpack_exports__, __webpack_require__) {
      "use strict";
  
      __webpack_require__.r(__webpack_exports__);
      /* harmony export (binding) */
  
  
      __webpack_require__.d(__webpack_exports__, "AppComponent", function () {
        return AppComponent;
      });
      /* harmony import */
  
  
      var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
      /*! @angular/core */
      "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
      /* harmony import */
  
  
      var _calculator_calculator_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
      /*! ./calculator/calculator.component */
      "./src/app/calculator/calculator.component.ts");
      /* harmony import */
  
  
      var ngx_ui_loader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
      /*! ngx-ui-loader */
      "./node_modules/ngx-ui-loader/__ivy_ngcc__/fesm2015/ngx-ui-loader.js");
  
      var AppComponent = function AppComponent() {
        _classCallCheck(this, AppComponent);
  
        this.title = 'Calculator Dawid Firląg';
      };
  
      AppComponent.ɵfac = function AppComponent_Factory(t) {
        return new (t || AppComponent)();
      };
  
      AppComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
        type: AppComponent,
        selectors: [["app-root"]],
        decls: 4,
        vars: 0,
        consts: [[1, "container"], [1, "container-fluid"]],
        template: function AppComponent_Template(rf, ctx) {
          if (rf & 1) {
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "div", 1);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](2, "app-calculator");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](3, "ngx-ui-loader");
          }
        },
        directives: [_calculator_calculator_component__WEBPACK_IMPORTED_MODULE_1__["CalculatorComponent"], ngx_ui_loader__WEBPACK_IMPORTED_MODULE_2__["ɵb"]],
        styles: ["\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2FwcC5jb21wb25lbnQuc2NzcyJ9 */"]
      });
      /*@__PURE__*/
  
      (function () {
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AppComponent, [{
          type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"],
          args: [{
            selector: 'app-root',
            templateUrl: './app.component.html',
            styleUrls: ['./app.component.scss']
          }]
        }], null, null);
      })();
      /***/
  
    },
  
    /***/
    "./src/app/app.module.ts":
    /*!*******************************!*\
      !*** ./src/app/app.module.ts ***!
      \*******************************/
  
    /*! exports provided: AppModule */
  
    /***/
    function srcAppAppModuleTs(module, __webpack_exports__, __webpack_require__) {
      "use strict";
  
      __webpack_require__.r(__webpack_exports__);
      /* harmony export (binding) */
  
  
      __webpack_require__.d(__webpack_exports__, "AppModule", function () {
        return AppModule;
      });
      /* harmony import */
  
  
      var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
      /*! @angular/platform-browser */
      "./node_modules/@angular/platform-browser/__ivy_ngcc__/fesm2015/platform-browser.js");
      /* harmony import */
  
  
      var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
      /*! @angular/core */
      "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
      /* harmony import */
  
  
      var _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
      /*! @ng-bootstrap/ng-bootstrap */
      "./node_modules/@ng-bootstrap/ng-bootstrap/__ivy_ngcc__/fesm2015/ng-bootstrap.js");
      /* harmony import */
  
  
      var _angular_common_http__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
      /*! @angular/common/http */
      "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/http.js");
      /* harmony import */
  
  
      var _app_routing_module__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
      /*! ./app-routing.module */
      "./src/app/app-routing.module.ts");
      /* harmony import */
  
  
      var _angular_forms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
      /*! @angular/forms */
      "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
      /* harmony import */
  
  
      var ngx_ui_loader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
      /*! ngx-ui-loader */
      "./node_modules/ngx-ui-loader/__ivy_ngcc__/fesm2015/ngx-ui-loader.js");
      /* harmony import */
  
  
      var _app_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
      /*! ./app.component */
      "./src/app/app.component.ts");
      /* harmony import */
  
  
      var _calculator_calculator_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
      /*! ./calculator/calculator.component */
      "./src/app/calculator/calculator.component.ts");
  
      var AppModule = function AppModule() {
        _classCallCheck(this, AppModule);
      };
  
      AppModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({
        type: AppModule,
        bootstrap: [_app_component__WEBPACK_IMPORTED_MODULE_7__["AppComponent"]]
      });
      AppModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({
        factory: function AppModule_Factory(t) {
          return new (t || AppModule)();
        },
        providers: [],
        imports: [[_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_2__["NgbModule"], _angular_platform_browser__WEBPACK_IMPORTED_MODULE_0__["BrowserModule"], _app_routing_module__WEBPACK_IMPORTED_MODULE_4__["AppRoutingModule"], _angular_common_http__WEBPACK_IMPORTED_MODULE_3__["HttpClientModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_5__["FormsModule"], ngx_ui_loader__WEBPACK_IMPORTED_MODULE_6__["NgxUiLoaderModule"]]]
      });
  
      (function () {
        (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵsetNgModuleScope"](AppModule, {
          declarations: [_app_component__WEBPACK_IMPORTED_MODULE_7__["AppComponent"], _calculator_calculator_component__WEBPACK_IMPORTED_MODULE_8__["CalculatorComponent"]],
          imports: [_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_2__["NgbModule"], _angular_platform_browser__WEBPACK_IMPORTED_MODULE_0__["BrowserModule"], _app_routing_module__WEBPACK_IMPORTED_MODULE_4__["AppRoutingModule"], _angular_common_http__WEBPACK_IMPORTED_MODULE_3__["HttpClientModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_5__["FormsModule"], ngx_ui_loader__WEBPACK_IMPORTED_MODULE_6__["NgxUiLoaderModule"]]
        });
      })();
      /*@__PURE__*/
  
  
      (function () {
        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](AppModule, [{
          type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"],
          args: [{
            declarations: [_app_component__WEBPACK_IMPORTED_MODULE_7__["AppComponent"], _calculator_calculator_component__WEBPACK_IMPORTED_MODULE_8__["CalculatorComponent"]],
            imports: [_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_2__["NgbModule"], _angular_platform_browser__WEBPACK_IMPORTED_MODULE_0__["BrowserModule"], _app_routing_module__WEBPACK_IMPORTED_MODULE_4__["AppRoutingModule"], _angular_common_http__WEBPACK_IMPORTED_MODULE_3__["HttpClientModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_5__["FormsModule"], ngx_ui_loader__WEBPACK_IMPORTED_MODULE_6__["NgxUiLoaderModule"]],
            providers: [],
            bootstrap: [_app_component__WEBPACK_IMPORTED_MODULE_7__["AppComponent"]]
          }]
        }], null, null);
      })();
      /***/
  
    },
  
    /***/
    "./src/app/calculator/calculator.component.ts":
    /*!****************************************************!*\
      !*** ./src/app/calculator/calculator.component.ts ***!
      \****************************************************/
  
    /*! exports provided: CalculatorComponent */
  
    /***/
    function srcAppCalculatorCalculatorComponentTs(module, __webpack_exports__, __webpack_require__) {
      "use strict";
  
      __webpack_require__.r(__webpack_exports__);
      /* harmony export (binding) */
  
  
      __webpack_require__.d(__webpack_exports__, "CalculatorComponent", function () {
        return CalculatorComponent;
      });
      /* harmony import */
  
  
      var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
      /*! @angular/core */
      "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
      /* harmony import */
  
  
      var _calculator_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
      /*! ./calculator.service */
      "./src/app/calculator/calculator.service.ts");
      /* harmony import */
  
  
      var ngx_ui_loader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
      /*! ngx-ui-loader */
      "./node_modules/ngx-ui-loader/__ivy_ngcc__/fesm2015/ngx-ui-loader.js");
      /* harmony import */
  
  
      var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
      /*! @angular/forms */
      "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
      /* harmony import */
  
  
      var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
      /*! @angular/common */
      "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
  
      function CalculatorComponent_small_10_Template(rf, ctx) {
        if (rf & 1) {
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "small", 18);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
        }
  
        if (rf & 2) {
          var ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", ctx_r2.errorMessage$, " ");
        }
      }
  
      function CalculatorComponent_small_11_Template(rf, ctx) {
        if (rf & 1) {
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "small", 18);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1, " Invalid expression ");
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
        }
      }
  
      function CalculatorComponent_small_12_Template(rf, ctx) {
        if (rf & 1) {
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "small", 18);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1, " Expression can't be empty ");
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
        }
      }
  
      function CalculatorComponent_div_19_Template(rf, ctx) {
        if (rf & 1) {
          var _r8 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 13);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1, " Result : ");
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "span");
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](3);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](4, "span");
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](5);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](6, "button", 19);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function CalculatorComponent_div_19_Template_button_click_6_listener() {
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r8);
  
            var ctx_r7 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
  
            return ctx_r7.saveExpression(ctx_r7.expression$);
          });
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](7, "Save");
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
        }
  
        if (rf & 2) {
          var ctx_r5 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](ctx_r5.expression$);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" = ", ctx_r5.result$, "");
        }
      }
  
      function CalculatorComponent_tr_35_Template(rf, ctx) {
        if (rf & 1) {
          var _r11 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "tr");
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "th", 20);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](2);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "td");
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](4);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](5, "td");
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](6, "button", 21);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function CalculatorComponent_tr_35_Template_button_click_6_listener() {
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r11);
  
            var row_r9 = ctx.$implicit;
  
            var ctx_r10 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
  
            return ctx_r10.deleteExpression(row_r9.id);
          });
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](7, "Remove");
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
        }
  
        if (rf & 2) {
          var row_r9 = ctx.$implicit;
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](row_r9.expression);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
  
          _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](row_r9.result);
        }
      }
  
      var CalculatorComponent = /*#__PURE__*/function () {
        function CalculatorComponent(calculatorQueryService, ngxService) {
          _classCallCheck(this, CalculatorComponent);
  
          this.calculatorQueryService = calculatorQueryService;
          this.ngxService = ngxService;
          this.result$ = "-";
          this.expression$ = "-";
          this.errorMessage$ = "-";
          this.invalidExpression$ = false;
          this.emptyExpression$ = false;
          this.isError$ = false;
        }
  
        _createClass(CalculatorComponent, [{
          key: "ngOnInit",
          value: function ngOnInit() {
            this.loadExpressions();
          }
        }, {
          key: "deleteExpression",
          value: function deleteExpression(id) {
            var _this = this;
  
            this.ngxService.start();
            this.calculatorQueryService.deleteExpression(id).subscribe(function (res) {
              _this.ngxService.stop(); // stop foreground spinner of the master loader with 'default' taskId
  
  
              if (res && res.hasOwnProperty("errorMessage")) {
                _this.isError$ = true;
                _this.errorMessage$ = res.errorMessage;
              }
  
              _this.loadExpressions();
            });
          }
        }, {
          key: "loadExpressions",
          value: function loadExpressions() {
            var _this2 = this;
  
            this.ngxService.start();
            this.calculatorQueryService.loadExpressions().subscribe(function (res) {
              _this2.ngxService.stop(); // stop foreground spinner of the master loader with 'default' taskId
  
  
              if (res && res.hasOwnProperty("errorMessage")) {
                _this2.isError$ = true;
                _this2.errorMessage$ = res.errorMessage;
              } else if (res.length == 0) {
                _this2.invalidExpression$ = true;
                _this2.result$ = "-";
                return;
              }
  
              if (res && res.hasOwnProperty("list")) {
                _this2.expressionList$ = res.list;
              }
            });
          }
        }, {
          key: "saveExpression",
          value: function saveExpression(expression) {
            var _this3 = this;
  
            this.ngxService.start();
            this.calculatorQueryService.saveExpression(expression).subscribe(function (res) {
              _this3.ngxService.stop(); // stop foreground spinner of the master loader with 'default' taskId
  
  
              if (res && res.hasOwnProperty("errorMessage")) {
                _this3.isError$ = true;
                _this3.errorMessage$ = res.errorMessage;
              }
  
              _this3.result$ = "-";
              _this3.expression$ = "-";
  
              _this3.loadExpressions();
            });
          }
        }, {
          key: "calculateExpression",
          value: function calculateExpression(expression) {
            var _this4 = this;
  
            this.ngxService.start();
            this.invalidExpression$ = false;
            this.isError$ = false;
            this.errorMessage$ = "";
            this.emptyExpression$ = false;
            this.expression$ = expression;
  
            if (this.expression$.length == 0) {
              this.ngxService.stop();
              this.emptyExpression$ = true;
              return;
            }
  
            this.calculatorQueryService.calculateExpression(expression).subscribe(function (res) {
              _this4.ngxService.stop(); // stop foreground spinner of the master loader with 'default' taskId
  
  
              if (res && res.hasOwnProperty("errorMessage")) {
                _this4.isError$ = true;
                _this4.errorMessage$ = res.errorMessage;
              } else if (res.length == 0) {
                _this4.invalidExpression$ = true;
                _this4.result$ = "-";
                return;
              }
  
              if (res && res.hasOwnProperty("double")) {
                _this4.result$ = res["double"];
              }
            });
          }
        }]);
  
        return CalculatorComponent;
      }();
  
      CalculatorComponent.ɵfac = function CalculatorComponent_Factory(t) {
        return new (t || CalculatorComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_calculator_service__WEBPACK_IMPORTED_MODULE_1__["CalculatorService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ngx_ui_loader__WEBPACK_IMPORTED_MODULE_2__["NgxUiLoaderService"]));
      };
  
      CalculatorComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
        type: CalculatorComponent,
        selectors: [["app-calculator"]],
        decls: 40,
        vars: 5,
        consts: [[1, "my-box"], [1, "text-central"], [3, "ngSubmit"], ["calculatorForm", "ngForm"], [1, "form-group"], ["for", "calculate-expression-input"], ["type", "input", "id", "calculate-expression-input", "placeholder", "1+2*(9+1)", 1, "form-control"], ["input", ""], ["class", "error text-danger", 4, "ngIf"], ["id", "emailHelp", 1, "form-text", "text-muted"], ["type", "button", 1, "btn", "btn-primary", 3, "click"], [1, "row"], ["class", "col-md-12", 4, "ngIf"], [1, "col-md-12"], [1, "table"], ["scope", "col"], [4, "ngFor", "ngForOf"], [1, "float-right"], [1, "error", "text-danger"], [1, "btn", "btn-primary", "float-right", 3, "click"], ["scope", "row"], [1, "btn", "btn-danger", "btn-sm", 3, "click"]],
        template: function CalculatorComponent_Template(rf, ctx) {
          if (rf & 1) {
            var _r12 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "h2", 1);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](2, "Math expression interpreter");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "form", 2, 3);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("ngSubmit", function CalculatorComponent_Template_form_ngSubmit_3_listener() {
              _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r12);
  
              var _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](9);
  
              return ctx.calculateExpression(_r1.value);
            });
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](5, "div", 4);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](6, "label", 5);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](7, "Calculate expression");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](8, "input", 6, 7);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](10, CalculatorComponent_small_10_Template, 2, 1, "small", 8);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](11, CalculatorComponent_small_11_Template, 2, 0, "small", 8);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](12, CalculatorComponent_small_12_Template, 2, 0, "small", 8);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](13, "small", 9);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](14, "Available operators: +-*/().");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](15, "button", 10);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function CalculatorComponent_Template_button_click_15_listener() {
              _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r12);
  
              var _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](9);
  
              return ctx.calculateExpression(_r1.value);
            });
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](16, "Calculate");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](17, "hr");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](18, "div", 11);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](19, CalculatorComponent_div_19_Template, 8, 2, "div", 12);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](20, "hr");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](21, "div", 11);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](22, "div", 13);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](23, "h5");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](24, "Saved results:");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](25, "table", 14);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](26, "thead");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](27, "tr");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](28, "th", 15);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](29, "Expression");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](30, "th", 15);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](31, "Result");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](32, "th", 15);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](33, "Options");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](34, "tbody");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](35, CalculatorComponent_tr_35_Template, 8, 2, "tr", 16);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](36, "div", 11);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](37, "div", 13);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](38, "small", 17);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](39, "Powered by Dawid Firl\u0105g");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
          }
  
          if (rf & 2) {
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](10);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.isError$);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.invalidExpression$);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.emptyExpression$);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](7);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.result$ != "-");
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](16);
  
            _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.expressionList$);
          }
        },
        directives: [_angular_forms__WEBPACK_IMPORTED_MODULE_3__["ɵangular_packages_forms_forms_y"], _angular_forms__WEBPACK_IMPORTED_MODULE_3__["NgControlStatusGroup"], _angular_forms__WEBPACK_IMPORTED_MODULE_3__["NgForm"], _angular_common__WEBPACK_IMPORTED_MODULE_4__["NgIf"], _angular_common__WEBPACK_IMPORTED_MODULE_4__["NgForOf"]],
        styles: ["\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2NhbGN1bGF0b3IvY2FsY3VsYXRvci5jb21wb25lbnQuc2NzcyJ9 */"]
      });
      /*@__PURE__*/
  
      (function () {
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CalculatorComponent, [{
          type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"],
          args: [{
            selector: 'app-calculator',
            templateUrl: './calculator.component.html',
            styleUrls: ['./calculator.component.scss']
          }]
        }], function () {
          return [{
            type: _calculator_service__WEBPACK_IMPORTED_MODULE_1__["CalculatorService"]
          }, {
            type: ngx_ui_loader__WEBPACK_IMPORTED_MODULE_2__["NgxUiLoaderService"]
          }];
        }, null);
      })();
      /***/
  
    },
  
    /***/
    "./src/app/calculator/calculator.service.ts":
    /*!**************************************************!*\
      !*** ./src/app/calculator/calculator.service.ts ***!
      \**************************************************/
  
    /*! exports provided: CalculatorService */
  
    /***/
    function srcAppCalculatorCalculatorServiceTs(module, __webpack_exports__, __webpack_require__) {
      "use strict";
  
      __webpack_require__.r(__webpack_exports__);
      /* harmony export (binding) */
  
  
      __webpack_require__.d(__webpack_exports__, "CalculatorService", function () {
        return CalculatorService;
      });
      /* harmony import */
  
  
      var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
      /*! @angular/core */
      "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
      /* harmony import */
  
  
      var _angular_common_http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
      /*! @angular/common/http */
      "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/http.js");
      /* harmony import */
  
  
      var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
      /*! rxjs */
      "./node_modules/rxjs/_esm2015/index.js");
      /* harmony import */
  
  
      var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
      /*! rxjs/operators */
      "./node_modules/rxjs/_esm2015/operators/index.js");
  
      var CalculatorService = /*#__PURE__*/function () {
        function CalculatorService(httpClient) {
          _classCallCheck(this, CalculatorService);
  
          this.httpClient = httpClient;
          this.result$ = "none";
        }
  
        _createClass(CalculatorService, [{
          key: "deleteExpression",
          value: function deleteExpression(id) {
            return this.httpClient["delete"]("http://localhost:8080/expression/delete-expression/" + id).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(this.handleError('calculateExpression')));
          }
        }, {
          key: "calculateExpression",
          value: function calculateExpression(expression) {
            expression = encodeURIComponent(expression);
            var params = new _angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpParams"]().set("expression", expression);
            return this.httpClient.get("http://localhost:8080/calculator/get-calculated-expression", {
              params: params,
              responseType: "json"
            }).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(this.handleError('calculateExpression')));
          }
        }, {
          key: "saveExpression",
          value: function saveExpression(expression) {
            var headers = new _angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpHeaders"]();
            headers = headers.set('Content-Type', 'application/json');
            var json = JSON.stringify({
              expression: expression
            });
            return this.httpClient.post("http://localhost:8080/expression/save-expression", json, {
              headers: headers
            }).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(this.handleError('calculateExpression')));
          }
        }, {
          key: "loadExpressions",
          value: function loadExpressions() {
            return this.httpClient.get("http://localhost:8080/expression/get-saved-expressions").pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(this.handleError('calculateExpression')));
          }
        }, {
          key: "handleError",
          value: function handleError() {
            var operation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'operation';
            var result = arguments.length > 1 ? arguments[1] : undefined;
            return function (error) {
              // TODO: send the error to remote logging infrastructure
              console.error(error); // log to console instead
  
              if (error.error.hasOwnProperty("message")) {
                result = {
                  errorMessage: error.error.message
                };
              }
  
              return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(result);
            };
          }
        }]);
  
        return CalculatorService;
      }();
  
      CalculatorService.ɵfac = function CalculatorService_Factory(t) {
        return new (t || CalculatorService)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpClient"]));
      };
  
      CalculatorService.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
        token: CalculatorService,
        factory: CalculatorService.ɵfac,
        providedIn: 'root'
      });
      /*@__PURE__*/
  
      (function () {
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CalculatorService, [{
          type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
          args: [{
            providedIn: 'root'
          }]
        }], function () {
          return [{
            type: _angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpClient"]
          }];
        }, null);
      })();
      /***/
  
    },
  
    /***/
    "./src/environments/environment.ts":
    /*!*****************************************!*\
      !*** ./src/environments/environment.ts ***!
      \*****************************************/
  
    /*! exports provided: environment */
  
    /***/
    function srcEnvironmentsEnvironmentTs(module, __webpack_exports__, __webpack_require__) {
      "use strict";
  
      __webpack_require__.r(__webpack_exports__);
      /* harmony export (binding) */
  
  
      __webpack_require__.d(__webpack_exports__, "environment", function () {
        return environment;
      }); // This file can be replaced during build by using the `fileReplacements` array.
      // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
      // The list of file replacements can be found in `angular.json`.
  
  
      var environment = {
        production: false
      };
      /*
       * For easier debugging in development mode, you can import the following file
       * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
       *
       * This import should be commented out in production mode because it will have a negative impact
       * on performance if an error is thrown.
       */
      // import 'zone.js/dist/zone-error';  // Included with Angular CLI.
  
      /***/
    },
  
    /***/
    "./src/main.ts":
    /*!*********************!*\
      !*** ./src/main.ts ***!
      \*********************/
  
    /*! no exports provided */
  
    /***/
    function srcMainTs(module, __webpack_exports__, __webpack_require__) {
      "use strict";
  
      __webpack_require__.r(__webpack_exports__);
      /* harmony import */
  
  
      var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
      /*! @angular/core */
      "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
      /* harmony import */
  
  
      var _environments_environment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
      /*! ./environments/environment */
      "./src/environments/environment.ts");
      /* harmony import */
  
  
      var _app_app_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
      /*! ./app/app.module */
      "./src/app/app.module.ts");
      /* harmony import */
  
  
      var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
      /*! @angular/platform-browser */
      "./node_modules/@angular/platform-browser/__ivy_ngcc__/fesm2015/platform-browser.js");
  
      if (_environments_environment__WEBPACK_IMPORTED_MODULE_1__["environment"].production) {
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["enableProdMode"])();
      }
  
      _angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__["platformBrowser"]().bootstrapModule(_app_app_module__WEBPACK_IMPORTED_MODULE_2__["AppModule"])["catch"](function (err) {
        return console.error(err);
      });
      /***/
  
    },
  
    /***/
    0:
    /*!***************************!*\
      !*** multi ./src/main.ts ***!
      \***************************/
  
    /*! no static exports found */
  
    /***/
    function _(module, exports, __webpack_require__) {
      module.exports = __webpack_require__(
      /*! /Users/Dawid/IdeaProjects/calculator/calculator-front/src/main.ts */
      "./src/main.ts");
      /***/
    }
  }, [[0, "runtime", "vendor"]]]);
  //# sourceMappingURL=main-es5.js.map