1import{a2 as D,c as l,j as e,Q as B,u as I}from"./index-B9q78oLf.js";import{p as L,a as S,b as _}from"./vetting-Cz-QxhAr.js";const y="Other",N={cv_journey:{badge:"CV Analysis Emails",headline:"Before you go â keep improving your CV.",subtext:"These updates are what help candidates get noticed by recruiters faster.",ctaLabel:"Keep me subscribed & improve my CV",keepPath:"/applicant/resume-builder",reasons:["The product experience wasn't good","The feedback was unclear or hard to understand","The analysis didn't feel personalized to my CV","The suggestions weren't useful or actionable","This isn't relevant to me right now","I don't remember signing up for this",y],successText:"You won't receive CV analysis emails anymore. Essential account updates will still reach you. Thanks for the feedback."},job_alert:{badge:"Job Alerts",headline:"Before you go â don't miss your next opportunity.",subtext:"Job alerts help you apply early, when your chances are highest.",ctaLabel:"Keep me subscribed & stay updated",keepPath:"/jobs",reasons:["I'm receiving too many emails","The job recommendations aren't relevant to me","I've already found a job","I didn't sign up for job alerts","I prefer to search for jobs myself","I don't remember signing up for this",y],successText:"You won't receive job alert emails anymore. Essential account updates will still reach you. Thanks for the feedback."},ai_interview:{badge:"AI Interview Emails",headline:"Before you go â keep your interview edge.",subtext:"Practice rounds are what turn interview nerves into confident answers.",ctaLabel:"Keep me subscribed & keep practicing",keepPath:"/",reasons:["I'm receiving too many emails","The practice questions weren't relevant to me","I've already found a job","I'm not preparing for interviews right now","I didn't sign up for interview reminders","I don't remember signing up for this",y],successText:"You won't receive AI interview emails anymore. Essential account updates will still reach you. Thanks for the feedback."}},P={cv_journey:_,job_alert:S,ai_interview:L},k=300,F="shadow-[0_1px_0_rgba(255,255,255,0.7)_inset,0_20px_60px_-25px_rgba(26,18,48,0.18),0_6px_20px_-10px_rgba(26,18,48,0.08)]",V=` 2@keyframes journeyFadeUp { 3 from { opacity: 0; transform: translateY(8px); } 4 to { opacity: 1; transform: translateY(0); } 5} 6@keyframes journeySlideDown { 7 from { opacity: 0; transform: translateY(-6px); max-height: 0; } 8 to { opacity: 1; transform: translateY(0); max-height: 240px; } 9} 10@keyframes journeyIconPop { 11 0% { opacity: 0; transform: scale(0.6); } 12 60% { opacity: 1; transform: scale(1.08); } 13 100% { transform: scale(1); } 14} 15@keyframes journeyCheckDraw { 16 from { stroke-dashoffset: 32; } 17 to { stroke-dashoffset: 0; } 18} 19@keyframes journeyShimmer { 20 0%, 100% { box-shadow: 0 10px 24px -10px rgba(75,31,184,0.5); } 21 50% { box-shadow: 0 14px 34px -10px rgba(75,31,184,0.7); } 22} 23.journey-fade-up { animation: journeyFadeUp 0.45s ease-out both; } 24.journey-slide-down { animation: journeySlideDown 0.28s ease-out both; overflow: hidden; } 25.journey-icon-pop { animation: journeyIconPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; } 26.journey-check path, .journey-check polyline { 27 stroke-dasharray: 32; 28 animation: journeyCheckDraw 0.6s 0.15s ease-out both; 29} 30.journey-cta-glow:hover { animation: journeyShimmer 1.6s ease-in-out infinite; } 31@media (prefers-reduced-motion: reduce) { 32 .journey-fade-up, 33 .journey-slide-down, 34 .journey-icon-pop, 35 .journey-check path, 36 .journey-check polyline { animation: none !important; } 37 .journey-cta-glow:hover { animation: none !important; } 38} 39`,Y=s=>{if(s?.code==="ECONNABORTED")return"The request took too long. Please try again.";if(s?.message==="Network Error"||!s?.response)return"Network error. Please check your connection and try again.";const a=s.response.status,r=s.response.data,t=typeof r=="string"&&r||r?.message||r?.error||r?.msg||null;switch(a){case 400:return t||"The unsubscribe request was invali
39d.";case 401:case 403:return"This unsubscribe link is no longer valid.";case 404:return"We couldn't find this subscription.";case 409:return"You've already been unsubscribed.";case 410:return"This unsubscribe link has expired.";case 422:return t||"Please check your details and try again.";case 429:return"Too many attempts. Please wait a moment and try again.";default:return a>=500?"Our server ran into an issue. Please try again shortly.":t||"Unsubscribe failed. Please try again."}},R=({children:s})=>e.jsxs("div",{className:"min-h-screen bg-[#F4F2F8] font-poppins text-[#1A1230]",children:[e.jsx("style",{children:V}),e.jsx("main",{className:"flex justify-center items-start px-[24px] py-[32px]",children:e.jsx("div",{className:"w-full max-w-[540px]",children:s})})]}),E=()=>e.jsxs("p",{className:"mt-[16px] text-center text-[11.5px] text-[#8489A0] leading-[1.5]",children:["Manage all communication preferences in"," ",e.jsx("a",{href:"/",className:"text-[#4B4F66] border-b border-[#E8E9F1] no-underline transition-colors duration-200 hover:text-[#6D3DF0] hover:border-[#6D3DF0]",children:"account settings"}),"."]}),O=()=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`bg-white border border-[#E8E9F1] rounded-[20px] overflow-hidden journey-fade-up ${F}`,children:e.jsxs("div",{className:"px-[32px] py-[40px] text-center",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-[56px] h-[56px] rounded-[16px] bg-[#FEECEC] mb-[16px] journey-icon-pop",children:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"#E55451",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-[24px] h-[24px]",children:[e.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}),e.jsx("h2",{className:"text-[20px] font-[600] tracking-[-0.015em] mb-[8px]",children:"Invalid unsubscribe link"}),e.jsx("p",{className:"text-[13.5px] text-[#4B4F66] leading-[1.55] max-w-[360px] mx-auto",children:"This link is missing required information or has been tampered with. Please use the unsubscribe link from the original email."})]})}),e.jsx(E,{})]}),M=({content:s})=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`bg-white border border-[#E8E9F1] rounded-[20px] overflow-hidden journey-fade-up ${F}`,children:e.jsxs("div",{className:"px-[32px] py-[40px] text-center",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-[56px] h-[56px] rounded-[16px] bg-[#E6F7F0] mb-[16px] journey-icon-pop",children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"#34C5A0",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round",className:"w-[24px] h-[24px] journey-check",children:e.jsx("polyline",{points:"4 12 10 18 20 6"})})}),e.jsx("h2",{className:"text-[20px] font-[600] tracking-[-0.015em] mb-[8px]",children:"You've been unsubscribed."}),e.jsx("p",{className:"text-[13.5px] text-[#4B4F66] leading-[1.55] max-w-[360px] mx-auto",children:s.successText})]})}),e.jsx(E,{})]}),U=({email:s,sig:a,type:r,content:t,showToast:m})=>{const g=I(),b=l.useRef(null),[c,j]=l.useState(""),[x,n]=l.useState(""),[i,p]=l.useState(!1),[f,d]=l.useState(!1),u=c===y,v=!!c&&!i&&(!u||x.trim().length>0),C=()=>{g(t.keepPath)},T=()=>{b.current?.scrollIntoView({behavior:"smooth",block:"start"})},A=async o=>{if(o.preventDefault(),!v)return;const h=u?x.trim().slice(0,k):c;p(!0);try{await(P[r]??_)({email:s,signature:a,reason:h}),d(!0)}catch(w){if(w?.response?.status===409){m("You've already been unsubscribed.","info"),d(!0);return}m(Y(w),"error")}finally{p(!1)}};return f?e.jsx(M,{content:t}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`bg-white border border-[#E8E9F1] rounded-[20px] overflow-hidden journey-fade-up ${F}`,children:[e.jsxs("div",{className:"px-[22px] sm:px-[32px] pt-[26px] pb-[22px] bg-gradient-to-b from-[#FBFAFE] to-white border-b border-[#E8E9F1]",children:[e.jsx("div",{className:"w-[42px] h-[42px] rounded-[12px] bg-[#F3EEFE] border border-[#E0D4FB] flex items-center justify-center text-[#6D3DF0] mb-[14px] journey-icon-pop",children:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"w-[20px] h-[20px]",children:[e.jsx("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"}),e.jsx("polyline",{points:"22,6 12,13 2,6"})]})}),e.jsx("div",{className:"inline-block text-[10.5px] tracking-[0.16em] uppercase text-[#6D3DF0] font-[600] mb-[6px]",children:t.badge}),e.jsx("h1",{className:"text-[22px] font-[600] leading-[1.25] tracking-[-0.02em] text-[#1A1230] mb-[8px]",children:t.headline}),e.jsx("p",{className:"text-[13.5px] text-[#4B4F66] leading-[1.55] mb-[14px]",children:t.subtext}),e.jsxs("div",{className:"px-[12px] py-[10px] bg-[#F4F2F8] border border-[#
39E8E9F1] rounded-[10px] flex items-center gap-[10px] text-[12.5px] text-[#4B4F66] transition-colors duration-200 hover:border-[#E0D4FB]",children:[e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"#8489A0",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-[14px] h-[14px] flex-shrink-0",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),e.jsx("strong",{className:"text-[#1A1230] font-[600] break-all",children:s})]})]}),e.jsxs("div",{className:"px-[22px] sm:px-[32px] py-[22px] text-center border-b border-[#E8E9F1]",children:[e.jsx("button",{type:"button",onClick:C,className:"journey-cta-glow w-full min-h-[46px] px-[20px] py-[10px] rounded-full bg-gradient-to-br from-[#6D3DF0] to-[#4B1FB8] text-white text-[14px] font-[600] leading-[1.3] shadow-[0_10px_24px_-10px_rgba(75,31,184,0.5)] cursor-pointer transition-all duration-200 hover:-translate-y-[1px] hover:shadow-[0_16px_34px_-10px_rgba(75,31,184,0.65)] active:translate-y-0 active:scale-[0.99] focus:outline-none focus-visible:ring-2 focus-visible:ring-[#6D3DF0] focus-visible:ring-offset-2",children:t.ctaLabel}),e.jsx("div",{children:e.jsx("button",{type:"button",onClick:T,className:"inline-block mt-[14px] text-[12.5px] text-[#8489A0] bg-transparent px-[6px] py-[2px] border-b border-[#B8BCCF] cursor-pointer transition-colors duration-200 hover:text-[#1A1230] hover:border-[#1A1230]",children:"No thanks, unsubscribe me anyway"})})]}),e.jsx("div",{ref:b,className:"px-[22px] sm:px-[32px] pt-[22px] pb-[26px]",children:e.jsxs("form",{onSubmit:A,children:[e.jsx("div",{className:"text-[10.5px] tracking-[0.16em] uppercase text-[#8489A0] font-[600] mb-[4px]",children:"Help us improve"}),e.jsx("p",{className:"text-[12.5px] text-[#8489A0] leading-[1.5] mb-[14px]",children:"If you're leaving, tell us why. Your answer helps us build better."}),e.jsx("div",{className:"flex flex-col gap-[6px] mb-[16px]",children:t.reasons.map(o=>{const h=c===o;return e.jsxs("label",{className:`flex items-center gap-[10px] px-[12px] py-[10px] rounded-[10px] cursor-pointer border transition-all duration-200 ease-out will-change-transform hover:-translate-y-[1px] ${h?"border-[#6D3DF0] bg-[#F3EEFE] shadow-[0_4px_12px_-6px_rgba(109,61,240,0.35)]":"border-[#E8E9F1] bg-white hover:border-[#E0D4FB] hover:bg-[#FCFBFE] hover:shadow-[0_4px_10px_-6px_rgba(26,18,48,0.08)]"}`,children:[e.jsx("input",{type:"radio",name:"reason",value:o,checked:h,onChange:()=>j(o),className:`appearance-none w-[16px] h-[16px] rounded-full cursor-pointer flex-shrink-0 transition-all duration-200 ease-out ${h?"border-[5px] border-[#6D3DF0]":"border-[1.5px] border-[#B8BCCF]"}`}),e.jsx("span",{className:"text-[13px] font-[500] text-[#1A1230] leading-[1.35]",children:o})]},o)})}),u&&e.jsxs("div",{className:"mb-[16px] journey-slide-down",children:[e.jsxs("div",{className:"flex items-center justify-between mb-[6px]",children:[e.jsx("label",{htmlFor:"feedback",className:"text-[11.5px] font-[500] text-[#4B4F66]",children:"Tell us your reason"}),e.jsx("span",{className:"text-[10.5px] text-[#8489A0]",children:"Required"})]}),e.jsx("textarea",{id:"feedback",name:"feedback",maxLength:k,value:x,onChange:o=>n(o.target.value),placeholder:"Tell us what would have made this betterâ¦",className:"w-full min-h-[60px] max-h-[100px] px-[12px] py-[10px] border border-[#E8E9F1] rounded-[10px] bg-white text-[12.5px] text-[#1A1230] resize-y transition-all duration-200 focus:outline-none focus:border-[#6D3DF0] focus:shadow-[0_0_0_3px_#F3EEFE]"}),e.jsxs("span",{className:"block text-right text-[10.5px] text-[#8489A0] mt-[4px]",children:[x.length," / ",k]})]}),e.jsx("button",{type:"submit",disabled:!v,className:`w-full h-[42px] px-[18px] rounded-full text-[13px] font-[600] inline-flex items-center justify-center gap-[8px] border transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#6D3DF0] focus-visible:ring-offset-2 ${v?"bg-white text-[#4B4F66] border-[#E8E9F1] cursor-pointer hover:border-[#1A1230] hover:text-[#1A1230] hover:-translate-y-[1px] hover:shadow-[0_8px_18px_-10px_rgba(26,18,48,0.25)] active:translate-y-0 active:scale-[0.99]":"bg-[#F0F1F6] text-[#B8BCCF] border-transparent cursor-not-allowed"}`,children:i?e.jsxs(e.Fragment,{children:[e.jsx("svg",{viewBox:"0 0 24 24",className:"w-[14px] h-[14px] animate-spin",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),"Unsubscribingâ¦"]}):e.jsxs(e.Fragment,{children:["Confirm unsubscribe",e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-[14px] h-[14px] transition-transform duration-200",children:[e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),e.jsx("polyline",{points:"12 5 19 12 12 19"})]})]})})]})})]}),e.jsx(E,{})]})},z=()=>{const s=D(),[a,r]=l.useState({isVisible:!1,message:"",type:"success"}),t=(n,i="success")=>{r({isVisible:!0,message:n,type:i})},m=()=>{r(n=>({...n,isVisible:!1}))},{email:g,sig:b,type:c,content:j,isValidLink:x}=l.useMemo(()=>{const n=new URLSearchParams(s.search),i=(n.get("email")||"").trim(),p=(n.get("sig")||"").trim(),f=n.get("type")??"",d=f in N?f:"cv_journey",u=/.+@.+\..+/.test(i);return{email:i,sig:p,type:d,content:N[d],isValidLink:!!i&&!!p&&u}},[s.search]);return e.jsxs(R,{children:[e.jsx(B,{message:a.message,type:a.type,isVisible:a.isVisible,onClose:m}),x?e.jsx(U,{email:g,sig:b,type:c,content:j,showToast:t}):e.jsx(O,{})]})};export{z as default}; 40//# sourceMappingURL=JourneyUnsubscribePage-CM9Eqzsq.js.map
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.