1const stickyButtonEl=document.querySelector(".sticky-button-el"),stickyButtonImage=document.querySelector(".sticky-button-image img"),stickyButtonWrpEl=document.getElementById("sticky-button-wrp"),stickyButtonPriceEl=document.querySelector(".sticky-button-price"),stickyButtonQuantityEl=document.querySelector(".sticky-button-product-units-quanrity"),stickyButtonItemsCountEl=document.querySelector(".sticky-button-items-count"),discountBadgeEl=document.getElementById("sticky-button-discount-badge"),bulkImageQuantityWrp=document.querySelector(".sticky-button-image-quantity-wrp"),stickyButtonPriceOldEl=document.querySelector(".sticky-button-price-old"),basePrice=document.querySelector(".product-quantity-bulk-item-price").dataset.basePrice,bodyEl=document.body,stickyNativeControls=document.querySelectorAll(".product-item-add-to-cart:not(.sticky-button-el), .product-quantity-retail"),SCROLL_HIDE_DELAY=350;let lastScrollTs=0,scrollHideTimer=null;function setStickyButtonVisibility(shouldShow){if(shouldShow){stickyButtonWrpEl.classList.add("active"),bodyEl.classList.add("sticky-button-active");return}stickyButtonWrpEl.classList.remove("active"),bodyEl.classList.remove("sticky-button-active")}function isElementInViewport(element){if(!element||!element.getBoundingClientRect||window.getComputedStyle(element).display==="none")return!1;const rect=element.getBoundingClientRect();return rect.bottom>0&&rect.top<window.innerHeight}function isAnyNativeOrderButtonVisible(){return!stickyNativeControls||stickyNativeControls.length===0?!1:Array.from(stickyNativeControls).some(control=>!control.offsetParent&&window.getComputedStyle(control).position!=="fixed"?!1:isElementInViewport(control))}function shouldHideWhileScrolling(){return Date.now()-lastScrollTs<SCROLL_HIDE_DELAY}function shouldShowStickyButton(){return!(!(window.matchMedia("(max-width: 991px)").matches||window.scrollY>=window.innerHeight)||isAnyNativeOrderButtonVisible()||shouldHideWhileScrolling())}function updateStickyButtonState(){stickyButtonWrpEl&&setStickyButtonVisibility(shouldShowStickyButton())}function handleScroll(){lastScrollTs=Date.now(),updateStickyButtonState(),clearTimeout(scrollHideTimer),scrollHideTimer=setTimeout(updateStickyButtonState,SCROLL_HIDE_DELAY+20)}document.addEventListener("DOMContentLoaded",()=>{document.addEventListener("scroll",handleScroll,{passive:!0}),window.addEventListener("resize",updateStickyButtonState),updateStickyButtonState(),stickyButtonWrpEl.addEventListener("click",e=>{const bundleSection=document.getElementById("product-quantity-selection");if(!bundleSection){window.scrollTo(0,0);return}const targetTop=window.scrollY+bundleSection.getBoundingClientRect().top-200;window.scrollTo({top:Math.max(0,targetTop),behavior:"smooth"})});let curActiveVariation=document.querySelector(".product-quantity-retail-item.active");setStickyButton(curActiveVariation)});function setStickyButton(item){let priceItem=item.querySelector(".product-quantity-retail-item-price"),priceText="";priceItem?priceText=priceItem.textContent:priceText=item.querySelector(".product-quantity-retail-item-price-promotional").textContent;let quantity=item.dataset.productQuantity;const parsedQuantity=parseInt(quantity,10)||1;stickyButtonPriceEl.textContent=priceText,parsedQuantity>1?(stickyButtonEl.classList.add("two-or-more-items"),stickyButtonWrpEl&&stickyButtonWrpEl.classList.add("has-multiple-items"),stickyButtonPriceOldEl.textContent=currencySymbol+basePrice*parsedQuantity,stickyButtonPriceOldEl.style.display="block"):(stickyButtonEl.classList.remove("two-or-more-items"),stickyButtonWrpEl&&stickyButtonWrpEl.classList.remove("has-multiple-items"),stickyButtonPriceOldEl.textContent="",stickyButtonPriceOldEl.style.display="none"),stickyButtonQuantityEl&&(stickyButtonQuantityEl.textContent=parsedQuantity),stickyButtonItemsCountEl&&(stickyButtonItemsCountEl.textContent=parsedQuantity);let discount=productDiscountAmounts[parsedQuantity];discountBadgeEl.textContent="-"+discount+"%",discount>0?discountBadgeEl.classList.remove("hidden"):discountBadgeEl.classList.add("hidden");let productImageSrc=item.querySelector(".product-quantity-retail-item-image img").src;changeProductImage(stickyButtonImage,productImageSrc)}function setStickyButtonMode(mode){if(mode=="retail"){let curActiveVariation=document.querySelector(".product-quantity-retail-item.active");setStickyButton(curActiveVariation),bulkImageQuantityWrp&&bulkImageQuantityWrp.classList.remove("active")}else setStickyButtonBulk(),bulkImageQuantityWrp&&bulkImageQuantityWrp.classList.add("active")}function setStickyButtonBulk(){let productBulkPrice=document.querySelector(".product-quantity-bulk-item-price").textContent,productQuantityBulk=document.querySelector(".product-quantity-bulk-units-qt").textContent;stickyButtonPriceEl.textContent=currencySymbol+productBulkPrice.trim(),stickyButtonQuantityEl&&(stickyButtonQuantityEl.textContent=productQuantityBulk);let quantity=parseInt(productQuantityBulk);quantity>1?(stickyButtonEl.classList.add("two-or-more-items"),stickyButtonWrpEl&&stickyButtonWrpEl.classList.add("has-multiple-items")):(stickyButtonEl.classList.remove("two-or-more-items"),stickyButtonWrpEl&&stickyButtonWrpEl.classList.remove("has-multiple-items")),stickyButtonItemsCountEl&&(stickyButtonItemsCountEl.textContent=quantity);let discount=productDiscountAmounts[quantity];if(discountBadgeEl.textContent="-"+discount+"%",discountBadgeEl.classList.remove("hidden"),stickyButtonPriceOldEl.textContent=currencySymbol+basePrice*quantity,stickyButtonPriceOldEl.style.display="block",bulkImageQuantityWrp){var colors=[],colorsAll="",qt=0;
1let quantityBulkInputs=document.querySelectorAll(".product-quantity-bulk-input"),stickyButtonImageQuantityMarkers=document.querySelectorAll(".sticky-button-image-quantity");if(quantityBulkInputs.forEach((input,index)=>{let colorQt=input.value,color=input.dataset.color,label=stickyButtonImageQuantityMarkers[index];colorQt!=0?(colors.push(color),qt++,label&&(label.innerHTML="x"+colorQt,label.classList.add("active"))):label.classList.remove("active")}),colors.length!=0){colorsAll=colors.sort().join("-");let img_url=getImageUrl("product-luminette-3"+"-"+colorsAll+"-qt-"+qt+"-2x");changeProductImage(stickyButtonImage,img_url)}}}function setStickyButtonImage(img_url){changeProductImage(stickyButtonImage,img_url)} 2//# sourceMappingURL=/cdn/shop/t/61/assets/sticky-button.js.map?v=36542477038733457381779711503
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.