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