"use strict";(()=>{vare={};e.id=2101,e.ids=[2101],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},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,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}}})},57164:(e,r,t)=>{t.r(r),t.d(r,{config:()=>f,default:()=>S,routeModule:()=>m});vars={};t.r(s),t.d(s,{default:()=>d});varn=t(89947),a=t(2706),o=t(96762),c=t(48225),i=t.n(c),l=t(6420),u=t.n(l),_=t(57638),p=t.n(_);asyncfunctiond(e,r){if("GET"!==e.method)returnr.json({msg:"Failed!"});lett=awaitu()(e,r);if(!t)returnr.json({success:!1,msg:"Unauthorized"});lets=e.query.table,n=e.query.db,a=e.query.field,o=String(e.query.term),c=e.query.operator;try{lete=`SELECT * FROM \`${s}\` WHERE LOWER(\`${a}\`) ${c?.toString()?.match(/equal/i)?"=":" LIKE "}? ORDER BY id DESC LIMIT 20`,t=[c?.toString()?.match(/equal/i)?o.toLowerCase():"%"+o.toLowerCase()+"%"],i=awaitp()({database:n?.toString()?.replace(/[^a-z0-9_]/g,""),queryString:e,queryValuesArray:t}),l=awaitp()({database:n?.toString()?.replace(/[^a-z0-9_]/g,""),queryString:e.replace(/\*/,"COUNT(id) AS count").replace(/ ORDER BY .*/,""),queryValuesArray:t});r.json({success:!0,result:i,count:l?.[0]?.count})}catch(e){i()({component:"/api/queryEntriesSearchTerm/main-catch-error",message:e.message,user:t}),r.json({success:!1,msg:"Failed!"})}}letS=(0,o.M)(s,"default"),f=(0,o.M)(s,"config"),m=newn.PagesAPIRouteModule({definition:{kind:a.A.PAGES_API,page:"/api/queryEntriesSearchTerm",pathname:"/api/queryEntriesSearchTerm",bundlePath:"",filename:""},userland:s})},6420:(e,r,t)=>{t(81630);lets=t(51348),n=t(72835),a=t(29021),o=t(31341);asyncfunctionc(e,r,t,c){let{keyCookieName:i,csrfCookieName:l}=o();if(!e.cookies?.[i]?.match(/./))returnnull;letu=n({encryptedString:e.cookies[i]});if(!u)returnnull;let_=JSON.parse(u);if(!_.csrf_k||t&&!e.headers["x-csrf-auth"]?.match(RegExp(`${_.csrf_k}`)))returnnull;letp=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!p)returnconsole.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(t&&!a.existsSync(`${p}/${_.csrf_k}`))returnnull;if(0==_.verification_status&&!t){lete=awaits(`SELECT verification_status FROM users WHERE id='${_.id}'`);e&&e[0]&&1==e[0].verification_status&&r.setHeader("Set-Cookie",["user_refresh=1"])}return_?.date&&Date.now()-_.date>6048e5?null:_}e.exports=c},31341:e=>{e.exports=function(e){letr=process.env.DSQL_COOKIES_PREFIX||"dsql_",t=process.env.DSQL_COOKIES_KEY_NAME||"key",s=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",n=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",a=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),o=r;e?.userId&&(o+=`user_${e.userId}_`),a&&(o+=`${a}_`),o+=t;letc=r;e?.userId&&(c+=`user_${e.userId}_`),a&&(c+=`${a}_`),c+=s;leti=r;returne?.userId&&(i+=`user_${e.userId}_`),a&&(i+=`${a}_`),{keyCookieName:o,csrfCookieName:c,oneTimeCodeName:i+=n}}},30003:e=>{e.exports=/^id$|^uuid$|^date_created$|^date_created_code$|^date_created_timestamp$|^date_updated$|^date_updated_code$|^date_updated_timestamp$/},6061:(e,r,t)=>{lets=t(72835),n=t(30003);e.exports=asyncfunction({unparsedResults:e,tableSchema:r}){lett=[];try{for(leta=0;a<e.length;a++){leto=e[a],c=Object.keys(o);for(lete=0;e<c.length;e++){lett=c[e],a=r?.fields[e];if(t?.match(n))continue;leti=o[t];("number"==typeofi||i)&&a?.encrypted&&i?.match(/./)&&(o[t]=s({encryptedString:i}))}t.push(o)}returnt}catch(r){returnconsole.log("ERROR in parseDbResults Function =>",r.message),e}}},48225:(e,r,t)=>{lets=t(29021),{IncomingMessage:n}=t(81630);e.exports=asyncfunction({user:e,message:r,component:t,noMail:n,req:a}){leto=newDate,c=(()=>{if(!a)returnnu