define(['jquery','underscore','Magento_Customer/js/model/authentication-popup','Magento_Customer/js/customer-data','nostojs','mage/translate','domReady!'],function($,_,authenticationPopup,customerData,nostojs,$t){'use strict';var htmlBody=$("body[data-container='body']");if($(".customer-welcome").length){htmlBody.addClass("customer-logged-in");}else{htmlBody.addClass("customer-logged-out");};$(document).on('click','.yotpo-login-link',function(e){e.preventDefault();authenticationPopup.showModal();});var cart=customerData.get('cart');var oldItems=undefined;var newtems=undefined;cart.subscribe(function(oldCart){if(!_.isUndefined(oldCart['items']&&oldItems==undefined)){let items=oldCart['items'];oldItems=items.map(a=>a.item_id);}else if(oldItems==undefined){let dsCart=localStorage.getItem('ds-cart');if(typeof dsCart!=='undefined'&&dsCart!=='{}'){let oldCart=JSON.parse(dsCart);if(!_.isEmpty(oldCart)){let items=oldCart.cart.items;oldItems=items.map(a=>a.item_id);}}}},this,"beforeChange");cart.subscribe(function(updatedCart){if(!_.isUndefined(updatedCart['items'])){let items=updatedCart['items'];newtems=items.map(a=>a.item_id);if(oldItems!=undefined&&newtems.sort().join(',')!==oldItems.sort().join(',')&&typeof nostojs==='function'){nostojs(function(api){api.createRecommendationRequest().setElements(['test-minicart']);});}}});$(".navigation .parent").on({mouseenter:function(){var $this=$(this),timer=$this.data("timer")||0;clearTimeout(timer);$this.addClass("hover-active");$this.data("timer",timer);},mouseleave:function(){var $this=$(this),timer=$this.data("timer")||0;clearTimeout(timer);timer=setTimeout(function(){$this.removeClass("hover-active");},300);$this.data("timer",timer);}});});