import{_ as C}from"./USelect.vue_vue_type_script_setup_true_lang-Cw4e8KSA.js";import{b as E,c as w,_ as G,a as j}from"./BasePage-aJlR_RJI.js";import{_ as B}from"./UInput.vue_vue_type_script_setup_true_lang-BjaSJgmr.js";import{b as N,u as P,O as Q}from"./index-DruWBKkm.js";import{h as y,o as h,w as n,a as o,v as F,P as I,N as O,a4 as x,g as $,k as M,a0 as L,z as T,u as m,a5 as b}from"./index-CdEV5Lsj.js";import{_ as z}from"./UAlert.vue_vue_type_script_setup_true_lang-DIQ9zHdR.js";import"./ULabel.vue_vue_type_script_setup_true_lang-DmdMPZfT.js";import"./UDivider.vue_vue_type_script_setup_true_lang-CBOjoWJ-.js";const q={__name:"ErrorAlert",props:{errorMessage:{type:String,default:"Error"}},setup(D){return(a,S)=>{const t=N,_=G,i=w,s=E,u=z;return h(),y(u,{class:"py-5",color:"red",variant:"thirdary"},{default:n(()=>[o(s,{gap:"sm",align:"center"},{default:n(()=>[o(s,{gap:"xs",align:"center"},{default:n(()=>[o(i,{gap:"xs","no-mobile":"",class:"justify-center"},{default:n(()=>[o(t,{name:"exclamation-circle-fill",color:"red"}),o(_,{class:"font-semibold text-gray-900",html:"Error"})]),_:1}),o(_,{class:"text-gray-600"},{default:n(()=>[I(O(D.errorMessage),1)]),_:1})]),_:1}),F(a.$slots,"default")]),_:3})]),_:3})}}},ae={__name:"Page",setup(D){const a=P(),S=x(a.domains.signUpFormData),t=$(()=>a.domains.signUpData.validation),_=$(()=>!!(Object.keys(t.value.errors||{}).length>0||t.value.message)),{username:i,password:s,securityQuestion:u,securityAnswer:v}=S,V={rightIconSlot:"border-none hover:border-none bg-transparent"};M(async()=>{a.hasSignUpFormData?(a.setDomainsLoading(!0),await a.getDomainRegistrarsSignUpData(),a.setDomainsLoading(!1)):await L.push({name:"GettingStarted/Domains/Step5"})});async function R(e){const{...r}=a.domains.signUpFormData,p={...r,phone:`${a.domainPhoneCodeValue}${r.phone}`};await a.signUpDomainRegistrar({registrar:"enom",formData:p}),e(!_.value)}const k=$(()=>!i.value||!s.value||!u.value||!v.value);return(e,r)=>{const p=B,U=w,A=C;return h(),y(j,{group:e.$t("group.domains"),"group-step":m(Q)*4,title:e.$t("title.enom"),description:e.$t("pageDescription.enom"),step:2,"max-steps":2,"prevent-next":k.value,prev:{name:"GettingStarted/Domains/Step5"},next:{name:"GettingStarted/Domains/Step2"},skip:{name:"GettingStarted/Domains/Step7"},onContinue:R},{default:n(()=>[t.value.message?(h(),y(q,{key:0,"error-message":t.value.message},null,8,["error-message"])):T("",!0),o(U,null,{default:n(()=>{var d,c,g,f;return[o(p,{modelValue:m(i),"onUpdate:modelValue":r[0]||(r[0]=l=>b(i)?i.value=l:null),error:(c=(d=t.value.errors)==null?void 0:d.username)==null?void 0:c.join(""),label:e.$t("label.username"),placeholder:e.$t("placeholder.username")},null,8,["modelValue","error","label","placeholder"]),o(p,{modelValue:m(s),"onUpdate:modelValue":r[1]||(r[1]=l=>b(s)?s.value=l:null),error:(f=(g=t.value.errors)==null?void 0:g.password)==null?void 0:f.join(""),type:"password",label:e.$t("label.password"),placeholder:e.$t("placeholder.password"),config:V},null,8,["modelValue","error","label","placeholder"])]}),_:1}),o(U,null,{default:n(()=>{var d,c,g,f;return[o(A,{modelValue:m(u),"onUpdate:modelValue":r[2]||(r[2]=l=>b(u)?u.value=l:null),error:(c=(d=t.value.errors)==null?void 0:d.securityQuestion)==null?void 0:c.join(""),searchable:"","value-key":"value",options:m(a).domains.signUpData.enom.securityQuestions,label:e.$t("label.securityQuestion"),placeholder:e.$t("placeholder.securityQuestion")},null,8,["modelValue","error","options","label","placeholder"]),o(p,{modelValue:m(v),"onUpdate:modelValue":r[3]||(r[3]=l=>b(v)?v.value=l:null),error:(f=(g=t.value.errors)==null?void 0:g.securityAnswer)==null?void 0:f.join(""),label:e.$t("label.securityAnswer"),placeholder:e.$t("placeholder.enterAnswer")},null,8,["modelValue","error","label","placeholder"])]}),_:1})]),_:1},8,["group","group-step","title","description","prevent-next"])}}};export{ae as default};
