PageSourceSearch

https://epson.ca/_ui/_v202608182013/responsive/common/js/asm.min.js

js epson.ca collected 2026-10-01 13:54:47 UTC 20,146 bytes, 1 lines download raw bytes

1var ASM=ASM||{};var sessionSec;var counter;var carts;var orderIdLengthMin=8;var orderIdLengthMax=10;function personifyForm(){if($("#_asmLogin").length){var b=$("#asmLoginForm input[name='username']");var a=1;if(b.val().length>=a){b.parent().addClass("checked")}}$("#asmLoginForm input[name='username'], #asmLoginForm input[name='password']").keyup(function(){var d=1;var c=$(this.parentNode);if(this.value.length>=(d)){c.addClass("checked");checkSignInButton(c)}else{c.removeClass("checked");checkSignInButton(c)}});$("input[name='customerName']").keyup(function(c){$("input[name='customerId']").val("");validateNewAccount(this);$(this).removeData("hover");removeAsmHover();toggleBind(false);toggleStartSessionButton(this,false);if($(this).val().length<3){toggleCreateAccount(false)}});$("#_asmPersonifyForm input[name='cartId']").on("keyup",function(){formValidate(this,orderIdLengthMin,true,orderIdLengthMax);if(isErrorDisplayed()){$("input[name='cartId']").removeClass("ASM-input-error");if($(".ASM_alert")){$(".ASM_alert").remove()}}});$("#_asmPersonifyForm input[name='customerName']").keyup(function(){if(isErrorDisplayed()){$("input[name='customerName']").removeClass("ASM-input-error");if($(".ASM_alert")){$(".ASM_alert").remove()}if($(this).val()===""){$("input[name='cartId']").removeClass("ASM-input-error");toggleStartSessionButton($("input[name='cartId']"),true);$("input[name='customerId']").val("")}}if($(this).val()===""){$("input[name='cartId']").val("");$("#asmAutoCompleteCartId").empty()}});$("#_asmPersonifyForm input[name='cartId']").on("blur",function(){var c=/^\s+$/;if(c.test($(this).val())){$(this).val("");formValidate(this,orderIdLengthMin,true,orderIdLengthMax)}});$("#_asmBindForm input[name='cartId']").keyup(function(c){checkCartIdFieldAndToggleBind(this)});$("#_asmBindForm input[name='cartId']").bind("paste",function(d){var c=this;setTimeout(function(){checkCartIdFieldAndToggleBind(c)},100)})}function addASMHandlers(){revertAutocompleteNormalize();removeAsmAlert(3000);addCloseBtnHandler();addASMFormHandler();addHideBtnHandler();addCustomerListBtnHandler();customerListModalHandler();addCustomer360Handler();addGenericCustomer360Handler();personifyForm();if($("#sessionTimer").length&&$("#asmLogoutForm").length){startTimer()}if($("#resetButton").length){$("#resetButton").click(function(){resetSession()})}if(placeholderNotAvailable()){$("[placeholder]").focus(function(){var b=$(this);if(b.val()===b.attr("placeholder")){b.val("");b.removeClass("placeholder")}}).blur(function(){var b=$(this);if(b.val()===""||b.val()===b.attr("placeholder")){b.addClass("placeholder");b.val(b.attr("placeholder"))}}).blur()}$("[placeholder]").blur(function(){var b=$(this);if((b.val()==="")&&(b.attr("name"))){toggleBind(false)}});if($(".ASM_alert_cart").length){$("input[name='cartId']").addClass("ASM-input-error")}if($(".ASM_alert_customer").length){$("input[name='customerName']").addClass("ASM-input-error")}if($(".ASM_alert_cred").length){$("input[name='username']").addClass("ASM-input-error");$("input[name='password']").addClass("ASM-input-error")}if($(".ASM_alert_create_new").length){toggleCreateAccount(true)}$("#_asmPersonifyForm input[name='customerName'], input[name='customerId']").on("mouseenter",function(){var c=($(this).attr("data-hover"))?jQuery.parseJSON($(this).attr("data-hover")):$(this).data("hover");var b=($(this).attr("data-hover"))?"disabled":"";if(!(c===null||c===undefined)){$(this).after($("<div>").attr("id","asmHover").addClass(b).append($("<span>").addClass("name").text(c.name),$("<span>").addClass("email").text(c.email),$("<span>").addClass("date").text(c.date),$("<span>").addClass("card").text(c.card)))}},function(){removeAsmHover()});$("#_asmPersonifyForm input[name='cartId']").autocomplete({source:function(c,b){b(carts)}
1,appendTo:"#asmAutoCompleteCartId",autoFocus:true,minLength:0,select:function(b,c){if(c.item.value===""){b.preventDefault()}toggleStartSessionButton(this,true)}});$("#_asmPersonifyForm input[name='cartId']").on("click, focus",function(){$("#_asmPersonifyForm input[name='cartId']").autocomplete("search","")});if($("input[name='customerName']").length>0){$("input[name='customerName']").autocomplete({source:function(c,b){$.ajax({url:ACC.config.encodedContextPath+"/assisted-service/autocomplete",dataType:"json",data:{customerId:c.term},success:function(d){b($.map(d,function(e){return{email:e.email,date:e.date,card:e.card,value:e.value,carts:e.carts}}))}})},minLength:3,appendTo:"#asmAutoComplete",select:function(c,d){if(d.item.value===null){c.preventDefault();return}c.originalEvent.originalEvent.stopPropagation();toggleStartSessionButton(this,true);$(this).data("hover",{name:d.item.value,email:d.item.email,card:d.item.card,date:d.item.date});$("input[name='customerId']").val(d.item.email);carts=d.item.carts;function b(){if(carts!==null){if(carts.length===1){$("input[name='cartId']").val(carts[0])}else{$("input[name='cartId']").autocomplete("search","");$("input[name='cartId']").focus()}}else{carts=[{label:"No Existing Carts",value:""}];$("input[name='cartId']").autocomplete("search","");$("input[name='cartId']").focus()}}if($("input[name='cartId']").attr("orig_value")===null){$("input[name='cartId']").val("");b()}checkCartIdFieldAndToggleBind($("input[name='cartId']")[0])}}).data("ui-autocomplete")._renderItem=function(b,c){if(c.value===null){toggleCreateAccount(true);return $("<li></li>").data("item.autocomplete",c).append($("<span class=noresult>").text(ASM_MESSAGES.customerIdNotFound)).appendTo(b)}else{toggleCreateAccount(false)}return $("<li></li>").data("item.autocomplete",c).append($("<span>").addClass("name").text(c.value),$("<span>").addClass("email").text(c.email),$("<span>").addClass("date").text(c.date),$("<span>").addClass("card").text(c.card)).appendTo(b)}}if($("#_asmBindForm").length){var a=$("input[name='customerName']").attr("readonly");if(a==="readonly"){$(".ASM_icon-chain").removeClass("invisible").addClass("ASM_chain-bind");if($("#_asmBindForm input[name='customerId']").val()!==undefined&&$("#_asmBindForm input[name='customerId']").val()!==""){$(".js-customer360").prop("disabled",false)}}}if($(".add_to_cart_form").length&&$("#_asm input[name='cartId']").val()===""){$(".add_to_cart_form").submit(function(b){setTimeout(function(){var c=ACC.config.encodedContextPath+"/assisted-service/add-to-cart";$.post(c,function(d){$("#_asm").replaceWith(d);addASMHandlers()})},400)})}enableAsmPanelButtons()}$(document).ready(function(){var a=a||{};addASMHandlers();$(document).on("click",".js-select-store-label",function(b){$("#colorbox .js-pickup-component").addClass("show-store");colorboxResize()});$(document).on("click",".js-asm-store-finder-details-back",function(b){$("#colorbox .js-pickup-component").removeClass("show-store")})});function addASMFormHandler(){if(($)&&($(".asmForm").length)){$(".asmForm").each(function(){$(this).submit(function(){$(this).find("[placeholder]").each(function(){var a=$(this);if(a.val()===a.attr("placeholder")){a.val("")}});$.ajax({type:"POST",url:$(this).attr("action"),data:$(this).serialize(),success:function(a){$("#_asm").replaceWith(a);$("#_asm").css("display","block");addASMHandlers()}});return false})})}}function addCloseBtnHandler(){$("#_asm .closeBtn").on("click",function(){$("#_asm").remove();var a=ACC.config.encodedContextPath+"/assisted-service/quit";$.post(a,function(d){var b=window.location.href;var c=b.replace("&asm=true","").replace("?asm=true&","?").replace("?asm=true","");window.location.replace(c)})})}function addHideBtnHandler(){$("#_asm .ASM_control_collapse").click(function(){$("#_asm").toggleClass("ASM-collapsed")})}function startTimer(){sessionSec=timer;clearInterval(counter);counter=setInterval(timerFunc,1000)}function timerFunc(){if(sessionSec<=0){clearInterval(counter);finishASMagentSession();return}sessionSec=sessionSec-1;var a=Math.floor(sessionSec/60);var b=sessionSec%60;if(a<10){a="0"+a}if(b<10){b="0"+b}$("#sessionTimer .ASM_timer_count").html(a+":"+b)}function resetSession(){var a=$.ajax({url:ACC.config.encodedContextPath+"/assisted-service/resetSession",type:"POST"});a.done(function(b){sessionSec=timer+1}
1);a.fail(function(b,c){$("#errors").empty();$("#errors").append("Request failed: "+c)})}function finishASMagentSession(){$.ajax({url:ACC.config.encodedContextPath+"/assisted-service/logoutasm",type:"POST",success:function(a){$("#_asm").replaceWith(a);addASMHandlers()}})}function isStartEmulateButtonPresent(){return $(".ASM-btn-start-session").length===1}function enableAsmPanelButtons(){$('div[id="_asm"] button').not(".js-customer360, .ASM-btn-start-session, .ASM-btn-create-account, .ASM-btn-login").prop("disabled",false);if(isStartEmulateButtonPresent()){if($("#_asmPersonifyForm input[name='customerId']").val()!==""){$("#_asmPersonifyForm input[name='customerId']").parent().addClass("checked")}formValidate($("#_asmPersonifyForm input[name='cartId']")[0],orderIdLengthMin,true,orderIdLengthMax)}}function placeholderNotAvailable(){var a=document.createElement("input");return !("placeholder" in a)}function removeAsmHover(){$("#asmHover").remove()}function toggleCreateAccount(b){var c=$(".ASM_icon-chain");var a=$("#_asmCreateAccountForm button.ASM-btn-create-account[type='submit']");if(b){a.removeClass("hidden");c.removeClass("invisible")}else{a.addClass("hidden");c.addClass("invisible")}}function toggleActivationState(a,b){if(b){a.removeAttr("disabled")}else{a.attr("disabled","")}}function checkSignInButton(b){var c=$("#asmLoginForm button[type='submit']");var a=$(b).parent().find(".checked").length;if(a>1){toggleActivationState(c,true)}else{toggleActivationState(c,false)}}function checkStartSessionButton(b){toggleStartSessionButton(b,false);var a=$(b.parentNode).siblings(".checked").length;if(a>0){toggleActivationState($("button.ASM-btn-start-session"),true)}}function checkCartIdFieldAndToggleBind(a){function c(){return !$(a).hasClass("placeholder")&&($("input[name='customerName']").val().length>0)&&($("input[name='customerId']").val().length>0)}function b(){return !isNaN(a.value)&&(a.value.length>=orderIdLengthMin&&a.value.length<=orderIdLengthMax)}if(c()&&b()){$("#_asmBindForm button[type='submit']").removeClass("hidden");$(".ASM_icon-chain").removeClass("invisible");return}$("#_asmBindForm button[type='submit']").addClass("hidden");$(".ASM_icon-chain").addClass("invisible")}function toggleBind(a){if($("#_asmBindForm").length){var b=$(".ASM_icon-chain");var c=$("#_asmBindForm button.ASM-btn-bind-cart[type='submit']");if(a){c.removeClass("hidden");b.removeClass("invisible")}else{c.addClass("hidden");if($(".ASM-btn-create-account").hasClass("hidden")){b.addClass("invisible")}}}}function toggleStartSessionButton(d,c){var a=$(d).parent();var b=$("button.ASM-btn-start-session");if(c){b.removeAttr("disabled");a.addClass("checked")}else{b.attr("disabled","");a.removeClass("checked")}}function formValidate(c,b,d,a){if(!$(c).hasClass("placeholder")){if($(c).hasClass("ASM-input-error")){toggleStartSessionButton(c,false);return false}if((d!==false)&&isNaN(c.value)){toggleStartSessionButton(c,false);return false}if(c.value.length>=(b)){toggleStartSessionButton(c,true);if(a!==undefined&&c.value.length>(a)){toggleStartSessionButton(c,false)}}else{if(c.value.length===0){checkStartSessionButton(c)}else{toggleStartSessionButton(c,false);return false}}return true}return false}function validateEmail(a){return($("<input>").attr({type:"email",required:"required"}).val(a))[0].checkValidity()&&(a.indexOf(".")>0)}function validateName(a){var b=a.trim().split(/\s+/);return !isBlank(b[0])&&!isBlank(b[1])}function isBlank(a){return(!a||0===a.length)}function validateNewAccount(c){var g=$("#_asmCreateAccountForm button.ASM-btn-create-account[type='submit']");var f=c.value.split(", ");var e=$("#_asmCreateAccountForm input[name='customerId']");var d=$("#_asmCreateAccountForm input[name='customerName']");if(f.length>1){var b=validateName(f[0]);var a=validateEmail(f[1]);if(b&&a){toggleActivationState(g,true);e.val(f[1].replace(/^\s\s*/,"").replace(/\s\s*$/,""));d.val(f[0])}else{toggleActivationState(g,false);return false}}else{toggleActivationState(g,false);return false}}function revertAutocompleteNormalize(){$.ui.autocomplete.prototype._normalize=function(b){if(b.length&&b[0].label&&b[0].value){return b}
1return $.map(b,function(a){if(typeof a==="string"){return{label:a,value:a}}return $.extend({label:a.label||a.value,value:a.value||a.label},a)})}}function isErrorDisplayed(){return $(".ASM_alert").length}function addCustomerListBtnHandler(){$(".js-customer-list-btn").removeClass("disabled");$(document).on("click",".js-customer-list-btn",function(a){a.preventDefault();$(".js-customer-list-modal-content-wrap").html('<div class="js-customer-list-modal-content"></div>');populateCustomerListModal($(this).data("actionurl"),"#_asm:visible .js-customer-list-modal-content",addCustomerListSelect)})}function openCustomer360Colorbox(a){a.colorbox({inline:"true",className:"ASM_customer360-modal",width:"100%",maxWidth:"1200px",close:'<span class="ASM_icon ASM_icon-close"></span>',transition:"none",scrolling:false,opacity:0.7,top:10,onOpen:function(){customer360Callback();$(window).on("resize",colorboxResize)},onClosed:function(){$(window).off("resize",colorboxResize)}})}function colorboxResize(){$.colorbox.resize()}function addCustomer360Handler(){openCustomer360Colorbox($(".js-customer360"))}function addGenericCustomer360Handler(){if($("#enable360View").val()){openCustomer360Colorbox($)}}function customer360Callback(){var a="<div class='loader'>Loading..</div>";$("#cboxLoadedContent").html(a).show();$.ajax({url:ACC.config.encodedContextPath+"/assisted-service-aif/customer360",type:"GET",success:function(b){$("#cboxLoadedContent").append(b);$.colorbox.resize()},error:function(c,d,b){console.debug("Failed to load Customer 360. %s",b);document.location.reload()}})}function loadCustomer360Fragment(a){return $.ajax({url:ACC.config.encodedContextPath+"/assisted-service-aif/customer360Fragment",timeout:a.timeout,type:a.method,data:a,success:function(b){$("#"+a.fragmentId).html(b);$.colorbox.resize()},error:function(c,d,b){if(d==="timeout"){$("#"+a.fragmentId).html("Widget timeout!")}else{console.debug("Failed to get widget data! %s",b);$("#"+a.fragmentId).html("Failed to get widget data!")}}})}function asmAifSectionClickHandler(){$(document).on("click",".asm__customer360__menu li",function(a){a.preventDefault();if(!$(this).hasClass("nav-tabs-mobile-caret")){aifSelectSection($(this).index())}})}function aifSelectLastSection(){var b=0;if(sessionStorage.getItem("lastSection")){var a=JSON.parse(sessionStorage.getItem("lastSection"));if(getCurrentEmulatedCustomerId()===a.userId){b=a.sectionId}}$($(".asm__customer360__menu li[role='presentation']")[b]).addClass("active");aifSelectSection(b)}function aifSelectSection(a){$("#sectionPlaceholder").hide();$("#longLoadExample").show();var b=$(".asm__customer360__menu li").get(a).getAttribute("value");sessionStorage.setItem("lastSection",JSON.stringify({userId:getCurrentEmulatedCustomerId(),sectionId:a}));$.ajax({url:ACC.config.encodedContextPath+"/assisted-service-aif/customer360section?sectionId="+b,type:"GET",success:function(c){$("#sectionPlaceholder").html(c);$("#longLoadExample").hide();$("#sectionPlaceholder").show();$.colorbox.resize()}});resetSession()}function getCurrentEmulatedCustomerId(){if($("#_asmBindForm input[name='customerId']").length){return $("#_asmBindForm input[name='customerId']").val()}return"anonymous"}function getCustomerListSearchUrl(){var c=$(".js-customer-list-sorting").data("sort-url");c+=$(".ASM_customer-list-modal .sort-refine-bar .form-control").val();var a=$("#ASM_customer-list-queryInput").val();var b=encodeURIComponent(a);c+="&query="+b;return c}function customerListModalHandler(){$(document).on("click",".ASM_customer-list-modal .pagination a",function(a){a.preventDefault();populateCustomerListModal($(this).attr("href"),".asm-account-section",replaceCustomerListTable)});$(document).on("click","#ASM_customer-list-sortOptions .sortOption",function(c){c.preventDefault();var b=$(this).data("value");var a=$(".ASM_customer-list-modal .sort-refine-bar .form-control").val();if(b!==a){$(".ASM_customer-list-modal .sort-refine-bar .form-control").val(b);var d=getCustomerListSearchUrl();populateCustomerListModal(d,".asm-account-section",replaceCustomerListTable)}});$(document).on("keypress","#ASM_customer-list-queryInput",function(a){if
1(a.keyCode===13){$("#ASM_customer-list-searchButton").click();return false}else{return true}});$(document).on("click","#ASM_customer-list-searchButton",function(a){a.preventDefault();var b=getCustomerListSearchUrl();populateCustomerListModal(b,".asm-account-section",replaceCustomerListTable)});$(document).on("change",".ASM_customer-list-modal .sort-refine-bar .form-control",function(a){a.preventDefault();var b=getCustomerListSearchUrl();populateCustomerListModal(b,".asm-account-section",replaceCustomerListTable)});$(document).on("change",".js-customer-list-select",function(b){b.preventDefault();var c=$(this).data("search-url");c+=$(this).val();var a=populateCustomerListModal(c,".asm-account-section",replaceCustomerListTable);a.done(function(){$.colorbox.resize()})})}function addCustomerListSelect(b,e){var a=$(e).find(".js-customer-list-select");$(b).html(e);var d=$(e).find(".js-customer-list-select").data("search-url");if(a[0].options.length>0){d+=a[0].options[0].value}var c=populateCustomerListModal(d,b,appendCustomerListTable);c.done(function(){ACC.colorbox.open("",{href:".js-customer-list-modal-content",inline:true,className:"ASM_customer-list-modal",width:"100%",maxWidth:"1200px",close:'<span class="ASM_icon ASM_icon-close"></span>',transition:"none",scrolling:false,opacity:0.7,top:10,onOpen:function(){$(window).on("resize",colorboxResize)},onClosed:function(){$(window).off("resize",colorboxResize)}})})}function appendCustomerListTable(a,b){$(a).append(b)}function replaceCustomerListTable(a,b){$(a).html(b)}function populateCustomerListModal(d,a,b){var c="GET";return $.ajax({url:d,type:c,success:function(e){b(a,e)},error:function(f,g,e){console.debug("Failed to get customer list. %s",e);document.location.reload()}})}function getAifTablePageSize(){var a=5;if($(window).width()<668){a=10}return a}function copyToClipBoard(b){$("#asmCopyHoldtext").val(b);$("#asmCopyHoldtext").show();$("#asmCopyHoldtext").select();try{return document.execCommand("copy")}catch(a){console.debug("Copy to clipboard failed.",a);return false}finally{$("#asmCopyHoldtext").hide()}}function addRatesTableSorterParser(){$.tablesorter.addParser({id:"rates",is:function(a){return false},format:function(b,c,a){return Math.floor($(a).attr("data-text")*10)},type:"numeric"})}function removeAsmAlert(a){setTimeout(function(){$(".ASM_alert").fadeOut("slow")},a)}ACC.assistedservicestorefront={buildArrayValues:function(a,b){a.push(b);return a}};$(function(){if($(".js-ASM-collapseBtn").length>0){var a=false;var d=function(){var g="ASMcollapseBtn=";var e=document.cookie.split(";");for(var f=0;f<e.length;f++){var h=e[f];while(h.charAt(0)===" "){h=h.substring(1,h.length)}if(h.indexOf(g)===0){return jQuery.parseJSON(decodeURIComponent(h.substring(g.length,h.length)))}}return null};var b=d();if(b){$(".js-ASM-collapseBtn").css("left",b.position+"%");if(b.state){$("#_asm").addClass("asm-collapsed")}}$("#_asm").show();var c=function(){var g=$(".js-ASM-collapseBtn").offset().left;var e=$(".js-ASM-collapseBtn-wrapper").width();var f={position:g/(e/100),state:$("#_asm").hasClass("asm-collapsed")};document.cookie="ASMcollapseBtn="+encodeURIComponent(JSON.stringify(f))+"; path=/"};$(document).on("mouseup",".js-ASM-collapseBtn",function(){if(!a){if($("#_asm").hasClass("asm-collapsed")){$("#_asm").removeClass("asm-collapsed")}else{$("#_asm").addClass("asm-collapsed")}c()}})}});$(function(){$(document).on("click",".js-dropdown",function(b){b.preventDefault();var a=$(this).parent();if(a.hasClass("open")){a.removeClass("open")}else{a.addClass("open")}});$(document).on("click",".js-customer-360-tab",function(a){a.preventDefault();$(this).parent().addClass("active").siblings().removeClass("active")})});

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.