"use strict";(()=>{vare={};e.id=291,e.ids=[291],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")},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}}})},50667:(e,t,r)=>{r.r(t),r.d(t,{config:()=>p,default:()=>d,routeModule:()=>_});vars={};r.r(s),r.d(s,{default:()=>f});varn=r(89947),i=r(2706),o=r(96762),a=r(51348),u=r.n(a),c=r(6420),l=r.n(c);asyncfunctionf(e,t){if("POST"!==e.method)returnt.json({msg:"Failed!"});letr=awaitl()(e,t,!0);if(!r)returnt.json({success:!1,msg:"Unauthorized"});awaitu()("DELETE FROM invitations WHERE id = ? AND inviting_user_id = ?",[e.body.id,r.id]),t.json({success:!0})}letd=(0,o.M)(s,"default"),p=(0,o.M)(s,"config"),_=newn.PagesAPIRouteModule({definition:{kind:i.A.PAGES_API,page:"/api/deleteInvitation",pathname:"/api/deleteInvitation",bundlePath:"",filename:""},userland:s})},6420:(e,t,r)=>{r(81630);lets=r(51348),n=r(72907),i=r(29021);asyncfunctiono(e,t,r,o){if(!e.cookies?.datasquirelAuthKey?.match(/./))returnnull;leta=n(e.cookies.datasquirelAuthKey);if(!a)returnnull;letu=JSON.parse(a);if(!u.csrf_k||r&&!e.headers["x-csrf-auth"]?.match(RegExp(`${u.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}/${u.csrf_k}`))returnnull;if(0==u.verification_status&&!r){lete=awaits(`SELECT verification_status FROM users WHERE id='${u.id}'`);e&&e[0]&&1==e[0].verification_status&&t.setHeader("Set-Cookie",["user_refresh=1"])}returnu?.date&&Date.now()-u.date>6048e5?null:u}e.exports=o},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}}},51348:(e,t,r)=>{lets=r(9973),n=r(21580),i=s({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void0,charset:"utf8mb4",ssl:n()}});asyncfunctiono(...e){try{lett=awaiti.query(...e);returnawaiti.end(),JSON.parse(JSON.stringify(t))}catch(e){returnconsole.log("DB Error =>",e),{success:!1,error:e.message}}}e.exports=o},21580:(e,t,r)=>{lets=r(29021);e.exports=function(){lete=process.env.DSQL_SSL_DIR;if(!e?.match(/./))return;lett=`${e}/ca-cert.pem`;if(!s.existsSync(t)){console.log(`${t} does not exist`);return}return{ca:s.readFileSync(`${e}/ca-cert.pem`)}}},2706:(e,t)=>{varr;Object.defineProperty(t,"A",{enumerable:!0,get:function(){returnr}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE"}(r||(r={}))},89947:(e,t,r)=>{e.exports=r(75600)}};vart=require("../../webpack-api-runtime.js");t.C(e);varr=t(t.s=50667);module.exports=r})();