{"version":3,"sources":["webpack:///./src/js/custom-handlers.js"],"names":["$","on","e","preventDefault","target","this","data","first","toggleClass","window","AddWishlistCallback","$elem","productId","RemoveWishlistCallback","RemoveWishlistProfile","document","querySelector","remove","querySelectorAll","length","wishlistContainer","insertAdjacentHTML","EmptyWishlistDisplay","deleteAddressProfileCallback","id","elem","addressDiv","parentElement","removeChild","deleteAddressProfilePrompt","Promise","rs","rj","confirm","deleteCartItem","itemInfo","css","imageUrl","text","productName","off","click","removeClass","addClass"],"mappings":"4FAAA,YAsBAA,EAAE,sBAAsBC,GAAG,SAAS,SAAUC,GAC1CA,EAAEC,iBAGF,IAAIC,EAASJ,EAAEK,MAAMC,KAAK,UAGZN,EAAEI,GAAQG,QAGhBC,YAAY,aAMxBC,OAAOC,oBAAsB,SAAUC,EAAOC,KAK9CH,OAAOI,uBAAyB,SAAUF,EAAOC,KAMjDH,OAAOK,sBAAwB,SAAUH,EAAOC,GAEzBG,SAASC,cAAc,oDAAoDJ,OAEjFK,SAKjB,WAII,GAFsBF,SAASG,iBAAiB,2CAA2CC,QAEpE,EAAG,CAEtB,IAAIC,EAAoBL,SAASC,cAAc,wCAG/CD,SAASC,cAAc,mBAAmBC,SAG1CG,EAAkBC,mBAAmB,YAAa,2XAftDC,IA6BJb,OAAOc,6BAA+B,SAAUC,EAAIC,GAEhD,IAAIC,EAAaX,SAASC,cAAc,YAAYQ,KAEpDE,EAAWC,cAAcC,YAAYF,IAMzCjB,OAAOoB,2BAA6B,WAChC,OAAO,IAAIC,QAAQ,CAACC,EAAIC,KAEAC,QAAQ,iDAGxBF,GAAG,GAGHC,GAAG,MAOfvB,OAAOyB,eAAiB,SAAUC,GAE9B,OAAO,IAAIL,QAAQ,CAACC,EAAIC,KAEpBhC,EAAE,kCACGoC,IAAI,aAAc,OAAOD,EAASE,aAEvCrC,EAAE,oCACGsC,KAAKH,EAASI,aAEnBvC,EAAE,2BAA2BwC,MAAMC,OAAM,WACrCzC,EAAE,wBAAwB0C,YAAY,cAEtCX,GAAG,MAGP/B,EAAE,kBAAkBwC,MAAMC,OAAM,WAE5BzC,EAAE,wBAAwB0C,YAAY,cACtCV,OAGJhC,EAAE,wBAAwB2C,SAAS,mB","file":"bobaweb.custom-handlers.0e323c48918cde0d2d95.js","sourcesContent":["/*\r\n * ==============================================================\r\n * Bobaweb Custom Handlers\r\n * Intended use for unique script for each web\r\n * ==============================================================\r\n * ==============================================================\r\n * ██████╗ ██████╗ ██████╗ █████╗ ██╗ ██╗███████╗██████╗\r\n * ██╔══██╗██╔═══██╗██╔══██╗██╔══██╗██║ ██║██╔════╝██╔══██╗\r\n * ██████╔╝██║ ██║██████╔╝███████║██║ █╗ ██║█████╗ ██████╔╝\r\n * ██╔══██╗██║ ██║██╔══██╗██╔══██║██║███╗██║██╔══╝ ██╔══██╗\r\n * ██████╔╝╚██████╔╝██████╔╝██║ ██║╚███╔███╔╝███████╗██████╔╝\r\n * ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚══╝╚══╝ ╚══════╝╚═════╝\r\n * ==============================================================\r\n * ==============================================================\r\n */\r\n\r\n'use strict';\r\n\r\n//import 'bootstrap/dist/js/bootstrap.bundle';\r\n\r\n// opening edit profile\r\n// in my account page\r\n$('#open-edit-profile').on('click', function (e) {\r\n e.preventDefault();\r\n\r\n // getting the target container\r\n let target = $(this).data('target');\r\n\r\n // make instance target as jQuery instance\r\n let $target = $(target).first();\r\n\r\n // toggling the class;\r\n $target.toggleClass('d-none');\r\n});\r\n\r\n//$('#promoModal').modal('show');\r\n\r\n// add wishlist callbacks\r\nwindow.AddWishlistCallback = function ($elem, productId) {\r\n ////$elem.addClass('wishlisted');\r\n}\r\n\r\n// remove wishlist callback\r\nwindow.RemoveWishlistCallback = function ($elem, productId) {\r\n //$elem.removeClass('wishlisted');\r\n}\r\n\r\n// remove wishlist callback\r\n// on profile page\r\nwindow.RemoveWishlistProfile = function ($elem, productId) {\r\n\r\n let elemToRemove = document.querySelector(`[data-identity=\"wishlist-profile-item\"][data-id=\"${productId}\"]`);\r\n\r\n elemToRemove.remove();\r\n\r\n EmptyWishlistDisplay();\r\n}\r\n\r\nfunction EmptyWishlistDisplay() {\r\n\r\n let wishlistNumbers = document.querySelectorAll('[data-identity=\"wishlist-profile-item\"]').length;\r\n\r\n if (wishlistNumbers <= 0) {\r\n\r\n let wishlistContainer = document.querySelector('[data-identity=\"wishlist-container\"]');\r\n\r\n // removing the wishlist display\r\n document.querySelector(`.wishlist-tbody`).remove();\r\n\r\n // appending the empty wishlist display\r\n wishlistContainer.insertAdjacentHTML('beforeend', `
\r\nYou currently don't have any wishlist!
\r\n \r\n