import{b as h,_ as v}from"./BasePage-C3DiNX0e.js";import{_ as C}from"./USelect.vue_vue_type_script_setup_true_lang-BgoCOcXc.js";import{_ as b}from"./UInput.vue_vue_type_script_setup_true_lang-eIU5RwOc.js";import{u as N,O as $,c as S}from"./index-_-ijfL1Q.js";import{l as V,r as U,k as u,f as k,h as G,o as E,w as d,a as r,u as w}from"./index-DRopsKkO.js";import"./ULabel.vue_vue_type_script_setup_true_lang-B9XE8rwf.js";import"./UDivider.vue_vue_type_script_setup_true_lang-CGxguuHo.js";import"./useMutationObserver-DtW-3lQD.js";const M={__name:"Page",setup(D){const a=N(),e=V({companyName:"",email:"",country:""}),p=U([]),y=u(()=>a.company.details.validation),f=u(()=>!e.companyName||!e.email||!e.country);k(async()=>{a.hasCompanyData||await a.getCompany(),e.companyName=a.company.details.companyName,e.email=a.company.details.email,e.country=a.company.details.country,p.value=a.company.details.countries});async function g(o){var m;S(e,a.company.details)&&(await a.updateCompanyDetails(e),a.company.details.companyName=e.companyName,a.company.details.email=e.email,a.company.details.country=e.country,e.country!==a.company.details.country&&(a.company.address.state=""));const l=!!((m=a.company.details.validation)!=null&&m.errors);o(!l)}return(o,t)=>{const l=b,m=C,_=h;return E(),G(v,{group:o.$t("group.company"),"group-step":w($)*3,title:o.$t("title.company"),step:1,"prevent-next":f.value,prev:{name:"GettingStarted/Analytics/Step1"},next:{name:"GettingStarted/Company/Step2"},skip:{name:"GettingStarted/Company/Step2"},onContinue:g},{default:d(()=>[r(_,null,{default:d(()=>{var s,i,c;return[r(l,{modelValue:e.companyName,"onUpdate:modelValue":t[0]||(t[0]=n=>e.companyName=n),label:o.$t("label.companyName"),placeholder:o.$t("placeholder.companyName"),"max-length":"255"},null,8,["modelValue","label","placeholder"]),r(l,{modelValue:e.email,"onUpdate:modelValue":t[1]||(t[1]=n=>e.email=n),error:(c=(i=(s=y.value)==null?void 0:s.errors)==null?void 0:i.email)==null?void 0:c.join(""),label:o.$t("label.email"),placeholder:o.$t("placeholder.companyEmail")},null,8,["modelValue","error","label","placeholder"]),r(m,{modelValue:e.country,"onUpdate:modelValue":t[2]||(t[2]=n=>e.country=n),searchable:"",options:p.value,label:o.$t("label.country"),placeholder:o.$t("placeholder.country"),"value-key":"value"},null,8,["modelValue","options","label","placeholder"])]}),_:1})]),_:1},8,["group","group-step","title","prevent-next"])}}};export{M as default};
