(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3751],{5263:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/unsubscribe",function(){return t(9911)}])},9625:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});var r=t(4848),n=t(3430),c=t(6540);function a(e){var s;let{pageTitle:t,pageDescription:a,pagePathname:i,aceEditor:l}=e,{DSQL_HOST:o}=(null===(s=c.useContext(n.AppContext).pageProps)||void 0===s?void 0:s.appData)||{DSQL_HOST:"https://datasquirel.com"};return(0,r.jsxs)(c.Fragment,{children:[(0,r.jsx)("link",{rel:"canonical",href:o+i}),(0,r.jsx)("meta",{property:"og:url",content:o+i}),(0,r.jsx)("meta",{itemProp:"url",content:o+i}),(0,r.jsx)("meta",{name:"twitter:url",content:o+i}),(0,r.jsx)("meta",{property:"og:title",content:t}),(0,r.jsx)("meta",{property:"og:description",content:a}),(0,r.jsx)("meta",{itemProp:"name",content:t}),(0,r.jsx)("meta",{itemProp:"description",content:a}),(0,r.jsx)("meta",{name:"twitter:title",content:t}),(0,r.jsx)("meta",{name:"twitter:description",content:a}),l&&(0,r.jsxs)(c.Fragment,{children:[(0,r.jsx)("script",{src:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ace.min.js",integrity:"sha512-q6CTB0jS+VuJnSct82rVcWlI06LGzNjaG3CWenHWVUncRvc4UQMFkA3a5Ip880xr+lBx38FcHDclOxPdSg+sBw==",crossOrigin:"anonymous",referrerPolicy:"no-referrer"}),(0,r.jsx)("script",{src:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ext-language_tools.min.js",integrity:"sha512-6g6cvocV7eT/J8L44lL8gJKqq9onqQeYGgJO0DmrsYFcCfRl6wYkYA/KHS768r4QVTB4JxsCcMQ9gIezxpTCZw==",crossOrigin:"anonymous",referrerPolicy:"no-referrer"})]})]})}},9911:(e,s,t)=>{"use strict";t.r(s),t.d(s,{__N_SSP:()=>o,default:()=>x});var r=t(4848),n=t(6540),c=t(1710),a=t(9625),i=t(9020),l=t(8883),o=!0;function x(e){let{user:s,email:t,productionEnvironment:o,existingAlerts:x}=e,m="Unsubscribe | Datasquirel",d="Unsubscribe from email alerts",u=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("title",{children:m}),(0,r.jsx)("meta",{name:"description",content:d}),(0,r.jsx)(a.A,{pageTitle:m,pageDescription:d,pagePathname:"/unsubscribe"})]}),[p,h]=n.useState(!1);return(0,r.jsx)(n.Fragment,{children:(0,r.jsx)(l.A,{head:u,user:s,productionEnvironment:o,children:(0,r.jsx)("main",{children:(0,r.jsxs)("section",{children:[p&&(0,r.jsx)(c.A,{}),(0,r.jsxs)("div",{className:"flex-col",children:[(0,r.jsx)("h1",{className:"text-2xl",children:"Unsubscribe from Email alerts"}),!t&&(0,r.jsxs)("p",{className:"max-w-md",children:["No email please ",(0,r.jsx)("a",{href:"/login",children:"Login"})," ","to Access Email Subscriptions or click on"," ",(0,r.jsx)("i",{children:'"unsubscribe"'})," from your mail box"]}),t&&(0,r.jsxs)("form",{className:"flex flex-col items-start gap-4",onSubmit:e=>{e.preventDefault(),h(!0);let r=e.target;(0,i.A)("/api/unsubscribe",{method:"post",body:{email:t,alerts:r.alerts_checkbox.checked,userId:(null==s?void 0:s.id)?s.id:null}}).then(e=>{console.log(e),h(!1)})},children:[(0,r.jsx)("span",{className:"bg-slate-100 py-1 px-3 rounded-full",children:t}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("input",{type:"checkbox",name:"alerts_checkbox",id:"alerts_checkbox",defaultChecked:!!x,className:"w-6 h-6"}),(0,r.jsx)("label",{htmlFor:"alerts_checkbox",className:"text-base whitespace-nowrap text-slate-800",children:"Alerts"})]}),(0,r.jsx)("button",{children:"Save Settings"})]})]})]})})})})}}},e=>{var s=s=>e(e.s=s);e.O(0,[636,6593,8792],()=>s(5263)),_N_E=e.O()}]);