"use strict";(()=>{vare={};e.id=3683,e.ids=[3683],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")},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}}})},18348:(e,r,t)=>{t.r(r),t.d(r,{config:()=>p,default:()=>l,routeModule:()=>d});varn={};t.r(n),t.d(n,{default:()=>u});vars=t(89947),o=t(2706),a=t(96762),i=t(30802),c=t(69842);asyncfunctionu(e,r){if("POST"!==e.method)returnr.json({msg:"Failed!"});if(!await(0,c.A)(e,r,!0))returnr.json({success:!1,msg:"Unauthorized"});let{dbFullName:t,payload:n}=e.body,s=(()=>{lete=Object.keys(n),r={};returne.forEach(e=>{!e?.match(/user_type|priviledge|database_access|databases?|confirm/)&&(e?.match(/databases|confirm/)||(r[e]=n[e]))}),r})(),o=await(0,i.A)({dbFullName:t,tableName:"users",identifierColumnName:"id",identifierValue:n.id,data:{...s},dbContext:"Dsql User",paradigm:"Full Access"});r.json({success:!!o?.affectedRows,msg:o?.affectedRows?"User Updated":o})}letl=(0,a.M)(n,"default"),p=(0,a.M)(n,"config"),d=news.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/updateDbUser",pathname:"/api/updateDbUser",bundlePath:"",filename:""},userland:n})},69842:(e,r,t)=>{t.d(r,{A:()=>o});varn=t(39908),s=t.n(n);asyncfunctiono(e,r,t){letn=s()({req:e,level:t?"deep":void0});returnconsole.log(n),n.payload}},30802:(e,r,t)=>{t.d(r,{A:()=>l});varn=t(72583),s=t.n(n),o=t(92652),a=t(48786),i=t(37897),c=t(68829),u=t(62050);asyncfunctionl({dbContext:e,paradigm:r,dbFullName:t,tableName:n,data:l,tableSchema:p,identifierColumnName:d,identifierValue:f,encryptionKey:_,encryptionSalt:S,useLocal:y}){if(!l||!Object.keys(l).length)returnnull;letA=!!y||!e?.match(/dsql.user/i)&&(!t||!!t.match(/^datasquirel$/)),D=y?u.A:A?a.A:i.A,g=Object.keys(l),h=[],m=[];for(lete=0;e<g.length;e++)try{letr=g[e],t=l[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=s()(t,o.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"}}),h.push(`\`${r}\`=?`),"number"==typeoft?m.push(String(t)):m.push(t)}catch(e){console.log("DSQL: Error in parsing data keys in update function =>",e.message);continue}h.push(`date_updated='${Date()}'`),h.push(`date_updated_code='${Date.now()}'`);letE=`UPDATE \`${t}\`.\`${n}\` SET ${h.join(",")} WHERE \`${d}\`=?`;returnm.push(f),A?awaitD(E,m):awaitD({paradigm:r,queryString:E,queryValues:m})}},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"]}}},68829:(e,r,t)=>{t.d(r,{A:()=>a});varn=t(55511),s=t(79428),o=t(32443);functiona({data:e,encryptionKey:r,encryptionSalt:t}){if(!e?.match(/./))returnconsole.log("Encryption string is invalid"),e;let{key:a,salt:i,keyLen:c,algorithm:u,bufferAllocSize:l}=(0,o.A)({encryptionKey:r});if(!a?.match(/.{8,}/))returnconsole.log("Encryption key is invalid"),e;if(!i?.match(/.{8,}/))returnconsole.log("Encryption salt is invalid"),e;letp=(0,n.scryptSync)(a,i,c),d=s.Buffer.alloc(l,0),f=(0,n.createCipheriv)(u,p,d);try{letr=f.update(e,"utf8","hex");returnr+=f.final("hex")}catch(r){returnconsole.log("Error in encrypting =>",r.message),