PageSourceSearch

https://nalakathfruits.com/_next/static/chunks/2808-811831f4283c3e2f.js

js nalakathfruits.com collected 2026-10-02 01:37:42 UTC 10,556 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2808],{92808:function(e,i,t){"use strict";var l=t(57437),o=t(2265);t(12543);var d=t(16463),n=t(11444),s=t(63872),a=t(35478),r=t(86122),c=t(73788),u=t(28370),v=t(88256),m=t(67830),A=t(49690),g=t(93573),x=t(94406),p=t(27625),h=t(30998),f=t(15610),y=t(22088),N=t(94454);i.Z=function(e){var i,t,b,j,w,P,Z,_,C,I,S,R,k,T,U,z,E,F,V,B,D,G,L,O,J,M,Q,Y,W,q,H;console.log("this is the props",e);let[K,X]=(0,o.useState)(!1),$=(0,d.useRouter)(),ee=(0,n.I0)(),ei=(0,n.v9)(m.ks),et=(0,n.v9)(e=>e.LocalCart||{items:[]});console.log("card");let{data:el}=(0,h.useSession)(),[eo,ed]=(0,o.useState)(1),en=(null==e?void 0:null===(i=e.item)||void 0===i?void 0:i.productVariant)&&(null==e?void 0:null===(t=e.item)||void 0===t?void 0:t.productVariant.length)>0,es=en?null==e?void 0:null===(j=e.item)||void 0===j?void 0:null===(b=j.productVariant[0])||void 0===b?void 0:b.price:null==e?void 0:null===(w=e.item)||void 0===w?void 0:w.retail_rate,ea=en?null==e?void 0:null===(Z=e.item)||void 0===Z?void 0:null===(P=Z.productVariant[0])||void 0===P?void 0:P.id:null,er=en?null==e?void 0:null===(C=e.item)||void 0===C?void 0:null===(_=C.productVariant[0])||void 0===_?void 0:_.units:null==e?void 0:null===(I=e.item)||void 0===I?void 0:I.unit,ec=null==e?void 0:null===(S=e.item)||void 0===S?void 0:S.is_offer;console.log("this onse has offer",ec);let eu=en?null==e?void 0:null===(k=e.item)||void 0===k?void 0:null===(R=k.productVariant[0])||void 0===R?void 0:R.offer_price:null==e?void 0:null===(T=e.item)||void 0===T?void 0:T.offer_price,ev=null==e?void 0:null===(U=e.item)||void 0===U?void 0:U.discount_type,em=null==e?void 0:null===(z=e.item)||void 0===z?void 0:z.discount_value,[eA,eg]=(0,o.useState)(ec?eu:es||0),[ex,ep]=a.ZP.useNotification(),eh=(0,n.v9)(e=>e.Cart.items),ef=(null==el?void 0:el.token)?eh:et.items;console.log("is this correct",ef);let ey=null==ef?void 0:ef.some(i=>i.pid==e.item.pid);(0,o.useEffect)(()=>{ef.find(i=>{i.pid==e.item.pid&&ed(i.quantity)})},[ef,e.item.pid]);let eN=new Date(null==e?void 0:null===(E=e.item)||void 0===E?void 0:E.createdAt),eb=new Date-eN;(0,o.useEffect)(()=>{eg((ec?eu:es||0)*eo)},[eo,es,eu,ec]);let ej=async i=>{let t=ef.find(i=>i.pid===e.item.pid);if(console.log("this one",t),t)try{if(null==el?void 0:el.token){if((await (0,p.uO)(x.Z.CART+t.id+"?action=".concat(i),{})).status){let e=await (0,p.HT)(x.Z.CART_GET_ALL);ee((0,f._3)(e.data))}}else"add"===i&&eo<(er||10)?ee((0,g.yT)({...t})):"reduce"===i&&eo>0&&ee((0,g.m7)({...t}))}catch(e){a.ZP.error({message:"Can't change Quantity"})}},ew=()=>{var i,t;let l="/".concat(null==e?void 0:null===(i=e.item)||void 0===i?void 0:i.slug,"/?pid=").concat(null==e?void 0:null===(t=e.item)||void 0===t?void 0:t.pid,"&review=2");en&&ea&&(console.log("currentVariantId",ea),l+="&vid=".concat(ea)),$.push(l)},eP=async i=>{var t,l,o;if(X(!0),(null==e?void 0:null===(t=e.item)||void 0===t?void 0:t.status)!=!0){a.ZP.error({message:"Product is Temporarily not Available"});return}if(0==er){a.ZP.error({message:"Product is Out of Stock!!"});return}if(i>er){a.ZP.error({message:"Selected Quantity is Not Available."});return}if(0===i){a.ZP.error({message:"Please select at least 1 quantity."});return}let d={productId:(null==e?void 0:null===(l=e.item)||void 0===l?void 0:l.pid)||(null==e?void 0:null===(o=e.item)||void 0===o?void 0:o._id),quantity:i,variantId:ea},n=x.Z.CART;try{let e=await (0,p.a4)(n,d);e.status?ex.success({message:null==e?void 0:e.message}):ex.error({message:null==e?void 0:e.message})}catch(e){ex.error({message:"Something went wrong!"})}try{let e=x.Z.CART_GET_ALL,i=await (0,p.HT)(e);i.status&&ee((0,f._3)(i.data))}catch(e){}},eZ=()=>{var i,t,l,o,d,n,s,r,c;if((null==e?void 0:null===(i=e.item)||void 0===i?void 0:i.status)!=!0){a.ZP.error({message:"Product is Temporarily not Available"});return}if(0==er){a.ZP.error({message:"Product is Out of Stock!!"});return}if(eo>er){a.ZP.error({message:"Selected Quantity is Not Available."});return}if(0===eo){a.ZP.error({message:"Please select at least 1 quantity."});return}console.log("this is the current props item",null==e?void 0:e.item);let u={productId:(null==e?void 0:null===(t=e.item)||void 0===t?void 0:t.pid)||(null==e?void 0:null===(l=e.item)||void 0===l?void 0:l._id),pid:null==e?void 0:null===(o=e.item)||void 0===o?void 0:o.pid,name:null==e?void 0:null===(d=e.item)||void 0===d?void 0:d.name,price:es,quantity:eo,image:null==e?void 0:null===(n=e.item)||void 0===n?void 0:n.image,variantId:ea,totalPrice:ec?eu*eo:es*eo,availableQuantity:er,storeId:null==e?void 0:null===(s=e.item)||void 0===s?void 0:s.store_id,storeName:null==e?void 0:null===(c=e.item)||void 0===c?void 0:null===(r=c.storeDetails)||void 0===r?void 0:r.store_name,discountType:ev,discountValue:em,is_offer:ec,offer_price:eu};try{ee((0,g.ks)(u))}catch(e){console.error("Error adding to local cart:",e),a.ZP.error({message:"Failed to add item to cart"})}},e_=(0,l.jsxs)("div",{children:[(0,l.jsxs)("p",{children:[null==e?void 0:null===(F=e.item)||void 0===F?void 0:F.totalReviews," total ratings"]}),(0,l.jsx)("hr",{}),(0,l.jsx)("p",{className:"ProductItem-txt5",style:{cursor:"pointer"},onClick:()=>ew(),children:"See customer reviews >"})]}),eC=(0,l.jsxs)("div",{className:"d-flex align-items-center gap-2",children:[(0,l.jsx)(r.Z,{disabled:!0,allowHalf:!0,value:Number(null==e?void 0:null===(V=e.item)||void 0===V?void 0:V.averageRating),className:"",style:{fontSize:"12px"}}),(0,l.jsx)("h6",{className:"my-0 fw-bold",children:"".concat(null===(B=Number(null==e?void 0:null===(D=e.item)||void 0===D?void 0:D.averageRating))||void 0===B?void 0:B.toFixed(1)," out of 5")})]});return(0,l.jsxs)("div",{className:"ProductItem position-relative",children:[ep,(0,l.jsxs)("div",{className:"ProductItem-Box1",children:[(0,l.jsx)("img",{src:null==e?void 0:null===(G=e.item)||void 0===G?void 0:G.image,className:"ProductItem-img border-bottom",alt:"ProductItem-img",onClick:()=>ew()}),ec&&(0,l.jsx)("div",{style:{position:"absolute",top:"10px",left:"10px",zIndex:2,background:"#ff4d4f",color:"white",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",fontWeight:"bold"},children:"percentage"===ev?"".concat(em,"% OFF"):"₹".concat(em," OFF")})]}),(0,l.jsxs)("div",{className:"ProductItem-Box2 d-flex flex-column justify-content-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"d-flex justify-content-between",children:[(0,l.jsx)("div",{className:"ProductItem-txt1 text-center text-sm-start",onClick:()=>ew(),children:null==e?void 0:null===(L=e.item)||void 0===L?void 0:L.name}),(0,l.jsx)("div",{children:(0,l.jsx)(c.Z,{size:26,src:(null==e?void 0:null===(O=e.item)||void 0===O?void 0:O.is_vegetarian)?y.Z.src:N.Z.src,shape:"square"})})]}),(0,l.jsx)(u.Z,{content:e_,title:eC,children:(null==e?void 0:null===(J=e.item)||void 0===J?void 0:J.averageRating)?(0,l.jsxs)("div",{className:"d-flex gap-2",children:[(0,l.jsxs)("div",{className:"ProductItem-txt5",children:[(0,l.jsx)(s.QJe,{color:"#f5da42"}),!1==isNaN(Number(null==e?void 0:null===(M=e.item)||void 0===M?void 0:M.averageRating))?null===(Q=Number(null==e?void 0:null===(Y=e.item)||void 0===Y?void 0:Y.averageRating))||void 0===Q?void 0:Q.toFixed(1):0]}),(0,l.jsx)("span",{className:"ProductItem-txt5 text-dark",children:(null==e?void 0:null===(W=e.item)||void 0===W?void 0:W.totalReviews)?" (".concat(null==e?void 0:null===(q=e.item)||void 0===q?void 0:q.totalReviews,")"):""})]}):null}),(0,l.jsxs)("div",{className:"d-flex justify-content-between",children:[ec?(0,l.jsxs)("div",{className:"d-flex align-items-center gap-2",children:[(0,l.jsx)("div",{className:"ProductItem-txt3 text-center text-sm-start",children:new Intl.NumberFormat("en-US",{style:"currency",currency:null==ei?void 0:ei.currency}).format(eu)}),(0,l.jsx)("div",{style:{textDecoration:"line-through",color:"#999",fontSize:"14px"},children:new Intl.NumberFormat("en-US",{style:"currency",currency:null==ei?void 0:ei.currency}).format(es)})]}):(0,l.jsx)("div",{className:"ProductItem-txt3 text-center text-sm-start",children:new Intl.NumberFormat("en-US",{style:"currency",currency:null==ei?void 0:ei.currency}).format(es)}),eo>1&&(0,l.jsxs)("small",{className:"text-success py-2  d-none d-sm-block",children:["Total:"," ",new Intl.NumberFormat("en-US",{style:"currency",currency:null==ei?void 0:ei.currency}).format(eA)]})]})]}),(0,l.jsx)("div",{className:"d-flex flex-column align-items-center mt-3",children:ey?(0,l.jsxs)("div",{className:"incDecBtn",children:[(0,l.jsx)(v.ZP,{size:"small",type:"primary",ghost:!0,icon:(0,l.jsx)(A.ywL,{}),shape:"circle",disabled:0==eo,onClick:e=>{e.stopPropagation(),ej("reduce")}}),(0,l.jsx)("div",{className:"fw-bold",children:eo}),(0,l.jsx)(v.ZP,{size:"small",type:"primary",ghost:!0,icon:(0,l.jsx)(A.Lfi,{}),shape:"circle",disabled:er<=eo,onClick:e=>{e.stopPropagation(),ej("add")}})]}):(0,l.jsx)(v.ZP,{size:"small",className:"w-100 p-1 h-100 w-100 cartBtn",onClick:()=>{(null==el?void 0:el.token)?eP(eo):eZ()},children:"Add to Cart"})}),er<=0?(0,l.jsx)("div",{className:"product_status_tag position-absolute",children:(0,l.jsx)("div",{className:"badge2 grey",children:"Soldout"})}):(null==e?void 0:null===(H=e.item)||void 0===H?void 0:H.status)==!1?(0,l.jsx)("div",{className:"product_status_tag position-absolute",children:(0,l.jsx)("div",{className:"badge2 red",children:"not available"})}):er<=5?(0,l.jsx)("div",{className:"product_status_tag position-absolute",children:(0,l.jsx)("div",{className:"badge2 orange",children:" only ".concat(er," left")})}):"number"==typeof eb&&eb<43e3?(0,l.jsx)("div",{className:"product_status_tag position-absolute",children:(0,l.jsx)("div",{className:"badge2 blue",children:"New"})}):null]})]})}},12543:function(){},94454:function(e,i){"use strict";i.Z={src:"/_next/static/media/non veg.75a21558.png",height:1024,width:1024,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAIVBMVEWXGBiYGRiaGRmWGBeUGBiWGBiXGRiWGBh/Pz+qVTClHBuC5mexAAAACnRSTlNiPsMiLXmmKQQDAUOEWgAAAAlwSFlzAAALEwAACxMBAJqcGAAAADJJREFUeJxVyrkRACAMAzDHNuTZf2COgoJOhdBKKdWIjbWwA4EkjQvO8IdIXbxcsm3VAR75ANRPfzFSAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8}},22088:function(e,i){"use strict";i.Z={src:"/_next/static/media/veg.8e5e560d.png",height:1024,width:1024,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAIVBMVEUAYzUAYjQAYzUAYDUAZzcAYTEAYTMAYTUAZDYAYzYAajni3vHJAAAACnRSTlNVTjtD3BcveutulgIObgAAAAlwSFlzAAALEwAACxMBAJqcGAAAADJJREFUeJxFxrkBADAIA7GzDeTZf+CUUSU6sZOGZfACJlU2SHVvST8Me8vAGZgDLSVSPxyFAM2detGlAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8}}}]);

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.