PageSourceSearch

https://premium-commerce--dmclearn.replit.app/assets/GiveawaysPublic-COKd7xs7.js

js premium-commerce--dmclearn.replit.app collected 2026-10-03 03:58:02 UTC 9,303 bytes, 1 lines download raw bytes

1import{h as E,a as v,r as l,j as e,S as C,L as w,B as p,v as A,G as S,Q as b,_ as j,$ as N,a9 as I}from"./index-Dh3w0av2.js";import{u as k}from"./useCountUp-C8ax6G2Y.js";import{T as L}from"./trophy-B2gMHVcT.js";import{f as $}from"./format-C7aNQKqU.js";async function y(s){const a=await fetch(s,{credentials:"include"}),n=await a.json().catch(()=>null);if(!a.ok)throw new Error(n?.error||"Request failed");return n}function W(){const s=l.useRef(null);return l.useEffect(()=>{const a=s.current;if(!a||typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const t=a.getContext("2d");if(!t)return;let i=a.width=a.offsetWidth,o=a.height=a.offsetHeight;const x=Math.max(12,Math.min(28,Math.floor(i/45))),f=Array.from({length:x}).map(()=>({x:Math.random()*i,y:Math.random()*o,r:.8+Math.random()*1.8,vy:.12+Math.random()*.28,vx:(Math.random()-.5)*.15,a:.15+Math.random()*.35}));let m=0;const c=()=>{t.clearRect(0,0,i,o);for(const r of f)r.y-=r.vy,r.x+=r.vx,r.y<-5&&(r.y=o+5,r.x=Math.random()*i),t.beginPath(),t.arc(r.x,r.y,r.r,0,Math.PI*2),t.fillStyle=`rgba(249, 115, 22, ${r.a})`,t.shadowBlur=6,t.shadowColor="rgba(249, 115, 22, 0.6)",t.fill();m=requestAnimationFrame(c)};m=requestAnimationFrame(c);const h=()=>{i=a.width=a.offsetWidth,o=a.height=a.offsetHeight};return window.addEventListener("resize",h),()=>{cancelAnimationFrame(m),window.removeEventListener("resize",h)}},[]),e.jsx("canvas",{ref:s,className:"absolute inset-0 h-full w-full pointer-events-none","aria-hidden":"true","data-testid":"canvas-embers"})}function F(s){const[a,n]=l.useState(()=>Date.now());return l.useEffect(()=>{const t=setInterval(()=>n(Date.now()),s);return()=>clearInterval(t)},[s]),a}function G({endsAt:s}){const a=F(1e3),n=new Date(s).getTime()-a;if(n<=0)return e.jsx("span",{className:"font-mono text-sm text-zinc-400","data-testid":"text-live-countdown",children:"Ending now"});const t=Math.floor(n/1e3);let i;if(t>=3600)i=`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m ${t%60}s`;else{const o=Math.floor(t/60),x=t%60;i=`${o}:${String(x).padStart(2,"0")}`}return e.jsxs("span",{className:"font-mono text-sm font-semibold text-orange-400","data-testid":"text-live-countdown",children:["Ends in ",i]})}function u({value:s,prefix:a="",suffix:n="",label:t,testId:i}){const o=k(s,1500);return e.jsxs("div",{className:"flex flex-col items-center justify-center px-4 py-6 text-center",children:[e.jsxs("span",{className:"text-3xl md:text-4xl font-extrabold text-white tabular-nums","data-testid":i,children:[a,o.toLocaleString(),n]}),e.jsx("span",{className:"mt-1 text-xs md:text-sm font-semibold tracking-wider text-zinc-400 uppercase",children:t})]})}function D({gw:s}){const a=s.winners.slice(0,3),n=s.winners.length-a.length;return e.jsx(j,{className:"bg-[#1f1f1f] border-zinc-800 rounded-xl overflow-hidden transition-all duration-200 hover:-translate-y-0.5 hover:border-orange-500/60 hover:shadow-[0_0_22px_rgba(249,115,22,0.25)]","data-testid":`card-past-giveaway-${s.id}`,children:e.jsxs(N,{className:"p-5 space-y-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white leading-snug",children:s.title}),s.completedAt&&e.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:$(new Date(s.completedAt),"MMMM d, yyyy")})]}),s.prizeDisplay&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(L,{className:"w-4 h-4 text-amber-400 shrink-0"}),e.jsx("span",{className:"text-zinc-200 font-medium",children:s.prizeDisplay})]}),s.winners.length>0&&e.jsxs("div",{className:"space-y-1",children:[a.map((t,i)=>e.jsxs("p",{className:"text-sm",children:[e.jsx("span",{className:"text-orange-400 font-semibold",children:t.name}),t.badge&&e.jsx("span",{className:"ml-1",title:t.wins?`Won ${t.wins} giveaway${t.wins===1?"":"s"}`:void 0,"data-testid":`badge-winner-${i}`,children:t.badge}),t.prizeDisplay&&e.jsxs("span",{className:"text-zinc-500",children:[" — ",t.prizeDisplay]})]},i)),n>0&&e.jsxs("p",{className:"text-xs text-zinc-500 font-medium",children:["+",n," more winner",n===1?"":"s"]})]}),e.jsxs("p",{className:"text-xs text-zinc-500 flex items-center gap-1.5 pt-1",children:[e.jsx(I,{className:"w-3.5 h-3.5"}
1),"from ",s.entryCount.toLocaleString()," entries"]})]})})}function T(){const{user:s}=E(),{data:a}=v({queryKey:["/api/giveaways/stats"],queryFn:()=>y("/api/giveaways/stats")}),{data:n}=v({queryKey:["/api/giveaways/live"],queryFn:()=>y("/api/giveaways/live"),refetchInterval:15e3}),[t,i]=l.useState(1),[o,x]=l.useState([]),[f,m]=l.useState(!1),{data:c,isLoading:h,isFetching:r}=v({queryKey:["/api/giveaways/history",t],queryFn:()=>y(`/api/giveaways/history?page=${t}`)});l.useEffect(()=>{c&&(m(c.hasMore),x(d=>{if(t===1)return c.giveaways;const M=new Set(d.map(g=>g.id));return[...d,...c.giveaways.filter(g=>!M.has(g.id))]}))},[c,t]);const z={"@context":"https://schema.org","@type":"Event",name:"Poppin Fire Giveaways & Winners",description:"A limited collectible release with a documented source record.",eventStatus:"https://schema.org/EventScheduled",eventAttendanceMode:"https://schema.org/OnlineEventAttendanceMode",organizer:{"@type":"Organization",name:"Poppin Fire"}};return e.jsxs("div",{className:"min-h-screen bg-[#0a0a0a] text-white",children:[e.jsx(C,{title:"Giveaways & Winners",description:"A limited collectible release with a documented source record.",jsonLd:z}),e.jsxs("section",{className:"relative overflow-hidden bg-[#0a0a0a] border-b border-zinc-900",children:[e.jsx(W,{}),e.jsxs("div",{className:"relative z-10 container mx-auto px-4 py-16 md:py-24 text-center",children:[e.jsx("h1",{className:"text-4xl md:text-6xl font-extrabold tracking-tight text-white","data-testid":"text-hero-headline",children:"GIVEAWAYS & WINNERS"}),e.jsx("p",{className:"mt-4 max-w-xl mx-auto text-zinc-400 text-base md:text-lg",children:"We give back to our community every week. Create an account to enter."}),e.jsx("div",{className:"mt-8",children:s?e.jsx(w,{href:"/account?tab=giveaways",children:e.jsx(p,{className:"bg-orange-500 hover:bg-orange-600 text-white font-bold min-h-[48px] px-8 text-base","data-testid":"button-go-to-giveaways",children:"GO TO MY GIVEAWAYS"})}):e.jsx(w,{href:"/login",children:e.jsx(p,{className:"bg-orange-500 hover:bg-orange-600 text-white font-bold min-h-[48px] px-8 text-base","data-testid":"button-create-account",children:"CREATE ACCOUNT"})})})]})]}),e.jsx("section",{className:"border-b border-zinc-900 bg-zinc-950",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 divide-x divide-y md:divide-y-0 divide-zinc-800",children:[e.jsx(u,{value:a?.totalGiveaways??0,label:"Giveaways",testId:"stat-giveaways"}),e.jsx(u,{value:a?.prizeValueEstimate??0,prefix:"$",suffix:"+",label:"In Prizes",testId:"stat-prizes"}),e.jsx(u,{value:a?.totalWinners??0,label:"Winners",testId:"stat-winners"}),e.jsx(u,{value:a?.thisMonth??0,label:"This Month",testId:"stat-this-month"})]})})}),n&&e.jsx("section",{className:"container mx-auto px-4 pt-10",children:e.jsx(w,{href:"/account?tab=giveaways",children:e.jsx("div",{className:"rounded-xl border-2 border-orange-500 bg-gradient-to-r from-orange-500/15 via-orange-500/10 to-orange-500/15 p-5 md:p-6 shadow-[0_0_30px_rgba(249,115,22,0.35)] animate-pulse-glow cursor-pointer transition-transform hover:-translate-y-0.5","data-testid":"banner-live-giveaway",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("p",{className:"text-lg md:text-xl font-bold text-white",children:["🔥 LIVE NOW: ",n.title,n.prizeDisplay?` — ${n.prizeDisplay}`:""]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-zinc-300",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(A,{className:"w-4 h-4 text-orange-500"}),n.participantCount.toLocaleString()," people checked in"]}),n.endsAt&&e.jsx(G,{endsAt:n.endsAt})]})]}),e.jsx(p,{className:"bg-orange-500 hover:bg-orange-600 text-white font-bold min-h-[48px] px-6 shrink-0","data-testid":"button-check-in-now",children:"CHECK IN NOW"})]})})})}),e.jsxs("section",{className:"container mx-auto px-4 py-12",children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2 mb-6",children:[e.jsx(S,{className:"w-6 h-6 text-orange-500"})," Past Giveaways"]}),h&&o.length===0?e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(b,{className:"w-8 h-8 animate-spin text-orange-500"})}):o.length===0?e.jsx(j,{className:"bg-[#1f1f1f] border-zinc-800",children:e.jsx(N,{className:"p-10 text-center text-zinc-400","data-testid":"text-no-past-giveaways",children:"No completed giveaways yet. Check back soon — we run them every week."})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:o.map(d=>e.jsx(D,{gw:d},d.id))}),f&&e.jsx("div",{className:"flex justify-center mt-10",children:e.jsx(p,{onClick:()=>i(d=>d+1),disabled:r,variant:"outline",className:"border-zinc-700 bg-transparent text-white hover:bg-zinc-800 hover:text-white font-semibold min-h-[48px] px-8","data-testid":"button-load-more",children:r?e.jsx(b,{className:"w-5 h-5 animate-spin"}):"Load More"})})]})]})]})}export{T as default};

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.