PageSourceSearch

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

js tarpsandall.com collected 2026-10-04 13:26:08 UTC 23,860 bytes, 42 lines download raw bytes

1(function(){'use strict';var navigationHtml='<div class="swiper-button-prev swiper-button-black"></div>'+'<div class="swiper-button-next swiper-button-black"></div>';$.widget('swiper',{component:'Swissup_Swiper/js/swiper',create:function(){var target,container;if(this.options.target){target=this.options.target.container?this.options.target.container:this.options.target;container=$(target,this.element).addClass('swiper-container');container.children(this.options.target.wrapper).addClass('swiper-wrapper').children(this.options.target.slide).addClass('swiper-slide');container.append(navigationHtml);this.element=container;this.options=$.extend({navigation:{nextEl:'.swiper-button-next',prevEl:'.swiper-button-prev'}},this.options);}
2if(this.options.lazy){this.options.on=$.extend({},this.options.on,{lazyImageReady:this.updateSwiper.bind(this)});}
3new Swiper(this.element,this.options);},updateSwiper:function(){var swiper=this.element.get(0).swiper;if(swiper){swiper.update();}}});})();(function(){'use strict';$.validator.validators['validate-emails']=[function(value){var emails,i;if(!value){return true;}
4emails=value.split(/[\s\n\,]+/g);for(i=0;i<emails.length;i++){if(!$.validator.regex.email.test(emails[i].trim())){return false;}}
5return true;},$.__('Please enter valid email addresses, separated by commas. For example, [email protected], [email protected].')];$.validator.validators['password-not-equal-to-user-name']=[function(value,element,params){if(typeof params==='string'){return value.toLowerCase()!==params.toLowerCase();}
6return true;},$.__('The password can\'t be the same as the email address. Create a new password and try again.')];$.validator.validators['validate-customer-password']=[function(value,element){if(!value||value.length===0){return true;}
7var counter=0,passwordMinLength=$(element).data('password-min-length'),passwordMinCharacterSets=$(element).data('password-min-character-sets'),result=value.length>=passwordMinLength;if(result===false){this.passwordErrorMessage=$.__('Minimum length of this field must be equal or greater than %1 symbols. Leading and trailing spaces will be ignored.').replace('%1',passwordMinLength);return result;}
8if(value.match(/\d+/)){counter++;}
9if(value.match(/[a-z]+/)){counter++;}
10if(value.match(/[A-Z]+/)){counter++;}
11if(value.match(/[^a-zA-Z0-9]+/)){counter++;}
12if(counter<passwordMinCharacterSets){result=false;this.passwordErrorMessage=$.__('Minimum of different classes of characters in password is %1. Classes of characters: Lower Case, Upper Case, Digits, Special Characters.').replace('%1',passwordMinCharacterSets);}
13return result;},function(){return this.passwordErrorMessage;}];})();(function(){'use strict';$.widget('address',{component:'address',options:{deleteConfirmMessage:$.__('Are you sure you want to delete this address?')},_create:function(){var options=this.options,addAddress=options.addAddress,deleteAddress=options.deleteAddress;if(addAddress){$(document).on('click.address',addAddress,this._addAddress.bind(this));}
14if(deleteAddress){$(document).on('click.address',deleteAddress,this._deleteAddress.bind(this));}},destroy:function(){$(document).off('click.address');this._super();},_addAddress:function(){$.breeze.visit(this.options.addAddressLocation);},_deleteAddress:function(e){var self=this,id=$(e.target).parent().data('address')||$(e.target).data('address');$.confirm({content:this.options.deleteConfirmMessage,actions:{confirm:function(){$.breeze.visit(self.options.deleteUrlPrefix+
15id+'/form_key/'+
16$.cookies.get('form_key'));}}});return false;}});})();(function(){'use strict';$.widget('changeEmailPassword',{component:'changeEmailPassword',options:{changeEmailSelector:'[data-role=change-email]',changePasswordSelector:'[data-role=change-password]',mainContainerSelector:'[data-container=change-email-password]',titleSelector:'[data-title=change-email-password]',emailContainerSelector:'[data-container=change-email]',newPasswordContainerSelector:'[data-container=new-password]',confirmPasswordContainerSelector:'[data-container=confirm-password]',currentPasswordSelector:'[data-input=current-password]',emailSelector:'[data-input=change-email]',newPasswordSelector:'[data-input=new-password]',confirmPasswordSelector:'[data-input=confirm-password]',otpContainerSelector:'[data-container=change-otp]',passwordContainerSelector:'[data-container=current-password]',showpasswordContainerSelector:'[data-container=current-sh
16owpassword]'},create:function(){this.element.on('change',this._checkChoice.bind(this));$(this.options.emailSelector).on('change keyup paste',this._updatePasswordFieldWithEmailValue.bind(this));this._checkChoice();},_checkChoice:function(){if($(this.options.changeEmailSelector).is(':checked')&&$(this.options.changePasswordSelector).is(':checked')){this._showAll();}else if($(this.options.changeEmailSelector).is(':checked')){this._showEmail();}else if($(this.options.changePasswordSelector).is(':checked')){this._showPassword();}else{this._hideAll();}},_showAll:function(){$(this.options.titleSelector).html(this.options.titleChangeEmailAndPassword);document.querySelector('.action.save').disabled=true;$(this.options.mainContainerSelector).show();$(this.options.emailContainerSelector).show();$(this.options.newPasswordContainerSelector).show();$(this.options.confirmPasswordContainerSelector).show();$(this.options.otpContainerSelector).show();$(this.options.passwordContainerSelector).show();$(this.options.showpasswordContainerSelector).show();$(this.options.currentPasswordSelector).attr('data-validate','{required:true}').prop('disabled',false);$(this.options.emailSelector).attr('data-validate','{required:true}').prop('disabled',false);this._updatePasswordFieldWithEmailValue();$(this.options.confirmPasswordSelector).attr('data-validate','{required:true, equalTo:"'+this.options.newPasswordSelector+'"}').prop('disabled',false);},_hideAll:function(){$(this.options.mainContainerSelector).hide();$(this.options.emailContainerSelector).hide();$(this.options.newPasswordContainerSelector).hide();$(this.options.confirmPasswordContainerSelector).hide();$(this.options.otpContainerSelector).hide();$(this.options.passwordContainerSelector).hide();$(this.options.showpasswordContainerSelector).hide();$(this.options.currentPasswordSelector).removeAttr('data-validate').prop('disabled',true);$(this.options.emailSelector).removeAttr('data-validate').prop('disabled',true);$(this.options.newPasswordSelector).removeAttr('data-validate').prop('disabled',true);$(this.options.confirmPasswordSelector).removeAttr('data-validate').prop('disabled',true);},_showEmail:function(){this._showAll();$(this.options.titleSelector).html(this.options.titleChangeEmail);document.querySelector('.action.save').disabled=true;document.getElementById('email').readOnly=true;$(this.options.otpContainerSelector).show();$(this.options.passwordContainerSelector).hide();$(this.options.showpasswordContainerSelector).hide();$(this.options.newPasswordContainerSelector).hide();$(this.options.confirmPasswordContainerSelector).hide();$(this.options.newPasswordSelector).removeAttr('data-validate').prop('disabled',true);$(this.options.confirmPasswordSelector).removeAttr('data-validate').prop('disabled',true);},_showPassword:function(){this._showAll();$(this.options.titleSelector).html(this.options.titleChangePassword);document.querySelector('.action.save').disabled=false;$(this.options.emailContainerSelector).hide();$(this.options.otpContainerSelector).hide();$(this.options.passwordContainerSelector).show();$(this.options.showpasswordContainerSelector).show();$(this.options.emailSelector).removeAttr('data-validate').prop('disabled',true);},_updatePasswordFieldWithEmailValue:function(){$(this.options.newPasswordSelector).attr('data-validate','{required:true, '+'\'validate-customer-password\':true, '+'\'password-not-equal-to-user-name\':\''+$(this.options.emailSelector).val()+'\'}').prop('disabled',false);}});})();(function(){'use strict';$(document).on('breeze:mount:regionUpdater',function(event,data){$(data.el).regionUpdater(data.settings);});$.widget('regionUpdater',{component:'directoryRegionUpdater',options:{regionTemplate:'<option value="<%- data.value %>" <% if (data.isSelected) { %>selected="selected"<% } %>>'+'<%- data.title %>'+'</option>',isRegionRequired:true,isZipRequired:true,isCountryRequired:true,currentRegion:null,isMultipleCountriesAllowed:true},create:function(){this._initCountryElement();this.currentRegionOption=this.options.currentRegion;this.regionTmpl=_.template(this.options.regionTemplate);this._updateRegion(this.element.val());$(this.options.regionListId).on('change',function(e){this.setOption=false;this.currentRegionOption=$(e.target).val();}.bind(this));$(this.options.regionInputId).on('focusout',function(){this.setOption=true;}.bind(this));},_initCountryElement:function(){if(this.options.isMultipleCountriesAllowed){this.element.parents('div.field').show();this.element.on('change',function(e){$(this.options.regionListId).val('');$(this.options.regionInputId).val('');this._updateRegion($(e.target).val());}.bind(this));if(this.options.isCountryRequired){this.element.addClass('required-entry');this.element.parents('div.field').addClass('required');}}else{this.element.parents('div.field').hide();}},_removeSelectOptions:function(selectElement){selectElement.find('option').each(function(index){
16if(index){$(this).remove();}});},_renderSelectOption:function(selectElement,key,value){var name=value.name.replace(/[!"#$%&'()*+,.\/:;<=>?@[\\\]^`{|}~]/g,'\\$&'),tmplData,tmpl;if(value.code&&$(name).is('span')){key=value.code;value.name=$(name).text();}
17tmplData={value:key,title:value.name,isSelected:false};if(this.options.defaultRegion==key){tmplData.isSelected=true;}
18tmpl=this.regionTmpl({data:tmplData});selectElement.append($(tmpl));},_clearError:function(){var args=['clearError',this.options.regionListId,this.options.regionInputId,this.options.postcodeId];if(this.options.clearError&&typeof this.options.clearError==='function'){this.options.clearError.call(this);}else{if(!this.options.form){this.options.form=this.element.closest('form').length?$(this.element.closest('form')[0]):null;}
19this.options.form=$(this.options.form);this.options.form&&this.options.form.data('validator')&&this.options.form.validation.apply(this.options.form,_.compact(args));$(this.options.regionInputId).removeClass('mage-error').parent().find('[generated]').remove();$(this.options.regionListId).removeClass('mage-error').parent().find('[generated]').remove();$(this.options.postcodeId).removeClass('mage-error').parent().find('[generated]').remove();}},_updateRegion:function(country){var regionList=$(this.options.regionListId),regionInput=$(this.options.regionInputId),postcode=$(this.options.postcodeId),label=regionList.parent().siblings('label'),container=regionList.parents('div.field'),regionsEntries,regionId,regionData;this._clearError();this._checkRegionRequired(country);if(this.options.regionJson[country]){this._removeSelectOptions(regionList);regionsEntries=_.pairs(this.options.regionJson[country]);regionsEntries.sort(function(a,b){return a[1].name>b[1].name?1:-1;});$.each(regionsEntries,function(key,value){regionData=value[1];regionId=value[0];this._renderSelectOption(regionList,regionId,regionData);}.bind(this));if(this.currentRegionOption){regionList.val(this.currentRegionOption);}
20if(this.setOption){regionList.find('option').filter(function(){return this.text===regionInput.val();}).attr('selected',true);}
21if(this.options.isRegionRequired){regionList.addClass('required-entry').removeAttr('disabled');container.addClass('required').show();}else{regionList.removeClass('required-entry validate-select').removeAttr('data-validate');container.removeClass('required');if(!this.options.optionalRegionAllowed){regionList.hide();container.hide();}else{regionList.removeAttr('disabled').show();}}
22regionList.show();regionInput.hide();label.attr('for',regionList.attr('id'));}else{this._removeSelectOptions(regionList);if(this.options.isRegionRequired){regionInput.addClass('required-entry').removeAttr('disabled');container.addClass('required').show();}else{if(!this.options.optionalRegionAllowed){regionInput.attr('disabled','disabled');container.hide();}
23container.removeClass('required');regionInput.removeClass('required-entry');}
24regionList.removeClass('required-entry').prop('disabled','disabled').hide();regionInput.show();label.attr('for',regionInput.attr('id'));}
25if(this.options.isZipRequired){if(this.options.countriesWithOptionalZip.indexOf(country)>-1){postcode.removeClass('required-entry').closest('.field').removeClass('required');}else{postcode.addClass('required-entry').closest('.field').addClass('required');}}
26regionList.attr('defaultvalue',this.options.defaultRegion);this.options.form.find('[type="submit"]').removeAttr('disabled').show();},_checkRegionRequired:function(country){var self=this;this.options.isRegionRequired=false;$.each(this.options.regionJson.config.regions_required,function(index,elem){if(elem===country){self.options.isRegionRequired=true;}});}});})();(function(){'use strict';var postCodeValidator={validatedPostCodeExample:[],validate:function(postCode,countryId,postCodesPatterns){var self=this,result,patterns=postCodesPatterns?postCodesPatterns[countryId]:(window.checkoutConfig!=undefined)?window.checkoutConfig.postCodes[countryId]:{pattern:"/(^[A-z0-9]{2,10}([\s]{0,1}|[\-]{0,1})[A-z0-9]{2,10}$)/"};this.validatedPostCodeExample=[];if(!postCode||!patterns){return true;}
27result=_.find(patterns,function(item){var regex=new RegExp(item.pattern);self.validatedPostCodeExample.push(item.example);return regex.test(postCode);});return result!==undefined;}};$.widget('addressValidation',{component:'addressValidation',options:{selectors:{button:'[data-action=save-address]',zip:'#zip',country:'select[name="country_id"]'}},create:function(){this.zipInput=this.element.find(this.options.selectors.zip);this.countrySelect=this.element.find(this.options.selectors.country);
27this._addPostCodeValidation();},_addPostCodeValidation:function(){var self=this;this.zipInput.on('keyup',_.debounce(function(event){var valid=self._validatePostCode(event.target.value);self._renderValidationResult(valid);},500));this.countrySelect.on('change',function(){var valid=self._validatePostCode(self.zipInput.val());self._renderValidationResult(valid);});},_validatePostCode:function(postCode){var countryId=this.countrySelect.val();if(postCode===null){return true;}
28return postCodeValidator.validate(postCode,countryId,this.options.postCodes);},_renderValidationResult:function(valid){var warnMessage,alertDiv=this.zipInput.next();if(!valid){warnMessage=$t('Provided Zip/Postal Code seems to be invalid.');if(postCodeValidator.validatedPostCodeExample.length){warnMessage+=$t(' Example: ')+postCodeValidator.validatedPostCodeExample.join('; ')+'. ';}
29warnMessage+=$t('If you believe it is the right one you can ignore this notice.');}
30alertDiv.children().first().text(warnMessage);if(valid){alertDiv.hide();}else{alertDiv.show();}}});})();(function(){'use strict';$.view('lastOrderedItems',{component:'Magento_Sales/js/view/last-ordered-items',defaults:{isShowAddToCart:false},create:function(){this.isShowAddToCart=ko.observable(this.isShowAddToCart);this.lastOrderedItems=$.customerData.get('last-ordered-items');this.lastOrderedItems.subscribe(this.checkSalableItems.bind(this));this.checkSalableItems();return this;},checkSalableItems:function(){var isShowAddToCart=_.some(this.lastOrderedItems().items,{'is_saleable':true});this.isShowAddToCart(isShowAddToCart);}});})();(function(){'use strict';$(document).on('breeze:mount:Magento_Customer/js/logout-redirect',function(event,data){var id=setTimeout(()=>{window.location.href=data.settings.url;},5000);$(document).one('turbolinks:visit',()=>{clearTimeout(id);});});})();(()=>{'use strict';$.widget('ordersReturns',{component:'ordersReturns',options:{zipCode:'#oar-zip',emailAddress:'#oar-email',searchType:'#quick-search-type-id'},_create:function(){$(this.options.searchType).on('change',this._showIdentifyBlock.bind(this)).trigger('change');},_showIdentifyBlock:function(e){var value=$(e.target).val();$(this.options.zipCode).toggle(value==='zip');$(this.options.emailAddress).toggle(value==='email');}});})();(function(){'use strict';$(document).ready(function(){emailOtp.init();});var emailOtp={timeLeft:null,resendBtnContainer:".customer-popup-login .email-otp-resend-container",timerElement:".customer-popup-login .email-otp-timer",popupLogin:"#customer-popup-login",otpmessages:".customer-popup-login .messages",passwordField:'.customer-popup-login .field.password',otpField:'.customer-popup-login .email-otp-field',otpSendContainer:'.customer-popup-login .email-otp-send-container',loginForm:'#customer-popup-login .form-login',resendAction:'.customer-popup-login .email-otp-resend',emailField:'.customer-popup-login  #email-login',emailotpAction:'.customer-popup-login .email-otp-send',emailLoginErrorDiv:'.customer-popup-login div.error-text.mage-error',resetContainer:".customer-popup-login .resend-container",sendOtpUrl:null,loginWithPassword:".customer-popup-login .email-otp-loginwithpassword",emailFieldContainer:'.customer-popup-login div.control.email',resend:false,emailOtpField:".customer-popup-login #emailotp",actionClosePopup:".customer-popup-login .action-close",passTxtField:".customer-popup-login #pass",init:function(){var current=this;current.sendOtpUrl=BASE_URL+"otplogin/account/otploginpost"
31current.timeLeft=(window.emailOtpTimer!==undefined&&window.emailOtpTimer!='')?window.emailOtpTimer:60;
31$(document).on("click",current.resendAction,function(e){e.preventDefault();$(current.resetContainer).addClass('hide');var email=current.getEmail();if(current.isValidEmail(email)){current.sendEmailOtp();}else{$(current.emailLoginErrorDiv).length&&$(current.emailLoginErrorDiv).remove();$(current.emailFieldContainer).append('<div for="email-login" id="email-login-error" generated="true" class="error-text mage-error">Please enter a valid email address.</div>');}});$(document).on("click",current.emailotpAction,function(e){e.preventDefault();var email=current.getEmail();$(current.emailLoginErrorDiv).length&&$(current.emailLoginErrorDiv).remove();$(current.otpmessages).html('');if(email==''){$(current.emailFieldContainer).append('<div for="email-login" id="email-login-error" generated="true" class="error-text mage-error">This is a required field.</div>');return;}
32if(!current.isValidEmail(email)){$(current.emailFieldContainer).append('<div for="email-login" id="email-login-error" generated="true" class="error-text mage-error">Please enter a valid email address.</div>');}else{current.sendEmailOtp();}});$(document).on("click",current.loginWithPassword,function(e){e.preventDefault();$(current.emailField).removeClass('.mage-error');$(current.passwordField).removeClass('hide');$(current.otpSendContainer).removeClass('hide');$(current.otpField).addClass('hide');$(current.resendBtnContainer).addClass('hide');current.resend=false;$(current.emailOtpField).val('');});$(document).on("click",'.customer-popup-login .toggle-otp',function(e){if($(current.emailOtpField).attr('type')=='password'){$(current.emailOtpField).attr('type','text');$(this).addClass('fa-eye').removeClass('fa-eye-slash');}else{$(current.emailOtpField).attr('type','password');$(this).addClass('fa-eye-slash').removeClass('fa-eye');}});$(document).on('click',current.actionClosePopup,function(){$(current.emailLoginErrorDiv).length&&$(current.emailLoginErrorDiv).remove();});},getEmail:function(){return $(this.emailField).length&&$(this.emailField).val();},updateTimerDisplay:function(seconds){let minutes;let timeLeftText;timeLeftText=`Resend in ${seconds} ${seconds > 1 ? 'seconds' : 'second'}`;$(this.timerElement).text(timeLeftText);},updateTimerDisplayForLimit:function(seconds,message){let timeLeftText;timeLeftText=message.replace("{time}",seconds);$('.limit_reached').text(timeLeftText);},isValidEmail:function(email){var emailRegex=/^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;return emailRegex.test(email);},startTimer:function(){var current=this;$(current.timerElement).removeClass('hide');current.updateTimerDisplay(current.timeLeft);var countdown;var tmpTimeLeft=current.timeLeft
33countdown=setInterval(function(){tmpTimeLeft--;current.updateTimerDisplay(tmpTimeLeft);if(tmpTimeLeft===0){$(current.timerElement).addClass('hide');$(current.resendBtnContainer).removeClass('hide');clearInterval(countdown);}},1000);},startTimerForLimit:function(limitTime,message){var current=this;current.updateTimerDisplayForLimit(limitTime,message);var countdown;var tmpTimeLeft=limitTime
34countdown=setInterval(function(){tmpTimeLeft--;current.updateTimerDisplayForLimit(tmpTimeLeft,message);if(tmpTimeLeft===0){$('.limit_reached_error').addClass('hide');clearInterval(countdown);}},1000);},sendEmailOtp:function(){var current=this;var otpEmail=current.getEmail();$.ajax({url:current.sendOtpUrl,data:$(current.loginForm).serialize(),type:'POST',dataType:'json',success:function(response){if(response.errors==true){if(current.resend===false){$(current.otpSendContainer).removeClass('hide');}else{$(current.resendBtnContainer).removeClass('hide');}
35$(current.otpmessages).html('');if(response.code=='limit_reached'){$('<div class="message message-error error limit_reached_error"><div class="limit_reached">'+response.time+'</div></div>').appendTo(current.otpmessages);current.startTimerForLimit(response.time,response.message);}else{$('<div class="message message-error error"><div>'+response.message+'</div></div>').appendTo(current.otpmessages);}
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){current.startTimer();$(current.emailLoginErrorDiv).length&&$(current.emailLoginErrorDiv).remove();$(current.otpField).removeClass('hide');$(current.otpSendContainer).addClass('hide');$(current.passwordField).addClass('hide');$(current.otpmessages).html('');if(response.message!==undefined){$('<div class="message message-success success"><div>'+response.message+'</div></div>').appendTo(current.otpmessages);}
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;}else{if(current.resend===true){current.triggerAdobeOtpEvents('adb_resend_email_otp',otpEmail,"otp",current.otpmessages,true);}else{current.triggerAdobeOtpEvents('adb_get_email_otp',otpEmail,false,current.otpmessages);}
39$('<div class="message message-error error"><div>There is something wrong.</div></div>').appendTo(current.otpmessages);}
40$('.login-loader').hide();},error:function(){if(current.resend===true){current.triggerAdobeOtpEvents('adb_resend_email_otp',otpEmail,"otp",current.otpmessages,true);}else{current.triggerAdobeOtpEvents('adb_get_email_otp',otpEmail,false,current.otpmessages);}
41$('.login-loader').hide();},beforeSend:function(){$('.page.messages').remove();$(current.resendBtnContainer).addClass('hide');$('.login-loader').show();$(current.otpmessages).html('');$(current.emailField).removeClass('.mage-error');$(current.passTxtField).val('');$(current.emailOtpField).val('');}});},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,success:result,message:message,timeStamp:Date.now()}}}
42if(typeof _satellite!='undefined'){console.info(digitalData);_satellite.track(action);}}};})();

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.