!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=39)}({39:function(e,n){var t=window.simplePayForms;function r(e){e.preventDefault();var n=e.target,t=n.formId,r=n.i18n,o=n.querySelector(".simpay-payment-btn"),i=o.querySelector("span"),a=o.innerHTML;o.disabled=!0,i.innerText=r.paymentButtonLoadingText;var u=n.querySelector(".simpay-errors");u.innerHTML="",function(e){if(window.simpayGoogleRecaptcha){var n=window.simpayGoogleRecaptcha.siteKey;return new Promise((function(e){grecaptcha.execute(n,{action:"simpay_payment"}).then((function(n){return e(n)})).catch((function(){return e(null)}))}))}var t=e.querySelector('[name="h-captcha-response"]');if(t)return Promise.resolve(t.value);var r=e.querySelector('[name="cf-turnstile-response"]');return r?Promise.resolve(r.value):Promise.resolve(null)}(n).then((function(e){return window.wp.apiFetch({url:window.spGeneral.strings.wpJsonUrl+"wpsp/__internal__/payment/create",method:"POST",data:{token:e,form_id:t,price_id:Object.values(n.settings.prices)[0].id,quantity:1}}).then((function(e){var n=e.redirect;window.location.href=n}))})).catch((function(e){var n=e.message;o.disabled=!1,u.innerHTML=n,o.innerHTML=a,wp.a11y.speak(n,"assertive")}))}function o(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.formId=parseInt(e.dataset.simpayFormId),n||(n=t[e.formId]),(e=Object.assign(e,n)).addEventListener("submit",r)}window.document.addEventListener("DOMContentLoaded",(function(){var e=document.querySelectorAll(".simpay-checkout-form");0!==e.length&&e.forEach((function(e){o(e)}))})),window.wpsp={initPaymentForm:o}}});