define(['jquery','mage/smart-keyboard-handler','mage/translate','Magento_Catalog/js/price-utils','lazyload','customValidation','customPhoneValidation','rjsResolver','Magento_Customer/js/customer-data','matchMedia','mage/mage','mage/calendar','unveil','domReady!','jquery/validate','owlCarousel'],function($,keyboardHandler,$t,priceutils,LazyLoad,customValidation,customPhoneValidation,resolver,customerData){'use strict';customValidation();customPhoneValidation();resolver(function(){var $calendar=$('.calendar');if($calendar.length>0){$calendar.calendar($calendar.data('options'));}},this);var customerData=customerData.get('customer');customerData.subscribe(function(data){if(!data['websiteId']){$('#switcher-language-nav').removeClass('hide');$('.minicart-wrapper').hide();}else{$('#switcher-language').removeClass('hide');}});var $invoiceForm=$('.invoice-form');if($invoiceForm.length>0){var $resetBtn=$('.reset');$resetBtn.on('click',function(){$invoiceForm.find('.input-text').val('');$invoiceForm.find('select').val('');setTimeout(function(){$invoiceForm[0].submit();},10);});} $('.page-footer .container.copyright').detach().appendTo('.page-footer');$('#switcher-language-nav').detach().appendTo('.header__content');var $orderSearchForm=$('.order-search');if($orderSearchForm.length>0){$orderSearchForm.find('[type="reset"]').on('click',function(event){event.preventDefault();$orderSearchForm.find('.input-text').val('');$orderSearchForm.find('select').val('');setTimeout(function(){$orderSearchForm[0].submit();},10);});} if(typeof(window.checkout)!=='undefined'){if(!window.checkout.showPrice){$('body').addClass('hideprice');}} $('#qty,.qty').on('keyup',function(){$(this).attr('value',$(this).val().replace(/[^0-9]/g,''));}) $('.calendar').on('keyup',function(){$(this).attr('value',$(this).val().replace(/[^0-9/]/g,''));}) if($('body').hasClass('page-product-bundle')&&!$('.product-options-wrapper .form-list').hasClass('earmold-addon')){$('.warranty').addClass('noearmold');} if($('body').hasClass('page-product-configurable')&&!$('.configurableclass .related-earmold').hasClass('earmold-addonc')){$('.warranty').addClass('noearmold');} if($('.isdemoproduct').hasClass('colornodropdown')){$('.radioselector').addClass('show');$('.product-add-form').addClass('demoproduct');} if($('.fieldset-bundle-options > .field').hasClass('Charger')){$('.warranty').addClass('hascharger');} if($('.product-options-wrapper > .fieldset > .field > div').hasClass('control')){$('.warranty').addClass('haspf');} if($('.product-add-form').hasClass('BTEgroup')){$('.box-tocart').prepend($('.configqty').detach());} if($('.bundleclass').hasClass('BTEgroup')){$('.bundleclass').removeClass('BTEgroup');$('.bundleclass').addClass('BTEgroupr');} if(typeof(window.checkout)!=='undefined'){if(window.checkout.showPrice&&window.estimateShippingTaxBlock){$('.checkout-cart-index').addClass('totals-loading');}} if($('body').hasClass('catalog-product-view')){if(!$('.detailed .data.content .block').hasClass('related')){$('#tab-label-custom_relprod').hide();}} $('.menu-dropdown-icon a').on('mouseover',function(){$(this).closest('.level-top').addClass('hover');}).on('mouseout',function(){$(this).closest('.level-top').removeClass('hover');});$('.menu-dropdown-icon a').on('mouseover',function(){$(this).closest('.menu-dropdown-icon').addClass('hover');}).on('mouseout',function(){$(this).closest('.menu-dropdown-icon').removeClass('hover');}) if(!$('.toolbar > div').hasClass('pages')){$('.toolbar .breadcrumbs').addClass('moveright')} $('body.account').find('.block-collapsible-nav-title').on('dimensionsChanged',function(){if($(this).hasClass('active')){$('html, body').animate({scrollTop:$(this).offset().top-20},500);}});var checkoutPage=document.getElementById('checkout');if(checkoutPage){if(typeof window.checkoutConfig!=='undefined'&&window.checkoutConfig.isPunchOut===true){checkoutPage.classList.add('punchout-checkout');}} var $lazy=$('.gor-lazy');if($lazy.length){$lazy.trigger('unveil');$lazy.unveil(250,function(){$(this).addClass('gor-lazy--loaded');});} window.lazySettings={elements_selector:'.lazy',class_loading:'lazy--loading',class_loaded:'lazy--loaded',class_error:'lazy--error'};var globalLazy=new LazyLoad(window.lazySettings);$(document).on('refresh.lazy',function(){globalLazy.update();});$('.jstree-container-ul li').each(function(){var isselected=$(this).attr('aria-selected');if(!isselected){$('#Magento_Company::index > a').removeClass('jstree-clicked');}});$('.jstree-container-ul li a').click(function(){$(this).parent().attr('aria-selected');if(!isselected){$('#Magento_Company::index > a').removeClass('jstree-clicked');}});$('body').on('click','.jstree-anchor',function(e){e.preventDefault();e.stopPropagation();var parentList=$(e.target).closest('ul'),checked=parentList.find('.jstree-clicked');if(checked.length0){$owlCarousel.owlCarousel({"loop":false,"dots":false,"items":6,"nav":true,"navText":"","responsive":{"0":{"items":2,"slideBy":2},"768":{"items":6,"slideBy":2},"960":{"items":6,"slideBy":2,"margin":20}}});} $('.product-items.owl-carousel--custom').owlCarousel({"loop":false,"dots":false,"items":6,"nav":true,"navText":"","responsive":{"0":{"items":1,"slideBy":2},"368":{"items":2,"slideBy":1},"768":{"items":3,"slideBy":1},"960":{"items":6,"mouseDrag":false,"slideBy":2,"margin":20}}});if(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)){var viewportmeta=document.querySelector('meta[name="viewport"]');if(viewportmeta){viewportmeta.content='width=device-width, minimum-scale=1.0, maximum-scale=1.0';document.body.addEventListener('gesturestart, resize',function(){viewportmeta.content='width=device-width, minimum-scale=1, maximum-scale=1.6, initial-scale=1';},false);}} $.validator.addMethod('validate-alpha-with-spaces',function(value){return/^[a-zA-Z\s]*$/.test(value);},$.mage.__('Please use letters only (a-z or A-Z) in this field.')) $('[data-role="youtube-video"]').on('click',function(e){e.preventDefault();var $self=$(this);if(!$self.hasClass('video--loaded')){var url=$(this).data('src');var youtubeOptions={autoplay:1,autohide:1,rel:0,showinfo:0,playsinline:0,disablekb:0,modestbranding:1} var $iframe=$('