function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }

function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }

function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }

function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }

function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }

function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }

function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }

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 _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 _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 _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 _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 _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([["tools-license-manager-license-manager-module"], {
  /***/
  "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/choose-plan/choose-plan.component.html":
  /*!**************************************************************************************************************************!*\
    !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/choose-plan/choose-plan.component.html ***!
    \**************************************************************************************************************************/

  /*! exports provided: default */

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

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


    __webpack_exports__["default"] = "<app-cav-loader *ngIf=\"isChooseplanLoading\"></app-cav-loader>\n<div class=\"p-16 font-13 h-100vh-135 overflow\"> \n<ol>\n    <li class=\"active\" (click)=\"planChoose()\" [class.active]=\"chooseYourPlan == true\">\n        <div class=\"p-8 w-90-p\">\n            <h2 class=\"font-weight-400 mt-0\">Choose your plan</h2>\n            <div class=\"p-grid p-nogutter8\">\n                <div class=\"p-col-6\" *ngFor=\"let plan of planTypes\" [class.disabled]=\"plan.planId==1 && isAlreadyPayAsYouGoPurchased\" (click)=\"toggleActive(plan, plan.planId)\">\n                    <div class=\"card p-align-center p-dir-col font-14 p-12 line-height22\" [class.active]=\"plan.selected\">\n                        <div class=\"font-weight-500\">{{plan.planName}}</div>\n                        <div class=\"font-weight-400\">{{plan.planDescription}}</div>\n                        <div class=\"badge myBadge\" *ngIf=\"plan.recommended == true\">Recommended</div>\n                    </div>\n                </div>\n            <ng-container *ngIf=\"!isPayAsGo\">\n                <ng-container *ngFor=\"let plan of planTypes\">\n                    <div  (click)=\"stopPropogate($event)\" class=\"p-col-12 p-grid p-align-center p-justify-end my-12\" *ngIf=\"plan.planId==2\">\n                        <div class=\"ribbon-container border-all border-4\">\n                            <label  [class.disabled]=\"!annualSubscriptionDuration\" (click)=\"selectPlan('monthly')\">{{plan.paymentPlans[0].name}}</label>\n                            <p-inputSwitch class=\"mt-2 mx-6\" [(ngModel)]=\"annualSubscriptionDuration\" (onChange)=\"logSelection()\"></p-inputSwitch>\n                            <label [class.disabled]=\"annualSubscriptionDuration\" (click)=\"selectPlan('annually')\">{{plan.paymentPlans[1].name}}</label>\n                        </div>\n                    </div>\n                </ng-container>\n            </ng-container>\n            </div> \n        </div>\n    </li>\n    <li class=\"active\" (click)=\"productChoose()\" [class.active]=\"chooseYourProduct == true\">\n        <div class=\"p-8 w-90-p\">\n        <h2 class=\"font-weight-400 my-0\">Products</h2>\n        <p *ngIf=\"productValidationError\" style=\"color: red; font-size: 11px;\">Please select at least one product before proceeding to the next section.</p>\n            <p *ngIf=\"planId == 1\">{{planTypes[0].productDescription}}</p> \n            <p *ngIf=\"planId==2\">{{planTypes[1].productDescription}}</p>\n        <div class=\"p-grid p-nogutter8\">\n            <div class=\"p-col-6\" *ngFor=\"let product of filteredProductList\" (click)=\"productToggleActive(product)\">\n                <div class=\"card flex-start p-8\" [class.active]=\"product.selected\">\n                    <div class=\"p-col font-weight-500 my-0 font-15\">\n                       <h4 class=\"mb-4 mt-0\">{{product.serviceName}}</h4>\n                       <p class=\"font-13 my-4\">{{product.description}}</p>\n                       <p class=\"font-11 my-0 text-neutral-600 d-text-neutral-500\">{{product.parameterDescription}}</p>\n                       \n                    </div>\n                    <div class=\"p-col-fixed oldPrice\" *ngIf=\"!isPayAsGo && annualSubscriptionDuration\">{{getCurrencySymbol(product.policies[0].paymentModes[0].pricing[1].currency)}}{{product.policies[0].paymentModes[0].pricing[1].unitPrice | number: '1.2-2'}}</div>\n                    <div class=\"p-col-fixed\" *ngIf=\"annualSubscriptionDuration\">{{getCurrencySymbol(product.policies[0].paymentModes[1].pricing[1].currency)}}{{product.policies[0].paymentModes[1].pricing[1].unitPrice | number: '1.2-2'}}</div>\n                    <div class=\"p-col-fixed\" *ngIf=\"!annualSubscriptionDuration\">{{getCurrencySymbol(product.policies[0].paymentModes[0].pricing[1].currency)}}{{product.policies[0].paymentModes[0].pricing[1].unitPrice | number: '1.2-2'}}</div>\n                </div>\n            </div>\n        </div>\n\n        </div>\n    </li>\n    <li class=\"active\"  *ngIf=\"customizeSubscription\" [class.active]=\"switchCustomizeSubscriptionSection == true\">\n        <div class=\"p-8 w-60-p\">\n        <h2 class=\"font-weight-400 mt-0\">Customize Subscription</h2>\n        <ng-container *ngIf=\"continuePlan\">\n                    <div class=\"card1 mx-8 my-16 p-4\" *ngFor=\"let product of selectedProductMap | keyvalue, let i = index\">\n                        <table class=\"w-100-p table\">\n                            <colgroup>\n                                <col class=\"width-160\">\n                                <col class=\"width-50\">\n                                <col class=\"width-80\">\n                                <col class=\"width-50\">\n                                <col class=\"width-150\">\n                                <col style=\"width: auto;\">\n                            </colgroup>\n                            <tr>\n                                <td colspan=\"5\">\n                                    <h3 class=\"font-weight-600 my-12\">{{ product.value.serviceName }}\n                                        <app-help  [helpFileName]=\"'javaFlightRecord'\"  [helpTitle]=\"'Java Flight Record'\" [helpFolder]=\"'action'\"></app-help>\n                                    </h3>\n                                </td>\n                                <td class=\"text-right\">\n                                    <button type=\"button\" pButton icon=\"icons8 icons8-delete\" class=\"btn-icon\" (click)=\"removeFromMap(product)\"></button>\n                                </td>\n                            </tr>\n                            <tr>\n                                <td class=\"font-weight-600\">Monthly Usage</td>\n                                <td></td>\n                                <td class=\"font-weight-600\">Unit Price*</td>\n                                <td></td>\n                                <td class=\"font-weight-600\">Subtotal</td>\n                                <td>{{product.value.usageDescription}}\n                                    <span class=\"font-weight-600\"><br> {{getCurrencySymbol(getPricingDetails(product.value, 1).currency)}}{{getPricingDetails(product.value, 1).addonPrice | number: '1.2-2'}} {{product.value.parameterDescription}}</span>\n                                </td>\n                            </tr>\n                            <tr>\n                                    <td><p-spinner inputStyleClass=\"w-100-p\" [min]=\"1\" [(ngModel)]=\"product.value.unitCount\" (onChange) = \"setPaymentPlanBanner()\"  ></p-spinner>\n                                        <p-dropdown styleClass=\"mt-6\" [id]=\"product.value.templateId\" *ngIf=\"product.value.retentionDaysList.length > 1\" [options]=\"product.value.retentionDaysList\" (onChange)=\"onRetentionValueChange($event.value, product.value)\" [(ngModel)]=\"product.value.selectedRetentionDayLabel\" placeholder=\"--Select Retention Days--\" appendTo='body'></p-dropdown>\n                                    </td>\n                                <td class=\"font-18 text-center\"><button type=\"button\" pButton icon=\"icons8 icons8-delete\" class=\"btn-icon\"></button>\n                                </td>\n                                <td class=\"font-weight-500\">\n                                    <span min *ngIf=\"!annualSubscriptionDuration\">{{getCurrencySymbol(getPricingDetails(product.value, 1).currency)}}{{getPricingDetails(product.value, 1).unitPrice | number: '1.2-2'}}</span>\n                                    <span min *ngIf=\"annualSubscriptionDuration\">{{getCurrencySymbol(getPricingDetails(product.value, 1).currency)}}{{getPricingDetails(product.value, 1).unitPrice | number: '1.2-2'}}</span>\n                                </td>\n                                <td class=\"font-18 text-center\">=</td>\n                                <ng-container *ngIf=\"!annualSubscriptionDuration\">\n                                    <td><span class=\"font-weight-500\" #monthlyCost>{{getCurrencySymbol(getPricingDetails(product.value, 1).currency)}}{{product.value.unitCount * getPricingDetails(product.value, 1).unitPrice | number: '1.2-2'}}</span> <small> per month</small></td>\n                                </ng-container>\n                                <ng-container *ngIf=\"annualSubscriptionDuration\">\n                                    <td><span class=\"font-weight-500\" #yearlyCost>{{getCurrencySymbol(getPricingDetails(product.value, 1).currency)}}{{product.value.unitCount * getPricingDetails(product.value, 1).unitPrice | number: '1.2-2'}}</span> <small> per month</small></td>\n                                </ng-container>\n                    \n                            </tr>\n                        </table>\n                    </div>\n        </ng-container>\n      </div>\n    </li>\n\n    <li class=\"active\"x *ngIf=\"billingDetails\" [class.active]=\"billingDetails == true\">\n        <div class=\"p-8 w-60-p\">\n            <h2 class=\"font-weight-400 mt-0\">Billing detalis</h2>\n            <div class=\"mx-8 my-16 w-100-p p-grid\">\n                <div class=\"p-col-6 p-grid p-dir-col\">\n                    <label>Address Line 1 <span class=\"text-danger\"> *</span> </label>\n                    <input type=\"text\" class=\"w-100-p mt-8\" pInputText placeholder=\"Enter Address Line 1\" [(ngModel)]=\"addressLine1\" (ngModelChange)=\"billingDeatilSection()\"> \n                </div>\n                <div class=\"p-col-6 p-grid p-dir-col\" >\n                    <label>Address Line 2</label>\n                    <input type=\"text\" class=\"w-100-p mt-8\" pInputText placeholder=\"Enter Address Line 2\" [(ngModel)]=\"addressLine2\"> \n                </div>\n                <div class=\"p-col-6 p-grid p-dir-col\">\n                    <label>City <span class=\"text-danger\"> *</span> </label>\n                    <input type=\"text\" class=\"w-100-p mt-8\" pInputText placeholder=\"Enter City\" [(ngModel)]=\"city\" (ngModelChange)=\"billingDeatilSection()\"> \n                </div>\n                <div class=\"p-col-6 p-grid p-dir-col\">\n                    <label>Country <span class=\"text-danger\"> *</span> </label>\n                    <p-dropdown class=\"w-100-p mt-8\"  [options]=\"countryList\" id=\"country\" [(ngModel)]=\"country\" placeholder=\"--Select Country--\" (onChange)=\"onCountryChange($event)\"></p-dropdown>\n                </div>\n                <div class=\"p-col-6 p-grid p-dir-col\" (change)=\"billingDeatilSection()\">\n                    <label>State/Province/Region <span class=\"text-danger\"> *</span> </label>\n                    <ng-container *ngIf=\"stateList.length > 0\">\n                        <p-dropdown class=\"w-100-p mt-8\"  [options]=\"stateList\" id=\"state\" [(ngModel)]=\"state\" placeholder=\"--Select State--\"></p-dropdown>\n                    </ng-container>\n                    <ng-container *ngIf=\"stateList.length == 0\">\n                        <input type=\"text\" class=\"w-100-p mt-8\" placeholder=\"Enter State\" id=\"state\" pInputText  [(ngModel)]=\"state\" (ngModelChange)=\"billingDeatilSection()\">\n                    </ng-container>\n                </div>\n                <div class=\"p-col-6 p-grid p-dir-col\">\n                    <label>Postal Code <span class=\"text-danger\"> *</span> </label>\n                    <input type=\"number\" class=\"w-100-p mt-8\" pInputText placeholder=\"Enter Postal Code\" [(ngModel)]=\"postalCode\" (ngModelChange)=\"billingDeatilSection()\">\n                </div>\n                <div class=\"p-col-6 p-grid p-dir-col\">\n                    <label>Billing Email<span class=\"text-danger\"> *</span></label>\n                    <input type=\"email\" class=\"w-100-p mt-8\" pInputText placeholder=\"Enter Billing Email\" [(ngModel)]=\"customerBillingEmail\" (ngModelChange)=\"validateBillingEmail()\" (ngModelChange)=\"billingDeatilSection()\">\n                    <div *ngIf=\"billingEmailError\" style=\"color:red; font-size:12px;\">{{ billingEmailError }}</div>\n                </div>\n            </div>\n        </div>\n    </li>\n\n\n    <li class=\"active\" (click)=\"choosePayment()\" *ngIf=\"paymentSection\" [class.active]=\"payments == true\">\n        <div class=\"p-8 w-80-p\">\n            <h2 class=\"font-weight-400 mt-0\">Payments</h2>\n            <ng-container *ngIf=\"paymentSection\">\n            <div class=\"p-grid\">\n                <h4 class=\"p-col-12 my-0\">Select Card</h4>\n                <ng-container *ngFor=\"let method of paymentMethods; let i = index\">\n                <div class=\"credit-card border-4\"  [class.selected]=\"i === selectedCardIndex\" (click)=\"onCardClick(method,i)\" (mouseenter)=\"hoveredCardIndex = i\" (mouseleave)=\"hoveredCardIndex = null\">\n                    <div class=\"p-grid p-align-start p-justify-between\" >\n                        <div class=\"paymentLogo border-4\" [ngClass]=\"method.brand\" ></div>\n                        <!-- Delete Card -->\n                        <div class=\"p-grid p-align-center\" *ngIf=\"hoveredCardIndex === i && !method.defaultPayMethod\">\n                            <button pButton type=\"button\" class=\"btn-danger-outline\" icon=\"icons8 icons8-trash\" (click)=\"deleteCustomerCard(method)\"></button>\n                        </div>\n                    </div>\n                    <div class=\"p-grid p-dir-col mt-30 mb-28\">\n                        <div class=\"my-4\">*** *** {{method.cardNumber}} / Expiry {{method.expMonth}}/{{method.expYear}}</div>\n                        <div class=\"font-weight-600 my-4\">{{method.cardHolderName}}</div>\n                    </div>\n                    <div class=\"p-grid p-dir-col\" *ngIf=\"i === selectedCardIndex\">\n                        <p-checkbox *ngIf=\"!method.defaultPayMethod\" name=\"group1\" label=\"Make as Default\"  binary=\"true\" [(ngModel)]=\"checked\"  (click)=\"setAsDefault(i, $event)\"  ></p-checkbox>\n                    </div>\n                    <div class=\"p-grid p-dir-col\">\n                        <div class=\"font-weight-600 my-4\" *ngIf=\"method.defaultPayMethod\">Default</div> \n                    </div>\n                </div>\n                </ng-container>\n                <div class=\"p-col-12\">\n                    <button pButton (click)=\"addNewCard()\" label=\"Add New Credit/Debit Card\"></button>\n                </div>\n            </div>\n            </ng-container>\n        </div>\n    </li>\n</ol>\n</div>\n\n<div class=\"bottomBar\">\n    <div class=\"p-grid p-dir-col\" *ngIf=\"!isPayAsGo\">\n        <div class=\"p-grid p-align-center\">\n        <label [class.disabled]=\"annualSubscriptionDuration\" (click)=\"selectPlan('monthly')\">Pay Monthly</label>\n        <p-inputSwitch class=\"mt-2 mx-6\" [(ngModel)]=\"annualSubscriptionDuration\" (onChange)=\"logSelection()\"></p-inputSwitch>\n        <label [class.disabled]=\"!annualSubscriptionDuration \" (click)=\"selectPlan('annually')\">Pay Annually</label>\n        </div>\n        <div *ngIf=\"selectedPlan\">\n            <span *ngIf=\"!productSelected\">\n                {{ selectedPlan.bannerBefore }}\n              </span>\n              <!-- Banner After -->\n              <span *ngIf=\"productSelected\">\n                <span>{{ paymentBanner[0] }}</span>\n                <span class=\"text-primary-base\">{{ paymentBanner[1] }}</span>\n                <span>{{ paymentBanner[2] }}</span>\n              </span>\n        </div>\n\n    </div>\n    <div class=\"p-grid p-align-center\" *ngIf=\"isPayAsGo\">\n        <p class=\"my-12\">You will be charged at the end of each month.<a href=\"#\" class=\"blueHead\">Learn more about Billing</a></p>\n    </div>\n    <div class=\"font-weight-500 p-grid p-align-center\" *ngIf=\"!isPayAsGo\">\n        <ng-container *ngIf=\"annualSubscriptionDuration\">\n            <span class=\"mx-5\">Annual Cost </span>\n            <span class=\"mx-5\">\n              $ {{totalPrice}}\n            </span>\n          </ng-container>\n          <ng-container *ngIf=\"!annualSubscriptionDuration\">\n            <span class=\"mx-5\">Monthly Cost </span>\n            <span class=\"mx-5\">\n              $ {{totalPrice}}\n            </span>\n          </ng-container>\n    </div>\n    \n    <button type=\"button\" pButton label=\"Checkout\" (click)=\"purchaseConfirmFun()\" [disabled]=\"isFinalButtonDisabled\"></button>\n</div>\n<p-confirmDialog [style]=\"{width: '30vw'}\"></p-confirmDialog>\n\n<!-- <p-dialog header=\"Review Purchase\" [(visible)]=\"reviewPurchase\" [modal]=\"true\" [style]=\"{width: '600px'}\">\n    <p class=\"my-12\">You are buying the <strong>\n        \n        Plan</strong>.</p>\n    <p class=\"my-12\" *ngIf=\" planSelected()!= 'Pay as You Go'\">Your monthly committed amount is <strong>$ {{getMonthlyTotal()}}.</strong></p>   \n    <p class=\"my-12\">You will be charged at the end of each month (plus any additional usage).</p>\n    <p class=\"my-12\">Subscription is automatically renewed each month and you may cancel any time.</p> \n    <p class=\"my-24 font-weight-500\">By purchasing, you agree to the <a href=\"#\" class=\"blueHead\">Master Subscription Agreement, Privacy Policy</a> and <a href=\"#\" class=\"blueHead\">Cookie Policy</a></p>        \n        <p-footer>\n            <button type=\"button\" pButton (click)=\"reviewPurchase=false\" label=\"Cancel\" class=\"btn-secondary-outline\"></button>\n            <button type=\"button\" pButton (click)=\"purchaseConfirmFun()\" label=\"Purchase\"></button>\n        </p-footer>\n</p-dialog> -->";
    /***/
  },

  /***/
  "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/credit-card/credit-card.component.html":
  /*!**************************************************************************************************************************!*\
    !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/credit-card/credit-card.component.html ***!
    \**************************************************************************************************************************/

  /*! exports provided: default */

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

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


    __webpack_exports__["default"] = "<div class=\"p-grid p-align-center p-justify-between my-16\">\n    <h3 class=\"font-weight-400 my-0\">Payment Method</h3>\n    <button type=\"button\" pButton label=\"Edit\" (click)=\"editPaymentFun()\"></button>\n</div>\n\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 600 350\" class=\"max-w-100 rounded-10 mt-12\">\n    <rect width=\"600\" height=\"350\" fill=\"#4066E3FF\"></rect>\n    <text x=\"10%\" y=\"60%\"  width=\"100\" dominant-baseline=\"left\" text-anchor=\"left\" font-family=\"monospace\" font-size=\"26px\" fill=\"#FFFFFFFF\">{{ getFormattedCardNumber() }}</text>\n    <text x=\"10%\" y=\"80%\" width=\"200\" dominant-baseline=\"left\" text-anchor=\"left\" font-family=\"monospace\" font-size=\"26px\" fill=\"#FFFFFFFF\">{{cardHolderName}}</text>\n  </svg>\n\n  \n<p-dialog header=\"Review Purchase\" [(visible)]=\"editPaymentMethod\" [modal]=\"true\" [style]=\"{width: '600px'}\">\n    <div class=\"p-grid\">\n        <div class=\"p-col-12\">\n            <h3 class=\"my-6\">Current Payment Method</h3>\n        </div>\n        <div class=\"p-col-12\">\n            Credit Card\n        </div>\n        <div class=\"p-col-12\">\n            <h4 class=\"my-6\">Credit Card</h4>\n        </div>\n        <div class=\"p-col-6 font-weight-500\">Card Holder Name</div>\n        <div class=\"p-col-6 font-weight-500\">Card Number</div>\n        <div class=\"p-col-6\">\n           <div *ngIf=\"!cardEdit\">{{cardHolderName}}</div>\n            <input type=\"text\" pInputText [(ngModel)]=\"cardHolderName\" class=\"w-100-p\" *ngIf=\"cardEdit\" />\n        </div>\n        <div class=\"p-col-6\">\n        <div *ngIf=\"!cardEdit\">{{ getFormattedCardNumber() }}</div>\n        <input type=\"text\" appCreditCard pInputText class=\"w-100-p\" [(ngModel)]=\"cardNumber\"  \n        placeholder=\"Enter Credit Card Number\" *ngIf=\"cardEdit\">\n        </div>\n\n        <div class=\"p-col-12\">\n            <p-button type=\"button\" (click)=\"cardEditFun()\" [label]=\"cardEdit ? 'Save' : 'Edit'\"></p-button>   \n            <button type=\"button\" pButton (click)=\"editPaymentMethod=false\" label=\"Remove\" class=\"ui-button-danger mx-6\"></button>   \n        </div>\n    </div>\n\n\n<p-footer>\n            <button type=\"button\" pButton (click)=\"editPaymentMethod=false\" label=\"Close\" class=\"btn-secondary-outline\"></button>\n        </p-footer>\n</p-dialog>\n\n\n\n\n";
    /***/
  },

  /***/
  "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/license-billing-history/license-billing-history.component.html":
  /*!**************************************************************************************************************************************************!*\
    !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/license-billing-history/license-billing-history.component.html ***!
    \**************************************************************************************************************************************************/

  /*! exports provided: default */

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

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


    __webpack_exports__["default"] = "<div class=\"subscriptionSummary font-13 px-6 h-100vh-135 overflow\">\n    <div class=\"p-grid p-nogutter8\">\n        <div class=\"p-col-12\">\n            <h2 class=\"font-weight-400 mb-0\">Billing History</h2>\n        </div>\n        <div class=\"p-col-12\">\n            <p class=\"m-0\">To inquire about an invoice statement, please email us at <a\n                    href=\"mailto:billing@cavisson.com\" class=\"btn-icon\">billing@cavisson.com.</a>\n                     <!-- or call us at <a\n                    href=“tel:123-1234-1234” class=\"btn-icon\">(123)-123-1234</a> \n                    and a representative will reach out to\n                you shortly.</p> -->\n        </div>\n        <div class=\"p-col-12 p-0 p-grid\">\n            <div class=\"p-col-fixed width-150\">\n                <p-dropdown [options]=\"status\" [style]=\"{'min-width':'100%'}\" \n                dropdownIcon=\"icons8 icons8-expand-arrow\" [(ngModel)]=\"selectStatus\" (onChange)=\"getInvoicesBasedonPaymentStatus($event.value)\"></p-dropdown>\n        </div>\n            <div class=\"p-col-fixed width-150\">\n                <p-dropdown [options]=\"timeDuration\" (onChange)=\"getDates($event.value)\" [style]=\"{'min-width':'100%'}\" \n                dropdownIcon=\"icons8 icons8-expand-arrow\" [(ngModel)]=\"selectDuration\"></p-dropdown>\n            </div>\n        </div>\n        <div class=\"p-col-12\">\n            <cav-table\n                [scrollable]=\"true\" [headerRelativePath]=\"invoiceTableHeader\" [value]=\"invoiceTableData\" (clickButtonEvent)=\"invoiceTableFun($event)\"\n                scrollHeight=\"193px\">\n            </cav-table>\n\n        </div>\n        <div class=\"p-col-12\">\n            <p class=\"m-0\">For more information on pricing, plans, and usage, visit the\n                <a href=\"https://docs.cavisson.com/pricing/\" class=\"btn-icon\" target=\"_blank\" rel=\"noopener noreferrer\">pricing page/FAQs</a>.\n            </p>\n        </div>\n    </div>\n\n</div>\n\n\n\n<!-- This code is commented as it is not working properly \n<p-dialog header=\"PDF Viewer\" [(visible)]=\"showPdfViewDialog\">\n    <iframe [src]=\"pdfUrl\" width=\"100%\" height=\"500px\"></iframe>\n  </p-dialog> -->";
    /***/
  },

  /***/
  "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/license-plan/license-plan.component.html":
  /*!****************************************************************************************************************************!*\
    !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/license-plan/license-plan.component.html ***!
    \****************************************************************************************************************************/

  /*! exports provided: default */

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

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


    __webpack_exports__["default"] = "<app-cav-loader *ngIf=\"isContentLoading\"></app-cav-loader>\n<div class=\"p-grid p-nogutter16 h-100vh-135 overflow\" *ngIf=\"!choosePlan\">\n    <div class=\"p-col-9 border-all border-5 rounded-4 subscriptionSummary my-16 \">\n        <div class=\"p-grid\">\n            <div class=\"p-col-12\">\n                <h2 class=\"font-weight-400 mt-0 mb-8\">Subscription Summary</h2>\n            </div>\n            <div class=\"p-col-4\" *ngFor=\"let list of subscriptionData\">\n                <div class=\"border-all border-5 rounded-2 py-10 px-12\">\n                    <span class=\"badge bg-primary-900 d-bg-primary-800\" *ngIf=\"list.subscriptionType && list.subscriptionType==0\">{{getSubscriptionType(list.subscriptionType)}}</span>\n                    <h2 class=\"my-12 font-weight-500 p-grid  p-align-center\">\n                        \n                        <a href=\"javascript:void(0)\" (click)=\"navigateToUsage(list.serviceName)\">{{list.serviceName}}</a>\n                    </h2>\n                    <p><span class=\"inlineFlex\" style=\"white-space: nowrap;\">Licensed on</span> : &nbsp; {{list.parameter}}</p>\n                    <p><span class=\"inlineFlex\">Usage</span><strong> : &nbsp; <span>{{list.usage}}</span><span *ngIf=\"list.subscriptionType === 0 ||list.planType == 1\">/{{list.threshold}}</span></strong></p>\n                    <p class=\"text-success\">Purchase Date &nbsp; {{list.start | timestampToDate }}</p>\n                    <p *ngIf=\"list.subscriptionType === 0 && list.usage > 0\" class=\"text-danger-base d-text-danger-600\">\n                        <span class=\"inlineFlex\">Expires on</span> : &nbsp; {{list.expiry | timestampToDate }}</p>\n                     <p *ngIf=\"!list.pendingCancellation && list.subscriptionType !== 0\" class=\"w-100-p p-grid p-align-center pb-4 p-justify-between\">\n                        <p-checkbox   binary=\"true\" label=\"Cancel Subscription\" (onChange)=\"onSubscriptionToggle($event, list)\"></p-checkbox>\n                        <span>\n                            <span *ngIf=\"choosePlanService.isChooseYourOwnPlanType(list.planType)\" class=\"cav-create-plan-name ml-4\"  title=\"Choose Your own plan\"></span>\n                            <span *ngIf=\"choosePlanService.isPayAsYouGoPlanType(list.planType)\" class=\" cav-pay-plan-name ml-4\"  title=\"Pay as You Go\"></span>\n                        </span>\n                    </p>\n                    <div *ngIf=\"list.subscriptionType === 0\" class=\"p-6 mb-12 bg-success trial\">Trial</div>\n                    <div *ngIf=\"isRecent(list)\" class=\" mb-12 bg-success trial font-12\">Recently Bought</div>\n                </div>\n            </div>\n        </div>\n    </div>\n    <div class=\"p-col-3 relative\">\n        <div class=\"border-all border-5 rounded-2 p-16 subscriptionSummary upgrade\">\n         <h2 class=\"font-weight-400 mt-0 mb-12\">Upgrade your subscription today!</h2>\n         <button type=\"button\" class=\"w-100-p\" pButton label=\"Choose Your Plan\"  (click)=\"choosePlanFn()\"></button>\n         <button pButton type=\"button\"  [disabled]=\"cancelButtonDisabled\" label=\"Cancel Subscription\" class=\"btn-danger-outline w-100-p mt-10\" (click)=\"cancelSubscription()\"></button>\n        </div>\n\n        <!-- <div class=\"p-grid p-align-center p-justify-between mt-36\">\n            <h3 class=\"font-weight-400 my-0\">Payment Method</h3>\n            <button type=\"button\" pButton label=\"Edit\"></button>\n        </div> -->\n\n        <!-- <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 600 350\" class=\"max-w-100 rounded-10 mt-12\">\n            <rect width=\"600\" height=\"350\" fill=\"#4066E3FF\"></rect>\n            <text x=\"30%\" y=\"60%\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"26px\" fill=\"#FFFFFFFF\">**** **** {{cardNumber}}</text>\n            <text x=\"30%\" y=\"80%\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"monospace\" font-size=\"26px\" fill=\"#FFFFFFFF\">{{cardHolderName}}</text>\n          </svg> -->\n\n        </div>\n    </div>\n\n    <!-- <div *ngIf=\"choosePlan\" class=\"choosePlan\">\n        <app-choose-plan></app-choose-plan>\n    </div> -->\n";
    /***/
  },

  /***/
  "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/license-usage-cost/license-usage-cost.component.html":
  /*!****************************************************************************************************************************************!*\
    !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/license-usage-cost/license-usage-cost.component.html ***!
    \****************************************************************************************************************************************/

  /*! exports provided: default */

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

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


    __webpack_exports__["default"] = "<app-cav-loader *ngIf=\"isLicenceUsageContentLoading\"></app-cav-loader>\n<div class=\"p-grid p-nogutter16 subscriptionSummary font-13 h-100vh-135 overflow\" *ngIf=\"!isLicenceUsageContentLoading\">\n  <div class=\"p-col-2\">\n    <ul class=\"m-0 p-0 sidebar-list\">\n      <li\n        *ngFor=\"let menu of sidebarMenu; let i = index\"\n        [ngClass]=\"{ 'is-active': i === activeDiv }\"\n        (click)=\"toggleActive(menu)\"\n      >\n        {{ menu.label }}\n      </li>\n    </ul>\n  </div>\n  <div class=\"p-col-10\">\n    <button\n      type=\"button\"\n      pButton\n      label=\"Buy More\"\n      (click)=\"onExtendLicenseClicked()\"\n      class=\"btn-primary-outline extant-license\"\n    ></button>\n\n      <div class=\"p-grid\">\n      <!-- License Model Displayed Once -->\n      <div class=\"usage-cost border-4\">\n        <span class=\"font-weight-600\">License Model</span>\n        <span>{{ selectedServiceDetails.licenseModel }}</span>\n      </div>\n\n      <!-- \n        Conditionally displays usage sections based on the associated plan types. \n        If a specific plan type (Create Your Own Plan or Pay As You Go) is associated \n        with the selected service, the corresponding usage block is rendered.\n      -->\n      <ng-container>\n        <div class=\"usage-cost border-4\" *ngIf=\"isPlanTypeAssociated(PLAN_TYPE_INDEX_ENUM.CREATE_YOUR_OWN_PLAN) || selectedServiceDetails.subscriptionType === SUBSCRIPTION_TYPE_ENUM.FREE_TRIAL\">\n          <span class=\"font-weight-600\">Usage</span>\n          <span>\n            {{ selectedServiceDetails.createYourOwnPlanUsage }}\n            <span>/ {{ selectedServiceDetails.threshold }}</span>\n          </span>\n            <span class=\"mt-8\" *ngIf=\"selectedServiceDetails.subscriptionType === SUBSCRIPTION_TYPE_ENUM.PRO\">Create Your Own Plan</span>\n        </div>\n        <div class=\"usage-cost border-4\" *ngIf=\"isPlanTypeAssociated(PLAN_TYPE_INDEX_ENUM.PAY_AS_YOU_GO) && selectedServiceDetails.subscriptionType === SUBSCRIPTION_TYPE_ENUM.PRO\">\n          <span class=\"font-weight-600\">Usage</span>\n          <span>\n            {{ selectedServiceDetails.payAsYouGoUsage }}\n          </span>\n          <span class=\"mt-8\">Pay as You Go</span>\n        </div>\n      </ng-container>\n\n      <!-- Over Usage -->\n      <div class=\"usage-cost border-4\" *ngIf=\"totalOverUsage && totalOverUsage !== 0\">\n        <span class=\"font-weight-600\">Over Consumed</span>\n        <span>{{ totalOverUsage }}</span>\n      </div>\n    </div>\n\n\n    <div class=\"my-16\">\n      <p-selectButton\n        [options]=\"durationType\"\n        [(ngModel)]=\"selectDuration\"\n        (click)=\"durationChanged()\"\n      ></p-selectButton>\n    </div>\n\n    <div class=\"my-16\">\n      <highcharts-chart\n        [Highcharts]=\"highcharts\"\n        [options]=\"chartOptions\"\n        style=\"width: 100%; height: 250px; display: block\"\n      >\n      </highcharts-chart>\n    </div>\n  </div>\n</div>\n";
    /***/
  },

  /***/
  "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/purchase-confirm/purchase-confirm.component.html":
  /*!************************************************************************************************************************************!*\
    !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/purchase-confirm/purchase-confirm.component.html ***!
    \************************************************************************************************************************************/

  /*! exports provided: default */

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

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


    __webpack_exports__["default"] = "<div class=\"p-grid p-nogutter16\">\n  <div class=\"p-col-9 border-all border-5 rounded-4 subscriptionSummary my-16\">\n    <h2 class=\"font-weight-400 mt-0 mb-8\">Plan Summary</h2>\n    <div class=\"font-weight-600 mt-0 mb-8\">\n      <span>Payment Frequency:</span>\n      <span class=\"ml-8\">\n        {{ isPayAsYouGoPlanSelected() ? 'Monthly' : paymentFrequency }}\n      </span>\n    </div>\n    <table class=\"w-100-p\">\n      <thead>\n        <tr>\n          <th>Assigned Plans</th>\n          <th>Price per Unit</th>\n          <th>Quantity</th>\n          <th *ngIf=\"!isPayAsYouGoPlanSelected()\">Unit Allocated</th>\n          <th *ngIf=\"isPayAsYouGoPlanSelected()\">Plan Tenure</th>\n          <th>Total Price</th>\n        </tr>\n      </thead>\n      <tbody>\n        <ng-container *ngIf=\"!isPayAsYouGoPlanSelected()\">\n          <tr *ngFor=\"let row of rowDataForChooseYourOwnPlan\">  \n            <td>{{row.service }}</td>\n            <td class=\"text-right\">{{ row.totalPrice | currency:'USD' }}</td>\n            <td class=\"text-right\">{{ row.quantity }}</td>\n            <td>{{ row.usage }}</td>\n            <td class=\"text-right\">{{ row.totalPrice | currency:'USD' }}</td>\n          </tr>\n        </ng-container>\n        <ng-container *ngIf=\"isPayAsYouGoPlanSelected()\">\n          <tr>\n            <td>{{rowDataForPayAsYouGo.assignedPlan }}</td>\n            <td>\n              <button (click)=\"openServiceDialog()\" class=\"blueHead btn btn-link p-0 m-0\">\n                {{ rowDataForPayAsYouGo.unitPrice }}\n              </button>\n            </td>\n            \n            <td>{{ rowDataForPayAsYouGo.quantity }}</td>\n            <td>{{ rowDataForPayAsYouGo.planTenure }}</td>\n            <td>{{ rowDataForPayAsYouGo.totalPrice }}</td>\n          </tr>\n        </ng-container>\n      </tbody>\n      <ng-container *ngIf=\"!isPayAsYouGoPlanSelected()\">\n      <tfoot>\n        <tr>\n          <td colspan=\"3\" rowspan=\"4\"></td>\n          <td colspan=\"2\" rowspan=\"4\">\n            <table class=\"w-100-p\">\n              <!-- <tr>\n                <td>Sub-Total (excl. tax)</td>\n                <ng-container *ngIf=\"!annuallyCommitted\">\n                <td class=\"text-right\">{{totalMonthlyPrice | currency:'USD'}}</td>\n                </ng-container>\n                <ng-container *ngIf=\"annuallyCommitted\">\n                  <td class=\"text-right\">{{totalAnnualPrice | currency:'USD'}}</td>\n                  </ng-container>\n              </tr> -->\n               <!-- <tr>\n               <td>Pro Rata <strong>({{proRataStartDate}} </strong> To <strong> {{proRataEndDate}})</strong></td>\n                <td class=\"text-right\">- {{ proRataAmount | currency:'USD'}}</td>\n              </tr>  -->\n              <tr>\n                <th class=\"text-left\">   <strong>Sub-Total</strong> (excl. tax)  (<strong>{{formattedStartDate}}</strong> - <strong>{{formattedEndDate}}</strong>)\n                  </th>\n                <th class=\"text-right\">{{totalPrice | currency:'USD'}}</th>\n              </tr>\n              <tr>\n                <th class=\"text-left\">   <strong>Total Amount</strong> (excl. tax)\n                  </th>\n                <th class=\"text-right\">{{totalPrice | currency:'USD'}}</th>\n              </tr>\n            </table>\n          </td>\n        </tr>\n      </tfoot>\n      </ng-container>\n    </table>\n  </div>\n  <div class=\"p-col-3\">\n    <h3 class=\"font-weight-400 my-0\">Subscription & Billing Details</h3>\n\n    <div class=\"border-all border-5 rounded-2 p-16 subscriptionSummary upgrade\">\n      <div class=\"p-grid p-align-center\">\n        <div class=\"p-col-6 font-weight-600\">Company Name</div>\n        <div class=\"p-col-6\">{{companyName}}</div>\n        <div class=\"p-col-6 font-weight-600\">Billing Address</div>\n        <div class=\"p-col-6\">{{billingAddress}}</div>\n        <ng-container *ngIf=\"annuallyCommitted && !isPayAsYouGoPlanSelected()\" >\n        <div class=\"p-col-6 font-weight-600\">Annually Committed</div>\n        <div class=\"p-col-6\">{{totalPrice | currency:'USD'}}</div>\n        </ng-container>\n        <ng-container *ngIf=\"isPayAsYouGoPlanSelected()\">\n        <div class=\"p-col-6 font-weight-600\">Plan Type</div>\n        <div class=\"p-col-6\">Pay as you go</div>\n        </ng-container>\n        <div class=\"p-col-6 font-weight-600\">Start Date</div>\n        <div class=\"p-col-6\">{{startDate}}</div>\n        <div class=\"p-col-6 font-weight-600\">Renewal Date</div>\n        <div class=\"p-col-6\">{{endDate}}</div>\n      </div>\n\n    </div>\n\n\n\n    <div class=\"p-grid p-align-center p-justify-between mt-36\">\n      <h3 class=\"font-weight-400 my-0\">Payment Method</h3>\n      <button type=\"button\" pButton label=\"Change Card\"  (click)=\"showCardChangeDialog=true\"></button>\n    </div>\n\n    <div class=\"credit-card border-4\">\n      <div class=\"p-grid p-align-start p-justify-between\" >\n          <div class=\"paymentLogo border-4\" [ngClass]=\"cardBrand\" ></div>\n      </div>\n      <div class=\"p-grid p-dir-col mt-30 mb-28\">\n          <div class=\"my-4\">** ** {{cardNumber}} / Expiry {{expMonth}}/{{expYear}}</div>\n          <div class=\"font-weight-600 my-4\">{{cardHolderName}}</div>\n      </div>\n    </div>\n\n  </div>\n  \n</div>\n\n<div class=\"bottomBar\">\n  <div class=\"p-grid p-align-center\" *ngIf=\"isPayAsYouGoPlanSelected()\">\n    <p class=\"my-12\"><strong>Note:</strong> You will be charged at the end of the month. The subscription will be auto-renewed, and you can cancel at any time.<a href=\"#\" class=\"blueHead\">Learn more about\n        Billing</a></p>\n  </div>\n  <span>   \n  </span>\n  <div class=\"font-weight-500 p-grid p-align-center\" *ngIf=\"!isPayAsYouGoPlanSelected()\">\n    <ng-container *ngIf=\"annuallyCommitted\">\n      <span class=\"mx-5\">Annual Cost </span>\n      <span class=\"mx-5\">\n        $ {{totalPrice}}\n      </span>\n    </ng-container>\n    <ng-container *ngIf=\"!annuallyCommitted\">\n      <span class=\"mx-5\">Monthly Cost </span>\n      <span class=\"mx-5\">\n        $ {{totalPrice}}\n      </span>\n    </ng-container>\n  </div>\n  <span>\n    <button type=\"button\" pButton class=\"ui-button-secondary px-15 mx-6\" label=\"Back\" (click)=\"cancelPurchase()\"></button>\n    <ng-container *ngIf=\"isPayAsYouGoPlanSelected()\">\n      <button type=\"button\" pButton label=\"Purchase\" (click)=\"confirmPurchase()\" [disabled]=\"isFinalButtonDisabled\"></button>\n    </ng-container>\n    <ng-container *ngIf=\"!isPayAsYouGoPlanSelected()\">\n      <button type=\"button\" pButton label=\"Pay\" (click)=\"confirmPurchase()\" [disabled]=\"isFinalButtonDisabled\"></button>\n    </ng-container>\n  </span>\n\n</div>\n\n\n<p-dialog [(visible)]=\"showCardChangeDialog\" header=\"Select Card\" [modal]=\"true\" [closable]=\"false\"\n  [style]=\"{width: '300px'}\">\n  <div class=\"p-grid\">\n    <div class=\"p-col-12\" *ngFor=\"let card of cardArr\">\n      <p-radioButton name=\"card\" [(ngModel)]=\"selectedCard\" [value]=\"card\"></p-radioButton>\n      {{ card.cardHolderName }} - {{ card.cardNumber }}\n    </div>\n</div>\n  <p-footer>\n    <button type=\"button\" pButton class=\"btn-secondary-outline mx-6\" label=\"Cancel\"\n      (click)=\"showCardChangeDialog=false\"></button>\n    <button pButton type=\"button\" pButton label=\"Submit\" (click)=\"changeCard()\"></button>\n  </p-footer>\n</p-dialog>\n\n\n<p-dialog header=\"License purchased successfully\" [(visible)]=\"showSuccessDialog\" [modal]=\"true\" [closable]=\"false\">\n  <div class=\"dialog-content\">\n    <p>Please choose what would you like to do next</p>\n  </div>\n  \n  <p-footer>\n    <button pButton type=\"button\" label=\"Explore Our Offerings\"  (click)=\"onContinue()\"></button>\n    <button pButton type=\"button\" label=\"Purchase Another License\" icon=\"pi pi-cart\" (click)=\"onPurchaseAnother()\"></button>\n  </p-footer>\n</p-dialog>\n\n\n<!-- Dialog for License Services -->\n<p-dialog header=\"Pay As You Go Price(s)\" [(visible)]=\"isDialogVisible\" [modal]=\"true\" [style]=\"{ width: '60vw' }\">\n  <div class=\"p-col-12\">\n    <cav-table [scrollable]=\"true\" [headerRelativePath]=\"serviceTableHeader\" [value]=\"serviceTableData\"\n      scrollHeight=\"193px\"></cav-table>\n  </div>\n</p-dialog>\n\n<p-confirmDialog [style]=\"{width: '25vw'}\"></p-confirmDialog>\n\n<app-cav-loader *ngIf=\"isLoading\"></app-cav-loader>";
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/choose-plan/choose-plan.component.scss":
  /*!************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/choose-plan/choose-plan.component.scss ***!
    \************************************************************************************/

  /*! exports provided: default */

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

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


    __webpack_exports__["default"] = "ol {\n  counter-reset: item;\n  margin: 0px;\n  padding-left: 0;\n  border-left: solid;\n  border-width: 2px;\n  border-color: var(--primary-base);\n}\n\nli {\n  display: flex;\n  margin-bottom: 0.5em;\n  margin-left: 2em;\n}\n\nli::before {\n  content: counter(item);\n  counter-increment: item;\n  width: 2em;\n  margin-left: -41px;\n  background-color: var(--background_color_12);\n  width: 28px;\n  height: 28px;\n  border-radius: 50%;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  border-style: solid;\n  border-width: 2px;\n  border-color: var(--primary-base);\n}\n\nli.active:before {\n  background-color: var(--primary-base);\n  color: var(--color_5);\n}\n\n.myBadge {\n  background-color: #ff5b23;\n  border-radius: 4px 0px 0px 4px;\n  padding: 3px 12px;\n  top: 27px;\n  right: 8px;\n}\n\n.ribbon-container {\n  display: flex;\n  align-items: center;\n  border-radius: 3px;\n  padding: 10px;\n  position: relative;\n  background-color: var(--background_color_1);\n  width: 230px;\n  justify-content: space-between;\n}\n\n.ribbon {\n  background-color: #ff3300;\n  color: #FFF;\n  text-align: center;\n  line-height: 20px;\n  padding: 10px;\n  position: absolute;\n  top: -10px;\n  bottom: -10px;\n  border-bottom-left-radius: 30px;\n  border-bottom-right-radius: 30px;\n}\n\n.ribbon::after {\n  content: \"\";\n  position: absolute;\n  border-bottom: solid 0px transparent;\n  border-top: solid 10px transparent;\n  border-left: solid 7px #333;\n  right: -6px;\n  top: 0px;\n  z-index: 5;\n}\n\n.ribbon::before {\n  content: \"\";\n  position: absolute;\n  border-bottom: solid 0px transparent;\n  border-top: solid 10px transparent;\n  border-right: solid 7px #333;\n  left: -5px;\n  top: 0px;\n  z-index: 5;\n}\n\n.ribbon-content {\n  margin-left: 56px;\n  color: #ff3300;\n  font-weight: 600;\n}\n\n.flex-start {\n  align-items: flex-start;\n}\n\n.disabled {\n  opacity: 0.5;\n  pointer-events: none;\n  cursor: not-allowed;\n}\n\n/* Form container \nform {\n  // max-width: 400px; \n  margin: 0 auto;\n  padding: 20px;\n  border: 1px solid #ccc;\n  border-radius: 8px;\n  background-color: #f9f9f9;\n}\n\nlabel {\n  display: block;\n  margin-bottom: 8px;\n  font-weight: bold;\n}\n\ninput[type=\"text\"] {\n  width: calc(100% - 20px);\n  padding: 10px;\n  margin-bottom: 15px;\n  border: 1px solid #ccc;\n  border-radius: 4px;\n}\n\ninput[type=\"email\"] {\n  width: calc(100% - 20px);\n  padding: 10px;\n  margin-bottom: 15px;\n  border: 1px solid #ccc;\n  border-radius: 4px;\n}\n\ndiv.error-message {\n  color: red;\n  font-size: 14px;\n  margin-top: 5px;\n}*/\n\n/* Submit button */\n\nbutton[type=submit] {\n  display: block;\n  width: 100%;\n  padding: 10px;\n  margin-top: 15px;\n  background-color: #007bff;\n  color: white;\n  border: none;\n  border-radius: 4px;\n  cursor: pointer;\n}\n\nbutton[type=submit]:hover {\n  background-color: #0056b3;\n}\n\n.container {\n  display: flex;\n  flex-wrap: wrap;\n}\n\n/* Initially hide the Delete button */\n\n.card .btn-danger {\n  opacity: 0;\n  transition: opacity 0.3s ease-in-out;\n}\n\n/* Show Delete button when hovering over the card */\n\n.card:hover .btn-danger {\n  opacity: 1;\n}\n\n.card:hover {\n  transform: scale(1.02);\n}\n\n.card {\n  flex: 0 0 calc(33.33% - 10px);\n  margin: 5px;\n  padding: 10px;\n  border: 1px solid #ccc;\n  border-radius: 5px;\n  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);\n  background-color: #fff;\n  cursor: pointer;\n  transition: transform 0.2s;\n}\n\n.card.selected {\n  border-color: #007bff;\n  box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);\n}\n\n.oldPrice {\n  text-decoration: line-through;\n  opacity: 0.5;\n}\n\n@media (max-width: 800px) {\n  .card {\n    flex-basis: calc(50% - 10px);\n  }\n}\n\n@media (max-width: 500px) {\n  .card {\n    flex-basis: calc(100% - 10px);\n  }\n}";
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/choose-plan/choose-plan.component.ts":
  /*!**********************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/choose-plan/choose-plan.component.ts ***!
    \**********************************************************************************/

  /*! exports provided: ChoosePlanComponent */

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

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


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


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


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


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


    var _service_choose_plan_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ./service/choose-plan.service */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.service.ts");
    /* harmony import */


    var _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
    /*! ./service/choose-plan.state */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.state.ts");
    /* harmony import */


    var _license_plan_service_license_plan_model__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
    /*! ../license-plan/service/license-plan.model */
    "./src/app/pages/tools/license-manager/license-plan/service/license-plan.model.ts");
    /* harmony import */


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


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


    var _service_stripe_operations_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
    /*! ./service/stripe-operations.service */
    "./src/app/pages/tools/license-manager/choose-plan/service/stripe-operations.service.ts");
    /* harmony import */


    var _license_plan_service_license_plan_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
    /*! ../license-plan/service/license-plan.service */
    "./src/app/pages/tools/license-manager/license-plan/service/license-plan.service.ts");
    /* harmony import */


    var src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(
    /*! src/app/shared/cav-toast/service/cav-message.service */
    "./src/app/shared/cav-toast/service/cav-message.service.ts");
    /* harmony import */


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


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


    var _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(
    /*! ./service/choose-plan.enum */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.enum.ts");
    /* harmony import */


    var src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(
    /*! src/app/shared/cavLoggerService/cav-logging.service */
    "./src/app/shared/cavLoggerService/cav-logging.service.ts");
    /* harmony import */


    var src_app_pages_exec_dashboard_services_exec_dashboard_config_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(
    /*! src/app/pages/exec-dashboard/services/exec-dashboard-config.service */
    "./src/app/pages/exec-dashboard/services/exec-dashboard-config.service.ts");
    /* harmony import */


    var src_app_shared_cav_license_services_cav_license_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(
    /*! src/app/shared/cav-license/services/cav-license.service */
    "./src/app/shared/cav-license/services/cav-license.service.ts");

    var ChoosePlanComponent = /*#__PURE__*/function () {
      function ChoosePlanComponent(licensePlanService, router, choosePlanService, messageService, fb, stripeOps, config, sessionService, cavLoggingService, licenseService, cd, confirmDialogService) {
        _classCallCheck(this, ChoosePlanComponent);

        this.licensePlanService = licensePlanService;
        this.router = router;
        this.choosePlanService = choosePlanService;
        this.messageService = messageService;
        this.fb = fb;
        this.stripeOps = stripeOps;
        this.config = config;
        this.sessionService = sessionService;
        this.cavLoggingService = cavLoggingService;
        this.licenseService = licenseService;
        this.cd = cd;
        this.confirmDialogService = confirmDialogService;
        this.retentionDaysList = [];
        this.chooseYourPlan = true;
        this.annualSubscriptionDuration = false;
        this.continuePlan = false;
        this.existingMethod = false;
        this.subscriptionSection = true;
        this.paymentSection = false;
        this.reviewPurchase = false;
        this.billingDetails = false;
        this.billingDetailsSection = false;
        this.selectedPlanMode = _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_NAME_ENUM"].ANNUALLY;
        this.selectedProductMap = new Map();
        this.productValidationError = false;
        this.paymentPlanNumber = 1;
        this.paymentMethods = [];
        this.previousPaymentMethod = [];
        this.isChooseplanLoading = true;
        this.isPaymentProcessing = false;
        this.monthlyPrice = 0;
        this.annuallyPrice = 0;
        this.isFinalButtonDisabled = true;
        this.policyIndex = 0;
        this.hoveredCardIndex = -1;
        this.loading = false;
        this.checked = false;
        this.countryList = [];
        this.stateList = [];
        this.countries = [];
        this.paymentBanner = [];
        this.isPayAsGo = true;
        this.paymentPlans = [];
        this.productSelected = false;
        this.billingEmailError = ''; // For showing the message in the billing section

        this.paymentForm = this.fb.group({
          name: ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_6__["Validators"].required]],
          mail: ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_6__["Validators"].email]],
          address_line1: ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_6__["Validators"].required]],
          address_city: ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_6__["Validators"].required]],
          address_country: ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_6__["Validators"].required]],
          card: [null, [_angular_forms__WEBPACK_IMPORTED_MODULE_6__["Validators"].required]],
          address_zip: ['', _angular_forms__WEBPACK_IMPORTED_MODULE_6__["Validators"].required],
          address_state: ['', _angular_forms__WEBPACK_IMPORTED_MODULE_6__["Validators"].required]
        });
      }

      return _createClass(ChoosePlanComponent, [{
        key: "ngOnInit",
        value: function ngOnInit() {
          this.getAccountDetails();
          this.getSubscriptions(_license_plan_service_license_plan_model__WEBPACK_IMPORTED_MODULE_5__["SubscriptionTypeEnum"].Pro.toString());
          this.checkPurchaseLicense();
        }
      }, {
        key: "checkPurchaseLicense",
        value: function checkPurchaseLicense() {
          // Check if the purchased plan type is "Pay As You Go" and update the flag accordingly
          this.isAlreadyPayAsYouGoPurchased = this.choosePlanService.purchasedPlanType === _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].PAY_AS_YOU_GO ? true : false;

          if (this.sessionService.checkFreeTrialLicenseExpires()) {
            this.sessionService.showLicenseExpiryDialog = false;
          }

          this.sessionService.userUpgradingLicense = true;
        }
      }, {
        key: "getAccountDetails",
        value: function getAccountDetails() {
          return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee() {
            var accountDetails;
            return _regenerator().w(function (_context) {
              while (1) switch (_context.n) {
                case 0:
                  // Get the account details from session object
                  accountDetails = this.sessionService.fetchAccountDetails();
                  this.accountName = accountDetails.accountName;
                  this.projectName = accountDetails.projectName;
                  this.customerEmail = accountDetails.accountEmail;

                case 1:
                  return _context.a(2);
              }
            }, _callee, this);
          }));
        }
      }, {
        key: "getSubscriptions",
        value: function getSubscriptions(subscriptionType) {
          var _this = this;

          this.choosePlanService.loadSubscriptions(subscriptionType).subscribe(function (state) {
            if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["ChoosePlanSubscriptionsLoadingState"]) {
              return;
            }

            if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["ChoosePlanSubscriptionsLoadedState"]) {
              _this.isChooseplanLoading = false;
              var data = state.data.data[0];
              var plansArray = data.plans;
              _this.countries = data.countries;
              _this.countryList = _this.countries.map(function (country) {
                return {
                  label: country.country,
                  value: country.countryCode
                };
              });
              _this.planTypes = plansArray; //call the recommendedplan method

              _this.setRecommendedPlan();

              var productDetailsArray = data.subscriptions;
              _this.productList = productDetailsArray;
              _this.filteredProductList = _this.productList;

              _this.filteredProductList.forEach(function (product) {
                product.selectedRetentionDays = null;
              });

              _this.setPolicies();

              _this.getCustomerDetails();

              _this.resetProducts();

              if (_this.choosePlanService.confirmDetails != null) {
                _this.setDefaultValues();
              }
            }
          }, function (state) {
            _this.cavLoggingService.error('Choose Plan', "Exception occured in the get subscriptions method ");

            _this.isChooseplanLoading = true;
          });
        } //method for Recomended

      }, {
        key: "setRecommendedPlan",
        value: function setRecommendedPlan() {
          var _iterator = _createForOfIteratorHelper(this.planTypes),
              _step;

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

              if (plan.recommended) {
                plan.selected = true;
                this.selectedPlanType = plan;
                this.planId = this.selectedPlanType.planId; // Initially, to check which plan type is selected in case "Pay As You Go" has already been purchased 

                if (this.selectedPlanType.planName === this.planTypes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN].planName) {
                  this.annualSubscriptionDuration = true;
                  this.isPayAsGo = false;
                  this.paymentPlans = this.planTypes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN].paymentPlans;
                  this.setPaymentPlanBanner();
                }

                return;
              }
            }
          } catch (err) {
            _iterator.e(err);
          } finally {
            _iterator.f();
          }
        }
      }, {
        key: "setDefaultValues",
        value: function setDefaultValues() {
          var _this2 = this;

          if (this.choosePlanService.confirmDetails.planType === _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_ENUM"].PAY_AS_YOU_GO) {
            this.planTypes.forEach(function (plan) {
              if (plan.planId === _this2.choosePlanService.confirmDetails.planType) {
                _this2.toggleActive(plan, plan.planId);
              }
            });
            this.chooseYourPlan = true;
            this.switchCustomizeSubscriptionSection = false;
            this.customizeSubscription = false;
            this.billingDetailsSection = true;
            this.billingDetails = true;
            this.continuePlan = true;
            this.payments = true;
            this.isFinalButtonDisabled = true;
            return;
          }

          this.planTypes.forEach(function (plan) {
            if (plan.planId === _this2.choosePlanService.confirmDetails.planType) {
              _this2.toggleActive(plan, plan.planId);
            }
          });
          var serviceNames = new Set(this.choosePlanService.confirmDetails.serviceDetails.map(function (service) {
            return service.serviceName;
          }));
          this.filteredProductList.forEach(function (product) {
            if (serviceNames.has(product.serviceName)) {
              _this2.productToggleActive(product);
            }
          });
          this.selectedProductMap.forEach(function (product) {
            if (serviceNames.has(product.serviceName)) {
              product.unitCount = _this2.choosePlanService.confirmDetails.serviceDetails.find(function (service) {
                return service.serviceName === product.serviceName;
              }).units;
            }
          });
          this.annualSubscriptionDuration = this.choosePlanService.confirmDetails.paymentDetails.paymentMode == _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_ENUM"].PAY_ANNUALLY ? true : false;
          this.subscriptionSection = true;
          this.continuePlan = true;
          this.productValidationError = false;
          this.switchCustomizeSubscriptionSection = true;
          this.customizeSubscription = true;
          this.paymentSection = true;
          this.payments = true;
          this.billingDetailsSection = true;
          this.billingDetails = true;
        }
      }, {
        key: "setPolicies",
        value: function setPolicies() {
          var _iterator2 = _createForOfIteratorHelper(this.filteredProductList),
              _step2;

          try {
            for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
              var product = _step2.value;
              product.retentionDaysList = [];

              if (product.policies.length > 1) {
                var _iterator3 = _createForOfIteratorHelper(product.policies),
                    _step3;

                try {
                  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
                    var policy = _step3.value;
                    var newPolicyIndex = product.retentionDaysList.length;
                    var temp = {
                      label: '',
                      value: '',
                      selected: false
                    };

                    if (policy.policyName.includes(_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["RETENTION_PERIOD_ENUM"].SEVEN_DAYS_RETENTION)) {
                      temp = {
                        label: policy.policyName,
                        value: policy.policyName,
                        selected: true
                      };
                    } else if (policy.policyName.includes(_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["RETENTION_PERIOD_ENUM"].FIFTEEN_DAYS_RETENTION)) {
                      temp = {
                        label: policy.policyName,
                        value: policy.policyName,
                        selected: false
                      };
                    } else if (policy.policyName.includes(_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["RETENTION_PERIOD_ENUM"].THIRTY_DAYS_RETENTION)) {
                      temp = {
                        label: policy.policyName,
                        value: policy.policyName,
                        selected: false
                      };
                    }

                    product.retentionDaysList.push(temp);

                    if (temp.selected) {
                      product.selectedRetentionDays = temp;
                      product.selectedRetentionDayLabel = temp.label;
                    }
                  }
                } catch (err) {
                  _iterator3.e(err);
                } finally {
                  _iterator3.f();
                }
              }
            }
          } catch (err) {
            _iterator2.e(err);
          } finally {
            _iterator2.f();
          }
        }
      }, {
        key: "getCustomerDetails",
        value: function getCustomerDetails() {
          return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee2() {
            var _this3 = this;

            var accountDetails;
            return _regenerator().w(function (_context2) {
              while (1) switch (_context2.n) {
                case 0:
                  accountDetails = {
                    saasProjectName: this.projectName,
                    saasEmail: this.customerEmail,
                    saasAccountName: this.accountName
                  };
                  this.choosePlanService.getCustomerDetails(accountDetails).subscribe(function (state) {
                    if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["CustomerDetailsLoadingState"]) {
                      return;
                    }

                    if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["CustomerDetailsLoadedState"]) {
                      _this3.customerInfo = state.data.data[0];
                      _this3.subscriptionType = _this3.customerInfo.subscriptionType;

                      if (_this3.customerInfo.country != null && _this3.customerInfo.state != null) {
                        _this3.customerBillingEmail = _this3.customerInfo.saasBillingEmail;
                        _this3.country = _this3.customerInfo.country;
                        _this3.state = _this3.customerInfo.state;
                        _this3.postalCode = _this3.customerInfo.postalCode;
                        _this3.city = _this3.customerInfo.city;
                        _this3.addressLine2 = _this3.customerInfo.addressLine2;
                        _this3.addressLine1 = _this3.customerInfo.addressLine1;
                        _this3.customerId = _this3.customerInfo.ppCustomerId;

                        var stateList = _this3.countries.find(function (country) {
                          return country.countryCode === _this3.country;
                        }).stateList;

                        if (stateList.length != 0) {
                          _this3.stateList = stateList.map(function (state) {
                            return {
                              label: state.state,
                              value: state.stateCode
                            };
                          });
                          _this3.state = _this3.stateList.find(function (state) {
                            return state.value === _this3.state;
                          }).value;
                        }
                      } else {
                        _this3.customerBillingEmail = _this3.customerEmail;
                      }

                      if (_this3.customerInfo.ppCustomerId != null) {
                        _this3.customerId = _this3.customerInfo.ppCustomerId;

                        _this3.getCards(false);
                      }
                    }
                  });

                case 1:
                  return _context2.a(2);
              }
            }, _callee2, this);
          }));
        }
      }, {
        key: "resetProducts",
        value: function resetProducts() {
          this.selectedProductMap.clear();
          if (this.productList == undefined || this.productList.length == 0) return;

          if (this.selectedPlanType.planName === this.planTypes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].PAY_AS_YOU_GO].planName) {
            var _iterator4 = _createForOfIteratorHelper(this.filteredProductList),
                _step4;

            try {
              for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
                var product = _step4.value;
                product.selected = true;
                this.selectedProductMap.set(product.templateId, product);
              }
            } catch (err) {
              _iterator4.e(err);
            } finally {
              _iterator4.f();
            }

            this.chooseYourProduct = true;
            this.subscriptionSection = false;
            this.customizeSubscription = false;
            this.billingDetails = true;
            this.payments = true;
            this.paymentSection = true;
          } else if (this.selectedPlanType.planName === this.planTypes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN].planName) {
            var _iterator5 = _createForOfIteratorHelper(this.filteredProductList),
                _step5;

            try {
              for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
                var _product = _step5.value;
                _product.selected = false;
              }
            } catch (err) {
              _iterator5.e(err);
            } finally {
              _iterator5.f();
            }

            this.chooseYourProduct = true;
            this.customizeSubscription = false;
            this.payments = false;
            this.billingDetails = false;
            this.paymentSection = false;
          }
        }
      }, {
        key: "onCountryChange",
        value: function onCountryChange(event) {
          if (event.value) {
            var stateList = this.countries.find(function (country) {
              return country.countryCode === event.value;
            }).stateList;
            this.stateList = stateList.map(function (state) {
              return {
                label: state.state,
                value: state.stateCode
              };
            });
          }
        }
      }, {
        key: "addNewCard",
        value: function addNewCard() {
          return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee3() {
            var me;
            return _regenerator().w(function (_context3) {
              while (1) switch (_context3.n) {
                case 0:
                  me = this;

                  if (!(this.customerId == null || this.customerId == undefined)) {
                    _context3.n = 2;
                    break;
                  }

                  _context3.n = 1;
                  return this.stripeCustomerCreation(true, true);

                case 1:
                  _context3.n = 3;
                  break;

                case 2:
                  me.createCheckSession();

                case 3:
                  return _context3.a(2);
              }
            }, _callee3, this);
          }));
        }
      }, {
        key: "createCheckSession",
        value: function createCheckSession() {
          var _this4 = this;

          var me = this; // Construct the host URL

          var ip = "".concat(this.config.$protocol, "//").concat(this.config._productConfig.$host);
          var base = me.sessionService.getBasePath(true, null, null); //Construct the success and cancel URLs

          var successUrl = ip + base + src_environments_environment__WEBPACK_IMPORTED_MODULE_7__["environment"].api.licenseManager.getCardStatusTemplate.endpoint + "?status=pass";
          var cancelUrl = ip + base + src_environments_environment__WEBPACK_IMPORTED_MODULE_7__["environment"].api.licenseManager.getCardStatusTemplate.endpoint + "?status=fail";
          var checkoutSessionDetails = {
            customerId: this.customerId,
            successUrl: successUrl,
            cancelUrl: cancelUrl,
            sessionId: "",
            sessionUrl: ""
          };
          this.stripeOps.createCheckoutSession(checkoutSessionDetails).subscribe(function (state) {
            if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["CreateCheckoutSessionLoadingState"]) {
              return;
            }

            if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["CreateCheckoutSessionLoadedState"]) {
              var checkoutSessionData = state.data.data[0];
              var sessionId = checkoutSessionData.sessionId;
              var sessionUrl = checkoutSessionData.sessionUrl;

              _this4.stripeOps.saveCard(sessionId, sessionUrl);

              _this4.getCards(true);
            }
          }, function (state) {// ERROR MESSAGE
          });
        }
      }, {
        key: "stripeCustomerCreation",
        value: function stripeCustomerCreation(sendRequestForCheckoutSession, createAccountAtPaymentGateway) {
          return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee4() {
            var _this5 = this;

            var newCustomer;
            return _regenerator().w(function (_context4) {
              while (1) switch (_context4.n) {
                case 0:
                  if (this.customerBillingEmail == undefined || this.customerBillingEmail == "") this.customerBillingEmail = this.customerEmail;
                  newCustomer = {
                    saasAccountName: this.accountName,
                    saasProjectName: this.projectName,
                    saasEmail: this.customerEmail,
                    saasBillingEmail: this.customerBillingEmail,
                    addressLine1: this.addressLine1,
                    addressLine2: this.addressLine2,
                    city: this.city,
                    state: this.state,
                    country: this.country,
                    postalCode: this.postalCode,
                    subscriptionType: _license_plan_service_license_plan_model__WEBPACK_IMPORTED_MODULE_5__["SubscriptionTypeEnum"].Free
                  }; // Create customer request and wait for the response

                  this.stripeOps.createCustomerRequest(newCustomer, createAccountAtPaymentGateway).subscribe(function (state) {
                    if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["CustomerDetailsLoadingState"]) {
                      return;
                    }

                    if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["CustomerDetailsLoadedState"]) {
                      _this5.customerInfo = state.data.data[0];
                      _this5.customerId = _this5.customerInfo.ppCustomerId;

                      _this5.getCards(false);

                      if (sendRequestForCheckoutSession) {
                        _this5.createCheckSession();
                      }
                    }

                    if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["CustomerDetailsLoadingErrorState"]) {
                      _this5.cavLoggingService.error('Choose Plan', "Exception occured in the stripe customer creation method ", state.error);
                    }
                  });

                case 1:
                  return _context4.a(2);
              }
            }, _callee4, this);
          }));
        }
      }, {
        key: "stripeCustomerUpdation",
        value: function stripeCustomerUpdation(customer) {
          return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee5() {
            var _this6 = this;

            return _regenerator().w(function (_context5) {
              while (1) switch (_context5.n) {
                case 0:
                  // update customer request and wait for the response
                  this.stripeOps.updateCustomerRequest(customer).subscribe(function (state) {
                    if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["CustomerDetailsLoadingState"]) {
                      return;
                    }

                    if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["CustomerDetailsLoadedState"]) {
                      _this6.customerInfo = state.data.data[0];
                      _this6.customerId = _this6.customerInfo.ppCustomerId;

                      _this6.createLicenseRequest();
                    }

                    if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["CustomerDetailsLoadingErrorState"]) {
                      _this6.cavLoggingService.error('Choose Plan', "Exception occured in the stripe customer updation method ", state.error);
                    }
                  });

                case 1:
                  return _context5.a(2);
              }
            }, _callee5, this);
          }));
        }
      }, {
        key: "updateBillingAddress",
        value: function updateBillingAddress() {
          if (this.customerId == null || this.customerId == undefined) {
            this.stripeCustomerCreation(false, true);
            this.createLicenseRequest();
          } else {
            if (this.customerInfo.addressLine1 == null || this.customerInfo.city == null || this.customerInfo.state == null || this.customerInfo.country == null || this.customerInfo.postalCode == null || this.customerBillingEmail != this.customerInfo.saasBillingEmail || this.customerInfo.addressLine1 != this.addressLine1 || this.customerInfo.addressLine2 != this.addressLine2 || this.customerInfo.city != this.city || this.customerInfo.state != this.state || this.customerInfo.country != this.country || this.customerInfo.postalCode != this.postalCode) {
              var customerUpdate = {
                saasAccountName: this.customerInfo.saasAccountName,
                saasProjectName: this.customerInfo.saasProjectName,
                saasEmail: this.customerEmail,
                saasBillingEmail: this.customerBillingEmail,
                addressLine1: this.addressLine1,
                addressLine2: this.addressLine2,
                city: this.city,
                state: this.state,
                country: this.country,
                postalCode: this.postalCode,
                subscriptionType: this.subscriptionType,
                ppCustomerId: this.customerInfo.ppCustomerId
              };
              this.stripeCustomerUpdation(customerUpdate);
            }
          }
        }
      }, {
        key: "filterProductsByPlanId",
        value: function filterProductsByPlanId(planId) {
          this.filteredProductList = this.productList.filter(function (product) {
            return product.planIds.includes(planId);
          });
        }
      }, {
        key: "onRetentionValueChange",
        value: function onRetentionValueChange(selectedPolicyName, product) {
          // Ensure the retentionDaysList exists and is populated
          if (product.retentionDaysList && product.retentionDaysList.length > 0) {
            // Find the index of the selected policy based on its name
            var selectedIndex = product.retentionDaysList.findIndex(function (policy) {
              return policy.label === selectedPolicyName;
            }); // If a valid index is found, proceed

            if (selectedIndex !== -1) {
              // Set all retentionDays to selected = false
              product.retentionDaysList.forEach(function (policy, index) {
                policy.selected = index === selectedIndex; // Only the selected index is true
              }); // Fetch the newly selected retention policy

              var selectedRetentionDay = product.retentionDaysList[selectedIndex]; // Update the product's selectedRetentionDays property

              product.selectedRetentionDays = selectedRetentionDay;
              product.selectedRetentionDayLabel = selectedRetentionDay.label; // Update the map with the modified product

              if (this.selectedProductMap.has(product.templateId)) {
                this.selectedProductMap.set(product.templateId, Object.assign(Object.assign({}, product), {
                  selectedRetentionDays: selectedRetentionDay,
                  selectedRetentionDayLabel: selectedRetentionDay.label
                }));
              } // Optionally store the index for other purposes


              this.policyIndex = selectedIndex;
              this.cd.detectChanges();
            } else {
              // Handle invalid policyName
              this.cavLoggingService.error('Choose Plan', 'Exception occurred in the retention day selection method', 'No retention day matched with the selected policy name');
            }
          } else {
            // Handle the case where retentionDaysList is not valid
            this.cavLoggingService.error('Choose Plan', 'Exception occurred in the retention day selection method', 'Retention days list is empty or undefined');
          }
        }
      }, {
        key: "getPricingDetails",
        value: function getPricingDetails(product, subscriptionType) {
          if (product.policies.length == 1) {
            var _iterator6 = _createForOfIteratorHelper(product.policies[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["INDEX_ENUM"].PRODUCT_POLICY_INDEX].paymentModes[this.paymentPlanNumber].pricing),
                _step6;

            try {
              for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
                var p = _step6.value;
                if (p.subscriptionType == subscriptionType) return p;
              }
            } catch (err) {
              _iterator6.e(err);
            } finally {
              _iterator6.f();
            }
          }

          var _iterator7 = _createForOfIteratorHelper(product.policies[this.policyIndex].paymentModes[this.paymentPlanNumber].pricing),
              _step7;

          try {
            for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
              var _p = _step7.value;
              if (_p.subscriptionType == subscriptionType) return _p;
            }
          } catch (err) {
            _iterator7.e(err);
          } finally {
            _iterator7.f();
          }
        }
      }, {
        key: "getCurrencySymbol",
        value: function getCurrencySymbol(currency) {
          this.getMonthlyTotal();

          if (currency == 'USD') {
            return '$';
          } else {
            return '$';
          }
        }
      }, {
        key: "toggleActive",
        value: function toggleActive(plan, pId) {
          var _this7 = this;

          // Prevent toggling if "Pay As You Go" is already purchased and the same plan is clicked again
          if (this.isAlreadyPayAsYouGoPurchased && pId === _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_ENUM"].PAY_AS_YOU_GO) {
            if (this.selectedPlanType.planName === this.planTypes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN].planName) {
              this.isFinalButtonDisabled = true;
            }

            return;
          }

          this.planId = pId;
          this.planTypes.forEach(function (item) {
            if (item === plan) {
              item.selected = true;

              if (item.planName === _this7.planTypes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN].planName) {
                _this7.annualPlan = true;
              } else {
                _this7.annualPlan = false;
              }
            } else {
              item.selected = false;
            }
          });
          this.selectedPlanType = plan;
          this.resetProducts(); // Check if the selected plan is "Pay As You Go"

          if (this.selectedPlanType.planName === _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_NAME_ENUM"].PAY_AS_YOUGO) {
            this.annualSubscriptionDuration = false;
            this.isPayAsGo = true;
            this.productValidationError = false;
          } else {
            this.annualSubscriptionDuration = true;
            this.isPayAsGo = false;
            this.paymentPlans = this.planTypes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN].paymentPlans;
            this.setPaymentPlanBanner();
          }

          this.filteredProductList = this.productList.filter(function (product) {
            return product.planIds.includes(pId);
          });
        }
      }, {
        key: "productToggleActive",
        value: function productToggleActive(product) {
          if (this.planTypes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].PAY_AS_YOU_GO].selected) return;
          product.selected = !product.selected;

          if (product.selected) {
            product.unitCount = 1;
            this.selectedProductMap.set(product.templateId, product);
          } else {
            product.unitCount = 0;
            this.selectedProductMap["delete"](product.templateId);
          }

          if (this.selectedProductMap.size) {
            this.productSelected = true;
            this.setPaymentPlanBanner();
          } else {
            this.productSelected = false;
            this.discountedPrice = 0;
            this.annuallyPrice = 0;
            this.monthlyPrice = 0;
            this.totalPrice = 0;
          }
        }
      }, {
        key: "deleteSelectedProduct",
        value: function deleteSelectedProduct(product) {
          product.selected = false;
          this.selectedProductMap["delete"](product.templateId);
        }
      }, {
        key: "planChoose",
        value: function planChoose() {
          // If "Pay As You Go" plan is already purchased, do nothing on selection
          if (this.isAlreadyPayAsYouGoPurchased) {
            // If the user has already purchased "Pay As You Go", then after logging into the License Manager, the plan is selected as "Create Your Own Plan and checkout button is disabled"
            if (this.selectedPlanType.planName === this.planTypes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN].planName) {
              this.isFinalButtonDisabled = true;
            }

            return;
          }

          this.chooseYourPlan = true;
          this.switchCustomizeSubscriptionSection = false;
          this.customizeSubscription = false;
          this.billingDetailsSection = true;
          this.billingDetails = true;
          this.continuePlan = true;
          this.payments = true;
          this.isFinalButtonDisabled = true;

          if (this.selectedPlanType.planName === this.planTypes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN].planName) {
            this.chooseYourProduct = false;
            this.switchCustomizeSubscriptionSection = false;
            this.payments = false;
            this.billingDetails = false;
            this.billingDetailsSection = false;
            this.subscriptionSection = true;
            this.isFinalButtonDisabled = true;
          }

          if (this.selectedPlanType.planName === this.planTypes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].PAY_AS_YOU_GO].planName) {
            if (this.selectedProductMap.size !== 0 && this.selectedCardIndex !== -1 && this.customerInfo.addressLine1 != null && this.customerInfo.city != null && this.customerInfo.country != null && this.customerInfo.postalCode != null && this.customerInfo.saasBillingEmail != null && this.customerInfo.state != null) {
              this.isFinalButtonDisabled = false;
            }
          }
        }
      }, {
        key: "productChoose",
        value: function productChoose() {
          this.chooseYourPlan = true;
          this.chooseYourProduct = true;
          this.switchCustomizeSubscriptionSection = false;
          this.customizeSubscription = false;
          this.billingDetailsSection = true;
          this.billingDetails = true;
          this.continuePlan = true;
          this.payments = true;

          if (this.selectedPlanType.planName === this.planTypes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN].planName) {
            if (this.selectedProductMap.size == 0 && this.planId != 0) {
              this.productValidationError = true;
              this.isFinalButtonDisabled = true;
              this.subscriptionSection = false;
              this.switchCustomizeSubscriptionSection = false;
              this.customizeSubscription = false;
              this.paymentSection = false;
              this.payments = false;
              this.billingDetailsSection = false;
              this.billingDetails = false;
              return;
            }

            this.subscriptionSection = true;
            this.productValidationError = false;
            this.switchCustomizeSubscriptionSection = true;
            this.customizeSubscription = true;
            this.paymentSection = true;
            this.payments = true;
            this.billingDetailsSection = true;
            this.billingDetails = true;

            if (this.selectedProductMap.size !== 0 && this.selectedCardIndex !== -1 && this.customerInfo.addressLine1 != null && this.customerInfo.city != null && this.customerInfo.country != null && this.customerInfo.postalCode != null && this.customerInfo.saasBillingEmail != null && this.customerInfo.state != null) {
              this.isFinalButtonDisabled = false;
            }
          }
        }
      }, {
        key: "subscriptionCustomize",
        value: function subscriptionCustomize() {
          this.chooseYourPlan = true;
          this.chooseYourProduct = true;
          this.switchCustomizeSubscriptionSection = true;
          this.customizeSubscription = true;
          this.payments = false;
          this.billingDetailsSection = false;
          this.billingDetails = false;
          this.paymentSection = false;
        }
      }, {
        key: "choosePayment",
        value: function choosePayment() {
          if (this.selectedPlanType.planName === this.planTypes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN].planName) {
            this.chooseYourPlan = true;
            this.chooseYourProduct = true;
            this.switchCustomizeSubscriptionSection = true;
            this.customizeSubscription = true;
            this.billingDetailsSection = true;
            this.billingDetails = true;
            this.payments = true;
            this.paymentSection = true;
          }
        }
      }, {
        key: "billingDeatilSection",
        value: function billingDeatilSection() {
          var _a, _b, _c, _d, _e; // Check if all required fields are not null or empty


          if (((_a = this.addressLine1) === null || _a === void 0 ? void 0 : _a.trim()) && ((_b = this.city) === null || _b === void 0 ? void 0 : _b.trim()) && ((_c = this.state) === null || _c === void 0 ? void 0 : _c.trim()) && ((_d = this.country) === null || _d === void 0 ? void 0 : _d.trim()) && ((_e = this.postalCode) === null || _e === void 0 ? void 0 : _e.trim())) {
            this.isFinalButtonDisabled = false; // Enable button
          } else {
            this.isFinalButtonDisabled = true; // Keep button disabled
          }
        }
      }, {
        key: "paymentSectionFunc",
        value: function paymentSectionFunc(event) {
          event.stopPropagation();
          this.paymentSection = true;
          this.chooseYourPlan = true;
          this.chooseYourProduct = true;
          this.switchCustomizeSubscriptionSection = true;
          this.payments = true;
        }
      }, {
        key: "createServiceDetailsRequests",
        value: function createServiceDetailsRequests(serviceDetails) {
          var _this8 = this;

          var serviceArray = [];
          serviceDetails.forEach(function (value, key) {
            serviceArray.push({
              units: value.unitCount,
              serviceName: value.serviceName,
              parameter: value.parameter,
              policyId: value.policies[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["INDEX_ENUM"].PRODUCT_POLICY_INDEX].policyId,
              price: value.policies[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["INDEX_ENUM"].PRODUCT_POLICY_INDEX].paymentModes[_this8.paymentPlanNumber].pricing[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["INDEX_ENUM"].PRODUCT_PRICE_INDEX].unitPrice,
              monthlyPrice: value.policies[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["INDEX_ENUM"].PRODUCT_POLICY_INDEX].paymentModes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_ENUM"].PAY_MONTHLY].pricing[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["INDEX_ENUM"].PRODUCT_PRICE_INDEX].unitPrice,
              unitDetails: value.parameterDescription,
              thresholdPerUnit: value.thresholdPerUnit
            });
          });
          return serviceArray;
        }
      }, {
        key: "createNewPricingRequests",
        value: function createNewPricingRequests(pricingData) {
          var pricingArray = [];
          pricingData.forEach(function (value, key) {
            pricingArray.push({
              units: value.unitCount,
              serviceName: value.serviceName,
              parameter: value.parameter,
              policyId: value.policies[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["INDEX_ENUM"].PRODUCT_POLICY_INDEX].policyId
            });
          });
          return pricingArray;
        }
      }, {
        key: "purchaseConfirmFun",
        value: function purchaseConfirmFun() {
          if (this.customerInfo.addressLine1 == null || this.customerInfo.city == null || this.customerInfo.state == null || this.customerInfo.country == null || this.customerInfo.postalCode == null || this.customerBillingEmail != this.customerInfo.saasBillingEmail || this.customerInfo.addressLine1 != this.addressLine1 || this.customerInfo.addressLine2 != this.addressLine2 || this.customerInfo.city != this.city || this.customerInfo.state != this.state || this.customerInfo.country != this.country || this.customerInfo.postalCode != this.postalCode) {
            this.updateBillingAddress();
          } else {
            this.createLicenseRequest();
          }
        }
      }, {
        key: "deleteCustomerCard",
        value: function deleteCustomerCard(card) {
          var me = this; // Show confirmation dialog before deleting the card

          me.confirmDialogService.confirm({
            message: "Are you sure you want to delete the card associated with ".concat(card.cardHolderName, "?"),
            header: 'Confirmation',
            icon: 'pi pi-exclamation-triangle',
            accept: function accept() {
              // If user accepts, proceed to delete the card
              me.deleteCard(card);
            },
            reject: function reject() {// If user rejects, do nothing
            }
          });
        }
      }, {
        key: "deleteCard",
        value: function deleteCard(card) {
          var _this9 = this;

          this.choosePlanService.deleteCard(card.ppPaymentMethodId).subscribe(function (state) {
            if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["DeleteCardLoadingState"]) {
              // Still loading, no action needed
              return;
            }

            if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["DeleteCardLoadedState"]) {
              // Card successfully deleted, refresh card list and show success message
              _this9.getCards(false);

              _this9.messageService.showSuccess("Card is successfully deleted.");
            }

            if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["DeleteCardLoadingErrorState"]) {
              // Log error if deletion failed
              _this9.cavLoggingService.error('Choose Plan', "Exception occurred in the delete card method", state.error);
            }
          });
        }
      }, {
        key: "setCardAsDefault",
        value: function setCardAsDefault(card) {
          var _this0 = this;

          this.choosePlanService.setCardAsDefault(card.ppCustomerId, card.ppPaymentMethodId).subscribe(function (state) {
            if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["setCardAsDefaultLoadingState"]) {
              // Still loading, no action needed
              return;
            }

            if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["setCardAsDefaultLoadedState"]) {
              // Show success message only if multiple payment methods exist
              if (Array.isArray(_this0.paymentMethods) && _this0.paymentMethods.length !== 1) {
                _this0.messageService.showSuccess("Card has been set as default successfully.");
              }
            }

            if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["setCardAsDefaultErrorState"]) {
              // Log and show error message if setting default card fails
              _this0.cavLoggingService.error('Choose Plan', "Exception occurred in the setCardAsDefault method", state.error);

              _this0.messageService.showError("Failed to set card as default.");
            }
          });
        }
      }, {
        key: "getMonthlyTotal",
        value: function getMonthlyTotal() {
          var _this1 = this;

          var totalPrice = 0;
          this.monthlyPrice = 0;
          this.discountedPrice = 0;
          this.annuallyPrice = 0;
          this.selectedProductMap.forEach(function (value) {
            // Find the matching retention policy
            var matchingPolicy = value.policies.find(function (policy) {
              return policy.policyName === value.selectedRetentionDayLabel;
            }); // Fallback to product policy if no match found

            var paymentModes = matchingPolicy ? matchingPolicy.paymentModes : value.policies[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["INDEX_ENUM"].PRODUCT_POLICY_INDEX].paymentModes;
            var selectedPaymentMode = paymentModes[_this1.paymentPlanNumber]; // Get the selected payment plan
            // Check if the payment plan is Annual

            if (selectedPaymentMode.value === _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_ENUM"].PAY_ANNUALLY) {
              // If it's an annual plan, calculate the total price
              // And also calculate the monthly price
              totalPrice += value.unitCount * selectedPaymentMode.pricing[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["INDEX_ENUM"].PRODUCT_PRICE_INDEX].unitPrice;
              _this1.monthlyPrice += value.unitCount * paymentModes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_ENUM"].PAY_MONTHLY].pricing[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["INDEX_ENUM"].PRODUCT_PRICE_INDEX].unitPrice;
            } else {
              // If it's a monthly plan, use the price directly
              totalPrice += value.unitCount * selectedPaymentMode.pricing[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["INDEX_ENUM"].PRODUCT_PRICE_INDEX].unitPrice;
              _this1.annuallyPrice += value.unitCount * paymentModes[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_ENUM"].PAY_ANNUALLY].pricing[_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["INDEX_ENUM"].PRODUCT_PRICE_INDEX].unitPrice;
            }
          });

          if (this.annualSubscriptionDuration) {
            this.annuallyPrice = totalPrice;
            this.totalPrice = parseFloat((totalPrice * 12).toFixed(2));
          } else {
            this.monthlyPrice = totalPrice;
            this.totalPrice = parseFloat(totalPrice.toFixed(2));
          }
        }
      }, {
        key: "removeFromMap",
        value: function removeFromMap(product) {
          var _this10 = this;

          this.selectedProductMap.forEach(function (value, key) {
            if (value.templateId === product.value.templateId) {
              _this10.selectedProductMap["delete"](key);

              product.value.selected = false;
            }
          });

          if (this.selectedProductMap.size === 0) {
            this.productValidationError = true;
            this.productSelected = false;
            this.customizeSubscription = false;
            this.paymentSection = false;
            this.billingDetails = false;
            this.isFinalButtonDisabled = true;
            this.discountedPrice = 0;
            this.annuallyPrice = 0;
            this.monthlyPrice = 0;
            this.totalPrice = 0;
          } else {
            this.setPaymentPlanBanner();
          }

          this.cd.detectChanges();
        }
      }, {
        key: "planSelected",
        value: function planSelected() {
          var selectedPlan = this.planTypes.find(function (plan) {
            return plan.selected;
          });
          return selectedPlan ? selectedPlan.planName : null;
        }
      }, {
        key: "logSelection",
        value: function logSelection() {
          this.selectedPlanMode = this.annualSubscriptionDuration ? _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_NAME_ENUM"].ANNUALLY : _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_NAME_ENUM"].MONTHLY;
          this.paymentPlanNumber = this.annualSubscriptionDuration == true ? _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_ENUM"].PAY_ANNUALLY : _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_ENUM"].PAY_MONTHLY;
          this.setPaymentPlanBanner();
        }
      }, {
        key: "setPaymentPlanBanner",
        value: function setPaymentPlanBanner() {
          var _this11 = this;

          this.discountedPrice = 0;
          this.selectedPlan = this.paymentPlans.find(function (plan) {
            return _this11.selectedPlanMode === _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_NAME_ENUM"].MONTHLY && plan.name === _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_PLAN_ENUM"].MONTHLY || _this11.selectedPlanMode === _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_NAME_ENUM"].ANNUALLY && plan.name === _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_PLAN_ENUM"].ANNUALLY;
          });
          this.getMonthlyTotal();

          if (this.selectedPlan) {
            if (this.selectedProductMap.size) {
              var discountedPrice = 0;

              if (this.selectedPlan.name === _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_PLAN_ENUM"].MONTHLY) {
                discountedPrice = this.totalPrice - this.annuallyPrice;
              } else {
                discountedPrice = this.monthlyPrice - this.annuallyPrice;
              }

              discountedPrice = discountedPrice * 12;
              discountedPrice = parseFloat(discountedPrice.toFixed(2)); // Preserve original template for bannerAfter

              if (!this.selectedPlan.originalBannerAfter) {
                this.selectedPlan.originalBannerAfter = this.selectedPlan.bannerAfter; // Save original
              } // Break bannerAfter into parts


              var _this$selectedPlan$or = this.selectedPlan.originalBannerAfter.split('<AMOUNT>'),
                  _this$selectedPlan$or2 = _slicedToArray(_this$selectedPlan$or, 2),
                  beforeAmount = _this$selectedPlan$or2[0],
                  afterAmount = _this$selectedPlan$or2[1];

              this.paymentBanner = [beforeAmount, "$".concat(discountedPrice), afterAmount];
            }
          }
        }
      }, {
        key: "selectPlan",
        value: function selectPlan(plan) {
          this.selectedPlanMode = plan;
          this.annualSubscriptionDuration = plan === _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_NAME_ENUM"].ANNUALLY;
        }
      }, {
        key: "getCards",
        value: function getCards(updatedCardListFlag) {
          return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee6() {
            var _this12 = this;

            var customer;
            return _regenerator().w(function (_context6) {
              while (1) switch (_context6.n) {
                case 0:
                  if (!(this.customerId == null || this.customerId == undefined)) {
                    _context6.n = 1;
                    break;
                  }

                  _context6.n = 1;
                  return this.stripeCustomerCreation(false, true);

                case 1:
                  // Construct customer object to send in the API request
                  customer = {
                    saasAccountName: this.accountName,
                    saasProjectName: this.projectName,
                    saasEmail: this.customerEmail,
                    updatedCardListFlag: updatedCardListFlag
                  }; // Call service to get saved payment methods

                  this.choosePlanService.getPaymentMethods(customer).subscribe(function (state) {
                    if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["CardDetailsLoadingState"]) {
                      // Still loading, do nothing
                      return;
                    }

                    if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["CardDetailsLoadedState"]) {
                      // Store previous list if flag is true
                      if (updatedCardListFlag) {
                        _this12.previousPaymentMethod = _this12.paymentMethods;
                      } // Update current list of payment methods


                      _this12.paymentMethods = state.data.data; // If only one card exists and it's not marked as default, set it as default

                      if (Array.isArray(_this12.paymentMethods) && _this12.paymentMethods.length == 1 && !_this12.paymentMethods[0].defaultPayMethod) {
                        _this12.setCardAsDefault(_this12.paymentMethods[0]);
                      } // Call method to mark the default card visually or in UI logic


                      _this12.selectDefaultCard(updatedCardListFlag);
                    }

                    if (state instanceof _service_choose_plan_state__WEBPACK_IMPORTED_MODULE_4__["CardDetailsLoadingErrorState"]) {
                      // Log any error encountered during API call
                      _this12.cavLoggingService.error('Choose Plan', "Exception occurred in the getCards method", state.error);
                    }
                  });

                case 2:
                  return _context6.a(2);
              }
            }, _callee6, this);
          }));
        }
      }, {
        key: "selectDefaultCard",
        value: function selectDefaultCard(updatedCardListFlag) {
          var _this13 = this;

          // Find the index of the default payment method
          var defaultIndex = this.paymentMethods.findIndex(function (method) {
            return method.defaultPayMethod;
          }); // Set the selectedCardIndex to the default one if exists

          if (defaultIndex !== -1 && !updatedCardListFlag) {
            this.selectedCardIndex = defaultIndex;

            if (this.selectedProductMap.size !== 0 && defaultIndex !== -1 && this.customerInfo.addressLine1 != null && this.customerInfo.city != null && this.customerInfo.country != null && this.customerInfo.postalCode != null && this.customerInfo.saasBillingEmail != null && this.customerInfo.state != null) {
              this.isFinalButtonDisabled = false;
            }
          } else {
            if (this.previousPaymentMethod.length) {
              this.selectedCardIndex = this.paymentMethods.findIndex(function (newCard) {
                return !_this13.previousPaymentMethod.some(function (prevCard) {
                  return newCard.ppPaymentMethodId === prevCard.ppPaymentMethodId;
                });
              }); // Select the latest card
            } else {
              this.selectedCardIndex = this.paymentMethods.indexOf(this.paymentMethods[0]);
            }

            if (defaultIndex === -1) {
              this.paymentMethods[this.selectedCardIndex].defaultPayMethod = true;
              this.paymentMethods[this.selectedCardIndex].makeItDefault = true;
            }

            if (this.selectedProductMap.size !== 0 && defaultIndex !== -1 && this.customerInfo.addressLine1 != null && this.customerInfo.city != null && this.customerInfo.country != null && this.customerInfo.postalCode != null && this.customerInfo.saasBillingEmail != null && this.customerInfo.state != null) {
              this.isFinalButtonDisabled = false;
            }
          }
        } // Method to handle card click and create customer request

      }, {
        key: "onCardClick",
        value: function onCardClick(m, index) {
          this.selectedCardIndex = index; // Enable the final button

          this.isFinalButtonDisabled = false;
        } // Helper method to create a new customer request

      }, {
        key: "createLicenseRequest",
        value: function createLicenseRequest() {
          this.customerNewRequest = {
            accountName: this.accountName,
            projectName: this.projectName,
            subscriptionType: _license_plan_service_license_plan_model__WEBPACK_IMPORTED_MODULE_5__["SubscriptionTypeEnum"].Pro,
            customerDetails: {
              ppCustomerId: this.customerId,
              customerName: this.accountName,
              email: this.customerEmail,
              address: null
            },
            paymentDetails: {
              paymentMethodId: this.paymentMethods[this.selectedCardIndex].ppPaymentMethodId,
              paymentMode: this.selectedPlanType.planId == _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_ENUM"].PAY_AS_YOU_GO ? _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PAYMENT_MODE_ENUM"].PAY_MONTHLY : this.paymentPlanNumber,
              planType: this.selectedPlanType.planId == _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_ENUM"].PAY_AS_YOU_GO ? _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].PAY_AS_YOU_GO : _service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_13__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN,
              paymentToken: null,
              makeItDefault: this.paymentMethods[this.selectedCardIndex].defaultPayMethod
            },
            servicesDetails: this.createNewPricingRequests(this.selectedProductMap)
          };
          this.customerConfirmationDetails = {
            accountName: this.accountName,
            companyName: this.projectName,
            billingEmail: this.customerEmail,
            billingAddress: {
              address_line1: this.addressLine1,
              address_line2: this.addressLine2,
              city: this.city,
              state: this.state,
              country: this.country,
              postal_code: this.postalCode
            },
            planTypes: this.planTypes,
            planType: this.selectedPlanType.planId,
            paymentDetails: this.customerNewRequest.paymentDetails,
            cardDetails: this.paymentMethods[this.selectedCardIndex],
            serviceDetails: this.createServiceDetailsRequests(this.selectedProductMap),
            monthlyPrice: this.monthlyPrice,
            customerInfo: this.customerInfo,
            annuallyPrice: this.annuallyPrice,
            subscriptionType: this.subscriptionType
          };
          this.choosePlanService.customerNewRequest = this.customerNewRequest;
          this.choosePlanService.confirmDetails = this.customerConfirmationDetails;
          this.paymentMethods = [];
          this.router.navigateByUrl('LicenseManager/purchaseConfirm');
        }
      }, {
        key: "setAsDefault",
        value: function setAsDefault(index, event) {
          // Prevent the click event from propagating to the parent div
          event.stopPropagation();

          if (this.checked) {
            // If the checkbox is checked, set the clicked card as the default
            this.paymentMethods.forEach(function (pm) {
              return pm.defaultPayMethod = false;
            });
            this.paymentMethods[index].defaultPayMethod = true;
            this.setCardAsDefault(this.paymentMethods[index]);
          } else {
            // If the checkbox is unchecked, unset the default card
            this.paymentMethods[index].defaultPayMethod = false;
          } // Optionally update the selected card index


          this.selectedCardIndex = this.checked ? index : null;
          this.checked = !this.checked;
        }
      }, {
        key: "stopPropogate",
        value: function stopPropogate(event) {
          event.stopPropagation();
        }
      }, {
        key: "validateBillingEmail",
        value: function validateBillingEmail() {
          var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;

          if (!emailRegex.test(this.customerBillingEmail)) {
            this.billingEmailError = 'Please enter a valid email address.';
            this.isFinalButtonDisabled = true;
          } else {
            this.billingEmailError = '';
            this.isFinalButtonDisabled = false;
            this.billingDeatilSection();
          }
        }
      }, {
        key: "ngOnDestroy",
        value: function ngOnDestroy() {
          if (this.sessionService.checkFreeTrialLicenseExpires()) {
            this.sessionService.showLicenseExpiryDialog = true;
          }

          this.sessionService.userUpgradingLicense = false;
        }
      }]);
    }();

    ChoosePlanComponent.ctorParameters = function () {
      return [{
        type: _license_plan_service_license_plan_service__WEBPACK_IMPORTED_MODULE_9__["LicensePlanService"]
      }, {
        type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"]
      }, {
        type: _service_choose_plan_service__WEBPACK_IMPORTED_MODULE_3__["ChoosePlanService"]
      }, {
        type: src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_10__["CavMessageService"]
      }, {
        type: _angular_forms__WEBPACK_IMPORTED_MODULE_6__["FormBuilder"]
      }, {
        type: _service_stripe_operations_service__WEBPACK_IMPORTED_MODULE_8__["StripeOperationsService"]
      }, {
        type: src_app_pages_exec_dashboard_services_exec_dashboard_config_service__WEBPACK_IMPORTED_MODULE_15__["ExecDashboardConfigService"]
      }, {
        type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_11__["SessionService"]
      }, {
        type: src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_14__["CavLoggingService"]
      }, {
        type: src_app_shared_cav_license_services_cav_license_service__WEBPACK_IMPORTED_MODULE_16__["CavLicenseService"]
      }, {
        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"]
      }, {
        type: primeng_api__WEBPACK_IMPORTED_MODULE_12__["ConfirmationService"]
      }];
    };

    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])('paymentRef', {
      "static": true
    })], ChoosePlanComponent.prototype, "paymentRef", void 0);
    ChoosePlanComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
      selector: 'app-choose-plan',
      template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! raw-loader!./choose-plan.component.html */
      "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/choose-plan/choose-plan.component.html"))["default"],
      styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! ./choose-plan.component.scss */
      "./src/app/pages/tools/license-manager/choose-plan/choose-plan.component.scss"))["default"]]
    })], ChoosePlanComponent);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/choose-plan/choose-plan.module.ts":
  /*!*******************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/choose-plan/choose-plan.module.ts ***!
    \*******************************************************************************/

  /*! exports provided: ChoosePlanModule */

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

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


    __webpack_require__.d(__webpack_exports__, "ChoosePlanModule", function () {
      return ChoosePlanModule;
    });
    /* 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 _choose_plan_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ./choose-plan.component */
    "./src/app/pages/tools/license-manager/choose-plan/choose-plan.component.ts");
    /* harmony import */


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


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


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


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


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


    var src_app_shared_help_help_module__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
    /*! src/app/shared/help/help.module */
    "./src/app/shared/help/help.module.ts");
    /* harmony import */


    var _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(
    /*! @angular/material/tooltip */
    "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/tooltip.js"); // import { NgxStripeModule } from 'ngx-stripe';


    var routes = [{
      path: 'choosePlan',
      component: _choose_plan_component__WEBPACK_IMPORTED_MODULE_3__["ChoosePlanComponent"]
    }];
    var imports = [_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_5__["FormsModule"], primeng__WEBPACK_IMPORTED_MODULE_4__["InputSwitchModule"], primeng__WEBPACK_IMPORTED_MODULE_4__["ButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_4__["SpinnerModule"], primeng__WEBPACK_IMPORTED_MODULE_4__["RadioButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_4__["InputTextModule"], primeng__WEBPACK_IMPORTED_MODULE_4__["DropdownModule"], primeng__WEBPACK_IMPORTED_MODULE_4__["DialogModule"], _angular_common_http__WEBPACK_IMPORTED_MODULE_7__["HttpClientModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_5__["ReactiveFormsModule"], src_app_shared_help_help_module__WEBPACK_IMPORTED_MODULE_9__["HelpModule"], src_app_shared_cav_loader_cav_loader_module__WEBPACK_IMPORTED_MODULE_8__["CavLoaderModule"], _angular_material_tooltip__WEBPACK_IMPORTED_MODULE_10__["MatTooltipModule"], primeng__WEBPACK_IMPORTED_MODULE_4__["CheckboxModule"], primeng__WEBPACK_IMPORTED_MODULE_4__["ConfirmDialogModule"] // NgxStripeModule.forRoot(environment.stripe.publicKey)
    ];
    var components = [_choose_plan_component__WEBPACK_IMPORTED_MODULE_3__["ChoosePlanComponent"]];

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

    ChoosePlanModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
      declarations: [components],
      imports: [imports, _angular_router__WEBPACK_IMPORTED_MODULE_6__["RouterModule"].forChild(routes)],
      exports: [_angular_router__WEBPACK_IMPORTED_MODULE_6__["RouterModule"], _choose_plan_component__WEBPACK_IMPORTED_MODULE_3__["ChoosePlanComponent"]]
    })], ChoosePlanModule);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/choose-plan/service/stripe-operations.service.ts":
  /*!**********************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/choose-plan/service/stripe-operations.service.ts ***!
    \**********************************************************************************************/

  /*! exports provided: StripeOperationsService */

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

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


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


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


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


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


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


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


    var src_app_core_store_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
    /*! src/app/core/store/store */
    "./src/app/core/store/store.ts");
    /* harmony import */


    var _choose_plan_state__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! ./choose-plan.state */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.state.ts");
    /* harmony import */


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

    var StripeOperationsService = /*#__PURE__*/function (_src_app_core_store_s) {
      function StripeOperationsService(http, sessionService) {
        var _this14;

        _classCallCheck(this, StripeOperationsService);

        _this14 = _callSuper(this, StripeOperationsService);
        _this14.http = http;
        _this14.sessionService = sessionService;
        return _this14;
      }

      _inherits(StripeOperationsService, _src_app_core_store_s);

      return _createClass(StripeOperationsService, [{
        key: "createCustomerRequest",
        value: function createCustomerRequest(customerRequest, createAccountAtPaymentGateway) {
          var me = this;
          var output = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
          setTimeout(function () {
            output.next(new _choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["CustomerDetailsLoadingState"]());
          }, 0);
          var base = me.sessionService.getBasePath(true, null, null);
          var path = src_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].api.licenseManager.createStripeAccount.endpoint + "?createAccountAtPaymentGateway=" + createAccountAtPaymentGateway;
          me.controller.post(path, customerRequest, base).subscribe(function (data) {
            output.next(new _choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["CustomerDetailsLoadedState"](data));
            output.complete();
          }, function (e) {
            output.error(new _choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["CustomerDetailsLoadingErrorState"](e));
            output.complete();
          });
          return output;
        }
      }, {
        key: "updateCustomerRequest",
        value: function updateCustomerRequest(customerRequest) {
          var me = this;
          var output = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
          setTimeout(function () {
            output.next(new _choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["CustomerDetailsLoadingState"]());
          }, 0);
          var base = me.sessionService.getBasePath(true, null, null);
          var path = src_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].api.licenseManager.updateStripeAccount.endpoint;
          me.controller.post(path, customerRequest, base).subscribe(function (data) {
            output.next(new _choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["CustomerDetailsLoadedState"](data));
            output.complete();
          }, function (e) {
            output.error(new _choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["CustomerDetailsLoadingErrorState"](e));
            output.complete();
          });
          return output;
        }
      }, {
        key: "getUrlWithBase",
        value: function getUrlWithBase(url) {
          var me = this;
          return me.controller.url(url);
        }
      }, {
        key: "createCheckoutSession",
        value: function createCheckoutSession(checkoutSessionDetails) {
          var me = this;
          var output = new rxjs__WEBPACK_IMPORTED_MODULE_4__["Subject"]();
          setTimeout(function () {
            output.next(new _choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["CreateCheckoutSessionLoadingState"]());
          }, 0);
          var base = me.sessionService.getBasePath(true, null, null);
          var path = src_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].api.licenseManager.createStripeCheckoutSession.endpoint; // const path = "/CavLicensing/cr/account/createCheckoutSession";

          me.controller.post(path, checkoutSessionDetails, base) // me.controller.post(path, CheckoutSessionDetails)
          .subscribe(function (data) {
            output.next(new _choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["CreateCheckoutSessionLoadedState"](data));
            output.complete();
          }, function (e) {
            output.error(new _choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["CreateCheckoutSessionErrorState"](e));
            output.complete();
          });
          return output;
        }
      }, {
        key: "saveCard",
        value: function saveCard(sessionId, sessionUrl) {
          return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee7() {
            return _regenerator().w(function (_context7) {
              while (1) switch (_context7.n) {
                case 0:
                  this.paymentGatewayPopUp(sessionId, sessionUrl);

                case 1:
                  return _context7.a(2);
              }
            }, _callee7, this);
          }));
        }
      }, {
        key: "paymentGatewayPopUp",
        value: function paymentGatewayPopUp(sessionId, sessionUrl) {
          var width = 500;
          var height = 700;
          var left = window.screen.width / 2 - width / 2;
          var top = window.screen.height / 2 - height / 2; // Adding payment gateway information into local storage so that when redirected to success url it should not go to welcome page

          localStorage.setItem("paymentGateway", "stripe");
          this.openPopUpWindow(sessionId, sessionUrl, 'stripeCheckout', width, height, top, left);
        }
      }, {
        key: "openPopUpWindow",
        value: function openPopUpWindow(sessionId, sessionUrl, target, width, height, top, left) {
          var _this15 = this;

          this.popUpWindow = window.open(sessionUrl, target, "width=".concat(width, ",height=").concat(height, ",top=").concat(top, ",left=").concat(left));

          if (this.popUpWindow) {
            var interval = setInterval(function () {
              if (_this15.popUpWindow && _this15.popUpWindow.closed) {
                clearInterval(interval);

                _this15.onPopupClosed(); // Call your custom logic when popup is closed

              }
            }, 500); // Check every 500ms if the popup is closed
          }
        }
      }, {
        key: "onPopupClosed",
        value: function onPopupClosed() {
          console.log("Popup closed."); // You can handle additional actions here like redirecting, showing a message, etc.
        }
      }, {
        key: "closePopUpWindow",
        value: function closePopUpWindow() {
          this.popUpWindow.close();
        }
      }, {
        key: "setCustomerID",
        value: function setCustomerID(val) {
          this.ppCustomerId = val;
        }
      }, {
        key: "getCustomerID",
        value: function getCustomerID() {
          return this.ppCustomerId;
        }
      }]);
    }(src_app_core_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].AbstractService);

    StripeOperationsService.ctorParameters = function () {
      return [{
        type: _angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpClient"]
      }, {
        type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_7__["SessionService"]
      }];
    };

    StripeOperationsService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"])({
      providedIn: 'root'
    })], StripeOperationsService);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/credit-card.directive.ts":
  /*!**********************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/credit-card.directive.ts ***!
    \**********************************************************************/

  /*! exports provided: CreditCardDirective */

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

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


    __webpack_require__.d(__webpack_exports__, "CreditCardDirective", function () {
      return CreditCardDirective;
    });
    /* 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");

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

      return _createClass(CreditCardDirective, [{
        key: "onKeyDown",
        value: function onKeyDown(event) {
          var input = event.target;
          var trimmedValue = input.value.replace(/\s+/g, '').replace(/[^0-9]/gi, '');

          if (trimmedValue.length > 16) {
            trimmedValue = trimmedValue.substr(0, 16);
          }

          var formattedValue = '';

          for (var i = 0; i < trimmedValue.length; i += 4) {
            if (i > 0) {
              formattedValue += ' ';
            }

            formattedValue += trimmedValue.substr(i, 4);
          }

          input.value = formattedValue;
        }
      }]);
    }();

    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["HostListener"])('input', ['$event'])], CreditCardDirective.prototype, "onKeyDown", null);
    CreditCardDirective = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"])({
      selector: '[appCreditCard]'
    })], CreditCardDirective);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/credit-card/credit-card.component.scss":
  /*!************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/credit-card/credit-card.component.scss ***!
    \************************************************************************************/

  /*! exports provided: default */

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

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


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

  /***/
  "./src/app/pages/tools/license-manager/credit-card/credit-card.component.ts":
  /*!**********************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/credit-card/credit-card.component.ts ***!
    \**********************************************************************************/

  /*! exports provided: CreditCardComponent */

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

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


    __webpack_require__.d(__webpack_exports__, "CreditCardComponent", function () {
      return CreditCardComponent;
    });
    /* 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");

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

        this.cardNumber = '9876543210123456';
        this.cardHolderName = 'Santosh Kumar';
        this.editPaymentMethod = false;
        this.cardEdit = false;
      }

      return _createClass(CreditCardComponent, [{
        key: "ngOnInit",
        value: function ngOnInit() {}
      }, {
        key: "editPaymentFun",
        value: function editPaymentFun() {
          this.editPaymentMethod = true;
        }
      }, {
        key: "cardEditFun",
        value: function cardEditFun() {
          this.cardEdit = !this.cardEdit;
        }
      }, {
        key: "getFormattedCardNumber",
        value: function getFormattedCardNumber() {
          var firstEightAsterisks = this.cardNumber.substring(0, 12).replace(/\d/g, '*');
          var lastDigits = this.cardNumber.substring(12);
          return "".concat(firstEightAsterisks).concat(lastDigits);
        }
      }]);
    }();

    CreditCardComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
      selector: 'app-credit-card',
      template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! raw-loader!./credit-card.component.html */
      "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/credit-card/credit-card.component.html"))["default"],
      styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! ./credit-card.component.scss */
      "./src/app/pages/tools/license-manager/credit-card/credit-card.component.scss"))["default"]]
    })], CreditCardComponent);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/credit-card/credit-card.module.ts":
  /*!*******************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/credit-card/credit-card.module.ts ***!
    \*******************************************************************************/

  /*! exports provided: CreditCardModule */

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

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


    __webpack_require__.d(__webpack_exports__, "CreditCardModule", function () {
      return CreditCardModule;
    });
    /* 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 _credit_card_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ./credit-card.component */
    "./src/app/pages/tools/license-manager/credit-card/credit-card.component.ts");
    /* harmony import */


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


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


    var _credit_card_directive__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! ../credit-card.directive */
    "./src/app/pages/tools/license-manager/credit-card.directive.ts");

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

    CreditCardModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
      declarations: [_credit_card_component__WEBPACK_IMPORTED_MODULE_3__["CreditCardComponent"], _credit_card_directive__WEBPACK_IMPORTED_MODULE_6__["CreditCardDirective"]],
      exports: [_credit_card_component__WEBPACK_IMPORTED_MODULE_3__["CreditCardComponent"]],
      imports: [_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"], primeng__WEBPACK_IMPORTED_MODULE_4__["ButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_4__["InputTextModule"], primeng__WEBPACK_IMPORTED_MODULE_4__["DialogModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_5__["FormsModule"]]
    })], CreditCardModule);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/license-billing-history/license-billing-history.component.scss":
  /*!************************************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-billing-history/license-billing-history.component.scss ***!
    \************************************************************************************************************/

  /*! exports provided: default */

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

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


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

  /***/
  "./src/app/pages/tools/license-manager/license-billing-history/license-billing-history.component.ts":
  /*!**********************************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-billing-history/license-billing-history.component.ts ***!
    \**********************************************************************************************************/

  /*! exports provided: LicenseBillingHistoryComponent */

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

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


    __webpack_require__.d(__webpack_exports__, "LicenseBillingHistoryComponent", function () {
      return LicenseBillingHistoryComponent;
    });
    /* 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_billing_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
    /*! ./service/billing-service */
    "./src/app/pages/tools/license-manager/license-billing-history/service/billing-service.ts");
    /* harmony import */


    var _license_plan_service_license_plan_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ../license-plan/service/license-plan.service */
    "./src/app/pages/tools/license-manager/license-plan/service/license-plan.service.ts");
    /* harmony import */


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


    var _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
    /*! ../choose-plan/service/choose-plan.state */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.state.ts");
    /* harmony import */


    var _choose_plan_service_choose_plan_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! ../choose-plan/service/choose-plan.service */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.service.ts");
    /* harmony import */


    var _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
    /*! ./service/billing-history.enum */
    "./src/app/pages/tools/license-manager/license-billing-history/service/billing-history.enum.ts");
    /* harmony import */


    var src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
    /*! src/app/shared/cav-toast/service/cav-message.service */
    "./src/app/shared/cav-toast/service/cav-message.service.ts");
    /* harmony import */


    var src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
    /*! src/app/shared/cavLoggerService/cav-logging.service */
    "./src/app/shared/cavLoggerService/cav-logging.service.ts");
    /* harmony import */


    var src_app_shared_cav_license_services_cav_license_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(
    /*! src/app/shared/cav-license/services/cav-license.service */
    "./src/app/shared/cav-license/services/cav-license.service.ts");

    var LicenseBillingHistoryComponent = /*#__PURE__*/function () {
      function LicenseBillingHistoryComponent(billingHistoryService, licensePlanService, sessionService, choosePlanService, messageService, cavLoggingService, licenseService) {
        _classCallCheck(this, LicenseBillingHistoryComponent);

        this.billingHistoryService = billingHistoryService;
        this.licensePlanService = licensePlanService;
        this.sessionService = sessionService;
        this.choosePlanService = choosePlanService;
        this.messageService = messageService;
        this.cavLoggingService = cavLoggingService;
        this.licenseService = licenseService;
        this.invoiceTableHeader = "saas/billingTable.json";
        this.invoiceTableData = [];
        this.billingEmailsTableData = [];
        this.selectStatus = _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_ENUM"].ALL;
        this.selectDuration = _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["BILLING_TIME_DURATION_ENUM"].ALL_TIME;
        this.startTime = 0;
        this.endTime = 0;
      }

      return _createClass(LicenseBillingHistoryComponent, [{
        key: "ngOnInit",
        value: function ngOnInit() {
          if (this.sessionService.checkFreeTrialLicenseExpires()) {
            this.sessionService.showLicenseExpiryDialog = true;
          }

          this.status = [{
            label: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_LABELS_ENUM"].ALL,
            value: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_ENUM"].ALL
          }, {
            label: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_LABELS_ENUM"].PENDING,
            value: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_ENUM"].PENDING
          }, {
            label: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_LABELS_ENUM"].PAID,
            value: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_ENUM"].PAID
          }, {
            label: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_LABELS_ENUM"].FAILED,
            value: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_ENUM"].FAILED
          }];
          this.timeDuration = [{
            label: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["BILLING_TIME_DURATION_LABELS_ENUM"].ALL_TIME,
            value: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["BILLING_TIME_DURATION_ENUM"].ALL_TIME
          }, {
            label: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["BILLING_TIME_DURATION_LABELS_ENUM"].THIS_YEAR,
            value: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["BILLING_TIME_DURATION_ENUM"].THIS_YEAR
          }, {
            label: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["BILLING_TIME_DURATION_LABELS_ENUM"].PAST_YEAR,
            value: _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["BILLING_TIME_DURATION_ENUM"].PAST_YEAR
          }];
          this.getInvoiceData(this.selectStatus, this.startTime, this.endTime);
        }
      }, {
        key: "getInvoiceData",
        value: function getInvoiceData(invoiceStatus, startTime, endTime) {
          return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee8() {
            var _this16 = this;

            var me, accountDetails, customer, basePath;
            return _regenerator().w(function (_context8) {
              while (1) switch (_context8.n) {
                case 0:
                  me = this; // Get the account details from session object

                  accountDetails = this.sessionService.fetchAccountDetails();
                  this.accountName = accountDetails.accountName;
                  this.projectName = accountDetails.projectName;
                  this.email = accountDetails.accountEmail;
                  customer = {
                    saasAccountName: this.accountName,
                    saasProjectName: this.projectName,
                    saasEmail: this.email
                  };
                  basePath = me.sessionService.getBasePath(true, null, null);
                  this.billingHistoryService.getInvoiceDetails(customer, basePath, invoiceStatus, startTime, endTime).subscribe(function (state) {
                    if (state instanceof _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_5__["InvoiceDetailsLoadingState"]) {
                      return;
                    }

                    if (state instanceof _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_5__["InvoiceDetailsLoadedState"]) {
                      _this16.setInvoiceTableData(state.data.data);
                    }

                    if (state instanceof _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_5__["InvoiceDetailsErrorState"]) {
                      me.messageService.showError("There was an error while fetching invoice details");
                      me.cavLoggingService.error('License Billing History', "Error while fetching invoice details", state.error);
                    }
                  });

                case 1:
                  return _context8.a(2);
              }
            }, _callee8, this);
          }));
        }
      }, {
        key: "setInvoiceTableData",
        value: function setInvoiceTableData(invoiceList) {
          var _this17 = this;

          this.invoiceTableData = invoiceList.map(function (invoice) {
            var options = {
              year: 'numeric',
              month: 'short',
              day: 'numeric'
            };
            var invoiceDate = new Date(invoice.creationDate).toLocaleDateString('en-US', options);
            return {
              creationDate: invoiceDate,
              invoiceNumber: invoice.invoiceNumber,
              invoiceLink: invoice.invoiceLink,
              totalAmount: invoice.totalAmount ? invoice.totalAmount : 0,
              status: _this17.getInvoiceStatus(invoice.invoiceStatus)
            };
          });
        } //new changes 

      }, {
        key: "getInvoiceStatus",
        value: function getInvoiceStatus(invoiceStatus) {
          var invoiceStatusStr = "";

          switch (invoiceStatus) {
            case _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_ENUM"].FAILED:
              invoiceStatusStr = _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_LABELS_ENUM"].FAILED;
              break;

            case _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_ENUM"].PAID:
              invoiceStatusStr = _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_LABELS_ENUM"].PAID;
              break;

            default:
              invoiceStatusStr = _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_STATUS_LABELS_ENUM"].PENDING;
              break;
          }

          return invoiceStatusStr;
        }
      }, {
        key: "invoiceTableFun",
        value: function invoiceTableFun(event) {
          //This code commented beacuse it is not working properly
          // if (event.cavEventExt.actionConfig.action === INVOICE_TABLE_OPERATIONS_ENUM.VIEW) {
          //     this.pdfUrl = this.sanitizer.bypassSecurityTrustResourceUrl(event.cavEventExt.row.invoiceLink);
          //     this.showPdfViewDialog = true;
          // }
          if (event.cavEventExt.actionConfig.action === _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["INVOICE_TABLE_OPERATIONS_ENUM"].DOWNLOAD) {
            var pdfUrl = event.cavEventExt.row.invoiceLink;
            window.open(pdfUrl, '_blank');
          }
        }
      }, {
        key: "getDates",
        value: function getDates(selectDuration) {
          var currentDate = new Date();
          var timestamp = currentDate.getTime();

          if (selectDuration == _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["BILLING_TIME_DURATION_ENUM"].THIS_YEAR) {
            var date = new Date(timestamp);
            date.setFullYear(date.getFullYear() - 1);
            var updatedTimestamp = date.getTime();
            this.startTime = updatedTimestamp;
            this.endTime = timestamp;
            this.getInvoiceData(this.selectStatus, this.startTime, this.endTime);
          } else if (selectDuration == _service_billing_history_enum__WEBPACK_IMPORTED_MODULE_7__["BILLING_TIME_DURATION_ENUM"].PAST_YEAR) {
            var _date = new Date(timestamp);

            _date.setFullYear(_date.getFullYear() - 1);

            var _updatedTimestamp = _date.getTime();

            this.startTime = _updatedTimestamp;

            _date.setFullYear(_date.getFullYear() - 1);

            _updatedTimestamp = _date.getTime();
            this.endTime = _updatedTimestamp;
            this.getInvoiceData(this.selectStatus, this.startTime, this.endTime);
          } else {
            this.startTime = 0;
            this.endTime = 0;
            this.getInvoiceData(this.selectStatus, this.startTime, this.endTime);
          }
        }
      }, {
        key: "getInvoicesBasedonPaymentStatus",
        value: function getInvoicesBasedonPaymentStatus(selectedStatus) {
          this.getInvoiceData(selectedStatus, this.startTime, this.endTime);
        }
      }]);
    }();

    LicenseBillingHistoryComponent.ctorParameters = function () {
      return [{
        type: _service_billing_service__WEBPACK_IMPORTED_MODULE_2__["BillingHistoryService"]
      }, {
        type: _license_plan_service_license_plan_service__WEBPACK_IMPORTED_MODULE_3__["LicensePlanService"]
      }, {
        type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_4__["SessionService"]
      }, {
        type: _choose_plan_service_choose_plan_service__WEBPACK_IMPORTED_MODULE_6__["ChoosePlanService"]
      }, {
        type: src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_8__["CavMessageService"]
      }, {
        type: src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_9__["CavLoggingService"]
      }, {
        type: src_app_shared_cav_license_services_cav_license_service__WEBPACK_IMPORTED_MODULE_10__["CavLicenseService"]
      }];
    };

    LicenseBillingHistoryComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
      selector: 'app-license-billing-history',
      template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! raw-loader!./license-billing-history.component.html */
      "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/license-billing-history/license-billing-history.component.html"))["default"],
      styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! ./license-billing-history.component.scss */
      "./src/app/pages/tools/license-manager/license-billing-history/license-billing-history.component.scss"))["default"]]
    })], LicenseBillingHistoryComponent);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/license-billing-history/license-billing-history.module.ts":
  /*!*******************************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-billing-history/license-billing-history.module.ts ***!
    \*******************************************************************************************************/

  /*! exports provided: LicenseBillingHistoryModule */

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

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


    __webpack_require__.d(__webpack_exports__, "LicenseBillingHistoryModule", function () {
      return LicenseBillingHistoryModule;
    });
    /* 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 _license_billing_history_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ./license-billing-history.component */
    "./src/app/pages/tools/license-manager/license-billing-history/license-billing-history.component.ts");
    /* harmony import */


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


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


    var _angular_forms__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! @angular/forms */
    "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.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");

    var routes = [{
      path: 'LicenseBillingHistory',
      component: _license_billing_history_component__WEBPACK_IMPORTED_MODULE_3__["LicenseBillingHistoryComponent"]
    }];
    var imports = [_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["ToolbarModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["ButtonModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_6__["FormsModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["InputSwitchModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["ButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["SpinnerModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["RadioButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["InputTextModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["DialogModule"], src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_7__["CavTableModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["DropdownModule"]];
    var components = [_license_billing_history_component__WEBPACK_IMPORTED_MODULE_3__["LicenseBillingHistoryComponent"]];

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

    LicenseBillingHistoryModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
      declarations: [components],
      imports: [imports, _angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterModule"].forChild(routes)],
      exports: [_angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterModule"], _license_billing_history_component__WEBPACK_IMPORTED_MODULE_3__["LicenseBillingHistoryComponent"]]
    })], LicenseBillingHistoryModule);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/license-billing-history/service/billing-history.enum.ts":
  /*!*****************************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-billing-history/service/billing-history.enum.ts ***!
    \*****************************************************************************************************/

  /*! exports provided: INVOICE_STATUS_ENUM, INVOICE_STATUS_LABELS_ENUM, BILLING_TIME_DURATION_LABELS_ENUM, BILLING_TIME_DURATION_ENUM, INVOICE_TABLE_OPERATIONS_ENUM */

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

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


    __webpack_require__.d(__webpack_exports__, "INVOICE_STATUS_ENUM", function () {
      return INVOICE_STATUS_ENUM;
    });
    /* harmony export (binding) */


    __webpack_require__.d(__webpack_exports__, "INVOICE_STATUS_LABELS_ENUM", function () {
      return INVOICE_STATUS_LABELS_ENUM;
    });
    /* harmony export (binding) */


    __webpack_require__.d(__webpack_exports__, "BILLING_TIME_DURATION_LABELS_ENUM", function () {
      return BILLING_TIME_DURATION_LABELS_ENUM;
    });
    /* harmony export (binding) */


    __webpack_require__.d(__webpack_exports__, "BILLING_TIME_DURATION_ENUM", function () {
      return BILLING_TIME_DURATION_ENUM;
    });
    /* harmony export (binding) */


    __webpack_require__.d(__webpack_exports__, "INVOICE_TABLE_OPERATIONS_ENUM", function () {
      return INVOICE_TABLE_OPERATIONS_ENUM;
    });

    var INVOICE_STATUS_ENUM;

    (function (INVOICE_STATUS_ENUM) {
      INVOICE_STATUS_ENUM[INVOICE_STATUS_ENUM["PENDING"] = 0] = "PENDING";
      INVOICE_STATUS_ENUM[INVOICE_STATUS_ENUM["PAID"] = 1] = "PAID";
      INVOICE_STATUS_ENUM[INVOICE_STATUS_ENUM["FAILED"] = 2] = "FAILED";
      INVOICE_STATUS_ENUM[INVOICE_STATUS_ENUM["ALL"] = 3] = "ALL";
    })(INVOICE_STATUS_ENUM || (INVOICE_STATUS_ENUM = {}));

    var INVOICE_STATUS_LABELS_ENUM;

    (function (INVOICE_STATUS_LABELS_ENUM) {
      INVOICE_STATUS_LABELS_ENUM["PENDING"] = "Pending";
      INVOICE_STATUS_LABELS_ENUM["PAID"] = "Paid";
      INVOICE_STATUS_LABELS_ENUM["FAILED"] = "Failed";
      INVOICE_STATUS_LABELS_ENUM["ALL"] = "All";
    })(INVOICE_STATUS_LABELS_ENUM || (INVOICE_STATUS_LABELS_ENUM = {}));

    var BILLING_TIME_DURATION_LABELS_ENUM;

    (function (BILLING_TIME_DURATION_LABELS_ENUM) {
      BILLING_TIME_DURATION_LABELS_ENUM["ALL_TIME"] = "All Time";
      BILLING_TIME_DURATION_LABELS_ENUM["THIS_YEAR"] = "This Year";
      BILLING_TIME_DURATION_LABELS_ENUM["PAST_YEAR"] = "Past Year";
    })(BILLING_TIME_DURATION_LABELS_ENUM || (BILLING_TIME_DURATION_LABELS_ENUM = {}));

    var BILLING_TIME_DURATION_ENUM;

    (function (BILLING_TIME_DURATION_ENUM) {
      BILLING_TIME_DURATION_ENUM["ALL_TIME"] = "allTime";
      BILLING_TIME_DURATION_ENUM["THIS_YEAR"] = "thisYear";
      BILLING_TIME_DURATION_ENUM["PAST_YEAR"] = "pastYear";
    })(BILLING_TIME_DURATION_ENUM || (BILLING_TIME_DURATION_ENUM = {}));

    var INVOICE_TABLE_OPERATIONS_ENUM;

    (function (INVOICE_TABLE_OPERATIONS_ENUM) {
      INVOICE_TABLE_OPERATIONS_ENUM["VIEW"] = "view";
      INVOICE_TABLE_OPERATIONS_ENUM["DOWNLOAD"] = "download";
    })(INVOICE_TABLE_OPERATIONS_ENUM || (INVOICE_TABLE_OPERATIONS_ENUM = {}));
    /***/

  },

  /***/
  "./src/app/pages/tools/license-manager/license-billing-history/service/billing-service.ts":
  /*!************************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-billing-history/service/billing-service.ts ***!
    \************************************************************************************************/

  /*! exports provided: BillingHistoryService */

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

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


    __webpack_require__.d(__webpack_exports__, "BillingHistoryService", function () {
      return BillingHistoryService;
    });
    /* 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_http__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
    /*! @angular/common/http */
    "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/http.js");
    /* harmony import */


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


    var src_app_core_store_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
    /*! src/app/core/store/store */
    "./src/app/core/store/store.ts");
    /* harmony import */


    var _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
    /*! ../../choose-plan/service/choose-plan.state */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.state.ts");
    /* harmony import */


    var src_environments_environment__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! src/environments/environment */
    "./src/environments/environment.ts");

    var BillingHistoryService = /*#__PURE__*/function (_src_app_core_store_s2) {
      function BillingHistoryService(http) {
        var _this18;

        _classCallCheck(this, BillingHistoryService);

        _this18 = _callSuper(this, BillingHistoryService);
        _this18.http = http;
        _this18.billingHistoryUrl = 'url not finalized yet'; // Need to add an url

        return _this18;
      }

      _inherits(BillingHistoryService, _src_app_core_store_s2);

      return _createClass(BillingHistoryService, [{
        key: "getInvoiceDetails",
        value: function getInvoiceDetails(account, base, invoiceStatus, startTimeStamp, endTimeStamp) {
          var me = this;
          var output = new rxjs__WEBPACK_IMPORTED_MODULE_3__["Subject"]();
          setTimeout(function () {
            output.next(new _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_5__["InvoiceDetailsLoadingState"]());
          }, 0);
          var path = src_environments_environment__WEBPACK_IMPORTED_MODULE_6__["environment"].api.licenseManager.getInvoices.endpoint + "?invoiceStatus=" + invoiceStatus + "&startTime=" + startTimeStamp + "&endTime=" + endTimeStamp;
          me.controller.post(path, account, base).subscribe(function (data) {
            output.next(new _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_5__["InvoiceDetailsLoadedState"](data));
            output.complete();
          }, function (e) {
            output.error(new _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_5__["InvoiceDetailsErrorState"](e));
            output.complete();
          });
          return output;
        }
      }]);
    }(src_app_core_store_store__WEBPACK_IMPORTED_MODULE_4__["Store"].AbstractService);

    BillingHistoryService.ctorParameters = function () {
      return [{
        type: _angular_common_http__WEBPACK_IMPORTED_MODULE_2__["HttpClient"]
      }];
    };

    BillingHistoryService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
      providedIn: 'root'
    })], BillingHistoryService);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/license-manager.module.ts":
  /*!***********************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-manager.module.ts ***!
    \***********************************************************************/

  /*! exports provided: LicenseManagerModule */

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

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


    __webpack_require__.d(__webpack_exports__, "LicenseManagerModule", function () {
      return LicenseManagerModule;
    });
    /* 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 _license_manager_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ./license-manager.component */
    "./src/app/pages/tools/license-manager/license-manager.component.ts");
    /* harmony import */


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


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


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


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


    var src_app_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");
    /* harmony import */


    var src_app_shared_help_help_module__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
    /*! src/app/shared/help/help.module */
    "./src/app/shared/help/help.module.ts");
    /* harmony import */


    var _license_plan_license_plan_component__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(
    /*! ./license-plan/license-plan.component */
    "./src/app/pages/tools/license-manager/license-plan/license-plan.component.ts");
    /* harmony import */


    var _license_plan_license_plan_module__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(
    /*! ./license-plan/license-plan.module */
    "./src/app/pages/tools/license-manager/license-plan/license-plan.module.ts");
    /* harmony import */


    var _license_billing_history_license_billing_history_component__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(
    /*! ./license-billing-history/license-billing-history.component */
    "./src/app/pages/tools/license-manager/license-billing-history/license-billing-history.component.ts");
    /* harmony import */


    var _license_usage_cost_license_usage_cost_component__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(
    /*! ./license-usage-cost/license-usage-cost.component */
    "./src/app/pages/tools/license-manager/license-usage-cost/license-usage-cost.component.ts");
    /* harmony import */


    var _license_usage_cost_license_usage_cost_module__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(
    /*! ./license-usage-cost/license-usage-cost.module */
    "./src/app/pages/tools/license-manager/license-usage-cost/license-usage-cost.module.ts");
    /* harmony import */


    var _license_billing_history_license_billing_history_module__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(
    /*! ./license-billing-history/license-billing-history.module */
    "./src/app/pages/tools/license-manager/license-billing-history/license-billing-history.module.ts");
    /* harmony import */


    var _choose_plan_choose_plan_component__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(
    /*! ./choose-plan/choose-plan.component */
    "./src/app/pages/tools/license-manager/choose-plan/choose-plan.component.ts");
    /* harmony import */


    var _choose_plan_choose_plan_module__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(
    /*! ./choose-plan/choose-plan.module */
    "./src/app/pages/tools/license-manager/choose-plan/choose-plan.module.ts");
    /* harmony import */


    var _purchase_confirm_purchase_confirm_module__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(
    /*! ./purchase-confirm/purchase-confirm.module */
    "./src/app/pages/tools/license-manager/purchase-confirm/purchase-confirm.module.ts");
    /* harmony import */


    var _purchase_confirm_purchase_confirm_component__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(
    /*! ./purchase-confirm/purchase-confirm.component */
    "./src/app/pages/tools/license-manager/purchase-confirm/purchase-confirm.component.ts");

    var routes = [{
      path: '',
      component: _license_manager_component__WEBPACK_IMPORTED_MODULE_3__["LicenseManagerComponent"],
      children: [{
        path: '',
        redirectTo: 'LicensePlan',
        pathMatch: 'full'
      }, {
        path: 'LicensePlan',
        component: _license_plan_license_plan_component__WEBPACK_IMPORTED_MODULE_10__["LicensePlanComponent"]
      }, {
        path: 'LicenseCost',
        component: _license_usage_cost_license_usage_cost_component__WEBPACK_IMPORTED_MODULE_13__["LicenseUsageCostComponent"]
      }, {
        path: 'LicenseBillingHistory',
        component: _license_billing_history_license_billing_history_component__WEBPACK_IMPORTED_MODULE_12__["LicenseBillingHistoryComponent"]
      }, {
        path: 'choosePlan',
        component: _choose_plan_choose_plan_component__WEBPACK_IMPORTED_MODULE_16__["ChoosePlanComponent"]
      }, {
        path: 'purchaseConfirm',
        component: _purchase_confirm_purchase_confirm_component__WEBPACK_IMPORTED_MODULE_19__["PurchaseConfirmComponent"]
      }]
    }];
    var imports = [_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["ToolbarModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["ButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["CheckboxModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["MultiSelectModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["InputTextModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["RadioButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["DropdownModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["InputTextareaModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["BreadcrumbModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["MenuModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_5__["FormsModule"], src_app_shared_help_help_module__WEBPACK_IMPORTED_MODULE_9__["HelpModule"], src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_8__["CavTableModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["TabViewModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["SelectButtonModule"], highcharts_angular__WEBPACK_IMPORTED_MODULE_6__["HighchartsChartModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["DialogModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["SpinnerModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["ToggleButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["SidebarModule"], primeng__WEBPACK_IMPORTED_MODULE_7__["TabMenuModule"], _license_plan_license_plan_module__WEBPACK_IMPORTED_MODULE_11__["LicensePlanModule"], _license_usage_cost_license_usage_cost_module__WEBPACK_IMPORTED_MODULE_14__["LicenseUsageCostModule"], _license_billing_history_license_billing_history_module__WEBPACK_IMPORTED_MODULE_15__["LicenseBillingHistoryModule"], _choose_plan_choose_plan_module__WEBPACK_IMPORTED_MODULE_17__["ChoosePlanModule"], _purchase_confirm_purchase_confirm_module__WEBPACK_IMPORTED_MODULE_18__["PurchaseConfirmModule"]];
    var components = [_license_manager_component__WEBPACK_IMPORTED_MODULE_3__["LicenseManagerComponent"]];

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

    LicenseManagerModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
      declarations: [components],
      imports: [imports, _angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterModule"].forChild(routes)],
      exports: [_angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterModule"], _license_manager_component__WEBPACK_IMPORTED_MODULE_3__["LicenseManagerComponent"], _license_plan_license_plan_component__WEBPACK_IMPORTED_MODULE_10__["LicensePlanComponent"], _license_usage_cost_license_usage_cost_component__WEBPACK_IMPORTED_MODULE_13__["LicenseUsageCostComponent"], _license_billing_history_license_billing_history_component__WEBPACK_IMPORTED_MODULE_12__["LicenseBillingHistoryComponent"], _choose_plan_choose_plan_component__WEBPACK_IMPORTED_MODULE_16__["ChoosePlanComponent"], _purchase_confirm_purchase_confirm_component__WEBPACK_IMPORTED_MODULE_19__["PurchaseConfirmComponent"]]
    })], LicenseManagerModule);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/license-plan/license-datepipes/timestamp-to-date.pipe.ts":
  /*!******************************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-plan/license-datepipes/timestamp-to-date.pipe.ts ***!
    \******************************************************************************************************/

  /*! exports provided: TimestampToDatePipe */

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

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


    __webpack_require__.d(__webpack_exports__, "TimestampToDatePipe", function () {
      return TimestampToDatePipe;
    });
    /* 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");

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

      return _createClass(TimestampToDatePipe, [{
        key: "transform",
        value: function transform(value) {
          if (!value) return '';
          var date = new Date(value);
          var mm = String(date.getMonth() + 1).padStart(2, '0');
          var dd = String(date.getDate()).padStart(2, '0');
          var yyyy = date.getFullYear();
          return "".concat(mm, "/").concat(dd, "/").concat(yyyy);
        }
      }]);
    }();

    TimestampToDatePipe = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Pipe"])({
      name: 'timestampToDate'
    })], TimestampToDatePipe);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/license-plan/license-plan.component.scss":
  /*!**************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-plan/license-plan.component.scss ***!
    \**************************************************************************************/

  /*! exports provided: default */

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

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


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

  /***/
  "./src/app/pages/tools/license-manager/license-plan/license-plan.component.ts":
  /*!************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-plan/license-plan.component.ts ***!
    \************************************************************************************/

  /*! exports provided: LicensePlanComponent */

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

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


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


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


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


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


    var _service_license_plan_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ./service/license-plan.model */
    "./src/app/pages/tools/license-manager/license-plan/service/license-plan.model.ts");
    /* harmony import */


    var _service_license_plan_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
    /*! ./service/license-plan.service */
    "./src/app/pages/tools/license-manager/license-plan/service/license-plan.service.ts");
    /* harmony import */


    var _service_license_plan_state__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
    /*! ./service/license-plan.state */
    "./src/app/pages/tools/license-manager/license-plan/service/license-plan.state.ts");
    /* harmony import */


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


    var src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
    /*! src/app/shared/cav-toast/service/cav-message.service */
    "./src/app/shared/cav-toast/service/cav-message.service.ts");
    /* harmony import */


    var _choose_plan_service_choose_plan_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
    /*! ../choose-plan/service/choose-plan.service */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.service.ts");
    /* harmony import */


    var _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
    /*! ../choose-plan/service/choose-plan.enum */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.enum.ts");

    var LicensePlanComponent = /*#__PURE__*/function () {
      function LicensePlanComponent(router, sessionService, licensePlanService, route, messageService, choosePlanService) {
        _classCallCheck(this, LicensePlanComponent);

        this.router = router;
        this.sessionService = sessionService;
        this.licensePlanService = licensePlanService;
        this.route = route;
        this.messageService = messageService;
        this.choosePlanService = choosePlanService;
        this.cardNumber = 9876;
        this.cardHolderName = 'Santosh Kumar';
        this.selectedServices = [];
        this.cancelButtonDisabled = true;
        this.isContentLoading = true;
      }

      return _createClass(LicensePlanComponent, [{
        key: "ngOnInit",
        value: function ngOnInit() {
          this.getSubscriptionSummary();
        }
      }, {
        key: "getSubscriptionSummary",
        value: function getSubscriptionSummary() {
          return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee9() {
            var _this19 = this;

            var accountDetails, base;
            return _regenerator().w(function (_context9) {
              while (1) switch (_context9.n) {
                case 0:
                  // Get the account details from session object
                  accountDetails = this.sessionService.fetchAccountDetails();
                  this.accountName = accountDetails.accountName;
                  this.projectName = accountDetails.projectName;
                  base = this.sessionService.getBasePath(true, null, null);
                  this.licensePlanService.loadSubscriptionSummary(this.accountName, this.projectName, base).subscribe(function (state) {
                    if (state instanceof _service_license_plan_state__WEBPACK_IMPORTED_MODULE_5__["LicensePlanSubscriptionSummaryLoadingState"]) {
                      return;
                    }

                    if (state instanceof _service_license_plan_state__WEBPACK_IMPORTED_MODULE_5__["LicensePlanSubscriptionSummaryLoadedState"]) {
                      var subscribedProductDetailsArray = state.data.data;
                      _this19.subscriptionData = subscribedProductDetailsArray;

                      if (_this19.subscriptionData == null || _this19.subscriptionData.length == 0) {
                        var url = "/LicenseManager/choosePlan";

                        _this19.router.navigateByUrl(url);
                      }

                      _this19.isContentLoading = false;

                      _this19.findLatestLicense();
                    }
                  }, function (state) {
                    // TODO: ERROR MESSAGE
                    _this19.isContentLoading = false;

                    _this19.messageService.showError("Error in loading subscription details");
                  });

                case 1:
                  return _context9.a(2);
              }
            }, _callee9, this);
          }));
        }
      }, {
        key: "findLatestLicense",
        value: function findLatestLicense() {
          var _this20 = this;

          var latestLicense = null; // Loop through all subscriptions to find the one with the latest start time

          this.subscriptionData.forEach(function (subscription) {
            // Skip the subscription if it is of type 'Free'
            if (subscription.subscriptionType === _service_license_plan_model__WEBPACK_IMPORTED_MODULE_3__["SubscriptionTypeEnum"].Free) {
              return;
            } // If the plan type is 'Pay As You Go', update the purchased plan type


            if (subscription.planType === _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_9__["PLAN_TYPE_INDEX_ENUM"].PAY_AS_YOU_GO) {
              _this20.choosePlanService.purchasedPlanType = subscription.planType;
            } // Update latestLicense if it's null or if the current subscription's start date is more recent


            if (!latestLicense || subscription.start > latestLicense.start) {
              latestLicense = subscription;
            }
          }); // Store the licenseId of the latest license if one was found

          if (latestLicense) {
            this.latestLicenseId = latestLicense.licenseId;
          }
        }
      }, {
        key: "navigateToUsage",
        value: function navigateToUsage(serviceName) {
          this.licensePlanService.serviceName = serviceName;
          var accountName = encodeURIComponent(this.accountName);
          var projectName = encodeURIComponent(this.projectName);
          var url = "/LicenseManager/LicenseCost?accountName=".concat(accountName, "&projectName=").concat(projectName);
          this.router.navigateByUrl(url);
        }
      }, {
        key: "getSubscriptionType",
        value: function getSubscriptionType(value) {
          return _service_license_plan_model__WEBPACK_IMPORTED_MODULE_3__["SubscriptionTypeEnum"][value];
        }
      }, {
        key: "getPayType",
        value: function getPayType(value) {
          return _service_license_plan_model__WEBPACK_IMPORTED_MODULE_3__["PayTypeEnum"][value];
        }
      }, {
        key: "choosePlanFn",
        value: function choosePlanFn() {
          // this.router.navigateByUrl('LicenseManager/choosePlan');
          // this.router.navigate(['LicenseManager/choosePlan'], {
          //   queryParams: { accountName: this.accountName, projectName: this.projectName }
          // });
          var accountName = encodeURIComponent(this.accountName);
          var projectName = encodeURIComponent(this.projectName);
          var url = "/LicenseManager/choosePlan?accountName=".concat(accountName, "&projectName=").concat(projectName);
          this.router.navigateByUrl(url);
        }
      }, {
        key: "compareTimestamps",
        value: function compareTimestamps(expiryDate) {
          if (this.sessionService.time > expiryDate) {
            return false;
          } else if (this.sessionService.time < expiryDate) {
            return true;
          }
        }
      }, {
        key: "getDiffTimestamps",
        value: function getDiffTimestamps(expiryDate) {
          var millisecondsInOneDay = 24 * 60 * 60 * 1000;
          var differenceInMilliseconds = Math.abs(this.sessionService.time - expiryDate);
          var differenceInDays = differenceInMilliseconds / millisecondsInOneDay;
          return differenceInDays > 7;
        }
      }, {
        key: "isRecent",
        value: function isRecent(subscription) {
          // Mark as "Recently Bought" if the licenseId matches the latest license's licenseId
          return subscription.licenseId === this.latestLicenseId;
        }
      }, {
        key: "onSubscriptionToggle",
        value: function onSubscriptionToggle(event, service) {
          if (event.checked) {
            this.selectedServices.push({
              serviceName: service.serviceName,
              parameter: service.parameter,
              crLicenseId: service.licenseId
            });
          } else {
            this.selectedServices = this.selectedServices.filter(function (item) {
              return item.serviceName !== service.serviceName;
            });
          }

          if (this.selectedServices.length > 0) {
            this.cancelButtonDisabled = false;
          } else {
            this.cancelButtonDisabled = true;
          }
        }
      }, {
        key: "cancelSubscription",
        value: function cancelSubscription() {
          var _this21 = this;

          this.isContentLoading = true;
          var base = this.sessionService.getBasePath(true, null, null);
          this.licensePlanService.cancelSubscription(this.selectedServices, base).subscribe(function (state) {
            if (state instanceof _service_license_plan_state__WEBPACK_IMPORTED_MODULE_5__["CancelSubscriptionLoadingState"]) {
              return;
            }

            if (state instanceof _service_license_plan_state__WEBPACK_IMPORTED_MODULE_5__["CancelSubscriptionLoadedState"]) {
              _this21.selectedServices = [];
              _this21.isContentLoading = false;
              _this21.cancelButtonDisabled = true;

              _this21.messageService.showSuccess("License Plan Cancelled Successfully");

              _this21.getSubscriptionSummary();
            }

            if (state instanceof _service_license_plan_state__WEBPACK_IMPORTED_MODULE_5__["CancelSubscriptionLoadingErrorState"]) {
              _this21.isContentLoading = false;

              _this21.messageService.showError("License Plan Cancel Failed");
            }
          });
        }
      }, {
        key: "ngOnDestroy",
        value: function ngOnDestroy() {
          this.choosePlanService.confirmDetails = null;
          this.choosePlanService.customerNewRequest = null;
        }
      }]);
    }();

    LicensePlanComponent.ctorParameters = function () {
      return [{
        type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"]
      }, {
        type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_6__["SessionService"]
      }, {
        type: _service_license_plan_service__WEBPACK_IMPORTED_MODULE_4__["LicensePlanService"]
      }, {
        type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"]
      }, {
        type: src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_7__["CavMessageService"]
      }, {
        type: _choose_plan_service_choose_plan_service__WEBPACK_IMPORTED_MODULE_8__["ChoosePlanService"]
      }];
    };

    LicensePlanComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
      selector: 'app-license-plan',
      template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! raw-loader!./license-plan.component.html */
      "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/license-plan/license-plan.component.html"))["default"],
      styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! ./license-plan.component.scss */
      "./src/app/pages/tools/license-manager/license-plan/license-plan.component.scss"))["default"]]
    })], LicensePlanComponent);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/license-plan/license-plan.module.ts":
  /*!*********************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-plan/license-plan.module.ts ***!
    \*********************************************************************************/

  /*! exports provided: LicensePlanModule */

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

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


    __webpack_require__.d(__webpack_exports__, "LicensePlanModule", function () {
      return LicensePlanModule;
    });
    /* 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 _license_plan_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ./license-plan.component */
    "./src/app/pages/tools/license-manager/license-plan/license-plan.component.ts");
    /* harmony import */


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


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


    var src_app_shared_header_header_module__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! src/app/shared/header/header.module */
    "./src/app/shared/header/header.module.ts");
    /* harmony import */


    var src_app_shared_pipes_pipes_module__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
    /*! src/app/shared/pipes/pipes.module */
    "./src/app/shared/pipes/pipes.module.ts");
    /* harmony import */


    var _license_datepipes_timestamp_to_date_pipe__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
    /*! ./license-datepipes/timestamp-to-date.pipe */
    "./src/app/pages/tools/license-manager/license-plan/license-datepipes/timestamp-to-date.pipe.ts");
    /* harmony import */


    var src_app_shared_cav_loader_cav_loader_module__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
    /*! src/app/shared/cav-loader/cav-loader.module */
    "./src/app/shared/cav-loader/cav-loader.module.ts"); // import { ChoosePlanModule } from '../choose-plan/choose-plan.module';


    var routes = [{
      path: 'LicensePlan',
      component: _license_plan_component__WEBPACK_IMPORTED_MODULE_3__["LicensePlanComponent"]
    }];
    var imports = [_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["ToolbarModule"], src_app_shared_header_header_module__WEBPACK_IMPORTED_MODULE_6__["HeaderModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["ButtonModule"], src_app_shared_pipes_pipes_module__WEBPACK_IMPORTED_MODULE_7__["PipeModule"], src_app_shared_cav_loader_cav_loader_module__WEBPACK_IMPORTED_MODULE_9__["CavLoaderModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["CheckboxModule"] // ChoosePlanModule
    ];
    var components = [_license_plan_component__WEBPACK_IMPORTED_MODULE_3__["LicensePlanComponent"]];

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

    LicensePlanModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
      declarations: [components, _license_datepipes_timestamp_to_date_pipe__WEBPACK_IMPORTED_MODULE_8__["TimestampToDatePipe"]],
      imports: [imports, _angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterModule"].forChild(routes)],
      exports: [_angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterModule"], _license_plan_component__WEBPACK_IMPORTED_MODULE_3__["LicensePlanComponent"]]
    })], LicensePlanModule);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/license-plan/service/license-plan.model.ts":
  /*!****************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-plan/service/license-plan.model.ts ***!
    \****************************************************************************************/

  /*! exports provided: SubscriptionTypeEnum, PayTypeEnum */

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

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


    __webpack_require__.d(__webpack_exports__, "SubscriptionTypeEnum", function () {
      return SubscriptionTypeEnum;
    });
    /* harmony export (binding) */


    __webpack_require__.d(__webpack_exports__, "PayTypeEnum", function () {
      return PayTypeEnum;
    });

    var SubscriptionTypeEnum;

    (function (SubscriptionTypeEnum) {
      SubscriptionTypeEnum[SubscriptionTypeEnum["Free"] = 0] = "Free";
      SubscriptionTypeEnum[SubscriptionTypeEnum["Pro"] = 1] = "Pro";
      SubscriptionTypeEnum[SubscriptionTypeEnum["Enterprise"] = 2] = "Enterprise";
    })(SubscriptionTypeEnum || (SubscriptionTypeEnum = {}));

    var PayTypeEnum;

    (function (PayTypeEnum) {
      PayTypeEnum[PayTypeEnum["PREPAID"] = 0] = "PREPAID";
      PayTypeEnum[PayTypeEnum["POSTPAID"] = 1] = "POSTPAID";
    })(PayTypeEnum || (PayTypeEnum = {}));
    /***/

  },

  /***/
  "./src/app/pages/tools/license-manager/license-usage-cost/license-usage-cost.component.scss":
  /*!**************************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-usage-cost/license-usage-cost.component.scss ***!
    \**************************************************************************************************/

  /*! exports provided: default */

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

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


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

  /***/
  "./src/app/pages/tools/license-manager/license-usage-cost/license-usage-cost.component.ts":
  /*!************************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-usage-cost/license-usage-cost.component.ts ***!
    \************************************************************************************************/

  /*! exports provided: LicenseUsageCostComponent */

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

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


    __webpack_require__.d(__webpack_exports__, "LicenseUsageCostComponent", function () {
      return LicenseUsageCostComponent;
    });
    /* 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__);
    /* harmony import */


    var _license_plan_service_license_plan_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ../license-plan/service/license-plan.service */
    "./src/app/pages/tools/license-manager/license-plan/service/license-plan.service.ts");
    /* harmony import */


    var _license_plan_service_license_plan_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
    /*! ../license-plan/service/license-plan.state */
    "./src/app/pages/tools/license-manager/license-plan/service/license-plan.state.ts");
    /* 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 _service_license_graph_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! ./service/license-graph.service */
    "./src/app/pages/tools/license-manager/license-usage-cost/service/license-graph.service.ts");
    /* harmony import */


    var _service_license_graph_model__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
    /*! ./service/license-graph.model */
    "./src/app/pages/tools/license-manager/license-usage-cost/service/license-graph.model.ts");
    /* harmony import */


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


    var _choose_plan_service_choose_plan_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
    /*! ../choose-plan/service/choose-plan.service */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.service.ts");
    /* harmony import */


    var src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(
    /*! src/app/shared/cavLoggerService/cav-logging.service */
    "./src/app/shared/cavLoggerService/cav-logging.service.ts");
    /* harmony import */


    var _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(
    /*! ../choose-plan/service/choose-plan.enum */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.enum.ts");
    /* 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");
    /* harmony import */


    var src_app_shared_cav_license_services_cav_license_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(
    /*! src/app/shared/cav-license/services/cav-license.service */
    "./src/app/shared/cav-license/services/cav-license.service.ts");

    var LicenseUsageCostComponent = /*#__PURE__*/function () {
      function LicenseUsageCostComponent(licensePlanService, router, licenseGraphData, route, sessionService, choosePlanService, cavLoggingService, licenseService, messageService) {
        _classCallCheck(this, LicenseUsageCostComponent);

        this.licensePlanService = licensePlanService;
        this.router = router;
        this.licenseGraphData = licenseGraphData;
        this.route = route;
        this.sessionService = sessionService;
        this.choosePlanService = choosePlanService;
        this.cavLoggingService = cavLoggingService;
        this.licenseService = licenseService;
        this.messageService = messageService;
        this.selectDuration = 'Daily';
        this.activeDiv = 0;
        this.highcharts = highcharts__WEBPACK_IMPORTED_MODULE_2__;
        this.setIndexForData = 0;
        this.itemSelected = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
        this.PLAN_TYPE_INDEX_ENUM = _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["PLAN_TYPE_INDEX_ENUM"];
        this.SUBSCRIPTION_TYPE_ENUM = _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["SUBSCRIPTION_TYPE_ENUM"];
        this.isLicenceUsageContentLoading = true;
      }

      return _createClass(LicenseUsageCostComponent, [{
        key: "ngOnInit",
        value: function ngOnInit() {
          if (this.sessionService.checkFreeTrialLicenseExpires()) {
            this.sessionService.showLicenseExpiryDialog = true;
          }

          this.getSubscriptionSummary();
          this.durationType = [{
            label: 'Daily',
            value: 'Daily'
          }, {
            label: 'Weekly',
            value: 'Weekly'
          }, {
            label: 'Monthly',
            value: 'Monthly'
          }, {
            label: 'Quarterly',
            value: 'Quarterly'
          }, {
            label: 'Yearly',
            value: 'Yearly'
          }]; // this.durationChanged();
        }
      }, {
        key: "getSubscriptionSummary",
        value: function getSubscriptionSummary() {
          return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee0() {
            var _this22 = this;

            var accountDetails, base;
            return _regenerator().w(function (_context0) {
              while (1) switch (_context0.n) {
                case 0:
                  this.route.queryParams.subscribe(function (params) {
                    _this22.accountName = params['accountName'];
                    _this22.projectName = params['projectName'];
                  }); // Get the account details from session object

                  accountDetails = this.sessionService.fetchAccountDetails();
                  this.accountName = accountDetails.accountName;
                  this.projectName = accountDetails.projectName;
                  base = this.sessionService.getBasePath(true, null, null);
                  this.licensePlanService.loadSubscriptionSummary(this.accountName, this.projectName, base).subscribe(function (state) {
                    if (state instanceof _license_plan_service_license_plan_state__WEBPACK_IMPORTED_MODULE_4__["LicensePlanSubscriptionSummaryLoadingState"]) {
                      return;
                    }

                    if (state instanceof _license_plan_service_license_plan_state__WEBPACK_IMPORTED_MODULE_4__["LicensePlanSubscriptionSummaryLoadedState"]) {
                      var subscribedProductDetailsArray = state.data.data;
                      _this22.subscriptionData = subscribedProductDetailsArray;
                      _this22.sidebarMenu = _this22.transformServices(_this22.subscriptionData);
                      _this22.licenseData = _this22.subscriptionData;

                      _this22.ensureFirstItemSelected();

                      _this22.isLicenceUsageContentLoading = false; // this.durationChanged();
                    }
                  }, function (state) {
                    // TODO: ERROR MESSAGE
                    _this22.isLicenceUsageContentLoading = false;

                    _this22.messageService.showError("Failed to load subscription details.");
                  });

                case 1:
                  return _context0.a(2);
              }
            }, _callee0, this);
          }));
        }
      }, {
        key: "transformServices",
        value: function transformServices(services) {
          var serviceMap = services.reduce(function (accumulator, current) {
            // Create a composite key based on serviceName and planSelected
            var existingService = accumulator.get(current.serviceName);

            if (!existingService) {
              // If no service with the same serviceName and planSelected exists, create a new entry
              accumulator.set(current.serviceName, {
                label: current.serviceName,
                licenseId: current.licenseId,
                serviceName: current.serviceName,
                parameter: current.parameter,
                licenseModel: current.licenseModel,
                subscriptionType: current.subscriptionType,
                usage: parseFloat(current.usage.toFixed(_choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].THREE)) || _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].DEFAULT,
                overUsage: parseFloat(current.overUsage.toFixed(_choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].THREE)) || _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].DEFAULT,
                threshold: current.planType === _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN || current.subscriptionType === _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["SUBSCRIPTION_TYPE_ENUM"].FREE_TRIAL ? current.threshold || _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].DEFAULT : _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].DEFAULT,
                start: current.start,
                planType: current.planType,
                associatedPlanTypesList: [current.planType],
                payType: current.paymentMode,
                expiry: current.expiry,
                selected: false,
                payAsYouGoUsage: current.planType === _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["PLAN_TYPE_INDEX_ENUM"].PAY_AS_YOU_GO ? parseFloat(current.usage.toFixed(_choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].THREE)) || _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].DEFAULT : _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].DEFAULT,
                createYourOwnPlanUsage: current.planType === _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN || current.subscriptionType === _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["SUBSCRIPTION_TYPE_ENUM"].FREE_TRIAL ? parseFloat(current.usage.toFixed(_choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].THREE)) || _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].DEFAULT : _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].DEFAULT
              });
            } else {
              // // Add the current plan type to the list if it's not already included
              if (!existingService.associatedPlanTypesList.includes(current.planType)) {
                existingService.associatedPlanTypesList.push(current.planType);
              } // Handle PAY_AS_YOU_GO plan usage aggregation


              if (current.planType === _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["PLAN_TYPE_INDEX_ENUM"].PAY_AS_YOU_GO) {
                // Accumulate usage under Pay As You Go plan
                existingService.payAsYouGoUsage += parseFloat(current.usage.toFixed(_choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].THREE)) || _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].DEFAULT;
              } // Handle CREATE_YOUR_OWN_PLAN or free-trail usage and threshold aggregation
              else if (current.planType === _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["PLAN_TYPE_INDEX_ENUM"].CREATE_YOUR_OWN_PLAN || current.subscriptionType === _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["SUBSCRIPTION_TYPE_ENUM"].FREE_TRIAL) {
                // Accumulate usage under Create Your Own Plan
                existingService.createYourOwnPlanUsage += parseFloat(current.usage.toFixed(_choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].THREE)) || _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].DEFAULT; // Aggregate threshold value for Create Your Own Plan

                existingService.threshold += current.threshold || _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].DEFAULT; // Aggregate over-usage for Create Your Own Plan

                existingService.overUsage += parseFloat(current.overUsage.toFixed(_choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].THREE)) || _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].DEFAULT;
              } // Optionally, update the start, expiry, etc. based on your business logic


              if (existingService.start > current.start) {
                existingService.start = current.start;
              }

              if (existingService.expiry < current.expiry) {
                existingService.expiry = current.expiry;
              }
            }

            return accumulator;
          }, new Map());
          return Array.from(serviceMap.values());
        }
      }, {
        key: "ensureFirstItemSelected",
        value: function ensureFirstItemSelected() {
          var _this23 = this;

          this.selectedServiceDetails = null;

          if (this.sidebarMenu && this.sidebarMenu.length > 0) {
            this.sidebarMenu[0].selected = true;
          }

          if (this.licensePlanService.serviceName) {
            this.sidebarMenu.forEach(function (entry, i) {
              if (entry.serviceName == _this23.licensePlanService.serviceName) {
                _this23.selectedServiceDetails = entry;
                _this23.activeDiv = i;
                _this23.setIndexForData = i;
                _this23.selectedServiceDetails.selected = true;
                _this23.licensePlanService.serviceName = null;
              }
            });
          } else {
            this.sidebarMenu.forEach(function (entry) {
              if (entry.selected) {
                _this23.selectedServiceDetails = entry;
              }
            });
          }

          this.durationChanged();
        }
        /**
         * Checks whether the specified plan type is associated with the selected service.
         * This is used to conditionally render UI elements (e.g., usage details)
         * based on whether a particular plan type (e.g., Pay As You Go or Create Your Own Plan)
         * exists in the selected service's associated plan types list.
         *
         * @param planType - The plan type identifier to check.
         * @returns True if the specified plan type is associated with the service, otherwise false.
         */

      }, {
        key: "isPlanTypeAssociated",
        value: function isPlanTypeAssociated(planType) {
          return this.selectedServiceDetails.associatedPlanTypesList.includes(planType) || false;
        }
      }, {
        key: "toggleActive",
        value: function toggleActive(menu) {
          var _this24 = this;

          this.sidebarMenu.forEach(function (item, i) {
            if (item == menu) {
              _this24.activeDiv = i;
              item.selected = true;
              _this24.setIndexForData = i;
            } else {
              item.selected = false;
            }
          });
          this.selectedServiceDetails = menu;
          this.durationChanged();
        }
      }, {
        key: "isMenuSelected",
        value: function isMenuSelected(label) {
          var _a;

          return ((_a = this.sidebarMenu.find(function (menu) {
            return menu.selected;
          })) === null || _a === void 0 ? void 0 : _a.label) === label;
        }
      }, {
        key: "onExtendLicenseClicked",
        value: function onExtendLicenseClicked() {
          // this.router.navigateByUrl('LicenseManager/choosePlan');
          this.router.navigate(['LicenseManager/choosePlan'], {
            queryParams: {
              accountName: this.accountName,
              projectName: this.projectName
            }
          });
        }
      }, {
        key: "convertTimestampsToDates",
        value: function convertTimestampsToDates(timestamps) {
          var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
          return timestamps.map(function (timestamp) {
            var date = new Date(timestamp);
            var month = monthNames[date.getMonth()];
            var day = date.getDate();
            var year = date.getFullYear();
            return "".concat(month, " ").concat(day, " ").concat(year);
          });
        }
      }, {
        key: "createGraph",
        value: function createGraph(data) {
          var dataTiming = [];
          var usage = data.data[0].usages;
          var overUsage = data.data[0].overUsages;
          var costing = data.data[0].costing; // Calculate total usage

          this.totalUsage = usage.reduce(function (sum, value) {
            return sum + value;
          }, 0);
          this.totalUsage = parseFloat(this.totalUsage.toFixed(3)); // Calculate total overUsage

          this.totalOverUsage = overUsage.reduce(function (sum, value) {
            return sum + value;
          }, 0);
          this.totalOverUsage = parseFloat(this.totalOverUsage.toFixed(3));
          dataTiming = this.convertTimestampsToDates(data.data[0].timestamps);
          this.chartOptions = {
            chart: {
              type: 'column'
            },
            title: {
              text: ""
            },
            yAxis: [{
              labels: {
                format: '{value}',
                style: {
                  color: 'blue'
                }
              },
              title: {
                text: 'Usage',
                style: {
                  color: 'blue'
                }
              }
            }, {
              title: {
                text: 'Cost',
                style: {
                  color: 'black'
                }
              },
              labels: {
                format: '$ {value}',
                style: {
                  color: 'black'
                }
              },
              opposite: true
            }],
            xAxis: [{
              categories: dataTiming,
              crosshair: true
            }],
            legend: {
              align: 'center',
              verticalAlign: 'bottom',
              floating: false,
              backgroundColor: highcharts__WEBPACK_IMPORTED_MODULE_2__["defaultOptions"].legend.backgroundColor || 'rgba(255,255,255,0.25)'
            },
            plotOptions: {
              column: {
                stacking: 'normal',
                dataLabels: {
                  enabled: false
                }
              },
              spline: {
                dataLabels: {
                  enabled: false
                }
              },
              series: {
                label: {
                  connectorAllowed: false
                }
              }
            },
            exporting: {
              buttons: {
                contextButton: {
                  enabled: false
                }
              }
            },
            credits: {
              enabled: false
            },
            series: [{
              name: 'Over Usage',
              data: overUsage.map(function (o) {
                return parseFloat(o.toFixed(_choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].THREE));
              }),
              color: 'red'
            }, {
              name: 'Usage',
              data: usage.map(function (u) {
                return parseFloat(u.toFixed(_choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].THREE));
              }),
              color: 'blue'
            }, {
              name: 'Cost',
              type: 'spline',
              yAxis: 1,
              color: 'black',
              data: costing.map(function (c) {
                return parseFloat(c.toFixed(_choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].Two)) || _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_11__["DECIMAL_PRECISION"].DEFAULT;
              }),
              tooltip: {
                valueSuffix: ' $'
              }
            }]
          };
        }
      }, {
        key: "getFrequencyEnumValue",
        value: function getFrequencyEnumValue(label) {
          switch (label) {
            case 'Daily':
              return _service_license_graph_model__WEBPACK_IMPORTED_MODULE_7__["LicenseFrequencyEnum"].Daily;

            case 'Weekly':
              return _service_license_graph_model__WEBPACK_IMPORTED_MODULE_7__["LicenseFrequencyEnum"].Weekly;

            case 'Monthly':
              return _service_license_graph_model__WEBPACK_IMPORTED_MODULE_7__["LicenseFrequencyEnum"].Monthly;

            case 'Quarterly':
              return _service_license_graph_model__WEBPACK_IMPORTED_MODULE_7__["LicenseFrequencyEnum"].Quarterly;

            case 'Yearly':
              return _service_license_graph_model__WEBPACK_IMPORTED_MODULE_7__["LicenseFrequencyEnum"].Yearly;

            default:
              throw new Error('Invalid duration type');
          }
        }
      }, {
        key: "durationChanged",
        value: function durationChanged() {
          return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee1() {
            var _this25 = this;

            var accountDetails, usageGranularityPayload, base;
            return _regenerator().w(function (_context1) {
              while (1) switch (_context1.n) {
                case 0:
                  this.route.queryParams.subscribe(function (params) {
                    _this25.accountName = params['accountName'];
                    _this25.projectName = params['projectName'];
                  }); // Get the account details from session object

                  accountDetails = this.sessionService.fetchAccountDetails();
                  this.accountName = accountDetails.accountName;
                  this.projectName = accountDetails.projectName;
                  usageGranularityPayload = {
                    accountName: this.accountName,
                    projectName: this.projectName,
                    serviceName: this.sidebarMenu[this.setIndexForData].serviceName,
                    parameter: this.sidebarMenu[this.setIndexForData].parameter,
                    frequency: this.getFrequencyEnumValue(this.selectDuration)
                  };
                  base = this.sessionService.getBasePath(true, null, null);
                  this.licenseGraphData.loadGraphData(usageGranularityPayload, base).subscribe(function (state) {
                    if (state instanceof _license_plan_service_license_plan_state__WEBPACK_IMPORTED_MODULE_4__["AccountDetailsLoadingState"]) {
                      return;
                    }

                    if (state instanceof _license_plan_service_license_plan_state__WEBPACK_IMPORTED_MODULE_4__["AccountDetailsLoadedState"]) {
                      if (state.data) {
                        _this25.createGraph(state.data);
                      } else {
                        _this25.cavLoggingService.error('License Usage Cost', "Exception occured in createGraph method ", state.error);
                      }

                      return;
                    }
                  }, function (state) {
                    _this25.cavLoggingService.error('License Usage Cost', "Exception occured in createGraph method ", state.error);
                  });

                case 1:
                  return _context1.a(2);
              }
            }, _callee1, this);
          }));
        }
      }, {
        key: "ngOnDestroy",
        value: function ngOnDestroy() {
          this.choosePlanService.confirmDetails = null;
          this.choosePlanService.customerNewRequest = null;
        }
      }]);
    }();

    LicenseUsageCostComponent.ctorParameters = function () {
      return [{
        type: _license_plan_service_license_plan_service__WEBPACK_IMPORTED_MODULE_3__["LicensePlanService"]
      }, {
        type: _angular_router__WEBPACK_IMPORTED_MODULE_5__["Router"]
      }, {
        type: _service_license_graph_service__WEBPACK_IMPORTED_MODULE_6__["LicenseGraphService"]
      }, {
        type: _angular_router__WEBPACK_IMPORTED_MODULE_5__["ActivatedRoute"]
      }, {
        type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_8__["SessionService"]
      }, {
        type: _choose_plan_service_choose_plan_service__WEBPACK_IMPORTED_MODULE_9__["ChoosePlanService"]
      }, {
        type: src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_10__["CavLoggingService"]
      }, {
        type: src_app_shared_cav_license_services_cav_license_service__WEBPACK_IMPORTED_MODULE_13__["CavLicenseService"]
      }, {
        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__["Output"])()], LicenseUsageCostComponent.prototype, "itemSelected", void 0);
    LicenseUsageCostComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
      selector: 'app-license-usage-cost',
      template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! raw-loader!./license-usage-cost.component.html */
      "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/license-usage-cost/license-usage-cost.component.html"))["default"],
      styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! ./license-usage-cost.component.scss */
      "./src/app/pages/tools/license-manager/license-usage-cost/license-usage-cost.component.scss"))["default"]]
    })], LicenseUsageCostComponent);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/license-usage-cost/license-usage-cost.module.ts":
  /*!*********************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-usage-cost/license-usage-cost.module.ts ***!
    \*********************************************************************************************/

  /*! exports provided: LicenseUsageCostModule */

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

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


    __webpack_require__.d(__webpack_exports__, "LicenseUsageCostModule", function () {
      return LicenseUsageCostModule;
    });
    /* 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 _license_usage_cost_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ./license-usage-cost.component */
    "./src/app/pages/tools/license-manager/license-usage-cost/license-usage-cost.component.ts");
    /* harmony import */


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


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


    var src_app_shared_header_header_module__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! src/app/shared/header/header.module */
    "./src/app/shared/header/header.module.ts");
    /* harmony import */


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


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


    var _shared_pipes_pipes_module__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
    /*! ../../../../shared/pipes/pipes.module */
    "./src/app/shared/pipes/pipes.module.ts");
    /* harmony import */


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

    var routes = [{
      path: 'LicenseCost',
      component: _license_usage_cost_component__WEBPACK_IMPORTED_MODULE_3__["LicenseUsageCostComponent"]
    }];
    var imports = [_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["ToolbarModule"], src_app_shared_header_header_module__WEBPACK_IMPORTED_MODULE_6__["HeaderModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["ButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_5__["SelectButtonModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_7__["FormsModule"], src_app_shared_cav_loader_cav_loader_module__WEBPACK_IMPORTED_MODULE_10__["CavLoaderModule"], highcharts_angular__WEBPACK_IMPORTED_MODULE_8__["HighchartsChartModule"]];
    var components = [_license_usage_cost_component__WEBPACK_IMPORTED_MODULE_3__["LicenseUsageCostComponent"]];

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

    LicenseUsageCostModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
      declarations: [components],
      exports: [_angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterModule"], _license_usage_cost_component__WEBPACK_IMPORTED_MODULE_3__["LicenseUsageCostComponent"]],
      imports: [imports, _angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterModule"].forChild(routes), _shared_pipes_pipes_module__WEBPACK_IMPORTED_MODULE_9__["PipeModule"]]
    })], LicenseUsageCostModule);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/license-usage-cost/service/license-graph.model.ts":
  /*!***********************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-usage-cost/service/license-graph.model.ts ***!
    \***********************************************************************************************/

  /*! exports provided: LicenseFrequencyEnum */

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

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


    __webpack_require__.d(__webpack_exports__, "LicenseFrequencyEnum", function () {
      return LicenseFrequencyEnum;
    });

    var LicenseFrequencyEnum;

    (function (LicenseFrequencyEnum) {
      LicenseFrequencyEnum[LicenseFrequencyEnum["Daily"] = 0] = "Daily";
      LicenseFrequencyEnum[LicenseFrequencyEnum["Weekly"] = 1] = "Weekly";
      LicenseFrequencyEnum[LicenseFrequencyEnum["Monthly"] = 2] = "Monthly";
      LicenseFrequencyEnum[LicenseFrequencyEnum["Quarterly"] = 3] = "Quarterly";
      LicenseFrequencyEnum[LicenseFrequencyEnum["Yearly"] = 4] = "Yearly";
    })(LicenseFrequencyEnum || (LicenseFrequencyEnum = {}));
    /***/

  },

  /***/
  "./src/app/pages/tools/license-manager/license-usage-cost/service/license-graph.service.ts":
  /*!*************************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/license-usage-cost/service/license-graph.service.ts ***!
    \*************************************************************************************************/

  /*! exports provided: LicenseGraphService */

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

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


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


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


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


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


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


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


    var src_app_core_store_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
    /*! src/app/core/store/store */
    "./src/app/core/store/store.ts");
    /* harmony import */


    var _license_plan_service_license_plan_state__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! ../../license-plan/service/license-plan.state */
    "./src/app/pages/tools/license-manager/license-plan/service/license-plan.state.ts");

    var LicenseGraphService = /*#__PURE__*/function (_src_app_core_store_s3) {
      function LicenseGraphService(http) {
        var _this26;

        _classCallCheck(this, LicenseGraphService);

        _this26 = _callSuper(this, LicenseGraphService);
        _this26.http = http;
        return _this26;
      }

      _inherits(LicenseGraphService, _src_app_core_store_s3);

      return _createClass(LicenseGraphService, [{
        key: "loadGraphData",
        value: function loadGraphData(requestBody, base) {
          var me = this;
          var output = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
          setTimeout(function () {
            output.next(new _license_plan_service_license_plan_state__WEBPACK_IMPORTED_MODULE_6__["AccountDetailsLoadedState"](undefined));
          }, 0);
          var path = src_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].api.licenseManager.usageBasedOnGranualarity.endpoint;
          me.controller.post(path, requestBody, base).subscribe(function (data) {
            output.next(new _license_plan_service_license_plan_state__WEBPACK_IMPORTED_MODULE_6__["AccountDetailsLoadedState"](data));
            output.complete();
          }, function (e) {
            output.error(new _license_plan_service_license_plan_state__WEBPACK_IMPORTED_MODULE_6__["AccountDetailsLoadingErrorState"](e));
            output.complete();
          });
          return output;
        }
      }]);
    }(src_app_core_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].AbstractService);

    LicenseGraphService.ctorParameters = function () {
      return [{
        type: _angular_common_http__WEBPACK_IMPORTED_MODULE_4__["HttpClient"]
      }];
    };

    LicenseGraphService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
      providedIn: 'root'
    })], LicenseGraphService);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/purchase-confirm/purchase-confirm.component.scss":
  /*!**********************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/purchase-confirm/purchase-confirm.component.scss ***!
    \**********************************************************************************************/

  /*! exports provided: default */

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

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


    __webpack_exports__["default"] = "/* purchase-confirm.component.css */\n/* Form container */\nform {\n  max-width: 400px;\n  /* Adjust max-width as per your layout */\n  margin: 0 auto;\n  padding: 20px;\n  border: 1px solid #ccc;\n  border-radius: 8px;\n  background-color: #f9f9f9;\n}\n/* Form labels */\nlabel {\n  display: block;\n  margin-bottom: 8px;\n  font-weight: bold;\n}\n/* Form input fields */\ninput[type=text] {\n  width: calc(100% - 20px);\n  /* Adjust width and padding as needed */\n  padding: 10px;\n  margin-bottom: 15px;\n  border: 1px solid #ccc;\n  border-radius: 4px;\n}\n/* Error messages */\ndiv.error-message {\n  color: red;\n  font-size: 14px;\n  margin-top: 5px;\n}\n/* Submit button */\nbutton[type=submit] {\n  display: block;\n  width: 100%;\n  padding: 10px;\n  margin-top: 15px;\n  background-color: #007bff;\n  color: white;\n  border: none;\n  border-radius: 4px;\n  cursor: pointer;\n}\nbutton[type=submit]:hover {\n  background-color: #0056b3;\n}\n.oldPrice {\n  text-decoration: line-through;\n  opacity: 0.5;\n}\nth.text-left strong {\n  font-weight: bold;\n}\nth.text-left {\n  font-weight: normal;\n}";
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/purchase-confirm/purchase-confirm.component.ts":
  /*!********************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/purchase-confirm/purchase-confirm.component.ts ***!
    \********************************************************************************************/

  /*! exports provided: PurchaseConfirmComponent */

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

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


    __webpack_require__.d(__webpack_exports__, "PurchaseConfirmComponent", function () {
      return PurchaseConfirmComponent;
    });
    /* 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 _choose_plan_service_choose_plan_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
    /*! ../choose-plan/service/choose-plan.service */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.service.ts");
    /* harmony import */


    var _license_plan_service_license_plan_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ../license-plan/service/license-plan.service */
    "./src/app/pages/tools/license-manager/license-plan/service/license-plan.service.ts");
    /* harmony import */


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


    var _license_plan_service_license_plan_model__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
    /*! ../license-plan/service/license-plan.model */
    "./src/app/pages/tools/license-manager/license-plan/service/license-plan.model.ts");
    /* harmony import */


    var _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! ../choose-plan/service/choose-plan.state */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.state.ts");
    /* harmony import */


    var src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
    /*! src/app/shared/cav-toast/service/cav-message.service */
    "./src/app/shared/cav-toast/service/cav-message.service.ts");
    /* harmony import */


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


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


    var _advanced_saas_cluster_management_saas_cluster_management_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(
    /*! ../../advanced/saas-cluster-management/saas-cluster-management.service */
    "./src/app/pages/tools/advanced/saas-cluster-management/saas-cluster-management.service.ts");
    /* harmony import */


    var src_app_shared_cav_license_services_cav_license_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(
    /*! src/app/shared/cav-license/services/cav-license.service */
    "./src/app/shared/cav-license/services/cav-license.service.ts");
    /* harmony import */


    var _advanced_saas_cluster_management_saas_clutser_management_state__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(
    /*! ../../advanced/saas-cluster-management/saas-clutser-management.state */
    "./src/app/pages/tools/advanced/saas-cluster-management/saas-clutser-management.state.ts");
    /* harmony import */


    var src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(
    /*! src/app/shared/cavLoggerService/cav-logging.service */
    "./src/app/shared/cavLoggerService/cav-logging.service.ts");
    /* harmony import */


    var _advanced_saas_cluster_management_saas_cluster_management_enum__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(
    /*! ../../advanced/saas-cluster-management/saas-cluster-management.enum */
    "./src/app/pages/tools/advanced/saas-cluster-management/saas-cluster-management.enum.ts");
    /* harmony import */


    var _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(
    /*! ../choose-plan/service/choose-plan.enum */
    "./src/app/pages/tools/license-manager/choose-plan/service/choose-plan.enum.ts");

    var PurchaseConfirmComponent = /*#__PURE__*/function () {
      function PurchaseConfirmComponent(choosePlanService, licensePlanService, sessionService, messageService, router, confirmationService, _saasService, licenseService, cavLoggingService) {
        _classCallCheck(this, PurchaseConfirmComponent);

        this.choosePlanService = choosePlanService;
        this.licensePlanService = licensePlanService;
        this.sessionService = sessionService;
        this.messageService = messageService;
        this.router = router;
        this.confirmationService = confirmationService;
        this._saasService = _saasService;
        this.licenseService = licenseService;
        this.cavLoggingService = cavLoggingService;
        this.serviceTableHeader = "saas/licenseService.json";
        this.serviceTableData = [];
        this.cardTableInfo = "saas/cardTableInfo.json";
        this.cardArr = []; // priceAfterProRata: number;
        // proRataAmount: number;

        this.isYearly = false; // Default is monthly

        this.totalDays = 0; // Total days in the scope (month or year)

        this.totalDaysGone = 0; // Days passed in the scope

        this.priceAfterProRata = 0; // Final price after pro-rata calculation
      }

      return _createClass(PurchaseConfirmComponent, [{
        key: "ngOnInit",
        value: function ngOnInit() {
          var me = this;
          me.isLoading = true;
          me.confirmDetails = me.choosePlanService.confirmDetails;
          me.customerNewRequest = me.choosePlanService.customerNewRequest;
          me.getAccountDetails();
          me.setCustomerData();
          me.createRowData();
          me.getCards();

          if (this.sessionService.checkFreeTrialLicenseExpires()) {
            this.sessionService.showLicenseExpiryDialog = false;
            this.sessionService.userUpgradingLicense = true;
          }
        }
      }, {
        key: "getAccountDetails",
        value: function getAccountDetails() {
          return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee10() {
            var accountDetails;
            return _regenerator().w(function (_context10) {
              while (1) switch (_context10.n) {
                case 0:
                  // Get the account details from session object
                  accountDetails = this.sessionService.fetchAccountDetails();
                  this.accountName = accountDetails.accountName;
                  this.projectName = accountDetails.projectName;
                  this.customerEmail = accountDetails.accountEmail;

                case 1:
                  return _context10.a(2);
              }
            }, _callee10, this);
          }));
        }
      }, {
        key: "getCards",
        value: function getCards() {
          var _this27 = this;

          var customer = {
            saasAccountName: this.accountName,
            saasProjectName: this.projectName,
            saasEmail: this.customerEmail,
            updatedCardListFlag: false
          };
          this.choosePlanService.getPaymentMethods(customer).subscribe(function (state) {
            if (state instanceof _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["CardDetailsLoadingState"]) {
              return;
            }

            if (state instanceof _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["CardDetailsLoadedState"]) {
              _this27.setCardsList(state.data.data);
            }

            if (state instanceof _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["CardDetailsLoadingErrorState"]) {
              _this27.cavLoggingService.error('Purchase Confirm , Error in getting payment methods', state.error);
            }
          });
        }
      }, {
        key: "confirm",
        value: function confirm() {
          var me = this;
          me.confirmationService.confirm({
            message: 'Please confirm that you want to proceed.Yow will be logged out?',
            header: 'Confirmation',
            icon: 'pi pi-exclamation-triangle',
            accept: function accept() {
              me.confirmPurchaseFnc();
            },
            reject: function reject() {}
          });
        }
      }, {
        key: "openServiceDialog",
        value: function openServiceDialog() {
          this.isDialogVisible = true;
          this.serviceTableData = [];

          for (var i = 0; i < this.confirmDetails.serviceDetails.length; i++) {
            var service = this.confirmDetails.serviceDetails[i];
            this.serviceTableData.push({
              serviceName: service.serviceName,
              price: "$".concat(service.monthlyPrice.toFixed(2))
            });
          }
        }
      }, {
        key: "migrateSubscriptions",
        value: function migrateSubscriptions() {
          var _this28 = this;

          var me = this;
          var operationPayload = {
            podName: me.sessionService.preSession.saasNdeControllerName,
            operation: _advanced_saas_cluster_management_saas_cluster_management_enum__WEBPACK_IMPORTED_MODULE_14__["K8S_STACK_OPERATION_TYPE"].POD_MIGRATION,
            k8sStack: _advanced_saas_cluster_management_saas_cluster_management_enum__WEBPACK_IMPORTED_MODULE_14__["K8S_STACK_TYPE_NAME"].POD
          };
          var base = me.sessionService.getBasePath(true, null, null);

          me._saasService.handleK8sOperations(operationPayload, base).subscribe(function (state) {
            if (state instanceof _advanced_saas_cluster_management_saas_clutser_management_state__WEBPACK_IMPORTED_MODULE_12__["k8sOperationLoadingState"]) {
              return;
            }

            if (state instanceof _advanced_saas_cluster_management_saas_clutser_management_state__WEBPACK_IMPORTED_MODULE_12__["k8sOperationLoadedState"]) {
              me.onLoadedCluster();
              return;
            }
          }, function (error) {
            _this28.cavLoggingService.error('Purchase Confirm , Error in getting migrate subscriptions methods', error);
          });
        }
      }, {
        key: "onLoadedCluster",
        value: function onLoadedCluster() {
          var _this29 = this;

          var _a;

          var me = this;
          var url = "https://" + ((_a = me.sessionService.preSession) === null || _a === void 0 ? void 0 : _a.saasControllerDomain);
          new Promise(function (resolve, reject) {
            _this29.sessionService.logout();
          });
          window.open(url, '_self');
          return;
        }
      }, {
        key: "setCardsList",
        value: function setCardsList(cardList) {
          var me = this; // Set card array to the provided card list

          me.cardArr = cardList; // Find and set the selected card

          me.selectedCard = cardList.find(function (card) {
            return card.ppPaymentMethodId === me.customerNewRequest.paymentDetails.paymentMethodId;
          }); // Stop loading after the operation is complete

          me.isLoading = false;
        }
      }, {
        key: "bindCard",
        value: function bindCard(event) {
          var me = this;
          this.selectedCard = event.cavEventExt.rowDataForChooseYourOwnPlan;
        }
      }, {
        key: "changeCard",
        value: function changeCard() {
          var me = this;
          me.customerNewRequest.paymentDetails.paymentMethodId = me.selectedCard.ppPaymentMethodId;
          me.cardNumber = me.selectedCard.cardNumber;
          me.cardHolderName = me.selectedCard.cardHolderName;
          me.showCardChangeDialog = false;
        }
      }, {
        key: "confirmPurchase",
        value: function confirmPurchase() {
          var me = this;

          if (me.confirmDetails.subscriptionType === _license_plan_service_license_plan_model__WEBPACK_IMPORTED_MODULE_5__["SubscriptionTypeEnum"].Free) {
            me.confirm();
          } else {
            me.confirmPurchaseFnc();
          }
        }
      }, {
        key: "confirmPurchaseFnc",
        value: function confirmPurchaseFnc() {
          var _this30 = this;

          var me = this;
          me.isLoading = true;
          me.isFinalButtonDisabled = true;
          me.choosePlanService.createLicenseRequest(me.customerNewRequest).subscribe(function (state) {
            if (state instanceof _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["RequestDetailsLoadingState"]) {
              return;
            }

            if (state instanceof _choose_plan_service_choose_plan_state__WEBPACK_IMPORTED_MODULE_6__["RequestDetailsLoadedState"]) {
              me.isLoading = false;

              if (me.confirmDetails.subscriptionType === _license_plan_service_license_plan_model__WEBPACK_IMPORTED_MODULE_5__["SubscriptionTypeEnum"].Free) {
                me.migrateSubscriptions();
              }

              var base = me.sessionService.getBasePath(true, null, null);
              me.licenseService.getAndSetActiveServiceSubscriptions(base);

              var accountDetails = _this30.sessionService.fetchAccountDetails();

              if (accountDetails.subscriptionType === _license_plan_service_license_plan_model__WEBPACK_IMPORTED_MODULE_5__["SubscriptionTypeEnum"].Free) {
                accountDetails.subscriptionType = me.confirmDetails.subscriptionType;
                me.sessionService.setAccountDetails(accountDetails);
              }

              me.showSuccessDialog = true;
            }
          }, function (state) {
            me.isLoading = false;
            me.isFinalButtonDisabled = false;
            me.messageService.showError("License Plan Purchase Failed");
          });
        }
      }, {
        key: "cancelPurchase",
        value: function cancelPurchase() {
          var url = "/LicenseManager/choosePlan?accountName=".concat(this.accountName, "&projectName=").concat(this.projectName);
          this.router.navigateByUrl(url);
        }
      }, {
        key: "onContinue",
        value: function onContinue() {
          var me = this;
          me.showSuccessDialog = false;
          me.choosePlanService.confirmDetails = null;
          me.choosePlanService.customerNewRequest = null;
          me.router.navigateByUrl('/home/saas-services');
        }
      }, {
        key: "onPurchaseAnother",
        value: function onPurchaseAnother() {
          var me = this;
          me.showSuccessDialog = false;
          me.choosePlanService.confirmDetails = null;
          me.choosePlanService.customerNewRequest = null;
          var url = "/LicenseManager/choosePlan?accountName=".concat(this.accountName, "&projectName=").concat(this.projectName);
          this.router.navigateByUrl(url);
        }
      }, {
        key: "createRowData",
        value: function createRowData() {
          var me = this;
          me.rowDataForChooseYourOwnPlan = [];
          var isAnnualSubscrption = me.customerNewRequest.paymentDetails.paymentMode == _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_15__["PAYMENT_MODE_ENUM"].PAY_ANNUALLY ? true : false;

          if (!me.isPayAsYouGoPlanSelected()) {
            me.rowDataForChooseYourOwnPlan = me.confirmDetails.serviceDetails.map(function (service) {
              // Derive the totalPrice by multiplying unit price by quantity (here, 'units')
              if (isAnnualSubscrption) {
                service.price = service.price * 12;
              }

              var totalPrice = service.price * service.units;
              return {
                service: service.serviceName,
                unitPrice: service.price,
                quantity: service.units,
                usage: "".concat(new Intl.NumberFormat('en-US').format(service.units * service.thresholdPerUnit), " ").concat(service.parameter, ": (").concat(me.startDateOfMonth, " - ").concat(me.formattedEndDate, ")"),
                totalPrice: totalPrice // Calculate total price

              };
            });
          } else {
            me.rowDataForPayAsYouGo = {
              assignedPlan: _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_15__["PLAN_TYPE_NAME_ENUM"].PAY_AS_YOUGO,
              unitPrice: 'View',
              quantity: 'NA',
              planTenure: me.startDate + "-" + me.endDate,
              totalPrice: 'Generated at the end of the month'
            };
          }
        }
      }, {
        key: "setCustomerData",
        value: function setCustomerData() {
          var me = this;
          me.companyName = me.confirmDetails.companyName;
          me.paymentFrequency = me.customerNewRequest.paymentDetails.paymentMode == _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_15__["PAYMENT_MODE_ENUM"].PAY_ANNUALLY ? _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_15__["PAYMENT_MODE_FREQUENCY_ENUM"].ANNUALLY : _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_15__["PAYMENT_MODE_FREQUENCY_ENUM"].MONTHLY;

          if (me.confirmDetails.billingAddress.address_line2 != undefined) {
            me.billingAddress = me.confirmDetails.billingAddress.address_line1 + ' ' + me.confirmDetails.billingAddress.address_line2 + ' ' + me.confirmDetails.billingAddress.city + ' ' + me.confirmDetails.billingAddress.state;
          } else {
            me.billingAddress = me.confirmDetails.billingAddress.address_line1 + ' ' + me.confirmDetails.billingAddress.city + ' ' + me.confirmDetails.billingAddress.state;
          }

          var options = {
            year: 'numeric',
            month: 'short',
            day: 'numeric'
          };
          var shortDateOptions = {
            year: '2-digit',
            month: '2-digit',
            day: 'numeric'
          };
          var currentDate = new Date(); // Current date

          var startDateOfMonth = me.getStartDateOfMonth(currentDate);
          me.startDateOfMonth = startDateOfMonth.toLocaleDateString('en-US', shortDateOptions);
          me.startDate = currentDate.toLocaleDateString('en-US', options);
          me.formattedStartDate = currentDate.toLocaleDateString('en-US', shortDateOptions);
          me.annuallyCommitted = me.customerNewRequest.paymentDetails.paymentMode == 1 ? true : false;
          me.proRataAmount = me.calculateProRata();

          if (me.annuallyCommitted && !me.isPayAsYouGoPlanSelected()) {
            me.totalAnnualPrice = parseFloat((me.confirmDetails.annuallyPrice * 12).toFixed(2));
            me.totalPrice = parseFloat((me.totalAnnualPrice - me.proRataAmount).toFixed(2)); /// Add 1 year to the start date

            var endDate = new Date(startDateOfMonth);
            endDate.setFullYear(startDateOfMonth.getFullYear() + 1); // Add 1 year
            // Subtract 1 day to get the last day of the previous month in the next year

            endDate.setDate(endDate.getDate() - 1); // Set to the last day of the previous month

            me.endDate = endDate.toLocaleDateString('en-US', options);
            me.formattedEndDate = endDate.toLocaleDateString('en-US', shortDateOptions);
          } else {
            me.totalPrice = parseFloat((me.confirmDetails.monthlyPrice - me.proRataAmount).toFixed(2));

            var _endDate = new Date(startDateOfMonth);

            _endDate.setMonth(startDateOfMonth.getMonth() + 1); // Add 1 month to start date
            // Adjust to last day of previous month


            _endDate.setDate(_endDate.getDate() - 1); // Set to the last day of the previous month


            me.endDate = _endDate.toLocaleDateString('en-US', options);
            me.formattedEndDate = _endDate.toLocaleDateString('en-US', shortDateOptions);
          }

          me.totalMonthlyPrice = me.confirmDetails.monthlyPrice;
          me.cardNumber = me.confirmDetails.cardDetails.cardNumber, me.cardHolderName = me.confirmDetails.cardDetails.cardHolderName, me.cardBrand = me.confirmDetails.cardDetails.brand, me.expMonth = me.confirmDetails.cardDetails.expMonth, me.expYear = me.confirmDetails.cardDetails.expYear;
        }
      }, {
        key: "getStartDateOfMonth",
        value: function getStartDateOfMonth(date) {
          var startDate = new Date(date); // Create a copy of the given date

          startDate.setDate(1); // Set the date to the 1st of the month

          startDate.setHours(0, 0, 0, 0); // Set time to the beginning of the day (midnight)

          return startDate;
        }
      }, {
        key: "ngOnDestroy",
        value: function ngOnDestroy() {
          if (this.sessionService.checkFreeTrialLicenseExpires()) {
            this.sessionService.showLicenseExpiryDialog = true;
            this.sessionService.userUpgradingLicense = false;
          } // this.choosePlanService.customerNewRequest = null;
          // this.choosePlanService.confirmDetails = null;

        }
      }, {
        key: "handlePayment",
        value: function handlePayment(event) {}
      }, {
        key: "isPayAsYouGoPlanSelected",
        value: function isPayAsYouGoPlanSelected() {
          var selectedPlan = this.confirmDetails.planTypes.find(function (plan) {
            return plan.selected;
          });
          return selectedPlan.planName === _choose_plan_service_choose_plan_enum__WEBPACK_IMPORTED_MODULE_15__["PLAN_TYPE_NAME_ENUM"].PAY_AS_YOUGO ? true : false;
        }
      }, {
        key: "calculateProRata",
        value: function calculateProRata() {
          var me = this;
          var proRata = 0; // Current date as the "purchase date"

          var currentDate = new Date(); // Set start and end dates based on the current month and current date
          // const startOfPeriodProRata = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
          // const endOfPeriodProRata = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()-1);
          // Store the formatted start and end dates
          // this.proRataStartDate = this.formatDate(startOfPeriodProRata);
          // this.proRataEndDate = this.formatDate(endOfPeriodProRata);
          // Calculate the total days and days gone in the Month

          var daysGone = currentDate.getDate() - 1;
          var totalDays = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).getDate();
          var proRataRatio = daysGone / totalDays;

          if (me.annuallyCommitted) {
            me.annuallyPrice = me.confirmDetails.annuallyPrice;
            proRata = parseFloat((me.annuallyPrice * proRataRatio).toFixed(2));
          } else {
            me.totalMonthlyPrice = me.confirmDetails.monthlyPrice;
            proRata = parseFloat((me.totalMonthlyPrice * proRataRatio).toFixed(2));
          }

          proRata = Math.abs(proRata);
          return proRata;
        }
      }, {
        key: "formatDate",
        value: function formatDate(date) {
          var year = String(date.getFullYear()).slice(-2);
          ;
          var month = String(date.getMonth() + 1).padStart(2, '0');
          var day = String(date.getDate()).padStart(2, '0');
          return "".concat(month, "/").concat(day, "/").concat(year);
        }
      }]);
    }();

    PurchaseConfirmComponent.ctorParameters = function () {
      return [{
        type: _choose_plan_service_choose_plan_service__WEBPACK_IMPORTED_MODULE_2__["ChoosePlanService"]
      }, {
        type: _license_plan_service_license_plan_service__WEBPACK_IMPORTED_MODULE_3__["LicensePlanService"]
      }, {
        type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_4__["SessionService"]
      }, {
        type: src_app_shared_cav_toast_service_cav_message_service__WEBPACK_IMPORTED_MODULE_7__["CavMessageService"]
      }, {
        type: _angular_router__WEBPACK_IMPORTED_MODULE_8__["Router"]
      }, {
        type: primeng__WEBPACK_IMPORTED_MODULE_9__["ConfirmationService"]
      }, {
        type: _advanced_saas_cluster_management_saas_cluster_management_service__WEBPACK_IMPORTED_MODULE_10__["SaasClusterManagementService"]
      }, {
        type: src_app_shared_cav_license_services_cav_license_service__WEBPACK_IMPORTED_MODULE_11__["CavLicenseService"]
      }, {
        type: src_app_shared_cavLoggerService_cav_logging_service__WEBPACK_IMPORTED_MODULE_13__["CavLoggingService"]
      }];
    };

    PurchaseConfirmComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
      selector: 'app-purchase-confirm',
      template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! raw-loader!./purchase-confirm.component.html */
      "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/tools/license-manager/purchase-confirm/purchase-confirm.component.html"))["default"],
      styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! ./purchase-confirm.component.scss */
      "./src/app/pages/tools/license-manager/purchase-confirm/purchase-confirm.component.scss"))["default"]]
    })], PurchaseConfirmComponent);
    /***/
  },

  /***/
  "./src/app/pages/tools/license-manager/purchase-confirm/purchase-confirm.module.ts":
  /*!*****************************************************************************************!*\
    !*** ./src/app/pages/tools/license-manager/purchase-confirm/purchase-confirm.module.ts ***!
    \*****************************************************************************************/

  /*! exports provided: PurchaseConfirmModule */

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

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


    __webpack_require__.d(__webpack_exports__, "PurchaseConfirmModule", function () {
      return PurchaseConfirmModule;
    });
    /* 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 _purchase_confirm_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ./purchase-confirm.component */
    "./src/app/pages/tools/license-manager/purchase-confirm/purchase-confirm.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 _credit_card_credit_card_module__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
    /*! ../credit-card/credit-card.module */
    "./src/app/pages/tools/license-manager/credit-card/credit-card.module.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");
    /* harmony import */


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

    var routes = [{
      path: 'purchaseConfirm',
      component: _purchase_confirm_component__WEBPACK_IMPORTED_MODULE_3__["PurchaseConfirmComponent"]
    }];
    var imports = [_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"], primeng__WEBPACK_IMPORTED_MODULE_6__["InputSwitchModule"], primeng__WEBPACK_IMPORTED_MODULE_6__["ButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_6__["SpinnerModule"], primeng__WEBPACK_IMPORTED_MODULE_6__["RadioButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_6__["InputTextModule"], primeng__WEBPACK_IMPORTED_MODULE_6__["DialogModule"], _angular_forms__WEBPACK_IMPORTED_MODULE_4__["ReactiveFormsModule"], _credit_card_credit_card_module__WEBPACK_IMPORTED_MODULE_7__["CreditCardModule"], src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_8__["CavTableModule"], primeng__WEBPACK_IMPORTED_MODULE_6__["RadioButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_6__["ButtonModule"], src_app_shared_cav_loader_cav_loader_module__WEBPACK_IMPORTED_MODULE_9__["CavLoaderModule"], primeng__WEBPACK_IMPORTED_MODULE_6__["ConfirmDialogModule"]];
    var components = [_purchase_confirm_component__WEBPACK_IMPORTED_MODULE_3__["PurchaseConfirmComponent"]];

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

    PurchaseConfirmModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
      declarations: [components],
      imports: [imports, _angular_router__WEBPACK_IMPORTED_MODULE_5__["RouterModule"].forChild(routes)],
      exports: [_angular_router__WEBPACK_IMPORTED_MODULE_5__["RouterModule"], _purchase_confirm_component__WEBPACK_IMPORTED_MODULE_3__["PurchaseConfirmComponent"]]
    })], PurchaseConfirmModule);
    /***/
  }
}]);