(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["components-nethavoc-home-nethavoc-home-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/disable-havoc-config/disable-havoc-config.component.html":
/*!****************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/disable-havoc-config/disable-havoc-config.component.html ***!
  \****************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("\n<p-dialog class=\"ns-scenario\" header=\"Disable All Havocs\"  [(visible)]=\"isVisible\" [modal]=\"true\" [style]=\"{width: '45vw'}\">\n    <div class=\"p-grid p-align-center p-nogutter16\">\n    <div class=\"p-col-12 p-grid p-align-center\">\n        <span>This action will disable havoc injection and stop all running havocs.</span>\n        <span class=\"ml-6\" *ngIf=\"selectedDisableOption !== 'Indefinate'\" >and scenarios</span>\n    </div>\n    <div class=\"p-col-fixed\">\n        <p-selectButton [options]=\"disableOptions\" [(ngModel)]=\"selectedDisableOption\"></p-selectButton>\n        <button pButton (mouseenter)=\"op.show($event)\" (mouseleave)=\"op.hide()\" icon=\"icons8 icons8-info\" class=\"btn-icon\"></button>\n    </div>\n    <div *ngIf=\"selectedDisableOption === 'Duration'\" class=\"p-col-fixed\">\n        <p-calendar [(ngModel)]=\"dateTime\" [timeOnly]=\"true\" [showSeconds]=\"true\" hourFormat=\"24\" dateFormat=\"HH:mm:ss\"></p-calendar>\n    </div>\n    <div *ngIf=\"selectedDisableOption === 'Specific'\" class=\"p-col-fixed\">\n        <p-calendar [(ngModel)]=\"dateTime\" appendTo=\"body\"  [showTime]=\"true\"></p-calendar>\n    </div>\n    </div>\n    <div class=\"p-grid mb-16 p-nogutter16\">\n        <div class=\"p-col-12 form-group\">\n            <label class=\"p-col-2\" for=\"ip-domain\">Reason</label>\n            <div class=\"p-col-4\">\n                <p-dropdown appendTo=\"body\"  styleClass=\"w-100-p\" placeholder=\"Select Reason\"  [options]=\"reasonOptions\"\n                [(ngModel)]=\"selectedReason\"></p-dropdown>\n            </div>\n            <div *ngIf=\"selectedReason === 'others'\" class=\"p-col-4\">\n                <input  type=\"text\" class=\"w-100-p\" pInputText [(ngModel)]=\"otherVal\" />\n            </div>\n        </div>\n</div>\n\n<p-overlayPanel appendTo=\"body\"  styleClass=\"popHover\" #op>\n    <ng-template pTemplate>\n        <ul class=\"p-0\" >\n            <li class=\"mb-16\">\n                <strong>Indefinate</strong>\n                All scenario will be disabled for an <strong>Indefinate</strong> time till it is enabled back.\n            </li>\n            <li class=\"mb-16\">\n                <strong>Duration</strong>\n                All scenario will be disabled for a specific <strong>Duration</strong> of time.\n            </li>\n            <li class=\"mb-16\">\n                <strong>Date and Time</strong>\n                All scenario will be disabled for a specific <strong>Data and Time</strong>.\n            </li>\n        </ul>\n        </ng-template>\n    </p-overlayPanel>\n        <p-footer class=\"p-grid p-align-center p-justify-center\">\n                <button pButton type=\"button\" label=\"Apply\" [pTooltip]=\"!isReadPermisson ? 'You don\\'t have permission to apply(You need Havocs: Havoc Configuration permission)' : 'Apply'\" [disabled]=\"!isReadPermisson\" (click)=\"disableAllHavoc()\" class=\"ui-btn-primary mr-8\"></button>\n                <button pButton type=\"button\" label=\"Cancel\" (click)=\"isVisible = false\" class=\"ui-button-secondary mr-5\"></button>\n        </p-footer>\n</p-dialog>\n");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/nethavoc-havocrundetails.component.html":
/*!************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/nethavoc-havocrundetails.component.html ***!
  \************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<cav-table *ngIf=\" !isNoPermisson\" [value]=\"havocDetails\" [rowGrouping]=\"groupList\" [headers]=\"tablejson.headers\"\n  [scrollable]=\"false\" (clickButtonEvent)=\"clickHavocDetails($event)\"\n  currentPageReportTemplate=\"showing {first} to {last} of {totalRecords}\" [tableConfig]=\"tablejson.tableConfig\"\n  [innerHTML]=\"paginatorInnerHTML\" [paginator]=\"true\" [rows]=\"rows\" scrollHeight=\"calc(100vh - 400px)\"\n  [rowsPerPageOptions]=\"[10, 20, 50, 100]\" [first]=\"first\">\n\n</cav-table>\n<app-havoc-design [havocDetails]=\"origHavocDetailsResp\"></app-havoc-design>\n<p-tieredMenu #havocRunDetails [model]=\"havocRunMenuItems\" appendTo=\"body\" [popup]=\"true\"></p-tieredMenu>\n\n<p-overlayPanel appendTo=\"body\" #havocrunoverlay [dismissable]=\"true\" styleClass=\"popHover\">\n\n  <ul class=\"m-0 p-0 width-300\" *ngIf=\"havocinfo\">\n\n    <li class=\"my-8 p-0\" *ngFor=\"let key of havocinfo | objectKeys\">\n\n      <strong>{{ key | camelTotitle }} :</strong>\n\n      <!-- If NOT object -->\n      <span class=\"word-break\" *ngIf=\"!(havocinfo[key] | isObject)\">\n        {{ havocinfo[key] }}\n      </span>\n\n      <!-- If object -->\n      <ul class=\"m-0 p-0\" *ngIf=\"havocinfo[key] | isObject\">\n\n        <li class=\"my-8 p-0\" *ngFor=\"let subKey of havocinfo[key] | objectKeys\">\n\n          <strong>{{ subKey | camelTotitle }} :</strong>\n          {{ havocinfo[key][subKey] }}\n\n        </li>\n\n      </ul>\n\n    </li>\n\n    <li class=\"my-8 p-0\">\n      <a class=\"btn-icon text-underline\" (click)=\"viewDetailsConfig()\">\n        View More Details\n      </a>\n    </li>\n\n  </ul>\n\n</p-overlayPanel>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocruns/nethavoc-havocruns.component.html":
/*!************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocruns/nethavoc-havocruns.component.html ***!
  \************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<cav-table  *ngIf=\"!isNoPermission\" [value]=\"havocRunList\" [headerRelativePath]=\"relativePathforHavocRuns\" [scrollable]=\"true\"\n    (clickButtonEvent)=\"clickHavocRunEvent($event)\" [totalRecords]=\"totalRecords\" [lazyLoadingProcessBar]=\"loading\" [rowSelection]= \"selectedHavocRun\"\n    [first]=\"first\" [rows]=\"rows\" (onLazyLoad)=\"loadPagination($event)\" scrollHeight=\"calc(100vh - 400px)\"\n    [responsive]=\"true\" [innerHTML]=\"paginatorInnerHTML\"></cav-table>\n\n<p-confirmDialog key=\"havocrun-delete\"></p-confirmDialog>\n\n\n<p-dialog header=\"Import HavocRun Number\" [(visible)]=\"openDialogForImport\" modal=\"true\" [closable]=\"false\"\n    [resizable]=\"false\" [style]=\"{width:'400px'}\">\n    <div class=\"p-grid p-align-center\">\n        <div class=\"p-col-12\">\n            Choose the Project and Sub Project where you want to upload the HavocRun Number.\n        </div>\n        <div class=\"p-col-4 mt-8\">Project </div>\n        <div class=\"p-col-8 mt-8\">\n            <p-dropdown [options]=\"projectOptions\" placeholder=\"Select Project\" [(ngModel)]=\"selectedProject\"\n                appendTo=\"body\" dropdownIcon=\"icons8 icons8-expand-arrow\"\n                (onChange)=\"updateSubProject($event)\"></p-dropdown>\n        </div>\n        <div class=\"p-col-4 mt-7\">Sub Project </div>\n        <div class=\"p-col-8 mt-7\">\n            <p-dropdown [options]=\"subProjectOptions\" placeholder=\"Select Sub-project\" [(ngModel)]=\"selectedSubProject\"\n                appendTo=\"body\" dropdownIcon=\"icons8 icons8-expand-arrow\"></p-dropdown>\n        </div>\n        <div class=\"p-col-4 mt-7\">Upload File</div>\n        <div class=\"p-col-8 mt-7\">\n            <p-fileUpload #upload1 class=\"mr-5\" mode=\"basic\" name=\"files[]\" (onSelect)=\"handleFileUpload($event)\"\n                accept=\".json\" styleClass=\"custom-file-upload1\" label=\"Upload Json\"></p-fileUpload>\n        </div>\n    </div>\n    <p-footer>\n        <button type=\"button\" pButton (click)=\"closeImport()\" label=\"Cancel\"\n            class=\"ui-button-rounded ui-button-secondary mx-3\"></button>\n        <button type=\"button\" pButton (click)=\"saveImportData()\" label=\"Import\"\n            class=\"ui-button-rounded ui-button-secondary mx-3\" [disabled]=\"this.canSave\"></button>\n    </p-footer>\n</p-dialog>\n\n<p-dialog header=\"Filter\" [(visible)]=\"filterDialog\" [style]=\"{width: '400px'}\" [modal]=\"true\">\n    <app-cav-loader *ngIf=\"isFilterLoading\"></app-cav-loader>\n    <div class=\"p-grid mb-16\">\n        <div class=\"p-col-12 form-group\">\n            <label class=\"p-col-4\">Project</label>\n            <div class=\"p-col-8\">\n                <p-multiSelect [options]=\"projectOptions\" [(ngModel)]=\"havocRunFilter.project\"\n                    (onChange)=\"onProjectChange()\" styleClass=\"w-100-p\">\n                    <ng-template let-selectedItems pTemplate=\"selectedItems\">\n                        <span\n                            *ngIf=\"selectedItems?.length > 0 && selectedItems?.length === projectOptions?.length\">All</span>\n                        <span *ngIf=\"selectedItems?.length !== projectOptions?.length && selectedItems?.length > 2\">\n                            {{ selectedItems.length }} items selected\n                        </span>\n                        <span *ngIf=\"selectedItems?.length !== projectOptions?.length && selectedItems?.length <= 2\">{{\n                            selectedItems }}</span>\n                        <span *ngIf=\"selectedItems?.length === 0\">Select Project</span>\n                    </ng-template>\n                </p-multiSelect>\n            </div>\n        </div>\n        <div class=\"p-col-12 form-group\">\n            <label class=\"p-col-4\">Sub-Project</label>\n            <div class=\"p-col-8\">\n                <p-multiSelect [options]=\"subProjectOptions\" [(ngModel)]=\"havocRunFilter.subproject\"\n                    (onChange)=\"onSubProjectChange()\" styleClass=\"w-100-p\">\n                    <ng-template let-selectedItems pTemplate=\"selectedItems\">\n                        <span\n                            *ngIf=\"selectedItems?.length > 0 && selectedItems?.length === subProjectOptions?.length\">All</span>\n                        <span *ngIf=\"selectedItems?.length !== subProjectOptions?.length && selectedItems?.length > 2\">\n                            {{ selectedItems.length }} items selected\n                        </span>\n                        <span\n                            *ngIf=\"selectedItems?.length !== subProjectOptions?.length && selectedItems?.length <= 2\">{{\n                            selectedItems }}</span>\n                        <span *ngIf=\"selectedItems?.length === 0\">Select Sub-Project</span>\n                    </ng-template>\n                </p-multiSelect>\n            </div>\n        </div>\n        <div class=\"p-col-12 form-group\">\n            <label class=\"p-col-4\">Scenario</label>\n            <div class=\"p-col-8\">\n                <p-multiSelect [options]=\"scenarioOptions\" [(ngModel)]=\"havocRunFilter.scenarioName\"\n                    styleClass=\"w-100-p\">\n                    <ng-template let-selectedItems pTemplate=\"selectedItems\">\n                        <span\n                            *ngIf=\"selectedItems?.length > 0 && selectedItems?.length === scenarioOptions?.length\">All</span>\n                        <span *ngIf=\"selectedItems?.length !== scenarioOptions?.length && selectedItems?.length > 2\">\n                            {{ selectedItems.length }} items selected\n                        </span>\n                        <span *ngIf=\"selectedItems?.length !== scenarioOptions?.length && selectedItems?.length <= 2\">{{\n                            selectedItems }}</span>\n                        <span *ngIf=\"selectedItems?.length === 0\">Select Scenario</span>\n                    </ng-template>\n                </p-multiSelect>\n            </div>\n        </div>\n        <div class=\"p-col-12 form-group\">\n            <label class=\"p-col-4\">Status</label>\n            <div class=\"p-col-8\">\n                <p-multiSelect [options]=\"statusOptions\" [(ngModel)]=\"havocRunFilter.scenarioStatus\"\n                    styleClass=\"w-100-p\">\n                    <ng-template let-selectedItems pTemplate=\"selectedItems\">\n                        <span>{{ getSelectedLabels(selectedItems) }}</span>\n                    </ng-template>\n                </p-multiSelect>\n            </div>\n        </div>\n        <div class=\"p-col-12 form-group\">\n            <label class=\"p-col-4\">Duration</label>\n            <div class=\"p-col-8\">\n                <p-dropdown [options]=\"durationStatus\" [(ngModel)]=\"havocRunFilter.duration\" appendTo=\"body\"\n                    styleClass=\"w-100-p\"></p-dropdown>\n            </div>\n        </div>\n        <div class=\"p-col-12 form-group\">\n            <label class=\"p-col-4\">Started</label>\n            <div class=\"p-col-8\">\n                <p-dropdown [options]=\"startedOptions\" [(ngModel)]=\"havocRunFilter.started\" appendTo=\"body\"\n                    styleClass=\"w-100-p\"></p-dropdown>\n            </div>\n        </div>\n    </div>\n    <p-footer class=\"p-grid p-align-center p-justify-center\">\n        <button type=\"button\" pButton (click)=\"applyFilter()\" label=\"Apply\" class=\"mx-6\"></button>\n        <button type=\"button\" pButton (click)=\"clearFilters()\" label=\"Reset\" class=\"btn-secondary-outline\"></button>\n    </p-footer>\n</p-dialog>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-health-check/nethavoc-health-check.component.html":
/*!******************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-health-check/nethavoc-health-check.component.html ***!
  \******************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<cav-table [value]=\"healthCheckList\" [headerRelativePath]=\"relativePathforHealthCheck\" [scrollable]=\"true\"\n        (clickButtonEvent)=\"healthCheckTableHandler($event)\" \n        currentPageReportTemplate=\"showing {first} to {last} of {totalRecords}\"\n        scrollHeight=\"calc(100vh - 210px)\"></cav-table>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-home.component.html":
/*!************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-home.component.html ***!
  \************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"h-100vh-90 overflow ns-scenario px-6\">\n  <div class=\"w-100-p p-grid p-nogutter8 mt-8\">\n    <div class=\"p-col p-grid p-align-center\">\n      <span class=\"havoc font-28\"><i class=\"cav5 bug\"></i></span>\n      <div class=\"havocDesc\">\n        <span class=\"font-weight-600 font-20\">{{runtablecountinfo[\"totalcount\"]}}</span>\n        <span class=\"opc-90 font-13\">Total Havoc Runs</span>\n      </div>\n    </div>\n    <div class=\"p-col p-grid p-align-center\">\n      <span class=\"font-24 havocRuns\"><i class=\"icons8 icons8-spinner spin\"></i></span>\n      <div class=\"havocDesc\">\n        <span class=\"font-weight-600 font-20\">{{runtablecountinfo[\"runingcount\"]}}</span>\n        <span class=\"opc-90 font-13\">Running Havoc Runs</span>\n      </div>\n    </div>\n    <div class=\"p-col p-grid p-align-center\">\n      <span class=\"havoc font-30\"><i class=\"cav5 bugs\"></i></span>\n      <div class=\"havocDesc\">\n        <span class=\"font-weight-600 font-20\">{{scenariolistcountinfo[\"totalcount\"]}}</span>\n        <span class=\"opc-90 font-13\">Total Havoc Scenarios</span>\n      </div>\n    </div>\n    <div class=\"p-col p-grid p-align-center\">\n      <span class=\"font-22 havocEvents\"><i class=\"cav calender-events\"></i></span>\n      <div class=\"havocDesc\">\n        <span class=\"font-weight-600 font-20\">{{scenariolistcountinfo[\"schedulecount\"]}}</span>\n        <span class=\"opc-90 font-13\">Scheduled Havoc Scenarios</span>\n      </div>\n    </div>\n    <div class=\"p-col-fixed\">\n      <button type=\"button\" *ngIf=\"!isNoPermisson\" pButton label=\"Configuration\" class=\"btn-primary-outline mx-3\"\n        (click)=\"netHavocConfig()\"></button>\n      <p-button type=\"button\" *ngIf=\"havocstate == 'disable' && !isNoPermisson\" label=\"Disable Havoc\" styleClass=\"mx-3 ui-button-danger\"\n        (click)=\"disableAllHavoc()\"></p-button>\n      <p-button type=\"button\" *ngIf=\"havocstate != 'disable' && !isNoPermisson\" label=\"Enable Havoc\" styleClass=\"mx-3 ui-btn-primary\"\n        (click)=\"enableAllHavoc()\"></p-button>\n      <app-help [helpFileName]=\"'sshConfiguration'\" [helpTitle]=\"'Havoc Configuration'\" [helpFolder]=\"'netHavoc'\"></app-help>\n    </div>\n  </div>\n\n  <div class=\"w-100-p p-grid p-nogutter8\">\n    <div class=\"w-70-p p-col-fixed\">\n      <app-nethavoc-havocruns></app-nethavoc-havocruns>\n    </div>\n    <div class=\"w-30-p p-col-fixed\">\n      <app-nethavoc-scenario></app-nethavoc-scenario>\n    </div>\n    <div class=\"p-col-12\" *ngIf=\"runtablecountinfo['totalcount'] > 0\">\n      <app-nthavoc-havocrundetails></app-nthavoc-havocrundetails>\n    </div>\n  </div>\n</div>\n<app-disable-havoc-config (havocstateevent)=\"havocstateevent($event)\"></app-disable-havoc-config>\n");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-scenario/nethavoc-scenario.component.html":
/*!**********************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-scenario/nethavoc-scenario.component.html ***!
  \**********************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<cav-table *ngIf=\"!isNoPermission\" [value]=\"scenList\" [headerRelativePath]=\"relativePathforScenName\" [scrollable]=\"true\"\n  (clickButtonEvent)=\"clickScenNameEvent($event)\" [showCurrentPageReport]=\"false\" cavRowsPerPageOptions=\"[10, 20, 50]\"\n  scrollHeight=\"calc(100vh - 400px)\" [responsive]=\"true\"></cav-table>\n\n<p-dialog [modal]=\"true\" [draggable]=\"false\" header=\"Scenario Schedule Summary\" [(visible)]=\"openScheduleSummaryDialog\"\n  [style]=\"{width: '70vw'}\">\n  <app-schedule-summary></app-schedule-summary>\n</p-dialog>\n\n\n<p-confirmDialog key=\"scenario-delete\" ></p-confirmDialog>\n\n\n<p-dialog header=\"Import Scenario\" [(visible)]=\"openDialogForImport\" modal=\"true\" [closable]=\"false\" [resizable]=\"false\"\n  [style]=\"{width:'400px'}\">\n  <div class=\"p-grid p-align-center\">\n    <div class=\"p-col-12\">\n      Choose the Project and Sub Project where you want to upload the Scenario.\n    </div>\n    <div class=\"p-col-4 mt-8\">Project </div>\n    <div class=\"p-col-8 mt-8\">\n      <p-dropdown [options]=\"projectOptions\" placeholder=\"Select Project\" [(ngModel)]=\"selectedProject\" appendTo=\"body\"\n        dropdownIcon=\"icons8 icons8-expand-arrow\" (onChange)=\"updateSubProject($event)\"></p-dropdown>\n    </div>\n    <div class=\"p-col-4 mt-7\">Sub Project </div>\n    <div class=\"p-col-8 mt-7\">\n      <p-dropdown [options]=\"subProjectOptions\" placeholder=\"Select Sub-project\" [(ngModel)]=\"selectedSubProject\"\n        appendTo=\"body\" dropdownIcon=\"icons8 icons8-expand-arrow\"></p-dropdown>\n    </div>\n    <div class=\"p-col-4 mt-7\">Upload File</div>\n    <div class=\"p-col-8 mt-7\">\n      <p-fileUpload #upload1 class=\"mr-5\" mode=\"basic\" name=\"files[]\" (onSelect)=\"handleFileUpload($event)\"\n        accept=\".json\" styleClass=\"custom-file-upload1\" label=\"Upload Json\"></p-fileUpload>\n    </div>\n  </div>\n  <p-footer>\n    <button type=\"button\" pButton (click)=\"closeImport()\" label=\"Cancel\"\n      class=\"ui-button-rounded ui-button-secondary mx-3\"></button>\n    <button type=\"button\" pButton (click)=\"saveImportData()\" label=\"Import\"\n      class=\"ui-button-rounded ui-button-secondary mx-3\" [disabled]=\"this.canSave\"></button>\n  </p-footer>\n</p-dialog>\n\n\n<p-dialog header=\"Copy Scenario\" [(visible)]=\"openDialogForCopy\" modal=\"true\" [closable]=\"false\" [resizable]=\"false\"\n  [style]=\"{width:'400px'}\">\n  <div class=\"p-grid p-align-center\">\n    <div class=\"p-col-12\">\n      Choose the Project and Sub Project where you want to copy the Scenario.\n    </div>\n    <div class=\"p-col-4 mt-8\">Project </div>\n    <div class=\"p-col-8 mt-8\">\n      <p-dropdown [options]=\"projectOptions\" placeholder=\"Select Project\" [(ngModel)]=\"selectedProject\" appendTo=\"body\"\n        dropdownIcon=\"icons8 icons8-expand-arrow\" (onChange)=\"updateSubProject($event)\"></p-dropdown>\n    </div>\n    <div class=\"p-col-4 mt-7\">Sub Project </div>\n    <div class=\"p-col-8 mt-7\">\n      <p-dropdown [options]=\"subProjectOptions\" placeholder=\"Select Sub-project\" [(ngModel)]=\"selectedSubProject\"\n        appendTo=\"body\" dropdownIcon=\"icons8 icons8-expand-arrow\"></p-dropdown>\n    </div>\n    <div class=\"p-col-4 mt-7\">Scenario Name</div>\n    <div class=\"p-col-8 mt-7\">\n      <input id=\"scenName\" type=\"text\" class=\"w-100-p\" pInputText [(ngModel)]=\"copyscenarioName\" />\n    </div>\n  </div>\n  <p-footer>\n    <button type=\"button\" pButton (click)=\"closeCopyScenario()\" label=\"Cancel\"\n      class=\"ui-button-rounded ui-button-secondary mx-3\"></button>\n    <button type=\"button\" pButton (click)=\"saveCopyScenarioData()\" label=\"Copy\"\n      class=\"ui-button-rounded ui-button-secondary mx-3\"></button>\n  </p-footer>\n</p-dialog>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-schedule-summary/nethavoc-schedule-summary.component.html":
/*!**************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-schedule-summary/nethavoc-schedule-summary.component.html ***!
  \**************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div>\n        <cav-scheduler-table scrollHeight=\"calc(100vh - 600px)\" [scheduleObj]=\"scheduleObj\"\n                (outputEvent)=\"outputEventHandler($event)\"></cav-scheduler-table>\n</div>\n<div>\n        <app-nh-schedule (onschedulesuccess)=\"reloadScheduleObj($event)\"\n                [editcavScehduleTaskobj]=\"editcavScehduleTaskobj\"></app-nh-schedule>\n</div>");

/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/disable-havoc-config/disable-havoc-config.component.scss":
/*!**************************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/disable-havoc-config/disable-havoc-config.component.scss ***!
  \**************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("");

/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/disable-havoc-config/disable-havoc-config.component.ts":
/*!************************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/disable-havoc-config/disable-havoc-config.component.ts ***!
  \************************************************************************************************************************/
/*! exports provided: DisbaleHavocConfigComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DisbaleHavocConfigComponent", function() { return DisbaleHavocConfigComponent; });
/* 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 _services_nethavoc_utility_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../services/nethavoc-utility.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-utility.service.ts");
/* 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 _services_nethavoc_http_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../services/nethavoc-http.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-http.service.ts");
/* harmony import */ var src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/app/shared/cav-toast/service/cav-message.service */ "./src/app/shared/cav-toast/service/cav-message.service.ts");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var moment_timezone__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! moment-timezone */ "./node_modules/moment-timezone/index.js");
/* harmony import */ var moment_timezone__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(moment_timezone__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/pages/tools/admin/access-control/services/access-control.model */ "./src/app/pages/tools/admin/access-control/services/access-control.model.ts");
/* harmony import */ var src_app_pages_tools_admin_access_control_management_services_cav_acl_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! src/app/pages/tools/admin/access-control-management/services/cav-acl-util */ "./src/app/pages/tools/admin/access-control-management/services/cav-acl-util.ts");










