1(()=>{"use strict";var e={744:e=>{var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function i(e,t,n){return e.concat(t).map((function(e){return o(e,n)}))}function r(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,n,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=o;var c=Array.isArray(n);return c===Array.isArray(e)?c?l.arrayMerge(e,n,l):function(e,t,n){var i={};return n.isMergeableObject(e)&&r(e).forEach((function(t){i[t]=o(e[t],n)})),r(t).forEach((function(r){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,r)||(s(e,r)&&n.isMergeableObject(t[r])?i[r]=function(e,t){if(!t.customMerge)return a;var n=t.customMerge(e);return"function"==typeof n?n:a}(r,n)(e[r],t[r],n):i[r]=o(t[r],n))})),i}(e,n,l):o(n,l)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return a(e,n,t)}),{})};var l=a;e.exports=l},988:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this._el=e,e.$emitter=this,this._listeners=[]}return e.prototype.publish=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n=!1);var o=new CustomEvent(e,{detail:t,cancelable:n});return this.el.dispatchEvent(o),o},e.prototype.subscribe=function(e,t,n){void 0===n&&(n={});var o=this,i=e.split("."),r=n.scope?t.bind(n.scope):t;if(n.once&&!0===n.once){var s=r;r=function(t){o.unsubscribe(e),s(t)}}return this.el.addEventListener(i[0],r),this.listeners.push({splitEventName:i,opts:n,cb:r}),!0},e.prototype.unsubscribe=function(e){var t=this,n=e.split(".");return this.listeners=this.listeners.reduce((function(e,o){return o.splitEventName.sort().toString()===n.sort().toString()?(t.el.removeEventListener(o.splitEventName[0],o.cb),e):(e.push(o),e)}),[]),!0},e.prototype.reset=function(){var e=this;return this.listeners.forEach((function(t){e.el.removeEventListener(t.splitEventName[0],t.cb)})),this.listeners=[],!0},Object.defineProperty(e.prototype,"el",{get:function(){return this._el},set:function(e){this._el=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"listeners",{get:function(){return this._listeners},set:function(e){this._listeners=e},enumerable:!1,configurable:!0}),e}();t.default=n},512:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(988)),r=o(n(744)),s=function(){function e(e,t,n){void 0===t&&(t={}),void 0===n&&(n=!1),this.el=e,this.$emitter=new i.default(this.el),this._pluginName=this._getPluginName(n),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}return e.prototype._init=function(){this._initialized||(this.init(),this._initialized=!0)},e.prototype._update=function(){this._initialized&&this.update()},e.prototype.update=function(){},e.prototype._registerInstance=function(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)},e.prototype._getPluginName=function(e){return!1===e?this.constructor.name:e},e.prototype._mergeOptions=function(e){var t=this._pluginName.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase(),n=this.parseJsonOrFail(t);let o="";"function"==typeof this.el.getAttribute&&(o=this.el.getAttribute("data-".concat(t,"-options"))||"");var i=[this.constructor.options,this.options,e];n&&i.push(window.PluginConfigManager.get(this._pluginName,n));try{o&&i.push(JSON.parse(o))}catch(e){throw new Error('The data attribute "data-'.concat(t,'-options" could not be parsed to json: ').concat(e.message||""))}return r.default.all(i.filter((function(e){return e instanceof Object&&!(e instanceof Array)})).map((function(e){return e||{}})))},e.prototype.parseJsonOrFail=function(e){if("function"!=typeof this.el.getAttribute)return"";const t=this.el.getAttribute("data-".concat(e,"-config"))||"";try{return JSON.parse(t)}catch(e){return t}},e}();t.default=s}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};
1return e[o].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var o=n(744),i=n.n(o);const r="application/json";class s{get(e,t=null,n=null,o=r){this.send("GET",e,null,t,n,o)}post(e,t=null,n=null,o=null,i=r){this.send("POST",e,t,n,o,i)}send(e,t,n=null,o=null,i=null,s=r){const a=new XMLHttpRequest;a.open(e,t),a.setRequestHeader("Content-Type",s),a.onload=function(){if(!o||"function"!=typeof o)return;const e=a.getResponseHeader("content-type"),t="response"in a?a.response:a.responseText;e.indexOf("application/json")>-1?o(JSON.parse(t)):o(t)},a.onerror=function(){i&&"function"==typeof o&&i()},a.send(n)}}var a=n(512),l=n.n(a);class c extends(l()){}class d extends c{static options={newCardMandateOption:null,mollieCreditCardFormClass:".mollie-components-credit-card",mollieCreditCardMandateInput:'input[name="mollieCreditCardMandate"]',mollieShouldSaveCardDetailInput:'input[name="mollieShouldSaveCardDetail"]'};init(){this.client=new s,this._fixShopUrl()}registerMandateEvents(){const{newCardMandateOption:e}=this.options;e&&(this.mollieCreditCarfFormEl=document.querySelector(".mollie-components-credit-card"),this.mollieCreditCardMandateEls=document.querySelectorAll('input[name="mollieCreditCardMandate"]'),this.mollieCreditCarfFormEl&&this.mollieCreditCardMandateEls&&this._registerRadioButtonsEvent())}_fixShopUrl(){null!=this.options.shopUrl&&"/"===this.options.shopUrl.substr(-1)&&(this.options.shopUrl=this.options.shopUrl.substr(0,this.options.shopUrl.length-1))}_registerRadioButtonsEvent(){this.onMandateInputChange(this.getMandateCheckedValue()),this.mollieCreditCardMandateEls.forEach((e=>{e.addEventListener("change",(()=>{this.onMandateInputChange(this.getMandateCheckedValue())}))}))}getMandateCheckedValue(){const{mollieCreditCardMandateInput:e}=this.options,t=document.querySelector(`${e}:checked`);return t&&t.value?t.value:null}isValidSelectedMandate(e){return e&&e!==this.options.newCardMandateOption}shouldSaveCardDetail(){const e=document.querySelector('input[name="mollieShouldSaveCardDetail"]');return!!e&&e.checked}onMandateInputChange(e){const{newCardMandateOption:t}=this.options;e!==t?null!==e&&this.mollieCreditCarfFormEl.classList.add("d-none"):this.mollieCreditCarfFormEl.classList.remove("d-none")}}class u extends d{static options=i()(d.options,{customerId:null,locale:null,profileId:null,shopUrl:null,testMode:!0});init(){super.init();const e=this;let t=null;const n=document.querySelector(this.getSelectors().mollieController);n&&n.remove();const o=document.querySelector(this.getSelectors().cardHolder),i=document.querySelector(this.getSelectors().componentsContainer),r=document.querySelector(this.getSelectors().paymentForm),s=document.querySelectorAll(this.getSelectors().radioInputs),a=document.querySelector(this.getSelectors().submitButton);i&&o&&(t=Mollie(this.options.profileId,{locale:this.options.locale,testmode:this.options.testMode})),this.createComponentsInputs(t,[this.getInputFields().cardHolder,this.getInputFields().cardNumber,this.getInputFields().expiryDate,this.getInputFields().verificationCode]),s.forEach((t=>{t.addEventListener("change",(()=>{e.showComponents()}))})),a.addEventListener("click",(n=>{n.preventDefault(),e.submitForm(n,t,r)})),this.registerMandateEvents()}getSelectors(){return{cardHolder:"#cardHolder",componentsContainer:"div.mollie-components-credit-card",creditCardRadioInput:'#confirmPaymentForm input[type="radio"].creditcard',mollieController:"div.mollie-components-controller",paymentForm:"#confirmPaymentForm",radioInputs:'#confirmPaymentForm input[type="radio"]',submitButton:'#confirmPaymentForm button[type="submit"]'}}getDefaultProperties(){return{styles:{base:{backgroundColor:"#fff",fontSize:"14px",padding:"10px 10px","::placeholder":{color:"rgba(68, 68, 68, 0.2)"}},valid:{color:"#090"},invalid:{backgroundColor:"#fff1f3"}}}}getInputFields(){return{cardHolder:{name:"cardHolder",id:"#cardHolder",errors:"cardHolderError"},cardNumber:{name:"cardNumber",id:"#cardNumber",errors:"cardNumberError"},expiryDate:{name:"expiryDate",id:"#expiryDate",errors:"expiryDateError"},verificationCode:{name:"verificationCode",id:"#verificationCode",errors:"verificationCodeError"}}}
1showComponents(){const e=document.querySelector(this.getSelectors().creditCardRadioInput),t=document.querySelector(this.getSelectors().componentsContainer);t&&(void 0===e||!1===e.checked?t.classList.add("d-none"):t.classList.remove("d-none"))}createComponentsInputs(e,t){const n=this;t.forEach(((t,o,i)=>{const r=e.createComponent(t.name,n.getDefaultProperties());r.mount(t.id),i[o][t.name]=r,r.addEventListener("change",(e=>{const n=document.getElementById(`${t.name}`),o=document.getElementById(`${t.errors}`);e.error&&e.touched?(n.classList.add("error"),o.textContent=e.error):(n.classList.remove("error"),o.textContent="")})),r.addEventListener("focus",(()=>{n.setFocus(`${t.id}`,!0)})),r.addEventListener("blur",(()=>{n.setFocus(`${t.id}`,!1)}))}))}setFocus(e,t){document.querySelector(e).classList.toggle("is-focused",t)}disableForm(){const e=document.querySelector(this.getSelectors().submitButton);e&&(e.disabled=!0)}enableForm(){const e=document.querySelector(this.getSelectors().submitButton);e&&(e.disabled=!1)}async submitForm(e,t,n){e.preventDefault();const o=this;this.disableForm();const i=document.querySelector(this.getSelectors().creditCardRadioInput);if(null!=i&&!1!==i.checked||!n||n.submit(),i&&!0===i.checked){const e=this.getMandateCheckedValue();if(this.isValidSelectedMandate(e))return void this.client.get(o.options.shopUrl+"/mollie/components/store-mandate-id/"+o.options.customerId+"/"+e,(()=>{n.submit()}),(()=>{n.submit()}),"application/json; charset=utf-8");const i=document.getElementById(`${this.getInputFields().verificationCode.errors}`);i.textContent="";const{token:r,error:s}=await t.createToken();if(s)return this.enableForm(),void(i.textContent=s.message);if(!s){let e=new URLSearchParams({shouldSaveCardDetail:this.shouldSaveCardDetail()}).toString();e&&(e=`?${e}`),this.client.get(o.options.shopUrl+"/mollie/components/store-card-token/"+o.options.customerId+"/"+r+e,(()=>{document.getElementById("cardToken").setAttribute("value",r),n.submit()}),(()=>{n.submit()}),"application/json; charset=utf-8")}}}}class m{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return m.isIPhoneDevice()||m.isIPadDevice()}static isNativeWindowsBrowser(){return m.isIEBrowser()||m.isEdgeBrowser()}static isIPhoneDevice(){return!!navigator.userAgent.match(/iPhone/i)}static isIPadDevice(){return!!navigator.userAgent.match(/iPad/i)}static isIEBrowser(){return-1!==navigator.userAgent.toLowerCase().indexOf("msie")||!!navigator.userAgent.match(/Trident.*rv:\d+\./)}static isEdgeBrowser(){return!!navigator.userAgent.match(/Edge\/\d+/i)}static getList(){return{"is-touch":m.isTouchDevice(),"is-ios":m.isIOSDevice(),"is-native-windows":m.isNativeWindowsBrowser(),"is-iphone":m.isIPhoneDevice(),"is-ipad":m.isIPadDevice(),"is-ie":m.isIEBrowser(),"is-edge":m.isEdgeBrowser()}}}class p{constructor(e){this.csrf=e}isActive(){return void 0!==this.csrf&&!1!==this.csrf.enabled&&"ajax"===this.csrf.mode}}class h{constructor(e){this._document=e}getPaymentForm(){return this._document.querySelector("#changePaymentForm")}getConfirmForm(){return this._document.querySelector("#confirmOrderForm")}getSubmitButton(){let e=this._document.querySelector("#confirmFormSubmit");return null===e&&(e=this._document.querySelector('#confirmOrderForm > button[type="submit"]')),e}}class f extends d{static options=i()(d.options,{paymentId:null,customerId:null,locale:null,profileId:null,shopUrl:null,testMode:!0});init(){super.init();try{const e=new h(document);this._paymentForm=e.getPaymentForm(),this._confirmForm=e.getConfirmForm(),this._confirmFormButton=e.getSubmitButton()}catch(e){return void console.error("Mollie Credit Card components: Required HTML elements not found on this page!")}this._initializeComponentInstance(),this._registerEvents(),this.registerMandateEvents()}_initializeComponentInstance(){const e=document.querySelector(this.getSelectors().cardHolder);document.querySelector(this.getSelectors().componentsContainer)&&e&&!window.mollieComponentsObject&&(window.mollieComponentsObject=Mollie(this.options.profileId,{locale:this.options.locale,testmode:this.options.testMode}),window.mollieComponents={}),this.createComponentsInputs()}_registerEvents(){null!==this._confirmForm&&this._confirmForm.addEventListener("submit",this.submitForm.bind(this))}_reactivateFormSubmit(){this._confirmFormButton.disabled=!1;const e=this._confirmFormButton.querySelector(".loader");e&&e.remove()}getSelectors(){return{cardHolder:"#cardHolder",componentsContainer:"div.mollie-components-credit-card",credit
1CardRadioInput:'#changePaymentForm input[type="radio"]',mollieController:"div.mollie-components-controller",paymentForm:"#changePaymentForm",confirmForm:"#confirmOrderForm",confirmFormButton:'#confirmOrderForm > button[type="submit"]'}}getDefaultProperties(){return{styles:{base:{backgroundColor:"#fff",fontSize:"14px",padding:"10px 10px","::placeholder":{color:"rgba(68, 68, 68, 0.2)"}},valid:{color:"#090"},invalid:{backgroundColor:"#fff1f3"}}}}getInputFields(){return{cardHolder:{name:"cardHolder",id:"#cardHolder",errors:"cardHolderError"},cardNumber:{name:"cardNumber",id:"#cardNumber",errors:"cardNumberError"},expiryDate:{name:"expiryDate",id:"#expiryDate",errors:"expiryDateError"},verificationCode:{name:"verificationCode",id:"#verificationCode",errors:"verificationCodeError"}}}createComponentsInputs(){const e=this,t=[this.getInputFields().cardHolder,this.getInputFields().cardNumber,this.getInputFields().expiryDate,this.getInputFields().verificationCode];window.mollieComponentsObject&&t.forEach(((t,n,o)=>{const i=this._mountMollieComponent(t.id,t.name);o[n][t.name]=i,i.addEventListener("change",(e=>{const n=document.getElementById(`${t.name}`),o=document.getElementById(`${t.errors}`);e.error&&e.touched?(n.classList.add("error"),o.textContent=e.error):(n.classList.remove("error"),o.textContent="")})),i.addEventListener("focus",(()=>{e.setFocus(`${t.id}`,!0)})),i.addEventListener("blur",(()=>{e.setFocus(`${t.id}`,!1)}))}))}_mountMollieComponent(e,t){return window.mollieComponents[t]?window.mollieComponents[t].unmount():window.mollieComponents[t]=window.mollieComponentsObject.createComponent(t,this.getDefaultProperties()),window.mollieComponents[t].mount(e),window.mollieComponents[t]}setFocus(e,t){document.querySelector(e).classList.toggle("is-focused",t)}async submitForm(e){const t=this,n=this._confirmForm,o=document.querySelector(`${this.get
1Selectors().creditCardRadioInput}[value="${this.options.paymentId}"]`);if((null==o||!1===o.checked)&&this._confirmForm)return;if(o&&!1===o.checked)return;e.preventDefault();const i=this.getMandateCheckedValue();if(this.isValidSelectedMandate(i))return void this.client.get(t.options.shopUrl+"/mollie/components/store-mandate-id/"+t.options.customerId+"/"+i,(()=>{t.continueShopwareCheckout(n)}),(()=>{t.continueShopwareCheckout(n)}),"application/json; charset=utf-8");const r=document.getElementById(`${this.getInputFields().verificationCode.errors}`);r.textContent="";const{token:s,error:a}=await window.mollieComponentsObject.createToken();if(a)return r.textContent=a.message,this._reactivateFormSubmit(),void r.scrollIntoView();let l=new URLSearchParams({shouldSaveCardDetail:this.shouldSaveCardDetail()}).toString();l&&(l=`?${l}`),this.client.get(t.options.shopUrl+"/mollie/components/store-card-token/"+t.options.customerId+"/"+s+l,(function(){t.continueShopwareCheckout(n)}),(function(){t.continueShopwareCheckout(n)}),"application/json; charset=utf-8")}continueShopwareCheckout(e){if(m.isIEBrowser()){const t=function(e,t){const n=document.createElement("input");return n.type="checkbox",n.name=e,n.checked=t,n.style.display="none",n},n=document.getElementById("tos");null!=n&&e.insertAdjacentElement("beforeend",t("tos",n.checked))}new p(window.csrf).isActive()||e.submit()}}class g{APPLE_PAY_VERSION=3;constructor(){this.client=new s}create(e,t,n,o,i,r,s){const a=this;var l=["name","email","postalAddress"];1===o&&l.push("phone");let c=!1;null!==r&&(c=r.value);var d={countryCode:t,currencyCode:n,requiredShippingContactFields:l,supportedNetworks:["amex","maestro","masterCard","visa","vPay"],merchantCapabilities:["supports3DS"],total:{label:"",amount:0}};const u=new ApplePaySession(this.APPLE_PAY_VERSION,d);return u.onvalidatemerchant=function(e){a.client.post(i+"/mollie/apple-pay/validate",JSON.stringify({validationUrl:e.validationURL}),(t=>{if(!1===t.success)throw new Error("Validation failed for URL: "+e.validationURL);const n=JSON.parse(t.session);u.completeMerchantValidation(n)}),(()=>{u.abort()}))},u.onshippingcontactselected=function(e){var t="";void 0!==e.shippingContact.countryCode&&(t=e.shippingContact.countryCode),a.client.post(i+"/mollie/apple-pay/shipping-methods",JSON.stringify({countryCode:t}),(e=>{e.success?u.completeShippingContactSelection(ApplePaySession.STATUS_SUCCESS,e.shippingmethods,e.cart.total,e.cart.items):u.completeShippingContactSelection(ApplePaySession.STATUS_FAILURE,[],{label:"",amount:0,pending:!0},[])}),(()=>{u.abort()}))},u.onshippingmethodselected=function(e){a.client.post(i+"/mollie/apple-pay/set-shipping",JSON.stringify({identifier:e.shippingMethod.identifier}),(e=>{e.success?u.completeShippingMethodSelection(ApplePaySession.STATUS_SUCCESS,e.cart.total,e.cart.items):u.completeShippingMethodSelection(ApplePaySession.STATUS_FAILURE,{label:"",amount:0,pending:!0},[])}),(()=>{u.abort()}))},u.onpaymentauthorized=function(e){var t=e.payment.token;t=JSON.stringify(t),u.completePayment(ApplePaySession.STATUS_SUCCESS),a.finishPayment(i+"/mollie/apple-pay/start-payment",t,e.payment,c),s.classList.remove("processed")},u.oncancel=function(){e&&a.client.post(i+"/mollie/apple-pay/restore-cart"),s.classList.remove("processed")},u}finishPayment(e,t,n,o){const i=function(e,t){const n=document.createElement("input");return n.type="hidden",n.name=e,n.value=t,n},r=document.createElement("form");r.action=e,r.method="POST";let s=n.shippingContact.addressLines[0];n.shippingContact.addressLines.length>1&&(s+=" "+n.shippingContact.addressLines[1]),r.insertAdjacentElement("beforeend",i("email",n.shippingContact.emailAddress)),r.insertAdjacentElement("beforeend",i("lastname",n.shippingContact.familyName)),r.insertAdjacentElement("beforeend",i("firstname",n.shippingContact.givenName)),r.insertAdjacentElement("beforeend",i("street",s)),r.insertAdjacentElement("beforeend",i("postalCode",n.shippingContact.postalCode)),r.insertAdjacentElement("beforeend",i("city",n.shippingContact.locality)),r.insertAdjacentElement("beforeend",i("acceptedDataProtection",o)),void 0!==n.shippingContact.phoneNumber&&n.shippingContact.phoneNumber.length>0&&r.insertAdjacentElement("beforeend",i("phone",n.shippingContact.phoneNumber)),r.insertAdjacentElement("beforeend",i("countryCode",n.shippingContact.countryCode)),r.insertAdjacentElement("beforeend",i("paymentToken",t)),document.body.insertAdjacentElement("beforeend",r),r.submit()}}class y{constructor(e=null){this.target=e,null===this.target&&(this.target=document)}findAll(e=null){let t=".mollie-express-button";return null!==e&&(t+=e),this.target.querySelectorAll(t)}}class v{find(e){let t=e.closest(".product-action");return null===t&&(t=e.closest(".product-detail-form-container")),null===t&&(t=e.closest(".offcanvas-cart-actions")),null===t&&(t=e.closest(".checkout-aside-container")),null===t&&(t=e.closest(".checkout-main")),t}}class b{constructor(){this.buyElementRepository=new v}find(e){const t=this.buyElementRepository.find(e);return null===t?null:t.querySelector(".mollie-privacy-note")}getCheckbox(e){return e.querySelector('input[name="acceptedDataProtection"]')}validate(e){const t=this.getCheckbox(e),n=t.checked?1:0;return t.classList.remove("is-invalid"),0!==n||(t.classList.add("is-invalid"),!1)}observeButtons(){const e=document.querySelectorAll(".mollie-privacy-note:not(.observed)"),t=new v;e.forEach((e=>{e.classList.add("observed");
1const n=t.find(e),o=new y(n).findAll();0===o.length&&e.classList.add("d-none"),o.forEach((t=>{new MutationObserver((t=>{let n=o.length;e.classList.remove("d-none"),t.forEach((e=>{e.target.classList.contains("d-none")&&n--})),n<=0&&e.classList.add("d-none")})).observe(t,{attributes:!0,attributeFilter:["class"]})}))}))}}class C{constructor(){this.buyElementRepository=new v}find(e){const t=this.buyElementRepository.find(e);return null===t?null:t.querySelector(".btn-buy")}}class E{addItemToCart(e){const t=(new C).find(e);if(!(t instanceof HTMLButtonElement))return;const n=t.closest("form");if(!(n instanceof HTMLFormElement))return;const o=new FormData(n);o.delete("redirectTo"),o.append("isExpressCheckout","1"),fetch(n.action,{method:n.method,body:o}).finally((()=>{}))}}const S="BindExpressEvents";class w extends c{init(){const e=window.PluginManager.getPluginList().OffCanvasCart.get("instances");e.length>0&&e.forEach((e=>{e.$emitter.subscribe("offCanvasOpened",this.bindEvents.bind(this))})),this.bindEvents()}bindEvents(){(new b).observeButtons(),document.addEventListener(S,(e=>{const t=e.detail;if(0===t.length)return;const n=new C;t.forEach((e=>{e.classList.remove("d-none"),e.addEventListener("click",this.onButtonClick);const t=n.find(e);if(!(t instanceof HTMLButtonElement))return;t.hasAttribute("disabled")&&(e.classList.add("d-none"),e.removeEventListener("click",this.onButtonClick));const o=t.closest("form");o instanceof HTMLFormElement&&o.addEventListener("change",(()=>{e.classList.remove("d-none"),e.addEventListener("click",this.onButtonClick),t.hasAttribute("disabled")&&(e.classList.add("d-none"),e.removeEventListener("click",this.onButtonClick))}))}))}))}onButtonClick(e){let t=e.target;if(t instanceof HTMLButtonElement||(t=t.closest("button")),t.classList.contains("processed"))return;const n=new b,o=n.find(t);if(o instanceof HTMLDivElement&&(o.classList.add("was-validated"),!1===n.validate(o)))return;t.classList.add("processed"),(new E).addItemToCart(t);const i=new e.constructor(e.type,e);t.dispatchEvent(i)}}class _ extends c{init(){const e=window.PluginManager.getPluginList().OffCanvasCart.get("instances");e.length>0&&e.forEach((e=>{e.$emitter.subscribe("offCanvasOpened",this.bindEvents.bind(this))})),this.bindEvents()}bindEvents(){if(!window.ApplePaySession||!window.ApplePaySession.canMakePayments())return;const e=(new y).findAll(".js-apple-pay"),t=document.querySelectorAll(".js-apple-pay-container");0===e.length&&0===t.length||(document.dispatchEvent(new CustomEvent(S,{detail:e})),t.forEach((e=>{e.classList.remove("d-none")})),e.forEach((e=>{e.classList.remove("d-none"),e.addEventListener("click",this.onExpressCheckout)})))}onExpressCheckout(e){const t=e.target;if(!t.classList.contains("processed"))return;const n=(new v).find(t),o=n.querySelector('input[name="countryCode"]').value,i=n.querySelector('input[name="currency"]').value,r=n.querySelector('input[name="mode"]').value,s=parseInt(n.querySelector('input[name="withPhone"]').value),a=n.querySelector('input[name="acceptedDataProtection"]'),l="productMode"===r;let c=t.getAttribute("data-shop-url");"/"===c.slice(-1)&&(c=c.slice(0,-1)),(new g).create(l,o,i,s,c,a,t).begin()}}class M extends c{init(){!this.options.hideAlways&&window.ApplePaySession&&window.ApplePaySession.canMakePayments()||(this.hideApplePay(".payment-method-input.applepay"),this.hideApplePay("#paymentMethod"+this.options.applePayId),this.options.hideApplePayOption&&this.hideApplePaySelect(this.options.applePayId))}hideApplePay(e){const t=document.querySelector(e),n=this.getClosest(t,".payment-method");n&&n.classList&&n.remove()}hideApplePaySelect(e){document.querySelector('option[value="'+e+'"]').remove()}getShopUrl(){let e=this.options.shopUrl;if(void 0===e)return"";for(;"/"===e.substr(-1);)e=e.substr(0,e.length-1);return e}getClosest(e,t){for(Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){const t=(this.document||this.ownerDocument).querySelectorAll(e);let n=t.length;for(;--n>=0&&t.item(n)!==this;);return n>-1});e&&e!==document;e=e.parentNode)if(e.matches(t))return e;return null}}class P extends c{static options={shopUrl:null,customerId:null,mollieMandateContainerClass:".mollie-credit-card-mandate",mollieMandateDataId:"data-mollie-credit-card-mandate-id",mollieMandateRemoveButtonClass:".mollie-credit-card-mandate-remove",mollieMandateRemoveModalButtonClass:".mollie-credit-card-mandate-remove-modal-button",mollieMandateDeleteAlertSuccessId:"#mollieCredit
1CardMandateDeleteSuccess",mollieMandateDeleteAlertErrorId:"#mollieCreditCardMandateDeleteError"};init(){const{shopUrl:e,customerId:t}=this.options;if(!e)throw new Error(`The "shopUrl" option for the plugin "${this._pluginName}" is not defined.`);if(!t)throw new Error(`The "customerId" option for the plugin "${this._pluginName}" is not defined.`);this.mollieMandateDeleteAlertEl=document.querySelector("#mollieCreditCardMandateDeleteSuccess"),this.mollieMandateDeleteAlertEl&&(this.mollieMandateDeleteAlertErrorEl=document.querySelector("#mollieCreditCardMandateDeleteError"),this.mollieMandateDeleteAlertErrorEl&&(this.client=new s,this.registerEvents()))}registerEvents(){const e=document.querySelectorAll(".mollie-credit-card-mandate-remove");if(!e||0===e.length)return;const t=document.querySelectorAll(".mollie-credit-card-mandate-remove-modal-button");t&&0!==t.length&&(e.forEach((e=>{e.addEventListener("click",(t=>{t.preventDefault(),this.onRemoveButtonClick(e)}))})),t.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),this.onConfirmRemoveButtonClick()}))})))}onRemoveButtonClick(e){const{mollieMandateContainerClass:t,mollieMandateDataId:n}=this.options;this.currentContainerEl=e.closest(t),this.currentContainerEl&&(this.currentMandateId=this.currentContainerEl.getAttribute(n))}onConfirmRemoveButtonClick(){const{currentContainerEl:e,currentMandateId:t}=this;e&&t&&this.deleteMandate(t).then((({success:t})=>{t?(this.mollieMandateDeleteAlertErrorEl.classList.add("d-none"),this.mollieMandateDeleteAlertEl.classList.remove("d-none"),e.remove()):(this.mollieMandateDeleteAlertEl.classList.add("d-none"),this.mollieMandateDeleteAlertErrorEl.classList.remove("d-none"))}))}deleteMandate(e){const{shopUrl:t,customerId:n}=this.options;return new Promise((o=>{this.client.get(t+"/mollie/components/revoke-mandate/"+n+"/"+e,(e=>{o({success:e&&e.success})}),(()=>{o({success:!1})}),"application/json; charset=utf-8")}))}}class A extends c{_shopUrl="";_customerId="";_dropdownTerminals=null;_isModalForm=!1;_container=null;_paymentForm=null;_radioInputs=null;_posRadioInput=null;init(){this._container=document.querySelector("div.mollie-pos-terminals"),void 0!==this._container&&null!==this._container&&(this.initControls(),null!==this._paymentForm&&null!==this._dropdownTerminals&&(this.registerEvents(),this.updateDropdownVisibility(this._posRadioInput,this._container,this._dropdownTerminals),this.updateTerminal(this._shopUrl,this._customerId,this._posRadioInput,this._dropdownTerminals,(function(){}))))}initControls(){this._shopUrl=this._container.getAttribute("data-shop-url"),"/"===this._shopUrl.substr(-1)&&(this._shopUrl=this._shopUrl.substr(0,this._shopUrl.length-1)),this._customerId=this._container.getAttribute("data-customer-id"),this._dropdownTerminals=document.querySelector("#posTerminals"),this._paymentForm=document.querySelector("#changePaymentForm"),void 0!==this._paymentForm&&null!==this._paymentForm&&(this._radioInputs=this._paymentForm.querySelectorAll('input[type="radio"]'),this._posRadioInput=this._paymentForm.querySelector('input[type="radio"].pointofsale'))}registerEvents(){if(null===this._paymentForm)return;const e=this._shopUrl,t=this._customerId,n=this._container,o=this._radioInputs,i=this._posRadioInput,r=this._dropdownTerminals;o.forEach((e=>{e.addEventListener("change",(()=>{this.updateDropdownVisibility(i,n,r)}))})),r.addEventListener("change",(async()=>{this.updateTerminal(e,t,i,r,(function(){}))}))}updateDropdownVisibility(e,t,n){let o=!1;void 0===e||!1===e.checked?t.classList.add("d-none"):(t.classList.remove("d-none"),o=!0),void 0!==n&&(n.required=o)}updateTerminal(e,t,n,o,i){void 0!==n?null!==n?!1!==n.checked?void 0!==o?null!==o?""!==o.value?(new s).get(e+"/mollie/pos/store-terminal/"+t+"/"+o.value,(function(){i("terminal updated successfully")}),(function(){i("error when updating terminal")}),"application/json; charset=utf-8"):i("no POS terminal selected"):i("POS terminals not found"):i("POS terminals not defined"):i("POS payment not active"):i("POS Radio Input not found"):i("POS Radio Input not defined")}}class I extends(l()){init(){const e=window.PluginManager.getPluginList().OffCanvasCart.get("instances");e.length>0&&e.forEach((e=>{e.$emitter.subscribe("offCanvasOpened",this.bindEvents.bind(this))})),this.bindEvents()}bindEvents(){const e=(new y).findAll(".mollie-paypal-button");0!==e.length&&(document.dispatchEvent(new CustomEvent(S,{detail:e})),e.forEach((e=>{e.addEventListener("click",this.onExpressCheckout)})))}onExpressCheckout(e){const t=e.target;if(!t.classList.contains("processed"))return;const n=t.getAttribute("data-form-action"),o=document.createElement("form");o.setAttribute("action",n),o.setAttribute("method","POST");const i=new b,r=i.find(t);if(r instanceof HTMLDivElement){const e=i.getCheckbox(r).checked?"on":"";o.setAttribute("acceptedDataProtection",e)}document.body.insertAdjacentElement("beforeend",o),o.submit()}}
1class L extends c{init(){const e=document.getElementById("mollieBancomatPayPhone");if(null===e)return;const t=document.querySelector(".mollie-bancomat-pay"),n=document.querySelector('.mollie-bancomat-pay [data-form-validation-invalid-phone="true"]');e.addEventListener("focus",(e=>{t.classList.add("was-validated"),e.target.removeAttribute("invalid"),n.classList.add("d-none")})),e.addEventListener("blur",(e=>{const t=e.target.form;return!1===t.reportValidity()&&(e.target.setAttribute("invalid",!0),n.classList.remove("d-none")),t.reportValidity()}))}}class F{register(){const e=window.PluginManager;e.register("MollieExpressActions",w),e.register("MollieApplePayDirect",_),e.register("PayPalExpressPlugin",I),e.register("MollieApplePayPaymentMethod",M,"[data-mollie-template-applepay-account]"),e.register("MollieApplePayPaymentMethod",M,"[data-mollie-template-applepay-checkout]"),e.register("MollieCreditCardComponents",u,"[data-mollie-template-creditcard-components]"),e.register("MollieCreditCardComponentsSw64",f,"[data-mollie-template-creditcard-components-sw64]"),e.register("MollieCreditCardMandateManage",P,"[data-mollie-credit-card-mandate-manage]"),e.register("MolliePosTerminal",A,"[data-mollie-template-pos-terminal]"),e.register("MollieBancomatPlugin",L)}}window.addEventListener("load",(function(){void 0!==window.mollie_javascript_use_shopware&&"1"!==window.mollie_javascript_use_shopware&&((new F).register(),window.dispatchEvent(new Event("mollieLoaded")),window.PluginManager.initializePlugins())}))})();
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.