1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[173],{41285:function(e,t,s){Promise.resolve().then(s.bind(s,2300))},76213:function(e,t,s){"use strict";var r=s(57437);s(2265),t.Z=e=>{let{color:t="#FFBC13",size:s=36,className:l=""}=e;return(0,r.jsx)("svg",{width:s,height:s,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:l,children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.08279 2.16656C6.70204 2.16619 6.37382 2.16588 6.08306 2.23568C5.25399 2.43473 4.58976 3.04034 4.30961 3.83328H3.00001C1.80339 3.83328 0.833344 4.80332 0.833344 5.99994V7.16661C0.833344 9.70779 2.72879 11.8059 5.18341 12.1247C6.08479 13.4413 7.51363 14.371 9.16668 14.6075V17.1666H6.66668C6.20644 17.1666 5.83334 17.5397 5.83334 17.9999C5.83334 18.4602 6.20644 18.8333 6.66668 18.8333H13.3333C13.7936 18.8333 14.1667 18.4602 14.1667 17.9999C14.1667 17.5397 13.7936 17.1666 13.3333 17.1666H10.8333V14.6075C12.4864 14.371 13.9152 13.4413 14.8166 12.1247C17.2712 11.8059 19.1667 9.70779 19.1667 7.16661V5.99994C19.1667 4.80333 18.1966 3.83328 17 3.83328H15.6904C15.4103 3.04034 14.746 2.43473 13.917 2.23568C13.6262 2.16588 13.298 2.16619 12.9172 2.16656H7.08279ZM3.00001 5.49994H4.16668V8.83328C4.16668 9.27985 4.217 9.71513 4.31231 10.1335C3.23632 9.58074 2.50001 8.45956 2.50001 7.16661V5.99994C2.50001 5.7238 2.72387 5.49994 3.00001 5.49994ZM17.5 7.16661C17.5 8.45956 16.7637 9.58075 15.6877 10.1335C15.783 9.71513 15.8333 9.27985 15.8333 8.83328V5.49994H17C17.2762 5.49994 17.5 5.7238 17.5 5.99994V7.16661Z",fill:t})})}},2300:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return o}});var r=s(57437),l=s(2265),n=s(49864),a=s(33145),i=s(27648),c=s(76213);let d=e=>{let{rank:t,size:s=18}=e;return 1===t?(0,r.jsx)("div",{className:"bg-[#FFD700] p-1 rounded-full",children:(0,r.jsx)(c.Z,{color:"#fff",size:s})}):2===t?(0,r.jsx)("div",{className:"bg-[#C0C0C0] p-1 rounded-full",children:(0,r.jsx)(c.Z,{color:"#fff",size:s})}):3===t?(0,r.jsx)("div",{className:"bg-[#CD7F32] p-1 rounded-full",children:(0,r.jsx)(c.Z,{color:"#fff",size:s})}):(0,r.jsx)("span",{className:"text-gray-500 text-sm ",children:t.toString().padStart(2,"0")})};function o(){let[e,t]=(0,l.useState)([]),[s,c]=(0,l.useState)(!0);(0,l.useEffect)(()=>{(async()=>{try{let e=await (0,n.Zp)(20);t(e)}catch(e){console.error("Error fetching leaderboard:",e)}finally{c(!1)}})()},[]);let o=e=>e.length>15?e.slice(0,13)+"..":e;return(0,r.jsx)("div",{className:"bg-background ",style:{backgroundImage:"url('/board.png')",backgroundSize:"cover",backgroundPosition:"center",backgroundAttachment:"fixed"},children:(0,r.jsxs)("div",{className:"min-h-screen w-full max-w-xl mx-auto p-4 pt-0 flex flex-col",style:{minHeight:"100vh"},children:[(0,r.jsx)("div",{className:"bg-tangerine-500 rounded-xl p-4 mx-4 rounded-t-none mb-6 shadow-lg text-center",children:(0,r.jsx)("h1",{className:"text-4xl text-white",children:"Leaderboard"})}),(0,r.jsx)("div",{className:"flex-grow",style:{paddingBottom:"90px"},children:s?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center h-[60vh] gap-4",children:[(0,r.jsx)("div",{className:"relative w-16 h-16",children:(0,r.jsx)("div",{className:"absolute inset-0 border-4 border-tangerine-500 border-t-transparent rounded-full animate-spin"})}),(0,r.jsx)("p",{className:"text-white animate-pulse",children:"Loading scores..."})]}):(0,r.jsxs)("div",{className:"space-y-4",children:[e.map((e,t)=>(0,r.jsx)("div",{className:"bg-white rounded-xl shadow-md w-full ",children:t<3?(0,r.jsxs)("div",{className:" relative ",children:[(0,r.jsx)("div",{className:"absolute -top-2 -left-2 rotate-12 z-10 overflow-visible",children:(0,r.jsx)(d,{rank:t+1})}),(0,r.jsxs)("div",{className:"flex items-center px-2 py-1 gap-3",children:[(0,r.jsx)("div",{className:"relative w-14 h-14 flex-shrink-0",children:(0,r.jsx)(a.default,{src:e.pfp_url||"/default-avatar.png",alt:e.username,fill:!0,className:"rounded-full object-cover"})}),(0,r.jsxs)("div",{className:"flex-grow min-w-0",children:[(0,r.jsx)("h3",{className:" text-[16px] font-inter font-bold text-black",children:o(e.name||e.username)}),(0,r.jsxs)("p",{className:"text-gray-400 text-sm font-inter",children:["@",e.username]})]}),(0,r.jsx)("div",{className:"flex-shrink-0 text-5xl text-tangerine-500",children:e.score.toLocaleStr
1ing()})]})]}):(0,r.jsxs)("div",{className:"flex items-center px-2 py-1 gap-3",children:[(0,r.jsx)("div",{className:"flex-shrink-0 flex justify-center",children:(0,r.jsx)(d,{rank:t+1})}),(0,r.jsx)("div",{className:"relative w-14 h-14 flex-shrink-0",children:(0,r.jsx)(a.default,{src:e.pfp_url||"/default-avatar.png",alt:e.username,fill:!0,className:"rounded-full object-cover"})}),(0,r.jsxs)("div",{className:"flex-grow min-w-0",children:[(0,r.jsx)("h3",{className:" text-[16px] font-inter font-bold text-black",children:o(e.name||e.username)}),(0,r.jsxs)("p",{className:"text-gray-400 text-sm font-inter",children:["@",e.username]})]}),(0,r.jsx)("div",{className:"flex-shrink-0 text-5xl text-tangerine-500",children:e.score.toLocaleString()})]})},e.id)),0===e.length&&(0,r.jsxs)("div",{className:"text-center py-16 bg-white rounded-xl",children:[(0,r.jsx)("h3",{className:"text-2xl font-bold mb-2",children:"No Scores Yet!"}),(0,r.jsx)("p",{className:"text-gray-600 mb-6",children:"Be the first to claim your spot on the leaderboard."}),(0,r.jsxs)(i.default,{href:"/",className:"inline-flex items-center gap-2 bg-tangerine-500 text-white px-6 py-3 rounded-full font-bold hover:bg-tangerine-600 transition-all",children:[(0,r.jsx)("span",{children:"\uD83C\uDFAE"}),(0,r.jsx)("span",{children:"Play Now"})]})]})]})}),(0,r.jsx)("div",{className:"fixed bottom-0 left-0 w-full px-4 z-20 pb-4 pt-2",style:{backgroundImage:"url('/board.png')",backgroundSize:"cover",backgroundPosition:"center",backgroundAttachment:"fixed",boxShadow:"0 -2px 16px rgba(0,0,0,0.08)"},children:(0,r.jsx)(i.default,{href:"/",className:"bg-tangerine-500 text-white px-6 py-3 rounded-xl text-3xl text-center hover:bg-tangerine-600 transition-all shadow-lg block",style:{width:"100%"},children:"Back to Game"})})]})})}},49864:function(e,t,s){"use strict";s.d(t,{Zp:function(){return n},rl:function(){return l}});let r=(0,s(67026).eI)("https://dcrmbccvbanstkhvgaed.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImRjcm1iY2N2YmFuc3RraHZnYWVkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDcwNjYxOTQsImV4cCI6MjA2MjY0MjE5NH0.sQxnAd4er_tePVpgmb1VGEK2mPskD16C6ar7Eqz_OME");async function l(e){try{var t;let{data:s,error:l}=await r.from("fruit_ninja_scores").select("score").eq("fid",e).order("score",{ascending:!1}).limit(1);if(console.log("data",s),l)throw l;return(null==s?void 0:null===(t=s[0])||void 0===t?void 0:t.score)||0}catch(e){return console.error("Error fetching player best score:",e),0}}async function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;try{let{data:t,error:s}=await r.from("fruit_ninja_scores").select("*").order("score",{ascending:!1}).limit(e);if(s)throw s;return t||[]}catch(e){return console.error("Error fetching leaderboard:",e),[]}}}},function(e){e.O(0,[957,319,971,117,744],function(){return e(e.s=41285)}),_N_E=e.O()}]);
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.