vendor: 5,273 bytes, lines 1-181
1(self["webpackChunkumbraco_frontend"] = self["webpackChunkumbraco_frontend"] || []).push([[251],{ 2 3/***/ 2215: 4/***/ ((module, exports, __webpack_require__) => { 5 6var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 7 * JavaScript Cookie v2.2.1 8 * https://github.com/js-cookie/js-cookie 9 * 10 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 11 * Released under the MIT license 12 */ 13;(function (factory) { 14 var registeredInModuleLoader; 15 if (true) { 16 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 17 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 18 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : 19 __WEBPACK_AMD_DEFINE_FACTORY__), 20 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 21 registeredInModuleLoader = true; 22 } 23 if (true) { 24 module.exports = factory(); 25 registeredInModuleLoader = true; 26 } 27 if (!registeredInModuleLoader) { 28 var OldCookies = window.Cookies; 29 var api = window.Cookies = factory(); 30 api.noConflict = function () { 31 window.Cookies = OldCookies; 32 return api; 33 }; 34 } 35}(function () { 36 function extend () { 37 var i = 0; 38 var result = {}; 39 for (; i < arguments.length; i++) { 40 var attributes = arguments[ i ]; 41 for (var key in attributes) { 42 result[key] = attributes[key]; 43 } 44 } 45 return result; 46 } 47 48 function decode (s) { 49 return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); 50 } 51 52 function init (converter) { 53 function api() {} 54 55 function set (key, value, attributes) { 56 if (typeof document === 'undefined') { 57 return; 58 } 59 60 attributes = extend({ 61 path: '/' 62 }, api.defaults, attributes); 63 64 if (typeof attributes.expires === 'number') { 65 attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5); 66 } 67 68 // We're using "expires" because "max-age" is not supported by IE 69 attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; 70 71 try { 72 var result = JSON.stringify(value); 73 if (/^[\{\[]/.test(result)) { 74 value = result; 75 } 76 } catch (e) {} 77 78 value = converter.write ? 79 converter.write(value, key) : 80 encodeURIComponent(String(value)) 81 .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); 82 83 key = encodeURIComponent(String(key)) 84 .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent) 85 .replace(/[\(\)]/g, escape); 86 87 var stringifiedAttributes = ''; 88 for (var attributeName in attributes) { 89 if (!attributes[attributeName]) { 90 continue; 91 } 92 stringifiedAttributes += '; ' + attributeName; 93 if (attributes[attributeName] === true) { 94 continue; 95 } 96 97 // Considers RFC 6265 section 5.2: 98 // ... 99 // 3. If the remaining unparsed-attributes contains a %x3B (";") 100 // character: 101 // Consume the characters of the unparsed-attributes up to, 102 // not including, the first %x3B (";") character. 103 // ... 104 stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]; 105 } 106 107 return (document.cookie = key + '=' + value + stringifiedAttributes); 108 } 109 110 function get (key, json) { 111 if (typeof document === 'undefined') { 112 return; 113 } 114 115 var jar = {}; 116 // To prevent the for loop in the first place assign an empty array 117 // in case there are no cookies at all. 118 var cookies = document.cookie ? document.cookie.split('; ') : []; 119 var i = 0; 120 121 for (; i < cookies.length; i++) { 122 var parts = cookies[i].split('='); 123 var cookie = parts.slice(1).join('='); 124 125 if (!json && cookie.charAt(0) === '"') { 126 cookie = cookie.slice(1, -1); 127 } 128 129 try { 130 var name = decode(parts[0]); 131 cookie = (converter.read || converter)(cookie, name) || 132 decode(cookie); 133 134 if (json) { 135 try { 136 cookie = JSON.parse(cookie); 137 } catch (e) {} 138 } 139 140 jar[name] = cookie; 141 142 if (key === name) { 143 break; 144 } 145 } catch (e) {} 146 } 147 148 return key ? jar[key] : jar; 149 } 150 151 api.set = set; 152 api.get = function (key) { 153 return get(key, false /* read as raw */); 154 }; 155 api.getJSON = function (key) { 156 return get(key, true /* read as json */); 157 }; 158 api.remove = function (key, attributes) { 159 set(key, '', extend(attributes, { 160 expires: -1 161 })); 162 }; 163 164 api.defaults = {}; 165 166 api.withConverter = init; 167 168 return api; 169 } 170 171 return init(function () {}); 172})); 173 174 175/***/ }), 176 177/***/ 4891: 178/***/ (function(module, exports, __webpack_require__) { 179 180var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! formbouncerjs v1.4.6 | (c) 2019 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/bouncer */ 181"document"in self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||(function(e){"use strict";if("Element"in e){var t="classList",r="prototype",n=e.Element[r],a=Object,i=String[r].trim||function(){return this.replace(/^\s+|\s+$/g,"")},o=Array[r].indexOf||function(e){for(var t=0,r=this.length;t<r;t++)if(t in this&&this[t]===e)return t;return-1}
vendor: 7,655 bytes, lines 181-182
181,l=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},u=function(e,t){if(""===t)throw new l("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new l("INVALID_CHARACTER_ERR","String contains an invalid character");return o.call(e,t)},s=function(e){for(var t=i.call(e.getAttribute("class")||""),r=t?t.split(/\s+/):[],n=0,a=r.length;n<a;n++)this.push(r[n]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},c=s[r]=[],f=function(){return new s(this)};if(l[r]=Error[r],c.item=function(e){return this[e]||null},c.contains=function(e){return-1!==u(this,e+="")},c.add=function(){for(var e,t=arguments,r=0,n=t.length,a=!1;e=t[r]+"",-1===u(this,e)&&(this.push(e),a=!0),++r<n;);a&&this._updateClassName()},c.remove=function(){var e,t,r=arguments,n=0,a=r.length,i=!1;do{for(e=r[n]+"",t=u(this,e);-1!==t;)this.splice(t,1),i=!0,t=u(this,e)}while(++n<a);i&&this._updateClassName()},c.toggle=function(e,t){e+="";var r=this.contains(e),n=r?!0!==t&&"remove":!1!==t&&"add";return n&&this[n](e),!0===t||!1===t?t:!r},c.toString=function(){return this.join(" ")},a.defineProperty){var d={get:f,enumerable:!0,configurable:!0};try{a.defineProperty(n,t,d)}catch(e){void 0!==e.number&&-2146823252!==e.number||(d.enumerable=!1,a.defineProperty(n,t,d))}}else a[r].__defineGetter__&&n.__defineGetter__(t,f)}})(self),(function(){"use strict";var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function(e){var n=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var t,r=arguments.length;for(t=0;t<r;t++)e=arguments[t],n.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var r=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:r.call(this,e)}}e=null})()),Element.prototype.closest||(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest=function(e){var t=this;if(!document.documentElement.contains(this))return null;do{if(t.matches(e))return t;t=t.parentElement}while(null!==t);return null}),(function(){if("function"==typeof window.CustomEvent)return;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r}e.prototype=window.Event.prototype,window.CustomEvent=e})(),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),(function(e,t){ true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function(){return t(e)}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 182 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):0})("undefined"!=typeof __webpack_require__.g?__webpack_require__.g:"undefined"!=typeof window?window:this,(function(a){"use strict";var u={fieldClass:"error",errorClass:"error-message",fieldPrefix:"bouncer-field_",errorPrefix:"bouncer-error_",patterns:{email:/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*(\.\w{2,})+$/,url:/^(?:(?:https?|HTTPS?|ftp|FTP):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)(?:\.(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)*(?:\.(?:[a-zA-Z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/,number:/^(?:[-+]?[0-9]*[.,]?[0-9]+)$/,color:/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,date:/(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))/,time:/^(?:(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]))$/,month:/^(?:(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])))$/},customValidations:{},messageAfterField:!0,messageCustom:"data-bouncer-message",messageTarget:"data-bouncer-target",messages:{missingValue:{checkbox:"This field is required.",radio:"Please select a value.",select:"Please select a value.","select-multiple":"Please select at least one value.",default:"Please fill out this field."},patternMismatch:{email:"Please enter a valid email address.",url:"Please enter a URL.",number:"Please enter a number",color:"Please match the following format: #rrggbb",date:"Please use the YYYY-MM-DD format",time:"Please use the 24-hour time format. Ex. 23:00",month:"Please use the YYYY-MM format",default:"Please match the requested format."},outOfRange:{over:"Please select a value that is no more than {max}.",under:"Please select a value that is no less than {min}."},wrongLength:{over:"Please shorten this text to no more than {maxLength} characters. You are currently using {length} characters.",under:"Please lengthen this text to {minLength} characters or more. You are currently using {length} characters."},fallback:"There was an error with this field."},disableSubmit:!1,emitEvents:!0},s=function(e,t){Array.prototype.forEach.call(e,t)},c=function(){var r={};return s(arguments,(function(e){for(var t in e){if(!e.hasOwnProperty(t))return;"[object Object]"===Object.prototype.toString.call(e[t])?r[t]=c(r[t],e[t]):r[t]=e[t]}})),r},f=function(e,t,r){if("function"==typeof a.CustomEvent){var n=new CustomEvent(t,{bubbles:!0,detail:r||{}});e.dispatchEvent(n)}},d=function(e,t){return{missingValue:(function(e){if(!e.hasAttribute("required"))return!1;if("checkbox"===e.type)return!e.checked;var t=e.value.length;return"radio"===e.type&&(t=Array.prototype.filter.call(e.form.querySelectorAll('[name="'+m(e.name)+'"]'),(function(e){return e.checked})).length),t<1})(e),patternMismatch:(r=e,n=t,a=r.getAttribute("pattern"),!(!(a=a?new RegExp("^(?:"+a+")$"):n.patterns[r.type])||!r.value||r.value.length<1||r.value.match(a))),outOfRange:(function(e){if(!e.value||e.value.length<1)return!1;var t=e.getAttribute("max"),r=e.getAttribute("min"),n=parseFloat(e.value);return t&&t<n?"over":!!(r&&n<r)&&"under"})(e),wrongLength:(function(e){if(!e.value||e.value.length<1)return!1;var t=e.getAttribute("maxlength"),r=e.getAttribute("minlength"),n=e.value.length;return t&&t<n?"over":!!(r&&n<r)&&"under"})(e)};var r,n,a},m=function(e){for(var t,r=String(e),n=r.length,a=-1,i="",o=r.charCodeAt(0);++a<n;){if(0===(t=r.charCodeAt(a)))throw new InvalidCharacterError("Invalid character: the input contains U+0000.");1<=t&&t<=31||127==t||0===a&&48<=t&&t<=57||1===a&&48<=t&&t<=57&&45===o?i+="\\"+t.toString(16)+" ":i+=128<=t||45===t||95===t||48<=t&&t<=57||65<=t&&t<=90||97<=t&&t<=122?r.charAt(a):"\\"+r.charAt(a)}return i},h=function(e,t,r){var n=e.name?e.name:e.id;return!n&&r&&(n=t.fieldPrefix+Math.floor(999*Math.random()),e.id=n),"checkbox"===e.type&&(n+="_"+(e.value||e.id)),n},x=function(e,t){var r=document.createElement("div");r.className=t.errorClass,r.id=t.errorPrefix+h(e,t,!0);var n=(function(e,t,r){var n=e.getAttribute(r.messageTarget);if(n){var a=e.form.querySelector(n);if(a)return a.firstChild||a.appendChild(document.createTextNode(""))}
vendor: 7,074 bytes, lines 182-228
182return r.messageAfterField?(t.nextSibling||t.parentNode.appendChild(document.createTextNode("")),t.nextSibling):t})(e,(function(e){if("radio"===e.type&&e.name){var t=e.form.querySelectorAll('[name="'+m(e.name)+'"]');e=t[t.length-1]}"radio"!==e.type&&"checkbox"!==e.type||(e=e.closest("label")||e.form.querySelector('[for="'+e.id+'"]')||e);return e})(e),t);return n.parentNode.insertBefore(r,n),r},v=function(e,t,r){e.classList.add(r.fieldClass),e.setAttribute("aria-describedby",t.id),e.setAttribute("aria-invalid",!0)},g=function(e,t,r){var n,a,i,o=e.form.querySelector("#"+m(r.errorPrefix+h(e,r)))||x(e,r),l=(function(e,t,r){var n=r.messages;if(t.missingValue)return n.missingValue[e.type]||n.missingValue.default;if(t.outOfRange)return n.outOfRange[t.outOfRange].replace("{max}",e.getAttribute("max")).replace("{min}",e.getAttribute("min")).replace("{length}",e.value.length);if(t.wrongLength)return n.wrongLength[t.wrongLength].replace("{maxLength}",e.getAttribute("maxlength")).replace("{minLength}",e.getAttribute("minlength")).replace("{length}",e.value.length);if(t.patternMismatch){var a=e.getAttribute(r.messageCustom);return a||n.patternMismatch[e.type]||n.patternMismatch.default}for(var i in r.customValidations)if(r.customValidations.hasOwnProperty(i)&&t[i]&&n[i])return n[i];return n.fallback})(e,t,r);o.textContent="function"==typeof l?l(e,r):l,a=o,i=r,"radio"===(n=e).type&&n.name&&Array.prototype.forEach.call(document.querySelectorAll('[name="'+n.name+'"]'),(function(e){v(e,a,i)})),v(n,a,i),r.emitEvents&&f(e,"bouncerShowError",{errors:t})},i=function(e,t){e.classList.remove(t.fieldClass),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-invalid")},p=function(e,t){var r,n,a=e.form.querySelector("#"+m(t.errorPrefix+h(e,t)));a&&(a.parentNode.removeChild(a),n=t,"radio"===(r=e).type&&r.name?Array.prototype.forEach.call(document.querySelectorAll('[name="'+r.name+'"]'),(function(e){i(e,n)})):i(r,n),t.emitEvents&&f(e,"bouncerRemoveError"))};return function(n,e){var l,r={};r.validate=function(e,t){if(!e.disabled&&!e.readOnly&&"reset"!==e.type&&"submit"!==e.type&&"button"!==e.type){var r,n,a,i=c(l,t||{}),o=(a=d(r=e,n=i),{valid:!(function(e){for(var t in e)if(e[t])return!0;return!1})(a=(function(e,t,r,n){for(var a in r)r.hasOwnProperty(a)&&(t[a]=r[a](e,n));return t})(r,a,n.customValidations,n)),errors:a});if(!o.valid)return g(e,o.errors,i),o;p(e,i)}},r.validateAll=function(e){return Array.prototype.filter.call(e.querySelectorAll("input, select, textarea"),(function(e){var t=r.validate(e);return t&&!t.valid}))};var a=function(e){e.target.form&&e.target.form.matches(n)&&r.validate(e.target)},i=function(e){e.target.form&&e.target.form.matches(n)&&e.target.classList.contains(l.fieldClass)&&r.validate(e.target)},o=function(e){if(e.target.matches(n)){e.preventDefault();var t=r.validateAll(e.target);if(0<t.length)return t[0].focus(),void f(e.target,"bouncerFormInvalid",{errors:t});l.disableSubmit||e.target.submit(),l.emitEvents&&f(e.target,"bouncerFormValid")}};r.destroy=function(){var e,t,r;document.removeEventListener("blur",a,!0),document.removeEventListener("input",i,!1),document.removeEventListener("click",i,!1),document.removeEventListener("submit",o,!1),e=n,t=l,s(document.querySelectorAll(e),(function(e){s(e.querySelectorAll("input, select, textarea"),(function(e){p(e,t)}))})),r=n,s(document.querySelectorAll(r),(function(e){e.removeAttribute("novalidate")})),l.emitEvents&&f(document,"bouncerDestroyed",{settings:l}),l=null};var t;return l=c(u,e||{}),t=n,s(document.querySelectorAll(t),(function(e){e.setAttribute("novalidate",!0)})),document.addEventListener("blur",a,!0),document.addEventListener("input",i,!1),document.addEventListener("click",i,!1),document.addEventListener("submit",o,!1),l.emitEvents&&f(document,"bouncerInitialized",{settings:l}),r}})); 183 184/***/ }), 185 186/***/ 5724: 187/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 188 189"use strict"; 190__webpack_require__.r(__webpack_exports__); 191/* harmony export */ __webpack_require__.d(__webpack_exports__, { 192/* harmony export */ "default": () => (/* binding */ Checkout) 193/* harmony export */ }); 194/* harmony import */ var alpinejs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8705); 195/* harmony import */ var formbouncerjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4891); 196/* harmony import */ var formbouncerjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(formbouncerjs__WEBPACK_IMPORTED_MODULE_1__); 197/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2215); 198/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(js_cookie__WEBPACK_IMPORTED_MODULE_2__); 199function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 200function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } 201function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } 202function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 203function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 204function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } 205 206 207 208var Checkout = /*#__PURE__*/_createClass(function Checkout(_ref) { 209 var el = _ref.el; 210 _classCallCheck(this, Checkout); 211 window.Checkout = this; 212 window.Alpine = alpinejs__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A; 213 alpinejs__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.data('checkout', function (initialWebshopLanguage, cartLanguageUrls, isLoggedIn, country, validationRules) { 214 return { 215 isLoggedIn: isLoggedIn, 216 shippingSameAsBilling: !isLoggedIn, 217 currentWebshopLanguage: initialWebshopLanguage, 218 selectedBillingCountry: country, 219 selectedShippingCountry: country, 220 billingCountryValidation: {}, 221 cartLanguageUrls: cartLanguageUrls, 222 cartUrl: '', 223 showCountryAlert: false, 224 isAddingShippingAddress: false, 225 bouncer: new (formbouncerjs__WEBPACK_IMPORTED_MODULE_1___default())(), 226 onBillingCountryChange: function onBillingCountryChange(billingCountry) { 227 var _this = this; 228 this.selectedShippingCountry = this.selectedBillingCountry;
229 this.billingCountryValidation = this.getCurrentBillingCountryValidationRules(); 230 this.$nextTick(function () { 231 var _this$$refs$billingAd, _this$$refs$shippingA, _this$$refs$vatNumber, _this$$refs; 232 // Revalidate billingAddressZipCode 233 if ((_this$$refs$billingAd = _this.$refs.billingAddressZipCode) !== null && _this$$refs$billingAd !== void 0 && _this$$refs$billingAd.value) { 234 _this.bouncer.validate(_this.$refs.billingAddressZipCode); 235 } 236 237 // Revalidate ShippingAddressZipCode 238 if ((_this$$refs$shippingA = _this.$refs.shippingAddressZipCode) !== null && _this$$refs$shippingA !== void 0 && _this$$refs$shippingA.value) { 239 _this.bouncer.validate(_this.$refs.shippingAddressZipCode); 240 } 241 242 // Revalidate Vatnumber 243 if ((_this$$refs$vatNumber = _this.$refs.vatNumber) !== null && _this$$refs$vatNumber !== void 0 && _this$$refs$vatNumber.value) { 244 _this.bouncer.validate(_this.$refs.vatNumber); 245 } 246 247 // Revalidate shippingAddressSelect 248 if ((_this$$refs = _this.$refs) !== null && _this$$refs !== void 0 && _this$$refs.shippingAddressSelect) { 249 _this.bouncer.validate(_this.$refs.shippingAddressSelect); 250 } 251 }); 252 if (this.selectedBillingCountry) { 253 this.onShippingCountryChange(billingCountry); 254 } 255 }, 256 /** 257 * Show dialog if needed with redirect url 258 * Checking if it needs to block the checkout because of selected SalesOrganization is different from the current language shop 259 * @param {String} shippingCountryKey 260 */ 261 onShippingCountryChange: function onShippingCountryChange(shippingCountryKey) { 262 var _this$cartLanguageUrl, _this$cartLanguageUrl2; 263 if (!shippingCountryKey) return; 264 265 // AUDION-1205 - Force shippingCountry to BillingCountry if it somehow (by Autocomplete) is still set to an disabled option 266 if (shippingCountryKey !== this.selectedBillingCountry) { 267 this.selectedShippingCountry = this.selectedBillingCountry; 268 return; 269 } 270 this.showCountryAlert = false; 271 this.cartUrl = null; 272 var currentSalesOrganisation = (_this$cartLanguageUrl = this.cartLanguageUrls.find(function (cartUrl) { 273 return cartUrl.Language === initialWebshopLanguage; 274 })) === null || _this$cartLanguageUrl === void 0 ? void 0 : _this$cartLanguageUrl.SalesOrganization; 275 var newSalesOrganisation = (_this$cartLanguageUrl2 = this.cartLanguageUrls.find(function (cartUrl) { 276 return cartUrl.Key === shippingCountryKey; 277 })) === null || _this$cartLanguageUrl2 === void 0 ? void 0 : _this$cartLanguageUrl2.SalesOrganization; 278 if (newSalesOrganisation !== currentSalesOrganisation) { 279 this.showCountryAlert = true; 280 this.cartUrl = this.cartLanguageUrls.find(function (cartUrl) { 281 return cartUrl.Key === shippingCountryKey; 282 }).RedirectUrl; 283 this.language = this.cartLanguageUrls.find(function (cartUrl) { 284 return cartUrl.Key === shippingCountryKey; 285 }).Language; 286 } 287 }, 288 redirectShippingCountry: function redirectShippingCountry() { 289 js_cookie__WEBPACK_IMPORTED_MODULE_2___default().set('selectedLanguage', this.language, { 290 expires: 30 291 }); 292 window.location.replace(this.cartUrl); 293 }, 294 getKeyByCountryName: function getKeyByCountryName() { 295 var _this$cartLanguageUrl3; 296 var sel = document.getElementById('ShippingAddress'); 297 var text = sel.options[sel.selectedIndex].text; 298 var address = text.split(', '); 299 var country = address.length > 1 && address[address.length - 1]; 300 var key = (_this$cartLanguageUrl3 = this.cartLanguageUrls.find(function (cartUrl) { 301 return cartUrl.CountryName === country; 302 })) === null || _this$cartLanguageUrl3 === void 0 ? void 0 : _this$cartLanguageUrl3.Key; 303 return key; 304 }, 305 toggleAddShippingAddress: function toggleAddShippingAddress(e) { 306 var _this2 = this; 307 e.preventDefault(); 308 this.isAddingShippingAddress = !this.isAddingShippingAddress; 309 if (this.isAddingShippingAddress) { 310 this.$refs.shippingAddressSelect.value = ''; 311 } 312 this.$nextTick(function () { 313 var errorTarget = _this2.$refs.shippingAddressSelect.getAttribute('data-bouncer-target'); 314 _this2.$refs.shippingAddressSelect.classList.remove('error'); 315 document.querySelector("".concat(errorTarget)).textContent = ''; 316 317 // Check if default selected shipping country is in the correct shipping area (in or outside EU/UK) 318 var element = document.getElementById('shipping-country'); 319 if (element) { 320 var shippingCountry = element.selectedOptions[0].value; 321 _this2.onShippingCountryChange(shippingCountry); 322 } 323 if (_this2.isAddingShippingAddress) { 324 var inputStreetname = document.getElementById('shipping-streetname'); 325 var feedbackStreetname = document.getElementById('char-count-streetname'); 326 inputStreetname.addEventListener('input', function () { 327 if (this.value.length >= this.maxLength) { 328 feedbackStreetname.textContent = addressStreetnameFieldMaxCharMessage; 329 feedbackStreetname.className = 'character-feedback error'; 330 this.classList.add('max-reached'); 331 } else { 332 feedbackStreetname.textContent = ''; 333 this.classList.remove('max-reached'); 334 } 335 }); 336 var inputHousenumberAddition = document.getElementById('shipping-housenumberaddition'); 337 var feedbackHousenumberAddition = document.getElementById('char-count-housenumber-addition'); 338 inputHousenumberAddition.addEventListener('input', function () { 339 if (this.value.length >= this.maxLength) { 340 feedbackHousenumberAddition.textContent = addressHouseNumberAdditionFieldMaxCharMessage; 341 feedbackHousenumberAddition.className = 'character-feedback error'; 342 this.classList.add('max-reached'); 343 } else { 344 feedbackHousenumberAddition.textContent = ''; 345 this.classList.remove('max-reached'); 346 } 347 }); 348 } 349 }); 350 }, 351 getCurrentCountryISO: function getCurrentCountryISO() { 352 var selectedOption = this.$refs.billingCountrySelect.options[this.$refs.billingCountrySelect.selectedIndex]; 353 var countryIso = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.getAttribute('data-iso'); 354 return countryIso; 355 },
356 getCurrentBillingCountryValidationRules: function getCurrentBillingCountryValidationRules() { 357 var currentIso = this.getCurrentCountryISO(); 358 return validationRules.find(function (z) { 359 return z.ISO === currentIso; 360 }); 361 }, 362 onSubmit: function onSubmit(e) { 363 var fieldsWithErrors = this.bouncer.validateAll(e.target); 364 if (this.cartUrl) { 365 this.showCountryAlert = true; 366 return false; 367 } 368 if (fieldsWithErrors.length === 0) { 369 e.target.submit(); 370 } 371 }, 372 init: function init() { 373 var _this3 = this; 374 this.$watch('shippingSameAsBilling', function (value) { 375 var _this3$$refs, _this3$$refs$billingC; 376 (_this3$$refs = _this3.$refs) === null || _this3$$refs === void 0 || (_this3$$refs = _this3$$refs.shippingAddressSelect) === null || _this3$$refs === void 0 || _this3$$refs.classList.remove('error'); 377 _this3.onBillingCountryChange((_this3$$refs$billingC = _this3.$refs.billingCountrySelect) === null || _this3$$refs$billingC === void 0 ? void 0 : _this3$$refs$billingC.value); 378 }); 379 this.$nextTick(function () { 380 _this3.billingCountryValidation = _this3.getCurrentBillingCountryValidationRules(); 381 }); 382 } 383 }; 384 }); 385 alpinejs__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.start(); 386}); 387 388 389/***/ }) 390 391}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.