"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")},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}}})},85607:(e,r,t)=>{t.r(r),t.d(r,{config:()=>_,default:()=>d,routeModule:()=>f});varn={};t.r(n),t.d(n,{default:()=>u});vara=t(89947),s=t(2706),o=t(96762),l=t(67619),i=t(69842),c=t(30944);asyncfunctionu(e,r){if("GET"!==e.method)returnr.json({msg:"Failed!"});lett=await(0,i.A)(e,r);if(!t)returnr.json({success:!1,msg:"Unauthorized"});letn=e.query.table,a=e.query.db,s=e.query.field,o=String(e.query.term),u=e.query.operator;try{lete=a?.toString()?.replace(/[^a-z0-9_]/g,""),t=`SELECT * FROM \`${e}\`.\`${n}\` WHERE LOWER(\`${s}\`) ${u?.toString()?.match(/equal/i)?"=":" LIKE "}? ORDER BY id DESC LIMIT 20`,l=[u?.toString()?.match(/equal/i)?o.toLowerCase():"%"+o.toLowerCase()+"%"],i=await(0,c.A)({database:e,queryString:t,queryValuesArray:l}),d=await(0,c.A)({database:e,queryString:t.replace(/\*/,"COUNT(id) AS count").replace(/ ORDER BY .*/,""),queryValuesArray:l});r.json({success:!0,result:i,count:d?.[0]?.count})}catch(e){(0,l.default)({component:"/api/queryEntriesSearchTerm/main-catch-error",message:e.message,user:t}),r.json({success:!1,msg:"Failed!"})}}letd=(0,o.M)(n,"default"),_=(0,o.M)(n,"config"),f=newa.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/queryEntriesSearchTerm",pathname:"/api/queryEntriesSearchTerm",bundlePath:"",filename:""},userland:n})},69842:(e,r,t)=>{t.d(r,{A:()=>i});varn=t(48786),a=t(95969),s=t(29021),o=t.n(s),l=t(89159);asyncfunctioni(e,r,t){let{keyCookieName:s,csrfCookieName:i}=(0,l.A)();if(!e.cookies?.[s]?.match(/./))returnnull;letc=(0,a.A)({encryptedString:e.cookies[s]});if(!c)returnnull;letu=JSON.parse(c);if(!u.csrf_k||t&&!Object.keys(e.headers).find(e=>e.includes(u.csrf_k)))returnnull;letd=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!d)returnconsole.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(t&&!o().existsSync(`${d}/${u.csrf_k}`))returnnull;if(0==u.verification_status&&!t){lete=await(0,n.A)(`SELECT verification_status FROM users WHERE id='${u.id}'`);e&&e[0]&&1==e[0].verification_status&&r.setHeader("Set-Cookie",["user_refresh=1"])}returnu?.date&&Date.now()-u.date>6048e5?null:u}},89159:(e,r,t)=>{t.d(r,{A:()=>n});functionn(e){letr=process.env.DSQL_COOKIES_PREFIX||"dsql_",t=process.env.DSQL_COOKIES_KEY_NAME||"key",n=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",a=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",s=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),o=r;e?.userId&&(o+=`user_${e.userId}_`),s&&(o+=`${s}_`),o+=t;letl=r;e?.userId&&(l+=`user_${e.userId}_`),s&&(l+=`${s}_`),l+=n;leti=r;returne?.userId&&(i+=`user_${e.userId}_`),s&&(i+=`${s}_`),{keyCookieName:o,csrfCookieName:l,oneTimeCodeName:i+=a}}},43775:(e,r,t)=>{t.d(r,{A:()=>s});varn=t(95969);leta=/^id$|^uuid$|^date_created$|^date_created_code$|^date_created_timestamp$|^date_updated$|^date_updated_code$|^date_updated_timestamp$/;asyncfunctions({unparsedResults:e,tableSchema:r}){lett=[];try{for(lets=0;s<e.length;s++){leto=e[s],l=Object.keys(o);for(lete=0;e<l.length;e++){lett=l[e],s=r?.fields[e];if(t?.match(a))continue;leti=o[t];("number"==typeofi||i)&&s?.encrypted&&i?.match(/./)&&(o[t]=(0,n.A)({encryptedString:i}))}t.push(o)}returnt}catch(r){returnconsole.log("ERROR in parseDbResults Function =>",r.message),e}}},67619:(e,r,t)=>{t.r(r),t.d(r,{default:()=>s});varn=t(29021),a=t.n(n);asyncfunctions({user:e,message:r,component:t,noMail:n,req:s}){leto=newDate,l=(()=>{if(!s)returnnull;try{lete=s.headers["x-forwarded-for"],r=s.headers["x-real-ip"],t=s.hea