(()=>{"use strict";window.newspack_grecaptcha=window.newspack_grecaptcha||{widgets:{},getCaptchaV3Token:function(){return new Promise(((e,a)=>{if(!grecaptcha||!t)return e("");grecaptcha?.ready||a("Error loading the reCAPTCHA library."),grecaptcha.ready((()=>{grecaptcha.execute(c,{action:"submit"}).then((t=>e(t))).catch((e=>a(e)))}))}))}};const e="v2"===newspack_recaptcha_data.version.substring(0,2),t="v3"===newspack_recaptcha_data.version,c=newspack_recaptcha_data.site_key,a="v2_invisible"===newspack_recaptcha_data.version;var n,r;function o(){[...document.querySelectorAll(".grecaptcha-container")].forEach((t=>{const n=t.id,r=t.closest("form"),o=a&&r&&[...r.querySelectorAll('input[type="submit"], button[type="submit"]')],i={sitekey:c,size:a?"invisible":"normal"};e&&a&&0{e.addEventListener("click",(e=>e.preventDefault())),i.callback=()=>r.requestSubmit(e);const c=grecaptcha.render(e||t,i);newspack_grecaptcha.widgets[n]=c}))}))}e&&(n=function(){grecaptcha.ready((function(){o()}))},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",n):n())),(r=jQuery)&&(r(document).on("updated_checkout",o),r(document.body).on("checkout_error",(function(){if(e){const{widgets:e}=newspack_grecaptcha;for(const t in e)grecaptcha.reset(newspack_grecaptcha.widgets[t])}})))})();