(()=>{var d=jQuery,u=({key:e,success:a,error:t})=>{grecaptcha.ready(()=>grecaptcha.execute(e,{action:"mbup"}).then(a).catch(t))};function m(){var e=d(this).attr("id");d(document).on("tinymce-editor-init",(a,t)=>{t.on("input keyup",()=>t.save())})}d(function(){d(".rwmb-wysiwyg").each(m)});var o=jQuery,h=e=>e.prop("disabled",!0),l=e=>e.prop("disabled",!1);function f(){let e=o(this),a="MBUP_Data_"+e.find('[name^="mbup_key"]').val(),t=window[a];if(typeof t!="object")return;typeof window.ajaxurl>"u"&&(window.ajaxurl=t.ajaxUrl);let r=e.find('[name^="rwmb_profile_submit"]'),c=()=>(o("#rwmb-validation-message").remove(),!o.validator||e.valid()),n=()=>HTMLFormElement.prototype.submit.call(e[0]);function p(s){t.recaptchaKey&&s.preventDefault(),c()&&(h(r),t.recaptchaKey?u({key:t.recaptchaKey,success:i=>{e.find('input[name="mbup_recaptcha_token"]').val(i),n()},error:()=>alert(t.captchaExecuteError)}):n())}r.on("click",p),w(t,e,r)}function w(e,a,t){if(!e.id_password||!e.id_password2)return;let r=a.find("#"+e.id_password),c=a.find("#"+e.id_password2),n=a.find("#password-strength");check=()=>y(e,t,n,r.val(),c.val()),r.on("keyup",check),c.on("keyup",check)}function y(e,a,t,r,c){let n=["very-weak","very-weak","weak","medium","strong","mismatch"],p=n.indexOf(e.strength);if(!r){t.hide();return}h(a),t.removeClass("very-weak weak medium strong mismatch").show();let s=wp.passwordStrength.meter(r,wp.passwordStrength.userInputDisallowedList(),c);if(0>s||5<s)return;let i=n[s];t.addClass(i).html(e[i]),p<=s&&s!==5&&l(a)}o(()=>o(".rwmb-form").each(f));})();