let DisbaleHavocConfigComponent = class DisbaleHavocConfigComponent {
    constructor(nhavocUtilityService, SessionService, _netHavocHttpService, msg, aclProperties) {
        this.nhavocUtilityService = nhavocUtilityService;
        this.SessionService = SessionService;
        this._netHavocHttpService = _netHavocHttpService;
        this.msg = msg;
        this.aclProperties = aclProperties;
        this.disableOptions = [];
        this.selectedDisableOption = 'Indefinate';
        this.reasonOptions = [];
        this.selectedReason = 'System under maintenance';
        this.dateTime = new Date();
        this.otherVal = '';
        this.havocstateevent = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
        this.isReadPermisson = false;
    }
    ngOnInit() {
        this.isReadPermisson = this.SessionService.isFeatureWrite(this.aclProperties.feature, this.aclProperties.subFeature);
        this.disableOptions = [
            { label: 'Indefinate', value: 'Indefinate' },
            { label: 'Duration', value: 'Duration' },
            { label: 'Specific', value: 'Specific' },
        ];
        this.reasonOptions = [
            { label: 'System under maintenance', value: 'System under maintenance' },
            { label: 'Peak sales day', value: 'Peak sales day' },
            { label: 'Resource scarcity', value: 'Resource scarcity' },
            { label: 'Planned shutdown in targets', value: 'Planned shutdown in targets' },
            { label: 'Others', value: 'others' },
        ];
        this.getHavocState();
    }
    open() {
        let timezoneinfo = this.SessionService.getTimeZoneInfoFromlocalStorage();
        this.dateTime = new Date(moment__WEBPACK_IMPORTED_MODULE_6__["tz"](new Date(), timezoneinfo === null || timezoneinfo === void 0 ? void 0 : timezoneinfo.zoneLabel).format('MM/DD/YYYY HH:mm:ss'));
        this.isVisible = true;
    }
    getHavocState() {
        let json = {};
        let commonJson = this.nhavocUtilityService.commonJson1();
        let finalJson = Object.assign(json, commonJson);
        try {
            this._netHavocHttpService.enabledisableHavocs(finalJson, this.SessionService.session.testRun.id, true).subscribe(result => {
                if (result['status'] == "Success") {
                    if (result['state'] == 1)
                        this.havocstateevent.emit('disable');
                    else
                        this.havocstateevent.emit('enable');
                }
                else {
                    this.havocstateevent.emit('disable');
                }
            }, error => {
                console.error("Error in runScenario", error);
            });
        }
        catch (error) {
            console.error("Error in runScenario", error);
        }
    }
    enableAllhavoc() {
        let reason = "";
        if (this.selectedReason == 'others')
            reason = this.otherVal;
        else
            reason = this.selectedReason;
        let json = {
            'type': 'state',
            'state': "1",
            'user': this.SessionService.session.cctx.u,
            'mode': 0,
            'reason': reason,
            'timeStamp': 0,
            'stopHavocStatus': 0,
            'lastModifiedTime': this.SessionService.time
        };
        let commonJson = this.nhavocUtilityService.commonJson1();
        let finalJson = Object.assign(json, commonJson);
        try {
            this._netHavocHttpService.enabledisableHavocs(finalJson, this.SessionService.session.testRun.id, false).subscribe(result => {
                if (result['status'] == "Success") {
                    this.msg.add({ severity: 'success', summary: 'Success Message', detail: "Havocs Enabled Successfully" });
                    this.havocstateevent.emit('disable');
                }
                else {
                    if (result['resultStatus'] != undefined && result['resultStatus'] == "ERROR") {
                        this.msg.add({ severity: 'error', summary: 'Error Message', detail: result['message'] });
                    }
                    if (result['status'] != undefined && result['status'] == "Error") {
                        this.msg.add({ severity: 'error', summary: 'Error Message', detail: "" + result['error'] });
                    }
                }
            }, error => {
                console.error("Error in runScenario", error);
            });
        }
        catch (error) {
            console.error("Error in runScenario", error);
        }
    }
    disableAllHavoc() {
        let mode = "0";
        let timestamp = 0;
        let durationReadable = "";
        if (this.selectedDisableOption == "Indefinate") {
            mode = "0";
            timestamp = 0;
        }
        else if (this.selectedDisableOption == "Duration") {
            mode = "1";
            timestamp = this.getTimeStamp();
            let timezoneinfo = this.SessionService.getTimeZoneInfoFromlocalStorage();
            let time = new Date(moment__WEBPACK_IMPORTED_MODULE_6__["tz"](new Date(), timezoneinfo === null || timezoneinfo === void 0 ? void 0 : timezoneinfo.zoneLabel).format('MM/DD/YYYY HH:mm:ss'));
            if (time.getHours() == 0 && time.getMinutes() != 0) {
                durationReadable = time.getMinutes() + "m";
            }
            else if (time.getHours() != 0 && time.getMinutes() == 0) {
                durationReadable = time.getHours() + "h";
            }
            else {
                durationReadable = time.getHours() + "h and " + time.getMinutes() + "m";
            }
        }
        else if (this.selectedDisableOption == "Specific") {
            mode = "3";
            timestamp = this.getTimeStamp();
        }
        let currenttime = this.SessionService.time;
        let reason = "";
        if (this.selectedReason == 'others')
            reason = this.otherVal;
        else
            reason = this.selectedReason;
        let json = {
            'type': 'state',
            'state': 0,
            'user': this.SessionService.session.cctx.u,
            'mode': mode,
            'reason': reason,
            'timeStamp': timestamp,
            'stopHavocStatus': 0,
            'lastModifiedTime': currenttime,
            'durationInReadableFormat': durationReadable
        };
        let commonJson = this.nhavocUtilityService.commonJson1();
        let finalJson = Object.assign(json, commonJson);
        try {
            this._netHavocHttpService.enabledisableHavocs(finalJson, this.SessionService.session.testRun.id, false).subscribe(result => {
                if (result['status'] == "Success") {
                    this.isVisible = false;
                    this.msg.add({ severity: 'success', summary: 'Success Message', detail: "Disabling havocs initiated successfully. All running scenarios/havocs (if any) will be stopped in background and may take few minutes." });
                    this.havocstateevent.emit('enable');
                }
                else {
                    if (result['resultStatus'] != undefined && result['resultStatus'] == "ERROR") {
                        this.msg.add({ severity: 'error', summary: 'Error Message', detail: result['message'] });
                    }
                    if (result['status'] != undefined && result['status'] == "Error") {
                        this.msg.add({ severity: 'error', summary: 'Error Message', detail: "" + result['error'] });
                    }
                }
            }, error => {
                console.error("Error in runScenario", error);
            });
        }
        catch (error) {
            console.error("Error in runScenario", error);
        }
    }
    getTimeStamp() {
        let timestamp = 0;
        let date = (this.dateTime.getDate() < 10 ? ("0" + this.dateTime.getDate()) : this.dateTime.getDate());
        let month = ((this.dateTime.getMonth() + 1) < 10 ? ("0" + (this.dateTime.getMonth() + 1)) : (this.dateTime.getMonth() + 1));
        let year = (this.dateTime.getFullYear() < 10 ? ("0" + this.dateTime.getFullYear()) : this.dateTime.getFullYear());
        let time = (this.dateTime.getHours() < 10 ? ("0" + this.dateTime.getHours()) : this.dateTime.getHours());
        let time1 = (this.dateTime.getMinutes() < 10 ? ("0" + this.dateTime.getMinutes()) : this.dateTime.getMinutes());
        let time2 = (this.dateTime.getSeconds() < 10 ? ("0" + this.dateTime.getSeconds()) : this.dateTime.getSeconds());
        let specificTimestamp = month + '/' + date + '/' + year + ' ' + time + ':' + time1 + ':' + time2;
        timestamp = this.SessionService.convertFormattedStringIntoTimestamp(specificTimestamp, "MM/DD/YYYY HH:mm:ss");
        return timestamp;
    }
};
DisbaleHavocConfigComponent.ctorParameters = () => [
    { type: _services_nethavoc_utility_service__WEBPACK_IMPORTED_MODULE_2__["NetHavocUtilityService"] },
    { type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_3__["SessionService"] },
    { type: _services_nethavoc_http_service__WEBPACK_IMPORTED_MODULE_4__["NethavocHttpService"] },
    { type: src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_5__["CavMessageService"] },
    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_8__["ACL_PROPS"],] }] }
];
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])()
], DisbaleHavocConfigComponent.prototype, "havocstateevent", void 0);
DisbaleHavocConfigComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-disable-havoc-config',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./disable-havoc-config.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/disable-havoc-config/disable-havoc-config.component.html")).default,
        encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
        providers: [{ provide: src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_8__["ACL_PROPS"], useFactory: src_app_pages_tools_admin_access_control_management_services_cav_acl_util__WEBPACK_IMPORTED_MODULE_9__["getHavocsHavocConfigurationACLProps"] }],
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./disable-havoc-config.component.scss */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/disable-havoc-config/disable-havoc-config.component.scss")).default]
    }),
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(4, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"])()), Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(4, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_8__["ACL_PROPS"]))
], DisbaleHavocConfigComponent);



/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/havocrun-detail-table.json":
/*!*********************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/havocrun-detail-table.json ***!
  \*********************************************************************************************************************/
