!function(){var a=function(r,e){return $("#msg").attr("trspan",r),$("#msg").html(window.translate(r)),$("#color").removeClass("message-positive message-warning message-danger alert-success alert-warning alert-danger"),$("#color").addClass("message-"+e),"positive"===e&&(e="success"),$("#color").addClass("alert-"+e),$("#msg").attr("role","danger"===e?"alert":"status")},s=function(r,e,s){if(console.log("Error",s),(s=JSON.parse(r.responseText))&&s.error)return s=s.error.replace(/.* /,""),console.log("Returned error",s),a(s,"warning")},r=function(){var r=$("#password2f").val(),e=$("#password2fverify").val();return r?$.ajax({type:"POST",url:portal+"2fregisters/password/verify",dataType:"json",data:{password:r,passwordverify:e},error:s,success:function(r){return r.error?r.error.match(/PE34/)?a(r.error,"warning"):a(r.error,"danger"):(r=jQuery.Event("mfaAdded"),$(document).trigger(r,[{type:"password"}]),r.isDefaultPrevented()?void 0:window.location.href=window.portal+"2fregisters?continue=1")}}):(a("PE79","warning"),$("#password").focus())};$(document).ready(function(){return $("#register").on("click",r)})}.call(this);