"use strict";(()=>{vare={};e.id=964,e.ids=[964],e.modules={39908:e=>{e.exports=require("@moduletrace/datasquirel/dist/users/user-auth")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},72583:e=>{e.exports=require("sanitize-html")},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,t){returntinr?r[t]:"then"inr&&"function"==typeofr.then?r.then(r=>e(r,t)):"function"==typeofr&&"default"===t?r:void0}}})},48171:(e,r,t)=>{t.r(r),t.d(r,{config:()=>d,default:()=>p,routeModule:()=>f});varn={};t.r(n),t.d(n,{default:()=>u});varo=t(89947),s=t(2706),a=t(96762),i=t(67619),c=t(69842),l=t(30802);asyncfunctionu(e,r){if("POST"!==e.method)returnr.json({msg:"Failed!"});lett=await(0,c.A)(e,r,!0);if(!t)returnr.json({success:!1,msg:"Unauthorized"});let{dbId:n}=e.body;try{if(!n)throwError("No Target Database ID provided");await(0,l.A)({tableName:"user_databases",data:{remote_connected:0,remote_connection_host:"",remote_connection_key:"",remote_connection_type:"",remote_db_full_name:""},identifierColumnName:"id",identifierValue:n}),r.json({success:!0})}catch(e){console.log("Disconnect Error, =>",e.message),(0,i.A)({component:"/api/connect/verify/main-catch-error",message:e.message,user:t}),r.json({success:!1,msg:"Operation Failed!"})}}letp=(0,a.M)(n,"default"),d=(0,a.M)(n,"config"),f=newo.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/connect/disconnect",pathname:"/api/connect/disconnect",bundlePath:"",filename:""},userland:n})},69842:(e,r,t)=>{t.d(r,{A:()=>s});varn=t(39908),o=t.n(n);asyncfunctions(e,r,t){letn=o()({req:e,level:t?"deep":void0});returnconsole.log(n),n.payload}},30802:(e,r,t)=>{t.d(r,{A:()=>u});varn=t(72583),o=t.n(n),s=t(92652),a=t(48786),i=t(37897),c=t(68829),l=t(62050);asyncfunctionu({dbContext:e,paradigm:r,dbFullName:t,tableName:n,data:u,tableSchema:p,identifierColumnName:d,identifierValue:f,encryptionKey:_,encryptionSalt:S,useLocal:y}){if(!u||!Object.keys(u).length)returnnull;letg=!!y||!e?.match(/dsql.user/i)&&(!t||!!t.match(/^datasquirel$/)),m=y?l.A:g?a.A:i.A,A=Object.keys(u),D=[],h=[];for(lete=0;e<A.length;e++)try{letr=A[e],t=u[r],n=p?p?.fields?.filter(e=>e.fieldName===r):null,a=n&&n[0]?n[0]:null;if(null==t||void0==t)continue;leti=/<[^>]+>/g;(a?.richText||String(t).match(i))&&(t=o()(t,s.A)),a?.encrypted&&(t=(0,c.A)({data:t,encryptionKey:_,encryptionSalt:S})),"object"==typeoft&&(t=JSON.stringify(t)),a?.pattern&&!newRegExp(a.pattern,a.patternFlags||"").test(t)&&(console.log("DSQL: Pattern not matched =>",t),t=""),"string"==typeoft&&t.match(/^null$/i)&&(t={toSqlString:function(){return"NULL"}}),"string"!=typeoft||t.match(/./i)||(t={toSqlString:function(){return"NULL"}}),D.push(`\`${r}\`=?`),"number"==typeoft?h.push(String(t)):h.push(t)}catch(e){console.log("DSQL: Error in parsing data keys in update function =>",e.message);continue}D.push(`date_updated='${Date()}'`),D.push(`date_updated_code='${Date.now()}'`);letE=`UPDATE \`${t}\`.\`${n}\` SET ${D.join(",")} WHERE \`${d}\`=?`;returnh.push(f),g?awaitm(E,h):awaitm({paradigm:r,queryString:E,queryValues:h})}},92652:(e,r,t)=>{t.d(r,{A:()=>n});letn={allowedTags:["b","i","em","strong","a","p","span","ul","ol","li","h1","h2","h3","h4","h5","h6","img","div","button","pre","code","br"],allowedAttributes:{a:["href"],img:["src","alt","width","height","class","style"],"*":["style","class"]}}},67619:(e,r,t)=>{t.d(r,{A:()=>s});varn=t(29021),o=t.n(n);asyncfunctions({user:e,message:r,component:t,noMail:n,req:s}){leta=newDate,i=(()=>{if(!s)returnnull;try{lete=s.headers["x-forwarded-for"],r=s.headers["x-real-ip"],t=s.headers["cf-connecting-ip"],n=Array.isArray(e)?e[0]:e?.split(",")[0],o=t||n||r||s.socket.remoteAddress;if(!o)returnnull;returnString(o)}catch(e){returnnull}})();try{letn=`🚀 SERVER ERROR ===========================