buildingproduct-library 1.1.8 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -991,11 +991,92 @@
991
991
  }]
992
992
  }], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
993
993
 
994
+ var CartService = /** @class */ (function () {
995
+ function CartService(http) {
996
+ this.http = http;
997
+ this.expandAll = new rxjs.BehaviorSubject(false);
998
+ this.isAccountLoaded = new rxjs.BehaviorSubject(false);
999
+ }
1000
+ CartService.prototype.getCartList = function (cartId, sortBy) {
1001
+ var url = GET_CART_LIST_ENDPOINT.url + cartId + '?fields=FULL';
1002
+ if (sortBy != undefined)
1003
+ url = url + sortBy;
1004
+ return this.http
1005
+ .get(url, {
1006
+ headers: { 'Content-Type': 'application/json' },
1007
+ })
1008
+ .pipe(operators.catchError(function (errorRes) {
1009
+ return rxjs.throwError(errorRes);
1010
+ }));
1011
+ };
1012
+ CartService.prototype.getOrderDetails = function (orderId) {
1013
+ var url = GET_ORDER_DETAIL.url + orderId + '?fields=DEFAULT&needBase64MediaURL=true&versionId=initial';
1014
+ return this.http
1015
+ .get(url, {
1016
+ headers: { 'Content-Type': 'application/json' },
1017
+ })
1018
+ .pipe(operators.catchError(function (errorRes) {
1019
+ return rxjs.throwError(errorRes);
1020
+ }));
1021
+ };
1022
+ CartService.prototype.deleteCartEntry = function (cartId, entryNumber) {
1023
+ var url = DELETE_CART_ENTRY_ENDPOINT.url + cartId + '/entries/' + entryNumber;
1024
+ return this.http
1025
+ .delete(url, {
1026
+ headers: { 'Content-Type': 'application/json' },
1027
+ })
1028
+ .pipe(operators.catchError(function (errorRes) {
1029
+ return rxjs.throwError(errorRes);
1030
+ }));
1031
+ };
1032
+ CartService.prototype.clearCart = function (cartId) {
1033
+ var url = DELETE_CART_ENTRY_ENDPOINT.url + cartId;
1034
+ return this.http
1035
+ .delete(url, {
1036
+ headers: { 'Content-Type': 'application/json' },
1037
+ })
1038
+ .pipe(operators.catchError(function (errorRes) {
1039
+ return rxjs.throwError(errorRes);
1040
+ }));
1041
+ };
1042
+ CartService.prototype.updateCartEntry = function (cartId, entryNumber, payLoad) {
1043
+ var url = UPDATE_CART_ENTRY_ENDPOINT.url + cartId + '/bpEntries/' + entryNumber;
1044
+ return this.http.put(url, payLoad, {
1045
+ headers: { 'Content-Type': 'application/json' },
1046
+ })
1047
+ .pipe(operators.catchError(function (errorRes) {
1048
+ return rxjs.throwError(errorRes);
1049
+ }));
1050
+ };
1051
+ CartService.prototype.reloadCart = function () {
1052
+ var url = GET_CART_DETAILS.url + '?fields=carts(DEFAULT,potentialProductPromotions,appliedProductPromotions,potentialOrderPromotions,appliedOrderPromotions,entries(totalPrice(formattedValue),product(images(FULL),stock(FULL)),basePrice(formattedValue,value),updateable),totalPrice(formattedValue),totalItems,totalPriceWithTax(formattedValue),totalDiscounts(value,formattedValue),subTotal(formattedValue),deliveryItemsQuantity,deliveryCost(formattedValue),totalTax(formattedValue,%20value),pickupItemsQuantity,net,appliedVouchers,productDiscounts(formattedValue),user,saveTime,name,description)';
1053
+ return this.http.get(url, {
1054
+ headers: {
1055
+ 'Content-Type': 'application/json',
1056
+ 'Cache-Control': 'no-store, no-cache'
1057
+ },
1058
+ })
1059
+ .pipe(operators.catchError(function (errorRes) {
1060
+ return rxjs.throwError(errorRes);
1061
+ }));
1062
+ };
1063
+ return CartService;
1064
+ }());
1065
+ CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CartService, deps: [{ token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1066
+ CartService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CartService, providedIn: 'root' });
1067
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CartService, decorators: [{
1068
+ type: i0.Injectable,
1069
+ args: [{
1070
+ providedIn: 'root',
1071
+ }]
1072
+ }], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
1073
+
994
1074
  var AccountDropdownComponent = /** @class */ (function () {
995
- function AccountDropdownComponent(service, fiUserAccountDetailsService, findStoreService) {
1075
+ function AccountDropdownComponent(service, fiUserAccountDetailsService, findStoreService, cartService) {
996
1076
  this.service = service;
997
1077
  this.fiUserAccountDetailsService = fiUserAccountDetailsService;
998
1078
  this.findStoreService = findStoreService;
1079
+ this.cartService = cartService;
999
1080
  this.accounts = [];
1000
1081
  this.showWaitCursor = new rxjs.BehaviorSubject(false);
1001
1082
  this.isAccountChanged = false;
@@ -1057,6 +1138,7 @@
1057
1138
  }
1058
1139
  }
1059
1140
  });
