PageSourceSearch

https://southernfm.com.au/assets/Unsubscribe-B2uU1ha-.js

js southernfm.com.au collected 2026-10-02 07:50:47 UTC 2,851 bytes, 1 lines download raw bytes

1import{b as x,r as c,j as e,L as p,S as j,B as g}from"./index-BvsqCpEz.js";const u="https://cimrcpciedxnvqjodikd.supabase.co",d="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNpbXJjcGNpZWR4bnZxam9kaWtkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzYwMjMwMjQsImV4cCI6MjA5MTU5OTAyNH0.aYJn-J-n8qbheHjRWhmVySijeBq8WZGexboNDBlcYcw",y=()=>{const[m]=x(),o=m.get("token")??"",[n,r]=c.useState("validating"),[i,l]=c.useState(null),[b,a]=c.useState("");c.useEffect(()=>{if(!o){r("invalid");return}(async()=>{try{const t=await fetch(`${u}/functions/v1/handle-email-unsubscribe?token=${encodeURIComponent(o)}`,{headers:{apikey:d}}),s=await t.json().catch(()=>({}));if(!t.ok){r("invalid"),a((s==null?void 0:s.error)??"This unsubscribe link is invalid or expired.");return}s!=null&&s.already_unsubscribed?(l((s==null?void 0:s.email)??null),r("already")):(l((s==null?void 0:s.email)??null),r("valid"))}catch{r("invalid"),a("Could not validate this unsubscribe link.")}})()},[o]);const h=async()=>{r("submitting");try{const t=await fetch(`${u}/functions/v1/handle-email-unsubscribe`,{method:"POST",headers:{"Content-Type":"application/json",apikey:d},body:JSON.stringify({token:o})});if(!t.ok){const s=await t.json().catch(()=>({}));r("error"),a((s==null?void 0:s.error)??"Something went wrong.");return}r("done")}catch{r("error"),a("Network error. Please try again.")}};return e.jsxs(p,{children:[e.jsx(j,{title:"Unsubscribe - 88.3 Southern FM",description:"Unsubscribe from Southern FM Member Hub emails.",path:"/unsubscribe",noindex:!0}),e.jsx("main",{className:"container max-w-xl mx-auto px-4 py-10",children:e.jsxs("div",{className:"bg-card rounded-3xl border p-8 shadow-sm text-center",children:[e.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Unsubscribe from Member Hub emails"}),n==="validating"&&e.jsx("p",{className:"text-muted-foreground",children:"Checking your link…"}),n==="valid"&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted-foreground mb-6",children:["You're about to unsubscribe",i?e.jsxs(e.Fragment,{children:[" ",e.jsx("strong",{children:i})]}):""," from Southern FM Member Hub emails."]}),e.jsx(g,{onClick:h,size:"lg",children:"Confirm unsubscribe"})]}),n==="submitting"&&e.jsx("p",{className:"text-muted-foreground",children:"Updating your preferences…"}),n==="done"&&e.jsxs("p",{className:"text-muted-foreground",children:["You've been unsubscribed",i?e.jsxs(e.Fragment,{children:[": ",e.jsx("strong",{children:i})]}):"",". You'll no longer receive these emails."]}),n==="already"&&e.jsxs("p",{className:"text-muted-foreground",children:[i?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:i})," is"]}):"You are"," already unsubscribed."]}),(n==="invalid"||n==="error")&&e.jsx("p",{className:"text-destructive",children:b||"This unsubscribe link is not valid."})]})})]})};export{y as default};

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.