"use strict";(()=>{var e={};e.id=2,e.ids=[2],e.modules={76102:e=>{e.exports=require("@moduletrace/datasquirel/dist/client")},39383:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/actions/users/user-auth")},65967:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/utils/ejson")},93726:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/utils/numberfy")},30889:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/utils/slugify")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},96762:(e,s)=>{Object.defineProperty(s,"M",{enumerable:!0,get:function(){return function e(s,r){return r in s?s[r]:"then"in s&&"function"==typeof s.then?s.then(s=>e(s,r)):"function"==typeof s&&"default"===r?s:void 0}}})},36857:(e,s,r)=>{r.r(s),r.d(s,{config:()=>D,default:()=>u,routeModule:()=>c});var o={};r.r(o),r.d(o,{default:()=>i});var _=r(89947),t=r(2706),n=r(96762),a=r(48786),S=r(69842);async function i(e,s){if("GET"!==e.method)return s.json({msg:"Failed!"});let{user:r}=await (0,S.A)(e,s);if(!r)return s.json({success:!1,msg:"Unauthorized"});let o=await (0,a.A)(`SELECT id,db_name,db_slug,db_full_name FROM user_databases WHERE user_id='${r.id}'`);s.json({success:!0,databases:o})}let u=(0,n.M)(o,"default"),D=(0,n.M)(o,"config"),c=new _.PagesAPIRouteModule({definition:{kind:t.A.PAGES_API,page:"/api/getUserDatabases",pathname:"/api/getUserDatabases",bundlePath:"",filename:""},userland:o})},55153:(e,s,r)=>{r.d(s,{On:()=>_.a,_n:()=>n}),r(76102);var o=r(65967),_=r.n(o);r(30889);var t=r(93726);let n=r.n(t)()},69842:(e,s,r)=>{r.d(s,{A:()=>n});var o=r(39383),_=r.n(o),t=r(55153);async function n(e,s,r,o){let n=_()({req:e,level:r?"deep":void 0}),a={DSQL_REMOTE_SQL_HOST:process.env.DSQL_REMOTE_SQL_HOST,DSQL_SU_USER_ID:process.env.DSQL_SU_USER_ID,DSQL_HOST_ENV:process.env.DSQL_HOST_ENV,DSQL_HOST:process.env.DSQL_HOST,DSQL_STATIC_HOST:process.env.DSQL_STATIC_HOST,DSQL_GOOGLE_CLIENT_ID:process.env.DSQL_GOOGLE_CLIENT_ID,DSQL_TINY_MCE_API_KEY:process.env.DSQL_TINY_MCE_API_KEY};return o&&n.payload?.id&&(0,t._n)(process.env.DSQL_SU_USER_ID)!==n.payload.id?{user:null,appData:a}:{user:n.payload,appData:a}}},48786:(e,s,r)=>{r.d(s,{A:()=>_});var o=r(7447);async function _(...e){let s=(0,o.A)();try{if(!s)throw Error("No Connection provided to DB_HANDLER function!");let r=await s.query(...e);return JSON.parse(JSON.stringify(r))}catch(e){return console.log("DB Error =>",e),{success:!1,error:e.message}}finally{await s?.end()}}},7447:(e,s,r)=>{r.d(s,{A:()=>t});var o=r(9973),_=r.n(o);function t(e){return global.DSQL_USE_LOCAL||e?.local?global.DSQL_DB_CONN||_()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.ro?global.DSQL_READ_ONLY_DB_CONN||_()({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):void 0,charset:"utf8mb4"}}):e?.fa?global.DSQL_FULL_ACCESS_DB_CONN||_()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_FULL_ACCESS_USERNAME,password:process.env.DSQL_DB_FULL_ACCESS_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):global.DSQL_DB_CONN||_()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}})}},2706:(e,s)=>{Object.defineProperty(s,"A",{enumerable:!0,get:function(){return r}});var r=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},89947:(e,s,r)=>{e.exports=r(75600)}};var s=require("../../webpack-api-runtime.js");s.C(e);var r=s(s.s=36857);module.exports=r})();