1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7373],{55839:(e,t,r)=>{r.d(t,{_:()=>b});var i=r(95155),a=r(12115),s=r(15239),o=r(52619),n=r.n(o),l=r(10512),c=r(83457),d=r(3998),u=r(17740),p=r(94205),h=r(22663),m=r(90151),g=r(79630),f=r(10196),v=r(13408),x=r(3390);function b(e){var t;let{id:r,name:o,categories:b,price:w,compareAtPrice:y,images:j,variants:N=[],variations:k,slug:S,href:A="/products/".concat(S)}=e,I=(null==j||null==(t=j[0])?void 0:t.url)||"/assets/images/products/new-arrivals-1.jpg",[q,C]=(0,a.useState)(!1),[E,z]=(0,a.useState)(!1),[P,D]=(0,a.useState)(!1),[M,O]=(0,a.useState)(!1),[T,F]=(0,a.useState)(null),[Q,R]=(0,a.useState)(!1),[_,V]=(0,a.useState)(!1),{isMargeGranolaSite:U}=(0,f.aO)(),$=(0,a.useMemo)(()=>{if(!U)return!1;let e=window.location.hostname.toLowerCase();return!e.includes("plantperfect")&&(!!e.includes("margegranola")||U)},[U]),{addToCart:K}=(0,u._)(),{addToWishlist:L,isInWishlist:B,wishlists:G,createWishlist:H,removeFromWishlist:W}=(0,p.n)(),X=B(r),Y=(0,a.useMemo)(()=>({id:r,title:o,slug:S,price:w,compareAtPrice:y,images:j,variants:N,variations:k,description:{},shortDescription:"",trackQuantity:!1,quantity:1,status:"ACTIVE",isDigital:!1,requiresShipping:!0,onSale:!1,isFeatured:!1,isNewArrival:!0,createdAt:new Date(0).toISOString(),updatedAt:new Date(0).toISOString(),categories:b}),[r,o,S,w,y,j,N,k,b]),J=$&&M&&!!T,Z=async e=>{if(e.preventDefault(),e.stopPropagation(),E)return;let t=/bundle/i.test("".concat(o," ").concat(S)),i=(0,v.je)(Y);if($&&t&&(null==i?void 0:i.length)){F({groups:i,selections:i.map(e=>e.values[0]||""),flavorSkuByName:{}}),O(!0),R(!0),(0,x.w9)(i.flatMap(e=>e.values),S).then(e=>{F(t=>t?{...t,flavorSkuByName:e}:t)}
1).catch(e=>{console.error("Error resolving bundle pouch SKUs:",e)}).finally(()=>R(!1));return}let a=N.filter(e=>e.isActive),s=(0,m.Yd)({slug:S,variations:k});if($&&!s&&a.length>1)return void D(!0);let n=s?void 0:1===a.length||!$&&a.length>1?a[0]:void 0;try{var l;z(!0);let e=(0,m.QQ)(S,k),t=null!=s?s:null==n?void 0:n.id,i=t&&(0,m.tx)({slug:S,variations:k})?(0,m.ak)({slug:S,title:o,unitPrice:w}):void 0;await K({productId:r,variantId:t,quantity:e,product:{id:r,title:o,slug:S,price:null!=(l=null==n?void 0:n.price)?l:w,compareAtPrice:y,images:j,trackQuantity:!1,quantity:1},variant:i||(n?{id:n.id,title:n.title,sku:n.sku,price:n.price,options:n.options}:void 0)})}catch(e){console.error("Error adding to cart:",e)}finally{z(!1)}},ee=async e=>{if(!E)try{var t;z(!0),await K({productId:r,variantId:e.id,quantity:1,product:{id:r,title:o,slug:S,price:null!=(t=e.price)?t:w,compareAtPrice:y,images:j,trackQuantity:!1,quantity:1},variant:{id:e.id,title:e.title,sku:e.sku,price:e.price,options:e.options}}),D(!1)}catch(e){console.error("Error adding variant to cart:",e)}finally{z(!1)}},et=async()=>{if(!T||E)return;let{groups:e,selections:t,flavorSkuByName:i}=T;if(t.length!==e.length||t.some(e=>!e))return void h.oR.error("Please select all pouch options.");let a=(0,v.uK)(Y,e,t);if(!a)return void h.oR.error("Selected bundle combination is not available.");let s=t.find(e=>!i[(0,x.ns)(e)]);if(s)return void h.oR.error('Unable to resolve required pouch SKU for "'.concat(s,'". Please try again.'));let n=t.map(e=>({name:e,code:(0,x.HX)(e),sku:i[(0,x.ns)(e)]})),l=n.map(e=>e.code).sort((e,t)=>e.localeCompare(t)).join("|");try{var c;z(!0),await K({productId:r,variantId:a.id,quantity:1,product:{id:r,title:o,slug:S,price:null!=(c=a.price)?c:w,compareAtPrice:y,images:j,trackQuantity:!1,quantity:1},variant:{id:a.id,title:a.title,sku:a.sku,price:a.price,options:a.options},bundleSelections:n,bundleSignature:l}),F(null),O(!1)}catch(e){console.error("Error adding bundle to cart:",e)}finally{z(!1)}},er=async e=>{if(e.preventDefault(),e.stopPropagation(),!_)try{if(V(!0),X){let e=G.flatMap(e=>e.items).find(e=>e.productId===r);e?await W(e.id):h.oR.error("Item not found in wishlist")}else{let e=G.find(e=>e.isDefault);if(e)await L({wishlistId:e.id,productId:r,quantity:1,product:{id:r,title:o,slug:S,price:w,compareAtPrice:y,images:j,isActive:!0,inStock:!0,status:"ACTIVE",quantity:1}});else try{let e=await H({name:"My Wishlist"});await L({wishlistId:e.wishlist.id,productId:r,quantity:1,product:{id:r,title:o,slug:S,price:w,compareAtPrice:y,images:j,isActive:!0,inStock:!0,status:"ACTIVE",quantity:1}})}catch(e){console.error("Error creating wishlist:",e),h.oR.error("Failed to create wishlist")}}}catch(e){console.error("Error toggling wishlist:",e)}finally{V(!1)}};return(0,i.jsxs)("div",{className:"group relative overflow-hidden bg-card font-sans transition-all duration-300 hover:shadow-xl",onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:[(0,i.jsxs)("div",{className:"relative aspect-square overflow-hidden bg-shop-canvas/50",children:[(0,i.jsxs)("div",{className:"absolute top-16 right-4 flex flex-col gap-3 transition-all duration-300 pointer-events-auto z-10 ".concat(q?"opacity-100 translate-x-0":"opacity-0 translate-x-4"),children:[(0,i.jsx)(d.$,{size:"sm",onClick:Z,disabled:E,className:"w-10 h-10 cursor-pointer p-0 bg-white/90 hover:bg-white text-shop-accent-2 hover:text-shop-navbar-foreground rounded-full shadow-lg transition-all duration-200 disabled:opacity-50",title:E?"Adding...":"Add to Cart",children:E?(0,i.jsx)("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,i.jsx)(l.A,{className:"h-4 w-4"})}),(0,i.jsx)(d.$,{size:"sm",onClick:er,disabled:_,className:"w-10 h-10 cursor-pointer p-0 rounded-full shadow-lg transition-all duration-200 disabled:opacity-50 ".concat(X?"bg-red-50 text-destructive hover:bg-red-100":"bg-white/90 hover:bg-white text-shop-accent-2 hover:text-shop-navbar-foreground"),title:X?"Remove from wishlist":"Add to wishlist",children:_?(0,i.jsx)("div",{className:"w-4 h-4 border-2 border-current border-t-transparent roun
1ded-full animate-spin"}):(0,i.jsx)(c.A,{className:"h-4 w-4 ".concat(X?"fill-current text-destructive":"text-shop-accent-2")})})]}),(0,i.jsx)("div",{className:"flex items-center justify-center h-full p-4",children:(0,i.jsx)("div",{className:"relative w-full h-full",children:I&&"/assets/images/products/placeholder.jpg"!==I?(0,i.jsx)(s.default,{src:I,alt:o,fill:!0,className:"object-contain",unoptimized:I.includes("minio-wc08sw004okowcococc4404k")||I.includes("sslip.io"),sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"}):(0,i.jsx)("div",{className:"flex h-full w-full items-center justify-center rounded-lg bg-muted",children:(0,i.jsx)("span",{className:"text-xl text-muted-foreground",children:"no image found"})})})}),(0,i.jsx)("div",{className:"absolute top-4 right-4 transition-all duration-300 ".concat(q?"opacity-100 translate-x-0":"opacity-0 translate-x-4"),children:(0,i.jsx)(n(),{href:A,children:(0,i.jsx)(d.$,{size:"sm",className:"cursor-pointer bg-shop-primary hover:bg-shop-primary/90 text-white hover:text-white px-6 py-2 rounded-sm text-sm font-medium shadow-lg hover:shadow-xl transition-all duration-200",children:"View Details"})})})]}),(0,i.jsxs)("div",{className:"p-4 text-center transition-all duration-300 ".concat(q?"bg-shop-navbar-foreground text-shop-topbar-foreground":"bg-card text-foreground"),children:[(0,i.jsx)("h3",{className:"font-heading mb-2 text-lg font-medium transition-colors duration-300 ".concat(q?"text-shop-topbar-foreground":"text-shop-navbar-foreground"),children:o}),(0,i.jsx)("p",{className:"mb-2 text-sm transition-colors duration-300 ".concat(q?"text-shop-topbar-foreground/90":"text-muted-foreground"),children:b.length>0?b.map(e=>e.name).join(", "):"Uncategorized"}),(0,i.jsxs)("p",{className:"text-base font-medium transition-colors duration-300 ".concat(q?"text-shop-topbar-foreground":"text-shop-navbar-foreground"),children:["$",w.toFixed(2)]})]}),(0,i.jsx)(g.x,{open:$&&(P||J),onOpenChange:e=>{e?M||D(!0):(D(!1),O(!1),T?window.setTimeout(()=>F(null),220):F(null))},productTitle:o,variants:N.filter(e=>e.isActive),onSelectVariant:e=>void ee(e),optionGroups:$?null==T?void 0:T.groups:void 0,optionSelections:$?null==T?void 0:T.selections:void 0,onOptionSelectionChange:(e,t)=>
1{F(r=>{if(!r)return r;let i=[...r.selections];return i[e]=t,{...r,selections:i}})},onConfirmOptions:$?()=>void et():void 0,confirmDisabled:!!$&&Q})]})}},74095:(e,t,r)=>{r.d(t,{default:()=>n});var i=r(95155),a=r(12115),s=r(15239);let o=["/assets/images/store/our-features/free.svg","/assets/images/store/our-features/cashback.svg","/assets/images/store/our-features/premium.svg","/assets/images/store/our-features/call.svg"];function n(e){let{features:t}=e,[r,n]=(0,a.useState)(null),l=t&&t.length>0?t.filter(e=>e.heading&&e.description).map((e,t)=>({id:e.id||"feature-".concat(t),title:e.heading,description:e.description,icon:e.icon||o[t]||o[0]})):[];return 0===l.length?null:(0,i.jsx)("section",{className:"py-16 ",children:(0,i.jsxs)("div",{className:"container mx-auto px-4",children:[(0,i.jsxs)("div",{className:"text-center mb-12",children:[(0,i.jsx)("h2",{className:"font-heading text-3xl font-bold text-shop-heading mb-4",children:"Our Features"}),(0,i.jsx)("p",{className:"mx-auto max-w-4xl text-base text-muted-foreground md:text-lg",children:"Plant Perfect is built to make sourcing easier, clearer, and more dependable for growers, buyers, and repeat customers."})]}),(0,i.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:l.map(e=>(0,i.jsxs)("div",{className:"relative group cursor-pointer transition-all duration-300 ease-out",onMouseEnter:()=>n(e.id),onMouseLeave:()=>n(null),children:[(0,i.jsxs)("div",{className:"relative h-full overflow-hidden rounded-lg border border-shop-accent/20 bg-card/90 p-6 transition-all duration-300 ease-out hover:border-shop-accent/40 hover:shadow-lg",children:[(0,i.jsx)("div",{className:"flex justify-center mb-4",children:(0,i.jsx)("div",{className:"w-16 h-16 flex items-center justify-center",children:(0,i.jsx)(s.default,{src:e.icon,alt:e.title,width:64,height:64,className:"transition-transform duration-300 ease-out group-hover:scale-110"})})}),(0,i.jsx)("h3",{className:"text-lg font-semibold text-shop-heading text-center mb-3 transition-colors duration-300",children:e.title}),(0,i.jsx)("p",{className:"text-center text-sm leading-relaxed text-muted-foreground",children:e.description}),(0,i.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-1 rounded-b-lg bg-shop-accent transform transition-all duration-300 ease-out ".concat(r===e.id?"scale-x-100 opacity-100":"scale-x-0 opacity-0"),style:{transformOrigin:"center",transitionTimingFunction:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"}})]}),(0,i.jsx)("div",{className:"absolute inset-0 rounded-lg transition-all duration-300 ease-out ".concat(r===e.id?"scale-105 -translate-y-1":"scale-100 translate-y-0"),style:{transitionTimingFunction:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",zIndex:-1}})]},e.id))})]})})}}}]);
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.