1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3341],{59813:(e,r,t)=>{t.d(r,{default:()=>f});var a=t(95155),n=t(52619),s=t.n(n),l=t(97262),i=t(15239),c=t(94520),o=t(78539),d=t(40876),u=t(60854);function f(e){var r,t,n,f,x,h=e.article,g=e.articleId,m=h.createdAt?new Date(h.createdAt).getTime():NaN,p=Number.isFinite(m)?(0,l.fw)(m):null,v=(0,c.Wq)(null==(r=h.featuredImage)?void 0:r.url),b=(0,d.r)(v),j=b.showFallback,N=b.onError;return(0,a.jsxs)(s(),{href:"/article/".concat(h.slug),title:h.title,prefetch:!1,"data-id":g,className:"group flex h-full flex-col overflow-hidden rounded-xl border border-gray-200 bg-white transition-all hover:shadow-lg hover:border-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:hover:border-gray-600",children:[(0,a.jsxs)("div",{className:"relative aspect-[16/9] w-full flex-shrink-0 overflow-hidden bg-gray-100 dark:bg-gray-900",children:[j?(0,a.jsx)(u.A,{label:null!=(f=h.title)?f:"",className:"absolute inset-0 text-2xl"}):(0,a.jsx)(i.default,{src:v,alt:null!=(x=h.title)?x:"",fill:!0,sizes:"(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw",quality:75,className:"object-cover transition-transform duration-300 group-hover:scale-105",onError:N}),(null==(t=h.category)?void 0:t.displayName)&&(0,a.jsx)("div",{className:"absolute left-2.5 top-2.5",children:(0,a.jsx)(o.A,{label:h.category.displayName,className:"bg-white/90 dark:bg-gray-900/90"})})]}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col p-4",children:[(0,a.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5 text-[11px] text-gray-500 dark:text-gray-400",children:[null!=h.readingTime&&(0,a.jsxs)("span",{children:[h.readingTime," min read"]}),null!=h.readingTime&&p&&(0,a.jsx)("span",{"aria-hidden":!0,children:"\xb7"}),p&&(0,a.jsx)("span",{children:p})]}),(0,a.jsx)("h3",{className:"text-base font-bold leading-snug text-gray-900 line-clamp-2 group-hover:text-accent dark:text-gray-100",children:h.title}),(0,a.jsx)("p",{className:"mt-1.5 text-sm text-gray-600 line-clamp-2 dark:text-gray-400",children:h.excerpt}),(null==(n=h.author)?void 0:n.name)&&(0,a.jsx)("div",{className:"mt-3 text-xs font-semibold text-gray-500 dark:text-gray-400",children:h.author.name})]})]})}},75722:(e,r,t)=>{t.d(r,{default:()=>g});var a=t(61975),n=t(79703),s=t(22043),l=t(45377),i=t(71450),c=t(95155),o=t(12115),d=t(52619),u=t.n(d),f=t(6132),x=t(59813);function h(){return(0,c.jsxs)("div",{"data-testid":"article-skeleton",className:"flex h-full flex-col overflow-hidden rounded-xl border border-ink-line bg-ink-850 animate-pulse",children:[(0,c.jsx)("div",{className:"aspect-[16/9] w-full flex-shrink-0 bg-ink-800"}),(0,c.jsxs)("div",{className:"flex flex-1 flex-col gap-2 p-4",children:[(0,c.jsx)("div",{className:"h-3 w-1/3 rounded bg-ink-800"}),(0,c.jsx)("div",{className:"h-4 w-full rounded bg-ink-800"}),(0,c.jsx)("div",{className:"h-4 w-2/3 rounded bg-ink-800"})]})]})}function g(e){var r,t,d,g,m,p,v,b,j,N,y,k,w=e.initialArticles,M=e.category,S=e.author,_=e.initialHasMore,A=e.pageSize,T=(0,s._)((0,o.useState)(w),2),E=T[0],R=T[1],F=(0,s._)((0,o.useState)(2),2),I=F[0],C=F[1],L=(0,s._)((0,o.useState)(void 0===_||_),2),z=L[0],U=L[1],P=(0,s._)((0,o.useState)(!1),2),q=P[0],H=P[1],Y=(0,s._)((0,o.useState)(null),2),Z=Y[0],D=Y[1],V=(0,o.useRef)(!1),W=(0,o.useCallback)(function(){return(0,a._)(function(){var e,r,t,a;return(0,i.YH)(this,function(s){switch(s.label){case 0:if(V.current||!z)return[2];V.current=!0,H(!0),D(null),s.label=1;case 1:return s.trys.push([1,4,5,6]),e=new URLSearchParams({page:I.toString()}),A&&e.append("pageSize",A.toString()),M&&e.append("category",M),S&&e.append("author",S),[4,fetch("/api/articles/load-more?".concat(e.toString()))];case 2:if(!(r=s.sent()).ok)throw Error("HTTP ".concat(r.status,": ").concat(r.statusText));return[4,r.json()];case 3:return(t=s.sent()).articles&&t.articles.length>0?(R(function(e){return(0,l._)(e).concat((0,l._)(t.articles))}),C(function(e){return e+1}),U(t.hasMore)):U(!1),[3,6];case 4:return a=s.sent(),D((0,n._)(a,Error)?a.message:"Failed to load more articles"),U(!1),[3,6];case 5:return V.current=!1,H(!1),[7];case 6:return[2]}})})()},[I,M,S,z,A]),X=(t=(r={hasMore:z,isLoading:q,onLoadMore:W,threshold:.1,rootMargin:"200px"}).hasMore,d=r.isLoading,g=r.onLoadMore,p=void 0===(m=r.threshold)?.1:m,b=void 0===(v=r.rootMargin)?"100px":v,j=(0,o.useRef)(null),N=(0,o.useRef)(g),y=(0,o.useRef)(t),k=(0,o.useRef)(d),N.current=g,y.current=t,k.current=d,(0,o.useEffect)(function(){var e=j.current;if(e){var r=new IntersectionObserver(function(e){(0,s._)(e,1)[0].isIntersecting&&y.current&&!k.current&&N.current()},{threshold:p,rootMargin:b});return r.observe(e),function(){r.disconnect()}}},[p,b]),{ref:j}).ref;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:E.map(function(e,r){return(0,c.jsx)(x.default,{article:e,articleId:r},"".concat(e.id,"-").concat(r))})}),z&&(0,c.jsx)("div",{ref:X,className:"py-8 min-h-20",children:q?(0,c.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:[(0,c.jsx)(h,{}),(0,c.jsx)(h,{}),(0,c.jsx)(h,{})]}):Z?(0,c.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,c.jsx)(f.A,{size:32,className:"text-bad"}),(0,c.jsxs)("p",{className:"text-ink-t2",children:["Error loading articles: ",Z]}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("button",{onClick:W,className:"px-4 py-2 bg-accent text-white rounded-full font-semibold hover:brightness-95 transition-colors",children:"Try Again"}),(0,c.jsx)(u(),{href:"/games/all",prefetch:!1,className:"px-4 py-2 rounded-full font-semibold border border-ink-line-2 text-ink-t2 hover:bg-ink-800 transition-colors",children:"Browse games"})]})]}):(0,c.jsx)("div",{className:"flex justify-center items-center text-ink-t3",children:"Scroll down to load more articles..."})}),!z&&!q&&E.length>0&&(0,c.jsx)("div",{className:"text-center py-8 text-ink-t2",children:(0,c.jsx)("p",{children:"You've reached the end! No more articles to load."})})]})}},78539:(e,r,t)=>{t.d(r,{A:()=>n});var a=t(95155);function n(e){var r=e.label,t=e.className;return r?(0,a.jsx)("span",{className:"inline-flex items-center rounded-full bg-accent/10 px-2.5 py-1 text-[11px] font-bold uppercase tracking-wide text-accent ".concat(void 0===t?"":t),children:r}):null}},94520:(e,r,t)=>{t.d(r,{Wq:()=>a});function a(e){return e?e.replace("strapistaticupload.s3.us-east-1.amazonaws.com","cdn.getjar.com"):""}},97262:(e,r,t)=>{function a(e){return new Intl.NumberFormat("en-US").format(e)}function n(e){var r=Number.isFinite(e)&&e>0?Math.floor(e):0,t=Math.floor(r/3600),a=Math.floor(r%3600/60);return t>0?"".concat(t,"h ").concat(a,"m"):"".concat(a,"m")}function s(e){return a(null!=e?e:0)}function l(e,r){return"number"==typeof r&&r>0?"".concat(e,"/").concat(r):"".concat(e," XP")}function i(e,r){if(null==e||e<=0)return"Unranked";var t="#".concat(a(e));return"number"==typeof r&&r>0?"".concat(t," of ").concat(a(r)):t}function c(e,r){return null==e||e<=0||null==r||r<=0?null:"".concat(a(e)," XP behind ").concat(i(r))}function o(e){return e?e.split(/([\s-]+)/).map(function(e){return/^[\s-]+$/.test(e)||/[A-Z]/.test(e.slice(1))?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(""):""}function d(e){if(!Number.isFinite(e)||e<=0)return"Recently";var r=Math.floor((Date.now()-e)/864e5);if(r<=0)return"Today";if(1===r)return"Yesterday";if(r<7)return"".concat(r," days ago");var t=Math.floor(r/7);return t<5?1===t?"1 week ago":"".concat(t," weeks ago"):"Recently"}t.d(r,{Ir:()=>s,Sn:()=>o,Uf:()=>i,V7:()=>l,ZV:()=>a,Zg:()=>n,cj:()=>c,fw:()=>d})}}]);
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.