PageSourceSearch

https://www.tarpsandall.com/static/version1790237564/frontend/Tarp…/Swissup_Breeze/bundles/6/default7.min.js

js tarpsandall.com collected 2026-10-04 13:26:04 UTC 38,363 bytes, 67 lines download raw bytes

1(function(){'use strict';$(document).on('breeze:load',function(){$(document).on('change','#measurement_customer_comment .measurement_comment_section .measurement_approval_section',function(e){if($(this).val()=='approve'){$(this).next('.measurement_comment').hide();$(this).parent().find('.browse-action-button').hide();$(this).parent().find('#upload_images').hide();}else{$(this).next('.measurement_comment').show();$(this).parent().find('.browse-action-button').show();$(this).parent().find('#upload_images').show();}
2var flag='no';$('#measurement_customer_comment .measurement_comment_section .measurement_approval_section').each(function(){if($(this).val()=='disapprove'){flag='yes';}})
3if(flag=='yes'){$('#submit_measurement_status').text('Submit');}else{$('#submit_measurement_status').text('Submit & Pay');}});$(document).on('click','#submit_measurement_status',function(e){if($('#measurement_customer_comment').validation('isValid')){$('body').spinner(true);$(this).addClass('processing-loader');}});$(document).on('change','#customer_comment .without-measurement-item .measurement_approval_section',function(e){$(this).next('.customer-comment-section').show();$(this).parent('.customer_comment_section').find('h4.customer-comment-title').hide();if($(this).val()=='approve'){$(this).parent('.customer_comment_section').find('textarea, .browse-action-button').hide();}else{$(this).parent('.customer_comment_section').find('textarea, .browse-action-button').show();}});});$.widget('uploadImage',{component:'uploadImage',options:{fileExtension:["jpg","jpeg","png","gif","pdf"],},create:function(){var widget=this;setTimeout(function(){widget.intializePersonalizeImage();widget.deleteReferenceImage();},80);},intializePersonalizeImage:function(){var $widget=this;$(".file").on("change",function(){var itemId=$(this).attr("data-itemid");var element=$(this);var file=$(this).prop('files');var extension=$widget.options.fileExtension.join();var formData=new FormData();$.each(file,function(index,item){if(item.name!=undefined&&item.size!=undefined){var ext=item.name.split('.').pop().toLowerCase();var sizeInMB=(item.size /(1024*1024)).toFixed(2);if(sizeInMB>20){$.alert({title:'Upload Logo Image',content:$.__("Please Upload below 20MB size for Logo Image"),actions:{always:function(){}}});$(this).val('');return false;}
4if(_.contains($widget.options.fileExtension,ext)==false){$.alert({title:'Upload Logo Image',content:$.__("Only Allowed these "+extension+" file format"),actions:{always:function(){}}});$(this).val('');return false;}
5formData.append("logo_image[]",item);}});formData.append("order_id",$("input[name=order_id]").val());formData.append("itemId",itemId);var dataVars={'order_id':formData.get('order_id'),'itemId':formData.get('itemId'),'logo_image[]':formData.getAll('logo_image[]')};$.ajax({url:window.refImageUploadURL,data:dataVars,processData:false,contentType:false,type:'POST',success:function(result){if(!result.error){$('.upload_images_'+itemId).show();$('.upload_images_'+itemId).append(result.html);var finalArray=[];$.each(result.file,function(index,item){finalArray.push(item['file']);});var hiddenImages=$("#reference_image_upload_hidden_"+itemId).val();if(hiddenImages.length>0){hiddenImages=hiddenImages.split(',');$.each(hiddenImages,function(index,item){finalArray.push(item);});}
6$("#reference_image_upload_hidden_"+itemId).val(finalArray.join());$('#request_image_'+itemId).prop('checked',false);$('#request_image_'+itemId).attr('disabled',true);}else{alert({content:$t(result.error)});}
7$(element).val('');$widget.deleteReferenceImage();},error:function(data){$.alert({title:'Upload Logo Image',content:$.__(data.error)});$(element).val('');},complete:function(){}});return false;});},deleteReferenceImage:function(){$('.deleteimage').click(function(){var dataId=$(this).attr('data-id');var itemId=$(this).attr('itemid');$('#'+dataId).remove();var refLogoImages=$("#reference_image_upload_hidden_"+itemId).val().split(',');var newLogoImages=[];$.each(refLogoImages,function(index,item){var imageExt=item.split('.');if(imageExt[0]!=dataId){newLogoImages.push(item);}});if(newLogoImages.length>0){$("#reference_image_upload_hidden_"+itemId).val(newLogoImages.join());}
8else{$("#reference_image_upload_hidden_"+itemId).val('');$('#request_image_'+itemId).attr('disabled',false);}});}});})();define(['uiComponent','jquery','ko','mage/url','Magento_Ui/js/lib/spinner','mage/validation','Magento_Customer/js/customer-data'],function(Component,$,ko,urlBuilder,spinner,validation,customerData){var alreadyInitialized=false;return Component.extend({component:'CP_CustomerAccount/js/view/form-login-step',defaults:{template:'CP_CustomerAccount/form-login-step'},emailOrMobile:ko.observable(''),otpCode:ko.observable(''),currentStep:ko.observable(''),message:ko.observable(''),successMessage:ko.observable(''),socialLoginHtml:ko.observable(''),loginForm:ko.observable('#otp-login-modal #otp-login-form'),loginFormLoder:ko.observable('#otp-login-modal .otp-login-popup'),password:ko.observable(''),usePassword:ko.observable(false),isRegistered:ko.observable(true),isRegisteredWithpassword:ko.observable(false),resendCountdown:ko.observable(0),resendEnabled:ko.observable(false),isEmailComplate:ko.observable(''),isOtpComplete:ko.observable(''),usFlag1:ko.observable(''),auFlag1:ko.observable(''),caFlag1:ko.observable(''),ukFlag1:ko.observable(''),othersFlag1:ko.observable(''),smsNotification:ko.observable(true),walletredirect:ko.observable(false),resendInterval:null,digitKeys:[],timeLeft:null,emailField:'#otp-login-modal #email-login',sendOtpUrl:null,resend:false,isInlineMode:false,suppressCloseConfirmation:ko.observable(false),firstname:ko.observable(''),lastname:ko.observable(''),password:ko.observable(''),mobile:ko.observable(''),isFormComplete:ko.observable(false),orderstatusbutton:ko.observable(false),ordernumbers:ko.observable(false),getHelp:ko.observable(false),forceFullyRedirectUrl:ko.observable(''),isCustomerLoggedInState:function(){var customer=customerData.get('customer')();if(customer&&(customer.firstname||customer.fullname||customer.email)){return true;}
9return window.isCustomerLoggedIn===true||$('body').hasClass('customer-logged-in')||$('#signout').length>0;},initialize:function(){this._super();var current=this;current.sendOtpUrl=BASE_URL+"otplogin/account/otploginpost"
10current.timeLeft=(window.emailOtpTimer!==undefined&&window.emailOtpTimer!='')?window.emailOtpTimer:60;current.isInlineMode=$('#otp-login-modal').hasClass('otp-inline-login');if(alreadyInitialized){return this;}
11alreadyInitialized=true;if(!current.isInlineMode){this.initModal();}
12var loginTriggerSelectors=['#open-otp-login','#sign-in-wallet','.nocartlogin','#custom-login-btn','#checkout-customer-login-popup','#orderstatusbutton','#order-numbers','#get-help','#top-ribbon-login','#wallet-login-btn','#wallet-check-points'].join(', ');$(document).on('click',loginTriggerSelectors,function(e){e.preventDefault();var isLoggedIn=current.isCustomerLoggedInState();var actionId=$(this).attr('id');var $target=$(this);if(!isLoggedIn||actionId==='open-otp-login'){current.openModal();}
13if(actionId==='sign-in-wallet'){if(!isLoggedIn){current.walletredirect(true);}else{var walletUrl=$target.attr('href');window.location.href=walletUrl;}}else if(actionId==='orderstatusbutton'){current.orderstatusbutton(true);}else if(actionId==='order-numbers'){var orderViewUrl=$target.attr('href');current.forceFullyRedirectUrl=orderViewUrl;current.ordernumbers(true);}else if(actionId==='get-help'){if(!isLoggedIn){current.getHelp(true);}else{var helpUrl=$target.attr('href');window.location.href=helpUrl;}}});current.walletredirect.subscribe(function(val){window.walletclick=val?1:0;});if($("body").hasClass("breeze")){$(document).off('modal:closed').on('modal:closed',function(e,data){current.walletredirect(false);current.orderstatusbutton(false);current.ordernumbers(false);current.getHelp(false);$('body').removeClass('otppopup');var currentStep=current.currentStep();if(currentStep==3){location.reload();}});}
14if(!$("body").hasClass("breeze")){$(document).off('modalclosed').on('modalclosed',function(){current.walletredirect(false);current.orderstatusbutton(false);current.ordernumbers(false);current.getHelp(false);$('body').removeClass('otppopup');var currentStep=current.currentStep();if(currentStep==3){location.reload();}});}
15$(document).off('click','#otp-login-form .toggle-password').on('click','#otp-login-form .toggle-password',function(e){const icon=$(this);const input=icon.parent().find("input");if(input.attr("type")==="password"){input.attr("type","text");icon.addClass("fa-eye");icon.removeClass("fa-eye-slash");}else{input.attr("type","password");icon.addClass("fa-eye-slash");icon.removeClass("fa-eye");}});$(".sign-icon").off('click').on('click',function(event){$(".login-dropdown").show("fast");current.triggerAdobeTopLogin('adb_top_menu_account_login');event.stopPropagation();});$(document).click(function(event){$(".login-dropdown").hide("fast");event.stopPropagation();});for(let i=1;i<=this.otpLength;i++){const key='digit'+i;this[key]=ko.observable('');this.digitKeys.push(key);}
16this.isEmailComplate=ko.computed(function(){var email=(this.emailOrMobile()||'').trim();if(!email){return false;}
17var pattern=/^[a-zA-Z0-9]+(?:[._%+-]?[a-zA-Z0-9]+)*@[a-zA-Z][a-zA-Z0-9.-]*\.[a-zA-Z]{2,}$/;return pattern.test(email);},this);this.otpCode=ko.computed(function(){var code='';for(var i=0;i<current.digitKeys.length;i++){var key=current.digitKeys[i];
17if(typeof current[key]==='function'){code+=current[key]()||'';}else{code+='';}}
18return code;},this);this.isOtpComplete=ko.computed(function(){var otp=current.otpCode();return otp.length===current.digitKeys.length;},this);this.isPasswordValid=ko.computed(function(){return current.password().length>=4;});this.countryOptions=ko.observableArray([{code:'US',name:'US',storeId:6,dialCode:'+1',thumbnail:this.usFlag},{code:'CA',name:'CA',storeId:11,dialCode:'+1',thumbnail:this.caFlag},{code:'AU',name:'AU',storeId:9,dialCode:'+61',thumbnail:this.auFlag},{code:'UK',name:'UK',storeId:10,dialCode:'+44',thumbnail:this.ukFlag},{code:'Others',name:'Others',storeId:6,dialCode:'',thumbnail:this.otherFlag}]);this.selectedCountry=ko.observable();this.smsNotification.subscribe(function(checked){$('#otp-login-form #sms_notification').val(checked?'1':'0');});$(document).on('paste','.otp-boxes input',function(e){let pasteData='';if(e.originalEvent&&e.originalEvent.clipboardData){pasteData=e.originalEvent.clipboardData.getData('text');}else if(e.clipboardData){pasteData=e.clipboardData.getData('text');}
19const inputs=document.querySelectorAll('.otp-boxes input');for(let i=0;i<inputs.length;i++){const key=current.digitKeys[i];if(typeof current[key]==='function'){current[key](pasteData[i]);inputs[i].value=pasteData[i];}}
20e.preventDefault();});current.isFormComplete=ko.pureComputed(()=>{return this.firstname().trim()!==''||this.lastname().trim()!==''||this.mobile().trim()!==''||this.password().trim()!=='';});var modalInstance=$('#otp-login-modal').data('mageModal');var modalElement=$('#otp-login-modal');var originalCloseModal=modalInstance?modalInstance.closeModal:null;if(!current.isInlineMode&&modalInstance){modalInstance.closeModal=function(){if(current.suppressCloseConfirmation()){current.suppressCloseConfirmation(false);return originalCloseModal.call(modalInstance);}
21var currentStep=current.currentStep();if(currentStep!=1){require(['Magento_Ui/js/modal/confirm'],function(confirm){confirm({modalClass:'otp-confirm-popup',title:'Do you want to close this process?',content:'You will lose your progress if you close now.',buttons:[{text:"Cancel",class:'action-secondary action-dismiss action-pagebuilder-cancel',click:function(event){this.closeModal(event);}},{text:"Close",class:'action-primary action-accept',click:function(event){this.closeModal(event,true);originalCloseModal.call(modalInstance);}}]});});return false;}
22originalCloseModal.call(modalInstance);};$(document).off('click','.modals-overlay').on('click','.modals-overlay',function(e){var currentStep=current.currentStep();if(currentStep!=1){var isOtpModalOpen=$('#otp-login-modal').closest('.modal-popup').hasClass('_show');if(isOtpModalOpen){modalInstance.closeModal();}}});modalElement.closest('.modal-popup').find('.action-close').off('click').on('click',function(e){var currentStep=current.currentStep();if(currentStep!=1){e.preventDefault();e.stopPropagation();modalInstance.closeModal();}else{modalInstance.closeModal();}});}
23if(current.isInlineMode){current.openModal();}},initModal:function(){var options={type:'popup',responsive:true,innerScroll:true,title:'',buttons:[],modalClass:'new-login-popup'};this.popup=$('#otp-login-modal').modal(options);},openModal:function(){this.currentStep(1);for(var i=0;i<this.digitKeys.length;i++){var key=this.digitKeys[i];if(typeof this[key]==='function'){this[key]('');}}
24this.message('');this.successMessage('');this.emailOrMobile('');this.availablesocialLoginhtml();$('#otp-login-form').mage('validation',{});if(!this.isInlineMode){$('#otp-login-modal').modal('openModal');$('body').addClass('otppopup');}
25var currentStep=this.currentStep();this.usFlag1(this.usFlag);this.auFlag1(this.auFlag);this.caFlag1(this.caFlag);this.ukFlag1(this.ukFlag);this.othersFlag1(this.otherFlag);this.suppressCloseConfirmation(false);this.resend=false;},signInWithPassword:function(){this.usePassword(true);for(var i=0;i<this.digitKeys.length;i++){var key=this.digitKeys[i];if(typeof this[key]==='function'){this[key]('');}}
26this.triggerAdobePasswordEvents('adb_login_with_password',this.emailOrMobile());},signInWithPasscode:function(){this.usePassword(false);this.triggerAdobePasswordEvents('adb_login_with_otp',this.emailOrMobile());},clearMessagesAfterDelay:function(){let self=this;setTimeout(function(){self.message('');self.successMessage('');},3000);},forgotpassword:function(){var self=this;var formArray=$('#otp-login-form').serializeArray();var formData=Object.fromEntries(formArray.map(field=>[field.name,field.value]));var payload={...formData,email:formData['username'],};var lodaersectionId=$(self.loginForm());var lodaersectionloaderId=$(self.loginFormLoder());
26$.ajax({url:urlBuilder.build('customeraccount/customer_ajax/forgotpasswordpost'),type:'POST',data:payload,dataType:'json',beforeSend:function(){lodaersectionId.addClass("disabled");lodaersectionloaderId.spinner(true);},complete:function(){lodaersectionId.removeClass("disabled");lodaersectionloaderId.spinner(false);}}).done(function(res){if(!res.errors){self.currentStep(5);}else{self.message(res.message);}
27self.clearMessagesAfterDelay();lodaersectionId.removeClass("disabled");lodaersectionloaderId.spinner(false);}).fail(function(){self.message('');self.clearMessagesAfterDelay();lodaersectionId.removeClass("disabled");lodaersectionloaderId.spinner(false);});},goToRegistration:function(){var self=this;var code=this.otpCode();$('input[name="otp"]').val(code);if($(self.loginForm()).validation()&&$(self.loginForm()).validation('isValid')){var formArray=$('#otp-login-form').serializeArray();var payload={};formArray.forEach(function(field){payload[field.name]=field.value;});$.ajax({url:urlBuilder.build('customeraccount/customer_ajax/login'),type:'POST',contentType:'application/json',data:JSON.stringify(payload),dataType:'json'}).done(function(res){if(!res.errors){self.successMessage(res.message);self.registerUser(formArray);}else{self.message(res.message);}
28self.clearMessagesAfterDelay();}).fail(function(){self.message('OTP verification failed.');self.clearMessagesAfterDelay();});}},registerUser:function(formPayload){var self=this;var formArray=$('#otp-login-form').serializeArray();var formData=Object.fromEntries(formArray.map(field=>[field.name,field.value]));var customerName=formData['username'].split('@')[0];var payload={...formData,firstname:'Customer',lastname:'\u200B',email:formData['username'],};var lodaersectionId=$(self.loginForm());var lodaersectionloaderId=$(self.loginFormLoder());$.ajax({url:formData['smsconcent_url'],data:{isSmsContent:formData['sms_notification'],email:formData['username'],updatefromLoginform:0},method:'post',dataType:'json'});$.ajax({url:urlBuilder.build('customeraccount/customer_ajax/register'),type:'POST',data:payload,dataType:'json',beforeSend:function(){lodaersectionId.addClass("disabled");lodaersectionloaderId.spinner(true);},complete:function(){lodaersectionId.removeClass("disabled");lodaersectionloaderId.spinner(false);}}).done(function(res){if(!res.errors){self.successMessage(res.message||'Registration successful!');self.triggerAdobePasswordEvents('adb_sign_up_successful',self.emailOrMobile());var hasRedirected=false;var redirectIfLoggedIn=function(){var customer=customerData.get('customer')();if(customer&&customer.email){console.log('clearInterval');hasRedirected=true;clearInterval(getCustomerEmailInterval);handleRedirect();}};var handleRedirect=function(){console.log('handleRedirect');self.currentStep(3);self.storeFlagWithCode();};var getCustomerEmailInterval=setInterval(redirectIfLoggedIn,200);setTimeout(function(){if(!hasRedirected){console.log('setTimeout');clearInterval(getCustomerEmailInterval);handleRedirect();}},4000);}else{self.message(res.message||'Registration failed.');$.mage.customdigitaldataWidgetDesktop().initilizeLogInOrSignUpSuccess('adb_sign_up_failed','email',res.message);}
29self.clearMessagesAfterDelay();lodaersectionId.removeClass("disabled");lodaersectionloaderId.spinner(false);}).fail(function(){self.message('Registration failed due to server error.');$.mage.customdigitaldataWidgetDesktop().initilizeLogInOrSignUpSuccess('adb_sign_up_failed','email',res.message);lodaersectionId.removeClass("disabled");lodaersectionloaderId.spinner(false);});},customerUpdate:function(){var self=this;if($(self.loginForm()).validation()&&$(self.loginForm()).validation('isValid')){var formArray=$('#otp-login-form').serializeArray();var formData={};formArray.forEach(function(field){formData[field.name]=field.value;});formData['cell_phone']=(formData['countryCode']||'')+(formData['phone']||'');self.triggerAdobePasswordEvents('adb_sign_up_update_details',self.emailOrMobile(),formData);$.ajax({url:formData['smsconcent_url'],data:{isSmsContent:formData['sms_notification'],isCellPhone:formData['cell_phone'],email:formData['username'],updatefromLoginform:1},method:'post',dataType:'json'}).done(function(response){console.log('[smsconcent] success',response);}).fail(function(xhr,status,error){console.error('[smsconcent] error',status,error,xhr&&xhr.responseText);});var lodaersectionId=$(self.loginForm());var lodaersectionloaderId=$(self.loginFormLoder());
29$.ajax({url:urlBuilder.build('customeraccount/customer_ajax/update'),type:'POST',data:formData,dataType:'json',beforeSend:function(){lodaersectionId.addClass("disabled");lodaersectionloaderId.spinner(true);},success:function(response){if(response.success){self.successMessage(response.message);self.currentStep(4);var hasRedirected=false;var redirectIfLoggedIn=function(){var customer=customerData.get('customer')();if(customer&&customer.email){console.log('clearInterval');hasRedirected=true;clearInterval(getCustomerEmailInterval);handleRedirect();}};var handleRedirect=function(){console.log('handleRedirect');self.suppressCloseConfirmation(true);var $modal=$('#otp-login-modal');if($modal.hasClass('_show')||$modal.is(':visible')){location.reload();$modal.modal('closeModal');}};var getCustomerEmailInterval=setInterval(redirectIfLoggedIn,200);setTimeout(function(){if(!hasRedirected){console.log('setTimeout');clearInterval(getCustomerEmailInterval);handleRedirect();}},4000);}else{self.message(response.message||'Update failed.');}
30self.clearMessagesAfterDelay();lodaersectionId.removeClass("disabled");lodaersectionloaderId.spinner(false);},error:function(){self.message('Something went wrong while updating.');self.clearMessagesAfterDelay();lodaersectionId.removeClass("disabled");lodaersectionloaderId.spinner(false);},complete:function(){lodaersectionId.removeClass("disabled");lodaersectionloaderId.spinner(false);}});}},skipforNow:function(){var self=this;self.currentStep(4);self.triggerAdobePasswordEvents('adb_sign_up_details_skip',self.emailOrMobile());self.suppressCloseConfirmation(true);setTimeout(function(){var $modal=$('#otp-login-modal');if($modal.hasClass('_show')||$modal.is(':visible')){location.reload();$modal.modal('closeModal');}},3000);},availablesocialLoginhtml:function(){var socialsArray=[];var html='';if(this.availableSocials){for(var key in this.availableSocials){if(this.availableSocials.hasOwnProperty(key)){var item=this.availableSocials[key];item.key=key;socialsArray.push(item);}}}
31ko.observableArray(socialsArray);if(socialsArray.length){html+='<ul>';socialsArray.forEach(function(item){if(item.label!=undefined&&item.label.toLowerCase()==='facebook'&&this.isMobile){html+='<li class="'+item.key+'">'+'<a class="facebook-logginbutton" aria-label="'+item.label+'" title="'+item.label+'" href="'+item.login_url+'">'+'<i></i> '+item.label+'</a></li>';}else{html+='<li class="'+item.key+'">'+'<a aria-label="'+item.label+'" title="'+item.label+'" href="javascript:void(0)" onclick="window.open(\''+item.login_url+'\',\'\',\'scrollbars=yes,menubar=no,width=500,resizable=yes,toolbar=no,location=no,status=no\'); return false;">'+'<i></i>'+item.label+'</a></li>';}}.bind(this));html+='</ul>';}
32return html;},getEmail:function(){return $(this.emailField).length&&$(this.emailField).val();},startResendCountdown:function(seconds){var self=this;self.resendCountdown(seconds);self.resendEnabled(false);if(self.resendInterval){clearInterval(self.resendInterval);}
33self.resendInterval=setInterval(function(){var remaining=self.resendCountdown()-1;self.resendCountdown(remaining);if(remaining<=0){clearInterval(self.resendInterval);self.resendEnabled(true);}},1000);},resendOtp:function(){var self=this;self.sendEmailOtp();},onOtpInput:function(data,event){const input=event.target;const value=input.value;if(value.length===1){const inputs=Array.from(document.querySelectorAll('.otp-boxes input'));const index=inputs.indexOf(input);if(index<inputs.length-1){inputs[index+1].focus();}}
34return true;},onOtpKeydown:function(data,event){const input=event.target;const key=event.key;const inputs=Array.from(document.querySelectorAll('.otp-boxes input'));const index=inputs.indexOf(input);if((key==='Backspace'||key==='Delete')&&input.value===''){if(index>0){inputs[index-1].focus();}}
35return true;},sendEmailOtp:function(){var current=this;var otpEmail=current.emailOrMobile();var lodaersectionId=$(current.loginForm());var lodaersectionloaderId=$(current.loginFormLoder());var payload={};var formArray=$('#otp-login-form').serializeArray();formArray.forEach(function(field){payload[field.name]=field.value;});$.ajax({url:current.sendOtpUrl,data:payload,type:'POST',dataType:'json',beforeSend:function(){lodaersectionId.addClass("disabled");lodaersectionloaderId.spinner(true);},success:function(response){if(response.errors==true){if(response.code=='limit_reached'){let time=response.time;let message=response.message.replace('{time}',time);current.message(message);current.startResendCountdown(time);}else{current.message(response.message);}
36if(current.resend===true){current.triggerAdobeOtpEvents('adb_resend_email_otp',otpEmail,"otp",response.message,true);}else{current.triggerAdobeOtpEvents('adb_get_email_otp',otpEmail,false,response.message);}}else if(response.errors==false){if(response.message!==undefined){current.successMessage(response.message);}
37if(current.resend===true){current.triggerAdobeOtpEvents('adb_resend_email_otp',otpEmail,"otp","OTP has been sent successfully",true);}else{current.triggerAdobeOtpEvents('adb_get_email_otp',otpEmail,true,"OTP has been sent successfully");}
38current.resend=true;current.isRegistered(response.is_registered);current.isRegisteredWithpassword(response.is_registered_withpassword);current.currentStep(2);current.startResendCountdown(current.timeLeft);}else{if(current.resend===true){current.triggerAdobeOtpEvents('adb_resend_email_otp',otpEmail,"otp",response.message,true);}else{current.triggerAdobeOtpEvents('adb_get_email_otp',otpEmail,false,response.message);}
39current.message('There is something wrong.');}
40current.clearMessagesAfterDelay();},error:function(response){if(current.resend===true){current.triggerAdobeOtpEvents('adb_resend_email_otp',otpEmail,"otp",response.message,true);}else{current.triggerAdobeOtpEvents('adb_get_email_otp',otpEmail,false,response.message);}
41current.message('There is something wrong.');current.clearMessagesAfterDelay();},complete:function(){lodaersectionId.removeClass("disabled");lodaersectionloaderId.spinner(false);},});},triggerAdobeTopLogin:function(action){window.digitalData=window.digitalData||[];digitalData={event:action,user:{timeStamp:Date.now()}};if(typeof _satellite!='undefined'){console.info(digitalData);_satellite.track(action);}},triggerAdobePasswordEvents:function(action,email,formdata=null){window.digitalData=window.digitalData||[];digitalData={event:action,user:{emailID:email,encryptedEmailid:window.btoa(unescape(email)).substr(0,36),timeStamp:Date.now()}};if(formdata){digitalData.user.firstName=formdata['firstname']||'';digitalData.user.lastName=formdata['lastname']||'';digitalData.user.phone=formdata['phone']||'';}
42if(typeof _satellite!='undefined'){console.info(digitalData);_satellite.track(action);}},triggerAdobeOtpEvents:function(action,email,result,message,resend=false){window.digitalData=window.digitalData||[];if(resend===true){digitalData={event:action,user:{emailID:email,loginType:result,message:message,timeStamp:Date.now()}}}else{digitalData={event:action,user:{emailID:email,encryptedEmailid:window.btoa(unescape(email)).substr(0,36),success:result,message:message,timeStamp:Date.now()}}}
43if(typeof _satellite!='undefined'){console.info(digitalData);_satellite.track(action);}},sendOtp:function(){let self=this;self.usePassword(false);
43if($(self.loginForm()).validation()&&$(self.loginForm()).validation('isValid')){this.emailOrMobile(this.getEmail());self.sendEmailOtp();}},getOtpCode:function(){let self=this;this.otpCode=ko.computed(function(){var code='';for(var i=0;i<self.digitKeys.length;i++){var key=self.digitKeys[i];code+=self[key]()||'';}
44return code;},this)},verifyOtp:function(){var self=this;var code=this.otpCode();$('input[name="otp"]').val(code);if($(self.loginForm()).validation()&&$(self.loginForm()).validation('isValid')){var formArray=$('#otp-login-form').serializeArray();var payload={};formArray.forEach(function(field){payload[field.name]=field.value;});var lodaersectionId=$(self.loginForm());var lodaersectionloaderId=$(self.loginFormLoder());$.ajax({url:urlBuilder.build('customeraccount/customer_ajax/login'),type:'POST',contentType:'application/json',data:JSON.stringify(payload),dataType:'json',beforeSend:function(){lodaersectionId.addClass("disabled");lodaersectionloaderId.spinner(true);}}).done(function(res){if(!res.errors){self.successMessage(res.message);var userData=$.extend({},(window.datalayerConfig&&window.datalayerConfig.user_data)||{});if(res.customerId){userData.customer_id=res.customerId;}
45userData.isCustomerLoggedIn=true;if(window.datalayerConfig){window.datalayerConfig.user_data=$.extend({},window.datalayerConfig.user_data||{},userData);}
46$.mage.customdigitaldataWidgetDesktop({user_data:userData}).initilizeLogInOrSignUpSuccess('adb_login_successful','email');var hasRedirected=false;var redirectIfLoggedIn=function(){var customer=customerData.get('customer')();if(customer&&customer.email){console.log('clearInterval');hasRedirected=true;clearInterval(getCustomerEmailInterval);handleRedirect();}};var handleRedirect=function(){var $modal=$('#otp-login-modal');console.log('handleRedirect');self.suppressCloseConfirmation(true);if($modal.hasClass('_show')||$modal.is(':visible')){if(self.walletredirect()){window.location.href=window.BASE_URL+'WalletPoint/wallet/transaction/';}else if(self.orderstatusbutton()){window.location.href=window.BASE_URL+'sales/order/history';}else if(self.getHelp()){window.location.href=window.BASE_URL+'helpdesk/';}else if(self.ordernumbers()){window.location.href=self.forceFullyRedirectUrl();}else if(res.redirectUrl&&res.redirectUrl.trim()!==''){window.location.href=res.redirectUrl;}else{location.reload();}
47$modal.modal('closeModal');}};var getCustomerEmailInterval=setInterval(redirectIfLoggedIn,200);setTimeout(function(){if(!hasRedirected){console.log('setTimeout');clearInterval(getCustomerEmailInterval);handleRedirect();}},4000);}else{self.message(res.message);$.mage.customdigitaldataWidgetDesktop().initilizeLogInOrSignUpFailed('adb_login_failed','email',res.message);}
48self.clearMessagesAfterDelay();lodaersectionId.removeClass("disabled");lodaersectionloaderId.spinner(false);}).fail(function(){self.message('OTP verification failed.');self.clearMessagesAfterDelay();lodaersectionId.removeClass("disabled");lodaersectionloaderId.spinner(false);});}},goBack:function(){this.message('');this.successMessage('');this.walletredirect(false);this.orderstatusbutton(false);this.getHelp(false);this.usePassword(false);this.resend=false;for(var i=0;i<this.digitKeys.length;i++){var key=this.digitKeys[i];if(typeof this[key]==='function'){this[key]('');}}
49var currentStep=this.currentStep();if(currentStep>1){if(currentStep==5){this.currentStep(2);}else{this.currentStep(currentStep-1);}}},storeFlagWithCode:function(){var currentStep=this.currentStep();var langArray=[];if(window.checkout!=undefined&&window.checkout.storeId!=undefined){var mainstoreId=window.checkout.storeId;}else if(window.storeId!=undefined){var mainstoreId=window.storeId;}else{var mainstoreId=null;}
50$('#otp-login-form .lang-select').each(function(){var formId=$(this).closest("form").attr('id');var selectId=$('.lang-select').closest(".country-code-field").find(".countries").attr('id');$('#'+formId+' #'+selectId+' option').each(function(){var cellstoreid=$(this).attr('data-store-id');var img=$(this).attr("data-thumbnail");var flagdata=$(this).attr('value');var item='';if(mainstoreId==cellstoreid){var getcountryCode=$(this).attr('id');if(getcountryCode){item='<li class="flag_select"><img src="'+img+'" value="'+flagdata+'"/><span>'+flagdata+'</span></li>';}}else{item='<li><img src="'+img+'" value="'+flagdata+'"/><span>'+flagdata+'</span></li>';}
51if(cellstoreid==6&&mainstoreId==5){$('.btn-select').html(langArray[0]);$('#'+formId+' #countryCode').val("+1");}
52langArray.push(item);if(mainstoreId==cellstoreid){var countryCode=$(this).attr('id');if(countryCode){var curr_img=$(this).attr("data-thumbnail");var curr_value=$(this).attr('id');var curr_item='<li><img src="'+curr_img+'" /><span>'+curr_value+'</span></li>';$('#'+formId+' .btn-select').html(curr_item);$('#'+formId+' #countryCode').val(countryCode);$('#'+formId+" #countryCode").prop("readonly",true);}}
53var flagId=$('#'+formId).find("#a_flag_image").attr('class');$('#'+formId+' .'+flagId).append(item);});var flagId=$('#'+formId).find("#a_flag_image").attr('id');$('#'+formId+' #'+flagId+' li').click(function(){$('#'+formId+' #a_flag_image li').removeClass('flag_select');$(this).addClass('flag_select');var img=$(this).find('img').attr("src");var value=$(this).find('img').attr('value');var text=this.innerText;$("#"+formId+" #"+selectId).val(value);$("#"+formId+" #"+selectId).attr("id","currentCNT");var e=document.getElementById("currentCNT");var countryCode=e.options[e.selectedIndex].id;if(countryCode){$('#'+formId+' #countryCode').val(countryCode);$('#'+formId+" #countryCode").prop("readonly",true);$('#'+formId+" .flag-code").removeClass('country-error other-country');}else{$('#'+formId+' #countryCode').val('');$('#'+formId+" #countryCode").prop("readonly",false);$('#'+formId+" .flag-code").addClass('other-country');$('#'+formId+' #countryCode').attr('type','text');}
54if($('#'+formId+' #countryCode').hasClass('mage-error')){$('#'+formId+" .flag-code").addClass('country-error');}else{$('#'+formId+" .flag-code").removeClass('country-error');}
55$("#"+formId+" #currentCNT").attr("id","countries")
56var item='<li><img src="'+img+'" alt="" /><span>'+countryCode+'</span></li>';$('#'+formId+' .btn-select').html(item);$('#'+formId+' .btn-select').attr('value',value);$("#"+formId+" .flag_dropdown_options").hide();});});$(".btn-select").click(function(){var formId=$(this).closest("form").attr('id');$('#'+formId+' .flag_dropdown_options').toggle();var dropdown=$('#'+formId+' .flag_dropdown_options');if(dropdown.is(':visible')){$('#'+formId+' .lang-select').addClass('active-dropdown');}else{$('#'+formId+' .lang-select').removeClass('active-dropdown');}
57if(mainstoreId==5&&$('#'+formId+' #countries').val()=="US"){var firstLI=document.querySelectorAll("#sms-newsletter-validate-detail ul#a_flag_image li");firstLI[0].classname="flag_select";}});$(document).click(function(e){if(e.target.closest('.btn-select')){return;}
58$(".flag_dropdown_options").each(function(){var $dropdown=$(this);var $form=$dropdown.closest("form");var $btn=$form.find(".btn-select");if(!$(e.target).closest($form).length||!$(e.target).is($btn)){$dropdown.hide();$form.find(".lang-select").removeClass("active-dropdown");}});});}});});define(['jquery','algoliaBundle','recommend','recommendJs','recommendProductsHtml','Magento_Customer/js/customer-data','domReady!'],function($,algoliaBundle,recommend,recommendJs,recommendProductsHtml,customerData){'use strict';if(typeof algoliaConfig==='undefined'){return;}
59var result=function(config,element){$(function($){this.defaultIndexName=algoliaConfig.indexName+'_products';const appId=algoliaConfig.applicationId;const apiKey=algoliaConfig.apiKey;let recommendClient=null;if(algoliaConfig.recommend&&algoliaConfig.recommend.isTrendItemsEnabledInPDP==true){recommendClient=recommend(appId,apiKey);}
60const indexName=this.defaultIndexName;if($('body').hasClass('catalog-product-view')||$('body').hasClass('checkout-cart-index')||$('body').hasClass('cms-index-index')||$('body').hasClass('catalogsearch-result-index')){if((algoliaConfig.recommend.enabledFBT&&$('body').hasClass('catalog-product-view'))||(algoliaConfig.recommend.enabledFBTInCart&&$('body').hasClass('checkout-cart-index'))){re
60commendJs.frequentlyBoughtTogether({container:'#frequentlyBoughtTogether',recommendClient,indexName,objectIDs:config.algoliObjectId,maxRecommendations:algoliaConfig.recommend.limitFBTProducts,transformItems:function(items){return items.map((item,index)=>({...item,position:index+1,}));},headerComponent({html}){return recommendProductsHtml.getHeaderHtml(html,algoliaConfig.recommend.FBTTitle);},itemComponent({item,html}){return recommendProductsHtml.getItemHtml(item,html,algoliaConfig.recommend.isAddToCartEnabledInFBT);},});}
61if(algoliaConfig.recommend.enabledRelated&&$('body').hasClass('catalog-product-view')){recommendJs.relatedProducts({container:'#relatedProducts',recommendClient,indexName,objectIDs:config.algoliObjectId,maxRecommendations:algoliaConfig.recommend.limitRelatedProducts,transformItems:function(items){return items.map((item,index)=>({...item,position:index+1,}));},headerComponent({html}){return recommendProductsHtml.getHeaderHtml(html,algoliaConfig.recommend.relatedProductsTitle);},itemComponent({item,html}){return recommendProductsHtml.getItemHtml(item,html,algoliaConfig.recommend.isAddToCartEnabledInRelatedProduct);},});}}
62if((algoliaConfig.recommend.isTrendItemsEnabledInPDP&&($('body').hasClass('cms-index-index')||$('body').hasClass('catalogsearch-result-index')))){var algoliatrendingitemsection=['algoliatrendingitem'];this.algoliaTrendingItemsJson=customerData.get('algoliatrendingitem')();var trendingItemsObject=null;if(this.algoliaTrendingItemsJson.trendingItems!=undefined){trendingItemsObject=this.algoliaTrendingItemsJson.trendingItems;}
63if($('body').hasClass('catalogsearch-result-index')){algoliaConfig.recommend.trendingItemsTitle="Browse Popular Products";}
64if(trendingItemsObject!=null){const container=document.getElementById('trendItems');const items=JSON.parse(trendingItemsObject);const appendHtmlAbove=recommendProductsHtml.getTrendingItemsHtml((strs,...args)=>strs.reduce((acc,str,i)=>acc+str+(args[i]||''),''),items,algoliaConfig.recommend.trendingItemsTitle,algoliaConfig.recommend.isAddToCartEnabledInTrendsItem);container.innerHTML+=appendHtmlAbove;}else{recommendJs.trendingItems({container:'#trendItems',facetName:algoliaConfig.recommend.trendItemFacetName?algoliaConfig.recommend.trendItemFacetName:'',facetValue:algoliaConfig.recommend.trendItemFacetValue?algoliaConfig.recommend.trendItemFacetValue:'',recommendClient,indexName,maxRecommendations:algoliaConfig.recommend.limitTrendingItems,transformItems:function(items){try{let newitems=items.map(item=>({image_url:item.image_url,name:item.name,objectID:item.objectID,price:item.price,status:item.status,url:item.url}));$.ajax({type:'POST',url:window.BASE_URL+'trendingsearch/index/trendingItems',contentType:'application/json',dataType:'json',async:true,data:{'trendingItems':JSON.stringify(newitems)},success:function(response){console.info("Algolia Treding Item response");console.info(response);},error:function(xhr,status,error){console.info(status+': '+error);}});}
65catch(e){console.warn(e.message);}
66return items.map((item,index)=>({...item,position:index+1,}));},headerComponent({html}){return recommendProductsHtml.getHeaderHtml(html,algoliaConfig.recommend.trendingItemsTitle);},itemComponent({item,html}){return recommendProductsHtml.getItemHtml(item,html,algoliaConfig.recommend.isAddToCartEnabledInTrendsItem);},});}}else if(algoliaConfig.recommend.enabledTrendItems&&typeof config.recommendTrendContainer!=="undefined"){let containerValue="#"+config.recommendTrendContainer;recommendJs.trendingItems({container:containerValue,facetName:config.facetName?config.facetName:'',facetValue:config.facetValue?config.facetValue:'',recommendClient,indexName,maxRecommendations:config.numOfTrendsItem?parseInt(config.numOfTrendsItem):algoliaConfig.recommend.limitTrendingItems,transformItems:function(items){return items.map((item,index)=>({...item,position:index+1,}));},headerComponent({html}){return recommendProductsHtml.getHeaderHtml(html,algoliaConfig.recommend.trendingItemsTitle);},itemComponent({item,html}){return recommendProductsHtml.getItemHtml(item,html,algoliaConfig.recommend.isAddToCartEnabledInTrendsItem);},});}});}
67result.component='recommendViewProductJs';return result;});

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.