PageSourceSearch

https://www.hutsoninc.com/component---src-pages-lp-hot-deals-js-9215652f65af2b444569.js

js hutsoninc.com collected 2026-10-04 07:06:23 UTC 11,989 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_hutson_www=self.webpackChunk_hutson_www||[]).push([[5199],{62189:function(e,t,n){n.r(t);var a=n(42236),o=n(28007),i=n(92568),l=n(68154),r=n(71822),c=n(10769),s=n(61344),d=n(13340),m=n.n(d),u=n(88110),g=n(19598),p=n(65873),h=n(14675),f=n(86457),w=n(65264),E=n(9119),v=n.n(E);const y=e=>{const t={},n=new URLSearchParams(e);for(let[a,o]of n.entries())o&&(/[^\d]/.test(o)||(o=Number(o)),t.hasOwnProperty(a)?t[a]=[t[a],o]:t[a]=o);return t},x={Relevance:e=>e,"Recently Added":e=>e.sort((e,t)=>e.modifiedDate<t.modifiedDate?1:e.modifiedDate>t.modifiedDate?-1:null),"Price: Low - High":e=>e.sort((e,t)=>e.price<t.price?-1:e.price>t.price?1:null),"Price: High - Low":e=>e.sort((e,t)=>e.price>t.price?-1:e.price<t.price?1:null),"Engine Hours: Low - High":e=>e.sort((e,t)=>e.engineHoursMeter<t.engineHoursMeter?-1:e.engineHoursMeter>t.engineHoursMeter?1:null),"Engine Hours: High - Low":e=>e.sort((e,t)=>e.engineHoursMeter>t.engineHoursMeter?-1:e.engineHoursMeter<t.engineHoursMeter?1:null),"Year: Newest - Oldest":e=>e.sort((e,t)=>e.modelYear>t.modelYear?-1:e.modelYear<t.modelYear?1:null),"Year: Oldest - Newest":e=>e.sort((e,t)=>e.modelYear<t.modelYear?-1:e.modelYear>t.modelYear?1:null)},b={location:"Location",minHours:"Min Hours",maxHours:"Max Hours",condition:"Condition"},H=[10,20,30],C=i.default.div.withConfig({displayName:"hot-deals__Content",componentId:"sc-g3iqcq-0"})(["box-sizing:border-box;margin:0 auto;padding:40px 0;width:85%;@media (min-width:1024px){padding:40px 25px;width:1024px;}"]),S=i.default.div.withConfig({displayName:"hot-deals__TitleBar",componentId:"sc-g3iqcq-1"})(["margin:0 0 30px;"]),q=i.default.div.withConfig({displayName:"hot-deals__TitleContainer",componentId:"sc-g3iqcq-2"})(["@media (min-width:1024px){display:inline-block;margin-right:3%;vertical-align:bottom;width:72%;}"]),N=i.default.h1.withConfig({displayName:"hot-deals__Title",componentId:"sc-g3iqcq-3"})(["font-size:1.75em;margin:0;"]),_=i.default.div.withConfig({displayName:"hot-deals__FilterTagClose",componentId:"sc-g3iqcq-4"})(["border-right:1px solid #d7d7d7;display:inline-block;font-size:1.3em;font-weight:600;padding:6px 8px;vertical-align:middle;"]),k=(0,i.default)(f.A).withConfig({displayName:"hot-deals__FilterTag",componentId:"sc-g3iqcq-5"})(["background-color:#ebebeb;color:#7d7d7d;cursor:pointer;display:inline-block;font-size:1em;font-weight:lighter;line-height:1;margin:10px 10px 0 0;text-decoration:none;:hover,:focus{background-color:#dbdbdb;color:#6d6d6d;","{border-right:1px solid #c7c7c7;}}"],_),A=i.default.div.withConfig({displayName:"hot-deals__FilterTagText",componentId:"sc-g3iqcq-6"})(["display:inline-block;padding:6px 8px;vertical-align:middle;"]),I=i.default.div.withConfig({displayName:"hot-deals__Sort",componentId:"sc-g3iqcq-7"})(["display:none;@media (min-width:1024px){display:inline-block;vertical-align:bottom;width:25%;}"]),L=i.default.div.withConfig({displayName:"hot-deals__ShowingBar",componentId:"sc-g3iqcq-8"})(["border-bottom:1px solid #d7d7d7;color:#999;margin-bottom:40px;padding:5px 0;width:100%;"]),M=i.default.div.withConfig({displayName:"hot-deals__ChangeShowing",componentId:"sc-g3iqcq-9"})(["display:none;@media (min-width:1024px){display:block;float:right;}"]),F=(0,i.default)(f.A).withConfig({displayName:"hot-deals__ChangeShowingOption",componentId:"sc-g3iqcq-10"})(["@media (min-width:1024px){color:",";cursor:",";display:inline-block;font-weight:",";text-decoration:",";:not(:first-of-type){margin-left:8px;}:hover,:focus{text-decoration:underline;}}"],e=>e["aria-selected"]?"#7d7d7d":"#377539",e=>e["aria-selected"]?"default":"pointer",e=>e["aria-selected"]?"700":"400",e=>e["aria-selected"]?"underline":"none"),P=i.default.div.withConfig({displayName:"hot-deals__ColumnsContainer",componentId:"sc-g3iqcq-11"})(["@media (min-width:1024px){","}"],h.J),O=i.default.div.withConfig({displayName:"hot-deals__FiltersColumn",componentId:"sc-g3iqcq-12"})(["margin-bottom:40px;@media (min-width:1024px){"," margin-bottom:0;}"],(0,p.f)("1/4")),T=i.default.div.withConfig({displayName:"hot-deals__ProductsColumn",componentId:"sc-g3iqcq-13"})(["@media (min-width:1024px){","}"],(0,p.f)("3/4")),Y=i.default.div.withConfig({displayName:"hot-deals__NoneFound",componentId:"sc-g3iqcq-14"})(["background-color:#f6f6f6;border:1px solid #d7d7d7;font-size:1em;padding:10px 20px;"]),R=(0,i.default)(s.A).withConfig({displayName:"hot-deals__StyledPagination",componentId:"sc-g3iqcq-15"})(["padding:0 0 40px;text-align:center;@media (min-width:800px){padding:0 0 60px;}"]),U=e=>{let{data:{allMachineFinderEquipment:t},location:{pathname:n}}=e;return{equipment:t.nodes,meta:{title:"Hot Deals | Used Equipment | Hutson Inc",pageUrl:`https://www.hutsoninc.com${n}`},pathname:n}},D=e=>{let{equipment:t=[],filter:n,itemsShowing:o,onFilter:i,search:l}=e,{location:r}=n;const{0:c,1:s}=(0,a.useState)([]);void 0===r&&(r="All Locations"),(0,a.useEffect)(()=>{const e=t.reduce((e,t)=>
1{const n=t.location.name;return-1===e.indexOf(n)&&e.push(n),e},[]).sort();s(e)},[t]);return a.createElement("select",{className:"All Locations"!==r?"filled":"",value:r,onChange:e=>{var t;t=e.target.value,i({...n,itemsShowing:o,search:l,location:"All Locations"===t?"":t},!0)},name:"Location"},a.createElement("option",{value:"All Locations"},"All Locations"),c.map(e=>a.createElement("option",{key:e,value:e},e)))},j=e=>{let{filter:t,itemsShowing:n,onFilter:o,search:i}=e,{maxHours:l,minHours:r}=t;void 0===r&&(r=0),void 0===l&&(l="None");const c=e=>{const a=e.target.getAttribute("name");((e,a)=>{const l={};"minHours"===a?l.minHours=e:"maxHours"===a&&(l.maxHours="None"===e?"":e),o({...t,...l,itemsShowing:n,search:i},!0)})(e.target.value,a)};return a.createElement(a.Fragment,null,a.createElement("label",null,"Min Hours",a.createElement("select",{className:r?"filled":"",value:r,onChange:c,name:"minHours"},a.createElement("option",{value:"0"},"0"),a.createElement("option",{value:"250"},"250"),a.createElement("option",{value:"500"},"500"),a.createElement("option",{value:"1000"},"1,000"),a.createElement("option",{value:"2000"},"2,000"),a.createElement("option",{value:"3000"},"3,000"),a.createElement("option",{value:"4000"},"4,000"),a.createElement("option",{value:"5000"},"5,000"))),a.createElement("label",null,"Max Hours",a.createElement("select",{className:"None"!==l?"filled":"",value:l,onChange:c,name:"maxHours"},a.createElement("option",{value:"None"},"None"),a.createElement("option",{value:"250"},"250"),a.createElement("option",{value:"500"},"500"),a.createElement("option",{value:"1000"},"1,000"),a.createElement("option",{value:"2000"},"2,000"),a.createElement("option",{value:"3000"},"3,000"),a.createElement("option",{value:"4000"},"4,000"),a.createElement("option",{value:"5000"},"5,000"))))},$=e=>{let{filter:t,itemsShowing:n,onFilter:o,search:i}=e,{condition:l,...r}=t;void 0===l&&(l="Any Condition");return a.createElement("select",{className:"Any Condition"!==l?"filled":"",value:l,onChange:e=>{const t={};"any"!==e.target.value&&(t.condition=e.target.value),o({...r,...t,itemsShowing:n,search:i},!0)},name:"Condition"},a.createElement("option",{value:"any"},"Any Condition"),a.createElement("option",{value:"New"},"New"),a.createElement("option",{value:"Used"},"Used"))};t.default=e=>{const t=U(e),{0:n,1:i}=(0,a.useState)(1),{0:s,1:d}=(0,a.useState)(10),{0:p,1:h}=(0,a.useState)("Recently Added"),{0:f,1:E}=(0,a.useState)({}),{0:z,1:B}=(0,a.useState)(""),{0:J,1:W}=(0,a.useState)(t.equipment),G=(0,a.useRef)(null),{meta:K={},pathname:Q}=t;(0,w.S)(()=>{if(window.addEventListener("popstate",V),e.location.search){const t=y(e.location.search);let{page:n,itemsShowing:a,search:o="",sort:i,...l}=t;X({...l,page:n,itemsShowing:a,sort:i,search:o},!1)}return()=>{window.removeEventListener("popstate",V)}});const V=()=>{const t=y(e.location.search);t.hasOwnProperty("search")||(t.search=""),X(t,!1)},X=async function(e,n){void 0===n&&(n=!0);let{page:a=1,itemsShowing:l=10,sort:r,search:c,...s}=e,u=t.equipment;if(""!==c){const e=[];(await ne(c)).forEach(t=>{for(let n=0;n<u.length;n++)if(u[n].slug===t.slug){e.push(u[n]);break}}),u=e}if(r?u=x[r](u):r=""!==c?"Relevance":p,l&&(l=Number(l)),s.condition){const e="New"===s.condition;u=u.filter(t=>t.isNew===e)}s.location&&(u=((e,t,n)=>{const a=Array.isArray(t)?t:[t];return e.filter(e=>v().get(e,a)===n)})(u,["location","name"],s.location)),s.minHours>0&&(s.minHours=Number(s.minHours),u=u.filter(e=>s.minHours<=e.engineHoursMeter)),s.maxHours&&(s.maxHours=Number(s.maxHours),u=u.filter(e=>s.maxHours>=e.engineHoursMeter));const g=m()(s);if(E(g),i(a),d(l),h(r),B(c),W(u),n){const e={...g,page:a,itemsShowing:l,sort:r};c&&(e.search=c);const t=new URLSearchParams(e);(0,o.navigate)(`${Q}?${t.toString()}`)}},Z=e=>{const t=Number(e.target.innerText);t!==s&&X({...f,itemsShowing:t,sort:p,search:z||""})},ee=e=>{const t=e.target.value||e.target.getAttribute("data-value");t!==p&&X({...f,sort:t,itemsShowing:s,search:z||""})},te=e=>{const t=e.currentTarget.getAttribute("data-filter");X({...f,itemsShowing:s,search:z||"",[t]:""})},ne=async e=>(await fetch("/api/search",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({query:e})}).then(e=>e.json())).filter(e=>/used/i.test(e.tag)&&!/used\spage/i.test(e.tag)),ae=[],oe=(n-1)*s;for(let a=oe,o=J.length;a<o&&a<oe+s;a++)ae.push(J[a]);const ie=Math.ceil(J.length/s);let le;le=n*s>J.length?J.length:n*s;const re=n*s-(s-1);return a.createElement(r.A,{kind:"white"},a.createElement(l.Helmet,null,a.createElement("title",null,K.title),a.createElement("meta",{property:"og:title",content:K.title}),a.createElement("meta",{property:"og:url",content:K.pageUrl}),a.createElement("meta",{property:"twitter:card",content:"summary"}),a.createElement("meta",{name:"twitter:site",content:"@Hutson_Inc"}),a.createElement("meta",{name:"robots",content:"noindex, nofollow"})),a.createElement(C,null,a.createElement(S,null,a.createElement(q,null,a.createElement(N,null,"Hot Deals")),a.createElement(I,null,a.createElement("select",{value:p,onChange:ee,name:"Sort"},Object.keys(x).map(e=>a.createElement("option",{value:e,key:`Sort_${e}`},e)))),a.createElement("div",null,z&&a.createElement(k,{onClick:te,"data-filter":"search"},a.createElement(_,null,"×"),a.createElement(A,null,"Search: ",z)),Ob
1ject.keys(f).map(e=>a.createElement(k,{key:e,onClick:te,"data-filter":e},a.createElement(_,null,"×"),a.createElement(A,null,b[e],": ",((e,t)=>{switch(t){case"minHours":case"maxHours":return e.toLocaleString("en-US");default:return e}})(f[e],e)))))),a.createElement(P,null,a.createElement(O,null,a.createElement(u.A,null),a.createElement(g.A,{filter:[{heading:"Location",content:a.createElement(D,{equipment:t.equipment,itemsShowing:s,search:z||"",filter:f,onFilter:X})},{heading:"Condition",content:a.createElement($,{itemsShowing:s,search:z||"",filter:f,onFilter:X})},{heading:"Hours",content:a.createElement(j,{itemsShowing:s,search:z||"",filter:f,onFilter:X})}],sort:{value:p,options:Object.keys(x),onChange:ee},desktopWidth:1024})),a.createElement(T,null,a.createElement(L,null,J.length>0&&a.createElement(a.Fragment,null,"Showing ",re,le>1&&a.createElement("span",null,"-",le)," of ",J.length),0===J.length&&a.createElement("span",null,"No equipment found."),a.createElement(M,{"aria-label":"Results per page"},"Show:"," ",H.map(e=>a.createElement(F,{"aria-selected":s===e,key:e,onClick:Z},e)))),a.createElement("div",{ref:G,tabIndex:"-1"}),J.length>0&&a.createElement(a.Fragment,null,ae.map((e,t)=>a.createElement("div",{key:t},a.createElement(c.A,Object.assign({},e,{hotDeal:!0}))))),0===J.length&&a.createElement(Y,null,"No equipment found matching your search.")))),ie>1&&a.createElement(R,{onPageChange:e=>{if(n!==e){const t={...m()(f),page:e,itemsShowing:s,sort:p};z&&(t.search=z),i(e);const n=new URLSearchParams(t);(0,o.navigate)(`${Q}?${n.toString()}`),G.current.focus()}},currentPage:n,totalPages:ie}))}}}]);
2//# sourceMappingURL=component---src-pages-lp-hot-deals-js-9215652f65af2b444569.js.map

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.