1import{s as o,a6 as u,_ as d,ai as n,av as m,au as x,as as p,a2 as e,B as h}from"./index-CQi9qSYE.js";async function f(){if(!(await o("/identity/erasure",{method:"DELETE"})).ok)throw new Error("Failed to cancel account erasure")}const g=u({requestId:n().uuid(),eraseAt:n(),status:d(["scheduled","processing","cancelled","completed","failed"])});async function y(){const t=await o("/identity/erasure");if(t.status===404)return null;if(!t.ok)throw new Error("Failed to load account erasure status");return g.parse(await t.json())}const r=["identity","erasure"];function l(t){return new Date(t).toLocaleString("en-GB",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"UTC",timeZoneName:"short"})}function w(){const t=m(),{data:s,isLoading:c,error:i}=x({queryKey:r,queryFn:y}),a=p({mutationFn:f,onSuccess:async()=>{await t.invalidateQueries({queryKey:r})}});return c?e.jsx("section",{className:"mx-auto w-full max-w-3xl px-4 py-6 sm:px-6 lg:px-8",children:e.jsx("p",{className:"text-sm text-neutral-500",children:"Loadingâ¦"})}):i?e.jsx("section",{className:"mx-auto w-full max-w-3xl px-4 py-6 sm:px-6 lg:px-8",children:e.jsx("p",{role:"alert",className:"text-sm text-red-600",children:"Could not load account erasure status."})}):!s||s.status!=="scheduled"&&s.status!=="processing"?e.jsxs("section",{className:"mx-auto w-full max-w-3xl px-4 py-6 sm:px-6 lg:px-8",children:[e.jsx("h1",{className:"text-2xl font-semibold text-neutral-700",children:"Account deletion"}),e.jsx("p",{className:"mt-1 text-sm text-neutral-500",children:"No account deletion is scheduled."})]}):s.status==="processing"?e.jsxs("section",{className:"mx-auto w-full max-w-3xl px-4 py-6 sm:px-6 lg:px-8",children:[e.jsx("h1",{className:"text-2xl font-semibold text-neutral-700",children:"Account deletion in progress"}),e.jsxs("p",{className:"mt-1 text-sm text-neutral-500",children:["Wipe has started for the schedule at ",l(s.eraseAt),". You can no longer cancel."]})]}):e.jsxs("section",{className:"mx-auto w-full max-w-3xl px-4 py-6 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"mb-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold text-neutral-700",children:"Account deletion scheduled"}),e.jsxs("p",{className:"mt-1 text-sm text-neutral-500",children:["Your Most account will be permanently deleted on ",l(s.eraseAt),". You can keep using Most until then."]})]}),e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-4 py-3",children:e.jsx("p",{className:"text-sm font-medium text-amber-950",children:"After that date, your chats, Tax MOT history, and profile data are wiped for good. We cannot restore them. Cancel now if you still want guidance, saved answers, and progress in Most."})})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-neutral-100 bg-white p-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6 sm:p-6",children:[e.jsx("p",{className:"text-sm text-neutral-600",children:"Keep your account and everything you have already built in Most."}),e.jsx(h,{type:"button",className:"shrink-0 self-end sm:self-auto",disabled:a.isPending,onClick:()=>a.mutate(),children:a.isPending?"Cancellingâ¦":"Cancel deletion"})]}),a.isError&&e.jsx("p",{role:"alert",className:"mt-3 text-sm text-red-600",children:"Could not cancel deletion. Try again."})]})}const N=w;export{N as component};
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.