1(self.webpackChunkgentek_www=self.webpackChunkgentek_www||[]).push([[101],{262116:function(e,t,n){const r=n(789450),{compose:l}=n(813296),{first:a}=n(298784),o=l(Object.keys,a),c={alignment:{vertical:"middle"},border:{bottom:{style:"thin"}}},i=e=>({fill:{type:"pattern",pattern:"solid",fgColor:{argb:e}}}),u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{font:{bold:!0,...e}}},s=e=>e.map((e=>({header:e.toUpperCase(),key:e,width:35}))),m=(e,t)=>(e.mergeCells("A1","Z1"),Object.assign(e.getRow(1),{...i("D7D7D7"),...u({size:14}),...c,values:[t],height:36})),d=(e,t)=>t?(m(e,t),2):1,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new r.Workbook,l=n.addWorksheet(),a=o(e);return l.columns=s(a),Object.assign(l.getRow(d(l,t.title)),{...i("C7C7C7"),...u(),...c,values:a}),e.forEach((e=>{l.addRow(e)})),l.properties.defaultRowHeight=18,n.xlsx.writeBuffer()};p.getHeader=o,p.mapColumns=s,p.makeTitle=m,e.exports=p},823678:function(e,t,n){"use strict";var r=n(307914),l=n(371954);t.Z=void 0;var a=l(n(827378)),o=(0,r(n(200545)).default)(a.createElement("path",{d:"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11z"}),"Extension");t.Z=o},434469:function(e,t,n){"use strict";var r=n(307914),l=n(371954);t.Z=void 0;var a=l(n(827378)),o=(0,r(n(200545)).default)(a.createElement("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList");t.Z=o},833529:function(e,t,n){"use strict";var r=n(307914),l=n(371954);t.Z=void 0;var a=l(n(827378)),o=(0,r(n(200545)).default)(a.createElement("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"}),"FormatListNumbered");t.Z=o},915292:function(e,t,n){"use strict";var r=n(307914),l=n(371954);t.Z=void 0;var a=l(n(827378)),o=(0,r(n(200545)).default)(a.createElement("path",{d:"M17.63 5.84C17.27 5.33 16.67 5 16 5L5 5.01C3.9 5.01 3 5.9 3 7v10c0 1.1.9 1.99 2 1.99L16 19c.67 0 1.27-.33 1.63-.84L22 12l-4.37-6.16z"}),"Label");t.Z=o},664126:function(e,t,n){"use strict";var r=n(307914),l=n(371954);t.Z=void 0;var a=l(n(827378)),o=(0,r(n(200545)).default)(a.createElement("path",{d:"M12 16.5l4-4h-3v-9h-2v9H8l4 4zm9-13h-6v1.99h6v14.03H3V5.49h6V3.5H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-14c0-1.1-.9-2-2-2z"}),"SystemUpdateAlt");t.Z=o},416658:function(e,t,n){"use strict";n.d(t,{Z:function(){return Ze}});var r=n(827378),l=n(722057),a=n(186298),o=n(883367),c=n(957318),i=n(677299),u=n(823678),s=n(462454),m=n(915292),d=n(836417),p=n.n(d),v=n(199729),h=n.n(v),E=n(25414),g=n(29317),f=n(51777),Z=n(874615),y=n(725525),b=n(567653),k=n(925189),x=n(443991),C=n(696347),w=n(434469),H=n(569355),$=n(995099),P=n.n($),z=n(555807),q=n.n(z),V=n(963633),M=n(450986),A=n.n(M);var L=e=>{let{route:t,children:n}=e;const[l,a]=r.useState();return r.useEffect((()=>{A().get(`/q3-api-${t}?limit=500`).then((e=>{var n,r;a((n=e,r=t,P()(q()(n.data[r],(e=>{let{name:t,code:n}=e;return{label:t,value:n}})),"label")))})).catch((()=>{a([])}))}),[]),l?n(l):r.createElement(V.Z,null)};const S=e=>{let{field:t,query:n,route:l,children:o,countFunction:u,icon:s}=e;const m=(0,C.useOpen)(),{decode:d}=(0,H.K)(),{t:v}=(0,g.$G)("labels"),w=function(e){return void 0===e&&(e=[]),r.createElement(i.ht.N,{query:n,onSave:e=>{e!==n&&(0,E.navigate)(e),m.close()}},o&&o(e),t&&r.createElement(i.hj.gN,{name:t,type:"checkset",xl:6,lg:6,options:e,suppressLabel:!0}),r.createElement(a.Z,{position:"sticky",bottom:0,left:0,right:0,width:"100%"},r.createElement(a.Z,{bgcolor:"background.paper",p:1},r.createElement(c.Z,{alignItems:"center",container:!0,spacing:1},r.createElement(c.Z,{item:!0},r.createElement(f.Z,{color:"secondary",variant:"contained",type:"submit"},"Apply")),r.createElement(c.Z,{item:!0},r.createElement(f.Z,{onClick:m.close},"Cancel"))))))};return r.createElement(a.Z,null,r.createElement(Z.Z,{badgeContent:(()=>{const e=d(n);return u?u(e):(r=h()(e,t,[]),Array.isArray(r)?p()(r):r?1:0);var r})(),color:"secondary"},r.createElement(y.Z,{mdDown:!0},r.createElement(f.Z,{color:"inherit",onClick:m.open,startIcon:r.createElement(s,null)},v(l||"attributes"))),r.createElement(y.Z,{lgUp:!0},r.createElement(b.Z,{color:"inherit","aria-label":v(l||"attributes"),onClick:m.open},r.createElement(s,null)))),r.createElement(k.ZP,{anchorEl:m.anchorEl,onClose:m.close,open:m.isOpen},r.createElement(x.Z,null,r.createElement(a.Z,{maxHeight:259,p:1,width:350},l?r.createElement(L,{route:l},w):w([])))))};S.defaultProps={children:null,countFunction:null,field:void 0,route:void 0,icon:w.Z};var O=S;const D=["featured","recommended","promotion","new"];var N=e=>{let{query:t}=e;return r.createElement(c.Z,{item:!0},r.createElement(c.Z,{container:!0,spacing:2},r.createElement(c.Z,{item:!0},r.createElement(O,{icon:s.Z,field:"category~code",route:"categories",query:t})),r.createElement(c.Z,{item:!0},r.createElement(O,{icon:u.Z,field:"vendor~code",route:"vendors",query:t})),r.createElement(c.Z,{item:!0},r.createElement(O,{icon:m.Z,query:t,countFunction:e=>D.reduce(((t,n)=>t+(e&&n in e)?1:0),0)},(()=>D.map((e=>r.createElement(i.hj.gN,{name:e,key:e,suppressHelper:!0,type:"checkbox",variant:"switch",checkedValue:"exists(true)",label:`Is ${e}`}))))))))},j=n(598125),F=n(996690),R=n(808885),W=n(833529),Y=n(264406);var _=()=>{const e="per_page_limit",t=t=>Y.Z.set(e,t);let n=Y.Z.get(e);return n||(n=16,t(n)),{limit:n,set:t}},G=n(788068),I=n(403526);const U=e=>!e||e<1?0:e-1,B=()=>{const{pathname:e,search:t}=(0,G.useLocation)();return n=>(0,E.navigate)(e+(()=>{const e=U(n);return t&&"?"!==t?t.includes("page")?t.replace(/page=[^&$]*/i,`page=${U(n)}`):`${t}&page=${e}`:`?page=${e}`})())},K=e=>{let{total:t}=e;const{search:n}=(0,G.useLocation)(),l=B(),o=Math.ceil(t/_().limit),c=(()=>{try{const e=n.match(/(?:\/page\/|[?&]page=)([0-9]\d*)/);return e?Number(e[1])+1:1}catch(e){return 1}})();return r.useEffect((()=>{c>o&&l(0)}),[c,o]),r.createElement(a.Z,{my:6,mx:"auto",display:"inline-block",align:"center"},r.createElement(I.Z,{color:"primary",count:o,onChange:(e,t)=>
1l(t),page:c}))};K.defaultProps={total:0};var T=K;var J=()=>{const e=(0,C.useOpen)(),{limit:t,set:n}=_(),l=B();return r.createElement(a.Z,null,r.createElement(j.ZP,{title:"# of results"},r.createElement(b.Z,{color:"primary",onClick:e.open},r.createElement(W.Z,null))),r.createElement(F.Z,{anchorEl:e.anchorEl,open:e.isOpen,onClose:e.close},[8,16,32,64].map((a=>r.createElement(R.Z,{dense:!0,selected:Number(t)===a,style:{fontSize:"1rem",margin:0},key:`perPage${a}`,onClick:()=>{try{n(a),l(),e.close()}catch(t){alert("Failed to change results count. Please try again.")}}},a," per page")))))},Q=n(185256),X=n(846358);const ee=e=>{let{list:t}=e;return Array.isArray(t)&&t.length?t.map((e=>r.createElement(X.xD,{key:e.id},r.createElement(X.ZP,e)))):r.createElement(c.Z,{item:!0,xs:!0},r.createElement(Q.ZP,{title:"noResults",icon:"NoResults"}))};ee.defaultProps={list:[]};var te=ee,ne=n(876445),re=n(424800),le=n(700854),ae=n.n(le),oe=n(889475),ce=n(664126),ie=n(502874),ue=n(478174),se=n.n(ue),me=n(262116),de=n.n(me),pe=n(664072);const ve=async function(e,t){void 0===t&&(t=500);const n=e=>{var t;return(null==e||null===(t=e.data)||void 0===t?void 0:t.products)||[]},r=function(n){void 0===n&&(n=-1);const r=`${"string"==typeof e?e.replace("limit=16",`limit=${t}`):`limit=${t}`}&fields=components,sku,manufacturerSku,excerpt,price,stock,inventory,vendor,currencyDefault&page=${n+1}`;return["/products",r].join(r.startsWith("?")?"":"?")},l=await A().get(r()),a=n(l),o=((e,t,n)=>{const r=t-e;return 0!==r?Math.ceil(r/Math.max(e,n)):0})(a.length,(null==(c=l)||null===(i=c.data)||void 0===i?void 0:i.total)||0,t);var c,i;return await Array.from({length:o}).reduce((async(e,t,l)=>(await e,A().get(r(l)).then((e=>a.push(n(e)))))),Promise.resolve()),a.flat()},he=e=>{var t,n,l,o;let{children:c,query:i}=e;const[u,s]=r.useState(),{t:m}=(0,g.$G)("labels"),d=null===(t=r.useContext(oe.Vo))||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.profile)||void 0===l||null===(o=l.customer)||void 0===o?void 0:o.name;return r.createElement(a.Z,null,r.createElement(ne.Z,{component:"button",disabled:u,onClick:async()=>(s(!0),ve(i).then((e=>{!function(){de().apply(void 0,arguments).then((e=>{se()(new Blob([e]),"export.xlsx")}))}(function(e,t){void 0===e&&(e=[]);const n=function(e){return void 0===e&&(e=[]),e.some((e=>{var t;return null==e||null===(t=e.price)||void 0===t?void 0:t.custom}))}(e),r=function(e){return void 0===e&&(e=[]),e.some((e=>{var t;return null==e||null===(t=e.inventory)||void 0===t?void 0:t.hasAvailable}))}(e);return e.map((e=>{var l,a,o,c,i;return{[t("sku")]:e.sku,[t("manufacturerSku")]:e.manufacturerSku,...n?{[t("price")]:null==e||null===(l=e.price)||void 0===l?void 0:l.custom,[t("msrp")]:null==e||null===(a=e.price)||void 0===a?void 0:a.msrp}:{},...r?{[t("inventory")]:(null==e||null===(o=e.inventory)||void 0===o?void 0:o.hasAvailable)||0,[t("inventoryMessage")]:(null==e||null===(c=e.stock)||void 0===c?void 0:c.message)||""}:{},[t("vendor")]:null==e||null===(i=e.vendor)||void 0===i?void 0:i.name,[t("excerpt")]:e.excerpt}}))}(e,m),{title:d?`(${ae()().format("YYYY-MM-DD")}) Pricelist for ${d} based on preferred payment method of ${(0,pe.v)()} in ${(0,pe.zC)()}`:null})})).catch((()=>{alert("Could not generate the file.")})).finally((()=>{s(!1)}))),style:{fontWeight:"bold"}},r.createElement(ce.Z,{style:{transform:"rotate(-90deg)"}}),u?"Please wait ...":c))};var Ee=e=>{const t=(0,C.useOpen)();return r.createElement(r.Fragment,null,r.createElement(j.ZP,{title:"Export options"},r.createElement(b.Z,{color:"primary",onClick:t.open},r.createElement(ie.Z,null))),r.createElement(k.ZP,{anchorEl:t.anchorEl,open:t.isOpen,onClose:t.close},r.createElement(a.Z,{p:2,maxWidth:320},r.createElement(re.Z,null,"Generate a downloadable of our products, pricing and current availability. Please allow up to 60 seconds for the full catalogue export to complete."),r.createElement(c.Z,{container:!0,spacing:1},!["?","undefined"].includes(null==e?void 0:e.query)&&r.createElement(c.Z,{item:!0,xs:12},r.createElement(he,e,"Export last search/filter")),r.createElement(c.Z,{item:!0,xs:12},r.createElement(he,null,"Export full catalogue"))))))};const ge=(0,l.default)((e=>({page:{backgroundColor:e.palette.background.paper,"& > div":{width:"100%"}}}))),fe=e=>{let{q:t,products:n=[],total:l=0}=e;const i=ge();return r.createElement(a.Z,{className:i.page},r.createElement(o.Z,{maxWidth:"xl"},r.createElement(c.Z,{container:!0,justifyContent:"space-between"},r.createElement(c.Z,{item:!0},r.createElement(N,{query:t})),r.createElement(c.Z,{item:!0},r.createElement(c.Z,{container:!0,spacing:1},r.createElement(c.Z,{item:!0},r.createElement(Ee,{query:t})),r.createElement(c.Z,{item:!0},r.createElement(J,null))))),r.createElement(c.Z,{container:!0},r.createElement(te,{list:n})),n.length>0&&r.createElement(c.Z,{item:!0,xs:12,style:{textAlign:"center"}},r.createElement(T,{total:l,perPage:16}))))};fe.defaultProps={q:"?",products:[],total:0};var Ze=fe}}]); 2//# sourceMappingURL=c9b50ccc85aefe0b7b222c540939092385a1b726-69aa46d84df08b0903d9.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.