PageSourceSearch

https://www.puratos.com.my/etc.clientlibs/settings/wcm/designs/pur…/js/freqBoughtTogether.a813e4e4.chunk.js

js puratos.com.my collected 2026-09-26 16:22:45 UTC 7,753 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkpuratos_react=self.webpackChunkpuratos_react||[]).push([[485,8602],{22833(e,r,t){t.d(r,{Q:()=>a});t(96540);var l=t(54585),i=t(18022),n=t(74848);const a=e=>{let{product:r,fallbackImage:t}=e;const a=(0,i.lD)(null===r||void 0===r?void 0:r.productUrl);return(0,n.jsx)("div",{className:"p-bundle-row__cell p-bundle-row__cell--header p-minicart__product",children:(0,n.jsx)(n.Fragment,{children:[(0,n.jsx)("div",{className:"p-minicart-product__image",children:(0,n.jsx)("div",{className:"p-minicart-product__img bg-lazyload lazyload",style:{backgroundImage:'url("'.concat((0,l.hZ)((null===r||void 0===r?void 0:r.skuImageUrl)||(null===r||void 0===r?void 0:r.imageUrl)||t),'")')}})},"image"),(0,n.jsx)("div",{className:"p-minicart-product-name",children:a?(0,n.jsx)("a",{href:a,children:r.aemProdName}):(0,n.jsx)("p",{children:null===r||void 0===r?void 0:r.aemProdName})},"name")]})})}},6010(e,r,t){t.d(r,{S:()=>a,z:()=>n});t(96540);var l=t(74848);const i={display:"initial"},n={sm:"-13",md:"",lg:"-15"},a=e=>{let{id:r,className:t,label:a="",selected:s,onChange:o,size:c=n.md,centered:d,list:u=!1,hideMobile:m=!1,hideDesktop:p=!1,disabled:h=!1}=e;return(0,l.jsxs)("div",{className:"p-checkbox"+c+(d?" center":"")+(u?" list":"")+(m?" important-hide-mobile":"")+(p?" important-hide-desktop":"")+(h?" disabled":""),children:[(0,l.jsx)("input",{id:r,type:"checkbox",className:t,checked:s,onChange:o,disabled:h}),(0,l.jsx)("label",{htmlFor:r,className:"p-cursor-pointer",style:i,children:a})]})}},96352(e,r,t){t.r(r),t.d(r,{FrequentlyBoughtTogether:()=>M,default:()=>B});var l=t(19115),i=t(54585),n=t(79393),a=t(96540),s=t(6010),o=t(17477),c=t(60040),d=t(83555),u=t(18022),m=t(74848);const p=e=>{let{product:r,fallbackImage:t,translate:n,changeSelection:p,selected:h,addEvent:b,position:v}=e;const g=(0,o.a)("1000px"),j=(0,l.useSelector)(c.x3),x=(0,u.lD)(r.productUrl);return(0,m.jsxs)(m.Fragment,{children:[j&&(0,m.jsx)(s.S,{id:r.materialNumber,selected:h,onChange:()=>p(r.materialNumber),list:!0,centered:!0,hideMobile:!1,hideDesktop:!0},"mobile-"+r.materialNumber),(0,m.jsx)(a.Fragment,{children:(0,m.jsx)(d.e,{condition:x,wrapper:e=>(0,m.jsx)("a",{href:x,onClick:()=>b(r,v),onMouseDown:e=>1===e.button&&b(r,v),children:e}),children:(0,m.jsx)("div",{className:"p-minicart-product__image"+(h?"":" unselected"),children:(0,m.jsx)("div",{className:"p-minicart-product__img",style:g?{backgroundImage:'url("'.concat((0,i.hZ)(r.skuImageUrl||r.imageUrl||t),'")')}:{content:'url("'.concat((0,i.hZ)(r.skuImageUrl||r.imageUrl||t),'")')}})},"image")})},"image"),(0,m.jsxs)("div",{className:"p-minicart-product-name",children:[(0,m.jsxs)("div",{className:"p-minicart-product-checkbox-name-wrapper",children:[j&&(0,m.jsx)(s.S,{id:r.materialNumber,selected:h,onChange:()=>p(r.materialNumber),list:!0,centered:!0,hideMobile:!0,hideDesktop:!1},"desktop-"+r.materialNumber),x?(0,m.jsx)("a",{href:x,onClick:()=>b(r,v),onMouseDown:e=>1===e.button&&b(r,v),children:r.aemProdName}):(0,m.jsx)("p",{children:r.aemProdName})]}),j&&(0,m.jsx)("div",{className:"p-minicart-product-price",children:r.promotionUnitPriceDouble>0?(0,m.jsxs)("div",{children:[(0,m.jsx)("span",{className:"text-lt",children:r.unitPrice}),(0,m.jsxs)("p",{className:"promoted-value",children:[r.promotionUnitPrice,(0,m.jsxs)("span",{children:[" ",n("each")]})]})]}):(0,m.jsx)("div",{children:(0,m.jsxs)("p",{children:[r.unitPrice," ",(0,m.jsxs)("span",{children:[" ",n("each")]})]})})})]},"name")]})};var h=t(66797),b=t(22833),v=t(13956);const g=e=>{let{isLoading:r,openModal:t,translate:l,color:i}=e;return(0,m.jsxs)("div",{className:"p-bundle-row__cell p-bundle-row__cell--selector",children:[(0,m.jsx)("div",{className:"addToCartButton",children:(0,m.jsx)(v.h,{small:!0,className:"btn-block p-margin-bottom-sm",loading:r,disabled:r,block:!0,response:!0,onClick:t,translate:l,color:i})}),(0,m.jsx)("p",{className:"p-margin-top-sm",children:l("Select quantity in next step")})]})};var j=t(92848),x=t(45037),N=t(99792),f=t(50285),_=t(95786),y=t(83943),k=t(12048),w=t(69727),O=t(46222),P=t(52306),S=t(67597),D=t(6664),C=t(51701),I=t(5864),E=t(7790),U=t(31977);function T(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);r&&(l=l.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,l)}return t}function F(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};
1r%2?T(Object(t),!0).forEach(function(r){G(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):T(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function G(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var l=t.call(e,r||"default");if("object"!=typeof l)return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}const M=e=>{var r,t,s,o;const[d,u]=(0,a.useState)([]),v=(0,l.useDispatch)(),y=(0,h.GO)(),T=(0,l.useSelector)(e=>(0,n.DG)(e)),G=(0,l.useSelector)(e=>(0,i.G9)(e)),M=(0,l.useSelector)(O.dD),q=(null===(r=(0,l.useSelector)(e=>(0,k.ti)(e,M)))||void 0===r?void 0:r.length)>0||!1,B=null===(t=e.resource)||void 0===t?void 0:t.product,L=null===(s=e.resource)||void 0===s?void 0:s.products,z=(0,l.useSelector)(c.B$),A=(0,l.useSelector)(D.D9),Q=(0,l.useSelector)(c.u6),R=(0,l.useSelector)(O.dC),Z=L&&(null===(o=L[0])||void 0===o?void 0:o.aemProdId)&&!R||!1;(0,a.useEffect)(()=>{(null===L||void 0===L?void 0:L.length)>0&&!L.includes(B)&&L.unshift(B),L&&u(L.map(e=>null===e||void 0===e?void 0:e.materialNumber))},[L]);const H=(0,a.useCallback)(function(e){const r=[...d];null!==r&&void 0!==r&&r.includes(e)?r.splice(r.indexOf(e),1):r.push(e),r.includes(null===B||void 0===B?void 0:B.materialNumber)||r.unshift(null===B||void 0===B?void 0:B.materialNumber),u(r)},[d]),Y=(e,r)=>{v((0,w.EG)(F(F({},e),{},{type:P.IJ.FREQUENTLY_BOUGHT_TOGETHER}))),(0,_.V)(e,S.v.pdpFreqBoughtTogether,!0,z,A,r),C.v.selectItem({user_id:z,page_language:(0,i.wq)(),email_address:(0,N.M3)()?Q:"",login_status:z?I.y.LOGGED_IN:I.y.GUEST,website_section:E.k.myProducts,items:(0,U.L_)(e,A,S.v.pdpFreqBoughtTogether)})};return B&&L&&0!=L.length&&Z?(0,m.jsx)(a.Fragment,{children:(0,m.jsxs)("div",{className:"p-bundle-selector"+(q?" has-bundles":""),children:[(0,m.jsx)("h4",{className:"p-bundle-selector__header",children:y("Frequently bought together")}),(0,m.jsx)("div",{className:"p-bundle-selector__body",children:(0,m.jsxs)("div",{className:"p-bundle-row p-cell-orientation-vertical",children:[(0,m.jsx)(b.Q,{product:B,fallbackImage:G}),null===L||void 0===L?void 0:L.map((e,r)=>e!==B?(0,m.jsx)("div",{className:"p-bundle-row__cell p-minicart__product",children:(0,m.jsx)(p,{product:e,fallbackImage:G,translate:y,changeSelection:H,selected:d.includes(e.materialNumber),addEvent:Y,position:r+1},"cell-"+e.materialNumber)},e.materialNumber):null),(0,m.jsx)(g,{translate:y,color:"SECONDARY",isLoading:T,openModal:()=>{if(!(0,N.M3)())return void v((0,f.C8)());const e=null===L||void 0===L?void 0:L.map(e=>d.includes(e.materialNumber)?e.aemProdId:null).filter(e=>null!==e);v((0,x.qf)(j.d,{productIds:e,skus:d,hideCartAmountAlert:!0,addAll:!0,showBundles:!1,translate:y,type:S.v.pdpFreqBoughtTogether}))}})]})})]})}):null},q={openModal:x.qf,redirectToLogin:f.C8,setProductImpressions:y.u4},B=(0,l.connect)((e,r)=>({resource:(0,i.W_)(e,r.model)||{},resourceLoading:(0,n.DG)(e,r.model)}),q)(M)}}]);
2//# sourceMappingURL=freqBoughtTogether.a813e4e4.chunk.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.