1141
+ this.cartService.isAccountLoaded.next(true);
1060
1142
  if (this.selecteduserData && this.selecteduserData.name) {
1061
1143
  this.selecteduserData = JSON.parse(localStorage.getItem('selectedAccout') || '{}');
1062
1144
  this.accounts.forEach(function (element) {
@@ -1146,7 +1228,7 @@
1146
1228
  };
1147
1229
  return AccountDropdownComponent;
1148
1230
  }());
1149
- AccountDropdownComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AccountDropdownComponent, deps: [{ token: AccountDropdownService }, { token: UserAccountDetailServiceService }, { token: FindStoreService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1231
+ AccountDropdownComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AccountDropdownComponent, deps: [{ token: AccountDropdownService }, { token: UserAccountDetailServiceService }, { token: FindStoreService }, { token: CartService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1150
1232
  AccountDropdownComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AccountDropdownComponent, selector: "app-account-dropdown", ngImport: i0__namespace, template: "<div class=\"loading \" *ngIf=\"showWaitCursor | async \">Loading&#8230;</div>\r\n<div class=\"row hello\">\r\n <div class=\"col-lg-12 col-md-12\">\r\n <div class=\"accountDropdown\">\r\n <div class=\"dropdown input-group\">\r\n <div class=\"input-group-prepend input-icon\">\r\n <img src=\"../../../assets/images/ionic-ios-users-outline.svg\" class=\"w-20\">\r\n </div>\r\n <button class=\"btn custom-input position-relative\" type=\"button\" id=\"branchAccountDropdown\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\r\n\t\t\t\t\t<span *ngIf=\"selectedUser && !selecteduserData?.name\" class=\"accountName\"> {{selectedUser[0]?.name}} </span>\r\n\t\t\t\t\t<span *ngIf=\"selecteduserData && selecteduserData?.name\" class=\"accountName\">{{selecteduserData?.name}}</span>\r\n\t\t\t\t\t<i class=\"fas fa-chevron-down custom-arrow\"></i>\r\n\t\t\t\t</button>\r\n <div class=\"dropdown-menu\" aria-labelledby=\"dropdownMenuButton\">\r\n <div class=\"menu\">\r\n <div *ngFor=\"let data of accounts\" class=\"parent-dropdown-item\">\r\n <div (click)=\"getAccountName(data)\" [ngClass]=\"{'highlight':data.name == selecteduserData?.name || data.isDefaultAccount && !isAccountChanged}\" class=\"labelOneChild position-relative\">\r\n <span class=\"accountdata\"> {{data.name}} </span>\r\n <span class=\"accountIcon\"> \r\n\t\t\t\t\t\t\t\t<img *ngIf=\"data.isDefaultAccount && !isAccountChanged\" src=\"../../../assets/images/Selected-icon.svg\" class=\"selectIcon\">\r\n\t\t\t\t\t\t\t\t<img *ngIf=\"data.name == selecteduserData?.name\" src=\"../../../assets/images/Selected-icon.svg\" class=\"selectIcon\">\r\n\t\t\t\t\t\t\t</span>\r\n </div>\r\n <div class=\"child-menu\" *ngIf=\"data?.children?.length > 0\">\r\n <div *ngFor=\"let child of data?.children\" class=\"child-dropdown-item\">\r\n <div (click)=\"getAccountName(child)\" [ngClass]=\"{'highlight':child.name == selecteduserData?.name}\" class=\"labelTwoChild position-relative\">\r\n <span class=\"accountdata\">{{child.name}} </span>\r\n <span class=\"accountIcon\"><img *ngIf=\"child.name == selecteduserData?.name\" src=\"../../../assets/images/Selected-icon.svg\" class=\"selectIcon\"></span>\r\n <img *ngIf=\"child.isDefaultAccount && !isAccountChanged\" src=\"../../../assets/images/Selected-icon.svg\" class=\"selectIcon\">\r\n\t\t\t\t\t\t\t\t <img *ngIf=\"child.name == selecteduserData?.name\" src=\"../../../assets/images/Selected-icon.svg\" class=\"selectIcon\">\r\n </div>\r\n <div *ngIf=\"child?.children?.length > 0\" class=\"subchild-menu\">\r\n <div *ngFor=\"let subChild of child.children\" class=\"subdropdown-item\">\r\n <div (click)=\"getAccountName(subChild)\" [ngClass]=\"{'highlight':subChild.name == selecteduserData?.name}\" class=\"labelThreeChild position-relative\">\r\n <span class=\"accountdata\">{{subChild.name}} </span>\r\n <span class=\"accountIcon\"><img *ngIf=\"subChild.name == selecteduserData?.name\" src=\"../../../assets/images/Selected-icon.svg\" class=\"selectIcon\"></span>\r\n <img *ngIf=\"subChild.isDefaultAccount && !isAccountChanged\" src=\"../../../assets/images/Selected-icon.svg\" class=\"selectIcon\">\r\n\t\t\t\t\t\t\t\t <img *ngIf=\"subChild.name == selecteduserData?.name\" src=\"../../../assets/images/Selected-icon.svg\" class=\"selectIcon\">\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n <!-- <div class=\"col-lg-7 col-md-12\">\r\n <app-find-store></app-find-store>\r\n </div> -->\r\n</div>\r\n<ngb-toast *ngIf=\"showToast\" [autohide]=\"true\" [delay]=\"4000\">\r\n <img src=\"../../../../assets/images/ActivateIcon.svg\"> Account has been changed\r\n <i class=\"icon-close toast-close\" aria-label=\"Close\" (click)=\"closeToast()\"></i>\r\n</ngb-toast>\r\n", styles: ["@charset \"UTF-8\";@media screen and (min-width: 1366px){:root{--fontsize12: .75rem;--fontsize14: .875rem;--fontsize16: 1rem;--fontsize17: 1.063rem;--fontsize17-5: 1.1rem;--fontsize18: 1.125rem;--fontsize18-4: 1.5rem;--fontsize20: 1.25rem;--fontsize21: 1.313rem;--fontsize22: 1.375rem;--fontsize23: 1.438rem;--fontsize24: 1.5rem;--fontsize26: 1.625rem;--fontsize28: 1.75rem;--fontsize30: 1.625rem;--fontsize32: 2rem;--fontsize34: 2.125rem;--fontsize36: 2rem;--fontsize40: 2.25rem;--fontsize46: 2.875rem;--fontsize80: 5rem}}@media screen and (max-width: 1365px) and (min-width: 768px){:root{--fontsize12: .75rem;--fontsize14: .875rem;--fontsize16: 1rem;--fontsize17: .9rem;--fontsize17-5: 1rem;--fontsize18: .875rem;--fontsize20: 1rem;--fontsize21: 1.063rem;--fontsize22: 1.125rem;--fontsize23: 1.188rem;--fontsize24: 1rem;--fontsize28: 1.5rem;--fontsize30: 1.25rem;--fontsize32: 1.75rem;--fontsize34: 1.875rem;--fontsize36: 1.625rem;--fontsize40: 2.5rem;--fontsize46: 2.875rem;--fontsize80: 3.5rem}}@media screen and (max-width: 767px){:root{--fontsize12: .75rem;--fontsize14: .875rem;--fontsize16: 1rem;--fontsize16-5: .77rem;--fontsize17: .9rem;--fontsize17-5: 1rem;--fontsize18: .875rem;--fontsize19: .938rem;--fontsize20: 1rem;--fontsize21: 1.063rem;--fontsize22: 1.125rem;--fontsize23: 1.188rem;--fontsize24: 1rem;--fontsize26: 1.25rem;--fontsize28: 1.5rem;--fontsize30: 1.25rem;--fontsize32: 1.75rem;--fontsize34: 1.875rem;--fontsize36: 1.625rem;--fontsize40: 2.5rem;--fontsize46: 2rem;--fontsize80: 2.5rem}}@font-face{font-family:icomoon;font-weight:400;src:url(../assets/fonts/icomoon.ttf) format(\"ttf\"),url(../assets/fonts/icomoon.woff) format(\"woff\");font-weight:normal;font-style:normal;font-display:swap}@font-face{font-family:\"Arial Regular\";src:url(../assets/fonts/arial-webfont.woff) format(\"woff\"),url(../assets/fonts/arial-webfont.woff2) format(\"woff2\");font-weight:normal;font-style:normal}@font-face{font-family:\"Arial Bold\";src:url(../assets/fonts/Arial-BoldMT.eot);src:url(../assets/fonts/Arial-BoldMT.eot?#iefix) format(\"embedded-opentype\"),url(../assets/fonts/Arial-BoldMT.woff2) format(\"woff2\"),url(../assets/fonts/Arial-BoldMT.woff) format(\"woff\"),url(../assets/fonts/Arial-BoldMT.ttf) format(\"truetype\"),url(../assets/fonts/Arial-BoldMT.svg#Arial-BoldMT) format(\"svg\");font-weight:bold;font-style:normal;font-display:swap}@font-face{font-family:\"Arial Black\";src:url(../assets/fonts/arialblack-webfont.woff) format(\"woff\"),url(../assets/fonts/arialblack-webfont.woff2) format(\"woff2\");font-weight:normal;font-style:normal}@font-face{font-family:\"Helvetica Neue Reqular\";src:url(../assets/fonts/helveticaneue.woff) format(\"woff\"),url(../assets/fonts/helveticaneue.woff2) format(\"woff2\");font-weight:normal;font-style:normal}@font-face{font-family:\"Helvetica Neue Thin\";src:url(../assets/fonts/helveticaneuethin-webfont.woff) format(\"woff\"),url(../assets/fonts/helveticaneuethin-webfont.woff2) format(\"woff2\");font-weight:normal;font-style:normal}@font-face{font-family:\"Helvetica Neue Medium\";src:url(../assets/fonts/helveticaneuemedium-webfont.woff) format(\"woff\"),url(../assets/fonts/helveticaneuemedium-webfont.woff2) format(\"woff2\");font-weight:normal;font-style:normal}[class*=\" icon-\"],[class^=icon-]{font-family:icomoon!important;font-feature-settings:normal;font-variant:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-style:normal;font-weight:400;line-height:1;text-transform:none;font-display:swap}.icon-right:before{content:\"\\e902\"}.icon-materials:before{content:\"\\e900\"}.icon-natural-lighting:before{content:\"\\e90a\"}.icon-rainwater:before{content:\"\\e901\"}.icon-roofing:before{content:\"\\e90b\"}.icon-flashing{position:relative;display:inline-block;height:32px;text-align:center;width:32px}.icon-flashing:before,.mainnav-link-level-2.show .navTagChild .icon-flashing:before{content:url(../assets/images/icon-flashing-white.svg);height:20px;width:20px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);line-height:15px}li.megamenuSubChild:hover .icon-flashing:before{content:url(../assets/images/icon-flashing-black.svg)}.icon-ridge{position:relative;display:inline-block;height:32px;text-align:center;width:65px}.icon-ridge:before,.mainnav-link-level-2.show .navTagChild .icon-ridge:before{content:url(../assets/images/icon-ridge-white.svg);height:24px;width:65px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);line-height:15px}li.megamenuSubChild:hover .icon-ridge:before{content:url(../assets/images/icon-ridge-black.svg)}.icon-structural:before{content:\"\\e90c\"}.icon-accessories-old .path1:before{content:\"\\e903\"}.icon-accessories-old .path2:before{margin-left:-1em;content:\"\\e904\"}.icon-accessories-old .path3:before{margin-left:-1em;content:\"\\e905\"}.icon-cladding-old .path1:before{content:\"\\e90d\"}.icon-cladding-old .path2:before{margin-left:-1em;content:\"\\e90e\"}.icon-close:before{content:\"\\e90f\"}.icon-message:before{content:\"\\e910\"}.icon-search .path1:before{content:\"\\e906\"}.icon-search .path2:before{content:\"\\e907\"}.icon-search .path3:before{margin-left:-1.0156em;content:\"\\e908\"}.icon-summary:before{content:\"\\e911\"}.icon-branch:before{content:\"\\e912\"}.icon-delivery:before{content:\"\\e913\"}.icon-downloads:before{content:\"\\e909\"}.icon-drawings:before{content:\"\\e914\"}.icon-full:before{content:\"\\e915\"}.icon-manual:before{content:\"\\e916\"}.icon-payment:before{content:\"\\e917\"}.icon-empty .path1:before{content:\"\\e918\"}.icon-empty .path2:before{margin-left:-1em;content:\"\\e919\"}.icon-empty .path3:before{margin-left:-1em;content:\"\\e91a\"}.icon-product-overview:before{content:\"\\e91b\"}.icon-arrows:before{content:\"\\e91c\"}.icon-selected:before{content:\"\\e91d\"}.icon-accessories:before{content:\"\\e91b\"}.icon-cladding:before{content:\"\\e91e\"}.icon-Triangle:before{content:\"\\e91f\"}.icon-home:before{content:\"\\e920\"}.icon-faq:before{content:\"\\e921\"}.icon-temperature:before{content:\"\\e922\"}body header{font-family:\"Arial Regular\",sans-serif}header{background-color:#1d1d1b;position:sticky;top:0;background-size:100% 25%!important;background-repeat:no-repeat;z-index:10}header .header{max-width:100%;padding:0}header cx-banner cx-media img{margin-top:.7rem;margin-bottom:0}header label{display:inline-flex}header .SiteLinks{height:52px;display:flex;align-items:center;justify-content:space-between;padding-top:5px;padding-bottom:5px}header .SiteLinks cx-paragraph p{color:#fff;font-size:var(--fontsize16);line-height:var(--fontsize16);margin-bottom:0}header .SiteLinks cx-paragraph{font-size:var(--fontsize16)}header .SiteLinks app-account-dropdown,header .SiteLinks app-find-store{width:calc(25% - 25px);max-width:328px;margin-right:25px}header .SiteLinks app-contact-us{width:calc(20% - 25px);max-width:100px;margin-left:auto}header .SiteLinks app-custom-mini-cart{width:10%}header .SiteLinks .preferenceLink{margin-left:auto}header .SiteLinks .preferenceLink cx-generic-link{margin:0}header .SiteLinks .preferenceLink cx-generic-link cx-media img{height:22px;margin:0}header .SiteLinks .preferenceLink cx-generic-link cx-media img cx-media img{height:22px;margin:0}header .SiteLogo .storeLogo{position:absolute;z-index:99;left:40px;bottom:10px}header .SiteLogo .homeLogo{max-width:28px;height:28px;position:absolute;z-index:99;bottom:47px}header .NavigationBar{flex:70%;background-color:#b61828;min-height:40px;display:flex;align-items:center;position:relative}header .logoutMenu{margin-top:0!important}header .logoutMenu li{cursor:pointer;background-color:#4c4c4c;color:#fff}header .logoutMenu li:hover{text-decoration:underline;background-color:#4c4c4c;color:#fff}header .logoutMenu li:hover:hover{text-decoration:underline;background-color:#4c4c4c}header .MarketingContext{width:100%;margin:auto}.customer-service-icon{cursor:pointer}.helpSupport{width:20rem;border:0;margin-top:.5rem!important;transform:translate(-42%,36px)!important;padding:1rem 1rem 0;background-color:#393939;color:#fff;top:0}.helpSupport .arrow-up{position:absolute;top:-8px;right:44%;width:0;height:0;border-left:15px solid rgba(0,0,0,0);border-right:15px solid rgba(0,0,0,0);border-bottom:15px solid #393939}.helpSupport .contact-us-info .heading{font-family:\"Arial Bold\",sans-serif}.helpSupport .contact-us-info .detail{font-size:var(--fontsize14);line-height:2rem}.helpSupport .contact-us-info .detail .service-icon{height:20px;width:20px;margin-right:10px}.helpSupport .contact-us-info .contactLink a{font-size:var(--fontsize14);text-decoration:underline;text-transform:uppercase}.helpSupport .contact-us-info a{color:#fff;text-decoration:none}.helpSupport .contact-us-info a:hover{text-decoration:underline}.pageTitle{font-family:\"Helvetica Neue Regular\",sans-serif;font-size:var(--fontsize54);color:#1d1d1b;padding-top:2rem}[aria-label=Close]{cursor:pointer}cx-global-message{position:fixed;top:9rem;width:100%;z-index:13}@media screen and (max-width: 991px){cx-global-message{top:3.75rem}cx-storefront header{background-color:#b61828}cx-storefront header cx-banner cx-media img{margin:auto}cx-storefront header .SiteLogo{width:100%;max-width:211px;margin:auto;padding-left:30px;box-sizing:border-box}cx-storefront header .SiteLogo .storeLogo{position:unset}cx-storefront header .SearchBox{margin:14px 0 10px;width:30px}cx-storefront header .miniCartStyle cx-paragraph{display:block!important}cx-storefront header .SiteLinks{background-color:transparent;width:110px;margin:auto 25px auto 0}cx-storefront header .SiteLinks app-account-dropdown,cx-storefront header .SiteLinks app-find-store,cx-storefront header .SiteLinks app-contact-us,cx-storefront header .SiteLinks cx-paragraph,cx-storefront header .SiteLinks .preferenceLink{display:none}cx-storefront header .SiteLinks app-custom-mini-cart,cx-storefront header .SiteLinks app-custom-user-account{width:35px}cx-storefront header.is-expanded{overflow-y:auto;position:fixed;bottom:0;top:0;width:calc(100% - 99px)}cx-storefront header.is-expanded .header{background-color:#b61828;margin-left:0;position:relative}cx-storefront header.is-expanded .PreHeader{position:absolute;right:0;top:5px}cx-storefront header.is-expanded .SearchBox{display:none}cx-storefront header.is-expanded .SiteLogo{position:absolute;bottom:110px;z-index:9}cx-storefront header.is-expanded .SiteLinks{background-color:#1d1d1b;width:100%;margin:15px auto 15px 0;height:unset;padding:15px;max-width:100%;position:relative;z-index:9;top:60px}cx-storefront header.is-expanded .SiteLinks app-account-dropdown,cx-storefront header.is-expanded .SiteLinks app-find-store,cx-storefront header.is-expanded .SiteLinks app-contact-us,cx-storefront header.is-expanded .SiteLinks cx-paragraph,cx-storefront header.is-expanded .SiteLinks .preferenceLink{display:block}cx-storefront header.is-expanded .SiteLinks app-custom-mini-cart,cx-storefront header.is-expanded .SiteLinks app-custom-user-account{display:none}cx-storefront header.is-expanded .SiteLinks app-account-dropdown{width:100%;max-width:100%}cx-storefront header.is-expanded .SiteLinks app-find-store{width:50%;max-width:328px;min-width:324px}cx-storefront header.is-expanded .SiteLinks app-contact-us{margin-right:40px;margin-left:auto;width:115px;max-width:unset}cx-storefront header.is-expanded .navigation{position:relative;top:45px}cx-storefront header.is-expanded:before{background-color:#0000004d;right:0;content:\"\";position:fixed;z-index:2;top:0;bottom:0;height:100vh;width:99px}cx-storefront header.is-expanded:after{background-color:transparent}cx-storefront header.is-expanded .SiteLogo{bottom:160px;max-width:211px!important}cx-storefront header.is-expanded .SiteLogo .storeLogo{display:block}}@media screen and (max-width: 576px){cx-storefront header .SiteLogo{max-width:80px}cx-storefront header .SiteLogo .storeLogo{display:none}cx-storefront header .searchBox{height:45px}cx-storefront header.is-expanded{width:100%}cx-storefront header.is-expanded .header,cx-storefront header.is-expanded .navigation{width:100%}cx-storefront header.is-expanded .SiteLinks{max-width:100%;width:100%}cx-storefront header.is-expanded .SiteLinks app-account-dropdown,cx-storefront header.is-expanded .SiteLinks app-find-store,cx-storefront header.is-expanded .SiteLinks app-contact-us,cx-storefront header.is-expanded .SiteLinks cx-paragraph,cx-storefront header.is-expanded .SiteLinks .preferenceLink{display:block}cx-storefront header.is-expanded .SiteLinks app-custom-mini-cart,cx-storefront header.is-expanded .SiteLinks app-custom-user-account{display:none}cx-storefront header.is-expanded .SiteLinks app-find-store{width:100%;max-width:100%;margin-bottom:10px}cx-storefront header.is-expanded .SiteLinks app-contact-us{margin-left:0}cx-storefront header.is-expanded .SiteLinks cx-paragraph{margin-left:auto}cx-storefront header.is-expanded:before{display:none}.pageTitle{font-size:28px}}.accountDropdown{display:flex;align-items:center;width:100%;max-width:328px}.accountDropdown .dropdown-menu{background-color:#393939}.accountDropdown .dropdown-menu .menu{max-height:28rem;overflow:auto;padding:0 15px}.accountDropdown .dropdown-menu .menu .parent-dropdown-item{background-color:#393939;color:#c6c6c6;border-bottom:1px solid #525252}.accountDropdown .dropdown-menu .menu .parent-dropdown-item.selected{background-color:#474747}.accountDropdown .dropdown-menu .menu .parent-dropdown-item .accountdata{width:90%;display:inline-block}.accountDropdown .dropdown-menu .menu .parent-dropdown-item .accountIcon{width:10%;background-image:url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2211.3%22 height%3D%227.8%22 viewBox%3D%220 0 11.3 7.8%22%3E%0D %3Cpath id%3D%22Fill%22 d%3D%22M4.2%2C6.4.7%2C2.9%2C0%2C3.6%2C3.5%2C7.1l.7.7L11.3.7%2C10.6%2C0Z%22 fill%3D%22%23fff%22%2F%3E%0D%3C%2Fsvg%3E%0D\")}.accountDropdown .dropdown-menu .menu .parent-dropdown-item .labelOneChild{padding:7px 0}.accountDropdown .dropdown-menu .menu .parent-dropdown-item .labelOneChild:hover{background-color:#474747}.accountDropdown .dropdown-menu .menu .parent-dropdown-item .labelTwoChild{padding:7px 0 7px 15px}.accountDropdown .dropdown-menu .menu .parent-dropdown-item .labelTwoChild:hover{background-color:#474747}.accountDropdown .dropdown-menu .menu .parent-dropdown-item .labelThreeChild{padding:7px 0 7px 30px}.accountDropdown .dropdown-menu .menu .parent-dropdown-item .labelThreeChild:hover{background-color:#474747}.accountDropdown .dropdown-menu .menu .child-menu{padding:0}.accountDropdown .dropdown-menu .menu .child-menu .child-dropdown-item{border-top:1px solid #525252;padding:0}.accountDropdown .dropdown-menu .menu .subchild-menu .subdropdown-item{border-top:1px solid #525252}.selectIcon{position:absolute;right:0;top:50%;transform:translate(-50%,-50%);width:16px}.input-icon{background-color:#6f6f6f;padding:8px 10px}.w-20{width:20px}.dropdown-menu{width:calc(100% - 40px);top:-11px!important;padding:0}.accountName{display:block;width:calc(100% - 30px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.custom-input{height:40px;background-color:#393939;border:1px solid #6F6F6F;color:#fff;border-radius:0;padding:.375rem .75rem;font-size:var(--fontsize16);line-height:var(--fontsize22);width:calc(100% - 42px);text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.placeholder-icon{position:relative;right:30px;top:0;z-index:4}.form-control[type=text]:focus{background-color:#464645}::placeholder{color:#fff}.btn:focus{box-shadow:none}.menu .parent-dropdown-item{cursor:pointer}.custom-arrow{position:absolute;right:20px;top:10px}@media screen and (max-width: 991px){.accountDropdown{margin-bottom:20px}}@media screen and (max-width: 576px){.accountDropdown{max-width:100%}}.highlight{background-color:#474747}::ng-deep .toast{top:20%;left:50%;position:fixed;min-width:500px;max-width:500px;transform:translate(-50%);z-index:9999;background-color:#1d1d1b}::ng-deep .toast .toast-body{color:#fff}::ng-deep .toast .toast-body img{margin-right:10px}::ng-deep .toast .toast-body .toast-close{top:50%;right:5%;position:absolute;transform:translate(-50%,-50%);cursor:pointer}::ng-deep .toast .toast-header{background-color:#1d1d1b;color:#fff;padding:15px;border-radius:0}::ng-deep .toast .toast-header .close{color:#fff;opacity:1;text-shadow:none}\n"], components: [{ type: i3__namespace$1.NgbToast, selector: "ngb-toast", inputs: ["delay", "autohide", "animation", "header"], outputs: ["shown", "hidden"], exportAs: ["ngbToast"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "async": i5__namespace.AsyncPipe } });
1151
1233
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AccountDropdownComponent, decorators: [{
1152
1234
  type: i0.Component,
@@ -1155,7 +1237,7 @@
1155
1237
  templateUrl: './account-dropdown.component.html',
1156
1238
  styleUrls: ['./account-dropdown.component.scss']
1157
1239
  }]
1158
- }], ctorParameters: function () { return [{ type: AccountDropdownService }, { type: UserAccountDetailServiceService }, { type: FindStoreService }]; } });
1240
+ }], ctorParameters: function () { return [{ type: AccountDropdownService }, { type: UserAccountDetailServiceService }, { type: FindStoreService }, { type: CartService }]; } });
1159
1241
 
