1"use strict";(self.webpackChunkcalypso=self.webpackChunkcalypso||[]).push([[4581],{84581:(e,s,r)=>{r.r(s),r.d(s,{default:()=>N});var t=r(89379),a=r(65043),n=r(73216),o=r(29619),c=r(48879),d=r(70626),i=r(16032),l=r(9437),u=r(13005),m=r(83517),p=r(54314),b=r(35327),x=r(92382),h=r(84669),g=r(86376),f=r(22024),j=r(70579);const N=function(){const{darkMode:e}=(0,u.D)(),s=(0,n.Zp)(),[r,N]=(0,a.useState)(""),[w,v]=(0,a.useState)(!1),[y,k]=(0,a.useState)(!1),[C,S]=(0,a.useState)(!1),[_,E]=(0,a.useState)(!1),[A,F]=(0,a.useState)(null),[B,U]=(0,a.useState)({earnings_previews_setting:!1,earnings_updates_setting:!1,earnings_evidence_setting:!1}),[R,q]=(0,a.useState)(""),[P,H]=(0,a.useState)(""),[G,M]=(0,a.useState)(!1);(0,a.useEffect)((()=>{if(c.auth.currentUser){const e=(0,i.H9)(c.db,"users",c.auth.currentUser.uid);(0,i.x7)(e).then((e=>{e.exists()&&U(e.data())}))}else s("/")}),[s]);const Z=e=>{const{name:s,checked:r}=e.target;U((e=>(0,t.A)((0,t.A)({},e),{},{[s]:r})));const a=(0,i.H9)(c.db,"users",c.auth.currentUser.uid);(0,i.mZ)(a,{[s]:r})},z=(e,s)=>{const r=(0,i.H9)(c.db,"users",c.auth.currentUser.uid);(0,i.mZ)(r,{[e]:(0,i.hq)(s)}),"ticker_requests"===e?q(""):H("")};(0,a.useEffect)((()=>{const e=c.auth.onAuthStateChanged((e=>{F(e),e||s("/")}));return()=>e()}),[s]),(0,a.useEffect)((()=>{(async()=>{const e=(0,i.H9)(c.db,"users",c.auth.currentUser.uid),s=await(0,i.x7)(e);s.exists()?(k(s.data().hasPaid),S(s.data().hasCanceled)):console.log("No such document!")})()}),[]);const D=(0,d.Qg)(c.C,"cancelSubscription"),T=()=>{M(!0)},O=()=>{M(!1)},Q=(0,d.Qg)(c.C,"renewSubscription"),W=()=>{const e=(0,i.H9)(c.db,"users",c.auth.currentUser.uid);(0,i.mZ)(e,{hasCanceled:!1}),v(!0),Q().then((e=>{console.log(e.data.message),N(e.data.message),v(!1),S(!1)})).catch((e=>{console.error("Error renewing subscription:",e),N("Error: ".concat(e.message)),v(!1)}))};return(0,j.jsxs)("div",{className:"app-route-canvas min-h-screen pb-24 pt-16",children:[(0,j.jsx)(l.Ay,{user:A,setShowUserMenu:E,showUserMenu:_,handleSignOut:async()=>{await(0,o.signOut)(c.auth),s("/")}}),(0,j.jsxs)("main",{className:"mx-auto max-w-3xl px-4 py-8 sm:px-6 sm:py-10",children:[(0,j.jsxs)("header",{className:"mb-6",children:[(0,j.jsx)("h1",{className:"mb-2 text-2xl font-semibold tracking-tight",children:"Account Settings"}),(0,j.jsx)("p",{className:"app-route-muted text-sm",children:"Manage your preferences and subscription"})]}),(0,j.jsx)("section",{className:"app-route-surface app-route-border mb-4 overflow-hidden rounded-lg border",children:(0,j.jsx)(m.EN,{children:s=>{let{open:r}=s;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(m.EN.Button,{className:"app-route-border flex w-full items-center justify-between border-b px-5 py-4 text-left transition-colors duration-150 hover:bg-[var(--app-surface-muted)]",children:[(0,j.jsxs)("div",{className:"flex items-center gap-3",children:[(0,j.jsx)("div",{className:"flex items-center justify-center rounded-md border p-2 ".concat(e?"bg-[rgba(59,130,246,0.15)] border border-[rgba(59,130,246,0.2)]":"bg-[rgba(59,130,246,0.1)] border border-[rgba(59,130,246,0.15)]"),children:(0,j.jsx)(b.A,{className:"w-[1.125rem] h-[1.125rem] ".concat(e?"text-[#60A5FA]":"text-[#3B82F6]")})}),(0,j.jsx)("span",{className:"text-base font-semibold tracking-tight sm:text-lg",children:"Email Notifications"})]}),(0,j.jsx)(x.A,{className:"app-route-subtle h-5 w-5 transition-transform duration-150 ".concat(r?"rotate-180":"")})]}),(0,j.jsx)(m.EN.Panel,{className:"p-5",children:(0,j.jsxs)("div",{className:"flex flex-col",children:[(0,j.jsxs)("label",{className:"flex items-start gap-3 mb-2 cursor-pointer",children:[(0,j.jsx)("input",{type:"checkbox",checked:B.earnings_previews_setting,onChange:Z,name:"earnings_previews_setting",className:"w-4 h-4 rounded checked:bg-blue-500 checked:border-blue-500 cursor-pointer accent-blue-500 mt-1 ".concat(e?"bg-slate-800 border border-white/20":"bg-white border border-gray-300")}),(0,j.jsxs)("div",{children:[(0,j.jsx)("p",{className:"font-medium",children:"Earnings Previews"}),(0,j.jsx)("p",{className:"app-route-muted text-sm",children:"Get notified before earnings calls"})]})]}),(0,j.jsxs)("label",{className:"flex items-start gap-3 mb-2 cursor-pointer",children:[(0,j.jsx)("input",{type:"checkbox",checked:B.earnings_updates_setting,onChange:Z,name:"earnings_updates_setting",className:"w-4 h-4 rounded checked:bg-blue-500 checked:border-blue-500 cursor-pointer accent-blue-500 mt-1 ".concat(e?"bg-slate-800 border border-white/20":"bg-white border border-gray-300")}),(0,j.jsxs)("div",{children:[(0,j.jsx)("p",{className:"font-medium",children:"Earnings Updates"}),(0,j.jsx)("p",{className:"app-route-muted text-sm",children:"Receive updates on earnings results"})]})]}),(0,j.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer",children:[(0,j.jsx)("input",{type:"checkbox",checked:B.earnings_evidence_setting,onChange:Z,name:"earnings_evidence_setting",className:"w-4 h-4 rounded checked:bg-blue-500 checked:border-blue-500 cursor-pointer accent-blue-500 mt-1 ".concat(e?"bg-slate-800 border border-white/20":"bg-white border border-gray-300")}),(0,j.jsxs)("div",{children:[(0,j.jsx)("p",{className:"font-medium",children:"New Disconfirming Evidence"}),(0,j.jsx)("p",{className:"app-route-muted text-sm",children:"Alerts when new evidence contradicts predictions"})]})]})]})})]})}})}),(0,j.jsx)("section",{className:"app-route-surface app-route-border mb-4 overflow-hidden rounded-lg border",children:(0,j.jsx)(m.EN,{children:s=>{let{open:r}=s;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(m.EN.Button,{className:"app-route-border flex w-full items-center justify-between border-b px-5 py-4 text-left transition-colors duration-150 hover:bg-[var(--app-surface-muted)]",children:[(0,j.jsxs)("div",{className:"flex items-center gap-3",children:[(0,j.jsx)("div",{className:"flex items-center justify-center rounded-md border p-2 ".concat(e?"bg-[rgba(251,191,36,0.15)] border border-[rgba(251,191,36,0.2)]":"bg-[rgba(245,158,11,0.1)] border border-[rgba(245,158,11,0.15)]"),children:(0,j.jsx)(h.A,{className:"w-[1.125rem] h-[1.125rem] ".concat(e?"text-[#FBBF24]":"text-[#F59E0B]")}
1)}),(0,j.jsx)("span",{className:"text-base font-semibold tracking-tight sm:text-lg",children:"Feedback & Requests"})]}),(0,j.jsx)(x.A,{className:"app-route-subtle h-5 w-5 transition-transform duration-150 ".concat(r?"rotate-180":"")})]}),(0,j.jsxs)(m.EN.Panel,{className:"p-5",children:[(0,j.jsxs)("div",{className:"mb-5",children:[(0,j.jsx)("p",{className:"mb-2 font-medium",children:"Request New Tickers"}),(0,j.jsx)("textarea",{value:R,onChange:e=>q(e.target.value),placeholder:"Which companies would you like us to add?",rows:2,className:"app-route-surface-muted app-route-border mb-3 w-full resize-none rounded-md border p-4 text-sm outline-none transition-[border-color,box-shadow] duration-150 placeholder:text-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/15 dark:placeholder:text-white/40"}),(0,j.jsx)("button",{onClick:()=>z("ticker_requests",R),className:"rounded-md bg-blue-600 px-5 py-2.5 text-sm font-medium text-white transition-colors duration-150 hover:bg-blue-700",children:"Submit Request"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("p",{className:"mb-2 font-medium",children:"Bug Reports & Feature Requests"}),(0,j.jsx)("textarea",{value:P,onChange:e=>H(e.target.value),placeholder:"Report bugs or suggest new features...",rows:3,className:"app-route-surface-muted app-route-border mb-3 w-full resize-none rounded-md border p-4 text-sm outline-none transition-[border-color,box-shadow] duration-150 placeholder:text-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/15 dark:placeholder:text-white/40"}),(0,j.jsx)("button",{onClick:()=>z("bugs_or_features",P),className:"rounded-md bg-blue-600 px-5 py-2.5 text-sm font-medium text-white transition-colors duration-150 hover:bg-blue-700",children:"Submit Feedback"})]})]})]})}})}),(0,j.jsx)("section",{className:"app-route-surface app-route-border overflow-hidden rounded-lg border",children:(0,j.jsx)(m.EN,{children:s=>{let{open:t}=s;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(m.EN.Button,{className:"app-route-border flex w-full items-center justify-between border-b px-5 py-4 text-left transition-colors duration-150 hover:bg-[var(--app-surface-muted)]",children:[(0,j.jsxs)("div",{className:"flex items-center gap-3",children:[(0,j.jsx)("div",{className:"flex items-center justify-center rounded-md border p-2 ".concat(e?"bg-[rgba(16,185,129,0.15)] border border-[rgba(16,185,129,0.2)]":"bg-[rgba(16,185,129,0.1)] border border-[rgba(16,185,129,0.15)]"),children:(0,j.jsx)(g.A,{className:"w-[1.125rem] h-[1.125rem] ".concat(e?"text-[#34D399]":"text-[#10B981]")})}),(0,j.jsx)("span",{className:"text-base font-semibold tracking-tight sm:text-lg",children:"Billing & Subscription"})]}),(0,j.jsx)(x.A,{className:"app-route-subtle h-5 w-5 transition-transform duration-150 ".concat(t?"rotate-180":"")})]}),(0,j.jsx)(m.EN.Panel,{className:"p-5",children:(0,j.jsxs)("div",{className:"flex flex-col gap-3",children:[r&&(0,j.jsx)("div",{className:"app-route-surface-muted app-route-border rounded-md border p-4",children:(0,j.jsx)("p",{className:"app-route-muted text-sm",children:r})}),y&&!C&&(0,j.jsx)("button",{onClick:T,disabled:w,className:"rounded-md bg-red-600 px-5 py-3 text-sm font-medium text-white transition-colors duration-150 hover:bg-red-700 disabled:cursor-not-allowed disabled:bg-slate-600",children:w?(0,j.jsxs)("span",{className:"flex items-center gap-2 justify-center",children:[(0,j.jsx)(f.A,{className:"w-5 h-5 text-white animate-spin"}),"Processing..."]}):"Cancel Subscription"}),y&&C&&(0,j.jsx)("button",{onClick:W,className:"rounded-md bg-emerald-600 px-5 py-3 text-sm font-medium text-white transition-colors duration-150 hover:bg-emerald-700",children:"Renew Subscription"}),!y&&(0,j.jsxs)("div",{className:"app-route-surface-muted app-route-border rounded-md border p-5 text-center",children:[(0,j.jsx)("p",{className:"app-route-muted mb-1 text-sm",children:"No active subscription"}),(0,j.jsx)("p",{className:"app-route-subtle text-xs",children:"Upgrade to access premium features"})]})]})})]})}})})]}),(0,j.jsxs)(p.lG,{open:G,onClose:O,className:"relative z-50",children:[(0,j.jsx)("div",{className:"fixed inset-0 bg-black/55","aria-hidden":"true"}),(0,j.jsx)("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:(0,j.jsxs)(p.lG.Panel,{className:"app-route-surface app-route-border mx-auto max-w-md rounded-lg border p-0 shadow-xl",children:[(0,j.jsx)(p.lG.Title,{className:"app-route-border border-b px-6 py-5 text-lg font-semibold",children:"Confirm Cancellation"}),(0,j.jsx)("div",{className:"px-6 pt-5 pb-3",children:(0,j.jsx)("p",{className:"app-route-muted text-sm leading-relaxed",children:"Are you sure you want to cancel your subscription? This action cannot be undone and you will lose access to all premium features."})}),(0,j.jsxs)("div",{className:"app-route-border flex justify-end gap-3 border-t px-6 py-5",children:[(0,j.jsx)("button",{onClick:O,className:"app-route-surface-muted app-route-border rounded-md border px-5 py-2.5 text-sm font-medium transition-colors duration-150 hover:brightness-95 dark:hover:brightness-110",children:"Cancel"}),(0,j.jsx)("button",{onClick:()=>{M(!1),v(!0),D().then((e=>{console.log(e.data.message),N(e.data.message),v(!1),S(!0)})).catch((e=>{console.error("Error canceling subscription:",e),N("Error: ".concat(e.message)),v(!1)}))},className:"rounded-md bg-red-600 px-5 py-2.5 text-sm font-medium text-white transition-colors duration-150 hover:bg-red-700",children:"Yes, Cancel Subscription"})]})]})})]})]})}}}]); 2//# sourceMappingURL=4581.9fef889b.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.