PageSourceSearch

https://eisenhowertodoist.netlify.app/assets/DeleteAccountDialog-CMaSG8PP.js

js eisenhowertodoist.netlify.app collected 2026-10-03 10:41:26 UTC 5,561 bytes, 1 lines download raw bytes

1import{bY as O,c as n,j as e,bZ as S,b$ as g,c0 as N,c1 as y,c2 as j,b_ as v,c3 as b,Z as z,Y as I,aS as Y}from"./vendor-1kUQ7zn2.js";import{c as l,bz as w,u as H,N as P,M as _,B as L,s as h}from"./index--kdl1ae9.js";import{F as B}from"./vendor-supabase-Dh2gyaRa.js";import"./vendor-date-en1IyhsK.js";import"./vendor-motion-BX-jsy7E.js";const G=O,K=S,D=n.forwardRef(({className:t,...a},s)=>e.jsx(v,{className:l("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a,ref:s}));D.displayName=v.displayName;const A=n.forwardRef(({className:t,...a},s)=>e.jsxs(K,{children:[e.jsx(D,{}),e.jsx(g,{ref:s,className:l("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...a})]}));A.displayName=g.displayName;const C=({className:t,...a})=>e.jsx("div",{className:l("flex flex-col space-y-2 text-center sm:text-left",t),...a});C.displayName="AlertDialogHeader";const E=({className:t,...a})=>e.jsx("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});E.displayName="AlertDialogFooter";const T=n.forwardRef(({className:t,...a},s)=>e.jsx(N,{ref:s,className:l("text-lg font-semibold",t),...a}));T.displayName=N.displayName;const k=n.forwardRef(({className:t,...a},s)=>e.jsx(y,{ref:s,className:l("text-sm text-muted-foreground",t),...a}));k.displayName=y.displayName;const M=n.forwardRef(({className:t,...a},s)=>e.jsx(b,{ref:s,className:l(w(),t),...a}));M.displayName=b.displayName;const R=n.forwardRef(({className:t,...a},s)=>e.jsx(j,{ref:s,className:l(w({variant:"outline"}),"mt-2 sm:mt-0",t),...a}));R.displayName=j.displayName;const d="DELETE",Z=["Your login and account details","Your Todoist connection and stored access tokens","All task history, statistics, streaks and achievements","Focus sessions, daily reviews, notes and goals","Filter presets, preferences and subscription records"],J=({open:t,onOpenChange:a,email:s})=>{const{toast:u}=H(),[f,p]=n.useState(""),[r,m]=n.useState(!1);n.useEffect(()=>{t||(p(""),m(!1))},[t]);const c=f.trim()===d,x=async()=>{if(!(!c||r)){m(!0);try{const{data:o,error:i}=await h.functions.invoke("delete-account",{body:{confirmation:d}});if(i){if(i instanceof B){const F=await i.context.json().catch(()=>null);throw new Error(F?.error||"Account deletion failed")}throw i}if(!o?.success)throw new Error(o?.error||"Account deletion failed");await h.auth.signOut({scope:"local"}).catch(()=>{}),localStorage.removeItem("todoist_oauth_state"),u({title:"Account deleted",description:"Your account and all of its data have been permanently removed."}),window.location.href="/"}catch(o){const i=o instanceof Error?o.message:"Please try again.";u({title:"Could not delete account",description:i,variant:"destructive"}),m(!1)}}};return e.jsx(G,{open:t,onOpenChange:r?void 0:a,children:e.jsxs(A,{className:"max-w-md",children:[e.jsxs(C,{children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-destructive/10 text-destructive",children:e.jsx(z,{className:"h-5 w-5"})}),e.jsx(T,{className:"text-left",children:"Delete your account?"})]}),e.jsx(k,{asChild:!0,children:e.jsxs("div",{className:"space-y-4 pt-2 text-left text-sm text-muted-foreground",children:[e.jsxs("p",{children:["This action is ",e.jsx("span",{className:"font-semibold text-destructive",children:"permanent and cannot be undone"}),". There is no grace period and no way for us to restore anything afterwards."]}),e.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3",children:[e.jsx("p",{className:"mb-2 font-medium text-foreground",children:"The following will be deleted forever:"}),e.jsx("ul",{className:"list-disc space-y-1 pl-5",children:Z.map(o=>e.jsx("li",{children:o},o))})]}),e.jsx("p",{className:"text-xs",children:"Your tasks inside Todoist itself are not affected. If you have an active Gumroad subscription, deleting this account does not cancel it — manage it from your Gumroad library."})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(P,{htmlFor:"delete-account-confirm",className:"text-sm",children:["Type ",e.jsx("span",{className:"font-mono font-semibold text-foreground",children:d})," to confirm",s&&e.jsxs("span",{className:"block text-xs font-normal text-muted-foreground",children:["Deleting ",e.jsx("span",{className:"font-medium",children:s})]})]}),e.jsx(_,{id:"delete-account-confirm",value:f,onChange:o=>p(o.target.value),placeholder:d,autoComplete:"off",autoCapitalize:"characters",spell
1Check:!1,disabled:r,onKeyDown:o=>{o.key==="Enter"&&c&&(o.preventDefault(),x())},className:l(c&&"border-destructive focus-visible:ring-destructive")})]}),e.jsxs(E,{className:"gap-2 sm:gap-0",children:[e.jsx(R,{disabled:r,children:"Keep my account"}),e.jsxs(L,{variant:"destructive",onClick:x,disabled:!c||r,className:"gap-2",children:[r?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(Y,{className:"h-4 w-4"}),r?"Deleting…":"Delete account permanently"]})]})]})})};export{J as DeleteAccountDialog};

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.