module.exports=[36898,a=>{"use strict";var b=a.i(20226),c=a.i(62435);let d=(0,b.create)()((0,c.persist)((a,b)=>({items:[],addItem:c=>{let d=b().items;d.find(a=>a.id===c.id)||a({items:[...d,c]})},removeItem:c=>{a({items:b().items.filter(a=>a.id!==c)})},toggleItem:c=>{let d=b().items;d.find(a=>a.id===c.id)?a({items:d.filter(a=>a.id!==c.id)}):a({items:[...d,c]})},isInWishlist:a=>b().items.some(b=>b.id===a),clearWishlist:()=>{a({items:[]})}}),{name:"bambucare-wishlist-storage"}));a.s(["useWishlistStore",0,d])},95826,a=>{"use strict";let b=(0,a.i(64831).default)("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);a.s(["ShoppingCart",0,b],95826)},26634,a=>{"use strict";let b=(0,a.i(64831).default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);a.s(["Star",0,b],26634)},90195,a=>{"use strict";let b=(0,a.i(64831).default)("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]);a.s(["Heart",0,b],90195)},39926,a=>{"use strict";var b=a.i(87924),c=a.i(38246),d=a.i(18697),e=a.i(95826),f=a.i(90195),g=a.i(26634),h=a.i(39583),i=a.i(36898),j=a.i(6704),k=a.i(72131);a.s(["default",0,function({initialProducts:a}){let l=(0,h.useCartStore)(a=>a.addItem),{toggleItem:m,isInWishlist:n}=(0,i.useWishlistStore)(),[o,p]=(0,k.useState)(!1);return((0,k.useEffect)(()=>{p(!0)},[]),0===a.length)?(0,b.jsx)("div",{className:"text-center py-20 text-slate-500 text-lg",children:"No products found."}):(0,b.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-8",children:a.map(a=>{let h=!!o&&n(a.id);return(0,b.jsxs)(c.default,{href:`/product/${a.slug}`,className:"group flex flex-col bg-white rounded-2xl overflow-hidden border border-slate-100 shadow-sm hover:shadow-xl transition-all duration-300",children:[(0,b.jsxs)("div",{className:"relative aspect-[4/5] bg-[#F5F5F0] overflow-hidden",children:[(0,b.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-slate-400 font-medium",children:"No Image"}),(0,b.jsx)("div",{className:"absolute top-4 right-4 flex flex-col gap-2 opacity-0 group-hover:opacity-100 transition-opacity duration-300 translate-x-4 group-hover:translate-x-0",children:(0,b.jsx)("button",{onClick:b=>{let c;return b.preventDefault(),c=Number(a.variants?.[0]?.price||0),void(m({id:a.id,name:a.name,slug:a.slug,price:c}),n(a.id)?j.default.success("Removed from wishlist"):j.default.success("Added to wishlist"))},className:`w-10 h-10 rounded-full bg-white shadow-md flex items-center justify-center transition-colors ${h?"text-red-500":"text-slate-400 hover:text-red-500"}`,children:(0,b.jsx)(f.Heart,{className:`w-5 h-5 ${h?"fill-current":""}`})})}),(0,b.jsx)("div",{className:"absolute top-4 left-4",children:(0,b.jsx)("span",{className:"bg-[#285b30] text-white text-[10px] font-bold px-2 py-1 rounded uppercase tracking-wider",children:"In Stock"})})]}),(0,b.jsxs)("div",{className:"p-5 flex flex-col flex-grow",children:[(0,b.jsxs)("div",{className:"flex text-yellow-400 mb-2",children:[(0,b.jsx)(g.Star,{fill:"currentColor",className:"w-3 h-3"}),(0,b.jsx)(g.Star,{fill:"currentColor",className:"w-3 h-3"}),(0,b.jsx)(g.Star,{fill:"currentColor",className:"w-3 h-3"}),(0,b.jsx)(g.Star,{fill:"currentColor",className:"w-3 h-3"}),(0,b.jsx)(g.Star,{fill:"currentColor",className:"w-3 h-3"})]}),(0,b.jsx)("h3",{className:"font-bold text-lg text-slate-900 group-hover:text-[#285b30] transition-colors line-clamp-2 mb-1",children:a.name}),(0,b.jsx)("p",{className:"text-sm text-slate-500 mb-4",children:a.brand?.name||"BambuCare"}),(0,b.jsx)("div",{className:"mt-auto flex items-center justify-between",children:(0,b.jsxs)("span",{className:"text-xl font-bold text-[#1f4a25]",children:["৳ ",a.variants?.[0]?.price?Number(a.variants[0].price).toFixed(2):"N/A"]})}),(0,b.jsxs)(d.Button,{onClick:b=>((a,b)=>{if(a.preventDefault(),!b.variants||0===b.variants.length)return void j.default.error("This product is out of stock or unavailable.");let c=Number(b.variants[0].price);l({productVariantId:b.variants[0].id,productName:b.name,sku:b.slug,price:c,quantity:1}),j.default.success("Added to cart!")})(b,a),className:"w-full mt-4 bg-slate-900 hover:bg-[#285b30] text-white transition-colors gap-2",children:[(0,b.jsx)(e.ShoppingCart,{className:"w-4 h-4"})," Add to Cart"]})]})]},a.id)})})}])}];

//# sourceMappingURL=_0r3_4qm._.js.map