{ "version": 3, "sources": ["src/@omnial/_services/navigation/canonical.service.ts", "src/@omnial/_services/order/cart.service.ts"], "sourcesContent": ["import { Injectable, OnDestroy } from '@angular/core';\r\nimport { Observable, Subscription } from 'rxjs';\r\nimport { Product, ProductDetail } from 'src/@omnial/_models/catalog/product.model';\r\nimport { SiteMapItem } from 'src/@omnial/_models/navigation/site-map.model';\r\nimport { SiteMapService } from './sitemap.service';\r\n\r\n\r\n\r\n@Injectable()\r\nexport class CanonicalService implements OnDestroy {\r\n private subscriptions: Subscription[] = [];\r\n private sitemapItems: SiteMapItem[];\r\n\r\n constructor(public sitemapService: SiteMapService) { }\r\n\r\n ngOnDestroy(): void {\r\n if (this.subscriptions && this.subscriptions.length > 0) {\r\n this.subscriptions.forEach((sub) => { sub.unsubscribe(); });\r\n }\r\n }\r\n\r\n public productCanonical(product: Product): Observable {\r\n return new Observable((observer) => {\r\n this.subscriptions.push(this.sitemapService.siteMap.subscribe({\r\n next: (res) => {\r\n this.sitemapItems = res as SiteMapItem[];\r\n if (this.sitemapItems && this.sitemapItems.length > 0) {\r\n let canonical = '/';\r\n if (product.canonicalCategoryId) {\r\n const node = this.sitemapItems.find(i => i.categoryId === product.canonicalCategoryId);\r\n if (node) {\r\n canonical = node.routerLink;\r\n }\r\n }\r\n if (product.categoryIds && canonical !== '/') { // HACK - Set the canonical to the longest link in case we have no canonical category\r\n for (const catId of product.categoryIds) {\r\n const node = this.sitemapItems.find(i => i.categoryId === catId);\r\n if (node && node.routerLink.length > canonical.length) {\r\n canonical = node.routerLink;\r\n }\r\n }\r\n }\r\n observer.next(canonical);\r\n observer.complete();\r\n }\r\n },\r\n error: () => {\r\n observer.next('/'); // Should never happen);\r\n observer.complete();\r\n }\r\n }));\r\n });\r\n }\r\n\r\n public productDetailCanonical(product: ProductDetail): Observable {\r\n return new Observable((observer) => {\r\n this.subscriptions.push(this.sitemapService.siteMap.subscribe({\r\n next: (res) => {\r\n this.sitemapItems = res as SiteMapItem[];\r\n if (this.sitemapItems && this.sitemapItems.length > 0) {\r\n let canonical = '/';\r\n if (product.canonicalCategoryId) {\r\n const node = this.sitemapItems.find(i => i.categoryId === product.canonicalCategoryId);\r\n if (node) {\r\n canonical = node.routerLink;\r\n }\r\n }\r\n if (product.categoryIds && canonical !== '/') { // HACK - Set the canonical to the longest link in case we have no canonical category\r\n for (const catId of product.categoryIds) {\r\n const node = this.sitemapItems.find(i => i.categoryId === catId);\r\n if (node && node.routerLink.length > canonical.length) {\r\n canonical = node.routerLink;\r\n }\r\n }\r\n }\r\n observer.next(canonical);\r\n observer.complete();\r\n }\r\n },\r\n error: () => {\r\n observer.next('/'); // Should never happen);\r\n observer.complete();\r\n }\r\n }));\r\n });\r\n }\r\n}\r\n", "import { Injectable, OnDestroy } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\nimport { NgxSpinnerService } from 'ngx-spinner';\r\nimport { ToastrService } from 'ngx-toastr';\r\nimport { Subscription, Observable } from 'rxjs';\r\nimport { Product, ProductDetail } from 'src/@omnial/_models/catalog/product.model';\r\nimport { Customer } from 'src/@omnial/_models/customer/customer.model';\r\nimport { OrderItem } from 'src/@omnial/_models/order/order.model';\r\nimport { CustomerService } from '../customer/customer.service';\r\nimport { TrackingService } from '../external/tracking.service';\r\nimport { KlaviyoService } from '../external/klaviyo.service';\r\nimport { CanonicalService } from '../navigation/canonical.service';\r\nimport { SiteMapService } from '../navigation/sitemap.service';\r\nimport { RepositoryService } from '../repository.service';\r\n\r\n\r\n@Injectable()\r\nexport class CartService implements OnDestroy {\r\n private customer: Customer;\r\n public recentToken = '';\r\n private subscriptions: Subscription[] = [];\r\n\r\n constructor(\r\n public router: Router,\r\n public sitemapService: SiteMapService,\r\n public repoService: RepositoryService,\r\n public customerService: CustomerService,\r\n public canonicalService: CanonicalService,\r\n public toastr: ToastrService,\r\n private spinner: NgxSpinnerService,\r\n public trackingService: TrackingService,\r\n public klaviyoService: KlaviyoService) {\r\n this.customerService.customer.subscribe({ next: (res) => { this.customer = res as Customer; } });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n if (this.subscriptions && this.subscriptions.length > 0) {\r\n this.subscriptions.forEach((sub) => { sub.unsubscribe(); });\r\n }\r\n }\r\n\r\n public checkCart(customerGuid: string): Observable {\r\n return new Observable((observer) => {\r\n this.subscriptions.push(this.repoService.getData(`Cart/Check/${customerGuid}`).subscribe({\r\n next: (res: Customer) => {\r\n this.customer = res as Customer;\r\n this.trackingService.pushCartView(this.customer);\r\n if (this.customer.warnings && this.customer.warnings.length > 0) {\r\n for (const warning of this.customer.warnings) {\r\n const message = warning;\r\n this.toastr.warning(message, 'Shopping Cart');\r\n }\r\n observer.next(false);\r\n } else {\r\n observer.next(true);\r\n }\r\n observer.complete();\r\n },\r\n error: () => {\r\n this.toastr.warning('We tried to check the contents of your cart but there was a problem', 'Shopping Cart');\r\n observer.next(false);\r\n observer.complete();\r\n }\r\n }));\r\n });\r\n }\r\n\r\n\r\n public addCoupon(customerGuid: string, couponCode: string, token: string): Observable {\r\n return new Observable((observer) => {\r\n this.spinner.show();\r\n this.subscriptions.push(this.repoService.update(`Cart/AddCoupon/${customerGuid}`, { couponCode, token }).subscribe({\r\n next: (res) => {\r\n this.spinner.hide();\r\n this.customerService.update(res as Customer);\r\n observer.next(res as Customer);\r\n observer.complete();\r\n },\r\n error: () => {\r\n this.spinner.hide();\r\n const errMessage = 'Sorry something went wrong with this coupon.';\r\n this.toastr.warning(errMessage, 'Coupon');\r\n observer.next(null);\r\n observer.complete();\r\n }\r\n }));\r\n });\r\n }\r\n\r\n public removeCoupons(customerGuid: string): Observable {\r\n return new Observable((observer) => {\r\n this.spinner.show();\r\n this.subscriptions.push(this.repoService.update(`Cart/RemoveCoupons/${customerGuid}`, JSON.stringify('nothing')).subscribe({\r\n next: (res) => {\r\n this.spinner.hide();\r\n this.customerService.update(res as Customer);\r\n observer.next(res as Customer);\r\n observer.complete();\r\n },\r\n error: () => {\r\n this.spinner.hide();\r\n const errMessage = 'Sorry something went wrong removing coupons.';\r\n this.toastr.warning(errMessage, 'Coupon');\r\n observer.next(null);\r\n observer.complete();\r\n }\r\n }));\r\n });\r\n }\r\n\r\n public reOrder(customerGuid: string, orderNumber: string): Observable {\r\n return new Observable((observer) => {\r\n this.spinner.show();\r\n this.subscriptions.push(this.repoService.create(`Cart/ReOrder/${customerGuid}`, JSON.stringify(orderNumber)).subscribe({\r\n next: (res) => {\r\n this.spinner.hide();\r\n const result = res as Customer;\r\n this.customerService.update(result);\r\n if (result.warnings && result.warnings.length > 0) {\r\n for (const warning of this.customer.warnings) {\r\n const message = warning;\r\n this.toastr.warning(message, 'Re-Order');\r\n }\r\n observer.next(false);\r\n } else {\r\n observer.next(true);\r\n }\r\n observer.complete();\r\n },\r\n error: () => {\r\n this.spinner.hide();\r\n const errMessage = 'Sorry we could reorder these items. Please try again later.';\r\n this.toastr.warning(errMessage, 'Re-Order');\r\n this.spinner.hide();\r\n observer.next(false);\r\n observer.complete();\r\n }\r\n }));\r\n });\r\n }\r\n\r\n public reOrderItem(customerGuid: string, orderItem: OrderItem): Observable {\r\n return new Observable((observer) => {\r\n this.spinner.show();\r\n this.subscriptions.push(this.repoService.create(`Cart/ReOrderItem/${customerGuid}`, orderItem).subscribe({\r\n next: (res) => {\r\n this.spinner.hide();\r\n const result = res as Customer;\r\n this.customerService.update(result);\r\n if (result.warnings && result.warnings.length > 0) {\r\n for (const warning of this.customer.warnings) {\r\n const message = warning;\r\n this.toastr.warning(message, 'Re-Order');\r\n }\r\n observer.next(false);\r\n } else {\r\n this.trackingService.pushCartAdd(orderItem.product, orderItem.quantity);\r\n this.klaviyoService.addCart(orderItem.product, orderItem.quantity, this.customer);\r\n const message = 'The product ' + orderItem.product.name + ' has been added. Tap this message to go to your cart.';\r\n const toastrCart = this.toastr.success(message, 'Shopping Cart', { positionClass: 'toast-top-center' });\r\n toastrCart.onTap.subscribe(() => this.router.navigate(['/cart']));\r\n observer.next(true);\r\n }\r\n observer.complete();\r\n },\r\n error: () => {\r\n this.spinner.hide();\r\n const errMessage = 'Sorry we could reorder this item. Please try again later.';\r\n this.toastr.warning(errMessage, 'Re-Order');\r\n this.spinner.hide();\r\n observer.next(false);\r\n observer.complete();\r\n }\r\n }));\r\n });\r\n }\r\n\r\n public addToWishlist(product: Product): boolean {\r\n if (this.customer?.customerGuid && !this.customerService.checkCustomerCookie()) {\r\n this.customerService.saveCustomerCookie(this.customer);\r\n }\r\n if (!this.customer || !this.customer?.customerGuid) {\r\n this.subscriptions.push(this.customerService.newCustomer().subscribe({\r\n next: (res) => {\r\n if (res !== null) {\r\n this.customer = res as Customer;\r\n return this.addProductToWishList(product);\r\n }\r\n }\r\n }));\r\n } else {\r\n return this.addProductToWishList(product);\r\n }\r\n }\r\n\r\n public addToWishListDetail(product: ProductDetail): boolean {\r\n if (this.customer?.customerGuid && !this.customerService.checkCustomerCookie()) {\r\n this.customerService.saveCustomerCookie(this.customer);\r\n }\r\n const cartProduct = new Product();\r\n cartProduct.id = product.id;\r\n cartProduct.name = product.name;\r\n cartProduct.listName = product.listName;\r\n cartProduct.listId = product.listId;\r\n if (!this.customer || !this.customer?.customerGuid) {\r\n this.subscriptions.push(this.customerService.newCustomer().subscribe({\r\n next: (res) => {\r\n if (res !== null) {\r\n this.customer = res as Customer;\r\n return this.addProductToWishList(cartProduct);\r\n }\r\n }\r\n }));\r\n } else {\r\n return this.addProductToWishList(cartProduct);\r\n }\r\n }\r\n\r\n public addToWishListWithAttributes(product: ProductDetail): boolean {\r\n if (this.customer && !this.customerService.checkCustomerCookie()) {\r\n this.customerService.saveCustomerCookie(this.customer);\r\n }\r\n if (!this.customer || !this.customer?.customerGuid) {\r\n this.subscriptions.push(this.customerService.newCustomer().subscribe({\r\n next: (res) => {\r\n if (res !== null) {\r\n this.customer = res as Customer;\r\n return this.addProductWithAttributesToWishList(product);\r\n }\r\n }\r\n }));\r\n } else {\r\n return this.addProductWithAttributesToWishList(product);\r\n }\r\n }\r\n\r\n public removeFromWishlist(product: Product): void {\r\n if (this.customer && !this.customerService.checkCustomerCookie()) {\r\n this.customerService.saveCustomerCookie(this.customer);\r\n }\r\n const cartProduct = new Product();\r\n cartProduct.id = product.id;\r\n this.spinner.show();\r\n this.subscriptions.push(this.repoService.update(`WishList/Remove/${this.customer.customerGuid}`, cartProduct).subscribe({\r\n next: (res) => {\r\n this.customer = res as Customer;\r\n this.customerService.update(this.customer);\r\n if (this.customer.warnings && this.customer.warnings.length > 0) {\r\n for (const warning of this.customer.warnings) {\r\n const message = `Sorry cannot remove ${product.name} from your wishlist right now - ${warning}`;\r\n this.toastr.warning(message, 'Wishlist');\r\n }\r\n } else {\r\n const message = 'The product ' + product.name + ' has been removed from the wishlist.';\r\n this.toastr.success(message, 'Wishlist');\r\n }\r\n this.spinner.hide();\r\n },\r\n error: () => {\r\n const errMessage = 'Sorry we could remove this from your wishlist, please try again later';\r\n this.toastr.warning(errMessage, 'Wishlist');\r\n this.spinner.hide();\r\n }\r\n }));\r\n }\r\n\r\n public addToCart(product: Product, quantity: number): boolean {\r\n this.spinner.show();\r\n if (this.customer?.customerGuid && !this.customerService.checkCustomerCookie()) {\r\n this.customerService.saveCustomerCookie(this.customer);\r\n }\r\n if (!this.customer || !this.customer?.customerGuid) {\r\n this.subscriptions.push(this.customerService.newCustomer().subscribe({\r\n next: (res) => {\r\n if (res !== null) {\r\n this.customer = res as Customer;\r\n return this.addProductToCart(product, null, quantity);\r\n }\r\n }\r\n }));\r\n } else {\r\n return this.addProductToCart(product, null, quantity);\r\n }\r\n }\r\n\r\n public addToCartDetail(product: ProductDetail, quantity: number): boolean {\r\n if (this.customer?.customerGuid && !this.customerService.checkCustomerCookie()) {\r\n this.customerService.saveCustomerCookie(this.customer);\r\n }\r\n const cartProduct = new Product();\r\n cartProduct.id = product.id;\r\n cartProduct.name = product.name;\r\n cartProduct.cartQuantity = product.cartQuantity;\r\n cartProduct.listName = product.listName;\r\n cartProduct.listId = product.listId;\r\n if (!this.customer || !this.customer?.customerGuid) {\r\n this.subscriptions.push(this.customerService.newCustomer().subscribe({\r\n next: (res) => {\r\n if (res !== null) {\r\n this.customer = res as Customer;\r\n return this.addProductToCart(cartProduct, product, quantity);\r\n }\r\n }\r\n }));\r\n } else {\r\n return this.addProductToCart(cartProduct, product, quantity);\r\n }\r\n }\r\n\r\n public addToCartWithAttributes(product: ProductDetail, quantity: number, category: string): boolean {\r\n if (this.customer?.customerGuid && !this.customerService.checkCustomerCookie()) {\r\n this.customerService.saveCustomerCookie(this.customer);\r\n }\r\n if (!this.customer || !this.customer?.customerGuid) {\r\n this.subscriptions.push(this.customerService.newCustomer().subscribe({\r\n next: (res) => {\r\n if (res !== null) {\r\n this.customer = res as Customer;\r\n return this.addProductWithAttributesToCart(product, quantity, category);\r\n }\r\n }\r\n }));\r\n } else {\r\n return this.addProductWithAttributesToCart(product, quantity, category);\r\n }\r\n }\r\n\r\n public increment(product: Product): boolean {\r\n if (this.customer?.customerGuid && !this.customerService.checkCustomerCookie()) {\r\n this.customerService.saveCustomerCookie(this.customer);\r\n }\r\n if (!this.customer || !this.customer?.customerGuid) {\r\n this.subscriptions.push(this.customerService.newCustomer().subscribe({\r\n next: (res) => {\r\n if (res !== null) {\r\n this.customer = res as Customer;\r\n return this.incrementLine(product);\r\n }\r\n }\r\n }));\r\n } else {\r\n return this.incrementLine(product);\r\n }\r\n }\r\n\r\n public removeFromCart(product: Product): void {\r\n if (this.customer?.customerGuid && !this.customerService.checkCustomerCookie()) {\r\n this.customerService.saveCustomerCookie(this.customer);\r\n }\r\n const cartProduct = new Product();\r\n cartProduct.id = product.id;\r\n const quantity = product.cartCount;\r\n this.spinner.show();\r\n this.subscriptions.push(this.repoService.update(`Cart/Remove/${this.customer?.customerGuid}`, cartProduct).subscribe({\r\n next: (res) => {\r\n this.spinner.hide();\r\n this.customer = res as Customer;\r\n this.customerService.update(this.customer);\r\n if (this.customer.warnings && this.customer.warnings.length > 0) {\r\n for (const warning of this.customer.warnings) {\r\n const message = `Sorry cannot remove ${product.name} from your cart right now - ${warning}`;\r\n this.toastr.warning(message, 'Shopping Cart');\r\n }\r\n } else {\r\n const message = 'The product ' + product.name + ' has been removed from the cart.';\r\n this.toastr.success(message, 'Shopping Cart');\r\n this.trackingService.pushCartRemove(product, quantity);\r\n }\r\n },\r\n error: () => {\r\n this.spinner.hide();\r\n const errMessage = 'Sorry we could remove this from your cart, please try again later';\r\n this.toastr.error(errMessage, 'Shopping Cart');\r\n }\r\n }));\r\n }\r\n\r\n public removeOneFromCart(product: Product): void {\r\n if (this.customer?.customerGuid && !this.customerService.checkCustomerCookie()) {\r\n this.customerService.saveCustomerCookie(this.customer);\r\n }\r\n const cartProduct = new Product();\r\n cartProduct.id = product.id;\r\n cartProduct.attributeInfo = product.attributeInfo;\r\n cartProduct.attributeXml = product.attributeXml;\r\n this.spinner.show();\r\n this.subscriptions.push(this.repoService.update(`Cart/RemoveOne/${this.customer.customerGuid}`, cartProduct).subscribe({\r\n next: (res) => {\r\n this.customer = res as Customer;\r\n this.customerService.update(this.customer);\r\n this.spinner.hide();\r\n if (this.customer.warnings && this.customer.warnings.length > 0) {\r\n for (const warning of this.customer.warnings) {\r\n const message = `Sorry cannot remove ${product.name} from your cart right now - ${warning}`;\r\n this.toastr.warning(message, 'Shopping Cart');\r\n }\r\n } else {\r\n const message = 'The product ' + product.name + ' has been removed from the cart.';\r\n this.toastr.success(message, 'Shopping Cart');\r\n this.trackingService.pushCartRemove(product, 1);\r\n }\r\n },\r\n error: () => {\r\n this.spinner.hide();\r\n const errMessage = 'Sorry we could remove this from your cart, please try again later';\r\n this.toastr.error(errMessage, 'Shopping Cart');\r\n }\r\n }));\r\n }\r\n\r\n private addProductToWishList(product: Product): boolean {\r\n const cartProduct = new Product();\r\n cartProduct.id = product.id;\r\n cartProduct.cartQuantity = 1;\r\n if (product.hasAttributes) {\r\n const message = `You cannot add the ${product.name} to you wishlist as you need to select your options. Opened the quick view or go to the product page.`;\r\n this.toastr.warning(message, 'Shopping Cart');\r\n return false;\r\n }\r\n this.spinner.show();\r\n this.subscriptions.push(this.repoService.update(`WishList/${this.customer.customerGuid}`, cartProduct).subscribe({\r\n next: (res) => {\r\n this.customer = res as Customer;\r\n this.customerService.update(this.customer);\r\n if (this.customer.warnings && this.customer.warnings.length > 0) {\r\n for (const warning of this.customer.warnings) {\r\n const message = `Sorry cannot add ${product.name} to you wishlist right now - ${warning}`;\r\n this.toastr.warning(message, 'Wishlist');\r\n }\r\n } else {\r\n const message = 'The product ' + product.name + ' has been added to your wishlist.';\r\n this.toastr.success(message, 'Wishlist');\r\n this.trackingService.pushWishListAdd(product);\r\n }\r\n this.spinner.hide();\r\n },\r\n error: () => {\r\n const errMessage = 'Sorry we could add this to your wishlist, please try again later';\r\n this.toastr.error(errMessage, 'Wishlist');\r\n this.spinner.hide();\r\n }\r\n }));\r\n return true;\r\n }\r\n\r\n // NOTE - Detailed Product (detail or quickview) for a product with attributes such as a bundle\r\n private addProductWithAttributesToWishList(product: ProductDetail): boolean {\r\n product.cartQuantity = 1;\r\n this.spinner.show();\r\n this.subscriptions.push(this.repoService.update(`WishList/Attributes/${this.customer.customerGuid}`, product).subscribe({\r\n next: (res) => {\r\n this.customer = res as Customer;\r\n this.customerService.update(this.customer);\r\n if (this.customer.warnings && this.customer.warnings.length > 0) {\r\n for (const warning of this.customer.warnings) {\r\n const message = `Sorry cannot add ${product.name} to you wishlist right now - ${warning}`;\r\n this.toastr.warning(message, 'Wishlist');\r\n }\r\n } else {\r\n const message = 'The product ' + product.name + ' has been added to the wishlist.';\r\n this.toastr.success(message, 'Wishlist');\r\n }\r\n this.spinner.hide();\r\n },\r\n error: () => {\r\n const errMessage = 'Sorry we could add this to your wishlist, please try again later';\r\n this.toastr.error(errMessage, 'Wishlist');\r\n this.spinner.hide();\r\n }\r\n }));\r\n return true;\r\n }\r\n\r\n // NOTE - This is the list screen version as it is not a Detailed Product\r\n private addProductToCart(product: Product, productDetail: ProductDetail, quantity: number): boolean {\r\n this.spinner.hide();\r\n const cartProduct = new Product();\r\n cartProduct.id = product.id;\r\n cartProduct.cartQuantity = quantity;\r\n cartProduct.listId = product.listId;\r\n cartProduct.listName = product.listName;\r\n if (product.hasAttributes) {\r\n const message = `Please review and choose your options options.`;\r\n this.toastr.info(message, 'Shopping Cart', { positionClass: 'toast-top-center' });\r\n if (product.canonical) {\r\n this.router.navigate([product.canonical, product.seName]);\r\n } else {\r\n this.subscriptions.push(this.canonicalService.productCanonical(product).subscribe({\r\n next: (res) => {\r\n const canonical = res as string;\r\n this.router.navigate([canonical, product.seName]);\r\n }\r\n }));\r\n }\r\n return false;\r\n }\r\n const message = 'The product ' + product.name + ' is being added. Tap this message to go to your cart.';\r\n this.customerService.addProductToCart(product, quantity);\r\n const toastrCart = this.toastr.success(message, 'Shopping Cart', { positionClass: 'toast-top-center' });\r\n toastrCart.onTap.subscribe(() => this.router.navigate(['/cart']));\r\n\r\n this.subscriptions.push(this.repoService.update(`Cart/${this.customer.customerGuid}`, cartProduct).subscribe({\r\n next: (res) => {\r\n this.customer = res as Customer;\r\n this.customerService.update(this.customer);\r\n if (this.customer.warnings && this.customer.warnings.length > 0) {\r\n for (const warning of this.customer.warnings) {\r\n const message = `Sorry cannot add ${quantity} x ${product.name} to you cart right now - ${warning}`;\r\n this.toastr.warning(message, 'Shopping Cart');\r\n }\r\n } else {\r\n if (productDetail) {\r\n this.trackingService.pushCartAddDetail(productDetail, quantity);\r\n this.klaviyoService.addCartDetail(productDetail, quantity, this.customer);\r\n } else {\r\n this.trackingService.pushCartAdd(product, quantity);\r\n this.klaviyoService.addCart(product, quantity, this.customer);\r\n }\r\n }\r\n },\r\n error: () => {\r\n const errMessage = 'Sorry we could add this to your cart, please try again later';\r\n this.toastr.error(errMessage, 'Shopping Cart');\r\n }\r\n }));\r\n return true;\r\n }\r\n\r\n // NOTE - Detailed Product (detail or quickview) for a product with attributes such as a bundle\r\n private addProductWithAttributesToCart(product: ProductDetail, quantity: number, category: string): boolean {\r\n product.cartQuantity = quantity;\r\n const message = 'The product ' + product.name + ' is being added. Tap this message to go to your cart.';\r\n const toastrCart = this.toastr.success(message, 'Shopping Cart', { positionClass: 'toast-top-center' });\r\n toastrCart.onTap.subscribe(() => this.router.navigate(['/cart']));\r\n this.customerService.addProductToCart(product, quantity);\r\n this.subscriptions.push(this.repoService.update(`Cart/Attributes/${this.customer.customerGuid}`, product).subscribe({\r\n next: (res) => {\r\n this.customer = res as Customer;\r\n this.customerService.update(this.customer);\r\n if (this.customer.warnings && this.customer.warnings.length > 0) {\r\n for (const warning of this.customer.warnings) {\r\n const message = `Sorry cannot add ${quantity} x ${product.name} to you cart right now - ${warning}`;\r\n this.toastr.warning(message, 'Shopping Cart');\r\n }\r\n } else {\r\n this.trackingService.pushCartAddDetail(product, quantity);\r\n this.klaviyoService.addCartDetail(product, quantity, this.customer);\r\n }\r\n },\r\n error: () => {\r\n const errMessage = 'Sorry we could add this to your cart, please try again later';\r\n this.toastr.error(errMessage, 'Shopping Cart');\r\n }\r\n }));\r\n return true;\r\n }\r\n\r\n private incrementLine(product: Product): boolean {\r\n this.spinner.show();\r\n this.subscriptions.push(this.repoService.update(`Cart/Increment/${this.customer.customerGuid}`, product).subscribe({\r\n next: (res) => {\r\n this.customer = res as Customer;\r\n this.customerService.update(this.customer);\r\n if (this.customer.warnings && this.customer.warnings.length > 0) {\r\n for (const warning of this.customer.warnings) {\r\n const message = `Sorry cannot update ${product.name} in your cart right now - ${warning}`;\r\n this.toastr.warning(message, 'Shopping Cart', { positionClass: 'toast-top-center' });\r\n }\r\n } else {\r\n const message = 'The product ' + product.name + ' has been updated.';\r\n const toastrCart = this.toastr.success(message, 'Shopping Cart');\r\n toastrCart.onTap.subscribe(action => this.router.navigate(['/cart']));\r\n this.trackingService.pushCartAdd(product, 1);\r\n this.klaviyoService.addCart(product, 1, this.customer);\r\n }\r\n this.spinner.hide();\r\n },\r\n error: () => {\r\n const errMessage = 'Sorry we could add this to your cart, please try again later';\r\n this.toastr.error(errMessage, 'Shopping Cart', { positionClass: 'toast-top-center' });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EACAN,MAAOA,IAAK,CAEV,KAAK1B,OAAO0B,MADO,+DACW,gBAAiB,CAAEsB,cAAe,kBAAkB,CAAE,EACpF,KAAK/C,QAAQ+B,KAAI,CACnB,EACD,CAAC,EACK,EACT,iDAvjBWvC,GAAWkG,EAAAC,CAAA,EAAAD,EAAAE,CAAA,EAAAF,EAAAG,CAAA,EAAAH,EAAAI,CAAA,EAAAJ,EAAAK,CAAA,EAAAL,EAAAM,CAAA,EAAAN,EAAAO,CAAA,EAAAP,EAAAQ,CAAA,EAAAR,EAAAS,CAAA,CAAA,CAAA,CAAA,iCAAX3G,EAAW4G,QAAX5G,EAAW6G,SAAA,CAAA,CAAA,SAAX7G,CAAW,GAAA", "names": ["CanonicalService", "constructor", "sitemapService", "subscriptions", "ngOnDestroy", "length", "forEach", "sub", "unsubscribe", "productCanonical", "product", "Observable", "observer", "push", "siteMap", "subscribe", "next", "res", "sitemapItems", "canonical", "canonicalCategoryId", "node", "find", "i", "categoryId", "routerLink", "categoryIds", "catId", "complete", "error", "productDetailCanonical", "\u0275\u0275inject", "SiteMapService", "factory", "\u0275fac", "CartService", "constructor", "router", "sitemapService", "repoService", "customerService", "canonicalService", "toastr", "spinner", "trackingService", "klaviyoService", "recentToken", "subscriptions", "customer", "subscribe", "next", "res", "ngOnDestroy", "length", "forEach", "sub", "unsubscribe", "checkCart", "customerGuid", "Observable", "observer", "push", "getData", "pushCartView", "warnings", "warning", "message", "complete", "error", "addCoupon", "couponCode", "token", "show", "update", "hide", "removeCoupons", "JSON", "stringify", "reOrder", "orderNumber", "create", "result", "reOrderItem", "orderItem", "pushCartAdd", "product", "quantity", "addCart", "name", "success", "positionClass", "onTap", "navigate", "addToWishlist", "checkCustomerCookie", "saveCustomerCookie", "newCustomer", "addProductToWishList", "addToWishListDetail", "cartProduct", "Product", "id", "listName", "listId", "addToWishListWithAttributes", "addProductWithAttributesToWishList", "removeFromWishlist", "addToCart", "addProductToCart", "addToCartDetail", "cartQuantity", "addToCartWithAttributes", "category", "addProductWithAttributesToCart", "increment", "incrementLine", "removeFromCart", "cartCount", "pushCartRemove", "removeOneFromCart", "attributeInfo", "attributeXml", "hasAttributes", "pushWishListAdd", "productDetail", "info", "canonical", "seName", "productCanonical", "pushCartAddDetail", "addCartDetail", "toastrCart", "action", "\u0275\u0275inject", "Router", "SiteMapService", "RepositoryService", "CustomerService", "CanonicalService", "ToastrService", "NgxSpinnerService", "TrackingService", "KlaviyoService", "factory", "\u0275fac"] }