/* Scoped to: real-estate-template-we_love */
(function() {
  'use strict';
  var componentRoots = document.querySelectorAll('[data-component-slug="real-estate-template-we_love"]');
  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="real-estate-template-we_love"] ~ ' + 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
    const track = document.getElementById("testimonialTrack"); const slides = document.querySelectorAll(".testimonial-slide"); const nextBtn = document.getElementById("nextBtn"); const prevBtn = document.getElementById("prevBtn"); let index = 0; function updateSlider() { track.style.transform = `translateX(-${index * 100}%)`; } nextBtn.addEventListener("click", () => { index = (index + 1) % slides.length; updateSlider(); }); prevBtn.addEventListener("click", () => { index = (index - 1 + slides.length) % slides.length; updateSlider(); });
  });
})();