function couponResult(n){n.IsSuccess?($("#modalCoupon").modal("toggle"),$("#pamount").html($("#camount").html()),$("#camount").html(n.NewAmount),$("#btnpayment").html("پرداخت "+$("#camount").html()),$("#CouponId").val(n.CouponId),$("#couponLink").hide()):($("#couponResultAlert").html(n.Result),$("#couponResultAlert").show())}/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&$("html").addClass("ismobile");$(document).ready(function(){function n(n){return/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(n)}function t(){$.trim($("#Email").val()).length>0&&n($("#Email").val())?$.ajax({url:"/Account/EmailExistProduct",data:{email:$("#Email").val()},type:"GET",dataType:"Json",success:function(n){n===!0?($("#reMsg").html("این ایمیل در پی پینگ ثبت است می توانید وارد شوید").css("color","#4caf50").show(700).delay(2e3).hide(700),$("#pswSection").show(700)):i()}}):($("#EmailValidate").html("ایمیل را کامل وارد کنید").delay(2e3),$("#reCheckBox").prop("checked",!1))}function i(){var t=null,i=null,r=null,u=null,f=null;if($("#FirstName")[0]&&(i=$("#FirstName").val()),$("#LastName")[0]&&$("#LastName").val().length===0&&(r=$("#LastName").val()),$("#Email").val().length!==0&&n($("#Email").val()))t=$("#Email").val();else{$("#EmailValidate").html("ایمیل را کامل وارد کنید").delay(2e3);$("#reCheckBox").prop("checked",!1);return}$("#Phone")[0]&&(u=$("#Phone").val());$("#UserId")[0]&&(f=$("#UserId").val());$("#reCheckBox").is(":checked")&&$.ajax({url:"/Account/RegisterProduct",data:{email:t,firstname:i,lastname:r,phone:u,merchantId:f},type:"POST",dataType:"Json",success:function(){$.get("/Account/RefreshToken",function(n){var t=$("<div />").html(n).find('input[name="__RequestVerificationToken"]').val();$('input[name="__RequestVerificationToken"]').val(t)});$("#emailShowLogin").text($("#Email").val());$("#loginSection").show(700);$("#emailSection").hide(700);$("#pswSection").hide(700);$("#reCheckBoxSection").hide(700);$("#reMsg").html("اطلاعات شما ثبت شد").css("color","#4caf50").show(700).delay(2e3).hide(700);ga("send","event","user","register","rememberme")}})}$.validator.messages.required="این فیلد را پر کنید";$.validator.messages.number="لطفاً فقط اعدد انگلیسی وارد کنید";$("#reCheckBox").click(function(){$(this).is(":checked")?$("#payproduct")[0]&&$(".emailshowed")[0]?t():$("#emailSection").show(700):($("#emailSection").hide(700),$("#pswSection").hide(700))});$("body").on("click","[data-ma-action]",function(n){n.preventDefault();var i=$(this).data("ma-action");switch(i){case"reCloseLogin":$("#pswSection").hide(700);$("#emailSection").hide(700);$("#reCheckBox").prop("checked",!1);break;case"reLogin":$.ajax({url:"/Account/LoginProduct",data:{password:$("#Password").val(),email:$("#Email").val()},type:"POST",dataType:"Json",success:function(n){n.isuser===!0?($.get("/Account/RefreshToken",function(n){var t=$("<div />").html(n).find('input[name="__RequestVerificationToken"]').val();$('input[name="__RequestVerificationToken"]').val(t)}),$("#pswSection").hide(700),$("#reCheckBoxSection").hide(700),$("#emailSection").hide(700),$("#reMsg").text("شما وارد شدید").show(700).css("color","#4caf50").delay(2e3).hide(700),$("#emailShowLogin").text($("#Email").val()),$("#loginSection").show(700),n.fname&&($("#FirstNameValidate").hide(),$("#FirstName").val(n.fname)),n.lname&&($("#LastNameValidate").hide(),$("#LastName").val(n.lname)),$("#FirstName").val().length>0&&$("#LastName").val().length>0&&$("#infoSection").hide(700),n.phonenum&&($("#phoneSection").hide(700),$("#Phone").val(n.phonenum))):$("#reMsg").html("رمزعبور اشتباه است").show(700).css("color","#f44336").delay(2e3).hide(700)}});break;case"reSearch":t()}})});$(document).ready(function(){function t(n){var t;$(n).keyup(function(){$(n).val($(n).val().replace(/,/g,"").replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"));t=$(n).val().replace(/,/g,"")});$(n).keypress(function(){var n=$(this).val().length;n>=0&&n<7?$(this).css("font-size","37px"):$(this).css("font-size","25px")});$(n).rules("add",{min:function(){if(t<100)return 100},messages:{min:jQuery.validator.format("لطفا مبلغ بیشتر از ۱۰۰ باشد")}})}function n(n,t,i){$(n).mCustomScrollbar({theme:t,scrollInertia:100,axis:"yx",mouseWheel:{enable:!0,axis:i,preventDefault:!0}})}if($(function(){$("a.disabled").on("click",function(n){n.preventDefault()})}),$("#amountInput")[0]&&t("#amountInput"),$("html").hasClass("ismobile")||$(".c-overflow")[0]&&n(".c-overflow","minimal-dark","y"),$(".m-overflow")[0]&&n(".m-overflow","minimal-dark","y"),$(".fg-line")[0]){$("body").on("focus",".fg-line .form-control",function(){$(this).closest(".fg-line").addClass("fg-toggled")});$("body").on("blur",".form-control",function(){var n=$(this).closest(".form-group, .input-group"),t=n.find(".form-control").val();n.hasClass("fg-float")?t.length==0&&$(this).closest(".fg-line").removeClass("fg-toggled"):$(this).closest(".fg-line").removeClass("fg-toggled")})}if($(".collapse")[0]){$(".collapse").on("show.bs.collapse",function(){$(this).closest(".panel").find(".panel-heading").addClass("active")});$(".collapse").on("hide.bs.collapse",function(){$(this).closest(".panel").find(".panel-heading").removeClass("active")});$(".collapse.in").each(function(){$(this).closest(".panel").find(".panel-heading").addClass("active")})}(function(){Waves.attach(".btn:not(.btn-icon):not(.btn-float)");Waves.attach(".btn-icon, .btn-float",["waves-circle","waves-float"]);Waves.init()})()})