((e,t)=>{var n;(n=Joomla.getOptions("com_convertforms.altcha"))&&n.language&&n.strings&&e.$altcha&&e.$altcha.i18n.set(n.language,n.strings),ConvertForms.Helper.onReady(function(){t.querySelectorAll("altcha-widget.cf-altcha").forEach(function(t){var n,r,e,i=t.closest(".convertforms");i&&(r=n=!1,t.addEventListener("statechange",function(e){e=e.detail&&e.detail.state;n="verified"===e,!r||"verified"!==e&&"unverified"!==e&&"expired"!==e&&"error"!==e||(r=!1,i.ConvertForms.submit())}),"onfocus"===t.getAttribute("auto")&&(t.setAttribute("auto","off"),t.addEventListener("focusin",e=function(){t.removeEventListener("focusin",e),"function"==typeof t.verify&&t.verify()})),i.addEventListener("beforeSubmit",function(e){e.defaultPrevented||n||(e.preventDefault(),r=!0,"function"==typeof t.verify&&t.verify())}),i.addEventListener("afterSubmit",function(){n=!1,"function"==typeof t.reset&&t.reset()}))})})})(window,document);

