1var w=Object.defineProperty,T=Object.defineProperties;var p=Object.getOwnPropertyDescriptors;var j=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var M=(e,n,s)=>n in e?w(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s,f=(e,n)=>{for(var s in n||(n={}))I.call(n,s)&&M(e,s,n[s]);if(j)for(var s of j(n))F.call(n,s)&&M(e,s,n[s]);return e},y=(e,n)=>T(e,p(n));var x=(e,n,s)=>new Promise((t,r)=>{var i=d=>{try{u(s.next(d))}catch(h){r(h)}},g=d=>{try{u(s.throw(d))}catch(h){r(h)}},u=d=>d.done?t(d.value):Promise.resolve(d.value).then(i,g);u((s=s.apply(e,n)).next())});import{r as c,j as a}from"./vendor-CdyVhcFp.js";import{I as R,n as O,ak as v,x as P,q as D,bd as L,ae as H}from"./main-g-ZnRNk3.js";import{C as E}from"./CurrentNewCarSpecialSearchService-D7HSQxeP.js";import{amx as k,amy as B,amz as $,amA as U,amB as A,amC as q,amD as Q,amE as G,amF as V,amG as z,amH as _,amI as W,amJ as Y,amK as J,amL as K,amM as X,amN as Z,amO as ee,amP as ae,amQ as te,amR as se,amS as ne}from"./cssModules-BUIZcazZ.js";import{D as re,S as le}from"./SearchPageView-C2Znen7N.js";import{M as ie,F as C,P as oe}from"./PaginationBarOld-CexDX5LM.js";import{D as ce}from"./Dropdown-Bm7iXpxF.js";import{S as de}from"./SpinnerButton-CBnOpzHt.js";import{D as me,C as ue}from"./CollapsedContainerHeaderStyling-uC1okbbk.js";import{F as he}from"./FixedFooter-YB9lhFma.js";import{S as ge}from"./arrow-right-mPA528qE.js";import"./Breadcrumbs-VvBRRzJx.js";import"./Checkbox-DYPV_04C.js";import"./Spinner-iGCsqlB0.js";import"./Button-NOZXTRtp.js";import"./FiltersAffectingResults-DzG3TRvO.js";import"./HighlightMessageStacked-DG1b1_5b.js";import"./ResultCountHeaderBar-w_ooDpX9.js";import"./SortDropdown-CAjUPIjL.js";function Se(e){const[n,s]=c.useState(!1),t=c.useRef(null),[r,i]=c.useState(!1);c.useEffect(()=>{const o=t.current;if(o){const S=o.offsetHeight;s(S>20)}},[]),c.useEffect(()=>{e.updateSelectedLocation()},[r]);const g=o=>x(null,null,function*(){o.preventDefault(),yield window.autotrader.nearMeStore.displayAndDetermineIfLocationWasSelected().then(S=>{r==!1&&i(S)})});return a.jsx(a.Fragment,{children:a.jsx("div",{className:k,children:a.jsx("a",{href:e.newCarSpecialUrl,onClick:()=>E.setLastResultIndexView(e.index),children:u()})})});function u(){return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:B,children:a.jsx("span",{className:$,children:a.jsx(R,{src:e.imageUrl,size:{width:"100%"},imageLoadType:"lazy"}
1,`${e.id}-main-image`)})}),a.jsxs("div",{className:U,children:[a.jsx("div",{className:A,children:h()}),a.jsxs("div",{className:q,children:[a.jsx("div",{className:`${Q} ${G}`,children:"New Car Special"}),a.jsx("div",{className:V,children:e.daysLeft==1?"1 Day left":e.daysLeft+" Days left"})]}),a.jsxs("span",{className:z,children:[e.registrationYear?`${e.registrationYear} `:"",e.makeModelLongVariant]}),a.jsx("span",{className:_,children:e.bodyFuelTransmissionSummary}),a.jsxs("span",{className:W,children:[a.jsx("span",{className:Y,ref:t,children:e.description}),n&&a.jsx("span",{className:J})]}),a.jsx(re,{dealerNameHTML:d(e.dealerName),dealerName:e.dealerName,dealerSuburbName:e.dealerSuburbName,dealerCityName:e.dealerCityName,userHasGeoLocation:e.userHasGeolocation,distanceFromUser:e.distanceFromUser,handleNearMeClicked:g,listingId:e.id,imageLoadType:"lazy",dealerLogoImageUrl:e.dealerLogoImageUrl,showDealerLogo:!0,className:K,rating:e.dealerRating})]})]})}function d(o){return a.jsx("span",{children:o})}function h(){return a.jsxs(a.Fragment,{children:["from ",e.price]})}}function fe(e){const n=[];return s(n),a.jsx(a.Fragment,{children:n});function s(t){if(e.hasResults){if(!O(e.cssClassNames)){const r=e.cssClassNames.map(i=>`.${i} { position: absolute; left: -${5e3+Math.random()*Number.MAX_SAFE_INTEGER%5e3}px }`).join(" ");t.unshift(a.jsx("style",{type:"text/css",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:r}},"cssrules"))}e.results.forEach(r=>{const i=r;t.push(a.jsx(Se,y(f({},i),{updateSelectedLocation:e.updateSelectedLocation}),`newCarSpecial-${i.id}`))})}}}function xe(e){function n(t){const r=v.selectedItem(e.items,parseInt(t.target.value));e.onSelectionChange(r)}function s(){return e.defaultOption?e.defaultOption:e.dropdownName}return a.jsxs(me,{transparencyOption:e.transparencyOption,small:e.small,hideShadow:e.hideShadow,bottomMargin:e.bottomMargin,children:[a.jsx(ue,{transparencyOption:e.transparencyOption,collapsedTextIsNullText:!e.selectedItem,collapsedText:v.selectedItemName(e.items,e.selectedItem,e.dropdownName)}),a.jsxs("select",{onChange:t=>n(t),value:e.selectedItem?e.selectedItem.toString():"",children:[e.removeDefault!=!0&&a.jsx("option",{className:"e-default",value:"",children:s()}),e.items.map(t=>a.jsxs("option",{value:t.value.toString(),children:[t.isChild?"- ":"",`${t.text} (${t.count})`]},t.value.toString()))]})]})}const ye=e=>{const[n,s]=c.useState(!1),[t,r]=c.useState(e.query),[i,g]=c.useState(e.controls),[u,d]=c.useState(e.totalCount),h=()=>{try{s(!0),e.search(t)}finally{s(!1),e.close()}},o=l=>x(null,null,function*(){const m=f(f({},t),l);yield N(m)}),S=()=>x(null,null,function*(){const l={sortOrder:t.sortOrder,pageNumber:1,keywords:[],searchFilterCount:0};yield N(l)}),N=l=>x(null,null,function*(){const m=yield e.searchClient.newCarSpecialUpdate(l);r(m.state.query),g(m.state.controls),d(m.state.searchPager.totalCount)});c.useEffect(()=>{e.isExpanded&&document.body.classList.add("m-modal-open")},[]),c.useEffect(()=>{e.isExpanded&&document.body.classList.add("m-modal-open")},[t]);const b=()=>a.jsx(he,{children:a.jsx(de,{onClick:h,loading:n,colour:"red",small:!1,customCssClass:"m-fixed-bottom-full-width",name:`Search ${H.numberWithSeparator(u)} New Car Specials`,type:"button"})});return e.isExpanded?a.jsx(P,{headerText:"Refine New Car Specials search",colour:"white",footer:b(),onClosed:()=>e.close(),children:a.jsx("div",{className:X,children:a.jsx("div",{className:Z,children:a.jsxs("div",{className:ee,children:[a.jsx("div",{className:"e-home-search-body",children:a.jsx(ie,{makeModels:t.makeModels,searchMakeModelsAutocomplete:(l,m)=>e.searchClient.searchMakeModelsAutocomplete(t,l,m),onMakeModelChanged:l=>o({makeModels:l}),small:!1,vehicleCategory:D.Cars,borderStyling:"bottom-only",searchStyling:"default"},1)}),a.jsxs("div",{className:"b-responsive-container",children:[a.jsx("h5",{className:ae,children:"Filters"}),a.jsx(ce,{dropdownName:"Min Price",defaultOption:"Min Price",items:i.minPrices,selectedItem:t.minPrice,onSelectionChange:l=>e.controlSelectionHelper.onPriceSelected(l,i.maxPrices,void 0,L.Min,m=>o(m)),small:!0,hideShadow:!0,bottomMargin:"normal"}),a.jsx(C,{nullText:"Fuel Type",items:i.fuelTypes,selectedItems:t.fuelTypes,onSelectionChange:l=>o({fuelTypes:l}),small:!0,hideShadow:!0,bottomMargin:"normal"}),a.jsx(C,{nullText:"Body Type",items:i.bodyTypes,selectedItems:t.bodyTypes,onSelectionChange:l=>o({bodyTypes:l}),small:!0,hideShadow:!0,bottomMargin:"normal"}),a.jsx(xe,{dropdownName:"Manual / Automatic",items:i.transmissionTypes,selectedItem:t.transmission,onSelectionChange:l=>e.controlSelectionHelper.singleSelectItemSelected(l,"transmission",m=>o(m)),small:!0,hideShadow:!0,bottomMargin:"normal"}),a.jsx(C,{nullText:"4x2 / 4x4",items:i.transmissionDriveTypes,selectedItems:t.transmissionDrive,onSelectionChange:l=>o({transmissionDrive:l}),small:!0,hideShadow:!0}
1),a.jsx("div",{className:te,children:a.jsx("div",{className:se,onClick:()=>S(),children:"Reset"})})]})]})})})}):null};function $e(e){const[n,s]=c.useState(!1);return a.jsx(a.Fragment,{children:c.createElement(le,y(f({},e),{key:void 0,SearchBar:void 0,PaginationBar:t=>a.jsx("div",{className:ne,children:a.jsx(oe,{searchPagerModel:t.searchPagerModel,selectPage:r=>t.selectPage(r),changePage:r=>t.selectPage(t.searchPagerModel.currentPage+r)})}),FilterOverlay:t=>a.jsx(ye,{query:t.query,controls:t.controls,controlSelectionHelper:t.controlSelectionHelper,mappingService:t.mappingService,search:r=>{t.search(r)},searchClient:t.searchClient,totalCount:t.totalCount,isExpanded:n,close:()=>s(!1)}),FilterSideBar:void 0,ResultsHeaderBar:t=>a.jsx(ge,{sortOrderItems:t.sortOrderItems,sortOrder:t.sortOrder,totalResults:t.totalResults,changeSort:t.changeSort}),ResultTiles:t=>a.jsx(fe,{results:t.results,cssClassNames:t.cssClassNames,hasResults:t.hasResults,pageCount:t.pageCount,resultCount:t.resultCount,pageNumber:t.pageNumber,updateSelectedLocation:t.updateSelectedLocation}),onFiltering:()=>s(!0)}))})}export{$e as default};
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.