1(self.webpackChunkapp_project=self.webpackChunkapp_project||[]).push([[6520],{84500:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>s});var o=i(12737),c=i(14863);const n=i(38302).default;class s extends n{get CLASSES(){return{ctaNewAccount:"js_checkout-cta-new-free-account",containerRegisterBox:"js_checkout-register-container",containerFormRegister:"js_checkout-register-form-container",containerFormLogin:"js_checkout-login-container",buttonBackFormRegister:"js_button-back-checkout-register",formRegisterCheckout:"js_register-form-checkout"}}constructor(t){super(t),this.ctaNewAccount=this.element.querySelector(".".concat(this.CLASSES.ctaNewAccount)),this.containerRegisterBox=this.element.querySelector(".".concat(this.CLASSES.containerRegisterBox)),this.containerFormRegister=this.element.querySelector(".".concat(this.CLASSES.containerFormRegister)),this.containerFormLogin=this.element.querySelector(".".concat(this.CLASSES.containerFormLogin)),this.buttonBackFormRegister=this.element.querySelector(".".concat(this.CLASSES.buttonBackFormRegister)),this.init()}init(){this.handleClick(),this.hideBoxRegister(),this.handleSocialRegistration()}handleClick(){let t=!1;this.ctaNewAccount.addEventListener("click",(async e=>{if(t)this.hideBoxLogin();else{const i=e.currentTarget.dataset.url;try{const t=await(0,c.ZP)("".concat(i),{method:"GET"}),e=await t.json();this.containerFormRegister.innerHTML=e.render,this.hideBoxLogin(),this.complateFormSubmit()}catch(t){console.error(t)}t=!0}o.Z.emit("body:loaded")}))}hideBoxLogin(){this.containerFormLogin.classList.add("d-none"),this.containerRegisterBox.classList.contains("d-none")&&this.containerRegisterBox.classList.remove("d-none")}hideBoxRegister(){this.buttonBackFormRegister&&this.buttonBackFormRegister.addEventListener("click",(()=>{this.containerRegisterBox.classList.add("d-none"),this.containerFormLogin.classList.remove("d-none")}))}complateFormSubmit(){const t=this.element.querySelector(".".concat(this.CLASSES.formRegisterCheckout));t&&t.addEventListener("data",(t=>{t.detail.data.success&&window.location.reload()}))}handleSocialRegistration(){this.ctaNewAccount.dataset.socialReg&&JSON.parse(this.ctaNewAccount.dataset.socialReg)&&(o.Z.emit("body:loading"),this.ctaNewAccount.click())}}}}]);
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.