(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[905],{5025:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/products/[slug]",function(){return l(1571)}])},9376:function(e,t,l){"use strict";var i=l(5893),s=l(265),a=l(2553),r=l(5675),n=l.n(r),o=l(1163),d=l(3854),c=l(9304);l(6268),l(333),l(4940);var u=l(2261),x=l(5434),p=l(1664),v=l.n(p),m=l(7294);t.Z=e=>{let{productList:t}=e,{setQuickViewModal:l,setProdId:r,setRequestStockModal:p,setId:h}=(0,s.$)(),[g,_]=(0,m.useState)(""),f=e=>{l(!0),r(e)},j=(e,t)=>{r(e),h(t),p(!0)},w=(0,o.useRouter)();return(0,i.jsx)("div",{className:"relative  section",children:(0,i.jsxs)(u.tq,{slidesPerView:5,spaceBetween:10,autoplay:{delay:2200,disableOnInteraction:!1},navigation:{nextEl:".button-next-slide",prevEl:".button-prev-slide"},modules:[c.pt,c.W_],breakpoints:{270:{slidesPerView:1.5,spaceBetween:9},320:{slidesPerView:3,spaceBetween:9},375:{slidesPerView:3,spaceBetween:10},425:{slidesPerView:3,spaceBetween:10},480:{slidesPerView:2,spaceBetween:18},768:{slidesPerView:3,spaceBetween:18},1024:{slidesPerView:4,spaceBetween:18},1150:{slidesPerView:4.5,spaceBetween:18},1440:{slidesPerView:4.7,spaceBetween:18},1500:{slidesPerView:5,spaceBetween:18}},children:[null==t?void 0:t.map((e,t)=>{var l,s,r,o,c,x,p,m,h,g,_;return(0,i.jsx)(u.o5,{children:(0,i.jsxs)("div",{className:"bg-[#ECF0F3] w-full  border rounded-2xl shadow-lg cursor-pointer relative",children:[(0,i.jsxs)("div",{className:"relative  flex items-end justify-center",children:[(null==e?void 0:e.image)&&(null==e?void 0:null===(l=e.image)||void 0===l?void 0:l.length)>0?(0,i.jsx)("div",{className:"relative w-full h-[300px] xs:h-[100px] xms:h-[130px] xls:h-[130px] sm:h-[240px] md:h-[270px] lg:h-[300px]",children:(0,i.jsx)(v(),{href:"/products/".concat(null==e?void 0:e.slug),children:(0,i.jsx)(n(),{className:"object-fill h-full w-full rounded-t-lg",src:"".concat(a.Z.ImageHostName,"/storage/product/").concat(encodeURIComponent(null==e?void 0:e.image[0])),width:450,height:50,alt:"category",priority:!0})})}):(0,i.jsx)("div",{className:"relative w-full h-[300px] xs:h-[130px] xms:h-[130px] xls:h-[130px] sm:h-[240px] md:h-[270px] lg:h-[300px]",children:(0,i.jsx)(v(),{href:"/products/".concat(null==e?void 0:e.slug),children:(0,i.jsx)(n(),{className:"object-fill h-full w-full",src:"/assets/category/product1.webp",width:450,height:50,alt:"category",priority:!0})})}),(null==e?void 0:e.campaign_name)?(0,i.jsx)("p",{className:"absolute bottom-2 text-center text-white bg-[#00254a]  grid justify-center text-sm xls:text-[10px] xms:text-[10px] xs:text-[8px]  px-2 rounded-md py-1 ",children:null==e?void 0:e.campaign_name}):null]}),(0,i.jsxs)("div",{className:" text-center py-1 bg-[#ECF0F3] rounded-b-lg",children:[(0,i.jsx)(v(),{href:"/products/".concat(null==e?void 0:e.slug),className:"px-1 text-[12px] xls:text-[9px]  xms:text-[9px] xs:text-[9px] font-semibold overflow-hidden line-clamp-2  py-1 cursor-pointer xls:h-[50px] xms:h-[50px] xs:h-[50px] h-[45px]  ",children:(null==e?void 0:null===(s=e.product_name)||void 0===s?void 0:s.length)>45?(0,i.jsx)("h2",{children:(null==e?void 0:null===(r=e.product_name)||void 0===r?void 0:r.substring(0,45))+"...."}):(0,i.jsx)("h2",{children:null==e?void 0:e.product_name})}),(0,i.jsxs)("div",{className:"font-semibold text-black text-center xls:text-[9px]  xms:text-[9px] xs:text-[9px] font-sans",children:["TK."," ",(null==e?void 0:e.product_variation_status)==0?(0,i.jsx)(i.Fragment,{children:(null==e?void 0:e.regular_price)==(null==e?void 0:e.sale_price)?null:(0,i.jsx)("span",{className:"line-through",children:Math.round(null==e?void 0:e.regular_price)})}):(0,i.jsx)(i.Fragment,{children:(null==e?void 0:null===(o=e.product_variants[0])||void 0===o?void 0:o.regular_price)==(null==e?void 0:null===(c=e.product_variants[0])||void 0===c?void 0:c.sale_price)?null:(0,i.jsx)("span",{className:"line-through",children:Math.round(null==e?void 0:null===(x=e.product_variants[0])||void 0===x?void 0:x.regular_price)})}),(null==e?void 0:e.product_variation_status)==0?(0,i.jsx)("span",{className:"pl-2 text-tahiti-500",children:Math.round(null==e?void 0:e.sale_price)}):(0,i.jsx)("span",{className:"pl-2 text-tahiti-500",children:Math.round(null==e?void 0:null===(p=e.product_variants[0])||void 0===p?void 0:p.sale_price)})]}),(null==e?void 0:null===(m=e.stock_products)||void 0===m?void 0:m.length)==0?(0,i.jsx)("div",{className:"uppercase mt-1 text-white  bg-[#DE606B] text-xs xls:text-[10px] xms:text-[9px] xs:text-[7px] py-[2px] rounded-full mx-2",onClick:()=>j(null==e?void 0:e.slug,null==e?void 0:e.id),children:"request stock"}):(0,i.jsx)("div",{className:"h-[22px]"})]}),(0,i.jsx)("div",{onClick:()=>w.push("/products/".concat(null==e?void 0:e.slug)),className:"absolute top-4 xls:top-3 xms:top-3 left-0 z-10 w-[60px] xls:w-[55px]",children:(0,i.jsxs)("div",{className:"bg-tahiti-500 flex items-center justify-between px-1 py-1 rounded-r-full shadow-md",children:[(0,i.jsx)("div",{className:"text-[12px] xls:text-[9px] xms:text-[9px] xs:text-[9px] font-bold text-white ",children:"OFF"}),(0,i.jsxs)("div",{className:" w-6 h-6 grid items-center justify-center text-[10px] font-semibold text-tahiti-500  rounded-full bg-white",children:[(null==e?void 0:e.product_variation_status)==1?Math.round(((null==e?void 0:null===(h=e.product_variants[0])||void 0===h?void 0:h.regular_price)-(null==e?void 0:null===(g=e.product_variants[0])||void 0===g?void 0:g.sale_price))*100/(null==e?void 0:null===(_=e.product_variants[0])||void 0===_?void 0:_.regular_price)):Math.round(((null==e?void 0:e.regular_price)-(null==e?void 0:e.sale_price))*100/(null==e?void 0:e.regular_price)),"%"]})]})}),(0,i.jsx)("div",{className:"absolute top-4 right-1 z-10  ",children:(0,i.jsx)("div",{onClick:()=>f(null==e?void 0:e.slug),className:" w-8 h-8 xls:w-6 xls:h-6 xms:w-5 xms:h-5 xs:w-5 xs:h-5 grid items-center justify-center text-[14px] font-semibold text-white  rounded-full bg-tahiti-500 hover:bg-white hover:text-tahiti-500",children:(0,i.jsx)(d.b9W,{})})})]})},t)}),(0,i.jsx)("button",{className:"button-prev-slide w-[50px] xls:w-[20px] xms:w-[20px] xms:h-[20px] xs:h-[20px] xs:w-[20px] xls:h-[20px] h-[50px] rounded-full shadow-xl drop-shadow-lg  transition duration-200 bg-slate-50 text-black grid place-items-center absolute top-[47%] z-10 left-[-50px] md:left-[-15px] sm:left-[-5px] xls:left-[-20px] xms:left-[-20px] xs:left-[-23px] cursor-pointer",children:(0,i.jsx)(x.RL9,{size:20,className:"text-primary"})}),(0,i.jsx)("button",{className:"button-next-slide w-[50px] xls:w-[20px] xms:w-[20px] xms:h-[20px] xs:h-[20px] xs:w-[20px] xls:h-[20px] h-[50px] rounded-full shadow-xl drop-shadow-lg  transition duration-200 bg-slate-50 text-black grid place-items-center absolute top-[47%] z-10 right-[-50px] md:right-[-15px] sm:right-[-5px]  xls:right-[-20px] xms:right-[-20px] xs:right-[-23px] cursor-pointer",children:(0,i.jsx)(x.Bqb,{size:20,className:"text-primary"})})]})})}},1571:function(e,t,l){"use strict";l.r(t),l.d(t,{__N_SSP:function(){return L},default:function(){return q}});var i=l(5893),s=l(7294),a=l(2553),r=l(5675),n=l.n(r),o=l(6066);l(9678),l(4640);var d=l(5434),c=e=>{let{image:t}=e,[l,r]=(0,s.useState)(!0);return(0,i.jsx)(n(),{className:"rounded-md object-cover h-full w-full",src:l?"".concat(a.Z.ImageHostName,"/storage/product/").concat(encodeURIComponent(t)):"/assets/placeholder_600x.webp",width:500,height:100,priority:!0,alt:"product",unoptimized:!l,onError:()=>r(!1)})},u=e=>{var t,l,r,u,x,p,v,m,h,g,_,f,j,w,b,y;let{data:N,selectedIndex:k,handleImageClick:C,handleVariationImageClick:S,setSelectedIndex:I,clickFlag:A,setClickFlag:L}=e,[q,B]=(0,s.useState)(!0),E={img:!A&&(null==N?void 0:N.image)?(null===(t=a.Z)||void 0===t?void 0:t.ImageHostName)+"/storage/product/"+encodeURIComponent(null==N?void 0:N.image[k]):(null==N?void 0:N.product_variation_status)==1&&(null==N?void 0:N.product_variants)&&(null==N?void 0:null===(l=N.product_variants[k])||void 0===l?void 0:l.image)?(null===(r=a.Z)||void 0===r?void 0:r.ImageHostName)+"/storage/product/"+encodeURIComponent(null==N?void 0:null===(u=N.product_variants[k])||void 0===u?void 0:u.image[0]):"/assets/placeholder_600x.webp"},M=e=>{let{onClick:t}=e,l=()=>{(null==N?void 0:N.product_variation_status)==1?(I(e=>{var t;return e>0?e-1:(null==N?void 0:null===(t=N.product_variants)||void 0===t?void 0:t.length)-1}),L(!0)):I(e=>{var t;return e>0?e-1:(null==N?void 0:N.image)&&(null==N?void 0:null===(t=N.image)||void 0===t?void 0:t.length)-1})};return(0,i.jsx)("div",{className:"custom-prev-arrow",onClick:t,children:(0,i.jsx)("button",{onClick:()=>l(),className:"h-[40px] w-[40px] rounded-full shadow-xl drop-shadow-lg  transition duration-200 bg-slate-50 text-black grid place-items-center cursor-pointer",children:(0,i.jsx)(d.DJ5,{size:20})})})},O=e=>{let{onClick:t}=e,l=()=>{(null==N?void 0:N.product_variation_status)==1?(I(e=>{var t;return e<(null==N?void 0:null===(t=N.product_variants)||void 0===t?void 0:t.length)-1?e+1:0}),L(!0)):I(e=>{var t;return e<(null==N?void 0:N.image)&&(null==N?void 0:null===(t=N.image)||void 0===t?void 0:t.length)-1?e+1:0})};return(0,i.jsx)("div",{className:"custom-next-arrow",onClick:t,children:(0,i.jsx)("button",{onClick:()=>l(),className:"h-[40px] w-[40px] rounded-full shadow-xl drop-shadow-lg  transition duration-200 bg-slate-50 text-black grid place-items-center cursor-pointer",children:(0,i.jsx)(d.Ix0,{size:20})})})},H=e=>{let{onClick:t}=e,l=()=>{(null==N?void 0:N.product_variation_status)==1?(I(e=>{var t;return e>0?e-1:(null==N?void 0:null===(t=N.product_variants)||void 0===t?void 0:t.length)-1}),L(!0)):I(e=>{var t;return e>0?e-1:(null==N?void 0:N.image)&&(null==N?void 0:null===(t=N.image)||void 0===t?void 0:t.length)-1})};return(0,i.jsx)("div",{className:"custom-small-prev-arrow",onClick:t,children:(0,i.jsx)("button",{onClick:()=>l(),className:"h-[30px] w-[30px] rounded-full shadow-xl drop-shadow-lg  transition duration-200 bg-slate-50 text-black grid place-items-center cursor-pointer",children:(0,i.jsx)(d.RL9,{size:20})})})},T=e=>{let{onClick:t}=e,l=()=>{(null==N?void 0:N.product_variation_status)==1?(I(e=>{var t;return e<(null==N?void 0:null===(t=N.product_variants)||void 0===t?void 0:t.length)-1?e+1:0}),L(!0)):I(e=>{var t;return e<(null==N?void 0:N.image)&&(null==N?void 0:null===(t=N.image)||void 0===t?void 0:t.length)-1?e+1:0})};return(0,i.jsx)("div",{className:"custom-small-next-arrow",onClick:t,children:(0,i.jsx)("button",{onClick:()=>l(),className:"h-[30px] w-[30px] rounded-full shadow-xl drop-shadow-lg  transition duration-200 bg-slate-50 text-black grid place-items-center cursor-pointer",children:(0,i.jsx)(d.Bqb,{size:20})})})};return(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"bg-white col-span-1 p-2 grid  grid-cols-6 gap-8 rounded-l-md shadow-md   sm:gap-0 sm:rounded-sm sm:hidden xls:hidden xms:hidden xs:hidden ",children:[(0,i.jsx)("div",{className:"mt-10",children:(0,i.jsx)("div",{children:(null==N?void 0:N.product_variation_status)==1?(0,i.jsx)("div",{className:"relative ",children:(null==N?void 0:N.product_variants)&&(null==N?void 0:null===(x=N.product_variants)||void 0===x?void 0:x.length)>5?(0,i.jsx)(o.Z,{slidesToShow:5,slidesToScroll:1,vertical:!0,verticalSwiping:!0,prevArrow:(0,i.jsx)(M,{}),nextArrow:(0,i.jsx)(O,{}),children:null==N?void 0:null===(p=N.product_variants)||void 0===p?void 0:p.map((e,t)=>(0,i.jsx)("div",{className:"relative w-[60px] h-[60px]  border-[2px] ".concat(k==t&&A?"border-tahiti-500":"border-gray-200"," rounded-md cursor-pointer"),onClick:()=>S(null==e?void 0:e.id,t),children:(null==e?void 0:e.image)?(0,i.jsx)(c,{image:null==e?void 0:e.image[0]}):(0,i.jsx)(n(),{className:"rounded-md object-cover h-full w-full",src:"/assets/placeholder_600x.webp",width:500,height:100,priority:!0,alt:"product"})},t))}):(0,i.jsx)("div",{children:null==N?void 0:null===(v=N.product_variants)||void 0===v?void 0:v.map((e,t)=>(0,i.jsx)("div",{className:"relative w-[60px] h-[60px]  border-[2px] ".concat(k==t&&A?"border-tahiti-500":"border-gray-200"," rounded-md mb-2 cursor-pointer"),onClick:()=>S(null==e?void 0:e.id,t),children:(null==e?void 0:e.image)?(0,i.jsx)(c,{image:null==e?void 0:e.image[0]}):(0,i.jsx)(n(),{className:"rounded-md object-cover h-full w-full",src:"/assets/placeholder_600x.webp",width:500,height:100,priority:!0,alt:"product"})},t))})}):(0,i.jsx)("div",{className:"relative",children:(null==N?void 0:N.image)&&(null==N?void 0:null===(m=N.image)||void 0===m?void 0:m.length)>5?(0,i.jsx)(o.Z,{slidesToShow:5,slidesToScroll:1,vertical:!0,verticalSwiping:!0,prevArrow:(0,i.jsx)(M,{}),nextArrow:(0,i.jsx)(O,{}),children:null==N?void 0:null===(h=N.image)||void 0===h?void 0:h.map((e,t)=>(0,i.jsx)("div",{className:"relative w-[60px] h-[60px]    border-[2px] ".concat(k==t&&A?"border-tahiti-500":"border-gray-200"," rounded-md cursor-pointer"),onClick:()=>C(t),children:e?(0,i.jsx)(c,{image:e}):(0,i.jsx)(n(),{className:"rounded-md object-cover h-full w-full",src:"/assets/placeholder_600x.webp",width:500,height:100,priority:!0,alt:"product"})},t))}):(0,i.jsx)("div",{className:"pb-2",children:null==N?void 0:null===(g=N.image)||void 0===g?void 0:g.map((e,t)=>(0,i.jsx)("div",{className:"relative w-[60px] h-[60px]    border-[2px] ".concat(k==t&&A?"border-tahiti-500":"border-gray-200"," rounded-md mb-2 cursor-pointer"),onClick:()=>C(t),children:e?(0,i.jsx)(c,{image:e}):(0,i.jsx)(n(),{className:"rounded-md object-cover h-full w-full",src:"/assets/placeholder_600x.webp",width:500,height:100,priority:!0,alt:"product"})},t))})})})}),(0,i.jsx)("div",{className:"col-span-5 xs:col-span-full xms:col-span-full xls:col-span-full sm:col-span-full",children:(0,i.jsx)("div",{className:"relative  rounded-md cursor-pointer w-full h-[600px] xs:h-[300px] xms:h-[300px] xls:h-[320px] sm:h-[380px] md:h-[500px]",children:(0,i.jsx)(n(),{className:"rounded-md object-contain h-full w-full",height:500,width:500,src:q?E.img:"/assets/placeholder_600x.webp",alt:"product image",priority:!0,unoptimized:!q,onError:()=>B(!1)})})})]}),(0,i.jsxs)("div",{className:"hidden sm:block xls:block xms:block xs:block bg-white",children:[(0,i.jsx)("div",{className:"relative  rounded-md cursor-pointer w-full h-[600px] xs:h-[300px] xms:h-[300px] xls:h-[320px] sm:h-[380px] md:h-[500px]",children:(0,i.jsx)(n(),{className:"rounded-md object-contain h-full w-full",height:500,width:500,src:q?E.img:"/assets/placeholder_600x.webp",alt:"product image",priority:!0,unoptimized:!q,onError:()=>B(!1)})}),(0,i.jsx)("div",{className:"mt-4",children:(null==N?void 0:N.product_variation_status)==1?(0,i.jsx)("div",{className:"relative",children:(null==N?void 0:N.product_variants)&&(null==N?void 0:null===(_=N.product_variants)||void 0===_?void 0:_.length)>5?(0,i.jsx)(o.Z,{slidesToShow:5,slidesToScroll:1,prevArrow:(0,i.jsx)(H,{}),nextArrow:(0,i.jsx)(T,{}),children:null==N?void 0:null===(f=N.product_variants)||void 0===f?void 0:f.map((e,t)=>{var l;return(0,i.jsx)("div",{className:"relative w-[40px] h-[100px] xls:h-[70px] xms:h-[60px] xs:h-[55px] p-[8px] xls:p-[5px] xms:p-[5px] xs:p-[4px] rounded-md cursor-pointer ",onClick:()=>S(null==e?void 0:e.id,t),children:(null==e?void 0:e.image)&&(null==e?void 0:null===(l=e.image)||void 0===l?void 0:l.length)>0?(0,i.jsx)(c,{image:null==e?void 0:e.image[0]}):(0,i.jsx)(n(),{className:"rounded-md object-cover h-full w-full",src:"/assets/placeholder_600x.webp",width:500,height:100,priority:!0,alt:"product"})},t)})}):(0,i.jsx)("div",{className:"grid grid-cols-5 gap-2",children:null==N?void 0:null===(j=N.product_variants)||void 0===j?void 0:j.map((e,t)=>{var l;return(0,i.jsx)("div",{className:"relative  rounded-md cursor-pointer ",onClick:()=>S(null==e?void 0:e.id,t),children:(null==e?void 0:e.image)&&(null==e?void 0:null===(l=e.image)||void 0===l?void 0:l.length)>0?(0,i.jsx)(c,{image:null==e?void 0:e.image[0]}):(0,i.jsx)(n(),{className:"rounded-md object-cover h-full w-full",src:"/assets/placeholder_600x.webp",width:500,height:100,priority:!0,alt:"product"})},t)})})}):(0,i.jsx)("div",{className:"relative",children:(null==N?void 0:N.image)&&(null==N?void 0:null===(w=N.image)||void 0===w?void 0:w.length)>5?(0,i.jsx)(o.Z,{slidesToShow:5,slidesToScroll:1,prevArrow:(0,i.jsx)(H,{}),nextArrow:(0,i.jsx)(T,{}),children:null==N?void 0:null===(b=N.image)||void 0===b?void 0:b.map((e,t)=>(0,i.jsx)("div",{className:"relative w-[40px] h-[100px] xls:h-[70px] xms:h-[60px] xs:h-[55px] p-[8px] xls:p-[5px] xms:p-[5px] xs:p-[4px] rounded-md cursor-pointer ",onClick:()=>C(t),children:e&&(null==e?void 0:e.length)>0?(0,i.jsx)(c,{image:e}):(0,i.jsx)(n(),{className:"rounded-md object-cover h-full w-full",src:"/assets/placeholder_600x.webp",width:500,height:100,priority:!0,alt:"product"})},t))}):(0,i.jsx)("div",{className:"grid grid-cols-5 gap-2",children:null==N?void 0:null===(y=N.image)||void 0===y?void 0:y.map((e,t)=>(0,i.jsx)("div",{className:"relative  rounded-md cursor-pointer ",onClick:()=>C(t),children:e&&(null==e?void 0:e.length)>0?(0,i.jsx)(c,{image:e}):(0,i.jsx)(n(),{className:"rounded-md object-cover h-full w-full",src:"/assets/placeholder_600x.webp",width:500,height:100,priority:!0,alt:"product"})},t))})})})]})]})},x=l(9376),p=l(265),v=l(4805),m=l(6734),h=l(1664),g=l.n(h),_=l(1163),f=l(2286),j=l(8193),w=l(3750),b=l(9583),y=l(6893),N=l(1511),k=l(2920),C=e=>{var t,l,r,o,d,c,u,x,h,C,S,I,A,L,q,B,E;let{data:M,selectedItem:O,variationId:H,selectedIndex:T,clickFlag:P,handleVariationImageClick:z}=e;window.location.origin&&window.location.origin;let F=(0,_.useRouter)(),[D,Z]=(0,s.useState)(1),{cartItems:V,setCartItems:R,setIsCartOpen:J,setWishCount:U,token:Y,contactInfo:$,setProdId:X,setId:K,setRequestStockModal:W,phone:G}=(0,p.$)(),[Q,ee]=(0,s.useState)(null),[et,el]=(0,s.useState)(null),[ei,es]=(0,s.useState)(0),[ea,er]=(0,s.useState)(!1),en=e=>{var t,l,i,s,a,r,n,o,d,c,u,x;if((null==M?void 0:M.product_variation_status)==1&&!0==P||(null==M?void 0:M.product_variation_status)==0){let e={product_id:null==M?void 0:M.id,slug:null==M?void 0:M.slug,variant_id:(null==M?void 0:M.product_variation_status)==1?H:null,name:null==M?void 0:M.product_name,image:(null==M?void 0:M.product_variation_status)==1?null==M?void 0:null===(t=M.product_variants[T])||void 0===t?void 0:t.image[0]:null==M?void 0:M.image[0],regularPrice:(null==M?void 0:M.product_variation_status)==1?null==M?void 0:null===(l=M.product_variants[T])||void 0===l?void 0:l.regular_price:null==M?void 0:M.regular_price,sellingPrice:(null==M?void 0:M.product_variation_status)==1?null==M?void 0:null===(i=M.product_variants[T])||void 0===i?void 0:i.sale_price:null==M?void 0:M.sale_price,quantity:D,variations:(null==M?void 0:M.product_variation_status)==1&&H?null==M?void 0:null===(s=M.product_variants[T])||void 0===s?void 0:s.product_variant_name:null,stock:(null==M?void 0:M.product_variation_status)==1?null==M?void 0:null===(a=M.product_variants[T])||void 0===a?void 0:a.qty:null==M?void 0:M.qty,discount:(null==M?void 0:M.product_variation_status)==1?null==M?void 0:null===(r=M.product_variants[T])||void 0===r?void 0:r.discount:null==M?void 0:M.discount,sale_unit_id:null==M?void 0:M.unit_id,discount_type:(null==M?void 0:M.product_variation_status)==1?null==M?void 0:null===(n=M.product_variants[T])||void 0===n?void 0:n.discount_type:null==M?void 0:M.discount_type},p={currency:"BDT",customer_phone:G,items:[{item_id:null==M?void 0:M.sku,item_name:null==M?void 0:M.product_name,item_brand:(null==M?void 0:null===(o=M.brands)||void 0===o?void 0:o.length)?null==M?void 0:null===(d=M.brands[0])||void 0===d?void 0:d.name:"",item_category:(null==M?void 0:null===(c=M.categories)||void 0===c?void 0:c.length)?null==M?void 0:M.categories[0]:"",item_variant:Q||null,price:Q?null==O?void 0:O.sale_price:null==M?void 0:M.sale_price,quantity:D}]},v=V.find(t=>t.product_id==e.product_id&&t.variant_id==e.variant_id);if(v){let t=V.findIndex(e=>(null==e?void 0:e.product_id)==v.product_id&&e.variant_id==v.variant_id);(null==M?void 0:M.product_variation_status)==1?V[t].quantity+(null==e?void 0:e.quantity)<=(null==M?void 0:null===(u=M.product_variants[T])||void 0===u?void 0:u.qty)?(V[t].quantity+=D,R(V),(0,f.setCookie)(null,"parisBd",JSON.stringify(V),{maxAge:2592e3,path:"/"}),window.dataLayer=window.dataLayer||[],dataLayer.push({event:"add_to_cart",ecommerce:p}),J(!0)):k.Am.error("Out of stock"):V[t].quantity+(null==e?void 0:e.quantity)<=(null==M?void 0:M.qty)?(V[t].quantity+=D,R(V),(0,f.setCookie)(null,"parisBd",JSON.stringify(V),{maxAge:2592e3,path:"/"}),window.dataLayer=window.dataLayer||[],dataLayer.push({event:"add_to_cart",ecommerce:p}),J(!0)):k.Am.error("Out of stock")}void 0===v&&((null==M?void 0:M.product_variation_status)==1?(null==M?void 0:null===(x=M.product_variants[T])||void 0===x?void 0:x.qty)>0?(R(t=>[...t,e]),(0,f.setCookie)(null,"parisBd",JSON.stringify([...V,e]),{maxAge:2592e3,path:"/"}),window.dataLayer=window.dataLayer||[],dataLayer.push({event:"add_to_cart",ecommerce:p}),J(!0)):k.Am.error("Out of stock"):(null==M?void 0:M.qty)>0?(R(t=>[...t,e]),(0,f.setCookie)(null,"parisBd",JSON.stringify([...V,e]),{maxAge:2592e3,path:"/"}),window.dataLayer=window.dataLayer||[],dataLayer.push({event:"add_to_cart",ecommerce:p}),J(!0)):k.Am.error("Out of stock"))}else{let t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"}),k.Am.error("Please select a size")}},eo=e=>{var t,l,i,s,a,r,n,o,d,c,u,x;if((null==M?void 0:M.product_variation_status)==1&&!0==P||(null==M?void 0:M.product_variation_status)==0){let e={product_id:null==M?void 0:M.id,slug:null==M?void 0:M.slug,variant_id:(null==M?void 0:M.product_variation_status)==1?H:null,name:null==M?void 0:M.product_name,image:(null==M?void 0:M.product_variation_status)==1?null==M?void 0:null===(t=M.product_variants[T])||void 0===t?void 0:t.image[0]:null==M?void 0:M.image[0],regularPrice:(null==M?void 0:M.product_variation_status)==1?null==M?void 0:null===(l=M.product_variants[T])||void 0===l?void 0:l.regular_price:null==M?void 0:M.regular_price,sellingPrice:(null==M?void 0:M.product_variation_status)==1?null==M?void 0:null===(i=M.product_variants[T])||void 0===i?void 0:i.sale_price:null==M?void 0:M.sale_price,quantity:D,variations:(null==M?void 0:M.product_variation_status)==1&&H?null==M?void 0:null===(s=M.product_variants[T])||void 0===s?void 0:s.product_variant_name:null,stock:(null==M?void 0:M.product_variation_status)==1?null==M?void 0:null===(a=M.product_variants[T])||void 0===a?void 0:a.qty:null==M?void 0:M.qty,discount:(null==M?void 0:M.product_variation_status)==1?null==M?void 0:null===(r=M.product_variants[T])||void 0===r?void 0:r.discount:null==M?void 0:M.discount,sale_unit_id:null==M?void 0:M.unit_id,discount_type:(null==M?void 0:M.product_variation_status)==1?null==M?void 0:null===(n=M.product_variants[T])||void 0===n?void 0:n.discount_type:null==M?void 0:M.discount_type},p={currency:"BDT",customer_phone:G,items:[{item_id:null==M?void 0:M.sku,item_name:null==M?void 0:M.product_name,item_brand:(null==M?void 0:null===(o=M.brands)||void 0===o?void 0:o.length)?null==M?void 0:null===(d=M.brands[0])||void 0===d?void 0:d.name:"",item_category:(null==M?void 0:null===(c=M.categories)||void 0===c?void 0:c.length)?null==M?void 0:M.categories[0]:"",item_variant:Q||null,price:Q?null==O?void 0:O.sale_price:null==M?void 0:M.sale_price,quantity:D}]},v=V.find(t=>t.product_id==e.product_id&&t.variant_id==e.variant_id);if(v){let t=V.findIndex(e=>(null==e?void 0:e.product_id)==v.product_id&&e.variant_id==v.variant_id);(null==M?void 0:M.product_variation_status)==1?V[t].quantity+(null==e?void 0:e.quantity)<=(null==M?void 0:null===(u=M.product_variants[T])||void 0===u?void 0:u.qty)?(V[t].quantity+=D,R(V),(0,f.setCookie)(null,"parisBd",JSON.stringify(V),{maxAge:2592e3,path:"/"}),window.dataLayer=window.dataLayer||[],dataLayer.push({event:"add_to_cart",ecommerce:p}),F.push("/checkout")):k.Am.error("Out of stock"):V[t].quantity+(null==e?void 0:e.quantity)<=(null==M?void 0:M.qty)?(V[t].quantity+=D,R(V),(0,f.setCookie)(null,"parisBd",JSON.stringify(V),{maxAge:2592e3,path:"/"}),window.dataLayer=window.dataLayer||[],dataLayer.push({event:"add_to_cart",ecommerce:p}),F.push("/checkout")):k.Am.error("Out of stock")}void 0===v&&((null==M?void 0:M.product_variation_status)==1?(null==M?void 0:null===(x=M.product_variants[T])||void 0===x?void 0:x.qty)>0?(R(t=>[...t,e]),(0,f.setCookie)(null,"parisBd",JSON.stringify([...V,e]),{maxAge:2592e3,path:"/"}),window.dataLayer=window.dataLayer||[],dataLayer.push({event:"add_to_cart",ecommerce:p}),k.Am.success("Product Added"),F.push("/checkout")):k.Am.error("Out of Stock"):(null==M?void 0:M.qty)>0?(R(t=>[...t,e]),(0,f.setCookie)(null,"parisBd",JSON.stringify([...V,e]),{maxAge:2592e3,path:"/"}),window.dataLayer=window.dataLayer||[],dataLayer.push({event:"add_to_cart",ecommerce:p}),k.Am.success("Product Added"),F.push("/checkout")):k.Am.error("Out of stock"))}else{let t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"}),k.Am.error("Please select a size")}},ed=(e,t)=>{X(e),K(t),W(!0)},ec=()=>{(null==M?void 0:M.product_variation_status)==1&&null==O&&(null==Q?void 0:Q.length)>0&&k.Am.error("There is no product in this variation")};(0,s.useEffect)(()=>{var e;(null==M?void 0:M.product_variation_status)==1?el(null==M?void 0:null===(e=M.product_variants)||void 0===e?void 0:e.reduce((e,t)=>e+(null==t?void 0:t.qty),0)):el(null==M?void 0:M.qty)},[M]),(0,s.useEffect)(()=>{let e=async()=>{let e=await (0,m.Z)("wishlists-count");(null==e?void 0:e.status)?U(null==e?void 0:e.wishlist_count):U(0)};Y&&e()},[ea]);let eu=async()=>{if(!Y){k.Am.warning("Login First");return}let e={product_id:null==M?void 0:M.id},t=await (0,v.Z)("add-to-wishlist",e);t.status&&(es(0==ei?1:0),er(!ea),k.Am.success(null==t?void 0:t.message))};return(0,i.jsxs)("div",{className:"col-span-1 border rounded-r-md shadow-md p-3",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between gap-5 xs:gap-2 xms:gap-2 xls:gap-2 sm:gap-3 border-b border-gray-300 py-1",children:[(0,i.jsx)("div",{className:"text-[20px] font-bold xs:text-[14px] xms:text-[14px] xls:text-[14px] sm:text-[16px]",children:null==M?void 0:M.product_name}),(0,i.jsxs)("div",{className:"flex flex-row gap-3",children:[(0,i.jsx)("div",{className:"border border-tahiti-500 p-[10px] rounded-lg cursor-pointer",children:(0,i.jsx)("div",{className:"relative",children:(0,i.jsx)(N.kIM,{onClick:()=>eu(),className:" text-[24px] text-tahiti-500 "})})}),(0,i.jsx)("div",{className:"border border-tahiti-500 p-[10px] rounded-lg cursor-pointer",children:1==ei?(0,i.jsx)("div",{className:"relative",children:(0,i.jsx)(b.$0H,{onClick:()=>eu(),className:" text-[24px] text-tahiti-500 "})}):(0,i.jsx)("div",{className:"relative",children:(0,i.jsx)(y.$aX,{onClick:()=>eu(),className:" text-[24px] text-tahiti-500 "})})})]})]}),(0,i.jsxs)("div",{className:" border-b border-gray-300 py-3 flex xls:block xms:block xs:block justify-between items-center",children:[(0,i.jsxs)("div",{className:"text-[20px] font-normal flex flow-row ",children:[(0,i.jsx)("span",{className:"text-tahiti-500 py-5",children:"Brand:"}),(0,i.jsx)(g(),{href:"/brand/".concat(null==M?void 0:null===(t=M.brands)||void 0===t?void 0:t.slug),className:"h-full group",children:(0,i.jsx)(n(),{className:"object-fill rounded pl-8",src:(null==M?void 0:null===(l=M.brands)||void 0===l?void 0:l.image)?"".concat(a.Z.ImageHostName,"/storage/brands/").concat(null==M?void 0:null===(r=M.brands)||void 0===r?void 0:r.image):"/assets/placeholder_600x.webp",width:100,height:30,alt:"".concat(null==M?void 0:null===(o=M.brands)||void 0===o?void 0:o.name),onError:e=>{e.target.src="/assets/placeholder_600x.webp"}})})]}),(null==M?void 0:M.campaign_name)?(0,i.jsxs)(g(),{href:"/campaign-products/".concat(null==M?void 0:M.campaign_slug),children:[" ",(0,i.jsx)("span",{className:"text-black ",children:"Campaign name:"}),(0,i.jsx)("span",{className:"text-tahiti-500",children:null==M?void 0:M.campaign_name})]}):(0,i.jsx)("div",{className:"grow "}),(0,i.jsxs)("div",{className:"text-[16px]  font-normal py-5",children:["Made In ",null==M?void 0:null===(d=M.made_in_country)||void 0===d?void 0:d.name]})]}),(0,i.jsxs)("div",{className:"flex  items-center justify-between gap-2 py-4 border-b border-gray-300",children:[(0,i.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,i.jsxs)("div",{className:"text-[20px] xls:text-xs xms:text-xs xs:text-xs font-bold",children:["TK.",(null==M?void 0:M.product_variation_status)==0?(0,i.jsx)(i.Fragment,{children:(null==M?void 0:M.regular_price)==(null==M?void 0:M.sale_price)?(0,i.jsx)("span",{children:(null==M?void 0:M.regular_price)*D}):(0,i.jsx)("span",{className:"line-through",children:null==M?void 0:M.regular_price})}):(0,i.jsx)(i.Fragment,{children:(null==M?void 0:null===(c=M.product_variants[T])||void 0===c?void 0:c.regular_price)==(null==M?void 0:null===(u=M.product_variants[T])||void 0===u?void 0:u.sale_price)?(0,i.jsx)("span",{children:(null==M?void 0:null===(x=M.product_variants[T])||void 0===x?void 0:x.regular_price)*D}):(0,i.jsx)("span",{className:"line-through",children:null==M?void 0:null===(h=M.product_variants[T])||void 0===h?void 0:h.regular_price})})]}),(null==M?void 0:M.product_variation_status)==0?(0,i.jsx)(i.Fragment,{children:(null==M?void 0:M.sale_price)==(null==M?void 0:M.regular_price)?null:(0,i.jsx)("div",{className:"text-[20px] xls:text-xs xms:text-xs xs:text-xs font-bold",children:(0,i.jsx)("span",{className:"pl-2",children:null==M?void 0:M.sale_price})})}):(0,i.jsx)(i.Fragment,{children:(null==M?void 0:null===(C=M.product_variants[T])||void 0===C?void 0:C.sale_price)==(null==M?void 0:null===(S=M.product_variants[T])||void 0===S?void 0:S.regular_price)?null:(0,i.jsx)("div",{className:"text-[20px] xls:text-xs xms:text-xs xs:text-xs font-bold",children:(0,i.jsx)("span",{className:"pl-2",children:null==M?void 0:null===(I=M.product_variants[T])||void 0===I?void 0:I.sale_price})})})]}),(0,i.jsxs)("div",{className:"flex  items-center gap-3  mt-4",children:[(0,i.jsxs)("div",{className:" flex  items-center justify-center ",children:[(0,i.jsx)("button",{onClick:()=>Z(D>1?D-1:1),className:"bg-gray-700 rounded-sm text-[18px] text-white w-[40px] h-[40px] font-extrabold ",children:"-"}),(0,i.jsx)("input",{value:D,className:" outline-none w-[60px] xls:w-[40px] xms:w-[40px] xs:w-[30px]  h-[40px] text-center border-t-[2px] border-b-[2px] border-tahiti-500",readOnly:!0}),(0,i.jsx)("button",{onClick:()=>{var e;return(null==M?void 0:M.product_variation_status)==1?null!==H?D<(null==M?void 0:null===(e=M.product_variants[T])||void 0===e?void 0:e.qty)?Z(e=>e+1):k.Am.error("You cant add more than product!"):k.Am.error("Must select variation !"):D<(null==M?void 0:M.qty)?Z(e=>e+1):k.Am.error("You cant add more than product!")},className:"bg-tahiti-500 rounded-sm text-[18px] text-white w-[40px] h-[40px] font-extrabold",children:"+"})]}),(0,i.jsxs)("div",{className:"flex space-x-2 items-center xls:hidden xms:hidden xs:hidden",children:[0==et?(0,i.jsx)("div",{className:" text-red-500 xls:text-xs xms:text-xs xs:text-xs py-1",children:"Out of stock"}):(0,i.jsx)("div",{className:" text-red-500 xls:text-xs xms:text-xs xs:text-xs py-1",children:"(In stock)"}),0==et?(0,i.jsx)("div",{className:"uppercase  text-white  bg-[#DE606B] text-xs py-2 cursor-pointer rounded-full px-2",onClick:()=>ed(null==M?void 0:M.slug,null==M?void 0:M.id),children:"request stock"}):null]})]}),(null==M?void 0:M.product_variation_status)==0?(0,i.jsx)(i.Fragment,{children:(null==M?void 0:M.sale_price)==(null==M?void 0:M.regular_price)?null:(0,i.jsx)("div",{className:"text-[20px] xls:text-sm xms:text-sm xs:text-sm font-bold",children:(0,i.jsx)("span",{className:"pl-2",children:(null==M?void 0:M.sale_price)*D})})}):(0,i.jsx)(i.Fragment,{children:(null==M?void 0:null===(A=M.product_variants[T])||void 0===A?void 0:A.sale_price)==(null==M?void 0:null===(L=M.product_variants[T])||void 0===L?void 0:L.regular_price)?null:(0,i.jsx)("div",{className:"text-[20px] xls:text-sm xms:text-sm xs:text-sm font-bold",children:(0,i.jsx)("span",{className:"pl-2",children:(null==M?void 0:null===(q=M.product_variants[T])||void 0===q?void 0:q.sale_price)*D})})})]}),(0,i.jsxs)("div",{className:" hidden xls:block xms:block xs:block",children:[0==et?(0,i.jsx)("div",{className:" text-red-500 xls:text-xs xms:text-xs xs:text-xs py-1",children:"Out of stock"}):(0,i.jsx)("div",{className:" text-red-500 xls:text-xs xms:text-xs xs:text-xs py-1",children:"(In stock)"}),0==et?(0,i.jsx)("button",{className:"bg-[#DE606B] uppercase  text-white   text-xs py-2 cursor-pointer rounded-full px-2",onClick:()=>ed(null==M?void 0:M.slug,null==M?void 0:M.id),children:"request stock"}):null]}),(0,i.jsx)("div",{children:(null==M?void 0:null===(B=M.product_variants)||void 0===B?void 0:B.length)>0&&(0,i.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 xls:grid-cols-2 xms:grid-cols-2 xs:grid-cols-2 py-1 w-[60%] md:w-[70%] sm:w-[75%] xls:w-full xms:w-full xs:w-full gap-4",children:null==M?void 0:null===(E=M.product_variants)||void 0===E?void 0:E.map((e,t)=>(0,i.jsx)("div",{children:!1==P?(0,i.jsx)("button",{className:"bg-gray-300 text-black\n                    px-2 py-2 w-full rounded-md cursor-pointer",onClick:()=>z(null==e?void 0:e.id,t),children:(0,i.jsx)("div",{className:" xls:text-xs xms:text-xs xs:text-xs",children:null==e?void 0:e.product_variant_name})}):(0,i.jsx)("button",{className:"".concat((null==e?void 0:e.id)==H?"bg-tahiti-500 text-white":"bg-gray-300 text-black"," px-2 py-2 rounded-md cursor-pointer w-full"),onClick:()=>z(null==e?void 0:e.id,t),children:(0,i.jsx)("div",{className:" xls:text-xs xms:text-xs xs:text-xs",children:null==e?void 0:e.product_variant_name})})},t))})}),(0,i.jsxs)("div",{className:"border-b border-gray-300 py-1",children:[(0,i.jsx)("div",{className:"grid grid-cols-2 py-1 gap-3",children:(null==M?void 0:M.product_variation_status)==1&&null==O&&(null==Q?void 0:Q.length)>0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{onClick:()=>ec(),className:"bg-gray-900 flex items-center justify-center col-span-1 py-3 rounded-md cursor-pointer hover:bg-[#A42E41]",children:[(0,i.jsx)(j.nxQ,{className:"text-white text-[20px] mr-4"}),(0,i.jsx)("div",{className:"text-white font-bold text-[14px] xs:text-[12px]",children:"Add To Cart"})]}),(0,i.jsxs)("div",{onClick:()=>ec(),className:"bg-[#ef486a] flex items-center justify-center col-span-1 py-3 rounded-md cursor-pointer hover:bg-tahiti-500",children:[(0,i.jsx)(w.EIo,{className:"text-white text-[20px] mr-4"}),(0,i.jsx)("div",{className:"text-white font-bold text-[14px] xs:text-[12px]",children:"Buy Now"})]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{onClick:()=>en("variation"),className:"bg-gray-900 flex items-center justify-center col-span-1 py-3 rounded-md cursor-pointer hover:bg-[#A42E41]",children:[(0,i.jsx)(j.nxQ,{className:"text-white text-[20px] mr-4"}),(0,i.jsx)("div",{className:"text-white font-bold text-[14px] xs:text-[12px]",children:"Add To Cart"})]}),(0,i.jsxs)("div",{onClick:()=>eo("variation"),className:"bg-[#ef486a] flex items-center justify-center col-span-1 py-3 rounded-md cursor-pointer hover:bg-tahiti-500",children:[(0,i.jsx)(w.EIo,{className:"text-white text-[20px] mr-4"}),(0,i.jsx)("div",{className:"text-white font-bold text-[14px] xs:text-[12px]",children:"Buy Now"})]})]})}),(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[(0,i.jsxs)("div",{className:"flex items-center px-2 py-2 gap-10 xs:gap-2 xms:gap-3 xls:gap-4 sm:gap-5",children:[(0,i.jsx)(n(),{src:"/assets/category/cash_on_delivery.webp",width:40,height:40,alt:"cash"}),(0,i.jsx)("div",{className:"text-[14px]",children:"Cash On Delivery Available"})]}),(0,i.jsxs)("div",{className:"flex items-center px-2 py-2 gap-10  xs:gap-2 xms:gap-3 xls:gap-4 sm:gap-5",children:[(0,i.jsx)(n(),{src:"/assets/category/policy.webp",width:40,height:40,alt:"policy"}),(0,i.jsx)("div",{className:"text-[14px]",children:"View Policy"})]})]})]}),(0,i.jsxs)("div",{className:"py-3 flex  items-center gap-4",children:[(0,i.jsx)("div",{className:"text-[12px]",children:"Share to:"}),(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(g(),{href:"".concat(null==$?void 0:$.facebook),target:"_blank",className:"px-2",children:(0,i.jsx)(n(),{src:"/assets/category/facebook.svg",width:30,height:30,alt:"logo"})}),(0,i.jsx)(g(),{href:"".concat(null==$?void 0:$.instagram_link),target:"_blank",className:"px-2",children:(0,i.jsx)(n(),{src:"/assets/category/instagram.svg",width:30,height:30,alt:"logo"})}),(0,i.jsx)(g(),{href:"".concat(null==$?void 0:$.whatsapp_link),target:"_blank",className:"px-2",children:(0,i.jsx)(n(),{src:"/assets/slider/whatsapp.webp",width:30,height:30,alt:"logo"})}),(0,i.jsx)(g(),{href:"".concat(null==$?void 0:$.twitter_link),target:"_blank",className:"px-2",children:(0,i.jsx)(n(),{src:"/assets/slider/twitter.webp",width:30,height:30,alt:"logo"})}),(0,i.jsx)(g(),{href:"".concat(null==$?void 0:$.tiktok_link),target:"_blank",className:"px-2",children:(0,i.jsx)(n(),{src:"/assets/category/tiktok.svg",width:30,height:30,alt:"logo"})})]})]})]})},S=l(1312),I=l(9008),A=l.n(I),L=!0,q=e=>{var t,l,r;let{data:n}=e,[o,d]=(0,s.useState)(1);(0,_.useRouter)();let[c,v]=(0,s.useState)(null),[h,g]=(0,s.useState)([]),[f,j]=(0,s.useState)([]),[w,b]=(0,s.useState)(null),[y,N]=(0,s.useState)(0),[k,I]=(0,s.useState)(!1),{phone:L}=(0,p.$)(),[q,B]=(0,s.useState)(0),E=(e,t)=>{b(e),N(t),I(!0)};return(0,s.useEffect)(()=>{if(n){let e=async()=>{let e=await (0,m.Z)("similar-products/".concat(null==n?void 0:n.id));g(null==e?void 0:e.more_products_from_brand),j(null==e?void 0:e.you_may_also_like)};e()}},[n]),(0,s.useEffect)(()=>{var e;(null==n?void 0:n.product_variation_status)==1?b(null==n?void 0:null===(e=n.product_variants[y])||void 0===e?void 0:e.id):b(null)},[n,y]),(0,s.useEffect)(()=>{var e,t,l,i,s,a,r;if((null==n?void 0:n.product_variation_status)==1){let s={currency:"BDT",customer_phone:L,items:[{item_id:null==n?void 0:n.sku,item_name:null==n?void 0:n.product_name,item_brand:(null==n?void 0:null===(e=n.brands)||void 0===e?void 0:e.length)?null==n?void 0:null===(t=n.brands[0])||void 0===t?void 0:t.name:"",item_category:(null==n?void 0:null===(l=n.categories)||void 0===l?void 0:l.length)?null==n?void 0:n.categories[0]:"",item_variant:(null==n?void 0:n.product_variation_status)==1?null==n?void 0:n.product_variants:"",price:null==n?void 0:null===(i=n.product_variants[0])||void 0===i?void 0:i.sale_price,quantity:1}]};window.dataLayer=window.dataLayer||[],dataLayer.push({event:"product_view",ecommerce:s})}else{let e={currency:"BDT",customer_phone:L,items:[{item_id:null==n?void 0:n.sku,item_name:null==n?void 0:n.product_name,item_brand:(null==n?void 0:null===(s=n.brands)||void 0===s?void 0:s.length)?null==n?void 0:null===(a=n.brands[0])||void 0===a?void 0:a.name:"",item_category:(null==n?void 0:null===(r=n.categories)||void 0===r?void 0:r.length)?null==n?void 0:n.categories[0]:"",price:null==n?void 0:n.sale_price,quantity:1}]};window.dataLayer=window.dataLayer||[],dataLayer.push({event:"product_view",ecommerce:e})}},[n]),(0,s.useEffect)(()=>{var e;(null==n?void 0:n.product_variation_status)==1?B(null==n?void 0:null===(e=n.product_variants)||void 0===e?void 0:e.reduce((e,t)=>e+(null==t?void 0:t.qty),0)):B(null==n?void 0:n.qty)},[n]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(A(),{children:[(0,i.jsx)("title",{children:"".concat(null==n?void 0:n.product_name)}),(0,i.jsx)("link",{rel:"icon",href:"/favicon.png"}),(0,i.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,i.jsx)("meta",{name:"robots",content:"index,follow"}),(0,i.jsx)("meta",{name:"url",content:"https://worldbrandbd.com/products/".concat(null==n?void 0:n.slug)}),(0,i.jsx)("link",{rel:"canonical",href:"https://worldbrandbd.com/products/".concat(null==n?void 0:n.slug)}),(0,i.jsx)("meta",{name:"description",content:"".concat(null==n?void 0:n.product_name)}),(0,i.jsx)("meta",{property:"product:availability",content:"".concat(0==q?"out of stock":"in stock")}),(0,i.jsx)("meta",{property:"og:site_name",content:"WorldBrandBD"}),(0,i.jsx)("meta",{property:"og:title",content:"".concat(null==n?void 0:n.product_name)}),(0,i.jsx)("meta",{property:"og:description",content:"".concat(null==n?void 0:n.product_name)}),(0,i.jsx)("meta",{property:"og:url",content:"https://worldbrandbd.com/products/".concat(null==n?void 0:n.slug)}),(0,i.jsx)("meta",{property:"og:type",content:"product"}),(0,i.jsx)("meta",{property:"product:condition",content:"new"}),(0,i.jsx)("meta",{property:"product:price:currency",content:"BDT"}),(0,i.jsx)("meta",{property:"product:price:amount",content:"".concat(null==n?void 0:n.sale_price)}),(null==n?void 0:null===(t=n.image)||void 0===t?void 0:t.length)>0?(0,i.jsx)("meta",{property:"og:image",content:"".concat(a.Z.ImageHostName,"/storage/product/").concat(null==n?void 0:n.image[0])}):null,(0,i.jsx)("meta",{property:"og:url",href:"https://worldbrandbd.com/products/".concat(null==n?void 0:n.slug)}),(0,i.jsx)("meta",{property:"product:retailer_item_id",content:"".concat(null==n?void 0:n.sku)}),(0,i.jsx)("meta",{property:"og:type",content:"website"}),(0,i.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:'{\n      "@context": "https://schema.org",\n      "@type": "Product",\n      "name": "'.concat(null==n?void 0:n.product_name,'",\n      "url": "https://worldbrandbd.com/products/').concat(null==n?void 0:n.slug,'",\n      "image": "').concat(a.Z.ImageHostName,"/storage/product/").concat((null==n?void 0:null===(r=n.image)||void 0===r?void 0:r.length)>0&&(null==n?void 0:n.image[0]),'",\n      "description": "').concat(null==n?void 0:n.product_name,'",\n      "sku": "').concat(null==n?void 0:n.sku,'",\n      \n    }\n  ')}},"product-jsonld")]}),(0,i.jsx)("div",{className:"min-h-screen pt-[170px] xs:pt-[165px] xms:pt-[165px] xls:pt-[165px] sm:pt-[175px]",children:(0,i.jsx)("div",{className:"max-w-[95rem] lg:max-w-[70rem] md:max-w-[60rem] sm:max-w-[45rem] xls:max-w-[22rem] xms:max-w-[20rem] xs:max-w-[18rem] mx-auto tracking-[0.4px]",children:(0,i.jsxs)("div",{className:"px-2",children:[(0,i.jsxs)("div",{className:"grid grid-cols-2 xs:grid-cols-1 xms:grid-cols-1 xls:grid-cols-1 sm:grid-cols-1",children:[(0,i.jsx)(u,{data:n,variationId:w,selectedIndex:y,handleImageClick:e=>{N(e)},handleVariationImageClick:E,setSelectedIndex:N,clickFlag:k,setClickFlag:I}),(0,i.jsx)(C,{data:n,selectedItem:c,setSelectedItem:v,variationId:w,setVariationId:b,selectedIndex:y,clickFlag:k,handleVariationImageClick:E})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"mt-3 rounded-sm",children:[(0,i.jsxs)("div",{className:"py-3 flex gap-3 items-center xs:flex-wrap xms:flex-wrap xls:flex-wrap ",children:[(0,i.jsx)("div",{children:(0,i.jsx)("button",{onClick:()=>d(1),className:"py-2 px-4 border ".concat(1==o?" bg-tahiti-500 text-white":"text-black"," border-tahiti-500 rounded-md text-[18px] font-semibold xs:text-[12px] xs:px-2 xms:text-[12px] xms:px-2 xls:text-[12px] xls:px-2 sm:text-[12px] sm:px-2"),children:"Benefits"})}),(0,i.jsx)("div",{children:(0,i.jsx)("button",{onClick:()=>d(2),className:"py-2 px-4 border ".concat(2==o?" bg-tahiti-500 text-white":" text-black"," border-tahiti-500 rounded-md text-[18px] font-semibold xs:text-[12px] xs:px-2 xms:text-[12px] xms:px-2 xls:text-[12px] xls:px-2 sm:text-[12px] sm:px-2"),children:"Description"})}),(0,i.jsx)("div",{children:(0,i.jsx)("button",{onClick:()=>d(3),className:"py-2 px-4 border ".concat(3==o?" bg-tahiti-500 text-white":"text-black"," border-tahiti-500 rounded-md text-[18px] font-semibold xs:text-[12px] xs:px-2 xms:text-[12px] xms:px-2 xls:text-[12px] xls:px-2 sm:text-[12px] sm:px-2"),children:"How to use"})}),(0,i.jsx)("div",{children:(0,i.jsx)("button",{onClick:()=>d(4),className:"py-2 px-4 border ".concat(4==o?" bg-tahiti-500 text-white":"text-black"," border-tahiti-500 rounded-md text-[18px] font-semibold xs:text-[12px] xs:px-2 xms:text-[12px] xms:px-2 xls:text-[12px] xls:px-2 sm:text-[12px] sm:px-2"),children:"Ingredient"})}),(0,i.jsx)("div",{children:(0,i.jsx)("button",{onClick:()=>d(5),className:"py-2 px-4 border ".concat(5==o?" bg-tahiti-500 text-white":"text-black"," border-tahiti-500 rounded-md text-[18px] font-semibold xs:text-[12px] xs:px-2 xms:text-[12px] xms:px-2 xls:text-[12px] xls:px-2 sm:text-[12px] sm:px-2"),children:"Reviews"})})]}),(0,i.jsx)("div",{className:"bg-white  py-3 px-2 xs:px-2 xms:px-2 xls:px-2",children:3==o?(0,i.jsx)("div",{className:" ",children:(0,i.jsx)("span",{className:"text-black",dangerouslySetInnerHTML:{__html:null==n?void 0:n.guide_line}})}):2==o?(0,i.jsx)("div",{className:"overflow-hidden",children:(0,i.jsx)("span",{className:"text-black",dangerouslySetInnerHTML:{__html:null==n?void 0:n.description}})}):1==o?(0,i.jsx)("div",{className:"overflow-hidden",children:(0,i.jsx)("span",{className:"text-black",dangerouslySetInnerHTML:{__html:null==n?void 0:n.benefits}})}):4==o?(0,i.jsx)("div",{className:"overflow-hidden",children:(0,i.jsx)("span",{className:"text-black",dangerouslySetInnerHTML:{__html:null==n?void 0:n.ingredient}})}):(0,i.jsx)("div",{className:"overflow-hidden",children:(null==n?void 0:null===(l=n.reviews)||void 0===l?void 0:l.length)>0?(0,i.jsx)(i.Fragment,{children:null==n?void 0:n.reviews.map((e,t)=>{var l;return(0,i.jsxs)("div",{className:"border-b py-1",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[(0,i.jsx)("div",{className:"text-[12px] text-gray-600",children:"Rating:"}),(0,i.jsx)("div",{children:(0,i.jsx)(S.Z,{count:5,value:null==e?void 0:e.star,edit:!1,size:20,activeColor:"#ffd700"})}),(0,i.jsxs)("div",{className:"text-[12px] text-gray-600",children:["(",null==e?void 0:null===(l=e.user)||void 0===l?void 0:l.name,")"]})]}),(0,i.jsx)("div",{className:"text-[12px] text-gray-600",children:null==e?void 0:e.review_date})]}),(0,i.jsxs)("div",{className:"text-[12px] font-semibold",children:[" ",null==e?void 0:e.description]})]},t)})}):(0,i.jsx)("span",{className:"text-black",children:"NO reviews yet"})})})]}),(0,i.jsxs)("div",{className:"py-2 text-[13px]",children:[(0,i.jsx)("span",{className:"text-tahiti-500 text-[13px]",children:"Disclaimer:"}),(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:null==n?void 0:n.disclaimer}})]})]}),(null==h?void 0:h.length)>0&&(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"py-5 flex items-center justify-between",children:(0,i.jsxs)("div",{className:"text-[18px] font-semibold border-b cursor-pointer xs:text-[14px] xms:text-[14px] xls:text-[14px] sm:text-[16px]",children:["More Products from this Brand"," ",(0,i.jsxs)("span",{className:"text-[14px] font-medium text-gray-500 xs:text-[10px] xms:text-[10px] xls:text-[10px] sm:text-[12px]",children:[" ","Check & Get Your Desired Product"]})]})}),(0,i.jsx)("div",{children:(0,i.jsx)(x.Z,{productList:h})})]}),(null==f?void 0:f.length)>0&&(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"py-5 flex items-center justify-between",children:(0,i.jsxs)("div",{className:"text-[18px] font-semibold border-b cursor-pointer xs:text-[14px] xms:text-[14px] xls:text-[14px] sm:text-[16px]",children:["You May Like"," ",(0,i.jsxs)("span",{className:"text-[14px] font-medium text-gray-500 xs:text-[10px] xms:text-[10px] xls:text-[10px] sm:text-[12px]",children:[" ","Check & Get Your Desired Product"]})]})}),(0,i.jsx)("div",{children:(0,i.jsx)(x.Z,{productList:f})})]})]})})})]})}},4955:function(e,t,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var l=[],i=!0,s=!1,a=void 0;try{for(var r,n=e[Symbol.iterator]();!(i=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{!i&&n.return&&n.return()}finally{if(s)throw a}}return l}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")};t.default=function(e){var t=i((0,s.useState)(e.count),2),l=t[0],a=t[1],r=i((0,s.useState)(e.size),2),n=r[0],o=r[1],d=i((0,s.useState)(e.char),2),c=d[0],u=d[1],x=i((0,s.useState)(e.color),2),p=x[0],v=x[1],m=i((0,s.useState)(e.activeColor),2),h=m[0],g=m[1],_=i((0,s.useState)(e.isHalf),2),f=_[0],j=_[1],w=i((0,s.useState)(e.edit),2),b=w[0],y=w[1],N=i((0,s.useState)(e.emptyIcon),2),k=N[0],C=N[1],S=i((0,s.useState)(e.halfIcon),2),I=S[0],A=S[1],L=i((0,s.useState)(e.filledIcon),2),q=L[0],B=L[1],E=i((0,s.useState)(e.a11y),2),M=E[0],O=E[1];return[{count:l,size:n,char:c,color:p,activeColor:h,isHalf:f,edit:b,emptyIcon:k,halfIcon:I,filledIcon:q,a11y:M},function(e){a(e.count),o(e.size),u(e.char),v(e.color),g(e.activeColor),j(e.isHalf),y(e.edit),C(e.emptyIcon),A(e.halfIcon),B(e.filledIcon),O(e.a11y)}]};var s=l(7294)},1312:function(e,t,l){"use strict";var i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var l=[],i=!0,s=!1,a=void 0;try{for(var r,n=e[Symbol.iterator]();!(i=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{!i&&n.return&&n.return()}finally{if(s)throw a}}return l}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},s=l(7294),a=d(s),r=d(l(5697)),n=d(l(4955)),o=d(l(7719));function d(e){return e&&e.__esModule?e:{default:e}}var c={overflow:"hidden",position:"relative"};function u(e){var t=i((0,s.useState)(""),2),l=t[0],r=t[1],d=i((0,s.useState)(0),2),u=d[0],x=d[1],p=i((0,s.useState)([]),2),v=p[0],m=p[1],h=i((0,s.useState)(!1),2),g=h[0],_=h[1],f=i((0,n.default)(e),2),j=f[0],w=f[1],b=i((0,s.useState)(0),2),y=b[0],N=b[1],k=i((0,s.useState)(!1),2),C=k[0],S=k[1],I=i((0,s.useState)(""),2),A=I[0],L=I[1];function q(e){void 0===e&&(e=j.isHalf?Math.floor(u):Math.round(u));for(var t=[],l=0;l<j.count;l++)t.push({active:l<=e-1});return t}function B(e){if(j.edit){var t,l=Number(e.currentTarget.getAttribute("data-index"));if(j.isHalf){var i=E(e);S(i),i&&(l+=1),N(l)}else l+=1;(t=l)!==v.filter(function(e){return e.active}).length&&m(q(t))}}function E(e){var t=e.target.getBoundingClientRect(),l=e.clientX-t.left;return(l=Math.round(Math.abs(l)))>t.width/2}function M(){j.edit&&(O(u),m(q()))}function O(e){j.isHalf&&(S(e%1==0),N(Math.floor(e)))}function H(e){if(j.edit){var t=Number(e.currentTarget.getAttribute("data-index")),l=void 0;if(j.isHalf){var i=E(e);S(i),i&&(t+=1),l=i?t:t+.5,N(t)}else l=t+=1;T(l)}}function T(t){t!==u&&(m(q(t)),x(t),e.onChange(t))}return(0,s.useEffect)(function(){var t,l;L(e.classNames+" react-stars"),t=e.value,l=e.count,t<0||t>l?x(0):x(t),m(q(e.value)),w(e),r((Math.random()+"").replace(".","")),_(!e.isHalf&&e.emptyIcon&&e.filledIcon||e.isHalf&&e.emptyIcon&&e.halfIcon&&e.filledIcon),N(Math.floor(e.value)),S(e.isHalf&&e.value%1<.5)},[]),a.default.createElement("div",{className:"react-stars-wrapper-"+l,style:{display:"flex"}},a.default.createElement("div",{tabIndex:j.a11y&&j.edit?0:null,"aria-label":"add rating by typing an integer from 0 to 5 or pressing arrow keys",onKeyDown:function(e){if(j.a11y||j.edit){var t=e.key,l=u,i=Number(t);i?Number.isInteger(i)&&i>0&&i<=j.count&&(l=i):("ArrowUp"===t||"ArrowRight"===t)&&l<j.count?(e.preventDefault(),l+=j.isHalf?.5:1):("ArrowDown"===t||"ArrowLeft"===t)&&l>.5&&(e.preventDefault(),l-=j.isHalf?.5:1),O(l),T(l)}},className:A,style:c},j.isHalf&&a.default.createElement("style",{dangerouslySetInnerHTML:{__html:g?"\n          span.react-stars-half > * {\n          color: "+j.activeColor+";\n      }":"\n    .react-stars-"+l+":before {\n      position: absolute;\n      overflow: hidden;\n      display: block;\n      z-index: 1;\n      top: 0; left: 0;\n      width: 50%;\n      content: attr(data-forhalf);\n      color: "+j.activeColor+";\n  }"}}),v.map(function(e,t){return a.default.createElement(o.default,{key:t,index:t,active:e.active,config:j,onMouseOver:B,onMouseLeave:M,onClick:H,halfStarHidden:C,halfStarAt:y,isUsingIcons:g,uniqueness:l})}),a.default.createElement("p",{style:{position:"absolute",left:"-200rem"},role:"status"},u)))}u.propTypes={classNames:r.default.string,edit:r.default.bool,half:r.default.bool,value:r.default.number,count:r.default.number,char:r.default.string,size:r.default.number,color:r.default.string,activeColor:r.default.string,emptyIcon:r.default.element,halfIcon:r.default.element,filledIcon:r.default.element,a11y:r.default.bool},u.defaultProps={edit:!0,half:!1,value:0,count:5,char:"★",size:15,color:"gray",activeColor:"#ffd700",a11y:!0,onChange:function(){}},t.Z=u},7719:function(e,t,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i])}return e};t.default=function(e){var t=e.index,l=e.active,i=e.config,n=e.onMouseOver,o=e.onMouseLeave,d=e.onClick,c=e.halfStarHidden,u=e.halfStarAt,x=e.isUsingIcons,p=e.uniqueness,v=i.color,m=i.activeColor,h=i.size,g=i.char,_=i.isHalf,f=i.edit,j=i.halfIcon,w=i.emptyIcon,b=i.filledIcon,y="",N=!1;_&&!c&&u===t&&(y=x?"react-stars-half":"react-stars-"+p,N=!0);var k=s({},r,{color:l?m:v,cursor:f?"pointer":"default",fontSize:h+"px"});return a.default.createElement("span",{className:y,style:k,key:t,"data-index":t,"data-forhalf":b?t:g,onMouseOver:n,onMouseMove:n,onMouseLeave:o,onClick:d},x?l?b:!l&&N?j:w:g)};var a=(i=l(7294))&&i.__esModule?i:{default:i},r={position:"relative",overflow:"hidden",cursor:"pointer",display:"block",float:"left"}}},function(e){e.O(0,[556,774,646,651,928,888,179],function(){return e(e.s=5025)}),_N_E=e.O()}]);