1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[892],{32192:(e,t,r)=>{r.d(t,{A:()=>D});var s=r(67684),n=r(62701),a=r(20294),l=r(37876),c=r(14678),i=r(15039),u=r.n(i),o=r(48230),d=r.n(o),_=r(89099),h=r(14232),f=r(69050),m=r(10997),p=r(80481),g=r(50075),v=r(52015),x=r(16927),b=r(85993),j=r(4902),y=r(42252),P=r(66002),N=r(88202),I=r(84367),S=r(78735),w=(0,N.$)().FEATURES,R=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;return(0,y.I)({queryKey:[P.w4,e],queryFn:function(){return(0,x._)(function(){var l,c,i,u;return(0,j.YH)(this,function(o){switch(o.label){case 0:return[4,Promise.all([(0,x._)(function(){return(0,j.YH)(this,function(e){if(!w.ADS_CLIENT_DISPLAY)return[2,Promise.resolve({search_result_id:"",ads:[]})];try{return[2,I.O8.getRelatedProducts({platform:r?"MWEB":"WEB",productId:t})]}catch(e){return[2,Promise.resolve({search_result_id:"",ads:[]})]}})})(),(0,S.zh)(e)])];case 1:return c=(l=a._.apply(void 0,[o.sent(),2]))[0],i=l[1],u=(0,b._)(i.map(function(e){return(0,n._)((0,s._)({},e),{adsInfo:null})})),c.ads.forEach(function(e){var t=(0,n._)((0,s._)({},e.item),{adsInfo:e.ad,adsSearchResultId:c.search_result_id,objectID:e.item.id}),r=e.ad.position;if(r<=u.length)u.splice(r,0,t);else{var a=(0,n._)((0,s._)({},t),{adsInfo:(0,n._)((0,s._)({},t.adsInfo),{position:u.length})});u.push(a)}}),[2,u]}})})()},cacheTime:1/0,staleTime:1/0,enabled:!!e.length})},E=r(71260),k=r(19391);let D=function(e){var t,r=e.productId,i=e.isMobile,o=e.showOtherSubcate,x=e.isCarouselStyle,b=e.trackingSource,j=e.dataSeleniumPrefix,y=e.trackEvent,P=(0,a._)((0,g.Bd)(p.sQ),1)[0],N=(0,_.useRouter)().query,I=(0,h.useRef)(null),S=(0,h.useRef)(!1),w=(0,E.DS)(r),D=w.data,T=void 0===D?[]:D,C=w.isLoading,F=R(T,r,i).data,A=(0,h.useMemo)(function(){return(null==F?void 0:F.slice(0,10))||[]},[F]),B=A.length>=2;(0,h.useEffect)(function(){var e=I.current,t=S.current;B&&e&&!t&&((0,k.s3)(e,function(){return y(T)},{threshold:.95}),S.current=!0)},[B,I.current]);var M={slidesToShow:4,slidesToScroll:4,infinite:!1,arrows:!0,adaptiveHeight:!1};return(0,l.jsxs)("div",{className:"lo-container _mgv-48px",children:[(B||C)&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h2",{className:u()({"_fs-700 _fw-600 _mgbt-24px":!i,"_fs-600 _mgbt-12px":i}),children:P("related-product.title")}),C&&(0,l.jsx)("div",{className:"lo-product-card-container _mgv-24px",style:{"--column":i?1:4},children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.Rl,{}),(0,l.jsx)(c.Rl,{}),(0,l.jsx)(c.Rl,{}),(0,l.jsx)(c.Rl,{})]})}),(0,l.jsx)(m.po,{wrapper:function(e){return x?(0,l.jsx)(m.FN,{settings:M,itemPadding:"8px",itemPaddingBottom:"20px",containerClassName:"_mgt-24px _mgbt-24px",children:e}):(0,l.jsx)("div",{className:"lo-product-card-container _mgbt-24px",style:{"--column":i?1:4},children:e})},children:null==A?void 0:A.map(function(e,t){var r,a,c=e.adsInfo&&"web_marketplace_product-detail_related-content-based-section_ads";return(0,l.jsx)("div",(0,n._)((0,s._)({className:"_dp-f _jtfct-str"},0===t&&{ref:I}),{children:(0,l.jsx)(f.c,(0,n._)((0,s._)({ads:{searchResultId:e.adsSearchResultId,sectionType:v.e.relatedProducts,pageType:v.S.PDP,info:e.adsInfo},className:u()("card-product _cs-pt _w-100pct"),productId:e.objectID,purchaseCount:null==e?void 0:e.purchase_count,title:e.title,coverPhoto:e.image||"",basePrice:e.base_price,slug:e.slug,rating:e.rating,badges:e.badges,user:e.user,reviewCount:null==e?void 0:e.review_count,responseTime:null==e||null==(a=e.user)||null==(r=a.stats)?void 0:r.response_time,productCardDecor:null==e?void 0:e.product_card_decor,productImageAlt:e.title,variant:i?"horizontal":void 0,overrideSource:c||b},j&&{dataSelenium:"".concat(j,"-").concat(t+1)}),{style:x&&{minHeight:"400px"}}),e.objectID)}),e.objectID)})})]}),o&&(t=function(){return(0,l.jsxs)("a",{className:"tb-link -primary _ffml-secondary _fw-600",children:[P("related-product.see-other")," ",(0,l.jsx)("i",{className:"far fa-arrow-right _mgl-8px"})]})},(0,l.jsx)(d(),{href:"/".concat(null==N?void 0:N["related-subcategory-slug"]),legacyBehavior:!0,children:i?(0,l.jsx)("div",{className:"_mgh-8px",children:(0,l.jsx)(c.$n,{variant:"outline",isFluid:!0,children:t()})}):(0,l.jsx)(l.Fragment,{children:t()})}))]})}},52015:(e,t,r)=>{r.d(t,{S:()=>s,e:()=>n});var s=function(e){return e.PDP="PDP",e.PLP="PLP",e}({}),n=function(e){return e.relatedProducts="related-product",e.serchResult="search-result",e.subCategory="subcategory",e}({})},98351:(e,t,r)=>{r.d(t,{A:()=>g});var s=r(67684),n=r(62701),a=r(20294),l=r(37876),c=r(15039),i=r.n(c),u=r(54587),o=r.n(u),d=r(14232),_=r(10997),h=r(80481),f=r(50075),m=r(75786),p=r(19391);let g=function(e){var t=e.isMobile,r=e.subcategorySlug,c=e.subcategoryTitle,u=e.trackingSource,g=e.dataSeleniumPrefix,v=e.trackEvent,x=e.className,b=(0,a._)((0,f.Bd)(h.sQ),1)[0],j=(0,m.X2)(r).data,y=(0,d.useRef)(null),P=(0,d.useRef)(!1),N=(0,d.useMemo)(function(){var e,t;return(null==j||null==(t=j.attributes)||null==(e=t.related_subcats)?void 0:e.slice(0,4))||[]},[j]),I=(0,d.useMemo)(function(){return N.length>=2},[N]);return(0,d.useEffect)(function(){if(I){var e,t,r=y.current,s=P.current,n=null==j||null==(t=j.attributes)||null==(e=t.related_subcats)?void 0:e.map(function(e){return null==e?void 0:e.slug});
1s||((0,p.s3)(r,function(){return v(n)},{threshold:.95}),P.current=!0)}},[I,y.current]),(0,l.jsx)("div",{className:i()("product-inform-layout",x),children:I&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h2",{className:i()("_mgbt-24px",{"_fs-700 _fw-600 _mgbt-24px":!t,"_fs-600 _mgbt-12px":t}),children:c?b("related-subcat.title-subcategory",{subcategoryTitle:c}):b("related-subcat.title")}),(0,l.jsx)("div",{className:"lo-product-card-container _mgv-12px",style:{"--column":t?2:4},children:null==N?void 0:N.map(function(e,t){return(0,l.jsx)(_.Gr,(0,n._)((0,s._)({href:"/".concat(e.slug,"?source=").concat(u,"_").concat(r),className:"tb-link -primary"},g&&{"data-selenium":"".concat(g,".").concat(null==e?void 0:e.slug,".").concat(t+1)}),{children:(0,l.jsxs)("div",(0,n._)((0,s._)({className:"subcate-card _cs-pt"},0===t&&{ref:y}),{children:[(0,l.jsx)("div",{style:{position:"relative",width:"100%",height:"98px"},children:(0,l.jsx)(o(),{src:e.image,alt:e.title,quality:90,fill:!0,style:{objectFit:"cover"}})}),(0,l.jsx)("p",{className:"title _ffml-secondary _fw-600 _fs-300",children:e.title})]}))}),e.slug)})})]})})}}}]);
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.