1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2072],{35617:(e,t,r)=>{"use strict";r.d(t,{Ed:()=>S});var o=r(60004),i=r(10945),n=r(42092),c=r(59100),a=r(21115),d=r.n(a),s=r(69311),u=r(7384),l=r(90856),p=r(32182),m=r(68178),I=r(66698),g=r(89555),y=r(87391),f=r(30690),h=r(35914),P=r(60072);let b=d()(()=>Promise.all([r.e(7883),r.e(3610),r.e(606),r.e(2760),r.e(3211)]).then(r.bind(r,16132)).then(({ProductContextProvider:e})=>({default:e})),{loadableGenerated:{webpack:()=>[16132]}}),R=d()(()=>Promise.all([r.e(4030),r.e(7883),r.e(349)]).then(r.bind(r,30349)).then(({RecommendationProductsModal:e})=>({default:e})),{loadableGenerated:{webpack:()=>[30349]}}),S=()=>{let{sendModalRecommendationGtmTag:e}=(0,u.PB)(),{openModal:t}=(0,i.h)(),{removeToast:r}=(0,n.d)(),[a]=(0,s.B)(),{addToCartCallback:d}=(()=>{let{sendAddToCartGtmTag:e}=(0,u.PB)(),{cart:t}=(0,m.B_)(),{guestUser:r}=(0,I.Z2)(),{sendToast:o}=(0,n.d)(),[i]=(0,s.B)(),[c]=(0,p.jkR)({update:(e,{data:o})=>{r?.userId&&!t?.items?.length&&(0,f.ad)("addToCart",p.wN)(e,{data:o})},onCompleted:()=>{o({message:i("catalog.addtocart.successMessage"),closeLabel:i("common.close"),status:"success",id:"add-to-cart-toast"})},onError:({graphQLErrors:e})=>{let t=e?.[0]?.extensions?.response?.body,{errorMessage:r,status:n}=(0,y.C)(t,i);o({message:r,status:n,closeLabel:i("common.close")})}});return{addToCartCallback:({productId:t,cartId:r,campaignId:o,quantity:i,productInfo:n,priceData:a,deliveryIndicator:d})=>{c({variables:{productId:t,cartId:r,campaignId:o,quantity:i}}),e({product:n,quantity:i,cart_id:r,cartSource:g.oe.PERSONALIZED_RECOMMENDATION_LIST,priceData:a,deliveryIndicator:d,isRecommendedProduct:!0,listName:h.IQ.CART_PERSONALIZED_RECOMMENDATION})}}})();return{openRecommendationProductsModal:(0,o.useCallback)(o=>{r("recommendation-toast"),e(),t({heading:(0,P.jsx)(c.D,{size:"body-5",as:"h2",children:a("catalog.recommendedProducts.modal.title")}),children:(0,P.jsx)(b,{productDocList:o,addToCart:d,productViewPage:l.WF.RECOMMENDED_PRODUCTS_MODAL,plpViewMode:l.o6.Table,children:(0,P.jsx)(R,{productIds:o.map(e=>e.productId),productDocList:o})}),closeLabel:a("common.close"),size:"xl"})},[d,t,r,e,a])}}},47852:(e,t,r)=>{"use strict";r.d(t,{KD:()=>n,Si:()=>i,jD:()=>o});let o="ft-personalized-recommendation",i=6,n="rl-reco-include-eol-products"},48173:e=>{e.exports={recommendationProductsContainer:"search-box-recommendation-products_recommendationProductsContainer__18Ttp"}},54394:(e,t,r)=>{"use strict";r.d(t,{RJ:()=>b,VY:()=>I,YC:()=>h,gK:()=>y,jk:()=>p});var o=r(12072),i=r(41010),n=r(36109),c=r(86987),a=r(53556);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach(function(t){(0,o.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}let u={},l=(0,i.J1)` 2 mutation AddToCart($cartId: ID!, $productId: ID!, $quantity: Int!) { 3 addToCart(cartId: $cartId, productId: $productId, quantity: $quantity) { 4 id 5 items { 6 productId 7 } 8 totalPriceIncludingSurcharges { 9 amount 10 currency 11 scale 12 } 13 } 14} 15 `;function p(e){let t=s(s({},u),e);return n.n(l,t)}let m=(0,i.J1)` 16 query stocks($productIds: [String!]!, $pickupFacilityIds: [String!]!, $deliveryFacilityId: String!) { 17 getStocks( 18 productIds: $productIds 19 pickupFacilityIds: $pickupFacilityIds 20 deliveryFacilityId: $deliveryFacilityId 21 ) { 22 deliveryIndicator { 23 deliveryIndicators { 24 productId 25 pickup { 26 quantity 27 unitOfMeasure 28 } 29 delivery { 30 quantity 31 unitOfMeasure 32 } 33 } 34 } 35 } 36} 37 `;function I(e){let t=s(s({},u),e);return c.IT(m,t)}let g=(0,i.J1)` 38 query prices($productId: String!, $accountId: ID!, $spaIds: String, $includeAllSpas: Boolean) { 39 getPriceById( 40 productId: $productId 41 accountId: $accountId 42 spaIds: $spaIds 43 includeAllSpas: $includeAllSpas 44 ) { 45 productPrices { 46 productId 47 netPrice { 48 amount 49 scale 50 currency 51 } 52 promotions { 53 totalPromotionalNetPrice { 54 amount 55 scale 56 currency 57 } 58 } 59 } 60 } 61} 62 `;function y(e){let t=s(s({},u),e);return c.IT(g,t)}let f=(0,i.J1)` 63 query ProductsRecommendationsV2($input: RecommendationRequestV2Input!) { 64 productsRecommendationsV2(input: $input) { 65 recommendedProducts { 66 productId 67 greenOffer { 68 greenRating 69 } 70 orderingDetail { 71 orderUnit 72 contentUnit 73 quantitySteps 74 minQuantity 75 } 76 identifier { 77 productTitle 78 opcoProductId 79 manufacturerRefId 80 manufacturerName 81 manufacturerRef 82 customerReference 83 customerReferenceStatus 84 brandName 85 tags 86 stockIndicator 87 gtin 88 keywords 89 } 90 isCuttable 91 offers { 92 offerId 93 leadtimeToShip 94 description 95 availableFrom 96 availableTo
97 productCondition 98 isDeleted 99 orderingDetail { 100 packingQuantity 101 minQuantity 102 maxQuantity 103 quantitySteps 104 contentUnit 105 } 106 seller { 107 opcoSellerId 108 sellerName 109 sellerSku 110 isPremium 111 isProfessional 112 } 113 } 114 references { 115 productIdTo 116 type 117 } 118 features { 119 name 120 value 121 unit 122 rank 123 } 124 categorisation 125 productCategoriesInfo { 126 error 127 id 128 title 129 parents { 130 id 131 title 132 } 133 } 134 isInFavoriteList 135 assetsV2 { 136 type 137 order 138 sourceUrl 139 externalUrl 140 title 141 category 142 } 143 iconCodes 144 } 145 } 146} 147 `;function h(e){let t=s(s({},u),e);return a._(f,t)}let P=(0,i.J1)` 148 query ProductsRecommendationsV2Filtered($input: RecommendationRequestV2Input!, $pickupFacilityIds: [String!], $deliveryFacilityId: String!, $excluding: [ProductExclusionCriteria!]) { 149 productsRecommendationsV2(input: $input) { 150 filteredProducts { 151 availableProducts( 152 pickupFacilityIds: $pickupFacilityIds 153 deliveryFacilityId: $deliveryFacilityId 154 excluding: $excluding 155 ) { 156 productId 157 greenOffer { 158 greenRating 159 } 160 orderingDetail { 161 orderUnit 162 contentUnit 163 quantitySteps 164 minQuantity 165 } 166 identifier { 167 productTitle 168 opcoProductId 169 manufacturerRefId 170 manufacturerName 171 manufacturerRef 172 customerReference 173 customerReferenceStatus 174 brandName 175 tags 176 stockIndicator 177 gtin 178 keywords 179 } 180 isCuttable 181 offers { 182 offerId 183 leadtimeToShip 184 description 185 availableFrom 186 availableTo 187 productCondition 188 isDeleted 189 orderingDetail { 190 packingQuantity 191 minQuantity 192 maxQuantity 193 quantitySteps 194 contentUnit 195 } 196 seller { 197 opcoSellerId 198 sellerName 199 sellerSku 200 isPremium 201 isProfessional 202 } 203 } 204 references { 205 productIdTo 206 type 207 } 208 features { 209 name 210 value 211 unit 212 rank 213 } 214 categorisation 215 productCategoriesInfo { 216 error 217 id 218 title 219 parents { 220 id 221 title 222 } 223 } 224 isInFavoriteList 225 assetsV2 { 226 type 227 order 228 sourceUrl 229 externalUrl 230 title 231 category 232 } 233 iconCodes 234 } 235 } 236 } 237} 238 `;function b(e){let t=s(s({},u),e);return a._(P,t)}},72072:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SearchBoxRecommendationProducts:()=>k});var o=r(60004),i=r(88088),n=r(82726),c=r(35880),a=r(69311),d=r(66698),s=r(14467),u=r(68178),l=r(7384),p=r(90567),m=r(35617),I=r(47852),g=r(54394),y=r(77703),f=r(5179),h=r(90856),P=r(9482),b=r(48173),R=r.n(b),S=r(60072);let k=({searchQuery:e,isBackDropOpen:t,closePopUp:r})=>{let[b]=(0,a.B)(),{user:k}=(0,d.Z2)(),{product_ref_priority_order:C}=(0,s.rD)(),{openRecommendationProductsModal:O}=(0,m.Ed)(),{isFlagEnabled:D}=(0,s.h)(),$=D(I.jD),[v,{data:E,loading:j}]=(0,g.YC)(),{cart:x}=(0,u.B_)(),N=f.U.down("sm"),{sendClickSeeMoreRecommendedProductsGtmTag:T,sendViewItemListGtmTag:_}=(0,l.PB)(),F=(0,p.P_)(E?.productsRecommendationsV2?.recommendedProducts,C),w=j||F?.length>0,M=F?.slice(0,y.eJ),q=F?.length>y.eJ&&!N,B=(0,o.useCallback)(()=>{T(),O(F),r()},[r,O,F,T]),U=(0,o.useMemo)(()=>x?.items?.reduce((e,{productId:t})=>(e.some(e=>e.productId===t)||e.push({productId:t}),e),[])??[],[x?.items]);return((0,o.useEffect)(()=>{!e&&$&&t&&U.length>0&&v({variables:{input:{lineItems:[...U],maxNumberResponses:I.Si,accountId:k?.accountId}}})},[e,t,v,$,U]),(0,o.useEffect)(()=>{E&&!e&&_({docs:M,isRecommendedProduct:!0,metadata:{widget:{name:"search_reco_engine",id:"SRE"}}})},[E]),$&&w)?w&&(0,S.jsxs)("div",{className:R().recommendedProducts,"data-testid":"recommended-products-container",children:[(0,S.jsx)(i.E,{className:R().title,size:"body-2",weight:"light",color:"subtle",children:b("catalog.searchBox.recommendedProducts")}),j?(0,S.jsxs)("div",{"data-testid":"search-suggestions-skeleton",children:[(0,S.jsx)(c.E,{shape:"line",height:16}),(0,S.jsx)(c.E,{shape:"line",height:16}),(0,S.jsx)(c.E,{shape:"line",height:16})]}):(0,S.jsxs)(S.Fragment,{children:[M?.length?(0,S.jsx)(P.P,{productsSuggested:M,currentView:h.WF.RECOMMENDED_PRODUCTS,isRecommendedProduct:!0}):null,q&&(0,S.jsx)(n.$,{variant:"ghost",fullWidth:!0,className:R().seeMoreButton,onClick:B,"data-testid":"see-more-recommended-products",children:b("catalog.search.seeMoreProducts",{count:F?.length-y.eJ})})]})]}):null}}}]);
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.