"use strict";(()=>{var e={};e.id=6298,e.ids=[6298],e.modules={27825:e=>{e.exports=require("lodash")},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")},29021:e=>{e.exports=require("fs")},33873:e=>{e.exports=require("path")},10031:(e,r,s)=>{s.r(r),s.d(r,{config:()=>b,default:()=>m,routeModule:()=>c});var i={};s.r(i),s.d(i,{default:()=>p});var a=s(89947),t=s(2706),u=s(96762),l=s(47670),n=s.n(l),o=s(51348),d=s.n(o);async function p(e,r){if("POST"!==e.method)return r.json({msg:"Failed!"});let{email:s,alerts:i,userId:a}=e.body;if(i)i&&await d()("DELETE FROM unsubscribes WHERE email=? AND type='alerts'",[s]);else{let e=await d()("SELECT email FROM unsubscribes WHERE email=? AND type='alerts'",[s]);e&&e[0]||await n()({dbFullName:"datasquirel",tableName:"unsubscribes",data:{email:s,type:"alerts",user_id:a||null}})}r.json({success:!0})}let m=(0,u.M)(i,"default"),b=(0,u.M)(i,"config"),c=new a.PagesAPIRouteModule({definition:{kind:t.A.PAGES_API,page:"/api/unsubscribe",pathname:"/api/unsubscribe",bundlePath:"",filename:""},userland:i})}};var r=require("../../webpack-api-runtime.js");r.C(e);var s=e=>r(r.s=e),i=r.X(0,[4050],()=>s(10031));module.exports=i})();