/*! exports provided: headers, paginator, tableConfig, default */
/***/ (function(module) {

module.exports = JSON.parse("{\"headers\":[{\"cols\":[{\"type\":0,\"key\":\"rowGrouping\",\"label\":\"Name\",\"width\":\"10%\"},{\"type\":0,\"key\":\"description\",\"label\":\"Havoc Description\"},{\"type\":8,\"key\":\"platForm\",\"label\":\"PlatForm\",\"definition\":[{\"label\":\"Linux\",\"value\":\"linux\",\"iconCls\":\"las-linux\"},{\"label\":\"Windows\",\"value\":\"windows\",\"iconCls\":\"las-windows\"},{\"label\":\"Docker\",\"value\":\"docker\",\"iconCls\":\"las-docker\"},{\"label\":\"Kubernetes\",\"value\":\"kubernetes\",\"iconCls\":\"cav kubernetes\"},{\"label\":\"Cloud\",\"value\":\"cloud\",\"iconCls\":\"las-cloud-solid\"},{\"label\":\"Tanzu\",\"value\":\"tanzu\",\"iconCls\":\"las-cloud-solid\"},{\"label\":\"Messaging Services\",\"value\":\"jms\",\"iconCls\":\"las-facebook-messenger\"}]},{\"type\":8,\"key\":\"category\",\"label\":\"Category\",\"selected\":false,\"definition\":[{\"label\":\"Starve Application\",\"value\":\"starve\"},{\"label\":\"State Change\",\"value\":\"state\"},{\"label\":\"Network Assaults\",\"value\":\"network\"},{\"label\":\"Application Disruption\",\"value\":\"application\"},{\"label\":\"Distort Queue/Topics\",\"value\":\"distort\"},{\"label\":\"Azure\",\"value\":\"azure\"},{\"label\":\"AWS\",\"value\":\"aws\"},{\"label\":\"GCP\",\"value\":\"gcp\"}]},{\"type\":8,\"key\":\"havocType\",\"label\":\"Havoc Type\",\"definition\":[{\"label\":\"CPU Burst\",\"value\":\"cpu\",\"iconCls\":\"cav2 nh-cpu\"},{\"label\":\"Disk Swindle\",\"value\":\"disk\",\"iconCls\":\"las-save\"},{\"label\":\"I/O Shoot Up\",\"value\":\"io\",\"iconCls\":\"cav2 ioactivity\"},{\"label\":\"Memory Outlay\",\"value\":\"memory\",\"iconCls\":\"cav2 memory-overlay\"},{\"label\":\"Abort Process\",\"value\":\"abortProcess\",\"iconCls\":\"las-window-close\"},{\"label\":\"Kill Server\",\"value\":\"killServer\",\"iconCls\":\"cav2 kill-server\"},{\"label\":\"Teleport\",\"value\":\"teleport\",\"iconCls\":\"cav2 teleport\"},{\"label\":\"Terminate Instance Azure\",\"value\":\"terminateinstanceAzure\",\"iconCls\":\"cav2 terminate-cloud\"},{\"label\":\"Terminate Instance AWS\",\"value\":\"terminateInstanceAws\",\"iconCls\":\"cav2 terminate-cloud\"},{\"label\":\"Terminate Instance GCP\",\"value\":\"terminateInstanceGcp\",\"iconCls\":\"cav2 terminate-cloud\"},{\"label\":\"Intrude Network\",\"value\":\"intrude\",\"iconCls\":\"cav2 Intrude-Network\"},{\"label\":\"Trim Network Packets\",\"value\":\"assaults\",\"iconCls\":\"cav application\"},{\"label\":\"Dormant Network\",\"value\":\"dormant\",\"iconCls\":\"cav2 dormant-network\"},{\"label\":\"DNS Breakdown\",\"value\":\"dns\",\"iconCls\":\"cav2 dns-Breakdown\"},{\"label\":\"Interstellar\",\"value\":\"interstellar\",\"iconCls\":\"cav2 Interstellar\"},{\"label\":\"Alter Inbound Service\",\"value\":\"inbound\",\"iconCls\":\"cav2 inbound-service\"},{\"label\":\"Alter Outbound Service\",\"value\":\"outbound\",\"iconCls\":\"cav2 outBound-service\"},{\"label\":\"Method Invocation\",\"value\":\"methodInvoke\",\"iconCls\":\"cav2 revamp-method\"},{\"label\":\"Method Exception\",\"value\":\"methodException\",\"iconCls\":\"cav2 method-exception\"},{\"label\":\"Heap Memory Leak\",\"value\":\"heapMemLeak\",\"iconCls\":\"cav2 memory-overlay\"},{\"label\":\"Application CPU Burst\",\"value\":\"appCpu\",\"iconCls\":\"cav2 nh-cpu\"},{\"label\":\"Thread Leak\",\"value\":\"threadLeak\",\"iconCls\":\"cav4 thread-leak\"},{\"label\":\"Application Kill\",\"value\":\"appKill\",\"iconCls\":\"cav4 application-kill\"},{\"label\":\"IBMMQ\",\"value\":\"ibmmq\",\"iconCls\":\"cav4 ibm-mq\"},{\"label\":\"TIBCO\",\"value\":\"tibco\",\"iconCls\":\"cav4 tibco-logo\"},{\"label\":\"KAFKA\",\"value\":\"kafka\",\"iconCls\":\"cav apache_kafka\"}]},{\"type\":0,\"key\":\"target\",\"label\":\"Target\"},{\"type\":2,\"key\":\"startTime\",\"label\":\"Start Time\",\"format\":\"format_date_time\",\"width\":\"10%\"},{\"type\":0,\"key\":\"tags\",\"label\":\"Tags\",\"classes\":\"text-center\",\"selected\":false},{\"type\":1,\"key\":\"duration\",\"label\":\"Duration\",\"format\":\"time_duration\"},{\"type\":0,\"key\":\"resilience\",\"label\":\"Resilience Score\",\"classes\":\"text-center\",\"selected\":false},{\"type\":11,\"key\":\"healthCheck\",\"label\":\"Health Check\",\"selected\":false},{\"type\":8,\"key\":\"status\",\"label\":\"Status\",\"selected\":true,\"classes\":\"text-center\",\"definition\":[{\"value\":\"0\",\"label\":\"Configured\",\"borClrCls\":\"cav-status configured\"},{\"value\":\"1\",\"label\":\"Started\",\"borClrCls\":\"cav-status configured\"},{\"value\":\"2\",\"label\":\"Stopped\",\"borClrCls\":\"cav-status stopped\"},{\"value\":\"3\",\"label\":\"Running\",\"borClrCls\":\"cav-status running\"},{\"value\":\"4\",\"label\":\"Completed\",\"borClrCls\":\"cav-status completed\"},{\"value\":\"5\",\"label\":\"Failed\",\"borClrCls\":\"cav-status failed\"},{\"value\":\"99\",\"label\":\"Disabled\",\"borClrCls\":\"cav-status disabled\"}]},{\"type\":5,\"key\":\"action\",\"label\":\"Action\",\"classes\":\"text-center\",\"width\":\"10%\"}]}],\"paginator\":{\"rows\":5,\"rowsPerPageOptions\":[5,10,20,30],\"first\":0,\"lazy\":false},\"tableConfig\":{\"config\":{\"globalFilter\":true,\"toggleFilter\":true,\"masterCheckbox\":false,\"tableName\":\"Havoc Run Details - Run \",\"download\":true},\"tableAction\":[{\"id\":\"refresh\"},{\"iconType\":\"inputSwitch\",\"iconClass\":\"icons8 icons8-settings\",\"toolTip\":\"Enable/Disable Auto Refresh\",\"action\":\"refreshflag\",\"needRowData\":true,\"ngModel\":true}],\"rowAction\":{\"rightAction\":[{\"iconType\":\"icon\",\"iconClass\":\"pi pi-chart-line\",\"action\":\"viewgraph\",\"needRowData\":true,\"toolTip\":\"View Graph\"},{\"iconType\":\"icon\",\"iconClass\":\"icons8 icons8-info\",\"action\":\"nhinfo\",\"needRowData\":true,\"toolTip\":\"Info\"},{\"iconType\":\"icon\",\"iconClass\":\"\",\"action\":\"\",\"needRowData\":true,\"definition\":{\"status\":[{\"value\":\"3\",\"iconClass\":\"las-square-solid text-danger\",\"toolTip\":\"Stop havoc\",\"action\":\"stop\",\"needRowData\":true}]}},{\"iconType\":\"icon\",\"iconClass\":\"\",\"action\":\"\",\"needRowData\":true,\"definition\":{\"status\":[{\"value\":\"0\",\"iconClass\":\"las-square-solid text-danger\",\"toolTip\":\"Stop havoc\",\"action\":\"stop\",\"needRowData\":true}]}}]}}}");

/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/is-object.pipe.ts":
/*!************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/is-object.pipe.ts ***!
  \************************************************************************************************************/
/*! exports provided: IsObjectPipe */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IsObjectPipe", function() { return IsObjectPipe; });
/* 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");


let IsObjectPipe = class IsObjectPipe {
    transform(value) {
        return value !== null &&
            typeof value === 'object' &&
            !Array.isArray(value);
    }
};
IsObjectPipe = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Pipe"])({
        name: 'isObject',
        pure: true
    })
], IsObjectPipe);



/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/nethavoc-havocrundetails.component.scss":
/*!**********************************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/nethavoc-havocrundetails.component.scss ***!
  \**********************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("");

/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/nethavoc-havocrundetails.component.ts":
/*!********************************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/nethavoc-havocrundetails.component.ts ***!
  \********************************************************************************************************************************/
/*! exports provided: NethavocHavocrundetailsComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NethavocHavocrundetailsComponent", function() { return NethavocHavocrundetailsComponent; });
/* 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 _services_nethavoc_http_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../services/nethavoc-http.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-http.service.ts");
/* harmony import */ var src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/shared/cav-toast/service/cav-message.service */ "./src/app/shared/cav-toast/service/cav-message.service.ts");
/* harmony import */ var _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../constants/nethavoc.constants */ "./src/app/pages/home/netHavoc-v2/constants/nethavoc.constants.ts");
/* harmony import */ var _services_nethavoc_navigate_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../services/nethavoc-navigate.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-navigate.service.ts");
/* harmony import */ var src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/core/session/session.service */ "./src/app/core/session/session.service.ts");
/* harmony import */ var src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/shared/cavLoggerService/cav-logging.service */ "./src/app/shared/cavLoggerService/cav-logging.service.ts");
/* harmony import */ var _services_nethavoc_graph_v2_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../services/nethavoc-graph-v2.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-graph-v2.service.ts");
/* harmony import */ var _services_netHavoc_details_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../services/netHavoc-details.service */ "./src/app/pages/home/netHavoc-v2/services/netHavoc-details.service.ts");
/* harmony import */ var _services_nethavoc_utility_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../services/nethavoc-utility.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-utility.service.ts");
/* harmony import */ var src_app_shared_time_bar_service_time_bar_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! src/app/shared/time-bar/service/time-bar.service */ "./src/app/shared/time-bar/service/time-bar.service.ts");
/* harmony import */ var _havocrun_detail_table_json__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./havocrun-detail-table.json */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/havocrun-detail-table.json");
var _havocrun_detail_table_json__WEBPACK_IMPORTED_MODULE_12___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./havocrun-detail-table.json */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/havocrun-detail-table.json", 1);
/* harmony import */ var src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! src/app/pages/tools/admin/access-control/services/access-control.model */ "./src/app/pages/tools/admin/access-control/services/access-control.model.ts");
/* harmony import */ var src_app_pages_tools_admin_access_control_management_services_cav_acl_util__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! src/app/pages/tools/admin/access-control-management/services/cav-acl-util */ "./src/app/pages/tools/admin/access-control-management/services/cav-acl-util.ts");
/* harmony import */ var _services_nh_config_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../services/nh-config.service */ "./src/app/pages/home/netHavoc-v2/services/nh-config.service.ts");
/* harmony import */ var _constants_havoc_type_constants__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../constants/havoc-type.constants */ "./src/app/pages/home/netHavoc-v2/constants/havoc-type.constants.ts");
/* harmony import */ var _services_nh_scenario_data_service__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../services/nh-scenario-data.service */ "./src/app/pages/home/netHavoc-v2/services/nh-scenario-data.service.ts");
/* harmony import */ var _model_nh_model__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../model/nh-model */ "./src/app/pages/home/netHavoc-v2/model/nh-model.ts");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_19__);




















let NethavocHavocrundetailsComponent = class NethavocHavocrundetailsComponent {
    constructor(_netHavocHttpService, msgs, nhNavigateService, _sessionservice, logger, _netHavocService, nethavocDetailsService, timebarService, _nhavocUtilityService, aclProperties, nhConfigService, nhScenarioDataService) {
        this._netHavocHttpService = _netHavocHttpService;
        this.msgs = msgs;
        this.nhNavigateService = nhNavigateService;
        this._sessionservice = _sessionservice;
        this.logger = logger;
        this._netHavocService = _netHavocService;
        this.nethavocDetailsService = nethavocDetailsService;
        this.timebarService = timebarService;
        this._nhavocUtilityService = _nhavocUtilityService;
        this.aclProperties = aclProperties;
        this.nhConfigService = nhConfigService;
        this.nhScenarioDataService = nhScenarioDataService;
        this.relativePathForHavocDetails = _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_4__["HAVOC_RUN_DETAIL_TABLE_CONFIG"];
        this.groupList = ["name"];
        this.currentDate = new Date();
        this.havocDetails = [];
        this.havocinfo = {};
        this.tablejson = _havocrun_detail_table_json__WEBPACK_IMPORTED_MODULE_12__;
        this.havocMapInfo = _havocrun_detail_table_json__WEBPACK_IMPORTED_MODULE_12__.headers[0].cols.find(col => col.key === "havocType").definition;
        this.platformMapInfo = _havocrun_detail_table_json__WEBPACK_IMPORTED_MODULE_12__.headers[0].cols.find(col => col.key === "platForm").definition;
        this.categoryMaoInfo = _havocrun_detail_table_json__WEBPACK_IMPORTED_MODULE_12__.headers[0].cols.find(col => col.key === "category").definition;
        this.isDoDataRefresh = true;
        this.isNoPermisson = false;
        this.stateCountMap = {};
        this.paginatorInnerHTML = '';
        this.rows = { rows: 10 };
        this.first = { first: 0 };
        this.selectedRow = [];
        this.mappings = {
            trNum: "Test Run",
            id: 'Havoc ID',
            platForm: 'PlatForm'
            // add more keys here   
        };
    }
    ngOnInit() {
        this.isNoPermisson = this._sessionservice.isFeatureNoPerm(this.aclProperties.feature, this.aclProperties.subFeature);
        /*
           #define NH_CONFIGURED      0
           #define NH_START           1
           #define NH_STOP            2
           #define NH_RUNNING         3
           #define NH_COMPLETE        4
           #define NH_FAIL            5
           #define NH_DISABLE_HAVOC   6
        */
        this.getHavocRunDetails();
    }
    getHavocRunDetails() {
        try {
            this.dataSubscription = this._netHavocHttpService.havocRunObserver$.subscribe(result => {
                this.havocRunData = result;
                if (!this.havocRunData) {
                    this.tablejson.tableConfig.config.tableName = "Havoc Run Details - Run #";
                    this.origHavocDetailsResp = [];
                    this.havocDetails = [];
                    return;
                }
                // Refresh details if the run number changes or if auto-refresh is enabled
                if (this.isDoDataRefresh || this.havocRunData.havocRunNumber !== this.selectedRunNum) {
                    this.getHavocDetailsRefresh();
                }
                // Stop auto-refresh if the scenario status is not running
                if (this.havocRunData.scenarioStatus != _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_4__["Havoc_Status"].RUNNING) {
                    this.isDoDataRefresh = false;
                }
                else {
                    this.tablejson.tableConfig.tableAction.forEach(item => {
                        if (item.iconType === "inputSwitch") {
                            this.isDoDataRefresh = item.ngModel;
                        }
                    });
                }
            }, error => {
                console.error("Error in getHavocRunDetails", error);
            }, () => {
                this.dataSubscription.unsubscribe();
            });
        }
        catch (error) {
            console.error("Error in getHavocRunDetails", error);
        }
    }
    getHavocDetailsRefresh() {
        try {
            this.tablejson.tableConfig.config.tableName =
                "Havoc Run Details - Run #" + this.havocRunData.havocRunNumber;
            this._netHavocHttpService.getDetailsHavocRuns(this.havocRunData.havocRunNumber).subscribe(result => {
                if (result['status'] == true) {
                    this.origHavocDetailsResp = result['havocs'];
                    this.havocDetails = this.processHavocDetailRunData(result['havocs']);
                    this.setPaginatorInnerHTML();
                    if (this.havocRunData.havocRunNumber !== this.selectedRunNum) { // reset only when havoc run number changes
                        this.havocrunoverlay.hide();
                        this.rows = lodash__WEBPACK_IMPORTED_MODULE_19__["cloneDeep"]({ rows: 10 });
                        this.first = lodash__WEBPACK_IMPORTED_MODULE_19__["cloneDeep"]({ first: 0 });
                    }
                    this.selectedRunNum = this.havocRunData.havocRunNumber;
                }
                else {
                    this.msgs.add({ severity: 'error', summary: 'Error Message', detail: result['msg'] });
                }
            }, error => {
                console.error("Error in getScenarioData", error);
            });
        }
        catch (error) {
            console.error("Error in getHavocDetails", error);
        }
    }
    setPaginatorInnerHTML() {
        let innerHTML = '';
        for (const state in this.stateCountMap) {
            const count = this.stateCountMap[state];
            const { label, icon } = _constants_havoc_type_constants__WEBPACK_IMPORTED_MODULE_16__["HAVOC_STATES"][+state]; // use +state to convert string key to number
            innerHTML +=
                `<div class="legend-group severity-button-group">
            <div class="paginator-legend rounded-3 cav-status ${icon}"></div>
            <span>${label} (${count})</span>
            </div>`;
        }
        this.paginatorInnerHTML = innerHTML;
        this.stateCountMap = {}; // Reset the map after setting the innerHTML
    }
    objectKeys(obj) {
        return Object.keys(obj);
    }
    isObject(value) {
        return typeof value === 'object' && value !== null;
    }
    processHavocDetailRunData(havocdetaildata) {
        let finaldata = [];
        let dataobj = {};
        havocdetaildata.forEach(element => {
            var _a;
            dataobj = {};
            dataobj["name"] = element["hName"];
            dataobj['scenarioName'] = element['scenarioName'];
            dataobj["_id"] = element["_id"];
            dataobj["id"] = element["id"];
            dataobj["description"] = element["description"];
            dataobj["project"] = element["project"];
            dataobj["subProject"] = element["subProject"];
            dataobj["parentID"] = element["runTime"]["parentID"];
            dataobj["trNum"] = element["runTime"]["trNum"];
            // Call method based on the "target" field
            // Call method based on the "target" field
            if (element["havoc"]["platform"] == _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_4__["PLATFORM_KEYS"].CLOUD || element["havoc"]["platform"] == _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_4__["PLATFORM_KEYS"].MESSAGING_SERVICE) {
                dataobj['target'] = "-";
            }
            else if (element["target"]) {
                dataobj['target'] = this.getTargetForTable(element); // Replace with your actual method
            }
            //dataobj["target"] = element["target"];
            dataobj["startTime"] = element["timing"]["sTime"];
            dataobj['platForm'] = element["havoc"]["platform"];
            dataobj['category'] = element["havoc"]["category"];
            dataobj["havocType"] = element["havoc"]["type"];
            dataobj["tags"] = element["tags"] || "-";
            const eTime = (_a = element["timing"]["eTime"]) !== null && _a !== void 0 ? _a : 0;
            dataobj["duration"] = this._nhavocUtilityService.getDuration(element["runTime"]["state"], element["timing"]["sTime"], eTime);
            dataobj["resilience"] = element["resilience"] || "-";
            dataobj["status"] = element["runTime"]["state"];
            dataobj['parent'] = element["runTime"]["parentID"] && element["runTime"]["parentID"] != '' ? false : true;
            dataobj['message'] = element["runTime"]["message"] || "-";
            finaldata.push(dataobj);
            this.countHavocStates(element["runTime"]["state"]);
        });
        return finaldata;
    }
    countHavocStates(state) {
        if (state === undefined || state === null) {
            return;
        }
        state = Number(state);
        if (state == 1) {
            state = 0;
        }
        if (_constants_havoc_type_constants__WEBPACK_IMPORTED_MODULE_16__["HAVOC_STATES"][state]) {
            this.stateCountMap[state] = (this.stateCountMap[state] || 0) + 1;
        }
    }
    getTargetForTable(havocDetail) {
        var _a, _b, _c, _d;
        let targetobj = havocDetail.target;
        if (((_a = havocDetail === null || havocDetail === void 0 ? void 0 : havocDetail.havoc) === null || _a === void 0 ? void 0 : _a.platform) === _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_4__["PLATFORM_KEYS"].KUBERNETES) {
            let result = "Cluster:" + (targetobj === null || targetobj === void 0 ? void 0 : targetobj.cluster) +
                ", Namespace:" + (targetobj === null || targetobj === void 0 ? void 0 : targetobj.namespace);
            if (targetobj === null || targetobj === void 0 ? void 0 : targetobj.workload) {
                result += ", Workload:" + (targetobj === null || targetobj === void 0 ? void 0 : targetobj.workload);
            }
            result += ", LabelSelectors:" + (targetobj === null || targetobj === void 0 ? void 0 : targetobj.labelSelectors) +
                ", Pod:" + ((_b = targetobj === null || targetobj === void 0 ? void 0 : targetobj.pod) === null || _b === void 0 ? void 0 : _b.value);
            return result;
        }
        else if (((_c = havocDetail === null || havocDetail === void 0 ? void 0 : havocDetail.havoc) === null || _c === void 0 ? void 0 : _c.platform) === _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_4__["PLATFORM_KEYS"].DOCKER) {
            return "Tier:" + (targetobj === null || targetobj === void 0 ? void 0 : targetobj.tier) +
                ", Server:" + (targetobj === null || targetobj === void 0 ? void 0 : targetobj.serverDisplayName) +
                " (" + (targetobj === null || targetobj === void 0 ? void 0 : targetobj.server) + ")" +
                ", Container Name:" + ((_d = targetobj === null || targetobj === void 0 ? void 0 : targetobj.container) === null || _d === void 0 ? void 0 : _d.value);
        }
        else {
            return "Tier:" + (targetobj === null || targetobj === void 0 ? void 0 : targetobj.tier) +
                ", Server:" + (targetobj === null || targetobj === void 0 ? void 0 : targetobj.serverDisplayName) +
                " (" + (targetobj === null || targetobj === void 0 ? void 0 : targetobj.server) + ")";
        }
    }
    clickHavocDetails(event) {
        try {
            if (event.cavEventExt.actionConfig.action === 'nhinfo')
                this.infoHavoc(event);
            else if (event.cavEventExt.actionConfig.action === 'refresh')
                this.getHavocDetailsRefresh();
            else if (event.cavEventExt.actionConfig.action === 'stop') {
                this.stopHavocRun(event.cavEventExt.row);
            }
            else if (event.cavEventExt.actionConfig.action == 'viewgraph') {
                this.showHavocGraph(event.cavEventExt.row);
            }
            if (event.cavEventExt.actionConfig.action === 'designMode') {
                console.log("designMode action calling");
                this.getCallForDesignView();
            }
            if (event.cavEventExt.actionConfig.action === 'refreshflag') {
                this.isDoDataRefresh = event.cavEventExt.actionConfig.ngModel;
            }
        }
        catch (error) {
            console.error("Error in clickHavocDetails", error);
        }
    }
    stopHavocRun(rowData) {
        try {
            //TODO need to handle actualTestRun
            const jsonData = {
                "project": rowData.project,
                "subProject": rowData.subProject,
                "scenarioName": rowData.scenarioName,
                'startTime': "Current",
                'testRun': this._sessionservice.session.testRun.id,
                'operation': "2",
                'parent': rowData.parent || false,
                'id': rowData.id || "",
                'parentId': rowData.parentID || "",
                'ishavocrundetails': true,
                'havocRunNumber': this.havocRunData.havocRunNumber
            };
            let finalJson = Object.assign(jsonData, this.commonJson1());
            this._netHavocHttpService.runScenario(finalJson).subscribe(result => {
                if (result['resultStatus'] == "success") {
                    this.msgs.add({ severity: 'success', summary: 'Success Message', detail: result['message'] });
                }
                else {
                    this.msgs.add({ severity: 'error', summary: 'Error Message', detail: result['message'] });
                }
            }, error => {
                console.error("Error in runScenario", error);
            });
        }
        catch (error) {
            console.error("Error in runScenario", error);
        }
    }
    commonJson1() {
        try {
            let isMultiDC = false;
            let url = "";
            let json = {};
            if (this._sessionservice.preSession.multiDc) {
                isMultiDC = true;
            }
            if (window.location.port == undefined || window.location.port == '') {
                url = window.location.protocol + '//' + window.location.hostname;
            }
            else {
                url = window.location.protocol + '//' + window.location.hostname + ':' + window.location.port;
            }
            json = {
                "clusterReq": true,
                "baseurl": url
                //"baseurl": "https://10.10.60.90:5003"
            };
            console.log("json ", json);
            return json;
        }
        catch (error) {
            console.log("Error in creating common json", error);
        }
    }
    showHavocGraph(rowData) {
        this.logger.info(src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_7__["NH"], 'showHavocGraph | row data', rowData);
        this.nhConfigService.getHavocJson(rowData.havocType).then((data) => {
            this.logger.info(src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_7__["NH"], 'showHavocGraph | havoc json', data);
            let specifichavocDetail = this.origHavocDetailsResp.find(obj => obj.hName == rowData.name);
            this.logger.info(src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_7__["NH"], 'showHavocGraph | specifichavocDetail', specifichavocDetail);
            if (data.name == specifichavocDetail.havoc.type) // for safety 
             {
                let havocUIConfig = data.configuration.find(config => config.platform == specifichavocDetail.havoc.platform &&
                    config.category == specifichavocDetail.havoc.category);
                this.sendCallForGraph(specifichavocDetail, havocUIConfig, rowData);
            }
        }, (error) => {
            this.msgs.showError(error === null || error === void 0 ? void 0 : error.message);
        });
    }
    getCallForDesignView() {
        try {
            let query;
            // let query = "?project=" + rowData.project + "&subProject=" + rowData.subProject + "&havocRun=" + this.havocRunNo + "&scenario=" + this.ScenarioName;
            this._netHavocHttpService.getHavocDesignData(query).subscribe(result => {
            }, error => {
                console.error("Error in stopHavoc", error);
            });
        }
        catch (error) {
            console.error("Error in getCallForDesignView", error);
        }
    }
    infoHavoc(event) {
        this.selectedRow = event.cavEventExt.row;
        this.havocinfo = JSON.parse(JSON.stringify(event.cavEventExt.row));
        for (let key in this.havocinfo) {
            if (key === "startTime") {
                this.havocinfo[key] = this.getFormatedtime(this.havocinfo['startTime']);
            }
            else if (key === "duration") {
                this.havocinfo[key] = this.timeDurationConversion(this.havocinfo['duration']);
            }
            else if (key === "havocType") {
                this.havocinfo[key] = this.getLabelByValue(this.havocinfo['havocType'], this.havocMapInfo);
            }
            else if (key === "platForm") {
                this.havocinfo[key] = this.getLabelByValue(this.havocinfo['platForm'], this.platformMapInfo);
            }
            else if (key === "category") {
                this.havocinfo[key] = this.getLabelByValue(this.havocinfo['category'], this.categoryMaoInfo);
            }
        }
        delete this.havocinfo["rowGrouping"];
        delete this.havocinfo["status"];
        delete this.havocinfo["parentID"];
        delete this.havocinfo["parent"];
        delete this.havocinfo["_id"];
        delete this.havocinfo["tags"];
        delete this.havocinfo["resilience"];
        this.havocrunoverlay.toggle(event);
    }
    getFormatedtime(starttime) {
        return this._sessionservice.convertTimestampIntoFormattedString(Number(starttime));
    }
    timeDurationConversion(value) {
        if (value == null) {
            return "-";
        }
        const days = Math.floor(value / (1000 * 60 * 60 * 24));
        const hours = Math.floor((value % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
        const minutes = Math.floor((value % (1000 * 60 * 60)) / (1000 * 60));
        const seconds = Math.floor((value % (1000 * 60)) / 1000);
        const milliseconds = value % 1000;
        function formatNumber(num) {
            return num % 1 === 0 ? num.toString() : num.toFixed(0);
        }
        let timeAgoStr = "";
        if (days > 0)
            timeAgoStr += days + "d ";
        if (hours > 0)
            timeAgoStr += hours + "h ";
        if (minutes > 0)
            timeAgoStr += minutes + "m ";
        if (seconds > 0)
            timeAgoStr += seconds + "s ";
        if (milliseconds > 0 || timeAgoStr === "") {
            timeAgoStr += formatNumber(milliseconds) + "ms";
        }
        return timeAgoStr.trim();
    }
    viewDetailsConfig() {
        try {
            const scenarioData = {
                scenario: this.havocRunData,
                havocDetails: this.origHavocDetailsResp
            };
            this.nhScenarioDataService.loadScenario(scenarioData);
            const index = this.getHavocIndex(scenarioData.havocDetails, this.selectedRow.name);
            const queryParams = {
                project: this.selectedRow.project,
                subProject: this.selectedRow.subProject,
                runNo: this.selectedRow.havocRunNumber,
                scenarioName: this.selectedRow.scenarioName,
                mode: _model_nh_model__WEBPACK_IMPORTED_MODULE_18__["InjectHavocCompMode"].VIEW,
            };
            this.nhNavigateService.setParams(queryParams);
            this.viewHavoc(index);
        }
        catch (error) {
            console.error("Error in viewScenario", error);
        }
    }
    getHavocIndex(havocjson, selectedHavoc) {
        return havocjson.findIndex(havoc => selectedHavoc == havoc.hName && havoc.id.startsWith("NHM"));
    }
    viewHavoc(rowIndex) {
        this.nhScenarioDataService.setActiveHavocIndex(rowIndex);
        this.nhNavigateService.navigateTo('inject');
    }
    ngOnDestroy() {
        try {
            if (this.dataSubscription != undefined) {
                this.dataSubscription.unsubscribe();
            }
            if (this.subscription != undefined) {
                this.subscription.unsubscribe();
            }
        }
        catch (error) {
            console.error("Error in ngOnDestroy", error);
        }
    }
    // TODO: isRecursiveCall 
    sendCallForGraph(havocRunData, havocUIConfig, havocRunRowData, isRecursiveCall) {
        var _a, _b, _c;
        try {
            let havocAttributes = havocRunData.attributes;
            this._netHavocService.instance = havocRunData.target.instance;
            this._netHavocService.faultType = havocRunData.havoc.faultkey ? havocRunData.havoc.faultkey : havocRunData.havoc.type;
            this._netHavocService.methodName = havocAttributes.methodFQM;
            this._netHavocService.partionName = havocAttributes.partition;
            this._netHavocService.MachineInfo = havocRunData.havoc.platform;
            //TODO_REVIEW
            let date = this._sessionservice.convertTimestampIntoFormattedString(havocRunRowData.startTime, "MM/DD/YYYY HH:mm:ss");
            this._netHavocService.date = date.split(' ')[0];
            this._netHavocService.starttime = date.split(' ')[1];
            this._netHavocService.faultStatus = havocRunData.runTime.state;
            this._netHavocService.regionName = havocAttributes.region;
            this._netHavocService.instaceID = havocAttributes.instanceID;
            this._netHavocService.trNum = havocRunData.runTime.trNum;
            this._netHavocService.node = "NA";
            this._netHavocService.pod = havocRunData.target.serverDisplayName; //TODO_REVIEW
            //TODO_REVIEW   this._netHavocService.containerDisplayName = havocRunData['containerDisplayName'];
            this._netHavocService._cluster = havocRunData.target.cluster;
            this._netHavocService._namespace = havocRunData.target.namespace;
            //   this._netHavocService.setSt = havocRunData["stTimeStamp"];
            //   this._netHavocService.setEt = havocRunData["etTimeStamp"];
            this._netHavocService.tier = havocRunData.target.tier;
            this._netHavocService.server = havocRunData.target.serverDisplayName;
            this._netHavocService.Category = havocRunData.havoc.category;
            this._netHavocService.graphId1 = "";
            this._netHavocService.graphName1 = "";
            this._netHavocService.setSt = havocRunData.timing.sTime || this.timebarService.getValue().time.frameStart.value;
            this._netHavocService.setEt = havocRunData.timing.eTime || this.timebarService.getValue().time.frameEnd.value;
            //TODO REVIEW
            //   if (havocRunData["machineInfo"] == "tanzu") {
            //         this._netHavocService.Cluster = havocRunData["tier"];
            //         this._netHavocService.diegoCell = havocRunData["server"];
            //         this._netHavocService.AppName = havocRunData["appname"];
            //         this._netHavocService.containerID = havocRunData["containerId"];
            //       }
            let havocType = havocRunData.havoc.type;
            let osType = havocRunData.havoc.platform;
            this._netHavocService.MachineInfo = osType;
            let graphKeys = Object.keys(havocUIConfig.graphConfig);
            for (let i = 0; i < graphKeys.length; i++) {
                if (graphKeys[i] == "subjectInfo" || graphKeys[i] == "merge")
                    continue;
                if (graphKeys.length == 3) {
                    if (!isRecursiveCall) {
                        this._netHavocService.graphId = havocUIConfig.graphConfig[graphKeys[i]][0]["mtId"];
                        this._netHavocService.graphName = havocUIConfig.graphConfig[graphKeys[i]][0]["name"];
                        this._netHavocService.groupId = havocUIConfig.graphConfig[graphKeys[i]][0]["mgId"];
                        this._netHavocService.groupName = havocUIConfig.graphConfig[graphKeys[i]][0]["group"];
                    }
                    else {
                        this._netHavocService.graphId1 = havocUIConfig.graphConfig[graphKeys[i]][0]["mtId"];
                        this._netHavocService.graphName1 = havocUIConfig.graphConfig[graphKeys[i]][0]["name"];
                        this._netHavocService.groupId1 = havocUIConfig.graphConfig[graphKeys[i]][0]["mgId"];
                        this._netHavocService.groupName1 = havocUIConfig.graphConfig[graphKeys[i]][0]["group"];
                        this._netHavocService.multipleGraph = "1";
                    }
                    if (havocType == "NH_APP_MET_EXC") {
                        //TODO REVIEW this.sendCallForGraph({...havocRunData, faultType: 'NH_APP_MET_CAL'}, true);
                    }
                    else
                        this._netHavocService.netHavocGraphLinkV2();
                    break;
                }
                else {
                    let applicationMode, cpuLoadType = '';
                    switch (havocRunData['applicationMode']) {
                        case '0':
                            applicationMode = 'Delay in Response Time';
                            break;
                        case '1':
                            applicationMode = 'Service Failure';
                            break;
                        case '2':
                            applicationMode = 'Callout Sync';
                            break;
                        default:
                            applicationMode = 'Service Failure';
                            break;
                    }
                    const valuesToMatch = [
                        (_a = havocRunData === null || havocRunData === void 0 ? void 0 : havocRunData.attributes) === null || _a === void 0 ? void 0 : _a.operation,
                        (_b = havocRunData === null || havocRunData === void 0 ? void 0 : havocRunData.attributes) === null || _b === void 0 ? void 0 : _b.mode,
                        (_c = havocRunData === null || havocRunData === void 0 ? void 0 : havocRunData.attributes) === null || _c === void 0 ? void 0 : _c.unit,
                        applicationMode
                    ];
                    if (valuesToMatch.includes(graphKeys[i])) {
                        this._netHavocService.graphId = "" + havocUIConfig.graphConfig[graphKeys[i]][0]["mtId"];
                        this._netHavocService.graphName = "" + havocUIConfig.graphConfig[graphKeys[i]][0]["name"];
                        this._netHavocService.groupId = "" + havocUIConfig.graphConfig[graphKeys[i]][0]["mgId"];
                        this._netHavocService.groupName = "" + havocUIConfig.graphConfig[graphKeys[i]][0]["group"];
                        if (havocUIConfig.graphConfig[graphKeys[i]].length > 1) {
                            this._netHavocService.graphId1 = "" + havocUIConfig.graphConfig[graphKeys[i]][1]["mtId"];
                            this._netHavocService.graphName1 = "" + havocUIConfig.graphConfig[graphKeys[i]][1]["name"];
                            this._netHavocService.multipleGraph = "1";
                        }
                        this._netHavocService.netHavocGraphLinkV2();
                        break;
                    }
                    console.log("unable to load netHavocGraphLinkV2 ");
                }
            }
        }
        catch (e) {
            console.error(e);
        }
    }
    getLabelByValue(searchValue, havocMapInfo) {
        const match = havocMapInfo.find(item => item.value === searchValue);
        return match ? match === null || match === void 0 ? void 0 : match.label : searchValue;
    }
};
NethavocHavocrundetailsComponent.ctorParameters = () => [
    { type: _services_nethavoc_http_service__WEBPACK_IMPORTED_MODULE_2__["NethavocHttpService"] },
    { type: src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_3__["CavMessageService"] },
    { type: _services_nethavoc_navigate_service__WEBPACK_IMPORTED_MODULE_5__["NetHavocNavigateService"] },
    { type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_6__["SessionService"] },
    { type: src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_7__["CavLoggingService"] },
    { type: _services_nethavoc_graph_v2_service__WEBPACK_IMPORTED_MODULE_8__["NethavocGraphV2Service"] },
    { type: _services_netHavoc_details_service__WEBPACK_IMPORTED_MODULE_9__["NethavocDetailsService"] },
    { type: src_app_shared_time_bar_service_time_bar_service__WEBPACK_IMPORTED_MODULE_11__["TimebarService"] },
    { type: _services_nethavoc_utility_service__WEBPACK_IMPORTED_MODULE_10__["NetHavocUtilityService"] },
    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_13__["ACL_PROPS"],] }] },
    { type: _services_nh_config_service__WEBPACK_IMPORTED_MODULE_15__["NhConfigService"] },
    { type: _services_nh_scenario_data_service__WEBPACK_IMPORTED_MODULE_17__["NhScenarioDataService"] }
];
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])('havocrunoverlay')
], NethavocHavocrundetailsComponent.prototype, "havocrunoverlay", void 0);
NethavocHavocrundetailsComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-nthavoc-havocrundetails',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./nethavoc-havocrundetails.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/nethavoc-havocrundetails.component.html")).default,
        providers: [{ provide: src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_13__["ACL_PROPS"], useFactory: src_app_pages_tools_admin_access_control_management_services_cav_acl_util__WEBPACK_IMPORTED_MODULE_14__["getHavocsHavocExecutionACLProps"] }],
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./nethavoc-havocrundetails.component.scss */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/nethavoc-havocrundetails.component.scss")).default]
    }),
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(9, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"])()), Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(9, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_13__["ACL_PROPS"]))
], NethavocHavocrundetailsComponent);



