/* Scoped to: history-template-watch-egypt */
(function() {
  'use strict';
  var componentRoots = document.querySelectorAll('[data-component-slug="history-template-watch-egypt"]');
  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="history-template-watch-egypt"] ~ ' + 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 items = document.querySelectorAll(".watch-item"); const image = document.getElementById("watchMainImage"); items.forEach((item) => { item.addEventListener("click", () => { items.forEach((i) => i.classList.remove("active")); item.classList.add("active"); const node = item.getAttribute("data-img"); const source = document.querySelector(`[data-node="${node}"]`); if (!source) return; image.style.opacity = 0; setTimeout(() => { image.src = source.src; image.style.opacity = 1; }, 150); }); }); })();
  });
})();