function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }

function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }

function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }

function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }

function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }

(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["page-dump-flimstrip-page-dump-flimstrip-module"], {
  /***/
  "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/ddr/components/page-dump-revamped/page-dump-sidebar-components/page-dump-flimstrip/page-dump-flimstrip.component.html":
  /*!***********************************************************************************************************************************************************************************!*\
    !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/ddr/components/page-dump-revamped/page-dump-sidebar-components/page-dump-flimstrip/page-dump-flimstrip.component.html ***!
    \***********************************************************************************************************************************************************************************/

  /*! exports provided: default */

  /***/
  function _node_modules_rawLoader_dist_cjsJs_src_app_pages_ddr_components_pageDumpRevamped_pageDumpSidebarComponents_pageDumpFlimstrip_pageDumpFlimstripComponentHtml(module, __webpack_exports__, __webpack_require__) {
    "use strict";

    __webpack_require__.r(__webpack_exports__);
    /* harmony default export */


    __webpack_exports__["default"] = "<div *ngIf=\"contentLoading\" class=\"menu-loader\">\n    <i class=\"icons8 icons8-loading spin font-30 text-primary\"></i>\n</div>\n\n<div *ngFor=\"let image of images\">\n   <div class=\"mt-10 mb-5 py-5 font-weight-700 font-14 bottom-border border-5 blueHead\" *ngIf=\"pageDumpUtilService.isCompare\"> {{image.pageName}} ({{image.keyName}}) </div>\n    <div *ngIf=\"image.data.length > 0\">\n        <div class=\"p-grid image-container pb-20\" *ngFor=\"let img of image.data\">\n            <div [class]=\"'image-div border-all border-5' + (item.selected ? 'image-div-active':'')\"\n                *ngFor=\"let item of img\">\n                <img [attr.src]=\"item.src\" class=\"image-style\" loading=\"lazy\">\n                <div class=\"image-text\">{{item.time+'s'}}</div>\n                <div class=\"image-text1\">\n                    {{item.progress}}\n                </div>\n            </div>\n        </div>\n    </div>\n    <div class=\"text-center p-10\" *ngIf=\"image.data.length == 0\">\n        No Filmstrip Found.\n    </div>\n</div>";
    /***/
  },

  /***/
  "./src/app/pages/ddr/components/page-dump-revamped/page-dump-sidebar-components/page-dump-flimstrip/page-dump-flimstrip.component.scss":
  /*!*********************************************************************************************************************************************!*\
    !*** ./src/app/pages/ddr/components/page-dump-revamped/page-dump-sidebar-components/page-dump-flimstrip/page-dump-flimstrip.component.scss ***!
    \*********************************************************************************************************************************************/

  /*! exports provided: default */

  /***/
  function _src_app_pages_ddr_components_pageDumpRevamped_pageDumpSidebarComponents_pageDumpFlimstrip_pageDumpFlimstripComponentScss(module, __webpack_exports__, __webpack_require__) {
    "use strict";

    __webpack_require__.r(__webpack_exports__);
    /* harmony default export */


    __webpack_exports__["default"] = "app-page-dump-flimstrip {\n  display: block;\n  width: 99%;\n}\napp-page-dump-flimstrip .image-div {\n  width: 24.5%;\n  height: 140px;\n  position: relative;\n  padding: 1px;\n  border-radius: 4px;\n  margin: 0.25%;\n  margin-bottom: 25px;\n  -o-object-fit: contain;\n     object-fit: contain;\n}\napp-page-dump-flimstrip .image-div .image-style {\n  width: 100%;\n  height: 135px;\n}\napp-page-dump-flimstrip .image-div .image-text {\n  position: absolute;\n  right: 1px;\n  bottom: 1px;\n  padding: 3px 5px;\n  background-color: var(--background_color_10);\n  color: var(--color_5);\n  border-radius: 3px;\n}\napp-page-dump-flimstrip .image-div .image-text1 {\n  position: absolute;\n  right: 37%;\n  bottom: -19px;\n  padding: 3px 5px;\n  border-radius: 3px;\n}";
    /***/
  },

  /***/
  "./src/app/pages/ddr/components/page-dump-revamped/page-dump-sidebar-components/page-dump-flimstrip/page-dump-flimstrip.component.ts":
  /*!*******************************************************************************************************************************************!*\
    !*** ./src/app/pages/ddr/components/page-dump-revamped/page-dump-sidebar-components/page-dump-flimstrip/page-dump-flimstrip.component.ts ***!
    \*******************************************************************************************************************************************/

  /*! exports provided: PageDumpFlimstripComponent */

  /***/
  function _src_app_pages_ddr_components_pageDumpRevamped_pageDumpSidebarComponents_pageDumpFlimstrip_pageDumpFlimstripComponentTs(module, __webpack_exports__, __webpack_require__) {
    "use strict";

    __webpack_require__.r(__webpack_exports__);
    /* harmony export (binding) */


    __webpack_require__.d(__webpack_exports__, "PageDumpFlimstripComponent", function () {
      return PageDumpFlimstripComponent;
    });
    /* harmony import */


    var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
    /*! tslib */
    "./node_modules/tslib/tslib.es6.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 _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
    /*! @angular/core */
    "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
    /* harmony import */


    var src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! src/app/core/session/session.service */
    "./src/app/core/session/session.service.ts");
    /* harmony import */


    var src_app_pages_home_home_nsm_page_average_report_service_page_average_report_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
    /*! src/app/pages/home/home-nsm/page-average-report/service/page-average-report.service */
    "./src/app/pages/home/home-nsm/page-average-report/service/page-average-report.service.ts");
    /* harmony import */


    var src_environments_environment__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
    /*! src/environments/environment */
    "./src/environments/environment.ts");
    /* harmony import */


    var _service_page_dump_utils_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! ../../service/page-dump-utils.service */
    "./src/app/pages/ddr/components/page-dump-revamped/service/page-dump-utils.service.ts");

    var PageDumpFlimstripComponent = /*#__PURE__*/function () {
      function PageDumpFlimstripComponent(pageAverageReportService, sessionService, pageDumpUtilService) {
        _classCallCheck(this, PageDumpFlimstripComponent);

        this.pageAverageReportService = pageAverageReportService;
        this.sessionService = sessionService;
        this.pageDumpUtilService = pageDumpUtilService;
        this.payLoadObj = {};
        this.limit = 100;
        this.offset = 0;
        this.images = [];
        this.pageDetailData = {};
        this.contentLoading = false;
      }

      return _createClass(PageDumpFlimstripComponent, [{
        key: "ngOnInit",
        value: function ngOnInit() {
          if (this.pageDumpUtilService.isCompare) this.getCompareData();else this.getData();
        }
      }, {
        key: "getCompareData",
        value: function getCompareData() {
          this.images = [];

          for (var i = 0; i < this.pageDumpUtilService.comparePageReqInfoArr.length; i++) {
            this.getData(this.pageDumpUtilService.comparePageReqInfoArr[i]['data'], this.pageDumpUtilService.comparePageReqInfoArr[i]['pageVal']).then(function (res) {});
          }
        }
      }, {
        key: "getData",
        value: function getData(compareData, keyName) {
          var _this = this;

          this.payLoadObj = {};
          var pageName = "";

          if (this.pageDumpUtilService.filmStripData[0]['data'].length && !this.pageDumpUtilService.isCompare) {
            this.images = this.pageDumpUtilService.filmStripData;
            return;
          } else if (this.pageDumpUtilService.filmStripData.length > 1 && this.pageDumpUtilService.isCompare) {
            this.images = this.pageDumpUtilService.filmStripData;
            return;
          }

          var url = src_environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].api.detailedReport.harpagedetail.endpoint;

          if (this.pageDumpUtilService.isCompare) {
            var pageDumpURL = compareData.pageDumpURL;
            var sessionIndex = pageDumpURL.split(":")[pageDumpURL.split(":").length - 1];
            pageName = compareData.pageName;
            this.payLoadObj = {
              testRun: this.sessionService.session.testRun.id,
              pageName: compareData.pageName,
              pageIndex: compareData.pageIndex,
              hostName: "",
              startTime: this.pageDumpUtilService.pageReqInfo.starttime,
              endTime: this.pageDumpUtilService.pageReqInfo.endTime,
              groupName: compareData.groupName,
              sessionIndex: sessionIndex,
              productType: this.sessionService.session.cctx.prodType,
              sesLoginName: this.sessionService.session.cctx.u,
              limit: this.limit,
              offset: this.offset,
              count: 'false'
            };
          } else {
            var _pageDumpURL = this.pageDumpUtilService.pageReqInfo.node.pageDumpURL;

            var _sessionIndex = _pageDumpURL.split(":")[_pageDumpURL.split(":").length - 1];

            pageName = this.pageDumpUtilService.pageReqInfo.pageName;
            this.payLoadObj = {
              testRun: this.sessionService.session.testRun.id,
              pageName: this.pageDumpUtilService.pageReqInfo.pageName,
              pageIndex: this.pageDumpUtilService.pageReqInfo.pageIndex,
              hostName: "",
              startTime: this.pageDumpUtilService.pageReqInfo.starttime,
              endTime: this.pageDumpUtilService.pageReqInfo.endTime,
              groupName: this.pageDumpUtilService.pageReqInfo.groupName,
              sessionIndex: _sessionIndex,
              productType: this.sessionService.session.cctx.prodType,
              sesLoginName: this.sessionService.session.cctx.u,
              limit: this.limit,
              offset: this.offset,
              count: 'false'
            };
          }

          var options = {
            params: new _angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpParams"]({
              fromObject: this.payLoadObj
            })
          };
          return new Promise(function (resolve, reject) {
            _this.pageAverageReportService.get(url, options).subscribe(function (state) {
              if (state instanceof src_app_pages_home_home_nsm_page_average_report_service_page_average_report_service__WEBPACK_IMPORTED_MODULE_4__["DetailedReportLoadingState"]) {
                _this.contentLoading = true;
                return;
              }

              if (state instanceof src_app_pages_home_home_nsm_page_average_report_service_page_average_report_service__WEBPACK_IMPORTED_MODULE_4__["DetailedReportLoadedState"]) {
                var data = state.data;

                if (data.length) {
                  _this.pageDetailData = data[0];

                  _this.getFilmStripData(_this.payLoadObj.pageName, _this.pageDetailData, keyName);
                } else {
                  _this.images.push({
                    data: [],
                    pageName: pageName
                  });
                }

                resolve(state.data);
                _this.contentLoading = false;
                return;
              }

              (function (state) {
                if (state instanceof src_app_pages_home_home_nsm_page_average_report_service_page_average_report_service__WEBPACK_IMPORTED_MODULE_4__["DetailedReportLoadingErrorState"]) {
                  _this.contentLoading = false;
                  reject();
                  return;
                }
              });
            });
          });
        }
      }, {
        key: "getFilmStripData",
        value: function getFilmStripData(pageName, pageDetailData, keyName) {
          var _this2 = this;

          var HARFileName = encodeURIComponent("/logs/TR".concat(this.sessionService.session.testRun.id, "/").concat(pageDetailData['partitionName'], "/rbu_logs/harp_files/").concat(pageDetailData['fileName']));
          var url = "".concat(src_environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].api.detailedReport.rptHarVideo.endpoint, "?deviceInfo=").concat(pageDetailData['deviceInfo'], "&harFilePath=").concat(HARFileName, "&pageLoad=").concat(pageDetailData['pageLoadTime'], "&pageName=").concat(pageDetailData['pageName'], "&productKey=").concat(this.sessionService.session.cctx.pk, "&selectedTestRun=").concat(this.sessionService.session.testRun.id, "&speedIndex=").concat(pageDetailData['speedIndex'], "&testRun=").concat(this.sessionService.session.testRun.id, "&visuallyCompleteTime=").concat(pageDetailData['visuallyCompleteTime']);
          this.pageAverageReportService.get(url).subscribe(function (state) {
            var _a, _b;

            if (state instanceof src_app_pages_home_home_nsm_page_average_report_service_page_average_report_service__WEBPACK_IMPORTED_MODULE_4__["DetailedReportLoadingState"]) {
              _this2.contentLoading = true;
              return;
            }

            if (state instanceof src_app_pages_home_home_nsm_page_average_report_service_page_average_report_service__WEBPACK_IMPORTED_MODULE_4__["DetailedReportLoadedState"]) {
              var data = state.data;
              if (_this2.pageDumpUtilService.isCompare) _this2.images.push({
                data: [(_a = data === null || data === void 0 ? void 0 : data.imgArray) === null || _a === void 0 ? void 0 : _a.map(function (img, i) {
                  return {
                    src: img,
                    time: data.arrVisualProgressHoz[i],
                    progress: "".concat(data.arrVisualProgressVer[i].toFixed(2), "%"),
                    selected: false
                  };
                })],
                pageName: pageName,
                keyName: keyName
              });else {
                _this2.images = [];

                _this2.images.push({
                  data: [(_b = data === null || data === void 0 ? void 0 : data.imgArray) === null || _b === void 0 ? void 0 : _b.map(function (img, i) {
                    return {
                      src: img,
                      time: data.arrVisualProgressHoz[i],
                      progress: "".concat(data.arrVisualProgressVer[i].toFixed(2), "%"),
                      selected: false
                    };
                  })],
                  pageName: pageName,
                  keyName: keyName
                });
              }
              _this2.contentLoading = false;
              return;
            }
          }, function (state) {
            if (state instanceof src_app_pages_home_home_nsm_page_average_report_service_page_average_report_service__WEBPACK_IMPORTED_MODULE_4__["DetailedReportLoadingErrorState"]) {
              _this2.contentLoading = false;
              return;
            }
          });
        }
      }]);
    }();

    PageDumpFlimstripComponent.ctorParameters = function () {
      return [{
        type: src_app_pages_home_home_nsm_page_average_report_service_page_average_report_service__WEBPACK_IMPORTED_MODULE_4__["PageAverageReportService"]
      }, {
        type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_3__["SessionService"]
      }, {
        type: _service_page_dump_utils_service__WEBPACK_IMPORTED_MODULE_6__["PageDumpUtilsService"]
      }];
    };

    PageDumpFlimstripComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["Component"])({
      selector: 'app-page-dump-flimstrip',
      template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! raw-loader!./page-dump-flimstrip.component.html */
      "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/ddr/components/page-dump-revamped/page-dump-sidebar-components/page-dump-flimstrip/page-dump-flimstrip.component.html"))["default"],
      encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewEncapsulation"].None,
      styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! ./page-dump-flimstrip.component.scss */
      "./src/app/pages/ddr/components/page-dump-revamped/page-dump-sidebar-components/page-dump-flimstrip/page-dump-flimstrip.component.scss"))["default"]]
    })], PageDumpFlimstripComponent);
    /***/
  },

  /***/
  "./src/app/pages/ddr/components/page-dump-revamped/page-dump-sidebar-components/page-dump-flimstrip/page-dump-flimstrip.module.ts":
  /*!****************************************************************************************************************************************!*\
    !*** ./src/app/pages/ddr/components/page-dump-revamped/page-dump-sidebar-components/page-dump-flimstrip/page-dump-flimstrip.module.ts ***!
    \****************************************************************************************************************************************/

  /*! exports provided: PageDumpFlimstripModule */

  /***/
  function _src_app_pages_ddr_components_pageDumpRevamped_pageDumpSidebarComponents_pageDumpFlimstrip_pageDumpFlimstripModuleTs(module, __webpack_exports__, __webpack_require__) {
    "use strict";

    __webpack_require__.r(__webpack_exports__);
    /* harmony export (binding) */


    __webpack_require__.d(__webpack_exports__, "PageDumpFlimstripModule", function () {
      return PageDumpFlimstripModule;
    });
    /* harmony import */


    var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
    /*! tslib */
    "./node_modules/tslib/tslib.es6.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 _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
    /*! @angular/common */
    "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
    /* harmony import */


    var _page_dump_flimstrip_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ./page-dump-flimstrip.component */
    "./src/app/pages/ddr/components/page-dump-revamped/page-dump-sidebar-components/page-dump-flimstrip/page-dump-flimstrip.component.ts");
    /* harmony import */


    var _angular_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
    /*! @angular/router */
    "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");

    var route = [{
      path: '',
      component: _page_dump_flimstrip_component__WEBPACK_IMPORTED_MODULE_3__["PageDumpFlimstripComponent"]
    }];

    var PageDumpFlimstripModule = /*#__PURE__*/_createClass(function PageDumpFlimstripModule() {
      _classCallCheck(this, PageDumpFlimstripModule);
    });

    PageDumpFlimstripModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
      declarations: [_page_dump_flimstrip_component__WEBPACK_IMPORTED_MODULE_3__["PageDumpFlimstripComponent"]],
      imports: [_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"], _angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterModule"].forChild(route)],
      exports: [_angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterModule"]]
    })], PageDumpFlimstripModule);
    /***/
  }
}]);