PageSourceSearch

https://www.pensionbee.com/uk/_next/static/chunks/pages/hive/beehi…/actions/refer-a-friend-767c02c19821fd93.js

js pensionbee.com collected 2026-09-24 17:37:52 UTC 12,419 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9273],{22608:(e,r,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/hive/beehive/actions/refer-a-friend",function(){return t(32646)}])},31513:(e,r,t)=>{"use strict";t.d(r,{v:()=>a});let a=function(e){let r=!(arguments.length>1)||void 0===arguments[1]||arguments[1],t="string"==typeof e?parseFloat(e):e;return isNaN(t)?(console.error("Invalid currency value provided: ",e),""):new Intl.NumberFormat("en-GB",{style:"currency",currency:"GBP",minimumFractionDigits:2*!!r,maximumFractionDigits:2*!!r}).format(t)}},32646:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>G});var a=t(37876),n=t(14232),i=t(77328),s=t.n(i),l=t(61381),o=t(18415),c=t(84847),d=t(89099),u=t(54587),f=t.n(u),h=t(80092),m=t(31513),x=t(38766),p=t(85194),g=t(25650),j=t(94252),v=t(82495),b=t(50900);let y=(0,b.F3)("Share",{web:()=>t.e(6392).then(t.bind(t,6392)).then(e=>new e.ShareWeb)}),w={src:"/uk/_next/static/media/green-star.f8406383.svg",height:18,width:18,blurWidth:0,blurHeight:0};var N=t(10170),k=t(35898),C=t(67768),R=t(40097);let S=()=>{let e=(0,k.A)(),r=(0,C.jE)();return(0,R.n)({mutationFn:async()=>{let r=await e("/api/account-management/raf-info-opened",{method:"POST",body:JSON.stringify({})});if(!r.ok)throw Error((await r.json()).message||r.statusText)},onSuccess:()=>{r.invalidateQueries({queryKey:["rewards"]})}})},_="".concat("https://www.pensionbee.com\n","/uk/referral-terms"),P=e=>[{title:"Share your unique link with a friend",description:"Share the referral link with your friend online, any way you like."},{title:"Your friend signs up to PensionBee",description:"We'll start processing their contributions or transfers as soon as they hit “confirm”."},{title:"Claim your ".concat((0,m.v)(e,!1)," contribution"),description:"As soon as both you and your friend's account have a balance of at least ".concat((0,m.v)(e,!1),".")}],F=e=>{let{onGetStarted:r}=e,{data:t,isLoading:i,isError:s,error:l}=(0,p.C)(),{mutate:o}=S(),c=(0,n.useRef)(!1);if((0,n.useEffect)(()=>{!c.current&&t&&(c.current=!0,t.rafInfoOpened||o(void 0,{onError:()=>{(0,x.h_)("Something went wrong. Please try again.")}}))},[t,o]),i)return(0,a.jsx)(g.A,{});if(s)return(0,a.jsx)(j.z,{error:l});if(!t)return null;let{rafAmountGross:d}=t;return(0,a.jsxs)("div",{className:"flex flex-col gap-28",children:[(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)(v.F,{name:"referAFriendIcon",alt:"Refer a friend",height:120,width:120})}),(0,a.jsx)(h.Tm,{as:"h1",children:"Refer a friend"}),(0,a.jsxs)(h.jP,{children:["You can refer up to 50 friends. So, you could earn up to \xa35,000 in pension contributions! ",(0,a.jsx)(h.N_,{href:_,target:"_blank",rel:"noopener noreferrer",onClick:e=>{e.preventDefault(),(0,N.M)(e.currentTarget.href)},children:"T&Cs apply"}),"."]}),P(d).map((e,r)=>(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-8",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-24 h-24 rounded-full bg-grey-6 flex-shrink-0",children:(0,a.jsx)(h.Tt,{className:"text-center leading-none",children:r+1})}),(0,a.jsx)(h.uJ,{as:"p",children:e.title})]}),(0,a.jsx)(h.jP,{children:e.description})]},e.title)),(0,a.jsx)(h.$n,{"data-testid":"raf-first-time-get-started-button",className:"w-full pb-10",variant:"primary-yellow",onClick:()=>null==r?void 0:r(),children:"Let’s get started"})]})},E="".concat("https://www.pensionbee.com\n","/uk/referral-terms"),T=["In progress","Claimed"],A="referred-friends-list",I=()=>{let{data:e,isLoading:r,isError:t,error:i}=(0,p.C)(),s=(0,d.useRouter)(),[l,o]=(0,n.useState)(!1),[c,u]=(0,n.use
1State)(0),[k,C]=(0,n.useState)(3),[R,S]=(0,n.useState)(!1),[_,P]=(0,n.useState)(!1),I=(0,n.useRef)(null);if(e&&null===I.current&&(I.current=!e.rafInfoOpened),r)return(0,a.jsx)(g.A,{});if(t)return(0,a.jsx)(j.z,{error:i});if(!e||I.current&&!R||_)return(0,a.jsx)(F,{onGetStarted:()=>{S(!0),P(!1)}});let{referrerRafs:B,totalEarnedByReferring:G,rafShareUrl:O,hasNotReachedMaxNumberOfRafSignups:$}=e,L=B.filter(e=>e.isRafRewardClaimable&&!e.isReferrerRewardClaimed),D=B.filter(e=>0===c?"Claimed"!==e.friendStatus:"Claimed"===e.friendStatus),z=D.slice(0,k),q=D.length-z.length,K=!O||!$,M=async()=>{K||(await navigator.clipboard.writeText(O),o(!0),setTimeout(()=>o(!1),3e3))},W=async()=>{if(!K)try{await y.share({url:O})}catch(e){e instanceof Error&&/cancel/i.test(e.message)||(0,x.h_)("Something went wrong. Please try again.")}};return(0,a.jsxs)("div",{className:"flex flex-col gap-28",children:[(0,a.jsx)(h.Tm,{as:"h1",className:"pb-20",children:"Refer a friend"}),L.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-12",children:L.map(e=>(0,a.jsx)(h.Eg,{variant:"infoGreen","data-testid":"unclaimed-reward-banner-".concat(e.id),children:(0,a.jsx)("div",{className:"flex items-center justify-between gap-12",children:(0,a.jsxs)("div",{className:"flex flex-col gap-16",children:[(0,a.jsxs)("div",{className:"flex gap-8",children:[(0,a.jsx)(f(),{src:w,alt:"",width:18,height:18}),(0,a.jsx)(h.Xv,{children:"Congratulations"})]}),(0,a.jsxs)(h.jP,{as:"p",children:["".concat(e.friendsName," opened an account with ").concat((0,m.v)(e.amountGross,!1),"+. "),(0,a.jsx)(h.$n,{variant:"inline-link",className:"text-inherit",onClick:()=>s.push("/hive/beehive/contributions/claim-reward"),"data-testid":"claim-now-button-".concat(e.id),children:"Claim your reward now."})]})]})})},e.id))}),(0,a.jsxs)(h.oR,{className:"flex-1 p-20 flex flex-col gap-16",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(h.ME,{children:(0,m.v)(G,!1)}),(0,a.jsx)(h.u7,{as:"p",children:"Total earned so far"})]}),B.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-12",children:[(0,a.jsx)(h.Iz,{segmentNames:T,selectedIndex:c,onClick:e=>{u(e),C(3)}}),(0,a.jsx)("div",{className:"flex flex-col gap-8",children:0===D.length?(0,a.jsx)(h.$Q,{children:"No referred friends here yet."}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("ul",{id:A,className:"flex flex-col gap-8",children:z.map(e=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-8",children:[(0,a.jsx)(h.$Q,{as:"p",children:e.friendsName}),(0,a.jsx)(h.uJ,{as:"p",children:e.friendStatus})]},e.id))}),(q>0||k>3)&&(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)(h.$n,{variant:"link",className:"self-start text-gray-500",onClick:()=>q>0?C(e=>e+10):C(3),"aria-expanded":0===q,"aria-controls":A,"data-testid":"toggle-show-all-friends-button",children:q>0?"Show more (".concat(q,")"):"Show less"})})]})})]})]}),$?(0,a.jsxs)(h.l3,{variant:"light",className:"flex flex-col gap-16",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(v.F,{name:"giftIcon",alt:"",height:60,width:60}),(0,a.jsx)(h.xt,{as:"p",children:"Share your link"})]}),(0,a.jsxs)(h.jP,{children:["Invite your friends to join PensionBee and receive a \xa3100 pension\n          contribution for every friend that opens an account and adds \xa3100 or\n          more to their pension. ",(0,a.jsx)(h.N_,{role:"link",tabIndex:0,className:"text-inherit",onClick:()=>P(!0),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),P(!0))},"data-testid":"learn-how-it-works-button",children:"Learn how it works."})]}),(0,a.jsxs)("div",{className:"flex flex-row gap-12",children:[!b.Ii.isNativePlatform()&&(0,a.jsx)(h.$n,{className:"flex-1",variant:"primary-yellow",icon:l?"Tick":"Copy",onClick:M,disabled:K,"data-testid":"copy-referral-link-button",children:l?"Copied!":"Copy link"}),b.Ii.isNativePlatform()&&(0,a.jsx)(h.$n,{className:"flex-1",variant:"primary-yellow",icon:"Share",onClick:W,disabled:K,"data-testid":"share-referral-link-button",children:"Share"})]})]}):(0,a.jsx)(h.Eg,{variant:"infoBlue",title:"You've reached your referral limit of 50 friends!","data-testid":"raf-limit-reached-banner",children:(0,a.jsxs)(h.jP,{children:["You have reached the limit of our Referral program per the"," ",(0,a.jsx)(h.N_,{href:E,target:"_blank",className:"text-blue-120",rel:"noopener noreferrer",onClick:e=>{e.preventDefault(),(0,N.M)(e.currentTarget.href)},children:"T&Cs"}
1),". Please contact your BeeKeeper if you need to discuss"]})})]})},B=(0,l.C7)(()=>(0,a.jsxs)("div",{children:[(0,a.jsxs)(s(),{children:[(0,a.jsx)("title",{children:"PensionBee - Refer a Friend"}),(0,a.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,a.jsx)(I,{})]}));B.getLayout=e=>(0,a.jsx)(c.A,{children:(0,a.jsx)(o.A,{backButtonIcon:"Back",children:e})});let G=B},38766:(e,r,t)=>{"use strict";t.d(r,{HP:()=>c,h_:()=>o,mI:()=>l});var a=t(37876),n=t(89848),i=t(80092);let s={backgroundColor:"#343A40",color:"#FFFFFF",borderRadius:"12px",padding:"12px"},l=(e,r)=>n.oR.success(e,{style:s,icon:(0,a.jsx)(i.m_,{icon:"Tick"}),...r}),o=(e,r)=>n.oR.error(e,{style:s,icon:(0,a.jsx)(i.m_,{icon:"Close"}),...r}),c=(e,r)=>n.oR.info(e,{style:s,icon:(0,a.jsx)(i.m_,{icon:"AlertInfo"}),...r})},61381:(e,r,t)=>{"use strict";t.d(r,{C7:()=>h,Cf:()=>m,_H:()=>u,v$:()=>f});var a=t(37876),n=t(14232),i=t(89099),s=t(38870),l=t(76668),o=t(16187);let c={public:"/hive/accounts/login",lead:"/hive/accounts/get-started",account:"/hive/beehive/summary"},d=(e,r)=>t=>
1{let[d,u]=(0,n.useState)(!0),f=(0,i.useRouter)(),{authReady:h,isLoggedIn:m}=(0,o.Z2)(),{userType:x,isLoading:p}=(0,s.F)();return((0,n.useEffect)(()=>{if(!h)return;if(!m){r.includes("public")||f.replace(c.public),u(!1);return}if(p)return;let e=null!=x?x:"public";r.includes(e)||f.replace(c[e]),u(!1)},[h,m,p,x,r]),d)?(0,a.jsx)("div",{className:"fixed inset-0 flex justify-center items-center bg-background",children:(0,a.jsx)(l.A,{})}):(0,a.jsx)(e,{...t})},u=e=>d(e,["public"]),f=e=>d(e,["lead"]),h=e=>d(e,["account"]),m=e=>d(e,["lead","account"])},84847:(e,r,t)=>{"use strict";t.d(r,{A:()=>x,G:()=>m});var a=t(37876),n=t(14232),i=t(80092),s=t(89099),l=t(52067),o=t(16187),c=t(94252),d=t(18415),u=t(25650),f=t(61381),h=t(79332);let m=e=>{let{children:r}=e,{logout:t}=(0,o.Z2)();return(0,a.jsx)("div",{className:"z-50",children:(0,a.jsx)("main",{className:"mx-auto max-w-header grid grid-cols-12 py-40 sm:py-32 px-20 sm:px-28",children:(0,a.jsx)("div",{className:"col-span-12 md:col-span-6 md:col-start-4 relative",children:(0,a.jsxs)("div",{className:"transition-opacity duration-300 opacity-100 visible",children:[(0,a.jsx)("div",{className:"min-h-[500px]",children:r}),(0,a.jsx)(i.$n,{variant:"secondary",className:"w-full",onClick:t,children:"Logout"})]})})})})},x=(0,f.C7)(e=>{var r;let{children:t}=e,i=(0,s.useRouter)(),[o,f]=(0,n.useState)(!0),{capabilities:m,isLoading:x,error:p,redirectRoute:g,beehiveAccessNotAllowed:j}=(0,l.E)();(0,n.useEffect)(()=>{var e;f(!1!==x||(null==m||null==(e=m.beehive)?void 0:e.allowed)===void 0||null===g)},[x,null==m||null==(r=m.beehive)?void 0:r.allowed]);let v=i.asPath.startsWith("/hive/beehive");return((0,n.useEffect)(()=>{!o&&null!==m&&j&&v&&g&&i.asPath!==g&&((0,h.cg)("info","Access gate redirect triggered",{accessGateRedirecting:!0,capabilities:m,redirectRoute:g}),i.replace(g))},[m,j,v,g,i,o]),p)?(0,a.jsx)(d.A,{hideBackButton:!0,hideBackButtonOnNativePlatform:!0,children:(0,a.jsx)(c.z,{error:p})}):o?(0,a.jsx)(u.A,{}):j?void 0:(0,a.jsx)(a.Fragment,{children:t})})},85194:(e,r,t)=>{"use strict";t.d(r,{C:()=>f});var a=t(3112),n=t(74359),i=t(16187),s=t(35898),l=t(44161);let o=a.object({id:a.string(),netReward:a.number(),grossReward:a.number(),partnerLabel:a.string(),alertType:a.string(),isAutomaticAward:a.boolean()}),c=a.object({id:a.string(),type:a.string(),friendsId:a.string().nullable(),isRafRewardClaimable:a.boolean(),isReferrerRewardClaimed:a.boolean(),friendStatus:a.string(),alertType:a.string(),amountGross:a.number(),friendsName:a.string()}),d=a.object({alertType:a.string(),amountGross:a.number()}),u=a.object({referrerRafs:a.array(c),rafPromotionalAlert:a.array(d),unclaimedRewards:a.array(o),totalEarnedByReferring:a.number(),rafInfoOpened:a.boolean().nullable(),rafAmountGross:a.number(),rafShareUrl:a.string().nullable(),hasNotReachedMaxNumberOfRafSignups:a.boolean()}),f=()=>{let e=(0,s.A)(),{isLoggedIn:r}=(0,i.Z2)();return(0,n.I)({queryKey:["rewards"],queryFn:async()=>{let r=await e("/api/account-management/rewards",{method:"GET"});if(!r.ok)throw new l.h("Failed to fetch rewards",r.status);let t=await r.json();return u.parse(t)},enabled:r})}}},e=>{var r=r=>e(e.s=r);e.O(0,[636,6593,8792],()=>r(22608)),_N_E=e.O()}]);
2//# sourceMappingURL=refer-a-friend-767c02c19821fd93.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.