/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/object-keys.pipe.ts":
/*!**************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/object-keys.pipe.ts ***!
  \**************************************************************************************************************/
/*! exports provided: ObjectKeysPipe */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectKeysPipe", function() { return ObjectKeysPipe; });
/* 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");


let ObjectKeysPipe = class ObjectKeysPipe {
    transform(value) {
        if (!value || typeof value !== 'object') {
            return [];
        }
        return Object.keys(value);
    }
};
ObjectKeysPipe = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Pipe"])({
        name: 'objectKeys',
        pure: true
    })
], ObjectKeysPipe);



/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocruns/nethavoc-havocruns.component.scss":
/*!**********************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocruns/nethavoc-havocruns.component.scss ***!
  \**********************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("");

/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocruns/nethavoc-havocruns.component.ts":
/*!********************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocruns/nethavoc-havocruns.component.ts ***!
  \********************************************************************************************************************/
/*! exports provided: NethavocHavocrunsComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NethavocHavocrunsComponent", function() { return NethavocHavocrunsComponent; });
/* 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 _services_nethavoc_utility_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../services/nethavoc-utility.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-utility.service.ts");
/* harmony import */ var _services_nethavoc_http_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../services/nethavoc-http.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-http.service.ts");
/* harmony import */ var src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/shared/cav-toast/service/cav-message.service */ "./src/app/shared/cav-toast/service/cav-message.service.ts");
/* harmony import */ var _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../constants/nethavoc.constants */ "./src/app/pages/home/netHavoc-v2/constants/nethavoc.constants.ts");
/* harmony import */ var _services_nethavoc_navigate_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../services/nethavoc-navigate.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-navigate.service.ts");
/* harmony import */ var src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/core/session/session.service */ "./src/app/core/session/session.service.ts");
/* harmony import */ var _services_nh_filter_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../services/nh-filter.service */ "./src/app/pages/home/netHavoc-v2/services/nh-filter.service.ts");
/* harmony import */ var src_app_pages_scenario_service_projectlist_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! src/app/pages/scenario/service/projectlist.service */ "./src/app/pages/scenario/service/projectlist.service.ts");
/* harmony import */ var _model_nh_model__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../model/nh-model */ "./src/app/pages/home/netHavoc-v2/model/nh-model.ts");
/* harmony import */ var src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! src/app/shared/cavLoggerService/cav-logging.service */ "./src/app/shared/cavLoggerService/cav-logging.service.ts");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var primeng_api__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! primeng/api */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng-api.js");
/* harmony import */ var src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! src/app/pages/tools/admin/access-control/services/access-control.model */ "./src/app/pages/tools/admin/access-control/services/access-control.model.ts");
/* harmony import */ var src_app_pages_tools_admin_access_control_management_services_cav_acl_util__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! src/app/pages/tools/admin/access-control-management/services/cav-acl-util */ "./src/app/pages/tools/admin/access-control-management/services/cav-acl-util.ts");
/* harmony import */ var _constants_havoc_type_constants__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../constants/havoc-type.constants */ "./src/app/pages/home/netHavoc-v2/constants/havoc-type.constants.ts");
var NethavocHavocrunsComponent_1;

















