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-3e8OGtgt.js";import{d as F,e as T,cb as D,g as Q,c2 as R,b9 as z}from"./index-Db0iSsz5.js";/* empty css                                                                     */import{u as A}from"./useSkyflowCards-CpPwDCrY.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(r){return(a,o)=>{const _=l("VcIcon"),d=l("VcButton");return e(),t("div",{class:N(["credit-card",{"credit-card--disabled":!r.cardActive}])},[m(_,{class:"credit-card__icon",name:"credit-card"}),v("div",X,i(r.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]=p=>a.$emit("remove"))},null,8,["aria-label"]),r.cardExpiration?(e(),t("div",q,[b(i(a.$t("common.prefixes.expires"))+" ",1),v("span",G,i(r.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(r,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"},ae=g({__name:"saved-credit-cards",setup(r){const{t:a}=E(),{openModal:o}=T(),{loading:_,skyflowCards:d,fetchSkyflowCards:p}=A(),{mutate:k}=I(D,{refetchQueries:[z.Query.GetSkyflowCards]}),{storeId:h}=Q;function w(n){const u=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(){u(),await k({command:{skyflowId:n,storeId:h}})}}})}return p(),(n,u)=>{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,c=>m(s(Z),{key:c})),64))])):s(d)?.length?(e(),t("div",H,[(e(!0),t(x,null,y(s(d),(c,$)=>(e(),f(s(L),{key:$,"card-number":s(R)(c.cardNumber),"card-expiration":c.cardExpiration,"card-active":c.active,onRemove:J=>w(c.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{ae as default};
//# sourceMappingURL=saved-credit-cards-DFRxbkUu.js.map
