var greenshiftcarousel=document.getElementsByClassName("gspb_smartscroll");for(let i=0;i<greenshiftcarousel.length;i++){let carouselEl=greenshiftcarousel[i],customwrap=carouselEl.getAttribute("data-carouselWrapper"),dragEnable;if(!customwrap){let btns=carouselEl.querySelector(".gspb_smartscroll_btns");btns&&(customwrap=btns.getAttribute("data-carouselWrapper"))}if(carouselEl.getAttribute("data-dragenable")){let scrollContainer=customwrap?carouselEl.querySelector("."+customwrap):carouselEl,isDown=!1,startX,scrollLeft;scrollContainer.addEventListener("mousedown",e=>{isDown=!0,scrollContainer.classList.add("activedrag"),startX=e.pageX-scrollContainer.offsetLeft,scrollLeft=scrollContainer.scrollLeft,cancelMomentumTracking()}),scrollContainer.addEventListener("mouseleave",()=>{isDown=!1,scrollContainer.classList.remove("activedrag")}),scrollContainer.addEventListener("mouseup",()=>{isDown=!1,scrollContainer.classList.remove("activedrag"),beginMomentumTracking()}),scrollContainer.addEventListener("mousemove",e=>{if(!isDown)return;e.preventDefault(),e.stopPropagation();const x=e.pageX-scrollContainer.offsetLeft,walk=x-startX;var prevScrollLeft=scrollContainer.scrollLeft;scrollContainer.scrollLeft=scrollLeft-walk,velX=scrollContainer.scrollLeft-prevScrollLeft});var velX=0,momentumID;function beginMomentumTracking(){cancelMomentumTracking(),momentumID=requestAnimationFrame(momentumLoop)}function cancelMomentumTracking(){cancelAnimationFrame(momentumID)}function momentumLoop(){scrollContainer.scrollLeft+=.5*velX,velX*=.98,Math.abs(velX)>.1&&(momentumID=requestAnimationFrame(momentumLoop))}scrollContainer.addEventListener("wheel",e=>{cancelMomentumTracking()}),scrollContainer.addEventListener("wheel",evt=>{evt.preventDefault(),window.requestAnimationFrame(()=>{scrollContainer.scrollTo({top:0,left:scrollContainer.scrollLeft+evt.deltaY+evt.deltaX})})})}}