let NethavocHavocrunsComponent = NethavocHavocrunsComponent_1 = class NethavocHavocrunsComponent {
    constructor(_netHavocUtilService, _netHavocHttpService, msgs, nhNavigateService, SessionService, nhFilterService, logger, projectListService, confirmationService, aclProperties) {
        this._netHavocUtilService = _netHavocUtilService;
        this._netHavocHttpService = _netHavocHttpService;
        this.msgs = msgs;
        this.nhNavigateService = nhNavigateService;
        this.SessionService = SessionService;
        this.nhFilterService = nhFilterService;
        this.logger = logger;
        this.projectListService = projectListService;
        this.confirmationService = confirmationService;
        this.aclProperties = aclProperties;
        this.relativePathforHavocRuns = _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_5__["HAVOCRUN_TABLE_CONFIG"];
        this.filterDialog = false;
        this.first = { first: 0 };
        this.rows = 10;
        this.limit = 10;
        this.offset = 0;
        this.totalRecords = 0;
        this.isFilterLoading = false;
        this.filterCount = 0;
        this.havocRunFilter = {};
        this.openDialogForImport = false;
        this.canSave = true;
        this.isNoPermission = false;
        this.stateCountMap = {};
    }
    ngOnInit() {
        return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
            this.isNoPermission = this.SessionService.isFeatureNoPerm(this.aclProperties.feature, this.aclProperties.subFeature);
            if (this.isNoPermission)
                return;
            this.nhFilterService.events.isLoading.subscribe((isLoading) => {
                this.isFilterLoading = isLoading;
                if (!isLoading) {
                    this.filterMetaData = this.nhFilterService.getFilterMetaData();
                    this.populateProjectDropdown();
                    this.setAllOptionsAsSelected();
                    this.clearFilters();
                }
            });
            this.getHavocRunsCount(this.getHavocRunFilter());
            this.pollHavocRunsData(this.getHavocRunFilter());
            this._netHavocHttpService.scenarioRunExecuted$.subscribe(() => {
                if (this.paginationEvent) {
                    this.paginationEvent.first = 0;
                    this.paginationEvent.rows = 10;
                }
                this.first = { first: 0 };
                this.rows = 10;
                this.limit = 10;
                this.offset = 0;
                this.selectedHavocRun = null;
                this.getHavocRunsCount(this.getHavocRunFilter());
                this.getHavocRunsDataRefresh(this.getHavocRunFilter());
            });
            this.statusOptions = [
                { label: 'Running', value: 3 },
                { label: 'Completed', value: 4 },
                { label: 'Failed', value: 5 },
                { label: 'Stopped', value: 2 },
            ];
            this.durationStatus = [
                { label: 'All', value: '00:00:00-NA' },
                { label: '< 30 minutes', value: '00:00:00-00:30:00' },
                { label: '> 30 minutes', value: '00:30:00-NA' },
                { label: '> 8 hours', value: '08:00:00-NA' },
            ];
            this.startedOptions = [
                { label: 'All', value: 'ALL' },
                { label: 'Last 24 hours', value: '1' },
                { label: 'Last 7 days', value: '7' },
                { label: 'Last 30 days', value: '30' },
                { label: 'Last 6 months', value: '180' },
                { label: 'Last 1 year', value: '365' },
            ];
            this.projectOptions = yield this.projectListService.getProjectListOptions();
            if (this.projectOptions && this.projectOptions.length > 0) {
                this.selectedProject = this.projectOptions[0].value;
                this.updateSubProject(this.projectOptions[0]);
            }
        });
    }
    populateProjectDropdown() {
        this.projectOptions = Object.keys(this.filterMetaData).map((project) => ({
            label: project,
            value: project,
        }));
    }
    setAllOptionsAsSelected() {
        this.havocRunFilter.project = this.projectOptions.map((option) => option.value);
        this.havocRunFilter.scenarioStatus = this.statusOptions.map((option) => option.value);
        this.onProjectChange();
    }
    updateSubProject(evt) {
        this.subProjectOptions = this.projectListService.showSubProjList(evt.value);
        if (this.subProjectOptions && this.subProjectOptions.length > 0) {
            this.selectedSubProject = this.subProjectOptions[0].value;
        }
    }
    closeImport() {
        this.openDialogForImport = false;
        this.upload1.clear();
        this.canSave = true;
        this.fileContentData = '';
    }
    getSelectedLabels(selectedItems) {
        if (!(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length))
            return 'Select Status';
        if (selectedItems.length === this.statusOptions.length)
            return 'All';
        if (selectedItems.length > 2)
            return `${selectedItems.length} items selected`;
        const labels = [];
        for (const item of selectedItems) {
            const option = this.statusOptions.find((opt) => opt.value === item);
            if (option) {
                labels.push(option.label);
            }
        }
        return labels.join(', ');
    }
    onProjectChange() {
        if (this.havocRunFilter.project && this.havocRunFilter.project.length > 0) {
            const subProjectsSet = new Set();
            this.havocRunFilter.project.forEach((project) => {
                if (this.filterMetaData[project]) {
                    Object.keys(this.filterMetaData[project]).forEach((subProject) => {
                        subProjectsSet.add(subProject);
                    });
                }
            });
            this.subProjectOptions = Array.from(subProjectsSet).map((subProject) => ({
                label: subProject,
                value: subProject,
            }));
            this.havocRunFilter.subproject = this.subProjectOptions.map((option) => option.value);
            this.onSubProjectChange();
        }
        else {
            this.subProjectOptions = [];
            this.havocRunFilter.subproject = [];
            this.scenarioOptions = [];
            this.havocRunFilter.scenarioName = [];
        }
    }
    onSubProjectChange() {
        if (this.havocRunFilter.project &&
            this.havocRunFilter.subproject &&
            this.havocRunFilter.subproject.length > 0) {
            const scenariosSet = new Set();
            this.havocRunFilter.project.forEach((project) => {
                this.havocRunFilter.subproject.forEach((subProject) => {
                    if (this.filterMetaData[project] &&
                        this.filterMetaData[project][subProject]) {
                        this.filterMetaData[project][subProject].forEach((scenario) => {
                            scenariosSet.add(scenario);
                        });
                    }
                });
            });
            this.scenarioOptions = Array.from(scenariosSet).map((scenario) => ({
                label: scenario,
                value: scenario,
            }));
            this.havocRunFilter.scenarioName = this.scenarioOptions.map((option) => option.value);
        }
        else {
            this.scenarioOptions = [];
            this.havocRunFilter.scenarioName = [];
        }
    }
    applyFilter() {
        this.filterCount = this.calculateFilterCount(this.getHavocRunFilter());
        if (this.filterCount > 0) {
            this.addFilterBadge();
        }
        else {
            this.removeFilterBadge();
        }
        this.filterDialog = false;
        this.getHavocRunsCount(this.getHavocRunFilter());
        this.pollHavocRunsData(this.getHavocRunFilter());
    }
    clearFilters() {
        // Reset all selected values
        this.havocRunFilter = {
            project: [],
            subproject: [],
            scenarioName: [],
            scenarioStatus: [],
            duration: _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_5__["DEFAULT_DURATION_FILTER"],
            started: _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_5__["DEFAULT_STARTED_FILTER"],
        };
        this.filterCount = 0;
    }
    getHavocRunFilter() {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
        let filter = lodash__WEBPACK_IMPORTED_MODULE_12__["cloneDeep"](this.havocRunFilter);
        if (((_a = filter.project) === null || _a === void 0 ? void 0 : _a.length) == 0 ||
            ((_b = filter.project) === null || _b === void 0 ? void 0 : _b.length) == ((_c = this.projectOptions) === null || _c === void 0 ? void 0 : _c.length))
            delete filter.project;
        if (((_d = filter.subproject) === null || _d === void 0 ? void 0 : _d.length) == 0 ||
            ((_e = filter.subproject) === null || _e === void 0 ? void 0 : _e.length) == ((_f = this.subProjectOptions) === null || _f === void 0 ? void 0 : _f.length))
            delete filter.subproject;
        if (((_g = filter.scenarioName) === null || _g === void 0 ? void 0 : _g.length) == 0 ||
            ((_h = filter.scenarioName) === null || _h === void 0 ? void 0 : _h.length) == ((_j = this.scenarioOptions) === null || _j === void 0 ? void 0 : _j.length))
            delete filter.scenarioName;
        if (((_k = filter.scenarioStatus) === null || _k === void 0 ? void 0 : _k.length) == 0 ||
            ((_l = filter.scenarioStatus) === null || _l === void 0 ? void 0 : _l.length) == ((_m = this.statusOptions) === null || _m === void 0 ? void 0 : _m.length))
            delete filter.scenarioStatus;
        if (filter.duration == _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_5__["DEFAULT_DURATION_FILTER"])
            delete filter.duration;
        if (filter.started == _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_5__["DEFAULT_STARTED_FILTER"])
            delete filter.started;
        return filter;
    }
    calculateFilterCount(filterValues) {
        let count = 0;
        if (filterValues.project &&
            filterValues.project.length != this.projectOptions.length)
            count++;
        if (filterValues.subproject &&
            filterValues.subproject.length != this.subProjectOptions.length)
            count++;
        if (filterValues.scenarioName &&
            filterValues.scenarioName.length != this.scenarioOptions.length)
            count++;
        if (filterValues.scenarioStatus &&
            filterValues.scenarioStatus.length != this.statusOptions.length)
            count++;
        if (filterValues.duration && filterValues.duration != '00:00:00-NA')
            count++;
        if (filterValues.started && filterValues.started != 'ALL')
            count++;
        return count;
    }
    addFilterBadge() {
        const filterButton = document.querySelector('.ui-button-icon-left.icons8-filter');
        if (filterButton) {
            const badge = document.createElement('span');
            badge.innerText = this.filterCount > 0 ? this.filterCount.toString() : '';
            badge.style.position = 'absolute';
            badge.style.top = '-7px';
            badge.style.right = '-10px';
            badge.style.backgroundColor = 'red';
            badge.style.color = 'white';
            badge.style.borderRadius = '80%';
            badge.style.padding = '2px 4px';
            badge.style.fontSize = '11px';
            badge.style.fontWeight = 'bold';
            const existingBadge = filterButton.querySelector('span');
            if (existingBadge) {
                filterButton.removeChild(existingBadge);
            }
            filterButton.appendChild(badge);
        }
    }
    removeFilterBadge() {
        const filterButton = document.querySelector('.ui-button-icon-left.icons8-filter');
        if (filterButton) {
            const existingBadge = filterButton.querySelector('span');
            if (existingBadge) {
                filterButton.removeChild(existingBadge);
            }
        }
    }
    clickHavocRunEvent(event) {
        /*
                  #define NH_CONFIGURED      0
                  #define NH_START           1
                  #define NH_STOP            2
                  #define NH_RUNNING         3
                  #define NH_COMPLETE        4
                  #define NH_FAIL            5
                  #define NH_DISABLE_HAVOC   6
               */
        this.debug(event);
        if (event.cavEventExt.actionConfig.action === 'delete') {
            this.deleteHavocRun(event.cavEventExt.row);
        }
        else if (event.cavEventExt.actionConfig.action === 'viewScenario') {
            this.viewScenario(event.cavEventExt.row);
        }
        else if (event.cavEventExt.actionConfig.action === 'reRun') {
            this.netHavocRunOperation(event.cavEventExt.row, '1');
        }
        else if (event.cavEventExt.actionConfig.action === 'stop') {
            this.netHavocRunOperation(event.cavEventExt.row, '2');
        }
        else if (event.cavEventExt.actionConfig.action === 'lockRun' || event.cavEventExt.actionConfig.action === 'unlockRun') {
            this.lockUnlock(event.cavEventExt.row);
        }
        else if (event.cavEventExt.actionConfig.action === 'export') {
            this.exportHavocRun(event.cavEventExt.row);
        }
        else if (event.cavEventExt.actionConfig.action === 'filter') {
            this.filterDialog = true;
        }
        else if (event.cavEventExt.actionConfig.action === 'import') {
            this.importHavocRun();
        }
        else if (event.cavEventExt.actionConfig.action === 'Disable_maintenances') {
            this.disableAllHavoc();
        }
        else if (event.cavEventExt.actionConfig.action === 'onRowSelect') {
            this.selectedHavocRun = event.cavEventExt.row;
            this._netHavocHttpService.havocRunBroadcaster.next(event.cavEventExt.row);
        }
    }
    deleteHavocRun(rowData) {
        try {
            this.confirmationService.confirm({
                key: 'havocrun-delete',
                message: "Are you sure you want to delete havocrun \'" +
                    rowData.havocRunNumber +
                    "\' ?",
                header: 'Confirmation',
                icon: 'pi pi-exclamation-triangle',
                acceptButtonStyleClass: 'ui-button-rounded',
                rejectButtonStyleClass: 'ui-button-rounded ui-button-secondary ml-5',
                accept: () => {
                    this._netHavocHttpService
                        .deleteHavocRun(rowData.havocRunNumber)
                        .subscribe((result) => {
                        if (result['status'] == true) {
                            this.msgs.add({
                                severity: 'success',
                                summary: 'Success Message',
                                detail: result['msg'],
                            });
                            if (this.selectedHavocRun &&
                                this.selectedHavocRun.havocRunNumber ==
                                    rowData.havocRunNumber) {
                                this.selectedHavocRun = null;
                            }
                            this.pollHavocRunsData(this.getHavocRunFilter());
                            this.getHavocRunsCount(this.getHavocRunFilter());
                        }
                        else {
                            this.msgs.add({
                                severity: 'error',
                                summary: 'Error Message',
                                detail: result['msg'],
                            });
                        }
                    }, (error) => {
                        this.error('Error in deleteRun', error);
                    });
                },
            });
        }
        catch (error) {
            console.error('Error in deleteScenario', error);
        }
    }
    lockUnlock(rowData) {
        // Check if the havoc is still running
        if (rowData.status.running === 1) {
            this.msgs.add({
                severity: 'error',
                summary: 'Error Message',
                detail: 'Cannot lock havoc run that is still in progress.',
            });
            return;
        }
        try {
            let lockstatus = !rowData.lock || false;
            this._netHavocHttpService
                .lockUnlockRun(rowData.havocRunNumber, lockstatus)
                .subscribe((result) => {
                if (result['status'] == true) {
                    this.getHavocRunsDataRefresh(this.getHavocRunFilter());
                    if (lockstatus == true) {
                        this.msgs.add({
                            severity: 'success',
                            summary: 'Success Message',
                            detail: "Havoc Run '" +
                                rowData.havocRunNumber +
                                "' has been locked successfully.",
                        });
                    }
                    else {
                        this.msgs.add({
                            severity: 'success',
                            summary: 'Success Message',
                            detail: "Havoc Run '" +
                                rowData.havocRunNumber +
                                "' has been unlocked successfully.",
                        });
                    }
                }
                else {
                    this.msgs.add({
                        severity: 'error',
                        summary: 'Error Message',
                        detail: result['msg'],
                    });
                }
            }, (error) => {
                this.error('Error in lockUnlock', error);
            });
        }
        catch (error) {
            this.error('Error in lockUnlock', error);
        }
    }
    netHavocRunOperation(rowData, operation) {
        try {
            //TODO need to handle actualTestRun
            let jsonData = {
                project: rowData.project,
                subProject: rowData.subProject,
                scenarioName: rowData.scenarioName,
                startTime: 'Current',
                testRun: this.SessionService.session.testRun.id,
                operation: operation,
            };
            if (operation == '2') {
                jsonData['havocRunNumber'] = rowData.havocRunNumber;
            }
            let finalJson = Object.assign(jsonData, this.commonJson1());
            this._netHavocHttpService.runScenario(finalJson).subscribe((result) => {
                if (result['resultStatus'] == 'success') {
                    this.msgs.add({
                        severity: 'success',
                        summary: 'Success Message',
                        detail: result['message'],
                    });
                }
                else {
                    this.msgs.add({
                        severity: 'error',
                        summary: 'Error Message',
                        detail: result['message'],
                    });
                }
            }, (error) => {
                this.error('Error in runScenario', error);
            });
        }
        catch (error) {
            this.error('Error in runScenario', error);
        }
    }
    commonJson1() {
        try {
            let isMultiDC = false;
            let url = '';
            let json = {};
            if (this.SessionService.preSession.multiDc) {
                isMultiDC = true;
            }
            if (window.location.port == undefined || window.location.port == '') {
                url = window.location.protocol + '//' + window.location.hostname;
            }
            else {
                url =
                    window.location.protocol +
                        '//' +
                        window.location.hostname +
                        ':' +
                        window.location.port;
            }
            json = {
                clusterReq: true,
                baseurl: url,
            };
            this.debug('json ', json);
            return json;
        }
        catch (error) {
            this.debug('Error in creating common json', error);
        }
    }
    viewScenario(rowData) {
        try {
            const queryParams = {
                project: rowData.project,
                subProject: rowData.subProject,
                runNo: rowData.havocRunNumber,
                scenarioName: rowData.scenarioName,
                mode: _model_nh_model__WEBPACK_IMPORTED_MODULE_10__["InjectHavocCompMode"].VIEW,
            };
            this.debug('viewScenario()', 'route scenario params', queryParams);
            this.nhNavigateService.setParams(queryParams);
            this.nhNavigateService.navigateTo('review');
        }
        catch (error) {
            this.error('Error in viewScenario', error);
        }
    }
    /*
    *This function is used to refresh the havoc runs data after every 10 seconds
    */
    pollHavocRunsData(filterValues) {
        this.loading = true;
        try {
            // Clear any existing timeout
            if (this.pollingTimer) {
                clearTimeout(this.pollingTimer);
            }
            const fetchData = () => {
                this._netHavocHttpService.getHavocRuns(this.limit, this.offset, false, filterValues)
                    .subscribe({
                    next: (result) => {
                        this.parseHavocRunsDataResponse(result);
                        // Schedule next poll after success
                        this.pollingTimer = setTimeout(fetchData, 10000);
                    },
                    error: (error) => {
                        this.error('Error in getScenarioData', error);
                        // Optional: Retry even on error
                        this.pollingTimer = setTimeout(fetchData, 10000);
                    }
                });
            };
            // Start the initial fetch
            fetchData();
        }
        catch (error) {
            this.error('Error in getHavocDetails', error);
        }
    }
    /*
    *This function is used to refresh the havoc runs data only once
    */
    getHavocRunsDataRefresh(filter) {
        this.loading = true;
        try {
            this._netHavocHttpService
                .getHavocRuns(this.limit, this.offset, false, filter)
                .subscribe((result) => {
                this.parseHavocRunsDataResponse(result);
            }, (error) => {
                this.error('Error in getHavocRunsData', error);
            });
        }
        catch (error) {
            this.error('Error in getHavocRunsData', error);
        }
    }
    parseHavocRunsDataResponse(result) {
        var _a;
        this.debug(' getHavocRunsData result ', result);
        if (result['status'] == true) {
            this.havocRunList = result['havocRuns'];
            if (!this.havocRunList || this.havocRunList.length == 0) {
                this.loading = false;
                return;
            }
            if (this.totalRecords && this.totalRecords > 0)
                this.gettablestatusdatacountinfo();
            if (this.selectedHavocRun == null)
                this.selectedHavocRun = this.havocRunList[0];
            let selectedHavocRunNum = (_a = this.selectedHavocRun) === null || _a === void 0 ? void 0 : _a.havocRunNumber;
            this.havocRunList.forEach((item) => {
                if ('duration' in item) {
                    item.duration = this._netHavocUtilService.getDuration(item.scenarioStatus, item['sTime'], item['eTime']);
                }
                if (selectedHavocRunNum && selectedHavocRunNum == item.havocRunNumber) {
                    this.selectedHavocRun = item;
                }
            });
            this.loading = false;
            if (this.selectedHavocRun)
                this._netHavocHttpService.havocRunBroadcaster.next(this.selectedHavocRun);
            else
                this._netHavocHttpService.havocRunBroadcaster.next(result['havocRuns'] && result['havocRuns'].length > 0
                    ? result['havocRuns'][0]
                    : undefined);
            if (this.paginationEvent) {
                setTimeout(() => {
                    this.first = { first: this.paginationEvent.first };
                }, 0);
            }
        }
        else {
            this.msgs.add({
                severity: 'error',
                summary: 'Error Message',
                detail: result['msg'],
            });
            this.loading = false;
        }
    }
    gettablestatusdatacountinfo() {
        let runingcount = 0;
        if (this.havocRunList) {
            runingcount = this.stateCountMap[_constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_5__["Havoc_Status"].RUNNING] || 0;
            let obj = {
                totalcount: this.totalRecords,
                runingcount: runingcount,
            };
            this._netHavocHttpService.havocRuntablestatusobj.next(obj); //.next(this.selectedHavocRun);
        }
    }
    ngOnDestroy() {
        try {
            if (this.pollingTimer) {
                clearTimeout(this.pollingTimer);
            }
        }
        catch (error) {
            this.error('Error in ngOnDestroy', error);
        }
    }
    disableAllHavoc() {
        try {
            this._netHavocHttpService.disableAllHavocs().subscribe((result) => {
                if (result['status'] == true) {
                    this.msgs.add({
                        severity: 'success',
                        summary: 'Success Message',
                        detail: result['msg'],
                    });
                }
                else {
                    this.msgs.add({
                        severity: 'error',
                        summary: 'Error Message',
                        detail: result['msg'],
                    });
                }
            }, (error) => {
                this.error('Error in disableAllHavoc', error);
            });
        }
        catch (error) {
            this.error('Error in disableAllHavoc', error);
        }
    }
    getHavocRunsCount(filterValue) {
        try {
            this._netHavocHttpService
                .getHavocRuns(this.limit, this.offset, true, filterValue)
                .subscribe((result) => {
                if (result['documentCount'] != null &&
                    result['documentCount'] > -1) {
                    this.totalRecords = result['documentCount'];
                    let statusCount = result['stateCounts'] || [];
                    this.stateCountMap = {};
                    statusCount.forEach((item) => {
                        this.stateCountMap[item._id] = item.count;
                    });
                    this.setPaginatorInnerHTML();
                    this.gettablestatusdatacountinfo();
                }
                else {
                    this.msgs.add({
                        severity: 'error',
                        summary: 'Error Message',
                        detail: result['msg'],
                    });
                }
            }, (error) => {
                this.error('Error in getHavocRunsCount', error);
            });
        }
        catch (error) {
            this.error('Error in getHavocRunsCount', error);
        }
    }
    loadPagination(event) {
        if (!this.totalRecords) {
            return;
        }
        this.loading = true;
        if (Object.keys(event.filters).length == 0) {
            this.updateOffset(event.first, event.rows);
            this.paginationEvent = event;
            return;
        }
    }
    updateOffset(offset, limit) {
        // set limit as per remaining counts.
        this.limit =
            this.totalRecords - offset > limit ? limit : this.totalRecords - offset;
        this.offset = offset;
        this.pollHavocRunsData(this.getHavocRunFilter());
    }
    debug(...msg) {
        this.logger.debug(src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_11__["NH"], NethavocHavocrunsComponent_1.SELECTOR, ...msg);
    }
    error(...msg) {
        this.logger.error(src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_11__["NH"], NethavocHavocrunsComponent_1.SELECTOR, ...msg);
    }
    handleFileUpload(event) {
        try {
            const file = event.files[0];
            const reader = new FileReader();
            reader.onload = (e) => {
                const fileContent = reader.result;
                this.fileContentData = JSON.parse(fileContent);
            };
            reader.readAsText(file);
            this.canSave = false;
        }
        catch (error) {
            console.error('Error in handleFileUpload', error);
        }
    }
    saveImportData() {
        let havocrunObj = JSON.parse(JSON.stringify(this.fileContentData));
        if (havocrunObj.havocRunDetail) {
            havocrunObj.havocRunDetail.forEach((obj) => {
                obj.project = this.selectedProject;
                obj.subProject = this.selectedSubProject;
            });
        }
        if (havocrunObj.havocRun) {
            havocrunObj.havocRun.project = this.selectedProject;
            havocrunObj.havocRun.subProject = this.selectedSubProject;
        }
        this._netHavocHttpService.importhavocrunReq(havocrunObj).subscribe({
            next: (response) => {
                if (response['status']) {
                    this.msgs.add({
                        severity: 'success',
                        summary: 'Success',
                        detail: response['msg'],
                    });
                    this.closeImport();
                }
                else {
                    this.msgs.add({
                        severity: 'error',
                        summary: 'Error Message',
                        detail: response['msg'],
                    });
                    this.closeImport();
                }
            },
            error: (error) => {
                this.msgs.add({
                    severity: 'error',
                    summary: 'Error Message',
                    detail: 'Error, please try again.',
                });
            },
            complete: () => { },
        });
    }
    exportHavocRun(rowData) {
        try {
            this._netHavocHttpService
                .getDetailsHavocRuns(rowData['havocRunNumber'])
                .subscribe((result) => {
                if (result['status'] == true) {
                    let havocDetails = result['havocs'];
                    (havocDetails || []).forEach((obj) => {
                        delete obj._id;
                    });
                    let havocrun = JSON.parse(JSON.stringify(rowData));
                    delete havocrun._id;
                    let havocrunobj = {
                        havocRun: havocrun,
                        havocRunDetail: havocDetails,
                    };
                    //this.msgs.add({severity:'success', summary:'Success Message', detail:result['msg']});
                    this.exportScenarioFile(JSON.stringify(havocrunobj, null, 2), 'HavocRun_' + havocrun['havocRunNumber'] + '.json');
                }
            }, (error) => {
                console.error('Error in getScenarioData', error);
            });
        }
        catch (error) {
            console.error('Error in getHavocDetails', error);
        }
    }
    exportScenarioFile(data, filename) {
        const blob = new Blob([data], { type: 'application/json' });
        const url = window.URL.createObjectURL(blob);
        const a = document.createElement('a');
        a.href = url;
        a.download = filename;
        document.body.appendChild(a);
        a.click();
        document.body.removeChild(a);
        window.URL.revokeObjectURL(url);
    }
    importHavocRun() {
        this.openDialogForImport = true;
    }
    setPaginatorInnerHTML() {
        let innerHTML = '';
        for (const state in this.stateCountMap) {
            const count = this.stateCountMap[state];
            const { label, icon } = _constants_havoc_type_constants__WEBPACK_IMPORTED_MODULE_16__["HAVOC_STATES"][+state]; // use +state to convert string key to number
            innerHTML +=
                `<div class="legend-group severity-button-group">
            <div class="paginator-legend rounded-3 cav-status ${icon}"></div>
            <span>${label} (${count})</span>
            </div>`;
        }
        this.paginatorInnerHTML = innerHTML;
    }
};
NethavocHavocrunsComponent.SELECTOR = 'app-nethavoc-havocruns';
NethavocHavocrunsComponent.ctorParameters = () => [
    { type: _services_nethavoc_utility_service__WEBPACK_IMPORTED_MODULE_2__["NetHavocUtilityService"] },
    { type: _services_nethavoc_http_service__WEBPACK_IMPORTED_MODULE_3__["NethavocHttpService"] },
    { type: src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_4__["CavMessageService"] },
    { type: _services_nethavoc_navigate_service__WEBPACK_IMPORTED_MODULE_6__["NetHavocNavigateService"] },
    { type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_7__["SessionService"] },
    { type: _services_nh_filter_service__WEBPACK_IMPORTED_MODULE_8__["NhFilterService"] },
    { type: src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_11__["CavLoggingService"] },
    { type: src_app_pages_scenario_service_projectlist_service__WEBPACK_IMPORTED_MODULE_9__["ProjectListService"] },
    { type: primeng_api__WEBPACK_IMPORTED_MODULE_13__["ConfirmationService"] },
    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_14__["ACL_PROPS"],] }] }
];
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])('upload1')
], NethavocHavocrunsComponent.prototype, "upload1", void 0);
NethavocHavocrunsComponent = NethavocHavocrunsComponent_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-nethavoc-havocruns',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./nethavoc-havocruns.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocruns/nethavoc-havocruns.component.html")).default,
        providers: [{ provide: src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_14__["ACL_PROPS"], useFactory: src_app_pages_tools_admin_access_control_management_services_cav_acl_util__WEBPACK_IMPORTED_MODULE_15__["getHavocsHavocExecutionACLProps"] }],
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./nethavoc-havocruns.component.scss */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocruns/nethavoc-havocruns.component.scss")).default]
    }),
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(9, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"])()), Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(9, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_14__["ACL_PROPS"]))
], NethavocHavocrunsComponent);



