PageSourceSearch

https://www.hometalk.com/resources/combined/js/productspec-dropdown.2bf7b15fee0f775fff55.bundle.js

js hometalk.com collected 2026-09-24 08:53:50 UTC 3,230 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkrapid_js=self.webpackChunkrapid_js||[]).push([["productspec-dropdown"],{4832(e,t,n){n.d(t,{default:()=>a});var o=n(4467),r=n(371),s=n(5997),i=n(8934),d=n(5137);class a{static init(e){(0,d.Kg)(e)&&(e=e.split()),e.forEach(e=>{$(e).find(".js-vs-product-item").length&&$(e).find(".js-vs-product-item").each((e,t)=>{let n=$(t).data("clear_on_load")?1:0;new a($(t),n)})})}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,o.A)(this,"enableDropdowns",e=>{for(const t in this.dropDownElements)t!==e&&"product"!=t&&$(this.dropDownElements[t]).removeAttr("disabled"),"product"==t&&this.productDropdownActive&&$(this.dropDownElements[t]).removeAttr("disabled")}),this.dropDownElements={},["type","brand","year","product","url"].forEach(n=>{let o=e.find(`.js-${n}`);t&&o.val(""),o.length&&(o.on("change",()=>this.buildQuery(n)),this.dropDownElements[n]=o)}),this.searchUrl=s.A.THEME.default_category_page_url,e.on("submit",e=>this.submit(e))}submit(e){e.preventDefault();let t=$(e.currentTarget);(0,i.default)("Find - Click Element",{element_type:"Dropdown Search",search_type:t.find(".js-type").val(),search_brand:t.find(".js-brand").val(),search_year:t.find(".js-year").val(),search_model:t.find(".js-product").val()}),window.location=this.searchUrl}async buildQuery(e){let t="productspec/search?";this.productDropdownActive=!0;for(const o in this.dropDownElements){if("url"===o)continue;let n=this.dropDownElements[o].val();t+=n?o+"="+n+"&":"",o!==e&&"product"!=o&&$(this.dropDownElements[o]).attr("disabled",!0),"product"!=o&&(this.productDropdownActive=this.productDropdownActive&&!!n)}"&"===t.slice(-1)&&(t=t.slice(0,-1)),this.productDropdownActive||($(this.dropDownElements.product).attr("disabled",!0),this.dropDownElements.product.find("option").not(".default").remove());let n=await this.getDropDownOptions(t);this.populateDropDowns(n),this.enableDropdowns(e)}getDropDownOptions(e){return new r.Ay(e.toLowerCase()).get().then(e=>e)}populateDropDowns(e){for(const t in e){if("url"===t){this.searchUrl=e[t][0];continue}let n=this.dropDownElements[t].val();this.dropDownElements[t].find("option").not(".default").remove(),e[t].forEach(e=>{let o=document.createElement("option");"string"==typeof e?(o.value=e,o.innerHTML=e):"object"==typeof e&&(o.value=e.id,o.innerHTML=e.text),o.selected=n==o.value,this.dropDownElements[t].append(o)})}}}},5137(e,t,n){function o(e){if("SELECT"==e.nodeName&&e.selectedIndex<1)return!0;if("checkbox"==e.type&&!s.checked)return!0;if("radio"==e.type){var t,n;for(n=0,t=e.form.elements;e<nl.length;n++)if("radio"==t[n].type&&t[n].name==e.name&&t[n].checked)return!1;return!0}return new RegExp("^\\s*$").test(1==e.nodeType?e.value:e)}function r(e){return!isNaN(1==e.nodeType?e.value:e)&&!function(e){return""==(e=1==e.nodeType?e.value:e)||new RegExp("^-?[0-9]*\\.[0-9]*$").test(e)}(e)}function i(e){return/^\d{5}$/.test(e)}function d(e){return"string"==typeof e||e instanceof String}function a(e){return String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)}n.d(t,{Et:()=>r,Im:()=>o,Kg:()=>d,P$:()=>i,xf:()=>a})}}]);

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.