import{c as P,a as M,l as Q}from"../chunks/cL9VaPgy.js";import{i as R,p as S,j as C,k as F,l as N,a as g,b as T,m as a,n as j,d as s,s as r,g as t,o as U,t as V,h as i,F as h,c as z}from"../chunks/C75YQU_W.js";import{i as W}from"../chunks/B4FYT0oR.js";import{e as X,i as Y,f as q,s as I}from"../chunks/D-5ps19L.js";import{g as Z}from"../chunks/Cz-4yBSw.js";o[h]="src/routes/+page.svelte";var aa=(x,n,v)=>{n.data.user&&Z(`/dashboard/card?template=${a(v).id}`)},ea=M(z('<div class="grid gap.4 radius p.4 bg.grey.2"><img alt="" role="presentation"/> <p>Earn <b> </b> if you spend <b> </b> in <b> </b></p> <p><small> <!></small></p> <a target="_blank">Apply<span class="visually-hidden"> </span></a></div>'),o[h],[[26,4,[[27,6],[29,6,[[30,13],[31,8],[32,11]]],[35,6,[[36,8]]],[44,6,[[53,13]]]]]]),ta=M(z('<ul class="grid.4 gap.4"></ul>'),o[h],[[23,0]]);function o(x,n){P(new.target),S(n,!0,o);const v=C(F(()=>n.data.cards.map(p=>{const e=n.data.wallet.find(l=>j(l.nickname.toLowerCase(),p.title.toLowerCase()));return{...p,isOwned:e}})),"cards");var m=ta();return N(()=>X(m,21,()=>a(v),Y,(p,e)=>{var l=ea();const k=C(F(()=>`${j(a(e).bonus_type,"cash")?"$":""}${q(a(e).bonus_amount)}`),"bonus");a(k);var y=s(l),$=r(y),b=r($),f=r(s(b)),B=s(f);t(f);var c=r(f,2),D=s(c);t(c);var w=r(c,2),G=s(w,!0);t(w),t(b);var d=r(b,2),A=s(d),E=s(A),H=r(E);{var J=_=>{var O=U("(after first year)");g(_,O)};N(()=>W(H,_=>{a(e).annual_fee&&a(e).annual_fee_waived&&_(J)}),"if",o,38,10)}t(A),t(d);var u=r(d,2);u.__click=[aa,n,e];var L=r(s(u)),K=s(L);t(L),t(u),t(l),V(_=>{I(y,"src",a(e).image),i($,` ${a(e).title??""} `),i(B,`${a(k)??""} ${a(e).bonus_type??""}`),i(D,`$${_??""}`),i(G,a(e).bonus_period),i(E,`Annual fee: $${a(e).annual_fee??""} `),I(u,"href",a(e).application_url),i(K,`for ${a(e).title??""}`)},[()=>q(a(e).bonus_spend)]),g(p,l)}),"each",o,24,2),t(m),g(x,m),T({...Q()})}R(["click"]);export{o as component};
