$emailVerificationModal=$("#email-verification-modal"),$emailVerificationForm=$("#email-verification-form"),$emailVerificationResendBtn=$("#email-verification-resend"),$((function(){$("#email-verification-resend").hide(),$emailVerificationForm.validate({rules:{email_or_number:{required:!0},otp:{required:!0,minlength:6,maxlength:6}},messages:{otp:{required:"Please enter your OTP",minlength:"The OTP must be of 6 digits",maxlength:"OTP should not be more than 6 digits"}}}),$emailVerificationResendBtn.on("click",(function(){!function(e){$.ajax({url:appConfig.api_url+"resend-otp",dataType:"json",type:"POST",data:{email:e,signin:!0},beforeSend:function(){showLoader()},success:function(e){hideLoader(),Swal.fire({icon:e.meta.status?"success":"error",text:e.meta.message}).then((function(){$emailVerificationForm[0].reset()}));var i=180,o=setInterval((function(){i<=0?(clearInterval(o),$("#email-verification-resend").show(),$("#otp-seconds").hide(),$(".otp-error").hide()):(document.getElementById("otp-seconds").innerHTML=i,$("#otp-seconds").show(),$(".otp-error").show(),$("#email-verification-resend").hide()),i-=1}),1e3)},error:function(e){hideLoader();var i=JSON.parse(e.responseText);Swal.fire({icon:"error",text:i.meta.message})}})}($emailVerificationForm.find("[name=email_or_number]").val())})),$emailVerificationForm.ajaxForm({url:appConfig.api_url+"signin",dataType:"json",beforeSend:function(){showLoader()},success:function(e){hideLoader(),Cookies.set("access_token",e.data.accessToken),Cookies.set("uuid",e.data.userDetail.uuid),Swal.fire({icon:e.meta.status?"success":"error",text:e.meta.message}).then((function(){$emailVerificationModal.modal("hide"),window.location.href=e.data.redirect_url}))},error:function(e){hideLoader(),showErrorAlertFromException(e)}})})),window.showEmailVerificationModal=function(e){$emailVerificationForm.find("[name=email_or_number]").val(e),$emailVerificationForm[0].reset(),$emailVerificationModal.modal({backdrop:"static",keyboard:!1}),$(".veriyfy_email").html("<b>"+e+"</b>"),$emailVerificationModal.modal("show");var i=180,o=setInterval((function(){i<=0?(clearInterval(o),$("#email-verification-resend").show(),$("#otp-seconds").hide(),$(".otp-error").hide()):(document.getElementById("otp-seconds").innerHTML=i,$("#otp-seconds").show(),$(".otp-error").show(),$("#email-verification-resend").hide()),i-=1}),1e3)},$(".btn-close").on("click",(function(){location.reload()}));
//# sourceMappingURL=login-otp.js.map