/** Shopify CDN: Minification failed Line 22:2 Transforming const to the configured target environment ("es5") is not supported yet Line 25:4 Transforming const to the configured target environment ("es5") is not supported yet Line 31:8 Transforming const to the configured target environment ("es5") is not supported yet Line 33:8 Transforming const to the configured target environment ("es5") is not supported yet Line 66:2 Transforming const to the configured target environment ("es5") is not supported yet Line 67:2 Transforming const to the configured target environment ("es5") is not supported yet **/ (function() { var __sections__ = {}; (function() { for(var i = 0, s = document.getElementById('sections-script').getAttribute('data-sections').split(','); i < s.length; i++) __sections__[s[i]] = true; })(); (function() { if (!__sections__["upsell-products"]) return; try { const handleIntersection = (entries, observer) => { if (!entries[0].isIntersecting) return; observer.unobserve(productRecommendationsSection); const url = productRecommendationsSection.dataset.url; //console.log(url, 'url') fetch(url) .then(response => response.text()) .then(text => { // console.log(text, 'text') const html = document.createElement('div'); html.innerHTML = text; const recommendations = html.querySelector('.product-recommendations'); if (recommendations && recommendations.innerHTML.trim().length) { productRecommendationsSection.innerHTML = recommendations.innerHTML; } var swiper = new Swiper('.pdp-upsell__slider', { slidesPerView: 2, // Breakpoints breakpoints: { 768: { slidesPerView: 3, }, 1024: { slidesPerView: 4, }, 1200: { slidesPerView: 6, }, }, pagination: { el: '#pdp-upsell__slider--pagination', clickable: true, }, navigation: { nextEl: '#pdp-upsell__slider--next', prevEl: '#pdp-upsell__slider--prev', } }); }) .catch(e => { console.error(e); }); }; const productRecommendationsSection = document.querySelector('.product-recommendations'); const observer = new IntersectionObserver(handleIntersection, {rootMargin: '0px 0px 200px 0px'}); observer.observe(productRecommendationsSection); } catch(e) { console.error(e); } })(); })();