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