"use strict";(()=>{var e={};e.id=3440,e.ids=[3440],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")},74625:(e,a,n)=>{n.r(a),n.d(a,{originalPathname:()=>M,patchFetch:()=>_,requestAsyncStorage:()=>f,routeModule:()=>l,serverHooks:()=>y,staticGenerationAsyncStorage:()=>m});var t={};n.r(t),n.d(t,{GET:()=>c,dynamic:()=>d});var r=n(49303),i=n(88716),o=n(60670),s=n(87070),u=n(72331);let d="force-dynamic";async function p(e){let{searchParams:a}=new URL(e.url),n=a.get("userId")||e.headers.get("x-user-id");if(!n)return!1;let t=await u._.user.findUnique({where:{id:n}});return t?.role==="ADMIN"}async function c(e){if(!await p(e))return s.NextResponse.json({error:"Unauthorized"},{status:401});try{let[e,a,n,t,r,i,o,d,p,c,l,f]=await Promise.all([u._.user.findMany(),u._.transaction.findMany(),u._.systemConfig.findMany(),u._.banner.findMany(),u._.vipPackage.findMany(),u._.coinPackage.findMany(),u._.voucher.findMany(),u._.report.findMany(),u._.comment.findMany(),u._.watchHistory.findMany(),u._.favorite.findMany(),u._.notification.findMany()]),m={timestamp:new Date().toISOString(),data:{users:e,transactions:a,configs:n,banners:t,vipPackages:r,coinPackages:i,vouchers:o,reports:d,comments:p,watchHistory:c,favorites:l,notifications:f}};return s.NextResponse.json(m)}catch(e){return console.error("Backup failed:",e),s.NextResponse.json({error:"Backup failed"},{status:500})}}let l=new r.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/admin/backup/route",pathname:"/api/admin/backup",filename:"route",bundlePath:"app/api/admin/backup/route"},resolvedPagePath:"C:\\Users\\MSI\\Downloads\\film\\app\\api\\admin\\backup\\route.ts",nextConfigOutput:"standalone",userland:t}),{requestAsyncStorage:f,staticGenerationAsyncStorage:m,serverHooks:y}=l,M="/api/admin/backup/route";function _(){return(0,o.patchFetch)({serverHooks:y,staticGenerationAsyncStorage:m})}},72331:(e,a,n)=>{n.d(a,{_:()=>r});var t=n(53524);let r=global.prisma||new t.PrismaClient}};var a=require("../../../../webpack-runtime.js");a.C(e);var n=e=>a(a.s=e),t=a.X(0,[8948,5972],()=>n(74625));module.exports=t})();