"use strict";(()=>{var e={};e.id=525,e.ids=[525],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},81630:e=>{e.exports=require("http")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},42513:(e,r,n)=>{n.r(r),n.d(r,{config:()=>d,default:()=>p,routeModule:()=>f});var t={};n.r(t),n.d(t,{default:()=>a});var o=n(89947),s=n(2706),i=n(96762),u=n(19131),c=n.n(u);let l=n(29021);async function a(e,r){if("POST"!==e.method)return r.json({success:!1,msg:"Wrong Method"});let n=await c()(e);if(!n?.logged_in_status)return r.json({success:!1,log:"No Logs"});let t=e.body.user.id.toString().replace(/[^0-9]/g,"").replace(/\//g,""),o=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${t}/backups`;l.existsSync(o)||l.mkdirSync(o);let s=l.readdirSync(o);r.json({success:!0,backups:s})}let p=(0,i.M)(t,"default"),d=(0,i.M)(t,"config"),f=new o.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/admin/getUserBackups",pathname:"/api/admin/getUserBackups",bundlePath:"",filename:""},userland:t})},19131:(e,r,n)=>{let{IncomingMessage:t}=n(81630),o=n(72835),s=n(31341);e.exports=async function(e){let{keyCookieName:r,csrfCookieName:n}=s(),t=`${r}_su`;if(!e.cookies?.[t])return console.log("No auth key cookie found"),null;let i=o({encryptedString:e.cookies[t]});if(!i)return console.log("No user payload found"),null;let u=JSON.parse(i);return u.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):u.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):u}},31341:e=>{e.exports=function(){let e=process.env.DSQL_COOKIES_PREFIX||"dsql_";return{keyCookieName:e+(process.env.DSQL_COOKIES_KEY_NAME||"key"),csrfCookieName:e+(process.env.DSQL_COOKIES_CSRF_NAME||"csrf")}}},72835:(e,r,n)=>{let{scryptSync:t,createDecipheriv:o}=n(55511),{Buffer:s}=n(79428);e.exports=({encryptedString:e,encryptionKey:r,encryptionSalt:n})=>{if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let i=r||process.env.DSQL_ENCRYPTION_PASSWORD,u=n||process.env.DSQL_ENCRYPTION_SALT,c=process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24;if(!i?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!u?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let l=o("aes-192-cbc",t(i,u,c),s.alloc(16,0));try{let r=l.update(e,"hex","utf8");return r+=l.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),e}}},2706:(e,r)=>{var n;Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE"}(n||(n={}))},89947:(e,r,n)=>{e.exports=n(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var n=r(r.s=42513);module.exports=n})();