PageSourceSearch

https://www.applestatepowersports.com/DesktopModules/MVC/Dx1ShowroomAlgolia/dist/selectSearch.js?cdv=1273

js applestatepowersports.com collected 2026-09-30 17:59:53 UTC 24,160 bytes, 1 lines download raw bytes

1(()=>{"use strict";var e,t={311:(e,t,i)=>{i.r(t),i.d(t,{SelectSearch:()=>m});var r,a=i(4350);!function(e){e[e.Inactive=0]="Inactive",e[e.Deposit=1]="Deposit",e[e.FullPurchase=2]="FullPurchase"}(r||(r={}));var n=i(3099),s=i.n(n);class o{static formatNumber(e){return e%1==0?e.toLocaleString("en-US"):e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}static formatCurrency(e){return`$${this.formatNumber(e)}`}static formatPrice(e,t){return e?this.formatCurrency(e):t.priceDisplaySetting.hidePriceText}static getDefaultSlugOptions(){const e=$.extend({},s().defaults.modes.pretty);e.symbols=!1,e.lower=!1;const t=e.charmap;return["(",")","&","®","™"].forEach((e=>{t[e]=" "})),e}static convertToFriendlyName(e){if(!e)return"";const t=this.getDefaultSlugOptions();return s()(e.trim(),t).replace(/(\-)+/gi,"-").replace(/^[\-]+/,"").replace(/[\-]+$/,"")}static getShowroomUrl(e,t){const i=[this.convertToFriendlyName(e.ProductCategory),this.convertToFriendlyName(e.Manufacturer),this.convertToFriendlyName(e.ProductName),this.convertToFriendlyName(null!=e.Year&&null!=e.Year?e.Year.toString():""),this.convertToFriendlyName(e.City),this.convertToFriendlyName(e.StateProvinceCode),e.objectID].join("-"),r=(null==t?void 0:t.isShopYamahaTab)?"Y":"";return`${location.origin}/${i}${r}`}static setMarketingIncentiveData(e){var t;const i=e.MarketingIncentiveActives||[],a=i.length>0;e.IsShowMarketingIncentive=e.Price>0&&a&&e.WebsitePurchaseSettingId!==r.FullPurchase,e.HasMarketingIncentive=a,a&&e.WebsitePurchaseSettingId!==r.FullPurchase&&(e.MarketingIncentiveActives=i.map((e=>Object.assign(Object.assign({},e),{FormattedAmount:e.FormattedAmount||(e.Amount>0?`- ${this.formatCurrency(e.Amount)}`:`+ ${this.formatCurrency(Math.abs(e.Amount||0))}`)}))),e.PriceAfterDiscount=e.TotalPrice,e.FormattedPriceAfterDiscount=this.formatCurrency(e.PriceAfterDiscount),e.IsShowMarketingIncentive&&e.MarketingIncentiveActives.length>3&&(e.IsDisplayViewPriceSummary=!0),e.TotalPriceText=null!==(t=e.ReplaceAfterDiscountsText)&&void 0!==t?t:"Total Price")}static setDestinationChargeData(e){e.IsShowFreightDsp&&(e.FormattedFreightDsp=this.formatCurrency(e.FreightDsp))}static setWebsitePurchaseData(e){e.IsFullPurchaseUnitWithCharges=!1,e.WebsitePurchaseSettingId===r.Deposit?e.FormattedDepositAmount=this.formatCurrency(e.DepositAmount):e.WebsitePurchaseSettingId===r.FullPurchase&&(e.FormattedFreightDsp=this.formatCurrency(e.FreightDsp),e.FormattedSetupDsp=this.formatCurrency(e.SetupDsp),e.FormattedOtherDsp=this.formatCurrency(e.OtherDsp),e.FormattedTotalPartsInvoiceAmount=this.formatCurrency(e.TotalPartsInvoiceAmount),e.FormattedTotalServiceInvoiceAmount=this.formatCurrency(e.TotalServiceInvoiceAmount),e.TotalPriceWithCharges=e.TotalPrice,e.FormattedTotalPriceWithCharges=this.formatCurrency(e.TotalPriceWithCharges),e.IsFullPurchaseUnitWithCharges=e.TotalPrice!==e.Price,e.TotalPriceText="Total Price")}static transformWebSellableItemPricing(e,t,i){e.FormattedPrice=this.formatPrice(e.Price,i);const a="new"===e.Condition.toLowerCase()?e.Msrp:e.Dsp;if(e.FormattedOriginalPrice=this.formatPrice(a,i),e.IsShowPrice=e.HasPrice&&(!e.IsHidePrice&&!e.IsSendPriceOnRequest||e.WebsitePurchaseSettingId==r.FullPurchase)&&!e.HasDateSold,e.IsDisplaySalePrice=i.priceDisplaySetting.isDisplaySalePrice&&a>e.Price,e.IsHidePriceOrPriceIsZero=!e.HasPrice||e.IsHidePrice&&e.WebsitePurchaseSettingId!==r.FullPurchase,e.HidePriceText=i.priceDisplaySetting.hidePriceText?i.priceDisplaySetting.hidePriceText:"Get Price",e.SendPriceOnRequestText=i.priceDisplaySetting.sendPriceOnRequestText?i.priceDisplaySetting.sendPriceOnRequestText:"Get Price",e.IsActivateMonthlyPayment){const t=6!==e.CalculateMonthlyPaymentFrom||e.TotalPrice>0;if(e.MonthlyPaymentExpirationDate){const t=new Date(e.MonthlyPaymentExpirationDate),i=new Date,r=new Date(i.getFullYear(),i.getUTCMonth(),i.getUTCDate());e.IsDisplayMonthlyPayment=t>=r}else e.IsDisplayMonthlyPayment=t;e.IsDisplayMonthlyPayment=e.IsDisplayMonthlyPayment&&t,e.FormattedEstimatedMonthlyPayment=this.formatCurrency(e.EstimateMonthlyPayment),e.FormattedDownPayment=this.formatCurrency(e.DownPayment)}this.setMarketingIncentiveData(e),this.setDestinationChargeData(e),this.setWebsitePurchaseData(e)}static transformWebSellableItemShowroomUrl(e,t){e.ShowroomUrl=this.getShowroomUrl(e,t)}static transformWebSellableItemOdometerData(e){let t="";e.HasOdometer&&(t="HRs"===e.OdometerUomCode?"Hours":"Miles",e.Odometer&&(e.Odometer=this.formatNumber(e.Odometer))),e.OdometerUomName=t}
1static transformWebSellableItemPolarisXchangeData(e,t){if(e.IsPolarisXchangeOnline=!1,!t.dealershipPolarisXchangeList||!t.dealershipPolarisXchangeList.length)return;const i=t.dealershipPolarisXchangeList.filter((t=>t.dealershipId.toLowerCase()===e.DealershipId.toLowerCase())).pop();if(i&&e.IsPolarisXchangeActive){e.IsPolarisXchangeOnline=!0;i.polarisXchangeId}}static transformWebSellableItemPromotionsData(e,t){e.IsBrpIntegratedPromotionsEnabled=t.isBrpIntegratedPromotionsEnabled&&e.DealershipId.toLowerCase()===t.dealershipId.toLowerCase(),e.IsDisplayPromotionsLinks=t.isDisplayPromotionsLinks}static getPhotoUrl(e){return e?(e=e.replace(/^https:\/\/cdp\.azureedge\.net/,"https://cdpcdn.dx1app.com")).replace(/(.*)(\..*)$/,"$1_480px$2"):null}static transformWebSellableItemModelNameDisplayText(e){let t=[e.Manufacturer,e.ProductName];e.Year&&(t=[e.Year.toString()].concat(t)),e.ModelNameDisplayText=t.join(" ")}static isAlgoliaApiKeyExpired(e){return((new Date).getTime()-new Date(e).getTime())/6e4>=50}}class l{constructor(){this.hdCpoConditionCode="CPO",this.hdCpoConditionName="Certified Pre-Owned",this.polarisPageTagPrefix="landingpage_pl",this.brpPageTagPrefix="landingpage_im",this.isFirstLoad=!0}convertConditionMenuUiStateToRouteState(e){const t=e.menu&&e.menu.Condition;return t===this.hdCpoConditionName?this.hdCpoConditionCode:t}convertToRouteStateConditionMenuUiState(e){const t=e.condition;return t===this.hdCpoConditionCode?this.hdCpoConditionName:t}convertStateToRoute(e){const t=e[this.algoliaInfo.defaultIndexName]||{};if(!t)return{};const i=t&&t.view||this.view.currentView,r=this.moduleSetting.displaySetting.defaultView&&i===this.moduleSetting.displaySetting.defaultView.toLowerCase()?void 0:i,a=this.getSortingValueByIndexName(t.sortBy),n=t.page,s={condition:this.convertConditionMenuUiStateToRouteState(t),make:t.menu&&t.menu.Manufacturer,category:t.menu&&t.menu.ProductCategory,type:t.menu&&t.menu.ProductType,family:t.menu&&t.menu.ProductFamilyName,dealership:t.menu&&t.menu.DealershipName,q:t.query,StartYear:this.getYearRangeQueryString(t,!0),EndYear:this.getYearRangeQueryString(t,!1),PriceLow:this.getInputRangeQueryStringValue(t,"TotalPrice",!0),PriceHigh:this.getInputRangeQueryStringValue(t,"TotalPrice",!1),sort:a,page:n,view:r,modelname:t.menu&&t.menu.ProductName};return this.mapStateToRoute(s)}mapStateToRoute(e){if(!e)return{};return 0===Object.keys(e).map((t=>e[t])).filter((e=>!!e)).length?{}:(e.condition&&e.condition===this.hdCpoConditionName&&(e.condition=this.hdCpoConditionCode),e)}convertRouteToState(e){var t;const i=this.getSortingIndexNameByValue(e.sort),r={query:e.q||e.model||e.stockNumber,menu:{Condition:this.convertToRouteStateConditionMenuUiState(e),Manufacturer:e.make,ProductCategory:e.category,ProductType:e.type,ProductFamilyName:null===(t=this.getFilterByName(this.filter.families,e.family))||void 0===t?void 0:t.name,DealershipName:e.dealership,ProductName:e.modelname},range:{Year:this.getYearRangeState(e),TotalPrice:this.getPriceRangeState(e)},refinementList:{Year:this.getYearRefinementList(e)},sortBy:i,page:e.page,view:e.view};return this.hasSingleConditionSetting()&&(r.menu.Condition=this.moduleSetting.productSetting.conditions[0]),this.view.currentView=e.view,this.setDefaultView(),{[this.algoliaInfo.defaultIndexName]:r}}createFriendlyUrl(e,t){const i=this.convertSearchQueryStringToObject(t&&t.search),r=this.getFriendlyUrlWithQueryString(e,i),a=r[0];let n=r[1];n=n.concat(this.getQueryString(e));let s="";return n.length&&(s=n.map((e=>`${e.key}=${encodeURIComponent(e.value)}`)).join("&"),s=`?${s}`),`${this.algoliaInfo.url}${a}${s}`}parseFriendlyUrl(e){const t={},i=this.algoliaInfo.url.replace(e.origin,""),r=e.pathname.replace(i,"");if(r){r.split("/").filter((e=>!!e)).forEach((e=>{const i=this.getFilterWithKey(e);if(i&&2===i.length)if("year"===i[0])t.StartYear=i[1].name,t.EndYear=i[1].name;else{var r=i[0];t[r]=i[1].name}}))}if(e.search){e.search.replace("?","").split("&").forEach((e=>{const i=e.indexOf("="),r=i<0?e:e.substring(0,i),a=i<0?"":e.substring(i+1),n="family"===r.toLowerCase()?"family":r;("q"===n||"family"===n||n in t||["make","category","type","dealership","condition","StartYear","EndYear","PriceLow","PriceHigh","sort","page","view","model","stockNumber","modelname","smid"].includes(n))&&(t[n]=this.getQueryStringValue(n,a))}))}return this.isPolarisBrandPage()&&(t.condition="New"),t}isPolarisBrandPage(){var e;const t=this.moduleSetting.productSetting.conditions,i=!t||0===t.length,r=(null==t?void 0:t.includes("New"))&&(null==t?void 0:t.includes("Used"));return this.isFirstLoad&&(i||r)&&!0===(null===(e=this.algoliaInfo.pageTags)||void 0===e?void 0:e.some((e=>(null==e?void 0:e.toLowerCase().startsWith(this.polarisPageTagPrefix))||(null==e?void 0:e.toLowerCase().startsWith(this.brpPageTagPrefix)))))}setDefaultView(){this.view.currentView||(this.moduleSetting.displaySetting.defaultView&&"card"===this.moduleSetting.displaySetting.defaultView.toLowerCase()?this.view.currentView="card":this.view.currentView="list")}getSortingIndexNameByValue(e){const t=this.algoliaInfo.sortingIndexes.filter((t=>t.value===e));return t&&t.length?t[0].indexName:this.moduleSetting.productSetting.defaultSortOption&&e!==this.moduleSetting.productSetting.defaultSortOption?this.get
1SortingIndexNameByValue(this.moduleSetting.productSetting.defaultSortOption):this.algoliaInfo.sortingIndexes[0].indexName}getSortingValueByIndexName(e){const t=this.algoliaInfo.sortingIndexes.filter((t=>t.indexName===e));if(t&&t.length&&t[0].value!==this.moduleSetting.productSetting.defaultSortOption)return t.length?t[0].value:this.algoliaInfo.sortingIndexes[0].value}hasSingleConditionSetting(){return this.moduleSetting&&this.moduleSetting.productSetting&&this.moduleSetting.productSetting.conditions&&1===this.moduleSetting.productSetting.conditions.length}getYearRangeState(e){var t;if(!e.StartYear&&e.EndYear)return`:${null!==(t=e.EndYear)&&void 0!==t?t:""}`}getYearRefinementList(e){if(!e.StartYear&&!e.EndYear||!e.StartYear&&e.EndYear)return;const t=parseInt(e.StartYear),i=e.EndYear?parseInt(e.EndYear):(new Date).getFullYear()+5,r=[0];for(let e=t;e<=i;e++)r.push(e);return e.EndYear||r.push(9999),r.map((e=>e.toString()))}getPriceRangeState(e){var t,i;if(e.PriceLow||e.PriceHigh)return`${null!==(t=e.PriceLow)&&void 0!==t?t:""}:${null!==(i=e.PriceHigh)&&void 0!==i?i:""}`}getInputRangeQueryStringValue(e,t,i){if(e.range&&e.range[t]&&2===e.range[t].split(":").length){const r=e.range[t].split(":")[i?0:1];if(r)return r}}getQueryStringValue(e,t){var i;if("category"===e||"type"===e||"dealership"===e||"family"===e){let r=[];r="category"==e?this.filter.categories:"type"===e?this.filter.types:"family"===e?this.filter.families:this.filter.dealerships;const a=this.getFilterName(r,t);if(null!=a)return a;if("family"===e)return null===(i=this.getFilterByName(r,decodeURIComponent(t)))||void 0===i?void 0:i.name}return decodeURIComponent(t)}getFilterName(e,t){const i=e.filter((e=>e.friendlyName===t));return 1===i.length?i[0].name:null}getYearRangeQueryString(e,t){var i,r;if(e&&e.range&&e.range.Year)return this.getInputRangeQueryStringValue(e,"Year",t);const a=null===(i=null==e?void 0:e.refinementList)||void 0===i?void 0:i.Year;if(!a)return;const n=[...a];n.splice(0,1);const s=n[0],o=n[n.length-1];return t||"9999"!==o?null===(r=t?s:o)||void 0===r?void 0:r.toString():void 0}getFriendlyUrlWithQueryString(e,t){let i="";const r=[],a=[];if((e.condition||e.make||e.category||e.type||e.family)&&(this.setConditionToFriendlyUrlWithQueryStringData(e,r),this.setFriendlyUrlWithQueryStringData(e,"make",this.filter.manufacturers,r,a),this.setFriendlyUrlWithQueryStringData(e,"category",this.filter.categories,r,a),this.setFriendlyUrlWithQueryStringData(e,"type",this.filter.types,r,a),this.setFriendlyUrlWithQueryStringData(e,"fam
1ily",this.filter.families,r,a)),e.dealership){const t=this.getFilterByName(this.filter.dealerships,e.dealership);a.push({key:"dealership",value:t.friendlyName})}const n=e.StartYear,s=e.EndYear;if(n&&s&&n===s&&1===this.filter.years.filter((e=>e.name===n)).length&&r.push(n),e.smid||t&&t.smid){const i=e.smid?e.smid:t.smid;a.push({key:"smid",value:i})}if(e.modelname||t&&t.modelname&&this.isFirstLoad){const i=e.modelname?e.modelname:t.modelname;a.push({key:"modelname",value:i})}return r.length&&(i=`/${r.join("/")}`),this.isFirstLoad&&(this.isFirstLoad=!1),[i,a]}setConditionToFriendlyUrlWithQueryStringData(e,t){if(!e.condition)return;const i=Object.keys(e),r=["condition","sort","page","view"];i.filter((e=>-1===r.indexOf(e))).filter((t=>!!e[t])).length>0&&t.push(e.condition)}setFriendlyUrlWithQueryStringData(e,t,i,r,a){if(!e)return;const n=e[t];if(!n)return;const s=this.getFilterByName(i,n);s&&(s.isDuplicated?a.push({key:t,value:s.isDuplicatedInGroup?n:s.friendlyName}):r.push(s.friendlyName))}getFilterByName(e,t){return this.getFilter(e,"name",t)}getFilter(e,t,i){if(!i)return null;const r=e.filter((e=>e[t].toLowerCase()===i.toLowerCase())).pop();return r||null}getFilterWithKey(e){for(var t=[{key:"condition",friendlyNames:[{name:"New",friendlyName:"New",isDuplicated:!1,isDuplicatedInGroup:!1},{name:"Used",friendlyName:"Used",isDuplicated:!1,isDuplicatedInGroup:!1},{name:this.hdCpoConditionCode,friendlyName:this.hdCpoConditionCode,isDuplicated:!1,isDuplicatedInGroup:!1}],friendlyNameValue:e},{key:"make",friendlyNames:this.filter.manufacturers,friendlyNameValue:e},{key:"category",friendlyNames:this.filter.categories,friendlyNameValue:e},{key:"type",friendlyNames:this.filter.types,friendlyNameValue:e},{key:"family",friendlyNames:this.filter.families,friendlyNameValue:e},{key:"year",friendlyNames:this.filter.years,friendlyNameValue:e}],i=0;i<t.length;i++){const e=t[i],r=this.getFilterByFriendlyName(e.friendlyNames,e.friendlyNameValue);if(r&&!r.isDuplicated)return[e.key,r]}return null}getFilterByFriendlyName(e,t){return this.getFilter(e,"friendlyName",t)}getQueryString(e){const t=[],i=["q","PriceLow","PriceHigh","sort","page","view"],r=e.StartYear,a=e.EndYear;return r&&a&&r===a||i.splice(1,0,"StartYear","EndYear"),i.forEach((i=>{e[i]&&t.push({key:i,value:e[i]})})),t}getShowroomAlgoliaFriendlyNames(e){if(!e||!e.length)return[];return e.map((e=>({name:e,friendlyName:o.convertToFriendlyName(e),isDuplicated:!1,isDuplicatedInGroup:!1})))}setDuplicatedFriendlyName(e,t,i,r,a){const n=[];[...e,...t,...i,...r,...a].forEach((e=>{n.push(e.friendlyName)})),this.setFriendlyNameDuplicatedValue(e,n),this.setFriendlyNameDuplicatedValue(t,n),this.setFriendlyNameDuplicatedValue(i,n),this.setFriendlyNameDuplicatedValue(r,n),this.setFriendlyNameDuplicatedValue(a,n)}setFriendlyNameDuplicatedValue(e,t){e.forEach((i=>{i.isDuplicated=t.filter((e=>e===i.friendlyName)).length>1,i.isDuplicatedInGroup=e.filter((e=>e.friendlyName===i.friendlyName)).length>1}))}convertSearchQueryStringToObject(e){if(!e)return null;try{return e=e.substring(1),JSON.parse('{"'+decodeURI(e).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')}catch(e){return null}}initFilter(){var e,t,i,r,a,n,s,o,l,c,d,u;const h=this.getShowroomAlgoliaFriendlyNames(null===(t=null===(e=this.algoliaInfo)||void 0===e?void 0:e.filter)||void 0===t?void 0:t.manufacturers),m=this.getShowroomAlgoliaFriendlyNames(null===(r=null===(i=this.algoliaInfo)||void 0===i?void 0:i.filter)||void 0===r?void 0:r.categories),g=this.getShowroomAlgoliaFriendlyNames(null===(n=null===(a=this.algoliaInfo)||void 0===a?void 0:a.filter)||void 0===n?void 0:n.types),p=this.getShowroomAlgoliaFriendlyNames(null===(o=null===(s=this.algoliaInfo)||void 0===s?void 0:s.filter)||void 0===o?void 0:o.families),y=this.getShowroomAlgoliaFriendlyNames(null===(c=null===(l=this.algoliaInfo)||void 0===l?void 0:l.filter)||void 0===c?void 0:c.years),f=this.getShowroomAlgoliaFriendlyNames(null===(u=null===(d=this.algoliaInfo)||void 0===d?void 0:d.filter)||void 0===u?void 0:u.dealerships);this.setDuplicatedFriendlyName(h,m,g,p,f),this.filter={manufacturers:h,categories:m,types:g,families:p,years:y,dealerships:f}}init(e,t,i){this.view=e,this.algoliaInfo=t,this.moduleSetting=i,this.initFilter()}}var c=i(7945),d=i(2678),u=i(5375);class h{constructor(e,t={useCacheOnFirstView:!1}){this.algoliaInfo=e,this.cachingOptions=t,this.updateAlgoliaApiKeyPromise=null,this.isFirstRequest=!0,this.serviceFramework=$.ServicesFramework(this.algoliaInfo.moduleId)}updateAlgoliaApiKey(){if(this.updateAlgoliaApiKeyPromise)return this.updateAlgoliaApiKeyPromise;const e=this.serviceFramework.getServiceRoot("MVC/Dx1ShowroomAlgolia")+"Showroom/GetSearchApiKey";return this.updateAlgoliaApiKeyPromise=new Promise(((t,i)=>{$.ajax({type:"GET",url:e,beforeSend:this.serviceFramework.setModuleHeaders}).then((e=>{this.algoliaInfo.apiKey=e.ApiKey,this.algoliaInfo.apiInitDateTime=e.ApiInitDateTime,t()}),(e=>{console.error("Failed to update Algolia API key:",e),i(e)})).always((()=>{this.updateAlgoliaApiKeyPromise=null}))})),this.updateAlgoliaApiKeyPromise}
1overrideRequest(e){const t=Object.assign({},e.headers);return t["x-algolia-api-key"]=this.algoliaInfo.apiKey,Object.assign(Object.assign({},e),{headers:t})}getAlgoliaSearchOptions(){return{requester:{send:e=>o.isAlgoliaApiKeyExpired(this.algoliaInfo.apiInitDateTime)?this.updateAlgoliaApiKey().then((()=>this.createAndSendRequest(this.overrideRequest(e)))).catch((t=>(console.error("Error updating API key:",t),this.createAndSendRequest(e)))):this.createAndSendRequest(this.overrideRequest(e))},authMode:"WithinHeaders"}}shouldUseProxy(){return this.cachingOptions.useCacheOnFirstView&&this.algoliaInfo.cacheEnabled&&this.isFirstRequest&&(!this.cachingOptions.validatePageUrl||this.algoliaInfo.url===window.location.href)}extractRequestParameters(e){const t=JSON.parse(e.data).requests[0],{indexName:i,facets:r,highlightPreTag:a,highlightPostTag:n}=t;return{indexName:i,facets:r,highlightPreTag:a,highlightPostTag:n}}createServiceFrameworkHeaders(){let e={};const t=this.serviceFramework.getTabId();t>-1&&(e={TabId:t,ModuleId:this.serviceFramework.getModuleId()});const i=this.serviceFramework.getAntiForgeryValue();return i&&(e=Object.assign(Object.assign({},e),{RequestVerificationToken:i})),e}createProxyRequest(e){const t=this.createServiceFrameworkHeaders(),{indexName:i,facets:r,highlightPreTag:a,highlightPostTag:n}=this.extractRequestParameters(e),s=this.serviceFramework.getServiceRoot("MVC/Dx1ShowroomAlgolia")+"Showroom/GetAlgoliaData";return Object.assign(Object.assign({},e),{url:s,method:"POST",headers:Object.assign({"x-algolia-api-key":e.headers["x-algolia-api-key"]||this.algoliaInfo.apiKey,"Content-Type":"application/json"},t),data:JSON.stringify({indexName:i,nbHitsPerPage:this.cachingOptions.nbHitsPerPage,maxValuesPerFacets:this.cachingOptions.maxValuesPerFacets,facets:r,highlightPreTag:a,highlightPostTag:n})})}createAndSendRequest(e){let t=e,i=!1;return this.shouldUseProxy()?(this.isFirstRequest=!1,t=this.createProxyRequest(e),i=!0):this.isFirstRequest=!1,(0,u.D)().send(t).then((t=>this.handleResponse(t,e,i))).catch((e=>{throw console.error("Error during Algolia request:",e),e}))}handleResponse(e,t,i){return e.content.indexOf("validUntil")>-1&&400===e.status?this.updateAlgoliaApiKey().then((()=>(i&&(this.isFirstRequest=!0),this.createAndSendRequest(this.overrideRequest(t))))).catch((t=>(console.error("Failed to update API key after invalid key response:",t),e))):e}}class m{initSelector(){const e=`#showroom-select-search-${this.algoliaInfo.moduleId}`;this.selectors={container:e,condition:`${e} .showroom-menu-select--condition`,manufacturer:`${e} .showroom-menu-select--manufacturer`,year:`${e} .showroom-menu-select--year`,productname:`${e} .showroom-menu-select--productname`,btnSearch:`${e} .btn-search`}}initEventHandles(){$(this.selectors.btnSearch).on("click",(()=>this.onSearchClicked()))}onSearchClicked(){const e=this.getCurrentState();if(!e)return null;const t=e.hierarchicalFacetsRefinements;if(t){const e={condition:t.Condition&&t.Condition[0],make:t.Manufacturer&&t.Manufacturer[0],StartYear:t.Year&&t.Year[0],EndYear:t.Year&&t.Year[0],modelname:t.ProductName&&t.ProductName[0],smid:this.algoliaInfo.moduleId},i=this.urlHelper.mapStateToRoute(e),r=this.urlHelper.createFriendlyUrl(i,null);window.location.href=r}}addMenuSelectWidgets(){const e=[];$(this.selectors.condition).length&&e.push((0,d.A)({container:this.selectors.condition,attribute:"Condition",cssClasses:{select:"form-control"},templates:{defaultOption:"All Conditions"}})),$(this.selectors.year).length&&e.push((0,d.A)({container:this.selectors.year,attribute:"Year",cssClasses:{select:"form-control"},templates:{defaultOption:"All Years"},sortBy:["name:desc"],limit:99})),$(this.selectors.manufacturer).length&&e.push((0,d.A)({container:this.selectors.manufacturer,attribute:"Manufacturer",cssClasses:{select:"form-control"},templates:{defaultOption:"All Manufacturers"},limit:99})),$(this.selectors.productname).length&&e.push((0,d.A)({container:this.selectors.productname,attribute:"ProductName",cssClasses:{select:"form-control"},templates:{defaultOption:"All Models"},limit:99})),e.length&&this.instantSearch.addWidgets(e)}getCurrentState(){return this.instantSearch.helper.state}initWidgets(){this.addMenuSelectWidgets()}initInstantSearch(){const e=new h(this.algoliaInfo,{useCacheOnFirstView:!0,validatePageUrl:!1,nbHitsPerPage:0,maxValuesPerFacets:99}).getAlgoliaSearchOptions(),t={searchClient:(0,c.w)(this.algoliaInfo.appId,this.algoliaInfo.apiKey,e),indexName:this.algoliaInfo.defaultIndexName};this.instantSearch=(0,a.default)(t),this.initWidgets(),this.instantSearch.start(),this.initEventHandlers()}onRender(){this.renderAriaLabel()}initEventHandlers(){this.instantSearch.on("render",(()=>{this.onRender()}))}addAriaLabel(e,t){const i=$(e);i.length&&i.attr("aria-label")!==t&&i.attr("aria-label",t)}renderAriaLabel(){this.addAriaLabel(`${this.selectors.condition} select`,"Select Condition"),this.addAriaLabel(`${this.selectors.manufacturer} select`,"Select Manufacturer"),this.addAriaLabel(`${this.selectors.year} select`,"Select Year"),this.addAriaLabel(`${this.selectors.productname} select`,"Select Model")}init(e,t){this.algoliaInfo=e;const i=Object.assign(Object.assign({},e),{url:t.typeSetting.searchResultPage});this.moduleSetting=t,this.urlHelper=new l,this.urlHelper.init(null,i,this.moduleSetting),this.initSelector(),this.initEventHandles(),this.initInstantSearch()}}}},i={};function r(e){var a=i[e];if(void 0!==a)return a.exports;var n=i[e]={exports:{}};return t[e].call(n.exports,n,n.exports,r),n.exports}r.m=t,e=[],r.O=(t,i,a,n)=>{if(!i){var s=1/0;for(d=0;d<e.length;d++){for(var[i,a,n]=e[d],o=!0,l=0;l<i.length;l++)(!1&n||s>=n)&&Object.keys(r.O).every((e=>r.O[e](i[l])))?i.splice(l--,1):(o=!1,n<s&&(s=n));if(o){e.splice(d--,1);var c=a();void 0!==c&&(t=c)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[i,a,n]},r.n=e=>
1{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=843,(()=>{var e={843:0};r.O.j=t=>0===e[t];var t=(t,i)=>{var a,n,[s,o,l]=i,c=0;if(s.some((t=>0!==e[t]))){for(a in o)r.o(o,a)&&(r.m[a]=o[a]);if(l)var d=l(r)}for(t&&t(i);c<s.length;c++)n=s[c],r.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return r.O(d)},i=self.webpackChunkmy_webpack_project=self.webpackChunkmy_webpack_project||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var a=r.O(void 0,[96],(()=>r(311)));a=r.O(a),window.Dx1ShowroomAlgoliaSelectSearch=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.