/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-health-check/nethavoc-health-check.component.scss":
/*!****************************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-health-check/nethavoc-health-check.component.scss ***!
  \****************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("");

/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-health-check/nethavoc-health-check.component.ts":
/*!**************************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-health-check/nethavoc-health-check.component.ts ***!
  \**************************************************************************************************************************/
/*! exports provided: NethavocHealthCheckComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NethavocHealthCheckComponent", function() { return NethavocHealthCheckComponent; });
/* 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 _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../constants/nethavoc.constants */ "./src/app/pages/home/netHavoc-v2/constants/nethavoc.constants.ts");



let NethavocHealthCheckComponent = class NethavocHealthCheckComponent {
    constructor() {
        this.relativePathforHealthCheck = _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_2__["HEALTH_CHECK_TABLE_CONFIG"];
    }
    ngOnInit() {
        this.healthCheckList = [
            {
                "healthCheck": "Memory",
                "properties": "Metric Utilization",
                "threshold": "",
                "startTime": new Date(),
                "status": "1"
            },
        ];
    }
    // healthCheck  properties  threshold  startTime  status 
    healthCheckTableHandler(event) {
    }
};
NethavocHealthCheckComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-nethavoc-health-check',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./nethavoc-health-check.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-health-check/nethavoc-health-check.component.html")).default,
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./nethavoc-health-check.component.scss */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-health-check/nethavoc-health-check.component.scss")).default]
    })
], NethavocHealthCheckComponent);



/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-home.component.scss":
/*!**********************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-home.component.scss ***!
  \**********************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("app-nethavoc-home .havoc,\napp-nethavoc-home .havocRuns,\napp-nethavoc-home .havocEvents {\n  width: 44px;\n  height: 44px;\n  border-radius: 50%;\n  border-style: dotted;\n  border-width: 1px;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n}\napp-nethavoc-home .havoc {\n  color: var(--secondary-800);\n  border-color: var(--secondary-800);\n  box-shadow: inset 0 0 0px 2px rgba(29, 82, 144, 0.2);\n}\napp-nethavoc-home .havocRuns {\n  color: var(--warning-800);\n  border-color: var(--warning-800);\n  box-shadow: inset 0 0 0px 2px rgba(255, 108, 55, 0.2);\n}\napp-nethavoc-home .havocEvents {\n  color: var(--primary-800);\n  border-color: var(--primary-800);\n  box-shadow: inset 0 0 0px 2px rgba(83, 182, 117, 0.2);\n}\napp-nethavoc-home .havocDesc {\n  display: flex;\n  flex-direction: column;\n  margin: 0px 12px;\n  height: 42px;\n  justify-content: space-between;\n}\napp-nethavoc-home .flex-container {\n  justify-content: center;\n}\napp-nethavoc-home .legend-group {\n  display: inline-block;\n  margin: 5px 0;\n}\napp-nethavoc-home .paginator-legend {\n  width: 10px;\n  height: 10px;\n  display: inline-block;\n  margin: 0 5px;\n  min-width: 7px;\n  padding: 0.25rem 0.3rem;\n}");

/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-home.component.ts":
/*!********************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-home.component.ts ***!
  \********************************************************************************************/
/*! exports provided: NetHavocHomeComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NetHavocHomeComponent", function() { return NetHavocHomeComponent; });
/* 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_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
/* harmony import */ var _disable_havoc_config_disable_havoc_config_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./disable-havoc-config/disable-havoc-config.component */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/disable-havoc-config/disable-havoc-config.component.ts");
/* harmony import */ var _netHavoc_services_nethavoc_data_provider_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../netHavoc/services/nethavoc-data-provider.service */ "./src/app/pages/home/netHavoc/services/nethavoc-data-provider.service.ts");
/* harmony import */ var src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/app/core/session/session.service */ "./src/app/core/session/session.service.ts");
/* harmony import */ var _services_nethavoc_http_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../services/nethavoc-http.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-http.service.ts");
/* harmony import */ var _services_nethavoc_utility_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../services/nethavoc-utility.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-utility.service.ts");
/* harmony import */ var _services_nethavoc_global_config_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../services/nethavoc-global-config.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-global-config.service.ts");
/* harmony import */ var _services_nh_hierarchical_data_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../services/nh-hierarchical-data.service */ "./src/app/pages/home/netHavoc-v2/services/nh-hierarchical-data.service.ts");
/* harmony import */ var src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! src/app/pages/tools/admin/access-control/services/access-control.model */ "./src/app/pages/tools/admin/access-control/services/access-control.model.ts");
/* harmony import */ var src_app_pages_tools_admin_access_control_management_services_cav_acl_util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! src/app/pages/tools/admin/access-control-management/services/cav-acl-util */ "./src/app/pages/tools/admin/access-control-management/services/cav-acl-util.ts");












let NetHavocHomeComponent = class NetHavocHomeComponent {
    constructor(_netHavocHttpService, router, nhUtilityService, netHavocDataProvider, sessionService, globalConfig, nhHierarchicalDataService, aclProperties) {
        this._netHavocHttpService = _netHavocHttpService;
        this.router = router;
        this.nhUtilityService = nhUtilityService;
        this.netHavocDataProvider = netHavocDataProvider;
        this.sessionService = sessionService;
        this.globalConfig = globalConfig;
        this.nhHierarchicalDataService = nhHierarchicalDataService;
        this.aclProperties = aclProperties;
        this.disableHavoc = false;
        this.runtablecountinfo = { "totalcount": 0, "runingcount": 0 };
        this.scenariolistcountinfo = { "totalcount": 0, "schedulecount": 0 };
        this.havocstate = 'disable';
        this.isNoPermisson = false;
    }
    ngOnInit() {
        this.isNoPermisson = this.sessionService.isFeatureNoPerm(this.aclProperties.feature, this.aclProperties.subFeature);
        //TO DO rest call for enable disable for first time (to load form havoc configuration collection)
        this.netHavocDataProvider.$testRun = this.sessionService.session.testRun.id;
        this.getHavocRunTableCountInfo();
        this.getScenarioListTableCountInfo();
        let obj = {
            "user": this.sessionService.session.cctx.u
        };
        this._netHavocHttpService.nethavocOldPostCall("getHavocConfiguration", null, obj, "/DashboardServer/v2/nethavoc/data/", 'post').subscribe((result) => {
            this.globalConfig.config = result;
            this.globalConfig.connectionType = Number(result["connectionType"]);
        }, error => {
            console.error("Error in getting Global Config: ", error);
        });
    }
    havocstateevent(event) {
        this.havocstate = event;
    }
    getHavocRunTableCountInfo() {
        try {
            this.dataSubscription = this._netHavocHttpService.havocRuntableObserver$.subscribe((result) => {
                this.runtablecountinfo = result;
            }, error => {
                console.error("Error in getHavocRunDetails", error);
            }, () => {
                this.dataSubscription.unsubscribe();
            });
        }
        catch (error) {
            console.error("Error in getHavocRunDetails", error);
        }
    }
    getScenarioListTableCountInfo() {
        try {
            this.scenarioSubscription = this._netHavocHttpService.ScenarioListtableObserver$.subscribe((result) => {
                this.scenariolistcountinfo = result;
            }, error => {
                console.error("Error in getHavocRunDetails", error);
            }, () => {
                this.scenarioSubscription.unsubscribe();
            });
        }
        catch (error) {
            console.error("Error in getHavocRunDetails", error);
        }
    }
    netHavocConfig() {
        this.router.navigateByUrl('/home/net-havoc-v2/netHavoc-configuration');
    }
    disableAllHavoc() {
        this.DisbaleHavocConfig.open();
    }
    enableAllHavoc() {
        this.DisbaleHavocConfig.enableAllhavoc();
    }
    ngOnDestroy() {
    }
};
NetHavocHomeComponent.ctorParameters = () => [
    { type: _services_nethavoc_http_service__WEBPACK_IMPORTED_MODULE_6__["NethavocHttpService"] },
    { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"] },
    { type: _services_nethavoc_utility_service__WEBPACK_IMPORTED_MODULE_7__["NetHavocUtilityService"] },
    { type: _netHavoc_services_nethavoc_data_provider_service__WEBPACK_IMPORTED_MODULE_4__["NetHavocDataProvider"] },
    { type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_5__["SessionService"] },
    { type: _services_nethavoc_global_config_service__WEBPACK_IMPORTED_MODULE_8__["NethavocGlobalConfigService"] },
    { type: _services_nh_hierarchical_data_service__WEBPACK_IMPORTED_MODULE_9__["NhHierarchicalDataService"] },
    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_10__["ACL_PROPS"],] }] }
];
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])(_disable_havoc_config_disable_havoc_config_component__WEBPACK_IMPORTED_MODULE_3__["DisbaleHavocConfigComponent"], { read: _disable_havoc_config_disable_havoc_config_component__WEBPACK_IMPORTED_MODULE_3__["DisbaleHavocConfigComponent"] })
], NetHavocHomeComponent.prototype, "DisbaleHavocConfig", void 0);
NetHavocHomeComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-nethavoc-home',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./nethavoc-home.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-home.component.html")).default,
        encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
        providers: [{ provide: src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_10__["ACL_PROPS"], useFactory: src_app_pages_tools_admin_access_control_management_services_cav_acl_util__WEBPACK_IMPORTED_MODULE_11__["getHavocsHavocConfigurationACLProps"] }],
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./nethavoc-home.component.scss */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-home.component.scss")).default]
    }),
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(7, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"])()), Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(7, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_10__["ACL_PROPS"]))
], NetHavocHomeComponent);



/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-home.module.ts":
/*!*****************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-home.module.ts ***!
  \*****************************************************************************************/
/*! exports provided: NethavocHomeModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NethavocHomeModule", function() { return NethavocHomeModule; });
/* 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_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
/* harmony import */ var _nethavoc_home_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./nethavoc-home.component */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-home.component.ts");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
/* 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 _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/material/tooltip */ "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/tooltip.js");
/* harmony import */ var primeng__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! primeng */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
/* harmony import */ var src_app_pages_my_library_alert_alert_actions_add_action_add_action_module__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/pages/my-library/alert/alert-actions/add-action/add-action.module */ "./src/app/pages/my-library/alert/alert-actions/add-action/add-action.module.ts");
/* harmony import */ var src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! src/app/shared/cav-table/cav-table.module */ "./src/app/shared/cav-table/cav-table.module.ts");
/* harmony import */ var src_app_shared_cav_toolbar_cav_toolbar_module__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! src/app/shared/cav-toolbar/cav-toolbar.module */ "./src/app/shared/cav-toolbar/cav-toolbar.module.ts");
/* harmony import */ var src_app_shared_help_help_module__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! src/app/shared/help/help.module */ "./src/app/shared/help/help.module.ts");
/* harmony import */ var src_app_shared_pipes_pipes_module__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! src/app/shared/pipes/pipes.module */ "./src/app/shared/pipes/pipes.module.ts");
/* harmony import */ var _nethavoc_havocruns_nethavoc_havocruns_component__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./nethavoc-havocruns/nethavoc-havocruns.component */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocruns/nethavoc-havocruns.component.ts");
/* harmony import */ var _nethavoc_scenario_nethavoc_scenario_component__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./nethavoc-scenario/nethavoc-scenario.component */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-scenario/nethavoc-scenario.component.ts");
/* harmony import */ var _nethavoc_havocrundetails_nethavoc_havocrundetails_component__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./nethavoc-havocrundetails/nethavoc-havocrundetails.component */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/nethavoc-havocrundetails.component.ts");
/* harmony import */ var _nethavoc_schedule_summary_nethavoc_schedule_summary_component__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./nethavoc-schedule-summary/nethavoc-schedule-summary.component */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-schedule-summary/nethavoc-schedule-summary.component.ts");
/* harmony import */ var _nethavoc_health_check_nethavoc_health_check_component__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./nethavoc-health-check/nethavoc-health-check.component */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-health-check/nethavoc-health-check.component.ts");
/* harmony import */ var primeng_radiobutton__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! primeng/radiobutton */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng-radiobutton.js");
/* harmony import */ var _disable_havoc_config_disable_havoc_config_component__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./disable-havoc-config/disable-havoc-config.component */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/disable-havoc-config/disable-havoc-config.component.ts");
/* harmony import */ var _nethavoc_scenario_save_nethavoc_scenario_save_module__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../nethavoc-scenario-save/nethavoc-scenario-save.module */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-scenario-save/nethavoc-scenario-save.module.ts");
/* harmony import */ var _shared_cav_scheduler_table_cav_scheduler_table_module__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../../../../shared/cav-scheduler-table/cav-scheduler-table.module */ "./src/app/shared/cav-scheduler-table/cav-scheduler-table.module.ts");
/* harmony import */ var _nh_schedule_nh_schedule_module__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../nh-schedule/nh-schedule.module */ "./src/app/pages/home/netHavoc-v2/components/nh-schedule/nh-schedule.module.ts");
/* harmony import */ var src_app_shared_cav_loader_cav_loader_module__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! src/app/shared/cav-loader/cav-loader.module */ "./src/app/shared/cav-loader/cav-loader.module.ts");
/* harmony import */ var _havoc_design_havoc_design_module__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../havoc-design/havoc-design.module */ "./src/app/pages/home/netHavoc-v2/components/havoc-design/havoc-design.module.ts");
/* harmony import */ var _pipes_camel_to_title_formatter_pipe__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../pipes/camel-to-title-formatter.pipe */ "./src/app/pages/home/netHavoc-v2/pipes/camel-to-title-formatter.pipe.ts");
/* harmony import */ var _nethavoc_havocrundetails_object_keys_pipe__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./nethavoc-havocrundetails/object-keys.pipe */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/object-keys.pipe.ts");
/* harmony import */ var _nethavoc_havocrundetails_is_object_pipe__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./nethavoc-havocrundetails/is-object.pipe */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-havocrundetails/is-object.pipe.ts");




























