import{b as f,c as g,a as b}from"./BasePage-aJlR_RJI.js";import{_ as h}from"./USelect.vue_vue_type_script_setup_true_lang-Cw4e8KSA.js";import{_}from"./UInput.vue_vue_type_script_setup_true_lang-BjaSJgmr.js";import{c as C}from"./helper.service-Dk93koq0.js";import{u as $,O as v}from"./index-DruWBKkm.js";import{j as V,r as A,g as S,k as z,h as U,o as k,w as r,a as l,u as G}from"./index-CdEV5Lsj.js";import"./ULabel.vue_vue_type_script_setup_true_lang-DmdMPZfT.js";import"./UDivider.vue_vue_type_script_setup_true_lang-CBOjoWJ-.js";const j={__name:"Page",setup(w){const a=$(),e=V({streetAddress:"",city:"",state:"",zip:""}),o=A([]),i=S(()=>{var t;return((t=o.value)==null?void 0:t.length)&&!e.state||!e.streetAddress||!e.city||!e.zip});z(async()=>{var t;a.hasCompanyData||await a.getCompany(),o.value=a.statesForSelectedCountry,e.streetAddress=a.company.address.streetAddress,e.city=a.company.address.city,e.state=((t=o.value)==null?void 0:t.length)&&(a.company.address.state||""),e.zip=a.company.address.zip});async function u(t){var d;C(e,a.company.address)&&(await a.updateCompanyAddress(e),a.company.address.streetAddress=e.streetAddress,a.company.address.city=e.city,a.company.address.state=(d=o.value)!=null&&d.length?e.state:null,a.company.address.zip=e.zip),t()}return(t,s)=>{const d=_,m=g,c=h,y=f;return k(),U(b,{group:t.$t("group.company"),"group-step":G(v)*2,title:t.$t("title.companyAddress"),step:4,"prevent-next":i.value,prev:{name:"GettingStarted/Company/Step3"},next:{name:"GettingStarted/Payments/Step1"},skip:{name:"GettingStarted/Payments/Step1"},onContinue:u},{default:r(()=>[l(y,null,{default:r(()=>[l(m,null,{default:r(()=>[l(d,{modelValue:e.streetAddress,"onUpdate:modelValue":s[0]||(s[0]=n=>e.streetAddress=n),label:t.$t("label.address"),placeholder:t.$t("placeholder.address")},null,8,["modelValue","label","placeholder"]),l(d,{modelValue:e.city,"onUpdate:modelValue":s[1]||(s[1]=n=>e.city=n),label:t.$t("label.city"),placeholder:t.$t("placeholder.city")},null,8,["modelValue","label","placeholder"])]),_:1}),l(m,null,{default:r(()=>{var n;return[l(c,{modelValue:e.state,"onUpdate:modelValue":s[2]||(s[2]=p=>e.state=p),searchable:"",options:o.value,label:t.$t("label.state"),placeholder:t.$t("placeholder.state"),disabled:!((n=o.value)!=null&&n.length),"value-key":"value"},null,8,["modelValue","options","label","placeholder","disabled"]),l(d,{modelValue:e.zip,"onUpdate:modelValue":s[3]||(s[3]=p=>e.zip=p),label:t.$t("label.zipCode"),placeholder:t.$t("placeholder.zipCode")},null,8,["modelValue","label","placeholder"])]}),_:1})]),_:1})]),_:1},8,["group","group-step","title","prevent-next"])}}};export{j as default};
