@movmo_app/payments 0.1.0 → 0.2.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.
- package/README.md +66 -12
- package/dist/index.cjs.js +10 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +194 -4
- package/dist/index.es.js +1417 -596
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import fr, { useState as S, useRef as q, useEffect as X, useCallback as B, useMemo as Ce } from "react";
|
|
2
|
+
var ze = { exports: {} }, je = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -9,21 +9,21 @@ var be = { exports: {} }, q = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
for (
|
|
21
|
-
if (
|
|
22
|
-
return { $$typeof:
|
|
12
|
+
var nr;
|
|
13
|
+
function Ir() {
|
|
14
|
+
if (nr) return je;
|
|
15
|
+
nr = 1;
|
|
16
|
+
var r = fr, t = Symbol.for("react.element"), s = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, l = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function d(v, y, T) {
|
|
18
|
+
var g, w = {}, F = null, _ = null;
|
|
19
|
+
T !== void 0 && (F = "" + T), y.key !== void 0 && (F = "" + y.key), y.ref !== void 0 && (_ = y.ref);
|
|
20
|
+
for (g in y) o.call(y, g) && !f.hasOwnProperty(g) && (w[g] = y[g]);
|
|
21
|
+
if (v && v.defaultProps) for (g in y = v.defaultProps, y) w[g] === void 0 && (w[g] = y[g]);
|
|
22
|
+
return { $$typeof: t, type: v, key: F, ref: _, props: w, _owner: l.current };
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return je.Fragment = s, je.jsx = d, je.jsxs = d, je;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
26
|
+
var _e = {};
|
|
27
27
|
/**
|
|
28
28
|
* @license React
|
|
29
29
|
* react-jsx-runtime.development.js
|
|
@@ -33,91 +33,91 @@ var B = {};
|
|
|
33
33
|
* This source code is licensed under the MIT license found in the
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
|
-
var
|
|
37
|
-
function
|
|
38
|
-
return
|
|
39
|
-
var
|
|
40
|
-
function
|
|
36
|
+
var sr;
|
|
37
|
+
function Ur() {
|
|
38
|
+
return sr || (sr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
+
var r = fr, t = Symbol.for("react.element"), s = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), v = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), D = Symbol.iterator, R = "@@iterator";
|
|
40
|
+
function G(e) {
|
|
41
41
|
if (e === null || typeof e != "object")
|
|
42
42
|
return null;
|
|
43
|
-
var
|
|
44
|
-
return typeof
|
|
43
|
+
var n = D && e[D] || e[R];
|
|
44
|
+
return typeof n == "function" ? n : null;
|
|
45
45
|
}
|
|
46
|
-
var
|
|
47
|
-
function
|
|
46
|
+
var O = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
|
+
function C(e) {
|
|
48
48
|
{
|
|
49
|
-
for (var
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), u = 1; u < n; u++)
|
|
50
|
+
i[u - 1] = arguments[u];
|
|
51
|
+
J("error", e, i);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function J(e, n, i) {
|
|
55
55
|
{
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
var
|
|
59
|
-
return String(
|
|
56
|
+
var u = O.ReactDebugCurrentFrame, h = u.getStackAddendum();
|
|
57
|
+
h !== "" && (n += "%s", i = i.concat([h]));
|
|
58
|
+
var j = i.map(function(p) {
|
|
59
|
+
return String(p);
|
|
60
60
|
});
|
|
61
|
-
|
|
61
|
+
j.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, j);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
function
|
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
64
|
+
var W = !1, se = !1, oe = !1, A = !1, x = !1, b;
|
|
65
|
+
b = Symbol.for("react.module.reference");
|
|
66
|
+
function I(e) {
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === o || e === f || x || e === l || e === T || e === g || A || e === _ || W || se || oe || typeof e == "object" && e !== null && (e.$$typeof === F || e.$$typeof === w || e.$$typeof === d || e.$$typeof === v || e.$$typeof === y || // This needs to include all possible module reference object
|
|
68
68
|
// types supported by any Flight configuration anywhere since
|
|
69
69
|
// we don't know which Flight build this will end up being used
|
|
70
70
|
// with.
|
|
71
|
-
e.$$typeof ===
|
|
71
|
+
e.$$typeof === b || e.getModuleId !== void 0));
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
var
|
|
75
|
-
if (
|
|
76
|
-
return
|
|
77
|
-
var
|
|
78
|
-
return
|
|
73
|
+
function U(e, n, i) {
|
|
74
|
+
var u = e.displayName;
|
|
75
|
+
if (u)
|
|
76
|
+
return u;
|
|
77
|
+
var h = n.displayName || n.name || "";
|
|
78
|
+
return h !== "" ? i + "(" + h + ")" : i;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function ie(e) {
|
|
81
81
|
return e.displayName || "Context";
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function z(e) {
|
|
84
84
|
if (e == null)
|
|
85
85
|
return null;
|
|
86
|
-
if (typeof e.tag == "number" &&
|
|
86
|
+
if (typeof e.tag == "number" && C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
87
87
|
return e.displayName || e.name || null;
|
|
88
88
|
if (typeof e == "string")
|
|
89
89
|
return e;
|
|
90
90
|
switch (e) {
|
|
91
|
-
case
|
|
91
|
+
case o:
|
|
92
92
|
return "Fragment";
|
|
93
|
-
case
|
|
93
|
+
case s:
|
|
94
94
|
return "Portal";
|
|
95
|
-
case
|
|
95
|
+
case f:
|
|
96
96
|
return "Profiler";
|
|
97
|
-
case
|
|
97
|
+
case l:
|
|
98
98
|
return "StrictMode";
|
|
99
|
-
case
|
|
99
|
+
case T:
|
|
100
100
|
return "Suspense";
|
|
101
|
-
case
|
|
101
|
+
case g:
|
|
102
102
|
return "SuspenseList";
|
|
103
103
|
}
|
|
104
104
|
if (typeof e == "object")
|
|
105
105
|
switch (e.$$typeof) {
|
|
106
|
-
case
|
|
107
|
-
var
|
|
108
|
-
return
|
|
109
|
-
case
|
|
110
|
-
var
|
|
111
|
-
return
|
|
112
|
-
case b:
|
|
113
|
-
return X(e, e.render, "ForwardRef");
|
|
106
|
+
case v:
|
|
107
|
+
var n = e;
|
|
108
|
+
return ie(n) + ".Consumer";
|
|
109
|
+
case d:
|
|
110
|
+
var i = e;
|
|
111
|
+
return ie(i._context) + ".Provider";
|
|
114
112
|
case y:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
return U(e, e.render, "ForwardRef");
|
|
114
|
+
case w:
|
|
115
|
+
var u = e.displayName || null;
|
|
116
|
+
return u !== null ? u : z(e.type) || "Memo";
|
|
117
|
+
case F: {
|
|
118
|
+
var h = e, j = h._payload, p = h._init;
|
|
119
119
|
try {
|
|
120
|
-
return
|
|
120
|
+
return z(p(j));
|
|
121
121
|
} catch {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
@@ -125,18 +125,18 @@ function jr() {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
var
|
|
129
|
-
function
|
|
128
|
+
var N = Object.assign, Y = 0, ue, V, k, le, ce, fe, me;
|
|
129
|
+
function pe() {
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
function
|
|
131
|
+
pe.__reactDisabledLog = !0;
|
|
132
|
+
function he() {
|
|
133
133
|
{
|
|
134
|
-
if (
|
|
135
|
-
|
|
134
|
+
if (Y === 0) {
|
|
135
|
+
ue = console.log, V = console.info, k = console.warn, le = console.error, ce = console.group, fe = console.groupCollapsed, me = console.groupEnd;
|
|
136
136
|
var e = {
|
|
137
137
|
configurable: !0,
|
|
138
138
|
enumerable: !0,
|
|
139
|
-
value:
|
|
139
|
+
value: pe,
|
|
140
140
|
writable: !0
|
|
141
141
|
};
|
|
142
142
|
Object.defineProperties(console, {
|
|
@@ -149,332 +149,332 @@ function jr() {
|
|
|
149
149
|
groupEnd: e
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
Y++;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Ee() {
|
|
156
156
|
{
|
|
157
|
-
if (
|
|
157
|
+
if (Y--, Y === 0) {
|
|
158
158
|
var e = {
|
|
159
159
|
configurable: !0,
|
|
160
160
|
enumerable: !0,
|
|
161
161
|
writable: !0
|
|
162
162
|
};
|
|
163
163
|
Object.defineProperties(console, {
|
|
164
|
-
log:
|
|
165
|
-
value:
|
|
164
|
+
log: N({}, e, {
|
|
165
|
+
value: ue
|
|
166
166
|
}),
|
|
167
|
-
info:
|
|
168
|
-
value:
|
|
167
|
+
info: N({}, e, {
|
|
168
|
+
value: V
|
|
169
169
|
}),
|
|
170
|
-
warn:
|
|
171
|
-
value:
|
|
170
|
+
warn: N({}, e, {
|
|
171
|
+
value: k
|
|
172
172
|
}),
|
|
173
|
-
error:
|
|
174
|
-
value:
|
|
173
|
+
error: N({}, e, {
|
|
174
|
+
value: le
|
|
175
175
|
}),
|
|
176
|
-
group:
|
|
177
|
-
value:
|
|
176
|
+
group: N({}, e, {
|
|
177
|
+
value: ce
|
|
178
178
|
}),
|
|
179
|
-
groupCollapsed:
|
|
180
|
-
value:
|
|
179
|
+
groupCollapsed: N({}, e, {
|
|
180
|
+
value: fe
|
|
181
181
|
}),
|
|
182
|
-
groupEnd:
|
|
183
|
-
value:
|
|
182
|
+
groupEnd: N({}, e, {
|
|
183
|
+
value: me
|
|
184
184
|
})
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
Y < 0 && C("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
var
|
|
191
|
-
function
|
|
190
|
+
var ae = O.ReactCurrentDispatcher, Q;
|
|
191
|
+
function ee(e, n, i) {
|
|
192
192
|
{
|
|
193
|
-
if (
|
|
193
|
+
if (Q === void 0)
|
|
194
194
|
try {
|
|
195
195
|
throw Error();
|
|
196
|
-
} catch (
|
|
197
|
-
var
|
|
198
|
-
|
|
196
|
+
} catch (h) {
|
|
197
|
+
var u = h.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
+
Q = u && u[1] || "";
|
|
199
199
|
}
|
|
200
200
|
return `
|
|
201
|
-
` +
|
|
201
|
+
` + Q + e;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
var
|
|
204
|
+
var re = !1, de;
|
|
205
205
|
{
|
|
206
|
-
var
|
|
207
|
-
|
|
206
|
+
var ye = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
de = new ye();
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
if (!e ||
|
|
209
|
+
function ve(e, n) {
|
|
210
|
+
if (!e || re)
|
|
211
211
|
return "";
|
|
212
212
|
{
|
|
213
|
-
var
|
|
214
|
-
if (
|
|
215
|
-
return
|
|
213
|
+
var i = de.get(e);
|
|
214
|
+
if (i !== void 0)
|
|
215
|
+
return i;
|
|
216
216
|
}
|
|
217
|
-
var
|
|
218
|
-
|
|
219
|
-
var
|
|
217
|
+
var u;
|
|
218
|
+
re = !0;
|
|
219
|
+
var h = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
|
-
var
|
|
222
|
-
|
|
221
|
+
var j;
|
|
222
|
+
j = ae.current, ae.current = null, he();
|
|
223
223
|
try {
|
|
224
|
-
if (
|
|
225
|
-
var
|
|
224
|
+
if (n) {
|
|
225
|
+
var p = function() {
|
|
226
226
|
throw Error();
|
|
227
227
|
};
|
|
228
|
-
if (Object.defineProperty(
|
|
228
|
+
if (Object.defineProperty(p.prototype, "props", {
|
|
229
229
|
set: function() {
|
|
230
230
|
throw Error();
|
|
231
231
|
}
|
|
232
232
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
233
|
try {
|
|
234
|
-
Reflect.construct(
|
|
235
|
-
} catch (
|
|
236
|
-
|
|
234
|
+
Reflect.construct(p, []);
|
|
235
|
+
} catch (Z) {
|
|
236
|
+
u = Z;
|
|
237
237
|
}
|
|
238
|
-
Reflect.construct(e, [],
|
|
238
|
+
Reflect.construct(e, [], p);
|
|
239
239
|
} else {
|
|
240
240
|
try {
|
|
241
|
-
|
|
242
|
-
} catch (
|
|
243
|
-
|
|
241
|
+
p.call();
|
|
242
|
+
} catch (Z) {
|
|
243
|
+
u = Z;
|
|
244
244
|
}
|
|
245
|
-
e.call(
|
|
245
|
+
e.call(p.prototype);
|
|
246
246
|
}
|
|
247
247
|
} else {
|
|
248
248
|
try {
|
|
249
249
|
throw Error();
|
|
250
|
-
} catch (
|
|
251
|
-
|
|
250
|
+
} catch (Z) {
|
|
251
|
+
u = Z;
|
|
252
252
|
}
|
|
253
253
|
e();
|
|
254
254
|
}
|
|
255
|
-
} catch (
|
|
256
|
-
if (
|
|
257
|
-
for (var
|
|
258
|
-
`),
|
|
259
|
-
`),
|
|
260
|
-
|
|
261
|
-
for (;
|
|
262
|
-
if (
|
|
263
|
-
if (
|
|
255
|
+
} catch (Z) {
|
|
256
|
+
if (Z && u && typeof Z.stack == "string") {
|
|
257
|
+
for (var m = Z.stack.split(`
|
|
258
|
+
`), K = u.stack.split(`
|
|
259
|
+
`), M = m.length - 1, L = K.length - 1; M >= 1 && L >= 0 && m[M] !== K[L]; )
|
|
260
|
+
L--;
|
|
261
|
+
for (; M >= 1 && L >= 0; M--, L--)
|
|
262
|
+
if (m[M] !== K[L]) {
|
|
263
|
+
if (M !== 1 || L !== 1)
|
|
264
264
|
do
|
|
265
|
-
if (
|
|
266
|
-
var
|
|
267
|
-
` +
|
|
268
|
-
return e.displayName &&
|
|
265
|
+
if (M--, L--, L < 0 || m[M] !== K[L]) {
|
|
266
|
+
var te = `
|
|
267
|
+
` + m[M].replace(" at new ", " at ");
|
|
268
|
+
return e.displayName && te.includes("<anonymous>") && (te = te.replace("<anonymous>", e.displayName)), typeof e == "function" && de.set(e, te), te;
|
|
269
269
|
}
|
|
270
|
-
while (
|
|
270
|
+
while (M >= 1 && L >= 0);
|
|
271
271
|
break;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
|
|
275
|
+
re = !1, ae.current = j, Ee(), Error.prepareStackTrace = h;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
278
|
-
return typeof e == "function" &&
|
|
277
|
+
var we = e ? e.displayName || e.name : "", xe = we ? ee(we) : "";
|
|
278
|
+
return typeof e == "function" && de.set(e, xe), xe;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function P(e, n, i) {
|
|
281
|
+
return ve(e, !1);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
var
|
|
285
|
-
return !!(
|
|
283
|
+
function c(e) {
|
|
284
|
+
var n = e.prototype;
|
|
285
|
+
return !!(n && n.isReactComponent);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function E(e, n, i) {
|
|
288
288
|
if (e == null)
|
|
289
289
|
return "";
|
|
290
290
|
if (typeof e == "function")
|
|
291
|
-
return
|
|
291
|
+
return ve(e, c(e));
|
|
292
292
|
if (typeof e == "string")
|
|
293
|
-
return
|
|
293
|
+
return ee(e);
|
|
294
294
|
switch (e) {
|
|
295
|
-
case
|
|
296
|
-
return
|
|
297
|
-
case
|
|
298
|
-
return
|
|
295
|
+
case T:
|
|
296
|
+
return ee("Suspense");
|
|
297
|
+
case g:
|
|
298
|
+
return ee("SuspenseList");
|
|
299
299
|
}
|
|
300
300
|
if (typeof e == "object")
|
|
301
301
|
switch (e.$$typeof) {
|
|
302
|
-
case b:
|
|
303
|
-
return tr(e.render);
|
|
304
302
|
case y:
|
|
305
|
-
return
|
|
306
|
-
case
|
|
307
|
-
|
|
303
|
+
return P(e.render);
|
|
304
|
+
case w:
|
|
305
|
+
return E(e.type, n, i);
|
|
306
|
+
case F: {
|
|
307
|
+
var u = e, h = u._payload, j = u._init;
|
|
308
308
|
try {
|
|
309
|
-
return
|
|
309
|
+
return E(j(h), n, i);
|
|
310
310
|
} catch {
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
return "";
|
|
315
315
|
}
|
|
316
|
-
var
|
|
317
|
-
function
|
|
316
|
+
var $ = Object.prototype.hasOwnProperty, H = {}, Be = O.ReactDebugCurrentFrame;
|
|
317
|
+
function Te(e) {
|
|
318
318
|
if (e) {
|
|
319
|
-
var
|
|
320
|
-
|
|
319
|
+
var n = e._owner, i = E(e.type, e._source, n ? n.type : null);
|
|
320
|
+
Be.setExtraStackFrame(i);
|
|
321
321
|
} else
|
|
322
|
-
|
|
322
|
+
Be.setExtraStackFrame(null);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function hr(e, n, i, u, h) {
|
|
325
325
|
{
|
|
326
|
-
var
|
|
327
|
-
for (var
|
|
328
|
-
if (
|
|
329
|
-
var
|
|
326
|
+
var j = Function.call.bind($);
|
|
327
|
+
for (var p in e)
|
|
328
|
+
if (j(e, p)) {
|
|
329
|
+
var m = void 0;
|
|
330
330
|
try {
|
|
331
|
-
if (typeof e[
|
|
332
|
-
var
|
|
333
|
-
throw
|
|
331
|
+
if (typeof e[p] != "function") {
|
|
332
|
+
var K = Error((u || "React class") + ": " + i + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw K.name = "Invariant Violation", K;
|
|
334
334
|
}
|
|
335
|
-
|
|
336
|
-
} catch (
|
|
337
|
-
|
|
335
|
+
m = e[p](n, p, u, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
|
+
} catch (M) {
|
|
337
|
+
m = M;
|
|
338
338
|
}
|
|
339
|
-
|
|
339
|
+
m && !(m instanceof Error) && (Te(h), C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", u || "React class", i, p, typeof m), Te(null)), m instanceof Error && !(m.message in H) && (H[m.message] = !0, Te(h), C("Failed %s type: %s", i, m.message), Te(null));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
var
|
|
344
|
-
function
|
|
345
|
-
return
|
|
343
|
+
var xr = Array.isArray;
|
|
344
|
+
function De(e) {
|
|
345
|
+
return xr(e);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function br(e) {
|
|
348
348
|
{
|
|
349
|
-
var
|
|
350
|
-
return
|
|
349
|
+
var n = typeof Symbol == "function" && Symbol.toStringTag, i = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
350
|
+
return i;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function gr(e) {
|
|
354
354
|
try {
|
|
355
|
-
return
|
|
355
|
+
return Ke(e), !1;
|
|
356
356
|
} catch {
|
|
357
357
|
return !0;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function Ke(e) {
|
|
361
361
|
return "" + e;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
if (
|
|
365
|
-
return
|
|
363
|
+
function qe(e) {
|
|
364
|
+
if (gr(e))
|
|
365
|
+
return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", br(e)), Ke(e);
|
|
366
366
|
}
|
|
367
|
-
var
|
|
367
|
+
var Ge = O.ReactCurrentOwner, wr = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
371
371
|
__source: !0
|
|
372
|
-
},
|
|
373
|
-
function
|
|
374
|
-
if (
|
|
375
|
-
var
|
|
376
|
-
if (
|
|
372
|
+
}, Je, He;
|
|
373
|
+
function Er(e) {
|
|
374
|
+
if ($.call(e, "ref")) {
|
|
375
|
+
var n = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
376
|
+
if (n && n.isReactWarning)
|
|
377
377
|
return !1;
|
|
378
378
|
}
|
|
379
379
|
return e.ref !== void 0;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
if (
|
|
383
|
-
var
|
|
384
|
-
if (
|
|
381
|
+
function jr(e) {
|
|
382
|
+
if ($.call(e, "key")) {
|
|
383
|
+
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
384
|
+
if (n && n.isReactWarning)
|
|
385
385
|
return !1;
|
|
386
386
|
}
|
|
387
387
|
return e.key !== void 0;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
typeof e.ref == "string" &&
|
|
389
|
+
function _r(e, n) {
|
|
390
|
+
typeof e.ref == "string" && Ge.current;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Rr(e, n) {
|
|
393
393
|
{
|
|
394
|
-
var
|
|
395
|
-
|
|
394
|
+
var i = function() {
|
|
395
|
+
Je || (Je = !0, C("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
396
396
|
};
|
|
397
|
-
|
|
398
|
-
get:
|
|
397
|
+
i.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
398
|
+
get: i,
|
|
399
399
|
configurable: !0
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function Cr(e, n) {
|
|
404
404
|
{
|
|
405
|
-
var
|
|
406
|
-
|
|
405
|
+
var i = function() {
|
|
406
|
+
He || (He = !0, C("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
407
407
|
};
|
|
408
|
-
|
|
409
|
-
get:
|
|
408
|
+
i.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
409
|
+
get: i,
|
|
410
410
|
configurable: !0
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
var
|
|
415
|
-
var
|
|
414
|
+
var Nr = function(e, n, i, u, h, j, p) {
|
|
415
|
+
var m = {
|
|
416
416
|
// This tag allows us to uniquely identify this as a React Element
|
|
417
|
-
$$typeof:
|
|
417
|
+
$$typeof: t,
|
|
418
418
|
// Built-in properties that belong on the element
|
|
419
419
|
type: e,
|
|
420
|
-
key:
|
|
421
|
-
ref:
|
|
422
|
-
props:
|
|
420
|
+
key: n,
|
|
421
|
+
ref: i,
|
|
422
|
+
props: p,
|
|
423
423
|
// Record the component responsible for creating this element.
|
|
424
|
-
_owner:
|
|
424
|
+
_owner: j
|
|
425
425
|
};
|
|
426
|
-
return
|
|
426
|
+
return m._store = {}, Object.defineProperty(m._store, "validated", {
|
|
427
427
|
configurable: !1,
|
|
428
428
|
enumerable: !1,
|
|
429
429
|
writable: !0,
|
|
430
430
|
value: !1
|
|
431
|
-
}), Object.defineProperty(
|
|
431
|
+
}), Object.defineProperty(m, "_self", {
|
|
432
432
|
configurable: !1,
|
|
433
433
|
enumerable: !1,
|
|
434
434
|
writable: !1,
|
|
435
|
-
value:
|
|
436
|
-
}), Object.defineProperty(
|
|
435
|
+
value: u
|
|
436
|
+
}), Object.defineProperty(m, "_source", {
|
|
437
437
|
configurable: !1,
|
|
438
438
|
enumerable: !1,
|
|
439
439
|
writable: !1,
|
|
440
|
-
value:
|
|
441
|
-
}), Object.freeze && (Object.freeze(
|
|
440
|
+
value: h
|
|
441
|
+
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
442
442
|
};
|
|
443
|
-
function
|
|
443
|
+
function Pr(e, n, i, u, h) {
|
|
444
444
|
{
|
|
445
|
-
var
|
|
446
|
-
|
|
447
|
-
for (
|
|
448
|
-
|
|
445
|
+
var j, p = {}, m = null, K = null;
|
|
446
|
+
i !== void 0 && (qe(i), m = "" + i), jr(n) && (qe(n.key), m = "" + n.key), Er(n) && (K = n.ref, _r(n, h));
|
|
447
|
+
for (j in n)
|
|
448
|
+
$.call(n, j) && !wr.hasOwnProperty(j) && (p[j] = n[j]);
|
|
449
449
|
if (e && e.defaultProps) {
|
|
450
|
-
var
|
|
451
|
-
for (
|
|
452
|
-
|
|
450
|
+
var M = e.defaultProps;
|
|
451
|
+
for (j in M)
|
|
452
|
+
p[j] === void 0 && (p[j] = M[j]);
|
|
453
453
|
}
|
|
454
|
-
if (
|
|
455
|
-
var
|
|
456
|
-
|
|
454
|
+
if (m || K) {
|
|
455
|
+
var L = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
456
|
+
m && Rr(p, L), K && Cr(p, L);
|
|
457
457
|
}
|
|
458
|
-
return
|
|
458
|
+
return Nr(e, m, K, h, u, Ge.current, p);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
var
|
|
462
|
-
function
|
|
461
|
+
var We = O.ReactCurrentOwner, Ze = O.ReactDebugCurrentFrame;
|
|
462
|
+
function ge(e) {
|
|
463
463
|
if (e) {
|
|
464
|
-
var
|
|
465
|
-
|
|
464
|
+
var n = e._owner, i = E(e.type, e._source, n ? n.type : null);
|
|
465
|
+
Ze.setExtraStackFrame(i);
|
|
466
466
|
} else
|
|
467
|
-
|
|
467
|
+
Ze.setExtraStackFrame(null);
|
|
468
468
|
}
|
|
469
|
-
var
|
|
470
|
-
|
|
471
|
-
function
|
|
472
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
469
|
+
var Ae;
|
|
470
|
+
Ae = !1;
|
|
471
|
+
function $e(e) {
|
|
472
|
+
return typeof e == "object" && e !== null && e.$$typeof === t;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function Xe() {
|
|
475
475
|
{
|
|
476
|
-
if (
|
|
477
|
-
var e =
|
|
476
|
+
if (We.current) {
|
|
477
|
+
var e = z(We.current.type);
|
|
478
478
|
if (e)
|
|
479
479
|
return `
|
|
480
480
|
|
|
@@ -483,497 +483,1318 @@ Check the render method of \`` + e + "`.";
|
|
|
483
483
|
return "";
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function Sr(e) {
|
|
487
487
|
return "";
|
|
488
488
|
}
|
|
489
|
-
var
|
|
490
|
-
function
|
|
489
|
+
var Qe = {};
|
|
490
|
+
function kr(e) {
|
|
491
491
|
{
|
|
492
|
-
var
|
|
493
|
-
if (!
|
|
494
|
-
var
|
|
495
|
-
|
|
492
|
+
var n = Xe();
|
|
493
|
+
if (!n) {
|
|
494
|
+
var i = typeof e == "string" ? e : e.displayName || e.name;
|
|
495
|
+
i && (n = `
|
|
496
496
|
|
|
497
|
-
Check the top-level render call using <` +
|
|
497
|
+
Check the top-level render call using <` + i + ">.");
|
|
498
498
|
}
|
|
499
|
-
return
|
|
499
|
+
return n;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function er(e, n) {
|
|
503
503
|
{
|
|
504
504
|
if (!e._store || e._store.validated || e.key != null)
|
|
505
505
|
return;
|
|
506
506
|
e._store.validated = !0;
|
|
507
|
-
var
|
|
508
|
-
if (
|
|
507
|
+
var i = kr(n);
|
|
508
|
+
if (Qe[i])
|
|
509
509
|
return;
|
|
510
|
-
|
|
511
|
-
var
|
|
512
|
-
e && e._owner && e._owner !==
|
|
510
|
+
Qe[i] = !0;
|
|
511
|
+
var u = "";
|
|
512
|
+
e && e._owner && e._owner !== We.current && (u = " It was passed a child from " + z(e._owner.type) + "."), ge(e), C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, u), ge(null);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function rr(e, n) {
|
|
516
516
|
{
|
|
517
517
|
if (typeof e != "object")
|
|
518
518
|
return;
|
|
519
|
-
if (
|
|
520
|
-
for (var
|
|
521
|
-
var
|
|
522
|
-
|
|
519
|
+
if (De(e))
|
|
520
|
+
for (var i = 0; i < e.length; i++) {
|
|
521
|
+
var u = e[i];
|
|
522
|
+
$e(u) && er(u, n);
|
|
523
523
|
}
|
|
524
|
-
else if (
|
|
524
|
+
else if ($e(e))
|
|
525
525
|
e._store && (e._store.validated = !0);
|
|
526
526
|
else if (e) {
|
|
527
|
-
var
|
|
528
|
-
if (typeof
|
|
529
|
-
for (var
|
|
530
|
-
|
|
527
|
+
var h = G(e);
|
|
528
|
+
if (typeof h == "function" && h !== e.entries)
|
|
529
|
+
for (var j = h.call(e), p; !(p = j.next()).done; )
|
|
530
|
+
$e(p.value) && er(p.value, n);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function Tr(e) {
|
|
535
535
|
{
|
|
536
|
-
var
|
|
537
|
-
if (
|
|
536
|
+
var n = e.type;
|
|
537
|
+
if (n == null || typeof n == "string")
|
|
538
538
|
return;
|
|
539
|
-
var
|
|
540
|
-
if (typeof
|
|
541
|
-
|
|
542
|
-
else if (typeof
|
|
539
|
+
var i;
|
|
540
|
+
if (typeof n == "function")
|
|
541
|
+
i = n.propTypes;
|
|
542
|
+
else if (typeof n == "object" && (n.$$typeof === y || // Note: Memo only checks outer props here.
|
|
543
543
|
// Inner props are checked in the reconciler.
|
|
544
|
-
|
|
545
|
-
|
|
544
|
+
n.$$typeof === w))
|
|
545
|
+
i = n.propTypes;
|
|
546
546
|
else
|
|
547
547
|
return;
|
|
548
|
-
if (
|
|
549
|
-
var
|
|
550
|
-
|
|
551
|
-
} else if (
|
|
552
|
-
|
|
553
|
-
var
|
|
554
|
-
|
|
548
|
+
if (i) {
|
|
549
|
+
var u = z(n);
|
|
550
|
+
hr(i, e.props, "prop", u, e);
|
|
551
|
+
} else if (n.PropTypes !== void 0 && !Ae) {
|
|
552
|
+
Ae = !0;
|
|
553
|
+
var h = z(n);
|
|
554
|
+
C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", h || "Unknown");
|
|
555
555
|
}
|
|
556
|
-
typeof
|
|
556
|
+
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function Or(e) {
|
|
560
560
|
{
|
|
561
|
-
for (var
|
|
562
|
-
var
|
|
563
|
-
if (
|
|
564
|
-
|
|
561
|
+
for (var n = Object.keys(e.props), i = 0; i < n.length; i++) {
|
|
562
|
+
var u = n[i];
|
|
563
|
+
if (u !== "children" && u !== "key") {
|
|
564
|
+
ge(e), C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), ge(null);
|
|
565
565
|
break;
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
e.ref !== null && (
|
|
568
|
+
e.ref !== null && (ge(e), C("Invalid attribute `ref` supplied to `React.Fragment`."), ge(null));
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
var
|
|
572
|
-
function
|
|
571
|
+
var tr = {};
|
|
572
|
+
function ar(e, n, i, u, h, j) {
|
|
573
573
|
{
|
|
574
|
-
var
|
|
575
|
-
if (!
|
|
576
|
-
var
|
|
577
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
578
|
-
var
|
|
579
|
-
|
|
580
|
-
var
|
|
581
|
-
e === null ?
|
|
574
|
+
var p = I(e);
|
|
575
|
+
if (!p) {
|
|
576
|
+
var m = "";
|
|
577
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (m += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
578
|
+
var K = Sr();
|
|
579
|
+
K ? m += K : m += Xe();
|
|
580
|
+
var M;
|
|
581
|
+
e === null ? M = "null" : De(e) ? M = "array" : e !== void 0 && e.$$typeof === t ? (M = "<" + (z(e.type) || "Unknown") + " />", m = " Did you accidentally export a JSX literal instead of a component?") : M = typeof e, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", M, m);
|
|
582
582
|
}
|
|
583
|
-
var
|
|
584
|
-
if (
|
|
585
|
-
return
|
|
586
|
-
if (
|
|
587
|
-
var
|
|
588
|
-
if (
|
|
589
|
-
if (
|
|
590
|
-
if (
|
|
591
|
-
for (var
|
|
592
|
-
|
|
593
|
-
Object.freeze && Object.freeze(
|
|
583
|
+
var L = Pr(e, n, i, h, j);
|
|
584
|
+
if (L == null)
|
|
585
|
+
return L;
|
|
586
|
+
if (p) {
|
|
587
|
+
var te = n.children;
|
|
588
|
+
if (te !== void 0)
|
|
589
|
+
if (u)
|
|
590
|
+
if (De(te)) {
|
|
591
|
+
for (var we = 0; we < te.length; we++)
|
|
592
|
+
rr(te[we], e);
|
|
593
|
+
Object.freeze && Object.freeze(te);
|
|
594
594
|
} else
|
|
595
|
-
|
|
595
|
+
C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
596
596
|
else
|
|
597
|
-
|
|
597
|
+
rr(te, e);
|
|
598
598
|
}
|
|
599
|
-
if (
|
|
600
|
-
var
|
|
601
|
-
return
|
|
602
|
-
}),
|
|
603
|
-
if (!
|
|
604
|
-
var
|
|
605
|
-
|
|
599
|
+
if ($.call(n, "key")) {
|
|
600
|
+
var xe = z(e), Z = Object.keys(n).filter(function(Mr) {
|
|
601
|
+
return Mr !== "key";
|
|
602
|
+
}), Me = Z.length > 0 ? "{key: someKey, " + Z.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
+
if (!tr[xe + Me]) {
|
|
604
|
+
var $r = Z.length > 0 ? "{" + Z.join(": ..., ") + ": ...}" : "{}";
|
|
605
|
+
C(`A props object containing a "key" prop is being spread into JSX:
|
|
606
606
|
let props = %s;
|
|
607
607
|
<%s {...props} />
|
|
608
608
|
React keys must be passed directly to JSX without using spread:
|
|
609
609
|
let props = %s;
|
|
610
|
-
<%s key={someKey} {...props} />`,
|
|
610
|
+
<%s key={someKey} {...props} />`, Me, xe, $r, xe), tr[xe + Me] = !0;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
return e ===
|
|
613
|
+
return e === o ? Or(L) : Tr(L), L;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
return
|
|
616
|
+
function Fr(e, n, i) {
|
|
617
|
+
return ar(e, n, i, !0);
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
return
|
|
619
|
+
function Dr(e, n, i) {
|
|
620
|
+
return ar(e, n, i, !1);
|
|
621
621
|
}
|
|
622
|
-
var
|
|
623
|
-
|
|
624
|
-
}()),
|
|
622
|
+
var Wr = Dr, Ar = Fr;
|
|
623
|
+
_e.Fragment = o, _e.jsx = Wr, _e.jsxs = Ar;
|
|
624
|
+
}()), _e;
|
|
625
625
|
}
|
|
626
|
-
process.env.NODE_ENV === "production" ?
|
|
627
|
-
var
|
|
628
|
-
function
|
|
629
|
-
var
|
|
630
|
-
if (typeof
|
|
631
|
-
else if (typeof
|
|
632
|
-
var
|
|
633
|
-
for (
|
|
634
|
-
} else for (
|
|
635
|
-
return
|
|
626
|
+
process.env.NODE_ENV === "production" ? ze.exports = Ir() : ze.exports = Ur();
|
|
627
|
+
var a = ze.exports;
|
|
628
|
+
function mr(r) {
|
|
629
|
+
var t, s, o = "";
|
|
630
|
+
if (typeof r == "string" || typeof r == "number") o += r;
|
|
631
|
+
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
632
|
+
var l = r.length;
|
|
633
|
+
for (t = 0; t < l; t++) r[t] && (s = mr(r[t])) && (o && (o += " "), o += s);
|
|
634
|
+
} else for (s in r) r[s] && (o && (o += " "), o += s);
|
|
635
|
+
return o;
|
|
636
636
|
}
|
|
637
|
-
function
|
|
638
|
-
for (var
|
|
639
|
-
return
|
|
637
|
+
function ne() {
|
|
638
|
+
for (var r, t, s = 0, o = "", l = arguments.length; s < l; s++) (r = arguments[s]) && (t = mr(r)) && (o && (o += " "), o += t);
|
|
639
|
+
return o;
|
|
640
640
|
}
|
|
641
|
-
const
|
|
642
|
-
let
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
},
|
|
646
|
-
var
|
|
647
|
-
const
|
|
648
|
-
return (
|
|
649
|
-
},
|
|
650
|
-
baseUrl:
|
|
651
|
-
spreedlyScriptUrl:
|
|
652
|
-
|
|
641
|
+
const Lr = "https://core.spreedly.com/iframe/iframe-v1.min.js", Yr = "https://cdn.e2e.movmo.io";
|
|
642
|
+
let Ne = {};
|
|
643
|
+
const yt = (r) => {
|
|
644
|
+
Ne = { ...Ne, ...r };
|
|
645
|
+
}, Ie = (r) => {
|
|
646
|
+
var s;
|
|
647
|
+
const t = globalThis.process;
|
|
648
|
+
return (s = t == null ? void 0 : t.env) == null ? void 0 : s[r];
|
|
649
|
+
}, Fe = () => ({
|
|
650
|
+
baseUrl: Ne.baseUrl ?? Ie("REACT_APP_MOVMO_API_URL") ?? "",
|
|
651
|
+
spreedlyScriptUrl: Ne.spreedlyScriptUrl ?? Ie("REACT_APP_SPREEDLY_SCRIPT_URL") ?? Lr,
|
|
652
|
+
iconCdnBaseUrl: Ne.iconCdnBaseUrl ?? Ie("REACT_APP_MOVMO_ICON_CDN_URL") ?? Yr
|
|
653
|
+
}), pr = (r) => ({
|
|
654
|
+
id: r.id,
|
|
655
|
+
last4: r.last4,
|
|
656
|
+
brand: r.brand,
|
|
657
|
+
expMonth: r.expMonth,
|
|
658
|
+
expYear: r.expYear,
|
|
659
|
+
isDefault: r.isDefault
|
|
660
|
+
}), Pe = {
|
|
653
661
|
Accept: "application/json",
|
|
654
662
|
"Content-Type": "application/json"
|
|
655
|
-
},
|
|
656
|
-
const { baseUrl:
|
|
657
|
-
if (!
|
|
663
|
+
}, Se = (r) => {
|
|
664
|
+
const { baseUrl: t } = Fe();
|
|
665
|
+
if (!t)
|
|
658
666
|
throw new Error(
|
|
659
667
|
"@movmo_app/payments: baseUrl is not configured. Call setPaymentsConfig({ baseUrl }) at app boot, or set REACT_APP_MOVMO_API_URL."
|
|
660
668
|
);
|
|
661
|
-
return `${
|
|
662
|
-
},
|
|
669
|
+
return `${t}${r}`;
|
|
670
|
+
}, ke = async (r, t) => {
|
|
663
671
|
try {
|
|
664
|
-
return (await
|
|
672
|
+
return (await r.json()).message || t;
|
|
665
673
|
} catch {
|
|
666
|
-
return
|
|
674
|
+
return t;
|
|
667
675
|
}
|
|
668
|
-
},
|
|
669
|
-
const
|
|
676
|
+
}, Vr = async () => {
|
|
677
|
+
const r = await fetch(Se("/v1/payments/tokenization-session"), {
|
|
670
678
|
method: "GET",
|
|
671
|
-
headers:
|
|
679
|
+
headers: Pe,
|
|
672
680
|
credentials: "include"
|
|
673
681
|
});
|
|
674
|
-
if (!
|
|
675
|
-
throw new Error(await
|
|
676
|
-
return await
|
|
677
|
-
},
|
|
678
|
-
const
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
682
|
+
if (!r.ok)
|
|
683
|
+
throw new Error(await ke(r, `Failed to fetch tokenization session (${r.status})`));
|
|
684
|
+
return await r.json();
|
|
685
|
+
}, zr = async (r, t, s) => {
|
|
686
|
+
const o = await fetch(
|
|
687
|
+
Se(`/v1/users/${encodeURIComponent(r)}/payment-methods/from-token`),
|
|
688
|
+
{
|
|
689
|
+
method: "POST",
|
|
690
|
+
headers: Pe,
|
|
691
|
+
credentials: "include",
|
|
692
|
+
body: JSON.stringify({ tokenizedPaymentMethodId: t, isDefault: s })
|
|
693
|
+
}
|
|
694
|
+
);
|
|
695
|
+
if (!o.ok)
|
|
696
|
+
throw new Error(await ke(o, `Failed to save payment method (${o.status})`));
|
|
697
|
+
const l = await o.json();
|
|
698
|
+
return pr(l);
|
|
699
|
+
}, Br = async (r) => {
|
|
700
|
+
const t = await fetch(Se(`/v1/users/${encodeURIComponent(r)}/payment-methods`), {
|
|
701
|
+
method: "GET",
|
|
702
|
+
headers: Pe,
|
|
703
|
+
credentials: "include"
|
|
683
704
|
});
|
|
684
|
-
if (!
|
|
685
|
-
throw new Error(await
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
705
|
+
if (!t.ok)
|
|
706
|
+
throw new Error(await ke(t, `Failed to fetch payment methods (${t.status})`));
|
|
707
|
+
return (await t.json() ?? []).map(pr);
|
|
708
|
+
}, Kr = async (r, t) => {
|
|
709
|
+
const s = await fetch(
|
|
710
|
+
Se(
|
|
711
|
+
`/v1/users/${encodeURIComponent(r)}/payment-methods/${encodeURIComponent(t)}`
|
|
712
|
+
),
|
|
713
|
+
{
|
|
714
|
+
method: "DELETE",
|
|
715
|
+
headers: Pe,
|
|
716
|
+
credentials: "include"
|
|
717
|
+
}
|
|
718
|
+
);
|
|
719
|
+
if (!s.ok)
|
|
720
|
+
throw new Error(await ke(s, `Failed to delete payment method (${s.status})`));
|
|
721
|
+
}, qr = async (r, t, s) => {
|
|
722
|
+
const o = await fetch(
|
|
723
|
+
Se(
|
|
724
|
+
`/v1/users/${encodeURIComponent(r)}/payment-methods/${encodeURIComponent(t)}`
|
|
725
|
+
),
|
|
726
|
+
{
|
|
727
|
+
method: "PUT",
|
|
728
|
+
headers: Pe,
|
|
729
|
+
credentials: "include",
|
|
730
|
+
body: JSON.stringify(s)
|
|
731
|
+
}
|
|
732
|
+
);
|
|
733
|
+
if (!o.ok)
|
|
734
|
+
throw new Error(await ke(o, `Failed to update payment method (${o.status})`));
|
|
735
|
+
}, Gr = {
|
|
736
|
+
visa: "visa",
|
|
737
|
+
master: "mastercard",
|
|
738
|
+
mastercard: "mastercard",
|
|
739
|
+
american_express: "amex",
|
|
740
|
+
amex: "amex",
|
|
741
|
+
discover: "discover"
|
|
742
|
+
}, Jr = 28, be = ({
|
|
743
|
+
brand: r,
|
|
744
|
+
className: t,
|
|
745
|
+
width: s = 46
|
|
746
|
+
}) => {
|
|
747
|
+
const o = Gr[r.toLowerCase()] ?? "credit-card", l = Math.max(s, Jr), f = Math.round(l * 24 / 34), { iconCdnBaseUrl: d } = Fe();
|
|
748
|
+
return /* @__PURE__ */ a.jsx(
|
|
749
|
+
"img",
|
|
750
|
+
{
|
|
751
|
+
src: `${d}/website/assets/icons/payments/${o}.svg`,
|
|
752
|
+
alt: o === "credit-card" ? "card" : `${o} card`,
|
|
753
|
+
"data-testid": `card-brand-${r.toLowerCase()}`,
|
|
754
|
+
className: t,
|
|
755
|
+
width: l,
|
|
756
|
+
height: f,
|
|
757
|
+
loading: "lazy"
|
|
758
|
+
}
|
|
759
|
+
);
|
|
695
760
|
};
|
|
696
|
-
let
|
|
697
|
-
const
|
|
761
|
+
let Re = null;
|
|
762
|
+
const Hr = () => {
|
|
698
763
|
if (typeof window > "u")
|
|
699
764
|
return Promise.reject(new Error("Spreedly can only be loaded in a browser environment."));
|
|
700
765
|
if (window.Spreedly)
|
|
701
766
|
return Promise.resolve(window.Spreedly);
|
|
702
|
-
if (
|
|
703
|
-
return
|
|
704
|
-
const { spreedlyScriptUrl:
|
|
705
|
-
return
|
|
706
|
-
const
|
|
707
|
-
`script[src="${
|
|
708
|
-
),
|
|
709
|
-
window.Spreedly ?
|
|
767
|
+
if (Re)
|
|
768
|
+
return Re;
|
|
769
|
+
const { spreedlyScriptUrl: r } = Fe();
|
|
770
|
+
return Re = new Promise((t, s) => {
|
|
771
|
+
const o = document.querySelector(
|
|
772
|
+
`script[src="${r}"]`
|
|
773
|
+
), l = () => {
|
|
774
|
+
window.Spreedly ? t(window.Spreedly) : s(new Error("Spreedly script loaded but window.Spreedly is undefined."));
|
|
710
775
|
};
|
|
711
|
-
if (
|
|
776
|
+
if (o) {
|
|
712
777
|
if (window.Spreedly) {
|
|
713
|
-
|
|
778
|
+
l();
|
|
714
779
|
return;
|
|
715
780
|
}
|
|
716
|
-
|
|
781
|
+
o.addEventListener("load", l, { once: !0 }), o.addEventListener(
|
|
717
782
|
"error",
|
|
718
783
|
() => {
|
|
719
|
-
|
|
784
|
+
o.remove(), s(new Error("Failed to load Spreedly iframe script."));
|
|
720
785
|
},
|
|
721
786
|
{ once: !0 }
|
|
722
787
|
);
|
|
723
788
|
return;
|
|
724
789
|
}
|
|
725
|
-
const
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
}, document.head.appendChild(
|
|
729
|
-
}).catch((
|
|
730
|
-
throw
|
|
731
|
-
}),
|
|
732
|
-
},
|
|
733
|
-
first_name:
|
|
734
|
-
last_name:
|
|
735
|
-
month:
|
|
736
|
-
year:
|
|
737
|
-
...
|
|
738
|
-
...
|
|
739
|
-
}),
|
|
790
|
+
const f = document.createElement("script");
|
|
791
|
+
f.src = r, f.async = !0, f.onload = l, f.onerror = () => {
|
|
792
|
+
f.remove(), s(new Error("Failed to load Spreedly iframe script."));
|
|
793
|
+
}, document.head.appendChild(f);
|
|
794
|
+
}).catch((t) => {
|
|
795
|
+
throw Re = null, t;
|
|
796
|
+
}), Re;
|
|
797
|
+
}, Zr = "movmo-card-number", Xr = "movmo-card-cvv", Qr = (r) => ({
|
|
798
|
+
first_name: r.firstName,
|
|
799
|
+
last_name: r.lastName,
|
|
800
|
+
month: r.month,
|
|
801
|
+
year: r.year,
|
|
802
|
+
...r.email ? { email: r.email } : {},
|
|
803
|
+
...r.zip ? { zip: r.zip } : {}
|
|
804
|
+
}), et = (r = {}) => {
|
|
740
805
|
const {
|
|
741
|
-
numberEl:
|
|
742
|
-
cvvEl:
|
|
743
|
-
onCardTokenized:
|
|
744
|
-
onFieldErrors:
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
}, [
|
|
751
|
-
|
|
752
|
-
|
|
806
|
+
numberEl: t = Zr,
|
|
807
|
+
cvvEl: s = Xr,
|
|
808
|
+
onCardTokenized: o,
|
|
809
|
+
onFieldErrors: l,
|
|
810
|
+
onValidityChange: f,
|
|
811
|
+
onBrandChange: d
|
|
812
|
+
} = r, [v, y] = S("idle"), [T, g] = S(null), [w, F] = S({ number: !1, cvv: !1 }), [_, D] = S(null), R = q(null), G = q(o), O = q(l), C = q(f), J = q(d);
|
|
813
|
+
X(() => {
|
|
814
|
+
G.current = o;
|
|
815
|
+
}, [o]), X(() => {
|
|
816
|
+
O.current = l;
|
|
817
|
+
}, [l]), X(() => {
|
|
818
|
+
C.current = f;
|
|
819
|
+
}, [f]), X(() => {
|
|
820
|
+
J.current = d;
|
|
821
|
+
}, [d]);
|
|
822
|
+
const W = q({ number: !1, cvv: !1 });
|
|
823
|
+
X(() => {
|
|
824
|
+
let A = !1;
|
|
825
|
+
return y("loading"), g(null), F({ number: !1, cvv: !1 }), D(null), W.current = { number: !1, cvv: !1 }, (async () => {
|
|
753
826
|
try {
|
|
754
|
-
const [
|
|
755
|
-
|
|
756
|
-
|
|
827
|
+
const [x, b] = await Promise.all([
|
|
828
|
+
Vr(),
|
|
829
|
+
Hr()
|
|
757
830
|
]);
|
|
758
|
-
if (
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
(
|
|
771
|
-
}),
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
831
|
+
if (A) return;
|
|
832
|
+
R.current = b, b.on("ready", () => {
|
|
833
|
+
var I;
|
|
834
|
+
if (!A) {
|
|
835
|
+
y("ready");
|
|
836
|
+
try {
|
|
837
|
+
(I = b.setNumberFormat) == null || I.call(b, "prettyFormat");
|
|
838
|
+
} catch {
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}), b.on("paymentMethod", (I) => {
|
|
842
|
+
var U;
|
|
843
|
+
(U = G.current) == null || U.call(G, I);
|
|
844
|
+
}), b.on("errors", (I) => {
|
|
845
|
+
var U;
|
|
846
|
+
(U = O.current) == null || U.call(O, I);
|
|
847
|
+
}), b.on("fieldEvent", (I, U, ie, z) => {
|
|
848
|
+
var ue;
|
|
849
|
+
if (A || U !== "input") return;
|
|
850
|
+
const N = z ?? {};
|
|
851
|
+
if (I === "number") {
|
|
852
|
+
if (N.numberLength === 0)
|
|
853
|
+
D((V) => {
|
|
854
|
+
var k;
|
|
855
|
+
return V !== null && ((k = J.current) == null || k.call(J, null)), null;
|
|
856
|
+
});
|
|
857
|
+
else if (N.cardType !== void 0) {
|
|
858
|
+
const V = N.cardType || null;
|
|
859
|
+
D((k) => {
|
|
860
|
+
var le;
|
|
861
|
+
return k !== V && ((le = J.current) == null || le.call(J, V)), V;
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
const Y = I === "number" ? typeof N.validNumber == "boolean" ? N.validNumber : void 0 : typeof N.validCvv == "boolean" ? N.validCvv : void 0;
|
|
866
|
+
if (typeof Y == "boolean") {
|
|
867
|
+
const V = W.current, k = I === "number" ? { ...V, number: Y } : { ...V, cvv: Y };
|
|
868
|
+
(k.number !== V.number || k.cvv !== V.cvv) && (W.current = k, F(k), (ue = C.current) == null || ue.call(C, k));
|
|
869
|
+
}
|
|
870
|
+
}), b.on("consoleError", (I) => {
|
|
871
|
+
var ie;
|
|
872
|
+
const U = I instanceof Error ? I.message : "An unexpected error occurred while securing your card.";
|
|
873
|
+
(ie = O.current) == null || ie.call(O, [{ message: U }]);
|
|
874
|
+
}), b.init(x.environmentKey, {
|
|
875
|
+
numberEl: t,
|
|
876
|
+
cvvEl: s,
|
|
877
|
+
nonce: x.nonce,
|
|
878
|
+
timestamp: String(x.timestamp),
|
|
879
|
+
certificateToken: x.certificateToken,
|
|
880
|
+
signature: x.signature
|
|
778
881
|
});
|
|
779
|
-
} catch (
|
|
780
|
-
if (
|
|
781
|
-
const
|
|
782
|
-
b
|
|
882
|
+
} catch (x) {
|
|
883
|
+
if (A) return;
|
|
884
|
+
const b = x instanceof Error ? x.message : "Failed to initialize card form.";
|
|
885
|
+
g(b), y("error");
|
|
783
886
|
}
|
|
784
887
|
})(), () => {
|
|
785
|
-
var
|
|
786
|
-
|
|
888
|
+
var x, b;
|
|
889
|
+
A = !0;
|
|
787
890
|
try {
|
|
788
|
-
(
|
|
891
|
+
(b = (x = R.current) == null ? void 0 : x.removeHandlers) == null || b.call(x);
|
|
789
892
|
} catch {
|
|
790
893
|
}
|
|
791
|
-
|
|
894
|
+
R.current = null;
|
|
792
895
|
};
|
|
793
|
-
}, [
|
|
794
|
-
const
|
|
795
|
-
var
|
|
796
|
-
(
|
|
896
|
+
}, [t, s]);
|
|
897
|
+
const se = B((A) => {
|
|
898
|
+
var x;
|
|
899
|
+
(x = R.current) == null || x.tokenizeCreditCard(Qr(A));
|
|
900
|
+
}, []), oe = B((A) => {
|
|
901
|
+
var x, b;
|
|
902
|
+
(b = (x = R.current) == null ? void 0 : x.transferFocus) == null || b.call(x, A);
|
|
797
903
|
}, []);
|
|
798
|
-
return { status:
|
|
799
|
-
},
|
|
800
|
-
const
|
|
801
|
-
return
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
904
|
+
return { status: v, error: T, tokenize: se, validity: w, brand: _, focusField: oe };
|
|
905
|
+
}, Ue = "h-11 w-full rounded-md border border-grayWarm-300 bg-white px-3 py-2 text-sm text-grayWarm-900 placeholder:text-grayWarm-400 outline-none focus:border-grayWarm-950 focus:shadow-[0_0_0_1px_#1c1917]", or = "flex h-11 w-full items-center gap-2 rounded-md border border-grayWarm-300 bg-white px-3 py-2 transition-shadow focus-within:border-grayWarm-950 focus-within:shadow-[0_0_0_1px_#1c1917]", rt = (r) => {
|
|
906
|
+
const t = r.trim();
|
|
907
|
+
if (!t) return { firstName: "", lastName: "" };
|
|
908
|
+
const s = t.lastIndexOf(" ");
|
|
909
|
+
return s === -1 ? { firstName: t, lastName: "" } : {
|
|
910
|
+
firstName: t.slice(0, s).trim(),
|
|
911
|
+
lastName: t.slice(s + 1).trim()
|
|
912
|
+
};
|
|
913
|
+
}, yr = (r) => {
|
|
914
|
+
const t = r.replace(/\D/g, "");
|
|
915
|
+
if (t.length < 4) return { month: "", year: "" };
|
|
916
|
+
const s = t.slice(0, 2), o = t.slice(2), l = o.length === 2 ? `20${o}` : o.slice(0, 4);
|
|
917
|
+
return { month: s, year: l };
|
|
918
|
+
}, tt = (r) => {
|
|
919
|
+
const t = r.replace(/\D/g, "").slice(0, 4);
|
|
920
|
+
return t.length <= 2 ? t : `${t.slice(0, 2)} / ${t.slice(2)}`;
|
|
921
|
+
}, Le = (r) => {
|
|
922
|
+
const { month: t, year: s } = yr(r);
|
|
923
|
+
if (!t || !s) return !1;
|
|
924
|
+
const o = parseInt(t, 10), l = parseInt(s, 10);
|
|
925
|
+
if (isNaN(o) || o < 1 || o > 12) return !1;
|
|
926
|
+
const f = /* @__PURE__ */ new Date();
|
|
927
|
+
return !(l < f.getFullYear() || l > f.getFullYear() + 20 || l === f.getFullYear() && o < f.getMonth() + 1);
|
|
928
|
+
}, Ye = (r) => /^\d{5}(-\d{4})?$/.test(r.trim()), at = (r) => {
|
|
929
|
+
const t = r.replace(/[^\d]/g, "").slice(0, 9);
|
|
930
|
+
return t.length <= 5 ? t : `${t.slice(0, 5)}-${t.slice(5)}`;
|
|
931
|
+
}, vr = ({
|
|
932
|
+
userId: r,
|
|
933
|
+
onSuccess: t,
|
|
934
|
+
onError: s,
|
|
935
|
+
isDefault: o = !1,
|
|
936
|
+
className: l,
|
|
937
|
+
defaultCardholderName: f,
|
|
938
|
+
defaultCardholderFirstName: d = "",
|
|
939
|
+
defaultCardholderLastName: v = "",
|
|
940
|
+
autoSave: y = !1,
|
|
941
|
+
formId: T = "movmo-card-form",
|
|
942
|
+
hideInternalSaveButton: g = !1,
|
|
943
|
+
onCanSubmitChange: w
|
|
810
944
|
}) => {
|
|
811
|
-
const [
|
|
812
|
-
async (
|
|
813
|
-
|
|
945
|
+
const F = f ?? [d, v].filter(Boolean).join(" "), [_, D] = S(F), [R, G] = S(""), [O, C] = S(""), [J, W] = S("idle"), [se, oe] = S(null), A = q(!1), x = B(
|
|
946
|
+
async (P) => {
|
|
947
|
+
W("saving");
|
|
814
948
|
try {
|
|
815
|
-
const
|
|
816
|
-
|
|
817
|
-
} catch (
|
|
818
|
-
const
|
|
819
|
-
|
|
949
|
+
const c = await zr(r, P, o);
|
|
950
|
+
W("ready"), t(c);
|
|
951
|
+
} catch (c) {
|
|
952
|
+
const E = c instanceof Error ? c.message : "Failed to save payment method.";
|
|
953
|
+
oe(E), W("ready"), A.current = !1, s(E);
|
|
820
954
|
}
|
|
821
955
|
},
|
|
822
|
-
[
|
|
823
|
-
),
|
|
824
|
-
(
|
|
825
|
-
const
|
|
826
|
-
|
|
956
|
+
[r, o, t, s]
|
|
957
|
+
), b = B(
|
|
958
|
+
(P) => {
|
|
959
|
+
const c = P.map((E) => E.message).filter(Boolean).join("; ") || "Card validation failed.";
|
|
960
|
+
oe(c), W((E) => E === "tokenizing" ? "ready" : E), A.current = !1, s(c);
|
|
827
961
|
},
|
|
828
|
-
[
|
|
829
|
-
),
|
|
962
|
+
[s]
|
|
963
|
+
), I = Ce(
|
|
830
964
|
() => ({
|
|
831
|
-
onCardTokenized:
|
|
832
|
-
onFieldErrors:
|
|
965
|
+
onCardTokenized: x,
|
|
966
|
+
onFieldErrors: b
|
|
833
967
|
}),
|
|
834
|
-
[
|
|
835
|
-
), {
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
},
|
|
843
|
-
|
|
968
|
+
[x, b]
|
|
969
|
+
), {
|
|
970
|
+
status: U,
|
|
971
|
+
error: ie,
|
|
972
|
+
tokenize: z,
|
|
973
|
+
validity: N,
|
|
974
|
+
brand: Y,
|
|
975
|
+
focusField: ue
|
|
976
|
+
} = et(I), V = _.trim().split(/\s+/).length >= 2, k = Le(R), le = Ye(O), ce = q(!1), fe = q(!1), me = q(!1), pe = q(null), he = q(null);
|
|
977
|
+
X(() => {
|
|
978
|
+
var P;
|
|
979
|
+
N.cvv ? fe.current || (fe.current = !0, (P = pe.current) == null || P.focus()) : fe.current = !1;
|
|
980
|
+
}, [N.cvv]);
|
|
981
|
+
const Ee = !V || !k || !le || !N.number || !N.cvv, ae = J === "tokenizing" || J === "saving", Q = U === "ready" && !ae && !Ee, ee = q(w);
|
|
982
|
+
X(() => {
|
|
983
|
+
ee.current = w;
|
|
984
|
+
}, [w]), X(() => {
|
|
985
|
+
var P;
|
|
986
|
+
(P = ee.current) == null || P.call(ee, Q);
|
|
987
|
+
}, [Q]);
|
|
988
|
+
const re = B(() => {
|
|
989
|
+
const { firstName: P, lastName: c } = rt(_), { month: E, year: $ } = yr(R);
|
|
990
|
+
oe(null), W("tokenizing"), z({ firstName: P, lastName: c, month: E, year: $, zip: O.trim() });
|
|
991
|
+
}, [_, R, O, z]);
|
|
992
|
+
X(() => {
|
|
993
|
+
if (!y || !Q || A.current) return;
|
|
994
|
+
const P = setTimeout(() => {
|
|
995
|
+
A.current = !0, re();
|
|
996
|
+
}, 1200);
|
|
997
|
+
return () => clearTimeout(P);
|
|
998
|
+
}, [y, Q, re]);
|
|
999
|
+
const de = (P) => {
|
|
1000
|
+
P.preventDefault(), Q && re();
|
|
1001
|
+
}, ye = se ?? ie, ve = U !== "ready" || ae;
|
|
1002
|
+
return /* @__PURE__ */ a.jsxs(
|
|
844
1003
|
"form",
|
|
845
1004
|
{
|
|
846
|
-
|
|
847
|
-
|
|
1005
|
+
id: T,
|
|
1006
|
+
onSubmit: de,
|
|
1007
|
+
className: ne("flex w-full flex-col gap-3", l),
|
|
848
1008
|
"data-testid": "movmo-card-form",
|
|
849
1009
|
children: [
|
|
850
|
-
/* @__PURE__ */
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
-
|
|
853
|
-
/* @__PURE__ */
|
|
1010
|
+
/* @__PURE__ */ a.jsxs("div", { children: [
|
|
1011
|
+
/* @__PURE__ */ a.jsx("span", { id: "movmo-card-number-label", className: "sr-only", children: "Card number" }),
|
|
1012
|
+
/* @__PURE__ */ a.jsxs("div", { className: or, children: [
|
|
1013
|
+
/* @__PURE__ */ a.jsx(be, { brand: Y ?? "", width: 32, className: "flex-shrink-0" }),
|
|
1014
|
+
/* @__PURE__ */ a.jsx(
|
|
1015
|
+
"div",
|
|
1016
|
+
{
|
|
1017
|
+
id: "movmo-card-number",
|
|
1018
|
+
"aria-labelledby": "movmo-card-number-label",
|
|
1019
|
+
className: "flex-1",
|
|
1020
|
+
"data-testid": "movmo-card-number-mount"
|
|
1021
|
+
}
|
|
1022
|
+
)
|
|
1023
|
+
] })
|
|
1024
|
+
] }),
|
|
1025
|
+
/* @__PURE__ */ a.jsxs("div", { className: "grid grid-cols-3 gap-3", children: [
|
|
1026
|
+
/* @__PURE__ */ a.jsxs("div", { children: [
|
|
1027
|
+
/* @__PURE__ */ a.jsx("label", { htmlFor: "movmo-card-expiry", className: "sr-only", children: "Expiry MM / YY" }),
|
|
1028
|
+
/* @__PURE__ */ a.jsx(
|
|
854
1029
|
"input",
|
|
855
1030
|
{
|
|
856
|
-
id: "movmo-card-
|
|
1031
|
+
id: "movmo-card-expiry",
|
|
857
1032
|
type: "text",
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
1033
|
+
inputMode: "numeric",
|
|
1034
|
+
autoComplete: "cc-exp",
|
|
1035
|
+
placeholder: "MM / YY",
|
|
1036
|
+
value: R,
|
|
1037
|
+
onChange: (P) => {
|
|
1038
|
+
const c = tt(P.target.value);
|
|
1039
|
+
G(c), Le(c) && !ce.current ? (ce.current = !0, ue("cvv")) : Le(c) || (ce.current = !1);
|
|
1040
|
+
},
|
|
1041
|
+
className: ne(Ue, R && !k && "border-error-500"),
|
|
1042
|
+
disabled: ve,
|
|
1043
|
+
required: !0,
|
|
1044
|
+
"data-testid": "movmo-card-expiry-input"
|
|
864
1045
|
}
|
|
865
1046
|
)
|
|
866
1047
|
] }),
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
/* @__PURE__ */
|
|
869
|
-
/* @__PURE__ */
|
|
1048
|
+
/* @__PURE__ */ a.jsxs("div", { className: "relative", children: [
|
|
1049
|
+
/* @__PURE__ */ a.jsx("span", { id: "movmo-card-cvv-label", className: "sr-only", children: "CVV" }),
|
|
1050
|
+
/* @__PURE__ */ a.jsxs("div", { className: or, children: [
|
|
1051
|
+
/* @__PURE__ */ a.jsx(
|
|
1052
|
+
"div",
|
|
1053
|
+
{
|
|
1054
|
+
id: "movmo-card-cvv",
|
|
1055
|
+
"aria-labelledby": "movmo-card-cvv-label",
|
|
1056
|
+
className: "flex-1",
|
|
1057
|
+
"data-testid": "movmo-card-cvv-mount"
|
|
1058
|
+
}
|
|
1059
|
+
),
|
|
1060
|
+
/* @__PURE__ */ a.jsx(
|
|
1061
|
+
"button",
|
|
1062
|
+
{
|
|
1063
|
+
type: "button",
|
|
1064
|
+
"aria-label": "CVV help",
|
|
1065
|
+
tabIndex: -1,
|
|
1066
|
+
className: "flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full border border-grayWarm-300 text-xs text-grayWarm-500",
|
|
1067
|
+
title: Y === "american_express" ? "The 4 numbers on the front of your card." : "The 3 numbers on the back of your card.",
|
|
1068
|
+
"data-testid": "movmo-cvv-help",
|
|
1069
|
+
children: "?"
|
|
1070
|
+
}
|
|
1071
|
+
)
|
|
1072
|
+
] })
|
|
1073
|
+
] }),
|
|
1074
|
+
/* @__PURE__ */ a.jsxs("div", { children: [
|
|
1075
|
+
/* @__PURE__ */ a.jsx("label", { htmlFor: "movmo-card-zip", className: "sr-only", children: "ZIP code" }),
|
|
1076
|
+
/* @__PURE__ */ a.jsx(
|
|
870
1077
|
"input",
|
|
871
1078
|
{
|
|
872
|
-
id: "movmo-card-
|
|
1079
|
+
id: "movmo-card-zip",
|
|
1080
|
+
ref: pe,
|
|
873
1081
|
type: "text",
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
1082
|
+
inputMode: "numeric",
|
|
1083
|
+
autoComplete: "postal-code",
|
|
1084
|
+
placeholder: "ZIP code",
|
|
1085
|
+
value: O,
|
|
1086
|
+
onChange: (P) => {
|
|
1087
|
+
var E;
|
|
1088
|
+
const c = at(P.target.value);
|
|
1089
|
+
C(c), Ye(c) && !me.current ? (me.current = !0, (E = he.current) == null || E.focus()) : Ye(c) || (me.current = !1);
|
|
1090
|
+
},
|
|
1091
|
+
className: ne(Ue, O && !le && "border-error-500"),
|
|
1092
|
+
disabled: ve,
|
|
1093
|
+
required: !0,
|
|
1094
|
+
"data-testid": "movmo-card-zip-input"
|
|
880
1095
|
}
|
|
881
1096
|
)
|
|
882
1097
|
] })
|
|
883
1098
|
] }),
|
|
884
|
-
/* @__PURE__ */
|
|
885
|
-
/* @__PURE__ */
|
|
886
|
-
/* @__PURE__ */
|
|
887
|
-
"
|
|
1099
|
+
/* @__PURE__ */ a.jsxs("div", { children: [
|
|
1100
|
+
/* @__PURE__ */ a.jsx("label", { htmlFor: "movmo-card-cardholder-name", className: "sr-only", children: "Cardholder name" }),
|
|
1101
|
+
/* @__PURE__ */ a.jsx(
|
|
1102
|
+
"input",
|
|
888
1103
|
{
|
|
889
|
-
id: "movmo-card-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
1104
|
+
id: "movmo-card-cardholder-name",
|
|
1105
|
+
ref: he,
|
|
1106
|
+
type: "text",
|
|
1107
|
+
autoComplete: "cc-name",
|
|
1108
|
+
placeholder: "Cardholder name",
|
|
1109
|
+
value: _,
|
|
1110
|
+
onChange: (P) => D(P.target.value),
|
|
1111
|
+
className: Ue,
|
|
1112
|
+
disabled: ve,
|
|
1113
|
+
required: !0,
|
|
1114
|
+
"data-testid": "movmo-card-cardholder-name-input"
|
|
893
1115
|
}
|
|
894
1116
|
)
|
|
895
1117
|
] }),
|
|
896
|
-
/* @__PURE__ */
|
|
897
|
-
/* @__PURE__ */ m.jsxs("div", { children: [
|
|
898
|
-
/* @__PURE__ */ m.jsx("label", { htmlFor: "movmo-card-exp-month", className: V, children: "Month" }),
|
|
899
|
-
/* @__PURE__ */ m.jsxs(
|
|
900
|
-
"select",
|
|
901
|
-
{
|
|
902
|
-
id: "movmo-card-exp-month",
|
|
903
|
-
value: y,
|
|
904
|
-
onChange: (d) => D(d.target.value),
|
|
905
|
-
className: ne,
|
|
906
|
-
disabled: U !== "ready" || Y,
|
|
907
|
-
required: !0,
|
|
908
|
-
children: [
|
|
909
|
-
/* @__PURE__ */ m.jsx("option", { value: "", children: "MM" }),
|
|
910
|
-
Ur.map((d) => /* @__PURE__ */ m.jsx("option", { value: d, children: d }, d))
|
|
911
|
-
]
|
|
912
|
-
}
|
|
913
|
-
)
|
|
914
|
-
] }),
|
|
915
|
-
/* @__PURE__ */ m.jsxs("div", { children: [
|
|
916
|
-
/* @__PURE__ */ m.jsx("label", { htmlFor: "movmo-card-exp-year", className: V, children: "Year" }),
|
|
917
|
-
/* @__PURE__ */ m.jsxs(
|
|
918
|
-
"select",
|
|
919
|
-
{
|
|
920
|
-
id: "movmo-card-exp-year",
|
|
921
|
-
value: C,
|
|
922
|
-
onChange: (d) => h(d.target.value),
|
|
923
|
-
className: ne,
|
|
924
|
-
disabled: U !== "ready" || Y,
|
|
925
|
-
required: !0,
|
|
926
|
-
children: [
|
|
927
|
-
/* @__PURE__ */ m.jsx("option", { value: "", children: "YYYY" }),
|
|
928
|
-
Yr.map((d) => /* @__PURE__ */ m.jsx("option", { value: d, children: d }, d))
|
|
929
|
-
]
|
|
930
|
-
}
|
|
931
|
-
)
|
|
932
|
-
] }),
|
|
933
|
-
/* @__PURE__ */ m.jsxs("div", { children: [
|
|
934
|
-
/* @__PURE__ */ m.jsx("span", { id: "movmo-card-cvv-label", className: V, children: "CVV" }),
|
|
935
|
-
/* @__PURE__ */ m.jsx(
|
|
936
|
-
"div",
|
|
937
|
-
{
|
|
938
|
-
id: "movmo-card-cvv",
|
|
939
|
-
"aria-labelledby": "movmo-card-cvv-label",
|
|
940
|
-
className: Be,
|
|
941
|
-
"data-testid": "movmo-card-cvv-mount"
|
|
942
|
-
}
|
|
943
|
-
)
|
|
944
|
-
] })
|
|
945
|
-
] }),
|
|
946
|
-
N ? /* @__PURE__ */ m.jsx(
|
|
1118
|
+
ye ? /* @__PURE__ */ a.jsx(
|
|
947
1119
|
"p",
|
|
948
1120
|
{
|
|
949
1121
|
role: "alert",
|
|
950
1122
|
className: "rounded-md bg-error-50 px-3 py-2 text-sm text-error-700",
|
|
951
1123
|
"data-testid": "movmo-card-error",
|
|
952
|
-
children:
|
|
1124
|
+
children: ye
|
|
953
1125
|
}
|
|
954
1126
|
) : null,
|
|
955
|
-
/* @__PURE__ */
|
|
1127
|
+
!y && !g ? /* @__PURE__ */ a.jsx(
|
|
956
1128
|
"button",
|
|
957
1129
|
{
|
|
958
1130
|
type: "submit",
|
|
959
|
-
disabled: !
|
|
960
|
-
className:
|
|
1131
|
+
disabled: !Q,
|
|
1132
|
+
className: ne(
|
|
961
1133
|
"inline-flex h-11 items-center justify-center rounded-md bg-brand-500 px-4 text-sm font-semibold text-white transition-colors hover:bg-brand-600",
|
|
962
1134
|
"disabled:cursor-not-allowed disabled:bg-grayWarm-300 disabled:text-grayWarm-500"
|
|
963
1135
|
),
|
|
964
1136
|
"data-testid": "movmo-card-save",
|
|
965
|
-
children:
|
|
1137
|
+
children: ae ? "Saving…" : U === "loading" ? "Loading…" : "Save card"
|
|
1138
|
+
}
|
|
1139
|
+
) : ae ? /* @__PURE__ */ a.jsx("p", { className: "text-center text-sm text-grayWarm-500", "data-testid": "movmo-card-autosaving", children: "Saving card…" }) : null
|
|
1140
|
+
]
|
|
1141
|
+
}
|
|
1142
|
+
);
|
|
1143
|
+
};
|
|
1144
|
+
vr.displayName = "MovmoCardForm";
|
|
1145
|
+
const nt = (r) => {
|
|
1146
|
+
const [t, s] = S("idle"), [o, l] = S(null);
|
|
1147
|
+
return { deletePaymentMethod: B(
|
|
1148
|
+
async (d) => {
|
|
1149
|
+
s("pending"), l(null);
|
|
1150
|
+
try {
|
|
1151
|
+
await Kr(r, d), s("idle");
|
|
1152
|
+
} catch (v) {
|
|
1153
|
+
const y = v instanceof Error ? v.message : "Failed to delete payment method.";
|
|
1154
|
+
throw l(y), s("error"), v;
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
[r]
|
|
1158
|
+
), status: t, error: o };
|
|
1159
|
+
}, st = (r) => {
|
|
1160
|
+
const [t, s] = S("idle"), [o, l] = S(null);
|
|
1161
|
+
return { setDefault: B(
|
|
1162
|
+
async (d) => {
|
|
1163
|
+
s("pending"), l(null);
|
|
1164
|
+
try {
|
|
1165
|
+
await qr(r, d, { isDefault: !0 }), s("idle");
|
|
1166
|
+
} catch (v) {
|
|
1167
|
+
const y = v instanceof Error ? v.message : "Failed to set default payment method.";
|
|
1168
|
+
throw l(y), s("error"), v;
|
|
1169
|
+
}
|
|
1170
|
+
},
|
|
1171
|
+
[r]
|
|
1172
|
+
), status: t, error: o };
|
|
1173
|
+
}, ot = (r) => {
|
|
1174
|
+
const [t, s] = S([]), [o, l] = S("idle"), [f, d] = S(null), [v, y] = S(0), T = q(null);
|
|
1175
|
+
X(() => {
|
|
1176
|
+
var F;
|
|
1177
|
+
(F = T.current) == null || F.abort();
|
|
1178
|
+
const w = new AbortController();
|
|
1179
|
+
return T.current = w, l("loading"), d(null), Br(r).then((_) => {
|
|
1180
|
+
w.signal.aborted || (s(_), l("ready"));
|
|
1181
|
+
}).catch((_) => {
|
|
1182
|
+
if (w.signal.aborted) return;
|
|
1183
|
+
const D = _ instanceof Error ? _.message : "Failed to fetch payment methods.";
|
|
1184
|
+
d(D), l("error");
|
|
1185
|
+
}), () => {
|
|
1186
|
+
w.abort();
|
|
1187
|
+
};
|
|
1188
|
+
}, [r, v]);
|
|
1189
|
+
const g = B(() => {
|
|
1190
|
+
y((w) => w + 1);
|
|
1191
|
+
}, []);
|
|
1192
|
+
return { items: t, status: o, error: f, refetch: g };
|
|
1193
|
+
}, it = ({
|
|
1194
|
+
open: r,
|
|
1195
|
+
onClose: t,
|
|
1196
|
+
formId: s,
|
|
1197
|
+
saveDisabled: o,
|
|
1198
|
+
saveLabel: l = "Save",
|
|
1199
|
+
children: f
|
|
1200
|
+
}) => (X(() => {
|
|
1201
|
+
if (!r) return;
|
|
1202
|
+
const d = (v) => {
|
|
1203
|
+
v.key === "Escape" && t();
|
|
1204
|
+
};
|
|
1205
|
+
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
1206
|
+
}, [r, t]), X(() => {
|
|
1207
|
+
if (!r) return;
|
|
1208
|
+
const d = document.body.style.overflow;
|
|
1209
|
+
return document.body.style.overflow = "hidden", () => {
|
|
1210
|
+
document.body.style.overflow = d;
|
|
1211
|
+
};
|
|
1212
|
+
}, [r]), r ? /* @__PURE__ */ a.jsx(
|
|
1213
|
+
"div",
|
|
1214
|
+
{
|
|
1215
|
+
role: "dialog",
|
|
1216
|
+
"aria-modal": "true",
|
|
1217
|
+
"aria-labelledby": "movmo-add-payment-title",
|
|
1218
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",
|
|
1219
|
+
onClick: (d) => {
|
|
1220
|
+
d.target === d.currentTarget && t();
|
|
1221
|
+
},
|
|
1222
|
+
"data-testid": "add-payment-method-modal",
|
|
1223
|
+
children: /* @__PURE__ */ a.jsxs("div", { className: "flex max-h-full w-full max-w-md flex-col rounded-xl bg-white shadow-2xl", children: [
|
|
1224
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-3 border-b border-grayWarm-200 px-4 py-3", children: [
|
|
1225
|
+
/* @__PURE__ */ a.jsx(
|
|
1226
|
+
"button",
|
|
1227
|
+
{
|
|
1228
|
+
type: "button",
|
|
1229
|
+
onClick: t,
|
|
1230
|
+
"aria-label": "Close add-payment dialog",
|
|
1231
|
+
className: "flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border border-grayWarm-200 text-grayWarm-700 hover:bg-grayWarm-100",
|
|
1232
|
+
"data-testid": "add-payment-method-close",
|
|
1233
|
+
children: /* @__PURE__ */ a.jsx("svg", { viewBox: "0 0 16 16", width: "14", height: "14", "aria-hidden": "true", children: /* @__PURE__ */ a.jsx(
|
|
1234
|
+
"path",
|
|
1235
|
+
{
|
|
1236
|
+
d: "M3 3L13 13M13 3L3 13",
|
|
1237
|
+
stroke: "currentColor",
|
|
1238
|
+
strokeWidth: "1.75",
|
|
1239
|
+
strokeLinecap: "round"
|
|
1240
|
+
}
|
|
1241
|
+
) })
|
|
1242
|
+
}
|
|
1243
|
+
),
|
|
1244
|
+
/* @__PURE__ */ a.jsx(
|
|
1245
|
+
"h2",
|
|
1246
|
+
{
|
|
1247
|
+
id: "movmo-add-payment-title",
|
|
1248
|
+
className: "flex-1 text-center text-base font-semibold text-grayWarm-900",
|
|
1249
|
+
children: "Add payment method"
|
|
1250
|
+
}
|
|
1251
|
+
),
|
|
1252
|
+
/* @__PURE__ */ a.jsx("span", { "aria-hidden": "true", className: "h-8 w-8 flex-shrink-0" })
|
|
1253
|
+
] }),
|
|
1254
|
+
/* @__PURE__ */ a.jsx("div", { className: "flex-1 overflow-y-auto p-4", children: f }),
|
|
1255
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex gap-3 border-t border-grayWarm-200 p-4", children: [
|
|
1256
|
+
/* @__PURE__ */ a.jsx(
|
|
1257
|
+
"button",
|
|
1258
|
+
{
|
|
1259
|
+
type: "button",
|
|
1260
|
+
onClick: t,
|
|
1261
|
+
className: "inline-flex h-11 flex-1 items-center justify-center rounded-lg border border-grayWarm-300 px-4 text-sm font-semibold text-grayWarm-900 transition-colors hover:border-grayWarm-900 hover:shadow-[0_0_0_1px_#1c1917]",
|
|
1262
|
+
"data-testid": "add-payment-method-cancel",
|
|
1263
|
+
children: "Cancel"
|
|
1264
|
+
}
|
|
1265
|
+
),
|
|
1266
|
+
/* @__PURE__ */ a.jsx(
|
|
1267
|
+
"button",
|
|
1268
|
+
{
|
|
1269
|
+
type: "submit",
|
|
1270
|
+
form: s,
|
|
1271
|
+
disabled: o,
|
|
1272
|
+
className: ne(
|
|
1273
|
+
"inline-flex h-11 flex-1 items-center justify-center rounded-lg bg-brand-500 px-4 text-sm font-semibold text-white transition-colors hover:bg-brand-600",
|
|
1274
|
+
"disabled:cursor-not-allowed disabled:bg-grayWarm-300 disabled:text-grayWarm-500"
|
|
1275
|
+
),
|
|
1276
|
+
"data-testid": "add-payment-method-save",
|
|
1277
|
+
children: l
|
|
1278
|
+
}
|
|
1279
|
+
)
|
|
1280
|
+
] })
|
|
1281
|
+
] })
|
|
1282
|
+
}
|
|
1283
|
+
) : null), lt = (r, t, s = /* @__PURE__ */ new Date()) => t < s.getFullYear() || t === s.getFullYear() && r < s.getMonth() + 1, ir = (r) => {
|
|
1284
|
+
const t = r.toLowerCase();
|
|
1285
|
+
return t === "amex" ? "Amex" : t ? t.charAt(0).toUpperCase() + t.slice(1) : "Card";
|
|
1286
|
+
}, ct = (r, t) => `${String(r).padStart(2, "0")}/${t}`, dt = ({
|
|
1287
|
+
method: r,
|
|
1288
|
+
selectable: t,
|
|
1289
|
+
selected: s,
|
|
1290
|
+
onSelect: o,
|
|
1291
|
+
onSetDefault: l,
|
|
1292
|
+
onRemove: f,
|
|
1293
|
+
disabled: d,
|
|
1294
|
+
showDefaultBadge: v,
|
|
1295
|
+
hideSetDefaultMenuItem: y
|
|
1296
|
+
}) => {
|
|
1297
|
+
const [T, g] = S(!1), w = q(null), F = lt(r.expMonth, r.expYear);
|
|
1298
|
+
X(() => {
|
|
1299
|
+
if (!T) return;
|
|
1300
|
+
const D = (R) => {
|
|
1301
|
+
var G;
|
|
1302
|
+
(G = w.current) != null && G.contains(R.target) || g(!1);
|
|
1303
|
+
};
|
|
1304
|
+
return document.addEventListener("mousedown", D), () => document.removeEventListener("mousedown", D);
|
|
1305
|
+
}, [T]);
|
|
1306
|
+
const _ = () => {
|
|
1307
|
+
t && o && !d && o(r);
|
|
1308
|
+
};
|
|
1309
|
+
return /* @__PURE__ */ a.jsxs(
|
|
1310
|
+
"div",
|
|
1311
|
+
{
|
|
1312
|
+
className: ne(
|
|
1313
|
+
"flex items-center gap-3 rounded-lg border px-3 py-3 transition-colors",
|
|
1314
|
+
t && !d && "cursor-pointer",
|
|
1315
|
+
s ? "border-grayWarm-950 shadow-[0_0_0_1px_#1c1917]" : "border-grayWarm-200 hover:border-grayWarm-300"
|
|
1316
|
+
),
|
|
1317
|
+
onClick: _,
|
|
1318
|
+
"data-testid": `payment-method-row-${r.id}`,
|
|
1319
|
+
children: [
|
|
1320
|
+
t ? /* @__PURE__ */ a.jsx(
|
|
1321
|
+
"input",
|
|
1322
|
+
{
|
|
1323
|
+
type: "radio",
|
|
1324
|
+
name: "movmo-payment-method",
|
|
1325
|
+
checked: s,
|
|
1326
|
+
onChange: () => o == null ? void 0 : o(r),
|
|
1327
|
+
onClick: (D) => D.stopPropagation(),
|
|
1328
|
+
"aria-label": `Select ${ir(r.brand)} ending ${r.last4}`,
|
|
1329
|
+
className: "h-4 w-4 cursor-pointer accent-grayWarm-950",
|
|
1330
|
+
disabled: d
|
|
1331
|
+
}
|
|
1332
|
+
) : null,
|
|
1333
|
+
/* @__PURE__ */ a.jsx(be, { brand: r.brand, className: "flex-shrink-0" }),
|
|
1334
|
+
/* @__PURE__ */ a.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1335
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1336
|
+
/* @__PURE__ */ a.jsxs("span", { className: "text-base font-semibold text-grayWarm-900", children: [
|
|
1337
|
+
ir(r.brand),
|
|
1338
|
+
" ••••",
|
|
1339
|
+
r.last4
|
|
1340
|
+
] }),
|
|
1341
|
+
v && r.isDefault ? /* @__PURE__ */ a.jsx(
|
|
1342
|
+
"span",
|
|
1343
|
+
{
|
|
1344
|
+
className: "inline-flex items-center rounded-full bg-success-50 px-2 py-0.5 text-xs font-medium text-success-700",
|
|
1345
|
+
"data-testid": `badge-default-${r.id}`,
|
|
1346
|
+
children: "Default"
|
|
1347
|
+
}
|
|
1348
|
+
) : null,
|
|
1349
|
+
F ? /* @__PURE__ */ a.jsx(
|
|
1350
|
+
"span",
|
|
1351
|
+
{
|
|
1352
|
+
className: "inline-flex items-center rounded-full bg-error-50 px-2 py-0.5 text-xs font-medium text-error-700",
|
|
1353
|
+
"data-testid": `badge-expired-${r.id}`,
|
|
1354
|
+
children: "Expired"
|
|
1355
|
+
}
|
|
1356
|
+
) : null
|
|
1357
|
+
] }),
|
|
1358
|
+
/* @__PURE__ */ a.jsxs("div", { className: ne("text-sm", F ? "text-grayWarm-400" : "text-grayWarm-600"), children: [
|
|
1359
|
+
"Exp. ",
|
|
1360
|
+
ct(r.expMonth, r.expYear)
|
|
1361
|
+
] })
|
|
1362
|
+
] }),
|
|
1363
|
+
/* @__PURE__ */ a.jsxs("div", { className: "relative flex-shrink-0", ref: w, children: [
|
|
1364
|
+
/* @__PURE__ */ a.jsx(
|
|
1365
|
+
"button",
|
|
1366
|
+
{
|
|
1367
|
+
type: "button",
|
|
1368
|
+
"aria-label": `Open actions for card ending ${r.last4}`,
|
|
1369
|
+
"aria-haspopup": "menu",
|
|
1370
|
+
"aria-expanded": T,
|
|
1371
|
+
className: "rounded-lg p-2 text-grayWarm-600 transition-colors hover:bg-grayWarm-100 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1372
|
+
disabled: d,
|
|
1373
|
+
onClick: (D) => {
|
|
1374
|
+
D.stopPropagation(), g((R) => !R);
|
|
1375
|
+
},
|
|
1376
|
+
"data-testid": `menu-trigger-${r.id}`,
|
|
1377
|
+
children: /* @__PURE__ */ a.jsxs("svg", { viewBox: "0 0 16 16", width: "16", height: "16", "aria-hidden": "true", children: [
|
|
1378
|
+
/* @__PURE__ */ a.jsx("circle", { cx: "3", cy: "8", r: "1.5", fill: "currentColor" }),
|
|
1379
|
+
/* @__PURE__ */ a.jsx("circle", { cx: "8", cy: "8", r: "1.5", fill: "currentColor" }),
|
|
1380
|
+
/* @__PURE__ */ a.jsx("circle", { cx: "13", cy: "8", r: "1.5", fill: "currentColor" })
|
|
1381
|
+
] })
|
|
1382
|
+
}
|
|
1383
|
+
),
|
|
1384
|
+
T ? /* @__PURE__ */ a.jsxs(
|
|
1385
|
+
"div",
|
|
1386
|
+
{
|
|
1387
|
+
role: "menu",
|
|
1388
|
+
className: "absolute right-0 top-full z-10 mt-1 min-w-[160px] rounded-lg border border-grayWarm-200 bg-white py-1 shadow-lg",
|
|
1389
|
+
onClick: (D) => D.stopPropagation(),
|
|
1390
|
+
"data-testid": `menu-${r.id}`,
|
|
1391
|
+
children: [
|
|
1392
|
+
!r.isDefault && !y ? /* @__PURE__ */ a.jsx(
|
|
1393
|
+
"button",
|
|
1394
|
+
{
|
|
1395
|
+
type: "button",
|
|
1396
|
+
role: "menuitem",
|
|
1397
|
+
className: "block w-full px-4 py-2 text-left text-sm text-grayWarm-700 hover:bg-grayWarm-100",
|
|
1398
|
+
onClick: () => {
|
|
1399
|
+
g(!1), l(r);
|
|
1400
|
+
},
|
|
1401
|
+
"data-testid": `menu-set-default-${r.id}`,
|
|
1402
|
+
children: "Set as default"
|
|
1403
|
+
}
|
|
1404
|
+
) : null,
|
|
1405
|
+
/* @__PURE__ */ a.jsx(
|
|
1406
|
+
"button",
|
|
1407
|
+
{
|
|
1408
|
+
type: "button",
|
|
1409
|
+
role: "menuitem",
|
|
1410
|
+
className: "block w-full px-4 py-2 text-left text-sm text-error-700 hover:bg-error-50",
|
|
1411
|
+
onClick: () => {
|
|
1412
|
+
g(!1), f(r);
|
|
1413
|
+
},
|
|
1414
|
+
"data-testid": `menu-remove-${r.id}`,
|
|
1415
|
+
children: "Remove"
|
|
1416
|
+
}
|
|
1417
|
+
)
|
|
1418
|
+
]
|
|
1419
|
+
}
|
|
1420
|
+
) : null
|
|
1421
|
+
] })
|
|
1422
|
+
]
|
|
1423
|
+
}
|
|
1424
|
+
);
|
|
1425
|
+
}, ut = (r) => `${Fe().iconCdnBaseUrl}/website/assets/icons/payments/${r}.svg`, Ve = ({ slug: r, alt: t }) => /* @__PURE__ */ a.jsx(
|
|
1426
|
+
"img",
|
|
1427
|
+
{
|
|
1428
|
+
src: ut(r),
|
|
1429
|
+
alt: t,
|
|
1430
|
+
height: 20,
|
|
1431
|
+
loading: "lazy",
|
|
1432
|
+
style: { height: 20, width: "auto" }
|
|
1433
|
+
}
|
|
1434
|
+
), Oe = ({
|
|
1435
|
+
type: r,
|
|
1436
|
+
label: t,
|
|
1437
|
+
iconNode: s
|
|
1438
|
+
}) => (
|
|
1439
|
+
// Alt payment types are visible + clickable but don't yet do anything —
|
|
1440
|
+
// the click is intentionally a no-op so the row looks identical to the
|
|
1441
|
+
// (future) functional state without faking selection.
|
|
1442
|
+
/* @__PURE__ */ a.jsxs(
|
|
1443
|
+
"label",
|
|
1444
|
+
{
|
|
1445
|
+
className: "flex cursor-pointer items-center gap-3 rounded-lg border border-grayWarm-200 px-4 py-3 transition-colors hover:border-grayWarm-300",
|
|
1446
|
+
"data-testid": `payment-type-${r}`,
|
|
1447
|
+
children: [
|
|
1448
|
+
/* @__PURE__ */ a.jsx(
|
|
1449
|
+
"input",
|
|
1450
|
+
{
|
|
1451
|
+
type: "radio",
|
|
1452
|
+
name: "movmo-payment-type",
|
|
1453
|
+
value: r,
|
|
1454
|
+
onChange: () => {
|
|
1455
|
+
},
|
|
1456
|
+
className: "h-4 w-4 cursor-pointer accent-grayWarm-900",
|
|
1457
|
+
"aria-label": t
|
|
1458
|
+
}
|
|
1459
|
+
),
|
|
1460
|
+
/* @__PURE__ */ a.jsxs("span", { className: "flex flex-1 items-center gap-2 text-sm font-semibold text-grayWarm-900", children: [
|
|
1461
|
+
t,
|
|
1462
|
+
s
|
|
1463
|
+
] })
|
|
1464
|
+
]
|
|
1465
|
+
}
|
|
1466
|
+
)
|
|
1467
|
+
), lr = ({
|
|
1468
|
+
selected: r,
|
|
1469
|
+
onSelect: t,
|
|
1470
|
+
creditCardBody: s,
|
|
1471
|
+
className: o
|
|
1472
|
+
}) => {
|
|
1473
|
+
const l = r === "credit_card";
|
|
1474
|
+
return /* @__PURE__ */ a.jsxs("div", { className: ne("flex w-full flex-col gap-3", o), children: [
|
|
1475
|
+
/* @__PURE__ */ a.jsxs(
|
|
1476
|
+
"label",
|
|
1477
|
+
{
|
|
1478
|
+
className: ne(
|
|
1479
|
+
"flex cursor-pointer flex-col gap-3 rounded-lg border px-4 py-3 transition-colors",
|
|
1480
|
+
l ? "border-grayWarm-900 shadow-[0_0_0_1px_#1c1917]" : "border-grayWarm-200"
|
|
1481
|
+
),
|
|
1482
|
+
"data-testid": "payment-type-credit_card",
|
|
1483
|
+
children: [
|
|
1484
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1485
|
+
/* @__PURE__ */ a.jsx(
|
|
1486
|
+
"input",
|
|
1487
|
+
{
|
|
1488
|
+
type: "radio",
|
|
1489
|
+
name: "movmo-payment-type",
|
|
1490
|
+
value: "credit_card",
|
|
1491
|
+
checked: l,
|
|
1492
|
+
onChange: () => t("credit_card"),
|
|
1493
|
+
className: "h-4 w-4 cursor-pointer accent-grayWarm-900",
|
|
1494
|
+
"aria-label": "Credit card"
|
|
1495
|
+
}
|
|
1496
|
+
),
|
|
1497
|
+
/* @__PURE__ */ a.jsx("span", { className: "flex-1 text-sm font-semibold text-grayWarm-900", children: "Credit card" }),
|
|
1498
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
1499
|
+
/* @__PURE__ */ a.jsx(be, { brand: "mastercard", width: 28 }),
|
|
1500
|
+
/* @__PURE__ */ a.jsx(be, { brand: "visa", width: 28 }),
|
|
1501
|
+
/* @__PURE__ */ a.jsx(be, { brand: "amex", width: 28 }),
|
|
1502
|
+
/* @__PURE__ */ a.jsx(be, { brand: "discover", width: 28 })
|
|
1503
|
+
] })
|
|
1504
|
+
] }),
|
|
1505
|
+
l ? /* @__PURE__ */ a.jsx("div", { "data-testid": "payment-type-credit_card-body", children: s }) : null
|
|
1506
|
+
]
|
|
1507
|
+
}
|
|
1508
|
+
),
|
|
1509
|
+
l ? /* @__PURE__ */ a.jsx(
|
|
1510
|
+
"p",
|
|
1511
|
+
{
|
|
1512
|
+
className: "mt-2 text-sm font-semibold text-grayWarm-900",
|
|
1513
|
+
"data-testid": "payment-type-other-options-header",
|
|
1514
|
+
children: "Other options"
|
|
1515
|
+
}
|
|
1516
|
+
) : null,
|
|
1517
|
+
/* @__PURE__ */ a.jsx(
|
|
1518
|
+
Oe,
|
|
1519
|
+
{
|
|
1520
|
+
type: "paypal",
|
|
1521
|
+
label: "PayPal",
|
|
1522
|
+
iconNode: /* @__PURE__ */ a.jsx(Ve, { slug: "paypal", alt: "PayPal" })
|
|
1523
|
+
}
|
|
1524
|
+
),
|
|
1525
|
+
/* @__PURE__ */ a.jsx(
|
|
1526
|
+
Oe,
|
|
1527
|
+
{
|
|
1528
|
+
type: "googlepay",
|
|
1529
|
+
label: "GooglePay",
|
|
1530
|
+
iconNode: /* @__PURE__ */ a.jsx(Ve, { slug: "google-pay", alt: "GooglePay" })
|
|
1531
|
+
}
|
|
1532
|
+
),
|
|
1533
|
+
/* @__PURE__ */ a.jsx(
|
|
1534
|
+
Oe,
|
|
1535
|
+
{
|
|
1536
|
+
type: "klarna",
|
|
1537
|
+
label: "Klarna",
|
|
1538
|
+
iconNode: /* @__PURE__ */ a.jsx(Ve, { slug: "klarna", alt: "Klarna" })
|
|
1539
|
+
}
|
|
1540
|
+
),
|
|
1541
|
+
/* @__PURE__ */ a.jsx(
|
|
1542
|
+
Oe,
|
|
1543
|
+
{
|
|
1544
|
+
type: "ach",
|
|
1545
|
+
label: "Bank account (ACH)",
|
|
1546
|
+
iconNode: /* @__PURE__ */ a.jsx("span", { className: "text-xs font-medium text-grayWarm-500", children: "Direct debit" })
|
|
1547
|
+
}
|
|
1548
|
+
)
|
|
1549
|
+
] });
|
|
1550
|
+
}, cr = "movmo-add-payment-form", dr = (r) => {
|
|
1551
|
+
const t = r.filter((o) => o.isDefault), s = r.filter((o) => !o.isDefault);
|
|
1552
|
+
return [...t, ...s];
|
|
1553
|
+
}, ur = () => /* @__PURE__ */ a.jsxs(
|
|
1554
|
+
"div",
|
|
1555
|
+
{
|
|
1556
|
+
className: "flex items-center gap-3 rounded-lg border border-grayWarm-200 px-3 py-3",
|
|
1557
|
+
"data-testid": "payment-method-skeleton",
|
|
1558
|
+
children: [
|
|
1559
|
+
/* @__PURE__ */ a.jsx("div", { className: "h-8 w-[46px] flex-shrink-0 animate-pulse rounded bg-grayWarm-200" }),
|
|
1560
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
1561
|
+
/* @__PURE__ */ a.jsx("div", { className: "h-4 w-32 animate-pulse rounded bg-grayWarm-200" }),
|
|
1562
|
+
/* @__PURE__ */ a.jsx("div", { className: "h-3 w-20 animate-pulse rounded bg-grayWarm-200" })
|
|
1563
|
+
] }),
|
|
1564
|
+
/* @__PURE__ */ a.jsx("div", { className: "h-8 w-8 animate-pulse rounded bg-grayWarm-200" })
|
|
1565
|
+
]
|
|
1566
|
+
}
|
|
1567
|
+
), ft = ({
|
|
1568
|
+
userId: r,
|
|
1569
|
+
defaultCardholderName: t,
|
|
1570
|
+
defaultCardholderFirstName: s,
|
|
1571
|
+
defaultCardholderLastName: o,
|
|
1572
|
+
selectedId: l,
|
|
1573
|
+
onSelect: f,
|
|
1574
|
+
onChange: d,
|
|
1575
|
+
paymentTypeSelector: v = !0,
|
|
1576
|
+
autoSaveFirstCard: y = !0,
|
|
1577
|
+
selectionSetsDefault: T = !1,
|
|
1578
|
+
showDefaultBadge: g = !0,
|
|
1579
|
+
className: w
|
|
1580
|
+
}) => {
|
|
1581
|
+
const { items: F, status: _, error: D, refetch: R } = ot(r), { deletePaymentMethod: G, status: O } = nt(r), { setDefault: C, status: J } = st(r), [W, se] = S([]), [oe, A] = S(null), [x, b] = S(!1), [I, U] = S(null), [ie, z] = S(!1), [N, Y] = S(null), ue = B(() => {
|
|
1582
|
+
b(!1), U(null), Y(null);
|
|
1583
|
+
}, []), V = t ?? ([s, o].filter(Boolean).join(" ") || void 0);
|
|
1584
|
+
X(() => {
|
|
1585
|
+
_ === "ready" && se(dr(F));
|
|
1586
|
+
}, [F, _]);
|
|
1587
|
+
const k = B(
|
|
1588
|
+
(c) => {
|
|
1589
|
+
se((E) => {
|
|
1590
|
+
const $ = typeof c == "function" ? c(E) : c, H = dr($);
|
|
1591
|
+
return d == null || d(H), H;
|
|
1592
|
+
});
|
|
1593
|
+
},
|
|
1594
|
+
[d]
|
|
1595
|
+
), le = O === "pending" || J === "pending", ce = B(
|
|
1596
|
+
async (c) => {
|
|
1597
|
+
const E = W;
|
|
1598
|
+
A(null), k(($) => $.map((H) => ({ ...H, isDefault: H.id === c.id })));
|
|
1599
|
+
try {
|
|
1600
|
+
await C(c.id), R();
|
|
1601
|
+
} catch ($) {
|
|
1602
|
+
se(E), d == null || d(E);
|
|
1603
|
+
const H = $ instanceof Error ? $.message : "Failed to set default payment method.";
|
|
1604
|
+
A(H);
|
|
1605
|
+
}
|
|
1606
|
+
},
|
|
1607
|
+
[W, k, C, R, d]
|
|
1608
|
+
), fe = B(
|
|
1609
|
+
(c) => {
|
|
1610
|
+
f == null || f(c), T && (c.isDefault || ce(c));
|
|
1611
|
+
},
|
|
1612
|
+
[f, T, ce]
|
|
1613
|
+
), me = B(
|
|
1614
|
+
async (c) => {
|
|
1615
|
+
const E = W;
|
|
1616
|
+
A(null), k(($) => $.filter((H) => H.id !== c.id));
|
|
1617
|
+
try {
|
|
1618
|
+
await G(c.id), R();
|
|
1619
|
+
} catch ($) {
|
|
1620
|
+
se(E), d == null || d(E);
|
|
1621
|
+
const H = $ instanceof Error ? $.message : "Failed to delete payment method.";
|
|
1622
|
+
A(H);
|
|
1623
|
+
}
|
|
1624
|
+
},
|
|
1625
|
+
[W, k, G, R, d]
|
|
1626
|
+
), pe = B(
|
|
1627
|
+
(c) => {
|
|
1628
|
+
U(null), b(!1), Y(null), k((E) => [c, ...E.filter(($) => $.id !== c.id)]), R();
|
|
1629
|
+
},
|
|
1630
|
+
[k, R]
|
|
1631
|
+
), he = B((c) => {
|
|
1632
|
+
U(c);
|
|
1633
|
+
}, []), Ee = _ === "ready" && W.length === 0, ae = typeof f == "function", Q = W.length === 0, ee = y && W.length === 0, re = B(
|
|
1634
|
+
(c) => /* @__PURE__ */ a.jsx(
|
|
1635
|
+
vr,
|
|
1636
|
+
{
|
|
1637
|
+
userId: r,
|
|
1638
|
+
isDefault: Q,
|
|
1639
|
+
defaultCardholderName: V,
|
|
1640
|
+
autoSave: !c && ee,
|
|
1641
|
+
hideInternalSaveButton: c,
|
|
1642
|
+
formId: c ? cr : void 0,
|
|
1643
|
+
onCanSubmitChange: c ? z : void 0,
|
|
1644
|
+
onSuccess: pe,
|
|
1645
|
+
onError: he
|
|
1646
|
+
}
|
|
1647
|
+
),
|
|
1648
|
+
[r, Q, V, ee, pe, he]
|
|
1649
|
+
), de = Ce(() => re(!1), [re]), ye = Ce(() => re(!0), [re]), ve = Ce(() => v ? /* @__PURE__ */ a.jsx(
|
|
1650
|
+
lr,
|
|
1651
|
+
{
|
|
1652
|
+
selected: N,
|
|
1653
|
+
onSelect: (c) => Y(c),
|
|
1654
|
+
creditCardBody: de
|
|
1655
|
+
}
|
|
1656
|
+
) : de, [v, N, de]), P = Ce(() => v ? /* @__PURE__ */ a.jsx(
|
|
1657
|
+
lr,
|
|
1658
|
+
{
|
|
1659
|
+
selected: N,
|
|
1660
|
+
onSelect: (c) => Y(c),
|
|
1661
|
+
creditCardBody: ye
|
|
1662
|
+
}
|
|
1663
|
+
) : ye, [v, N, ye]);
|
|
1664
|
+
return /* @__PURE__ */ a.jsxs(
|
|
1665
|
+
"div",
|
|
1666
|
+
{
|
|
1667
|
+
className: ne("flex w-full flex-col gap-4", w),
|
|
1668
|
+
"data-testid": "payment-methods-manager",
|
|
1669
|
+
children: [
|
|
1670
|
+
_ === "loading" ? /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col gap-2", "data-testid": "payment-methods-loading", children: [
|
|
1671
|
+
/* @__PURE__ */ a.jsx(ur, {}),
|
|
1672
|
+
/* @__PURE__ */ a.jsx(ur, {})
|
|
1673
|
+
] }) : null,
|
|
1674
|
+
_ === "error" ? /* @__PURE__ */ a.jsxs(
|
|
1675
|
+
"div",
|
|
1676
|
+
{
|
|
1677
|
+
role: "alert",
|
|
1678
|
+
className: "flex items-center justify-between gap-3 rounded-md bg-error-50 p-3 text-sm text-error-700",
|
|
1679
|
+
"data-testid": "payment-methods-list-error",
|
|
1680
|
+
children: [
|
|
1681
|
+
/* @__PURE__ */ a.jsx("span", { children: D ?? "Failed to load payment methods." }),
|
|
1682
|
+
/* @__PURE__ */ a.jsx(
|
|
1683
|
+
"button",
|
|
1684
|
+
{
|
|
1685
|
+
type: "button",
|
|
1686
|
+
onClick: R,
|
|
1687
|
+
className: "rounded-md border border-error-700 px-3 py-1 text-xs font-semibold text-error-700 hover:bg-error-50",
|
|
1688
|
+
children: "Retry"
|
|
1689
|
+
}
|
|
1690
|
+
)
|
|
1691
|
+
]
|
|
1692
|
+
}
|
|
1693
|
+
) : null,
|
|
1694
|
+
oe ? /* @__PURE__ */ a.jsx(
|
|
1695
|
+
"div",
|
|
1696
|
+
{
|
|
1697
|
+
role: "alert",
|
|
1698
|
+
className: "rounded-md bg-error-50 p-3 text-sm text-error-700",
|
|
1699
|
+
"data-testid": "payment-methods-mutation-error",
|
|
1700
|
+
children: oe
|
|
1701
|
+
}
|
|
1702
|
+
) : null,
|
|
1703
|
+
_ === "ready" && W.length > 0 ? /* @__PURE__ */ a.jsx("div", { className: "flex flex-col gap-2", children: W.map((c) => /* @__PURE__ */ a.jsx(
|
|
1704
|
+
dt,
|
|
1705
|
+
{
|
|
1706
|
+
method: c,
|
|
1707
|
+
selectable: ae,
|
|
1708
|
+
selected: ae && c.id === l,
|
|
1709
|
+
onSelect: fe,
|
|
1710
|
+
onSetDefault: ce,
|
|
1711
|
+
onRemove: me,
|
|
1712
|
+
disabled: le,
|
|
1713
|
+
showDefaultBadge: g,
|
|
1714
|
+
hideSetDefaultMenuItem: T
|
|
1715
|
+
},
|
|
1716
|
+
c.id
|
|
1717
|
+
)) }) : null,
|
|
1718
|
+
Ee ? (
|
|
1719
|
+
// Empty state: render the add-card body inline (per Figma 1536-21454).
|
|
1720
|
+
/* @__PURE__ */ a.jsx("div", { "data-testid": "payment-methods-empty", children: ve })
|
|
1721
|
+
) : _ === "ready" ? /* @__PURE__ */ a.jsx(
|
|
1722
|
+
"button",
|
|
1723
|
+
{
|
|
1724
|
+
type: "button",
|
|
1725
|
+
onClick: () => {
|
|
1726
|
+
U(null), Y(null), z(!1), b(!0);
|
|
1727
|
+
},
|
|
1728
|
+
className: "self-start rounded-lg bg-brand-50 px-6 py-3 text-md font-semibold text-brand-600 transition-colors hover:bg-brand-100",
|
|
1729
|
+
"data-testid": "payment-methods-add-trigger",
|
|
1730
|
+
children: "Add payment method"
|
|
1731
|
+
}
|
|
1732
|
+
) : null,
|
|
1733
|
+
/* @__PURE__ */ a.jsxs(
|
|
1734
|
+
it,
|
|
1735
|
+
{
|
|
1736
|
+
open: x,
|
|
1737
|
+
onClose: ue,
|
|
1738
|
+
formId: cr,
|
|
1739
|
+
saveDisabled: !ie,
|
|
1740
|
+
children: [
|
|
1741
|
+
P,
|
|
1742
|
+
I ? /* @__PURE__ */ a.jsx(
|
|
1743
|
+
"p",
|
|
1744
|
+
{
|
|
1745
|
+
role: "alert",
|
|
1746
|
+
className: "mt-3 rounded-md bg-error-50 px-3 py-2 text-sm text-error-700",
|
|
1747
|
+
"data-testid": "payment-methods-modal-error",
|
|
1748
|
+
children: I
|
|
1749
|
+
}
|
|
1750
|
+
) : null
|
|
1751
|
+
]
|
|
966
1752
|
}
|
|
967
1753
|
)
|
|
968
1754
|
]
|
|
969
1755
|
}
|
|
970
1756
|
);
|
|
971
1757
|
};
|
|
972
|
-
|
|
1758
|
+
ft.displayName = "PaymentMethodsManager";
|
|
1759
|
+
const mt = (r) => {
|
|
1760
|
+
const t = r.toLowerCase();
|
|
1761
|
+
return t === "amex" ? "Amex" : t ? t.charAt(0).toUpperCase() + t.slice(1) : "Card";
|
|
1762
|
+
}, vt = ({
|
|
1763
|
+
method: r,
|
|
1764
|
+
trailing: t,
|
|
1765
|
+
onClick: s,
|
|
1766
|
+
className: o
|
|
1767
|
+
}) => /* @__PURE__ */ a.jsxs(
|
|
1768
|
+
"div",
|
|
1769
|
+
{
|
|
1770
|
+
className: ne("flex items-center gap-3 py-2", s && "cursor-pointer", o),
|
|
1771
|
+
onClick: s,
|
|
1772
|
+
role: s ? "button" : void 0,
|
|
1773
|
+
tabIndex: s ? 0 : void 0,
|
|
1774
|
+
onKeyDown: s ? (l) => {
|
|
1775
|
+
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), s());
|
|
1776
|
+
} : void 0,
|
|
1777
|
+
"data-testid": `payment-method-preview-${r.id}`,
|
|
1778
|
+
children: [
|
|
1779
|
+
/* @__PURE__ */ a.jsx(be, { brand: r.brand, className: "flex-shrink-0" }),
|
|
1780
|
+
/* @__PURE__ */ a.jsxs("span", { className: "flex-1 text-base font-semibold text-grayWarm-900", children: [
|
|
1781
|
+
mt(r.brand),
|
|
1782
|
+
" ",
|
|
1783
|
+
r.last4
|
|
1784
|
+
] }),
|
|
1785
|
+
t
|
|
1786
|
+
]
|
|
1787
|
+
}
|
|
1788
|
+
);
|
|
973
1789
|
export {
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
1790
|
+
vr as MovmoCardForm,
|
|
1791
|
+
vt as PaymentMethodPreview,
|
|
1792
|
+
ft as PaymentMethodsManager,
|
|
1793
|
+
Fe as getPaymentsConfig,
|
|
1794
|
+
yt as setPaymentsConfig,
|
|
1795
|
+
nt as useDeletePaymentMethod,
|
|
1796
|
+
et as useMovmoCardFields,
|
|
1797
|
+
st as useSetDefaultPaymentMethod,
|
|
1798
|
+
ot as useUserPaymentMethods
|
|
978
1799
|
};
|
|
979
1800
|
//# sourceMappingURL=index.es.js.map
|