PageSourceSearch

https://slamjam.com/cdn/shop/t/493/assets/register-validator.min.js?v=23310636030545169151784710878

js slamjam.com collected 2026-09-24 08:50:27 UTC 2,835 bytes, 1 lines download raw bytes

1class RegisterValidator extends HTMLElement{constructor(){super(),this.selectors={Email:".email",Password:".password",FirstName:".firstName",LastName:".lastName",PrivacyCheck:"#RegisterForm-PrivacyCheck",ProfilingCheck:"#chkProfiling",PasswordConfirmation:".passwordConfirmation",EmailConfirmation:".emailConfirmation",Gender:".customer-gender"},this.form=document.querySelector("#create_customer"),this.validator=new Validator(this.form),this.confirmPwdInput=this.form.querySelector(this.selectors.PasswordConfirmation+" input"),this.pwdInput=this.form.querySelector(this.selectors.Password+" input"),this.form.addEventListener("submit",r=>this.onSubmit(r)),this.submitBtn=this.form.querySelector("#register_submit")}reset(){Object.keys(this.selectors).forEach(r=>this.validator.removeError(this.selectors[r])),this.removeBtnError()}removeBtnError(){this.validator.removeErrorBtn(this.submitBtn),this.submitBtn.innerHTML=window.formStrings.registerSubmit}checkErrors(r){let i=!1;var e=(r,e,t)=>{r?(this.validator.addError(this.selectors[e],t),i=!0):this.validator.removeError(this.selectors[e])},t=this.form.querySelector(this.selectors.Email+" input")?.value,s=this.form.querySelector(this.selectors.EmailConfirmation+" input")?.value,o=this.form.querySelector(this.selectors.FirstName+" input")?.value,a=this.form.querySelector(this.selectors.LastName+" input")?.value,n=this.pwdInput?.value,l=this.confirmPwdInput?.value,h=this.form.querySelector(this.selectors.PrivacyCheck+" input")?.checked,m=Array.from(this.form.querySelectorAll(this.selectors.Gender+" input")),c=this.validator.validateEmail(t),d=this.validator.validatePassword(n);return e(!m.find(r=>r.checked),"Gender",window.errorStrings?.fieldBlank),e(!c,"Email",window.errorStrings?.emailInvalid),e(!d,"Password",window.errorStrings?.passwordInvalid),e(!o,"FirstName",window.errorStrings?.firstNameBlank),e(!a,"LastName",window.errorStrings?.lastNameBlank),e(!h,"PrivacyCheck"),d&&e(n!==l,"PasswordConfirmation",window.errorStrings?.passwordMismatch),c&&e(t!==s,"EmailConfirmation",window.errorStrings?.emailMismatch),i?(this.validator.scrollToError(),this.validator.showErrorBtn(this.submitBtn)):this.removeBtnError(),i}onSubmit(r){this.checkErrors()?(this.form.addEventListener("change",r=>this.checkErrors(r)),r.preventDefault()):this.populateTagFields(r)}populateTagFields(r){const e=[];this.querySelector(this.selectors.ProfilingCheck)?.checked&&e.push("accept_profiling_yes");Array.from(this.form.querySelectorAll(this.selectors.Gender+" input")).forEach(r=>{r.checked&&(e.push(r.value),sessionStorage.setItem("newCustomer",window.location.pathname))});var t=this.querySelector("#form-tags").value;t&&(t=t.split(",").map(r=>r.trim()),e.push(...t)),this.querySelector("#form-tags").value=e.join(", ")}}customElements.define("register-validator",RegisterValidator);

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.