// { path: '', component: NetHavocHomeComponent, children:[
//     { path: 'dummy', component: NetHavocDummyComponent } // Use the component, not the module
// ]}
const routes = [
    { path: '', component: _nethavoc_home_component__WEBPACK_IMPORTED_MODULE_3__["NetHavocHomeComponent"], }
];
const imports = [
    _nh_schedule_nh_schedule_module__WEBPACK_IMPORTED_MODULE_22__["NhScheduleModule"],
    src_app_shared_cav_loader_cav_loader_module__WEBPACK_IMPORTED_MODULE_23__["CavLoaderModule"],
    _angular_common__WEBPACK_IMPORTED_MODULE_4__["CommonModule"],
    _angular_forms__WEBPACK_IMPORTED_MODULE_5__["FormsModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["ToolbarModule"],
    _shared_cav_scheduler_table_cav_scheduler_table_module__WEBPACK_IMPORTED_MODULE_21__["cavSchedulerTableModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["ButtonModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["TableModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["FileUploadModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["InputSwitchModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["InputTextModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["CalendarModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["SpinnerModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["SelectButtonModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["PanelModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["DropdownModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["CheckboxModule"],
    src_app_shared_pipes_pipes_module__WEBPACK_IMPORTED_MODULE_12__["PipeModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["MultiSelectModule"],
    src_app_pages_my_library_alert_alert_actions_add_action_add_action_module__WEBPACK_IMPORTED_MODULE_8__["AddActionModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["ChipsModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["BlockUIModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["ConfirmDialogModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["TieredMenuModule"],
    _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_6__["MatTooltipModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["TooltipModule"],
    src_app_shared_help_help_module__WEBPACK_IMPORTED_MODULE_11__["HelpModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["PaginatorModule"],
    src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_9__["CavTableModule"],
    src_app_shared_cav_toolbar_cav_toolbar_module__WEBPACK_IMPORTED_MODULE_10__["CavToolbarModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["DialogModule"],
    primeng_radiobutton__WEBPACK_IMPORTED_MODULE_18__["RadioButtonModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["BreadcrumbModule"],
    primeng__WEBPACK_IMPORTED_MODULE_7__["OverlayPanelModule"],
    _nethavoc_scenario_save_nethavoc_scenario_save_module__WEBPACK_IMPORTED_MODULE_20__["NetHavocScenarioSaveModule"],
    _havoc_design_havoc_design_module__WEBPACK_IMPORTED_MODULE_24__["HavocDesignModule"]
];
let NethavocHomeModule = class NethavocHomeModule {
};
NethavocHomeModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
        declarations: [
            _nethavoc_home_component__WEBPACK_IMPORTED_MODULE_3__["NetHavocHomeComponent"],
            _nethavoc_havocruns_nethavoc_havocruns_component__WEBPACK_IMPORTED_MODULE_13__["NethavocHavocrunsComponent"],
            _nethavoc_scenario_nethavoc_scenario_component__WEBPACK_IMPORTED_MODULE_14__["NethavocScenarioComponent"],
            _nethavoc_havocrundetails_nethavoc_havocrundetails_component__WEBPACK_IMPORTED_MODULE_15__["NethavocHavocrundetailsComponent"],
            _disable_havoc_config_disable_havoc_config_component__WEBPACK_IMPORTED_MODULE_19__["DisbaleHavocConfigComponent"],
            _nethavoc_schedule_summary_nethavoc_schedule_summary_component__WEBPACK_IMPORTED_MODULE_16__["NetHavocScheduleSummaryComponent"],
            _nethavoc_health_check_nethavoc_health_check_component__WEBPACK_IMPORTED_MODULE_17__["NethavocHealthCheckComponent"],
            _pipes_camel_to_title_formatter_pipe__WEBPACK_IMPORTED_MODULE_25__["CamelToTitleFormatterPipe"],
            _nethavoc_havocrundetails_object_keys_pipe__WEBPACK_IMPORTED_MODULE_26__["ObjectKeysPipe"],
            _nethavoc_havocrundetails_is_object_pipe__WEBPACK_IMPORTED_MODULE_27__["IsObjectPipe"]
        ],
        imports: [_angular_router__WEBPACK_IMPORTED_MODULE_2__["RouterModule"].forChild(routes), imports],
        exports: [_nethavoc_home_component__WEBPACK_IMPORTED_MODULE_3__["NetHavocHomeComponent"]]
    })
], NethavocHomeModule);



/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-scenario/nethavoc-scenario.component.scss":
/*!********************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-scenario/nethavoc-scenario.component.scss ***!
  \********************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("");

/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-scenario/nethavoc-scenario.component.ts":
/*!******************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-scenario/nethavoc-scenario.component.ts ***!
  \******************************************************************************************************************/
/*! exports provided: NethavocScenarioComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NethavocScenarioComponent", function() { return NethavocScenarioComponent; });
/* 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 _services_nethavoc_http_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../services/nethavoc-http.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-http.service.ts");
/* harmony import */ var src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/shared/cav-toast/service/cav-message.service */ "./src/app/shared/cav-toast/service/cav-message.service.ts");
/* harmony import */ var _services_nethavoc_navigate_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../services/nethavoc-navigate.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-navigate.service.ts");
/* harmony import */ var _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../constants/nethavoc.constants */ "./src/app/pages/home/netHavoc-v2/constants/nethavoc.constants.ts");
/* harmony import */ var primeng_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! primeng/api */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng-api.js");
/* harmony import */ var src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/core/session/session.service */ "./src/app/core/session/session.service.ts");
/* harmony import */ var _services_nh_filter_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../services/nh-filter.service */ "./src/app/pages/home/netHavoc-v2/services/nh-filter.service.ts");
/* harmony import */ var src_app_pages_scenario_service_projectlist_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! src/app/pages/scenario/service/projectlist.service */ "./src/app/pages/scenario/service/projectlist.service.ts");
/* harmony import */ var _model_nh_model__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../model/nh-model */ "./src/app/pages/home/netHavoc-v2/model/nh-model.ts");
/* harmony import */ var src_app_pages_home_netHavoc_services_nethavoc_data_provider_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! src/app/pages/home/netHavoc/services/nethavoc-data-provider.service */ "./src/app/pages/home/netHavoc/services/nethavoc-data-provider.service.ts");
/* harmony import */ var src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! src/app/pages/tools/admin/access-control/services/access-control.model */ "./src/app/pages/tools/admin/access-control/services/access-control.model.ts");
/* harmony import */ var src_app_pages_tools_admin_access_control_management_services_cav_acl_util__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! src/app/pages/tools/admin/access-control-management/services/cav-acl-util */ "./src/app/pages/tools/admin/access-control-management/services/cav-acl-util.ts");














let NethavocScenarioComponent = class NethavocScenarioComponent {
    constructor(_netHavocHttpService, msgs, nHNavigateService, confirmationService, SessionService, nhFilterService, projectListService, nhavocDataProvider, aclProperties) {
        this._netHavocHttpService = _netHavocHttpService;
        this.msgs = msgs;
        this.nHNavigateService = nHNavigateService;
        this.confirmationService = confirmationService;
        this.SessionService = SessionService;
        this.nhFilterService = nhFilterService;
        this.projectListService = projectListService;
        this.nhavocDataProvider = nhavocDataProvider;
        this.aclProperties = aclProperties;
        this.copyscenarioName = "";
        this.openDialogForCopy = false;
        this.relativePathforScenName = _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_5__["SCENARIOLIST_TABLE_CONFIG"];
        this.openScheduleSummaryDialog = false;
        this.openDialogForImport = false;
        this.canSave = true;
        this.projectOptions = [];
        this.subProjectOptions = [];
        this.isNoPermission = false;
        this.hasPermission = false;
    }
    ngOnInit() {
        return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
            this.nHNavigateService.isScenarioEditNewMode = false;
            this.isNoPermission = this.SessionService.isFeatureNoPerm(this.aclProperties.feature, this.aclProperties.subFeature);
            this.hasPermission = this.SessionService.isFeatureWrite(this.aclProperties.feature, this.aclProperties.subFeature);
            if (this.isNoPermission)
                return;
            this.scenList = [];
            this.getScenarioData();
            this.projectOptions = yield this.projectListService.getProjectListOptions();
            if (this.projectOptions && this.projectOptions.length > 0) {
                this.selectedProject = this.projectOptions[0].value;
                this.updateSubProject(this.projectOptions[0]);
            }
        });
    }
    clickScenNameEvent(event) {
        const action = event.cavEventExt.actionConfig.action;
        const row = event.cavEventExt.row;
        if (action === 'edit' || action === 'clickable') {
            if (!this.hasPermission) {
                this.msgs.add({
                    severity: 'warn',
                    summary: 'Permission Denied',
                    detail: `You don't have permission to edit scenario (You need Havocs: Havoc Scenario permission)`,
                });
                return;
            }
            else {
                this.editScenario(row);
            }
        }
        else if (action === 'export') {
            this.exportScenario(row);
        }
        else if (action === 'copy') {
            this.copyScenario(row);
        }
        else if (action === 'delete') {
            this.deleteScenario(row);
        }
        else if (action === 'clock') {
            this.openScheduleSummaryDialog = true;
        }
        else if (action === 'add') {
            this.nHNavigateService.resetParams();
            this.nHNavigateService.navigateTo('inject');
        }
        else if (action === 'refresh') {
            this.getScenarioData('refresh');
        }
        else if (action === 'import') {
            this.openDialogForImport = true;
        }
        else if (action === 'run') {
            this.runScenario(row);
        }
    }
    closeImport() {
        this.openDialogForImport = false;
        this.upload1.clear();
        this.canSave = true;
        this.fileContentData = "";
    }
    saveImportData() {
        let scenarioObj = JSON.parse(JSON.stringify(this.fileContentData));
        delete scenarioObj.status;
        delete scenarioObj.rsTime;
        delete scenarioObj.status;
        delete scenarioObj.rsTime;
        if (scenarioObj.havocDetails) {
            scenarioObj.havocDetails.forEach(obj => {
                obj.project = this.selectedProject;
                obj.subProject = this.selectedSubProject;
            });
        }
        if (scenarioObj.scenario) {
            scenarioObj.scenario.project = this.selectedProject;
            scenarioObj.scenario.subProject = this.selectedSubProject;
        }
        this._netHavocHttpService.configureScenario(scenarioObj).subscribe({
            next: (response) => {
                if (response['status']) {
                    this.msgs.add({ severity: 'success', summary: 'Success', detail: response['msg'] });
                    this.closeImport();
                    const queryParams = {
                        project: scenarioObj.scenario.project,
                        subProject: scenarioObj.scenario.subProject,
                        scenarioName: scenarioObj.scenario.scenarioName,
                        mode: _model_nh_model__WEBPACK_IMPORTED_MODULE_10__["InjectHavocCompMode"].EDIT
                    };
                    this.nHNavigateService.setParams(queryParams);
                    this.nHNavigateService.navigateTo('review');
                }
                else {
                    this.msgs.add({ severity: 'error', summary: 'Error Message', detail: response['msg'] });
                }
            },
            error: (error) => {
                this.msgs.add({ severity: 'error', summary: 'Error Message', detail: 'Error, please try again.' });
            },
            complete: () => {
            }
        });
    }
    updateSubProject(evt) {
        this.subProjectOptions = this.projectListService.showSubProjList(evt.value);
        if (this.subProjectOptions && this.subProjectOptions.length > 0) {
            this.selectedSubProject = this.subProjectOptions[0].value;
        }
    }
    handleFileUpload(event) {
        try {
            const file = event.files[0];
            const reader = new FileReader();
            reader.onload = (e) => {
                const fileContent = reader.result;
                this.fileContentData = JSON.parse(fileContent);
            };
            reader.readAsText(file);
            this.canSave = false;
        }
        catch (error) {
            console.error("Error in handleFileUpload", error);
        }
    }
    exportScenario(rowData) {
        try {
            let queryParam = "/" + rowData['project'] + "/" + rowData['subProject'] + "/" + rowData['scenarioName'];
            this._netHavocHttpService.getScenarioList(queryParam).subscribe(result => {
                if (result['status'] == true) {
                    let scenarioObj = JSON.parse(JSON.stringify(result));
                    delete scenarioObj.status;
                    delete scenarioObj.rsTime;
                    if (scenarioObj.havocDetails) {
                        scenarioObj.havocDetails.forEach(obj => {
                            delete obj._id;
                        });
                    }
                    if (scenarioObj.scenario) {
                        delete scenarioObj.scenario._id;
                        delete scenarioObj.scenario.ct;
                        delete scenarioObj.scenario.lmt;
                    }
                    this.exportScenarioFile(JSON.stringify(scenarioObj, null, 2), rowData['scenarioName'] + ".json");
                }
                else {
                    this.msgs.add({ severity: 'error', summary: 'Error Message', detail: result['msg'] });
                }
            }, error => {
                console.error("Error in getScenarioData", error);
            });
        }
        catch (error) {
            console.error("Error in getHavocDetails", error);
        }
    }
    exportScenarioFile(data, filename) {
        const blob = new Blob([data], { type: 'application/json' });
        const url = window.URL.createObjectURL(blob);
        const a = document.createElement('a');
        a.href = url;
        a.download = filename;
        document.body.appendChild(a);
        a.click();
        document.body.removeChild(a);
        window.URL.revokeObjectURL(url);
    }
    deleteScenario(rowData) {
        try {
            this.confirmationService.confirm({
                key: 'scenario-delete',
                message: 'Are you sure you want to delete scanario \'' + rowData.scenarioName + '\' ?',
                header: 'Confirmation',
                icon: 'pi pi-exclamation-triangle',
                acceptButtonStyleClass: 'ui-button-rounded',
                rejectButtonStyleClass: 'ui-button-rounded ui-button-secondary ml-5',
                accept: () => {
                    const jsonData = {
                        "project": rowData.project,
                        "subProject": rowData.subProject,
                        "scenarioName": rowData.scenarioName
                    };
                    this._netHavocHttpService.deleteScenario(jsonData).subscribe(result => {
                        if (result['status'] == true) {
                            this.msgs.add({ severity: 'success', summary: 'Success Message', detail: 'Scanario \'' + rowData.scenarioName + '\' deleted successfully' });
                            this.getScenarioData();
                        }
                        else {
                            this.msgs.add({ severity: 'error', summary: 'Error Message', detail: result['msg'] });
                        }
                    }, error => {
                        console.error("Error in deleteScenario", error);
                    });
                }
            });
        }
        catch (error) {
            console.error("Error in deleteScenario", error);
        }
    }
    closeCopyScenario() {
        this.openDialogForCopy = false;
        this.copyscenarioName = "";
    }
    saveCopyScenarioData() {
        try {
            let queryParam = "/" + this.copyrowData['project'] + "/" + this.copyrowData['subProject'] + "/" + this.copyrowData['scenarioName'];
            this._netHavocHttpService.getScenarioList(queryParam).subscribe(result => {
                if (result['status'] == true) {
                    let scenarioObj = JSON.parse(JSON.stringify(result));
                    delete scenarioObj.status;
                    delete scenarioObj.rsTime;
                    if (scenarioObj.havocDetails) {
                        scenarioObj.havocDetails.forEach(obj => {
                            obj.project = this.selectedProject;
                            obj.subProject = this.selectedSubProject;
                            obj.scenarioName = this.copyscenarioName;
                            delete obj.id;
                            delete obj._id;
                        });
                    }
                    if (scenarioObj.scenario) {
                        scenarioObj.scenario.project = this.selectedProject;
                        scenarioObj.scenario.subProject = this.selectedSubProject;
                        scenarioObj.scenario.scenarioName = this.copyscenarioName;
                        delete scenarioObj.scenario._id;
                        delete scenarioObj.scenario.ct;
                        delete scenarioObj.scenario.lmt;
                    }
                    this._netHavocHttpService.configureScenario(scenarioObj).subscribe({
                        next: (response) => {
                            if (response['status']) {
                                this.getScenarioData('copyscenario');
                            }
                            else {
                                this.msgs.add({ severity: 'error', summary: 'Error Message', detail: response['msg'] });
                            }
                        },
                        error: (error) => {
                            this.msgs.add({ severity: 'error', summary: 'Error Message', detail: 'Error, please try again.' });
                        },
                        complete: () => {
                        }
                    });
                }
                else {
                    this.msgs.add({ severity: 'error', summary: 'Error Message', detail: result['msg'] });
                }
            }, error => {
                console.error("Error in getScenarioData", error);
            });
        }
        catch (error) {
            console.error("Error in getHavocDetails", error);
        }
    }
    copyScenario(rowData) {
        this.openDialogForCopy = true;
        this.copyrowData = rowData;
        this.copyscenarioName = "Copy_of_" + this.copyrowData['scenarioName'];
        this.selectedProject = this.copyrowData["project"];
        this.selectedSubProject = this.copyrowData["subProject"];
    }
    editScenario(rowData) {
        try {
            const queryParams = {
                project: rowData.project,
                subProject: rowData.subProject,
                scenarioName: rowData.scenarioName,
                mode: _model_nh_model__WEBPACK_IMPORTED_MODULE_10__["InjectHavocCompMode"].EDIT,
                objectId: rowData._id
            };
            this.nHNavigateService.setParams(queryParams);
            this.nHNavigateService.navigateTo("review");
        }
        catch (error) {
            console.error("Error in editScenario", error);
        }
    }
    runScenario(rowData) {
        try {
            this.nhavocDataProvider.showProgressBar(_constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_5__["progressMeassageJson"].runScenario);
            //TODO need to handle actualTestRun
            const jsonData = {
                "project": rowData.project,
                "subProject": rowData.subProject,
                "scenarioName": rowData.scenarioName,
                'startTime': "Current",
                'testRun': this.SessionService.session.testRun.id,
                'operation': "1"
            };
            let finalJson = Object.assign(jsonData, this.commonJson1());
            this._netHavocHttpService.runScenario(finalJson).subscribe(result => {
                this.nhavocDataProvider.isHideProgress = true;
                if (result['resultStatus'] == "success") {
                    this.msgs.add({ severity: 'success', summary: 'Success Message', detail: result['message'] });
                    this._netHavocHttpService.isscenarioRunExecuted.next();
                }
                else {
                    this.msgs.add({ severity: 'error', summary: 'Error Message', detail: result['message'] });
                }
            }, error => {
                this.nhavocDataProvider.isHideProgress = true;
                console.error("Error in runScenario", error);
            });
        }
        catch (error) {
            this.nhavocDataProvider.isHideProgress = true;
            console.error("Error in runScenario", error);
        }
    }
    commonJson1() {
        try {
            let isMultiDC = false;
            let url = "";
            let json = {};
            if (this.SessionService.preSession.multiDc) {
                isMultiDC = true;
            }
            if (window.location.port == undefined || window.location.port == '') {
                url = window.location.protocol + '//' + window.location.hostname;
            }
            else {
                url = window.location.protocol + '//' + window.location.hostname + ':' + window.location.port;
            }
            json = {
                "clusterReq": true
            };
            return json;
        }
        catch (error) {
            console.log("Error in creating common json", error);
        }
    }
    getScenarioData(val) {
        try {
            this.scenList = [];
            this.nhFilterService.events.isLoading.next(true);
            let query = "";
            this._netHavocHttpService.getScenarioList(query).subscribe(result => {
                this._netHavocHttpService.getScenarioScheduleList('NethavocScenarioSchedule').subscribe(scheduleresult => {
                    if (result['status'] == true) {
                        this.scenList = (result['scenarios'] || []).map(scenario => {
                            var _a;
                            const match = (_a = scheduleresult['task']) === null || _a === void 0 ? void 0 : _a.some(t => t.taskReq.scenarioName === scenario.scenarioName);
                            return Object.assign(Object.assign({}, scenario), { status: match ? _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_5__["Scenario_Status"].SCHEDULED : _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_5__["Scenario_Status"].CONFIGURED });
                        });
                        this.nhFilterService.setFilterMetaData(this.scenList);
                        this.gettablestatusdatacountinfo();
                        if (val == 'refresh') {
                            this.msgs.add({ severity: 'info', summary: 'Info', detail: 'Scenario List Refreshed Successfully' });
                        }
                        if (val == 'copyscenario') {
                            let sceobj = this.scenList.filter((val) => val.scenarioName == this.copyscenarioName);
                            if (sceobj.length > 0)
                                this.editScenario(sceobj[0]);
                            this.closeCopyScenario();
                        }
                    }
                    else {
                        this.msgs.add({ severity: 'error', summary: 'Error Message', detail: result['msg'] });
                    }
                }, error => {
                    console.error("Error in getScenarioData", error);
                });
            });
        }
        catch (error) {
            console.error("Error in getScenarioData", error);
        }
    }
    gettablestatusdatacountinfo() {
        let schedulecount = 0;
        // Filter the array to get objects with status value 4 
        const filteredArray = this.scenList.filter(item => item["status"] == _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_5__["Scenario_Status"].SCHEDULED);
        // Get the size of the filtered array
        schedulecount = filteredArray.length || 0;
        let obj = { "totalcount": this.scenList.length, "schedulecount": schedulecount };
        this._netHavocHttpService.ScenarioListtablestatusobj.next(obj); //.next(this.selectedHavocRun);
    }
};
NethavocScenarioComponent.ctorParameters = () => [
    { type: _services_nethavoc_http_service__WEBPACK_IMPORTED_MODULE_2__["NethavocHttpService"] },
    { type: src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_3__["CavMessageService"] },
    { type: _services_nethavoc_navigate_service__WEBPACK_IMPORTED_MODULE_4__["NetHavocNavigateService"] },
    { type: primeng_api__WEBPACK_IMPORTED_MODULE_6__["ConfirmationService"] },
    { type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_7__["SessionService"] },
    { type: _services_nh_filter_service__WEBPACK_IMPORTED_MODULE_8__["NhFilterService"] },
    { type: src_app_pages_scenario_service_projectlist_service__WEBPACK_IMPORTED_MODULE_9__["ProjectListService"] },
    { type: src_app_pages_home_netHavoc_services_nethavoc_data_provider_service__WEBPACK_IMPORTED_MODULE_11__["NetHavocDataProvider"] },
    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_12__["ACL_PROPS"],] }] }
];
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])('upload1')
], NethavocScenarioComponent.prototype, "upload1", void 0);
NethavocScenarioComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-nethavoc-scenario',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./nethavoc-scenario.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-scenario/nethavoc-scenario.component.html")).default,
        providers: [{ provide: src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_12__["ACL_PROPS"], useFactory: src_app_pages_tools_admin_access_control_management_services_cav_acl_util__WEBPACK_IMPORTED_MODULE_13__["getHavocsHavocScenarioACLProps"] }],
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./nethavoc-scenario.component.scss */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-scenario/nethavoc-scenario.component.scss")).default]
    }),
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(8, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"])()), Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(8, Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"])(src_app_pages_tools_admin_access_control_services_access_control_model__WEBPACK_IMPORTED_MODULE_12__["ACL_PROPS"]))
], NethavocScenarioComponent);



