'use strict';document.addEventListener('DOMContentLoaded',()=>{if(document.body.clientWidth>=1024){return;}
const create_name=(text)=>text.toLowerCase().replace(/^\s+|\s+$|[^a-z0-9&\s-]/g,'').replace(/&/g,'and').replace(/\s/g,'-').replace(/(-)+\1/g,'$1');const h2=document.querySelectorAll('#sidebar div div h2');for(const element of h2){element.classList.add('toggle');element.parentNode.classList.add('hide');const name=create_name(element.textContent);element.nextElementSibling.setAttribute('name',name);element.innerHTML=`<a href="#${name}" title="Reveal ${element.textContent} content">${element.innerHTML}</a>`;element.addEventListener('click',(e)=>{e.preventDefault();element.parentNode.classList.toggle('hide');});}
const h2_link=document.querySelectorAll('h2.toggle a');for(const element of h2_link){element.addEventListener('mouseup',()=>{const event=new Event('blur',{bubbles:true,cancelable:false});element.dispatchEvent(event);});}});