import{a as y}from"./BasePage-aJlR_RJI.js";import{_ as f}from"./AddressForm-C-6JNukl.js";import{c as i}from"./helper.service-Dk93koq0.js";import{u as g,O as v}from"./index-DruWBKkm.js";import{u as C}from"./usePaymentMethods-BbCZJclB.js";import{j as h,r as S,g as m,k as P,h as _,o as k,w as N,a as x,u as z}from"./index-CdEV5Lsj.js";import"./USelect.vue_vue_type_script_setup_true_lang-Cw4e8KSA.js";import"./ULabel.vue_vue_type_script_setup_true_lang-DmdMPZfT.js";import"./UDivider.vue_vue_type_script_setup_true_lang-CBOjoWJ-.js";import"./UInput.vue_vue_type_script_setup_true_lang-BjaSJgmr.js";const M={__name:"Page",setup(A){const e=g(),{activatePaymentMethods:o}=C(e),t=h({accountName:"",address:"",city:"",state:"",zipCode:""}),s=S([]),p=m(()=>{var a;return!t.accountName||!t.address||!t.city||!t.zipCode||((a=s.value)==null?void 0:a.length)>0&&!t.state}),c=m(()=>{let a=1;return e.payments.banktransfer.isActive&&(a=3),a}),u=m(()=>{let a=1;return e.payments.banktransfer.isActive&&(a=3),a}),d=m(()=>e.payments.banktransfer.isActive?{name:"GettingStarted/Payments/Step3"}:{name:"GettingStarted/Payments/Step1"});P(async()=>{var a;e.hasCompanyData||await e.getCompany(),e.hasPaymentData||await e.getPayments(),s.value=e.statesForSelectedCountry,t.state=((a=s.value)==null?void 0:a.length)&&(e.payments.mailin.params.state||e.company.address.state||""),t.accountName=e.payments.mailin.params.accountName,t.address=e.payments.mailin.params.address||e.company.address.streetAddress,t.city=e.payments.mailin.params.city||e.company.address.city,t.zipCode=e.payments.mailin.params.zipCode||e.company.address.zip});async function l(a){var n;(i(t,e.payments)||i(t,e.payments.mailin.params))&&(e.payments.mailin.params.accountName=String(t.accountName),e.payments.mailin.params.address=t.address,e.payments.mailin.params.city=t.city,e.payments.mailin.params.state=(n=s.value)!=null&&n.length?t.state:"",e.payments.mailin.params.zipCode=t.zipCode,await o()),a()}return(a,r)=>(k(),_(y,{group:a.$t("group.payments"),"group-step":z(v)*3,title:a.$t("title.checkPayment"),description:a.$t("pageDescription.checkPayment"),step:c.value,"max-steps":u.value,"prevent-next":p.value,prev:d.value,next:{name:"GettingStarted/Domains/Step1"},onContinue:l},{default:N(()=>[x(f,{modelValue:t,"onUpdate:modelValue":r[0]||(r[0]=n=>t=n),states:s.value},null,8,["modelValue","states"])]),_:1},8,["group","group-step","title","description","step","max-steps","prevent-next","prev"]))}};export{M as default};
