1import{u as X,a as q,j as e}from"./tanstack-CJyWI9_e.js";import{r as c}from"./recharts-BL76hIFH.js";import{am as O,b4 as K,as as T,bY as Z,bX as ee,b2 as te,au as se,bM as N,H as ae,aJ as re,aG as ie}from"./index-KInSj83w.js";import{L as Y}from"./lock-Dhg0866l.js";import{u as ne}from"./react-vendor-CkR1Zo-P.js";import"./tiptap-q7R5EYtG.js";const u=[{key:"application_process",text:"How easy was the application process?",type:"rating"},{key:"recruiter_communication",text:"How would you rate the communication from the recruiting team?",type:"rating"},{key:"interview_experience",text:"How was your interview experience?",type:"rating"},{key:"timely_updates",text:"Were you kept updated on your application status in good time?",type:"choice",options:["Yes","Somewhat","No"]},{key:"role_clarity",text:"Was the role clearly explained to you?",type:"choice",options:["Yes","Somewhat","No"]}],k=[{value:1,emoji:"ð",label:"Very poor"},{value:2,emoji:"ð",label:"Poor"},{value:3,emoji:"ð",label:"Okay"},{value:4,emoji:"ð",label:"Good"},{value:5,emoji:"ð¤©",label:"Excellent"}],P=k.map(a=>a.label),le={Yes:"ð",Somewhat:"ð¤",No:"ð"},oe=["Friendly recruiters","Quick process","Clear communication","Slow responses","Too many rounds","Unclear next steps"],de=a=>a<=6?{solid:"border-[#F04438] bg-[#F04438]",bar:"bg-[#F04438]"}:a<=8?{solid:"border-[#F79009] bg-[#F79009]",bar:"bg-[#F79009]"}:{solid:"border-[#12B76A] bg-[#12B76A]",bar:"bg-[#12B76A]"},ce=a=>a<=6?"Sorry it fell short â the questions below help us see what went wrong.":a<=8?"Thanks! Tell us below what would have made it a 10.":"Wonderful â thank you for the love!",xe=Array.from({length:22},(a,r)=>({left:(r*37+7)%100,delay:r%7*.12,color:["#7B61FF","#FDB022","#12B76A","#F670C7"][r%4]})),me=` 2 @keyframes fb-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } } 3 @keyframes fb-pop { 0% { transform: scale(0.8); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } } 4 @keyframes fb-confetti { 5 0% { transform: translateY(-12px) rotate(0deg); opacity: 1; } 6 100% { transform: translateY(460px) rotate(560deg); opacity: 0; } 7 } 8 .fb-rise { animation: fb-rise 0.45s ease both; } 9 .fb-pop { animation: fb-pop 0.35s ease; } 10 .fb-confetti { animation: fb-confetti 2.6s ease-in forwards; } 11 @media (prefers-reduced-motion: reduce) { 12 .fb-rise, .fb-pop { animation: none !important; } 13 .fb-confetti { display: none; } 14 } 15`,h=({logo:a,children:r})=>e.jsxs("div",{className:"min-h-screen w-full",style:{background:"linear-gradient(180deg, #EFEBFF 0%, #F6F7FB 360px)"},children:[e.jsx("style",{children:me}),e.jsx("div",{className:"sticky top-0 z-20 border-b border-[#ECEAF5] bg-white/80 backdrop-blur-md",children:e.jsxs("div",{className:"mx-auto flex h-14 w-full max-w-[680px] items-center justify-between px-4",children:[e.jsx("img",{src:a||re,className:"h-7 max-w-[140px] object-contain",alt:"Company logo"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11.5px] font-medium text-[#8D8D8E]",children:[e.jsx(Y,{size:12})," Secure & confidential"]})]})}),e.jsx("div",{className:"mx-auto flex w-full max-w-[680px] flex-col gap-4 px-4 py-6 sm:gap-5 sm:py-10",children:r})]}),M=({icon:a,title:r,text:x})=>e.jsxs("div",{className:"fb-rise flex w-full flex-col items-center gap-3 rounded-[24px] border border-[#ECEAF5] bg-white px-6 py-12 text-center shadow-sm",children:[e.jsx("span",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-[#F8F8FA]",children:a}),e.jsx("p",{className:"mt-1 text-[17px] font-semibold text-[#1a1a1a]",children:r}),e.jsx("p",{className:"max-w-sm text-[13px] leading-relaxed text-[#646465]",children:x})]}),j=({step:a,title:r,hint:x,required:i,done:m,error:n,delay:o=0,children:b})=>e.jsxs("section",{className:`fb-rise rounded-[20px] border bg-white p-5 shadow-[0_1px_3px_rgba(16,24,40,0.05)] transition-[border-color,box-shadow] sm:p-6 ${n?"border-[#FDA29B] ring-4 ring-[#FEE4E2]":"border-[#ECEAF5]"}`,style:{animationDelay:`${o}ms`},children:[e.jsxs("div",{className:"mb-4 flex items-start gap-3 sm:mb-5",children:[e.jsx("span",{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-[12px] font-bold transition-colors ${m?"bg-[#12B76A] text-white":"bg-[#F0EEFF] text-[#7B61FF]"}`,children:m?e.jsx(N,{size:14,strokeWidth:3}):a}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("h2",{className:"text-[15px] leading-snug font-semibold text-[#1a1a1a] sm:text-[16
15px]",children:[r,i&&e.jsx("span",{className:"ml-1 text-[#F04438]",children:"*"})]}),x&&e.jsx("p",{className:"mt-0.5 text-[12px] text-[#8D8D8E]",children:x}),n&&e.jsx("p",{className:"mt-1 text-[12px] font-medium text-[#D92D20]",children:"Please answer this question."})]}),!i&&e.jsx("span",{className:"shrink-0 rounded-full bg-[#F4F4F5] px-2.5 py-0.5 text-[10.5px] font-medium text-[#8D8D8E]",children:"Optional"})]}),b]}),pe=({value:a,onChange:r,label:x})=>{const[i,m]=c.useState(0),n=i||a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{role:"radiogroup","aria-label":x,className:"flex",onMouseLeave:()=>m(0),children:[1,2,3,4,5].map(o=>e.jsx("button",{type:"button",role:"radio","aria-checked":a===o,"aria-label":`${o} of 5 â ${P[o-1]}`,onMouseEnter:()=>m(o),onClick:()=>r(o),className:"cursor-pointer p-1 transition-transform hover:scale-115",children:e.jsx(ie,{size:24,className:`transition-colors ${n>=o?"fill-[#FDB022] text-[#FDB022]":"text-[#D0D5DD]"}`})},o))}),e.jsx("span",{className:`min-w-[64px] text-[12px] font-medium ${n?"text-[#B54708]":"text-[#B0B0B2]"}`,children:n?P[n-1]:"Rate"})]})},je=()=>{const{token:a=""}=ne(),[r,x]=c.useState(0),[i,m]=c.useState(null),[n,o]=c.useState({}),[b,I]=c.useState([]),[w,H]=c.useState(""),[E,F]=c.useState({overall:!1,nps:!1}),[C,v]=c.useState(""),_=c.useRef(null),B=c.useRef(null),{data:S,isPending:L,isError:R,error:W}=X({queryKey:["public-feedback",a],queryFn:()=>O.getPublicFeedback(a),enabled:!!a,retry:!1,refetchOnWindowFocus:!1}),d=S?.data??S??{},D=typeof d.company_logo_url=="string"?d.company_logo_url:void 0,f=(d.candidate_name??d.recipient_name??"").trim().split(/\s+/)[0],G=d.is_submitted===!0||!!d.submitted_at||String(d.status??"").toLowerCase()==="submitted",g=[b.join(", "),w.trim()].filter(Boolean).join(" â "),A=u.filter(t=>n[t.key]!=null).length,$=Math.round(((r?1:0)+(i!=null?1:0)+A+(g?1:0))/(u.length+3)*100),{mutate:Q,isPending:z,isSuccess:y}=q({mutationFn:()=>O.submitPublicFeedback(a,{overall_rating:r,nps_score:i,...g?{comment:g}:{},answers:u.filter(t=>n[t.key]!=null).map(t=>({question_key:t.key,question_text:t.text,value:n[t.key]}))}),onSuccess:()=>window.scrollTo({top:0,behavior:"smooth"}),onError:t=>v(t?.message||"We could not submit your feedback. Please try again.")}),V=()=>{const t={overall:!r,nps:i==null};if(F(t),t.overall||t.nps){v(""),(t.overall?_:B).current?.scrollIntoView({behavior:"smooth",block:"center"});return}v(""),Q()},J=t=>I(s=>s.includes(t)?s.filter(l=>l!==t):[...s,t]);if(!a)return e.jsx(h,{children:e.jsx(M,{icon:e.jsx(K,{size:32,className:"text-[#F79009]"}),title:"Invalid link",text:"This link is incomplete. Please open the feedback link exactly as it appears in your email."})});if(L)return e.jsx(h,{children:e.jsxs("div",{className:"flex w-full flex-col items-center gap-4 roun
15ded-[24px] border border-[#ECEAF5] bg-white px-6 py-14 shadow-sm",children:[e.jsx(T,{className:"animate-spin text-[#7B61FF]",size:30}),e.jsx("p",{className:"text-[13px] font-medium text-[#646465]",children:"Getting your survey readyâ¦"})]})});if(R)return e.jsx(h,{children:e.jsx(M,{icon:e.jsx(Z,{size:32,className:"text-[#F04438]"}),title:"This link is not available",text:W?.message||"The link may have expired or already been used. Please contact the recruiter for a new one."})});if(y||G){const t=k.find(s=>s.value===r);return e.jsx(h,{logo:D,children:e.jsxs("div",{className:"fb-rise relative overflow-hidden rounded-[24px] border border-[#ECEAF5] bg-white px-6 py-12 text-center shadow-sm sm:px-10 sm:py-16",children:[y&&xe.map((s,l)=>e.jsx("span",{"aria-hidden":!0,className:"fb-confetti absolute top-0 h-2.5 w-1.5 rounded-sm",style:{left:`${s.left}%`,background:s.color,animationDelay:`${s.delay}s`}},l)),e.jsxs("div",{className:"relative mx-auto flex h-20 w-20 items-center justify-center",children:[e.jsx("span",{className:"absolute inset-0 animate-ping rounded-full bg-[#12B76A]/15 motion-reduce:hidden"}),e.jsx("span",{className:"relative flex h-20 w-20 items-center justify-center rounded-full bg-[#ECFDF3]",children:e.jsx(ee,{size:42,className:"text-[#12B76A]"})})]}),e.jsxs("h1",{className:"relative mt-6 text-[22px] font-bold text-[#1a1a1a] sm:text-[26px]",children:["Thank you",f?`, ${f}`:"","!"]}),e.jsx("p",{className:"relative mx-auto mt-2 max-w-md text-[13.5px] leading-relaxed text-[#646465]",children:y?"Your feedback has been shared with the hiring team. It genuinely helps make the experience better for every candidate.":"You have already shared your feedback for this link â we appreciate you taking the time."}),y&&t&&e.jsxs("div",{className:"relative mt-6 inline-flex items-center gap-2 rounded-full bg-[#F7F5FF] px-4 py-2 text-[13px] font-medium text-[#7B61FF]",children:[e.jsx("span",{className:"text-[18px]",children:t.emoji}),"You rated your experience â",t.label,"â"]})]})})}return e.jsxs(h,{logo:D,children:[e.jsxs("div",{className:"fb-rise relative overflow-hidden rounded-[24px] p-6 text-white shadow-[0_14px_36px_rgba(123,97,255,0.28)] sm:p-8",style:{background:"linear-gradient(135deg, #6A4DF5 0%, #8F72FF 55%, #C4ABFF 100%)"},children:[e.jsx("span",{"aria-hidden":!0,className:"absolute -top-16 -right-12 h-52 w-52 rounded-full bg-white/15 blur-2xl"}),e.jsx("span",{"aria-hidden":!0,className:"absolute -bottom-24 -left-10 h-48 w-48 rounded-full bg-[#FFB4E1]/30 blur-2xl"}),e.jsxs("div",{className:"relative",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-white/20 px-3 py-1 text-[11px] font-semibold tracking-wide backdrop-blur",children:[e.jsx(te,{size:12})," Candidate experience survey"]}),e.jsx("h1",{className:"mt-3 text-[23px] leading-tight font-bold sm:text-[30px]",children:f?`Hi ${f}, how did we do?`:"How did we do?"}),e.jsxs("p",{className:"mt-2 max-w-[480px] text-[13px] leading-relaxed text-white/85 sm:text-[14px]",children:["Share your honest experience",d.job_title&&e.jsxs(e.Fragment,{children:[" ","applying for ",e.jsx("span",{className:"font-semibold text-white",children:d.job_title})]}),d.company_name&&e.jsxs(e.Fragment,{children:[" ","at ",e.jsx("span",{className:"font-semibold text-white",children:d.company_name})]}),". Every answer helps make hiring better for the next candidate."]}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-[12px] text-white/90",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(se,{size:13})," About 1 minute"]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(N,{size:13})," Only 2 required questions"]})]}),e.jsxs("div",{className:"mt-5",children:[e.jsxs("div",{className:"mb-1.5 flex justify-between text-[11px] font-medium text-white/85",children:[e.jsx("span",{children:"Your progress"}),e.jsxs("span",{children:[$,"%"]})]}),e.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-white/25",children:e.jsx("div",{className:"h-full rounded-full bg-white transition-[width] duration-500 ease-out",style:{width:`${$}%`}})})]})]})]}),e.jsx("div",{ref:_,children:e.jsx(j,{step:1,title:"Overall, how was your experience?",required:!0,done:!!r,error:E.overall,delay:60,children:e.jsx("div",{role:"radiogroup","aria-label":"Overall experience",className:"grid grid-cols-5 ga
15p-2 sm:gap-3",children:k.map(t=>{const s=r===t.value;return e.jsxs("button",{type:"button",role:"radio","aria-checked":s,"aria-label":t.label,onClick:()=>{x(t.value),F(l=>({...l,overall:!1}))},className:`group flex cursor-pointer flex-col items-center gap-1.5 rounded-2xl border-2 px-1 py-3 transition-all sm:gap-2 sm:py-4 ${s?"border-[#7B61FF] bg-[#F7F5FF] shadow-[0_8px_18px_rgba(123,97,255,0.18)]":"border-transparent bg-[#F8F8FA] hover:-translate-y-0.5 hover:bg-[#F3F0FF]"}`,children:[e.jsx("span",{className:`text-[28px] leading-none transition-[filter,opacity] sm:text-[38px] ${s?"fb-pop":r?"opacity-45 grayscale group-hover:opacity-100 group-hover:grayscale-0":""}`,children:t.emoji},s?"on":"off"),e.jsx("span",{className:`text-[10px] font-semibold sm:text-[12px] ${s?"text-[#7B61FF]":"text-[#646465]"}`,children:t.label})]},t.value)})})})}),e.jsx("div",{ref:B,children:e.jsxs(j,{step:2,title:"How likely are you to recommend us to a friend?",hint:"0 = not at all likely · 10 = extremely likely",required:!0,done:i!=null,error:E.nps,delay:120,children:[e.jsx("div",{role:"radiogroup","aria-label":"Likelihood to recommend",className:"grid grid-cols-6 gap-1.5 sm:grid-cols-11 sm:gap-2",children:Array.from({length:11},(t,s)=>{const l=de(s),p=i===s;return e.jsxs("button",{type:"button",role:"radio","aria-checked":p,onClick:()=>{m(s),F(U=>({...U,nps:!1}))},className:`relative h-11 cursor-pointer overflow-hidden rounded-xl border text-[14px] font-semibold transition-all ${p?`${l.solid}
15 scale-105 text-white shadow-md`:"border-[#E6E7E8] bg-white text-[#383838] hover:-translate-y-0.5 hover:border-[#C9C1FF]"}`,children:[s,e.jsx("span",{"aria-hidden":!0,className:`absolute inset-x-0 bottom-0 h-[3px] ${l.bar} ${p?"opacity-0":"opacity-60"}`})]},s)})}),e.jsxs("div",{className:"mt-2.5 flex justify-between text-[11.5px] text-[#8D8D8E]",children:[e.jsx("span",{children:"ð Not likely"}),e.jsx("span",{children:"Very likely ð"})]}),i!=null&&e.jsx("p",{className:"fb-rise mt-3 rounded-xl bg-[#F7F5FF] px-3.5 py-2.5 text-[12.5px] font-medium text-[#5B45D6]",children:ce(i)},i<=6?"low":i<=8?"mid":"high")]})}),e.jsx(j,{step:3,title:"A few quick questions",hint:"Answer the ones that apply to you.",done:A===u.length,delay:180,children:e.jsx("div",{className:"flex flex-col divide-y divide-[#F0F0F3]",children:u.map(t=>e.jsxs("div",{className:"flex flex-col gap-2 py-4 first:pt-0 last:pb-0 sm:flex-row sm:items-center sm:justify-between sm:gap-6",children:[e.jsx("p",{className:"text-[13.5px] leading-snug font-medium text-[#383838] sm:max-w-[52%]",children:t.text}),t.type==="rating"?e.jsx(pe,{value:n[t.key]??0,onChange:s=>o(l=>({...l,[t.key]:s})),label:t.text}):e.jsx("div",{role:"radiogroup","aria-label":t.text,className:"flex flex-wrap gap-2",children:t.options.map(s=>{const l=n[t.key]===s;return e.jsxs("button",{type:"button",role:"radio","aria-checked":l,onClick:()=>o(p=>({...p,[t.key]:s})),className:`inline-flex cursor-pointer items-center gap-1.5 rounded-full border px-3.5 py-1.5 text-[12.5px] font-medium transition-all ${l?"border-[#7B61FF] bg-[#7B61FF] text-white shadow-[0_4px_12px_rgba(123,97,255,0.25)]":"border-[#E6E7E8] bg-white text-[#383838] hover:border-[#C9C1FF] hover:bg-[#F7F5FF]"}`,children:[e.jsx("span",{"aria-hidden":!0,children:le[s]}),s]},s)})})]},t.key))})}),e.jsxs(j,{step:4,title:"Anything else you'd like to share?",hint:"Tap what stood out, or write in your own words.",done:!!g,delay:240,children:[e.jsx("div",{className:"mb-3 flex flex-wrap gap-2",children:oe.map(t=>{const s=b.includes(t);return e.jsxs("button",{type:"button","aria-pressed":s,onClick:()=>J(t),className:`inline-flex cursor-pointer items-center gap-1 rounded-full border px-3 py-1.5 text-[12px] font-medium transition-colors ${s?"border-[#7B61FF] bg-[#F0EEFF] text-[#5B45D6]":"border-dashed border-[#D0D5DD] bg-white text-[#646465] hover:border-[#C9C1FF] hover:text-[#5B45D6]"}`,children:[s?e.jsx(N,{size:12,strokeWidth:3}):e.jsx("span",{"aria-hidden":!0,children:"+"}),t]},t)})}),e.jsxs("div",{className:"relative",children:[e.jsx("textarea",{value:w,onChange:t=>H(t.target.value),rows:4,maxLength:2e3,placeholder:"What went well, and what could we do better?",className:"w-full resize-none rounded-2xl border border-[#E6E7E8] bg-[#FCFCFD] px-4 py-3 pb-7 text-[13.5px] leading-relaxed transition-colors outline-none placeholder:text-[#B0B0B2] focus:border-[#A48CFF] focus:bg-white focus:ring-4 focus:ring-[#F0EEFF]"}),e.jsxs("span",{className:"pointer-events-none absolute right-3.5 bottom-3 text-[10.5px] text-[#B0B0B2]",children:[w.length,"/2000"]})]})]}),e.jsxs("div",{className:"sticky bottom-0 z-10 -mx-4 border-t border-[#ECEAF5] bg-white/90 px-4 pt-3 pb-[max(12px,env(safe-area-inset-bottom))] backdrop-blur-md sm:static sm:mx-0 sm:rounded-[20px] sm:border sm:p-5 sm:shadow-[0_1px_3px_rgba(16,24,40,0.05)]",children:[C&&e.jsx("p",{className:"mb-3 rounded-xl bg-[#FEF3F2] px-3.5 py-2.5 text-[12px] text-[#B42318]",children:C}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("p",{className:"hidden flex-1 items-center gap-2 text-[12px] leading-relaxed text-[#8D8D8E] sm:flex",children:[e.jsx(Y,{size:13,className:"shrink-0"}),"Your responses are only used to improve the hiring experience."]}),e.jsx("button",{type:"button",disabled:z,onClick:V,className:"inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-6 py-3 text-[14px] font-semibold text-white shadow-[0_8px_20px_rgba(123,97,255,0.32)] transition-[transform,opacity] hover:-translate-y-0.5 active:translate-y-0 disabled:cursor-not-allowed disabled:opacity-60 sm:w-auto",style:{background:"linear-gradient(135deg, #6A4DF5 0%, #8F72FF 100%)"},children:z?e.jsxs(e.Fragment,{children:[e.jsx(T,{size:16,className:"animate-spin"})," Sendingâ¦"]}):e.jsxs(e.Fragment,{children:["Send feedback ",e.jsx(ae,{size:15})]})})]})]})]})};export{je 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.