var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++){a=arguments[r];for(var s in a)if(Object.prototype.hasOwnProperty.call(a,s))e[s]=a[s]}return e};return __assign.apply(this,arguments)};import{h}from"./index-38ad4957.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{A as AuthWrapper,g as gap,a as AuthColumn,b as AuthButtonsContainer,E as ErrorStyles}from"./mixins-f750863a.js";var style={Wrapper:__assign(__assign({},AuthWrapper),gap({direction:"column",size:"var(--sl-spacing-small)"})),Column:AuthColumn,ForgotButtonContainer:{display:"inline",cursor:"pointer","font-size":"13px","font-weight":"600",color:"#AAAAAA",margin:"0"},ButtonsContainer:AuthButtonsContainer,ErrorStyle:ErrorStyles};var vanillaStyle="\n:host {\n  display: block;\n}\n:host([hidden]): {\n  display: none;\n}\na svg {\n  margin: 0 auto;\n  display: block;\n}\n";var sheet=createStyleSheet(style);var styleString=sheet.toString();function EmailRegistrationView(e){var a,r,t,s;var i=e.states,n=e.callbacks,l=e.content;var o=function(e,a,r){return e==="FRAUD"?h("sqm-form-message",{type:"error",exportparts:"erroralert-icon"},h("b",null,r),h("div",{part:"erroralert-text"},a)):h("sqm-form-message",{type:"error",exportparts:"erroralert-icon"},h("div",{part:"erroralert-text"},e))};var p=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return h("div",{part:"sqm-base",class:sheet.classes.Wrapper,style:{border:""+(l.hideBorder?"none":"var(--sqm-border-thickness, 1px) solid var(--sqm-border-color)"),backgroundColor:l.backgroundColor,"padding-top":"var(--sl-spacing-"+l.paddingTop+")","padding-right":"var(--sl-spacing-"+l.paddingRight+")","padding-bottom":"var(--sl-spacing-"+l.paddingBottom+")","padding-left":"var(--sl-spacing-"+l.paddingLeft+")"}},h("style",{type:"text/css"},vanillaStyle,styleString),l.topSlot,h("sl-form",{class:sheet.classes.Column,"onSl-submit":n.submit},e.states.error&&o(e.states.error,e.content.fraudErrorMessage,e.content.fraudErrorMessageTitle),l.includeName&&h("sl-input",{exportparts:"label: input-label, base: input-base",type:"name",name:"/firstName",label:l.firstNameLabel||"First Name",disabled:i.loading}),l.includeName&&h("sl-input",{exportparts:"label: input-label, base: input-base",type:"name",name:"/lastName",label:l.lastNameLabel||"Last Name",disabled:i.loading}),h("sl-input",Object.assign({exportparts:"label: input-label, base: input-base",type:"email",name:"/email",label:l.emailLabel||"Email",disabled:i.loading,required:true,validationError:function(e){var a=e.value;if(!a){return l.requiredFieldErrorMessage}if(!a.match(p)){return l.invalidEmailErrorMessage}}},((r=(a=i.registrationFormState)===null||a===void 0?void 0:a.validationErrors)===null||r===void 0?void 0:r.email)?{class:sheet.classes.ErrorStyle,helpText:((s=(t=i.registrationFormState)===null||t===void 0?void 0:t.validationErrors)===null||s===void 0?void 0:s.email)||l.requiredFieldErrorMessage}:[])),h("div",{class:sheet.classes.ButtonsContainer,style:{paddingTop:""+(l.includeName?"var(--sl-spacing-medium)":"0")}},h("sl-button",{submit:true,loading:i.loading,exportparts:"base: primarybutton-base",type:"primary"},l.registerLabel||"Registration"))),l.bottomSlot)}export{EmailRegistrationView as E};