PageSourceSearch

https://www.chapmanspeedway.com/_nuxt/D-BAtXrA.js

js chapmanspeedway.com collected 2026-09-29 16:33:34 UTC 11,439 bytes, 1 lines download raw bytes

1import{x as Y,z as B,b$ as U,ai as J,a3 as w,a9 as D,k as h,as as X,am as Z,al as ee,j as te,a7 as re}from"./BJvA0EIL.js";import{u as se}from"./qn8f9jnI.js";import{b as K}from"./5_InDKFl.js";import{u as z}from"./D2l_f3Sr.js";const N=Y("filters",()=>{try{B()||(console.error("Pinia is not active!"),console.trace("Attempted to create store: filters"))}catch(n){console.error("getActivePinia failed: filters",n)}const s=U("appConfig","filters.ts",()=>J()),a=w("new"),c=w(s.filtersOptions.categoriesOrder??{type:["new","used","cpo"],year:[],make:[],model:[],trim:[],fuel:[],body:[],bodyManufacturer:[],drive:[],transmission:[],price:[0,0],colorInt:[],colorExt:[],engine:[],mileage:[0,0],location:[],availability:[]}),t=w({isHeavilyDiscounted:{label:"Value",isSelected:!1},isPopular:{label:"Hot",isSelected:!1},isRare:{label:"Rare",isSelected:!1},isClassic:{label:"Classic",isSelected:!1},isSelect:{label:"Select",isSelected:!1},isCustom:{label:"Customs",isSelected:!1},isInTransit:{label:"In-Transit",isSelected:!1},isComingSoon:{label:"Early Access",isSelected:!1},isFleet:{label:"Fleet",isSelected:!1},isPendingSold:{label:"Pending",isSelected:!1},isSold:{label:"Sold",isSelected:!1},isShelby:{label:"Shelby",isSelected:!1},isUsaHaulers:{label:"USA Haulers",isSelected:!1},isCourtesy:{label:"Courtesy Vehicle",isSelected:!1}}),f=D([]),v=D({}),E=n=>{v.value=n},g=w([0,1e6]),S=w([0,1e6]),m=w(""),L=w(12),b={label:"Price: low to high",by:"price",asc:!0},k=w({new:s.filtersOptions.defaultSortNew??b,used:s.filtersOptions.defaultSortUsed??b,cpo:s.filtersOptions.defaultSortCpo??b,all:s.filtersOptions.defaultSortAll??b}),V=w([{label:"Price: low to high",by:"price",asc:!0},{label:"Price: high to low",by:"price",asc:!1},{label:"Year: low to high",by:"year",asc:!0},{label:"Year: high to low",by:"year",asc:!1},{label:"Make: a to z",by:"make",asc:!0},{label:"Make: z to a",by:"make",asc:!1},{label:"Model: a to z",by:"model",asc:!0},{label:"Model: z to a",by:"model",asc:!1},{label:"Trim: a to z",by:"trim",asc:!0},{label:"Trim: z to a",by:"trim",asc:!1},{label:"Popularity",by:"carGurusDealRatingSort",asc:!0}]);s.hub.isValue&&V.value.push({label:"Distance: low to high",by:"distance",asc:!0});const F=h(()=>[...Object.keys(c.value),...Object.keys(t.value),"keywords","minPrice","maxPrice","minMileage","maxMileage"]),M=n=>Object.keys(t.value).includes(n),A=h(()=>f.value.filter(n=>n.category==="type").map(n=>n.option)),G=h(()=>f.value.reduce((n,I)=>(n[I.category]?n[I.category]?.push(I):n[I.category]=[I],n),{})),O=h(()=>Object.values(t.value).some(n=>n.isSelected));return{currentType:a,categories:c,tags:t,selections:f,pathFilterQuery:v,SET_PATH_FILTER_QUERY:E,price:g,mileage:S,keywords:m,showingCount:L,sort:k,sortOptions:V,getValidQueryNames:F,isTagKey:M,getSelectedTypes:A,groupedSelections:G,hasSelectedTags:O,SET_KEYWORDS:n=>{m.value=n},SET_PRICE_SELECTIONS:n=>{g.value=[...n]},SET_MILEAGE_SELECTIONS:n=>{S.value=[...n]},ADD_QUERIES_TO_FILTERS:n=>{const I=Object.keys(n.query);g.value=[c.value.price[0],c.value.price[1]],S.value=[c.value.mileage[0],c.value.mileage[1]];const _=[],T=F.value;I.forEach(r=>{let l=n.query[r];l&&T.includes(r)&&r!=="keywords"&&(r==="minPrice"?g.value[0]=parseInt(l.toString()):r==="maxPrice"?g.value[1]=parseInt(l.toString()):r==="minMileage"?S.value[0]=parseInt(l.toString()):r==="maxMileage"?S.value[1]=parseInt(l.toString()):M(r)||(Array.isArray(l)||(l=[l]),l.forEach(C=>{if(!C)return;const e=r==="year"?parseInt(C):se(C);_.push({category:r,option:e})})))}),m.value=n.query.keywords?n.query.keywords.toString():"",f.value=_,Object.keys(t.value).forEach(r=>{if(K(r,t.value)){const l=t.value[r];l&&(l.isSelected=!!n.query[r])}})},CLEAR_FILTERS:()=>{f.value=[],m.value="",g.value=[c.value.price[0],c.value.price[1]],S.value=[c.value.mileage[0],c.value.mileage[1]]},GET_FILTER_OPTIONS:n=>{const I=Object.keys(c.value),_=new Intl.Collator("en",{sensitivity:"base",ignorePunctuation:!0,numeric:!0});I.forEach(T=>{if(T!=="type"&&!(T==="bodyManufacturer"&&s.arkonas.site!=="ca5"))if(T==="price"){const p=n.reduce((r,l)=>{const C=l.pricing.displayTotalPriceValue.value;return C<r[0]&&(r[0]=C),C>r[1]&&(r[1]=C),r},[1e7,0]);p[0]<0&&(p[0]=0),p[0]=Math.floor(p[0]/5e3)*5e3,p[1]=Math.ceil(p[1]/5e3)*5e3,c.value.price=[...p],g.value=[...p]}else if(T==="mileage"){const p=n.reduce((r,l)=>(l.car.mileage<r[0]&&(r[0]=l.car.mileage),l.car.mileage>r[1]&&(r[1]=l.car.mileage),r),[1e7,0]);p[0]<0&&(p[0]=0),p[0]=Math.floor(p[0]/5e3)*5e3,p[1]=Math.ceil(p[1]/5e3)*5e3,c.value.mileage=[...p],S.value=[...p]}else if(T==="year"){const p=n.reduce((r,l)=>(r.includes(l.car[T])||r.push(l.car[T]),r),[]);p.sort(),c.value[T]=p}else{const p=n.reduce((r,l)=>{const C=l.car[T].trim();return C&&!r.includes(C)&&r.push(C),r},[]);p.sort((r,l)=>_.compare(r,l)),c.value[T]=p}})}}});function ae(s,a){return a==="new"?s.type==="N":a==="used"?s.type==="U":a==="cpo"?s.isCertified:!1}
1function oe(s,a){return typeof s!="string"?s===a:s.toUpperCase()===a.toString().toUpperCase()}function ne(s,a,c,t){const f=t??N(),{selections:v,groupedSelections:E}=f;if(!v.length)return!0;let g=!0;for(const[S,m]of Object.entries(E))m.some(b=>K(S,s)?!c&&S==="type"?ae(s,b.option):a&&S===a?!0:oe(s[S],b.option):!1)||(g=!1);return g}function ie(s,a){const c=a??N(),{hasSelectedTags:t,tags:f}=c;return t?Object.entries(f).some(([v,E])=>{const g=E.isSelected,S=K(v,s)&&s[v],m=E.label==="Sold"&&E.isSelected;return s.isSold&&!m?!1:g&&S}):!0}function le(s,a){const c=a??N(),{categories:t,price:f}=c;if(t.price[0]!==f[0]){const v=parseInt(f[0].toString(),10);if(s.pricing.displayTotalPriceValue.value<v)return!1}if(t.price[1]!==f[1]){const v=parseInt(f[1].toString(),10);if(s.pricing.displayTotalPriceValue.value>v)return!1}return!0}function ce(s,a){const c=a??N(),{categories:t,mileage:f}=c;if(t.mileage[0]!==f[0]){const v=parseInt(f[0].toString(),10);if(s.mileage<v)return!1}if(t.mileage[1]!==f[1]){const v=parseInt(f[1].toString(),10);if(s.mileage>v)return!1}return!0}function ue(s,a){const c=Object.keys(s);return a.every(f=>c.some(E=>{if(K(E,s)){let g=s[E];if(g!=null&&E!=="colorInt"&&(g=g.toString().toUpperCase(),g.includes(f.toUpperCase())))return!0}return!1}))}function pe(s,a){const c=a??N(),{keywords:t}=c;if(!t)return!0;const f=t.toString().trim().split(" ");return ue(s,f)}const ve=Y("inventory",()=>{try{B()||(console.error("Pinia is not active!"),console.trace("Attempted to create store: inventory"))}catch(e){console.error("getActivePinia failed: inventory",e)}const{$publicApi:s}=X(),a=U("appConfig","inventory.ts",()=>J()),c=U("dealersStore","inventory.ts",()=>Z()),t=U("filtersStore","inventory.ts",()=>N()),f=U("customerDataStore","inventory.ts",()=>ee()),v=w("initial"),E=w(!1),g=w(null),S=w(null),m=D([]),L=h(()=>{const e=new Map;for(const i of m.value)e.set(i.model.toLowerCase(),i.subModels??[]);return e}),b=D([]),k=D([]),V=h(()=>b.value.concat(...k.value));function F(e){return{siteArkona:a.arkonas.site,msrp:e.pricing.msrp,isVehicleNew:e.type==="N",pageType:"SRP",isMsrpRequired:e.isMsrpRequired,exclusiveDiscount:e.pricing.exclusiveDiscount,docFee:e.pricing.docFee,markupsTotal:e.pricing.markupsTotal,rebatesAppliedTotal:e.pricing.rebatesAppliedTotal,rebatesEveryoneTotal:e.pricing.rebatesEveryoneTotal,discountsTotal:e.pricing.discountsTotal,customerDataStore:f}}const M=h(()=>b.value.map(e=>({car:e,pricing:z(F(e))}))),A=h(()=>k.value.map(e=>({car:e,pricing:z(F(e))}))),G=h(()=>A.value.filter(e=>a.searchOptions.cpoFilterByMake?e.car.isCertified&&c.currentDealer.makes.includes(e.car.make):e.car.isCertified)),O=h(()=>M.value.concat(A.value)),j=h(()=>{if(t.getSelectedTypes.length===0)return O.value;let e=[];return t.getSelectedTypes.includes("new")&&(e=e.concat(M.value)),t.getSelectedTypes.includes("used")?e.concat(A.value):(t.getSelectedTypes.includes("cpo")&&(e=e.concat(G.value)),e)}),W=h(()=>j.value.filter(e=>ne(e.car,void 0,void 0,t)&&ie(e.car,t)&&le(e,t)&&ce(e.car,t)&&pe(e.car,t))),H=h(()=>[...W.value].sort((i,u)=>{let d,o,y;const{by:P,asc:Q}=t.sort[t.currentType],q=new Intl.Collator("en",{sensitivity:"base",ignorePunctuation:!0,numeric:!0});return P==="price"?(d=i.pricing.displayTotalPriceValue.value,d<=0&&Q&&(d=9999999),o=u.pricing.displayTotalPriceValue.value,o<=0&&Q&&(o=9999999)):P==="distance"?(d=c.valueDealerDistanceMap.get(i.car.valueArkona)??0,o=c.valueDealerDistanceMap.get(u.car.valueArkona)??0):P==="carGurusDealRatingSort"?(d=i.car[P]||0,o=u.car[P]||0):(d=i.car[P],o=u.car[P]),typeof d=="string"||typeof o=="string"?y=q.compare(d.toString(),o.toString()):(y=d-o,y===0&&(y=q.compare(i.car.vin,u.car.vin))),Q?y:y*-1})),$=h(()=>{const e=[],i=[],u=[],d=[];return H.value.forEach(o=>{const y=o.car.imageUrls[0]&&!o.car.imageUrls[0].includes("default");o.car.type==="N"?y?e.push(o):i.push(o):y?a.inventory.sortMakeToTop&&o.car.make===a.inventory.sortMakeToTop?u.push(o):e.push(o):a.inventory.sortMakeToTop&&o.car.make===a.inventory.sortMakeToTop?d.push(o):i.push(o)}),[...u,...d,...e,...i]}),R=h(()=>$.value.filter((e,i)=>i<t.showingCount));function x(e){if(e<4)return[];let i=2;const u=[i];for(;e+u.length-i>=12;){const d=12+i;u.push(d),i=d}return u}const n=h(()=>
1{if(!a.searchOptions.matchingCards.length)return R.value;const e=x(R.value.length);if(!e.length)return R.value;const i=[...R.value];let u=a.searchOptions.matchingCards.map((d,o)=>o);return e.forEach(d=>{const o=Math.floor(Math.random()*u.length);u[o]!==void 0&&i.splice(d,0,{cardIndex:u[o]}),u.splice(o,1),u.length||(u=a.searchOptions.matchingCards.map((y,P)=>P))}),i}),I=async()=>{try{await Promise.all([_({getFilterOptions:!1}),T({getFilterOptions:!1})]),t.GET_FILTER_OPTIONS(O.value),t.ADD_QUERIES_TO_FILTERS({query:t.pathFilterQuery})}catch(e){te(e),console.error(e)}};async function _({make:e,model:i,count:u,getFilterOptions:d=!0}={}){try{const o=a.arkonas.inventory||a.arkonas.site,y=await $fetch(`/api/inventory/${o}/new`,{query:{make:e,model:i,count:u}});Array.isArray(y)?b.value=y:b.value=[],d&&t.GET_FILTER_OPTIONS(O.value)}catch(o){console.error(o)}}async function T({make:e,model:i,count:u,getFilterOptions:d=!0}={}){try{const o=a.arkonas.inventory||a.arkonas.site,y=await $fetch(`/api/inventory/${o}/used`,{query:{make:e,model:i,count:u}});Array.isArray(y)?k.value=y:k.value=[],d&&t.GET_FILTER_OPTIONS(O.value)}catch(o){console.error(o)}}const p=async()=>{try{m.value=await s("/inventory/{arkona}/new/grouped-models",{path:{arkona:a.arkonas.inventory||a.arkonas.site}})}catch(e){console.error(e)}},r=e=>`${e.make}-${e.model}`,l=h(()=>{const e=new Map;for(const i of m.value)for(const u of M.value){const d=i.make===u.car.make&&i.model===u.car.model,o=i.subModels.includes(u.car.model);if(d||o){const y=r(i);e.set(y,(e.get(y)??0)+1)}}return e});return{status:v,showPricingModal:E,pricingModalCar:g,pricingModalVehiclePricing:S,uniqueNewCars:m,subModelsByModel:L,rawNewCars:b,rawUsedCars:k,rawAllCars:V,allCarsWithPricing:O,newCarsWithPricing:M,usedCarsWithPricing:A,cpoCarsWithPricing:G,getVehiclesByType:j,filteredCars:W,sortedCars:H,groupedAndOrderedCars:$,paginatedCars:R,carsWithCards:n,getAllInventory:I,getNewInventory:_,getUsedInventory:T,GET_UNIQUE_NEW_CARS:p,counts:l,GET_COUNT:e=>{const i=r(e);return l.value||re("inventoryStoreGetCount",{countsValueType:typeof l.value,countsValueIsUndefined:l.value===void 0,countsValueIsNull:l.value===null,uniqueNewCarsLength:m.value?.length??null,rawNewCarsLength:b.value?.length??null,makeModelKey:i}),l.value?.get(i)??0}}});
1export{ve as a,pe as b,ce as c,le as d,ne as e,ie as f,N as u};

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.