"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[14],{69:(e,r,a)=>{a.d(r,{a:()=>T});var s=a(0),i=a(1),c=a(352),n=a(2),t=a(14);function l(e){return r=>{r.on("animationStarted",(()=>{const a=r.track.details.minIdx,s=r.track.details.maxIdx,i=r.animator.targetIdx||0;e({min:a,max:s,current:i})}))}}var d=a(46);const o={priceColor:"#000000",grayscaleColor:"#000000",regularPriceColor:"#000",redPriceColor:"#B70111"};var u=a(38);const{wrapper:p,wrapperBiggerFont:m,wrapperTitle:j,wrapperCrossedPrice:x,wrapperImageContainer:h,wrapperPricesContainer:g,wrapperPricesContainerActualPrice:b,wrapperPricesContainerComparePrice:v,wrapperPricesContainerActualPriceFrom:C}=u.a,P=({product:{productTitle:e,productLink:r,featuredImage:a,variantId:n,price:t,crossedPrice:l,isFromPrice:u},currencySymbol:P="$",onOpenModal:w,isQuickAddEnabled:k})=>{var O;const N=null!==(O=r.split("/").pop())&&void 0!==O?O:"",f=k,y=t!==l,S=Object.assign({},o),$=`${r}?variant=${n}`;return(0,s.jsx)(i.Fragment,{children:(0,s.jsxs)("div",Object.assign({className:p},{children:[(0,s.jsx)("a",Object.assign({href:$},{children:(0,s.jsxs)("div",Object.assign({className:h},{children:[(0,s.jsx)("img",{width:13,height:18,src:a.src,alt:a.alt}),f&&(0,s.jsx)(d.a,{onClick:()=>{w&&w(n,N)}})]}))})),(0,s.jsx)("div",{children:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",Object.assign({className:j},{children:e})),u&&(0,s.jsx)("div",Object.assign({className:g},{children:(0,s.jsx)("p",Object.assign({className:C},{children:`From ${P}${Number(t).toFixed(2)}`}))})),!u&&(0,s.jsxs)("div",Object.assign({className:g},{children:[y&&(0,s.jsx)("p",Object.assign({className:(0,c.a)(v,x),style:{color:S.regularPriceColor}},{children:`${P}${Number(l).toFixed(2)}`})),(0,s.jsx)("p",Object.assign({className:(0,c.a)(b,!y&&m),style:{color:y?S.redPriceColor:S.grayscaleColor}},{children:` ${P}${Number(t).toFixed(2)}`}))]}))]})})]}))})};var w=a(4),k=a(21),O=a(72),N=a(39),f=a(73);const y={initial:0,mode:"free",slides:{perView:2.5},breakpoints:{"(min-width: 794px)":{slides:{perView:3.5}},"(min-width: 990px)":{slides:{perView:5}}},loop:!1},{wrapper:S,wrapperTitle:$,arrowLeft:F,arrowRight:I,disable:A}=N.a,T=({title:e,slides:r,currencySymbol:a="$",noMarginOnCollection:d,addToCart:o,isBusy:u,isQuickAdd:p,PDPHideColors:m})=>{const{error:j,isLoading:x,activeProduct:h,isModalOpen:g,handleSetProduct:b,handleCloseModal:v,activeModalData:C}=(0,f.a)(m),{carouselRef:N,isJsDisabled:T,handleSlideNext:M,handleSlidePrev:D,slideIdx:{current:L,min:Q,max:B}}=function(e){const[r,a]=(0,n.useState)(!0),[s,i]=(0,n.useState)({min:0,max:1,current:0}),[c,d]=(0,t.a)(e,[l(i)]);var o,u;(0,n.useEffect)((o=d,u=e,()=>(o.current&&o.current.update(Object.assign({},u)),()=>{o.current&&o.current.destroy()})),[d.current]);const p=(0,n.useCallback)((e=>{e.stopPropagation(),d.current&&d.current.prev()}),[d.current]),m=(0,n.useCallback)((e=>{e.stopPropagation(),d.current&&d.current.next()}),[d.current]);return(0,n.useEffect)((()=>{a(!1)}),[]),{carouselRef:c,handleSlideNext:m,handleSlidePrev:p,isJsDisabled:r,instanceRef:d,slideIdx:s}}(y);return(0,s.jsxs)(i.Fragment,{children:[r&&r.length>0&&(0,s.jsxs)("div",Object.assign({className:(0,c.a)(S,T&&"noJsProductSlider")},{children:[(0,s.jsx)("h3",Object.assign({className:$},{children:e})),r.length>5&&(0,s.jsxs)(i.Fragment,{children:[(0,s.jsx)("a",Object.assign({className:(0,c.a)(F,L===Q?A:""),onClick:D},{children:(0,s.jsx)(w.K,{})})),(0,s.jsx)("a",Object.assign({className:(0,c.a)(I,L===B?A:""),onClick:M},{children:(0,s.jsx)(w.L,{})}))]}),(0,s.jsx)("div",Object.assign({className:(0,c.a)("keen-slider"),ref:N},{children:r&&r.length>0&&r.map(((e,r)=>(0,s.jsx)("div",Object.assign({className:(0,c.a)(`keen-slider__slide number-slide${r}`)},{children:(0,s.jsx)(P,{currencySymbol:a,product:e,onOpenModal:b,isQuickAddEnabled:p},e.productTitle)}),e.productTitle)))}))]})),g&&h&&(0,s.jsx)(k.a,{children:(0,s.jsx)(O.a,{showQuickAdd:g,handleQuickAdd:v,quickAddProductData:h,addToCart:o,isBusy:u,variantId:null==C?void 0:C.variantId,error:j,isLoading:x})})]})}}}]);