1160
1242
  var generalConstants = {
1161
1243
  //general constants goes here
@@ -1676,73 +1758,6 @@
1676
1758
  return CommonUtils;
1677
1759
  }());
1678
1760
 
1679
- var CartService = /** @class */ (function () {
1680
- function CartService(http) {
1681
- this.http = http;
1682
- this.expandAll = new rxjs.BehaviorSubject(false);
1683
- }
1684
- CartService.prototype.getCartList = function (cartId, sortBy) {
1685
- var url = GET_CART_LIST_ENDPOINT.url + cartId + '?fields=FULL';
1686
- if (sortBy != undefined)
1687
- url = url + sortBy;
1688
- return this.http
1689
- .get(url, {
1690
- headers: { 'Content-Type': 'application/json' },
1691
- })
1692
- .pipe(operators.catchError(function (errorRes) {
1693
- return rxjs.throwError(errorRes);
1694
- }));
1695
- };
1696
- CartService.prototype.getOrderDetails = function (orderId) {
1697
- var url = GET_ORDER_DETAIL.url + orderId + '?fields=DEFAULT&needBase64MediaURL=true&versionId=initial';
1698
- return this.http
1699
- .get(url, {
1700
- headers: { 'Content-Type': 'application/json' },
1701
- })
1702
- .pipe(operators.catchError(function (errorRes) {
1703
- return rxjs.throwError(errorRes);
1704
- }));
1705
- };
1706
- CartService.prototype.deleteCartEntry = function (cartId, entryNumber) {
1707
- var url = DELETE_CART_ENTRY_ENDPOINT.url + cartId + '/entries/' + entryNumber;
1708
- return this.http
1709
- .delete(url, {
1710
- headers: { 'Content-Type': 'application/json' },
1711
- })
1712
- .pipe(operators.catchError(function (errorRes) {
1713
- return rxjs.throwError(errorRes);
1714
- }));
1715
- };
1716
- CartService.prototype.clearCart = function (cartId) {
1717
- var url = DELETE_CART_ENTRY_ENDPOINT.url + cartId;
1718
- return this.http
1719
- .delete(url, {
1720
- headers: { 'Content-Type': 'application/json' },
1721
- })
1722
- .pipe(operators.catchError(function (errorRes) {
1723
- return rxjs.throwError(errorRes);
1724
- }));
1725
- };
1726
- CartService.prototype.updateCartEntry = function (cartId, entryNumber, payLoad) {
1727
- var url = UPDATE_CART_ENTRY_ENDPOINT.url + cartId + '/bpEntries/' + entryNumber;
1728
- return this.http.put(url, payLoad, {
1729
- headers: { 'Content-Type': 'application/json' },
1730
- })
1731
- .pipe(operators.catchError(function (errorRes) {
1732
- return rxjs.throwError(errorRes);
1733
- }));
1734
- };
1735
- return CartService;
1736
- }());
1737
- CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CartService, deps: [{ token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1738
- CartService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CartService, providedIn: 'root' });
1739
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CartService, decorators: [{
1740
- type: i0.Injectable,
1741
- args: [{
1742
- providedIn: 'root',
1743
- }]
1744
- }], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
1745
-
1746
1761
  var AccountDropdownStateService = /** @class */ (function () {
1747
1762
  function AccountDropdownStateService() {
1748
1763
  this.cartValue = new rxjs.BehaviorSubject({});
@@ -1936,16 +1951,11 @@
1936
1951
  }
1937
1952
  CustomMiniCartComponent.prototype.ngOnInit = function () {
1938
1953
  return __awaiter(this, void 0, void 0, function () {
1939
- var cartLoaded, _u;
1954
+ var _u;
1940
1955
  var _this = this;
1941
1956
  return __generator(this, function (_v) {
1942
1957
  switch (_v.label) {
1943
1958
  case 0:
1944
- cartLoaded = sessionStorage.getItem('isCartLoaded');
1945
- if (cartLoaded == null) {
1946
- sessionStorage.setItem('isCartLoaded', 'true');
1947
- window.location.reload();
1948
- }
1949
1959
  _u = this;
1950
1960
  return [4 /*yield*/, this.userProfileDetailsService.isCartPermission()];
1951
1961
  case 1:
@@ -1953,31 +1963,26 @@
1953
1963
  _v.sent();
1954
1964
  this.getCartId();
1955
1965
  this.showWaitCursor.next(true);
1956
- this.cmsService
1957
- .getComponentData("ContactUsComponent")
1958
- .subscribe(function (data) { });
1959
- this.cart$.subscribe(function (dataRes) {
1960
- var _a;
1961
- _this.totalCartItems = dataRes === null || dataRes === void 0 ? void 0 : dataRes.totalItems;
1962
- if (dataRes.totalPrice) {
1963
- _this.getCartLists();
1964
- _this.totalPriceFormat = (_a = dataRes === null || dataRes === void 0 ? void 0 : dataRes.totalPrice) === null || _a === void 0 ? void 0 : _a.formattedValue;
1966
+ this.router.events.subscribe(function (val) {
1967
+ if (window.location.pathname.includes("mylist")) {
1968
+ _this.searchPlaceHolder = "Search for a particular list";
1965
1969
  }
1966
1970
  else {
1967
- _this.totalPriceFormat = "";
1971
+ _this.searchPlaceHolder = "Search";
1968
1972
  }
1969
- _this.accountDropDownStateService.setCartValue(dataRes);
1970
- _this.router.events.subscribe(function (val) {
1971
- if (window.location.pathname.includes("mylist")) {
1972
- _this.searchPlaceHolder = "Search for a particular list";
1973
- }
1974
- else {
1975
- _this.searchPlaceHolder = "Search";
1976
- }
1977
- _this.ref.markForCheck();
1978
- });
1979
1973
  _this.ref.markForCheck();
1980
1974
  });
1975
+ this.cartService.isAccountLoaded.subscribe(function (isLoaded) {
1976
+ if (isLoaded) {
1977
+ setTimeout(function () {
1978
+ _this.loadFirstCartData();
1979
+ }, 1000);
1980
+ _this.getCartData();
1981
+ }
1982
+ });
1983
+ this.cmsService
1984
+ .getComponentData("ContactUsComponent")
1985
+ .subscribe(function (data) { });
1981
1986
  this.cmsService
1982
1987
  .getComponentData("EmptyCartParagraphComponent")
1983
1988
  .subscribe(function (data) {
@@ -2012,6 +2017,53 @@
2012
2017
  var cartObj = localStorage.getItem("spartacus⚿dimond-spa⚿cart");
2013
2018
  this.cartId = (_a = JSON.parse(cartObj)) === null || _a === void 0 ? void 0 : _a.active;
2014
2019
  };
2020
+ CustomMiniCartComponent.prototype.loadFirstCartData = function () {
2021
+ var _this = this;
2022
+ this.cartService.reloadCart().subscribe(function (data) {
2023
+ var _a;
2024
+ if (data && data.carts && data.carts.length > 0) {
2025
+ var dataRes = data.carts[0];
2026
+ _this.totalCartItems = dataRes === null || dataRes === void 0 ? void 0 : dataRes.totalItems;
2027
+ if (dataRes.totalPrice) {
2028
+ _this.totalPriceFormat = (_a = dataRes === null || dataRes === void 0 ? void 0 : dataRes.totalPrice) === null || _a === void 0 ? void 0 : _a.formattedValue;
2029
+ }
2030
+ else {
2031
+ _this.totalPriceFormat = "";
2032
+ }
2033
+ _this.items = [];
2034
+ dataRes.entries.forEach(function (n) {
2035
+ _this.items.push(n);
2036
+ });
2037
+ _this.cartDetails = dataRes.entries;
2038
+ _this.accountDropDownStateService.setCartValue(dataRes);
2039
+ _this.ref.markForCheck();
2040
+ }
2041
+ });
2042
+ };
2043
+ CustomMiniCartComponent.prototype.getCartData = function () {
2044
+ var _this = this;
2045
+ this.cart$.subscribe(function (dataRes) {
2046
+ var _a;
2047
+ _this.totalCartItems = dataRes === null || dataRes === void 0 ? void 0 : dataRes.totalItems;
2048
+ if (dataRes.totalPrice) {
2049
+ _this.getCartLists();
2050
+ _this.totalPriceFormat = (_a = dataRes === null || dataRes === void 0 ? void 0 : dataRes.totalPrice) === null || _a === void 0 ? void 0 : _a.formattedValue;
2051
+ }
2052
+ else {
2053
+ _this.totalPriceFormat = "";
2054
+ }
2055
+ _this.accountDropDownStateService.setCartValue(dataRes);
2056
+ _this.ref.markForCheck();
2057
+ });
2058
+ if (this.entries$) {
2059
+ this.entries$.subscribe(function (data) {
2060
+ _this.items = [];
2061
+ data.forEach(function (n) {
2062
+ _this.items.push(n);
2063
+ });
2064
+ });
2065
+ }
2066
+ };
2015
2067
  CustomMiniCartComponent.prototype.getCartLists = function () {
2016
2068
  var _this = this;
2017
2069
  this.showWaitCursor.next(true);