1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="f22a9f37-04a9-4105-9415-1ef9261b48b3",e._sentryDebugIdIdentifier="sentry-dbid-f22a9f37-04a9-4105-9415-1ef9261b48b3")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4922],{4922:(e,s,a)=>{a.r(s),a.d(s,{default:()=>A});var t=a(37876),r=a(14232),o=a(91408),n=a(88992),i=a(71090),l=a(72377),d=a(78229),c=a(76859),p=a(25002),u=a(53897),g=a(53838),m=a(87856);let y=(0,m.Ay)(g.aE).attrs({"data-testid":"password-input"}).withConfig({displayName:"PasswordStep.styles__PasswordInput",componentId:"sc-e708333e-0"})(["border-color:",";&:hover{border-color:",";}&:focus{border-color:",";}"],({theme:e,$hasError:s})=>s?e.colours.danger500:e.colours.border.secondary,({theme:e,$hasError:s})=>s?e.colours.danger500:e.colours.black,({theme:e,$hasError:s})=>s?e.colours.danger500:e.colours.primary500),f=(0,m.Ay)(g.rP).attrs({"data-testid":"password-error-message"}).withConfig({displayName:"PasswordStep.styles__PasswordErrorMessage",componentId:"sc-e708333e-1"})(["visibility:visible;",";"],({theme:e,$isFocused:s,$isPasswordValid:a,$hasError:t})=>a?`color: ${e.colours.primary500}; font-weight: 600;`:t?`color: ${e.colours.text.danger};`:s?`color: ${e.colours.black}`:`color: ${e.colours.grey500}`),h=m.Ay.div.withConfig({displayName:"PasswordStep.styles__CheckboxesWrapper",componentId:"sc-e708333e-2"})(["margin-top:",";margin-bottom:",";"],({theme:e})=>e.spacing(8),({theme:e})=>e.spacing(8));m.Ay.div.withConfig({displayName:"PasswordStep.styles__TermsAndConditionsWrapper",componentId:"sc-e708333e-3"})(["margin-bottom:",";"],({theme:e})=>e.spacing(4));let w=m.Ay.div.withConfig({displayName:"PasswordStep.styles__ButtonsWrapper",componentId:"sc-e708333e-4"})(["display:flex;flex-direction:column;align-items:center;"]);var b=a(86631),x=a(74291),_=a(75171),v=a(49784),k=a(53381);let C=["required","min","max","matches"],I=/^(((?=.*[A-Za-z])(?=.*[0-9])(?=.*[\W_\s*])))(?=.{8,50})/,A=({stepNumber:e,onContinue:s,onBack:a,loading:m,passwordValidationError:A,onResetPasswordValidationError:P})=>{var j;let{t:N}=(0,l.Bd)(),{CLIENT_RECAPTCHA_KEY:S,features:V}=(0,b.z)(),{addBanner:B}=(0,v.V)(),[E,T]=(0,u.O1)(),R=(0,r.useRef)(null),[$,W]=(0,r.useState)(!1),[M,F]=(0,r.useState)(!1),[L,D]=(0,r.useState)(!1),[z,O]=(0,r.useState)(!1),{newPasswordValidation:q=!1}=V||{},U=N("password.showPassword",{defaultValue:"Show password",ns:"signup"}),Y=N("password.hidePassword",{defaultValue:"Hide password",ns:"signup"}),G=N("errorMessages.invalidPassword",{defaultValue:"Include letters, numbers, and special characters",ns:"signup"}),H=N("password.valid",{defaultValue:"Great password!",ns:"signup"}),Z=(0,o.Ik)({password:(0,o.Yj)().required(N("errorMessages.requiredPassword",{defaultValue:"Password can't be empty",ns:"signup"})).min(8,N("errorMessages.shortPassword",{defaultValue:"Password is too short",ns:"signup"})).max(50,N("errorMessages.longPassword",{defaultValue:"Password is too long",ns:"signup"})).matches(I,G).trim()}),{register:J,formState:{errors:K,isValid:Q},handleSubmit:X}=(0,n.mN)({mode:"all",resolver:(0,i.t)(Z),defaultValues:{password:E.password}}),ee=(0,r.useCallback)(async()=>{if(!E.recaptcha)try{let e=await R.current?.executeAsync();if(!e)throw Error("Recaptcha verification failed");T({type:"change_recaptcha",nextRecaptcha:e})}catch(e){B({message:N("banners.verificationFailed",{defaultValue:"Verification failed. Please try again.",ns:"signup"}),shouldPersist:!0,bannerType:"error",status:_.l.ERROR})}},[E.recaptcha,T,B,N]),es=!Q||!E.termsAndCondsChecked||!!A,ea=(0,r.useCallback)(async e=>{try{T({type:"change_password",nextPassword:e.password}),await ee(),O(!0)}catch(e){B({message:N("banners.unknown",{defaultValue:"There was an unknown error while creating your account.",ns:"signup"}),shouldPersist:!0,bannerType:"error",status:_.l.ERROR})}},[ee,T,N,B]);(0,r.useEffect)(()=>A?void O(!1):(z&&!es&&E.recaptcha&&s(),()=>{O(!1)}),[E.recaptcha,es,z,s]);let et=L&&!q&&!A,er=!!A,eo=K.password?.type,en=(j=(!$&&"string"==typeof eo&&C.some(e=>
1e===eo)?eo:void 0)??null,er?"server":j||null),ei=K.password?.message||A||(et?H:G);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.hE,{children:N("password.title",{defaultValue:"Choose a password",ns:"signup"})}),(0,t.jsxs)(g.lV,{onSubmit:X(ea),children:[(0,t.jsxs)(g.mO,{children:[(0,t.jsx)(g.l1,{htmlFor:"password",children:N("password.label",{defaultValue:"Password",ns:"signup"})}),(0,t.jsxs)(g.oi,{children:[(0,t.jsx)(y,{id:"password",type:M?"text":"password",...J("password",{onChange:e=>{q&&P&&P(),T({type:"change_password",nextPassword:e.target.value}),D(I.test(e.target.value))}}),autoComplete:"new-password","aria-invalid":!!en,$hasError:!!en,"aria-required":!0,onFocus:()=>{W(!0)},onBlur:()=>{W(!1)}}),(0,t.jsx)(g.Yw,{children:(0,t.jsx)(g.fP,{onClick:()=>{F(!M)},"aria-label":M?Y:U,"aria-pressed":M,"data-testid":"ToggleShowPasswordButton",type:"button",children:M?(0,t.jsx)(c.A,{fill:"disabled"}):(0,t.jsx)(p.A,{fill:"disabled"})})})]})]}),(0,t.jsx)(f,{role:"alert",$errorType:en,$isFocused:$,$isPasswordValid:et,$hasServerError:er,$hasError:!!en,children:ei}),(0,t.jsx)(h,{children:Q&&!K.password&&!A&&(0,t.jsx)(k.A,{onClick:()=>T({type:"toggle_marketing_checkbox"}),value:E.marketingEmailsChecked})}),(0,t.jsx)(w,{children:(0,t.jsx)(x.A,{stepNumber:e,continueDisabled:es,loading:m,inForm:!0,onBack:a,continueTestId:"password-continue-action"})})]}),(0,t.jsx)(d.A,{sitekey:S,size:"invisible",ref:R})]})}},53381:(e,s,a)=>{a.d(s,{A:()=>n});var t=a(37876),r=a(72322),o=a(72377);let n=({onClick:e,value:s})=>{let{t:a}=(0,o.Bd)(),n=a("marketing",{ns:"signup",defaultValue:"I'd like to receive personalised recommendations, discount codes, and updates from Perlego"});return(0,t.jsx)(r.S,{name:"marketingCheckbox",onClick:()=>e(!s),value:s,ariaLabel:n,testId:"marketing-checkbox",children:(0,t.jsx)("span",{"data-testid":"marketing-label",children:n})})}},53838:(e,s,a)=>{a.d(s,{Yw:()=>u,aE:()=>c,fP:()=>g,hE:()=>o,l1:()=>d,lV:()=>n,mO:()=>i,oi:()=>l,rP:()=>p});var t=a(87856),r=a(78338);let o=t.Ay.h2.attrs({"data-testid":"signup-step-title"}).withConfig({displayName:"common.styles__Title",componentId:"sc-bcefcce5-0"})(["",";text-align:left;margin-bottom:",";"],({theme:e})=>e.text.BodyLMedium,({theme:e})=>e.spacing(4)),n=t.Ay.form.withConfig({displayName:"common.styles__Form",componentId:"sc-bcefcce5-1"})(["display:flex;flex-direction:column;"]),i=t.Ay.div.withConfig({displayName:"common.styles__Wrapper",componentId:"sc-bcefcce5-2"})(["",";display:flex;flex-direction:column;color:",";"],({theme:e})=>e.text.BodySMedium,({theme:e})=>e.colours.text.secondary),l=t.Ay.div.withConfig({displayName:"common.styles__InputWrapper",componentId:"sc-bcefcce5-3"})(["display:flex;align-items:center;"]),d=t.Ay.label.withConfig({displayName:"common.styles__InputLabel",componentId:"sc-bcefcce5-4"})(["margin-bottom:",";"],({theme:e})=>e.spacing(2)),c=t.Ay.input.withConfig({displayName:"common.styles__BaseInput",componentId:"sc-bcefcce5-5"})(["",";height:",";width:100%;border-width:1px;border-style:solid;border-radius:6px;padding-left:10px;padding-right:",";"],({theme:e})=>e.text.BodyMRegular,({theme:e})=>e.spacing(10),({$errorType:e})=>e?"30px":"10px"),p=t.Ay.p.withConfig({displayName:"common.styles__BaseErrorMessage",componentId:"sc-bcefcce5-6"})(["",";visibility:",";min-height:",";margin:0;"],({theme:e})=>e.text.BodySRegular,({$errorType:e})=>e?"visible":"hidden",({theme:e})=>e.spacing(5)),u=t.Ay.div.withConfig({displayName:"common.styles__InputAidWrapper",componentId:"sc-bcefcce5-7"})(["display:flex;align-items:center;justify-content:center;margin-inline-start:",";"],({theme:e})=>e.spacing(-7.5)),g=t.Ay.button.withConfig({displayName:"common.styles__ToggleShowPasswordButton",componentId:"sc-bcefcce5-8"})(["background-color:transparent;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;margin:0;"]);(0,t.Ay)(r.A).withConfig({displayName:"common.styles__Link",componentId:"sc-bcefcce5-9"})(["text-decoration:underline;"])},74291:(e,s,a)=>{a.d(s,{A:()=>l});var t=a(37876),r=a(72377);let o=a(87856).Ay.div.withConfig({displayName:"SignUpStepNavigation.styles__Wrapper",componentId:"sc-43ba246b-0"})(["display:flex;flex-direction:column;align-items:center;width:100%;"]);var n=a(1946),i=a(10475);let l=({stepNumber:e,continueDisabled:s,showBackLink:a=!0,loading:l,onContinue:d,onBack:c,inForm:p,continueTestId:u,backTestId:g})=>{let{t:m}=(0,r.Bd)();return(0,t.jsxs)(o,{children:[(0,t.jsx)(n.$,{type:p?"submit":"button",testId:u||"SignUpStepNavigation__continue",disabled:s,"aria-disabled":s,loading:l,"aria-busy":l,fullWidth:!0,size:"m",onClick:p?void 0:d,children:m("navigation.continue",{defaultValue:"Continue",ns:"signup"})}),a&&c&&e>1&&(0,t.jsx)(i.N,{testId:g||"SignUpStepNavigation__back",ariaLabel:m("navigation.backAriaLabel",{defaultValue:"Back to previous step",ns:"signup"}),size:"m",variant:"tertiary",fullWidth:!1,tabIndex:0,href:"#",onClick:e=>{e.preventDefault(),c()},children:m("navigation.back",{defaultValue:"Back",ns:"signup"})})]})}},78338:(e,s,a)=>{a.d(s,{A:()=>i});var t,r=a(37876),o=a(72377),n=a(85495);let i=(t=n.A,e=>{let{t:s}=(0,o.Bd)(),a={opensInNewTab:s("linkNewTabScreenReaderText",{ns:"translation",defaultValue:"opens in new tab"})};return(0,r.jsx)(n.A.TranslationProvider,{screenReader:a,children:(0,r.jsx)(t,{...e})})})}}]);
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.