1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1903],{1929:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/my-account/register",function(){return r(5803)}])},5803:function(e,n,r){"use strict";r.r(n),r.d(n,{__N_SSG:function(){return N},default:function(){return k}});var t=r(85893),s=r(67294),i=r(9008),o=r.n(i),c=r(86925),a=r(34727),u=r(14251),l=r(52875),d=r(97582),m=r(47058),v=r.n(m),h=r(27002),f=r(26729),p=r(2185),x=r(79614),g=r(11163),_=r(76195),j=r(35281);var y=function(){var e=(0,p.I0)(),n=(0,j.$G)("translation").t,r=(0,s.useState)(null),i=r[0],o=r[1],c=(0,s.useState)({}),m=c[0],y=c[1],N=(0,s.useState)(null),k=N[0],b=N[1],w=(0,s.useState)(null),I=w[0],C=w[1],R=(0,p.v9)((function(e){return e.accountReducer.errorMessage}),p.wU),E=(0,p.v9)((function(e){return e.mainReducer.isMobile}),p.wU),S=((0,p.v9)((function(e){return e.appReducer.authModal}),p.wU),(0,g.useRouter)()),A=null===S||void 0===S?void 0:S.query,Z=(0,s.useMemo)((function(){var e;return(null===R||void 0===R||null===(e=R[0])||void 0===e?void 0:e.includes("have a member with that email address entered"))?(0,t.jsx)("div",{className:v().errorMessage,children:"Sorry, the email address is invalid. Provide an alternative email or verify the email address is not already registered."}):(0,t.jsx)("div",{className:v().errorMessage,dangerouslySetInnerHTML:R&&{__html:R}})}),[R]),M=function(e){var n=e.target.value;b(n),y((function(e){return(0,l.Z)((0,u.Z)({},e),{countryId:n})}))},P=function(e){var n=e.target.value;y((function(e){return(0,l.Z)((0,u.Z)({},e),{provinceId:n})}))},F=(0,s.useMemo)((function(){if(k&&(null===I||void 0===I?void 0:I.countries)){var e,n=null===I||void 0===I||null===(e=I.countries)||void 0===e?void 0:e.find((function(e){return e.country_id===k}));return!n||0!=(null===n||void 0===n?void 0:n.usePostalCode)}return null}),[I,k]),U=function(){if(I&&I.countries){var e=I.countries;return m.countryId||y((function(e){return(0,l.Z)((0,u.Z)({},e),{countryId:"1"})})),(0,t.jsxs)("div",{className:v().formField,children:[(0,t.jsxs)("label",{className:v().label,children:["Country ",(0,t.jsx)("icon",{className:v().asteriskIcon,children:"*"})]}),(0,t.jsxs)("select",{name:"countryid",className:v().select,value:m.countryId,onChange:M,children:[(0,t.jsx)("option",{value:"Country",children:"Country"},"select"),e.map((function(e,n){var r=e.country_id,s=e.country_name;return(0,t.jsx)("option",{value:r,children:s},r)}))]})]})}},q=function(){if(I){var e=m.countryId,n=I.provinces.find((function(n){return n.country_id==e}));if(n){var r=n&&n.province_list||[];return I.countries&&I.provinces&&I.countries.length>0&&I.provinces.length>0&&r?(0,t.jsxs)("div",{className:v().formField,children:[(0,t.jsxs)("label",{className:v().label,children:["State ",(0,t.jsx)("icon",{className:v().asteriskIcon,children:"*"})]}),(0,t.jsxs)("select",{className:v().select,name:"provinceid",onChange:P,children:[(0,t.jsx)("option",{value:"state",disabled:!0,children:"Select... *"},"select_state"),r.map((function(e,n){var r=e.province_id,s=e.province_name;return 0!==n||m.provinceId||y((function(e){return(0,l.Z)((0,u.Z)({},e),{provinceId:r})})),(0,t.jsx)("option",{value:r,children:s},r)}))]})]}):void 0}}};(0,s.useEffect)((function(){e({type:x.Nfv,payload:""})}),[]),(0,s.useEffect)((0,a.Z)((function(){var e;return(0,d.__generator)(this,(function(n){switch(n.label){case 0:return[4,fetch(_.pt,{method:"GET",credentials:"include",mode:"cors",headers:{Accept:"*/*"}})];case 1:return[4,n.sent().json()];case 2:return e=n.sent(),C(e||{}),[2]}}))})),[]);var T=function(e){return e?void 0:n("checkout.isRequired")},G=function(e){return e&&!/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*\W).{8,}$/.test(e)?n("checkout.mustbe8characters"):e?void 0:n("checkout.isRequired")},B=function(e){return e&&e.match(/\d/g)?n("checkout.notContainNumber"):e?void 0:n("checkout.isRequired")},D=/^[0-9]{10}$/,L=function(e){return e&&!D.test(e)?n("checkout.mustContain10Digits"):e?void 0:n("checkout.isRequired")},$=function(e){return e&&!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(e)?n("checkout.isInvalid"):e?void 0:n("checkout.isRequired")}
1,z=function(e,n,r,s){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,t.jsxs)("div",{className:v().formField,children:[(0,t.jsxs)("label",{children:[r,i&&(0,t.jsx)("icon",{className:v().asteriskIcon,children:"*"})]}),(0,t.jsx)(f.gN,{name:n,component:"input",validate:i?s:null,children:function(n){var s=n.input,i=n.meta;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",(0,l.Z)((0,u.Z)({type:e},s),{style:{border:i.error&&i.touched?"1px solid red":""},placeholder:r})),i.error&&i.touched&&(0,t.jsx)("span",{className:v().red,children:r+" "+i.error})]})}})]})};return(0,t.jsxs)("div",{className:v().container,children:[E?(0,t.jsxs)("div",{className:"site-nav-container container",children:[" ",(0,t.jsxs)("div",{className:"theme1-basket",children:[" ",(0,t.jsxs)("div",{className:"linkClean",children:[" ",A.guest?n("checkout.guestAccount"):n("checkout.registerAccount")," "]})," "]})," "]}):(0,t.jsxs)("div",{className:"site-nav-container container",children:[" ",(0,t.jsxs)("div",{className:"theme1-basket",children:[" ",(0,t.jsxs)("div",{className:"linkClean",children:[" ",A.guest?n("checkout.guestAccount"):n("checkout.registerAccount")]})," "]})," "]}),(0,t.jsx)(f.l0,{onSubmit:function(n){m&&(null===A||void 0===A?void 0:A.guest)&&(n.countryId=m.countryId,n.provinceId=m.provinceId);var r="";o(null),n.email!==n.confirmEmail&&(r="Confirm Email must match Login Email. "),n.password!==n.confirmPassword&&(r+="Confirm Password must match Password"),r?o(r):A.guest?e((0,h.dE)(n,(function(){(null===A||void 0===A?void 0:A.returnUrl)&&S.push(null===A||void 0===A?void 0:A.returnUrl)}))):e((0,h.UD)(n,(function(){(null===A||void 0===A?void 0:A.returnUrl)&&S.push(null===A||void 0===A?void 0:A.returnUrl)})))},render:function(e){var n=e.handleSubmit;e.form,e.submitting;return(0,t.jsxs)("form",{onSubmit:n,id:"form-id",children:[z("text","firstname","First Name",B),z("text","lastname","Last Name",B),z("text","email","Email address",$),z("text","confirmEmail","Confirm Email",$),A.guest?(0,t.jsxs)(t.Fragment,{children:[z("text","company","Company",T,!1),z("text","address1","Address 1",T),z("text","address2","Address 2",T,!1),U(),q(),z("text","city","City",B),z("text","postal","Postal Code",F?T:null,F)]}):(0,t.jsxs)(t.Fragment,{children:[z("password","password","Password",G),z("password","confirmPassword","Confirm Password",G)]}),z("text","phone","Phone number",L)]})}}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("div",{className:"registermain",children:[(0,t.jsx)("button",{color:"primary",className:v().formButton,type:"submit",form:"form-id",children:"Create Account"}),(0,t.jsx)("button",{color:"secondary",className:v().formButton,onClick:function(){(null===A||void 0===A?void 0:A.returnUrl)?S.push(null===A||void 0===A?void 0:A.returnUrl):S.push("/")},children:"Cancel"})]}),R&&Z,i&&(0,t.jsx)("div",{className:v().errorMessage,dangerouslySetInnerHTML:i&&{__html:i}})]})]})},N=!0,k=function(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o(),{children:[(0,t.jsx)("title",{children:"Account Register"}),(0,t.jsx)("meta",{name:"description",content:"placeholder"}),(0,t.jsx)("meta",{name:"keywords",content:"placeholder"}),(0,t.jsx)("meta",{name:"metakeywords",content:"placeholder"}),(0,t.jsx)("meta",{property:"og:title",content:"placeholder"}),(0,t.jsx)("meta",{property:"og:image",content:"/images/sllogo.png"}),(0,t.jsx)("meta",{property:"og:image:secure_url",content:"/images/sllogo.png"}),(0,t.jsx)("meta",{property:"og:description",content:"placeholder"}),(0,t.jsx)("meta",{property:"og:url",content:c.I4+"/my-account/register"}),(0,t.jsx)("meta",{property:"og:type",content:"website"})]}),(0,t.jsx)("div",{children:(0,t.jsx)(y,{})})]})}},47058:function(e){e.exports={container:"Register_container__mSAP_",red:"Register_red__hR4DF",formField:"Register_formField__r8Miz",options:"Register_options__27kJD",asteriskIcon:"Register_asteriskIcon__2x8Tz",formButton:"Register_formButton___EEG4",errorMessage:"Register_errorMessage__ISG8A",registermain:"Register_registermain___wJY6"}}},function(e){e.O(0,[9669,6729,7002,9774,2888,179],(function(){return n=1929,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
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.