function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }

function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }

function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }

function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }

function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }

function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }

function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }

function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }

function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }

function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }

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

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

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

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

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

(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["cc-recommendation-cc-recommendation-module"], {
  /***/
  "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/cloud-cost/cc-recommendation/cc-action-sidebar/cc-action-sidebar.component.html":
  /*!**************************************************************************************************************************************************!*\
    !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/cloud-cost/cc-recommendation/cc-action-sidebar/cc-action-sidebar.component.html ***!
    \**************************************************************************************************************************************************/

  /*! exports provided: default */

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

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


    __webpack_exports__["default"] = "<p-sidebar [(visible)]=\"visible\" (onHide)=\"onClose()\" position=\"right\" [showCloseIcon]=\"false\" [style]=\"{width: '82%'}\">\n    <div class=\"sidebar-header\">\n        <div class=\"sidebar-title p-grid p-align-center p-justify-between\">\n            <div class=\"text-lg font-semibold\" style=\"border-bottom: 1px gray;\">Action event</div>\n            <button\n                type=\"button\"\n                (click)=\"onClose()\"\n                pButton\n                class=\"btn-icon btn-white\"\n                icon=\"pi pi-times\">\n            </button>\n        </div>\n    </div>\n\n    <div *ngIf=\"isLoading\" class=\"p-grid p-justify-center p-align-center\" style=\"height: 400px; flex-direction: column;\">\n      <i class=\"pi pi-spin pi-spinner\" style=\"font-size: 3rem\"></i>\n      <span class=\"mt-2\">Loading Action Data...</span>\n    </div>\n    \n    <div *ngIf=\"!isLoading\" class=\"sidebar-body-content p-6 p-grid\" style=\"max-height: calc(100vh - 90px); overflow-y: auto;\">\n      <div *ngIf=\"instanceScale\" class=\"p-grid w-100-p p-10 bg-secondary-100 d-bg-secondary-1200 bottom-border border-5 font-weight-600 font-14\">\n        Scale Instance {{instanceActionHeader?.name || ''}} from {{instanceActionHeader?.from || ''}} to {{instanceActionHeader?.to || ''}} ,  cost Impact: ${{instanceActionHeader?.saving||' '}}\n        \n      </div>\n      <div *ngIf=\"instanceDelete\" class=\"p-grid w-100-p p-10 bg-secondary-100 d-bg-secondary-1200 bottom-border border-5 font-weight-600 font-14\">\n        Delete Instance {{instanceActionHeader?.name || ''}} ,  cost Saving: ${{instanceActionHeader?.saving||' '}}\n        \n      </div>\n      <div *ngIf=\"volumeScale\" class=\"p-grid w-100-p p-10 bg-secondary-100 d-bg-secondary-1200 bottom-border border-5 font-weight-600 font-14\">\n       Scale Volume {{volumeActionHeader?.name || ''}} from {{volumeActionHeader?.from || ''}} to {{volumeActionHeader?.to || ''}} ,  cost Saving: ${{volumeActionHeader?.saving||' '}}\n        \n      </div>\n      <div *ngIf=\"volumeDelete\" class=\"p-grid w-100-p p-10 bg-secondary-100 d-bg-secondary-1200 bottom-border border-5 font-weight-600 font-14\">\n        Delete Volume {{volumeActionHeader?.name || ''}} ,  cost Saving: ${{volumeActionHeader?.saving||' '}}\n        \n      </div>\n          \n      <div *ngIf=\"(instanceScale||vpaRecommendation) && chartOptions\" class=\"sidebar-body p-col overflow-y-auto\">\n          <!-- <p class=\"text-sm text-gray-600 mb-3\">\n              CPU Utilization\n          </p> -->\n \n          <div class=\"p-card p-4 shadow-md rounded-xl\">\n              <highcharts-chart\n                  [Highcharts]=\"Highcharts\"\n                  [options]=\"chartOptions\"\n                  style=\"width: 100%; height: 400px; display: block;\">\n              </highcharts-chart>\n          </div>\n      </div><br>\n      <div *ngIf=\"(vpaRecommendation) && chartOptionsMem\" class=\"sidebar-body p-col overflow-y-auto\">\n          <!-- <p class=\"text-sm text-gray-600 mb-3\">\n              CPU Utilization\n          </p> -->\n \n          <div class=\"p-card p-4 shadow-md rounded-xl\">\n              <highcharts-chart\n                  [Highcharts]=\"Highcharts\"\n                  [options]=\"chartOptionsMem\"\n                  style=\"width: 100%; height: 400px; display: block;\">\n              </highcharts-chart>\n          </div>\n      </div>\n      <div *ngIf=\"(volumeScale) && chartOptions\" class=\"sidebar-body p-col overflow-y-auto\">\n        <!-- <p class=\"text-sm text-gray-600 mb-3\">\n          IOPS percentile and avg. utilization\n        </p> -->\n \n        <div class=\"p-card p-4 shadow-md rounded-xl\">\n            <highcharts-chart\n                [Highcharts]=\"Highcharts\"\n                [options]=\"chartOptions\"\n                style=\"width: 100%; height: 400px; display: block;\">\n            </highcharts-chart>\n        </div>\n      </div>\n      <div class=\"p-col\" style=\"max-height: calc(100vh - 130px); overflow:auto\">\n \n        \n        <div class=\"mb-6\">\n          <!-- <div class=\"ui-table-caption ui-widget-header height-32 p-grid p-align-center\">\n          Action Essentials\n          </div> -->\n          <cav-table [value]=\"action\" [headerRelativePath]=\"'cloud_cost_visibility/cc-recommendationAction.json'\" [scrollable]=\"true\"></cav-table>\n        </div>\n      \n        <div  class=\"mb-6\" *ngIf=\"volumeScale || volumeDelete\">\n          <!-- <div class=\"ui-table-caption ui-widget-header height-32 p-grid p-align-center\">\n            Volume Details\n            </div> -->\n          <cav-table [value]=\"volumeDetails\" [headerRelativePath]=\"'cloud_cost_visibility/ccRecommendationActionDetails.json'\" [scrollable]=\"true\"></cav-table>\n        </div>\n        <div  class=\"mb-6\" *ngIf=\"vpaRecommendation\">\n          <!-- <div class=\"ui-table-caption ui-widget-header height-32 p-grid p-align-center\">\n            Volume Details\n            </div> -->\n          <cav-table [value]=\"vpaDetails\" [headerRelativePath]=\"'cloud_cost_visibility/ccRecommendationActionDetails.json'\" [scrollable]=\"true\"></cav-table>\n        </div>\n        <div class=\"mb-6\" *ngIf=\"instanceScale || instanceDelete\">\n          <!-- <div class=\"ui-table-caption ui-widget-header height-32 p-grid p-align-center\">\n            Instance Details\n        </div> -->\n          <cav-table [value]=\"instanceDetails\" [headerRelativePath]=\"'cloud_cost_visibility/ccRecommendationActionDetails.json'\" [scrollable]=\"true\"></cav-table>\n        </div>\n        </div>\n      \n        <div class=\"mb-6\">\n          <!-- <div class=\"ui-table-caption ui-widget-header height-32 p-grid p-align-center\">\n            Resource Impact\n          </div> -->\n          <div *ngIf=\"volumeScale || volumeDelete\">\n            <cav-table [value]=\"volumeResource\" [headerRelativePath]=\"'cloud_cost_visibility/ccRecommendationActionResourceImpact.json'\" [scrollable]=\"true\"></cav-table>\n          </div>\n          <div *ngIf=\"vpaRecommendation\">\n            <cav-table [value]=\"volumeResource\" [headerRelativePath]=\"'cloud_cost_visibility/ccRecommendationVpaResourceImpact.json'\" [scrollable]=\"true\"></cav-table>\n          </div>\n          <div *ngIf=\"instanceScale || instanceDelete\">\n            <cav-table [value]=\"instanceResource\" [headerRelativePath]=\"'cloud_cost_visibility/ccRecommendationActionResourceImpact.json'\" [scrollable]=\"true\"></cav-table>\n          </div>\n        </div>\n      \n        <div  class=\"mb-6\">\n          <!-- <div class=\"ui-table-caption ui-widget-header height-32 p-grid p-align-center\">\n            Cost Impact\n          </div> -->\n          <div *ngIf=\"volumeScale || volumeDelete\">\n            <cav-table [value]=\"volumeCost\" [headerRelativePath]=\"'cloud_cost_visibility/ccRecommendationActionCost.json'\" [scrollable]=\"true\"></cav-table>\n          </div>\n      \n          <div *ngIf=\"instanceScale || instanceDelete\">\n            <cav-table [value]=\"instanceCost\" [headerRelativePath]=\"'cloud_cost_visibility/ccRecommendationActionCost.json'\" [scrollable]=\"true\"></cav-table>\n          </div>\n        </div>\n      </div>\n    <!-- </div> -->\n    \n    <div *ngIf=\"!vpaRecommendation && !isLoading\" class=\"sidebar-footer p-3 p-grid p-justify-end top-border border-3 bg-neutral-100 d-bg-neutral-1500\">\n        <button pButton type=\"button\" label=\"Execute Action\" (click)=\"onExecuteAction()\" class=\"p-button-success\" icon=\"pi pi-check\"></button>\n    </div>\n</p-sidebar>";
    /***/
  },

  /***/
  "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/cloud-cost/cc-recommendation/cc-recommendation.component.html":
  /*!********************************************************************************************************************************!*\
    !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/cloud-cost/cc-recommendation/cc-recommendation.component.html ***!
    \********************************************************************************************************************************/

  /*! exports provided: default */

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

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


    __webpack_exports__["default"] = "<div class=\"recommendations-container\">\n  <div class=\"recommendations-container relative\">\n    <div class=\"mb-5\">\n      <app-cav-toolbar [heading]=\"'Recommendations'\" [showHeading]=\"true\" [showNumber]=\"false\"></app-cav-toolbar>\n    </div>\n    <div class=\"inline-flex absolute total\">\n      <div class=\"inline-flex\">\n        <span class=\"opc-80 font-13\">Total Savings: </span>\n        <span class=\"font-16 font-weight-600 text-primary-1200 d-text-primary-800 mx-6\"> ${{ totalTabSavings | number:'1.3-3' }}</span>\n      </div>\n\n      <div class=\"inline-flex ml-16\">\n        <span class=\"opc-80 font-13\">Total Investments: </span>\n        <span class=\"font-16 font-weight-600 text-secondary-800 d-text-secondary-800 mx-6\"> ${{ totalTabInvestments | number:'1.3-3' }}</span>\n      </div>\n      <!-- <app-cav-toolbar [heading]=\"totalTabSavings\" [showHeading]=\"true\" [showNumber]=\"false\"></app-cav-toolbar> -->\n    </div>\n    <div class=\"inline-flex absolute ml-1\">\n      <p-selectButton [options]=\"cloudTabs\" [(ngModel)]=\"activeCloudFilter\" (onChange)=\"onActiveTabChange($event)\"></p-selectButton>\n    </div>\n\n    <!-- FORCE CHECK BUTTON CONTAINER -->\n    <!-- <div class=\"inline-flex absolute\" style=\"right: 360px; z-index: 10;\">\n      <button pButton type=\"button\"\n              label=\"Force Check\"\n              [icon]=\"isForceChecking ? 'pi pi-spin pi-spinner' : 'pi pi-refresh'\"\n              [disabled]=\"isForceChecking\"\n              class=\"ui-button-secondary\"\n              (click)=\"forceCheck()\">\n      </button>\n    </div> -->\n  \n  \n    <div *ngIf=\"isLoading; else dataContainer\" class=\"p-grid p-justify-center p-align-center\" style=\"height: 300px;\">\n      <i class=\"pi pi-spin pi-spinner\" style=\"font-size: 3rem\"></i>\n      <span class=\"ml-2\">Loading Recommendations...</span>\n    </div>\n  <!-- <div class=\"p-grid w-100-p mt-5\">\n    <div class=\"p-col-2 pl-0\">\n        <label class=\"dataSource\">Data Sources</label>\n        <p-multiSelect \n          id=\"dataSource\" \n          [options]=\"displayedDataSourceOpt\" \n          [(ngModel)]=\"selectedDataSource\"\n          (onChange)=\"onSelectionChange()\" \n          [style]=\"{'width':'100%'}\"  \n          [filter]=\"true\"\n          [defaultLabel]=\"'All'\"\n        >\n        </p-multiSelect>\n    </div> -->\n    \n    <!-- <div class=\"p-col-12\">\n      <app-common-iframe #commonIFrame [dataForIframe]=\"dataForIframe\"></app-common-iframe>\n    </div> -->\n    <!-- <div class=\"p-col-2\">\n      <span class=\"ui-float-label\">\n        <p-dropdown id=\"catagories\" [options]=\"catagoriesOpt\" [(ngModel)]=\"selectedCatagoriesOpt\"\n          (onChange)=\"onCategoryChange($event)\">\n        </p-dropdown>\n        <label for=\"catagories\">Catagories</label>\n      </span>\n    </div>\n    <div class=\"p-col-2\">\n      <span class=\"ui-float-label\">\n        <p-dropdown id=\"services\" [options]=\"applicableServiceOptions\" [(ngModel)]=\"selectedServicesOpt\"\n          (onChange)=\"onServiceChange($event)\">\n          <ng-template let-item pTemplate=\"selectedItem\">\n            <ng-container *ngIf=\"item.value != 'all'\"> -->\n              <!-- <img class=\"width-22\" src=\"assets/images/{{item.icon}}.svg\" style=\"vertical-align:middle\"> -->\n            <!-- </ng-container>\n            <span style=\"vertical-align:middle; margin-left: .5em\">{{item.label}}</span>\n          </ng-template>\n          <ng-template let-icon pTemplate=\"item\">\n            <div class=\"ui-helper-clearfix relative\"> -->\n              <!-- <img class=\"absolute width-22\" src=\"assets/images/{{icon?.icon}}.svg\" *ngIf=\"icon?.icon\" > -->\n              <!-- <div [ngClass]=\"{'ml-24': icon?.icon}\">{{icon.label}}</div>\n            </div>\n          </ng-template>\n        </p-dropdown>\n        <label for=\"services\">Applicable Services</label>\n      </span>\n    </div>\n  </div> -->\n  <ng-template #dataContainer>\n  <div [ngStyle]=\"visualTable.selectedlayout == 'Cards' ? {'margin-top' : '0px'} : {'margin-top' : '0px'}\" class=\"table-container mln-6\" [ngClass]=\"visualTable.selectedlayout == 'Cards' ? 'px-0' : 'px-6'\">\n    <!-- Table with Card View -->\n    <cav-table #visualTable [value]=\"filteredResults\" [headers]=\"headers\" [tableConfig]=\"tableConfig\"\n      [scrollable]=\"true\" [cardToggle]=\"true\" [cardTemplate]=\"cardTemplate\" [cardClass]=\"'card-count4'\" cardLayoutWidth=\"calc(-170px + 100vh)\"\n      (clickButtonEvent)=\"clickButtonEvent($event)\" scrollHeight=\"calc(100vh - 259px)\" (rowActionEvent)=\"rowActionEvent($event.action, $event.row)\"></cav-table>\n    <!-- Card Template -->\n    <ng-template #cardTemplate let-data>\n      <div class=\"p-grid overflow\">\n      <div *ngFor=\"let item of data\" class=\"p-col card-count4\">\n        <div class=\"border-radius-8 border-5 cav-card-border\">\n        <!-- <div class=\"cav-card border-radius-8\" [ngClass]=\"{ 'critical-card': item.status === 'Critical' || item.status === 'Ok', 'security-card': item.status === 'Security','savings-card': item.instances.length === 0 }\"> comment this line for demo purpose only -->\n        <div class=\"cav-card border-radius-8\" [ngClass]=\"{ 'critical-card': item.costSaving==='0','security-card': item.costSaving !== '0' }\">\n \n          <!-- Header Section -->\n          <div class=\"card-header p-grid p-nogutter\">\n            <span class=\"p-col\">{{ item.groupId }}</span>\n            <div class=\"p-col-fixed p-grid\">\n            <span class=\"status\" [class.critical]=\"item.status === 'Critical'\"\n              [class.Security]=\"item.status === 'Security'\">\n              <!-- ${{ item.costSaving || 0.000}} -->\n               {{ (item.costSaving == 0 || !item.costSaving) ? \"$0.000\" : (item.costSaving < 0 ? \"-$\" + -item.costSaving : \"$\" + item.costSaving ) }}\n              <small>Savings</small>\n            </span>\n            <app-help [helpTitle]=\"'Cloud Cost Recommendation'\" [helpFileName]=\"'CloudCostRecommendation'\" [helpFolder]=\"'cloudCost'\">\n            </app-help>\n            <i *ngIf=\"item?.isSettingSaved\" class=\"pi pi-spin pi-spinner\"></i>\n            </div>\n          </div>\n          <div class=\"maincontents\">\n            <!-- Actions -->\n            <!-- \"--\"<ng-container>\n              <div class=\"p-grid p-align-center w-100-p\">\n                <ng-container *ngFor=\"let catagory of item.categories\">\"---\" -->\n                  <!-- <button pButton type=\"button\" class=\"ui-button-secondary mr-5\" (click)=\"onAws(item,catagory)\" pTooltip=\"{{catagory}}\"     [ngClass]=\"{\n                    'ui-button-primary mr-5': item.showSummary === catagory,\n                    'ui-button-secondary mr-5': item.showSummary !== catagory\n                  }\"  [ngStyle]=\"{ 'border-radius': '15px' }\">\n                    <img src=\"assets/images/amazon-web-services.svg\" class=\"width-22\">{{catagory}}\n                  </button> -->\n                  <!-- \"-----\"<span class=\"instance-badge border-3\" (click)=\"onAws(item,catagory)\" pTooltip=\"{{catagory}}\"  [ngClass]=\"{\n                    'critical-card': item.showSummary === catagory && (item.status === 'Critical' || item.status === 'Ok'),\n                    'security-card': item.showSummary === catagory && item.status === 'Security',\n                    'savings-card': item.showSummary === catagory && item.instances.length === 0\n                  }\"> \"-----\" -->\n                   <!-- <img src=\"assets/images/amazon-web-services.svg\" class=\"width-22\">-->\n                   \n                   \n                   <!-- \"----\"{{catagory}}\n                  </span>\n\n                </ng-container>\n              </div>\n            </ng-container>\"----\" -->\n\n            <!-- Description Section -->\n            <!-- <ng-container>\n              <p class=\"line-height18 my-5\">{{ item.description[item.showSummary]}}</p>\n            </ng-container> -->\n            \n\n            <!-- Instances Details -->\n            <div *ngIf=\"item.instances && item.instances.length > 0\">\n              <p class=\"line-height18 my-5\"></p>\n              <ul class=\"la-ul line-height20\" *ngIf=\"item.costSaving\">\n                <li *ngFor=\"let instance of item.instances.slice(0, 5)\" class=\"p-grid p-align-center p-justify-between\">\n                  <div class=\"p-grid p-align-center font-weight-600 w-75-p\">\n                     <!-- <img\n                      src=\"assets/images/amazon-web-services.svg\" class=\"width-22 mr-5\" alt=\"AWS Logo\"> -->\n                    <span class=\"btn-icon elipseText w-85-p mtn-2 text-underline\" [matTooltip]=\"instance.name || instance.id\">{{\n                      instance.name || instance.id }},</span>\n                  </div>\n                 <strong>{{ instance.costImapctType == \"INVEST\" ? '-$' : '$' }} {{ (instance.costSaving < 0 ? -instance.costSaving : instance.costSaving) | number:'1.3-3' }}</strong>\n                </li>\n              </ul>\n              <ul class=\"la-ul line-height20\" *ngIf=\"!item.costSaving\">\n                <li class=\"p-grid p-align-center p-justify-between\">\n                  Data Not Available\n                </li>\n              </ul>\n            </div>\n          </div>\n          <!-- See All Items Link  -->\n          <div class=\"see-all-items p-grid p-align-center p-justify-between\">\n            <a class=\"btn-icon text-underline\" *ngIf=\"item.costSaving\" (click)=\"openSidebar(item)\">\n              See all {{ item.instances.length }} items\n            </a>\n            <a class=\"btn-icon text-underline\" *ngIf=\"!item.costSaving\" (click)=\"openSidebar(item)\">            \n            </a>\n            <span>\n              <button type=\"button\" pButton class=\"btn-icon\" icon=\"icons8 icons8-menu-vertical\"\n                [matMenuTriggerFor]=\"menu\">\n              </button>\n              <mat-menu #menu=\"matMenu\">\n                <button mat-menu-item (click)=\"onSettings(item)\">Settings</button>\n                <button mat-menu-item (click)=\"randerRecommendation(item)\">Generate Recommendation</button>\n                <!-- <button mat-menu-item (click)=\"onExcludePools(item)\">Exclude Pools</button> -->\n                <!-- <button mat-menu-item (click)=\"onPin(item)\">Pin</button> -->\n              </mat-menu>\n            </span>\n          </div>\n          </div>\n        </div>\n      </div>\n      </div>\n    </ng-template>\n    <p-sidebar [(visible)]=\"displaySidebar\" position=\"right\" [showCloseIcon]=\"false\" position=\"right\"\n      [style]=\"{width: '85vw'}\">\n      <div class=\"sidebar-header\">\n        <div class=\"sidebar-title p-grid p-align-center p-justify-between\">\n          <div class=\"\">{{jsrTitle}}</div>\n          <div>\n            <button type=\"button\" (click)=\"displaySidebar = false;\" pButton class=\"btn-icon btn-white\"\n              icon=\"icons8 icons8-delete\"></button>\n          </div>\n        </div>\n      </div>\n      <div class=\"sidebar-body p-6\">\n        <!-- <div class=\"alert-info relative mb-10\">\n          <span>\n            <i class=\"icons8 icons8-info mr-5\"></i> {{instanceDescription}}\n          </span>\n        </div> -->\n        <cav-table [value]=\"instanceData\" [headerRelativePath]=\"instanceHeaders\" [tableConfig]=\"tableConfig1\" [scrollable]=\"true\"\n          (clickButtonEvent)=\"clickButtonEvent($event)\" [rowSelection]=\"instanceData[0]\"\n          ></cav-table>\n      <div *ngIf=\"instanceScale || volumeScale \">\n        <cav-table [value]=\"scaleData\" [headerRelativePath]=\"recommendationActionHeader\" [scrollable]=\"true\"></cav-table>\n      </div>\n      </div>\n    </p-sidebar>\n    <!-- <ng-container *ngIf=\"showDialog == true\"> -->\n    <p-sidebar [showCloseIcon]=\"false\" position=\"right\" [(visible)]=\"showDialog\" [style]=\"{width: '950px'}\">\n      <div class=\"sidebar-header\">\n        <div class=\"sidebar-title p-grid p-align-center p-justify-between\">\n          <div class=\"\">{{dialogTitle}}</div>\n          <div>\n            <button type=\"button\" (click)=\"showDialog = false;\" pButton class=\"btn-icon btn-white\"\n              icon=\"icons8 icons8-delete\"></button>\n          </div>\n        </div>\n      </div>\n      <div class=\"sidebar-body\">\n        <div class=\"p-grid p-align-center\">\n          <div class=\"p-col-12\">\n            <div class=\"alert-info relative\">\n              <span>\n                <i class=\"icons8 icons8-info mr-5\"></i> New settings will be applied on the next recommendations check.\n              </span>\n            </div>\n          </div>\n          <div class=\"p-col-12\">\n          <p-dropdown  id=\"rulecatagories\" [options]=\"ruleCategory\" [(ngModel)]=\"selectedRuleCatagoryOption\"\n          (onChange)=\"onRuleCategoryChange($event,jsonSend)\"> </p-dropdown>\n        </div>\n        </div>\n        <div class=\"px-8\" *ngIf=\"loadForm\">\n          <app-dynamic-form [panelPosition]=\"'none'\" [jsonData]=\"jsonSend\"\n            (result)=\"getResult($event)\" [isDataFromCloudCost]=\"true\"></app-dynamic-form>\n        </div>\n      </div>\n    </p-sidebar>\n    <app-cc-action-sidebar\n        [(visible)]=\"showAction\"\n        [chartOptions]=\"chartOptions\"\n        [chartOptionsMem]=\"chartOptionsMem\"\n        [instanceScale]=\"instanceScale\"\n        [instanceDelete]=\"instanceDelete\"\n        [volumeScale]=\"volumeScale\"\n        [volumeDelete]=\"volumeDelete\"\n        [vpaRecommendation]=\"vpaRecommendation\"\n        [instanceActionHeader]=\"instanceActionHeader\"\n        [volumeActionHeader]=\"volumeActionHeader\"\n        [action]=\"action\"\n        [volumeDetails]=\"volumeDetails\"\n        [instanceDetails]=\"instanceDetails\"\n        [vpaDetails]=\"vpaDetails\"\n        [volumeResource]=\"volumeResource\"\n        [instanceResource]=\"instanceResource\"\n        [volumeCost]=\"volumeCost\"\n        [instanceCost]=\"instanceCost\"\n        [isLoading]=\"isActionLoading\"\n        (executeAction)=\"handleExecuteAction()\">\n    </app-cc-action-sidebar>\n    <!-- </ng-container> -->\n  </div>\n</ng-template>\n</div>\n";
    /***/
  },

  /***/
  "./src/app/pages/home/cloud-cost/cc-recommendation/cc-action-sidebar/cc-action-sidebar.component.scss":
  /*!************************************************************************************************************!*\
    !*** ./src/app/pages/home/cloud-cost/cc-recommendation/cc-action-sidebar/cc-action-sidebar.component.scss ***!
    \************************************************************************************************************/

  /*! exports provided: default */

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

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


    __webpack_exports__["default"] = "";
    /***/
  },

  /***/
  "./src/app/pages/home/cloud-cost/cc-recommendation/cc-action-sidebar/cc-action-sidebar.component.ts":
  /*!**********************************************************************************************************!*\
    !*** ./src/app/pages/home/cloud-cost/cc-recommendation/cc-action-sidebar/cc-action-sidebar.component.ts ***!
    \**********************************************************************************************************/

  /*! exports provided: CcActionSidebarComponent */

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

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


    __webpack_require__.d(__webpack_exports__, "CcActionSidebarComponent", function () {
      return CcActionSidebarComponent;
    });
    /* 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 highcharts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
    /*! highcharts */
    "./node_modules/highcharts/highcharts.js");
    /* harmony import */


    var highcharts__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(highcharts__WEBPACK_IMPORTED_MODULE_2__);

    var CcActionSidebarComponent = /*#__PURE__*/function () {
      function CcActionSidebarComponent() {
        _classCallCheck(this, CcActionSidebarComponent);

        // --- Inputs ---
        this.visible = false;
        this.isLoading = false;
        this.instanceActionHeader = {};
        this.volumeActionHeader = {};
        this.action = [];
        this.volumeDetails = [];
        this.instanceDetails = [];
        this.vpaDetails = [];
        this.volumeResource = [];
        this.instanceResource = [];
        this.volumeCost = [];
        this.instanceCost = []; // --- Outputs ---

        this.visibleChange = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
        this.executeAction = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
        this.Highcharts = highcharts__WEBPACK_IMPORTED_MODULE_2__;
      }
      /**
       * Emits an event to close the sidebar.
       */


      return _createClass(CcActionSidebarComponent, [{
        key: "onClose",
        value: function onClose() {
          this.visible = false;
          this.visibleChange.emit(this.visible);
        }
        /**
         * Emits an event to signal the parent component to execute the action.
         */

      }, {
        key: "onExecuteAction",
        value: function onExecuteAction() {
          this.executeAction.emit();
        }
      }]);
    }();

    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "visible", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "isLoading", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "chartOptions", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "chartOptionsMem", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "instanceScale", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "instanceDelete", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "volumeScale", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "volumeDelete", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "instanceActionHeader", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "volumeActionHeader", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "action", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "volumeDetails", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "instanceDetails", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "vpaDetails", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "volumeResource", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "instanceResource", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "volumeCost", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "instanceCost", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])()], CcActionSidebarComponent.prototype, "vpaRecommendation", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])()], CcActionSidebarComponent.prototype, "visibleChange", void 0);
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])()], CcActionSidebarComponent.prototype, "executeAction", void 0);
    CcActionSidebarComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
      selector: 'app-cc-action-sidebar',
      template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! raw-loader!./cc-action-sidebar.component.html */
      "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/cloud-cost/cc-recommendation/cc-action-sidebar/cc-action-sidebar.component.html"))["default"],
      encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None // To ensure styles are applied correctly
      ,
      styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! ./cc-action-sidebar.component.scss */
      "./src/app/pages/home/cloud-cost/cc-recommendation/cc-action-sidebar/cc-action-sidebar.component.scss"))["default"]]
    })], CcActionSidebarComponent);
    /***/
  },

  /***/
  "./src/app/pages/home/cloud-cost/cc-recommendation/cc-action-sidebar/cc-action-sidebar.module.ts":
  /*!*******************************************************************************************************!*\
    !*** ./src/app/pages/home/cloud-cost/cc-recommendation/cc-action-sidebar/cc-action-sidebar.module.ts ***!
    \*******************************************************************************************************/

  /*! exports provided: CcActionSidebarModule */

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

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


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


    var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
    /*! tslib */
    "./node_modules/tslib/tslib.es6.js");
    /* harmony import */


    var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
    /*! @angular/core */
    "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
    /* harmony import */


    var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
    /*! @angular/common */
    "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
    /* harmony import */


    var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! @angular/forms */
    "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
    /* harmony import */


    var primeng_sidebar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
    /*! primeng/sidebar */
    "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng-sidebar.js");
    /* harmony import */


    var primeng_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
    /*! primeng/button */
    "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng-button.js");
    /* harmony import */


    var highcharts_angular__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! highcharts-angular */
    "./node_modules/highcharts-angular/__ivy_ngcc__/fesm2015/highcharts-angular.js");
    /* harmony import */


    var _cc_action_sidebar_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
    /*! ./cc-action-sidebar.component */
    "./src/app/pages/home/cloud-cost/cc-recommendation/cc-action-sidebar/cc-action-sidebar.component.ts");
    /* harmony import */


    var src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
    /*! src/app/shared/cav-table/cav-table.module */
    "./src/app/shared/cav-table/cav-table.module.ts");

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

    CcActionSidebarModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
      declarations: [_cc_action_sidebar_component__WEBPACK_IMPORTED_MODULE_7__["CcActionSidebarComponent"]],
      imports: [_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_3__["FormsModule"], primeng_sidebar__WEBPACK_IMPORTED_MODULE_4__["SidebarModule"], primeng_button__WEBPACK_IMPORTED_MODULE_5__["ButtonModule"], highcharts_angular__WEBPACK_IMPORTED_MODULE_6__["HighchartsChartModule"], src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_8__["CavTableModule"]],
      exports: [_cc_action_sidebar_component__WEBPACK_IMPORTED_MODULE_7__["CcActionSidebarComponent"]]
    })], CcActionSidebarModule);
    /***/
  },

  /***/
  "./src/app/pages/home/cloud-cost/cc-recommendation/cc-recommendation.component.scss":
  /*!******************************************************************************************!*\
    !*** ./src/app/pages/home/cloud-cost/cc-recommendation/cc-recommendation.component.scss ***!
    \******************************************************************************************/

  /*! exports provided: default */

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

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


    __webpack_exports__["default"] = "app-cc-recommendation .card-count4 {\n  min-width: 25%;\n  max-width: 25%;\n}\napp-cc-recommendation .cav-card {\n  position: relative;\n  width: 100%;\n  min-height: 210px;\n  overflow: hidden;\n  padding: 12px;\n  display: flex;\n  flex-direction: column;\n}\napp-cc-recommendation .cav-card .maincontents {\n  flex: 1;\n  display: flex;\n  flex-direction: column;\n  max-height: 115px;\n  overflow: hidden;\n  min-height: 115px;\n}\napp-cc-recommendation .cav-card .card-header, app-cc-recommendation .cav-card .see-all-items {\n  flex: 0;\n}\napp-cc-recommendation .cav-card .card-header {\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n  font-size: 16px;\n  font-weight: bold;\n  margin-bottom: 10px;\n  min-height: 26px;\n}\napp-cc-recommendation .cav-card .card-header .status {\n  font-size: 0.85rem;\n  padding: 3px 6px;\n  border-radius: 4px;\n  display: inline-flex;\n  flex-direction: column;\n  justify-content: space-between;\n  height: 36px;\n  color: var(--primary-1300);\n}\napp-cc-recommendation .cav-card .card-header .status.critical {\n  color: var(--primary-1300);\n}\napp-cc-recommendation .cav-card .instance-badge {\n  border-style: solid;\n  border-width: 1px;\n  border-radius: 12px;\n  display: inline-flex;\n  align-items: center;\n  padding: 6px 12px;\n  height: 24px;\n  margin: 0px 6px 6px 0px;\n  cursor: pointer;\n}\napp-cc-recommendation .cav-card-border {\n  border-style: solid;\n  border-width: 1px;\n}\napp-cc-recommendation .p-grid.ui-fluid.cloudCost > span {\n  flex: 0 0 auto;\n  padding: 0.5em;\n}\napp-cc-recommendation .p-grid.ui-fluid.cloudCost form {\n  display: inline-flex;\n  width: 70px;\n}\napp-cc-recommendation .p-grid.ui-fluid.cloudCost form input.mt-6.number.ng-pristine.ng-valid.ui-inputtext {\n  width: 100% !important;\n}\napp-cc-recommendation .parent .p-grid.ui-fluid.cloudCost {\n  margin-left: -2px;\n}\napp-cc-recommendation label.dataSource {\n  color: var(--color_1);\n  font-size: 11px;\n  background-color: var(--background_color_1);\n  display: inline-block;\n  position: absolute;\n  margin-top: -5px;\n  z-index: 5;\n  left: 11px;\n  top: 5px;\n}\napp-cc-recommendation .critical-card {\n  background-color: var(--danger-400);\n}\napp-cc-recommendation .security-card {\n  background-color: var(--secondary-400);\n}\napp-cc-recommendation .savings-card {\n  background-color: var(--warning-500);\n}\napp-cc-recommendation app-dynamic-form app-panel #cloudCost {\n  word-wrap: break-word;\n  display: block !important;\n  margin-bottom: 6px;\n}\napp-cc-recommendation app-dynamic-form app-panel #cloudCost span {\n  display: inline;\n  max-width: 100%;\n}\napp-cc-recommendation app-dynamic-form app-panel #cloudCost app-input {\n  display: inline-flex;\n  width: 80px;\n  margin: 3px;\n}\napp-cc-recommendation app-dynamic-form app-panel #cloudCost app-text {\n  display: inline-flex;\n}\napp-cc-recommendation app-dynamic-form app-panel #cloudCost app-text span {\n  display: inline-flex;\n  max-width: 100%;\n}\napp-cc-recommendation app-dynamic-form app-panel #cloudCost app-select {\n  display: inline-flex;\n}\napp-cc-recommendation app-dynamic-form app-panel #cloudCost app-select span {\n  display: inline-flex;\n  max-width: 100%;\n}\napp-cc-recommendation .total {\n  left: 50%;\n  top: 53px;\n  transform: translate(-50%, 0px);\n  z-index: 55;\n}";
    /***/
  },

  /***/
  "./src/app/pages/home/cloud-cost/cc-recommendation/cc-recommendation.component.ts":
  /*!****************************************************************************************!*\
    !*** ./src/app/pages/home/cloud-cost/cc-recommendation/cc-recommendation.component.ts ***!
    \****************************************************************************************/

  /*! exports provided: CcRecommendationComponent */

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

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


    __webpack_require__.d(__webpack_exports__, "CcRecommendationComponent", function () {
      return CcRecommendationComponent;
    });
    /* 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 _service_cc_recommendation_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
    /*! ./service/cc-recommendation.service */
    "./src/app/pages/home/cloud-cost/cc-recommendation/service/cc-recommendation.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_shared_cav_table_service_cav_table_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
    /*! src/app/shared/cav-table/service/cav-table.service */
    "./src/app/shared/cav-table/service/cav-table.service.ts");
    /* harmony import */


    var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
    /*! rxjs */
    "./node_modules/rxjs/_esm2015/index.js");
    /* harmony import */


    var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! rxjs/operators */
    "./node_modules/rxjs/_esm2015/operators/index.js");
    /* harmony import */


    var _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
    /*! ./service/cc-recommendation.state */
    "./src/app/pages/home/cloud-cost/cc-recommendation/service/cc-recommendation.state.ts");
    /* harmony import */


    var _cloud_data_source_service_cloud_data_source_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
    /*! ../../cloud-data-source/service/cloud-data-source.service */
    "./src/app/pages/home/cloud-data-source/service/cloud-data-source.service.ts");
    /* harmony import */


    var src_app_shared_cav_table_cav_table_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
    /*! src/app/shared/cav-table/cav-table.component */
    "./src/app/shared/cav-table/cav-table.component.ts");
    /* harmony import */


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


    var highcharts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(
    /*! highcharts */
    "./node_modules/highcharts/highcharts.js");
    /* harmony import */


    var highcharts__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(highcharts__WEBPACK_IMPORTED_MODULE_11__);
    /* harmony import */


    var src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(
    /*! src/app/shared/cav-toast/service/cav-message.service */
    "./src/app/shared/cav-toast/service/cav-message.service.ts"); // import { dataTypesForIframe } from 'src/app/shared/common-iframe/service/common-iframe.model';


    var CcRecommendationComponent = /*#__PURE__*/function () {
      function CcRecommendationComponent(router, ccRecommendationService, cavTableService, cloudDataSourceService, cavMessageService) {
        _classCallCheck(this, CcRecommendationComponent);

        this.router = router;
        this.ccRecommendationService = ccRecommendationService;
        this.cavTableService = cavTableService;
        this.cloudDataSourceService = cloudDataSourceService;
        this.cavMessageService = cavMessageService;
        this.isLoading = false;
        this.currentViewMode = 'Cards';
        this.totalTabSavings = 0;
        this.totalTabInvestments = 0;
        this.action = [// { name: 'State', value: '--' },
        {
          name: 'Non Disruptive',
          value: '--'
        }, {
          name: 'Reversible',
          value: '--'
        }];
        this.vpaResource = [{
          name: 'Memory (MB)',
          current: '--',
          after: '--'
        }, {
          name: 'CPU (Mcores)',
          current: '--',
          after: '--'
        }];
        this.configDetails = [];
        this.scaleData = [];
        this.volumeScaleResource = [];
        this.instanceScaleResource = [];
        this.isActionLoading = false; // volumeScaleResource=[
        //   { name: 'storage tier', current: '--', after: '--' },
        //   { name: 'disk size,capacity', current: '--', after: '--' },
        //   { name: 'IOPS,capacity', current: '--', after: '--' },
        //   { name: 'IOPS,P95th utilization', current: '--', after: '--' },
        //   { name: 'throughput,capacity', current: '--', after: '--' },
        //   { name: 'throughput,P95th utilization', current: '--', after: '--' },
        // ];
        // instanceScaleResource=[
        //   { name: 'Instance type', current: '--' ,after:'--'},
        //   { name: 'vCPU capacity',current: '--' ,after:'--' },
        //   { name: 'vCPU,P95th utilization', current: '--' ,after:'--' },
        //   { name: 'Virtual memory,capacity', current: '--' ,after:'--' },
        //   { name: 'Virtual memory,P95th utilization', current: '--' ,after:'--' },
        //   { name: 'VM Storage throughput,capacity', current: '--' ,after:'--' },
        //   { name: 'VM Storage throughput,P95th utilization', current: '--' ,after:'--' },
        //   { name: 'Net throughput,capacity', current: '--' ,after:'--' },
        //   { name: 'Net throughput,P95th utilization', current: '--' ,after:'--' },
        // ];

        this.volumeDeleteResource = [{
          name: 'Storage access',
          current: '--',
          after: ''
        }, {
          name: 'Storage amount',
          current: '--',
          after: ''
        }];
        this.instanceDeleteResource = [{
          name: 'Virtual CPU',
          current: '--',
          after: ''
        }, {
          name: 'Virtual memory',
          current: '--',
          after: ''
        }];
        this.volumeCost = [{
          name: 'Total cost',
          current: '--',
          after: '--',
          saving: '--'
        }];
        this.instanceCost = [{
          name: 'On demand rate',
          current: '--',
          after: '--',
          saving: '--'
        }, // { name: 'Discount coverage', current: '--' ,after:'--',saving:'--'},
        {
          name: 'On demand cost ($/month)',
          current: '--',
          after: '--',
          saving: '--'
        }];
        this.volumeDetails = [{
          name: 'Name',
          value: '--'
        }, {
          name: 'ID',
          value: '--'
        }, {
          name: 'Account',
          value: '--'
        }, {
          name: 'Region',
          value: '--'
        }, {
          name: 'Virtual machine',
          value: '--'
        }];
        this.vpaDetails = [{
          name: 'Workload name',
          value: '--'
        }, {
          name: 'Node name',
          value: '--'
        }, {
          name: 'Container name',
          value: '--'
        }, {
          name: 'Cluster name',
          value: '--'
        }, {
          name: 'LowerBound CPU',
          value: '--'
        }, {
          name: 'LowerBound memory',
          value: '--'
        }, {
          name: 'UpperBound CPU',
          value: '--'
        }, {
          name: 'UpperBound memory',
          value: '--'
        }];
        this.instanceDetails = [{
          name: 'Name',
          value: '--'
        }, {
          name: 'ID',
          value: '--'
        }, {
          name: 'Account',
          value: '--'
        }, {
          name: 'Region',
          value: '--'
        }, {
          name: 'OS Software',
          value: '--'
        }, {
          name: 'Uptime',
          value: '--'
        }, {
          name: 'Resource type',
          value: '--'
        }]; // ...add more as needed

        this.currentRowForAction = null; //actionHeaderPath : 'cloud_cost_visibility/cc-recommendationAction.json';

        this.instanceActionHeader = {};
        this.volumeActionHeader = {};
        this.Highcharts = highcharts__WEBPACK_IMPORTED_MODULE_11__;
        this.displayedDataSourceOpt = [];
        this.selectedServicesOpt = 'all';
        this.isForceChecking = false;
        this.tableConfig = {
          config: {
            globalFilter: true,
            toggleFilter: true,
            //masterCheckbox: true,
            tableName: "Recommendation Table",
            download: true
          },
          rowAction: {
            rightAction: [{
              iconType: 'icon',
              iconClass: 'las-aws',
              toolTip: 'Aws',
              action: 'aws',
              needRowData: true
            }, {
              iconType: 'icon',
              iconClass: 'icons8 icons8-delete-trash',
              toolTip: 'Delete',
              action: 'delete',
              needRowData: true
            }, {
              iconType: 'icon',
              iconClass: 'cav5 microsoft-azure',
              toolTip: 'Azure',
              action: 'azure',
              needRowData: true
            }]
          }
        };
        this.headers = [{
          "cols": [{
            "label": "Name",
            "key": "type",
            "type": 0
          }, {
            "label": "Status",
            "key": "status",
            "type": 0
          }, {
            "label": "Items",
            "key": "total_instances",
            "type": 1
          }, {
            "label": "Possible monthly savings(USD)",
            "key": "costSaving",
            "type": 3
          }, {
            "label": "Applicable services",
            "key": "categories",
            "type": 0
          }]
        }];
        this.tableConfig1 = {
          config: {
            globalFilter: true,
            toggleFilter: true,
            masterCheckbox: true,
            tableName: "Instances  Table",
            download: true
          },
          rowAction: {
            rightAction: [{
              iconType: 'icon',
              iconClass: 'las-aws',
              toolTip: 'Aws',
              action: 'aws',
              needRowData: true
            }, {
              iconType: 'icon',
              iconClass: 'icons8 icons8-delete-trash',
              toolTip: 'Delete',
              action: 'delete',
              needRowData: true
            }, {
              iconType: 'icon',
              iconClass: 'cav5 microsoft-azure',
              toolTip: 'Azure',
              action: 'azure',
              needRowData: true
            }]
          }
        };
        this.recommendationActionHeader = 'cloud_cost_visibility/ccRecommendationOptmizationConfig.json';
        this.cardJson = [];
        this.formJson = [];
        this.showDialog = false;
        this.showAction = false;
        this.jsonSend = [];
        this.dialogTitle = '';
        this.displaySidebar = false; // data: any = {};

        this.destroy = new rxjs__WEBPACK_IMPORTED_MODULE_5__["Subject"]();
        this.searchResults = [];
        this.cardData = [];
        this.jsrRuleSet = {
          rsName: "",
          rules: []
        };
        this.loadForm = false;
        this.dialogKey = '';
        this.jsrTitle = '';
        this.instanceData = [];
        this.instanceDescription = '';
        this.saveRecommendationList = [];
        this.filteredResults = [];
        this.selectedCardGroupElements = [];
        this.descriptionTemplate = '';
        this.isDaysFieldPresent = false;
      }

      return _createClass(CcRecommendationComponent, [{
        key: "ngOnInit",
        value: function ngOnInit() {
          var _this = this;

          this.cloudTabs = [{
            label: 'ALL',
            value: 'all'
          }, {
            label: 'AWS',
            value: 'aws'
          }, {
            label: 'GCP',
            value: 'gcp'
          }, {
            label: 'Azure',
            value: 'azure'
          }, {
            label: 'On-Prem',
            value: 'onprem'
          }, {
            label: 'Containers',
            value: 'containers'
          }];
          this.activeCloudFilter = this.cloudTabs[0].value;
          this.dataSourceOpt = [];
          this.selectedDataSource = this.activeCloudFilter;
          this.catagoriesOpt = [{
            label: 'All',
            value: 'all'
          }, {
            label: 'Savings',
            value: 'Savings'
          }, {
            label: 'Security',
            value: 'Security'
          }, {
            label: 'Critical',
            value: 'Critical'
          }];
          this.applicableServiceOptions = [{
            label: 'Aws',
            value: 'aws',
            icon: 'las-aws'
          }, {
            label: 'Line',
            value: 'line',
            icon: 'icons8 icons8-line-chart'
          }, {
            label: 'Bar',
            value: 'bar',
            icon: 'icons8 icons8-bar-chart-2'
          }, {
            label: 'None',
            value: 'none',
            icon: 'icons8 icons8-rectangular'
          }];
          var formJsonPath = src_environments_environment__WEBPACK_IMPORTED_MODULE_10__["environment"].api.cloudCostFormJson.read.endpoint;
          this.getCardFormJson(formJsonPath, function (formData) {
            _this.formJson = formData;
            var groupMap = {};

            _this.formJson.forEach(function (item) {
              var groupId = item.groupId,
                  categoryList = item.categoryList;
              groupMap[groupId] = groupMap[groupId] || new Set();
              categoryList.forEach(function (cat) {
                return groupMap[groupId].add(cat);
              });
            });

            _this.groupedCategoryOptions = [];

            for (var groupId in groupMap) {
              _this.groupedCategoryOptions.push({
                label: groupId,
                value: _toConsumableArray(groupMap[groupId])
              });
            }
          });
          var cardJsonPath = src_environments_environment__WEBPACK_IMPORTED_MODULE_10__["environment"].api.cloudCostCardJson.read.endpoint;
          this.getCardFormJson(cardJsonPath, function (cardData) {
            var _a;

            _this.cardJson = cardData;
            (_a = _this.cardJson) === null || _a === void 0 ? void 0 : _a.forEach(function (element) {
              var _a;

              var filterEle = (_a = _this.groupedCategoryOptions) === null || _a === void 0 ? void 0 : _a.find(function (option) {
                return option.label === element.groupId;
              });
              Object.assign(element, {
                "groupCategory": filterEle === null || filterEle === void 0 ? void 0 : filterEle.value
              });
            });

            _this.initializeCard();
          });
          this.cavTableService.searchItem.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["takeUntil"])(this.destroy)).subscribe(function (searchText) {
            _this.searchCardData(searchText);
          });
          this.ccRecommendationService.isSaveBtnClicked.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["takeUntil"])(this.destroy)).subscribe(function (data) {
            if (data == true) {
              _this.showDialog = false;
              _this.loadForm = false;
            }
          });
        }
      }, {
        key: "getRecomData",
        value: function getRecomData() {
          var _this2 = this;

          this.isLoading = true;
          this.filteredResults = []; // Clear old results

          this.totalTabSavings = 0; // this.cardJson=[];
          // We pass the active filter (e.g., 'aws') to the service
          // We wrap it in an array as the service expects

          var providerFilter = this.activeCloudFilter.toUpperCase(); // e.g., "AWS"

          this.ccRecommendationService.getSavedRecommendation(providerFilter).subscribe(function (state) {
            if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadingState"]) {
              return;
            }

            if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadedState"]) {
              _this2.applicableServiceOptions = [];

              _this2.applicableServiceOptions.push({
                label: 'All',
                value: 'all',
                icon: ''
              });

              if (state.data && state.data.length > 0) {
                // Use .reduce() to sum the 'total' field from every group in the array
                _this2.totalTabSavings = state.data.reduce(function (sum, currentGroup) {
                  return sum + (currentGroup.totalSaving || 0);
                }, 0);
                _this2.totalTabInvestments = state.data.reduce(function (sum, currentGroup) {
                  return sum + (currentGroup.totalInvestment || 0);
                }, 0);
              } // This function merges the API data with the card templates


              _this2.transformCardDataWithSavedData(state); // this.cardJson now holds the *filtered* data from the server.
              // We assign it directly to filteredResults.


              _this2.filteredResults = JSON.parse(JSON.stringify(_this2.cardJson)); //

              _this2.isLoading = false;
              setTimeout(function () {
                if (_this2.visualTable) {
                  _this2.visualTable.selectedlayout = _this2.currentViewMode;
                }
              }, 0);
            }
          }, function (error) {
            // Handle error
            console.error("Error fetching recommendations", error);
            _this2.isLoading = false;
            _this2.filteredResults = []; // Ensure empty on error

            _this2.totalTabSavings = 0;
          });
        }
      }, {
        key: "initializeCard",
        value: function initializeCard() {
          this.updateData(); // this.loadDataForIframe();

          this.searchResults = this.cardJson;
          this.filteredResults = JSON.parse(JSON.stringify(this.cardJson));
          this.displayedDataSourceOpt = this.ccRecommendationService.getDataSource();
          this.getRecomData();
        }
      }, {
        key: "getCardFormJson",
        value: function getCardFormJson(path, callback) {
          this.ccRecommendationService.getJson(path).subscribe(function (state) {
            var _a;

            if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadingState"]) {
              return;
            }

            if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadedState"]) {
              if (((_a = state === null || state === void 0 ? void 0 : state.data) === null || _a === void 0 ? void 0 : _a.length) > 0) {
                callback(state === null || state === void 0 ? void 0 : state.data);
              }
            }
          }, function (state) {
            var _a;

            if (window['logLevel'] > 0) console.log("error:::", (_a = state === null || state === void 0 ? void 0 : state.error['error']) === null || _a === void 0 ? void 0 : _a.text);
          });
        }
      }, {
        key: "onSelectionChange",
        value: function onSelectionChange() {
          // if (this.selectedDataSource.length > 0) {
          //   this.selectedDataSource = this.selectedDataSource.filter(
          //     (value) => value !== 'all'
          //   );
          // }
          this.getRecomData(); // if (this.selectedDataSource.length === 0) {
          //   this.selectedDataSource = [];
          // }
        }
      }, {
        key: "formatToK",
        value: function formatToK(value) {
          if (value >= 1000) {
            return (value / 1000).toFixed(3) + 'K';
          }

          return value.toFixed(3);
        }
      }, {
        key: "clickButtonEvent",
        value: function clickButtonEvent(event) {
          var _this3 = this;

          var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;

          var me = this;

          if (((_b = (_a = event.cavEventExt) === null || _a === void 0 ? void 0 : _a.actionConfig) === null || _b === void 0 ? void 0 : _b.action) == "onRowSelect") {
            var row = (_c = event.cavEventExt) === null || _c === void 0 ? void 0 : _c.row;
            this.HandleConfigClick(row);
            var nameRow = {
              name: 'Resource Name',
              current: row.name,
              after: row.name // This is the 'after' value

            };
            this.scaleData = [nameRow].concat(_toConsumableArray(this.configDetails));
            return;
          }

          if (((_e = (_d = event.cavEventExt) === null || _d === void 0 ? void 0 : _d.actionConfig) === null || _e === void 0 ? void 0 : _e.action) == "clickable") {
            var filter = {
              resource_id: (_g = (_f = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _f === void 0 ? void 0 : _f.row) === null || _g === void 0 ? void 0 : _g.id
            };
            var newOne = {
              ccvGctx: filter,
              favName: "RESOURCE_DETAILS",
              event: "showResources"
            };
            me.router.navigate(['/home/cloud-cost/resource'], {
              state: {
                data: newOne
              }
            });
          } else if (((_j = (_h = event.cavEventExt) === null || _h === void 0 ? void 0 : _h.actionConfig) === null || _j === void 0 ? void 0 : _j.action) == "executeAction") {
            //this.chartOptions = null;
            this.isActionLoading = true;
            me.currentRowForAction = (_k = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _k === void 0 ? void 0 : _k.row;

            if (this.vpaRecommendation) {
              var workloadId = (_m = (_l = event.cavEventExt) === null || _l === void 0 ? void 0 : _l.row) === null || _m === void 0 ? void 0 : _m.name; // from your DB sample

              if (workloadId) {
                workloadId = workloadId.replace(/-vpa$/i, '');
              }

              var sortedData = [];
              Object(rxjs__WEBPACK_IMPORTED_MODULE_5__["forkJoin"])({
                metrics: this.ccRecommendationService.getResourceMetricsByWorkLoadName(workloadId),
                recommendation: this.ccRecommendationService.getRecommendMetric(workloadId)
              }).subscribe(function (_ref) {
                var metrics = _ref.metrics,
                    recommendation = _ref.recommendation;

                var _a, _b, _c; // 1. Handle Loading State


                if (metrics instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadingState"]) return; // 2. Process Data for Highcharts

                if ((metrics === null || metrics === void 0 ? void 0 : metrics.data) && metrics.data.length > 0) {
                  var displayName = ((_a = metrics === null || metrics === void 0 ? void 0 : metrics.data) === null || _a === void 0 ? void 0 : _a[0].workloadId) ? (_b = metrics === null || metrics === void 0 ? void 0 : metrics.data) === null || _b === void 0 ? void 0 : _b[0].workloadId.split(':').pop() : "Workload"; // Sort by timestamp ascending
                  //const sortedData = [...state.data].sort((a, b) => a.hour - b.hour);

                  sortedData = _toConsumableArray(metrics.data).sort(function (a, b) {
                    return new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime();
                  });
                  var seriesData = sortedData.map(function (d) {
                    return [new Date(d.timestamp).getTime(), Number(d.cpuUtilizedMcores || 0)];
                  });
                  var seriesReqData = sortedData.filter(function (d) {
                    return Number(d.cpuRequestMcores) > 0;
                  }).map(function (d) {
                    return [new Date(d.timestamp).getTime(), Number(d.cpuRequestMcores)];
                  });
                  var recommendSeries = [];
                  var recommendMemSeries = [];
                  console.log("recommended metric data ", recommendation);

                  if ((_c = recommendation === null || recommendation === void 0 ? void 0 : recommendation.data) === null || _c === void 0 ? void 0 : _c.length) {
                    recommendSeries = recommendation.data.map(function (d) {
                      return [new Date(d.timestamp).getTime(), Number(String(d.cpuRecommendMCores || '0').replace('m', ''))];
                    });
                    recommendMemSeries = recommendation.data.map(function (d) {
                      var mem = String(d.memoryRecommendMb || '0');

                      if (mem.includes('Mi')) {
                        mem = mem.replace('Mi', '');
                        return [new Date(d.timestamp).getTime(), Number(mem)];
                      } else {
                        return [new Date(d.timestamp).getTime(), Number(mem) / (1024 * 1024)];
                      }
                    });
                  }

                  var seriesDataMem = sortedData.map(function (d) {
                    return [new Date(d.timestamp).getTime(), Number(d.memoryUtilizedMb || 0)];
                  });
                  var seriesReqDataMem = sortedData.filter(function (d) {
                    return Number(d.memoryRequestMb) > 0;
                  }).map(function (d) {
                    return [new Date(d.timestamp).getTime(), Number(d.memoryRequestMb)];
                  });
                  console.log("sorted data of vpa", sortedData);
                  var latest = sortedData === null || sortedData === void 0 ? void 0 : sortedData[sortedData.length - 2]; // this.vpaResource = this.vpaResource.map(res => {
                  //   if (res.name === 'Memory (MB)') {
                  //     if (latest?.memoryRequestMb != null) {
                  //       res.current = String(Math.trunc(latest.memoryRequestMb)+"mb");
                  //     }
                  //     if (event?.cavEventExt?.row?.recommendConfDisplay?.memory) {
                  //       res.after = String(Math.round(event.cavEventExt.row.recommendConfDisplay.memory / (1024 * 1024))+"mb");
                  //     }
                  //   }
                  //   if (res.name === 'CPU (Mcores)') {
                  //     if (latest?.cpuRequestMcores != null) {
                  //       res.current = String(latest.cpuRequestMcores+"m");
                  //     }
                  //     if (event?.cavEventExt?.row?.recommendConfDisplay?.cpu) {
                  //       res.after = String(event.cavEventExt.row.recommendConfDisplay.cpu);
                  //     }
                  //   }
                  //   return res;
                  // });

                  _this3.vpaDetails = _this3.vpaDetails.map(function (vol) {
                    var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;

                    if (vol.name === 'Workload name') {
                      return Object.assign(Object.assign({}, vol), {
                        value: String(workloadId || '--')
                      });
                    }

                    if (vol.name === 'Node name') {
                      return Object.assign(Object.assign({}, vol), {
                        value: String(((_a = sortedData === null || sortedData === void 0 ? void 0 : sortedData[0]) === null || _a === void 0 ? void 0 : _a.nodeName) || '--')
                      });
                    }

                    if (vol.name === 'Container name') {
                      return Object.assign(Object.assign({}, vol), {
                        value: String(((_f = (_e = (_d = (_c = (_b = event.cavEventExt) === null || _b === void 0 ? void 0 : _b.row) === null || _c === void 0 ? void 0 : _c.optConf) === null || _d === void 0 ? void 0 : _d.containerRecommendations) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.containerName) || '--')
                      });
                    }

                    if (vol.name === 'Cluster name') {
                      return Object.assign(Object.assign({}, vol), {
                        value: String(((_g = sortedData === null || sortedData === void 0 ? void 0 : sortedData[0]) === null || _g === void 0 ? void 0 : _g.clusterName) || '--')
                      });
                    }

                    if (vol.name === 'LowerBound CPU') {
                      return Object.assign(Object.assign({}, vol), {
                        value: String(((_o = (_m = (_l = (_k = (_j = (_h = event.cavEventExt) === null || _h === void 0 ? void 0 : _h.row) === null || _j === void 0 ? void 0 : _j.optConf) === null || _k === void 0 ? void 0 : _k.containerRecommendations) === null || _l === void 0 ? void 0 : _l[0]) === null || _m === void 0 ? void 0 : _m.lowerBound) === null || _o === void 0 ? void 0 : _o.cpu) || '--')
                      });
                    }

                    if (vol.name === 'LowerBound memory') {
                      return Object.assign(Object.assign({}, vol), {
                        value: String(((_u = (_t = (_s = (_r = (_q = (_p = event.cavEventExt) === null || _p === void 0 ? void 0 : _p.row) === null || _q === void 0 ? void 0 : _q.optConf) === null || _r === void 0 ? void 0 : _r.containerRecommendations) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.lowerBound) === null || _u === void 0 ? void 0 : _u.memory) || '--')
                      });
                    }

                    if (vol.name === 'UpperBound CPU') {
                      return Object.assign(Object.assign({}, vol), {
                        value: String(((_0 = (_z = (_y = (_x = (_w = (_v = event.cavEventExt) === null || _v === void 0 ? void 0 : _v.row) === null || _w === void 0 ? void 0 : _w.optConf) === null || _x === void 0 ? void 0 : _x.containerRecommendations) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.upperBound) === null || _0 === void 0 ? void 0 : _0.cpu) || '--')
                      });
                    }

                    if (vol.name === 'UpperBound memory') {
                      return Object.assign(Object.assign({}, vol), {
                        value: String(((_6 = (_5 = (_4 = (_3 = (_2 = (_1 = event.cavEventExt) === null || _1 === void 0 ? void 0 : _1.row) === null || _2 === void 0 ? void 0 : _2.optConf) === null || _3 === void 0 ? void 0 : _3.containerRecommendations) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.upperBound) === null || _6 === void 0 ? void 0 : _6.memory) || '--')
                      });
                    }

                    return vol;
                  }); // Map to Highcharts format [timestamp, value]
                  // Use memoryUtilizedPct or cpuUtilizedMcores based on your requirement
                  //const seriesData = sortedData?.map(d => [new Date(d.timestamp).getTime(),Number(d.cpuUtilizedMcores)]); // milliseconds since epoch);
                  //✅ Optionally filter last 60 days

                  var sixtyDaysAgo = Date.now() - 30 * 24 * 60 * 60 * 1000;
                  var filteredData = seriesData.filter(function (p) {
                    return p[0] >= sixtyDaysAgo;
                  });
                  var filteredReqData = seriesReqData.filter(function (p) {
                    return p[0] >= sixtyDaysAgo;
                  });
                  var filteredRecommData = recommendSeries.filter(function (p) {
                    return p[0] >= sixtyDaysAgo;
                  });
                  var filteredDataMem = seriesDataMem.filter(function (p) {
                    return p[0] >= sixtyDaysAgo;
                  });
                  var filteredReqDataMem = seriesReqDataMem.filter(function (p) {
                    return p[0] >= sixtyDaysAgo;
                  });
                  var filteredRecommMemData = recommendMemSeries.filter(function (p) {
                    return p[0] >= sixtyDaysAgo;
                  });
                  console.log("metric data ----------------", filteredData); //const memData = sortedData.map(d => [new Date(d.timestamp).getTime(), d.memoryUtilizedMb]);
                  // 3. Configure Highcharts Options

                  _this3.chartOptions = {
                    chart: {
                      type: 'line',
                      height: 350
                    },
                    title: {
                      text: "CPU Metrics for ".concat(displayName.replace(/-vpa$/i, ''))
                    },
                    xAxis: {
                      type: 'datetime',
                      title: {
                        text: 'Date'
                      }
                    },
                    yAxis: {
                      title: {
                        text: 'CPU (mCores)'
                      },
                      min: 0
                    },
                    series: [{
                      type: 'line',
                      name: 'CPU Utilization',
                      data: filteredData,
                      color: '#2196F3'
                    }, {
                      type: 'line',
                      name: 'CPU Request',
                      data: filteredReqData,
                      color: '#ec21f3'
                    }, {
                      type: 'line',
                      name: 'CPU Recommended',
                      data: filteredRecommData,
                      color: '#FF9800'
                    }],
                    credits: {
                      enabled: false
                    },
                    exporting: {
                      enabled: false
                    }
                  };
                  _this3.chartOptionsMem = {
                    chart: {
                      type: 'line',
                      height: 350
                    },
                    title: {
                      text: "Memory Metrics for ".concat(displayName.replace(/-vpa$/i, ''))
                    },
                    xAxis: {
                      type: 'datetime',
                      title: {
                        text: 'Date'
                      }
                    },
                    yAxis: {
                      title: {
                        text: 'Memory (MB)'
                      },
                      min: 0
                    },
                    series: [{
                      type: 'line',
                      name: 'Memory Utilization',
                      data: filteredDataMem,
                      color: '#2196F3'
                    }, {
                      type: 'line',
                      name: 'Memory Request',
                      data: filteredReqDataMem,
                      color: '#ec21f3'
                    }, {
                      type: 'line',
                      name: 'Memory Recommended',
                      data: filteredRecommMemData,
                      color: '#FF9800'
                    }],
                    credits: {
                      enabled: false
                    },
                    exporting: {
                      enabled: false
                    }
                  }; // 4. Open the Sidebar
                  // this.isSidebarVisible = true;
                }

                _this3.isActionLoading = false;
              });
              this.HandleVpaConfigClick((_o = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _o === void 0 ? void 0 : _o.row); //   const nameRow = {
              //   name: 'Resource Name', // This is the label for the row
              //   current: event?.cavEventExt?.row?.name,  // This is the 'current' value
              //   after: event?.cavEventExt?.row?.name     // This is the 'after' value
              // };
              // this.scaleData = [nameRow, ...this.configDetails];

              this.volumeResource = this.configDetails;
            } else if (this.instanceScale || this.volumeScale) {
              var cloudProvider = (_r = (_q = (_p = event.cavEventExt) === null || _p === void 0 ? void 0 : _p.row) === null || _q === void 0 ? void 0 : _q.cloudProvider) === null || _r === void 0 ? void 0 : _r.toUpperCase();
              var metrics = ((_t = (_s = event.cavEventExt) === null || _s === void 0 ? void 0 : _s.row) === null || _t === void 0 ? void 0 : _t.displayMetrics) ? (_v = (_u = event.cavEventExt) === null || _u === void 0 ? void 0 : _u.row) === null || _v === void 0 ? void 0 : _v.displayMetrics[cloudProvider] : ["Percentage CPU"];
              this.ccRecommendationService.getResourceMetricsById((_x = (_w = event.cavEventExt) === null || _w === void 0 ? void 0 : _w.row) === null || _x === void 0 ? void 0 : _x.id, metrics).subscribe(function (state) {
                var _a, _b;

                if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadingState"]) {
                  return;
                }

                if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadedState"]) {
                  //this.applicableServiceOptions = [];
                  //this.applicableServiceOptions.push({ label: 'All', value: 'all', icon: '' });
                  //this.transformCardDataWithSavedData(state);
                  console.log("this is chart data", state);
                  /*if (!state?.data?.length){
                    if (!this.chartOptions) {
                      this.chartOptions = {
                        chart: { type: 'line' },
                        title: { text: '' },
                        //series: [{ type: 'line', data: [] }],
                        exporting: { enabled: false }
                      };
                    } else {
                      // Update title safely
                      if (!this.chartOptions.title) {
                        this.chartOptions.title = { text: '' };
                      } else {
                       this.chartOptions.title.text = '';
                      }
                  
                      // Clear series data safely
                      if (!this.chartOptions.series) {
                        this.chartOptions.series = [{ type: 'line', data: [] }];
                      } else {
                        (this.chartOptions.series[0] as Highcharts.SeriesLineOptions).data = [];
                      }
                    }
                  
                    this.chartOptions = { ...this.chartOptions , credits: { enabled: false },}; // trigger change detection
                    return;
                  }
                                   // ✅ Sort by timestamp ascending
                  const sortedData = [state.data].sort((a, b) => a.timestamp - b.timestamp);
                                   // ✅ Convert each record to Highcharts { x, y } format
                                   const seriesData = sortedData?.[0].map(d => [d.timestamp,Number(d.avgValue)]); // milliseconds since epoch);
                                   // ✅ Optionally filter last 60 days
                  const sixtyDaysAgo = Date.now() - 30 * 24 * 60 * 60 * 1000;
                  const filteredData = seriesData.filter(p => p[0] >= sixtyDaysAgo);
                                   // ✅ Configure Highcharts
                  this.chartOptions = {
                    chart: {
                      type: 'line',
                      backgroundColor: '#fff',
                      height: 350
                    },
                    title: { text: '' },
                    xAxis: {
                      type: 'datetime',
                      title: { text: 'Date' },
                      crosshair: true,
                      labels: {
                        format: '{value:%b %e}', // e.g. Oct 29
                        style: { color: '#555' }
                      },
                      lineColor: '#ccc',
                      tickColor: '#ccc'
                    },
                    yAxis: {
                      title: { text: 'CPU Utilization (%)' },
                      min: 0,
                      gridLineColor: '#e5e7eb'
                    },
                    tooltip: {
                      enabled: true,
                      shared: true,
                      // backgroundColor: '#333',
                      // style: { color: '#fff' },
                      format: "lkjdljdslkjlk"//function () {
                        // // Get the formatted date from the shared X value (this.x)
                        // const date = Highcharts.dateFormat('%e %b %Y %H:%M', this.x as number);
                        // let tooltipContent = `<b>${date}</b><br/>`;
                    
                        // // Iterate over all points at this X-value (this.points)
                        // this.points.forEach(function (point) {
                        //   tooltipContent += `<span style="color:${point.series.color}">\u25CF</span> `;
                        //   tooltipContent += `CPU: ${point.y?.toFixed(3)}%`;
                        //   // Since you only have one series, this is enough.
                        //   // If you had more series, you'd add: ` ${point.series.name}: ... `
                        // });
                    
                      //   return "hello here tooltip"//tooltipContent;
                      // }
                    } as any,
                    legend: {
                      align: 'center',
                      verticalAlign: 'bottom',
                      itemStyle: { fontSize: '11px' }
                    },
                    plotOptions: {
                      line: {
                        marker: { enabled: true, radius: 3, symbol: 'circle' }
                      },
                      series: { lineWidth: 1.5 }
                    },
                    series: [
                      {
                        type: 'line',
                        name: 'CPU Utilization',
                        data: filteredData,
                        color: '#2196F3'
                      }
                    ] as Highcharts.SeriesOptionsType[],
                    credits: { enabled: false },
                    exporting: { enabled: false }
                  };*/

                  if (!((_a = state === null || state === void 0 ? void 0 : state.data) === null || _a === void 0 ? void 0 : _a.length)) {
                    if (!_this3.chartOptions) {
                      _this3.chartOptions = {
                        chart: {
                          type: 'line'
                        },
                        title: {
                          text: ''
                        },
                        exporting: {
                          enabled: false
                        },
                        credits: {
                          enabled: false
                        }
                      };
                    } else {
                      _this3.chartOptions.title = {
                        text: ''
                      };
                      _this3.chartOptions.series = [];
                    }

                    _this3.chartOptions = Object.assign({}, _this3.chartOptions); // trigger change detection

                    return;
                  } // -----------------------------------------
                  // 1️⃣ Group data by metric dynamically
                  // -----------------------------------------


                  var grouped = {};
                  (_b = state.data) === null || _b === void 0 ? void 0 : _b.forEach(function (rec) {
                    if (!grouped[rec.metric]) grouped[rec.metric] = [];
                    grouped[rec.metric].push(rec);
                  }); // -----------------------------------------
                  // 2️⃣ For each metric, sort + convert to [x,y]
                  // -----------------------------------------

                  var now = Date.now();
                  var thirtyDaysAgo = now - 30 * 24 * 60 * 60 * 1000;
                  var seriesList = [];
                  Object.entries(grouped).forEach(function (_ref2) {
                    var _ref3 = _slicedToArray(_ref2, 2),
                        metricName = _ref3[0],
                        items = _ref3[1];

                    var sorted = items.sort(function (a, b) {
                      return a.timestamp - b.timestamp;
                    });
                    var mapped = sorted.map(function (d) {
                      return [d.timestamp, Number(d.avgValue)];
                    });
                    var filtered = mapped.filter(function (p) {
                      return p[0] >= thirtyDaysAgo;
                    });
                    seriesList.push({
                      type: 'line',
                      name: metricName,
                      data: filtered,
                      lineWidth: 1.5,
                      marker: {
                        enabled: true,
                        radius: 3
                      }
                    });
                  }); // -----------------------------------------
                  // 3️⃣ Set a dynamic title (optional)
                  // -----------------------------------------

                  var metricList = Object.keys(grouped).join(", ");
                  _this3.chartOptions = {
                    chart: {
                      type: 'line',
                      backgroundColor: '#fff',
                      height: 350
                    },
                    title: {
                      text: "Metrics Trend: ".concat(metricList) // ⬅ Auto title

                    },
                    xAxis: {
                      type: 'datetime',
                      title: {
                        text: 'Date'
                      },
                      labels: {
                        format: '{value:%b %e}',
                        style: {
                          color: '#555'
                        }
                      },
                      lineColor: '#ccc',
                      tickColor: '#ccc',
                      crosshair: true
                    },
                    yAxis: {
                      title: {
                        text: 'Value'
                      },
                      min: 0,
                      gridLineColor: '#e5e7eb'
                    },
                    tooltip: {
                      shared: true,
                      formatter: function formatter() {
                        var date = highcharts__WEBPACK_IMPORTED_MODULE_11__["dateFormat"]('%e %b %Y %H:%M', this.x);
                        var tooltip = "<b>".concat(date, "</b><br/>");
                        this.points.forEach(function (p) {
                          tooltip += "<span style=\"color:".concat(p.color, "\">\u25CF</span> ");
                          tooltip += "".concat(p.series.name, ": <b>").concat(p.y.toFixed(3), "</b><br/>");
                        });
                        return tooltip;
                      }
                    },
                    legend: {
                      align: 'center',
                      verticalAlign: 'bottom',
                      itemStyle: {
                        fontSize: '11px'
                      }
                    },
                    plotOptions: {
                      series: {
                        lineWidth: 1.5
                      }
                    },
                    series: seriesList,
                    credits: {
                      enabled: false
                    },
                    exporting: {
                      enabled: false
                    }
                  };
                }

                console.log(_this3.chartOptions);
                _this3.isActionLoading = false;
              });
            }
            /*console.log(event?.cavEventExt?.row);
            let rowData = event?.cavEventExt?.row;
            let actionParameter = {
              "parentRecoEntryId": rowData.recomId,
              "ruleId": rowData.ruleDBId,
              "cloudResourceId": rowData.id,
              "optimizationStrategy": rowData?.optimizationStrategy?.toLowerCase() == "deleteinstance" ? "StopVm" : rowData.optimizationStrategy,
              "actionParameters": {
                "provider": "AWS",
                "actionType":  rowData?.optimizationStrategy?.toLowerCase() == "deleteinstance" ? "StopVm" : rowData.optimizationStrategy,
              }
            }
            if (rowData?.optimizationStrategy?.toLowerCase() == "migratevolume") {
              let proposed = rowData.propossed.split(",");
              proposed.forEach(ps=>{
                if (ps.includes("recommended_volume_type")) {
                 actionParameter.actionParameters['volumeType'] = ps.split(":")[1].trim()
                }
              })
            }
            else if (rowData?.optimizationStrategy?.toLowerCase() == "migrateinstance" || rowData?.optimizationStrategy?.toLowerCase() == "resizevm") {
              let proposed = rowData.propossed.split(",");
              proposed.forEach(ps=>{
                if (ps.includes("recommendInstanceFamily")) {
                 actionParameter.actionParameters["targetInstanceType"] = actionParameter.actionParameters['volumeType'] = ps.split(":")[1].trim()
                }
              })
            }*/
            //this.executeAction(actionParameter);


            console.log("row data that is :", (_y = event.cavEventExt) === null || _y === void 0 ? void 0 : _y.row); // Get the row object ONCE

            var _row = (_z = event.cavEventExt) === null || _z === void 0 ? void 0 : _z.row; // --- Guard Clause ---
            // If there's no row data, log an error and stop.


            if (!_row) {
              console.error("Row data is missing!");
              return;
            } // --- BRANCH 1: VOLUME ACTIONS ---


            if (this.volumeScale || this.volumeDelete) {
              this.volumeActionHeader.saving = String(_row.costSaving || '--'); // 1. Populate Volume Cost (Common to both volume actions)

              this.volumeCost = this.volumeCost.map(function (cost) {
                if (cost.name === 'Total cost') {
                  return Object.assign(Object.assign({}, cost), {
                    current: String(_row.cmc || '--'),
                    after: String(_row.omc || '--'),
                    saving: String(_row.costSaving || '--')
                  });
                }

                return cost;
              }); // 2. Populate Volume Details (Common to both volume actions)

              this.volumeDetails = this.volumeDetails.map(function (vol) {
                if (vol.name === 'ID') {
                  return Object.assign(Object.assign({}, vol), {
                    value: String(_row.resourceId || '--')
                  });
                }

                if (vol.name === 'Name') {
                  _this3.volumeActionHeader.name = _row.name;
                  return Object.assign(Object.assign({}, vol), {
                    value: String(_row.name || '--')
                  });
                }

                if (vol.name === 'Account') {
                  // FIX: The JSON has "CustomerId", not "account"
                  _this3.volumeActionHeader.account = _row.CustomerId || _row.SubscriptionId;
                  return Object.assign(Object.assign({}, vol), {
                    value: String(_row.CustomerId || _row.SubscriptionId || '--')
                  });
                }

                if (vol.name === 'Region') {
                  return Object.assign(Object.assign({}, vol), {
                    value: String(_row.Region || '--')
                  });
                }

                if (vol.name === 'Virtual machine') {
                  return Object.assign(Object.assign({}, vol), {
                    value: String(_row.VMID || '--')
                  });
                }

                return vol;
              }); // 3. Populate Volume-Specific Resource

              if (this.volumeScale) {
                // --- volumeScale sub-branch ---
                // this.volumeResource = this.volumeScaleResource.map(res => {
                //   switch (res.name) {
                //     case 'storage tier':
                //       // FIX: Using "VolumeType" from JSON
                //       if(row.current_volume_type){
                //         res.current=String(row.current_volume_type || '--');
                //       }
                //       if(row.recommended_volume_type){
                //         res.after=String(row.recommended_volume_type || '--');
                //       }
                //       break;
                //     case 'IOPS,capacity':
                //       // FIX: Accessing JSON key with a trailing space
                //       if(row.recommended_volume_iops){
                //         res.after=String(row.recommended_volume_iops || '--');
                //       }
                //       if(row.current_volume_iops){
                //         res.current=String(row.current_volume_iops || '--');
                //       }
                //       break;
                //     case 'IOPS,P95th utilization':
                //       // FIX: This key ("iops") is NOT in your JSON.
                //       return { ...res, current: String(row.iops || '--') };
                //     case 'disk size,capacity':
                //       if(row.recommended_volume_size){
                //         res.after=String(row.recommended_volume_size||'--');
                //       }
                //       if(row.current_volume_size){
                //         res.current=String(row.current_volume_size||'--');
                //       }
                //       break;
                //     case 'throughput,capacity':
                //       if(row.recommended_volume_thoroughput){
                //         res.after=String(row.recommended_volume_thoroughput || '--');
                //       }
                //       if(row.current_volume_thoroughput){
                //         res.current=String(row.current_volume_thoroughput  || '--');
                //       }
                //     case 'throughput,P95th utilization':
                //       // FIX: Fixed case-sensitivity. 'T' is uppercase.
                //      // return { ...res, current: String(row.Throughput ?? '') };
                //   }
                //   return res;
                // });
                this.volumeActionHeader.to = String(_row.recommended_volume_type || '--');
                this.volumeActionHeader.from = String(_row.current_volume_type || '--');
                this.HandleConfigClick(_row);
                this.volumeResource = this.configDetails;
              } else {
                // --- volumeDelete sub-branch ---
                this.volumeResource = this.volumeDeleteResource.map(function (vol) {
                  var _a;

                  if (vol.name === 'Storage access') {
                    // NOTE: "iops,capacity" is not in your JSON. 
                    // Using "ProvisionedIOPS " as a guess.
                    return Object.assign(Object.assign({}, vol), {
                      value: String((_row['ProvisionedIOPS '] || '--') + ' IOPS')
                    });
                  }

                  if (vol.name === 'Storage amount') {
                    // NOTE: This will be a very large number in bytes, not GB.
                    return Object.assign(Object.assign({}, vol), {
                      value: String(((_a = _row.VolumeSize) !== null && _a !== void 0 ? _a : '--') + ' GB')
                    });
                  }

                  return vol;
                });
              }
            } // --- BRANCH 2: INSTANCE ACTIONS ---
            else {
              // 1. Populate Instance Cost (Common to both instance actions)
              this.instanceCost = this.instanceCost.map(function (res) {
                if (res.name.toLowerCase().includes("on demand rate")) {
                  res.current = '--';
                  res.after = '--';
                  res.saving = '--';
                  if (_row.cmcRatePerUnit) res.current = String(_row.cmcRatePerUnit || '--');
                  if (_row.omcRatePerUnit) res.after = String(_row.omcRatePerUnit || '--');
                  if (_row.cmcRatePerUnit > 0 || _row.omcRatePerUnit > 0) res.saving = String(_row.cmcRatePerUnit - _row.omcRatePerUnit);

                  if (!res.name.toLowerCase().includes("$")) {
                    res.name = res.name + " ($/" + _row.pricingUnit + ")";
                  } else {
                    res.name = res.name.replace(/\$.*/, '$/' + _row.pricingUnit + ')');
                  }
                } else if (res.name.toLowerCase().includes("Discount coverage")) {
                  res.current = '--';
                  res.after = '--';
                  if (_row.discountCurrent) res.current = String(_row.discountCurrent || '--');
                  if (_row.discountAfter) res.after = String(_row.discountAfter || '--');
                } else if (res.name.toLowerCase().includes("on demand cost ($/month)")) {
                  res.current = '--';
                  res.after = '--';
                  res.saving = '--';
                  if (_row.cmc) res.current = String(_row.cmc || '--');
                  if (_row.omc) res.after = String(_row.omc || '--');

                  if (_row.costSaving) {
                    _this3.instanceActionHeader.saving = _row.costSaving || '--';
                    res.saving = String(_row.costSaving || '--');
                  }
                }

                return res;
              }); // 2. Populate Instance Details (Common to both instance actions)

              this.instanceDetails = this.instanceDetails.map(function (res) {
                switch (res.name) {
                  case 'Name':
                    _this3.instanceActionHeader.name = _row.name;
                    return Object.assign(Object.assign({}, res), {
                      value: String(_row.name || '--')
                    });

                  case 'ID':
                    return Object.assign(Object.assign({}, res), {
                      value: String(_row.id || '--')
                    });

                  case 'Account':
                    _this3.instanceActionHeader.account = _row.CustomerId || _row.SubscriptionId || '--';
                    return Object.assign(Object.assign({}, res), {
                      value: String(_row.CustomerId || _row.SubscriptionId || '--')
                    });

                  case 'Region':
                    return Object.assign(Object.assign({}, res), {
                      value: String(_row.Region || '--')
                    });

                  case 'OS Software':
                    return Object.assign(Object.assign({}, res), {
                      value: String(_row.CpuPlatform || _row.OSType || '--')
                    });

                  case 'Uptime':
                    return Object.assign(Object.assign({}, res), {
                      value: String(_row.upTime || '--')
                    });

                  case 'Resource type':
                    return Object.assign(Object.assign({}, res), {
                      value: String(_row.resourceType || '--')
                    });

                  default:
                    return res;
                }
              }); // 3. Populate Instance-Specific Resource

              if (this.instanceScale) {
                // --- instanceScale sub-branch ---
                // this.instanceResource = this.instanceScaleResource.map(res => {
                //   switch (res.name) {
                //     case 'Instance type':
                //       if (row.instanceType) {
                //         this.instanceActionHeader.from = row.instanceType;
                //         res.current = String(row.instanceType  || '--');
                //       }
                //       if (row.recommendInstanceFamily) {
                //         this.instanceActionHeader.to = row.recommendInstanceFamily;
                //         res.after = String(row.recommendInstanceFamily  || '--');
                //       }
                //       break;
                //     case 'vCPU capacity':
                //       if (row.core_cpu) res.current = String(row.core_cpu  || '--');
                //       if (row.recommend_cpu) res.after = String(row.recommend_cpu  || '--');
                //       break;
                //     case 'vCPU,P95th utilization':
                //       if (row.current_cpu_p95) res.current = String(row.current_cpu_p95 || '--');
                //       // Typo in original? You used current_cpu_p95 for 'after'
                //       if (row.recommend_cpu_p95) res.after = String(row.recommend_cpu_p95 || '--');
                //       break;
                //     case 'Virtual memory,capacity':
                //       if (row.core_memory) res.current = String(row.core_memory || '--');
                //       if (row.recommend_memory) res.after = String(row.recommend_memory || '--');
                //       break;
                //     case 'Virtual memory,P95th utilization':
                //       if (row.current_memory_p95) res.current = String(row.current_memory_p95 || '--');
                //       if (row.recommend_memory_p95) res.after = String(row.recommend_memory_p95 || '--');
                //       break;
                //     case 'VM Storage throughput,capacity':
                //       if (row.current_memory_throughput) res.current = String(row.current_memory_throughput || '--');
                //       if (row.recommend_memory_throughput) res.after = String(row.recommend_memory_throughput || '--');
                //       break;
                //   }
                //   return res;
                // });
                if (_row.recommend_PriceType === "Spot") {
                  this.instanceActionHeader.from = String(_row.current_PriceType) || '--';
                  this.instanceActionHeader.to = String(_row.recommend_PriceType) || '--';
                } else {
                  this.instanceActionHeader.from = String(_row.instanceType) || '--';
                  this.instanceActionHeader.to = String(_row.recommendInstanceFamily) || '--';
                }

                this.HandleConfigClick(_row);
                this.instanceResource = this.configDetails;
              } else {
                // --- instanceDelete sub-branch ---
                this.instanceResource = this.instanceDeleteResource.map(function (res) {
                  if (res.name === 'Virtual CPU' && _row.vCPU) {
                    return Object.assign(Object.assign({}, res), {
                      current: String(_row.vCPU || '--')
                    });
                  }

                  if (res.name === 'Virtual memory' && _row.vMemory) {
                    return Object.assign(Object.assign({}, res), {
                      current: String(_row.vMemory || '--')
                    });
                  }

                  return res;
                });
              }
            } // --- FINAL COMMON ACTION ---
            // This is populated for all 4 conditions.


            this.action = this.action.map(function (action) {
              if (action.name === 'State') {
                return Object.assign(Object.assign({}, action), {
                  value: String(_row.State || '--')
                });
              }

              if (action.name === 'Non Disruptive') {
                return Object.assign(Object.assign({}, action), {
                  value: String(_row.nonDistruptive || '--')
                });
              }

              if (action.name === 'Reversible') {
                return Object.assign(Object.assign({}, action), {
                  value: String(_row.reversible || '--')
                });
              }

              return action;
            }); // --- Show the results ---

            console.log("data of action window:", this.volumeDetails, this.instanceDetails);
            me.showAction = true;
          }
        }
      }, {
        key: "rowActionEvent",
        value: function rowActionEvent(action, row) {
          var me = this;
        }
      }, {
        key: "onExcludePools",
        value: function onExcludePools(data) {
          if (window['logLevel'] > 0) console.log(data);
        }
      }, {
        key: "onPin",
        value: function onPin(data) {
          if (window['logLevel'] > 0) console.log(data);
        }
      }, {
        key: "onAws",
        value: function onAws(data, category) {
          this.cardJson.forEach(function (card) {
            if (card.type === data.type) {
              card.showSummary = category;
            }
          });
        }
      }, {
        key: "toKeyValueString",
        value: function toKeyValueString(obj) {
          if (!obj || typeof obj !== 'object') return '';
          return Object.entries(obj).map(function (_ref4) {
            var _ref5 = _slicedToArray(_ref4, 2),
                k = _ref5[0],
                v = _ref5[1];

            // Try to parse to number
            var num = Number(v);

            if (!isNaN(num)) {
              return "".concat(k, ": ").concat(parseFloat(num.toFixed(3)));
            }

            return "".concat(k, ": ").concat(v);
          }).join(', ');
        }
      }, {
        key: "transformCardDataWithSavedData",
        value: function transformCardDataWithSavedData(state) {
          var _this4 = this;

          var cloneJsonData = JSON.parse(JSON.stringify(this.cardJson));
          var savedData = state === null || state === void 0 ? void 0 : state.data;
          savedData.forEach(function (element) {
            var _a, _b, _c, _d, _e, _f, _g;

            var transformedResList = (_a = element === null || element === void 0 ? void 0 : element.resList) === null || _a === void 0 ? void 0 : _a.map(function (item) {
              var _a, _b, _c, _d, _e, _f, _g;

              return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
                id: item.resourceId || item.planName,
                costSaving: parseFloat((_a = item.costSaving) === null || _a === void 0 ? void 0 : _a.toFixed(3)),
                name: item.resourceName || item.planName,
                propossed: _this4.toKeyValueString((_b = item.optConf) === null || _b === void 0 ? void 0 : _b.recommendConfDisplay),
                current: _this4.toKeyValueString((_c = item.optConf) === null || _c === void 0 ? void 0 : _c.currentConfDisplay)
              }, ((_d = item.optConf) === null || _d === void 0 ? void 0 : _d.currentConfDisplay) || {}), ((_e = item.optConf) === null || _e === void 0 ? void 0 : _e.recommendConfDisplay) || {}), item.optConf || {}), ((_g = (_f = item.optConf) === null || _f === void 0 ? void 0 : _f.optConf) === null || _g === void 0 ? void 0 : _g.containerRecommendations) || {}), {
                costImapctType: item.costImapctType,
                pool: item.pool,
                possibleShutdown: item.possibleShutdown || "na",
                actionCategory: item.actionCategory,
                reversible: item.reversible,
                nonDistruptive: item.nonDistruptive,
                //optConf : item.optconf,
                omc: item.omc,
                cmc: item.cmc,
                planDetatils: _this4.toKeyValueString(item.planDetails),
                planName: item.planName,
                planType: item.planType,
                cloudProvider: (item === null || item === void 0 ? void 0 : item.cloudProvider) || "AZURE",
                cmcRatePerUnit: item === null || item === void 0 ? void 0 : item.cmcRatePerUnit,
                omcRatePerUnit: item === null || item === void 0 ? void 0 : item.omcRatePerUnit,
                upTime: item.upTime,
                pricingUnit: item.pricingUnit,
                displayMetrics: item.displayMetrics,
                actionId: item.actionId
              });
            }); // const transformedResList = element?.resList?.map(item => ({ ...item }));

            var idx;
            idx = cloneJsonData === null || cloneJsonData === void 0 ? void 0 : cloneJsonData.findIndex(function (ele) {
              var _a, _b;

              return ((_a = ele === null || ele === void 0 ? void 0 : ele.groupId) === null || _a === void 0 ? void 0 : _a.toLowerCase()) == ((_b = element === null || element === void 0 ? void 0 : element.groupId) === null || _b === void 0 ? void 0 : _b.toLowerCase());
            });

            if (idx >= 0) {
              // Sort by time DESC first (latest first)
              transformedResList === null || transformedResList === void 0 ? void 0 : transformedResList.sort(function (a, b) {
                return new Date(b.timeField).getTime() - new Date(a.timeField).getTime();
              }); // Keep only latest entry per unique name

              transformedResList === null || transformedResList === void 0 ? void 0 : transformedResList.sort(function (a, b) {
                return new Date(b.timeField).getTime() - new Date(a.timeField).getTime();
              });
              var uniqueLatestInstances = Array.from(new Map(transformedResList.map(function (item) {
                var _a;

                return [(_a = item.name) === null || _a === void 0 ? void 0 : _a.toLowerCase(), item];
              })).values()); // Keep only latest entry per unique name

              uniqueLatestInstances === null || uniqueLatestInstances === void 0 ? void 0 : uniqueLatestInstances.sort(function (a, b) {
                return b.costSaving - a.costSaving;
              });
              transformedResList === null || transformedResList === void 0 ? void 0 : transformedResList.sort(function (a, b) {
                return b.costSaving - a.costSaving;
              });
              cloneJsonData[idx].instances = uniqueLatestInstances;
              cloneJsonData[idx].allInstances = transformedResList;
              cloneJsonData[idx].status = element === null || element === void 0 ? void 0 : element.status;
              cloneJsonData[idx].costSaving = _this4.formatToK((element === null || element === void 0 ? void 0 : element.totalSaving) - ((element === null || element === void 0 ? void 0 : element.totalInvestment) ? element === null || element === void 0 ? void 0 : element.totalInvestment : 0));
              cloneJsonData[idx].categories = element === null || element === void 0 ? void 0 : element.catg;
              cloneJsonData[idx].total_instances = element === null || element === void 0 ? void 0 : element.resourceCount;
              cloneJsonData[idx].recomId = (_b = element === null || element === void 0 ? void 0 : element.items[0]) === null || _b === void 0 ? void 0 : _b._id;
              cloneJsonData[idx].ruleDBId = (_c = element === null || element === void 0 ? void 0 : element.items[0]) === null || _c === void 0 ? void 0 : _c.ruleDBId;
              cloneJsonData[idx].optimizationStrategy = element === null || element === void 0 ? void 0 : element.items[0].optimizationStrategy;

              if ((element === null || element === void 0 ? void 0 : element.description) != null && _this4.selectedRuleCatagoryOption != '') {
                cloneJsonData[idx].description = element === null || element === void 0 ? void 0 : element.description;
              } else {
                (_e = (_d = cloneJsonData === null || cloneJsonData === void 0 ? void 0 : cloneJsonData[idx]) === null || _d === void 0 ? void 0 : _d.categories) === null || _e === void 0 ? void 0 : _e.forEach(function (category) {
                  var _a;

                  cloneJsonData[idx].description[category] = (_a = element === null || element === void 0 ? void 0 : element.description) === null || _a === void 0 ? void 0 : _a[category];
                });
              }

              (_g = (_f = cloneJsonData === null || cloneJsonData === void 0 ? void 0 : cloneJsonData[idx]) === null || _f === void 0 ? void 0 : _f.categories) === null || _g === void 0 ? void 0 : _g.forEach(function (element, index) {
                var exists = _this4.applicableServiceOptions.some(function (opt) {
                  return opt.value.toLowerCase() === element.toLowerCase();
                });

                if (!exists) {
                  _this4.applicableServiceOptions.push({
                    label: element,
                    value: element.toLowerCase(),
                    icon: 'amazon-web-services'
                  });
                }
              });
            }
          });
          cloneJsonData.sort(function (a, b) {
            var parseSavings = function parseSavings(val) {
              return parseFloat((val || "0").toString().replace(/,/g, '')) || 0;
            };

            return parseSavings(b.costSaving < 0 ? -b.costSaving : b.costSaving) - parseSavings(a.costSaving < 0 ? -a.costSaving : a.costSaving);
          });
          this.cardJson = cloneJsonData;
          this.filteredResults = JSON.parse(JSON.stringify(this.cardJson));
        }
      }, {
        key: "onServiceChange",
        value: function onServiceChange(event) {
          var selectedService = event.value;

          if (selectedService === 'all') {
            this.filteredResults = JSON.parse(JSON.stringify(this.cardJson));
          } else {
            this.filteredResults = this.cardJson.filter(function (item) {
              return item.categories.includes(selectedService.toUpperCase());
            });
          }
        }
      }, {
        key: "updateData",
        value: function updateData() {
          if (this.cardJson && this.cardJson.length > 0) {// this.data = {
            //   total_instances: this.cardJson[0].total_instances, 
            //   type: this.cardJson[0].type 
            // };
          }
        } // onCategoryChange(event: any): void {
        //   try {
        //     const selectedCategory = event?.value || 'all'; 
        //     switch (selectedCategory) {
        //       case 'all':
        //         this.filteredResults = [...this.cardJson]; 
        //         break;
        //       case 'Non-empty':
        //         this.filteredResults = this.cardJson.filter(
        //           (item: any) => item.instances && item.instances.length > 0
        //         );
        //         break;
        //       default:
        //         this.filteredResults = this.cardJson.filter(
        //           (item: any) => item.status === selectedCategory
        //         );
        //         break;
        //     }
        //   } catch (error) {
        //     console.error('Error in onCategoryChange:', error);
        //   }
        // }

      }, {
        key: "onRuleCategoryChange",
        value: function onRuleCategoryChange(e, selectedCardFormJson) {
          var filterForm = this.formJson.filter(function (form) {
            var _a;

            return form.categoryList.join(',') === e.value && ((_a = selectedCardFormJson === null || selectedCardFormJson === void 0 ? void 0 : selectedCardFormJson[0]) === null || _a === void 0 ? void 0 : _a.groupId) === form.groupId;
          });
          this.matchingElement = '';
          this.initializeFormWithSavedData(filterForm);
        } // loadDataForIframe() {
        //   this.dataForIframe = {
        //     data: {
        //       data_type: dataTypesForIframe.Load_Fav_and_Time,
        //       data_Param: ["DASHBOARD", "AWS_IFrame_weight_test", "/dashboards"],
        //       id: 'WS',
        //       label: 'Whole Test',
        //     }
        //   };
        //   localStorage.setItem('iframeTime', JSON.stringify(this.dataForIframe.data))
        // }

      }, {
        key: "searchCardData",
        value: function searchCardData(searchText) {
          if (!searchText) {
            this.searchResults = _toConsumableArray(this.cardJson);
            return;
          }

          var lowerSearchText = searchText.trim().toLowerCase();
          this.searchResults = this.cardJson.filter(function (card) {
            return card.type.toLowerCase().includes(lowerSearchText) || card.description.toLowerCase().includes(lowerSearchText) || card.categories.some(function (category) {
              return category.toLowerCase().includes(lowerSearchText);
            });
          });
        }
      }, {
        key: "onEdit",
        value: function onEdit(row) {
          alert("Edit action triggered for ".concat(row.type));
        }
      }, {
        key: "onDelete",
        value: function onDelete(row) {
          alert("Delete action triggered for ".concat(row.type));
        }
      }, {
        key: "onCustomAction",
        value: function onCustomAction(row) {
          alert("Custom action triggered for ".concat(row.type));
        } // Sidebar toggle function

      }, {
        key: "openSidebar",
        value: function openSidebar(data) {
          var _this5 = this;

          var _a, _b, _c;

          this.displaySidebar = true; //this.vpaDetails=null;
          //this.chartOptions = null;    // Critical reset
          //this.chartOptionsMem = null; // Critical reset

          this.CardInstanceData = data.allInstances;
          this.scaleData = null;
          this.volumeResource = null;
          this.instanceResource = null;
          this.jsrTitle = data === null || data === void 0 ? void 0 : data.type; // this.instanceData = JSON.parse(JSON.stringify(data?.instances));

          this.instanceData = [];
          var instanceId = [];
          data.instances.forEach(function (ins) {
            instanceId.push(ins.id);
          });
          this.ccRecommendationService.getRecomWithResources(instanceId).subscribe(function (state) {
            var _a;

            if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadingState"]) {
              return;
            }

            if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadedState"]) {
              if (((_a = state === null || state === void 0 ? void 0 : state.data) === null || _a === void 0 ? void 0 : _a.length) > 0) {
                _this5.instanceData = data.instances.map(function (recData) {
                  var _a;

                  var match = (_a = state === null || state === void 0 ? void 0 : state.data) === null || _a === void 0 ? void 0 : _a.find(function (resData) {
                    return resData.resourceId === recData.id;
                  });
                  recData.ruleDBId = data.ruleDBId;
                  recData.recomId = data.recomId; //recData.workload_name = data.name;

                  if (recData.costImapctType === "INVEST") {
                    recData.costSaving = -1 * Math.abs(recData.costSaving);
                  }

                  recData.optimizationStrategy = data.optimizationStrategy;
                  return match ? Object.assign(Object.assign({}, recData), match) : recData;
                });
              } else {
                _this5.instanceData = data.instances.map(function (recData) {
                  recData.ruleDBId = data.ruleDBId;
                  recData.recomId = data.recomId;

                  if (recData.costImapctType === "INVEST") {
                    recData.costSaving = -1 * Math.abs(recData.costSaving);
                  }

                  recData.optimizationStrategy = data.optimizationStrategy;
                  return recData;
                });
              }
            }
          }, function (state) {
            var _a;

            if (window['logLevel'] > 0) console.log("error:::", (_a = state === null || state === void 0 ? void 0 : state.error['error']) === null || _a === void 0 ? void 0 : _a.text);
          });
          this.instanceDescription = data === null || data === void 0 ? void 0 : data.description;
          var strategy = data === null || data === void 0 ? void 0 : data.optimizationStrategy;
          this.vpaRecommendation = false;

          if (strategy === null || strategy === void 0 ? void 0 : strategy.toLowerCase().includes('deletevolume')) {
            this.instanceHeaders = 'cloud_cost_visibility/ccRecommendationVolumeDelete.json';
            this.volumeDelete = true;
            this.volumeScale = false;
            this.instanceScale = false;
            this.instanceDelete = false;
          } else if (strategy === null || strategy === void 0 ? void 0 : strategy.toLowerCase().includes('migratevolume')) {
            this.instanceHeaders = 'cloud_cost_visibility/ccRecommendationVolumeScale.json';
            this.volumeDelete = false;
            this.volumeScale = true;
            this.instanceScale = false;
            this.instanceDelete = false;
          } else if ((strategy === null || strategy === void 0 ? void 0 : strategy.toLowerCase().includes('migrateinstance')) || (strategy === null || strategy === void 0 ? void 0 : strategy.toLowerCase().includes('resizevm'))) {
            this.instanceHeaders = 'cloud_cost_visibility/ccRecommendationVM-instanceScale.json';
            this.volumeDelete = false;
            this.volumeScale = false;
            this.instanceScale = true;
            this.instanceDelete = false;
          } else if (strategy === null || strategy === void 0 ? void 0 : strategy.toLowerCase().includes('deleteinstance')) {
            this.instanceHeaders = 'cloud_cost_visibility/ccRecommendationVM-instanceDelete.json';
            this.volumeDelete = false;
            this.volumeScale = false;
            this.instanceScale = false;
            this.instanceDelete = true;
          } else if (strategy === null || strategy === void 0 ? void 0 : strategy.toLowerCase().includes('risp')) {
            this.instanceHeaders = 'cloud_cost_visibility/ccRecommendationRISPPlan.json';
            this.volumeDelete = false;
            this.volumeScale = false;
            this.instanceScale = false;
            this.instanceDelete = false;
          } else if (strategy === null || strategy === void 0 ? void 0 : strategy.toLowerCase().includes('workloadoptimization')) {
            this.instanceHeaders = 'cloud_cost_visibility/ccRecommendationVPA.json';
            this.volumeDelete = false;
            this.volumeScale = false;
            this.instanceScale = false;
            this.instanceDelete = false;
            this.vpaRecommendation = true;
          } else {
            this.volumeDelete = false;
            this.volumeScale = false;
            this.instanceScale = false;
            this.instanceDelete = false;

            if ((data === null || data === void 0 ? void 0 : data.groupId) === "Underutilized Instances") {
              this.instanceHeaders = 'cloud_cost_visibility/ccRecommendationPropossed.json';
            } else if ((data === null || data === void 0 ? void 0 : data.groupId) === "Abandoned images" || (data === null || data === void 0 ? void 0 : data.groupId) === "Inactive IAM users" || (data === null || data === void 0 ? void 0 : data.groupId) === "IAM users with unused console access") {
              this.instanceHeaders = 'cloud_cost_visibility/ccRecommendationLastUses.json';
            } else if ((data === null || data === void 0 ? void 0 : data.groupId) === "Instances for shutdown") {
              this.instanceHeaders = 'cloud_cost_visibility/ccRecommendationPossibleShutdown.json';
            } else if ((data === null || data === void 0 ? void 0 : data.groupId) === "Abandoned Instances") {
              this.instanceHeaders = 'cloud_cost_visibility/ccRecommendationPool.json';
            } else if ((data === null || data === void 0 ? void 0 : data.groupId) === "Reserved Instances opportunities") {
              this.instanceHeaders = 'cloud_cost_visibility/ccRecommendationSize.json';
            } else if ((data === null || data === void 0 ? void 0 : data.groupId) === "Instances with Subscription opportunities") {
              this.instanceHeaders = 'cloud_cost_visibility/ccRecommendationSubscription.json';
            } else {
              this.instanceHeaders = 'cloud_cost_visibility/ccRecommendationTable.json';
            }
          }

          this.HandleConfigClick((_a = data === null || data === void 0 ? void 0 : data.instances) === null || _a === void 0 ? void 0 : _a[0]);
          var nameRow = {
            name: 'Resource Name',
            current: (_b = data === null || data === void 0 ? void 0 : data.instances) === null || _b === void 0 ? void 0 : _b[0].name,
            after: (_c = data === null || data === void 0 ? void 0 : data.instances) === null || _c === void 0 ? void 0 : _c[0].name // This is the 'after' value

          };
          this.scaleData = [nameRow].concat(_toConsumableArray(this.configDetails));
        }
      }, {
        key: "executeAction",
        value: function executeAction(actionParam) {
          var _this6 = this;

          this.ccRecommendationService.registerActionForRecommendation(actionParam).subscribe(function (state) {
            var _a;

            if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadedState"]) {
              _this6.cavMessageService.add({
                severity: 'success',
                summary: "Success",
                detail: (_a = state.data) === null || _a === void 0 ? void 0 : _a.message,
                sticky: false
              });
            }
          });
        }
      }, {
        key: "onSettings",
        value: function onSettings(selectedCard) {
          var _a, _b, _c, _d; // let temp = [];
          // this.ruleCategory = [];


          this.selectedCardGroupElements = this.formJson.filter(function (form) {
            return form.groupId === selectedCard.groupId;
          });
          this.dialogTitle = selectedCard === null || selectedCard === void 0 ? void 0 : selectedCard.type;
          var filterItem = (_a = this.groupedCategoryOptions) === null || _a === void 0 ? void 0 : _a.filter(function (item) {
            return item.label === selectedCard.groupId;
          });
          this.ruleCategory = (_b = filterItem === null || filterItem === void 0 ? void 0 : filterItem[0]) === null || _b === void 0 ? void 0 : _b.value.map(function (item) {
            return {
              label: item,
              value: item
            };
          });
          if (this.activeCloudFilter === "all") this.selectedRuleCatagoryOption = this.ruleCategory[0].value;else this.selectedRuleCatagoryOption = this.activeCloudFilter; //this.selectedRuleCatagoryOption = this.ruleCategory[0].value;

          this.showDialog = !this.showDialog;
          this.ccRecommendationService.jsrRuleCondition[0].ruleConditonsList = [];
          this.currentSelectedCard = selectedCard; //let matchingForm = [this.formJson?.find(formItem => formItem.groupId.includes(selectedCard.type) && (formItem.categoryList?.join(',').toUpperCase()).contains(this.selectedRuleCatagoryOption).toUpperCase())];
          //console.log("this is new form ",matchingForm);

          var selectedCategory = (_c = this.selectedRuleCatagoryOption) === null || _c === void 0 ? void 0 : _c.toUpperCase();
          var selectedType = (_d = selectedCard === null || selectedCard === void 0 ? void 0 : selectedCard.groupId) === null || _d === void 0 ? void 0 : _d.toUpperCase();
          var filterForms = this.formJson.filter(function (form) {
            var _a, _b, _c;

            return ((_b = (_a = form.groupId) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === null || _b === void 0 ? void 0 : _b.includes(selectedType)) && ((_c = form.categoryList) === null || _c === void 0 ? void 0 : _c.join(',').toUpperCase()).includes(selectedCategory);
          }); //form.categoryList?.map(x => x.toUpperCase()).includes(selectedCategory)

          if (this.showDialog == true) {
            this.matchingElement = '';
            this.initializeFormWithSavedData(filterForms);
          } // const selectedType = selectedCard?.type;
          // const selectedCategory = this.selectedRuleCatagoryOption;
          // const filterForms = this.formJson.filter(form =>
          //     form.groupId === selectedCard.groupId &&
          //     form.categoryList?.join(',') === selectedCategory &&
          //     form.formName?.includes(selectedType)
          // );
          // if (this.showDialog == true) {
          //   this.matchingElement = '';
          // this.initializeFormWithSavedData(filterForms);
          // }

        }
      }, {
        key: "initializeFormWithSavedData",
        value: function initializeFormWithSavedData(matchingForm) {
          var _this7 = this;

          var _a;

          this.ccRecommendationService.getFormDetails1((_a = matchingForm === null || matchingForm === void 0 ? void 0 : matchingForm[0]) === null || _a === void 0 ? void 0 : _a.key).subscribe(function (state) {
            var _a, _b, _c, _d;

            if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadingState"]) {
              return;
            }

            if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadedState"]) {
              if (Array.isArray(state === null || state === void 0 ? void 0 : state.data) && state.data.length > 0) {
                _this7.matchingElement = (_a = state === null || state === void 0 ? void 0 : state.data) === null || _a === void 0 ? void 0 : _a[0];
                var json = (_c = (_b = state === null || state === void 0 ? void 0 : state.data) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c[(_d = matchingForm === null || matchingForm === void 0 ? void 0 : matchingForm[0]) === null || _d === void 0 ? void 0 : _d.key];
                var clonedJsonVal = JSON.parse(JSON.stringify(matchingForm));

                var _iterator = _createForOfIteratorHelper(clonedJsonVal),
                    _step;

                try {
                  for (_iterator.s(); !(_step = _iterator.n()).done;) {
                    var k = _step.value;

                    var updatedFields = _this7.applySavedValuesToFields(k.fields, json);

                    k.fields = updatedFields; // Replace the fields in the cloned JSON
                  } // Replace jsonVal with the updated clone

                } catch (err) {
                  _iterator.e(err);
                } finally {
                  _iterator.f();
                }

                _this7.jsonSend = clonedJsonVal;
              } else {
                _this7.jsonSend = JSON.parse(JSON.stringify(matchingForm));
              }

              _this7.loadForm = true; // this.dialogTitle = this.jsonSend[0].description?.[this.selectedRuleCatagoryOption];
            }
          });
        }
      }, {
        key: "applySavedValuesToFields",
        value: function applySavedValuesToFields(fields, json) {
          var _iterator2 = _createForOfIteratorHelper(fields),
              _step2;

          try {
            for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
              var field = _step2.value;

              if (field.hasOwnProperty('fields')) {
                // Recursively process child fields
                var subJson = json[field.key] || {}; // Navigate into the JSON if the key exists

                this.applySavedValuesToFields(field.fields, subJson);
              } else {
                // Check if the key exists in JSON
                if (json.hasOwnProperty(field.key)) {
                  field.value = json[field.key]; // Assign the value from JSON
                }
              }
            }
          } catch (err) {
            _iterator2.e(err);
          } finally {
            _iterator2.f();
          }

          return fields;
        }
      }, {
        key: "findMatchingElement",
        value: function findMatchingElement(arr, key) {
          return arr.find(function (element) {
            if ((element === null || element === void 0 ? void 0 : element.rulename) == key) {
              return true;
            }
          });
        }
      }, {
        key: "getResult",
        value: function getResult(formData) {
          var _a;

          return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee() {
            var _this8 = this;

            var id, transformedRuleTemplateJson, _t2;

            return _regenerator().w(function (_context) {
              while (1) switch (_context.p = _context.n) {
                case 0:
                  // Get rule ID if a matching element exists
                  id = this.matchingElement != '' ? (_a = this.matchingElement) === null || _a === void 0 ? void 0 : _a._id['$oid'] : ''; // this.ccRecommendationService.registerActionForRecommendation();
                  // Save form details

                  this.ccRecommendationService.saveFormDetails(formData, id).subscribe(function (state) {
                    if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadingState"]) return;

                    if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadedState"]) {// Form saved successfully
                    }
                  }); // Create JSR config

                  this.createJSRConfig();
                  _context.p = 1;
                  _context.n = 2;
                  return this.saveFormDataInRuleTemplate(formData);

                case 2:
                  transformedRuleTemplateJson = _context.v;
                  // Get existing JSR rule based on title
                  this.ccRecommendationService.getJsrRule(this.jsrTitle).subscribe(function (state) {
                    var _a, _b;

                    if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadingState"]) return;

                    if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadedState"]) {
                      var _id = ''; // Check if the rule already exists

                      var existingRule = (_a = state === null || state === void 0 ? void 0 : state.data) === null || _a === void 0 ? void 0 : _a.find(function (item) {
                        var _a;

                        return (item === null || item === void 0 ? void 0 : item.rsName) === ((_a = transformedRuleTemplateJson === null || transformedRuleTemplateJson === void 0 ? void 0 : transformedRuleTemplateJson.rule_set) === null || _a === void 0 ? void 0 : _a.rsName);
                      });

                      if (existingRule) {
                        _id = ((_b = existingRule === null || existingRule === void 0 ? void 0 : existingRule._id) === null || _b === void 0 ? void 0 : _b.$oid) || '';
                      } else {
                        console.log("No matching rule found, creating a new rule.");
                      } // Add description to the rule before saving
                      // const ruleToUpdate = transformedRuleTemplateJson?.rule_set?.rules[0];
                      // Object.assign(ruleToUpdate, {description:this.currentSelectedCard?.description });
                      // Save the rule set


                      _this8.ccRecommendationService.saveJsrRule(transformedRuleTemplateJson === null || transformedRuleTemplateJson === void 0 ? void 0 : transformedRuleTemplateJson.rule_set, _id).subscribe(function (state) {
                        if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadingState"]) {
                          _this8.currentSelectedCard.isSettingSaved = true;
                          return;
                        }

                        if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadedState"]) {
                          // On success, fetch saved recommendations
                          var providerFilter = _this8.activeCloudFilter.toUpperCase();

                          _this8.ccRecommendationService.getSavedRecommendation(_this8.selectedDataSource).subscribe(function (state) {
                            if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadingState"]) return;

                            if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadedState"]) {
                              _this8.currentSelectedCard.isSettingSaved = false; // Update local card JSON with latest description

                              _this8.cardJson.forEach(function (element) {
                                var _a, _b;

                                if ((element === null || element === void 0 ? void 0 : element.type) == ((_a = _this8.currentSelectedCard) === null || _a === void 0 ? void 0 : _a.type)) {
                                  element.description = (_b = _this8.currentSelectedCard) === null || _b === void 0 ? void 0 : _b.description;
                                }
                              }); // Transform and update card data


                              _this8.transformCardDataWithSavedData(state);
                            }
                          });
                        }
                      });
                    }
                  });
                  _context.n = 4;
                  break;

                case 3:
                  _context.p = 3;
                  _t2 = _context.v;
                  console.error('Error in saveFormDataInRuleTemplate:', _t2);

                case 4:
                  return _context.a(2);
              }
            }, _callee, this, [[1, 3]]);
          }));
        }
      }, {
        key: "createSchedulerJsonString",
        value: function createSchedulerJsonString(res) {
          // --- 1. Small Helpers ---
          var getEpoch = function getEpoch(d) {
            if (!d) return null;

            try {
              var date = new Date(d);
              return isNaN(date.getTime()) ? null : date.getTime();
            } catch (e) {
              return null;
            }
          };

          var getMs = function getMs(d) {
            if (!d) return 0;

            try {
              var date = new Date(d);
              return date.getHours() * 3600000 + date.getMinutes() * 60000 + date.getSeconds() * 1000;
            } catch (e) {
              return 0;
            }
          };

          var getRepType = function getRepType(u) {
            var val = ((u === null || u === void 0 ? void 0 : u.value) || u || '').toLowerCase();
            if (val.includes('minute')) return 1;
            if (val.includes('hour')) return 2;
            if (val.includes('day')) return 3;
            if (val.includes('week')) return 4;
            if (val.includes('month')) return 5;
            if (val.includes('year')) return 6;
            return 3;
          };

          var getEnd = function getEnd(c) {
            var val = (c === null || c === void 0 ? void 0 : c.value) || c;
            if (val === 'After') return 3;
            if (val === 'On') return 2;
            return 1;
          }; // --- 2. Logic (Using 'res' only) ---
          // We strictly use 'res' because you fixed the DynamicForm to include these fields.


          var repeatIntervalVal = res.repeatInterval;
          var isRecurring = repeatIntervalVal && parseInt(repeatIntervalVal) > 0;
          var startDate = isRecurring ? res.recStartDate : res.oneTimeDate;
          var startTime = isRecurring ? res.recStartTime : res.oneTimeTime;
          var repUnit = isRecurring ? res.repeatUnit : null;
          var endCond = res.endCondition;
          var endDt = res.endDate;
          var occur = res.occurrences; // 1. Build the inner schedule object with defaults for a "One Time" schedule

          var scheduleObj = {
            "stDate": getEpoch(startDate),
            "stTime": getMs(startTime),
            "duration": 0,
            "durationType": 0,
            "zone": "(UTC+0530), Asia/Kolkata",
            "repetition": null,
            "repetitionType": null,
            "week": null,
            "monthBasedOn": null,
            "monthDateType": null,
            "weekDay": null,
            "endType": null,
            "endDate": null,
            "color": "#1C5391",
            "afterRepetition": null
          }; // 2. If it is recurring, override the nulls with actual values

          if (isRecurring) {
            scheduleObj.repetition = parseInt(repeatIntervalVal);
            scheduleObj.repetitionType = getRepType(repUnit);
            scheduleObj.endType = getEnd(endCond);
            scheduleObj.endDate = getEpoch(endDt);

            if (getEnd(endCond) === 3) {
              // 3 = AFTER
              scheduleObj.occurrences = occur || 0;
            }
          } // 3. Wrap it in the outer object with the Cloud Cost task properties


          var fullSchedulerJson = {
            "scheduleType": isRecurring ? 2 : 1,
            "schedule": [scheduleObj],
            "enable": true,
            "taskType": "CloudCostTask" // Added missing property

          };
          return JSON.stringify(fullSchedulerJson);
        }
      }, {
        key: "saveFormDataInRuleTemplate",
        value: function saveFormDataInRuleTemplate(res) {
          var _this9 = this;

          return new Promise(function (resolve, reject) {
            var matchingRuleTemplate;
            var formNameFromSelectedGroup;

            if (_this9.selectedRuleCatagoryOption != '') {
              formNameFromSelectedGroup = _this9.selectedCardGroupElements.find(function (ele) {
                return ele.categoryList.includes(_this9.selectedRuleCatagoryOption);
              }).formName;
            } else {
              formNameFromSelectedGroup = _this9.selectedCardGroupElements[0].formName;
            }

            _this9.jsrTitle = formNameFromSelectedGroup;

            _this9.ccRecommendationService.getRuleTemplate(formNameFromSelectedGroup).subscribe(function (state) {
              var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;

              if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadingState"]) {
                return;
              }

              if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadedState"]) {
                if (((_a = state === null || state === void 0 ? void 0 : state.data) === null || _a === void 0 ? void 0 : _a.length) > 0) {
                  matchingRuleTemplate = (_b = state === null || state === void 0 ? void 0 : state.data) === null || _b === void 0 ? void 0 : _b[0];
                }

                if (matchingRuleTemplate) {
                  var cloneRuleTemplate = JSON.parse(JSON.stringify(matchingRuleTemplate));
                  var ruleOptionValue = '';
                  var matchedRule = '';

                  if (((_c = cloneRuleTemplate === null || cloneRuleTemplate === void 0 ? void 0 : cloneRuleTemplate.rule_set) === null || _c === void 0 ? void 0 : _c.rules.length) > 1) {
                    var option = _this9.findRuleOption(res);

                    (_e = (_d = cloneRuleTemplate === null || cloneRuleTemplate === void 0 ? void 0 : cloneRuleTemplate.rule_set) === null || _d === void 0 ? void 0 : _d.rules) === null || _e === void 0 ? void 0 : _e.forEach(function (rule, i) {
                      if ((rule === null || rule === void 0 ? void 0 : rule.ruleOption.toLowerCase()) == option.toLowerCase()) {
                        matchedRule = rule;
                        return;
                      }
                    });

                    if (Object.keys(matchedRule).length != 0) {
                      cloneRuleTemplate.rule_set.rules = [];
                      cloneRuleTemplate.rule_set.rules.push(matchedRule);
                    }
                  }

                  ruleOptionValue = matchedRule != '' ? matchedRule === null || matchedRule === void 0 ? void 0 : matchedRule.ruleOption.toLowerCase() : '';
                  var index = -1;
                  _this9.descriptionTemplate = (_h = (_g = (_f = cloneRuleTemplate === null || cloneRuleTemplate === void 0 ? void 0 : cloneRuleTemplate.rule_set) === null || _f === void 0 ? void 0 : _f.rules) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.description;
                  (_o = (_m = (_l = (_k = (_j = cloneRuleTemplate === null || cloneRuleTemplate === void 0 ? void 0 : cloneRuleTemplate.rule_set) === null || _j === void 0 ? void 0 : _j.rules) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.ruleConditions) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.ruleConditionsList.forEach(function (condition, i) {
                    var _a, _b; // let isDaysFieldPresent = "false";


                    if ((_b = (_a = condition === null || condition === void 0 ? void 0 : condition.rhsOperand) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.includes('$ruleoption')) {
                      index = i;
                    }

                    var orderedKeys = ['period', 'lhsOperand', 'rhsOperand', 'condName', 'fieldType', 'operator'];

                    for (var _i = 0, _orderedKeys = orderedKeys; _i < _orderedKeys.length; _i++) {
                      var key = _orderedKeys[_i];
                      if (!(key in condition)) continue;

                      if (typeof condition[key] === 'string' && condition[key].startsWith('$JsonPath')) {
                        condition[key] = _this9.findValue(condition[key], res, ruleOptionValue, "false", '');
                      } else if (typeof condition[key] === 'object' && condition[key] !== null) {
                        for (var nestedKey in condition[key]) {
                          if (condition[key][nestedKey] === 'LastSeen') {
                            _this9.isDaysFieldPresent = true;
                          }

                          if (nestedKey !== 'cloudProvider' && typeof condition[key][nestedKey] === 'string' && condition[key][nestedKey].startsWith('$JsonPath')) {
                            condition[key][nestedKey] = _this9.findValue(condition[key][nestedKey], res, ruleOptionValue, _this9.isDaysFieldPresent, key).toString();
                          }
                        }
                      }
                    }
                  }); // const scheduleString = this.createSchedulerJsonString(res);

                  var actionModeValue = _this9.getActionModeValue(res);

                  (_r = (_q = (_p = cloneRuleTemplate === null || cloneRuleTemplate === void 0 ? void 0 : cloneRuleTemplate.rule_set) === null || _p === void 0 ? void 0 : _p.rules) === null || _q === void 0 ? void 0 : _q[0]) === null || _r === void 0 ? void 0 : _r.actions.forEach(function (condition, i) {
                    if (condition.atype === 'EXECUTEACTION') {
                      if (!condition.kvlist) condition.kvlist = []; // Remove existing schedule key to avoid duplicates

                      condition.kvlist = condition.kvlist.filter(function (k) {
                        return k.key !== 'scheduleTaskTime' && k.key !== 'actionMode';
                      });

                      if (res.executeNow) {
                        condition.kvlist.push({
                          key: 'actionMode',
                          value: 'execute'
                        });
                      } else if (actionModeValue == 'Approve') condition.kvlist.push({
                        key: 'actionMode',
                        value: 'approval'
                      });else if (actionModeValue == 'Automate') {
                        condition.kvlist.push({
                          key: 'actionMode',
                          value: 'scheduled'
                        });
                        var isRecurring = res.repeatInterval && parseInt(res.repeatInterval) > 0;
                        var hasDateProvided = isRecurring ? res.recStartDate : res.oneTimeDate; // Only generate and push the schedule string if a date exists

                        if (hasDateProvided) {
                          var scheduleString = _this9.createSchedulerJsonString(res);

                          condition.kvlist.push({
                            key: 'scheduleTaskTime',
                            value: scheduleString
                          });
                        }
                      } else {
                        condition.kvlist.push({
                          key: 'actionMode',
                          value: 'recomended'
                        });
                      }
                    }

                    var key = 'atype';

                    if (key in condition) {
                      if (typeof condition[key] === 'string' && condition[key].startsWith('$JsonPath')) {
                        condition[key] = _this9.findValue(condition[key], res, ruleOptionValue, "false", '');
                      } else if (typeof condition[key] === 'object' && condition[key] !== null) {
                        for (var nestedKey in condition[key]) {
                          if (condition[key][nestedKey] === 'LastSeen') {
                            _this9.isDaysFieldPresent = true;
                          }

                          if (nestedKey !== 'cloudProvider' && typeof condition[key][nestedKey] === 'string' && condition[key][nestedKey].startsWith('$JsonPath')) {
                            condition[key][nestedKey] = _this9.findValue(condition[key][nestedKey], res, ruleOptionValue, _this9.isDaysFieldPresent, key).toString();
                          }
                        }
                      }
                    }
                  });
                  var ruleParams = (_u = (_t = (_s = cloneRuleTemplate === null || cloneRuleTemplate === void 0 ? void 0 : cloneRuleTemplate.rule_set) === null || _s === void 0 ? void 0 : _s.rules) === null || _t === void 0 ? void 0 : _t[0]) === null || _u === void 0 ? void 0 : _u.ruleParameters;

                  if (ruleParams && typeof ruleParams === 'object' && !Array.isArray(ruleParams)) {
                    // Loop over each key in the ruleParameters object (e.g., "minSavingThreshold")
                    for (var key in ruleParams) {
                      if (Object.prototype.hasOwnProperty.call(ruleParams, key)) {
                        var value = ruleParams[key]; // Check if the value is a string that needs replacement

                        if (typeof value === 'string' && value.startsWith('$JsonPath')) {
                          // Use your existing findValue function to get the real value from the form
                          ruleParams[key] = _this9.findValue(value, res, ruleOptionValue, "false", // isDaysFieldPresent
                          key // ruleConditionKey (passing the param key, e.g., "minSavingThreshold")
                          );
                        }
                      }
                    }
                  }

                  if (index !== -1) {
                    (_z = (_y = (_x = (_w = (_v = cloneRuleTemplate === null || cloneRuleTemplate === void 0 ? void 0 : cloneRuleTemplate.rule_set) === null || _v === void 0 ? void 0 : _v.rules) === null || _w === void 0 ? void 0 : _w[0]) === null || _x === void 0 ? void 0 : _x.ruleConditions) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.ruleConditionsList.splice(index, 1);
                  }

                  if (!((_1 = (_0 = _this9.descriptionTemplate) === null || _0 === void 0 ? void 0 : _0[Object.keys(_this9.descriptionTemplate)[0]]) === null || _1 === void 0 ? void 0 : _1.includes('$'))) {
                    cloneRuleTemplate.rule_set.rules[0].description = _this9.descriptionTemplate;
                  }

                  resolve(cloneRuleTemplate); // Resolve the cloned JSON
                } else {
                  reject('No matching rule template found');
                }
              }
            }, function (error) {
              return reject(error);
            });
          });
        }
      }, {
        key: "findRuleOption",
        value: function findRuleOption(res) {
          for (var key in res) {
            if (key.startsWith('ruleoption:')) {
              return res[key];
            }

            if (typeof res[key] === 'object' && res[key] !== null) {
              var result = this.findRuleOption(res[key]);

              if (result !== undefined) {
                return result;
              }
            }
          }

          return undefined;
        }
      }, {
        key: "findValue",
        value: function findValue(path, res, ruleOptionValue, isDaysFieldPresent, ruleConditionKey) {
          var _this0 = this;

          var _a, _b, _c, _d, _e, _f, _g;

          var temp = path.replace(/\$JsonPath:/, '').split('.').join('').split('$');
          var obj = res;
          if (window['logLevel'] > 0) console.log("path:::", path, "res:::", res, "ruleOptionValue::", ruleOptionValue, "isDaysFieldPresent", isDaysFieldPresent);

          var _loop = function _loop(i) {
            var key = Object.keys(obj).find(function (ele) {
              if (ele.includes(temp[i] + ':')) {
                return true;
              } else if (ele.includes(temp[i])) {
                return true;
              }
            });

            if (i != temp.length - 1) {
              obj = obj[key];
            } else {
              if ((_b = (_a = _this0.descriptionTemplate) === null || _a === void 0 ? void 0 : _a[Object.keys(_this0.descriptionTemplate)[0]]) === null || _b === void 0 ? void 0 : _b.includes('#')) {
                _this0.descriptionTemplate[Object.keys(_this0.descriptionTemplate)[0]] = _this0.descriptionTemplate[Object.keys(_this0.descriptionTemplate)[0]].replace(/#/g, ":".concat(ruleOptionValue));
              }

              if (ruleConditionKey == 'rhsOperand') {
                var a = (_c = _this0.descriptionTemplate) === null || _c === void 0 ? void 0 : _c[Object.keys(_this0.descriptionTemplate)[0]];
                var idx = a.indexOf(path);
                _this0.descriptionTemplate[Object.keys(_this0.descriptionTemplate)[0]] = ((_e = (_d = _this0.descriptionTemplate) === null || _d === void 0 ? void 0 : _d[Object.keys(_this0.descriptionTemplate)[0]]) === null || _e === void 0 ? void 0 : _e.substring(0, idx)) + obj[key] + ((_g = (_f = _this0.descriptionTemplate) === null || _f === void 0 ? void 0 : _f[Object.keys(_this0.descriptionTemplate)[0]]) === null || _g === void 0 ? void 0 : _g.substring(idx + path.length));
              }

              if (isDaysFieldPresent === true) {
                obj[key] = obj[key] * 24 * 60 * 60;
                _this0.isDaysFieldPresent = false;
              }

              return {
                v: obj[key]
              };
            }
          },
              _ret;

          for (var i = 1; i < temp.length; i++) {
            _ret = _loop(i);
            if (_ret) return _ret.v;
          }

          return -1;
        }
      }, {
        key: "createJSRConfig",
        value: function createJSRConfig() {
          this.jsrRuleSet['rsName'] = this.jsrTitle;
          this.jsrRuleSet['rules'] = this.setRules();
        }
      }, {
        key: "setRules",
        value: function setRules() {
          var rulesList = [];
          var rules = {
            ruleName: this.jsrTitle,
            ruleOption: 'default',
            priority: 1,
            ruleSchedule: {
              periodicity: "",
              units: 'days',
              alignTime: '02:00'
            },
            declarations: [{
              factVar: "$resource",
              factType: "LOGICAL",
              factParam: "VMInstance"
            }],
            ruleConditions: this.ccRecommendationService.jsrRuleCondition
          };
          rulesList.push(rules);
          return rulesList;
        }
      }, {
        key: "handleExecuteAction",
        value: function handleExecuteAction() {
          var rowData = this.currentRowForAction;

          if (!rowData.actionId) {
            console.error("No row data available for action.");
            this.cavMessageService.add({
              severity: 'error',
              summary: "Error",
              detail: "No action data found. Please try again."
            });
            return;
          } // Build the action parameter (this logic is from your commented-out code in clickButtonEvent)


          var actionId = rowData.actionId; // Call your existing executeAction method

          this.executeAction(actionId); // Hide the sidebar and clear the data

          this.showAction = false;
          this.currentRowForAction = null;
        }
      }, {
        key: "formatDisplayName",
        value: function formatDisplayName(baseName) {
          // Dynamically format:
          // 'InstanceFamily' -> 'Instance Family' (Handles camelCase)
          // 'volume_iops' -> 'Volume iops' (Handles underscore)
          // 'cpu' -> 'Cpu'
          return baseName.replace(/_/g, ' ') // Replace underscores with spaces
          .replace(/([a-z0-9])([A-Z])/g, '$1 $2') // Add space before caps
          .replace(/^./, function (s) {
            return s.toUpperCase();
          }); // Capitalize first letter
        }
        /**
         * Helper function to format the final value, e.g., adding '$' or '%'.
         */

      }, {
        key: "formatDisplayValue",
        value: function formatDisplayValue(key, value) {
          // Handle "null" strings
          if (value === 'null') {
            return '--';
          }

          var strValue = String(value !== null && value !== void 0 ? value : '');

          if (strValue === '') {
            return '--';
          }

          var lowerKey = key.toLowerCase(); // Add $ for cost/price fields

          if ((lowerKey.includes('cost') || lowerKey.includes('price')) && !lowerKey.includes('type')) {
            return '$' + strValue;
          } // Add % for percentage fields
          // if (lowerKey.includes('percentage')) {
          //   return strValue + ' %';
          // }


          return strValue;
        }
      }, {
        key: "HandleVpaConfigClick",
        value: function HandleVpaConfigClick(event) {
          var _this1 = this;

          if (!event) return;
          var currentConf = event.currentConfDisplay || {};
          var recommendConf = event.recommendConfDisplay || {}; // Get a unique list of all keys from both objects

          var allKeys = Array.from(new Set([].concat(_toConsumableArray(Object.keys(currentConf)), _toConsumableArray(Object.keys(recommendConf)))));
          this.configDetails = allKeys.map(function (key) {
            return {
              name: _this1.formatDisplayName(key),
              // Fallback to '--' if the key doesn't exist in one of the objects
              current: _this1.formatDisplayValue(key, currentConf[key]) || '--',
              after: _this1.formatDisplayValue(key, recommendConf[key]) || '--'
            };
          });
        }
        /**
         * Handles the config click event based on the new data structure.
         * This is fully dynamic and matches keys by their 'base name'.
         */

      }, {
        key: "HandleConfigClick",
        value: function HandleConfigClick(event) {
          // --- Guard Clause ---
          if (!event) {
            console.error("Configuration data is missing!");
            return;
          } // Default to empty objects to prevent errors if one is null/undefined


          var currentConf = event.currentConfDisplay || {};
          var recommendConf = event.recommendConfDisplay || {}; // Use a Map to store the combined data.

          var processedData = new Map(); // --- 1. Process all CURRENT properties ---

          for (var key in currentConf) {
            if (Object.prototype.hasOwnProperty.call(currentConf, key)) {
              // --- UPDATED LINE 1 ---
              // Checks for 'current_', 'core_', AND 'current' (camelCase)
              var isCurrentKey = key.startsWith('current_') || key.startsWith('core_') || key.startsWith('current');
              var isSharedIdentifier = !isCurrentKey; // --- UPDATED LINE 2 ---
              // Removes 'current_', 'core_', OR 'current' from the start

              var baseName = key.replace(/^(current_|core_|current)/, '');
              var displayName = this.formatDisplayName(baseName);
              var value = this.formatDisplayValue(key, currentConf[key]);
              var afterValue = isSharedIdentifier ? value : '--'; // processedData.set(baseName, {
              //   name: displayName,
              //   current: value,
              //   after: afterValue
              // });
            }
          } // --- 2. Process all RECOMMENDED properties ---


          for (var _key in recommendConf) {
            if (Object.prototype.hasOwnProperty.call(recommendConf, _key)) {
              // --- UPDATED LINE 3 ---
              // Removes 'recommend_', 'recommended_', OR 'recommend'
              var _baseName = _key.replace(/^(recommend_|recommended_|recommend)/, '');

              var _value = this.formatDisplayValue(_key, recommendConf[_key]); // Check if this property already exists from the 'current' pass


              if (processedData.has(_baseName)) {
                // It exists, just update the 'after' value
                var entry = processedData.get(_baseName);
                entry.after = _value;
              } else {// It's a new property (e.g., 'performance_impact')
                // Add it with an empty 'current' value
                // processedData.set(baseName, {
                //   name: this.formatDisplayName(baseName),
                //   current: '--',
                //   after: value
                // });
              }
            }
          } // const resourceName = event.name || '--';
          // const nameRow = {
          //   name: 'Resource Name', // This is the label for the row
          //   current: resourceName,  // This is the 'current' value
          //   after: resourceName     // This is the 'after' value
          // };
          // --- 3. Convert the Map's values into the final array ---
          //this.scaleData = Array.from(processedData.values());


          var otherDataRows = Array.from(processedData.values());
          this.configDetails = otherDataRows; //this.scaleData = [nameRow, ...otherDataRows];
        }
      }, {
        key: "onActiveTabChange",
        value: function onActiveTabChange(event) {
          var _this10 = this;

          this.resetState();

          if (this.visualTable) {
            this.currentViewMode = this.visualTable.selectedlayout;
          }

          this.activeCloudFilter = event.value;
          this.cardJson = [];
          var cardJsonPath = src_environments_environment__WEBPACK_IMPORTED_MODULE_10__["environment"].api.cloudCostCardJson.read.endpoint;
          this.getCardFormJson(cardJsonPath, function (cardData) {
            var _a;

            _this10.cardJson = cardData;
            (_a = _this10.cardJson) === null || _a === void 0 ? void 0 : _a.forEach(function (element) {
              var _a;

              var filterEle = (_a = _this10.groupedCategoryOptions) === null || _a === void 0 ? void 0 : _a.find(function (option) {
                return option.label === element.groupId;
              });
              Object.assign(element, {
                "groupCategory": filterEle === null || filterEle === void 0 ? void 0 : filterEle.value
              });
            });

            _this10.initializeCard();
          }); // Fetch new data for the selected tab
          // this.getRecomData();
        }
      }, {
        key: "resetState",
        value: function resetState() {
          this.totalTabSavings = 0;
          this.totalTabInvestments = 0;
          this.filteredResults = [];
          this.cardJson = [];
          this.chartOptions = null; // Clear old charts

          this.chartOptionsMem = null;
          this.instanceResource = null;
          this.volumeResource = null;
        }
      }, {
        key: "getActionModeValue",
        value: function getActionModeValue(res) {
          var actionMode = '';

          function search(obj) {
            if (!obj || typeof obj !== 'object') return;

            for (var key in obj) {
              if (key === 'actionMode') {
                actionMode = obj[key];
                return;
              }

              if (typeof obj[key] === 'object') {
                search(obj[key]);
              }
            }
          }

          search(res);
          return actionMode;
        }
      }, {
        key: "randerRecommendation",
        value: function randerRecommendation(state) {
          var _this11 = this;

          this.ccRecommendationService.renderRecommendation(state.groupId).subscribe(function (state) {
            var _a;

            if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadedState"]) {
              // Unlock the button
              _this11.isForceChecking = false;
              var backendMessage = ((_a = state.data) === null || _a === void 0 ? void 0 : _a.message) || 'Rules executed successfully.';

              _this11.cavMessageService.add({
                severity: 'success',
                summary: 'Force Check Complete',
                // Depending on how Spring Boot returns strings, it might be in state.data directly
                detail: backendMessage
              }); // Refresh the table with the new data!


              _this11.getRecomData();
            }
          }, function (error) {
            // Unlock the button on failure
            _this11.isForceChecking = false;

            _this11.cavMessageService.add({
              severity: 'error',
              summary: 'Force Check Failed',
              detail: 'Failed to execute rules.'
            });

            console.error("Force check error:", error);
          });
        }
      }, {
        key: "forceCheck",
        value: function forceCheck() {
          var _this12 = this;

          // Lock the button and show spinner
          this.isForceChecking = true;
          this.cavMessageService.add({
            severity: 'info',
            summary: 'Force Check Started',
            detail: 'Executing all rules. This may take a moment...'
          });
          this.ccRecommendationService.forceCheckRules().subscribe(function (state) {
            var _a;

            if (state instanceof _service_cc_recommendation_state__WEBPACK_IMPORTED_MODULE_7__["formDetailsLoadedState"]) {
              // Unlock the button
              _this12.isForceChecking = false;
              var backendMessage = ((_a = state.data) === null || _a === void 0 ? void 0 : _a.message) || 'Rules executed successfully.';

              _this12.cavMessageService.add({
                severity: 'success',
                summary: 'Force Check Complete',
                // Depending on how Spring Boot returns strings, it might be in state.data directly
                detail: backendMessage
              }); // Refresh the table with the new data!


              _this12.getRecomData();
            }
          }, function (error) {
            // Unlock the button on failure
            _this12.isForceChecking = false;

            _this12.cavMessageService.add({
              severity: 'error',
              summary: 'Force Check Failed',
              detail: 'Failed to execute rules.'
            });

            console.error("Force check error:", error);
          });
        }
      }, {
        key: "ngOnDestroy",
        value: function ngOnDestroy() {
          this.destroy.next(true);
          this.destroy.complete();
        }
      }]);
    }();

    CcRecommendationComponent.ctorParameters = function () {
      return [{
        type: _angular_router__WEBPACK_IMPORTED_MODULE_3__["Router"]
      }, {
        type: _service_cc_recommendation_service__WEBPACK_IMPORTED_MODULE_2__["CcRecommendationService"]
      }, {
        type: src_app_shared_cav_table_service_cav_table_service__WEBPACK_IMPORTED_MODULE_4__["CavTableService"]
      }, {
        type: _cloud_data_source_service_cloud_data_source_service__WEBPACK_IMPORTED_MODULE_8__["CloudDataSourceService"]
      }, {
        type: src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_12__["CavMessageService"]
      }];
    };

    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])('visualTable', {
      read: src_app_shared_cav_table_cav_table_component__WEBPACK_IMPORTED_MODULE_9__["CavTable"]
    })], CcRecommendationComponent.prototype, "visualTable", void 0);
    CcRecommendationComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
      selector: 'app-cc-recommendation',
      template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! raw-loader!./cc-recommendation.component.html */
      "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/cloud-cost/cc-recommendation/cc-recommendation.component.html"))["default"],
      encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
      styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! ./cc-recommendation.component.scss */
      "./src/app/pages/home/cloud-cost/cc-recommendation/cc-recommendation.component.scss"))["default"]]
    })], CcRecommendationComponent);
    /***/
  },

  /***/
  "./src/app/pages/home/cloud-cost/cc-recommendation/cc-recommendation.module.ts":
  /*!*************************************************************************************!*\
    !*** ./src/app/pages/home/cloud-cost/cc-recommendation/cc-recommendation.module.ts ***!
    \*************************************************************************************/

  /*! exports provided: CcRecommendationModule */

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

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


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


    var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
    /*! tslib */
    "./node_modules/tslib/tslib.es6.js");
    /* harmony import */


    var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
    /*! @angular/core */
    "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
    /* harmony import */


    var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
    /*! @angular/common */
    "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
    /* harmony import */


    var _cc_recommendation_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ./cc-recommendation.component */
    "./src/app/pages/home/cloud-cost/cc-recommendation/cc-recommendation.component.ts");
    /* harmony import */


    var _angular_forms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
    /*! @angular/forms */
    "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
    /* harmony import */


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


    var primeng__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! primeng */
    "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
    /* harmony import */


    var src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
    /*! src/app/shared/cav-table/cav-table.module */
    "./src/app/shared/cav-table/cav-table.module.ts");
    /* harmony import */


    var primeng_dialog__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
    /*! primeng/dialog */
    "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng-dialog.js");
    /* harmony import */


    var primeng_sidebar__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
    /*! primeng/sidebar */
    "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng-sidebar.js");
    /* harmony import */


    var _angular_material_menu__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(
    /*! @angular/material/menu */
    "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/menu.js");
    /* harmony import */


    var _angular_material_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(
    /*! @angular/material/button */
    "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/button.js");
    /* harmony import */


    var _angular_material_icon__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(
    /*! @angular/material/icon */
    "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/icon.js");
    /* harmony import */


    var _shared_dynamic_form_dynamic_form_module__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(
    /*! ../../../../shared/dynamic-form/dynamic-form.module */
    "./src/app/shared/dynamic-form/dynamic-form.module.ts");
    /* harmony import */


    var src_app_shared_common_iframe_common_iframe_module__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(
    /*! src/app/shared/common-iframe/common-iframe.module */
    "./src/app/shared/common-iframe/common-iframe.module.ts");
    /* harmony import */


    var _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(
    /*! @angular/material/tooltip */
    "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/tooltip.js");
    /* harmony import */


    var primeng_multiselect__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(
    /*! primeng/multiselect */
    "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng-multiselect.js");
    /* harmony import */


    var src_app_shared_cav_notification_settings_cav_notification_settings_module__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(
    /*! src/app/shared/cav-notification-settings/cav-notification-settings.module */
    "./src/app/shared/cav-notification-settings/cav-notification-settings.module.ts");
    /* harmony import */


    var src_app_shared_cav_toolbar_cav_toolbar_module__WEBPACK_IMPORTED_MODULE_18__ = __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_19__ = __webpack_require__(
    /*! src/app/shared/help/help.module */
    "./src/app/shared/help/help.module.ts");
    /* harmony import */


    var highcharts_angular__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(
    /*! highcharts-angular */
    "./node_modules/highcharts-angular/__ivy_ngcc__/fesm2015/highcharts-angular.js");
    /* harmony import */


    var _cc_action_sidebar_cc_action_sidebar_module__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(
    /*! ./cc-action-sidebar/cc-action-sidebar.module */
    "./src/app/pages/home/cloud-cost/cc-recommendation/cc-action-sidebar/cc-action-sidebar.module.ts");

    var route = [{
      path: '',
      component: _cc_recommendation_component__WEBPACK_IMPORTED_MODULE_3__["CcRecommendationComponent"]
    }];

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

    CcRecommendationModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
      declarations: [_cc_recommendation_component__WEBPACK_IMPORTED_MODULE_3__["CcRecommendationComponent"]],
      imports: [_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"], primeng__WEBPACK_IMPORTED_MODULE_6__["TabMenuModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"], primeng__WEBPACK_IMPORTED_MODULE_6__["TooltipModule"], src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_7__["CavTableModule"], primeng_dialog__WEBPACK_IMPORTED_MODULE_8__["DialogModule"], _angular_material_menu__WEBPACK_IMPORTED_MODULE_10__["MatMenuModule"], _angular_material_button__WEBPACK_IMPORTED_MODULE_11__["MatButtonModule"], _angular_material_icon__WEBPACK_IMPORTED_MODULE_12__["MatIconModule"], _shared_dynamic_form_dynamic_form_module__WEBPACK_IMPORTED_MODULE_13__["DynamicFormModule"], src_app_shared_common_iframe_common_iframe_module__WEBPACK_IMPORTED_MODULE_14__["CommonIfameModule"], highcharts_angular__WEBPACK_IMPORTED_MODULE_20__["HighchartsChartModule"], primeng_sidebar__WEBPACK_IMPORTED_MODULE_9__["SidebarModule"], _angular_router__WEBPACK_IMPORTED_MODULE_5__["RouterModule"].forChild(route), primeng__WEBPACK_IMPORTED_MODULE_6__["ButtonModule"], _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_15__["MatTooltipModule"], primeng_multiselect__WEBPACK_IMPORTED_MODULE_16__["MultiSelectModule"], primeng__WEBPACK_IMPORTED_MODULE_6__["DropdownModule"], src_app_shared_cav_notification_settings_cav_notification_settings_module__WEBPACK_IMPORTED_MODULE_17__["CavNotificationSettingsModule"], src_app_shared_cav_toolbar_cav_toolbar_module__WEBPACK_IMPORTED_MODULE_18__["CavToolbarModule"], _cc_action_sidebar_cc_action_sidebar_module__WEBPACK_IMPORTED_MODULE_21__["CcActionSidebarModule"], primeng__WEBPACK_IMPORTED_MODULE_6__["SelectButtonModule"], src_app_shared_help_help_module__WEBPACK_IMPORTED_MODULE_19__["HelpModule"]],
      providers: [],
      exports: [_angular_router__WEBPACK_IMPORTED_MODULE_5__["RouterModule"]]
    })], CcRecommendationModule);
    /***/
  }
}]);