{"version":3,"file":"js/splits/wishlist.js","sources":["webpack:///./org_colony/cartridge/js/login.js","webpack:///./org_colony/cartridge/js/pages/wishlist.js"],"sourcesContent":["const dialog = require('./dialog');\nconst page = require('./page');\nconst util = require('./util');\nconst validator = require('./validator');\n\nconst login = {\n /**\n * @private\n * @function\n * @description init events for the loginPage\n */\n init() {\n // o-auth binding for which icon is clicked\n $('.oAuthIcon').bind('click', (event) => {\n $('#OAuthProvider').val(event.currentTarget.id);\n });\n\n // toggle the value of the rememberme checkbox\n $('#dwfrm_login_rememberme').bind('change', () => {\n if ($('#dwfrm_login_rememberme').attr('checked')) {\n $('#rememberme').val('true');\n } else {\n $('#rememberme').val('false');\n }\n });\n\n const $passwordReset = $('#password-reset');\n $passwordReset.on('click', (e) => {\n e.preventDefault();\n const $target = $(e.target);\n const isLegacy = $target.hasClass('legacy');\n const url = $target.attr('href');\n dialog.open({\n url: isLegacy ? util.appendParamToURL(url, 'email', $('.email input').val()) : url,\n options: {\n title: isLegacy ? Resources.TITLE_FORGOTPASSWORDLEGACY : Resources.TITLE_FORGOTPASSWORD,\n dialogClass: 'ui-dialog-resetpass',\n height: 'auto',\n open() {\n validator.init();\n const $requestPasswordForm = $('[name$=\"_requestpassword\"]');\n const $submit = $requestPasswordForm.find('[name$=\"_requestpassword_send\"]');\n $($submit).on('click', (event) => {\n if (!$requestPasswordForm.valid()) {\n return;\n }\n event.preventDefault();\n let data = $requestPasswordForm.serialize();\n // add form action to data\n data += `&${$submit.attr('name')}=`;\n // make sure the server knows this is an ajax request\n if (data.indexOf('ajax') === -1) {\n data += '&format=ajax';\n }\n $.ajax({\n type: 'POST',\n url: $requestPasswordForm.attr('action'),\n data,\n success(response) {\n if (typeof response === 'object'\n && !response.success\n && response.error === 'CSRF Token Mismatch') {\n page.redirect(Urls.csrffailed);\n } else if (typeof response === 'string') {\n dialog.$container.html(response);\n }\n },\n failure() {\n dialog.$container.html(`

${Resources.SERVER_ERROR}

`);\n },\n });\n });\n },\n },\n });\n });\n\n // Trigger password reset dialog if marked as legacy\n if ($passwordReset.hasClass('legacy')) {\n $passwordReset.click();\n }\n },\n};\n\nmodule.exports = login;\n","const addProductToCart = require('./product/addToCart');\nconst page = require('../page');\nconst login = require('../login');\nconst productUtil = require('./product/productUtil');\nconst util = require('../util');\n\nexports.init = () => {\n addProductToCart();\n $('#editAddress').on('change', (event) => {\n page.redirect(util.appendParamToURL(Urls.wishlistAddress, 'AddressID', $(event.currentTarget).val()));\n });\n\n // add js logic to remove the , from the qty feild to pass regex expression on client side\n $('.option-quantity-desired input').on('focusout', (event) => {\n $(event.currentTarget).val($(event.currentTarget).val().replace(',', ''));\n });\n\n login.init();\n\n if ($('.item-list').hasClass('limit-error')) {\n productUtil.showLimitErrorDialog();\n // Remove limit error from query string to prevent it from showing on page refresh\n if (window.history !== undefined && window.history.replaceState !== undefined) {\n window.history.replaceState({}, document.title, window.location.pathname);\n }\n }\n};\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;ACpFA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;A","sourceRoot":""}