/* Scoped to: politician-party-template-shaping-tabs */
(function() {
  'use strict';
  var componentRoots = document.querySelectorAll('[data-component-slug="politician-party-template-shaping-tabs"]');
  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="politician-party-template-shaping-tabs"] ~ ' + 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 tabs = document.querySelectorAll(".rt-tab"); const contents = document.querySelectorAll(".rt-content"); tabs.forEach(tab => { tab.addEventListener("click", () => { const id = tab.getAttribute("data-tab"); tabs.forEach(t => t.classList.remove("active")); contents.forEach(c => c.classList.remove("active")); tab.classList.add("active"); document.querySelector('.rt-content[data-content="' + id + '"]').classList.add("active"); }); }); })();
  });
})();