import{M as A,ai as B,ab as D,$ as N,E as a,U as s,R as E,O as P,V as m,X as c,Z as M,Y as F}from"./vendor-CsGITfgk.js";import{a3 as L,aY as U,bR as g,f as Y}from"./index-CsCqMgta.js";import{u as z}from"./useCheckout-DB1kmMTf.js";import"./address-type.enum-CGCAFS3X.js";const G=A({__name:"index",setup(H){const h=B(),o=D(),{t:e}=N(),{themeContext:v}=L(),{loading:_,changing:b,allItemsAreDigital:r,forceFetch:x}=U(),{loading:f,changing:k,placedOrder:n,allOrderItemsAreDigital:C,canPayNow:w,initialize:y}=z(),i=a(()=>_.value||f.value),I=a(()=>b.value||k.value),l=a(()=>{const t=[];return n.value?t.push({icon:"arrow-left-bold",route:{name:"OrderDetails",params:{orderId:n.value.id},replace:!0},text:e("common.buttons.back_to_order_details")}):o.params.cartId?t.push({icon:"arrow-left-bold",route:{name:g.CART_ID.NAME,params:{cartId:o.params.cartId},replace:!0},text:e("common.buttons.back_to_cart")}):t.push({icon:"arrow-left-bold",route:{name:g.CART.NAME,replace:!0},text:e("common.buttons.back_to_cart")}),v.value?.settings?.checkout_multistep_enabled&&t.push({id:"Shipping",route:{name:"Shipping",replace:!0},text:e("pages.checkout.steps.shipping"),disabled:!!n.value,hidden:C.value??r.value},{id:"Billing",route:{name:"Billing",replace:!0},text:e("pages.checkout.steps.billing"),disabled:!!n.value},{id:"Review",text:e("pages.checkout.steps.review"),disabled:!!n.value}),t.push({id:"CheckoutPayment",text:e("pages.checkout.steps.payment"),hidden:!w.value},{id:"CheckoutPaymentResult",text:e("pages.checkout.steps.completed")}),t}),u=a(()=>o.name),p=a(()=>l.value.findIndex(t=>t.id===u.value)),d=a(()=>l.value[p.value]?.text);return Y({title:a(()=>[e("pages.checkout.meta.title"),d.value])}),(async()=>(await x(),o.name==="Checkout"&&(await y(),await h.push({name:r.value?"Billing":"Shipping",replace:!0}))))(),(t,X)=>{const V=s("VcTypography"),R=s("VcSteps"),S=s("VcLoaderOverlay"),T=s("router-view"),O=s("VcContainer");return P(),E(O,null,{default:m(()=>[c(V,{tag:"h1",class:"mb-5 print:mb-0"},{default:m(()=>[M(F(d.value),1)]),_:1}),c(R,{steps:l.value,"current-step-index":p.value,"start-step-index":0,disabled:i.value||I.value,class:"mb-5"},null,8,["steps","current-step-index","disabled"]),c(S,{visible:i.value||!u.value,"fixed-spinner":""},null,8,["visible"]),c(T)]),_:1})}}});export{G as default};
//# sourceMappingURL=index-DBAca8xl.js.map
