PageSourceSearch

https://organicpureoil.com/_next/static/chunks/4780-d0690d6039b28931.js

js organicpureoil.com collected 2026-10-05 02:40:34 UTC 7,909 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4780],{4780:function(e,s,t){t.d(s,{Z:function(){return x}});var a=t(7437),n=t(6648),r=t(7476),i=e=>{let{access:s,size:t="sm",className:n=""}=e;if("PUBLIC"===s)return null;let i={sm:"text-xs px-2 py-1",md:"text-sm px-3 py-1.5",lg:"text-base px-4 py-2"},l={sm:10,md:12,lg:14};return"PROTECTED"===s?(0,a.jsxs)("span",{className:"\n        inline-flex items-center gap-1 \n        bg-yellow-100 text-yellow-800 \n        font-medium rounded-full\n        ".concat(i[t],"\n        ").concat(n,"\n      "),children:[(0,a.jsx)(r.UIZ,{size:l[t]}),"Protected"]}):"PRIVATE"===s?(0,a.jsxs)("span",{className:"\n        inline-flex items-center gap-1 \n        bg-red-100 text-red-800 \n        font-medium rounded-full\n        ".concat(i[t],"\n        ").concat(n,"\n      "),children:[(0,a.jsx)(r.rzC,{size:l[t]}),"Private"]}):null},l=t(3583),c=t(2265),o=t(6463),d=t(8097);let m=e=>{let{productSlug:s,access:t,productName:a}=e,[n,r]=(0,c.useState)(!1),[i,l]=(0,c.useState)(!1),[m,x]=(0,c.useState)(null),u=(0,o.useRouter)(),h=(0,c.useCallback)(()=>{r(!0),x(null)},[]),p=(0,c.useCallback)(()=>{r(!1),x(null),l(!1)},[]),g=(0,c.useCallback)(async e=>{l(!0),x(null);try{let n=await fetch("/api/shop/products/slug/".concat(encodeURIComponent(s),"?password=").concat(encodeURIComponent(e)));if(n.ok)p(),u.push("".concat((0,d.Y1)(s),"?password=").concat(encodeURIComponent(e)));else{let e=await n.json();if(404===n.status){var t,a;(null===(t=e.message)||void 0===t?void 0:t.includes("Invalid password"))?x("Invalid password. Please try again."):(null===(a=e.message)||void 0===a?void 0:a.includes("protected"))?x("This product requires a password to access."):x("Product not found or access denied.")}else x("An error occurred while verifying the password.")}}catch(e){x("An error occurred while verifying the password.")}finally{l(!1)}},[s,u,p]),f=(0,c.useCallback)(e=>{e&&e.preventDefault(),"PRIVATE"!==t&&("PROTECTED"===t?h():u.push((0,d.Y1)(s)))},[t,s,u,h]);return{isPasswordModalOpen:n,isLoading:i,error:m,openPasswordModal:h,closePasswordModal:p,handlePasswordSubmit:g,handleProductClick:f}};var x=e=>{var s;let{product:t,viewMode:c,onAddToCart:o,addingToCartId:d}=e,x=t.salePrice||t.price,u=t.maxPrice&&t.maxPrice>x?t.maxPrice:null,h=t.averageRating||0,p=t.reviewCount||0,g=Array.from(new Set((null===(s=t.categories)||void 0===s?void 0:s.map(e=>e.name))||[])).join(" • "),{isPasswordModalOpen:f,isLoading:v,error:b,closePasswordModal:j,handlePasswordSubmit:N,handleProductClick:w}=m({productSlug:t.slug,access:t.access,productName:t.name}),k=e=>{e.preventDefault(),e.stopPropagation(),w()},y=e=>{e.preventDefault(),e.stopPropagation(),w()},C=()=>(0,a.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2",children:[(0,a.jsxs)("span",{className:"text-lg font-bold text-dark-green",children:["$",x.toFixed(2),u?" - $".concat(u.toFixed(2)):""]}),t.salePrice&&(0,a.jsxs)("span",{className:"text-sm text-dark-green/45 line-through",children:["$",t.price.toFixed(2)]})]}),P=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-dark-green/60",children:[(0,a.jsx)("div",{className:"flex items-center gap-0.5",children:[1,2,3,4,5].map(s=>(0,a.jsx)(r.nae,{size:e?13:15,className:s<=Math.round(h)?"fill-current text-[#ffb23f]":"text-black/20"},s))}),(0,a.jsx)("span",{className:"text-xs",children:p>0?"".concat(h.toFixed(1)," (").concat(p,")"):"New"})]})};return"grid"===c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{onClick:k,className:"group cursor-pointer overflow-hidden rounded-lg bg-[#fbfaf7]/75 shadow-sm ring-1 ring-black/5 transition-all duration-300 hover:-translate-y-1 hover:shadow-lg",children:[(0,a.jsxs)("div",{className:"relative flex h-80 items-center justify-center overflow-hidden bg-white",children:[t.imageUrl?(0,a.jsx)(n.default,{src:t.imageUrl,alt:t.name,fill:!0,className:"object-contain p-6 transition-transform duration-300 group-hover:scale-105"}):(0,a.jsx)("div",{className:"text-sm text-dark-green/45",children:"No image"}),"PUBLIC"!==t.access&&(0,a.jsx)("div",{className:"absolute top-2 left-2",children:(0,a.jsx)(i,{access:t.access,size:"sm"})}),t.salePrice&&(0,a.jsx)("div",{className:"absolute top-2 right-2 roun
1ded bg-red-500 px-2 py-1 text-sm font-medium text-white",children:"Sale"}),!t.inStock&&(0,a.jsx)("div",{className:"absolute bottom-2 right-2 rounded bg-gray-600 px-2 py-1 text-sm font-medium text-white",children:"Out of Stock"})]}),(0,a.jsxs)("div",{className:"p-5",children:[g&&(0,a.jsx)("p",{className:"mb-2 text-center text-xs font-semibold uppercase tracking-wide text-main-color",children:g}),(0,a.jsx)("h3",{onClick:y,className:"font-playfair mb-3 line-clamp-2 min-h-[3.5rem] cursor-pointer text-center text-xl font-medium text-black transition-colors group-hover:text-dark-green",children:t.name}),(0,a.jsx)("div",{className:"mb-4 flex justify-center",children:P()}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[C(),(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),o(t)},disabled:!t.inStock||d===t.id||"PRIVATE"===t.access,className:"p-2 rounded-full transition-colors ".concat(t.inStock&&"PRIVATE"!==t.access?"bg-dark-green text-white hover:bg-light-green/90":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:d===t.id?(0,a.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}):(0,a.jsx)(r.x8h,{size:16})})]})]})]}),(0,a.jsx)(l.Z,{isOpen:f,onClose:j,onSubmit:N,productName:t.name,isLoading:v,error:b||void 0})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"group rounded-lg bg-[#fbfaf7]/75 p-4 shadow-sm ring-1 ring-black/5 transition-shadow duration-300 hover:shadow-md",children:(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)("div",{className:"relative h-24 w-24 flex-shrink-0 overflow-hidden rounded-lg bg-white",children:(0,a.jsx)("div",{onClick:k,className:"cursor-pointer w-full h-full",children:t.imageUrl?(0,a.jsx)(n.default,{src:t.imageUrl,alt:t.name,fill:!0,className:"object-contain bg-white transition-transform duration-300 group-hover:scale-105"}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-xs text-dark-green/45",children:"No image"})})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsxs)("div",{className:"flex items-start justify-between",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0 mr-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("div",{onClick:y,className:"cursor-pointer flex-1",children:(0,a.jsx)("h3",{className:"font-medium text-black hover:text-dark-green transition-colors",children:t.name})}),"PUBLIC"!==t.access&&(0,a.jsx)(i,{access:t.access,size:"sm"})]}),(0,a.jsx)("div",{className:"mb-2",children:P(!0)}),t.shortDescription&&(0,a.jsx)("div",{className:"mb-2 text-sm leading-relaxed text-gray-600 [&_p]:mb-1 [&_p:last-child]:mb-0",dangerouslySetInnerHTML:{__html:t.shortDescription}}),C()]}),(0,a.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[!t.inStock&&(0,a.jsx)("span",{className:"text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded",children:"Out of Stock"}),(0,a.jsx)("button",{onClick:()=>o(t),disabled:!t.inStock||d===t.id||"PRIVATE"===t.access,className:"p-2 rounded-full transition-colors ".concat(t.inStock&&"PRIVATE"!==t.access?"bg-dark-green text-white hover:bg-light-green/90":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:d===t.id?(0,a.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}):(0,a.jsx)(r.x8h,{size:16})})]})]})})]})}),(0,a.jsx)(l.Z,{isOpen:f,onClose:j,onSubmit:N,productName:t.name,isLoading:v,error:b||void 0})]})}},8097:function(e,s,t){t.d(s,{Y1:function(){return a}});function a(e){let s=null==e?void 0:e.trim();return s?"/product/".concat(encodeURIComponent(s)):"/shop"}}}]);

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.