/* Scoped to: ss-photography-featured-carousel */
(function() {
  'use strict';
  var componentRoots = document.querySelectorAll('[data-component-slug="ss-photography-featured-carousel"]');
  componentRoots.forEach(function(componentRoot) {
    // Helper to query within component, with fallback to document for sibling elements
    var $ = function(sel) { 
      return componentRoot.querySelector(sel) || document.querySelector('[data-component-slug="ss-photography-featured-carousel"] ~ ' + sel) || document.querySelector(sel);
    };
    var $$ = function(sel) { 
      var results = componentRoot.querySelectorAll(sel);
      return results.length ? results : document.querySelectorAll(sel);
    };
    // Original component JS runs in this scope
    (function () { const initCarousel = () => { const carousel = document.getElementById("featuredCarousel"); if (!carousel) return; let autoScrollInterval; let isPaused = false; const scrollAmount = carousel.offsetWidth * 0.85; const startAutoScroll = () => { autoScrollInterval = setInterval(() => { if (!isPaused) { const maxScrollLeft = carousel.scrollWidth - carousel.clientWidth; if (carousel.scrollLeft >= maxScrollLeft - 10) { carousel.scrollTo({ left: 0, behavior: "smooth" }); } else { const currentScroll = carousel.scrollLeft; const oneSlideWidth = carousel.children[0].offsetWidth + 40; carousel.scrollBy({ left: oneSlideWidth, behavior: "smooth" }); } } }, 4000); }; carousel.addEventListener("mouseenter", () => { isPaused = true; }); carousel.addEventListener("mouseleave", () => { isPaused = false; }); carousel.addEventListener("touchstart", () => { isPaused = true; }); carousel.addEventListener("touchend", () => { setTimeout(() => { isPaused = false; }, 2000); }); startAutoScroll(); }; if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", initCarousel); } else { initCarousel(); } })();
  });
})();