@kiva/kv-components 6.14.2 → 6.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,12 @@
1
- function r(o) {
1
+ import a from "./Alea.js";
2
+ function c(o) {
2
3
  if (!o)
3
4
  return !1;
4
5
  let t = o.toString();
5
6
  return t.includes(".") && ([t] = t.split(".")), ["726677", "315726", "4d844ac2c0b77a8a522741b908ea5c32"].includes(t);
6
7
  }
7
- function a() {
8
- const o = [
8
+ function l(o = "") {
9
+ const t = new a(o), e = [
9
10
  { color: "tw-text-action", bg: "tw-bg-brand-100" },
10
11
  { color: "tw-text-black", bg: "tw-bg-brand-100" },
11
12
  { color: "tw-text-white", bg: "tw-bg-action" },
@@ -13,10 +14,10 @@ function a() {
13
14
  { color: "tw-text-primary-inverse", bg: "tw-bg-action" },
14
15
  { color: "tw-text-white", bg: "tw-bg-black" },
15
16
  { color: "tw-text-action", bg: "tw-bg-black" }
16
- ], t = o[Math.floor(Math.random() * o.length)];
17
- return `${t.color} ${t.bg}`;
17
+ ], r = e[Math.floor(t() * e.length)];
18
+ return `${r.color} ${r.bg}`;
18
19
  }
19
20
  export {
20
- r as isLegacyPlaceholderAvatar,
21
- a as randomizedUserAvatarClass
21
+ c as isLegacyPlaceholderAvatar,
22
+ l as randomizedUserAvatarClass
22
23
  };
@@ -1,8 +1,9 @@
1
1
  import R from "graphql-tag";
2
- import ee from "numeral";
3
- import { toRefs as ne, computed as n } from "vue";
4
- import { mdiMapMarker as Le } from "@mdi/js";
5
- const ye = "N/A", te = "ECO-FRIENDLY", ae = "SUSTAINABLE AG", oe = "SINGLE PARENT", Ee = "REFUGEES/DISPLACED", P = (c, p) => (c == null ? void 0 : c.find((v) => v.name.replace("#", "").toUpperCase() === p.toUpperCase())) ?? {}, Pe = R`
2
+ import ae from "numeral";
3
+ import { toRefs as se, computed as n } from "vue";
4
+ import { mdiMapMarker as ye } from "@mdi/js";
5
+ import Ee from "./Alea.js";
6
+ const Ue = "N/A", oe = "ECO-FRIENDLY", ne = "SUSTAINABLE AG", le = "SINGLE PARENT", Ne = "REFUGEES/DISPLACED", P = (c, v) => (c == null ? void 0 : c.find((f) => f.name.replace("#", "").toUpperCase() === v.toUpperCase())) ?? {}, _e = R`
6
7
  fragment LoanCallouts on LoanBasic {
7
8
  id
8
9
  activity {
@@ -19,7 +20,7 @@ const ye = "N/A", te = "ECO-FRIENDLY", ae = "SUSTAINABLE AG", oe = "SINGLE PAREN
19
20
  themes
20
21
  }
21
22
  }
22
- `, Re = R`
23
+ `, Se = R`
23
24
  fragment LoanGeocode on LoanBasic {
24
25
  id
25
26
  geocode {
@@ -31,7 +32,7 @@ const ye = "N/A", te = "ECO-FRIENDLY", ae = "SUSTAINABLE AG", oe = "SINGLE PAREN
31
32
  }
32
33
  }
33
34
  }
34
- `, Me = R`
35
+ `, De = R`
35
36
  fragment LoanProgress on LoanBasic {
36
37
  id
37
38
  loanAmount
@@ -42,124 +43,124 @@ const ye = "N/A", te = "ECO-FRIENDLY", ae = "SUSTAINABLE AG", oe = "SINGLE PAREN
42
43
  }
43
44
  }
44
45
  `;
45
- function Fe(c, p = !1) {
46
+ function Me(c, v = !1) {
46
47
  const {
47
- externalLinks: v,
48
+ externalLinks: f,
48
49
  customLoanDetails: L,
49
- loanId: h,
50
+ loanId: m,
50
51
  loan: t,
51
- categoryPageName: d,
52
+ categoryPageName: p,
52
53
  customCallouts: y
53
- } = ne(c), se = n(() => v.value ? "a" : "router-link"), le = n(() => L.value ? "" : `/lend/${h.value}`), M = n(() => !h.value || !t.value), re = n(() => {
54
+ } = se(c), re = n(() => f.value ? "a" : "router-link"), ue = n(() => L.value ? "" : `/lend/${m.value}`), F = n(() => !m.value || !t.value), ie = n(() => {
54
55
  var e;
55
56
  return ((e = t.value) == null ? void 0 : e.name) || "";
56
- }), f = n(() => {
57
- var e, a, s;
58
- return ((s = (a = (e = t.value) == null ? void 0 : e.geocode) == null ? void 0 : a.country) == null ? void 0 : s.name) || "";
59
- }), ue = n(() => {
60
- var e, a, s;
61
- return ((s = (a = (e = t.value) == null ? void 0 : e.geocode) == null ? void 0 : a.country) == null ? void 0 : s.isoCode) || "";
57
+ }), g = n(() => {
58
+ var e, a, l;
59
+ return ((l = (a = (e = t.value) == null ? void 0 : e.geocode) == null ? void 0 : a.country) == null ? void 0 : l.name) || "";
60
+ }), ce = n(() => {
61
+ var e, a, l;
62
+ return ((l = (a = (e = t.value) == null ? void 0 : e.geocode) == null ? void 0 : a.country) == null ? void 0 : l.isoCode) || "";
62
63
  }), E = n(() => {
63
64
  var e, a;
64
65
  return ((a = (e = t.value) == null ? void 0 : e.geocode) == null ? void 0 : a.city) || "";
65
- }), F = n(() => {
66
+ }), _ = n(() => {
66
67
  var e, a;
67
68
  return ((a = (e = t.value) == null ? void 0 : e.geocode) == null ? void 0 : a.state) || "";
68
- }), _ = n(() => {
69
+ }), S = n(() => {
69
70
  var e;
70
71
  return ((e = t.value) == null ? void 0 : e.distributionModel) || "";
71
- }), ie = n(() => {
72
+ }), de = n(() => {
72
73
  var e, a;
73
74
  return ((a = (e = t.value) == null ? void 0 : e.image) == null ? void 0 : a.hash) ?? "";
74
75
  }), U = n(() => {
75
- var e, a, s, u, m;
76
- return typeof ((e = t.value) == null ? void 0 : e.loanAmount) < "u" && typeof ((s = (a = t.value) == null ? void 0 : a.loanFundraisingInfo) == null ? void 0 : s.fundedAmount) < "u" && typeof ((m = (u = t.value) == null ? void 0 : u.loanFundraisingInfo) == null ? void 0 : m.reservedAmount) < "u";
77
- }), ce = n(() => !M.value && U.value), de = n(() => {
78
- if (_.value === "direct") {
79
- const e = p && f.value.toLowerCase() === "united states" ? "" : `, ${f.value}`;
80
- return `${E.value}, ${F.value}${e}`;
76
+ var e, a, l, u, d;
77
+ return typeof ((e = t.value) == null ? void 0 : e.loanAmount) < "u" && typeof ((l = (a = t.value) == null ? void 0 : a.loanFundraisingInfo) == null ? void 0 : l.fundedAmount) < "u" && typeof ((d = (u = t.value) == null ? void 0 : u.loanFundraisingInfo) == null ? void 0 : d.reservedAmount) < "u";
78
+ }), pe = n(() => !F.value && U.value), ve = n(() => {
79
+ if (S.value === "direct") {
80
+ const e = v && g.value.toLowerCase() === "united states" ? "" : `, ${g.value}`;
81
+ return `${E.value}, ${_.value}${e}`;
81
82
  }
82
- return f.value === "Puerto Rico" ? `${E.value}, PR` : f.value;
83
- }), pe = n(() => {
83
+ return g.value === "Puerto Rico" ? `${E.value}, PR` : g.value;
84
+ }), fe = n(() => {
84
85
  var e;
85
86
  return ((e = t.value) == null ? void 0 : e.use) ?? "";
86
- }), ve = n(() => {
87
+ }), me = n(() => {
87
88
  var e;
88
89
  return ((e = t.value) == null ? void 0 : e.status) ?? "";
89
90
  }), C = n(() => {
90
91
  var e;
91
92
  return ((e = t.value) == null ? void 0 : e.loanAmount) ?? "0";
92
93
  }), N = n(() => {
93
- var e, a, s, u;
94
- return ee(((a = (e = t.value) == null ? void 0 : e.loanFundraisingInfo) == null ? void 0 : a.reservedAmount) ?? "0").add(((u = (s = t.value) == null ? void 0 : s.loanFundraisingInfo) == null ? void 0 : u.fundedAmount) ?? "0");
95
- }), fe = n(() => N.value.clone().divide(C.value).value()), S = n(() => U.value && C.value - N.value.value() > 0), me = n(() => S.value ? ee(C.value).subtract(N.value.value()).format("0.00") : "0"), ge = n(() => {
94
+ var e, a, l, u;
95
+ return ae(((a = (e = t.value) == null ? void 0 : e.loanFundraisingInfo) == null ? void 0 : a.reservedAmount) ?? "0").add(((u = (l = t.value) == null ? void 0 : l.loanFundraisingInfo) == null ? void 0 : u.fundedAmount) ?? "0");
96
+ }), D = n(() => N.value.clone().divide(C.value).value()), M = n(() => U.value && C.value - N.value.value() > 0), ge = n(() => M.value ? ae(C.value).subtract(N.value.value()).format("0.00") : "0"), he = n(() => {
96
97
  var e;
97
98
  return ((e = t.value) == null ? void 0 : e.borrowerCount) ?? 0;
98
- }), he = n(() => {
99
- var G, O, k, Y, B, $, w, K, x, q, H, j, z, J, Q, V, W, X, Z;
100
- const e = [], a = ((O = (G = t.value) == null ? void 0 : G.activity) == null ? void 0 : O.name) ?? "", s = ((Y = (k = t.value) == null ? void 0 : k.activity) == null ? void 0 : Y.id) ?? null, u = (($ = (B = t.value) == null ? void 0 : B.sector) == null ? void 0 : $.name) ?? "", m = ((K = (w = t.value) == null ? void 0 : w.sector) == null ? void 0 : K.id) ?? null, i = ((q = (x = t.value) == null ? void 0 : x.tags) == null ? void 0 : q.filter((o) => o.charAt(0) === "#").map((o) => o.substring(1))) ?? [], A = ((H = t.value) == null ? void 0 : H.themes) ?? [], b = {
101
- ecoFriendly: !!i.filter((o) => o.toUpperCase() === te || o.toUpperCase() === ae).length,
102
- refugeesIdps: !!A.filter((o) => o.toUpperCase() === Ee).length,
103
- singleParents: !!i.filter((o) => o.toUpperCase() === oe).length
104
- }, D = (z = (j = t.value) == null ? void 0 : j.partnerName) == null ? void 0 : z.toUpperCase().includes(ye), T = ((J = t.value) == null ? void 0 : J.tagsData) ?? [], Ce = ((Q = t.value) == null ? void 0 : Q.themesData) ?? [];
105
- if (D && i.length) {
106
- const o = Math.floor(Math.random() * i.length), l = i[o], r = P(T, l), g = (r == null ? void 0 : r.id) ?? null;
107
- e.push({ label: l, type: "tag", id: g });
99
+ }), Ce = n(() => {
100
+ var k, Y, w, B, $, K, x, q, H, j, z, J, Q, V, W, X, Z, ee, te;
101
+ const e = [], a = new Ee(m.value, D.value), l = ((Y = (k = t.value) == null ? void 0 : k.activity) == null ? void 0 : Y.name) ?? "", u = ((B = (w = t.value) == null ? void 0 : w.activity) == null ? void 0 : B.id) ?? null, d = ((K = ($ = t.value) == null ? void 0 : $.sector) == null ? void 0 : K.name) ?? "", T = ((q = (x = t.value) == null ? void 0 : x.sector) == null ? void 0 : q.id) ?? null, i = ((j = (H = t.value) == null ? void 0 : H.tags) == null ? void 0 : j.filter((o) => o.charAt(0) === "#").map((o) => o.substring(1))) ?? [], A = ((z = t.value) == null ? void 0 : z.themes) ?? [], b = {
102
+ ecoFriendly: !!i.filter((o) => o.toUpperCase() === oe || o.toUpperCase() === ne).length,
103
+ refugeesIdps: !!A.filter((o) => o.toUpperCase() === Ne).length,
104
+ singleParents: !!i.filter((o) => o.toUpperCase() === le).length
105
+ }, G = (Q = (J = t.value) == null ? void 0 : J.partnerName) == null ? void 0 : Q.toUpperCase().includes(Ue), O = ((V = t.value) == null ? void 0 : V.tagsData) ?? [], Ae = ((W = t.value) == null ? void 0 : W.themesData) ?? [];
106
+ if (G && i.length) {
107
+ const o = Math.floor(a() * i.length), s = i[o], r = P(O, s), h = (r == null ? void 0 : r.id) ?? null;
108
+ e.push({ label: s, type: "tag", id: h });
108
109
  }
109
- if (d.value || (b.ecoFriendly && !e.find((o) => o.label.toUpperCase() === te || o.label.toUpperCase() === ae) ? e.push({ label: "Eco-friendly", type: "tag", id: 9 }) : b.refugeesIdps ? e.push({ label: "Refugees and IDPs", type: "attribute", id: 28 }) : b.singleParents && !e.find((o) => o.label.toUpperCase() === oe) && e.push({ label: "Single Parent", type: "tag", id: 17 })), a && s && ((V = d.value) == null ? void 0 : V.toUpperCase()) !== a.toUpperCase() && e.push({ id: s, label: a, type: "activity" }), u && m && a.toUpperCase() !== u.toUpperCase() && u.toUpperCase() !== ((W = d.value) == null ? void 0 : W.toUpperCase()) && e.length < 2 && e.push({ id: m, label: u, type: "sector" }), i.length && e.length < 2) {
110
- const o = Math.floor(Math.random() * i.length), l = i[o], r = P(T, l), g = (r == null ? void 0 : r.id) ?? null;
111
- e.filter((I) => I.label.toUpperCase() === l.toUpperCase()).length || e.push({ label: l, type: "tag", id: g });
110
+ if (p.value || (b.ecoFriendly && !e.find((o) => o.label.toUpperCase() === oe || o.label.toUpperCase() === ne) ? e.push({ label: "Eco-friendly", type: "tag", id: 9 }) : b.refugeesIdps ? e.push({ label: "Refugees and IDPs", type: "attribute", id: 28 }) : b.singleParents && !e.find((o) => o.label.toUpperCase() === le) && e.push({ label: "Single Parent", type: "tag", id: 17 })), l && u && ((X = p.value) == null ? void 0 : X.toUpperCase()) !== l.toUpperCase() && e.push({ id: u, label: l, type: "activity" }), d && T && l.toUpperCase() !== d.toUpperCase() && d.toUpperCase() !== ((Z = p.value) == null ? void 0 : Z.toUpperCase()) && e.length < 2 && e.push({ id: T, label: d, type: "sector" }), i.length && e.length < 2) {
111
+ const o = Math.floor(a() * i.length), s = i[o], r = P(O, s), h = (r == null ? void 0 : r.id) ?? null;
112
+ e.filter((I) => I.label.toUpperCase() === s.toUpperCase()).length || e.push({ label: s, type: "tag", id: h });
112
113
  }
113
114
  if (A.length && e.length < 2) {
114
- const o = Math.floor(Math.random() * A.length), l = A[o], r = P(Ce, l), g = (r == null ? void 0 : r.id) ?? null;
115
- !e.filter((I) => I.label.toUpperCase() === l.toUpperCase()).length && l.toUpperCase() !== ((X = d.value) == null ? void 0 : X.toUpperCase()) && e.push({ label: l, type: "attribute", id: g });
115
+ const o = Math.floor(a() * A.length), s = A[o], r = P(Ae, s), h = (r == null ? void 0 : r.id) ?? null;
116
+ !e.filter((I) => I.label.toUpperCase() === s.toUpperCase()).length && s.toUpperCase() !== ((ee = p.value) == null ? void 0 : ee.toUpperCase()) && e.push({ label: s, type: "attribute", id: h });
116
117
  }
117
- if (D && e.length > 1) return [e.shift()];
118
- const Ae = ((Z = y.value) == null ? void 0 : Z.map((o) => ({ label: o }))) ?? [];
119
- return e.push(...Ae), e;
118
+ if (G && e.length > 1) return [e.shift()];
119
+ const Le = ((te = y.value) == null ? void 0 : te.map((o) => ({ label: o }))) ?? [];
120
+ return e.push(...Le), e;
120
121
  });
121
122
  return {
122
- tag: se,
123
- readMorePath: le,
124
- isLoading: M,
125
- borrowerName: re,
126
- countryName: f,
127
- countryCode: ue,
123
+ tag: re,
124
+ readMorePath: ue,
125
+ isLoading: F,
126
+ borrowerName: ie,
127
+ countryName: g,
128
+ countryCode: ce,
128
129
  city: E,
129
- state: F,
130
- distributionModel: _,
131
- imageHash: ie,
130
+ state: _,
131
+ distributionModel: S,
132
+ imageHash: de,
132
133
  hasProgressData: U,
133
- allDataLoaded: ce,
134
- fundraisingPercent: fe,
135
- unreservedAmount: me,
136
- sharesAvailable: S,
137
- formattedLocation: de,
138
- loanUse: pe,
139
- loanStatus: ve,
134
+ allDataLoaded: pe,
135
+ fundraisingPercent: D,
136
+ unreservedAmount: ge,
137
+ sharesAvailable: M,
138
+ formattedLocation: ve,
139
+ loanUse: fe,
140
+ loanStatus: me,
140
141
  loanAmount: C,
141
- loanBorrowerCount: ge,
142
- mdiMapMarker: Le,
143
- loanCallouts: he
142
+ loanBorrowerCount: he,
143
+ mdiMapMarker: ye,
144
+ loanCallouts: Ce
144
145
  };
145
146
  }
146
- function _e(c, p) {
147
+ function Te(c, v) {
147
148
  const {
148
- loanId: v,
149
+ loanId: f,
149
150
  customLoanDetails: L,
150
- kvTrackFunction: h
151
- } = ne(c);
152
- function t(d, y) {
153
- h.value("Lending", "click-Read more", d, v.value), L.value && (y.preventDefault(), p("show-loan-details"));
151
+ kvTrackFunction: m
152
+ } = se(c);
153
+ function t(p, y) {
154
+ m.value("Lending", "click-Read more", p, f.value), L.value && (y.preventDefault(), v("show-loan-details"));
154
155
  }
155
156
  return {
156
157
  clickReadMore: t
157
158
  };
158
159
  }
159
160
  export {
160
- Pe as LOAN_CALLOUTS_FRAGMENT,
161
- Re as LOAN_GEOCODE_FRAGMENT,
162
- Me as LOAN_PROGRESS_FRAGMENT,
163
- Fe as loanCardComputedProperties,
164
- _e as loanCardMethods
161
+ _e as LOAN_CALLOUTS_FRAGMENT,
162
+ Se as LOAN_GEOCODE_FRAGMENT,
163
+ De as LOAN_PROGRESS_FRAGMENT,
164
+ Me as loanCardComputedProperties,
165
+ Te as loanCardMethods
165
166
  };
@@ -1 +1 @@
1
- .amountDropdownWrapper[data-v-1ac5c3c8] select{border-radius:14px 0 0 14px}.lend-again[data-v-1ac5c3c8] span{padding-left:0;padding-right:0;padding-left:.5rem;padding-right:.5rem}.lendButtonWrapper[data-v-1ac5c3c8] span:first-child{border-radius:0 14px 14px 0}.filtered-dropdown[data-v-1ac5c3c8] select{cursor:pointer;border-radius:.875rem;border-width:2px;font-weight:500}.unselected-dropdown[data-v-1ac5c3c8] select{--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-dropdown[data-v-1ac5c3c8] select{--tw-border-opacity: 1;border-color:rgb(34 56 41 / var(--tw-border-opacity, 1))}.preset-option[data-v-1ac5c3c8] span.tw-w-full:first-child{border-width:2px;--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-option[data-v-1ac5c3c8] span.tw-w-full:first-child{--tw-border-opacity: 1;border-color:rgba(var(--border-action),var(--tw-border-opacity, 1))}
1
+ .amountDropdownWrapper[data-v-e06394ac] select{border-radius:14px 0 0 14px}.lend-again[data-v-e06394ac] span{padding-left:0;padding-right:0;padding-left:.5rem;padding-right:.5rem}.lendButtonWrapper[data-v-e06394ac] span:first-child{border-radius:0 14px 14px 0}.filtered-dropdown[data-v-e06394ac] select{cursor:pointer;border-radius:.875rem;border-width:2px;font-weight:500}.unselected-dropdown[data-v-e06394ac] select{--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-dropdown[data-v-e06394ac] select{--tw-border-opacity: 1;border-color:rgb(34 56 41 / var(--tw-border-opacity, 1))}.preset-option[data-v-e06394ac] span.tw-w-full:first-child{border-width:2px;--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-option[data-v-e06394ac] span.tw-w-full:first-child{--tw-border-opacity: 1;border-color:rgba(var(--border-action),var(--tw-border-opacity, 1))}
@@ -1,12 +1,12 @@
1
1
  import C from "graphql-tag";
2
- import { mdiChevronRight as x } from "@mdi/js";
2
+ import { mdiChevronRight as _ } from "@mdi/js";
3
3
  import { getLendCtaSelectedOption as B, getDropdownPriceArray as D } from "../utils/loanUtils.js";
4
4
  import P from "./KvLendAmountButton.js";
5
5
  import S from "./KvSelect.js";
6
6
  import F from "./KvButton.js";
7
7
  import I from "./KvMaterialIcon.js";
8
8
  import N from "./KvCartPill.js";
9
- import { resolveComponent as y, openBlock as i, createElementBlock as l, createBlock as a, withCtx as r, createElementVNode as u, createCommentVNode as d, normalizeClass as h, createTextVNode as f, toDisplayString as w, createVNode as V, withModifiers as A, Fragment as g, renderList as p } from "vue";
9
+ import { resolveComponent as y, openBlock as i, createElementBlock as l, createBlock as a, withCtx as r, createElementVNode as u, createCommentVNode as d, normalizeClass as h, createTextVNode as f, toDisplayString as w, createVNode as V, withModifiers as p, Fragment as L, renderList as g } from "vue";
10
10
  import "./KvLendCta.css";
11
11
  import O from "../_virtual/_plugin-vue_export-helper.js";
12
12
  const k = "Other", oe = C`
@@ -113,6 +113,14 @@ const k = "Other", oe = C`
113
113
  type: Function,
114
114
  default: void 0
115
115
  },
116
+ /**
117
+ * Hide preset buttons under this amount when
118
+ * showPresetAmounts is true
119
+ * */
120
+ maxAmount: {
121
+ type: String,
122
+ default: ""
123
+ },
116
124
  showPresetAmounts: {
117
125
  type: Boolean,
118
126
  default: !1
@@ -129,7 +137,7 @@ const k = "Other", oe = C`
129
137
  data() {
130
138
  var e, n;
131
139
  return {
132
- mdiChevronRight: x,
140
+ mdiChevronRight: _,
133
141
  defaultAmountOptions: [25, 50, 75],
134
142
  selectedOption: B(
135
143
  this.getCookie,
@@ -169,8 +177,7 @@ const k = "Other", oe = C`
169
177
  return ((e = this.basketItems) == null ? void 0 : e.some((n) => n.__typename === "LoanReservation" && n.id === this.loanId)) ?? !1;
170
178
  },
171
179
  prices() {
172
- const e = parseFloat(this.unreservedAmount < 25 ? this.minNoteSize : 25);
173
- return D(
180
+ const e = parseFloat(this.unreservedAmount < 25 ? this.minNoteSize : 25), n = D(
174
181
  this.unreservedAmount,
175
182
  this.isCompleteLoanActive,
176
183
  e,
@@ -178,6 +185,7 @@ const k = "Other", oe = C`
178
185
  this.enableHugeAmount,
179
186
  this.isVisitor
180
187
  );
188
+ return this.maxAmount ? n.filter((s) => parseFloat(s) <= parseFloat(this.maxAmount)) : n;
181
189
  },
182
190
  presetButtonsPrices() {
183
191
  const e = this.prices.slice(0, 3);
@@ -241,7 +249,7 @@ const k = "Other", oe = C`
241
249
  return this.isAmountLessThan25(this.unreservedAmount) || this.isAmountBetween25And500(this.unreservedAmount);
242
250
  },
243
251
  isLendAmountButton() {
244
- return (this.lendButtonVisibility || this.state === "lent-to") && this.isAmountLessThan25(this.unreservedAmount) || this.showPresetAmounts && this.presetButtonsPrices.length === 1 && !this.isAdding;
252
+ return this.maxAmount ? !1 : (this.lendButtonVisibility || this.state === "lent-to") && this.isAmountLessThan25(this.unreservedAmount) || this.showPresetAmounts && this.presetButtonsPrices.length === 1 && !this.isAdding;
245
253
  },
246
254
  isFunded() {
247
255
  return this.state === "funded" || this.state === "fully-reserved";
@@ -259,17 +267,17 @@ const k = "Other", oe = C`
259
267
  return this.presetDropdownPrices.length > 1;
260
268
  },
261
269
  hideLendButton() {
262
- return this.showPresetAmounts && (this.isAdding || this.presetButtonsPrices.length === 1);
270
+ return this.maxAmount ? !1 : this.showPresetAmounts && (this.isAdding || this.presetButtonsPrices.length === 1);
263
271
  }
264
272
  },
265
273
  watch: {
266
274
  unreservedAmount(e, n) {
267
- var s, L;
275
+ var s, A;
268
276
  e !== n && n === "" && (this.selectedOption = B(
269
277
  this.getCookie,
270
278
  this.setCookie,
271
279
  this.enableFiveDollarsNotes,
272
- (L = (s = this.route) == null ? void 0 : s.query) == null ? void 0 : L.utm_campaign,
280
+ (A = (s = this.route) == null ? void 0 : s.query) == null ? void 0 : A.utm_campaign,
273
281
  e,
274
282
  this.userBalance,
275
283
  this.fiveDollarsSelected,
@@ -344,8 +352,8 @@ const k = "Other", oe = C`
344
352
  key: 1,
345
353
  class: "amountDropdownWrapper"
346
354
  }, z = ["value"];
347
- function q(e, n, s, L, c, t) {
348
- const b = y("kv-cart-pill"), m = y("kv-ui-button"), T = y("kv-material-icon"), v = y("kv-ui-select"), _ = y("kv-lend-amount-button");
355
+ function q(e, n, s, A, c, t) {
356
+ const b = y("kv-cart-pill"), m = y("kv-ui-button"), T = y("kv-material-icon"), v = y("kv-ui-select"), x = y("kv-lend-amount-button");
349
357
  return i(), l("div", H, [
350
358
  s.showPill && s.showPresetAmounts ? (i(), a(b, {
351
359
  key: 0,
@@ -429,7 +437,7 @@ function q(e, n, s, L, c, t) {
429
437
  }, 8, ["state", "to", "href"])) : t.useFormSubmit ? (i(), l("form", {
430
438
  key: 5,
431
439
  class: "tw-w-full tw-flex",
432
- onSubmit: n[4] || (n[4] = A((...o) => t.addToBasket && t.addToBasket(...o), ["prevent"]))
440
+ onSubmit: n[4] || (n[4] = p((...o) => t.addToBasket && t.addToBasket(...o), ["prevent"]))
433
441
  }, [
434
442
  u("fieldset", {
435
443
  class: h(["tw-w-full tw-flex", {
@@ -443,7 +451,7 @@ function q(e, n, s, L, c, t) {
443
451
  key: 0,
444
452
  class: h(["tw-flex tw-gap-1 lg:tw-gap-2", { "tw-flex-wrap md:tw-flex-nowrap": s.enableHugeAmount }])
445
453
  }, [
446
- t.isLendAmountButton ? d("", !0) : (i(!0), l(g, { key: 0 }, p(t.presetButtonsPrices, (o) => (i(), a(m, {
454
+ t.isLendAmountButton ? d("", !0) : (i(!0), l(L, { key: 0 }, g(t.presetButtonsPrices, (o) => (i(), a(m, {
447
455
  key: o,
448
456
  variant: "secondary",
449
457
  class: h(["tw-inline-flex tw-flex-1 preset-option tw-w-8", { "selected-option": c.selectedOption == o }]),
@@ -469,10 +477,10 @@ function q(e, n, s, L, c, t) {
469
477
  "tw-w-full": s.enableHugeAmount
470
478
  }]),
471
479
  "aria-label": "Lend amount",
472
- onClick: A(t.clickDropdown, ["stop"])
480
+ onClick: p(t.clickDropdown, ["stop"])
473
481
  }, {
474
482
  default: r(() => [
475
- (i(!0), l(g, null, p(t.presetDropdownPrices, (o) => (i(), l("option", {
483
+ (i(!0), l(L, null, g(t.presetDropdownPrices, (o) => (i(), l("option", {
476
484
  key: o,
477
485
  value: o
478
486
  }, w(o !== c.OTHER_OPTION ? `$${o}` : o), 9, E))), 128))
@@ -491,10 +499,10 @@ function q(e, n, s, L, c, t) {
491
499
  class: "tw-min-w-12",
492
500
  style: { "border-radius": "14px 0 0 14px" },
493
501
  "aria-label": "Lend amount",
494
- onClick: A(t.clickDropdown, ["stop"])
502
+ onClick: p(t.clickDropdown, ["stop"])
495
503
  }, {
496
504
  default: r(() => [
497
- (i(!0), l(g, null, p(t.prices, (o) => (i(), l("option", {
505
+ (i(!0), l(L, null, g(t.prices, (o) => (i(), l("option", {
498
506
  key: o,
499
507
  value: o
500
508
  }, " $" + w(o), 9, z))), 128))
@@ -530,7 +538,7 @@ function q(e, n, s, L, c, t) {
530
538
  _: 1
531
539
  }, 8, ["class"])) : d("", !0)
532
540
  ], 2),
533
- t.isLendAmountButton && !s.enableFiveDollarsNotes ? (i(), a(_, {
541
+ t.isLendAmountButton && !s.enableFiveDollarsNotes ? (i(), a(x, {
534
542
  key: 2,
535
543
  class: "tw-w-full",
536
544
  "loan-id": t.loanId,
@@ -552,7 +560,7 @@ function q(e, n, s, L, c, t) {
552
560
  ], 32)) : d("", !0)
553
561
  ]);
554
562
  }
555
- const ae = /* @__PURE__ */ O(M, [["render", q], ["__scopeId", "data-v-1ac5c3c8"]]);
563
+ const ae = /* @__PURE__ */ O(M, [["render", q], ["__scopeId", "data-v-e06394ac"]]);
556
564
  export {
557
565
  oe as KV_LEND_CTA_FRAGMENT,
558
566
  ie as KV_LEND_CTA_USER_FRAGMENT,
@@ -37,7 +37,7 @@ const V = {
37
37
  isSmall: e
38
38
  } = A(u), i = v(!0), m = v(null), c = d(() => a.value === "" && t.value === "" || a.value === "Anonymous"), f = () => {
39
39
  const l = e != null && e.value ? "tw-w-3 tw-h-3 tw-text-h4" : "tw-w-6 tw-h-6 tw-text-h2";
40
- return `${D()} ${l}`;
40
+ return `${D(a.value)} ${l}`;
41
41
  }, S = d(() => {
42
42
  var l;
43
43
  return ((l = t == null ? void 0 : t.value) == null ? void 0 : l.split("/").pop()) ?? "";
@@ -46,9 +46,9 @@ const V = {
46
46
  return (l = a == null ? void 0 : a.value) == null ? void 0 : l.substring(0, 1).toUpperCase();
47
47
  }), g = () => {
48
48
  i.value = !1;
49
- }, C = (l, w = 1e4) => new Promise((k, L) => {
49
+ }, C = (l, w = 1e4) => new Promise((L, k) => {
50
50
  const x = Date.now() + w, h = () => {
51
- !l || l.complete ? k(l) : Date.now() > x ? L(new Error(`Timeout: ${l.src}`)) : setTimeout(h, 50);
51
+ !l || l.complete ? L(l) : Date.now() > x ? k(new Error(`Timeout: ${l.src}`)) : setTimeout(h, 50);
52
52
  };
53
53
  h();
54
54
  });
@@ -74,7 +74,6 @@ const V = {
74
74
  function K(u, a, t, e, i, m) {
75
75
  const c = U("kv-loading-placeholder");
76
76
  return n(), o("div", {
77
- id: "kv-user-avatar",
78
77
  class: r(["data-hj-suppress tw-flex", { "tw-w-3": t.isSmall, "tw-w-6": !t.isSmall }])
79
78
  }, [
80
79
  e.isAnonymousUser ? (n(), o("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.14.2",
3
+ "version": "6.16.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -111,5 +111,5 @@
111
111
  "embla-carousel-fade",
112
112
  "popper.js"
113
113
  ],
114
- "gitHead": "a99f2d5f6d3157739316f6533029c18c913d9aa0"
114
+ "gitHead": "6b563c82fd8270b4df50c76da70eed7f2c82b908"
115
115
  }