jQuery(function(e){e(".ur-frontend-form").find("form.login").each(function(){e(this).find("#user_registration_ajax_login_submit").on("click",function(r){r.preventDefault();var s=e(this),t=s.closest("form").find('input[name="username"]').val(),a=s.closest("form").find('input[name="password"]').val(),n=s.closest("form").find('input[name="rememberme"]').val(),i=s.closest("form").find('input[name="redirect"]').val();if("hCaptcha"===ur_login_params.recaptcha_type)var o=s.closest("form").find('[name="h-captcha-response"]').val();else if("cloudflare"===ur_login_params.recaptcha_type)o=s.closest("form").find('[name="cf-turnstile-response"]').val();else o=s.closest("form").find('[name="g-recaptcha-response"]').val();var u=ur_login_params.ajax_url+"?action=user_registration_ajax_login_submit&security="+ur_login_params.ur_login_form_save_nonce;window.location.href.indexOf("pl=true")>-1&&(u+="&pl=true"),s.closest("form").find(".ur-submit-button").siblings("span").addClass("ur-front-spinner");var l={username:t,password:a,CaptchaResponse:o,redirect:i};s.closest("form").find('input[name="rememberme"]').is(":checked")&&(l.rememberme=n),e.ajax({type:"POST",url:u,data:l,success:function(r){s.closest("form").find(".ur-submit-button").siblings("span").removeClass("ur-front-spinner"),0==r.success?(e(document).trigger("user_registration_after_login_failed",[s]),s.closest("#user-registration").find(".user-registration-error").remove(),s.closest("#user-registration").find(".user-registration-message").remove(),s.closest("#user-registration").prepend('<ul class="user-registration-error">'+r.data.message+"</ul>")):r.data.status?(s.closest("#user-registration").find(".user-registration-error").remove(),s.closest("#user-registration").find(".user-registration-message").remove(),s.closest("#user-registration").prepend('<ul class="user-registration-message">'+r.data.message+"</ul>"),s.closest("#user-registration").find("input#username").val("")):window.location.href=r.data.message}})})})});