PageSourceSearch

https://offerbot.in/_next/static/chunks/485-cbadb806c570a927.js

js offerbot.in collected 2026-10-02 01:56:21 UTC 11,441 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[485],{3247:function(e,t,r){r.d(t,{Z:function(){return a}});let a=(0,r(9763).Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},3966:function(e,t,r){r.d(t,{W:function(){return x}});var a=r(7437);r(2265);var i=r(9376),s=r(8884),n=r(3695),l=r(6676),o=r(6595),c=r(5805),d=r(1723);let m=(0,r(9763).Z)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),u=e=>({[s.N.FLASH_DEAL]:"bg-red-600",[s.N.LOOT_ALERT]:"bg-orange-600",[s.N.TOP_PICK]:"bg-blue-500",[s.N.MEGA_DEAL]:"bg-purple-500",[s.N.LIMITED_TIME]:"bg-yellow-500",[s.N.BEST_SELLER]:"bg-green-500",[s.N.TRENDING]:"bg-pink-500",[s.N.EXCLUSIVE]:"bg-indigo-500",[s.N.NEW_ARRIVAL]:"bg-teal-500",[s.N.NEW_BRAND]:"bg-cyan-500"})[e]||"bg-gray-500",f=e=>({amazon:"\uD83D\uDED2",flipkart:"\uD83D\uDCE6",myntra:"\uD83D\uDC57",meesho:"\uD83D\uDECD️",shopsy:"\uD83D\uDED2"})[e.toLowerCase()]||"\uD83D\uDED2",g=e=>({amazon:"bg-orange-600",flipkart:"bg-blue-500",myntra:"bg-pink-500",meesho:"bg-purple-500",shopsy:"bg-green-500"})[e.toLowerCase()]||"bg-gray-500",p=e=>new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:0}).format(e),h=e=>{try{let t=new Date(e),r=new Date,a=Math.floor((r.getTime()-t.getTime())/36e5);if(a<1)return"Just now";if(a<24)return`${a}h ago`;let i=Math.floor(a/24);if(i<7)return`${i}d ago`;let s=Math.floor(i/7);if(s<4)return`${s}w ago`;return t.toLocaleDateString("en-IN",{month:"short",day:"numeric"})}catch{return"Recently"}},x=e=>{let{deal:t}=e,r=(0,i.useRouter)(),s=(0,i.usePathname)(),x=t.discountedPrice||t.dealPrice||0,b=t.originalPrice||t.ogPrice||0,y=b-x;return(0,a.jsxs)("div",{className:"bg-white rounded-xl overflow-hidden shadow-md hover:shadow-xl transition-all duration-300 hover:-translate-y-1 group cursor-pointer border border-gray-100",children:[(0,a.jsxs)("div",{onClick:()=>{let e=(0,n.lV)(t.title,t.id);r.push(`/deals/${e}`)},className:"block",children:[(0,a.jsxs)("div",{className:"relative aspect-square sm:aspect-auto sm:h-48 bg-gray-50",children:[(0,a.jsx)("img",{src:t.imgUrl,alt:t.title,className:"w-full h-full object-contain sm:object-cover group-hover:scale-105 transition-transform duration-300",loading:"lazy"}),(0,a.jsx)("div",{className:"absolute top-1 left-1 sm:top-2 sm:left-2",children:(0,a.jsx)("span",{className:`${u(t.chipTitle)} text-white px-1.5 py-0.5 sm:px-2 sm:py-1 rounded-full text-[10px] sm:text-xs font-bold`,children:t.chipTitle.replace("_"," ")})}),(0,a.jsx)("div",{className:"absolute top-1 right-1 sm:top-2 sm:right-2",children:(0,a.jsxs)("span",{className:`${g(t.platform)} text-white px-1.5 py-0.5 sm:px-2 sm:py-1 rounded-full text-[10px] sm:text-xs font-semibold`,children:[f(t.platform)," ",t.platform]})}),t.discountPercentage>0&&(0,a.jsx)("div",{className:"absolute bottom-1 left-1 sm:bottom-2 sm:left-2",children:(0,a.jsxs)("span",{className:"bg-red-600 text-white px-1.5 py-0.5 sm:px-2 sm:py-1 rounded-full text-[10px] sm:text-xs font-bold",children:[t.discountPercentage,"% OFF"]})})]}),(0,a.jsxs)("div",{className:"p-2 sm:p-4",children:[(0,a.jsx)("h3",{className:"font-semibold text-gray-900 text-xs sm:text-sm mb-1 sm:mb-2 line-clamp-2 leading-tight min-h-[2rem] sm:min-h-[2.5rem]",children:t.title}),(0,a.jsxs)("div",{className:"flex items-center gap-1 sm:gap-2 mb-1 sm:mb-2 flex-wrap",children:[(0,a.jsx)("span",{className:"text-sm sm:text-lg font-bold text-green-700",children:p(x)}),b>x&&(0,a.jsx)("span",{className:"text-xs sm:text-sm text-gray-500 line-through",children:p(b)})]}),y>0&&(0,a.jsxs)("p",{className:"text-green-700 font-semibold text-xs sm:text-sm mb-1 sm:mb-3",children:["Save ",p(y)]}),t.rating&&(0,a.jsxs)("div",{className:"hidden sm:flex items-center gap-2 mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(o.Z,{className:"w-4 h-4 text-yellow-400 fill-current"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-gray-700 ml-1",children:t.rating})]}),t.reviews&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-gray-400",children:"•"}),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(c.Z,{className:"w-4 h-4 text-gray-400"}),(0,a.jsx)("span",{className:"text-sm text-gray-500 ml-1",children:t.reviews})]})]})]}),t.timePosted&&(0,a.jsxs)("div",{className:"hidden sm:flex items-center text-gray-500 text-sm mb-3",children:[(0,a.jsx)(d.Z,{className:"w-4 h-4 mr-1"}),(0,a.jsx)("span",{children:h(t.timePosted)})]})]})]}),(0,a.jsx)("div",{className:"px-2 sm:px-4 pb-2 sm:pb-4",children:(0,a.jsxs)("button",{onClick:()=>{let e=(0,l.A)(t.ctaLink,t.platform);if(window.gtag){let r="unknown";"/"===s?r="homepage":"/deals"===s?r="deals_page":((null==s?void 0:s.startsWith("/product/"))||(null==s?void 0:s.startsWith("/deals/")))&&(r="single_product_page"),window.gtag("event","affiliate_link_click",{event_category:"deals_clicks",event_label:`${r}
1_deals_click`,deal_id:t.id,deal_title:t.title,platform:t.platform,section:r,affiliate_link:e})}if(window.innerWidth<=768)try{window.location.href=e}catch(t){window.open(e,"_blank","noopener,noreferrer")}else window.open(e,"_blank","noopener,noreferrer")},className:"w-full bg-gradient-to-r from-orange-500 to-red-500 hover:from-orange-600 hover:to-red-600 text-white font-bold py-2 sm:py-3 px-3 sm:px-4 rounded-lg transition-all duration-200 transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-orange-500 focus:ring-offset-2 flex items-center justify-center group text-xs sm:text-base","aria-label":`Shop ${t.title} for ${p(x)}`,children:[(0,a.jsx)("span",{children:"Shop Now"}),(0,a.jsx)(m,{className:"w-4 h-4 ml-2 group-hover:translate-x-1 transition-transform duration-200"})]})})]})}},6676:function(e,t,r){r.d(t,{A:function(){return i}});var a=r(257);function i(e,t){try{let r=new URL(e),i=t.toLowerCase();if("amazon"===i)return r.searchParams.set("tag","offerbot04-21"),r.toString();if("flipkart"===i){let e=a.env.NEXT_PUBLIC_FLIPKART_AFFILIATE_ID;return e&&!r.searchParams.get("affid")&&r.searchParams.set("affid",e),r.toString()}return r.searchParams.set("affExtParam2","EP6F66666572626F74"),r.toString()}catch{return e}}},3695:function(e,t,r){r.d(t,{lV:function(){return a}});function a(e,t){let r=String(t).trim(),a=e.toLowerCase().trim().replace(/[\s\W_]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");if(!a)return r.slice(0,100);let i=Math.max(1,100-r.length-1),s=a.slice(0,i).replace(/-+$/g,""),n=s.lastIndexOf("-");return n>.5*i&&(s=s.slice(0,n)),s||(s="deal"),`${s}-${r}`}},1003:function(e,t,r){r.d(t,{DealsProvider:function(){return u},_:function(){return g},n:function(){return f}});var a=r(7437),i=r(2265),s=r(1713),n=r(8884),l=r(6676);function o(e){let t=parseFloat(String(e.product_sale_price??e.originalPrice??e.ogPrice??0))||0,r=parseFloat(String(e.product_offer_price??e.discountedPrice??e.dealPrice??0))||0,a=("number"==typeof e.discountPercentage?e.discountPercentage:null)??(t&&r?Math.round((t-r)/t*100):0),i=String(e.product_url??e.affiliateLink??e.ctaLink??"#"),s=String(e.store_name??e.platform??e.source??"other");return{id:String(e.pid??e.id??Math.random().toString(36).slice(2,11)),imgUrl:String(e.product_image??e.image??e.imgUrl??"")||"https://via.placeholder.com/200x200/F3F4F6/D1D1D1?text=No+Image",title:String(e.product_name??e.title??e.name??"Product Title"),chipTitle:n.N.TOP_PICK,ctaLink:i,ogPrice:t,dealPrice:r,platform:s,timeLeft:"string"==typeof e.timeLeft?e.timeLeft:void 0,discountPercentage:a,originalPrice:t,discountedPrice:r,savings:t&&r?t-r:0,timePosted:"string"==typeof e.date_time?e.date_time:"string"==typeof e.timePosted?e.timePosted:"string"==typeof e.createdAt?e.createdAt:void 0,category:"string"==typeof e.category?e.category:void 0,brand:"string"==typeof e.brand?e.brand:void 0,rating:"number"==typeof e.rating?e.rating:void 0,reviews:"number"==typeof e.reviews?e.reviews:void 0}}let c={deals:[],filteredDeals:[],filters:{...n.q}},d=async()=>{try{let e=await fetch("/api/deals",{method:"POST",headers:{"Content-Type":"application/json"}});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(`Failed to fetch deals: ${e.status} - ${t.error||"Unknown error"}`)}let t=await e.json();if(!Array.isArray(t))throw Error("Deals API returned non-array payload");return t.map(o).filter((e,t,r)=>r.findIndex(t=>t.id===e.id)===t)}catch(e){throw console.error("[DealsContext] fetch failed:",e),Error("Failed to fetch deals. Please try again later.")}},m=(0,i.createContext)(void 0),u=e=>{let{children:t,initialDeals:r}=e,n=!!(r&&r.length>0),{data:l=[],isLoading:o,error:u,refetch:f}=(0,s.a)({queryKey:["deals"],queryFn:d,initialData:n?r:void 0,initialDataUpdatedAt:n?Date.now():void 0,staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:!1,retry:2}),[g,p]=i.useState(()=>({...c,deals:r??[],filteredDeals:r??[]}));i.useEffect(()=>{l.length>0&&p(e=>({...e,deals:l,filteredDeals:l}))},[l]),i.useEffect(()=>{(()=>{let e=[...g.deals];if(g.filters.search){let t=g.filters.search.toLowerCase();e=e.filter(e=>{var r,a;return e.title.toLowerCase().includes(t)||(null===(r=e.brand)||void 0===r?void 0:r.toLowerCase().includes(t))||(null===(a=e.category)||void 0===a?void 0:a.toLowerCase().includes(t))})}"all"!==g.filters.platform&&(e=e.filter(e=>e.platform.toLowerCase()===g.filters.platform.toLowerCase())),"all"!==g.filters.category&&(e=e.filter(e=>e.category===g.filters.category)),(e=(e=e.filter(e=>e.dealPrice>=g.filters.priceRange[0]&&e.dealPrice<=g.filters.priceRange[1])).filter(e=>e.discountPercentage>=g.filters.discountRange[0]&&e.discountPercentage<=g.filters.discountRange[1])).sort((e,t)=>
1{let r,a;switch(g.filters.sortBy){case"discount":default:r=e.discountPercentage,a=t.discountPercentage;break;case"price":r=e.dealPrice,a=t.dealPrice;break;case"newest":r=new Date(e.timePosted||"").getTime(),a=new Date(t.timePosted||"").getTime();break;case"rating":r=e.rating||0,a=t.rating||0}return"desc"===g.filters.sortOrder?a-r:r-a}),p(t=>({...t,filteredDeals:e}))})()},[g.deals,g.filters]);let h=(0,i.useCallback)(e=>{p(t=>({...t,filters:{...t.filters,...e}}))},[]),x=(0,i.useCallback)(()=>{p(e=>({...e,filters:c.filters}))},[]),b=(0,i.useCallback)(e=>{if(0!==l.length)return l.find(t=>t.id===e)||l.find(t=>t.id.includes(e)||e.includes(t.id))},[l]),y=(0,i.useCallback)(()=>{f()},[f]),w={deals:l,filteredDeals:g.filteredDeals,loading:o&&!n,error:u?u.message:null,filters:g.filters,setFilter:h,resetFilters:x,getDealById:b,refetchDeals:y};return(0,a.jsx)(m.Provider,{value:w,children:t})},f=()=>{let e=(0,i.useContext)(m);if(void 0===e)throw Error("useDeals must be used within a DealsProvider");return e},g=(e,t)=>{try{if(!e||0===t.length)return;let r=t.find(t=>t.id===e);if(r||(r=t.find(t=>t.id.includes(e)||e.includes(t.id))))return{...r,ctaLink:(0,l.A)(r.ctaLink,r.platform)};return}catch(e){console.error("useDeal hook error:",e);return}}},8884:function(e,t,r){var a,i;r.d(t,{N:function(){return a},q:function(){return s}}),(i=a||(a={})).FLASH_DEAL="FLASH DEAL",i.LOOT_ALERT="LOOT ALERT",i.TOP_PICK="TOP PICK",i.MEGA_DEAL="MEGA DEAL",i.LIMITED_TIME="LIMITED TIME",i.BEST_SELLER="BEST SELLER",i.TRENDING="TRENDING",i.EXCLUSIVE="EXCLUSIVE",i.NEW_ARRIVAL="NEW ARRIVAL",i.NEW_BRAND="NEW BRAND";let s={search:"",platform:"all",category:"all",priceRange:[0,1e5],discountRange:[0,100],sortBy:"discount",sortOrder:"desc"}}}]);

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.