1$.Controller=(()=>{function i(e,t,n,i){let o="change click contextmenu dblclick keydown keyup keypress mousedown mousemove mouseout mouseover mouseup reset resize scroll select submit focus blur focusin focusout mouseenter mouseleave draginit dragstart drag dragend shown ifChecked ifUnchecked ifChanged paste beforeChange afterChange hover mousewheel".split(" "),l=/(.+) \-\> (\w+)/i;var s="attach"+e;let a=!1,r=this,c;function d(e,t){this.element=$(e),this.options=t,this.events=[],this.subscriptions=[];let i=this;$.each(this.parent.actions,function(){i[this[0]]=$.proxy(this[1],i)}),$.each(this.parent.events,function(){let e=this.slice(),t="",n=e.length-1;e[n]=$.proxy(this[n],i),i.events.push(e),2==this.length?t="bind":3==this.length&&(t="delegate"),i.element[t].apply(i.element,e)}),$.each(this.parent.subscriptions,function(e,t){i.subscriptions.push($.subscribe(e,$.proxy(t,i)))}),this.super_call=function(a,r){if(this.ancestor){let e=!1,t=this.ancestor,n=0,i=!0,o,s=((matches=a.match(l))&&(e=!0,a=[matches[1],matches[2]]),o=t.actions.concat(t.events).concat($.map(t.subscriptions,function(e,t){return[[t,e]]})),!1);for(;n<o.length&&i;)meth=o[n],(!e&&meth[0]==a||e&&meth[0]==a[0]&&meth[1]==a[1])&&(s=meth[meth.length-1].apply(this,void 0===r?[]:r),i=!1),n+=1;if(i)throw"Method not found "+a;return s}alert("Controller has no ancestor")},this.destroy=function(){$.each(this.events,function(){i.element[2==this.length?"unbind":"undelegate"].apply(i.element,this)}),$.each(this.subscriptions,function(){$.unsubscribe(this)}),$.publish(this.parent.controllerName+"/destroyed",[this.element]),this.element=null,this.options=null,this.events=null,this.subscriptions=null}}this.events=[],this.actions=[],this.definitionObj=t,this.subscriptions=n,this.controllerName=e,this.ancestorClass=i,(a=""!=this.ancestorClass&&window[this.ancestorClass]?window[this.ancestorClass]:a)&&(this.definitionObj=$.extend({},a.definitionObj,this.definitionObj),this.subscriptions=$.extend({},a.subscriptions,this.subscriptions)),$.each(this.definitionObj,function(e,t){"function"==typeof t?-1<$.inArray(e,o)||e.match(/^ajax:/)?r.events.push([e,t]):(matches=e.match(l))&&-1<$.inArray(matches[2],o)?r.events.push([matches[1],matches[2],t]):r.actions.push([e,t]):r[e]=t}),d.prototype.parent=this,d.prototype.ancestor=a,this.instantiate=function(e,t){return(c=new d(e,t)).init&&"function"==typeof c.init&&c.init(),c},$.fn[s]||($.fn[s]=function(){let e=arguments,t;return this.each(function(){(t=$(this).data("controllers")||[]).push(r.instantiate(this,e[0]||{})),$(this).data("controllers",t)})}),$.fn.extend({controllers:function(){let e=[];return this.each(function(){$.merge(e,$(this).data("controllers")||[])}),e},controller:function(){return this.controllers.apply(this,arguments)[0]}})}return function(e,t,n){return ancestor_name="","string"==typeof arguments[1]&&(ancestor_name=arguments[1],t=arguments[2],n=arguments[3]),window[e]=new i(e,t||{},n||{},ancestor_name)}})();let coreForms={processingMessages(e){let t="",n={negative:[],success:[],info:[]};for(var i in e.messages)n[e.messages[i][0]].push(e.messages[i][1]);for(var o in n)0<n[o].length&&(t+="<ul class='list "+o+" mb-3'><li>"+n[o].join("</li><li>")+"</li></ul>");return t},processingActions(e){if(void 0!==e.action)switch(e.action){case"redirect":location.replace(e.url);break;case"refresh":location.reload()}return!1}};function passwordEasynessCheck(e){var t,n=[],e=e.element.find("#password").val();return 0<e.length&&(t=new RegExp("((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]))").test(e),e=6<=e.length,t&&e||(t=JSON.parse($("#password")[0].attributes["data-validate"].value)[0].prompt_password_rules_error,n.push(t))),n}function passwordsCompareCheck(e){var t=[],n=e.element.find("#password").val(),e=e.element.find("#password_confirm").val();return 0<n.length&&0<e.length&&n!==e&&(n=JSON.parse($("#password")[0].attributes["data-validate"].value)[0].prompt_password_identical_error,t.push(n)),t}function passwordValidation(e,t,n=!0,i=!1){var o=passwordEasynessCheck(e),s=passwordsCompareCheck(e);let a="";o.forEach(e=>{a+="<li>"+e+"</li>"}
1),s.forEach(e=>{a+="<li>"+e+"</li>"}),0<a.length&&(changeSendButtonEnabled(e,t,!0),$(".password_errors").remove(),o="<div class='password_errors'><div class=\"ui warning-message warning-message_max-width\"><div class='ui warning-message "+(i?"warning-message_max-width":"")+'\'"><ul class="list warning mb-3">'+a+"</ul></div></div>",n?$("#"+t).after(o):$("#"+t).before(o)),0===a.length&&($(".password_errors").remove(),changeSendButtonEnabled(e,t,!1))}function changeSendButtonEnabled(e,t,n){e=e.element.find("#"+t);n?(e.prop("disabled",n),e.css("background-color","Gray")):(e.prop("disabled",n),e.css("background-color","#0078fa"))}function retrieveSeonFingerprintData(){seon.config({session_id:"c32d8b45-92fe-44f6-8b61-42c2107dfe87"+Date.now(),audio_fingerprint:!0,canvas_fingerprint:!0,webgl_fingerprint:!0,onSuccess:function(e){},onError:function(e){}}),seon.getBase64Session(function(e){var t;e&&((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("name","fingerprint_data"),t.setAttribute("value",e),$("#fingerprint_data").val(e))})}function getCurrentLanguage(){let t="en";var n=window.location.href,i=[{value:"en",pattern:"/en/"},{value:"ru",pattern:"/ru/"}];for(let e=0;e<i.length;e++){var o=i[e];new RegExp(o.pattern).test(n)&&(t=o.value)}return t}function showErrorOnReviewController(e){var t,n,i,o=document.getElementById("avatar"),o=(o.value="",o.parentElement.classList.add("error"),document.querySelector("#upload_avatar_result").innerHTML="",document.querySelector(".ui.error.message"));o&&(0===(t=document.querySelectorAll(".ui .list")).length?((n=document.createElement("ul")).classList.add("list"),(i=document.getElementById("upload_avatar_error"))||((i=document.createElement("li")).id="upload_avatar_error",i.innerText=e,n.append(i)),o.prepend(n)):(i=t[0],(o=document.getElementById("upload_avatar_error"))||((o=document.createElement("li")).id="upload_avatar_error",o.innerText=e,i.append(o))))}function UIForm(i){this.isValidation=!1,this.components=[],this.dom=i,this.add=function(e){return this.components.push(e),this},this.fill=function(e){return $(this.dom).form("set values",e),this},this.init=function(){for(var e in this.components)this.components[e].init();return this},this.post=function(e,n){return $(i).form({fields:[],onSuccess:function(){var e=$
1(this),t=e.serialize();console.log(t),null!=n&&n(),$(i).api({url:e.attr("action"),method:"POST",serializeForm:!1,beforeSend:function(){},onSuccess:function(){}})}}),this},this.postAjax=function(e){this.isValidation=0<e.length||0<Object.keys(e).length;var i=this;return $(this.dom).form({fields:e,onSuccess:function(){var n=$(this);return n.addClass("loading"),$.ajax({type:"POST",url:n.attr("action"),data:n.serialize(),dataType:"json"}).done(function(e){if(n.removeClass("loading"),coreForms.processingActions(e),"reset"===e.action&&n.find("input,textarea").each(function(){$(this).val("")}),"close"===e.action&&($(".ui.modal").modal("hide").remove(),ajaxGo(window.location.search)),e.fields)for(var t in e.fields)n.form("add prompt",e.fields[t]);e.messages&&i.renderMessages(e)}).fail(()=>{e.length||(n.removeClass("loading"),n.form("add errors",[I18n.REQUEST_ERROR]),n.find(".message").show())}),!1}}),this},this.renderMessages=function(e){$(this.dom).find(".ui.message").html(coreForms.processingMessages(e))}}function UIUploader(e,t){this.defaults={fieldName:"file_upload",url:"/admin/uploader",maxFileSize:5e6,allowedTypes:"*",dataType:"json",extFilter:null,multiple:!0,onUploadSuccess:function(e,t){this.getEvent(t)}.bind(this),onInit:function(){void 0!==this.options.initParams&&this.getEvent(this.options.initParams)}.bind(this),onDocumentDragEnter:function(){$(this).addClass("dragenter")},onDocumentDragLeave:function(){$(this).removeClass("dragenter")},onUploadProgress:function(){0===$(".lds-block").length&&$(".uploader").parent().append('<div class="lds-block"><div class="lds-ring"><div></div><div></div><div></div><div></div></div></div>')}},this.options={},this.opts=t,this.id=e,this.getData=function(){return!1},this.init=function(){try{this.options=$.extend(this.defaults,this.opts||{}),$("#uploader-"+this.id).dmUploader(this.options)}catch(e){console.log(e)}},this.getEvent=function(e){void 0!==e.action&&("redirect"===e.action&&this.buildRedirect(e),"list"===e.action&&this.renderList(e),"file"===e.action&&this.renderFile(e),"crop"===e.action&&this.renderCrop(e),e.messages)&&(new UIForm).renderMessages(e)},this.JCropInit=function(e,t,n){console.log(n),$(e).Jcrop({minSize:[200,200],aspectRatio:1,onChange:function(e){$(t).val(e.x+","+e.y+","+e.w+","+e.h)}})},this.buildRedirect=function(e){var t=window.location.pathname+"/update/",e=e.files[0];t+=window.btoa(e.filepath+e.fileext),WidgetUIModal.create(t)},this.renderList=function(e){var t,n=$("#files-"+this.id);for(t in e.files)e.files.hasOwnProperty(t)&&(n.append($("<img/>").attr("src",e.files[t].filepath+e.files[t].fileext).addClass("ui image")),$("#uploader-"+this.id+" > .inputs").append($("<input />").attr("type","hidden").attr("name",this.id+"[]").val(e.files[t].filepath)))},this.renderFile=function(e){var t=$("#files-"+this.id),e=e.files[0];t.html($("<img/>").attr("src",e.filepath+e.fileext).addClass("ui image")),$("#uploader-"+this.id+" > .inputs").html($("<input />").attr("type","hidden").attr("name",this.id).val(e.filepath))},this.renderCrop=function(e){var t=$("#files-"+this.id),e=e.files[0];t.html($("<img/>").attr("src",e.filepath+e.fileext).attr("id",this.id+"Image").addClass("ui image")),$("#uploader-"+this.id+" > .inputs").html("").append($("<input />").attr("type","hidden").attr("name",this.id).val(e.options[this.id])).append($("<input />").val(e.options.pathData.toString()).attr("name",this.id+"Data").attr("test",e.options.pathData.toString()).attr("id",this.id+"Data").attr("type","hidden")),this.JCropInit("#"+this.id+"Image","#"+this.id+"Data",e.options.pathData)}}function searchCountries(e){var t=$(e).val().toLowerCase();""===t?$(".countries-item").css("display","flex"):($(".countries-item").css("display","none"),$(".countries-item").each(function(){-1<$(this).find(".caption").html().toLowerCase().indexOf(t)&&$(this).css("display","flex")})),$(".countries-list").getNiceScroll().resize()}function checkForApplePaySupport(e){$(".test-user").attr("data-test-user-id");return window.ApplePaySession&&window.ApplePaySession.canMakePayments()?ApplePaySession.canMakePaymentsWithActiveCard(e):null}$(document).ready(()=>{$("*[data-auto-controller]").each(function(){var t,n=$(this).data("auto-controller").split(" ");let i;for(let e=0;e<n.length;++e)(!$(this).controller()||$(this).controller()&&$(this).controller().parent.controllerName!==n[e])&&(t=$(this)["attach"+n[e]])&&(i=t.call($(this)));return i}),$(".g-recaptcha").length&&(importJS("https://www.google.com/recaptcha/api.js?render="+GOOGLE_RECAPTCHA),$(".g-recaptcha").on("click",function(e){let n=$(this);e.preventDefault(),grecaptcha.ready(()=>{grecaptcha.execute(GOOGLE_RECAPTCHA,{action:"submit"}).then(function(e){var t=n.closest("form");0===t.find('input[name="g-captcha"]').length&&t.append("<input type='hidden' name='g-captcha'>"),t.find('input[name="g-captcha"]').val(e),t.submit()})})}))}),importJS=function(e){var t=document.createElement("script"),n=document.getElementsByTagName("head")[0];t.type="text/javascript",t.src=e,n.appendChild(t)},$(document).ready(function(){$(".countries-list").niceScroll({cursorborderradiu
1s:"0",cursorcolor:"#ff6b24",background:"#0078ff",cursorborder:"none",autohidemode:!1,cursorwidth:3}),$("span.menu").click(function(){$(".topMobileMenu").slideToggle("slow",function(){})}),$(window).scroll(function(){100<$(this).scrollTop()?$(".scrollup").fadeIn():$(".scrollup").fadeOut()}),$(".scrollup").click(function(){return $("html, body").animate({scrollTop:0},600),!1}),$(".navbar-toggler").click(function(){$(".topMobileMenu").toggleClass("show")}),$(".menu-close").click(function(){$(".topMobileMenu").removeClass("show")}),$.cookie("cookieAgree")||$(".toolbar").slideDown("slow"),$("#cookiesAgreement").on("click",function(){var e=Math.round((new Date).getTime()/1e3);$.cookie("cookieAgree",e,{domain:PROJECT_DOMAIN,expires:365,path:"/",secure:!0}),$(".toolbar").slideUp("slow")}),$("#cookiesAgreementMob").on("click",function(){var e=Math.round((new Date).getTime()/1e3);$.cookie("cookieAgree",e,{domain:PROJECT_DOMAIN,expires:365,path:"/",secure:!0}),$(".toolbar").slideUp("slow")}),$("#allCookiesAgree").on("click",function(){var e=Math.round((new Date).getTime()/1e3);$.cookie("cookieAgree",e,{domain:PROJECT_DOMAIN,expires:365,path:"/",secure:!0}),$(".dialog-wrap").css("display","none"),$(".dialog-overlay").css("display","none"),$(".toolbar").slideUp("slow")}),$("#selectedCookiesAgree").on("click",function(){var e=Math.round((new Date).getTime()/1e3);$.cookie("cookieAgree",e,{domain:PROJECT_DOMAIN,expires:365,path:"/",secure:!0}),$(".dialog-wrap").css("display","none"),$(".dialog-overlay").css("display","none"),$(".toolbar").slideUp("slow")}),$("#cookiesManage").on("click",function(){$(".dialog-wrap").css("display","flex"),$(".dialog-overlay").css("display","block")}),$("#cookiesManageMob").on("click",function(){$(".dialog-wrap").css("display","flex"),$(".dialog-overlay").css("display","block")}),$(".dialog-overlay").on("click",function(){$(".dialog-wrap").css("display","none"),$(".dialog-overlay").css("display","none")}),$(".ui.sidebar").sidebar("attach events",".toc.item"),$(".masthead").visibility({once:!1,onBottomPassed:function(){$(".fixed.menu").transition("fade in")},onBottomPassedReverse:function(){$(".fixed.menu").transition("fade out")}})}),window.onload=function(){document.querySelectorAll(".accordion-section").forEach(function(e){e.addEventListener("click",function(e){var t,e=e.target.closest(".accordion-header");e&&((t=e.querySelector("img"))&&t.classList.toggle("rotate-plus"),t=e.closest(".accordion-section"))&&((e=t.querySelector(".accordion-body")).style.maxHeight=e.querySelector("*").clientHeight+"px",t.classList.toggle("opened"),t.classList.contains("opened")||(e.style.maxHeight="0px"))})})},$.Controller("BaseAjaxForm",{validator:[],processingMessage(e){this.element.find(".ui.message").html(coreForms.processingMessages(e))},processingActions(e){coreForms.processingActions(e)},Array2Object(e){let n={};return $(e).each(function(e,t){n[t.name]=t.value}),n},ajaxSend(e,t,n){let i=this;var o=$(":submit");let s=$(o).css("background-color");$.ajax($.extend({},{headers:{"X-Requested-With":"xmlhttprequest"},dataType:"json",method:"GET",data:{},url:""},t||{},{beforeSend:function(e){return $(o).prop("disabled",!0),$(o).css({"background-color":"gray"}),!0}})).done(e=>{$(o).prop("disabled",!1),$(o).css("background-color",s),void 0!==e.messages&&i.processingMessage(e),void 0!==e.action&&i.processingActions(e),n&&n(e)}).fail(()=>{console.log("error log")})},ajaxForm(e,t){var n=e.find("input");let i=[],o=this;n.each(function(){$(this).data("validate")&&i.push({identifier:$(this).attr("name"),rules:$(this).data("validate")})}),e.on("submit",e=>{e.preventDefault()}),e.form({fields:i,onSuccess(){o.ajaxSend(e,{data:o.Array2Object(e.serializeArray()),method:e.attr("method"),url:e.attr("action")},t)}})}}),$.Controller("ProfileAuthController","BaseAjaxForm",{init(){this.form=this.element;let s=this.form.find('button[type="button"]');if(s.length){let e=$(s).css("background-color"),t=45;$(s).css({"background-color":"gray","margin-left":"10px"}),$(s).on("click",function(e){window.grecaptcha.execute(GOOGLE_RECAPTCHA,{action:"submit"}).then(function(e){window.location.href="/"+LANG+"/customers/signin/by/push?token="+e})});let n=this.form.find("span#countDown-sms"),i=this.form.find("p#wrap-countdown-sms"),o=this.form.find("p#wrap-countdown-sms-done");var a=setInterval(function(){t<=1?($(s).prop("disabled",!1),$(s).css("background-color",e),console.log(e),$(i).hide(),$(o).show(),clearInterval(a)):(--t,$(i).show(),$(n).text(t))},1e3)}retrieveSeonFingerprintData(),this.ajaxForm(this.form)}}),$.Controller("ProfilePaymentSecondController","BaseAjaxForm",{init(){if(this.methodsList=this.element.find(".payment-method"),this.form=this.element.find("form"),this.methodsList){this.methods=this.methodsList.find(".card-header");for(let t=0;t<this.methods.length;t++){let e=this.methods[t].getAttribute("data-code");this.methods[t].addEventListener("click",()=>{$("#radioButton"+e).prop("checked",!0),$('.collapse[data-parent="#accordion"]').find("input").each((e,t)=>{$(t).attr("disabled","disabled")}),$("#collapse"+e).find("input").each((e,t)=>{$(t).attr("disabled",!1)}),$("#agree").attr("disabled",!1)})}}$("#package_select").on("change",function(){"custom"===this.value?($("#package_custom .field").attr("value",""),$("#package_custom").css("display","block")):($("#package_custom .field").attr("value",this.value),$("#package_custom").css("display","none"))});var e=checkForApplePaySupport("merchant.net.cfon");null!=e&&e.then(function(e){e&&$(".apple-pay-method_appear_none").addClass("apple-pay-method_appear_block")}),this.ajaxForm(this.form)}}),$.Controller("ProfileRecoveryController","BaseAjaxForm",{callback(e){void 0!==e.action&&"code_sent"===e.action&&$(this.element.find(".ui.button")).css("display","none"),void 0!==e.action&&"sign_in_redirect"===e.action&&setTimeout(function(){window.location.href="/"+LANG+"/customers/signin/"},1e3)},init(){this.form=this.element.find("form"),$(this.element.find(".ui.button")).prop("id","send_button"),$(this.element.find("#password")).on("input",()=>{passwordValidation(this,"send_button",!1)}),$(this.element.find("#password_confirm")).on("input",()=>{passwordValidation(this,"send_button",!1)}),this.ajaxForm(this.form,this.callback)}}),$.Controller("ProfileRequestController","BaseAjaxForm",{init(){this.form=this.element.find("form"),$.fn.form.settings.rules.emailOrEmpty=function(e){return""===e||$.fn.form.settings.rules.email(e)},$.fn.form.settings.rules.contentOrEmpty=function(e){return!0},$(this.element.find(".btn.btn-primary")).prop("id","update_button"),$(this.element.find("#password")).on("input",()=>{passwordValidation(this,"update_button",!0,!0)}),$(this.element.find("#password_confirm")).on("input",()=>{passwordValidation(this,"update_button",!0,!0)}),this.ajaxForm(this.form)}}),$.Controller("SecurityInformationController","BaseAjaxForm",{init(){this.form=this.element.find("form"),$(this.element.find(".ui.button")).prop("id","send_button"),$(this.element.find("#password")).on("input",()=>{passwordValidation(this,"send_button",!1)}),$(this.element.find("#password_confirm")).on("input",()=>{passwordValidation(this,"send_button",!1)}),this.ajaxForm(this.form)}}),$.Controller("ProfileSignInController","BaseAjaxForm",{qrAjaxLoader(){var e=$
1("#fingerprint_data").val();$.ajax({type:"POST",url:"/"+LANG+"/customers/qrcode?"+Math.random(),data:"fingerprint_data="+encodeURIComponent(e),dataType:"JSON",success:e=>{"redirect"===e.action&&(window.location="/"+LANG+"/customers/profile/"),"renew"===e.action&&this.qrGenerator()}})},qrGenerator(){$(this.element.find("#qrcode")).attr("src","/"+LANG+"/customers/qrcode?"+Math.random())},qrInterval(){clearInterval(this.qrReload),this.qrReload=setInterval(()=>{this.qrAjaxLoader()},1500)},init(){retrieveSeonFingerprintData(),this.qrcode=this.element.find("#qrcode"),this.form=this.element.find("form"),this.qrReload=null,$(this.element.find("#qrcode")).on("click",()=>{this.qrGenerator(),this.qrInterval()}),this.qrInterval(),this.ajaxForm(this.form)}}),$.Controller("ProfileSignUpController","BaseAjaxForm",{intlTel:{},callback(e){void 0!==e.action&&"unlock"===e.action&&($(this.element.find("#step")).prop("value","step2"),$(this.element.find("input")).prop("readonly",!0),$(this.element.find("#code")).prop("readonly",!1).attr({type:"number"}).addClass("fieldNumber").prop("disabled",!1)),void 0!==e.action&&"unlock_password"===e.action&&($(this.element.find("#step")).prop("value","step3"),$(this.element.find("#code")).prop("readonly",!0),$(this.element.find("#password")).prop("readonly",!1).attr({type:"password"}).prop("disabled",!1),$(this.element.find("#password_confirm")).prop("readonly",!1).attr({type:"password"}).prop("disabled",!1))},setCode(e){var t=$("#phone_number");"+"!==t.val()&&t.val("+"+e).css("padding-left","48px")},setCode2(e){$("#phone-number-div").text()||$("#phone_number").before("<div id='phone-number-div'>text</div>");e=$("#phone-number-div").text("+"+e).width();$("#phone_number").css("padding-left","calc(14% + "+(e+4)+"px)")},init(){var e=document.querySelector("#phone_number");this.form=this.element;let t=this;$(this.element.find(".ui.button")).prop("id","send_button"),$(this.element.find("#password")).on("input",()=>{passwordValidation(this,"send_button",!1)}),$(this.element.find("#password_confirm")).on("input",()=>{passwordValidation(this,"send_button",!1)}),t.intlTel=window.intlTelInput(e,{initialCountry:"auto",hiddenInput:"phone",geoIpLookup:n=>{$.get("/api/system/ipinfo",()=>{},"jsonp").always(function(e){let t=e&&e.countryCode?e.countryCode:"us";"xx"===t&&(t="us"),n(t)})},utilsScript:"/vendor/depends/phone-input/js/utils.js"}),e.addEventListener("countrychange",()=>{var e=t.intlTel.getSelectedCountryData();void 0!==e.dialCode&&t.setCode(e.dialCode)}),retrieveSeonFingerprintData(),this.ajaxForm(this.form,this.callback)}}),$.Controller("ReviewController","BaseAjaxForm",{callback(e){$(".feedback-form-errors").css("display","block")},init(){this.form=this.element;var e,t,n=document.getElementById("avatar");n&&(n.type="file",(e=document.createElement("input")).type="hidden",e.name="avatar",(t=document.createElement("div")).id="upload_avatar_result",n.parentElement.prepend(e),n.parentElement.append(t),n.addEventListener("change",function(e){try{if(0===e.target.files)throw new Error;var t,n=getCurrentLanguage(),i=this.files[0].type;["image/jpeg","image/png"].includes(i)?((t=new FormData).append("avatar",e.target.files[0]),t.append("lang",n),fetch("/api/upload/avatar",{method:"POST",credentials:"include",body:t}).then(function(e){e.ok&&(console.log(e),e.json().then(function(e){try{if("string"!=typeof e.result.filename)throw Error(e.result.message);document.querySelector('[name="avatar"]').value=e.result.filename,document.querySelector("#upload_avatar_result").innerHTML='<img src="'+e.result.filename+'" />';document.getElementById("avatar").parentElement.classList.remove("error");var t=document.querySelectorAll(".ui .list");[].forEach.call(t,function(e){e.remove()})}catch(e){showErrorOnReviewController(e.message)}}))}.bind(this))):showErrorOnReviewController("ru"===n?"ТолÑко JPEG или PNG":"JPEG or PNG only")}catch(e){}})),this.ajaxForm(this.form,this.callback)}});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.