PageSourceSearch

https://eby.co/cdn/shop/t/2179/assets/components-predictive-search.js?v=164647679942341612091790631066

js eby.co collected 2026-10-09 17:40:27 UTC 1,103 bytes, 1 lines download raw bytes

1import{utils}from"@theme/global-utilities";export class PredictiveSearch extends HTMLElement{constructor(){super(),this.input=this.querySelector('input[type="search"]'),this.predictiveSearchResults=this.querySelector("[js-predictive-search]"),this.input.addEventListener("input",utils.debounce(e=>{this.onChange(e)},300).bind(this))}onChange(){const e=this.input.value.trim();e.length?this.getSearchResults(e):this.close()}getSearchResults(e){fetch(`${routes.predictive_search_url}?q=${e}&resources[type]=product,collection,article,page&resources[limit]=4&section_id=predictive-search`).then(e=>{if(!e.ok){var t=new Error(e.status);throw this.close(),t}return e.text()}).then(e=>{const t=(new DOMParser).parseFromString(e,"text/html").querySelector("#shopify-section-predictive-search").innerHTML;this.predictiveSearchResults.innerHTML=t,this.open()}).catch(e=>{throw this.close(),e})}open(){this.predictiveSearchResults.style.display="block"}close(){this.predictiveSearchResults.style.display="none"}}customElements.get("predictive-search")||customElements.define("predictive-search",PredictiveSearch);

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.