{"version":3,"sources":["webpack:///./cartridges/app_accelerator_core/cartridge/client/default/js/components/dialog.js","webpack:///./cartridges/app_accelerator_core/cartridge/client/default/js/components/langEnablement.js","webpack:///./cartridges/app_accelerator_core/cartridge/client/default/js/modules/module.ajax-form.js","webpack:///./cartridges/app_accelerator_core/cartridge/client/default/js/modules/module.input-format.js","webpack:///./cartridges/app_accelerator_core/cartridge/client/default/js/modules/module.window-scroll.js"],"names":["_openWithContent","params","content","html","modalInstance","originalCallback","options","objectAssign","tracking","callback","afterCreateCallback","modal","initModules","validation","_handleTracking","BornModal","open","targetModal","getModal","modalID","afterOpenCallback","url","progress","$","ajax","dataType","type","data","xhrFields","withCredentials","done","response","renderedTemplate","window","SFRA","SitePreferences","languageExclusionList","langEnablement","fail","xhr","textStatus","console","log","selector","document","querySelector","replace","getActiveModal","updateModal","newID","close","closeModal","getActive","trigger","els","addEventListenerList","evt","preventDefault","getAttribute","trackEvent","trackObject","asyncURL","Urls","GTMVirtualView","asyncParams","nameOfPopin","modalName","modules","init","langEnablementInit","elementsWithReplacement","querySelectorAll","forEach","call","elementWithReplacement","siblingTextNode","nextSibling","nodeType","Node","TEXT_NODE","textContent","trim","spanElement","createElement","parentNode","insertBefore","appendChild","allElements","getElementsByTagName","wordsAndPhrasesToUpperCaseString","wordsAndPhrasesToUpperCase","JSON","parse","element","computedStyle","getComputedStyle","getPropertyValue","hasChildNodes","innermostChild","firstChild","word","regex","RegExp","concat","toLocaleUpperCase","_typeof","o","Symbol","iterator","constructor","prototype","STATUS_LABELS","SUCCESS","ERROR","_doneActions","formEl","actionData","actionType","Array","currentData","_runAction","actionName","action","classList","add","dialog","location","reload","reset","WindowScroll","setupScroll","settings","target","offset","targetElement","removeChild","createCookie","cookieName","cookieValue","cookieDuration","_displayMessages","messageContainer","messageList","length","currentMessage","_handleError","err","error","formSettings","submissionStatus","_replaceContent","responseContent","responseTargetEl","activeDialog","responseTargetStrategy","innerHTML","insertAdjacentHTML","onReplaceCallback","_getFormSettings","formAjaxAttrVal","removeAttribute","_appendExternalData","formData","pageData","getPageActionData","appendPageQueryString","queryString","appendPageAction","_appendSubmittedActionData","submittedAction","hasAttribute","_handleFormSubmitSuccess","publish","formTriggerName","onSuccess","errorsContainerEl","remove","successContainerEl","msg","message","_handleFormSubmitError","onError","serverErrors","setCustomErrors","fields","fieldErrors","_setTrackingAttributesFromResponse","user_email","gtmAddAddressEvent","_requestFormSubmit","method","success","onComplete","openModal","doneModalOptions","redirectUrl","href","appendHashOnRedirect","hash","userEmailEl","trackingAttributes","processAjaxForm","$form","getQueryStringParams","serialize","submitSelector","errorsSelector","createElWithAttrs","class","successSelector","responseTarget","validateForm","name","value","InputFormat","sanitizeFormattedData","enableGoogleRecaptcha","formNameForRecaptchaVerificationObj","formNameForRecaptchaVerification","then","reCaptcha","executeVerification","token","backInStockTracking","setupAJAXForm","currentForm","submitActionSelector","submitActionEvent","addEventListener","event","callbackOnElements","elements","trackingParams","trackingParamsObj","_classCallCheck","a","n","TypeError","_defineProperties","e","r","t","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","key","_createClass","i","_toPrimitive","toPrimitive","String","Number","customBINs","Instances","CARD_TYPES","visa","mastercard","mada","amex","discover","unknown","jcb","inputs","arguments","undefined","setupFormatting","bind","currentInput","hasCustomSettings","currentInputSettings","inputFormat","creditCard","getCustomBINs","setupCreditCard","phone","setupPhone","setupInput","get","push","input","setAttribute","referenceInput","ckoEnabled","list","updateMatchingCardData","cardNumber","inputField","firstTwoDigits","substring","cardTypeLabel","keys","indexOf","cardTypeContainer","cardTypeInput","cardCVVInput","maxLength","formContainer","form","Cleave","onValueChanged","cardValue","rawValue","properties","creditCardType","onCreditCardTypeChanged","dataIsSerialized","rawFormatInputs","getRawValue","param","query","setupWindowScroll","breakpoints","breakpointRanges","isEnabled","breakpointName","matchedBreakpoint","min","body","offsetWidth","max","getOffsetValue","offsetMatch","HTMLElement","getBoundingClientRect","height","bindEvents","el","enabled","hasOwnProperty","delay","setTimeout","disabled","contains","duration","scrollContainer","destination","manualOffset","containerEl","scrollOptions","easings","easeOutCubic","startPosition","getScrollPosition","startTime","performance","now","Date","getTime","destinationPosition","scrollToPosition","scroll","easeScroll","scrollTop","pageYOffset","elapsedTime","time","Math","timeFunction","currentScrollPos","ceil","requestAnimationFrame"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;;AAE8C;AACS;AACN;AACsB;AAChC;AACY;AACV;;AAEzC;AACA;AACA;AACA,SAASA,gBAAgBA,CAACC,MAAM,EAAE;EAC9B,IAAIC,OAAO,GAAGD,MAAM,CAACC,OAAO,IAAID,MAAM,CAACE,IAAI;IACvCC,aAAa;EAEjB,IAAIF,OAAO,EAAE;IACT,IAAIG,gBAAgB;IAEpBJ,MAAM,CAACK,OAAO,GAAGC,8EAAY,CAAC,CAAC,CAAC,EAAEN,MAAM,CAACK,OAAO,CAAC;IACjDL,MAAM,CAACO,QAAQ,GAAGD,8EAAY,CAAC,CAAC,CAAC,EAAEN,MAAM,CAACO,QAAQ,CAAC;IACnDP,MAAM,CAACK,OAAO,CAACJ,OAAO,GAAGA,OAAO;IAEhCG,gBAAgB,GAAGJ,MAAM,CAACQ,QAAQ,IAAIR,MAAM,CAACK,OAAO,CAACI,mBAAmB;IAExET,MAAM,CAACK,OAAO,CAACI,mBAAmB,GAAG,UAASC,KAAK,EAAE;MACjD,IAAI,OAAON,gBAAgB,KAAK,UAAU,EAAE;QACxCA,gBAAgB,CAACM,KAAK,CAAC;MAC3B;MAEAC,sEAAW,CAACD,KAAK,CAAC;MAClBE,sDAAe,CAAC,CAAC;MAEjBC,eAAe,CAACH,KAAK,EAAEV,MAAM,CAAC;IAClC,CAAC;IAEDG,aAAa,GAAG,IAAIW,4DAAS,CAACd,MAAM,CAACK,OAAO,CAAC;IAE7C,OAAOL,MAAM,CAACK,OAAO,CAAC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BAAgB;MAEpB,CAACxB,eAAe,IAAIhT,MAAM,EAAEgU,MAAM,CAAC,CAAC,EAAEM,IAAI,CAACG,IAAI,CAAEF,YAAY,IAAInB,aAAa,CAACU,mBAAmB,GAAGV,aAAa,CAACG,aAAa,CAAC,GAAIH,aAAa,CAACG,aAAa,CAAC,CAAC;MAElKiB,gBAAgB,GAAGxO,YAAY,CAACwN,iBAAiB,CAACR,eAAe,CAAC;;MAElE;MACA;MACA,IAAIwB,gBAAgB,KAAKpB,aAAa,CAACU,mBAAmB,IAAIM,WAAW,IAAIhB,aAAa,CAACL,QAAQ,EAAE;QACjGK,aAAa,CAAC5U,QAAQ,CAAC,CAAC;QAExB;MACJ;MAEAwB,MAAM,CAAC0U,qBAAqB,CAAC1O,YAAY,CAACiO,UAAU,CAACrF,IAAI,CAAC,IAAI,EAAEoE,eAAe,EAAEI,aAAa,CAAC,CAAC;IACpG;EAAC;AAAA","file":"module-ajax-form.js","sourcesContent":["/**\n * Wrapper for Born Modal.\n * Provides ease of usage for modals as well as some default fallbacks.\n */\n\nimport BornModal from '@borngroup/born-modal';\nimport {objectAssign} from '@borngroup/born-utilities';\nimport * as validation from './customValidation';\nimport {initModules, addEventListenerList} from '../helpers/utilities';\nimport * as progress from './progress';\nimport * as langEnablement from './langEnablement';\nimport modules from '../helpers/modules';\n\n/**\n * @description populate the dialog with html content, then open it\n **/\nfunction _openWithContent(params) {\n let content = params.content || params.html,\n modalInstance;\n\n if (content) {\n let originalCallback;\n\n params.options = objectAssign({}, params.options);\n params.tracking = objectAssign({}, params.tracking);\n params.options.content = content;\n\n originalCallback = params.callback || params.options.afterCreateCallback;\n\n params.options.afterCreateCallback = function(modal) {\n if (typeof originalCallback === 'function') {\n originalCallback(modal);\n }\n\n initModules(modal);\n validation.init();\n\n _handleTracking(modal, params);\n };\n\n modalInstance = new BornModal(params.options);\n\n delete params.options.afterCreateCallback;\n\n return modalInstance;\n }\n}\n\n/**\n * @description Replace the content of current dialog\n * @param {object} params\n * @param {string} params.url - If the url property is provided, an ajax call is performed to get the content to replace\n * @param {string} params.html - If no url property is provided, use html provided to replace\n */\nexport function open(params) {\n let targetModal;\n\n params.options = params.options || {};\n\n targetModal = BornModal.getModal(params.options.modalID);\n\n //Avoid making unnecessary requests if modal was already loaded once.\n if (targetModal) {\n //Makes sure the afterOpenCallback is taken from the object every time, in case the values change.\n targetModal.modal.afterOpenCallback = params.options.afterOpenCallback || function() {\n return false;\n };\n\n targetModal.modal.open();\n } else {\n if (params.url) {\n progress.showLoader();\n\n $.ajax({\n dataType: params.type || 'json',\n url: params.url,\n data: params.data,\n xhrFields: {\n withCredentials: true\n }\n })\n .done(function(response) {\n progress.hideLoader();\n\n params.content = typeof response === 'string' ? response : (response.renderedTemplate || response.content);\n\n _openWithContent(params);\n if (window.SFRA.SitePreferences.languageExclusionList) {\n langEnablement.langEnablementInit();\n }\n })\n .fail(function(xhr, textStatus) {\n // failed\n if (textStatus === 'parsererror') {\n console.log('Bad response type. Check if your `dataType` request matches the response type.');\n }\n })\n } else if (params.html) {\n _openWithContent(params);\n } else if (params.selector) {\n params.content = document.querySelector(params.selector);\n _openWithContent(params);\n }\n }\n}\n\nexport function replace(options) {\n var modal = options.modalID ? BornModal.getModal(options.modalID) : BornModal.getActiveModal();\n\n BornModal.updateModal(modal, options.content, options.newID);\n}\n\n/**\n * @function\n * @description Closes the dialog\n */\nexport function close() {\n BornModal.closeModal();\n}\n\nexport function getActive() {\n return BornModal.getActiveModal();\n}\n\n/**\n * Returns the matched Modal element.\n * @param {[type]} modalID [description]\n * @return {[type]} [description]\n */\nexport function getModal(modalID) {\n return BornModal.getModal(modalID);\n}\n\nexport function trigger(els, params) {\n addEventListenerList(els, 'click', function(evt) {\n evt.preventDefault();\n\n if (!params.url && !params.html && !params.selector) {\n params.selector = this.getAttribute('href');\n }\n\n open(params);\n });\n}\n\nfunction _handleTracking(modal, params) {\n let trackEvent = params.tracking.trackEvent || 'virtualPageview',\n trackObject = trackEvent === 'virtualPageview' ? {\n asyncURL: window.SFRA.Urls.GTMVirtualView,\n asyncParams: {\n nameOfPopin: params.tracking.modalName || params.options.modalID\n }\n } : params.tracking.trackObject;\n\n modules.tracking.init(null, {trackEvent, trackObject});\n}\n","export function langEnablementInit() {\n if (window.SFRA.SitePreferences.languageExclusionList) {\n let elementsWithReplacement = document.querySelectorAll('.font-family--cartier-logos');\n [].forEach.call(elementsWithReplacement, function(elementWithReplacement) {\n var siblingTextNode = elementWithReplacement.nextSibling;\n if (siblingTextNode.nodeType == Node.TEXT_NODE && siblingTextNode.textContent.trim() !== '') {\n let spanElement = document.createElement('span');\n siblingTextNode.parentNode.insertBefore(spanElement, siblingTextNode);\n spanElement.appendChild(siblingTextNode);\n }\n });\n\n var allElements = document.getElementsByTagName('*');\n const wordsAndPhrasesToUpperCaseString = window.SFRA.SitePreferences.languageExclusionList,\n wordsAndPhrasesToUpperCase = JSON.parse(wordsAndPhrasesToUpperCaseString);\n\n [].forEach.call(allElements, function(element) {\n var computedStyle = window.getComputedStyle(element);\n if (computedStyle.getPropertyValue('text-transform') === 'uppercase') {\n if (element && element.hasChildNodes()) {\n let innermostChild = element;\n\n while (innermostChild.hasChildNodes()) {\n innermostChild = innermostChild.firstChild;\n }\n\n if (innermostChild.nodeType === Node.TEXT_NODE) {\n let textContent = innermostChild.textContent;\n\n // Replace words and phrases with their uppercase versions\n wordsAndPhrasesToUpperCase.forEach(word => {\n const regex = new RegExp(`\\\\b${word}\\\\b`, 'gi'); // Use word boundaries and case-insensitive matching\n textContent = textContent.replace(regex, word.toLocaleUpperCase());\n });\n\n innermostChild.textContent = textContent;\n }\n }\n }\n });\n }\n}\n","'use strict';\n\nimport * as dialog from '../components/dialog';\nimport * as progress from '../components/progress';\n\nimport InputFormat from './module.input-format';\nimport WindowScroll from './module.window-scroll';\nimport {publish} from '../helpers/pubSub';\nimport modules from '../helpers/modules';\nimport {getQueryStringParams} from '../helpers/urlUtilities';\nimport {addEventListenerList, getPageActionData, initModules} from '../helpers/utilities';\nimport {validateForm, setCustomErrors} from '../components/clientSideValidation';\nimport {createElWithAttrs, callbackOnElements, createCookie, objectAssign} from '@borngroup/born-utilities';\n\nconst STATUS_LABELS = {\n SUCCESS: 'OK',\n ERROR: 'Error'\n};\n\n/**\n * Runs the provided actions, loops if more than one.\n */\nfunction _doneActions(formEl, actionData, actionType) {\n if (actionData instanceof Array) {\n actionData.forEach(currentData => _runAction(formEl, currentData, actionType));\n } else {\n _runAction(formEl, actionData, actionType);\n }\n}\n\n/**\n * Runs a single action from the list.\n * Provides an easy way to execute common actions after a form is submitted.\n */\nfunction _runAction(formEl, actionData, actionType) {\n let actionName = typeof actionData === 'string' ? actionData : (actionData ? actionData.action : '');\n\n formEl.classList.add(`set--form-${actionType}`);\n\n switch (actionName) {\n case 'close': {\n dialog.close();\n\n return true;\n }\n case 'reload': {\n window.location.reload();\n\n return true;\n }\n case 'reset': {\n formEl.reset();\n\n return true;\n }\n case 'scrollTo': {\n WindowScroll.setupScroll(actionData.settings.target, 300, actionData.settings.offset);\n\n return true;\n }\n case 'deleteElement': {\n let targetElement = document.querySelector(actionData.selector);\n\n if (targetElement) {\n targetElement.parentNode.removeChild(targetElement);\n }\n\n return true;\n }\n case 'createCookie': {\n createCookie(actionData.settings.cookieName, actionData.settings.cookieValue, actionData.settings.cookieDuration);\n\n return true;\n }\n default: {\n break;\n }\n }\n}\n\n//Displays an inline message if a message is passed and a message target is available.\nfunction _displayMessages(messageContainer, messageList) {\n if (messageList) {\n if (typeof messageList === 'string') {\n messageContainer.textContent = messageList;\n } else if (messageList.length) {\n messageList.forEach(function(currentMessage) {\n messageContainer.textContent = currentMessage;\n });\n }\n\n messageContainer.classList.add('set--visible');\n }\n}\n\n/**\n * Handles the response error flow.\n */\nfunction _handleError(err) {\n progress.hideLoader();\n\n console.error(err);\n}\n\nfunction _handleTracking(formSettings, error) {\n if (formSettings.tracking) {\n let trackObject = objectAssign({submissionStatus: error ? STATUS_LABELS.ERROR : STATUS_LABELS.SUCCESS}, formSettings.tracking.trackObject);\n\n modules.tracking.init(null, {trackEvent: formSettings.tracking.trackEvent, trackObject});\n }\n}\n\n/**\n * Use `responseContent` to replace the contents of a `responseTargetEl` element.\n */\nfunction _replaceContent(responseContent, responseTargetEl, formSettings) {\n if (responseTargetEl === formSettings.activeDialog) {\n dialog.replace({content: responseContent});\n } else {\n if (formSettings.responseTargetStrategy === 'update') {\n responseTargetEl.innerHTML = responseContent;\n } else if (formSettings.responseTargetStrategy === 'append') {\n responseTargetEl.insertAdjacentHTML('beforeend', responseContent);\n } else {\n responseTargetEl.insertAdjacentHTML('afterend', responseContent);\n responseTargetEl.parentNode.removeChild(responseTargetEl);\n }\n\n initModules(responseTargetEl);\n }\n\n if (typeof formSettings.onReplaceCallback === 'function') {\n formSettings.onReplaceCallback(responseContent, responseTargetEl);\n }\n}\n\n/**\n * Retrieves the form's settings attribute (data-ajax-form) and JSON parses it.\n * data-ajax-form can have the following attributes:\n * -submitSelector: A selector to target the submit action element. Defaults to [data-continue-action].\n * -errorsSelector: A selector to target the errors container element. Defaults to [data-ajax-errors].\n * If no error element is found, places the error at the end of the form.\n */\nfunction _getFormSettings(formEl) {\n if (formEl !== null) {\n let formAjaxAttrVal = formEl.getAttribute('data-ajax-form');\n\n formEl.removeAttribute('data-ajax-form');\n return formAjaxAttrVal ? JSON.parse(formAjaxAttrVal) : {};\n }\n return;\n}\n\n/**\n * Append the page's data-querystring and data-action attributes to the request `formData` object.\n * This can be useful for certain Controllers that leverage this information for processing or redirection purposes.\n */\nfunction _appendExternalData(formSettings, formData) {\n let pageData = getPageActionData();\n\n if (pageData) {\n if (formSettings.appendPageQueryString) {\n formData.queryString = pageData.queryString;\n }\n\n if (formSettings.appendPageAction) {\n formData.action = pageData.action;\n }\n }\n}\n\n/**\n * Appends data stored in the `submittedAction` into the request `formData` obeject.\n * This can be useful to construct a form with mutliple \"submit\" CTAs each with a different set of custom data that should be submitted.\n */\nfunction _appendSubmittedActionData(submittedAction, formData) {\n if (submittedAction && submittedAction.hasAttribute('data-ajax-form-data')) {\n objectAssign(formData, JSON.parse(submittedAction.getAttribute('data-ajax-form-data')));\n }\n}\n\n/**\n * Manages necessary handling for a successful form submission,\n * including message display and success action triggering.\n */\nfunction _handleFormSubmitSuccess(formEl, formData, formSettings, response) {\n publish(`${formSettings.formTriggerName}:success`, {formEl, formData, response});\n\n _doneActions(formEl, formSettings.onSuccess, 'success');\n\n formSettings.errorsContainerEl.classList.remove('set--visible');\n\n _displayMessages(formSettings.successContainerEl, response.msg || response.message);\n\n _handleTracking(formSettings);\n\n return response;\n}\n\n/**\n * Manages necessary handling for a failed form submission,\n * including error message display and success action triggering.\n */\nfunction _handleFormSubmitError(formEl, formData, formSettings, response) {\n progress.hideLoader();\n\n publish(`${formSettings.formTriggerName}:error`, {formEl, formData, response});\n\n _doneActions(formEl, formSettings.onError, 'error');\n\n formSettings.successContainerEl.classList.remove('set--visible');\n\n _displayMessages(formSettings.errorsContainerEl, response.msg || response.message || response.error || response.serverErrors);\n\n setCustomErrors(formEl, response.fields || response.fieldErrors);\n\n _handleTracking(formSettings, true);\n\n return response;\n}\n\n//Sets attributes for datalayer from the response\nfunction _setTrackingAttributesFromResponse(response, formSettings) {\n if (response.user_email && formSettings.tracking) {\n if (!formSettings.tracking.trackObject) {\n formSettings.tracking.trackObject = {};\n }\n formSettings.tracking.trackObject.user_email = response.user_email;\n }\n if (response.gtmAddAddressEvent && !formSettings.tracking) {\n formSettings.tracking = response.gtmAddAddressEvent;\n }\n}\n\n/**\n * Submits an XHR request for `formEl` using the provided `formData` and `formSettings`.\n * @param {[type]} formEl [description]\n * @param {[type]} formData [description]\n * @param {[type]} formSettings [description]\n * @return {[type]} [description]\n */\nfunction _requestFormSubmit(formEl, formData, formSettings) {\n return $.ajax({\n url: formEl.action,\n type: formSettings.type || formEl.method || 'POST',\n data: formData,\n success: function(response) {\n progress.hideLoader();\n\n _doneActions(formEl, formSettings.onComplete, 'complete');\n\n if (typeof response === 'object') {\n let responseContent = response.content || response.renderedTemplate;\n\n if (response.success) {\n _setTrackingAttributesFromResponse(response, formSettings);\n _handleFormSubmitSuccess(formEl, formData, formSettings, response);\n } else {\n _handleFormSubmitError(formEl, formData, formSettings, response);\n }\n\n //Replaces the content of the current modal with whatever the response is.\n //Useful to display BED errors or update messages.\n if (responseContent) {\n _replaceContent(responseContent, formSettings.responseTargetEl, formSettings);\n }\n\n //Opens an additional modal that overlays the form.\n //Useful to display additional information in the form of a modal.\n if (response.openModal) {\n dialog.open({\n url: response.openModal,\n type: response.dataType || null,\n options: formSettings.doneModalOptions\n });\n }\n\n if (response.tracking) {\n formSettings.tracking = response.tracking;\n\n _handleTracking(formSettings);\n }\n\n //Redirects to another URL.\n if (response.redirectUrl) {\n if (window.location.href === response.redirectUrl) {\n window.location.reload();\n } else {\n window.location = formSettings.appendHashOnRedirect ? (`${response.redirectUrl}${window.location.hash}`) : response.redirectUrl;\n }\n }\n } else if (typeof response === 'string') {\n _replaceContent(response, formSettings.responseTargetEl, formSettings);\n let userEmailEl = document.querySelector('[data-locator-component=\"user-email\"]');\n if (userEmailEl) {\n let trackingAttributes = {};\n trackingAttributes.user_email = userEmailEl.getAttribute('value');\n _setTrackingAttributesFromResponse(trackingAttributes, formSettings);\n }\n if (formSettings.tracking) {\n _handleTracking(formSettings);\n }\n }\n },\n error: _handleError\n });\n}\n\n/**\n * Preparees the provided `formEl` for submission,\n * by configuring additional properties on `formSettings` and creating a `formData` object.\n * @return {Promise} [description]\n */\nexport function processAjaxForm(formEl, formSettings, evt) {\n let $form = $(formEl),\n formData = getQueryStringParams($form.serialize(), null);\n\n formSettings = formSettings || _getFormSettings(formEl);\n\n formSettings.formTriggerName = formSettings.formTriggerName || 'form';\n formSettings.submittedAction = formSettings.submittedAction || formEl.querySelector(formSettings.submitSelector || '[data-ajax-submit]');\n\n formSettings.errorsContainerEl = formEl.querySelector(formSettings.errorsSelector || '[data-ajax-errors]') || createElWithAttrs(formEl, {class: 'invalid-feedback', 'data-ajax-errors': true}, 'p');\n formSettings.successContainerEl = formEl.querySelector(formSettings.successSelector || '[data-ajax-success]') || createElWithAttrs(formEl, {class: 'success-feedback', 'data-ajax-success': true}, 'p');\n\n //Define the content replacement strategy when the response provides HTML.\n //Types: 'update', 'replace', 'append'.\n //Default: 'update'.\n formSettings.activeDialog = dialog.getActive();\n formSettings.responseTargetStrategy = formSettings.responseTargetStrategy || 'update';\n formSettings.responseTargetEl = formSettings.responseTarget ? document.querySelector(formSettings.responseTarget) : (formSettings.activeDialog || formEl);\n\n publish(`${formSettings.formTriggerName}:submit`, {formEl, formData, evt});\n\n if (validateForm(formEl)) {\n if (formSettings.submittedAction && formSettings.submittedAction.name) {\n formData[formSettings.submittedAction.name] = formSettings.submittedAction.value;\n }\n\n progress.showLoader(formEl);\n\n _appendExternalData(formSettings, formData);\n _appendSubmittedActionData(formSettings.submittedAction, formData);\n\n InputFormat.sanitizeFormattedData(formEl, formData);\n\n //Checks if Google reCaptcha is enabled and requests a user score before proceeding to submit a form.\n if (window.SFRA.SitePreferences.enableGoogleRecaptcha) {\n let formNameForRecaptchaVerificationObj = window.SFRA.SitePreferences.formNameForRecaptchaVerification ? JSON.parse(window.SFRA.SitePreferences.formNameForRecaptchaVerification) : {};\n\n if (formEl.name && formNameForRecaptchaVerificationObj[formEl.name]) {\n return import('../helpers/reCaptcha.js').then(reCaptcha => {\n return reCaptcha.executeVerification().then(function(response) {\n if (response.token) {\n formData['gRecaptchaToken'] = response.token;\n return _requestFormSubmit(formEl, formData, formSettings);\n } else {\n return _handleFormSubmitError(formEl, formData, formSettings, response);\n }\n });\n });\n }\n }\n backInStockTracking(formEl);\n return _requestFormSubmit(formEl, formData, formSettings);\n } else {\n _handleTracking(formSettings, true);\n\n publish(`${formSettings.formTriggerName}:validationError`, {formEl, formData, evt});\n }\n}\n\n/**\n * Sets up a simple AJAX form handling. Depends on the controller to provide a valid JSON response.\n * Uses the 'data-ajax-form' attribute to select which forms will use this method.\n * @param {[type]} currentForm [description]\n */\nexport function setupAJAXForm(currentForm) {\n let formSettings = _getFormSettings(currentForm),\n submitSelector = formSettings.submitActionSelector || '[type=\"submit\"]',\n submitActionEvent = formSettings.submitActionEvent || 'click';\n\n addEventListenerList(currentForm.querySelectorAll(submitSelector), submitActionEvent, function(evt) {\n formSettings.submittedAction = this;\n\n if (this.type !== 'submit') {\n //Does not work on certain browsers (FireFox) that set an `isTrusted: false` property in the event.\n //dispatchEvent(currentForm, 'submit');\n //Instead, process the form directly:\n processAjaxForm(currentForm, formSettings, evt);\n }\n });\n\n currentForm.addEventListener((formSettings.event || 'submit'), function(evt) {\n evt.preventDefault();\n\n processAjaxForm(currentForm, formSettings, evt);\n });\n}\n\nexport function init(options) {\n callbackOnElements(options.elements, setupAJAXForm);\n}\n\nexport function backInStockTracking(formEl) {\n var trackingParams,\n trackingParamsObj;\n trackingParams = formEl.getAttribute('data-component-onclicktrackingparams-backinstock');\n if (trackingParams) {\n trackingParamsObj = JSON.parse(trackingParams);\n modules.tracking.init(null, {\n trackEvent: trackingParamsObj.trackEvent || 'virtualPageview',\n trackObject: trackingParamsObj.trackObject\n });\n }\n}\n","'use strict';\n\n/**\n * This class acts as a wrapper for your input formatter of choice.\n * Using Cleave.js in this case.\n */\n\nimport Cleave from 'cleave.js';\nimport {objectAssign} from '../helpers/utilities';\nimport {getQueryStringParams} from '../helpers/urlUtilities';\nimport {callbackOnElements} from '@borngroup/born-utilities';\n\nlet customBINs;\n\nconst Instances = [],\n CARD_TYPES = {\n visa: 'Visa',\n mastercard: 'Master Card',\n mada: 'Mada',\n amex: 'Amex',\n discover: 'Discover',\n unknown: 'Unknown',\n jcb: 'JCB'\n };\n\nexport default class InputFormat {\n constructor(inputs, options = {}) {\n this.options = options;\n\n callbackOnElements(inputs, this.setupFormatting.bind(this));\n }\n\n setupFormatting(currentInput) {\n let hasCustomSettings = currentInput.getAttribute('data-input-format'),\n currentInputSettings = objectAssign({}, this.options, hasCustomSettings ? JSON.parse(hasCustomSettings) : {}),\n inputFormat;\n\n if (!currentInput.hasAttribute('data-disable-formatting')) {\n if (currentInputSettings.creditCard) {\n //Retrieve the available custom BINs for later use.\n InputFormat.getCustomBINs();\n\n inputFormat = InputFormat.setupCreditCard(currentInput, currentInputSettings);\n } else if (currentInputSettings.phone) {\n inputFormat = InputFormat.setupPhone(currentInput, currentInputSettings);\n } else {\n inputFormat = InputFormat.setupInput(currentInput, currentInputSettings);\n }\n }\n\n if (inputFormat && !InputFormat.get(currentInput)) {\n Instances.push({input: currentInput, inputFormat});\n }\n\n currentInput.removeAttribute('data-input-format');\n currentInput.setAttribute('data-input-has-format', true);\n }\n\n /**\n * Returns the matched format object, where `referenceInput` is the element to be looked up.\n */\n static get(referenceInput) {\n for (let i = 0; i < Instances.length; i++) {\n if (Instances[i].input === referenceInput) {\n return Instances[i].inputFormat;\n }\n }\n }\n\n static getCustomBINs() {\n if (!customBINs && window.SFRA.SitePreferences.ckoEnabled) {\n return $.get(window.SFRA.Urls.customBINs, function(response) {\n customBINs = response.list;\n });\n }\n }\n\n static updateMatchingCardData(options) {\n // handling JCB creditcards starting with 33 because cleave.js not recognising this series\n let cardNumber = options.inputField.value.trim();\n let firstTwoDigits = cardNumber.substring(0, 2);\n if (options.type == 'unknown' && firstTwoDigits == '33') {\n options.type = 'jcb';\n }\n\n let cardTypeLabel = CARD_TYPES[Object.keys(CARD_TYPES).indexOf(options.type) > -1 ? options.type : 'unknown'];\n\n if (options.cardTypeContainer) {\n options.cardTypeContainer.setAttribute('data-type', options.type);\n }\n\n if (options.cardTypeInput) {\n options.cardTypeInput.value = cardTypeLabel;\n }\n\n if (options.cardCVVInput) {\n options.cardCVVInput.maxLength = options.type === 'amex' ? 4 : 3;\n }\n\n options.inputField.setAttribute('data-submit-format-raw', true);\n }\n\n static setupCreditCard(inputField, settings) {\n let formContainer = inputField.form || document,\n cardTypeContainer = formContainer.querySelector(settings.cardTypeContainer || '[data-card-type-container]'),\n cardTypeInput = formContainer.querySelector(settings.cardTypeInput || '[data-card-type-input]'),\n cardCVVInput = formContainer.querySelector(settings.cardCVVInput || '[data-card-cvv-input]');\n\n return new Cleave(inputField, {\n creditCard: true,\n onValueChanged: function(evt) {\n let cardValue = evt.target.rawValue.substring(0, 6),\n type = this.properties.creditCardType;\n\n if (cardValue.length >= 6 && customBINs && customBINs.mada && customBINs.mada.indexOf(cardValue) !== -1) {\n type = 'mada';\n }\n\n InputFormat.updateMatchingCardData({type, inputField, cardTypeContainer, cardTypeInput, cardCVVInput});\n },\n onCreditCardTypeChanged: function(type) {\n InputFormat.updateMatchingCardData({type, inputField, cardTypeContainer, cardTypeInput, cardCVVInput});\n }\n });\n }\n\n //import 'cleave.js/src/addons/phone-type-formatter.us.js';\n // static setupPhone(inputField, settings) {\n // let countrySelector = inputField.form ? inputField.form.querySelector('[name*=\"country\"]') : null,\n // selectedCountryCode = countrySelector ? countrySelector.value : 'US';\n\n // settings.phoneRegionCode = settings.phoneRegionCode || selectedCountryCode;\n\n // return new Cleave(inputField, settings);\n // }\n\n static setupInput(inputField, settings) {\n return new Cleave(inputField, settings);\n }\n\n static sanitizeFormattedData(formEl, formData, callback) {\n let dataIsSerialized = typeof formData === 'string',\n rawFormatInputs = formEl.querySelectorAll('[data-submit-format-raw]');\n\n //Convert `formData` to a literal for easy updating.\n formData = dataIsSerialized ? getQueryStringParams(formData) : formData;\n\n [].forEach.call(rawFormatInputs, function(currentInput) {\n formData[currentInput.name] = InputFormat.get(currentInput).getRawValue();\n });\n\n //Reset `formData` to its original format.\n formData = dataIsSerialized ? $.param(formData) : formData;\n\n if (typeof callback === 'function') {\n callback(formData);\n }\n\n return formData;\n }\n}\n","/**\n * WINDOW SCROLL MODULE\n *\n * This module scrolls the window to a target via a click on an element with a [data-window-scroll] property.\n *\n * @param {[Object]} data-window-scroll\n * [\n * target: [Required] HTML Element. Element to scroll to.\n * offset: [Optional] Number | HTML Element. If parameter is a number, then the number will used for offset. If it is a HTML Element, than the offsetHeight of the element will be used.\n * duration: [Optional] Number. Duration of the scroll.\n * callback: [Optional] Function. This is called once the scroll is complete.\n * ]\n */\n\nimport { callbackOnElements, scrollToPosition } from '@borngroup/born-utilities';\nimport { breakpointRanges } from '../helpers/utilities';\n\nexport default class WindowScroll {\n constructor( query ) {\n callbackOnElements(query, this.setupWindowScroll.bind(this));\n\n this.breakpoints = breakpointRanges;\n }\n\n static setupScroll(destination, duration = 350, manualOffset = 0, callback, containerEl) {\n let scrollContainer = typeof containerEl === 'string' ? document.querySelector(containerEl) : containerEl,\n scrollOptions = {\n easings: {\n easeOutCubic(t) {\n return (--t) * t * t + 1;\n }\n },\n startPosition: WindowScroll.getScrollPosition(scrollContainer),\n startTime: 'now' in window.performance ? performance.now() : new Date().getTime(),\n duration: duration,\n destinationPosition: scrollToPosition(destination, manualOffset, scrollContainer),\n callback: callback || function() {\n return true;\n }\n };\n\n if ('requestAnimationFrame' in window === false) {\n (scrollContainer || window).scroll(0, scrollOptions.destinationPosition);\n\n if (typeof callback === 'function') {\n callback(scrollOptions);\n }\n\n return;\n }\n\n WindowScroll.easeScroll(scrollContainer, scrollOptions);\n }\n\n static getScrollPosition(scrollContainer) {\n return scrollContainer ? scrollContainer.scrollTop : window.pageYOffset;\n }\n\n static easeScroll(scrollContainer, scrollOptions) {\n let now = 'now' in window.performance ? performance.now() : new Date().getTime(),\n elapsedTime = now - scrollOptions.startTime,\n time = Math.min(1, (elapsedTime / scrollOptions.duration)),\n timeFunction = scrollOptions.easings['easeOutCubic'](time),\n currentScrollPos;\n\n (scrollContainer || window).scroll(0, Math.ceil((timeFunction * (scrollOptions.destinationPosition - scrollOptions.startPosition)) + scrollOptions.startPosition));\n\n currentScrollPos = WindowScroll.getScrollPosition(scrollContainer);\n\n //Check for both the elapsed time and the current position.\n //If either matches, stop the scrolling function.\n if (currentScrollPos === scrollOptions.destinationPosition || elapsedTime >= scrollOptions.duration) {\n scrollOptions.callback();\n\n return;\n }\n\n window.requestAnimationFrame(WindowScroll.easeScroll.bind(this, scrollContainer, scrollOptions));\n }\n\n isEnabled(breakpointName) {\n let matchedBreakpoint = this.breakpoints[breakpointName];\n\n return matchedBreakpoint && (!matchedBreakpoint.min || document.body.offsetWidth >= matchedBreakpoint.min) && (!matchedBreakpoint.max || document.body.offsetWidth <= matchedBreakpoint.max);\n }\n\n getOffsetValue(offsetMatch) {\n return offsetMatch instanceof HTMLElement ? offsetMatch.getBoundingClientRect().height : (offsetMatch || 0);\n }\n\n bindEvents(el) {\n let settings = JSON.parse( el.getAttribute( 'data-window-scroll' ) );\n\n el.addEventListener('click', function() {\n let enabled = settings.hasOwnProperty('enabled') ? this.isEnabled.call(this, settings.enabled) : true,\n delay = settings.delay || 0;\n\n window.setTimeout(function() {\n if (enabled && !(el.disabled || el.classList.contains('disabled'))) {\n WindowScroll.setupScroll(settings.target, settings.duration, settings.offset, null, settings.scrollContainer);\n }\n }, delay);\n }.bind(this));\n\n el.removeAttribute('data-window-scroll');\n }\n\n setupWindowScroll(el) {\n this.bindEvents(el);\n }\n}\n"],"sourceRoot":""}