!function(r){function e(){var e=function(e){var o=e.login_settings,n=[];return r.each(o.sections,function(e,o){r.each(o.settings,function(r,e){n.push({option:e.id,type:e.type})})}),n}(ur_login_form_params),n=[];r.each(e,function(e,o){if("toggle"===o.type)var i=r("#"+o.option).is(":checked");else i=r("#"+o.option).val();n.push({option:o.option,value:i})});var i={action:"user_registration_login_settings_save_action",security:ur_login_form_params.ur_login_settings_save,data:{setting_data:n}};r.ajax({url:ur_login_form_params.ajax_url,data:i,type:"POST",beforeSend:function(){r(".ur_save_login_form_action_button").append('')},complete:function(e){r(".ur_save_login_form_action_button").find(".ur-spinner").remove();var n=ur_login_form_params.i18n_admin.i18n_settings_successfully_saved;if(!0===e.responseJSON.success)o(n,"success");else{o(JSON.parse(e.responseText).data.message,"error")}}})}function o(e,o){var i=r(".ur-form-container").find(".ur-builder-message-container"),s=r("#wpadminbar"),t="";0===i.length&&(r(".ur-form-container").append('
'),(i=r(".ur-form-container").find(".ur-builder-message-container")).css({top:s.height()+"px"})),"success"===o?t='':(r(".ur-error").remove(),t='');var a=r(t).prependTo(i);setTimeout(function(){a.addClass("entered")},50),1==r(".ur-error").find(".ur-captcha-error").length?(r(".ur-error").css("width","490px"),setTimeout(function(){n(a)},5e3)):setTimeout(function(){n(a)},3e3)}function n(r){r.removeClass("entered").addClass("exiting"),setTimeout(function(){r.remove()},120)}function i(){var e=r("#user_registration_login_title").is(":checked"),o=r(".ur-login-form-wrapper").find(".ur-frontend-form.login");e?(o.find(".user-registration-login-title").show(),o.find(".user-registration-login-description").show()):(o.find(".user-registration-login-description").hide(),o.find(".user-registration-login-title").hide())}function s(){var e=r("#user_registration_login_options_remember_me").is(":checked"),o=r(".ur-login-form-wrapper").find(".ur-frontend-form.login");e?o.find("#rememberme").parent("label").show():o.find("#rememberme").parent("label").hide()}function t(){var e=r("#user_registration_login_options_lost_password").is(":checked"),o=r(".ur-login-form-wrapper").find(".ur-frontend-form.login");e?o.find(".user-registration-LostPassword").show():o.find(".user-registration-LostPassword").hide()}function a(){var e=r("#user_registration_login_options_hide_labels").is(":checked"),o=r(".ur-login-form-wrapper").find(".ur-frontend-form.login");e?o.find(".user-registration-form-row label").hide():o.find(".user-registration-form-row label").show()}function _(){var e=r("#user_registration_general_setting_registration_url_options").val(),o=r(".ur-login-form-wrapper").find(".ur-frontend-form.login");""===e.trim()?o.find(".user-registration-register").hide():o.find(".user-registration-register").show()}function l(){r("#user_registration_login_options_enable_recaptcha").is(":checked")?r("#user_registration_login_options_configured_captcha_type").closest(".user-registration-login-form-global-settings").show():r("#user_registration_login_options_configured_captcha_type").closest(".user-registration-login-form-global-settings").hide()}function u(){r("#user_registration_pro_general_setting_prevent_active_login").is(":checked")?r("#user_registration_pro_general_setting_limited_login").closest(".user-registration-login-form-global-settings").show():r("#user_registration_pro_general_setting_limited_login").closest(".user-registration-login-form-global-settings").hide()}function g(){var e=r("#user_registration_pro_passwordless_login").is(":checked"),o=r(".ur-login-form-wrapper").find(".ur-frontend-form.login");e?(o.find(".user-registration-passwordless-login").show(),r("#user_registration_pro_passwordless_login_default_login_area").closest(".user-registration-login-form-global-settings").show()):(o.find(".user-registration-passwordless-login").hide(),r("#user_registration_pro_passwordless_login_default_login_area").closest(".user-registration-login-form-global-settings").hide()),d(r("#user_registration_pro_passwordless_login_default_login_area"))}function d(e){var o=e.is(":checked"),n=r(".ur-login-form-wrapper").find(".ur-frontend-form.login");r("#user_registration_pro_passwordless_login").is(":checked")&&o?(n.find(".user-registration-passwordless-login").hide(),n.find(".password-input-group").closest(".form-row").hide(),n.find(".user-registration-before-login-btn").hide()):r("#user_registration_pro_passwordless_login").is(":checked")&&!o?(n.find(".user-registration-passwordless-login").show(),n.find(".password-input-group").closest(".form-row").show(),n.find(".user-registration-before-login-btn").show()):(n.find(".user-registration-passwordless-login").hide(),n.find(".password-input-group").closest(".form-row").show(),n.find(".user-registration-before-login-btn").show())}function f(){var e=r("#user_registration_pro_general_setting_login_form").is(":checked"),o=r(".ur-login-form-wrapper").find(".ur-frontend-form.login");e?o.find(".user-registration-form-row span.ur-icon").show():o.find(".user-registration-form-row span.ur-icon").hide()}r(document).ready(function(){if(l(),r(document).on("change","#user_registration_login_options_enable_recaptcha",function(){l()}),r(document).on("change","#user_registration_pro_general_setting_login_form",function(){f()}),f(),u(),r(document).on("change","#user_registration_pro_general_setting_prevent_active_login",function(){u()}),g(),r(document).on("change","#user_registration_pro_passwordless_login",function(){g()}),r(document).on("change","#user_registration_pro_passwordless_login_default_login_area",function(){d(r(this))}),r("#user_registration_login_options_form_template").on("change",function(){var e=r("#user_registration_login_options_form_template").val(),o=r(".ur-login-form-wrapper").find(".ur-frontend-form.login");o.removeClass("ur-frontend-form--rounded-edge"),o.removeClass("ur-frontend-form--rounded"),o.removeClass("ur-frontend-form--flat"),o.removeClass("ur-frontend-form--bordered"),"default"!==e&&(e="rounded_edge"===e?"rounded ur-frontend-form--rounded-edge":e,o.addClass("ur-frontend-form--"+e))}),r(document).on("change","#user_registration_login_title",function(r){i()}),i(),r(document).on("change","#user_registration_login_options_remember_me",function(r){s()}),s(),r(document).on("change","#user_registration_login_options_lost_password",function(r){t()}),t(),r(document).on("change","#user_registration_login_options_hide_labels",function(r){a()}),a(),r("#user_registration_general_setting_registration_url_options").on("keyup",function(){_()}),_(),r("#user_registration_general_setting_registration_label").on("keyup",function(){var e=r("#user_registration_general_setting_registration_label").val();r(".ur-login-form-wrapper").find(".ur-frontend-form.login").find(".user-registration-register a").html(e)}),r("#user_registration_label_lost_your_password").on("keyup",function(){var e=r("#user_registration_label_lost_your_password").val();r(".ur-login-form-wrapper").find(".ur-frontend-form.login").find(".user-registration-LostPassword a").html(e)}),r("#user_registration_label_login").on("keyup",function(){var e=r("#user_registration_label_login").val();r(".ur-login-form-wrapper").find(".ur-frontend-form.login").find(".user-registration-Button").html(e)}),r("#user_registration_label_remember_me").on("keyup",function(){var e=r("#user_registration_label_remember_me").val();r(".ur-login-form-wrapper").find(".ur-frontend-form.login").find(".user-registration-form__label-for-checkbox span").html(e)}),r("#user_registration_label_password").on("keyup",function(){var e=r("#user_registration_label_password").val();r(".ur-login-form-wrapper").find(".ur-frontend-form.login").find(".user-registration-form-row[data-field='password'] label").html(e+'*')}),r("#user_registration_label_username_or_email").on("keyup",function(){var e=r("#user_registration_label_username_or_email").val();r(".ur-login-form-wrapper").find(".ur-frontend-form.login").find(".user-registration-form-row label[for='username']").html(e+'*')}),r("#user_registration_placeholder_username_or_email").on("keyup",function(){var e=r("#user_registration_placeholder_username_or_email").val();r(".ur-login-form-wrapper").find(".ur-frontend-form.login").find(".user-registration-form-row #username").attr("placeholder",e)}),r("#user_registration_placeholder_password").on("keyup",function(){var e=r("#user_registration_placeholder_password").val();r(".ur-login-form-wrapper").find(".ur-frontend-form.login").find(".user-registration-form-row #password").attr("placeholder",e)}),ur_login_form_params.is_login_settings_page){r(window).on("keydown",function(r){if((r.ctrlKey||r.metaKey)&&("s"===String.fromCharCode(r.which).toLowerCase()||83===r.which))return r.preventDefault(),e(),!1});r("#toplevel_page_user-registration").find(".wp-submenu").find('li a[href="admin.php?page=user-registration"]').first().closest("li").addClass("current")}r(".ur_save_login_form_action_button").on("click",function(){e()})})}(jQuery);