import{F as g,P as l,Q as t,R as e,Z as N,X as m,T as v,W as B,a0 as i,a2 as b,c3 as S,ag as E,aq as I,_ as f,a1 as M,e as s,a6 as x,a7 as y}from"./vendor-CB-jpi5M.js";import{d as F,e as T,cc as D,g as Q,c3 as R,b9 as z}from"./index--7FqiOc7.js";import{u as A}from"./useSkyflowCards-e_LUwS36.js";const X={class:"credit-card__number"},q={key:0,class:"credit-card__expire"},G={class:"credit-card__expiration-date"},L=g({__name:"credit-card",props:{cardNumber:{},cardExpiration:{},cardActive:{type:Boolean}},emits:["remove"],setup(c){return(a,o)=>{const _=l("VcIcon"),d=l("VcButton");return e(),t("div",{class:N(["credit-card",{"credit-card--disabled":!c.cardActive}])},[m(_,{class:"credit-card__icon",name:"credit-card"}),v("div",X,i(c.cardNumber),1),m(d,{class:"credit-card__remove","aria-label":a.$t("common.buttons.remove_credit_card"),color:"neutral",size:"xs",variant:"no-background",icon:"delete-thin",onClick:o[0]||(o[0]=u=>a.$emit("remove"))},null,8,["aria-label"]),c.cardExpiration?(e(),t("div",q,[b(i(a.$t("common.prefixes.expires"))+" ",1),v("span",G,i(c.cardExpiration),1)])):B("",!0)],2)}}}),O={},P={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 W(c,a){return e(),t("div",P,[...a[0]||(a[0]=[S('<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 Z=F(O,[["render",W]]),j={key:0,class:"flex flex-col divide-y lg:space-y-3 lg:divide-none"},H={key:1,class:"space-y-3 md:space-y-2.5"},ee=g({__name:"saved-credit-cards",setup(c){const{t:a}=E(),{openModal:o}=T(),{loading:_,skyflowCards:d,fetchSkyflowCards:u}=A(),{mutate:k}=I(D,{refetchQueries:[z.Query.GetSkyflowCards]}),{storeId:h}=Q;function w(n){const p=o({component:"VcConfirmationModal",props:{variant:"danger",title:a("pages.account.saved_credit_cards.delete_credit_card_modal.title"),text:a("pages.account.saved_credit_cards.delete_credit_card_modal.message"),async onConfirm(){p(),await k({command:{skyflowId:n,storeId:h}})}}})}return u(),(n,p)=>{const V=l("VcTypography"),C=l("VcEmptyView");return e(),t("div",null,[m(V,{tag:"h1"},{default:M(()=>[b(i(n.$t("shared.account.navigation.links.saved_credit_cards")),1)]),_:1}),s(_)?(e(),t("div",j,[(e(),t(x,null,y(3,r=>m(s(Z),{key:r})),64))])):s(d)?.length?(e(),t("div",H,[(e(!0),t(x,null,y(s(d),(r,$)=>(e(),f(s(L),{key:$,"card-number":s(R)(r.cardNumber),"card-expiration":r.cardExpiration,"card-active":r.active,onRemove:J=>w(r.skyflowId)},null,8,["card-number","card-expiration","card-active","onRemove"]))),128))])):(e(),f(C,{key:2,text:n.$t("pages.account.saved_credit_cards.no_cards"),icon:"credit-card"},null,8,["text"]))])}}});export{ee as default};
//# sourceMappingURL=saved-credit-cards-B3-TMzi3.js.map
