"use strict";(()=>{vare={};e.id=3683,e.ids=[3683],e.modules={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")},81630:e=>{e.exports=require("http")},33873:e=>{e.exports=require("path")},96762:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){returnfunctione(t,r){returnrint?t[r]:"then"int&&"function"==typeoft.then?t.then(t=>e(t,r)):"function"==typeoft&&"default"===r?t:void0}}})},96016:(e,t,r)=>{r.r(t),r.d(t,{config:()=>f,default:()=>d,routeModule:()=>S});vars={};r.r(s),r.d(s,{default:()=>p});varn=r(89947),a=r(2706),o=r(96762),i=r(33364),c=r.n(i),u=r(6420),l=r.n(u);asyncfunctionp(e,t){if("POST"!==e.method)returnt.json({msg:"Failed!"});if(!awaitl()(e,t,!0))returnt.json({success:!1,msg:"Unauthorized"});let{dbFullName:r,payload:s}=e.body,n=(()=>{lete=Object.keys(s),t={};returne.forEach(e=>{!e?.match(/user_type|priviledge|database_access|databases?|confirm/)&&(e?.match(/databases|confirm/)||(t[e]=s[e]))}),t})(),a=awaitc()({dbFullName:r,tableName:"users",identifierColumnName:"id",identifierValue:s.id,data:{...n},dbContext:"Dsql User",paradigm:"Full Access"});t.json({success:!!a?.affectedRows,msg:a?.affectedRows?"User Updated":a})}letd=(0,o.M)(s,"default"),f=(0,o.M)(s,"config"),S=newn.PagesAPIRouteModule({definition:{kind:a.A.PAGES_API,page:"/api/updateDbUser",pathname:"/api/updateDbUser",bundlePath:"",filename:""},userland:s})},6420:(e,t,r)=>{r(81630);lets=r(51348),n=r(72907),a=r(29021);asyncfunctiono(e,t,r,o){if(!e.cookies?.datasquirelAuthKey?.match(/./))returnnull;leti=n(e.cookies.datasquirelAuthKey);if(!i)returnnull;letc=JSON.parse(i);if(!c.csrf_k||r&&!e.headers["x-csrf-auth"]?.match(RegExp(`${c.csrf_k}`)))returnnull;letu=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!u)returnconsole.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(r&&!a.existsSync(`${u}/${c.csrf_k}`))returnnull;if(0==c.verification_status&&!r){lete=awaits(`SELECT verification_status FROM users WHERE id='${c.id}'`);e&&e[0]&&1==e[0].verification_status&&t.setHeader("Set-Cookie",["user_refresh=1"])}returnc?.date&&Date.now()-c.date>6048e5?null:c}e.exports=o},33364:(e,t,r)=>{lets=r(82703),n=r(72583),a=r(16570),o=r(51348),i=r(21339);asyncfunctionc({dbContext:e,paradigm:t,dbFullName:r,tableName:c,data:u,tableSchema:l,identifierColumnName:p,identifierValue:d,encryptionKey:f,encryptionSalt:S}){if(!u||!Object.keys(u).length)returnnull;let_=!e?.match(/dsql.user/i)&&(!r||!!r.match(/^datasquirel$/)),h=_?o:i,m=Object.keys(u),D=[],g=[];for(lete=0;e<m.length;e++)try{lett=m[e],r=u[t],o=l?l?.fields?.filter(e=>e.fieldName===t):null,i=o&&o[0]?o[0]:null;if(null==r||void0==r)continue;i?.richText&&(r=n(r,a)),i?.encrypted&&(r=s(r,f,S)),"object"==typeofr&&(r=JSON.stringify(r)),i?.pattern&&!newRegExp(i.pattern,i.patternFlags||"").test(r)&&(console.log("DSQL: Pattern not matched =>",r),r=""),"string"==typeofr&&r.match(/^null$/i)&&(r={toSqlString:function(){return"NULL"}}),"string"!=typeofr||r.match(/./i)||(r={toSqlString:function(){return"NULL"}}),D.push(`\`${t}\`=?`),"number"==typeofr?g.push(String(r)):g.push(r)}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()}'`);lety=`UPDATE ${c} SET ${D.join(",")} WHERE \`${p}\`=?`;returng.push(d),_?awaith(y,g):awaith({paradigm:t,database:r,queryString:y,queryValues:g})}e.exports=c},72907:(e,t,r)=>{let{scryptSync:s,createDecipheriv:n}=r(55511),{Buffer:a}=r(79428);e.exports=e=>{lett=n("aes-192-cbc",s(process.env.DSQL_ENCRYPTION_PASSWORD||"",process.env.DSQL_ENCRYPTION_SALT||"",24),a.alloc(16,0));try{letr=t.update(e,"hex","utf8");returnr+=t.final("utf8")}catch(e){returnnull}}},82703:(e,t,r)=>{let{scryptSync:s,createCipheriv:n}=r(55511),{Buffer:a}=r(79428),o=r(48225);e.exports=(