"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7817],{29267:function(e,a,t){t.d(a,{k:function(){return x}});var l=t(31549),s=t(13546),r=t.n(s),i=t(36435),n=t.n(i);t(44194);var o=t(28408),m=t(5634),d=t(41666),c=t(89277),u=t(26644);let x=e=>{let{game:a,className:t}=e,{avgReviewRating:s}=a,i=s||"N/A";return(0,l.jsxs)("div",{className:(0,c.cn)("group relative h-48 w-full overflow-hidden rounded-lg hover:cursor-pointer md:h-64",t),children:[(0,l.jsx)("div",{className:"absolute left-0 top-0 h-full w-full object-cover transition duration-200 ease-in-out group-hover:scale-110",children:(0,l.jsx)(n(),{fill:!0,className:"object-cover",src:(0,d.y8)(a,"logo.formats.small.url"),alt:r()(a,"name","Game logo")||"Game logo",title:r()(a,"name","Game logo")||"Game logo",sizes:"(max-width: 768px) 160px, 260px"})}),(0,l.jsxs)("div",{className:"absolute top-0 flex w-full flex-col items-start justify-between gap-1 p-1 2xl:flex-row",children:[(0,l.jsx)(m.K,{className:"z-50 rounded-md bg-backgroundContrast p-2 drop-shadow-lg",content:(0,l.jsx)("span",{className:"text-sm font-light text-gray-700",children:"Average review rating (list of reviews can be found on the game page)"}),children:(0,l.jsxs)("div",{className:"mr-auto flex items-center justify-start gap-2 rounded-full bg-black/60 p-1 pr-4 backdrop-blur",children:[(0,l.jsx)("div",{className:"bg-gradient-youtube relative flex h-5 w-5 items-center justify-center rounded-full md:h-8 md:w-8",children:(0,l.jsx)(o.QJe,{className:"h-3 w-3 fill-yellowStatic-600 md:h-5 md:w-5"})}),(0,l.jsx)("span",{className:(0,c.cn)("self-center text-lg font-black leading-none md:text-2xl","number"==typeof i&&i>8?"text-gradient-hot":"text-white"),children:i})]})}),(0,l.jsx)(m.K,{className:"z-50 rounded-md bg-backgroundContrast p-2 drop-shadow-lg",content:(0,l.jsxs)("span",{className:"text-sm font-light text-gray-700",children:[(0,l.jsx)("span",{className:"font-semibold text-gray-900",children:a.name})," was released"," ",a.releaseDate?(0,u.Z)(new Date(a.releaseDate),"do MMMM yyyy"):"N/A","."]}),children:(0,l.jsx)("div",{className:"flex flex-grow items-center justify-end",children:(0,l.jsx)("div",{className:"rounded-full bg-black/60 px-2 text-xs font-black text-white backdrop-blur",children:a.releaseDate?(0,u.Z)(new Date(a.releaseDate),"dd-MM-yyyy"):"N/A"})})})]})]})}},37817:function(e,a,t){t.r(a),t.d(a,{IndexPageGamesComponent:function(){return p}});var l=t(31549),s=t(40451),r=t(42762),i=t(78984),n=t(89277),o=t(44194),m=t(21584),d=t(61906);let c=e=>{let{className:a}=e,t=(0,m.T)(),{sortBy:s}=(0,m.C)(e=>e.games.sidebar);return(0,l.jsxs)(r.Ph,{value:s,onValueChange:e=>{t((0,d.km)(e))},children:[(0,l.jsx)(r.i4,{className:(0,n.cn)("h-[38px] rounded-lg bg-backgroundContrast py-0 text-sm",a),"aria-label":"Sort",children:(0,l.jsx)(r.ki,{placeholder:"Sort by"})}),(0,l.jsx)(r.Bw,{className:"bg-backgroundContrast",children:(0,l.jsxs)(r.DI,{children:[(0,l.jsx)(r.n5,{children:"Sort by"}),(0,l.jsx)(r.Ql,{value:i.e.RTP_DESC,children:"RTP"}),(0,l.jsx)(r.Ql,{value:i.e.VOLATILITY_DESC,children:"Volatility"}),(0,l.jsx)(r.Ql,{value:i.e.MAX_BET_DESC,children:"Max Bet"}),(0,l.jsx)(r.Ql,{value:i.e.MAX_PAYOUT_DESC,children:"Max Payout"}),(0,l.jsx)(r.Ql,{value:i.e.HIT_FREQUENCY_DESC,children:"Hit Frequency"}),(0,l.jsx)(r.Ql,{value:i.e.RELEASE_DESC,children:"Newest"}),(0,l.jsx)(r.Ql,{value:i.e.RELEASE_ASC,children:"Oldest"})]})})]})};var u=t(11763),x=t(89978),h=t(22826),g=t(29630),v=t(96296),b=t(59e3),f=t(29267);let p=()=>{let{data:e=[],isFetching:a}=(0,v.c8)(),{sortBy:t}=(0,m.C)(e=>e.games.sidebar),{isLargerThanBreakpoint:r}=(0,h.g)((0,x.a)(u.r.md),{value:u.r.lg,isLargerThanBreakpoint:!0}),i=(0,o.useMemo)(()=>[...e].sort((e,a)=>{var l,s,r,i,n,o,m,d,c,u;let[x,h]=t.split(":");return"release"===x&&e.releaseDate&&a.releaseDate?"asc"===h?new Date(e.releaseDate).getTime()-new Date(a.releaseDate).getTime():new Date(a.releaseDate).getTime()-new Date(e.releaseDate).getTime():"maxBet"===x&&(null===(l=e.information)||void 0===l?void 0:l.maxBet)&&(null===(s=a.information)||void 0===s?void 0:s.maxBet)?"asc"===h?Number(e.information.maxBet)-Number(a.information.maxBet):Number(a.information.maxBet)-Number(e.information.maxBet):"maxPayout"===x&&(null===(r=e.math)||void 0===r?void 0:r.maxPayout)&&(null===(i=a.math)||void 0===i?void 0:i.maxPayout)?"asc"===h?Number(e.math.maxPayout)-Number(a.math.maxPayout):Number(a.math.maxPayout)-Number(e.math.maxPayout):"hitFrequency"===x&&(null===(n=e.math)||void 0===n?void 0:n.hitFrequency)&&(null===(o=a.math)||void 0===o?void 0:o.hitFrequency)?"asc"===h?Number(e.math.hitFrequency)-Number(a.math.hitFrequency):Number(a.math.hitFrequency)-Number(e.math.hitFrequency):"rtp"===x&&(null===(m=e.math)||void 0===m?void 0:m.rtp)&&(null===(d=a.math)||void 0===d?void 0:d.rtp)?"asc"===h?Number(e.math.rtp)-Number(a.math.rtp):Number(a.math.rtp)-Number(e.math.rtp):"volatility"===x&&(null===(c=e.math)||void 0===c?void 0:c.volatility)&&(null===(u=a.math)||void 0===u?void 0:u.volatility)?"asc"===h?Number(e.math.volatility)-Number(a.math.volatility):Number(a.math.volatility)-Number(e.math.volatility):0}).slice(0,r?8:6),[e,t,r]);return(0,l.jsxs)("div",{className:"flex flex-col gap-4 rounded-lg bg-backgroundContrast p-4",children:[(0,l.jsxs)("div",{className:"flex flex-row items-end justify-between space-x-2",children:[(0,l.jsx)("h2",{className:"text-3xl font-semibold text-text hover:text-gray-500",children:(0,l.jsx)(s.A,{"aria-label":"games page link",href:"/games",children:"Games"})}),(0,l.jsx)(c,{className:"flex-0 w-[180px]"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:[a&&(0,b.Ri)(i.length||8).map(e=>(0,l.jsx)("div",{className:"h-48 w-full animate-pulse rounded-lg bg-gray-100 md:h-64"},e)),!a&&i.map(e=>(0,l.jsx)(s.A,{"aria-label":"".concat(e.name," link"),href:"/games/".concat(e.slug),className:"relative space-y-2",children:(0,l.jsx)(f.k,{game:e})},"".concat(e.gameId,"-gameCardComponent")))]}),(0,l.jsxs)("div",{className:"group relative place-self-end font-light text-gray-800",children:[(0,l.jsx)(s.A,{"aria-label":"games page link",href:"/games",children:(0,l.jsxs)("div",{className:"flex flex-row items-center justify-center text-3xl font-semibold",children:["All Games ",(0,l.jsx)(g.qvS,{size:"28",className:"ml-2"})]})}),(0,l.jsx)("span",{className:"absolute -bottom-1 left-0 h-px w-0 bg-gray-800 transition-all group-hover:w-full"})]})]})}}}]);