"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")},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,t){returntinr?r[t]:"then"inr&&"function"==typeofr.then?r.then(r=>e(r,t)):"function"==typeofr&&"default"===t?r:void0}}})},75461:(e,r,t)=>{t.r(r),t.d(r,{config:()=>p,default:()=>_,routeModule:()=>f});varn={};t.r(n),t.d(n,{default:()=>d});varo=t(89947),s=t(2706),a=t(96762),i=t(48786),u=t(87369),l=t(29021),c=t.n(l);asyncfunctiond(e,r){if("POST"!==e.method)returnr.json({success:!1,msg:"Wrong Method"});lett=await(0,u.A)(e);if(!t?.logged_in_status)returnr.json({success:!1,log:"No Logs"});letn=e.body.user,o=n?.id.toString().replace(/[^0-9]/g,"").replace(/\//g,""),s=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${o}`,a=[];!functione({originArray:r,rootPath:t}){letn=c().readdirSync(t);for(leto=0;o<n.length;o++){lets=n[o];if(s?.match(/\..{2,5}$/))r.push({name:s,type:"file",root:t});else{letn={name:s,type:"folder",root:t,content:[]};e({originArray:n.content,rootPath:`${t}/${s}`}),r.push(n)}}}({originArray:a,rootPath:s});letl=await(0,i.A)(`SHOW databases LIKE 'datasquirel_user_${n.id}_%'`);r.json({success:!0,data:a,databases:l.map(e=>Object.values(e)[0])})}let_=(0,a.M)(n,"default"),p=(0,a.M)(n,"config"),f=newo.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/admin/getUserData",pathname:"/api/admin/getUserData",bundlePath:"",filename:""},userland:n})},87369:(e,r,t)=>{t.d(r,{A:()=>s});varn=t(95969),o=t(89159);asyncfunctions(e){let{keyCookieName:r,csrfCookieName:t}=(0,o.A)(),s=`${r}_su`;if(!e.cookies?.[s])returnconsole.log("No auth key cookie found"),null;leta=(0,n.A)({encryptedString:e.cookies[s]});if(!a)returnconsole.log("No user payload found"),null;leti=JSON.parse(a);returni.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},89159:(e,r,t)=>{t.d(r,{A:()=>n});functionn(e){letr=process.env.DSQL_COOKIES_PREFIX||"dsql_",t=process.env.DSQL_COOKIES_KEY_NAME||"key",n=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",o=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",s=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),a=r;e?.userId&&(a+=`user_${e.userId}_`),s&&(a+=`${s}_`),a+=t;leti=r;e?.userId&&(i+=`user_${e.userId}_`),s&&(i+=`${s}_`),i+=n;letu=r;returne?.userId&&(u+=`user_${e.userId}_`),s&&(u+=`${s}_`),{keyCookieName:a,csrfCookieName:i,oneTimeCodeName:u+=o}}},95969:(e,r,t)=>{t.d(r,{A:()=>s});varn=t(55511),o=t(79428);functions({encryptedString:e,encryptionKey:r,encryptionSalt:t}){if(!e?.match(/./))returnconsole.log("Encrypted string is invalid"),e;lets=r||process.env.DSQL_ENCRYPTION_PASSWORD,a=t||process.env.DSQL_ENCRYPTION_SALT,i=process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24;if(!s?.match(/.{8,}/))returnconsole.log("Decrption key is invalid"),e;if(!a?.match(/.{8,}/))returnconsole.log("Decrption salt is invalid"),e;letu=(0,n.scryptSync)(s,a,i),l=o.Buffer.alloc(16,0),c=(0,n.createDecipheriv)("aes-192-cbc",u,l);try{letr=c.update(e,"hex","utf8");returnr+=c.final("utf8")}catch(r){returnconsole.log("Error in decrypting =>",r.message),e}}},48786:(e,r,t)=>{t.d(r,{A:()=>n});asyncfunctionn(...e){letr=global.DSQL_DB_CONN;try{if(!r)throwError("No Connection provided to DB_HANDLER function!");lett=awaitr.query(...e);returnJSON.parse(JSON.stringify(t))}catch(e){returnconsole.log("DB Error =>",e),{success:!1,error:e.message}}finally{awaitr?.end()}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){returnt}});vart=function(e){returne.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},89947:(e,r,t)=>{e.exports=t(75600)}};varr=require("../.