"use strict";(()=>{var e={};e.id=1383,e.ids=[1383],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")},486:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>h,patchFetch:()=>x,requestAsyncStorage:()=>l,routeModule:()=>d,serverHooks:()=>c,staticGenerationAsyncStorage:()=>m});var a={};r.r(a),r.d(a,{POST:()=>p});var n=r(49303),s=r(88716),o=r(60670),i=r(87070),u=r(72331);async function p(e){try{let{requesterId:t,targetUserId:r,action:a,duration:n}=await e.json();if(!t||!r||!a)return i.NextResponse.json({error:"Missing parameters"},{status:400});let s=await u._.user.findUnique({where:{id:t}});if(!s||"ADMIN"!==s.role)return i.NextResponse.json({error:"Unauthorized"},{status:403});let o=null,p="";if("mute"===a||"ban"===a){if("permanent"===n)(o=new Date).setFullYear(o.getFullYear()+100),p="User banned permanently from chat";else{let e=parseInt(n||"0");if(!(e>0))return i.NextResponse.json({error:"Invalid duration"},{status:400});(o=new Date).setMinutes(o.getMinutes()+e),p=`User muted for ${e} minutes`}}else{if("unmute"!==a)return i.NextResponse.json({error:"Invalid action"},{status:400});o=null,p="User unmuted"}return await u._.user.update({where:{id:r},data:{chatBannedUntil:o}}),i.NextResponse.json({success:!0,message:p})}catch(e){return console.error("Moderation error:",e),i.NextResponse.json({error:e.message||"Internal Server Error"},{status:500})}}let d=new n.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/chat/moderate/route",pathname:"/api/chat/moderate",filename:"route",bundlePath:"app/api/chat/moderate/route"},resolvedPagePath:"C:\\Users\\MSI\\Downloads\\film\\app\\api\\chat\\moderate\\route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:l,staticGenerationAsyncStorage:m,serverHooks:c}=d,h="/api/chat/moderate/route";function x(){return(0,o.patchFetch)({serverHooks:c,staticGenerationAsyncStorage:m})}},72331:(e,t,r)=>{r.d(t,{_:()=>n});var a=r(53524);let n=global.prisma||new a.PrismaClient}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[8948,5972],()=>r(486));module.exports=a})();