!function(e,s){"use strict";ElementsKit_Helper.registerWidget("elementskit-register-form.default",(function(s){let r=s.find(".ekit-register-form-wrapper"),t=r.find(".ekit-register-form");const i=window.ekit_config?.ajaxurl||null;r.find(".ekit-register-form-password-toggle").each((function(){let s=e(this),t=s.data("target"),i=r.find("#"+t);s.off("click").on("click",(function(){if(!i.length)return;let e="password"===i.attr("type");i.attr("type",e?"text":"password"),s.toggleClass("is-active",e),s.attr("aria-label",e?"Hide password":"Show password"),s.find(".ekit-eye").toggle(!e),s.find(".ekit-eye-off").toggle(e)}))})),t.on("submit",(function(s){s.preventDefault();const r=e(this);let t=r.find(".ekit-register-error-message"),n=r.find(".ekit-register-form-button"),a=r.find('input[name="user_login"]').val(),o=r.find('input[name="user_pass"]').val(),l=r.find('input[name="user_confirm_password"]').val(),d=r.find('input[name="user_email"]').val(),u=r.find('input[name="user_phone"]').val(),c=r.find('input[name="user_first_name"]').val(),f=r.find('input[name="user_last_name"]').val(),m=r.find('input[name="user_url"]').val(),g=r.find('input[name="redirect_to"]').val();a&&o&&d?l&&o!==l?t.length&&t.html("Passwords do not match.").removeClass("hidden success").addClass("error"):(t.length&&t.html("").removeClass("error success").addClass("hidden"),n.prop("disabled",!0).css("cursor","not-allowed"),e.ajax({url:i,type:"POST",data:{action:"ekit_register_user",user_login:a,user_email:d,user_pass:o,user_confirm_password:l||"",user_phone:u,first_name:c,last_name:f,user_url:m,redirect_to:g,security:window.ekit_config?.nonce||""},success:function(e){e.success?(t.length&&t.html(e.data.message).removeClass("hidden error").addClass("success"),e.data.redirect_url&&setTimeout((function(){window.location.href=e.data.redirect_url}),1e3)):t.length&&t.html(e.data?.message||"Registration failed. Please try again.").removeClass("hidden success").addClass("error")},error:function(){t.length&&t.html(window.ekit_config?.errorMessage||"An error occurred. Please try again.").removeClass("hidden success").addClass("error")},complete:function(){n.prop("disabled",!1)}})):t.length&&t.html("Please fill in all required fields.").removeClass("hidden success").addClass("error")}))}))}(jQuery,window.elementorFrontend);