/* Scoped to: clothing-template-brand-proof */
(function() {
  'use strict';
  var componentRoots = document.querySelectorAll('[data-component-slug="clothing-template-brand-proof"]');
  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="clothing-template-brand-proof"] ~ ' + 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 counters = document.querySelectorAll( "[data-node^='stat_'][data-node$='_num']" ); let counterStarted = false; function animateCounters() { if (counterStarted) return; counters.forEach((counter) => { const targetText = counter.innerText.trim(); const target = parseInt(targetText.replace("+", "")); const hasPlus = targetText.includes("+"); let current = 0; const increment = Math.ceil(target / 60); const updateCount = () => { current += increment; if (current >= target) { counter.innerText = target + (hasPlus ? "+" : ""); } else { counter.innerText = current; requestAnimationFrame(updateCount); } }; updateCount(); }); counterStarted = true; } const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { animateCounters(); } }); }, { threshold: 0.4 } ); observer.observe(document.querySelector("[data-component-type='Gallery']"));
  });
})();