1export function initToggles() { 2 const toggles = document.querySelectorAll('.js-toggle'); 3 4 toggles.forEach((toggle) => { 5 const btns = toggle.querySelectorAll('.js-toggle__btn'); 6 7 btns.forEach((btn) => { 8 btn.addEventListener('click', () => { 9 btns.forEach((b) => b.classList.remove('is-active')); 10 btn.classList.add('is-active'); 11 12 toggle.dispatchEvent(new CustomEvent(`toggle:${toggle.id}:change`, { 13 bubbles: true, 14 detail: { 15 toggle: toggle, 16 button: btn, 17 value: btn.dataset.value ?? null, 18 }, 19 })); 20 }); 21 }); 22 }); 23}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.