"use strict";(()=>{vare={};e.id=7714,e.ids=[7714],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},21572:e=>{e.exports=require("nodemailer")},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")},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}}})},11074:(e,t,r)=>{r.r(t),r.d(t,{config:()=>S,default:()=>d,routeModule:()=>_});vars={};r.r(s),r.d(s,{default:()=>f});varn=r(89947),i=r(2706),a=r(96762),o=r(6420),l=r.n(o);letc=r(29021),u=r(79531),p=r(82703);asyncfunctionf(e,t){if("GET"===e.method){letr=awaitl()(e,t);if(!r)returnt.redirect(307,"/logout");lets=p(JSON.stringify({id:r.id,email:r.email,dateCode:Date.now()})),n=process.env.DSQL_HOST;if(!awaitu({to:r.email,subject:"Verify Email Address",text:"Please click the link to verify your email address",html:c.readFileSync("./email/send-email-verification-link.html","utf8").replace(/{{host}}/,n||"").replace(/{{token}}/,s||"")}))returnt.json({success:!1});t.json({success:!0})}}letd=(0,a.M)(s,"default"),S=(0,a.M)(s,"config"),_=newn.PagesAPIRouteModule({definition:{kind:i.A.PAGES_API,page:"/api/sendEmailVerificationLink",pathname:"/api/sendEmailVerificationLink",bundlePath:"",filename:""},userland:s})},79531:(e,t,r)=>{lets=r(29021),n=r(21572).createTransport({host:process.env.DSQL_MAIL_HOST,port:465,secure:!0,auth:{user:process.env.DSQL_MAIL_EMAIL,pass:process.env.DSQL_MAIL_PASSWORD}});e.exports=asyncfunction({to:e,subject:t,text:r,html:i,alias:a}){leto;if(!process.env.DSQL_MAIL_HOST||!process.env.DSQL_MAIL_EMAIL||!process.env.DSQL_MAIL_PASSWORD)returnnull;letl=(a?.match(/support/i),process.env.DSQL_MAIL_EMAIL);if(!s.existsSync("./email/index.html"))return;letc=s.readFileSync("./email/index.html","utf8").replace(/{{email_body}}/,i||"").replace(/{{issue_date}}/,Date().substring(0,24));try{lets={};s.from=`"Datasquirel" <${l}>`,s.sender=l,a&&(s["replyTo "]=l),s.to=e,s.subject=t,s.text=r,s.html=c,o=awaitn.sendMail(s)}catch(e){console.log("ERROR in handleNodemailer Function =>",e.message)}returno}},6420:(e,t,r)=>{r(81630);lets=r(51348),n=r(72907),i=r(29021);asyncfunctiona(e,t,r,a){if(!e.cookies?.datasquirelAuthKey?.match(/./))returnnull;leto=n(e.cookies.datasquirelAuthKey);if(!o)returnnull;letl=JSON.parse(o);if(!l.csrf_k||r&&!e.headers["x-csrf-auth"]?.match(RegExp(`${l.csrf_k}`)))returnnull;letc=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!c)returnconsole.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(r&&!i.existsSync(`${c}/${l.csrf_k}`))returnnull;if(0==l.verification_status&&!r){lete=awaits(`SELECT verification_status FROM users WHERE id='${l.id}'`);e&&e[0]&&1==e[0].verification_status&&t.setHeader("Set-Cookie",["user_refresh=1"])}returnl?.date&&Date.now()-l.date>6048e5?null:l}e.exports=a},72907:(e,t,r)=>{let{scryptSync:s,createDecipheriv:n}=r(55511),{Buffer:i}=r(79428);e.exports=e=>{lett=n("aes-192-cbc",s(process.env.DSQL_ENCRYPTION_PASSWORD||"",process.env.DSQL_ENCRYPTION_SALT||"",24),i.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:i}=r(79428),a=r(48225);e.exports=(e,t,r)=>{leto=n("aes-192-cbc",s(t||process.env.DSQL_ENCRYPTION_PASSWORD||"",r||process.env.DSQL_ENCRYPTION_SALT||"",24),i.alloc(16,0));try{lett=o.update(e,"utf8","hex");returnt+=o.final("hex")}catch(e){returna({component:"encrypt",message:e.message}),null}}},48225:(e,t,r)=>{lets=r(29021);e.exports=asyncfunction({user:e,message:t,component:r,noMail:n}){leti=`🚀 SERVER ERROR ===========================