/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-schedule-summary/nethavoc-schedule-summary.component.scss":
/*!************************************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-schedule-summary/nethavoc-schedule-summary.component.scss ***!
  \************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("");

/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-schedule-summary/nethavoc-schedule-summary.component.ts":
/*!**********************************************************************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-schedule-summary/nethavoc-schedule-summary.component.ts ***!
  \**********************************************************************************************************************************/
/*! exports provided: NetHavocScheduleSummaryComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NetHavocScheduleSummaryComponent", function() { return NetHavocScheduleSummaryComponent; });
/* 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 _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../constants/nethavoc.constants */ "./src/app/pages/home/netHavoc-v2/constants/nethavoc.constants.ts");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
/* harmony import */ var src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/shared/cavLoggerService/cav-logging.service */ "./src/app/shared/cavLoggerService/cav-logging.service.ts");
/* harmony import */ var _services_nethavoc_utility_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../services/nethavoc-utility.service */ "./src/app/pages/home/netHavoc-v2/services/nethavoc-utility.service.ts");






let NetHavocScheduleSummaryComponent = class NetHavocScheduleSummaryComponent {
    constructor(router, utilityService, logger) {
        this.router = router;
        this.utilityService = utilityService;
        this.logger = logger;
    }
    ngOnInit() {
        this.scheduleObj = {
            taskType: "NethavocScenarioSchedule",
            headerRelativePath: _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_2__["SCHEDULE_SUMMARY_TABLE_CONFIG"]
        };
    }
    // scenName schTime schExpireTime enable action 
    scheduleSummaryTableHandler(event) {
    }
    reloadScheduleObj(event) {
        this.scheduleObj = {
            taskType: "NethavocScenarioSchedule",
            headerRelativePath: _constants_nethavoc_constants__WEBPACK_IMPORTED_MODULE_2__["SCHEDULE_SUMMARY_TABLE_CONFIG"]
        };
    }
    outputEventHandler(cavScehduleTask) {
        this.editcavScehduleTaskobj = null;
        if (cavScehduleTask) {
            this.editcavScehduleTaskobj = cavScehduleTask;
        }
        this.utilityService.openDialog();
    }
};
NetHavocScheduleSummaryComponent.ctorParameters = () => [
    { type: _angular_router__WEBPACK_IMPORTED_MODULE_3__["Router"] },
    { type: _services_nethavoc_utility_service__WEBPACK_IMPORTED_MODULE_5__["NetHavocUtilityService"] },
    { type: src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_4__["CavLoggingService"] }
];
NetHavocScheduleSummaryComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-schedule-summary',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./nethavoc-schedule-summary.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-schedule-summary/nethavoc-schedule-summary.component.html")).default,
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./nethavoc-schedule-summary.component.scss */ "./src/app/pages/home/netHavoc-v2/components/nethavoc-home/nethavoc-schedule-summary/nethavoc-schedule-summary.component.scss")).default]
    })
], NetHavocScheduleSummaryComponent);



/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/pipes/camel-to-title-formatter.pipe.ts":
/*!*******************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/pipes/camel-to-title-formatter.pipe.ts ***!
  \*******************************************************************************/
/*! exports provided: CamelToTitleFormatterPipe */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CamelToTitleFormatterPipe", function() { return CamelToTitleFormatterPipe; });
/* 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");


let CamelToTitleFormatterPipe = class CamelToTitleFormatterPipe {
    transform(value) {
        if (!value)
            return '';
        return value
            .replace(/([A-Z])/g, ' $1')
            .replace(/^./, (char) => char.toUpperCase());
    }
};
CamelToTitleFormatterPipe = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Pipe"])({
        name: 'camelTotitle',
        pure: true
    })
], CamelToTitleFormatterPipe);



/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/services/nethavoc-graph-v2.service.ts":
/*!******************************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/services/nethavoc-graph-v2.service.ts ***!
  \******************************************************************************/
/*! exports provided: NethavocGraphV2Service */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NethavocGraphV2Service", function() { return NethavocGraphV2Service; });
/* 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 src_app_shared_dashboard_service_dashboard_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/shared/dashboard/service/dashboard.service */ "./src/app/shared/dashboard/service/dashboard.service.ts");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
/* harmony import */ var src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/core/session/session.service */ "./src/app/core/session/session.service.ts");





let NethavocGraphV2Service = class NethavocGraphV2Service {
    constructor(dashboarService, router, SessionService) {
        this.dashboarService = dashboarService;
        this.router = router;
        this.SessionService = SessionService;
    }
    get faultType() {
        return this._faultType;
    }
    set faultType(v) {
        this._faultType = v;
    }
    get graphId() {
        return this._graphId;
    }
    set graphId(v) {
        this._graphId = v;
    }
    get graphId1() {
        return this._graphId1;
    }
    set graphId1(v) {
        this._graphId1 = v;
    }
    get graphName() {
        return this._graphName;
    }
    set graphName(v) {
        this._graphName = v;
    }
    get groupId() {
        return this._groupId;
    }
    set groupId(v) {
        this._groupId = v;
    }
    get groupName() {
        return this._groupName;
    }
    set groupName(v) {
        this._groupName = v;
    }
    get groupName1() {
        return this._groupName1;
    }
    set groupName1(v) {
        this._groupName1 = v;
    }
    get tier() {
        return this._tier;
    }
    set tier(v) {
        this._tier = v;
    }
    get server() {
        return this._server;
    }
    set server(v) {
        this._server = v;
    }
    get instance() {
        return this._instance;
    }
    set instance(v) {
        this._instance = v;
    }
    get methodName() {
        return this._methodName;
    }
    set methodName(v) {
        this._methodName = v;
    }
    get starttime() {
        return this._starttime;
    }
    set starttime(v) {
        this._starttime = v;
    }
    get date() {
        return this._date;
    }
    set date(v) {
        this._date = v;
    }
    get duration() {
        return this._duration;
    }
    set duration(v) {
        this._duration = v;
    }
    get trNum() {
        return this._trNum;
    }
    set trNum(v) {
        this._trNum = v;
    }
    get preset() {
        return this._preset;
    }
    set preset(v) {
        this._preset = v;
    }
    get faultStatus() {
        return this._faultStatus;
    }
    set faultStatus(value) {
        this._faultStatus = value;
    }
    get MachineInfo() {
        return this._MachineInfo;
    }
    set MachineInfo(v) {
        this._MachineInfo = v;
    }
    get Category() {
        return this._Category;
    }
    set Category(v) {
        this._Category = v;
    }
    get pod() {
        return this._pod;
    }
    set pod(v) {
        this._pod = v;
    }
    get node() {
        return this._node;
    }
    set node(v) {
        this._node = v;
    }
    get containerDisplayName() {
        return this._containerDisplayName;
    }
    set containerDisplayName(v) {
        this._containerDisplayName = v;
    }
    get containerID() {
        return this._containerID;
    }
    set containerID(v) {
        this._containerID = v;
    }
    get multipleGraph() {
        return this._multipleGraph;
    }
    set multipleGraph(v) {
        this._multipleGraph = v;
    }
    get partionName() {
        return this._partionName;
    }
    set partionName(v) {
        this._partionName = v;
    }
    get AppName() {
        return this._appName;
    }
    set AppName(v) {
        this._appName = v;
    }
    get Cluster() {
        return this._cluster;
    }
    set Cluster(v) {
        this._cluster = v;
    }
    get namespace() {
        return this._namespace;
    }
    set namespace(v) {
        this._namespace = v;
    }
    get DiegoCell() {
        return this.diegoCell;
    }
    set DiegoCell(v) {
        this.diegoCell = v;
    }
    get regionName() {
        return this._regionName;
    }
    set regionName(v) {
        this._regionName = v;
    }
    get instaceID() {
        return this._instaceID;
    }
    set instaceID(v) {
        this._instaceID = v;
    }
    get setSt() {
        return this._setSt;
    }
    set setSt(v) {
        this._setSt = v;
    }
    get setEt() {
        return this._setEt;
    }
    set setEt(v) {
        this._setEt = v;
    }
    get graphName1() {
        return this._graphName1;
    }
    set graphName1(v) {
        this._graphName1 = v;
    }
    get groupId1() {
        return this._groupId1;
    }
    set groupId1(v) {
        this._groupId1 = v;
    }
    get topicName() {
        return this._topicName;
    }
    set topicName(v) {
        this._topicName = v;
    }
    netHavocGraphLinkV2() {
        try {
            console.log("inside graph link -------------->>");
            if (this.MachineInfo == "linux" || this.MachineInfo == "windows" || (this.MachineInfo == "tanzu" && this.Category == "Application")) {
                this.dashboarService.isCallFromNetHavoc = true;
                let st = this._setSt;
                let et = this._setEt;
                let indesis = this.tier + ">" + this.server;
                let mgType = "NA";
                if (this.faultType == "NH_LINUX_FILL_DISK" || this.faultType == "NH_LINUX_BURN_IO") {
                    indesis = this.tier + ">" + this.server + ">" + this._partionName;
                }
                if (this.faultType == "NH_APP_INB_SER" || this.faultType == "NH_APP_OUT_SER" || this.faultType == "NH_APP_MET_CAL") {
                    indesis = this.btGraphData.tierName + ">" + this.btGraphData.serverName + ">" + this.btGraphData.instanceName + ">ALL";
                }
                if (this.faultType == "NH_APP_MET_EXC") {
                    indesis = this.btGraphData.tierName + ">" + this.btGraphData.serverName + ">" + this.btGraphData.instanceName + ">NDHavocException" + "," + this.btGraphData.tierName + ">" + this.btGraphData.serverName + ">" + this.btGraphData.instanceName + ">" + this.methodName;
                }
                if (this.faultType == "NH_APP_MEM_LEK" || this.faultType == "NH_APP_THR_LEK") {
                    indesis = indesis + ">" + this.btGraphData.instanceName;
                }
                if (this.faultType == "NH_APP_BURN_CPU") {
                    indesis = indesis + ">" + this.instance;
                }
                if (this.faultType == "NH_APP_KILL") {
                    indesis = indesis + ">" + this.instance + ">AllTransactions";
                }
                if (this.faultType == "NH_LINUX_NW_LOSS" || this.faultType == "NH_LINUX_NW_LATENCY") {
                    indesis = "All>All>" + this.btGraphData.instanceName;
                }
                if (this.faultType == "NH_TIBCO_HAVOC") {
                    indesis = "Cavisson>NDAppliance>Tibco>" + this._topicName;
                    this.graphId1 = "5";
                    mgType = "NA";
                }
                if (this.faultType == "NH_KAFKA_HAVOC") {
                    indesis = "All>All>All>" + this._topicName;
                    this.graphId1 = "12";
                    mgType = "NA";
                }
                this.dashboarService.netHavocPayLoad = {
                    "st": "" + st,
                    "et": "" + et,
                    "indices": indesis,
                    "havocOS": this.MachineInfo,
                    "havoctype": this.faultType,
                    "mgType": mgType,
                    "mgTypeId": "-1",
                    "mg": this.groupName,
                    "mg1": this.groupName1,
                    "mgId": this.groupId,
                    "metric": this.graphName,
                    "metricId": "" + this.graphId,
                    "level": "0",
                    "graphid": "" + this.graphId,
                    "groupid": this.groupId,
                    "status": "" + this._faultStatus,
                    "isMultiGraph": (this.multipleGraph == "1") ? true : false,
                    "graphId1": this.graphId1,
                    "groupId1": this.groupId1,
                    "metric1": this.graphName1
                };
                console.log("this.dashboarService.netHavocPayLoad ", this.dashboarService.netHavocPayLoad);
                this.router.navigate(['/home']);
            }
            if (this.MachineInfo == "kubernetes") {
                const duration = {
                    st: "1764911920226",
                    et: "1764911921146",
                    preset: "LIVE5",
                    viewBy: 600,
                };
                this.dashboarService.netHavocKuberNatePayload = {
                    opType: '9',
                    cctx: this.SessionService.session.cctx,
                    duration: duration,
                    tr: this.SessionService.session.testRun.id,
                    clientId: "Default",
                    appId: "Default",
                    glbMgId: "-1",
                    grpName: "Kubernetes Container Havoc",
                    mgId: 14218,
                    levels: 6,
                    subject: {
                        tags: [],
                    }
                };
                let node;
                if (this.faultType == "NH_LINUX_FILL_DISK") {
                    if (this._containerDisplayName == "" || this._containerDisplayName == undefined || this._containerDisplayName == "0") {
                        this._containerDisplayName = "All";
                    }
                    node = this._cluster + ">" + this._namespace + ">" + this._pod + ">" + this._containerDisplayName + ">" + this._partionName;
                }
                else if (this.faultType == "NH_APP_INB_SER" || this.faultType == "NH_APP_OUT_SER" || this.faultType == "NH_APP_MET_CAL" || this.faultType == "NH_APP_MET_EXC" || this.faultType == "NH_APP_MEM_LEK") {
                    node = (this.btGraphData) ? this.btGraphData.result.join(",") : "NA";
                }
                else {
                    if (this._containerDisplayName == "" || this._containerDisplayName == undefined || this._containerDisplayName == "0") {
                        this._containerDisplayName = "All";
                    }
                    node = this._cluster + ">" + this._namespace + ">" + this._pod + ">" + this._containerDisplayName;
                }
                this.dashboarService.isCallFromNetHavoc = true;
                let st = this._setSt;
                let et = this._setEt;
                let status = "1";
                if (this._faultStatus == "2") {
                    et = 0;
                    status = "2";
                }
                this.dashboarService.netHavocPayLoad = {
                    "st": st,
                    "et": et,
                    "indices": node,
                    "havocOS": this.MachineInfo,
                    "havoctype": this.faultType,
                    "mgType": "NA",
                    "mgTypeId": "-1",
                    "mg": this.groupName,
                    "mgId": this.groupId,
                    "metric": this.graphName,
                    "metricId": this.graphId,
                    "level": "0",
                    "graphid": this.graphId,
                    "groupid": this.groupId,
                    "status": status,
                    "container": this._containerDisplayName
                };
                this.router.navigate(['/home']);
            }
            if (this.MachineInfo == "docker") {
                let tier;
                let server;
                tier = this.tier + ">" + this.server;
                {
                    server = this._containerDisplayName;
                }
                this.dashboarService.isCallFromNetHavoc = true;
                let st = this._setSt;
                let et = this._setEt;
                this.dashboarService.netHavocPayLoad = {
                    "st": st,
                    "et": et,
                    "indices": tier + ">" + server,
                    "havocOS": this.MachineInfo,
                    "havoctype": this.faultType,
                    "mgType": "System status",
                    "mgTypeId": "-1",
                    "mg": this.groupName,
                    "mgId": this.groupId,
                    "metric": this.graphName,
                    "metricId": this.graphId,
                    "level": "0",
                    "graphid": this.graphId,
                    "groupid": this.groupId,
                    "status": this._faultStatus,
                    "isMultiGraph": (this.multipleGraph == "1") ? true : false,
                    "graphId1": this.graphId1,
                    "groupId1": this.groupId1,
                    "metric1": this.graphName1,
                    "mg1": this.groupName1
                };
                this.router.navigate(['/home']);
            }
            if (this.MachineInfo == "tanzu" && this.Category != "Application") {
                let tier;
                let server;
                let indesis;
                let partition;
                let st = this._setSt;
                let et = this._setEt;
                this.dashboarService.isCallFromNetHavoc = true;
                tier = this.tier + ">" + this.server + ">" + this.AppName;
                let mgType = "NA";
                if (this.faultType != "NH_LINUX_FILL_DISK") {
                    indesis = this.Cluster + ">" + this.DiegoCell + ">" + this.containerID;
                }
                else {
                    if (this._partionName == "") {
                        partition = "/";
                    }
                    else {
                        partition = this._partionName;
                    }
                    indesis = this.Cluster + ">" + this.DiegoCell + ">" + this.containerID + ">" + partition;
                }
                if (this.faultType == "NH_LINUX_BURN_IO") {
                    server = this._containerID + ">AllDevices";
                    indesis = indesis + ">AllDevices";
                }
                else {
                    server = this._containerID;
                }
                this.dashboarService.netHavocPayLoad = {
                    "st": st,
                    "et": et,
                    "indices": indesis,
                    "havocOS": this.MachineInfo,
                    "havoctype": this.faultType,
                    "mgType": mgType,
                    "mgTypeId": "-1",
                    "mg": this.groupName,
                    "mgId": this.groupId,
                    "metric": this.graphName,
                    "metricId": this.graphId,
                    "level": "0",
                    "graphid": this.graphId,
                    "groupid": this.groupId,
                    "status": this._faultStatus,
                    "isMultiGraph": (this.multipleGraph == "1") ? true : false,
                    "graphId1": this.graphId1,
                    "metric1": this.graphName1
                };
                this.router.navigate(['/home']);
            }
            if (this.MachineInfo == "ibmcloudcf") {
                let server = this.instaceID;
                if (this.faultType == "NH_LINUX_BURN_IO") {
                    server = server + ">AllDevices";
                }
            }
        }
        catch (error) {
            console.error("error in  netHavocGraphLink -->>", error);
        }
    }
};
NethavocGraphV2Service.ctorParameters = () => [
    { type: src_app_shared_dashboard_service_dashboard_service__WEBPACK_IMPORTED_MODULE_2__["DashboardService"] },
    { type: _angular_router__WEBPACK_IMPORTED_MODULE_3__["Router"] },
    { type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_4__["SessionService"] }
];
NethavocGraphV2Service = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
        providedIn: 'root'
    })
], NethavocGraphV2Service);



/***/ }),

/***/ "./src/app/pages/home/netHavoc-v2/services/nh-filter.service.ts":
/*!**********************************************************************!*\
  !*** ./src/app/pages/home/netHavoc-v2/services/nh-filter.service.ts ***!
  \**********************************************************************/
/*! exports provided: NhFilterService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NhFilterService", function() { return NhFilterService; });
/* 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 rxjs_Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/Subject */ "./node_modules/rxjs-compat/_esm2015/Subject.js");



let NhFilterService = class NhFilterService {
    constructor() {
        this.events = {
            isLoading: new rxjs_Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"](),
        };
        this._filterHavocMetaData = {};
    }
    setFilterMetaData(scenarioList) {
        this._filterHavocMetaData = {};
        scenarioList.forEach((scenario) => {
            const project = scenario.project;
            const subProject = scenario.subProject;
            const scenarioName = scenario.scenarioName;
            if (!this._filterHavocMetaData[project]) {
                this._filterHavocMetaData[project] = {};
            }
            if (!this._filterHavocMetaData[project][subProject]) {
                this._filterHavocMetaData[project][subProject] = [];
            }
            this._filterHavocMetaData[project][subProject].push(scenarioName);
        });
        this.events.isLoading.next(false);
    }
    getFilterMetaData() {
        return this._filterHavocMetaData;
    }
};
NhFilterService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
        providedIn: 'root'
    })
], NhFilterService);



/***/ })

}]);