"use strict";(()=>{var e={};e.id=2628,e.ids=[2628,2331],e.modules={53524:e=>{e.exports=require("@prisma/client")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},8235:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>_,patchFetch:()=>g,requestAsyncStorage:()=>l,routeModule:()=>d,serverHooks:()=>m,staticGenerationAsyncStorage:()=>p});var a={};r.r(a),r.d(a,{GET:()=>c});var i=r(49303),s=r(88716),o=r(60670),n=r(87070),u=r(72331);async function c(e){try{let{searchParams:t}=new URL(e.url),r=parseInt(t.get("page")??"1"),a=parseInt(t.get("limit")??"20"),i=t.get("search")??"",s=t.get("premium_tier"),o=t.get("is_locked"),c=(r-1)*a,d={};i&&(d.userId={contains:i}),s&&(d.premiumTier=s),null!==o&&""!==o&&(d.isLocked="true"===o);let[l,p]=await Promise.all([u.prisma.user.findMany({where:d,select:{id:!0,userId:!0,premiumTier:!0,premiumExpiresAt:!0,rankTier:!0,level:!0,totalPoints:!0,totalCoins:!0,currentStreak:!0,totalPredictions:!0,correctPredictions:!0,accuracyRate:!0,isLocked:!0,failedLoginAttempts:!0,createdAt:!0,favoriteClubId:!0,birthday:!0,favoriteClub:{select:{id:!0,name:!0,code:!0}}},orderBy:{createdAt:"desc"},skip:c,take:a}),u.prisma.user.count({where:d})]);return n.NextResponse.json({success:!0,data:l.map(e=>({id:e.id,user_id:e.userId,premium_tier:e.premiumTier,premium_expires_at:e.premiumExpiresAt,rank_tier:e.rankTier,level:e.level,total_points:e.totalPoints,total_coins:e.totalCoins,current_streak:e.currentStreak,total_predictions:e.totalPredictions,correct_predictions:e.correctPredictions,accuracy_rate:e.accuracyRate,is_locked:e.isLocked,failed_login_attempts:e.failedLoginAttempts,created_at:e.createdAt,birthday:e.birthday,favorite_club_id:e.favoriteClubId,favorite_club_name:e.favoriteClub?.name??null,favorite_club_code:e.favoriteClub?.code??null})),pagination:{page:r,limit:a,total:p,total_pages:Math.ceil(p/a)}})}catch(e){return console.error("Admin users GET error:",e),n.NextResponse.json({success:!1,message:"Gagal memuat data pengguna"},{status:500})}}let d=new i.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/admin/users/route",pathname:"/api/admin/users",filename:"route",bundlePath:"app/api/admin/users/route"},resolvedPagePath:"C:\\xampp\\htdocs\\Bolafest\\app\\api\\admin\\users\\route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:l,staticGenerationAsyncStorage:p,serverHooks:m}=d,_="/api/admin/users/route";function g(){return(0,o.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:p})}},72331:(e,t,r)=>{r.d(t,{prisma:()=>i});var a=r(53524);let i=globalThis.prisma??new a.PrismaClient({log:["error"]})}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[9276,5972],()=>r(8235));module.exports=a})();