!function(e){function t(){e("#user_registration_login_options_enable_recaptcha").is(":checked")?e("#user_registration_login_options_configured_captcha_type").closest(".user-registration-global-settings").show():e("#user_registration_login_options_configured_captcha_type").closest(".user-registration-global-settings").hide()}function s(t,s,i){if(t.length){var r=e('.ur-captcha-test-container[data-captcha-type="'+i+'"]').find(".ur-captcha-notice"),a=e('.ur-captcha-test-container[data-captcha-type="'+i+'"]').find(".ur-captcha-notice--icon"),n=e('.ur-captcha-test-container[data-captcha-type="'+i+'"]').find(".ur-captcha-notice--text");n.length&&(n.html(t),"success"===s?(r.removeClass().addClass("success").addClass("ur-captcha-notice"),a.addClass("dashicons dashicons-yes-alt")):"error"===s&&(r.removeClass().addClass("error").addClass("ur-captcha-notice"),a.addClass("dashicons dashicons-dismiss")))}e("#user_registration_captcha_setting_"+i+"_captcha_test .spinner").hide()}function i(){for(var e,t=[],s=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),i=0;i<s.length;i++)e=s[i].split("="),t.push(e[0]),t[e[0]]=e[1];return t}e("select#user_registration_allowed_screens").on("change",function(){"specific"===e(this).val()?(e(this).closest(".user-registration-global-settings").next(".user-registration-global-settings").hide(),e(this).closest(".user-registration-global-settings").next().next(".user-registration-global-settings").show()):"all_except"===e(this).val()?(e(this).closest(".user-registration-global-settings").next(".user-registration-global-settings").show(),e(this).closest(".user-registration-global-settings").next().next(".user-registration-global-settings").hide()):(e(this).closest(".user-registration-global-settings").next(".user-registration-global-settings").hide(),e(this).closest(".user-registration-global-settings").next().next(".user-registration-global-settings").hide())}).trigger("change"),e(".colorpick, .colorpickpreview").iris({change:function(t,s){e(this).parent().find(".colorpickpreview").css({backgroundColor:s.color.toString()})},hide:!0,border:!0}).on("click",function(){e(".iris-picker").hide(),e(this).closest(".user-registration-global-settings--field").find("> .iris-picker").show()}),e("body").on("click",function(){e(".iris-picker").hide()}),e(".colorpick, .colorpickpreview").on("click",function(e){e.stopPropagation()}),e(function(){var t=!1;e("input, textarea, select, checkbox").on("change",function(){t=!0}),e(".ur-nav-tab-wrapper a").on("click",function(){window.onbeforeunload=t?function(){return user_registration_settings_params.i18n_nav_warning}:""}),e(".submit input").on("click",function(){window.onbeforeunload=""})}),e(".user-registration").on("click",".select_all",function(){return e(this).closest("td").find("select option").attr("selected","selected"),e(this).closest("td").find("select").trigger("change"),!1}),e(".user-registration").on("click",".select_none",function(){return e(this).closest("td").find("select option").prop("selected",!1),e(this).closest("td").find("select").trigger("change"),!1}),t(),e(".user-registration").on("change","#user_registration_login_options_enable_recaptcha",function(){t()});var r=e(".user-registration").find("#user_registration_captcha_setting_invisible_recaptcha_v2").is(":checked");r!=undefined&&function(t){t?(e("#user_registration_captcha_setting_recaptcha_site_key").closest(".user-registration-global-settings").hide(),e("#user_registration_captcha_setting_recaptcha_site_secret").closest(".user-registration-global-settings").hide(),e("#user_registration_captcha_setting_recaptcha_invisible_site_key").closest(".user-registration-global-settings").show(),e("#user_registration_captcha_setting_recaptcha_invisible_site_secret").closest(".user-registration-global-settings").show()):(e("#user_registration_captcha_setting_recaptcha_site_key").closest(".user-registration-global-settings").show(),e("#user_registration_captcha_setting_recaptcha_site_secret").closest(".user-registration-global-settings").show(),e("#user_registration_captcha_setting_recaptcha_invisible_site_key").closest(".user-registration-global-settings").hide(),e("#user_registration_captcha_setting_recaptcha_invisible_site_secret").closest(".user-registration-global-settings").hide())}(r),e(".user-registration").on("change","input#user_registration_captcha_setting_invisible_recaptcha_v2",function(){e(this).is(":checked")?(e("#user_registration_captcha_setting_recaptcha_site_key").closest(".user-registration-global-settings").hide(),e("#user_registration_captcha_setting_recaptcha_site_secret").closest(".user-registration-global-settings").hide(),e("#user_registration_captcha_setting_recaptcha_invisible_site_key").closest(".user-registration-global-settings").show(),e("#user_registration_captcha_setting_recaptcha_invisible_site_secret").closest(".user-registration-global-settings").show()):(e("#user_registration_captcha_setting_recaptcha_site_key").closest(".user-registration-global-settings").show(),e("#user_registration_captcha_setting_recaptcha_site_secret").closest(".user-registration-global-settings").show(),e("#user_registration_captcha_setting_recaptcha_invisible_site_key").closest(".user-registration-global-settings").hide(),e("#user_registration_captcha_setting_recaptcha_invisible_site_secret").closest(".user-registration-global-settings").hide())});var a=!1;e(".user-registration-global-settings").find("input, select").on("change",function(){a=!0,e(this).closest(".ur-captcha-settings-body").find(".user_registration_captcha_setting_captcha_test").closest(".user-registration-global-settings").hide()}),e(".user-registration").on("click",".user_registration_captcha_setting_captcha_test",function(t){if(t.preventDefault(),t.stopPropagation(),a)alert(user_registration_settings_params.i18n.unsaved_changes);else{var i=e(this).attr("data-captcha-type"),r=!1;if("v2"===i)r=e("#user_registration_captcha_setting_invisible_recaptcha_v2").is(":checked");e.ajax({type:"POST",url:user_registration_settings_params.ajax_url,data:{action:"user_registration_captcha_test",security:user_registration_settings_params.user_registration_captcha_test_nonce,captcha_type:i,invisible_recaptcha:r},beforeSend:function(){var t=e("#user_registration_captcha_setting_"+i+"_captcha_test .spinner");t.show(),setTimeout(function(){t.hide()},2500)},success:function(t){var r=e('.ur-captcha-test-container[data-captcha-type="'+i+'"] .ur-captcha-node'),a=t.data.ur_recaptcha_code;if(void 0!==a&&a.site_key.length&&0!==r.length)switch(i){case"v2":google_recaptcha_login=grecaptcha.render(r.find(".g-recaptcha").attr("id"),{sitekey:a.site_key,theme:"light",style:"transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;"}),"false"!==a.is_invisible&&grecaptcha.execute(google_recaptcha_login).then(function(e){null===e?s(user_registration_settings_params.i18n.captcha_success,"success",i):s(user_registration_settings_params.i18n.captcha_failed,"error",i)});break;case"v3":try{grecaptcha.execute(a.site_key,{action:"click"}).then(function(e){s(user_registration_settings_params.i18n.captcha_success,"success",i)})}catch(o){s(o.message,"error",i)}break;case"hCaptcha":console.log(hcaptcha),google_recaptcha_login=hcaptcha.render(r.find(".g-recaptcha-hcaptcha").attr("id"),{sitekey:a.site_key,theme:"light","error-callback":function(e){console.log(e)},style:"transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;"});break;case"cloudflare":try{turnstile.render("#"+r.find(".cf-turnstile").attr("id"),{sitekey:a.site_key,theme:a.theme_mode,style:"transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;"}),r.find("iframe").css("display","block")}catch(o){s(o.message,"error",i)}}if(!t.success){var n=t.data;return console.log(n),void s(n,"error",i)}}})}}),e(".ur-redirect-to-login-page").ready(function(){var t=e(".ur-redirect-to-login-page"),s=e("#user_registration_login_options_prevent_core_login"),i=e("#user_registration_login_options_login_redirect_url");s.prop("checked")?i.prop("required",!0):t.val("").closest(".single_select_page").css("display","none")}),e("#user_registration_login_options_prevent_core_login").on("change",function(){var t=e("#user_registration_login_options_prevent_core_login");e(".single_select_page").toggle(),e("#user_registration_login_options_login_redirect_url").prop("required",function(){return"checked"===t.prop("checked")})}),e("#user_registration_disable_profile_picture").on("change",function(){var t=parseInt(user_registration_settings_params.is_advanced_field_active);e(this).prop("checked")&&1===t?e("#user_registration_sync_profile_picture").closest(".user-registration-global-settings").css("display","flex"):(e("#user_registration_sync_profile_picture").prop("checked",!1),e("#user_registration_sync_profile_picture").closest(".user-registration-global-settings").css("display","none"))}),e("#user_registration_sync_profile_picture").ready(function(){$this=e("#user_registration_sync_profile_picture"),$this.prop("checked")?$this.closest(".user-registration-global-settings").css("display","flex"):e("#user_registration_disable_profile_picture").prop("checked")&&1===parseInt(user_registration_settings_params.is_advanced_field_active)?$this.closest(".user-registration-global-settings").css("display","flex"):$this.closest(".user-registration-global-settings").css("display","none")}),e(".user-registration-custom-file__input").on("change",function(){var t=e(".user-registration-custom-file__input").prop("files")[0];e(".user-registration-custom-selected-file").html(t.name)}),e(".ur-image-uploader").on("click",function(t){ur_uploader=e(this),t.preventDefault();var s=wp.media({library:{type:["image"]},title:ur_uploader.upload_file,multiple:!1}).open().on("select",function(e){var t=s.state().get("selection").first().toJSON().url;ur_uploader.attr("src",t),ur_uploader.hasClass("ur-button")?(ur_uploader.siblings("img").show(),ur_uploader.siblings("img").attr("src",t),ur_uploader.siblings("#user_registration_pdf_logo_image").val(t),ur_uploader.hide(),ur_uploader.siblings(".ur-image-remover").show()):(ur_uploader.attr("src",t),ur_uploader.siblings("#user_registration_pdf_logo_image").val(t))})}),e(".ur-image-remover").on("click",function(t){var s=e(this);t.preventDefault(),s.siblings("img").attr("src",""),s.siblings("#user_registration_pdf_logo_image").val(""),s.siblings(".ur-image-uploader").show(),s.hide(),s.siblings("img").hide()}),e(".radio-image").find("input").each(function(){e(this).on("click",function(){e(this).closest("ul").find("label").removeClass("selected"),e(this).closest("label").addClass("selected")})}),e(".user-registration #mainform").on("keyup keypress",function(e){if(13===(e.keyCode||e.which))return e.preventDefault(),!1}),e(".user-registration #ur-search-settings").autocomplete({source:function(t,s){var i=t.term,r=new FormData;r.append("search_string",i),r.append("action","user_registration_search_global_settings"),r.append("security",user_registration_settings_params.user_registration_search_global_settings_nonce),e(".user-registration-search-icon").hide(),e.ajax({url:user_registration_settings_params.ajax_url,dataType:"json",cache:!1,contentType:!1,processData:!1,data:r,type:"post",complete:function(t){if(!0===t.responseJSON.success){var i=t.responseJSON.data.results;s(i)}e(".user-registration-search-icon").show()}})},classes:{"ui-autocomplete":"user-registration-ui-autocomplete"},minLength:3,focus:function(t,s){return e(".user-registration-ui-autocomplete > li").attr("title",s.item.desc),e("#ur-search-settings").val(s.item.label),!1},select:function(t,s){return"no_result_found"!==s.item.value&&(e(".user-registration #ur-search-settings").val(s.item.label),window.location.href=s.item.value),!1}}),e("#user_registration_login_options_login_redirect_url, #user_registration_myaccount_page_id").on("change",function(){var t=e(this),s={action:"user_registration_my_account_selection_validator",security:user_registration_settings_params.user_registration_my_account_selection_validator_nonce};s.user_registration_selected_my_account_page=t.val(),t.prop("disabled",!0),t.css("border","1px solid #e1e1e1"),t.closest(".user-registration-global-settings--field").find(".error.inline").remove(),t.closest(".user-registration-global-settings").append('<div class="ur-spinner is-active"></div>'),e.ajax({url:user_registration_settings_params.ajax_url,data:s,type:"POST",complete:function(e){!1===e.responseJSON.success?(t.closest(".user-registration-global-settings--field").append("<div id='message' class='error inline' style='padding:10px;'>"+e.responseJSON.data.message+"</div>"),t.css("border","1px solid red"),t.closest("form").find("input[name='save']").prop("disabled",!0)):t.closest("form").find("input[name='save']").prop("disabled",!1),t.prop("disabled",!1),t.closest(".user-registration-global-settings").find(".ur-spinner").remove()}})}),e("#ur-settings-collapse").on("click",function(t){t.preventDefault(),e(this).hasClass("close")?(e(this).closest("header").addClass("collapsed"),e(this).removeClass("close").addClass("open"),function(e,t){var s={value:t,expiry:(new Date).getTime()+864e5};localStorage.setItem(e,JSON.stringify(s))}("ur-settings-navCollapsed",!0)):(e(this).closest("header").removeClass("collapsed"),e(this).removeClass("open").addClass("close"),localStorage.removeItem("ur-settings-navCollapsed"))});if("collapsed"==(!0===function(e){var t=localStorage.getItem(e);if(!t)return!1;var s=JSON.parse(t);return!((new Date).getTime()>s.expiry&&(localStorage.removeItem(e),1))}("ur-settings-navCollapsed")?"collapsed":"not-collapsed")?(e(".user-registration-header").addClass("collapsed"),e("#ur-settings-collapse").removeClass("close").addClass("open")):(e(".user-registration-header").removeClass("collapsed"),e("#ur-settings-collapse").removeClass("open").addClass("close")),e(".ur-nav-premium").each(function(){e(this).hover(function(t){e(this).find(".ur-tooltip").show()},function(t){e(this).find(".ur-tooltip").hide()})}),e(".ur-search-input").on("click",function(){e(this).closest(".user-registration-header").hasClass("collapsed")&&(e(this).closest(".user-registration-header").removeClass("collapsed"),e(this).closest(".user-registration-header").find("#ur-settings-collapse").addClass("close"),e(this).find("#ur-search-settings").focus())}),"undefined"!=typeof i().searched_option||null!=i().searched_option){var n=e("#"+i().searched_option).closest(".user-registration-global-settings");n.addClass("ur-searched-settings-focus");var o=e(".ur-searched-settings-focus").offset().top;window.scrollTo({top:o-300,behavior:"smooth"}),setTimeout(function(){n.removeClass("ur-searched-settings-focus")},2e3)}e("body").on("click",".user-registration-inactive-addon",function(t){$this=e(this),t.preventDefault();var s=$this.data("video"),i=$this.data("title"),r=e(this).data("available-in"),a="";""!==s&&(a='<div style="width: 535px; height: 300px;"><iframe width="100%" height="100%" frameborder="0" src="https://www.youtube.com/embed/'+s+'" rel="1" allowfullscreen></iframe></div><br>');var n=a+user_registration_settings_params.i18n.upgrade_message;n=n.replace("%title%",i).replace("%plan%",r);var o='<i class="dashicons dashicons-lock" style="color:#72aee6; border-color: #72aee6;"></i><span class="user-registration-swal2-modal__title">'+i+" "+user_registration_settings_params.i18n.pro_feature_title;Swal.fire({title:o,html:n,customClass:"user-registration-swal2-modal user-registration-swal2-modal--centered user-registration-locked-field",showCloseButton:!0,showConfirmButton:!0,allowOutsideClick:!0,heightAuto:!1,width:"575px",confirmButtonText:user_registration_settings_params.i18n.upgrade_plan}).then(function(e){e.isConfirmed&&window.open(user_registration_settings_params.i18n.upgrade_link,"_blank")})}),e(document).find(".user-registration-global-settings--field").find(".ur-radio-group-list--item").each(function(){e(this).on("click",function(){e(this).closest(".ur-radio-group-list").find(".active").find("input").prop("checked",!1),e(this).closest(".ur-radio-group-list").find(".active").removeClass("active"),e(this).addClass("active"),e(this).find("input").prop("checked",!0)})}),e(document).ready(function(){e(document).on("change","#user_registration_hide_show_sidebar",function(t){!function(t){var s=e(t).is(":checked");localStorage.setItem("isSidebarEnabled",s),document.cookie="isSidebarEnabled="+s+"; path=/;",s?(e("body").removeClass("ur-settings-sidebar-hidden").addClass("ur-settings-sidebar-show"),e(t).closest(".user-registration-options-header--top__right").find(".user-registration-toggle-text").text("Sidebar")):(e("body").removeClass("ur-settings-sidebar-show").addClass("ur-settings-sidebar-hidden"),e(t).closest(".user-registration-options-header--top__right").find(".user-registration-toggle-text").text("Sidebar"))}(e(this))}),function(){var t=e(".user-registration").find("form")[0],s=!1;e(t).on("change",function(e){"user_registration_enable_sidebar"!==e.target.name&&(s=!0)});var i=!1;e(t).on("submit",function(){i=!0}),e(t).find(".ur-nav__link").on("click",function(){i=!0}),e(window).on("beforeunload",function(e){s&&!i?(e.preventDefault(),e.returnValue=""):e.stopImmediatePropagation()})}(),function(){var t,s=document.getElementsByClassName("accordion");for(t=0;t<s.length;t++)s[t].nextElementSibling.style.display="none",s[t].addEventListener("click",function(){this.classList.toggle("active");var e=this.nextElementSibling;"block"===e.style.display?e.style.display="none":e.style.display="block"});e.each(e(".ur-captcha-settings"),function(){e(this).find(".ur-captcha-settings-body .ur-captcha-enable").is(":checked")&&e(this).find(".ur-captcha-settings-header .integration-status").addClass("ur-integration-account-connected")})}()}),e(document).find(".wp-list-table").wrap("<div class='ur-list-table-wrapper'></div>")}(jQuery);