1function debounce(fn,wait=300){let t;return(...args)=>{clearTimeout(t);t=setTimeout(()=>fn.apply(this,args),wait)}} 2if(!customElements.get('sticky-scroll-direction')){class StickyScrollDirection extends HTMLElement{connectedCallback(){this.init()} 3init(){const headerIsSticky=document.querySelector('store-header[data-is-sticky="true"]');this.headerHeight=Number.parseInt(getComputedStyle(this.parentElement).getPropertyValue('--header-height').replace('px',''),10);this.container=this.firstElementChild;this.currentTop=Number.parseInt(document.documentElement.scrollTop+this.getBoundingClientRect().top-this.offsetTop,10);this.defaultTop=headerIsSticky?parseInt(this.headerHeight+30,10):48;this.scrollY=window.scrollY;this.minStickySize=this.dataset.minStickySize;this.toggleListeners();window.addEventListener('on:breakpoint-change',this.toggleListeners.bind(this))} 4toggleListeners(){if((this.minStickySize==='lg'&&theme.mediaMatches.lg)||(this.minStickySize==='md'&&theme.mediaMatches.md)){this.addListeners()}else{this.removeListeners()}} 5addListeners(){this.scrollListener=this.scrollListener||this.handleScroll.bind(this);window.addEventListener('scroll',this.scrollListener);this.scrollListener();if(this.parentElement.dataset.stickyHeightElems){this.debouncedSetStickyHeights=this.debouncedSetStickyHeights||debounce(this.setStickyHeight.bind(this),500);window.addEventListener('resize',this.debouncedSetStickyHeights);if('MutationObserver' in window){this.stickyHeightElems=this.parentElement.dataset.stickyHeightElems;this.observer=new MutationObserver(this.debouncedSetStickyHeights);document.querySelectorAll(this.stickyHeightElems).forEach((elem)=>{this.observer.observe(elem,{childList:!0,attributes:!0,subtree:!0})})} 6this.setStickyHeight()} 7this.disclosures=this.querySelectorAll('details');if(this.disclosures){this.disclosureChangeHandler=this.disclosureChangeHandler||this.handleDisclosureChange.bind(this);this.disclosures.forEach((disclosure)=>{disclosure.addEventListener('transitionend',this.disclosureChangeHandler)})}} 8handleDisclosureChange(evt){if(evt.target.classList.contains('disclosure__panel')){const summaryElem=evt.target.closest('.disclosure').querySelector('summary');if(!theme.elementUtil.isInViewport(summaryElem)){window.scrollTo({behavior:'smooth',top:summaryElem.getBoundingClientRect().top-document.body.getBoundingClientRect().top-this.headerHeight-20})}}} 9removeListeners(){this.container.style.top='';window.removeEventListener('scroll',this.scrollListener);if(this.observer){this.observer.disconnect();window.removeEventListener('resize',this.debouncedSetStickyHeights)} 10if(this.disclosures){this.disclosures.forEach((disclosure)=>{disclosure.removeEventListener('transitionend',this.disclosureChangeHandler)})}} 11setStickyHeight(){let totalHeight=0;document.querySelectorAll(this.stickyHeightElems).forEach((elem)=>{totalHeight+=elem.getBoundingClientRect().height});this.parentElement.style.setProperty('--sticky-height',`${parseInt(totalHeight, 10)}px`)} 12handleScroll(){const bounds=this.container.getBoundingClientRect();const maxTop=bounds.top+window.scrollY-this.container.offsetTop+this.defaultTop;const minTop=this.container.clientHeight-window.innerHeight;if(window.scrollY<this.scrollY){this.currentTop-=window.scrollY-this.scrollY}else{this.currentTop+=this.scrollY-window.scrollY} 13this.currentTop=Math.min(Math.max(this.currentTop,-minTop),maxTop,this.defaultTop);this.scrollY=window.scrollY;this.container.style.top=`${this.currentTop}px`}} 14customElements.define('sticky-scroll-direction',StickyScrollDirection)}
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.