PageSourceSearch

https://myaccount.sbs.com.au/assets/d197cac/create-account-BY2m1LAq.js

js sbs.com.au collected 2026-09-24 08:25:22 UTC 6,694 bytes, 1 lines download raw bytes

1import{z as _,A as L,w as T,R as B}from"./chunk-EPOLDU6W-Cy0pbNoL.js";import{j as e}from"./jsx-runtime-u17CrQMm.js";import{f as i,H as A,P as f,h as j,B as h,L as c,l as D,t as N}from"./index-e26oBipY.js";import{E as y}from"./elevated-container-BseI2e8E.js";import{u as b}from"./use-query-params-BZ521P1R.js";import{u as w}from"./use-status-announcer-MDvt8qpK.js";import{a as p}from"./status-announcer-provider-twgJHQuP.js";import{u as H,C as u}from"./index.esm-B0oGELu-.js";import{A as q}from"./middleware-OTSEx0cA.js";import{u as W}from"./user-profile-DknISN-A.js";import{G as $,B as V}from"./gender-control-mG0z26uC.js";import{a as z,P as R,E as Y}from"./password-control-VZ_UVzCj.js";import{T as x}from"./Trans-DmyXkCdt.js";import{A as d}from"./data-layer-1kvIXlWL.js";import{u as M}from"./user-provider-BVDzkoqu.js";import"./index-hDuMSH-s.js";import"./i18nInstance-CHFDjdcJ.js";import"./mutation-BhTIUPuz.js";import"./QueryClientProvider-CC4TKqza.js";import"./sbs-login-instance-QtxHg8-X.js";import"./constant-DgzOUPqJ.js";function K({email:o}){const n=_(),{t:s}=p();w(s("createAccountVerifyEmail.heading"));const{"redirect-url":t}=b();return e.jsx(y,{children:e.jsxs(i,{space:"spacing.400",children:[e.jsx(A,{textAlign:"center",fontSize:{xs:"xl",sm:"2xl"},children:s("createAccountVerifyEmail.heading")}),e.jsxs(i,{space:"spacing.200",textAlign:"center",children:[e.jsx(f,{children:s("createAccountVerifyEmail.p1",{email:o})}),e.jsx(f,{children:s("createAccountVerifyEmail.p2")})]}),e.jsx(j,{onClick:()=>{n(`/sign-in${t?`?redirect-url=${t}`:""}`)},children:s("button.signIn")})]})})}function G(){const{t:o}=p(),{"redirect-url":n,site:s}=b(),t=new URL("/sign-in",window.location.origin);return s&&t.searchParams.set("site",s),n&&t.searchParams.set("redirect-url",n),e.jsx(h,{color:"text",fontSize:"md",textAlign:"center",children:e.jsx(x,{components:[e.jsx(c,{fontWeight:"medium",color:"text",href:`${t.pathname}${t.search}`,textDecoration:"underline"},"link.signIn")],i18nKey:"createAccountForm.alreadyHaveAnAccount",values:{signIn:o("link.signIn")}})})}function Q(){const{t:o}=p();return e.jsxs(i,{space:"spacing.100",children:[e.jsx(h,{color:"text-subtle",fontSize:"xs",textAlign:"center",paddingX:"spacing.200",lineHeight:"heading",children:e.jsx(x,{components:[e.jsx(c,{color:"text-subtle",fontWeight:"medium",href:"https://www.sbs.com.au/aboutus/terms-and-conditions",rel:"noopener noreferrer",target:"_blank",textDecoration:"underline"},"createAccountForm.termsLink"),e.jsx(c,{color:"text-subtle",fontWeight:"medium",href:"https://www.sbs.com.au/privacy-policy",rel:"noopener noreferrer",target:"_blank",textDecoration:"underline"},"createAccountForm.privacyLink"),e.jsx(c,{color:"text-subtle",fontWeight:"medium",href:"https://help.sbs.com.au/hc/en-au/articles/360002024815-Why-do-I-need-an-SBS-Account",rel:"noopener noreferrer",target:"_blank",textDecoration:"underline"},"createAccountForm.whyLink")],i18nKey:"createAccountForm.p1"})}),e.jsx(h,{color:"text-subtle",fontSize:"xs",textAlign:"center",lineHeight:"heading",children:e.jsx(x,{components:[e.jsx(c,{color:"text-subtle",fontWeight:"medium",href:"https://help.sbs.com.au/hc/en-au/articles/360002024815-Why-do-I-need-an-SBS-Account",rel:"noopener noreferrer",target:"_blank",textDecoration:"underline"},"createAccountForm.whyLink")],i18nKey:"createAccountForm.p2",values:{whyLink:o("createAccountForm.whyLink")}})})]})}function Z({onSuccess:o}){const{t:n,i18n:s}=p(),{user:t}=M(),[E]=L(),S=E.get("site")||"myaccount",{control:l,register:v,handleSubmit:C,formState:a,setError:g}=H({mode:"onBlur"});w(n("createAccountForm.heading"));const{mutate:F,isPending:k}=W.useMutation("post","/profile",{onMutate:()=>{g("root",{type:void 0})},onSuccess:(r,m,P)=>{o(m.body.email),d.push({event:"createAccountSuccess",userAccount:{loginType:"email",status:t.loggedIn?"login":"logout"},identification:{janrainUUID:t.id??"",hashedEmail:t.emailHash??""}})},onError:(r,m,P)=>{d.push({event:"createAccountFailed",userAccount:{loginType:"email",status:t.loggedIn?"login":"logout",failMessage:r.message},identification:{janrainUUID:t.id??"",hashedEmail:t.emailHash??""}}),r instanceof q&&r.status===400?g("email",{type:"emailCannotBeUsed"},{shouldFocus:!0}):g("root",{type:"generic"})}}),I=async r=>{d.push({event:"createAccountInitiated",userAccount:{loginType:"email",status:t.loggedIn?"login":"logout"},identification:{janrainUUID:t.id??"",hashedEmail:t.emailHash??""}}),F({params:{header:{"x-api-key":"74165a3a-0ae7-4d27-ac1a-e71e81062a89"}}
1,body:{firstName:r.firstName,email:r.email,password:r.password,gender:r.gender,birthYear:r.birthYear,lang:s.language,registrationSource:`${S}_rego_web`}})},U=async r=>{const m=r.firstName?.message??r.email?.message??r.password?.message??r.gender?.message??r.birthYear?.message??r.root?.message??"";d.push({event:"createAccountFailed",userAccount:{status:"logout",failMessage:m,loginType:"email"},identification:{hashedEmail:"",janrainUUID:""}})};return e.jsx(y,{children:e.jsxs(i,{alignItems:"center",space:{xs:"spacing.600",sm:"spacing.700"},textAlign:"center",children:[e.jsx(A,{fontSize:{xs:"xl",sm:"2xl"},children:n("createAccountForm.heading")}),e.jsx(i,{asChild:!0,space:"spacing.300",width:"100%",style:{maxWidth:600},textAlign:"left",children:e.jsx("form",{onSubmit:r=>{C(I,U)(r)},children:e.jsxs(i,{space:"spacing.400",children:[e.jsx(D,{error:!!a.errors.firstName,helperText:a.errors.firstName?.type==="required"?n("formError.firstNameRequired"):a.errors.firstName?.message,label:n("formFields.firstName"),required:!0,children:e.jsx(N.Root,{...v("firstName",{required:!0}),autoComplete:"given-name"})}),e.jsx(u,{control:l,name:"email",render:({field:r})=>e.jsx(z,{field:r,error:a.errors.email,autoComplete:"username"}),rules:{required:!0,pattern:{value:/^[\w.%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,message:n("formError.invalidEmail")}}}),e.jsx(u,{control:l,name:"password",render:({field:r})=>e.jsx(R,{field:r,error:a.errors.password,autoComplete:"new-password"}),rules:{required:!0,pattern:{value:/^(?=(.*\d.*))[\s\S]{5,}$/,message:n("formError.passwordStrength")}}}),e.jsx(u,{control:l,name:"gender",rules:{required:!0},render:({field:r})=>e.jsx($,{field:r,error:a.errors.gender})}),e.jsx(u,{control:l,name:"birthYear",rules:{required:!0},render:({field:r})=>e.jsx(V,{field:r,error:a.errors.birthYear})}),e.jsx(j,{type:"submit",disabled:k,children:n("button.createAccount")}),e.jsx("div",{role:"alert",children:a.errors.root?.type==="generic"&&e.jsx(Y,{children:n("formError.generic")})})]})})}),e.jsx(Q,{}),e.jsx(G,{})]})})}const Ae=()=>[{title:"Create Account"}],je=T(function(){const[o,n]=B.useState();return o?e.jsx(K,{email:o}):e.jsx(Z,{onSuccess:n})});export{je as default,Ae as meta};

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.