1(function(){'use strict';function initHeaderScrollReveal(){const header=document.querySelector('header.wp-block-template-part');if(!header){return;} 2const settings=window.codedicationHeader||{};const isSticky=settings.sticky!==false;const isScrollReveal=settings.scrollReveal!==false;const isShrink=settings.shrinkOnScroll===true;if(!isSticky){header.classList.add('no-sticky');return;} 3let lastScroll=0;let ticking=false;const scrollThreshold=100;function handleScroll(){const currentScroll=window.scrollY;if(currentScroll>10){header.classList.add('is-scrolled');}else{header.classList.remove('is-scrolled');} 4if(isShrink){if(currentScroll>50){header.classList.add('is-shrunk');}else{header.classList.remove('is-shrunk');}} 5if(isScrollReveal&¤tScroll>scrollThreshold){if(currentScroll>lastScroll){header.classList.add('is-hidden');}else{header.classList.remove('is-hidden');}}else if(isScrollReveal){header.classList.remove('is-hidden');} 6lastScroll=currentScroll<=0?0:currentScroll;ticking=false;} 7window.addEventListener('scroll',function(){if(!ticking){requestAnimationFrame(handleScroll);ticking=true;}},{passive:true});} 8function initSpotlightCards(){const cards=document.querySelectorAll('.is-style-spotlight');cards.forEach(card=>{let ticking=false;card.addEventListener('mousemove',function(e){if(!ticking){requestAnimationFrame(()=>{const rect=card.getBoundingClientRect();const x=((e.clientX-rect.left)/rect.width)*100;const y=((e.clientY-rect.top)/rect.height)*100;card.style.setProperty('--spotlight-x',x+'%');card.style.setProperty('--spotlight-y',y+'%');ticking=false;});ticking=true;}},{passive:true});card.addEventListener('focus',function(){card.style.setProperty('--spotlight-x','50%');card.style.setProperty('--spotlight-y','50%');});});} 9function initMobileMenu(){const focusableSelectors='a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';const navContainers=document.querySelectorAll('.wp-block-navigation__responsive-container');navContainers.forEach(container=>{const openButton=container.previousElementSibling;let trapHandler=null;const menuObserver=new MutationObserver(function(mutations){mutations.forEach(function(mutation){if(mutation.attributeName!=='class')return;if(container.classList.contains('is-menu-open')){container.querySelectorAll('.wp-block-navigation-item').forEach((item,index)=>{item.style.setProperty('--animation-delay',`${index * 0.05}s`);});trapHandler=function(e){if(e.key!=='Tab')return;const focusable=container.querySelectorAll(focusableSelectors);const first=focusable[0];const last=focusable[focusable.length-1];if(e.shiftKey&&document.activeElement===first){e.preventDefault();last.focus();}else if(!e.shiftKey&&document.activeElement===last){e.preventDefault();first.focus();}};document.addEventListener('keydown',trapHandler);const closeBtn=container.querySelector('.wp-block-navigation__responsive-container-close');if(closeBtn){setTimeout(()=>closeBtn.focus(),100);}}else{if(trapHandler){document.removeEventListener('keydown',trapHandler);trapHandler=null;} 10if(openButton&&document.activeElement&&container.contains(document.activeElement)){openButton.focus();}}});});menuObserver.observe(container,{attributes:true});});document.addEventListener('keydown',function(e){if(e.key==='Escape'){const openMenu=document.querySelector('.wp-block-navigation__responsive-container.is-menu-open');if(openMenu){const closeButton=openMenu.querySelector('.wp-block-navigation__responsive-container-close');if(closeButton){closeButton.click();}}}});} 11function initTableOfContents(){const toc=document.querySelector('.codedication-toc');if(!toc)return;const content=document.querySelector('.wp-block-post-content');if(!content)return;const headings=content.querySelectorAll('h2, h3');if(!headings.length){toc.hidden=true;return;} 12const slugify=(text)=>text.toLowerCase().trim().replace(/[^\p{L}\p{N}\s-]/gu,'').replace(/\s+/g,'-').replace(/-+/g,'-').replace(/^-|-$/g,'')||'section';const usedIds=new Set();const root=document.createElement('ol');const orderedIds=[];const links=new Map();let currentSubList=null;
12headings.forEach((heading)=>{let id=heading.id;if(!id){const base=slugify(heading.textContent||'');id=base;let i=2;while(usedIds.has(id)||document.getElementById(id)){id=`${base}-${i++}`;} 13heading.id=id;} 14usedIds.add(id);orderedIds.push(id);const li=document.createElement('li');const link=document.createElement('a');link.href=`#${id}`;link.textContent=heading.textContent||'';li.appendChild(link);links.set(id,link);if(heading.tagName==='H2'){root.appendChild(li);currentSubList=null;}else{const parent=root.lastElementChild;if(parent){if(!currentSubList){currentSubList=document.createElement('ol');parent.appendChild(currentSubList);} 15currentSubList.appendChild(li);}else{root.appendChild(li);}}});const nav=document.createElement('nav');nav.className='codedication-toc__nav';nav.setAttribute('aria-label','Table of contents');nav.appendChild(root);const placeholder=toc.querySelector('.codedication-toc__empty');if(placeholder){placeholder.replaceWith(nav);}else{toc.appendChild(nav);} 16const tocHeading=toc.querySelector('h1, h2, h3, h4, h5, h6');const isNarrow=window.matchMedia('(max-width: 781px)');let details=null;const collapseToc=()=>{if(details||!tocHeading)return;details=document.createElement('details');details.className='codedication-toc__details';const summary=document.createElement('summary');summary.className='codedication-toc__summary';tocHeading.replaceWith(details);summary.appendChild(tocHeading);details.append(summary,nav);};const expandToc=()=>{if(!details)return;details.replaceWith(tocHeading,nav);details=null;};const syncTocLayout=()=>(isNarrow.matches?collapseToc():expandToc());syncTocLayout();isNarrow.addEventListener('change',syncTocLayout);if('IntersectionObserver'in window){const visible=new Set();const observer=new IntersectionObserver((entries)=>{entries.forEach((entry)=>{if(entry.isIntersecting){visible.add(entry.target.id);}else{visible.delete(entry.target.id);}});let activeId=null;for(const id of orderedIds){if(visible.has(id)){activeId=id;break;}} 17links.forEach((link,id)=>{link.classList.toggle('is-active',id===activeId);});},{rootMargin:'-80px 0px -70% 0px',threshold:0});
17headings.forEach((h)=>observer.observe(h));}} 18function init(){initHeaderScrollReveal();initSpotlightCards();initMobileMenu();initTableOfContents();} 19init();})();
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.