1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3475],{53475:function(e,r,t){t.r(r),t.d(r,{default:function(){return search_SearchDropdown_SearchDropdown},sendAutocompleteClickEvent:function(){return sendAutocompleteClickEvent}});var n=t(90849),o=t(55732),c=t(90089),a=t(51967),i=t(27062),u=t(21238),s=t(95434),l=t(31684),d=t(27378),p=t(70380),f=t(93939),m=t(59139),h=t(24246);function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){(0,n.Z)(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}var search_SearchHistory_SearchHistory=e=>{var r=Object.assign({},e),{values:{onSearchSelection:t}}=(0,a.R)(),{searchHistory:n,clearSearchHistory:o}=(0,m.Z)();return n.length?(0,h.jsx)(p.Z,_objectSpread(_objectSpread({title:"History",onClear:o},r),{},{children:n.map(e=>(0,h.jsx)(f.Z,{value:e.term,linkProps:{href:e.path,onClick:()=>null==t?void 0:t(e.term,e.path)}},e.term))})):null},O=t(39801),b=t(25137),y=t(47461),v=t(9377),j=t(43179),_=t(90194),S=v.M,search_useTopSearch=function(){var{channel:e,locale:r}=(0,_.kP)(),{data:t,error:n}=(0,j.aM)(S,{term:"",selectedFacets:[{key:"channel",value:null!=e?e:""},{key:"locale",value:r}]});return{data:t,error:n}},P=["topTerms","sort"];function SearchTop_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function SearchTop_objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?SearchTop_ownKeys(Object(t),!0).forEach(function(r){(0,n.Z)(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):SearchTop_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}var search_SearchTop_SearchTop=function(e){var r,{topTerms:t=[],sort:n}=e,o=(0,c.Z)(e,P),{values:{onSearchSelection:i}}=(0,a.R)(),{data:u}=search_useTopSearch(),s=(null!==(r=null==u?void 0:u.search.suggestions.terms)&&void 0!==r?r:t).slice(0,5);return 0===s.length?null:(0,h.jsx)(O.Z,SearchTop_objectSpread(SearchTop_objectSpread({title:"Top Search"},o),{},{children:s.map((e,r)=>(0,h.jsx)(b.Z,{value:e.value,index:r,linkProps:{href:(0,y.u)({term:e.value,sort:n}),onClick:()=>null==i?void 0:i(e.value,(0,y.u)({term:e.value,sort:n}))}},r))}))},g=t(12279),w=t(69),k=t(55991),D=t(20807),x=t(29935),C=t(37389),Z=t(22142),I=t(59845),E=t(14614),T=t(92659),q=t(16801),V=t(10797),K=t(19530),F=t.n(K),M=["product","index","quickOrderSettings","onChangeCustomSearchDropdownVisible"],A=["href","onClick"];function SearchProductItem_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function SearchProductItem_objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?SearchProductItem_ownKeys(Object(t),!0).forEach(function(r){(0,n.Z)(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):SearchProductItem_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}var search_SearchProductItem_SearchProductItem=function(e){var{product:r,index:t,quickOrderSettings:n,onChangeCustomSearchDropdownVisible:o}=e,i=(0,c.Z)(e,M),{values:{term:u,onSearchSelection:s}}=(0,a.R)(),{pushToast:l}=(0,g.l8)(),{__experimentalSKUMatrixSidebar:p}=(0,T.r3)(),f=(0,V.w)({product:r,selectedOffer:0,index:t}),{href:m,onClick:O}=f,b=(0,c.Z)(f,A),{0:y,1:v}=(0,d.useState)(1),{id:j,sku:_,gtin:S,brand:P,isVariantOf:K,isVariantOf:{
1name:B},unitMultiplier:N,image:[H],offers:{lowPrice:G,offers:[{listPrice:L,availability:R,price:Q,listPriceWithTaxes:W,seller:U,priceWithTaxes:z,quantity:J}]},additionalProperty:X}=r,Y=SearchProductItem_objectSpread({href:m,onClick:()=>{var e;O(),null==s||s(B,m),sendAutocompleteClickEvent({url:m,term:u,position:t,productId:null!==(e=r.isVariantOf.productGroupID)&&void 0!==e?e:r.sku})}},b),$=(0,d.useMemo)(()=>"https://schema.org/OutOfStock"===R,[R]),ee=(0,d.useMemo)(()=>!!Object.keys(r.isVariantOf.skuVariants.allVariantsByName).length,[r]),er=(0,E.Q)({id:j,price:Q,priceWithTaxes:z,listPrice:L,listPriceWithTaxes:W,seller:U,quantity:y,itemOffered:{sku:_,name:B,gtin:S,image:[H],brand:P,isVariantOf:K,additionalProperty:X,unitMultiplier:N}},!1);return(0,h.jsxs)(w.Z,SearchProductItem_objectSpread(SearchProductItem_objectSpread({linkProps:Y},i),{},{children:[(0,h.jsx)(k.Z,{children:(0,h.jsx)(I.Z,{src:H.url,alt:H.alternateName,width:56,height:56})}),(0,h.jsx)(D.Z,{title:B,price:{value:G,listPrice:L,formatter:q.P},onValidateBlur:(e,r,t)=>l({title:"Invalid quantity!",message:"The quantity you entered is outside the range of ".concat(e," to ").concat(r,". The quantity was set to ").concat(t,"."),status:"INFO",icon:(0,h.jsx)(x.Z,{name:"CircleWavyWarning",width:30,height:30})}),quickOrder:{enabled:null==n?void 0:n.quickOrder,outOfStockLabel:"Out of stock",availability:!$,hasVariants:ee,buyProps:er,quantity:y,onChangeQuantity:v,max:J,skuMatrixControl:(0,h.jsx)(h.Fragment,{children:(null==n?void 0:n.quickOrder)&&(0,h.jsxs)(C.Z,{children:[(0,h.jsx)(Z.Z,{children:null==n?void 0:n.skuMatrix.triggerButtonLabel}),(0,h.jsx)(p.Component,{overlayProps:{className:F().section},formatter:q.P,columns:null==n?void 0:n.skuMatrix.columns,product:r,status:e=>o("visible"===e)})]})})}})]}))},B=["sort","quickOrderSettings","onChangeCustomSearchDropdownVisible"];function SearchDropdown_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function SearchDropdown_objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?SearchDropdown_ownKeys(Object(t),!0).forEach(function(r){(0,n.Z)(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):SearchDropdown_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function sendAutocompleteClickEvent(e){var{url:r,term:n,position:o,productId:c}=e;return t.e(4605).then(t.bind(t,14791)).then(e=>{var{sendAnalyticsEvent:t}=e;return t({name:"intelligent_search_autocomplete_click",params:{term:n,url:r,productId:c,position:o}})})}var search_SearchDropdown_SearchDropdown=function(e){var{sort:r,quickOrderSettings:t,onChangeCustomSearchDropdownVisible:n}=e,d=(0,c.Z)(e,B),{values:{onSearchSelection:p,products:f,term:m,terms:O}}=(0,a.R)();return(0,h.jsxs)(i.Z,SearchDropdown_objectSpread(SearchDropdown_objectSpread({},d),{},{children:[(0,h.jsx)(search_SearchHistory_SearchHistory,{sort:r}),(0,h.jsx)(search_SearchTop_SearchTop,{sort:r}),(0,h.jsx)(u.Z,{children:null==O?void 0:O.map(e=>{var t,{value:n}=e;return(0,h.jsx)(s.Z,{term:m,suggestion:n,linkProps:{href:(0,y.u)({term:n,sort:r}),onClick:(t=(0,o.Z)(function*(e){e.preventDefault();var t=(0,y.u)({term:n,sort:r});null==p||p(m,(0,y.u)({term:m,sort:r}));try{yield sendAutocompleteClickEvent({term:m,url:window.location.href})}catch(e){}window.location.href=t}),function(e){return t.apply(this,arguments)})}},n)})}),(0,h.jsx)(l.Z,{children:f.map((e,r)=>(0,h.jsx)(search_SearchProductItem_SearchProductItem,{product:e,index:r,quickOrderSettings:t,onChangeCustomSearchDropdownVisible:n},e.id))})]}))}},14614:function(e,r,t){t.d(r,{Q:function(){return useBuyButton}});var n=t(27378),o=t(12279),c=t(90194),a=t(96957),useBuyButton=function(e){var r,i=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{openCart:u}=(0,o.l8)(),{currency:{code:s}}=(0,c.kP)(),l=Array.isArray(e);return{onClick:(0,n.useCallback)(r=>{if(r.preventDefault(),e){var n=l?e.reduce((e,r)=>e+=r.price*r.quantity,0):e.price*e.quantity;t.e(4605).then(t.bind(t,14791)).then(r=>{var{sendAnalyticsEvent:t}=r;t({name:"add_to_cart",params:{currency:s,value:n,items:l?e.map(generatedItem):[generatedItem(e)]}})}
1),l?e.forEach(e=>a.i8.addItem(e)):a.i8.addItem(e),i&&u()}function generatedItem(e){return{item_id:e.itemOffered.isVariantOf.productGroupID,item_name:e.itemOffered.isVariantOf.name,item_brand:e.itemOffered.brand.name,item_variant:e.itemOffered.sku,quantity:e.quantity,price:e.price,discount:e.listPrice-e.price,currency:s,item_variant_name:e.itemOffered.name,product_reference_id:e.itemOffered.gtin}}},[s,e,u,l]),"data-testid":"buy-button","data-sku":l?"sku-matrix-sidebar":null==e?void 0:e.itemOffered.sku,"data-seller":l?null===(r=e[0])||void 0===r?void 0:r.seller.identifier:null==e?void 0:e.seller.identifier}}},16801:function(e,r,t){t.d(r,{P:function(){return useFormattedPrice}});var n=t(27378),o=t(90194),usePriceFormatter=function(){var{decimals:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{currency:r,locale:t}=(0,o.kP)();return(0,n.useCallback)(n=>Intl.NumberFormat(t,{style:"currency",currency:r.code,minimumFractionDigits:e?2:0}).format(n),[r.code,t,e])},useFormattedPrice=e=>{var r=usePriceFormatter();return(0,n.useMemo)(()=>r(e),[r,e])}},10797:function(e,r,t){t.d(r,{w:function(){return useProductLink}});var n=t(27378),o=t(90194),useProductLink=e=>{var{index:r,product:c,selectedOffer:a}=e,{slug:i}=c,{currency:{code:u}}=(0,o.kP)(),s=(0,n.useCallback)(()=>{t.e(4605).then(t.bind(t,14791)).then(e=>{var{sendAnalyticsEvent:t}=e;t({name:"select_item",params:{items:[{item_id:c.isVariantOf.productGroupID,item_name:c.isVariantOf.name,item_brand:c.brand.name,item_variant:c.sku,index:r,price:c.offers.offers[a].price,discount:c.offers.offers[a].listPrice-c.offers.offers[a].price,currency:u,item_variant_name:c.name,product_reference_id:c.gtin}]}}),t({name:"search_select_item",params:{url:window.location.href,items:[{item_id:c.isVariantOf.productGroupID,item_variant:c.sku,index:r}]}})})},[u,c,r,a]);return{href:"/".concat(i,"/p"),onClick:s,"data-testid":"product-link"}}}}]);
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.