import{C as k,N as i,D as t,E as a,am as S,Q as l,P as f,a3 as B,R as n,S as b,ce as E,V as I,a6 as M,K as y,O as D,u as s,F as g,J as x}from"./vendor-BGtMsOoo.js";import{e as F,h as Q,ah as R,c7 as T,g as z,c0 as A}from"./index-CRze-aDK.js";import"./payment-policies.vue_vue_type_style_index_0_lang-BQUPSUyI.js";import{u as O}from"./useSkyflowCards-Blgc1LI3.js";const G={class:"credit-card__number"},J={key:0,class:"credit-card__expire"},K={class:"credit-card__expiration-date"},L=k({__name:"credit-card",props:{cardNumber:{},cardExpiration:{},cardActive:{type:Boolean}},emits:["remove"],setup(p){return(e,o)=>{const m=i("VcIcon"),c=i("VcButton");return a(),t("div",{class:S(["credit-card",{"credit-card--disabled":!e.cardActive}])},[l(m,{class:"credit-card__icon",name:"credit-card"}),f("div",G,n(e.cardNumber),1),l(c,{class:"credit-card__remove","aria-label":e.$t("common.buttons.remove_credit_card"),color:"neutral",size:"xs",variant:"no-background",icon:"delete-thin",onClick:o[0]||(o[0]=_=>e.$emit("remove"))},null,8,["aria-label"]),e.cardExpiration?(a(),t("div",J,[b(n(e.$t("common.prefixes.expires"))+" ",1),f("span",K,n(e.cardExpiration),1)])):B("",!0)],2)}}}),P={},X={class:"flex flex-col border-y bg-additional-50 pb-4 pt-4.5 shadow-sm md:flex-row md:items-center md:rounded md:border-x md:py-0"};function j(p,e){return a(),t("div",X,e[0]||(e[0]=[E('<div class="grow px-6 text-lg md:py-5 md:text-base"><div class="w-8/12 bg-neutral-100"> </div></div><div class="mt-1.5 shrink-0 px-6 text-sm md:mt-0 md:text-base"><div class="w-32 bg-neutral-100"> </div></div><div class="hidden shrink-0 px-6 md:flex"><div class="h-7 w-16 bg-neutral-100"> </div></div>',3)]))}const q=F(P,[["render",j]]),H={key:0,class:"flex flex-col divide-y lg:space-y-3 lg:divide-none"},U={key:1,class:"space-y-3 md:space-y-2.5"},te=k({__name:"saved-credit-cards",setup(p){const{t:e}=I(),{openModal:o}=Q(),{loading:m,skyflowCards:c,fetchSkyflowCards:_}=O(),{mutate:h}=M(T,{refetchQueries:[R.Query.GetSkyflowCards]}),{storeId:w}=z;function V(d){const u=o({component:"VcConfirmationModal",props:{variant:"danger",title:e("pages.account.saved_credit_cards.delete_credit_card_modal.title"),text:e("pages.account.saved_credit_cards.delete_credit_card_modal.message"),async onConfirm(){u(),await h({command:{skyflowId:d,storeId:w}})}}})}return _(),(d,u)=>{var v;const C=i("VcTypography"),$=i("VcEmptyView");return a(),t("div",null,[l(C,{tag:"h1"},{default:D(()=>[b(n(d.$t("shared.account.navigation.links.saved_credit_cards")),1)]),_:1}),s(m)?(a(),t("div",H,[(a(),t(g,null,x(3,r=>l(s(q),{key:r})),64))])):(v=s(c))!=null&&v.length?(a(),t("div",U,[(a(!0),t(g,null,x(s(c),(r,N)=>(a(),y(s(L),{key:N,"card-number":s(A)(r.cardNumber),"card-expiration":r.cardExpiration,"card-active":r.active,onRemove:W=>V(r.skyflowId)},null,8,["card-number","card-expiration","card-active","onRemove"]))),128))])):(a(),y($,{key:2,text:d.$t("pages.account.saved_credit_cards.no_cards"),icon:"credit-card"},null,8,["text"]))])}}});export{te as default};
//# sourceMappingURL=saved-credit-cards--PWKdPeA.js.map
