PageSourceSearch

https://www.softprowatersystems.com/cdn/shop/t/71/assets/search-form.js?v=134891882275301843081766648295

js softprowatersystems.com collected 2026-09-25 23:39:33 UTC 2,658 bytes, 9 lines download raw bytes

1class SearchForm extends HTMLElement{constructor(){super(),this.input=this.querySelector('input[type="search"]'),this.resetButton=this.querySelector('button[type="reset"]'),this.input&&(this.input.form.addEventListener("reset",this.onFormReset.bind(this)),this.input.addEventListener("input",debounce(event=>{this.onChange(event)},300).bind(this)))}toggleResetButton(){}onChange(){this.toggleResetButton()}shouldResetForm(){return!document.querySelector('[aria-selected="true"] a')}onFormReset(event){event.preventDefault(),this.shouldResetForm()&&(this.input.value="",this.input.focus(),this.toggleResetButton())}}customElements.define("search-form",SearchForm);class HeaderPredictiveSearch extends HTMLElement{constructor(){super(),this.input=this.querySelector('input[type="search"]'),this.results=this.querySelector("[data-predictive-search]"),this.loading=this.querySelector(".predictive-search__loading-state"),this.status=this.querySelector(".predictive-search-status"),this.input&&this.input.addEventListener("input",this.debounce(event=>{this.onChange(event)},300))}onChange(event){const query=event.target.value.trim();if(!query){this.close();return}this.fetchResults(query)}fetchResults(query){this.open(),this.loading.style.display="block",fetch(`/search/suggest.json?q=${encodeURIComponent(query)}&resources[type]=product,collection,page&resources[limit]=6&section_id=predictive-search`).then(response=>response.json()).then(data=>{this.renderResults(data.resources.results)}).catch(()=>{this.close()}).finally(()=>{this.loading.style.display="none"})}renderResults(results){const{products,collections,pages}=results;let html='<ul class="predictive-search__results-list">';[...products,...collections,...pages].forEach(item=>{html+=`
2        <li class="predictive-search__list-item">
3          <a href="${item.url}" class="predictive-search__item">
4            ${item.image?`<img src="${item.image}" alt="${item.title}" width="40" height="40">`:""}
5            <span class="predictive-search__item-heading">${item.title}</span>
6          </a>
7        </li>
8      `}),html+="</ul>",this.results.innerHTML=html,this.status.textContent=`${products.length} results available`}open(){this.results.classList.add("is-active"),this.results.removeAttribute("tabindex")}close(){this.results.classList.remove("is-active"),this.results.setAttribute("tabindex","-1"),this.results.innerHTML=""}debounce(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}}customElements.define("predictive-search",HeaderPredictiveSearch);
9//# sourceMappingURL=/cdn/shop/t/71/assets/search-form.js.map?v=134891882275301843081766648295

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.