{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/app_project/cartridge/client/default/js/components/spinner.js","webpack:///./cartridges/app_project/cartridge/client/default/js/profile/profileSFSC.js","webpack:///./cartridges/app_project/cartridge/client/default/js/components/formValidation.js","webpack:///./cartridges/int_mf_tealium/cartridge/client/default/js/tealiumEvents.js","webpack:///./cartridges/app_project/cartridge/client/default/js/components/clientSideValidation.js","webpack:///./cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack:///./cartridges/app_project_margiela/cartridge/client/default/js/registration.js","webpack:///./cartridges/app_project_margiela/cartridge/client/default/js/registration/registration.js","webpack:///./node_modules/vanillajs-datepicker/js/lib/utils.js","webpack:///./node_modules/vanillajs-datepicker/js/lib/date.js","webpack:///./node_modules/vanillajs-datepicker/js/lib/date-format.js","webpack:///./node_modules/vanillajs-datepicker/js/lib/event.js","webpack:///./node_modules/vanillajs-datepicker/js/i18n/base-locales.js","webpack:///./node_modules/vanillajs-datepicker/js/options/defaultOptions.js","webpack:///./node_modules/vanillajs-datepicker/js/lib/dom.js","webpack:///./node_modules/vanillajs-datepicker/js/options/processOptions.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/templates/pickerTemplate.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/templates/daysTemplate.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/templates/calendarWeeksTemplate.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/views/View.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/views/DaysView.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/views/MonthsView.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/views/YearsView.js","webpack:///./node_modules/vanillajs-datepicker/js/events/functions.js","webpack:///./node_modules/vanillajs-datepicker/js/events/pickerListeners.js","webpack:///./node_modules/vanillajs-datepicker/js/picker/Picker.js","webpack:///./node_modules/vanillajs-datepicker/js/events/inputFieldListeners.js","webpack:///./node_modules/vanillajs-datepicker/js/events/otherListeners.js","webpack:///./node_modules/vanillajs-datepicker/js/Datepicker.js","webpack:///./cartridges/app_project/cartridge/client/default/js/datepicker.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","$","fn","spinner","$element","this","start","length","stop","fillDropdowns","data","isCountryTrigger","$provinces","empty","provinces","provinceName","append","provinceID","$languages","selectedLanguage","val","languages","languageID","languageName","$languageGroup","addClass","removeClass","$cities","cities","cityID","cityName","handleSelectedDropdowns","$countryDropdown","$provinceDropdown","on","selectedCountry","url","dataset","ajax","type","country","success","error","selectedProvince","province","isMargiela","document","body","sitebrand","formElement","payload","find","remove","fields","keys","forEach","feedbackElement","parent","children","Array","isArray","html","join","siblings","form","prop","parents","content","attr","before","prepend","$body","$document","utagExists","utag","refreshCartData","window","sfcc_urls","refresh_utag_basket","location","href","indexOf","method","dataType","copyResponseData","err","console","log","getParameterByName","paramName","replace","results","RegExp","exec","decodeURIComponent","getVariationValue","variationAttributes","id","result","variation","filter","attributeId","selected","values","addProductData","page_type","product_id","utag_data","product_name","product_season","product_newin","product_category","product_color","product_waist","product_length","product_size","product_unit_price","product_old_price","product_sale_price","product_net_price","addCartData","product_quantity","product_shipping_type","order_currency","order_track_id","response","utagData","newsletterEventTrigger","gender","page_name","store_country","event_name","link","ready","trigger","loadMoreProduct","nodeList","arrayValue","replaceAll","split","original","mergedArray","concat","item","index","concatUtagValues","querySelectorAll","pageNewsletter","text","trim","genders","isMultipleGender","g","push","innerText","footerNewsletter","video","$video","video_title","video_time","currentTime","track","duration","PLPUpdateData","e","activePLP","active_plp","PDPUpdateData","activePDP","product","active_pdp","product_sku","addToCart","page_context_type","addAllProductsFromWishList","backInStock","PDPAddToWishlist","productSetIDs","pid","storeLocatorFind","storeLocatorMyLocation","filters","detail","pmin","pmax","subArray","j","checkoutStages","step","stage","page_name_onload","login","register","fastCheckout","event","cartType","buttonPosition","cart_type","cartModifyModalOpen","cartModifyModalConfirm","cartRemoveProduct","cartMoveToPickup","cartShipItem","cartStoreDialogOpen","cartStoreChanged","helpOrderDetails","view","createReturnSteps","params","product_return_type","types","orderID","URL","searchParams","updateCustomerAttributes","customerProfileAttributes","updateCartAndWishlist","persist_wishlist","total_with_vat","currency","persist_cart","total_without_vat","jQuery","setListViewType","click","viewType","list_view_type","searchOpen","searchTypeKeyword","names","skus","suggestions","productName","searchProductClick","currentTarget","ariaLabel","sku","searchSend","searchResultsPage","formCleared","triggerEdgeValidation","input","nextElementSibling","classList","contains","toggle","scrollToError","$form","animate","scrollTop","first","offset","top","focus","validateReCaptcha","$response","valid","toggleClass","validateForm","checkValidity","preventDefault","stopPropagation","stopImmediatePropagation","each","validity","clearFormErrors","jquery","attachNoBubbleEvents","attachTimeout","off","setCustomValidity","fieldMessages","formValidationMessages","validationMessage","clearTimeout","setTimeout","clearFormFieldErrors","noBubbleEvents","init","additionalMessagesStr","additionalMessages","JSON","parse","warn","$formMessages","extend","submit","buttonClick","focusOut","$this","target","blur","cleanString","onChange","handleDateChange","scrollOnError","updatePostalCodePattern","postalCodeElementID","$postalCode","closest","postalCodeRegexp","defaults","at","be","bg","dk","gr","hu","lv","lt","lu","nl","no","pl","pt","ro","ru","sk","si","es","se","ch","gb","us","ca","cz","countryCode","toLowerCase","regexp","toString","slice","reCaptchaOnChange","functions","reAttachNoBubbleEvents","include","processInclude","formValidation","clientSideValidation","$registrationForm","post","serialize","redirectUrl","responseJSON","slideToggle","handlePopups","$aTag","relatedTarget","$relevantSelector","scrollIntoView","datePickerKeyboardNav","activeElement","$datepicker","css","passwordDinamicValidation","emailInput","test","hasProperty","obj","lastItemOf","arr","pushUnique","items","includes","stringToArray","str","separator","isInRange","testVal","min","max","undefined","limitToRange","createTagRepeat","tagName","repeat","attributes","reduce","src","next","optimizeTemplateHTML","stripTime","timeValue","Date","setHours","today","dateValue","args","newDate","setFullYear","addDays","date","amount","setDate","getDate","addMonths","monthsToSet","getMonth","expectedMonth","time","setMonth","addYears","getFullYear","dayDiff","day","from","dayOfTheWeekOf","baseDate","dayOfWeek","weekStart","baseDay","getDay","startOfYearPeriod","years","year","Math","floor","reFormatTokens","reNonDateParts","knownFormats","parseFns","y","parseInt","month","locale","monthIndex","isNaN","NaN","monthName","compareNames","startsWith","monthsShort","findIndex","months","normalizeMonth","getTime","formatFns","dd","padZero","D","daysShort","DD","days","mm","M","MM","yy","yyyy","num","padStart","parseFormatString","format","Error","separators","parts","match","partFormatters","map","token","partParserKeys","part","dateStr","dateParts","dtParts","origDate","formatter","parseDate","toValue","parser","formatDate","dateObj","toDisplay","listenerRegistry","WeakMap","addEventListener","removeEventListener","EventTarget","registerListeners","keyObj","listeners","registered","set","listener","unregisterListeners","delete","Event","composedPath","getComposedPath","node","path","parentNode","host","defaultView","findElementInEventPath","ev","selector","criteria","el","matches","findFromPath","parentElement","en","daysMin","clear","titleFormat","autohide","beforeShowDay","beforeShowDecade","beforeShowMonth","beforeShowYear","calendarWeeks","clearBtn","dateDelimiter","datesDisabled","daysOfWeekDisabled","daysOfWeekHighlighted","defaultViewDate","disableTouchKeyboard","language","maxDate","maxNumberOfDates","maxView","minDate","nextArrow","orientation","pickLevel","prevArrow","showDaysOfWeek","showOnClick","showOnFocus","startView","title","todayBtn","todayBtnMode","todayHighlight","updateOnBlur","createRange","parseHTML","createContextualFragment","hideElement","style","display","styleDisplay","showElement","emptyChildNodes","firstChild","removeChild","defaultLang","defaultFormat","defaultWeekStart","sanitizeDOW","dow","calcEndOfWeek","startOfWeek","validateDate","origValue","validateViewId","viewId","processOptions","options","datepicker","inOpts","assign","config","locales","constructor","lang","origLocale","weekEnd","hasToDisplay","hasToValue","validFormatString","minDt","maxDt","dates","dt","viewDate","wkStart","Number","multidate","String","newPickLevel","newMaxView","newStartView","childNodes","x","class","picker","element","isMinView","setOptions","updateFocus","updateSelection","current","beforeShow","enabled","classes","add","disabled","extraClasses","newChildNodes","DocumentFragment","appendChild","replaceChildNodes","super","cellClass","onConstruction","inner","grid","lastChild","updateDOW","dayNames","switchLabelFormat","weeksElem","weeks","insertBefore","textContent","className","viewYear","viewMonth","firstOfMonth","last","focused","rangepicker","range","switchLabel","setViewSwitchLabel","setPrevBtnDisabled","setNextBtnDisabled","thuOfTheWeek","firstThu","round","getWeek","rangeStart","rangeEnd","performBeforeHook","computeMonthRange","thisYear","startY","startM","endY","endM","ix","monthNames","minYear","minMonth","minDateObj","maxYear","maxMonth","maxDateObj","yrOutOfRange","isMinYear","isMaxYear","word","navStep","beforeShowOption","toUpperCase","triggerDatepickerEvent","currentView","dispatchEvent","CustomEvent","goToPrevOrNext","direction","newViewDate","changeFocus","render","switchView","changeView","unfocus","update","refresh","hide","goToSelectedMonthOrYear","selection","onClickTodayBtn","currentDate","onClickClearBtn","onClickViewSwitch","onClickPrevBtn","onClickNextBtn","onClickView","onClickPicker","inline","inputField","processPickerOptions","controls","prevBtn","cloneNode","nextBtn","computeResetViewDate","setViewDate","oldViewDate","getTextDirection","getComputedStyle","template","buttonClass","header","main","footer","firstElementChild","viewSwitch","lastElementChild","elementClass","capture","views","container","active","inputDirection","dir","removeAttribute","place","exitEditMode","width","calendarWidth","height","calendarHeight","getBoundingClientRect","left","containerLeft","containerTop","containerWidth","inputLeft","inputTop","inputWidth","inputHeight","orientX","orientY","scrollY","scrollX","labelText","oldView","newView","_renderMethod","replaceChild","quickRender","renderMethod","moveByArrowKey","vertical","addFn","testFn","ctrlKey","metaKey","findNextAvailableOne","increase","onKeydown","editMode","shiftKey","enterEditMode","show","onFocus","_showing","onMousedown","_active","_clicking","onClickInput","onPaste","clipboardData","onClickOutside","pickerElem","stringifyDates","processInputDates","inputDates","origDates","datepickers","newDates","refreshUI","_options","initialDates","querySelector","inputs","inputDateValues","onMousedownDocument","newOptions","detach","callback","opts","lastArg","pop","forceRender","inputElement","datepickerDefault","milliseconds","now","nowTime","currentConfig"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,S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Q,QAAUwQ,SACrBJ,GAAaruB,QAAQuuB,aAE9B,MAAMG,EAAgB,IAAKJ,KAAsBD,GAAaruB,SAC9DquB,GAAa3N,WAAa,IAAI,GAAW2N,GAAcK","file":"app_project_margiela/cartridge/static/default/js/registration.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 543);\n","'use strict';\n\n/**\n * Show a spinner inside a given element\n * @param {element} $target - Element to block by the veil and spinner.\n * Pass body to block the whole page.\n */\nfunction addSpinner($target) {\n let $veil = $('
');\n $veil.append('
');\n if ($target.get(0).tagName === 'IMG') {\n $target.after($veil);\n $veil.css({ width: $target.width(), height: $target.height() });\n if ($target.parent().css('position') === 'static') {\n $target.parent().css('position', 'relative');\n }\n } else {\n $target.append($veil);\n if ($target.css('position') === 'static') {\n $target.parent().css('position', 'relative');\n $target.parent().addClass('veiled');\n }\n if ($target.get(0).tagName === 'BODY') {\n $veil.find('.spinner').css('position', 'fixed');\n }\n }\n $veil.click(function (e) {\n e.stopPropagation();\n });\n}\n\n/**\n * Remove existing spinner\n * @param {element} $veil - jQuery pointer to the veil element\n */\nfunction removeSpinner($veil) {\n if ($veil.parent().hasClass('veiled')) {\n $veil.parent().css('position', '');\n $veil.parent().removeClass('veiled');\n }\n $veil.off('click');\n $veil.remove();\n}\n\n// element level spinner:\n$.fn.spinner = function () {\n let $element = $(this);\n let Fn = function () {\n this.start = function () {\n if ($element.length) {\n // remove default spinner test IBT-1180\n // addSpinner($element);\n }\n };\n this.stop = function () {\n if ($element.length) {\n // remove default spinner test IBT-1180\n // let $veil = $('.veil');\n // removeSpinner($veil);\n }\n };\n };\n return new Fn();\n};\n\n// page-level spinner:\n$.spinner = function () {\n let Fn = function () {\n this.start = function () {\n // remove default spinner test IBT-1180\n // addSpinner($('body'));\n };\n this.stop = function () {\n // remove default spinner test IBT-1180\n // removeSpinner($('.veil'));\n };\n };\n return new Fn();\n};\n","'use strict';\n\n/**\n * Fill the dropdowns for country, province, city and language based on the already selected values.\n * If country is selected, province and languages are updated and cities are cleared.\n * If province is selected cities are updated.\n *\n * @param {Object} data - the retrieved data from back-end\n * @param {boolean} isCountryTrigger - identify which dropdown triggers the data fetch\n */\nfunction fillDropdowns(data, isCountryTrigger) {\n const $provinces = $('.js_sfsc-provinces');\n if (isCountryTrigger) {\n $provinces.empty();\n for (let i = 0; i < data.provinces.length; i++) {\n // IBT-4751\n if (data.provinces[i].provinceName !== 'MISSING COUNTY') {\n $provinces.append('');\n }\n }\n\n const $languages = $('.js_sfsc-languages');\n const selectedLanguage = $languages.val();\n $languages.empty();\n for (let i = 0; i < data.languages.length; i++) {\n $languages.append(\n ''\n );\n }\n const $languageGroup = $('.js_sfsc-language-group');\n if (data.languages.length <= 2) {\n $languageGroup.addClass('d-none');\n } else {\n $languageGroup.removeClass('d-none');\n }\n }\n\n const $cities = $('.js_sfsc-cities');\n $cities.empty();\n for (let i = 0; i < data.cities.length; i++) {\n $cities.append('');\n }\n}\n\nmodule.exports = {\n handleSelectedDropdowns: function () {\n const $countryDropdown = $('.js_sfsc-countries');\n const $provinceDropdown = $('.js_sfsc-provinces');\n $countryDropdown.on('change', function () {\n const selectedCountry = $countryDropdown.val();\n const url = this.dataset.url;\n $.spinner().start();\n $.ajax({\n type: 'GET',\n url: url,\n data: {\n country: selectedCountry,\n },\n success: function success(data) {\n $.spinner().stop();\n fillDropdowns(data, true);\n },\n error: function error() {\n $.spinner().stop();\n },\n });\n });\n $provinceDropdown.on('change', function () {\n const selectedCountry = $countryDropdown.val();\n const selectedProvince = $provinceDropdown.val();\n const url = this.dataset.url;\n $.spinner().start();\n $.ajax({\n type: 'GET',\n url: url,\n data: {\n country: selectedCountry,\n province: selectedProvince,\n },\n success: function success(data) {\n $.spinner().stop();\n fillDropdowns(data, false);\n },\n error: function error() {\n $.spinner().stop();\n },\n });\n });\n },\n};\n","'use strict';\n\nconst isMargiela = document.body.dataset.sitebrand === \"Margiela\";\n\n/**\n * Remove all validation. Should be called every time before revalidating form\n * @param {element} form - Form to be cleared\n * @returns {void}\n */\nfunction clearFormErrors(form) {\n $(form).find('.form-control.is-invalid').removeClass('is-invalid');\n}\n\nmodule.exports = function (formElement, payload) {\n // clear form validation first\n clearFormErrors(formElement);\n $('.alert', formElement).remove();\n\n if (typeof payload === 'object' && payload.fields) {\n Object.keys(payload.fields).forEach(function (key) {\n if (payload.fields[key]) {\n let feedbackElement = $(formElement)\n .find('[name=\"' + key + '\"]')\n .parent()\n .children('.invalid-feedback');\n\n if (feedbackElement.length > 0) {\n if (Array.isArray(payload[key])) {\n feedbackElement.html(payload.fields[key].join('
'));\n } else {\n feedbackElement.html(payload.fields[key]);\n }\n feedbackElement.siblings('.form-control').addClass('is-invalid');\n }\n }\n });\n }\n if (payload && payload.error) {\n let form = $(formElement).prop('tagName') === 'FORM' ? $(formElement) : $(formElement).parents('form');\n const content = '
' + payload.error.join('
') + '
';\n if (isMargiela && form.attr('name') === 'login-form') {\n form.find('.remember-me-section').before(content);\n } else {\n form.prepend(content);\n }\n }\n};\n","'use strict';\n\nconst delimiter = ':';\nconst $body = $('body');\nconst $document = $(document);\n\n$document.ready(function(){\n $body.trigger('tealiumEvents:loaded');\n});\n\nfunction utagExists(){\n return typeof utag !== 'undefined';\n}\n\n/**\n* Gets a parameter from a link or from [window.location.href]\n*/\nfunction refreshCartData() {\n const url = window.sfcc_urls.refresh_utag_basket;\n\n if (window.location.href.indexOf('Order-ReturnConfirmation') > 0) {\n return;\n }\n\n $.ajax({\n url: url,\n method: 'GET',\n dataType: 'json',\n success: function(data) {\n copyResponseData(data);\n },\n error: function(err) {\n console.log('error refreshing utag', err);\n }\n });\n}\n\n/**\n* Gets a parameter from a link or from [window.location.href]\n* @param {string} paramName - the parameter name\n* @param {string} url - [window.location.href] or equivalent\n* @returns {string} the parameter value or [null]\n*/\nfunction getParameterByName(paramName, url = window.location.href) {\n const name = paramName.replace(/[[\\]]/g, '\\\\$&');\n const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');\n const results = regex.exec(url);\n if (!results) return null;\n if (!results[2]) return '';\n return decodeURIComponent(results[2].replace(/\\+/g, ' '));\n}\n\n/**\n* Get selected variation value by variation id\n* @param {Object} variationAttributes - variation attributes model from backend\n* @param {string} id - variation id\n* @returns {string} the id of the variation value or empty string\n*/\nfunction getVariationValue(variationAttributes, id) {\n let result = '';\n\n if (variationAttributes instanceof Array) {\n const variation = variationAttributes.filter((i) => i.attributeId === id);\n\n if (variation && variation.length) {\n const selected = variation[0].values.filter((i) => i.selected === true);\n if (selected && selected.length) result = selected[0].id;\n }\n }\n\n return result;\n}\n\n/**\n* Use the existing data from the [utag_data] object to fill [utag.data] with product data on PDP\n*/\nfunction addProductData() {\n utag.data.page_type = 'product';\n utag.data.product_id = utag_data.product_id;\n utag.data.product_name = utag_data.product_name;\n utag.data.product_season = utag_data.product_season;\n utag.data.product_newin = utag_data.product_newin;\n utag.data.product_category = utag_data.product_category;\n utag.data.product_color = utag_data.product_color;\n utag.data.product_waist = utag_data.product_waist;\n utag.data.product_length = utag_data.product_length;\n utag.data.product_size = utag_data.product_size;\n utag.data.product_unit_price = utag_data.product_unit_price;\n utag.data.product_old_price = utag_data.product_old_price;\n utag.data.product_sale_price = utag_data.product_sale_price;\n utag.data.product_net_price = utag_data.product_net_price;\n}\n\n/**\n* Use the existing data from the [utag_data] object to fill [utag.data] with product data on Cart/Checkout\n*/\nfunction addCartData() {\n utag.data.page_type = 'checkout';\n utag.data.product_id = utag_data.product_id;\n utag.data.product_name = utag_data.product_name;\n utag.data.product_season = utag_data.product_season;\n utag.data.product_newin = utag_data.product_newin;\n utag.data.product_category = utag_data.product_category;\n utag.data.product_color = utag_data.product_color;\n utag.data.product_waist = utag_data.product_waist;\n utag.data.product_length = utag_data.product_length;\n utag.data.product_size = utag_data.product_size;\n utag.data.product_unit_price = utag_data.product_unit_price;\n utag.data.product_old_price = utag_data.product_old_price;\n utag.data.product_sale_price = utag_data.product_sale_price;\n utag.data.product_net_price = utag_data.product_net_price;\n utag.data.product_quantity = utag_data.product_quantity;\n utag.data.product_shipping_type = utag_data.product_shipping_type;\n utag.data.order_currency = utag_data.order_currency;\n\n if (utag_data.order_track_id) {\n utag.data.order_track_id = utag_data.order_track_id;\n }\n}\n\n/**\n * Copies the `utagData` object values to the current utag data object\n * @param {Object} response - the response object from the server that contains a `utagData` object\n */\nfunction copyResponseData(response) {\n if (!response) return;\n\n for (const key in response.utagData) { // eslint-disable-line no-restricted-syntax\n if (response.utagData.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins\n utag.data[key] = response.utagData[key];\n }\n }\n}\n\nfunction concatUtagValues(nodeList, key){\n for (let i = 0; i < nodeList.length; i++) {\n var value = nodeList[i].value;\n var arrayValue = value.replaceAll('[','').replaceAll(']','').replaceAll(' ','').split(',');\n var original = utag.data[key];\n\n if(original) {\n let mergedArray = original.concat(arrayValue);\n mergedArray = mergedArray.filter((item,index) => {\n return (mergedArray.indexOf(item) == index);\n }); \n utag.data[key] = mergedArray;\n }\n }\n}\n\nfunction newsletterEventTrigger(gender) {\n\n if (!gender) gender = '';\n\n utag.data.page_type = 'newsletter';\n utag.data.page_name = utag_data.store_country + delimiter + 'myaccount' + delimiter + 'newsletter_subscription';\n utag.data.event_name = 'newsletter_subscription_' + gender;\n utag.link(utag.data);\n}\n\nmodule.exports = {\n loadMoreProduct: function(){\n $body.on('product:listing-show-more', function(){\n var utag_product_id = document.querySelectorAll('[name=\"utag_product_id\"]');\n \n concatUtagValues(utag_product_id, 'product_id');\n });\n },\n\n pageNewsletter: function() {\n $body.on('newsletter:submit', function() {\n if (typeof utag === 'undefined' || !utag) return;\n const $form = $('.page-newsletter .form-newsletter');\n \n $form.find('.gender-check:checked +.checkbox-label').text().trim();\n let genders = [];\n let gender;\n let isMultipleGender = false;\n document.querySelectorAll('.gender-check:checked + .checkbox-label').forEach(g => {\n genders.push(g.innerText);\n isMultipleGender = genders.length > 1;\n });\n gender = isMultipleGender ? 'Both' : genders[0];\n newsletterEventTrigger(gender);\n });\n },\n\n footerNewsletter: function() {\n $body.on('click', 'footer .form-newsletter [type=\"submit\"]', function() {\n if (typeof utag === 'undefined' || !utag) return;\n const $form = $('footer .form-newsletter');\n const gender = $form.find('[name=\"gender-radio\"]:checked').val(); \n newsletterEventTrigger(gender);\n });\n },\n\n video: function() {\n const $video = $('video');\n\n $video.on('pause', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n utag.data.video_title = $(this).find('source').attr('src');\n utag.data.video_time = this.currentTime;\n utag.data.event_name = 'video_pause';\n utag.track('video', utag.data);\n });\n\n $video.on('loadeddata', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n utag.data.video_title = $(this).find('source').attr('src');\n utag.data.video_time = this.duration;\n utag.data.event_name = 'video_open';\n utag.track('video', utag.data);\n });\n\n $video.on('play', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n utag.data.video_title = $(this).find('source').attr('src');\n utag.data.video_time = this.currentTime;\n\n if (this.currentTime > 0) {\n utag.data.event_name = 'video_play';\n } else {\n utag.data.event_name = 'video_start';\n }\n\n utag.track('video', utag.data);\n });\n },\n\n PLPUpdateData: function() {\n // Update data for future events\n $body.on('plp:plpPageLoad', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n\n\n var activePLP = 'old';\n\n if ($('.new-page-search-result').length > 0) {\n activePLP = 'new';\n }\n\n utag_data.active_plp = activePLP;\n });\n },\n\n PDPUpdateData: function() {\n // Update data for future events\n $body.on('product:afterAttributeSelect', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n\n\n var activePDP = 'old';\n\n if ($('.pdp-new').length > 0) {\n activePDP = 'new';\n }\n\n const product = response.data.product;\n utag_data.active_pdp = activePDP;\n utag_data.product_sku = [product.id];\n utag_data.product_color = [getVariationValue(product.variationAttributes, 'color')];\n utag_data.product_waist = [getVariationValue(product.variationAttributes, 'waist')];\n utag_data.product_length = [getVariationValue(product.variationAttributes, 'length')];\n utag_data.product_size = [getVariationValue(product.variationAttributes, 'size')];\n });\n },\n\n addToCart: function() {\n $body.on('product:afterAddToCart', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n addProductData();\n\n\n\n var activePDP = 'old';\n\n if ($('.pdp-new').length > 0) {\n activePDP = 'new';\n }\n utag_data.active_pdp = activePDP;\n\n if (utag_data.page_context_type === 'product') {\n utag.data.event_name = 'pdp_cart_add';\n } else if (response.addAllProductsFromWishList) {\n utag.data.event_name = 'cart_add_wishlist_full';\n } else if (utag_data.page_context_type === 'myaccount') {\n utag.data.event_name = 'cart_add_wishlist_prod';\n } else {\n utag.data.event_name = utag_data.page_type + 'pdp_cart_add';\n }\n\n utag.link(utag.data);\n });\n },\n\n backInStock: function() {\n $body.on('product:afterBackInStock', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n addProductData();\n var activePDP = 'old';\n\n if ($('.pdp-new').length > 0) {\n activePDP = 'new';\n }\n utag_data.active_pdp = activePDP;\n\n utag.data.event_name = 'pdp_backinstock';\n\n utag.link(utag.data);\n });\n },\n\n PDPAddToWishlist: function() {\n $body.on('product:afterAddToWishlist', function() {\n if (typeof utag === 'undefined' || !utag || !utag_data.page_context_type === 'product') return;\n\n addProductData();\n var activePDP = 'old';\n if (utag_data.page_context_type == \"product set\") {\n var productSetIDs = [''];\n for (i = 0 ; i < $('.product-set-item').length; i++) {\n if (i +1 < $('.product-set-item').length) {\n productSetIDs[0] += $('.product-set-item')[i].dataset.pid + ', ';\n } else {\n productSetIDs[0] += $('.product-set-item')[i].dataset.pid;\n }\n }\n utag.data.product_id = productSetIDs;\n utag.data.page_type = 'product set';\n }\n if ($('.pdp-new').length > 0) {\n activePDP = 'new';\n }\n utag_data.active_pdp = activePDP;\n utag.data.event_name = 'pdp_wishlist_add';\n utag.link(utag.data);\n });\n },\n\n storeLocatorFind: function() {\n $body.on('store:MyLocation', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n utag.data.page_type = 'store locator';\n utag.data.page_name = utag.data.page_name + ':my location';\n utag.data.event_name = 'storelocator_mylocation';\n utag.link(utag.data);\n });\n },\n\n storeLocatorMyLocation: function() {\n $body.on('store:Search', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n utag.data.page_type = 'store locator';\n utag.data.page_name = utag.data.page_name + ':search location';\n utag.data.event_name = 'storelocator_search';\n utag.link(utag.data);\n });\n },\n\n filters: function() {\n $document.on('appliedFilter', function(e) {\n\n var url;\n if (typeof utag === 'undefined' || !utag) {return;} \n \n if (typeof e.url !== 'undefined' && e.url) {\n url = e.url;\n };\n\n if (!url) {\n url = (e.detail && e.detail.url) ? e.detail.url : null; \n }\n\n if (!url){\n return;\n }\n\n const result = [];\n\n const pmin = getParameterByName('pmin', url);\n const pmax = getParameterByName('pmax', url);\n\n if (pmin && pmax) {\n result.push('price' + delimiter + pmin + ' to ' + pmax);\n }\n\n let i = 1;\n let name = getParameterByName('prefn' + i, url);\n let value;\n let subArray;\n\n while (name) {\n value = getParameterByName('prefv' + i, url);\n name = name.replace('refinement', '');\n\n if (value.indexOf('|') > -1) { // Multiple values for this preference\n subArray = value.split('|');\n\n for (let j = 0; j < subArray.length; j++) {\n result.push(name + delimiter + subArray[j]);\n }\n } else { // Single value for this preference\n result.push(name + delimiter + value);\n }\n\n i++;\n name = getParameterByName('prefn' + i, e.url);\n }\n\n if (result.length > 0) {\n utag.data.filter = result;\n utag.data.event_name = 'filter_usage';\n utag.link(utag.data);\n }\n });\n },\n\n checkoutStages: function() {\n $body.on('checkout:stageGoTo checkout:updatedCheckoutView', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n let step = '';\n const stage = $('#checkout-main').attr('data-checkout-stage');\n\n if (stage === 'shipping') {\n step = 'step1';\n } else if (stage === 'payment') {\n step = 'step2';\n } else if (stage === 'placeOrder') {\n step = 'step3';\n }\n\n utag.data.page_name = utag_data.page_name_onload.replace(/step\\d/gi, step);\n utag.link(utag.data);\n });\n },\n\n login: function() {\n $body.on('user:loggedIn', function() {\n if (typeof utag === 'undefined' || !utag) return;\n utag.data.event_name = 'login_ok';\n utag.link(utag.data);\n });\n },\n\n register: function() {\n $body.on('user:registered', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n utag.data.event_name = 'registration_ok';\n utag.link(utag.data);\n });\n },\n\n fastCheckout: function() {\n $body.on('checkout:fastCheckoutStart', function(event, cartType, buttonPosition) {\n if (typeof utag === 'undefined' || !utag) return;\n\n if(typeof cartType !== 'undefined' && typeof buttonPosition !== 'undefined') {\n utag.data.cart_type = cartType + ':' + buttonPosition;\n }\n utag.data.event_name = 'fastcheckout_start';\n utag.link(utag.data);\n });\n },\n\n cartModifyModalOpen: function() {\n $body.on('cart:modifyProductOpen', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n addCartData();\n utag.data.event_name = 'cart_prod_update_popup';\n utag.link(utag.data);\n });\n },\n\n cartModifyModalConfirm: function() {\n $body.on('cart:productModified', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n copyResponseData(response);\n\n utag.data.page_type = 'checkout';\n utag.data.event_name = 'cart_prod_update_confirm';\n utag.link(utag.data);\n\n refreshCartData();\n });\n },\n\n cartRemoveProduct: function() {\n $body.on('cart:productRemoved', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n copyResponseData(response);\n\n utag.data.page_type = 'checkout';\n utag.data.event_name = 'cart_prod_update';\n utag.link(utag.data);\n\n refreshCartData();\n });\n },\n\n cartMoveToPickup: function() {\n $body.on('cart:pickUpItem', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n copyResponseData(response);\n\n utag.data.page_type = 'checkout';\n utag.data.event_name = 'cart_moveto_pickup';\n utag.link(utag.data);\n\n refreshCartData();\n });\n },\n\n cartShipItem: function() {\n $body.on('cart:shipItem', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n copyResponseData(response);\n\n utag.data.page_type = 'checkout';\n utag.data.event_name = 'cart_moveto_shipping';\n utag.link(utag.data);\n\n refreshCartData();\n });\n },\n\n cartStoreDialogOpen: function() {\n $body.on('findInStore:open', function() {\n if (typeof utag === 'undefined' || !utag) return;\n if ($('.page').data('action') !== 'Cart-Show') return;\n\n addCartData();\n\n utag.data.page_type = 'checkout';\n utag.data.event_name = 'cart_store_detail_popup';\n utag.link(utag.data);\n });\n },\n\n cartStoreChanged: function() {\n $body.on('cart:storeChanged', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n copyResponseData(response);\n\n utag.data.page_type = 'checkout';\n utag.data.event_name = 'cart_store_detail_change';\n utag.link(utag.data);\n });\n },\n\n helpOrderDetails: function() {\n $body.on('help:orderDetailsOpened', function(e, response) {\n if (typeof utag === 'undefined' || !utag) return;\n\n copyResponseData(response);\n\n utag.data.page_name = `${utag.data.store_country}:order_track:detail ${utag.data.order_track_id}`;\n utag.data.page_type = 'order track';\n utag.view(utag.data);\n });\n },\n\n createReturnSteps: function() {\n $body.on('order:createReturn:step2', function() {\n if (typeof utag === 'undefined' || !utag) return;\n\n addCartData();\n\n utag.data.page_name = `${utag.data.store_country}:order_track:return_exchange:step2`;\n utag.data.page_type = 'return-exchange funnel';\n utag.data.event_name = 'return_exchange:step2';\n utag.view(utag.data);\n });\n $body.on('order:createReturn:step3', function(e, params) {\n if (typeof utag === 'undefined' || !utag) return;\n\n addCartData();\n \n utag.data.product_return_type = params.types;\n\n utag.data.page_name = `${utag.data.store_country}:order_track:return_exchange:step3`;\n utag.data.page_type = 'return-exchange funnel';\n utag.data.event_name = 'return_exchange:step3';\n utag.view(utag.data);\n });\n $body.on('order:createReturn:thank-you', function(e, params) {\n if (typeof utag === 'undefined' || !utag) return;\n\n addCartData();\n utag.data.product_return_type = params.types;\n\n if (!utag.data.order_track_id){\n let searchParams = (new URL(document.location)).searchParams;\n let orderID = searchParams.get('orderID');\n utag.data.order_track_id = orderID;\n }\n\n utag.data.page_name = `${utag.data.store_country}:order_track:return_exchange:thank you`;\n utag.data.page_type = 'return-exchange funnel';\n utag.data.event_name = 'return_exchange:thank you';\n });\n },\n\n /**\n * Method to track events and collect information about customers\n */\n updateCustomerAttributes: function() {\n if (utagExists()) {\n $body.on('customer:updateAttributes', function() {\n const url = $('.get-customer-profile-url').attr('data-get-customer-profile');\n\n if (url) {\n $.ajax({\n url: url,\n method: 'GET',\n success: function(data) {\n if (typeof utag === 'undefined' || !utag || !data.success) return;\n\n for (const key in data.customerProfileAttributes) {\n if (data.customerProfileAttributes.hasOwnProperty(key)) {\n utag.data[key] = data.customerProfileAttributes[key];\n }\n }\n\n utag.link(utag.data);\n $body.trigger('datalayer:redirectUrl');\n },\n error: function(data) {\n console.error(data);\n }\n });\n }\n });\n }\n },\n /**\n * Method to track events and collect information about cart and wishlist\n */\n updateCartAndWishlist: function() {\n if (utagExists()) {\n $(document).ready(function() {\n /* Persist wishlist variable */\n\n var url = $('.get-datalayer-wishlist-url').attr('data-datalayer-wishlist');\n\n if (url) {\n $.ajax({\n url: url,\n method: 'GET',\n success: function(data) {\n var persist_wishlist = {\n item: data.item,\n total_with_vat: data.total_with_vat,\n currency: data.currency\n };\n utag.data['persist_wishlist'] = persist_wishlist;\n },\n error: function(data) {\n console.error(data);\n }\n });\n }\n\n /* Persist cart variable */\n url = $('.get-datalayer-cart-url').attr('data-datalayer-cart');\n\n if (url) {\n $.ajax({\n url: url,\n method: 'GET',\n success: function(data) {\n var persist_cart = {\n item: data.item,\n total_without_vat: data.total_without_vat,\n total_with_vat: data.total_with_vat,\n currency: data.currency\n };\n utag.data['persist_cart'] = persist_cart;\n\n jQuery('body').trigger('cart_wishlist_updated');\n\n },\n error: function(data) {\n console.error(data);\n }\n });\n }\n });\n }\n },\n\n setListViewType: function() {\n $(\".js-change-view-toggle\").click(function() {\n let viewType = $(\".js-change-view-toggle.active\").attr('data-layout');\n\n if (viewType == 'single') {\n utag.data.list_view_type = 'outfit view';\n } else {\n utag.data.list_view_type = 'product view';\n }\n utag.link(utag.data);\n });\n },\n\n\n searchOpen: function() {\n $body.on('search:open', function() {\n if (utagExists()) {\n utag.data.page_name = utag.data.store_country + ':search:open';\n // utag.data.page_type = 'search';\n // utag.data.event_name = 'search_open';\n // utag.link(utag.data);\n let page_name = utag.data.store_country + ':search:open';\n \n utag.view({\n 'page_name' : page_name,\n 'view_name': utag.data.store_country + ':search:open',\n 'page_type' : 'search',\n \"tealium_event\" : 'search',\n 'event_name' : 'search_open',\n 'event_category' : 'searchOpen',\n 'event_action' : 'click'\n });\n }\n });\n },\n\n\n searchTypeKeyword: function() {\n $body.on('search:searchKeyword', function(e, response) {\n if (utagExists()) {\n let names = [];\n let skus = [];\n for (let i = 0; i < response.suggestions.length; i++) {\n if (response.suggestions[i].dataset.productName) {\n names.push(response.suggestions[i].dataset.productName);\n }\n if (response.suggestions[i].dataset.pid) {\n skus.push(response.suggestions[i].dataset.pid);\n }\n }\n if (typeof utag === 'undefined' || !utag) return;\n utag.data.page_name = `${utag.data.store_country}:search:inline result`;\n // utag.data.page_type = 'search';\n // utag.data.search_results = response.suggestions.length;\n // utag.data.search_term = $('.search-field').val();\n // utag.data.product_impression_name = names.toString();\n // utag.data.product_impression_sku = skus.toString();\n // utag.data.event_name = 'search_inline';\n // utag.view(utag.data);\n\n\n utag.view({\n 'page_name' : utag.data.store_country + ':search:inline result',\n 'view_name': utag.data.store_country + ':search:inline result',\n 'page_type' : 'search',\n \"tealium_event\" : 'search',\n 'search_results' : response.suggestions.length,\n 'search_term' : $('.search-field').val(),\n 'product_name' : names,\n 'product_sku' : skus,\n 'event_name' : 'search_inline',\n 'event_category' : 'searchInline',\n 'event_action' : 'typeKeywords'\n });\n }\n });\n },\n\n searchProductClick: function() {\n $body.on('click', '.search-suggestion-list-item', function(e) {\n if (utagExists()) {\n utag.data.page_name = `${utag.data.store_country}:search:inline result`;\n // utag.data.page_type = 'search';\n // utag.data.search_term = $('.search-field').val();\n // utag.data.search_result_type = e.currentTarget.dataset.type;\n // utag.data.search_result_value = e.currentTarget.ariaLabel;\n // utag.data.product_impression_name = e.currentTarget.ariaLabel;\n // utag.data.product_impression_sku = e.currentTarget.dataset.pid;\n // utag.data.event_name = 'search_inline_click';\n // utag.view(utag.data);\n let page_name = utag.data.store_country + ':search:inline result';\n let name = [e.currentTarget.ariaLabel];\n let sku = [e.currentTarget.dataset.pid];\n\n\n utag.view({\n 'page_name' : page_name,\n 'view_name': utag.data.store_country + ':search:inline result',\n \"tealium_event\" : 'search',\n 'page_type' : 'search',\n 'search_term' : $('.search-field').val(),\n 'search_result_type' : e.currentTarget.dataset.type,\n 'search_result_value' : e.currentTarget.ariaLabel,\n 'product_name' : name,\n 'product_sku' : sku,\n 'event_name' : 'search_inline_click',\n 'event_category' : 'searchInlineClick',\n 'event_action' : 'searchClick'\n });\n }\n });\n },\n\n\n searchSend: function() {\n $body.on('search:send', function() {\n if (utagExists()) {\n utag.view({\n 'page_name' : utag.data.store_country + ':search send',\n 'page_section' : 'search',\n 'page_type' : 'search',\n 'search_term' : $('.search-field').val(),\n 'event_name' : 'search_ok',\n });\n utag.link(utag.data);\n }\n });\n },\n\n searchResultsPage: function() {\n if (utagExists()) {\n $body.on('search:searchResultsPage', function() {\n let names = [];\n let skus = [];\n let product = $('.product');\n for (let i = 0; i < product.length; i++) {\n if (product[i].dataset.productName) {\n names.push(product[i].dataset.productName);\n }\n if (product[i].dataset.pid) {\n skus.push(product[i].dataset.pid);\n }\n }\n utag.data.page_name = utag.data.store_country + ':search';\n // utag.data.page_type = 'search';\n // utag.data.list_view_type = 'product view';\n // utag.data.product_impression_name = names.toString();\n // utag.data.product_impression_sku = skus.toString();\n\n\n utag.view({\n 'page_name' : utag.data.store_country + ':search',\n 'view_name': utag.data.store_country + ':search', \n \"tealium_event\" : 'search',\n 'page_type' : 'search',\n 'list_view_type' : 'product view',\n 'search_term' : $('.search-field').val(),\n 'product_name' : names,\n 'product_sku' : skus,\n 'event_name' : 'search_results_page',\n 'event_category' : 'searchResults',\n 'event_action' : 'resultsLoad'\n });\n });\n }\n }\n};\n","'use strict';\n\nlet formCleared = false;\n\n/**\n * Additional class to invalid-feed back when input field is changed\n * @param {HTMLElement} input input field\n */\nfunction triggerEdgeValidation(input) {\n if (!input || !input.nextElementSibling) return;\n if (!input.nextElementSibling.classList.contains('invalid-feedback')) return;\n\n const invalidFeedback = input.nextElementSibling;\n invalidFeedback.classList.toggle('edge-validation-fix');\n}\n\n/**\n * Scroll to first error in given form (if there is any)\n * @param {JQuery} $form - jQuery object containing form\n */\nfunction scrollToError($form) {\n if ($form.find('.is-invalid,.-invalid').length && !$form.parents('.modal').length) {\n $('html, body').animate(\n {\n scrollTop: $form.find('.is-invalid,.-invalid').first().offset().top - 25,\n },\n 500\n );\n $form.find('.is-invalid:first,.-invalid:first').focus();\n }\n}\n\n/**\n * Check if the user has done the reCaptcha and return true if so\n * @param {jQuery} $form - the from which contains the reCaptcha\n * @returns {boolean} whether the reCaptcha is entered or not\n */\nfunction validateReCaptcha($form) {\n const $response = $form.find('[name=g-recaptcha-response]');\n let valid;\n\n if ($response.length && $response.val()) {\n // ReCaptcha found and valid\n valid = true;\n } else if ($response.length) {\n // ReCaptcha found but not valid\n valid = false;\n } else {\n // ReCaptcha not found\n valid = true;\n }\n\n $response.parent().toggleClass('highlight-recaptcha', !valid);\n return valid;\n}\n\n/**\n * Validate whole form. Requires `this` to be set to form object\n * @param {jQuery.event} event - Event to be canceled if form is invalid.\n * @returns {boolean} - Flag to indicate if form is valid\n */\nfunction validateForm(event) {\n let valid = true;\n\n if (!validateReCaptcha($(this)) || (this.checkValidity && !this.checkValidity())) {\n // safari\n valid = false;\n\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n }\n\n $(this)\n .find('input, select, textarea')\n .each(function () {\n if (!this.validity.valid) {\n $(this).trigger('invalid', this.validity);\n }\n });\n }\n\n return valid;\n}\n\n/**\n * Remove all validation. Should be called every time before revalidating form\n * @param {element|jQuery} form - Form to be cleared. Could be plain JS object or jQuery object\n * @returns {void}\n */\nfunction clearFormErrors(form) {\n let $form = form;\n\n // Transform to jQuery object if plain JS object is passed.\n if (!form.jquery) {\n $form = $(form);\n }\n\n $form.find('.form-control.is-invalid').removeClass('is-invalid');\n $form.find('.form-control.is-valid').removeClass('is-valid');\n // margiela\n $form.find('.-invalid').removeClass('-invalid');\n $form.find('-valid').removeClass('-valid');\n \n $form.find('.invalid-feedback').empty();\n}\n\n/**\n * Init the handlers for events which doesn't bubble.\n * No bubbling means that body, document or element's container cannot be used for that event\n * and the exact element should be selected instead.\n * This is not a problem on initial load but doesn't work on html loaded with Ajax\n * and this is why this method is needed so we can re-attach the event handlers.\n * @returns {void}\n */\nfunction attachNoBubbleEvents() {\n let attachTimeout;\n $('form input, form select, form textarea')\n .off('invalid')\n .on('invalid', function (e) {\n e.preventDefault();\n this.setCustomValidity('');\n const $form = $(this).parents('form');\n triggerEdgeValidation(this);\n\n if (!this.validity.valid) {\n $(this).removeClass('is-valid -valid');\n $(this).addClass('is-invalid -invalid');\n\n const id = $(this).attr('id');\n const fieldMessages = window.formValidationMessages[id];\n\n if (fieldMessages) {\n // Important:\n // for-in statement was the only possible solution in this case.\n // ValidityState has no enumerable properties hence Object.keys() wouldn't work.\n let key;\n\n for (key in this.validity) {\n // eslint-disable-line no-restricted-syntax, guard-for-in\n if (key !== 'valid') {\n if (this.validity[key] && fieldMessages[key]) {\n this.setCustomValidity(fieldMessages[key]);\n break;\n }\n }\n }\n }\n\n $(this).parents('.form-group').find('.invalid-feedback').text(this.validationMessage);\n $(this).parents('[class^=\"mm-form\"]').find('.invalid-feedback').text(this.validationMessage);\n\n clearTimeout(attachTimeout);\n attachTimeout = setTimeout(function () {\n $body.trigger('validation:afterReattachInvalid', { $form });\n }, 50);\n }\n });\n}\n\n/**\n * Clear errors from form fields (includes messeges and visual feedback)\n * @param {JQuery} $form - jquery form object\n */\nfunction clearFormFieldErrors($form) {\n $form.siblings('.invalid-feedback').empty();\n $form.removeClass('is-invalid -inalid');\n $form.addClass('is-valid -valid');\n\n $form.find('input').each((i, e) => {\n triggerEdgeValidation(e);\n });\n}\n\nmodule.exports = {\n noBubbleEvents: attachNoBubbleEvents,\n\n init: function (additionalMessagesStr) {\n window.formValidationMessages = {};\n\n let additionalMessages;\n\n if (additionalMessagesStr) {\n try {\n additionalMessages = JSON.parse(additionalMessagesStr);\n } catch (e) {\n window.console.warn(e);\n }\n }\n\n const $formMessages = $('.js-form-messages');\n\n if ($formMessages.length) {\n try {\n window.formValidationMessages = JSON.parse($formMessages.text());\n } catch (e) {\n window.console.warn(e);\n }\n }\n\n if (additionalMessages) {\n $.extend(window.formValidationMessages, additionalMessages);\n }\n\n },\n\n submit: function () {\n $body.on('submit', 'form', function (e) {\n return validateForm.call(this, e);\n });\n },\n\n buttonClick: function () {\n $body.on('click', 'form button[type=\"submit\"], form input[type=\"submit\"]', function () {\n // clear all errors when trying to submit the form\n const $form = $(this).parents('form');\n clearFormErrors($form);\n validateReCaptcha($form);\n formCleared = true;\n });\n },\n\n focusOut: function () {\n $body.on('focusout', 'form input:not(.validate-on-change), form select:not(.validate-on-change), form textarea', function (e) {\n const $this = $(e.target);\n $this.siblings('.field-description').remove();\n\n if (!this.checkValidity()) {\n $this.trigger('invalid', this.validity);\n } else {\n clearFormFieldErrors($this);\n }\n });\n },\n\n blur: function () {\n $body.on('blur', 'form input:not(.validate-on-change), form select:not(.validate-on-change), form textarea', function (e) {\n const $this = $(e.target);\n\n const removeWhitespaces = $($this).val();\n const cleanString = removeWhitespaces.replace(/^\\s+|\\s+$/g, '');\n $($this).val(cleanString);\n $this.siblings('.field-description').remove();\n\n if (!this.checkValidity()) {\n $this.trigger('invalid', this.validity);\n } else {\n clearFormFieldErrors($this);\n }\n });\n },\n\n onChange: function () {\n $body.on('change', 'input.validate-on-change, select.validate-on-change', function (e) {\n const $this = $(e.target);\n\n if (!this.checkValidity()) {\n $this.trigger('invalid', this.validity);\n } else {\n clearFormFieldErrors($this);\n }\n });\n },\n\n handleDateChange: function () {\n $body.on('changeDate', '[data-provide=datepicker]', function () {\n $(this).trigger('change');\n $(this).trigger('focusout');\n });\n },\n\n scrollOnError: function () {\n $body.on('validation:afterReattachInvalid', function (e, data) {\n if (formCleared) {\n formCleared = false;\n scrollToError(data.$form);\n }\n });\n },\n\n updatePostalCodePattern: function () {\n $body.on('change', '[data-update-postal-code-pattern]', function () {\n const $this = $(this);\n const postalCodeElementID = $this.data('update-postal-code-pattern');\n const $postalCode = $this.closest('form').find('#' + postalCodeElementID);\n\n if ($postalCode.length > 0) {\n const postalCodeRegexp = {\n defaults: /^[0-9]{5}$/,\n at: /^(?!0)([0-9]{4})$/,\n be: /^(?!0)([0-9]{4})$/,\n bg: /^(?!0)([0-9]{4})$/,\n dk: /^(?!0)([0-9]{4})$/,\n gr: /^([0-9]{3}\\s[0-9]{2}|[0-9]{5})$/,\n hu: /^[0-9]{4}$/,\n lv: /^([Ll][Vv])[-]([0-9]){4}$/,\n lt: /^([Ll][Tt])[-]([0-9]){5}$/,\n lu: /^(?!0)([0-9]{4})$/,\n nl: /^[1-9][0-9]{3}\\s[A-Z]{2}$/,\n no: /^[0-9]{4}$/,\n pl: /^[0-9]{2}[-][0-9]{3}$/,\n pt: /^(?!0)([0-9]{4}-?[0-9]{3})$/,\n ro: /^[0-9]{6}$/,\n ru: /^[0-9]{6}$/,\n sk: /^(?=0|8|9)([0-9]{3}\\s?[0-9]{2})$/,\n si: /^(?!0)([0-9]{4}$)/,\n es: /^((0[1-9]|5[0-2])|[1-4][0-9])[0-9]{3}$/,\n se: /^([0-9]{3}\\s[0-9]{2}|[0-9]{5})$/,\n ch: /^[0-9]{4}$/,\n gb: /^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9][A-Za-z]?))))\\s?[0-9][A-Za-z]{2})$/,\n us: /^\\d{5}(-\\d{4})?$/,\n ca: /^[ABCEGHJKLMNPRSTVXYabceghjklmnprstvxy]{1}\\d{1}[ABCEGHJKLMNPRSTVWXYZabceghjklmnprstvwxyz]{1} *\\d{1}[ABCEGHJKLMNPRSTVWXYZabceghjklmnprstvwxyz]{1}\\d{1}$/,\n cz: /^[0-9]{3}\\s[0-9]{2}$/,\n };\n const countryCode = ($this.val() || '').toLowerCase();\n const regexp = countryCode in postalCodeRegexp ? postalCodeRegexp[countryCode] : postalCodeRegexp.defaults;\n\n $postalCode.attr('pattern', regexp.toString().slice(1, -1));\n }\n });\n\n $('[data-update-postal-code-pattern]').trigger('change');\n },\n\n reCaptchaOnChange: function () {\n $body.on('focusin', '.g-recaptcha iframe', function () {\n validateReCaptcha($(event.target).parents('form'));\n });\n },\n\n functions: {\n validateForm: function (form, event) {\n return validateForm.call(form, event || null);\n },\n clearFormErrors: clearFormErrors,\n reAttachNoBubbleEvents: attachNoBubbleEvents,\n scrollToError: scrollToError,\n },\n};\n","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n};\n","'use strict';\n\nconst processInclude = require('base/util');\n\n$(document).ready(function () {\n processInclude(require('./registration/registration'));\n processInclude(require('core/datepicker'));\n processInclude(require('tealium/tealiumEvents'));\n\n // MARG-754\n processInclude(require('core/profile/profileSFSC'));\n\n});\nrequire('core/components/spinner');\n","'use strict';\n\nconst $body = $('body');\nconst formValidation = require('core/components/formValidation');\nconst clientSideValidation = require('core/components/clientSideValidation');\n\nconst $registrationForm = $('form.registration');\n\nmodule.exports = {\n init: function () {\n // clientSideValidation.init();\n $registrationForm.on('bouncerFormValid', function (e) {\n e.preventDefault();\n\n $.spinner().start();\n clientSideValidation.functions.clearFormErrors($registrationForm);\n\n $.post({\n url: $registrationForm.attr('action'),\n dataType: 'json',\n data: $registrationForm.serialize(),\n success: function (data) {\n if (!data.success) {\n formValidation($registrationForm, data);\n $.spinner().stop();\n clientSideValidation.functions.scrollToError($registrationForm);\n } else {\n $body.trigger('user:registered');\n $body.trigger('customer:updateAttributes');\n window.location = data.redirectUrl;\n }\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n\n $.spinner().stop();\n },\n });\n\n return false;\n });\n\n /**\n * toggle confirmation content\n */\n $('.js_toggle-order-details').on('click', function () {\n $('.js_confirmation-content').slideToggle();\n $(this).toggleClass('active');\n });\n },\n handlePopups: function () {\n $('#privacyPopupModal').on('shown.bs.modal', function (event) {\n const $aTag = $(event.relatedTarget); // Element that triggered the modal\n const $relevantSelector = $($aTag.data('hash'));\n\n if ($relevantSelector.length) {\n $relevantSelector.get(0).scrollIntoView();\n }\n });\n },\n datePickerKeyboardNav: function () {\n $('#registration-form-birthday').on('keydown', function (event) {\n if (event.key !== 'Enter' || this !== document.activeElement) return; // Only do something if element has focus and Enter is pressed.\n\n const $datepicker = $('.datepicker');\n if (!$datepicker.length) return; // date picker not open\n\n // get current user selection\n const $selection = $datepicker\n .children()\n .filter(function () {\n return $(this).css('display') !== 'none';\n })\n .find('.focused');\n // click on user selection\n $selection.trigger('click');\n\n event.preventDefault();\n event.stopImmediatePropagation();\n });\n },\n passwordDinamicValidation: function() {\n $('#registration-form-password').on('keydown input', function(e) {\n var emailInput = e.target.value;\n if(emailInput.length >= 8) {\n $('.error-length').addClass('green');\n } else {\n $('.error-length').removeClass('green');\n } \n if(/\\d/.test(emailInput)) {\n $('.error-number').addClass('green');\n } else {\n $('.error-number').removeClass('green');\n }\n if( /[!+,\\-./:;<=>?@]/.test(emailInput)) {\n $('.error-character').addClass('green');\n } else {\n $('.error-character').removeClass('green');\n }\n });\n }\n};\n","export function hasProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function lastItemOf(arr) {\n return arr[arr.length - 1];\n}\n\n// push only the items not included in the array\nexport function pushUnique(arr, ...items) {\n items.forEach((item) => {\n if (arr.includes(item)) {\n return;\n }\n arr.push(item);\n });\n return arr;\n}\n\nexport function stringToArray(str, separator) {\n // convert empty string to an empty array\n return str ? str.split(separator) : [];\n}\n\nexport function isInRange(testVal, min, max) {\n const minOK = min === undefined || testVal >= min;\n const maxOK = max === undefined || testVal <= max;\n return minOK && maxOK;\n}\n\nexport function limitToRange(val, min, max) {\n if (val < min) {\n return min;\n }\n if (val > max) {\n return max;\n }\n return val;\n}\n\nexport function createTagRepeat(tagName, repeat, attributes = {}, index = 0, html = '') {\n const openTagSrc = Object.keys(attributes).reduce((src, attr) => {\n let val = attributes[attr];\n if (typeof val === 'function') {\n val = val(index);\n }\n return `${src} ${attr}=\"${val}\"`;\n }, tagName);\n html += `<${openTagSrc}>`;\n\n const next = index + 1;\n return next < repeat\n ? createTagRepeat(tagName, repeat, attributes, next, html)\n : html;\n}\n\n// Remove the spacing surrounding tags for HTML parser not to create text nodes\n// before/after elements\nexport function optimizeTemplateHTML(html) {\n return html.replace(/>\\s+/g, '>').replace(/\\s+ name.toLowerCase().startsWith(monthName);\n // compare with both short and full names because some locales have periods\n // in the short names (not equal to the first X letters of the full names)\n monthIndex = locale.monthsShort.findIndex(compareNames);\n if (monthIndex < 0) {\n monthIndex = locale.months.findIndex(compareNames);\n }\n if (monthIndex < 0) {\n return NaN;\n }\n }\n\n newDate.setMonth(monthIndex);\n return newDate.getMonth() !== normalizeMonth(monthIndex)\n ? newDate.setDate(0)\n : newDate.getTime();\n },\n d(date, day) {\n return new Date(date).setDate(parseInt(day, 10));\n },\n};\n// format functions for date parts\nconst formatFns = {\n d(date) {\n return date.getDate();\n },\n dd(date) {\n return padZero(date.getDate(), 2);\n },\n D(date, locale) {\n return locale.daysShort[date.getDay()];\n },\n DD(date, locale) {\n return locale.days[date.getDay()];\n },\n m(date) {\n return date.getMonth() + 1;\n },\n mm(date) {\n return padZero(date.getMonth() + 1, 2);\n },\n M(date, locale) {\n return locale.monthsShort[date.getMonth()];\n },\n MM(date, locale) {\n return locale.months[date.getMonth()];\n },\n y(date) {\n return date.getFullYear();\n },\n yy(date) {\n return padZero(date.getFullYear(), 2).slice(-2);\n },\n yyyy(date) {\n return padZero(date.getFullYear(), 4);\n },\n};\n\n// get month index in normal range (0 - 11) from any number\nfunction normalizeMonth(monthIndex) {\n return monthIndex > -1 ? monthIndex % 12 : normalizeMonth(monthIndex + 12);\n}\n\nfunction padZero(num, length) {\n return num.toString().padStart(length, '0');\n}\n\nfunction parseFormatString(format) {\n if (typeof format !== 'string') {\n throw new Error(\"Invalid date format.\");\n }\n if (format in knownFormats) {\n return knownFormats[format];\n }\n\n // sprit the format string into parts and seprators\n const separators = format.split(reFormatTokens);\n const parts = format.match(new RegExp(reFormatTokens, 'g'));\n if (separators.length === 0 || !parts) {\n throw new Error(\"Invalid date format.\");\n }\n\n // collect format functions used in the format\n const partFormatters = parts.map(token => formatFns[token]);\n\n // collect parse function keys used in the format\n // iterate over parseFns' keys in order to keep the order of the keys.\n const partParserKeys = Object.keys(parseFns).reduce((keys, key) => {\n const token = parts.find(part => part[0] !== 'D' && part[0].toLowerCase() === key);\n if (token) {\n keys.push(key);\n }\n return keys;\n }, []);\n\n return knownFormats[format] = {\n parser(dateStr, locale) {\n const dateParts = dateStr.split(reNonDateParts).reduce((dtParts, part, index) => {\n if (part.length > 0 && parts[index]) {\n const token = parts[index][0];\n if (token === 'M') {\n dtParts.m = part;\n } else if (token !== 'D') {\n dtParts[token] = part;\n }\n }\n return dtParts;\n }, {});\n\n // iterate over partParserkeys so that the parsing is made in the oder\n // of year, month and day to prevent the day parser from correcting last\n // day of month wrongly\n return partParserKeys.reduce((origDate, key) => {\n const newDate = parseFns[key](origDate, dateParts[key], locale);\n // ingnore the part failed to parse\n return isNaN(newDate) ? origDate : newDate;\n }, today());\n },\n formatter(date, locale) {\n let dateStr = partFormatters.reduce((str, fn, index) => {\n return str += `${separators[index]}${fn(date, locale)}`;\n }, '');\n // separators' length is always parts' length + 1,\n return dateStr += lastItemOf(separators);\n },\n };\n}\n\nexport function parseDate(dateStr, format, locale) {\n if (dateStr instanceof Date || typeof dateStr === 'number') {\n const date = stripTime(dateStr);\n return isNaN(date) ? undefined : date;\n }\n if (!dateStr) {\n return undefined;\n }\n if (dateStr === 'today') {\n return today();\n }\n\n if (format && format.toValue) {\n const date = format.toValue(dateStr, format, locale);\n return isNaN(date) ? undefined : stripTime(date);\n }\n\n return parseFormatString(format).parser(dateStr, locale);\n}\n\nexport function formatDate(date, format, locale) {\n if (isNaN(date) || (!date && date !== 0)) {\n return '';\n }\n\n const dateObj = typeof date === 'number' ? new Date(date) : date;\n\n if (format.toDisplay) {\n return format.toDisplay(dateObj, format, locale);\n }\n\n return parseFormatString(format).formatter(dateObj, locale);\n}\n","const listenerRegistry = new WeakMap();\nconst {addEventListener, removeEventListener} = EventTarget.prototype;\n\n// Register event listeners to a key object\n// listeners: array of listener definitions;\n// - each definition must be a flat array of event target and the arguments\n// used to call addEventListener() on the target\nexport function registerListeners(keyObj, listeners) {\n let registered = listenerRegistry.get(keyObj);\n if (!registered) {\n registered = [];\n listenerRegistry.set(keyObj, registered);\n }\n listeners.forEach((listener) => {\n addEventListener.call(...listener);\n registered.push(listener);\n });\n}\n\nexport function unregisterListeners(keyObj) {\n let listeners = listenerRegistry.get(keyObj);\n if (!listeners) {\n return;\n }\n listeners.forEach((listener) => {\n removeEventListener.call(...listener);\n });\n listenerRegistry.delete(keyObj);\n}\n\n// Event.composedPath() polyfill for Edge\n// based on https://gist.github.com/kleinfreund/e9787d73776c0e3750dcfcdc89f100ec\nif (!Event.prototype.composedPath) {\n const getComposedPath = (node, path = []) => {\n path.push(node);\n\n let parent;\n if (node.parentNode) {\n parent = node.parentNode;\n } else if (node.host) { // ShadowRoot\n parent = node.host;\n } else if (node.defaultView) { // Document\n parent = node.defaultView;\n }\n return parent ? getComposedPath(parent, path) : path;\n };\n\n Event.prototype.composedPath = function () {\n return getComposedPath(this.target);\n };\n}\n\nfunction findFromPath(path, criteria, currentTarget, index = 0) {\n const el = path[index];\n if (criteria(el)) {\n return el;\n } else if (el === currentTarget || !el.parentElement) {\n // stop when reaching currentTarget or \n return;\n }\n return findFromPath(path, criteria, currentTarget, index + 1);\n}\n\n// Search for the actual target of a delegated event\nexport function findElementInEventPath(ev, selector) {\n const criteria = typeof selector === 'function' ? selector : el => el.matches(selector);\n return findFromPath(ev.composedPath(), criteria, ev.currentTarget);\n}\n","// default locales\nexport const locales = {\n en: {\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n daysShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n daysMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n monthsShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n today: \"Today\",\n clear: \"Clear\",\n titleFormat: \"MM y\"\n }\n};\n","// config options updatable by setOptions() and their default values\nconst defaultOptions = {\n autohide: false,\n beforeShowDay: null,\n beforeShowDecade: null,\n beforeShowMonth: null,\n beforeShowYear: null,\n calendarWeeks: false,\n clearBtn: false,\n dateDelimiter: ',',\n datesDisabled: [],\n daysOfWeekDisabled: [],\n daysOfWeekHighlighted: [],\n defaultViewDate: undefined, // placeholder, defaults to today() by the program\n disableTouchKeyboard: false,\n format: 'mm/dd/yyyy',\n language: 'en',\n maxDate: null,\n maxNumberOfDates: 1,\n maxView: 3,\n minDate: null,\n nextArrow: '»',\n orientation: 'auto',\n pickLevel: 0,\n prevArrow: '«',\n showDaysOfWeek: true,\n showOnClick: true,\n showOnFocus: true,\n startView: 0,\n title: '',\n todayBtn: false,\n todayBtnMode: 0,\n todayHighlight: false,\n updateOnBlur: true,\n weekStart: 0,\n};\n\nexport default defaultOptions;\n","const range = document.createRange();\n\nexport function parseHTML(html) {\n return range.createContextualFragment(html);\n}\n\n// equivalent to jQuery's :visble\nexport function isVisible(el) {\n return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n}\n\nexport function hideElement(el) {\n if (el.style.display === 'none') {\n return;\n }\n // back up the existing display setting in data-style-display\n if (el.style.display) {\n el.dataset.styleDisplay = el.style.display;\n }\n el.style.display = 'none';\n}\n\nexport function showElement(el) {\n if (el.style.display !== 'none') {\n return;\n }\n if (el.dataset.styleDisplay) {\n // restore backed-up dispay property\n el.style.display = el.dataset.styleDisplay;\n delete el.dataset.styleDisplay;\n } else {\n el.style.display = '';\n }\n}\n\nexport function emptyChildNodes(el) {\n if (el.firstChild) {\n el.removeChild(el.firstChild);\n emptyChildNodes(el);\n }\n}\n\nexport function replaceChildNodes(el, newChildNodes) {\n emptyChildNodes(el);\n if (newChildNodes instanceof DocumentFragment) {\n el.appendChild(newChildNodes);\n } else if (typeof newChildNodes === 'string') {\n el.appendChild(parseHTML(newChildNodes));\n } else if (typeof newChildNodes.forEach === 'function') {\n newChildNodes.forEach((node) => {\n el.appendChild(node);\n });\n }\n}\n","import {hasProperty, pushUnique} from '../lib/utils.js';\nimport {dateValue} from '../lib/date.js';\nimport {reFormatTokens, parseDate} from '../lib/date-format.js';\nimport {parseHTML} from '../lib/dom.js';\nimport defaultOptions from './defaultOptions.js';\n\nconst {\n language: defaultLang,\n format: defaultFormat,\n weekStart: defaultWeekStart,\n} = defaultOptions;\n\n// Reducer function to filter out invalid day-of-week from the input\nfunction sanitizeDOW(dow, day) {\n return dow.length < 6 && day >= 0 && day < 7\n ? pushUnique(dow, day)\n : dow;\n}\n\nfunction calcEndOfWeek(startOfWeek) {\n return (startOfWeek + 6) % 7;\n}\n\n// validate input date. if invalid, fallback to the original value\nfunction validateDate(value, format, locale, origValue) {\n const date = parseDate(value, format, locale);\n return date !== undefined ? date : origValue;\n}\n\n// Validate viewId. if invalid, fallback to the original value\nfunction validateViewId(value, origValue, max = 3) {\n const viewId = parseInt(value, 10);\n return viewId >= 0 && viewId <= max ? viewId : origValue;\n}\n\n// Create Datepicker configuration to set\nexport default function processOptions(options, datepicker) {\n const inOpts = Object.assign({}, options);\n const config = {};\n const locales = datepicker.constructor.locales;\n let {\n format,\n language,\n locale,\n maxDate,\n maxView,\n minDate,\n pickLevel,\n startView,\n weekStart,\n } = datepicker.config || {};\n\n if (inOpts.language) {\n let lang;\n if (inOpts.language !== language) {\n if (locales[inOpts.language]) {\n lang = inOpts.language;\n } else {\n // Check if langauge + region tag can fallback to the one without\n // region (e.g. fr-CA → fr)\n lang = inOpts.language.split('-')[0];\n if (locales[lang] === undefined) {\n lang = false;\n }\n }\n }\n delete inOpts.language;\n if (lang) {\n language = config.language = lang;\n\n // update locale as well when updating language\n const origLocale = locale || locales[defaultLang];\n // use default language's properties for the fallback\n locale = Object.assign({\n format: defaultFormat,\n weekStart: defaultWeekStart\n }, locales[defaultLang]);\n if (language !== defaultLang) {\n Object.assign(locale, locales[language]);\n }\n config.locale = locale;\n // if format and/or weekStart are the same as old locale's defaults,\n // update them to new locale's defaults\n if (format === origLocale.format) {\n format = config.format = locale.format;\n }\n if (weekStart === origLocale.weekStart) {\n weekStart = config.weekStart = locale.weekStart;\n config.weekEnd = calcEndOfWeek(locale.weekStart);\n }\n }\n }\n\n if (inOpts.format) {\n const hasToDisplay = typeof inOpts.format.toDisplay === 'function';\n const hasToValue = typeof inOpts.format.toValue === 'function';\n const validFormatString = reFormatTokens.test(inOpts.format);\n if ((hasToDisplay && hasToValue) || validFormatString) {\n format = config.format = inOpts.format;\n }\n delete inOpts.format;\n }\n\n //*** dates ***//\n // while min and maxDate for \"no limit\" in the options are better to be null\n // (especially when updating), the ones in the config have to be undefined\n // because null is treated as 0 (= unix epoch) when comparing with time value\n let minDt = minDate;\n let maxDt = maxDate;\n if (inOpts.minDate !== undefined) {\n minDt = inOpts.minDate === null\n ? dateValue(0, 0, 1) // set 0000-01-01 to prevent negative values for year\n : validateDate(inOpts.minDate, format, locale, minDt);\n delete inOpts.minDate;\n }\n if (inOpts.maxDate !== undefined) {\n maxDt = inOpts.maxDate === null\n ? undefined\n : validateDate(inOpts.maxDate, format, locale, maxDt);\n delete inOpts.maxDate;\n }\n if (maxDt < minDt) {\n minDate = config.minDate = maxDt;\n maxDate = config.maxDate = minDt;\n } else {\n if (minDate !== minDt) {\n minDate = config.minDate = minDt;\n }\n if (maxDate !== maxDt) {\n maxDate = config.maxDate = maxDt;\n }\n }\n\n if (inOpts.datesDisabled) {\n config.datesDisabled = inOpts.datesDisabled.reduce((dates, dt) => {\n const date = parseDate(dt, format, locale);\n return date !== undefined ? pushUnique(dates, date) : dates;\n }, []);\n delete inOpts.datesDisabled;\n }\n if (inOpts.defaultViewDate !== undefined) {\n const viewDate = parseDate(inOpts.defaultViewDate, format, locale);\n if (viewDate !== undefined) {\n config.defaultViewDate = viewDate;\n }\n delete inOpts.defaultViewDate;\n }\n\n //*** days of week ***//\n if (inOpts.weekStart !== undefined) {\n const wkStart = Number(inOpts.weekStart) % 7;\n if (!isNaN(wkStart)) {\n weekStart = config.weekStart = wkStart;\n config.weekEnd = calcEndOfWeek(wkStart);\n }\n delete inOpts.weekStart;\n }\n if (inOpts.daysOfWeekDisabled) {\n config.daysOfWeekDisabled = inOpts.daysOfWeekDisabled.reduce(sanitizeDOW, []);\n delete inOpts.daysOfWeekDisabled;\n }\n if (inOpts.daysOfWeekHighlighted) {\n config.daysOfWeekHighlighted = inOpts.daysOfWeekHighlighted.reduce(sanitizeDOW, []);\n delete inOpts.daysOfWeekHighlighted;\n }\n\n //*** multi date ***//\n if (inOpts.maxNumberOfDates !== undefined) {\n const maxNumberOfDates = parseInt(inOpts.maxNumberOfDates, 10);\n if (maxNumberOfDates >= 0) {\n config.maxNumberOfDates = maxNumberOfDates;\n config.multidate = maxNumberOfDates !== 1;\n }\n delete inOpts.maxNumberOfDates;\n }\n if (inOpts.dateDelimiter) {\n config.dateDelimiter = String(inOpts.dateDelimiter);\n delete inOpts.dateDelimiter;\n }\n\n //*** pick level & view ***//\n let newPickLevel = pickLevel;\n if (inOpts.pickLevel !== undefined) {\n newPickLevel = validateViewId(inOpts.pickLevel, 2);\n delete inOpts.pickLevel;\n }\n if (newPickLevel !== pickLevel) {\n pickLevel = config.pickLevel = newPickLevel;\n }\n\n let newMaxView = maxView;\n if (inOpts.maxView !== undefined) {\n newMaxView = validateViewId(inOpts.maxView, maxView);\n delete inOpts.maxView;\n }\n // ensure max view >= pick level\n newMaxView = pickLevel > newMaxView ? pickLevel : newMaxView;\n if (newMaxView !== maxView) {\n maxView = config.maxView = newMaxView;\n }\n\n let newStartView = startView;\n if (inOpts.startView !== undefined) {\n newStartView = validateViewId(inOpts.startView, newStartView);\n delete inOpts.startView;\n }\n // ensure pick level <= start view <= max view\n if (newStartView < pickLevel) {\n newStartView = pickLevel;\n } else if (newStartView > maxView) {\n newStartView = maxView;\n }\n if (newStartView !== startView) {\n config.startView = newStartView;\n }\n\n //*** template ***//\n if (inOpts.prevArrow) {\n const prevArrow = parseHTML(inOpts.prevArrow);\n if (prevArrow.childNodes.length > 0) {\n config.prevArrow = prevArrow.childNodes;\n }\n delete inOpts.prevArrow;\n }\n if (inOpts.nextArrow) {\n const nextArrow = parseHTML(inOpts.nextArrow);\n if (nextArrow.childNodes.length > 0) {\n config.nextArrow = nextArrow.childNodes;\n }\n delete inOpts.nextArrow;\n }\n\n //*** misc ***//\n if (inOpts.disableTouchKeyboard !== undefined) {\n config.disableTouchKeyboard = 'ontouchstart' in document && !!inOpts.disableTouchKeyboard;\n delete inOpts.disableTouchKeyboard;\n }\n if (inOpts.orientation) {\n const orientation = inOpts.orientation.toLowerCase().split(/\\s+/g);\n config.orientation = {\n x: orientation.find(x => (x === 'left' || x === 'right')) || 'auto',\n y: orientation.find(y => (y === 'top' || y === 'bottom')) || 'auto',\n };\n delete inOpts.orientation;\n }\n if (inOpts.todayBtnMode !== undefined) {\n switch(inOpts.todayBtnMode) {\n case 0:\n case 1:\n config.todayBtnMode = inOpts.todayBtnMode;\n }\n delete inOpts.todayBtnMode;\n }\n\n //*** copy the rest ***//\n Object.keys(inOpts).forEach((key) => {\n if (inOpts[key] !== undefined && hasProperty(defaultOptions, key)) {\n config[key] = inOpts[key];\n }\n });\n\n return config;\n}\n","import {optimizeTemplateHTML} from '../../lib/utils.js';\n\nconst pickerTemplate = optimizeTemplateHTML(`
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
`);\n\nexport default pickerTemplate;\n","import {createTagRepeat, optimizeTemplateHTML} from '../../lib/utils.js';\n\nconst daysTemplate = optimizeTemplateHTML(`
\n
${createTagRepeat('span', 7, {class: 'dow'})}
\n
${createTagRepeat('span', 42)}
\n
`);\n\nexport default daysTemplate;\n","import {createTagRepeat, optimizeTemplateHTML} from '../../lib/utils.js';\n\nconst calendarWeeksTemplate = optimizeTemplateHTML(`
\n
\n
${createTagRepeat('span', 6, {class: 'week'})}
\n
`);\n\nexport default calendarWeeksTemplate;\n","import {pushUnique} from '../../lib/utils.js';\nimport {parseHTML, replaceChildNodes} from '../../lib/dom.js';\n\n// Base class of the view classes\nexport default class View {\n constructor(picker, config) {\n Object.assign(this, config, {\n picker,\n element: parseHTML(`
`).firstChild,\n selected: [],\n });\n this.init(this.picker.datepicker.config);\n }\n\n init(options) {\n if (options.pickLevel !== undefined) {\n this.isMinView = this.id === options.pickLevel;\n }\n this.setOptions(options);\n this.updateFocus();\n this.updateSelection();\n }\n\n // Execute beforeShow() callback and apply the result to the element\n // args:\n // - current - current value on the iteration on view rendering\n // - timeValue - time value of the date to pass to beforeShow()\n performBeforeHook(el, current, timeValue) {\n let result = this.beforeShow(new Date(timeValue));\n switch (typeof result) {\n case 'boolean':\n result = {enabled: result};\n break;\n case 'string':\n result = {classes: result};\n }\n\n if (result) {\n if (result.enabled === false) {\n el.classList.add('disabled');\n pushUnique(this.disabled, current);\n }\n if (result.classes) {\n const extraClasses = result.classes.split(/\\s+/);\n el.classList.add(...extraClasses);\n if (extraClasses.includes('disabled')) {\n pushUnique(this.disabled, current);\n }\n }\n if (result.content) {\n replaceChildNodes(el, result.content);\n }\n }\n }\n}\n","import {hasProperty, pushUnique} from '../../lib/utils.js';\nimport {today, dateValue, addDays, addWeeks, dayOfTheWeekOf, getWeek} from '../../lib/date.js';\nimport {formatDate} from '../../lib/date-format.js';\nimport {parseHTML, showElement, hideElement} from '../../lib/dom.js';\nimport daysTemplate from '../templates/daysTemplate.js';\nimport calendarWeeksTemplate from '../templates/calendarWeeksTemplate.js';\nimport View from './View.js';\n\nexport default class DaysView extends View {\n constructor(picker) {\n super(picker, {\n id: 0,\n name: 'days',\n cellClass: 'day',\n });\n }\n\n init(options, onConstruction = true) {\n if (onConstruction) {\n const inner = parseHTML(daysTemplate).firstChild;\n this.dow = inner.firstChild;\n this.grid = inner.lastChild;\n this.element.appendChild(inner);\n }\n super.init(options);\n }\n\n setOptions(options) {\n let updateDOW;\n\n if (hasProperty(options, 'minDate')) {\n this.minDate = options.minDate;\n }\n if (hasProperty(options, 'maxDate')) {\n this.maxDate = options.maxDate;\n }\n if (options.datesDisabled) {\n this.datesDisabled = options.datesDisabled;\n }\n if (options.daysOfWeekDisabled) {\n this.daysOfWeekDisabled = options.daysOfWeekDisabled;\n updateDOW = true;\n }\n if (options.daysOfWeekHighlighted) {\n this.daysOfWeekHighlighted = options.daysOfWeekHighlighted;\n }\n if (options.todayHighlight !== undefined) {\n this.todayHighlight = options.todayHighlight;\n }\n if (options.weekStart !== undefined) {\n this.weekStart = options.weekStart;\n this.weekEnd = options.weekEnd;\n updateDOW = true;\n }\n if (options.locale) {\n const locale = this.locale = options.locale;\n this.dayNames = locale.daysMin;\n this.switchLabelFormat = locale.titleFormat;\n updateDOW = true;\n }\n if (options.beforeShowDay !== undefined) {\n this.beforeShow = typeof options.beforeShowDay === 'function'\n ? options.beforeShowDay\n : undefined;\n }\n\n if (options.calendarWeeks !== undefined) {\n if (options.calendarWeeks && !this.calendarWeeks) {\n const weeksElem = parseHTML(calendarWeeksTemplate).firstChild;\n this.calendarWeeks = {\n element: weeksElem,\n dow: weeksElem.firstChild,\n weeks: weeksElem.lastChild,\n };\n this.element.insertBefore(weeksElem, this.element.firstChild);\n } else if (this.calendarWeeks && !options.calendarWeeks) {\n this.element.removeChild(this.calendarWeeks.element);\n this.calendarWeeks = null;\n }\n }\n if (options.showDaysOfWeek !== undefined) {\n if (options.showDaysOfWeek) {\n showElement(this.dow);\n if (this.calendarWeeks) {\n showElement(this.calendarWeeks.dow);\n }\n } else {\n hideElement(this.dow);\n if (this.calendarWeeks) {\n hideElement(this.calendarWeeks.dow);\n }\n }\n }\n\n // update days-of-week when locale, daysOfweekDisabled or weekStart is changed\n if (updateDOW) {\n Array.from(this.dow.children).forEach((el, index) => {\n const dow = (this.weekStart + index) % 7;\n el.textContent = this.dayNames[dow];\n el.className = this.daysOfWeekDisabled.includes(dow) ? 'dow disabled' : 'dow';\n });\n }\n }\n\n // Apply update on the focused date to view's settings\n updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const viewYear = viewDate.getFullYear();\n const viewMonth = viewDate.getMonth();\n const firstOfMonth = dateValue(viewYear, viewMonth, 1);\n const start = dayOfTheWeekOf(firstOfMonth, this.weekStart, this.weekStart);\n\n this.first = firstOfMonth;\n this.last = dateValue(viewYear, viewMonth + 1, 0);\n this.start = start;\n this.focused = this.picker.viewDate;\n }\n\n // Apply update on the selected dates to view's settings\n updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates;\n if (rangepicker) {\n this.range = rangepicker.dates;\n }\n }\n\n // Update the entire view UI\n render() {\n // update today marker on ever render\n this.today = this.todayHighlight ? today() : undefined;\n // refresh disabled dates on every render in order to clear the ones added\n // by beforeShow hook at previous render\n this.disabled = [...this.datesDisabled];\n\n const switchLabel = formatDate(this.focused, this.switchLabelFormat, this.locale);\n this.picker.setViewSwitchLabel(switchLabel);\n this.picker.setPrevBtnDisabled(this.first <= this.minDate);\n this.picker.setNextBtnDisabled(this.last >= this.maxDate);\n\n if (this.calendarWeeks) {\n // start of the UTC week (Monday) of the 1st of the month\n const startOfWeek = dayOfTheWeekOf(this.first, 1, 1);\n Array.from(this.calendarWeeks.weeks.children).forEach((el, index) => {\n el.textContent = getWeek(addWeeks(startOfWeek, index));\n });\n }\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n const current = addDays(this.start, index);\n const date = new Date(current);\n const day = date.getDay();\n\n el.className = `datepicker-cell ${this.cellClass}`;\n el.dataset.date = current;\n el.textContent = date.getDate();\n\n if (current < this.first) {\n classList.add('prev');\n } else if (current > this.last) {\n classList.add('next');\n }\n if (this.today === current) {\n classList.add('today');\n }\n if (current < this.minDate || current > this.maxDate || this.disabled.includes(current)) {\n classList.add('disabled');\n }\n if (this.daysOfWeekDisabled.includes(day)) {\n classList.add('disabled');\n pushUnique(this.disabled, current);\n }\n if (this.daysOfWeekHighlighted.includes(day)) {\n classList.add('highlighted');\n }\n if (this.range) {\n const [rangeStart, rangeEnd] = this.range;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range');\n }\n if (current === rangeStart) {\n classList.add('range-start');\n }\n if (current === rangeEnd) {\n classList.add('range-end');\n }\n }\n if (this.selected.includes(current)) {\n classList.add('selected');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n\n if (this.beforeShow) {\n this.performBeforeHook(el, current, current);\n }\n });\n }\n\n // Update the view UI by applying the changes of selected and focused items\n refresh() {\n const [rangeStart, rangeEnd] = this.range || [];\n this.grid\n .querySelectorAll('.range, .range-start, .range-end, .selected, .focused')\n .forEach((el) => {\n el.classList.remove('range', 'range-start', 'range-end', 'selected', 'focused');\n });\n Array.from(this.grid.children).forEach((el) => {\n const current = Number(el.dataset.date);\n const classList = el.classList;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range');\n }\n if (current === rangeStart) {\n classList.add('range-start');\n }\n if (current === rangeEnd) {\n classList.add('range-end');\n }\n if (this.selected.includes(current)) {\n classList.add('selected');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n });\n }\n\n // Update the view UI by applying the change of focused item\n refreshFocus() {\n const index = Math.round((this.focused - this.start) / 86400000);\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[index].classList.add('focused');\n }\n}\n","import {hasProperty, pushUnique, createTagRepeat} from '../../lib/utils.js';\nimport {dateValue} from '../../lib/date.js';\nimport {parseHTML} from '../../lib/dom.js';\nimport View from './View.js';\n\nfunction computeMonthRange(range, thisYear) {\n if (!range || !range[0] || !range[1]) {\n return;\n }\n\n const [[startY, startM], [endY, endM]] = range;\n if (startY > thisYear || endY < thisYear) {\n return;\n }\n return [\n startY === thisYear ? startM : -1,\n endY === thisYear ? endM : 12,\n ];\n}\n\nexport default class MonthsView extends View {\n constructor(picker) {\n super(picker, {\n id: 1,\n name: 'months',\n cellClass: 'month',\n });\n }\n\n init(options, onConstruction = true) {\n if (onConstruction) {\n this.grid = this.element;\n this.element.classList.add('months', 'datepicker-grid');\n this.grid.appendChild(parseHTML(createTagRepeat('span', 12, {'data-month': ix => ix})));\n }\n super.init(options);\n }\n\n setOptions(options) {\n if (options.locale) {\n this.monthNames = options.locale.monthsShort;\n }\n if (hasProperty(options, 'minDate')) {\n if (options.minDate === undefined) {\n this.minYear = this.minMonth = this.minDate = undefined;\n } else {\n const minDateObj = new Date(options.minDate);\n this.minYear = minDateObj.getFullYear();\n this.minMonth = minDateObj.getMonth();\n this.minDate = minDateObj.setDate(1);\n }\n }\n if (hasProperty(options, 'maxDate')) {\n if (options.maxDate === undefined) {\n this.maxYear = this.maxMonth = this.maxDate = undefined;\n } else {\n const maxDateObj = new Date(options.maxDate);\n this.maxYear = maxDateObj.getFullYear();\n this.maxMonth = maxDateObj.getMonth();\n this.maxDate = dateValue(this.maxYear, this.maxMonth + 1, 0);\n }\n }\n if (options.beforeShowMonth !== undefined) {\n this.beforeShow = typeof options.beforeShowMonth === 'function'\n ? options.beforeShowMonth\n : undefined;\n }\n }\n\n // Update view's settings to reflect the viewDate set on the picker\n updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n this.year = viewDate.getFullYear();\n this.focused = viewDate.getMonth();\n }\n\n // Update view's settings to reflect the selected dates\n updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates.reduce((selected, timeValue) => {\n const date = new Date(timeValue);\n const year = date.getFullYear();\n const month = date.getMonth();\n if (selected[year] === undefined) {\n selected[year] = [month];\n } else {\n pushUnique(selected[year], month);\n }\n return selected;\n }, {});\n if (rangepicker && rangepicker.dates) {\n this.range = rangepicker.dates.map(timeValue => {\n const date = new Date(timeValue);\n return isNaN(date) ? undefined : [date.getFullYear(), date.getMonth()];\n });\n }\n }\n\n // Update the entire view UI\n render() {\n // refresh disabled months on every render in order to clear the ones added\n // by beforeShow hook at previous render\n this.disabled = [];\n\n this.picker.setViewSwitchLabel(this.year);\n this.picker.setPrevBtnDisabled(this.year <= this.minYear);\n this.picker.setNextBtnDisabled(this.year >= this.maxYear);\n\n const selected = this.selected[this.year] || [];\n const yrOutOfRange = this.year < this.minYear || this.year > this.maxYear;\n const isMinYear = this.year === this.minYear;\n const isMaxYear = this.year === this.maxYear;\n const range = computeMonthRange(this.range, this.year);\n\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n const date = dateValue(this.year, index, 1);\n\n el.className = `datepicker-cell ${this.cellClass}`;\n if (this.isMinView) {\n el.dataset.date = date;\n }\n // reset text on every render to clear the custom content set\n // by beforeShow hook at previous render\n el.textContent = this.monthNames[index];\n\n if (\n yrOutOfRange\n || isMinYear && index < this.minMonth\n || isMaxYear && index > this.maxMonth\n ) {\n classList.add('disabled');\n }\n if (range) {\n const [rangeStart, rangeEnd] = range;\n if (index > rangeStart && index < rangeEnd) {\n classList.add('range');\n }\n if (index === rangeStart) {\n classList.add('range-start');\n }\n if (index === rangeEnd) {\n classList.add('range-end');\n }\n }\n if (selected.includes(index)) {\n classList.add('selected');\n }\n if (index === this.focused) {\n classList.add('focused');\n }\n\n if (this.beforeShow) {\n this.performBeforeHook(el, index, date);\n }\n });\n }\n\n // Update the view UI by applying the changes of selected and focused items\n refresh() {\n const selected = this.selected[this.year] || [];\n const [rangeStart, rangeEnd] = computeMonthRange(this.range, this.year) || [];\n this.grid\n .querySelectorAll('.range, .range-start, .range-end, .selected, .focused')\n .forEach((el) => {\n el.classList.remove('range', 'range-start', 'range-end', 'selected', 'focused');\n });\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n if (index > rangeStart && index < rangeEnd) {\n classList.add('range');\n }\n if (index === rangeStart) {\n classList.add('range-start');\n }\n if (index === rangeEnd) {\n classList.add('range-end');\n }\n if (selected.includes(index)) {\n classList.add('selected');\n }\n if (index === this.focused) {\n classList.add('focused');\n }\n });\n }\n\n // Update the view UI by applying the change of focused item\n refreshFocus() {\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[this.focused].classList.add('focused');\n }\n}","import {hasProperty, pushUnique, createTagRepeat} from '../../lib/utils.js';\nimport {dateValue, startOfYearPeriod} from '../../lib/date.js';\nimport {parseHTML} from '../../lib/dom.js';\nimport View from './View.js';\n\nfunction toTitleCase(word) {\n return [...word].reduce((str, ch, ix) => str += ix ? ch : ch.toUpperCase(), '');\n}\n\n// Class representing the years and decades view elements\nexport default class YearsView extends View {\n constructor(picker, config) {\n super(picker, config);\n }\n\n init(options, onConstruction = true) {\n if (onConstruction) {\n this.navStep = this.step * 10;\n this.beforeShowOption = `beforeShow${toTitleCase(this.cellClass)}`;\n this.grid = this.element;\n this.element.classList.add(this.name, 'datepicker-grid');\n this.grid.appendChild(parseHTML(createTagRepeat('span', 12)));\n }\n super.init(options);\n }\n\n setOptions(options) {\n if (hasProperty(options, 'minDate')) {\n if (options.minDate === undefined) {\n this.minYear = this.minDate = undefined;\n } else {\n this.minYear = startOfYearPeriod(options.minDate, this.step);\n this.minDate = dateValue(this.minYear, 0, 1);\n }\n }\n if (hasProperty(options, 'maxDate')) {\n if (options.maxDate === undefined) {\n this.maxYear = this.maxDate = undefined;\n } else {\n this.maxYear = startOfYearPeriod(options.maxDate, this.step);\n this.maxDate = dateValue(this.maxYear, 11, 31);\n }\n }\n if (options[this.beforeShowOption] !== undefined) {\n const beforeShow = options[this.beforeShowOption];\n this.beforeShow = typeof beforeShow === 'function' ? beforeShow : undefined;\n }\n }\n\n // Update view's settings to reflect the viewDate set on the picker\n updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const first = startOfYearPeriod(viewDate, this.navStep);\n const last = first + 9 * this.step;\n\n this.first = first;\n this.last = last;\n this.start = first - this.step;\n this.focused = startOfYearPeriod(viewDate, this.step);\n }\n\n // Update view's settings to reflect the selected dates\n updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates.reduce((years, timeValue) => {\n return pushUnique(years, startOfYearPeriod(timeValue, this.step));\n }, []);\n if (rangepicker && rangepicker.dates) {\n this.range = rangepicker.dates.map(timeValue => {\n if (timeValue !== undefined) {\n return startOfYearPeriod(timeValue, this.step);\n }\n });\n }\n }\n\n // Update the entire view UI\n render() {\n // refresh disabled years on every render in order to clear the ones added\n // by beforeShow hook at previous render\n this.disabled = [];\n\n this.picker.setViewSwitchLabel(`${this.first}-${this.last}`);\n this.picker.setPrevBtnDisabled(this.first <= this.minYear);\n this.picker.setNextBtnDisabled(this.last >= this.maxYear);\n\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n const current = this.start + (index * this.step);\n const date = dateValue(current, 0, 1);\n\n el.className = `datepicker-cell ${this.cellClass}`;\n if (this.isMinView) {\n el.dataset.date = date;\n }\n el.textContent = el.dataset.year = current;\n\n if (index === 0) {\n classList.add('prev');\n } else if (index === 11) {\n classList.add('next');\n }\n if (current < this.minYear || current > this.maxYear) {\n classList.add('disabled');\n }\n if (this.range) {\n const [rangeStart, rangeEnd] = this.range;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range');\n }\n if (current === rangeStart) {\n classList.add('range-start');\n }\n if (current === rangeEnd) {\n classList.add('range-end');\n }\n }\n if (this.selected.includes(current)) {\n classList.add('selected');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n\n if (this.beforeShow) {\n this.performBeforeHook(el, current, date);\n }\n });\n }\n\n // Update the view UI by applying the changes of selected and focused items\n refresh() {\n const [rangeStart, rangeEnd] = this.range || [];\n this.grid\n .querySelectorAll('.range, .range-start, .range-end, .selected, .focused')\n .forEach((el) => {\n el.classList.remove('range', 'range-start', 'range-end', 'selected', 'focused');\n });\n Array.from(this.grid.children).forEach((el) => {\n const current = Number(el.textContent);\n const classList = el.classList;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range');\n }\n if (current === rangeStart) {\n classList.add('range-start');\n }\n if (current === rangeEnd) {\n classList.add('range-end');\n }\n if (this.selected.includes(current)) {\n classList.add('selected');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n });\n }\n\n // Update the view UI by applying the change of focused item\n refreshFocus() {\n const index = Math.round((this.focused - this.start) / this.step);\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[index].classList.add('focused');\n }\n}\n","import {limitToRange} from '../lib/utils.js';\nimport {addMonths, addYears} from '../lib/date.js';\n\nexport function triggerDatepickerEvent(datepicker, type) {\n const detail = {\n date: datepicker.getDate(),\n viewDate: new Date(datepicker.picker.viewDate),\n viewId: datepicker.picker.currentView.id,\n datepicker,\n };\n datepicker.element.dispatchEvent(new CustomEvent(type, {detail}));\n}\n\n// direction: -1 (to previous), 1 (to next)\nexport function goToPrevOrNext(datepicker, direction) {\n const {minDate, maxDate} = datepicker.config;\n const {currentView, viewDate} = datepicker.picker;\n let newViewDate;\n switch (currentView.id) {\n case 0:\n newViewDate = addMonths(viewDate, direction);\n break;\n case 1:\n newViewDate = addYears(viewDate, direction);\n break;\n default:\n newViewDate = addYears(viewDate, direction * currentView.navStep);\n }\n newViewDate = limitToRange(newViewDate, minDate, maxDate);\n datepicker.picker.changeFocus(newViewDate).render();\n}\n\nexport function switchView(datepicker) {\n const viewId = datepicker.picker.currentView.id;\n if (viewId === datepicker.config.maxView) {\n return;\n }\n datepicker.picker.changeView(viewId + 1).render();\n}\n\nexport function unfocus(datepicker) {\n if (datepicker.config.updateOnBlur) {\n datepicker.update({autohide: true});\n } else {\n datepicker.refresh('input');\n datepicker.hide();\n }\n}\n","import {today, addMonths, addYears} from '../lib/date.js';\nimport {findElementInEventPath} from '../lib/event.js';\nimport {goToPrevOrNext, switchView} from './functions.js';\n\nfunction goToSelectedMonthOrYear(datepicker, selection) {\n const picker = datepicker.picker;\n const viewDate = new Date(picker.viewDate);\n const viewId = picker.currentView.id;\n const newDate = viewId === 1\n ? addMonths(viewDate, selection - viewDate.getMonth())\n : addYears(viewDate, selection - viewDate.getFullYear());\n\n picker.changeFocus(newDate).changeView(viewId - 1).render();\n}\n\nexport function onClickTodayBtn(datepicker) {\n const picker = datepicker.picker;\n const currentDate = today();\n if (datepicker.config.todayBtnMode === 1) {\n if (datepicker.config.autohide) {\n datepicker.setDate(currentDate);\n return;\n }\n datepicker.setDate(currentDate, {render: false});\n picker.update();\n }\n if (picker.viewDate !== currentDate) {\n picker.changeFocus(currentDate);\n }\n picker.changeView(0).render();\n}\n\nexport function onClickClearBtn(datepicker) {\n datepicker.setDate({clear: true});\n}\n\nexport function onClickViewSwitch(datepicker) {\n switchView(datepicker);\n}\n\nexport function onClickPrevBtn(datepicker) {\n goToPrevOrNext(datepicker, -1);\n}\n\nexport function onClickNextBtn(datepicker) {\n goToPrevOrNext(datepicker, 1);\n}\n\n// For the picker's main block to delegete the events from `datepicker-cell`s\nexport function onClickView(datepicker, ev) {\n const target = findElementInEventPath(ev, '.datepicker-cell');\n if (!target || target.classList.contains('disabled')) {\n return;\n }\n\n const {id, isMinView} = datepicker.picker.currentView;\n if (isMinView) {\n datepicker.setDate(Number(target.dataset.date));\n } else if (id === 1) {\n goToSelectedMonthOrYear(datepicker, Number(target.dataset.month));\n } else {\n goToSelectedMonthOrYear(datepicker, Number(target.dataset.year));\n }\n}\n\nexport function onClickPicker(datepicker) {\n if (!datepicker.inline && !datepicker.config.disableTouchKeyboard) {\n datepicker.inputField.focus();\n }\n}\n","import {hasProperty, lastItemOf, isInRange, limitToRange} from '../lib/utils.js';\nimport {today} from '../lib/date.js';\nimport {parseHTML, showElement, hideElement, emptyChildNodes} from '../lib/dom.js';\nimport {registerListeners} from '../lib/event.js';\nimport pickerTemplate from './templates/pickerTemplate.js';\nimport DaysView from './views/DaysView.js';\nimport MonthsView from './views/MonthsView.js';\nimport YearsView from './views/YearsView.js';\nimport {triggerDatepickerEvent} from '../events/functions.js';\nimport {\n onClickTodayBtn,\n onClickClearBtn,\n onClickViewSwitch,\n onClickPrevBtn,\n onClickNextBtn,\n onClickView,\n onClickPicker,\n} from '../events/pickerListeners.js';\n\nfunction processPickerOptions(picker, options) {\n if (options.title !== undefined) {\n if (options.title) {\n picker.controls.title.textContent = options.title;\n showElement(picker.controls.title);\n } else {\n picker.controls.title.textContent = '';\n hideElement(picker.controls.title);\n }\n }\n if (options.prevArrow) {\n const prevBtn = picker.controls.prevBtn;\n emptyChildNodes(prevBtn);\n options.prevArrow.forEach((node) => {\n prevBtn.appendChild(node.cloneNode(true));\n });\n }\n if (options.nextArrow) {\n const nextBtn = picker.controls.nextBtn;\n emptyChildNodes(nextBtn);\n options.nextArrow.forEach((node) => {\n nextBtn.appendChild(node.cloneNode(true));\n });\n }\n if (options.locale) {\n picker.controls.todayBtn.textContent = options.locale.today;\n picker.controls.clearBtn.textContent = options.locale.clear;\n }\n if (options.todayBtn !== undefined) {\n if (options.todayBtn) {\n showElement(picker.controls.todayBtn);\n } else {\n hideElement(picker.controls.todayBtn);\n }\n }\n if (hasProperty(options, 'minDate') || hasProperty(options, 'maxDate')) {\n const {minDate, maxDate} = picker.datepicker.config;\n picker.controls.todayBtn.disabled = !isInRange(today(), minDate, maxDate);\n }\n if (options.clearBtn !== undefined) {\n if (options.clearBtn) {\n showElement(picker.controls.clearBtn);\n } else {\n hideElement(picker.controls.clearBtn);\n }\n }\n}\n\n// Compute view date to reset, which will be...\n// - the last item of the selected dates or defaultViewDate if no selection\n// - limitted to minDate or maxDate if it exceeds the range\nfunction computeResetViewDate(datepicker) {\n const {dates, config} = datepicker;\n const viewDate = dates.length > 0 ? lastItemOf(dates) : config.defaultViewDate;\n return limitToRange(viewDate, config.minDate, config.maxDate);\n}\n\n// Change current view's view date\nfunction setViewDate(picker, newDate) {\n const oldViewDate = new Date(picker.viewDate);\n const newViewDate = new Date(newDate);\n const {id, year, first, last} = picker.currentView;\n const viewYear = newViewDate.getFullYear();\n\n picker.viewDate = newDate;\n if (viewYear !== oldViewDate.getFullYear()) {\n triggerDatepickerEvent(picker.datepicker, 'changeYear');\n }\n if (newViewDate.getMonth() !== oldViewDate.getMonth()) {\n triggerDatepickerEvent(picker.datepicker, 'changeMonth');\n }\n\n // return whether the new date is in different period on time from the one\n // displayed in the current view\n // when true, the view needs to be re-rendered on the next UI refresh.\n switch (id) {\n case 0:\n return newDate < first || newDate > last;\n case 1:\n return viewYear !== year;\n default:\n return viewYear < first || viewYear > last;\n }\n}\n\nfunction getTextDirection(el) {\n return window.getComputedStyle(el).direction;\n}\n\n// Class representing the picker UI\nexport default class Picker {\n constructor(datepicker) {\n this.datepicker = datepicker;\n\n const template = pickerTemplate.replace(/%buttonClass%/g, datepicker.config.buttonClass);\n const element = this.element = parseHTML(template).firstChild;\n const [header, main, footer] = element.firstChild.children;\n const title = header.firstElementChild;\n const [prevBtn, viewSwitch, nextBtn] = header.lastElementChild.children;\n const [todayBtn, clearBtn] = footer.firstChild.children;\n const controls = {\n title,\n prevBtn,\n viewSwitch,\n nextBtn,\n todayBtn,\n clearBtn,\n };\n this.main = main;\n this.controls = controls;\n\n const elementClass = datepicker.inline ? 'inline' : 'dropdown';\n element.classList.add(`datepicker-${elementClass}`);\n\n processPickerOptions(this, datepicker.config);\n this.viewDate = computeResetViewDate(datepicker);\n\n // set up event listeners\n registerListeners(datepicker, [\n [element, 'click', onClickPicker.bind(null, datepicker), {capture: true}],\n [main, 'click', onClickView.bind(null, datepicker)],\n [controls.viewSwitch, 'click', onClickViewSwitch.bind(null, datepicker)],\n [controls.prevBtn, 'click', onClickPrevBtn.bind(null, datepicker)],\n [controls.nextBtn, 'click', onClickNextBtn.bind(null, datepicker)],\n [controls.todayBtn, 'click', onClickTodayBtn.bind(null, datepicker)],\n [controls.clearBtn, 'click', onClickClearBtn.bind(null, datepicker)],\n ]);\n\n // set up views\n this.views = [\n new DaysView(this),\n new MonthsView(this),\n new YearsView(this, {id: 2, name: 'years', cellClass: 'year', step: 1}),\n new YearsView(this, {id: 3, name: 'decades', cellClass: 'decade', step: 10}),\n ];\n this.currentView = this.views[datepicker.config.startView];\n\n this.currentView.render();\n this.main.appendChild(this.currentView.element);\n datepicker.config.container.appendChild(this.element);\n }\n\n setOptions(options) {\n processPickerOptions(this, options);\n this.views.forEach((view) => {\n view.init(options, false);\n });\n this.currentView.render();\n }\n\n detach() {\n this.datepicker.config.container.removeChild(this.element);\n }\n\n show() {\n if (this.active) {\n return;\n }\n this.element.classList.add('active');\n this.active = true;\n\n const datepicker = this.datepicker;\n if (!datepicker.inline) {\n // ensure picker's direction matches input's\n const inputDirection = getTextDirection(datepicker.inputField);\n if (inputDirection !== getTextDirection(datepicker.config.container)) {\n this.element.dir = inputDirection;\n } else if (this.element.dir) {\n this.element.removeAttribute('dir');\n }\n\n this.place();\n if (datepicker.config.disableTouchKeyboard) {\n datepicker.inputField.blur();\n }\n }\n triggerDatepickerEvent(datepicker, 'show');\n }\n\n hide() {\n if (!this.active) {\n return;\n }\n this.datepicker.exitEditMode();\n this.element.classList.remove('active');\n this.active = false;\n triggerDatepickerEvent(this.datepicker, 'hide');\n }\n\n place() {\n const {classList, style} = this.element;\n const {config, inputField} = this.datepicker;\n const container = config.container;\n const {\n width: calendarWidth,\n height: calendarHeight,\n } = this.element.getBoundingClientRect();\n const {\n left: containerLeft,\n top: containerTop,\n width: containerWidth,\n } = container.getBoundingClientRect();\n const {\n left: inputLeft,\n top: inputTop,\n width: inputWidth,\n height: inputHeight\n } = inputField.getBoundingClientRect();\n let {x: orientX, y: orientY} = config.orientation;\n let scrollTop;\n let left;\n let top;\n\n if (container === document.body) {\n scrollTop = window.scrollY;\n left = inputLeft + window.scrollX;\n top = inputTop + scrollTop;\n } else {\n scrollTop = container.scrollTop;\n left = inputLeft - containerLeft;\n top = inputTop - containerTop + scrollTop;\n }\n\n if (orientX === 'auto') {\n if (left < 0) {\n // align to the left and move into visible area if input's left edge < window's\n orientX = 'left';\n left = 10;\n } else if (left + calendarWidth > containerWidth) {\n // align to the right if canlendar's right edge > container's\n orientX = 'right';\n } else {\n orientX = getTextDirection(inputField) === 'rtl' ? 'right' : 'left';\n }\n }\n if (orientX === 'right') {\n left -= calendarWidth - inputWidth;\n }\n\n if (orientY === 'auto') {\n orientY = top - calendarHeight < scrollTop ? 'bottom' : 'top';\n }\n if (orientY === 'top') {\n top -= calendarHeight;\n } else {\n top += inputHeight;\n }\n\n classList.remove(\n 'datepicker-orient-top',\n 'datepicker-orient-bottom',\n 'datepicker-orient-right',\n 'datepicker-orient-left'\n );\n classList.add(`datepicker-orient-${orientY}`, `datepicker-orient-${orientX}`);\n\n style.top = top ? `${top}px` : top;\n style.left = left ? `${left}px` : left;\n }\n\n setViewSwitchLabel(labelText) {\n this.controls.viewSwitch.textContent = labelText;\n }\n\n setPrevBtnDisabled(disabled) {\n this.controls.prevBtn.disabled = disabled;\n }\n\n setNextBtnDisabled(disabled) {\n this.controls.nextBtn.disabled = disabled;\n }\n\n changeView(viewId) {\n const oldView = this.currentView;\n const newView = this.views[viewId];\n if (newView.id !== oldView.id) {\n this.currentView = newView;\n this._renderMethod = 'render';\n triggerDatepickerEvent(this.datepicker, 'changeView');\n this.main.replaceChild(newView.element, oldView.element);\n }\n return this;\n }\n\n // Change the focused date (view date)\n changeFocus(newViewDate) {\n this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refreshFocus';\n this.views.forEach((view) => {\n view.updateFocus();\n });\n return this;\n }\n\n // Apply the change of the selected dates\n update() {\n const newViewDate = computeResetViewDate(this.datepicker);\n this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refresh';\n this.views.forEach((view) => {\n view.updateFocus();\n view.updateSelection();\n });\n return this;\n }\n\n // Refresh the picker UI\n render(quickRender = true) {\n const renderMethod = (quickRender && this._renderMethod) || 'render';\n delete this._renderMethod;\n\n this.currentView[renderMethod]();\n }\n}\n","import {isInRange} from '../lib/utils.js';\nimport {addDays, addMonths, addYears, startOfYearPeriod} from '../lib/date.js';\nimport {goToPrevOrNext, switchView, unfocus} from './functions.js';\n\n// Find the closest date that doesn't meet the condition for unavailable date\n// Returns undefined if no available date is found\n// addFn: function to calculate the next date\n// - args: time value, amount\n// increase: amount to pass to addFn\n// testFn: function to test the unavailablity of the date\n// - args: time value; retun: true if unavailable\nfunction findNextAvailableOne(date, addFn, increase, testFn, min, max) {\n if (!isInRange(date, min, max)) {\n return;\n }\n if (testFn(date)) {\n const newDate = addFn(date, increase);\n return findNextAvailableOne(newDate, addFn, increase, testFn, min, max);\n }\n return date;\n}\n\n// direction: -1 (left/up), 1 (right/down)\n// vertical: true for up/down, false for left/right\nfunction moveByArrowKey(datepicker, ev, direction, vertical) {\n const picker = datepicker.picker;\n const currentView = picker.currentView;\n const step = currentView.step || 1;\n let viewDate = picker.viewDate;\n let addFn;\n let testFn;\n switch (currentView.id) {\n case 0:\n if (vertical) {\n viewDate = addDays(viewDate, direction * 7);\n } else if (ev.ctrlKey || ev.metaKey) {\n viewDate = addYears(viewDate, direction);\n } else {\n viewDate = addDays(viewDate, direction);\n }\n addFn = addDays;\n testFn = (date) => currentView.disabled.includes(date);\n break;\n case 1:\n viewDate = addMonths(viewDate, vertical ? direction * 4 : direction);\n addFn = addMonths;\n testFn = (date) => {\n const dt = new Date(date);\n const {year, disabled} = currentView;\n return dt.getFullYear() === year && disabled.includes(dt.getMonth());\n };\n break;\n default:\n viewDate = addYears(viewDate, direction * (vertical ? 4 : 1) * step);\n addFn = addYears;\n testFn = date => currentView.disabled.includes(startOfYearPeriod(date, step));\n }\n viewDate = findNextAvailableOne(\n viewDate,\n addFn,\n direction < 0 ? -step : step,\n testFn,\n currentView.minDate,\n currentView.maxDate\n );\n if (viewDate !== undefined) {\n picker.changeFocus(viewDate).render();\n }\n}\n\nexport function onKeydown(datepicker, ev) {\n if (ev.key === 'Tab') {\n unfocus(datepicker);\n return;\n }\n\n const picker = datepicker.picker;\n const {id, isMinView} = picker.currentView;\n if (!picker.active) {\n switch (ev.key) {\n case 'ArrowDown':\n case 'Escape':\n picker.show();\n break;\n case 'Enter':\n datepicker.update();\n break;\n default:\n return;\n }\n } else if (datepicker.editMode) {\n switch (ev.key) {\n case 'Escape':\n picker.hide();\n break;\n case 'Enter':\n datepicker.exitEditMode({update: true, autohide: datepicker.config.autohide});\n break;\n default:\n return;\n }\n } else {\n switch (ev.key) {\n case 'Escape':\n picker.hide();\n break;\n case 'ArrowLeft':\n if (ev.ctrlKey || ev.metaKey) {\n goToPrevOrNext(datepicker, -1);\n } else if (ev.shiftKey) {\n datepicker.enterEditMode();\n return;\n } else {\n moveByArrowKey(datepicker, ev, -1, false);\n }\n break;\n case 'ArrowRight':\n if (ev.ctrlKey || ev.metaKey) {\n goToPrevOrNext(datepicker, 1);\n } else if (ev.shiftKey) {\n datepicker.enterEditMode();\n return;\n } else {\n moveByArrowKey(datepicker, ev, 1, false);\n }\n break;\n case 'ArrowUp':\n if (ev.ctrlKey || ev.metaKey) {\n switchView(datepicker);\n } else if (ev.shiftKey) {\n datepicker.enterEditMode();\n return;\n } else {\n moveByArrowKey(datepicker, ev, -1, true);\n }\n break;\n case 'ArrowDown':\n if (ev.shiftKey && !ev.ctrlKey && !ev.metaKey) {\n datepicker.enterEditMode();\n return;\n }\n moveByArrowKey(datepicker, ev, 1, true);\n break;\n case 'Enter':\n if (isMinView) {\n datepicker.setDate(picker.viewDate);\n } else {\n picker.changeView(id - 1).render();\n }\n break;\n case 'Backspace':\n case 'Delete':\n datepicker.enterEditMode();\n return;\n default:\n if (ev.key.length === 1 && !ev.ctrlKey && !ev.metaKey) {\n datepicker.enterEditMode();\n }\n return;\n }\n }\n ev.preventDefault();\n ev.stopPropagation();\n}\n\nexport function onFocus(datepicker) {\n if (datepicker.config.showOnFocus && !datepicker._showing) {\n datepicker.show();\n }\n}\n\n// for the prevention for entering edit mode while getting focus on click\nexport function onMousedown(datepicker, ev) {\n const el = ev.target;\n if (datepicker.picker.active || datepicker.config.showOnClick) {\n el._active = el === document.activeElement;\n el._clicking = setTimeout(() => {\n delete el._active;\n delete el._clicking;\n }, 2000);\n }\n}\n\nexport function onClickInput(datepicker, ev) {\n const el = ev.target;\n if (!el._clicking) {\n return;\n }\n clearTimeout(el._clicking);\n delete el._clicking;\n\n if (el._active) {\n datepicker.enterEditMode();\n }\n delete el._active;\n\n if (datepicker.config.showOnClick) {\n datepicker.show();\n }\n}\n\nexport function onPaste(datepicker, ev) {\n if (ev.clipboardData.types.includes('text/plain')) {\n datepicker.enterEditMode();\n }\n}\n","import {findElementInEventPath} from '../lib/event.js';\nimport {unfocus} from './functions.js';\n\n// for the `document` to delegate the events from outside the picker/input field\nexport function onClickOutside(datepicker, ev) {\n const element = datepicker.element;\n if (element !== document.activeElement) {\n return;\n }\n const pickerElem = datepicker.picker.element;\n if (findElementInEventPath(ev, el => el === element || el === pickerElem)) {\n return;\n }\n unfocus(datepicker);\n}\n","import {lastItemOf, stringToArray, isInRange} from './lib/utils.js';\nimport {today} from './lib/date.js';\nimport {parseDate, formatDate} from './lib/date-format.js';\nimport {registerListeners, unregisterListeners} from './lib/event.js';\nimport {locales} from './i18n/base-locales.js';\nimport defaultOptions from './options/defaultOptions.js';\nimport processOptions from './options/processOptions.js';\nimport Picker from './picker/Picker.js';\nimport {triggerDatepickerEvent} from './events/functions.js';\nimport {onKeydown, onFocus, onMousedown, onClickInput, onPaste} from './events/inputFieldListeners.js';\nimport {onClickOutside} from './events/otherListeners.js';\n\nfunction stringifyDates(dates, config) {\n return dates\n .map(dt => formatDate(dt, config.format, config.locale))\n .join(config.dateDelimiter);\n}\n\n// parse input dates and create an array of time values for selection\n// returns undefined if there are no valid dates in inputDates\n// when origDates (current selection) is passed, the function works to mix\n// the input dates into the current selection\nfunction processInputDates(datepicker, inputDates, clear = false) {\n const {config, dates: origDates, rangepicker} = datepicker;\n if (inputDates.length === 0) {\n // empty input is considered valid unless origiDates is passed\n return clear ? [] : undefined;\n }\n\n const rangeEnd = rangepicker && datepicker === rangepicker.datepickers[1];\n let newDates = inputDates.reduce((dates, dt) => {\n let date = parseDate(dt, config.format, config.locale);\n if (date === undefined) {\n return dates;\n }\n if (config.pickLevel > 0) {\n // adjust to 1st of the month/Jan 1st of the year\n // or to the last day of the monh/Dec 31st of the year if the datepicker\n // is the range-end picker of a rangepicker\n const dt = new Date(date);\n if (config.pickLevel === 1) {\n date = rangeEnd\n ? dt.setMonth(dt.getMonth() + 1, 0)\n : dt.setDate(1);\n } else {\n date = rangeEnd\n ? dt.setFullYear(dt.getFullYear() + 1, 0, 0)\n : dt.setMonth(0, 1);\n }\n }\n if (\n isInRange(date, config.minDate, config.maxDate)\n && !dates.includes(date)\n && !config.datesDisabled.includes(date)\n && !config.daysOfWeekDisabled.includes(new Date(date).getDay())\n ) {\n dates.push(date);\n }\n return dates;\n }, []);\n if (newDates.length === 0) {\n return;\n }\n if (config.multidate && !clear) {\n // get the synmetric difference between origDates and newDates\n newDates = newDates.reduce((dates, date) => {\n if (!origDates.includes(date)) {\n dates.push(date);\n }\n return dates;\n }, origDates.filter(date => !newDates.includes(date)));\n }\n // do length check always because user can input multiple dates regardless of the mode\n return config.maxNumberOfDates && newDates.length > config.maxNumberOfDates\n ? newDates.slice(config.maxNumberOfDates * -1)\n : newDates;\n}\n\n// refresh the UI elements\n// modes: 1: input only, 2, picker only, 3 both\nfunction refreshUI(datepicker, mode = 3, quickRender = true) {\n const {config, picker, inputField} = datepicker;\n if (mode & 2) {\n const newView = picker.active ? config.pickLevel : config.startView;\n picker.update().changeView(newView).render(quickRender);\n }\n if (mode & 1 && inputField) {\n inputField.value = stringifyDates(datepicker.dates, config);\n }\n}\n\nfunction setDate(datepicker, inputDates, options) {\n let {clear, render, autohide} = options;\n if (render === undefined) {\n render = true;\n }\n if (!render) {\n autohide = false;\n } else if (autohide === undefined) {\n autohide = datepicker.config.autohide;\n }\n\n const newDates = processInputDates(datepicker, inputDates, clear);\n if (!newDates) {\n return;\n }\n if (newDates.toString() !== datepicker.dates.toString()) {\n datepicker.dates = newDates;\n refreshUI(datepicker, render ? 3 : 1);\n triggerDatepickerEvent(datepicker, 'changeDate');\n } else {\n refreshUI(datepicker, 1);\n }\n if (autohide) {\n datepicker.hide();\n }\n}\n\n/**\n * Class representing a date picker\n */\nexport default class Datepicker {\n /**\n * Create a date picker\n * @param {Element} element - element to bind a date picker\n * @param {Object} [options] - config options\n * @param {DateRangePicker} [rangepicker] - DateRangePicker instance the\n * date picker belongs to. Use this only when creating date picker as a part\n * of date range picker\n */\n constructor(element, options = {}, rangepicker = undefined) {\n element.datepicker = this;\n this.element = element;\n\n // set up config\n const config = this.config = Object.assign({\n buttonClass: (options.buttonClass && String(options.buttonClass)) || 'button',\n container: document.body,\n defaultViewDate: today(),\n maxDate: undefined,\n minDate: undefined,\n }, processOptions(defaultOptions, this));\n this._options = options;\n Object.assign(config, processOptions(options, this));\n\n // configure by type\n const inline = this.inline = element.tagName !== 'INPUT';\n let inputField;\n let initialDates;\n\n if (inline) {\n config.container = element;\n initialDates = stringToArray(element.dataset.date, config.dateDelimiter);\n delete element.dataset.date;\n } else {\n const container = options.container ? document.querySelector(options.container) : null;\n if (container) {\n config.container = container;\n }\n inputField = this.inputField = element;\n inputField.classList.add('datepicker-input');\n initialDates = stringToArray(inputField.value, config.dateDelimiter);\n }\n if (rangepicker) {\n // check validiry\n const index = rangepicker.inputs.indexOf(inputField);\n const datepickers = rangepicker.datepickers;\n if (index < 0 || index > 1 || !Array.isArray(datepickers)) {\n throw Error('Invalid rangepicker object.');\n }\n // attach itaelf to the rangepicker here so that processInputDates() can\n // determine if this is the range-end picker of the rangepicker while\n // setting inital values when pickLevel > 0\n datepickers[index] = this;\n // add getter for rangepicker\n Object.defineProperty(this, 'rangepicker', {\n get() {\n return rangepicker;\n },\n });\n }\n\n // set initial dates\n this.dates = [];\n // process initial value\n const inputDateValues = processInputDates(this, initialDates);\n if (inputDateValues && inputDateValues.length > 0) {\n this.dates = inputDateValues;\n }\n if (inputField) {\n inputField.value = stringifyDates(this.dates, config);\n }\n\n const picker = this.picker = new Picker(this);\n\n if (inline) {\n this.show();\n } else {\n // set up event listeners in other modes\n const onMousedownDocument = onClickOutside.bind(null, this);\n const listeners = [\n [inputField, 'keydown', onKeydown.bind(null, this)],\n [inputField, 'focus', onFocus.bind(null, this)],\n [inputField, 'mousedown', onMousedown.bind(null, this)],\n [inputField, 'click', onClickInput.bind(null, this)],\n [inputField, 'paste', onPaste.bind(null, this)],\n [document, 'mousedown', onMousedownDocument],\n [document, 'touchstart', onMousedownDocument],\n [window, 'resize', picker.place.bind(picker)]\n ];\n registerListeners(this, listeners);\n }\n }\n\n /**\n * Format Date object or time value in given format and language\n * @param {Date|Number} date - date or time value to format\n * @param {String|Object} format - format string or object that contains\n * toDisplay() custom formatter, whose signature is\n * - args:\n * - date: {Date} - Date instance of the date passed to the method\n * - format: {Object} - the format object passed to the method\n * - locale: {Object} - locale for the language specified by `lang`\n * - return:\n * {String} formatted date\n * @param {String} [lang=en] - language code for the locale to use\n * @return {String} formatted date\n */\n static formatDate(date, format, lang) {\n return formatDate(date, format, lang && locales[lang] || locales.en);\n }\n\n /**\n * Parse date string\n * @param {String|Date|Number} dateStr - date string, Date object or time\n * value to parse\n * @param {String|Object} format - format string or object that contains\n * toValue() custom parser, whose signature is\n * - args:\n * - dateStr: {String|Date|Number} - the dateStr passed to the method\n * - format: {Object} - the format object passed to the method\n * - locale: {Object} - locale for the language specified by `lang`\n * - return:\n * {Date|Number} parsed date or its time value\n * @param {String} [lang=en] - language code for the locale to use\n * @return {Number} time value of parsed date\n */\n static parseDate(dateStr, format, lang) {\n return parseDate(dateStr, format, lang && locales[lang] || locales.en);\n }\n\n /**\n * @type {Object} - Installed locales in `[languageCode]: localeObject` format\n * en`:_English (US)_ is pre-installed.\n */\n static get locales() {\n return locales;\n }\n\n /**\n * @type {Boolean} - Whether the picker element is shown. `true` whne shown\n */\n get active() {\n return !!(this.picker && this.picker.active);\n }\n\n /**\n * @type {HTMLDivElement} - DOM object of picker element\n */\n get pickerElement() {\n return this.picker ? this.picker.element : undefined;\n }\n\n /**\n * Set new values to the config options\n * @param {Object} options - config options to update\n */\n setOptions(options) {\n const picker = this.picker;\n const newOptions = processOptions(options, this);\n Object.assign(this._options, options);\n Object.assign(this.config, newOptions);\n picker.setOptions(newOptions);\n\n refreshUI(this, 3);\n }\n\n /**\n * Show the picker element\n */\n show() {\n if (this.inputField) {\n if (this.inputField.disabled) {\n return;\n }\n if (this.inputField !== document.activeElement) {\n this._showing = true;\n this.inputField.focus();\n delete this._showing;\n }\n }\n this.picker.show();\n }\n\n /**\n * Hide the picker element\n * Not available on inline picker\n */\n hide() {\n if (this.inline) {\n return;\n }\n this.picker.hide();\n this.picker.update().changeView(this.config.startView).render();\n }\n\n /**\n * Destroy the Datepicker instance\n * @return {Detepicker} - the instance destroyed\n */\n destroy() {\n this.hide();\n unregisterListeners(this);\n this.picker.detach();\n if (!this.inline) {\n this.inputField.classList.remove('datepicker-input');\n }\n delete this.element.datepicker;\n return this;\n }\n\n /**\n * Get the selected date(s)\n *\n * The method returns a Date object of selected date by default, and returns\n * an array of selected dates in multidate mode. If format string is passed,\n * it returns date string(s) formatted in given format.\n *\n * @param {String} [format] - Format string to stringify the date(s)\n * @return {Date|String|Date[]|String[]} - selected date(s), or if none is\n * selected, empty array in multidate mode and untitled in sigledate mode\n */\n getDate(format = undefined) {\n const callback = format\n ? date => formatDate(date, format, this.config.locale)\n : date => new Date(date);\n\n if (this.config.multidate) {\n return this.dates.map(callback);\n }\n if (this.dates.length > 0) {\n return callback(this.dates[0]);\n }\n }\n\n /**\n * Set selected date(s)\n *\n * In multidate mode, you can pass multiple dates as a series of arguments\n * or an array. (Since each date is parsed individually, the type of the\n * dates doesn't have to be the same.)\n * The given dates are used to toggle the select status of each date. The\n * number of selected dates is kept from exceeding the length set to\n * maxNumberOfDates.\n *\n * With clear: true option, the method can be used to clear the selection\n * and to replace the selection instead of toggling in multidate mode.\n * If the option is passed with no date arguments or an empty dates array,\n * it works as \"clear\" (clear the selection then set nothing), and if the\n * option is passed with new dates to select, it works as \"replace\" (clear\n * the selection then set the given dates)\n *\n * When render: false option is used, the method omits re-rendering the\n * picker element. In this case, you need to call refresh() method later in\n * order for the picker element to reflect the changes. The input field is\n * refreshed always regardless of this option.\n *\n * When invalid (unparsable, repeated, disabled or out-of-range) dates are\n * passed, the method ignores them and applies only valid ones. In the case\n * that all the given dates are invalid, which is distinguished from passing\n * no dates, the method considers it as an error and leaves the selection\n * untouched.\n *\n * @param {...(Date|Number|String)|Array} [dates] - Date strings, Date\n * objects, time values or mix of those for new selection\n * @param {Object} [options] - function options\n * - clear: {boolean} - Whether to clear the existing selection\n * defualt: false\n * - render: {boolean} - Whether to re-render the picker element\n * default: true\n * - autohide: {boolean} - Whether to hide the picker element after re-render\n * Ignored when used with render: false\n * default: config.autohide\n */\n setDate(...args) {\n const dates = [...args];\n const opts = {};\n const lastArg = lastItemOf(args);\n if (\n typeof lastArg === 'object'\n && !Array.isArray(lastArg)\n && !(lastArg instanceof Date)\n && lastArg\n ) {\n Object.assign(opts, dates.pop());\n }\n\n const inputDates = Array.isArray(dates[0]) ? dates[0] : dates;\n setDate(this, inputDates, opts);\n }\n\n /**\n * Update the selected date(s) with input field's value\n * Not available on inline picker\n *\n * The input field will be refreshed with properly formatted date string.\n *\n * @param {Object} [options] - function options\n * - autohide: {boolean} - whether to hide the picker element after refresh\n * default: false\n */\n update(options = undefined) {\n if (this.inline) {\n return;\n }\n\n const opts = {clear: true, autohide: !!(options && options.autohide)};\n const inputDates = stringToArray(this.inputField.value, this.config.dateDelimiter);\n setDate(this, inputDates, opts);\n }\n\n /**\n * Refresh the picker element and the associated input field\n * @param {String} [target] - target item when refreshing one item only\n * 'picker' or 'input'\n * @param {Boolean} [forceRender] - whether to re-render the picker element\n * regardless of its state instead of optimized refresh\n */\n refresh(target = undefined, forceRender = false) {\n if (target && typeof target !== 'string') {\n forceRender = target;\n target = undefined;\n }\n\n let mode;\n if (target === 'picker') {\n mode = 2;\n } else if (target === 'input') {\n mode = 1;\n } else {\n mode = 3;\n }\n refreshUI(this, mode, !forceRender);\n }\n\n /**\n * Enter edit mode\n * Not available on inline picker or when the picker element is hidden\n */\n enterEditMode() {\n if (this.inline || !this.picker.active || this.editMode) {\n return;\n }\n this.editMode = true;\n this.inputField.classList.add('in-edit');\n }\n\n /**\n * Exit from edit mode\n * Not available on inline picker\n * @param {Object} [options] - function options\n * - update: {boolean} - whether to call update() after exiting\n * If false, input field is revert to the existing selection\n * default: false\n */\n exitEditMode(options = undefined) {\n if (this.inline || !this.editMode) {\n return;\n }\n const opts = Object.assign({update: false}, options);\n delete this.editMode;\n this.inputField.classList.remove('in-edit');\n if (opts.update) {\n this.update(opts);\n }\n }\n}\n","'use strict';\n\nimport { Datepicker } from 'vanillajs-datepicker'; \n\nconst inputElement = document.querySelector('.form-control__input--date');\n\nif ($(inputElement).length > 0) {\n const datepickerDefault = {\n autohide: true,\n startView: 2\n };\n if (inputElement.dataset.milliseconds) {\n const now = new Date();\n const nowTime = new Date(now.getTime() - Number(inputElement.dataset.milliseconds));\n datepickerDefault.maxDate = nowTime;\n delete inputElement.dataset.milliseconds;\n }\n const currentConfig = { ...datepickerDefault, ...inputElement.dataset };\n inputElement.datepicker = new Datepicker(inputElement, currentConfig);\n}"],"sourceRoot":""}