{"version":3,"sources":["webpack:///./cartridges/app_harmony/cartridge/client/default/js/widgets/wishlist/HarmonyWishListItem.js","webpack:///./cartridges/app_harmony/cartridge/client/default/js/widgets/wishlist/HarmonyWishlistMgr.js","webpack:///./cartridges/app_storefront_widgets/cartridge/client/default/js/widgets/product/AddToCartMixin.js","webpack:///./cartridges/app_storefront_widgets/cartridge/client/default/js/widgets/wishlist/WishListItem.js","webpack:///./cartridges/app_storefront_widgets/cartridge/client/default/js/widgets/wishlist/WishlistMgr.js"],"names":["reRenderWishlistComponentGlobalEvent","Widget","HarmonyWishListItem","init","eventBus","on","availabilityUpdate","params","renderAvailability","renderAddToCart","pid","config","message","availabilityClass","alert","availability","isPreorder","isBackorder","messages","join","class","alerts","alertsCommon","getById","availabilityLabel","emit","templateRefId","data","element","ref","availabilityAlert","QuickAddToCart","getConstructor","ProcessButton","eachChild","child","button","available","WishlistMgr","HarmonyWishlistMgr","reRenderWishlist","wishlistModel","then","totalCount","confirmedRemoveProductFromWishlist","productToRemove","get","querySelector","focus","reRenderTemplate","render","ProductDetail","AddToCartMixin","prefs","textNetworkError","addToCartBtn","classesBusy","showMinicartOnProductAdd","showMessageOnProductAdd","showAlertOnProductAdd","zeroWidthSpaceSymbol","readyToOrder","has","stock","selectedQuantity","spacesLength","showCartMessage","msg","error","addToCartMsg","concat","Array","show","postAddProduct","response","cart","cartModel","showMinicart","accessibilityAlert","accessibilityAlerts","addedtocart","addToCart","addToCartBtnPrefs","textSelectOptions","textStockLimit","startProcess","showProgressBar","submitFormJson","addToCartUrl","currentProductID","quantity","finally","stopProcess","hideProgressBar","catch","addClass","removeClass","updateProductView","product","isOutOfStock","setText","outOfStockLabel","disable","isReachedLimit","update","enable","WishListItem","editProduct","editBtn","uuid","qty","editModeQV","getContentByUrl","updateGTMInfo","success","newLineItem","currentGtmInfo","gtmInfo","onProductLinkClick","link","productAddedToCartWishError","addToCartErrorMessage","ALERT_EVENT","wishlistId","publicView","urlToSetPublic","urlLoadMore","shareConfirmationDialogTitle","shareConfirmationDialogMessage","shareConfirmationDialogConfirm","shareConfirmationDialogCancel","deleteConfirmationDialogTitle","deleteConfirmationDialogMessage","deleteConfirmationDialogConfirm","deleteConfirmationDialogCancel","tauAttrShareConfirmationPopUp","tauAttrRemoveProductConfirmationPopUp","wishlistGrid","items","renderWishlistHeader","calculateLoadMorePercentage","Promise","all","renderWishlist","renderWishlistCount","renderWishlistProgressIndicator","toggle","loadMorePercentage","Math","round","viewedItemsCount","shareLink","linkToShare","confirmationHandler","confirmedShareLink","confirmDialog","showModal","title","confirm","cancel","isShareConfirmDialog","attributes","removeProductFromWishlist","productName","replace","shareMethod","linkToCopy","copyToClipboard","call","url","wishlistID","windowReference","window","open","id","linkCopied","location","loadMore","href","pageNumber","String","parseInt","getJSONByUrl","wishlist","productListUpdated","count","countPlural","showEditProductModal","item","body","editProductModal","closeModalAfterEditProduct","removedUUIDs","closeModal","filter","includes","UUID","unshift","scrollWindowTo","wishlistUpdated","productUuid","itemIndexToRemove","findIndex","splice","loadMoreCount","showMore","length","res","undefined","productRemoved","str","el","document","createElement","value","appendChild","select","execCommand","removeChild"],"mappings":";;;;;;;;;;AAAA;AAAA,MAAMA,oCAAoC,GAAG,2BAA7C;AAEA;;;;;AAKA;;;;;AAKe,yEAAUC,MAAV,EAAkB;AAC7B;;;;;;;;;;;AAWA,QAAMC,mBAAN,SAAkCD,MAAlC,CAAyC;AACrC;;;;AAIAE,QAAI,GAAG;AACH,YAAMA,IAAN;AACA,WAAKC,QAAL,GAAgBC,EAAhB,CAAmB,qBAAnB,EAA0C,oBAA1C;AACH;AAED;;;;;;AAIAC,sBAAkB,CAACC,MAAD,EAAS;AACvB,WAAKC,kBAAL,CAAwBD,MAAxB;AACA,WAAKE,eAAL,CAAqBF,MAArB;AACH;AAED;;;;;;;AAKAC,sBAAkB,CAACD,MAAD,EAAS;AACvB,UAAI,CAACA,MAAM,CAACG,GAAR,IAAe,KAAKC,MAAL,CAAYD,GAAZ,KAAoBH,MA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;AACJ;AAED;;;;;;;AAMAyF,mBAAe,CAAC2C,GAAD,EAAM;AACjB,YAAMC,EAAE,GAAGC,QAAQ,CAACC,aAAT,CAAuB,UAAvB,CAAX;AACAF,QAAE,CAACG,KAAH,GAAWJ,GAAG,IAAI,EAAlB;AACAE,cAAQ,CAACvB,IAAT,CAAc0B,WAAd,CAA0BJ,EAA1B;AACAA,QAAE,CAACK,MAAH;AACAJ,cAAQ,CAACK,WAAT,CAAqB,MAArB;AACAL,cAAQ,CAACvB,IAAT,CAAc6B,WAAd,CAA0BP,EAA1B;AACH;;AA5Y4B;;AA+YjC,SAAO7K,WAAP;AACH,C","file":"wishlist.widgets.bundle.js","sourcesContent":["const reRenderWishlistComponentGlobalEvent = 'wishlist.reRenderTemplate';\n\n/**\n * @typedef {ReturnType} QuickAddToCart\n * @typedef {ReturnType} ProcessButton\n */\n\n/**\n * @param {Widget} Widget Base widget for extending\n * @returns {typeof WishListItem} Wishlist item class\n */\n\nexport default function (Widget) {\n /**\n * @category widgets\n * @subcategory wishlist\n * @class WishListItem\n * @augments Widget\n * @classdesc Wish list item component with next features:\n * 1. Handles click on product and click on edit button\n * 2. Handles add to cart error\n * 3. Stores actual analytics data\n * @property {string} [addToCartMsg=addToCartMsg] - Reference id for `add to cart message` element\n */\n class HarmonyWishListItem extends Widget {\n /**\n * @description Add global event handlers\n * @returns {void}\n */\n init() {\n super.init();\n this.eventBus().on('availability.update', 'availabilityUpdate');\n }\n\n /**\n * @description update components after availability check on change qty\n * @param {object} params - params\n */\n availabilityUpdate(params) {\n this.renderAvailability(params);\n this.renderAddToCart(params);\n }\n\n /**\n * @description Render product availability\n * @param {object} params Product object\n * @returns {void}\n */\n renderAvailability(params) {\n if (!params.pid || this.config.pid !== params.pid) {\n return;\n }\n\n let message = '';\n let availabilityClass = '';\n let alert = '';\n\n if (params.availability && (params.availability.isPreorder || params.availability.isBackorder)) {\n if (params.availability.messages) {\n message = params.availability.messages.join('');\n availabilityClass = params.availability.class;\n }\n\n if (params.availability.alerts) {\n alert = params.availability.alertsCommon.join('');\n }\n }\n\n this.getById('availability', (availabilityLabel) => {\n /** due to we use global Mustache template for whole wishlist templates are placed on wishlistMgr level,\n * so need to trigger render there */\n this.eventBus().emit(reRenderWishlistComponentGlobalEvent, {\n templateRefId: 'availabilityTemplate',\n data: {\n message: message,\n class: availabilityClass\n },\n element: availabilityLabel.ref('container')\n });\n });\n\n this.getById('availabilityAlert', (availabilityAlert) => {\n /** due to we use global Mustache template for whole wishlist templates are placed on wishlistMgr level,\n * so need to trigger render there */\n this.eventBus().emit(reRenderWishlistComponentGlobalEvent, {\n templateRefId: 'availabilityAlertTemplate',\n data: {\n alert: alert\n },\n element: availabilityAlert.ref('container')\n });\n });\n }\n\n /**\n * @description Render Add to Cart btn\n * @param {object} params - params\n */\n renderAddToCart(params) {\n if (!params.pid || this.config.pid !== params.pid) {\n return;\n }\n\n const QuickAddToCart = /** @type {QuickAddToCart} */(this.getConstructor('quickAddToCart'));\n const ProcessButton = /** @type {ProcessButton} */(this.getConstructor('processButton'));\n\n this.eachChild(child => {\n if (child instanceof QuickAddToCart) {\n child.eachChild(button => {\n if (button instanceof ProcessButton) {\n /** due to we use global Mustache template for whole wishlist templates are placed on wishlistMgr level,\n * so need to trigger render there */\n this.eventBus().emit(reRenderWishlistComponentGlobalEvent, {\n templateRefId: 'addToCartTemplate',\n data: {\n available: params.available,\n availability: params.availability\n },\n element: button.ref('container')\n });\n }\n });\n }\n });\n }\n }\n return HarmonyWishListItem;\n}\n","/**\n * @typedef {ReturnType } WishlistMgr\n */\n\n/**\n * @param {WishlistMgr} WishlistMgr widget for extending\n * @returns {typeof HarmonyWishlistMgr} HarmonyWishlistMgr widget\n */\nexport default function (WishlistMgr) {\n class HarmonyWishlistMgr extends WishlistMgr {\n init() {\n super.init();\n this.eventBus().on('wishlist.reRenderTemplate', 'reRenderTemplate');\n }\n\n /**\n * @description Render to template wishlist\n * @param {object} wishlistModel Wishlist Model object to render\n * @returns {Promise}\n */\n reRenderWishlist(wishlistModel) {\n return super.reRenderWishlist(wishlistModel).then(() => {\n if (wishlistModel?.totalCount <= 0) {\n this.eventBus().emit('wishlist.empty');\n }\n });\n }\n\n confirmedRemoveProductFromWishlist() {\n super.confirmedRemoveProductFromWishlist();\n\n if (this.productToRemove) {\n this.eventBus().emit('product.removed.from.wishlist', this.productToRemove.data('analytics'));\n this.ref('self').get().querySelector('.b-product_tile-image').focus();\n }\n }\n\n /**\n * @description Rerender templates for wishlist components\n * Requires due to we use one template for whole wishlist\n * @param {object} params - params\n */\n reRenderTemplate(params) {\n this.render(params.templateRefId, params.data, params.element);\n }\n }\n\n return HarmonyWishlistMgr;\n}\n","// TODO: freeze loaded sections during update with aria-busy\n// TODO: investigate proper implementation of aria-live region for updated sections\n// TODO: keep track that focus stays on the same place during PLP update\n\nimport { submitFormJson } from 'widgets/toolbox/ajax';\n/**\n * @typedef {ReturnType} ProductDetail\n */\n\n/**\n * @description Base AddToCartMixin implementation\n *
This class is not intended to have a separate DOM representation.\n * @param {ProductDetail} ProductDetail Base widget for extending\n * @returns {typeof AddToCartMixin} Add to Cart mixin class\n */\nexport default function (ProductDetail) {\n /**\n * @class AddToCartMixin\n * @augments ProductDetail\n * @property {string} data-text-network-error - network error text\n * @property {string} data-add-to-cart-label - add to cart label\n * @property {string} data-pid - product id\n * @property {boolean} data-show-minicart-on-product-add - Show minicart on product added to cart\n * @property {boolean} data-show-message-on-product-add - Show message on poroduct added to cart\n * @property {boolean} data-show-alert-on-product-add - Show Global Alert on product added to cart\n */\n class AddToCartMixin extends ProductDetail {\n prefs() {\n return {\n pid: '',\n textNetworkError: 'Network Error',\n addToCartBtn: 'addToCart',\n classesBusy: 'm-busy',\n showMinicartOnProductAdd: false,\n showMessageOnProductAdd: true,\n showAlertOnProductAdd: true,\n zeroWidthSpaceSymbol: '\\u200B',\n ...super.prefs()\n };\n }\n\n init() {\n super.init();\n this.readyToOrder = this.prefs().readyToOrder;\n this.has(this.prefs().addToCartBtn, (element) => {\n const stock = element.data('stock');\n if (stock) {\n this.stock = stock;\n }\n });\n this.selectedQuantity = this.prefs().selectedQuantity;\n this.spacesLength = 0;\n }\n\n /**\n * @description Show message\n * @param {string} msg Message\n * @param {boolean} error Error flag\n */\n showCartMessage(msg, error = false) {\n this.getById(this.prefs().addToCartMsg, (addToCartMsg) => {\n if (typeof this.spacesLength === 'undefined') {\n this.spacesLength = 0;\n }\n // It's needed to force render previously added success message. If we try to add the same product\n // several times, success message alert will not be announced by a screen reader.\n msg = msg.concat(Array(++this.spacesLength).join(this.prefs().zeroWidthSpaceSymbol));\n\n addToCartMsg.render('template', { msg, error }, addToCartMsg.ref('container')).then(() => addToCartMsg.show());\n });\n }\n\n /**\n * @description Handles response from server once product added to cart\n * @emits \"product.added.to.cart\"\n * @param {any} response Add Product response\n */\n postAddProduct(response) {\n if (!response.error && response.cart) {\n this.emit('productadded');\n const cartModel = response.cart;\n cartModel.showMinicart = this.prefs().showMinicartOnProductAdd;\n this.eventBus().emit('product.added.to.cart', cartModel, this);\n\n if (this.prefs().showAlertOnProductAdd) {\n const accessibilityAlert = this.prefs().accessibilityAlerts.addedtocart;\n this.eventBus().emit('alert.show', {\n accessibilityAlert\n });\n }\n }\n\n if (response.error || this.prefs().showMessageOnProductAdd) {\n this.eventBus().emit('product.addedTocart.with.error', response);\n this.showCartMessage(response.message, response.error);\n }\n }\n\n addToCart(button) {\n const addToCartBtnPrefs = button.prefs();\n\n if (addToCartBtnPrefs.readyToOrder) {\n this.readyToOrder = addToCartBtnPrefs.readyToOrder;\n }\n\n if (!this.readyToOrder) {\n this.showCartMessage(this.prefs().textSelectOptions, true);\n\n return;\n }\n\n if (this.stock && this.stock < this.selectedQuantity) {\n this.showCartMessage(this.prefs().textStockLimit, true);\n\n return;\n }\n\n button.startProcess();\n\n this.showProgressBar();\n\n submitFormJson(addToCartBtnPrefs.addToCartUrl, {\n pid: this.currentProductID || addToCartBtnPrefs.pid,\n quantity: this.selectedQuantity || addToCartBtnPrefs.selectedQuantity\n }).then(response => this.postAddProduct(response))\n .finally(() => {\n button.stopProcess();\n\n this.hideProgressBar();\n }).catch(() => {\n this.showCartMessage(this.prefs().textNetworkError, true);\n });\n }\n\n showProgressBar() {\n this.ref('self').addClass(this.prefs().classesBusy);\n }\n\n hideProgressBar() {\n this.ref('self').removeClass(this.prefs().classesBusy);\n }\n\n /**\n * @description Update Product View\n * @param {any} product productModel\n */\n updateProductView(product) {\n super.updateProductView(product);\n this.renderAddToCart(product);\n }\n\n renderAddToCart(product) {\n this.getById('addToCart', (addToCartBtn) => {\n if (!product.available && product.availability.isOutOfStock) {\n addToCartBtn.setText(this.prefs().outOfStockLabel);\n addToCartBtn.disable();\n } else if (product.availability.isReachedLimit) {\n this.getById(this.prefs().addToCartMsg, (addToCartMsg) => {\n const msg = product.availability.messages[0];\n const error = true;\n addToCartMsg.render(\n 'template',\n { msg, error },\n addToCartMsg.ref('container')\n ).then(() => addToCartMsg.show());\n });\n addToCartBtn.setText(this.prefs()[this.prefs().update ? 'updateLabel' : 'addToCartLabel']);\n addToCartBtn.disable();\n } else {\n addToCartBtn.setText(this.prefs()[this.prefs().update ? 'updateLabel' : 'addToCartLabel']);\n addToCartBtn.enable();\n }\n });\n }\n }\n\n return AddToCartMixin;\n}\n","import { getContentByUrl } from 'widgets/toolbox/ajax';\n\n/**\n * @typedef {typeof import('widgets/Widget').default} Widget\n * @typedef {InstanceType} refElement\n */\n\n/**\n * @param {Widget} Widget Base widget for extending\n * @returns {typeof WishListItem} Wishlist item class\n */\n\nexport default function (Widget) {\n /**\n * @category widgets\n * @subcategory wishlist\n * @class WishListItem\n * @augments Widget\n * @classdesc Wish list item component with next features:\n * 1. Handles click on product and click on edit button\n * 2. Handles add to cart error\n * 3. Stores actual analytics data\n * @property {string} [addToCartMsg=addToCartMsg] - Reference id for `add to cart message` element\n */\n class WishListItem extends Widget {\n prefs() {\n return {\n addToCartMsg: 'addToCartMsg',\n ...super.prefs()\n };\n }\n\n /**\n * @description Add global event handlers\n * @returns {void}\n */\n init() {\n this.eventBus().on('product.updated', 'updateGTMInfo');\n this.eventBus().on('product.addedTocart.with.error', 'productAddedToCartWishError');\n super.init();\n }\n\n /**\n * @description Handler for `edit` product button in a Cart\n * @param {refElement} editBtn - Target `edit` button\n * @listens dom#click\n * @emits WishListItem#edit\n * @emits \"product.tile.qv.open.edit\"\n * @returns {void}\n */\n editProduct(editBtn) {\n const uuid = editBtn.data('uuid');\n const pid = editBtn.data('pid');\n const qty = editBtn.data('qty');\n const editModeQV = editBtn.data('editModeQv') || false;\n getContentByUrl(editBtn.data('href'), {\n uuid,\n pid,\n qty,\n editModeQV\n })\n .then((response) => {\n /**\n * @description Event to show edit button from parent component\n * @event WishListItem#edit\n */\n this.emit('edit', response);\n });\n this.eventBus().emit('product.tile.qv.open.edit', editBtn);\n }\n\n /**\n * @description Save updated analytics info to property\n * @param {object} response - Response object from server\n * @returns {void}\n */\n updateGTMInfo(response) {\n if (response.success && response.newLineItem) {\n this.currentGtmInfo = response.newLineItem.gtmInfo;\n }\n }\n\n /**\n * @description Handle clicking on the product link\n * @param {refElement} link - Product link\n * @listens dom#click\n * @emits \"wishlist.product.link.click\"\n * @returns {void}\n */\n onProductLinkClick(link) {\n this.eventBus().emit('wishlist.product.link.click', link);\n }\n\n /**\n * @description Error handler on product added to cart\n * @param {object} response - Response object from server\n * @emits \"alert.show\"\n * @returns {void}\n */\n productAddedToCartWishError(response) {\n const addToCartErrorMessage = response.message;\n if (response.error && addToCartErrorMessage && response.pid) {\n const ref = this.prefs().addToCartMsg;\n this.ref(ref)\n .setText(addToCartErrorMessage)\n .show();\n }\n this.eventBus().emit('alert.show', {\n addToCartErrorMessage\n });\n }\n }\n return WishListItem;\n}\n","import { getJSONByUrl, submitFormJson } from 'widgets/toolbox/ajax';\nimport { scrollWindowTo } from 'widgets/toolbox/scroll';\n\nconst ALERT_EVENT = 'alert.show';\n\n/**\n * @typedef {typeof import('widgets/Widget').default} Widget\n * @typedef {InstanceType>} confirmDialog\n * @typedef {InstanceType>} ProductDetail\n * @typedef {InstanceType>} WishListItem\n * @typedef {InstanceType} RefElement\n * @typedef {InstanceType>} modal\n */\n\n/**\n * @param {Widget} Widget Base widget for extending\n * @returns {typeof WishlistMgr} WishlistMgr widget\n */\n\nexport default function (Widget) {\n /**\n * @category widgets\n * @subcategory wishlist\n * @class WishlistMgr\n * @augments Widget\n * @classdesc Represents WishlistMgr component with next features:\n * 1.Render Wishlist and all counters\n * 2.Allow Remove/Edit product from Wishlist\n * 3.Allow load more products to display\n * 4.Allow share Wishlist in social networks and by direct link\n *\n * WishlistMgr widget should contain {@link WishListItem} widgets that implement one product tile.\n * @property {string} data-widget - Widget name `wishlistMgr`\n * @property {boolean} data-show-more - Load More button toggle(on/off)\n * @property {string} data-page-number - Page number\n * @property {object} data-wishlist-model - Wishlist model\n * @property {string} data-share-confirmation-dialog-title - Confirmation Dialog Share title\n * @property {string} data-share-confirmation-dialog-message - Confirmation Dialog Share message\n * @property {string} data-share-confirmation-dialog-confirm - Confirmation Dialog Share confirm button\n * @property {string} data-share-confirmation-dialog-cancel - Confirmation Dialog Share cancel button\n * @property {string} data-delete-confirmation-dialog-title - Confirmation Dialog Delete Product title\n * @property {string} data-delete-confirmation-dialog-message - Confirmation Dialog Delete Product message\n * @property {string} data-delete-confirmation-dialog-confirm - Confirmation Dialog Delete Product confirm button\n * @property {string} data-delete-confirmation-dialog-cancel - Confirmation Dialog Delete Product cancel button\n * @property {string} data-add-to-cart-error-message - Add to Cart error message\n * @property {boolean} data-show-minicart-on-product-add - Show minicart on product add to Cart\n * @property {object} data-accessibility-alerts - Accessibility alerts messages for different user actions\n * Possible values are: `linkCopied`\n * @example Example of wishlistMgr widget usage\n * \n *
\n * \n *
\n * \n * \n *
\n *
\n * \n * ...wishListItem content\n *
\n * \n * \n */\n class WishlistMgr extends Widget {\n prefs() {\n return {\n accessibilityAlerts: {},\n wishlistModel: {},\n wishlistId: '',\n publicView: '',\n urlToSetPublic: '',\n urlLoadMore: '',\n shareConfirmationDialogTitle: '',\n shareConfirmationDialogMessage: '',\n shareConfirmationDialogConfirm: '',\n shareConfirmationDialogCancel: '',\n deleteConfirmationDialogTitle: '',\n deleteConfirmationDialogMessage: '',\n deleteConfirmationDialogConfirm: '',\n deleteConfirmationDialogCancel: '',\n tauAttrShareConfirmationPopUp: 'wishlist_share_dialog',\n tauAttrRemoveProductConfirmationPopUp: 'remove_item_confirmation_dialog',\n wishlistGrid: 'wishlistGrid',\n ...super.prefs()\n };\n }\n\n /**\n * @description Widget initialisation\n * @listens \"product.updated\"\n * @emits \"wishlist.products.init\"\n * @returns {void}\n */\n init() {\n super.init();\n this.eventBus().on('product.updated', 'closeModalAfterEditProduct');\n this.wishlistModel = this.prefs().wishlistModel;\n this.reRenderWishlist(this.wishlistModel).then(() => {\n /**\n * @description Global event to indicate wishlist products are init\n * @event \"wishlist.products.init\"\n */\n this.eventBus().emit('wishlist.products.init', this.wishlistModel.items);\n });\n }\n\n /**\n * @description Render to template wishlist\n * @param {object} wishlistModel Wishlist Model object to render\n * @returns {Promise}\n */\n\n reRenderWishlist(wishlistModel) {\n this.renderWishlistHeader(wishlistModel);\n this.calculateLoadMorePercentage(wishlistModel);\n\n return Promise.all([\n this.renderWishlist(wishlistModel),\n this.renderWishlistCount(wishlistModel),\n this.renderWishlistProgressIndicator(wishlistModel)\n ]);\n }\n\n /**\n * @description Render wishlist header\n * @param {object} wishlistModel Wishlist Model object to render\n * @returns {void}\n */\n renderWishlistHeader(wishlistModel) {\n this.ref('wishlistHeader').toggle(wishlistModel.totalCount > 0);\n }\n\n /**\n * @description Calculate Progress Indicator percentage\n * @param {object} wishlistModel Wishlist Model object to render\n * @returns {void}\n */\n\n calculateLoadMorePercentage(wishlistModel) {\n const loadMorePercentage = Math.round((wishlistModel.viewedItemsCount * 100) / wishlistModel.totalCount);\n\n wishlistModel.loadMorePercentage = loadMorePercentage;\n }\n\n /**\n * @description Share button handler\n * @listens dom#click\n * @param {RefElement} link Link to share\n * @returns {void}\n */\n shareLink(link) {\n this.linkToShare = link;\n this.confirmationHandler = this.confirmedShareLink;\n this.getById('confirmDialog', (/** @type {confirmDialog} */confirmDialog) => {\n confirmDialog.showModal({\n title: this.prefs().shareConfirmationDialogTitle,\n message: this.prefs().shareConfirmationDialogMessage,\n confirm: this.prefs().shareConfirmationDialogConfirm,\n cancel: this.prefs().shareConfirmationDialogCancel,\n isShareConfirmDialog: true,\n attributes: {\n 'data-tau': this.prefs().tauAttrShareConfirmationPopUp\n }\n });\n });\n }\n\n /**\n * @description Remove product handler\n * @listens dom#click\n * @param {RefElement} product Product to remove\n * @returns {void}\n */\n removeProductFromWishlist(product) {\n this.productToRemove = product;\n this.confirmationHandler = this.confirmedRemoveProductFromWishlist;\n const productName = product.data('productName');\n const message = this.prefs().deleteConfirmationDialogMessage.replace('{0}', productName);\n this.getById('confirmDialog', (/** @type {confirmDialog} */confirmDialog) => {\n confirmDialog.showModal({\n title: this.prefs().deleteConfirmationDialogTitle,\n message: message,\n confirm: this.prefs().deleteConfirmationDialogConfirm,\n cancel: this.prefs().deleteConfirmationDialogCancel,\n attributes: {\n 'data-tau': this.prefs().tauAttrRemoveProductConfirmationPopUp\n }\n });\n });\n }\n\n /**\n * @description Show confirmation dialog\n * @listens dom#click\n * @returns {void}\n */\n confirmDialog() {\n const linkToShare = this.linkToShare;\n const shareMethod = linkToShare ? linkToShare.data('share') : '';\n const confirmationHandler = this.confirmationHandler;\n // We copy the link before AJAX call to be able to use execCommand in other case IOS/MACOS denied the use execCommand\n if (confirmationHandler === this.confirmedShareLink && linkToShare && shareMethod === 'clipboard') {\n const linkToCopy = linkToShare.data('href');\n this.copyToClipboard(linkToCopy);\n }\n if (confirmationHandler) {\n confirmationHandler.call(this);\n }\n }\n\n /**\n * @description Share link logic.\n * @emits \"alert.show\"\n * @returns {void}\n */\n confirmedShareLink() {\n const linkToShare = this.linkToShare;\n if (linkToShare) {\n const link = linkToShare.data('href');\n const shareMethod = linkToShare.data('share');\n const url = this.prefs().urlToSetPublic;\n const wishlistID = this.prefs().wishlistId;\n const publicView = this.prefs().publicView;\n let windowReference;\n if (shareMethod !== 'clipboard') {\n windowReference = window.open();\n }\n submitFormJson(url, { id: wishlistID, publicView })\n .then(response => {\n if (shareMethod === 'clipboard') {\n if (response.success) {\n const accessibilityAlert = this.prefs().accessibilityAlerts.linkCopied;\n /**\n * @description Global event to show alert\n * @event \"alert.show\"\n */\n this.eventBus().emit(ALERT_EVENT, {\n accessibilityAlert\n });\n }\n return;\n }\n if (windowReference) {\n windowReference.location = link;\n }\n });\n }\n }\n\n /**\n * @description Render Wishlist\n * @param {object} wishlistModel Wishlist Model object to render\n * @returns {Promise} Return new Promise\n */\n renderWishlist(wishlistModel) {\n return this.render('wishlistTemplate', wishlistModel, this.ref('wishlistContainer'));\n }\n\n /**\n * @description Render Wishlist proggress indicator\n * @param {object} wishlistModel Wishlist Model object to render\n * @returns {Promise} Return new Promise\n */\n renderWishlistProgressIndicator(wishlistModel) {\n return this.render('wishlistProgressTemplate', wishlistModel, this.ref('wishlistProgressContainer'))\n .then(() => {\n this.ref('productProgressIndicator').toggle(wishlistModel.totalCount > 0);\n });\n }\n\n /**\n * @description Load More Button handler\n * @listens dom#click\n * @emits WishlistMgr#productsInit\n * @emits \"alert.show\"\n * @param {RefElement} button Load More Button\n * @returns {void}\n */\n\n loadMore(button) {\n const href = button.data('href');\n const id = button.data('uuid');\n const pageNumber = String(parseInt(button.data('pageNumber'), 10) + 1);\n const publicView = button.data('publicView');\n let url = '';\n\n if (typeof href === 'string') {\n url = href;\n }\n\n getJSONByUrl(url, {\n publicView,\n pageNumber,\n id\n }).then(response => {\n if (this.wishlistModel && response.success) {\n this.wishlistModel = {\n ...response.wishlist,\n items: this.wishlistModel.items.concat(response.wishlist.items)\n };\n /**\n * @description Event to init wishlist products\n * @event WishlistMgr#productsInit\n */\n this.eventBus().emit('wishlist.products.init', response.wishlist.items, 'browsing');\n }\n this.reRenderWishlist(this.wishlistModel).then(() => {\n const accessibilityAlert = this.prefs().accessibilityAlerts.productListUpdated;\n /**\n * @description Global event to show alert\n * @event \"alert.show\"\n */\n this.eventBus().emit(ALERT_EVENT, {\n accessibilityAlert\n });\n });\n });\n }\n\n /**\n * @description Render Wishlist total count\n * @param {object} wishlistModel Wishlist Model object to render\n * @returns {Promise} Return new Promise\n */\n\n renderWishlistCount(wishlistModel) {\n return this.render(\n 'wishlistCountTemplate',\n {\n count: wishlistModel.totalCount,\n countPlural: wishlistModel.totalCount !== 1\n },\n this.ref('wishlistCountContainer')\n );\n }\n\n /**\n * @description Show edit product modal\n * @param {WishListItem} item - List item component\n * @param {string} body - modal body\n * @listens WishlistItem#edit\n * @returns {void}\n */\n showEditProductModal(item, body) {\n this.getById('editProductModal', (/** @type {modal} */ editProductModal) => editProductModal\n .showModal({ body: body }));\n }\n\n /**\n * @description Get response from server after editing wishlist items. Remove old items and add new to wishslist.\n * Rerender wishlist with updated items\n * @emits \"alert.show\"\n * @param {object} response object response from server\n * @returns {void}\n */\n closeModalAfterEditProduct(response) {\n if (response.success\n && (response.newLineItem || response.removedUUIDs)\n && this.wishlistModel) {\n const wishlistGrid = this.ref(this.prefs().wishlistGrid).get();\n this.getById('editProductModal', (/** @type {modal} */ editProductModal) => editProductModal\n .closeModal());\n this.wishlistModel.items = this.wishlistModel.items.filter(item => {\n return !response.removedUUIDs.includes(item.UUID);\n });\n this.wishlistModel.items.unshift(response.newLineItem);\n this.reRenderWishlist(this.wishlistModel).then(() => {\n scrollWindowTo(wishlistGrid, true);\n\n const accessibilityAlert = this.prefs().accessibilityAlerts.wishlistUpdated;\n /**\n * @description Global event to show alert\n * @event \"alert.show\"\n */\n this.eventBus().emit(ALERT_EVENT, {\n accessibilityAlert\n });\n });\n }\n }\n\n /**\n * @description Remove product from Wishlist.Update Wishlist counters\n * @emits \"alert.show\"\n * @returns {void}\n */\n confirmedRemoveProductFromWishlist() {\n const productToRemove = this.productToRemove;\n if (productToRemove) {\n const url = productToRemove.data('url');\n const pid = productToRemove.data('productId');\n getJSONByUrl(url, { pid }).then((response) => {\n if (response.success && this.wishlistModel) {\n const productUuid = productToRemove.data('productUuid');\n const itemIndexToRemove = this.wishlistModel.items.findIndex(item => {\n return item.UUID === productUuid;\n });\n this.wishlistModel.items.splice(itemIndexToRemove, 1);\n this.wishlistModel.viewedItemsCount--;\n this.wishlistModel.totalCount--;\n if (this.wishlistModel.loadMoreCount <= 0) {\n this.wishlistModel.loadMoreCount = 0;\n this.wishlistModel.showMore = false;\n }\n if (this.wishlistModel.items.length === 0 && this.wishlistModel.totalCount > 0) {\n const urlLoadMore = this.prefs().urlLoadMore;\n const id = this.wishlistModel.UUID;\n const pageNumber = '1';\n const publicView = this.wishlistModel.publicView;\n getJSONByUrl(urlLoadMore, {\n id,\n pageNumber,\n publicView\n }).then(res => {\n if (this.wishlistModel) {\n this.wishlistModel = {\n ...res.wishlist,\n items: this.wishlistModel.items.concat(res.wishlist.items)\n };\n this.productToRemove = undefined;\n this.reRenderWishlist(this.wishlistModel).then(() => {\n const accessibilityAlert = this.prefs().accessibilityAlerts.productRemoved;\n /**\n * @description Global event to show alert\n * @event \"alert.show\"\n */\n this.eventBus().emit(ALERT_EVENT, {\n accessibilityAlert\n });\n });\n }\n });\n return;\n }\n this.productToRemove = undefined;\n this.reRenderWishlist(this.wishlistModel).then(() => {\n const accessibilityAlert = this.prefs().accessibilityAlerts.productRemoved;\n this.eventBus().emit(ALERT_EVENT, {\n accessibilityAlert\n });\n });\n }\n });\n }\n }\n\n /**\n * @description Copy link to clipboard\n * @param {string} str Link that copied to clipboard\n * @returns {void}\n */\n\n copyToClipboard(str) {\n const el = document.createElement('textarea');\n el.value = str || '';\n document.body.appendChild(el);\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el);\n }\n }\n\n return WishlistMgr;\n}\n"],"sourceRoot":""}