import{K as S,ag as w,B as c,S as d,P as r,a7 as k,b as t,M as l,T as p,V as y,U as i,W as C}from"./vendor-bSWkQivH.js";import{aM as N,bV as x}from"./index-Dqv5IkpS.js";import{O as z}from"./order-summary-DbBBQpx2.js";import{_ as T,a as B,b as O,c as R}from"./payment-processing-cyber-source.vue_vue_type_style_index_0_lang-BDX6Whc-.js";import"./useSkyflowCards-C4tN6b9M.js";const A={class:"flex flex-row items-center justify-between space-x-3 p-4 shadow-lg md:p-6"},F={class:"min-w-0 truncate"},I={class:"p-5 md:p-6"},q=S({__name:"payment",setup(W){const $=w(),{placedOrder:n,allOrderItemsAreDigital:b}=N(),m=c(()=>n.value.inPayments[0]),M=c(()=>{var o,e;return(e=(o=m.value)==null?void 0:o.paymentMethod)==null?void 0:e.paymentMethodType}),u=c(()=>{var o,e;return(e=(o=m.value)==null?void 0:o.paymentMethod)==null?void 0:e.typeName});async function a(o){await $.replace({name:"CheckoutPaymentResult",params:{status:o?"success":"failure"}})}return(o,e)=>{const V=d("VcImage"),h=d("VcWidget"),P=d("VcLayout");return t(n)?(l(),r(P,{key:0,"sidebar-position":"right","sticky-sidebar":""},{sidebar:p(()=>[y(t(z),{cart:t(n),"no-shipping":t(b)},null,8,["cart","no-shipping"])]),default:p(()=>[y(h,{size:"lg"},{"default-container":p(()=>{var f,_,v,g;return[i("div",A,[i("div",F,[y(V,{src:(_=(f=m.value)==null?void 0:f.paymentMethod)==null?void 0:_.logoUrl,class:"mr-3.5 inline-block size-8 object-center md:size-9",lazy:""},null,8,["src"]),i("span",null,C(o.$t(`common.methods.payment_by_code.${(g=(v=m.value)==null?void 0:v.paymentMethod)==null?void 0:g.code}`)),1)])]),i("div",I,[M.value===t(x).Redirection?(l(),r(t(T),{key:0,order:t(n)},null,8,["order"])):u.value==="AuthorizeNetPaymentMethod"?(l(),r(B,{key:1,order:t(n),onSuccess:e[0]||(e[0]=s=>a(!0)),onFail:e[1]||(e[1]=s=>a(!1))},null,8,["order"])):u.value==="SkyflowPaymentMethod"?(l(),r(O,{key:2,order:t(n),onSuccess:e[2]||(e[2]=s=>a(!0)),onFail:e[3]||(e[3]=s=>a(!1))},null,8,["order"])):u.value==="CyberSourcePaymentMethod"?(l(),r(R,{key:3,order:t(n),onSuccess:e[4]||(e[4]=s=>a(!0)),onFail:e[5]||(e[5]=s=>a(!1))},null,8,["order"])):k("",!0)])]}),_:1})]),_:1})):k("",!0)}}});export{q as default};
//# sourceMappingURL=payment-PvF9Gq9I.js.map
