import{F as O,m as P,P as n,_ as g,R as _,a1 as l,T as d,X as t,a2 as m,a0 as r,Z as q,W as V,e,Y as y,bm as E}from"./vendor-d3O24IFR.js";import{a_ as U,bu as f}from"./index-dwhe4uKT.js";import{_ as D}from"./address-selection.vue_vue_type_script_setup_true_lang-hwrwP74f.js";import{u as T}from"./useCheckout-Ok6fq2eW.js";const W={class:"flex flex-col gap-6 lg:flex-row lg:gap-8"},F={class:"lg:w-3/5"},L={class:"space-y-3 lg:w-2/5"},R={class:"flex items-center gap-3 p-3 text-sm"},X=["data-selected-payment-method-id"],Y=["data-payment-method-id"],J=O({__name:"billing-details-section",props:{disabled:{type:Boolean}},setup(i){const{allItemsAreDigital:u,availablePaymentMethods:k,availableShippingMethods:v}=U(),p=P(()=>S.value?.code===f||v.value.length===1&&v.value[0].code===f),{billingAddressEqualsShipping:c,billingAddress:C,paymentMethod:$,shipmentMethod:S,onBillingAddressChange:w,setPaymentMethod:B,isPurchaseOrderNumberEnabled:M,purchaseOrderNumber:h}=T();return(a,o)=>{const N=n("VcLabel"),x=n("VcCheckbox"),b=n("VcImage"),z=n("VcSelect"),I=n("VcInput"),A=n("VcWidget");return _(),g(A,{title:a.$t("shared.checkout.billing_details_section.title"),"prepend-icon":"cash",size:"lg","data-test-id":"checkout.payment-details-section"},{default:l(()=>[d("div",W,[d("div",F,[t(N,{required:""},{default:l(()=>[m(r(a.$t("shared.checkout.billing_details_section.labels.billing_address")),1)]),_:1}),d("div",{class:q(["grow divide-y rounded-[--vc-radius] border",{"cursor-not-allowed bg-neutral-50":i.disabled}])},[!e(u)&&!p.value?(_(),g(x,{key:0,modelValue:e(c),"onUpdate:modelValue":o[0]||(o[0]=s=>y(c)?c.value=s:null),disabled:i.disabled,name:"billingAddressEqualsShipping",class:"p-3"},{default:l(()=>[m(r(a.$t("shared.checkout.billing_details_section.labels.same_as_shipping_address")),1)]),_:1},8,["modelValue","disabled"])):V("",!0),t(e(D),{placeholder:!e(u)&&!p.value&&e(c)?a.$t("shared.checkout.shipping_details_section.links.select_address"):a.$t("shared.checkout.billing_details_section.links.select_address"),address:e(C),disabled:i.disabled,readonly:!e(u)&&!p.value&&e(c),class:"min-h-18 px-3 py-1.5",onChange:e(w)},null,8,["placeholder","address","disabled","readonly","onChange"])],2)]),d("div",L,[t(z,{"model-value":e($),label:a.$t("shared.checkout.billing_details_section.labels.payment_method"),items:e(k),disabled:i.disabled,size:"auto",required:"","test-id-dropdown":"checkout.payment-method-selector",onChange:o[1]||(o[1]=s=>e(B)(s))},{placeholder:l(()=>[d("div",R,[t(b,{class:"size-12 rounded bg-neutral-100",src:"select-payment.svg"}),m(" "+r(a.$t("common.placeholders.select_payment_method")),1)])]),selected:l(({item:s})=>[d("div",{class:"flex items-center gap-3 p-3 text-sm","data-selected-payment-method-id":s.code},[t(b,{class:"size-12 rounded",src:s.logoUrl},null,8,["src"]),m(" "+r(s.name),1)],8,X)]),item:l(({item:s})=>[t(b,{class:"size-12 rounded",src:s.logoUrl},null,8,["src"]),d("span",{"data-payment-method-id":s.code},r(s.name),9,Y)]),_:1},8,["model-value","label","items","disabled"]),t(E,{name:"slide-fade-top",mode:"in-out"},{default:l(()=>[e(M)?(_(),g(I,{key:0,modelValue:e(h),"onUpdate:modelValue":o[2]||(o[2]=s=>y(h)?h.value=s:null),modelModifiers:{trim:!0},placeholder:a.$t("common.placeholders.purchase_order_number"),disabled:i.disabled,name:"purchaseOrderNumber"},null,8,["modelValue","placeholder","disabled"])):V("",!0)]),_:1})])])]),_:1},8,["title"])}}});export{J as _};
//# sourceMappingURL=billing-details-section.vue_vue_type_script_setup_true_lang-CLltjuYw.js.map
