1import{j as e,s}from"./index-B-01gp8C.js";import{f as t,c as a,r}from"./vendor-react-7UJKJIhU.js";import{L as l,u as n,ai as i,ah as d}from"./vendor-ui-DJKmmfZX.js";import"./vendor-supabase-CDTnsVBO.js";function c(){const{token:c}=t(),o=a(),[x,m]=r.useState("loading"),[h,b]=r.useState("");r.useEffect(()=>{(async()=>{if(!c)return void m("error");if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(c))try{const{data:e,error:t}=await s.rpc("unsubscribe_newsletter_subscriber",{p_token:c});if(t||!e||0===e.length)return void m("error");const a=e[0];if(b(a.email),!a.was_active)return void m("already_unsubscribed");m("success")}catch(e){m("error")}else m("error")})()},[c]);const u=()=>{o("/")};return"loading"===x?e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 via-white to-gray-50 flex items-center justify-center px-4",children:e.jsxs("div",{className:"text-center",children:[e.jsx(l,{className:"w-12 h-12 text-amber-600 animate-spin mx-auto mb-4"}),e.jsx("p",{className:"text-gray-600 text-lg",children:"Zpracovávám vaÅ¡i žádost..."})]})}):"success"===x?e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 via-white to-gray-50 flex items-center justify-center px-4",children:e.jsx("div",{className:"max-w-md w-full",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-8 space-y-6 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"bg-green-100 rounded-full p-4",children:e.jsx(n,{className:"w-16 h-16 text-green-600"})})}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Odhlášenà dokonÄeno"}),e.jsxs("p",{className:"text-gray-600 text-lg",children:["Email ",e.jsx("span",{className:"font-semibold text-gray-900",children:h})," byl úspÄÅ¡nÄ odhlášen z odbÄru newsletteru."]}),e.jsx("p",{className:"text-gray-500 text-sm",children:"Již vám nebudeme zasÃlat žádné marketingové zprávy."}),e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e.jsx("p",{className:"text-sm text-gray-700",children:"Mrzà nás, že odcházÃte. Pokud si to rozmyslÃte, můžete se kdykoli znovu pÅihlásit k odbÄru na našà stránce."})}),e.jsx("button",{onClick:u,className:"w-full bg-amber-600 text-white px-8 py-3 rounded-lg font-semibold hover:bg-amber-700 transition-colors",children:"ZpÄt na hlavnà stránku"})]})})}):"already_unsubscribed"===x?e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 via-white to-gray-50 flex items-center justify-center px-4",children:e.jsx("div",{className:"max-w-md w-full",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-8 space-y-6 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"bg-blue-100 rounded-full p-4",children:e.jsx(i,{className:"w-16 h-16 text-blue-600"})})}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Již odhlášeno"}),e.jsxs("p",{className:"text-gray-600 text-lg",children:["Email ",e.jsx("span",{className:"font-semibold text-gray-900",children:h})," je již odhlášen z odbÄru newsletteru."]}),e.jsx("p",{className:"text-gray-500 text-sm",children:"Pokud chcete obnovit odbÄr, pÅihlaste se prosÃm znovu na našà stránce."}),e.jsx("button",{onClick:u,className:"w-full bg-amber-600 text-white px-8 py-3 rounded-lg font-semibold hover:bg-amber-700 transition-colors",children:"ZpÄt na hlavnà stránku"})]})})}):e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-red-50 via-white to-red-50 flex items-center justify-center px-4",children:e.jsx("div",{className:"max-w-md w-full",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-8 space-y-6 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"bg-red-100 rounded-full p-4",children:e.jsx(d,{className:"w-16 h-16 text-red-600"})})}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Nastala chyba"}),e.jsx("p",{className:"text-gray-600 text-lg",children:"NepodaÅilo se odhlásit z odbÄru newsletteru. Odkaz může být neplatný nebo vyprÅ¡el."}),e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e.jsx("p",{className:"text-sm text-gray-700",children:"Pokud potÅebujete pomoc s odhlášenÃm, kontaktujte nás prosÃm pÅÃmo."})}),e.jsx("button",{onClick:u,className:"w-full bg-amber-600 text-white px-8 py-3 rounded-lg font-semibold hover:bg-amber-700 transition-colors",children:"ZpÄt na hlavnà stránku"})]})})})}export{c 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.