PageSourceSearch

https://stevecastaneda.com/_next/static/chunks/pages/unsubscribe-0449956ec3309ade.js

js stevecastaneda.com collected 2026-10-06 19:32:19 UTC 7,323 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[785],{6266:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/unsubscribe",function(){return t(5817)}])},5817:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return y}});var s=t(5893),n=t(9008),a=t.n(n),i=t(1163),l=t(7294);function c(e){let{className:r}=e;return(0,s.jsxs)("svg",{width:"120",height:"30",viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:r,children:[(0,s.jsxs)("circle",{cx:"15",cy:"15",r:"15",children:[(0,s.jsx)("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})]}),(0,s.jsxs)("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3",children:[(0,s.jsx)("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})]}),(0,s.jsxs)("circle",{cx:"105",cy:"15",r:"15",children:[(0,s.jsx)("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})]})]})}function o(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.filter(Boolean).join(" ")}let d={primary:"border border-transparent text-white bg-blue-600 hover:bg-blue-700 focus:ring-blue-500",secondary:"border border-transparent text-white bg-gray-800 hover:bg-gray-900 focus:ring-gray-600",basic:"border border-gray-300 text-gray-700 bg-white hover:bg-gray-50 focus:ring-gray-500",success:"border border-transparent text-white bg-green-600 hover:bg-green-700 focus:ring-green-500",danger:"border border-transparent text-white bg-gradient-to-r from-red-500 to-red-600 focus:ring-red-400 hover:from-red-600 hover:to-red-600",disabled:"border border-transparent text-gray-400 border bg-gray-50 border-gray-200 cursor-default focus:ring-0",transparent:"text-gray-600 hover:text-gray-700 border-none text-gray-400 focus:ring-0 focus:ring-offset-0"},u=(0,l.forwardRef)((e,r)=>{let{className:t,variant:n="primary",fluid:a,small:i,loading:l,...u}=e;return(0,s.jsx)("button",{ref:r,tabIndex:"disabled"===n?-1:void 0,disabled:"disabled"===n,className:o(t,"inline-flex items-center rounded-md font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2",a&&"w-full justify-center",d[n],i?"px-2.5 py-1.5 text-xs":"px-4 py-2 text-sm"),...u,children:(0,s.jsxs)("div",{className:"relative flex w-full justify-around",children:[l&&(0,s.jsx)(c,{className:o(i?"h-4 w-4":"h-5 w-5","absolute")}),(0,s.jsx)("div",{className:l?"opacity-0":"select-none",children:u.children})]})})});u.displayName="Button";var x=t(7538),m=t(7525),b=t(5265);function h(e){let{className:r,noMargin:t,selectOnFocus:n,description:a,error:i,disabled:c,type:d,...u}=e,[h,f]=(0,l.useState)(!1),g="password"===d||i;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:o(!t&&"mt-1","relative rounded-md shadow-sm"),children:[(0,s.jsx)("input",{disabled:c,className:o(r,g&&"pr-10",c&&"bg-gray-100",i?"border-red-300 focus:ring-red-500 focus:border-red-500 text-red-900 placeholder-red-300":"border-gray-300 focus:ring-blue-500 focus:border-blue-500 placeholder-gray-400","rounded-md block w-full transition duration-150 ease-in-out sm:text-sm"),onFocus:e=>n&&e.target.select(),type:h?"text":d,...u}),i&&(0,s.jsx)("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:(0,s.jsx)(x.Z,{className:"h-5 w-5 text-red-500"})}),!i&&"password"===d&&(0,s.jsx)("button",{tabIndex:-1,title:h?"Hide Password":"Show Password",type:"button",onClick:()=>f(e=>!e),className:"absolute inset-y-0 right-0 pr-3",children:h?(0,s.jsx)(m.Z,{className:"h-5 w-5 text-gray-400 transition hover:text-gray-300"}):(0,s.jsx)(b.Z,{className:"h-5 w-5 text-gray-300 transition hover:text-gray-400"})})]}),i&&"string"==typeof i&&(0,s.jsx)("p",{className:"mt-2 text-xs text-red-600",children:i}),!i&&a&&(0,s.jsx)("p",{className:"mt-1.5 text-xs text-gray-500",children:a})]})}var f=t(2175),g=t(6310);let j=(0,l.createContext)({handleUnsubscribe:e=>{}});function y(){let e=(0,i.useRouter)(),{email:r}=e.query,[t,n]=(0,l.useState)("idle");async function c(e){try{n("pending");let r="/api/unsubscribe?email=".concat(e);await fetch(r),n("resolved")}catch(e){n("error")}}let o=""===r||void 0===r;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a(),{children:(0,s.jsx)("title",{children:"Unsubscribe"})}),(0,s.jsx)("div",{className:"max-w-sm mx-auto mb-20",children:"pending"===t?(0,s.jsx)(p,{}):"resolved"===t?(0,s.jsx)(v,{}):"error"===t?(0,s.jsx)(N,{}):(0,s.jsxs)(j.Provider,{value:{handleUnsubscribe:c},children:[o&&(0,s.jsx)(w,{}),!o&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-2xl font-semibold mb-2 text-center",children:"Unsubscribe"}),(0,s.jsxs)("p",{className:"text-gray-600 mb-4 text-center",children:["Are you sure you want to unsubscribe ",r," from all future emails?"]}
1),(0,s.jsx)("div",{className:"text-center",children:(0,s.jsx)(u,{onClick:()=>c(r),children:"Continue"})})]})]})})]})}function p(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{className:"text-2xl font-semibold mb-2 text-center",children:"Unsubscribing"}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(c,{className:"h-5 w-5 text-gray-600"})})]})}function v(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{className:"text-2xl font-semibold mb-2 text-center",children:"Unsubscribe Successful"}),(0,s.jsx)("p",{className:"text-gray-600 text-center",children:"Your email has been successfully unsubscribed."})]})}function N(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{className:"text-2xl font-semibold mb-2 text-center",children:"Unsubscribe Error"}),(0,s.jsx)("p",{className:"text-gray-600 text-center",children:"There was an error unsubscribing your email. Please try again later."})]})}function w(){let{handleUnsubscribe:e}=(0,l.useContext)(j),r=(0,f.TA)({initialValues:{email:""},validationSchema:g.Ry({email:g.Z_().email("Please enter a valid email address.").required("Required")}),onSubmit:r=>{e(r.email)}});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{className:"text-2xl font-semibold mb-2 text-center",children:"Unsubscribe"}),(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)("p",{className:"text-gray-600 text-center",children:"Please confirm the email address you'd like to unsubscribe."})}),(0,s.jsx)("form",{onSubmit:r.handleSubmit,children:(0,s.jsxs)("div",{className:"flex items-baseline space-x-2",children:[(0,s.jsx)("div",{className:"flex-grow",children:(0,s.jsx)(h,{type:"email",...r.getFieldProps("email"),error:r.errors.email})}),(0,s.jsx)("div",{className:"flex-none",children:(0,s.jsx)(u,{disabled:""===r.values.email,variant:""===r.values.email?"disabled":"primary",children:"Submit"})})]})})]})}}},function(e){e.O(0,[342,774,888,179],function(){return e(e.s=6266)}),_N_E=e.O()}]);

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.