"use strict";(()=>{vare={};e.id=9664,e.ids=[9664],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){returnfunctione(r,s){returnsinr?r[s]:"then"inr&&"function"==typeofr.then?r.then(r=>e(r,s)):"function"==typeofr&&"default"===s?r:void0}}})},75461:(e,r,s)=>{s.r(r),s.d(r,{config:()=>d,default:()=>p,routeModule:()=>S});varo={};s.r(o),s.d(o,{default:()=>l});varn=s(89947),t=s(2706),a=s(96762),_=s(48786),c=s(87369),i=s(29021),u=s.n(i);asyncfunctionl(e,r){if("POST"!==e.method)returnr.json({success:!1,msg:"Wrong Method"});lets=await(0,c.A)(e);if(!s?.logged_in_status)returnr.json({success:!1,log:"No Logs"});leto=e.body.user,n=o?.id.toString().replace(/[^0-9]/g,"").replace(/\//g,""),t=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${n}`,a=[];!functione({originArray:r,rootPath:s}){leto=u().readdirSync(s);for(letn=0;n<o.length;n++){lett=o[n];if(t?.match(/\..{2,5}$/))r.push({name:t,type:"file",root:s});else{leto={name:t,type:"folder",root:s,content:[]};e({originArray:o.content,rootPath:`${s}/${t}`}),r.push(o)}}}({originArray:a,rootPath:t});leti=await(0,_.A)(`SHOW databases LIKE 'datasquirel_user_${o.id}_%'`);r.json({success:!0,data:a,databases:i.map(e=>Object.values(e)[0])})}letp=(0,a.M)(o,"default"),d=(0,a.M)(o,"config"),S=newn.PagesAPIRouteModule({definition:{kind:t.A.PAGES_API,page:"/api/admin/getUserData",pathname:"/api/admin/getUserData",bundlePath:"",filename:""},userland:o})},87369:(e,r,s)=>{s.d(r,{A:()=>t});varo=s(95969),n=s(89159);asyncfunctiont(e){let{keyCookieName:r,csrfCookieName:s}=(0,n.A)(),t=`${r}_su`;if(!e.cookies?.[t])returnconsole.log("No auth key cookie found"),null;leta=(0,o.A)({encryptedString:e.cookies[t]});if(!a)returnconsole.log("No user payload found"),null;let_=JSON.parse(a);return_.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):_.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):_}},89159:(e,r,s)=>{s.d(r,{A:()=>o});functiono(e){letr=process.env.DSQL_COOKIES_PREFIX||"dsql_",s=process.env.DSQL_COOKIES_KEY_NAME||"key",o=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",n=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",t=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),a=r;e?.userId&&(a+=`user_${e.userId}_`),t&&(a+=`${t}_`),a+=s;let_=r;e?.userId&&(_+=`user_${e.userId}_`),t&&(_+=`${t}_`),_+=o;letc=r;returne?.userId&&(c+=`user_${e.userId}_`),t&&(c+=`${t}_`),{keyCookieName:a,csrfCookieName:_,oneTimeCodeName:c+=n}}},95969:(e,r,s)=>{s.d(r,{A:()=>a});varo=s(55511),n=s(79428),t=s(32443);functiona({encryptedString:e,encryptionKey:r,encryptionSalt:s}){if(!e?.match(/./))returnconsole.log("Encrypted string is invalid"),e;let{key:a,salt:_,keyLen:c,algorithm:i,bufferAllocSize:u}=(0,t.A)({encryptionKey:r});if(!a?.match(/.{8,}/))returnconsole.log("Decrption key is invalid"),e;if(!_?.match(/.{8,}/))returnconsole.log("Decrption salt is invalid"),e;letl=(0,o.scryptSync)(a,_,c),p=n.Buffer.alloc(u,0),d=(0,o.createDecipheriv)(i,l,p);try{letr=d.update(e,"hex","utf8");returnr+=d.final("utf8")}catch(r){returnconsole.log("Error in decrypting =>",r.message),e}}},48786:(e,r,s)=>{s.d(r,{A:()=>n});varo=s(7447);asyncfunctionn(...e){letr=(0,o.A)();try{if(!r)throwError("No Connection provided to DB_HANDLER function!");lets=awaitr.query(...e);returnJSON.parse(JSON.stringify(s))}catch(e){returnconsole.log("DB Error =>",e),{success:!1,error:e.message}}finally{awaitr?.end()}}},7447:(e,r,s)=>{s.d(r,{A:()=>t});varo=s(9973),n=s.n(o);functiont(e){returne?.ro?DSQL_READ_ONLY_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_READ_ONLY_USERNAME,password:process.env.DSQL_DB_READ_ONLY_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void0,char