@movmo_app/payments 0.5.1 → 0.6.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/dist/index.cjs.js +10 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.es.js +814 -795
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Gr = Object.defineProperty;
|
|
2
2
|
var Hr = (r, t, n) => t in r ? Gr(r, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[t] = n;
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
var
|
|
3
|
+
var mr = (r, t, n) => Hr(r, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import Or, { useState as C, useRef as I, useEffect as D, useCallback as Y, useMemo as Qe, useId as Jr } from "react";
|
|
5
|
+
var xr = { exports: {} }, He = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.min.js
|
|
@@ -12,21 +12,21 @@ var fr = { exports: {} }, Ge = {};
|
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
15
|
+
var _r;
|
|
16
16
|
function Zr() {
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
var r =
|
|
20
|
-
function u(x, m,
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
for (
|
|
24
|
-
if (x && x.defaultProps) for (
|
|
25
|
-
return { $$typeof: t, type: x, key:
|
|
17
|
+
if (_r) return He;
|
|
18
|
+
_r = 1;
|
|
19
|
+
var r = Or, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, i = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
20
|
+
function u(x, m, k) {
|
|
21
|
+
var b, f = {}, y = null, w = null;
|
|
22
|
+
k !== void 0 && (y = "" + k), m.key !== void 0 && (y = "" + m.key), m.ref !== void 0 && (w = m.ref);
|
|
23
|
+
for (b in m) s.call(m, b) && !l.hasOwnProperty(b) && (f[b] = m[b]);
|
|
24
|
+
if (x && x.defaultProps) for (b in m = x.defaultProps, m) f[b] === void 0 && (f[b] = m[b]);
|
|
25
|
+
return { $$typeof: t, type: x, key: y, ref: w, props: f, _owner: i.current };
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return He.Fragment = n, He.jsx = u, He.jsxs = u, He;
|
|
28
28
|
}
|
|
29
|
-
var
|
|
29
|
+
var Je = {};
|
|
30
30
|
/**
|
|
31
31
|
* @license React
|
|
32
32
|
* react-jsx-runtime.development.js
|
|
@@ -36,57 +36,57 @@ var He = {};
|
|
|
36
36
|
* This source code is licensed under the MIT license found in the
|
|
37
37
|
* LICENSE file in the root directory of this source tree.
|
|
38
38
|
*/
|
|
39
|
-
var
|
|
39
|
+
var Nr;
|
|
40
40
|
function Xr() {
|
|
41
|
-
return
|
|
42
|
-
var r =
|
|
43
|
-
function
|
|
41
|
+
return Nr || (Nr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
42
|
+
var r = Or, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), x = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), k = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), S = Symbol.iterator, le = "@@iterator";
|
|
43
|
+
function O(e) {
|
|
44
44
|
if (e === null || typeof e != "object")
|
|
45
45
|
return null;
|
|
46
|
-
var o =
|
|
46
|
+
var o = S && e[S] || e[le];
|
|
47
47
|
return typeof o == "function" ? o : null;
|
|
48
48
|
}
|
|
49
|
-
var
|
|
50
|
-
function
|
|
49
|
+
var _ = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
50
|
+
function g(e) {
|
|
51
51
|
{
|
|
52
52
|
for (var o = arguments.length, c = new Array(o > 1 ? o - 1 : 0), h = 1; h < o; h++)
|
|
53
53
|
c[h - 1] = arguments[h];
|
|
54
|
-
|
|
54
|
+
q("error", e, c);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function q(e, o, c) {
|
|
58
58
|
{
|
|
59
|
-
var h =
|
|
59
|
+
var h = _.ReactDebugCurrentFrame, F = h.getStackAddendum();
|
|
60
60
|
F !== "" && (o += "%s", c = c.concat([F]));
|
|
61
|
-
var
|
|
62
|
-
return String(
|
|
61
|
+
var $ = c.map(function(N) {
|
|
62
|
+
return String(N);
|
|
63
63
|
});
|
|
64
|
-
|
|
64
|
+
$.unshift("Warning: " + o), Function.prototype.apply.call(console[e], console, $);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
function
|
|
70
|
-
return !!(typeof e == "string" || typeof e == "function" || e === s || e === l ||
|
|
67
|
+
var ae = !1, be = !1, pe = !1, ne = !1, ce = !1, M;
|
|
68
|
+
M = Symbol.for("react.module.reference");
|
|
69
|
+
function j(e) {
|
|
70
|
+
return !!(typeof e == "string" || typeof e == "function" || e === s || e === l || ce || e === i || e === k || e === b || ne || e === w || ae || be || pe || typeof e == "object" && e !== null && (e.$$typeof === y || e.$$typeof === f || e.$$typeof === u || e.$$typeof === x || e.$$typeof === m || // This needs to include all possible module reference object
|
|
71
71
|
// types supported by any Flight configuration anywhere since
|
|
72
72
|
// we don't know which Flight build this will end up being used
|
|
73
73
|
// with.
|
|
74
|
-
e.$$typeof ===
|
|
74
|
+
e.$$typeof === M || e.getModuleId !== void 0));
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function he(e, o, c) {
|
|
77
77
|
var h = e.displayName;
|
|
78
78
|
if (h)
|
|
79
79
|
return h;
|
|
80
80
|
var F = o.displayName || o.name || "";
|
|
81
81
|
return F !== "" ? c + "(" + F + ")" : c;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Ne(e) {
|
|
84
84
|
return e.displayName || "Context";
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function P(e) {
|
|
87
87
|
if (e == null)
|
|
88
88
|
return null;
|
|
89
|
-
if (typeof e.tag == "number" &&
|
|
89
|
+
if (typeof e.tag == "number" && g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
90
90
|
return e.displayName || e.name || null;
|
|
91
91
|
if (typeof e == "string")
|
|
92
92
|
return e;
|
|
@@ -99,28 +99,28 @@ function Xr() {
|
|
|
99
99
|
return "Profiler";
|
|
100
100
|
case i:
|
|
101
101
|
return "StrictMode";
|
|
102
|
-
case
|
|
102
|
+
case k:
|
|
103
103
|
return "Suspense";
|
|
104
|
-
case
|
|
104
|
+
case b:
|
|
105
105
|
return "SuspenseList";
|
|
106
106
|
}
|
|
107
107
|
if (typeof e == "object")
|
|
108
108
|
switch (e.$$typeof) {
|
|
109
109
|
case x:
|
|
110
110
|
var o = e;
|
|
111
|
-
return
|
|
111
|
+
return Ne(o) + ".Consumer";
|
|
112
112
|
case u:
|
|
113
113
|
var c = e;
|
|
114
|
-
return
|
|
114
|
+
return Ne(c._context) + ".Provider";
|
|
115
115
|
case m:
|
|
116
|
-
return
|
|
117
|
-
case
|
|
116
|
+
return he(e, e.render, "ForwardRef");
|
|
117
|
+
case f:
|
|
118
118
|
var h = e.displayName || null;
|
|
119
|
-
return h !== null ? h :
|
|
120
|
-
case
|
|
121
|
-
var F = e,
|
|
119
|
+
return h !== null ? h : P(e.type) || "Memo";
|
|
120
|
+
case y: {
|
|
121
|
+
var F = e, $ = F._payload, N = F._init;
|
|
122
122
|
try {
|
|
123
|
-
return
|
|
123
|
+
return P(N($));
|
|
124
124
|
} catch {
|
|
125
125
|
return null;
|
|
126
126
|
}
|
|
@@ -128,18 +128,18 @@ function Xr() {
|
|
|
128
128
|
}
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
|
-
var
|
|
132
|
-
function
|
|
131
|
+
var v = Object.assign, p = 0, R, L, J, ye, Z, se, X;
|
|
132
|
+
function W() {
|
|
133
133
|
}
|
|
134
|
-
|
|
135
|
-
function
|
|
134
|
+
W.__reactDisabledLog = !0;
|
|
135
|
+
function ee() {
|
|
136
136
|
{
|
|
137
137
|
if (p === 0) {
|
|
138
|
-
|
|
138
|
+
R = console.log, L = console.info, J = console.warn, ye = console.error, Z = console.group, se = console.groupCollapsed, X = console.groupEnd;
|
|
139
139
|
var e = {
|
|
140
140
|
configurable: !0,
|
|
141
141
|
enumerable: !0,
|
|
142
|
-
value:
|
|
142
|
+
value: W,
|
|
143
143
|
writable: !0
|
|
144
144
|
};
|
|
145
145
|
Object.defineProperties(console, {
|
|
@@ -155,7 +155,7 @@ function Xr() {
|
|
|
155
155
|
p++;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Ce() {
|
|
159
159
|
{
|
|
160
160
|
if (p--, p === 0) {
|
|
161
161
|
var e = {
|
|
@@ -164,196 +164,196 @@ function Xr() {
|
|
|
164
164
|
writable: !0
|
|
165
165
|
};
|
|
166
166
|
Object.defineProperties(console, {
|
|
167
|
-
log:
|
|
168
|
-
value:
|
|
167
|
+
log: v({}, e, {
|
|
168
|
+
value: R
|
|
169
169
|
}),
|
|
170
|
-
info:
|
|
171
|
-
value:
|
|
170
|
+
info: v({}, e, {
|
|
171
|
+
value: L
|
|
172
172
|
}),
|
|
173
|
-
warn:
|
|
174
|
-
value:
|
|
173
|
+
warn: v({}, e, {
|
|
174
|
+
value: J
|
|
175
175
|
}),
|
|
176
|
-
error:
|
|
177
|
-
value:
|
|
176
|
+
error: v({}, e, {
|
|
177
|
+
value: ye
|
|
178
178
|
}),
|
|
179
|
-
group:
|
|
180
|
-
value:
|
|
179
|
+
group: v({}, e, {
|
|
180
|
+
value: Z
|
|
181
181
|
}),
|
|
182
|
-
groupCollapsed:
|
|
183
|
-
value:
|
|
182
|
+
groupCollapsed: v({}, e, {
|
|
183
|
+
value: se
|
|
184
184
|
}),
|
|
185
|
-
groupEnd:
|
|
186
|
-
value:
|
|
185
|
+
groupEnd: v({}, e, {
|
|
186
|
+
value: X
|
|
187
187
|
})
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
|
-
p < 0 &&
|
|
190
|
+
p < 0 && g("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
var
|
|
194
|
-
function
|
|
193
|
+
var ve = _.ReactCurrentDispatcher, xe;
|
|
194
|
+
function de(e, o, c) {
|
|
195
195
|
{
|
|
196
|
-
if (
|
|
196
|
+
if (xe === void 0)
|
|
197
197
|
try {
|
|
198
198
|
throw Error();
|
|
199
199
|
} catch (F) {
|
|
200
200
|
var h = F.stack.trim().match(/\n( *(at )?)/);
|
|
201
|
-
|
|
201
|
+
xe = h && h[1] || "";
|
|
202
202
|
}
|
|
203
203
|
return `
|
|
204
|
-
` +
|
|
204
|
+
` + xe + e;
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
var
|
|
207
|
+
var oe = !1, ke;
|
|
208
208
|
{
|
|
209
|
-
var
|
|
210
|
-
|
|
209
|
+
var Oe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
210
|
+
ke = new Oe();
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
if (!e ||
|
|
212
|
+
function ue(e, o) {
|
|
213
|
+
if (!e || oe)
|
|
214
214
|
return "";
|
|
215
215
|
{
|
|
216
|
-
var c =
|
|
216
|
+
var c = ke.get(e);
|
|
217
217
|
if (c !== void 0)
|
|
218
218
|
return c;
|
|
219
219
|
}
|
|
220
220
|
var h;
|
|
221
|
-
|
|
221
|
+
oe = !0;
|
|
222
222
|
var F = Error.prepareStackTrace;
|
|
223
223
|
Error.prepareStackTrace = void 0;
|
|
224
|
-
var
|
|
225
|
-
|
|
224
|
+
var $;
|
|
225
|
+
$ = ve.current, ve.current = null, ee();
|
|
226
226
|
try {
|
|
227
227
|
if (o) {
|
|
228
|
-
var
|
|
228
|
+
var N = function() {
|
|
229
229
|
throw Error();
|
|
230
230
|
};
|
|
231
|
-
if (Object.defineProperty(
|
|
231
|
+
if (Object.defineProperty(N.prototype, "props", {
|
|
232
232
|
set: function() {
|
|
233
233
|
throw Error();
|
|
234
234
|
}
|
|
235
235
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
236
236
|
try {
|
|
237
|
-
Reflect.construct(
|
|
238
|
-
} catch (
|
|
239
|
-
h =
|
|
237
|
+
Reflect.construct(N, []);
|
|
238
|
+
} catch (me) {
|
|
239
|
+
h = me;
|
|
240
240
|
}
|
|
241
|
-
Reflect.construct(e, [],
|
|
241
|
+
Reflect.construct(e, [], N);
|
|
242
242
|
} else {
|
|
243
243
|
try {
|
|
244
|
-
|
|
245
|
-
} catch (
|
|
246
|
-
h =
|
|
244
|
+
N.call();
|
|
245
|
+
} catch (me) {
|
|
246
|
+
h = me;
|
|
247
247
|
}
|
|
248
|
-
e.call(
|
|
248
|
+
e.call(N.prototype);
|
|
249
249
|
}
|
|
250
250
|
} else {
|
|
251
251
|
try {
|
|
252
252
|
throw Error();
|
|
253
|
-
} catch (
|
|
254
|
-
h =
|
|
253
|
+
} catch (me) {
|
|
254
|
+
h = me;
|
|
255
255
|
}
|
|
256
256
|
e();
|
|
257
257
|
}
|
|
258
|
-
} catch (
|
|
259
|
-
if (
|
|
260
|
-
for (var E =
|
|
261
|
-
`),
|
|
262
|
-
`),
|
|
263
|
-
|
|
264
|
-
for (;
|
|
265
|
-
if (E[
|
|
266
|
-
if (
|
|
258
|
+
} catch (me) {
|
|
259
|
+
if (me && h && typeof me.stack == "string") {
|
|
260
|
+
for (var E = me.stack.split(`
|
|
261
|
+
`), ie = h.stack.split(`
|
|
262
|
+
`), G = E.length - 1, H = ie.length - 1; G >= 1 && H >= 0 && E[G] !== ie[H]; )
|
|
263
|
+
H--;
|
|
264
|
+
for (; G >= 1 && H >= 0; G--, H--)
|
|
265
|
+
if (E[G] !== ie[H]) {
|
|
266
|
+
if (G !== 1 || H !== 1)
|
|
267
267
|
do
|
|
268
|
-
if (
|
|
269
|
-
var
|
|
270
|
-
` + E[
|
|
271
|
-
return e.displayName &&
|
|
268
|
+
if (G--, H--, H < 0 || E[G] !== ie[H]) {
|
|
269
|
+
var ge = `
|
|
270
|
+
` + E[G].replace(" at new ", " at ");
|
|
271
|
+
return e.displayName && ge.includes("<anonymous>") && (ge = ge.replace("<anonymous>", e.displayName)), typeof e == "function" && ke.set(e, ge), ge;
|
|
272
272
|
}
|
|
273
|
-
while (
|
|
273
|
+
while (G >= 1 && H >= 0);
|
|
274
274
|
break;
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
} finally {
|
|
278
|
-
|
|
278
|
+
oe = !1, ve.current = $, Ce(), Error.prepareStackTrace = F;
|
|
279
279
|
}
|
|
280
|
-
var Me = e ? e.displayName || e.name : "", We = Me ?
|
|
281
|
-
return typeof e == "function" &&
|
|
280
|
+
var Me = e ? e.displayName || e.name : "", We = Me ? de(Me) : "";
|
|
281
|
+
return typeof e == "function" && ke.set(e, We), We;
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
return
|
|
283
|
+
function Q(e, o, c) {
|
|
284
|
+
return ue(e, !1);
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function we(e) {
|
|
287
287
|
var o = e.prototype;
|
|
288
288
|
return !!(o && o.isReactComponent);
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function V(e, o, c) {
|
|
291
291
|
if (e == null)
|
|
292
292
|
return "";
|
|
293
293
|
if (typeof e == "function")
|
|
294
|
-
return
|
|
294
|
+
return ue(e, we(e));
|
|
295
295
|
if (typeof e == "string")
|
|
296
|
-
return
|
|
296
|
+
return de(e);
|
|
297
297
|
switch (e) {
|
|
298
|
-
case
|
|
299
|
-
return
|
|
300
|
-
case
|
|
301
|
-
return
|
|
298
|
+
case k:
|
|
299
|
+
return de("Suspense");
|
|
300
|
+
case b:
|
|
301
|
+
return de("SuspenseList");
|
|
302
302
|
}
|
|
303
303
|
if (typeof e == "object")
|
|
304
304
|
switch (e.$$typeof) {
|
|
305
305
|
case m:
|
|
306
|
-
return
|
|
307
|
-
case
|
|
308
|
-
return
|
|
309
|
-
case
|
|
310
|
-
var h = e, F = h._payload,
|
|
306
|
+
return Q(e.render);
|
|
307
|
+
case f:
|
|
308
|
+
return V(e.type, o, c);
|
|
309
|
+
case y: {
|
|
310
|
+
var h = e, F = h._payload, $ = h._init;
|
|
311
311
|
try {
|
|
312
|
-
return
|
|
312
|
+
return V($(F), o, c);
|
|
313
313
|
} catch {
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
return "";
|
|
318
318
|
}
|
|
319
|
-
var
|
|
320
|
-
function
|
|
319
|
+
var je = Object.prototype.hasOwnProperty, Fe = {}, _e = _.ReactDebugCurrentFrame;
|
|
320
|
+
function re(e) {
|
|
321
321
|
if (e) {
|
|
322
|
-
var o = e._owner, c =
|
|
323
|
-
|
|
322
|
+
var o = e._owner, c = V(e.type, e._source, o ? o.type : null);
|
|
323
|
+
_e.setExtraStackFrame(c);
|
|
324
324
|
} else
|
|
325
|
-
|
|
325
|
+
_e.setExtraStackFrame(null);
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function T(e, o, c, h, F) {
|
|
328
328
|
{
|
|
329
|
-
var
|
|
330
|
-
for (var
|
|
331
|
-
if (
|
|
329
|
+
var $ = Function.call.bind(je);
|
|
330
|
+
for (var N in e)
|
|
331
|
+
if ($(e, N)) {
|
|
332
332
|
var E = void 0;
|
|
333
333
|
try {
|
|
334
|
-
if (typeof e[
|
|
335
|
-
var
|
|
336
|
-
throw
|
|
334
|
+
if (typeof e[N] != "function") {
|
|
335
|
+
var ie = Error((h || "React class") + ": " + c + " type `" + N + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[N] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
336
|
+
throw ie.name = "Invariant Violation", ie;
|
|
337
337
|
}
|
|
338
|
-
E = e[
|
|
339
|
-
} catch (
|
|
340
|
-
E =
|
|
338
|
+
E = e[N](o, N, h, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
339
|
+
} catch (G) {
|
|
340
|
+
E = G;
|
|
341
341
|
}
|
|
342
|
-
E && !(E instanceof Error) && (
|
|
342
|
+
E && !(E instanceof Error) && (re(F), g("%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).", h || "React class", c, N, typeof E), re(null)), E instanceof Error && !(E.message in Fe) && (Fe[E.message] = !0, re(F), g("Failed %s type: %s", c, E.message), re(null));
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
var
|
|
347
|
-
function
|
|
348
|
-
return
|
|
346
|
+
var A = Array.isArray;
|
|
347
|
+
function U(e) {
|
|
348
|
+
return A(e);
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function fe(e) {
|
|
351
351
|
{
|
|
352
352
|
var o = typeof Symbol == "function" && Symbol.toStringTag, c = o && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
353
353
|
return c;
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function dr(e) {
|
|
357
357
|
try {
|
|
358
358
|
return er(e), !1;
|
|
359
359
|
} catch {
|
|
@@ -363,39 +363,39 @@ function Xr() {
|
|
|
363
363
|
function er(e) {
|
|
364
364
|
return "" + e;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
if (
|
|
368
|
-
return
|
|
366
|
+
function $e(e) {
|
|
367
|
+
if (dr(e))
|
|
368
|
+
return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", fe(e)), er(e);
|
|
369
369
|
}
|
|
370
|
-
var
|
|
370
|
+
var rr = _.ReactCurrentOwner, tr = {
|
|
371
371
|
key: !0,
|
|
372
372
|
ref: !0,
|
|
373
373
|
__self: !0,
|
|
374
374
|
__source: !0
|
|
375
|
-
},
|
|
376
|
-
function
|
|
377
|
-
if (
|
|
375
|
+
}, Ye, ar;
|
|
376
|
+
function Ve(e) {
|
|
377
|
+
if (je.call(e, "ref")) {
|
|
378
378
|
var o = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
379
379
|
if (o && o.isReactWarning)
|
|
380
380
|
return !1;
|
|
381
381
|
}
|
|
382
382
|
return e.ref !== void 0;
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
if (
|
|
384
|
+
function nr(e) {
|
|
385
|
+
if (je.call(e, "key")) {
|
|
386
386
|
var o = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
387
387
|
if (o && o.isReactWarning)
|
|
388
388
|
return !1;
|
|
389
389
|
}
|
|
390
390
|
return e.key !== void 0;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
typeof e.ref == "string" &&
|
|
392
|
+
function sr(e, o) {
|
|
393
|
+
typeof e.ref == "string" && rr.current;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function or(e, o) {
|
|
396
396
|
{
|
|
397
397
|
var c = function() {
|
|
398
|
-
|
|
398
|
+
Ye || (Ye = !0, g("%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)", o));
|
|
399
399
|
};
|
|
400
400
|
c.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
401
401
|
get: c,
|
|
@@ -403,10 +403,10 @@ function Xr() {
|
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function De(e, o) {
|
|
407
407
|
{
|
|
408
408
|
var c = function() {
|
|
409
|
-
|
|
409
|
+
ar || (ar = !0, g("%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)", o));
|
|
410
410
|
};
|
|
411
411
|
c.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
412
412
|
get: c,
|
|
@@ -414,7 +414,7 @@ function Xr() {
|
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
var
|
|
417
|
+
var Ke = function(e, o, c, h, F, $, N) {
|
|
418
418
|
var E = {
|
|
419
419
|
// This tag allows us to uniquely identify this as a React Element
|
|
420
420
|
$$typeof: t,
|
|
@@ -422,9 +422,9 @@ function Xr() {
|
|
|
422
422
|
type: e,
|
|
423
423
|
key: o,
|
|
424
424
|
ref: c,
|
|
425
|
-
props:
|
|
425
|
+
props: N,
|
|
426
426
|
// Record the component responsible for creating this element.
|
|
427
|
-
_owner:
|
|
427
|
+
_owner: $
|
|
428
428
|
};
|
|
429
429
|
return E._store = {}, Object.defineProperty(E._store, "validated", {
|
|
430
430
|
configurable: !1,
|
|
@@ -443,41 +443,41 @@ function Xr() {
|
|
|
443
443
|
value: F
|
|
444
444
|
}), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
|
|
445
445
|
};
|
|
446
|
-
function
|
|
446
|
+
function qe(e, o, c, h, F) {
|
|
447
447
|
{
|
|
448
|
-
var
|
|
449
|
-
c !== void 0 && (
|
|
450
|
-
for (
|
|
451
|
-
|
|
448
|
+
var $, N = {}, E = null, ie = null;
|
|
449
|
+
c !== void 0 && ($e(c), E = "" + c), nr(o) && ($e(o.key), E = "" + o.key), Ve(o) && (ie = o.ref, sr(o, F));
|
|
450
|
+
for ($ in o)
|
|
451
|
+
je.call(o, $) && !tr.hasOwnProperty($) && (N[$] = o[$]);
|
|
452
452
|
if (e && e.defaultProps) {
|
|
453
|
-
var
|
|
454
|
-
for (
|
|
455
|
-
|
|
453
|
+
var G = e.defaultProps;
|
|
454
|
+
for ($ in G)
|
|
455
|
+
N[$] === void 0 && (N[$] = G[$]);
|
|
456
456
|
}
|
|
457
|
-
if (E ||
|
|
458
|
-
var
|
|
459
|
-
E &&
|
|
457
|
+
if (E || ie) {
|
|
458
|
+
var H = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
459
|
+
E && or(N, H), ie && De(N, H);
|
|
460
460
|
}
|
|
461
|
-
return
|
|
461
|
+
return Ke(e, E, ie, F, h, rr.current, N);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
var
|
|
465
|
-
function
|
|
464
|
+
var Pe = _.ReactCurrentOwner, ir = _.ReactDebugCurrentFrame;
|
|
465
|
+
function Te(e) {
|
|
466
466
|
if (e) {
|
|
467
|
-
var o = e._owner, c =
|
|
468
|
-
|
|
467
|
+
var o = e._owner, c = V(e.type, e._source, o ? o.type : null);
|
|
468
|
+
ir.setExtraStackFrame(c);
|
|
469
469
|
} else
|
|
470
|
-
|
|
470
|
+
ir.setExtraStackFrame(null);
|
|
471
471
|
}
|
|
472
|
-
var
|
|
473
|
-
|
|
474
|
-
function
|
|
472
|
+
var d;
|
|
473
|
+
d = !1;
|
|
474
|
+
function K(e) {
|
|
475
475
|
return typeof e == "object" && e !== null && e.$$typeof === t;
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function z() {
|
|
478
478
|
{
|
|
479
|
-
if (
|
|
480
|
-
var e =
|
|
479
|
+
if (Pe.current) {
|
|
480
|
+
var e = P(Pe.current.type);
|
|
481
481
|
if (e)
|
|
482
482
|
return `
|
|
483
483
|
|
|
@@ -486,13 +486,13 @@ Check the render method of \`` + e + "`.";
|
|
|
486
486
|
return "";
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function B(e) {
|
|
490
490
|
return "";
|
|
491
491
|
}
|
|
492
|
-
var
|
|
493
|
-
function
|
|
492
|
+
var Ee = {};
|
|
493
|
+
function Re(e) {
|
|
494
494
|
{
|
|
495
|
-
var o =
|
|
495
|
+
var o = z();
|
|
496
496
|
if (!o) {
|
|
497
497
|
var c = typeof e == "string" ? e : e.displayName || e.name;
|
|
498
498
|
c && (o = `
|
|
@@ -502,35 +502,35 @@ Check the top-level render call using <` + c + ">.");
|
|
|
502
502
|
return o;
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function Ge(e, o) {
|
|
506
506
|
{
|
|
507
507
|
if (!e._store || e._store.validated || e.key != null)
|
|
508
508
|
return;
|
|
509
509
|
e._store.validated = !0;
|
|
510
|
-
var c =
|
|
511
|
-
if (
|
|
510
|
+
var c = Re(o);
|
|
511
|
+
if (Ee[c])
|
|
512
512
|
return;
|
|
513
|
-
|
|
513
|
+
Ee[c] = !0;
|
|
514
514
|
var h = "";
|
|
515
|
-
e && e._owner && e._owner !==
|
|
515
|
+
e && e._owner && e._owner !== Pe.current && (h = " It was passed a child from " + P(e._owner.type) + "."), Te(e), g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, h), Te(null);
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function wr(e, o) {
|
|
519
519
|
{
|
|
520
520
|
if (typeof e != "object")
|
|
521
521
|
return;
|
|
522
|
-
if (
|
|
522
|
+
if (U(e))
|
|
523
523
|
for (var c = 0; c < e.length; c++) {
|
|
524
524
|
var h = e[c];
|
|
525
|
-
|
|
525
|
+
K(h) && Ge(h, o);
|
|
526
526
|
}
|
|
527
|
-
else if (
|
|
527
|
+
else if (K(e))
|
|
528
528
|
e._store && (e._store.validated = !0);
|
|
529
529
|
else if (e) {
|
|
530
|
-
var F =
|
|
530
|
+
var F = O(e);
|
|
531
531
|
if (typeof F == "function" && F !== e.entries)
|
|
532
|
-
for (var
|
|
533
|
-
|
|
532
|
+
for (var $ = F.call(e), N; !(N = $.next()).done; )
|
|
533
|
+
K(N.value) && Ge(N.value, o);
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
}
|
|
@@ -544,19 +544,19 @@ Check the top-level render call using <` + c + ">.");
|
|
|
544
544
|
c = o.propTypes;
|
|
545
545
|
else if (typeof o == "object" && (o.$$typeof === m || // Note: Memo only checks outer props here.
|
|
546
546
|
// Inner props are checked in the reconciler.
|
|
547
|
-
o.$$typeof ===
|
|
547
|
+
o.$$typeof === f))
|
|
548
548
|
c = o.propTypes;
|
|
549
549
|
else
|
|
550
550
|
return;
|
|
551
551
|
if (c) {
|
|
552
|
-
var h =
|
|
553
|
-
|
|
554
|
-
} else if (o.PropTypes !== void 0 && !
|
|
555
|
-
|
|
556
|
-
var F =
|
|
557
|
-
|
|
552
|
+
var h = P(o);
|
|
553
|
+
T(c, e.props, "prop", h, e);
|
|
554
|
+
} else if (o.PropTypes !== void 0 && !d) {
|
|
555
|
+
d = !0;
|
|
556
|
+
var F = P(o);
|
|
557
|
+
g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", F || "Unknown");
|
|
558
558
|
}
|
|
559
|
-
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved &&
|
|
559
|
+
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
562
|
function Lr(e) {
|
|
@@ -564,99 +564,99 @@ Check the top-level render call using <` + c + ">.");
|
|
|
564
564
|
for (var o = Object.keys(e.props), c = 0; c < o.length; c++) {
|
|
565
565
|
var h = o[c];
|
|
566
566
|
if (h !== "children" && h !== "key") {
|
|
567
|
-
|
|
567
|
+
Te(e), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", h), Te(null);
|
|
568
568
|
break;
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
e.ref !== null && (
|
|
571
|
+
e.ref !== null && (Te(e), g("Invalid attribute `ref` supplied to `React.Fragment`."), Te(null));
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
var
|
|
575
|
-
function
|
|
574
|
+
var jr = {};
|
|
575
|
+
function Er(e, o, c, h, F, $) {
|
|
576
576
|
{
|
|
577
|
-
var
|
|
578
|
-
if (!
|
|
577
|
+
var N = j(e);
|
|
578
|
+
if (!N) {
|
|
579
579
|
var E = "";
|
|
580
580
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (E += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
581
|
-
var
|
|
582
|
-
|
|
583
|
-
var
|
|
584
|
-
e === null ?
|
|
581
|
+
var ie = B();
|
|
582
|
+
ie ? E += ie : E += z();
|
|
583
|
+
var G;
|
|
584
|
+
e === null ? G = "null" : U(e) ? G = "array" : e !== void 0 && e.$$typeof === t ? (G = "<" + (P(e.type) || "Unknown") + " />", E = " Did you accidentally export a JSX literal instead of a component?") : G = typeof e, g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", G, E);
|
|
585
585
|
}
|
|
586
|
-
var
|
|
587
|
-
if (
|
|
588
|
-
return
|
|
589
|
-
if (
|
|
590
|
-
var
|
|
591
|
-
if (
|
|
586
|
+
var H = qe(e, o, c, F, $);
|
|
587
|
+
if (H == null)
|
|
588
|
+
return H;
|
|
589
|
+
if (N) {
|
|
590
|
+
var ge = o.children;
|
|
591
|
+
if (ge !== void 0)
|
|
592
592
|
if (h)
|
|
593
|
-
if (
|
|
594
|
-
for (var Me = 0; Me <
|
|
595
|
-
|
|
596
|
-
Object.freeze && Object.freeze(
|
|
593
|
+
if (U(ge)) {
|
|
594
|
+
for (var Me = 0; Me < ge.length; Me++)
|
|
595
|
+
wr(ge[Me], e);
|
|
596
|
+
Object.freeze && Object.freeze(ge);
|
|
597
597
|
} else
|
|
598
|
-
|
|
598
|
+
g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
599
599
|
else
|
|
600
|
-
|
|
600
|
+
wr(ge, e);
|
|
601
601
|
}
|
|
602
|
-
if (
|
|
603
|
-
var We =
|
|
602
|
+
if (je.call(o, "key")) {
|
|
603
|
+
var We = P(e), me = Object.keys(o).filter(function(qr) {
|
|
604
604
|
return qr !== "key";
|
|
605
|
-
}),
|
|
606
|
-
if (!
|
|
607
|
-
var Kr =
|
|
608
|
-
|
|
605
|
+
}), ur = me.length > 0 ? "{key: someKey, " + me.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
606
|
+
if (!jr[We + ur]) {
|
|
607
|
+
var Kr = me.length > 0 ? "{" + me.join(": ..., ") + ": ...}" : "{}";
|
|
608
|
+
g(`A props object containing a "key" prop is being spread into JSX:
|
|
609
609
|
let props = %s;
|
|
610
610
|
<%s {...props} />
|
|
611
611
|
React keys must be passed directly to JSX without using spread:
|
|
612
612
|
let props = %s;
|
|
613
|
-
<%s key={someKey} {...props} />`,
|
|
613
|
+
<%s key={someKey} {...props} />`, ur, We, Kr, We), jr[We + ur] = !0;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
return e === s ? Lr(
|
|
616
|
+
return e === s ? Lr(H) : Ir(H), H;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
function zr(e, o, c) {
|
|
620
|
-
return
|
|
620
|
+
return Er(e, o, c, !0);
|
|
621
621
|
}
|
|
622
622
|
function Br(e, o, c) {
|
|
623
|
-
return
|
|
623
|
+
return Er(e, o, c, !1);
|
|
624
624
|
}
|
|
625
625
|
var Yr = Br, Vr = zr;
|
|
626
|
-
|
|
627
|
-
}()),
|
|
626
|
+
Je.Fragment = s, Je.jsx = Yr, Je.jsxs = Vr;
|
|
627
|
+
}()), Je;
|
|
628
628
|
}
|
|
629
|
-
process.env.NODE_ENV === "production" ?
|
|
630
|
-
var a =
|
|
631
|
-
function
|
|
629
|
+
process.env.NODE_ENV === "production" ? xr.exports = Zr() : xr.exports = Xr();
|
|
630
|
+
var a = xr.exports;
|
|
631
|
+
function $r(r) {
|
|
632
632
|
var t, n, s = "";
|
|
633
633
|
if (typeof r == "string" || typeof r == "number") s += r;
|
|
634
634
|
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
635
635
|
var i = r.length;
|
|
636
|
-
for (t = 0; t < i; t++) r[t] && (n =
|
|
636
|
+
for (t = 0; t < i; t++) r[t] && (n = $r(r[t])) && (s && (s += " "), s += n);
|
|
637
637
|
} else for (n in r) r[n] && (s && (s += " "), s += n);
|
|
638
638
|
return s;
|
|
639
639
|
}
|
|
640
|
-
function
|
|
641
|
-
for (var r, t, n = 0, s = "", i = arguments.length; n < i; n++) (r = arguments[n]) && (t =
|
|
640
|
+
function te() {
|
|
641
|
+
for (var r, t, n = 0, s = "", i = arguments.length; n < i; n++) (r = arguments[n]) && (t = $r(r)) && (s && (s += " "), s += t);
|
|
642
642
|
return s;
|
|
643
643
|
}
|
|
644
644
|
const Qr = "https://core.spreedly.com/iframe/iframe-v1.min.js", et = "https://cdn.e2e.movmo.io";
|
|
645
645
|
let Ae = {};
|
|
646
646
|
const At = (r) => {
|
|
647
647
|
Ae = { ...Ae, ...r };
|
|
648
|
-
},
|
|
648
|
+
}, fr = (r) => {
|
|
649
649
|
var n;
|
|
650
650
|
const t = globalThis.process;
|
|
651
651
|
return (n = t == null ? void 0 : t.env) == null ? void 0 : n[r];
|
|
652
652
|
}, Be = () => ({
|
|
653
|
-
baseUrl: Ae.baseUrl ??
|
|
654
|
-
spreedlyScriptUrl: Ae.spreedlyScriptUrl ??
|
|
655
|
-
iconCdnBaseUrl: Ae.iconCdnBaseUrl ??
|
|
653
|
+
baseUrl: Ae.baseUrl ?? fr("REACT_APP_MOVMO_API_URL") ?? "",
|
|
654
|
+
spreedlyScriptUrl: Ae.spreedlyScriptUrl ?? fr("REACT_APP_SPREEDLY_SCRIPT_URL") ?? Qr,
|
|
655
|
+
iconCdnBaseUrl: Ae.iconCdnBaseUrl ?? fr("REACT_APP_MOVMO_ICON_CDN_URL") ?? et,
|
|
656
656
|
fetch: Ae.fetch ?? (typeof globalThis < "u" && typeof globalThis.fetch == "function" ? globalThis.fetch.bind(globalThis) : (() => {
|
|
657
657
|
throw new Error("@movmo_app/payments: no fetch available");
|
|
658
658
|
})())
|
|
659
|
-
}),
|
|
659
|
+
}), gr = (r) => ({
|
|
660
660
|
id: r.id,
|
|
661
661
|
last4: r.last4,
|
|
662
662
|
brand: r.brand,
|
|
@@ -686,9 +686,9 @@ const At = (r) => {
|
|
|
686
686
|
return t;
|
|
687
687
|
}
|
|
688
688
|
};
|
|
689
|
-
let
|
|
690
|
-
const
|
|
691
|
-
if (
|
|
689
|
+
let Ze = null;
|
|
690
|
+
const br = () => {
|
|
691
|
+
if (Ze) return Ze;
|
|
692
692
|
const r = (async () => {
|
|
693
693
|
const t = await Le(Ie("/v1/payments/tokenization-session"), {
|
|
694
694
|
method: "GET",
|
|
@@ -699,8 +699,8 @@ const hr = () => {
|
|
|
699
699
|
throw new Error(await ze(t, `Failed to fetch tokenization session (${t.status})`));
|
|
700
700
|
return await t.json();
|
|
701
701
|
})();
|
|
702
|
-
return
|
|
703
|
-
|
|
702
|
+
return Ze = r, r.finally(() => {
|
|
703
|
+
Ze === r && (Ze = null);
|
|
704
704
|
}).catch(() => {
|
|
705
705
|
}), r;
|
|
706
706
|
}, rt = (r) => typeof r.brand == "string" && typeof r.last4 == "string" && typeof r.expMonth == "number" && typeof r.expYear == "number", tt = async (r, t, n) => {
|
|
@@ -717,7 +717,7 @@ const hr = () => {
|
|
|
717
717
|
throw new Error(await ze(s, `Failed to save payment method (${s.status})`));
|
|
718
718
|
const i = await s.json();
|
|
719
719
|
if (rt(i))
|
|
720
|
-
return
|
|
720
|
+
return gr(i);
|
|
721
721
|
const l = await Le(
|
|
722
722
|
Ie(
|
|
723
723
|
`/v1/users/${encodeURIComponent(r)}/payment-methods/${encodeURIComponent(i.id)}`
|
|
@@ -733,7 +733,7 @@ const hr = () => {
|
|
|
733
733
|
await ze(l, `Failed to fetch saved payment method (${l.status})`)
|
|
734
734
|
);
|
|
735
735
|
const u = await l.json();
|
|
736
|
-
return
|
|
736
|
+
return gr(u);
|
|
737
737
|
}, at = async (r, t) => {
|
|
738
738
|
if (!r) return [];
|
|
739
739
|
const n = await Le(
|
|
@@ -747,7 +747,7 @@ const hr = () => {
|
|
|
747
747
|
);
|
|
748
748
|
if (!n.ok)
|
|
749
749
|
throw new Error(await ze(n, `Failed to fetch payment methods (${n.status})`));
|
|
750
|
-
return (await n.json() ?? []).map(
|
|
750
|
+
return (await n.json() ?? []).map(gr);
|
|
751
751
|
}, nt = async (r, t) => {
|
|
752
752
|
const n = await Le(
|
|
753
753
|
Ie(
|
|
@@ -761,7 +761,7 @@ const hr = () => {
|
|
|
761
761
|
);
|
|
762
762
|
if (!n.ok)
|
|
763
763
|
throw new Error(await ze(n, `Failed to delete payment method (${n.status})`));
|
|
764
|
-
},
|
|
764
|
+
}, Dr = async (r, t, n) => {
|
|
765
765
|
const s = await Le(
|
|
766
766
|
Ie(
|
|
767
767
|
`/v1/users/${encodeURIComponent(r)}/payment-methods/${encodeURIComponent(t)}`
|
|
@@ -801,16 +801,16 @@ const hr = () => {
|
|
|
801
801
|
}
|
|
802
802
|
);
|
|
803
803
|
};
|
|
804
|
-
let
|
|
804
|
+
let Xe = null;
|
|
805
805
|
const it = () => {
|
|
806
806
|
if (typeof window > "u")
|
|
807
807
|
return Promise.reject(new Error("Spreedly can only be loaded in a browser environment."));
|
|
808
808
|
if (window.Spreedly)
|
|
809
809
|
return Promise.resolve(window.Spreedly);
|
|
810
|
-
if (
|
|
811
|
-
return
|
|
810
|
+
if (Xe)
|
|
811
|
+
return Xe;
|
|
812
812
|
const { spreedlyScriptUrl: r } = Be();
|
|
813
|
-
return
|
|
813
|
+
return Xe = new Promise((t, n) => {
|
|
814
814
|
const s = document.querySelector(
|
|
815
815
|
`script[src="${r}"]`
|
|
816
816
|
), i = () => {
|
|
@@ -835,16 +835,16 @@ const it = () => {
|
|
|
835
835
|
l.remove(), n(new Error("Failed to load Spreedly iframe script."));
|
|
836
836
|
}, document.head.appendChild(l);
|
|
837
837
|
}).catch((t) => {
|
|
838
|
-
throw
|
|
839
|
-
}),
|
|
838
|
+
throw Xe = null, t;
|
|
839
|
+
}), Xe;
|
|
840
840
|
};
|
|
841
|
-
class
|
|
841
|
+
class lr extends Error {
|
|
842
842
|
constructor(n, s) {
|
|
843
843
|
super(s instanceof Error ? s.message : "Failed to initialize card form.");
|
|
844
|
-
|
|
844
|
+
mr(this, "source");
|
|
845
845
|
// Re-declared (vs. relying on the lib's ES2022 `Error.cause`) so the field is
|
|
846
846
|
// always present on the type regardless of the consuming app's tsconfig `lib`.
|
|
847
|
-
|
|
847
|
+
mr(this, "cause");
|
|
848
848
|
this.name = "InitError", this.source = n, this.cause = s;
|
|
849
849
|
}
|
|
850
850
|
}
|
|
@@ -863,129 +863,129 @@ const lt = "movmo-card-number", ct = "movmo-card-cvv", dt = (r) => ({
|
|
|
863
863
|
onFieldErrors: i,
|
|
864
864
|
onValidityChange: l,
|
|
865
865
|
onBrandChange: u
|
|
866
|
-
} = r, [x, m] =
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
}, [s]),
|
|
870
|
-
|
|
871
|
-
}, [i]),
|
|
872
|
-
|
|
873
|
-
}, [l]),
|
|
874
|
-
|
|
866
|
+
} = r, [x, m] = C("idle"), [k, b] = C(null), [f, y] = C(null), [w, S] = C(null), [le, O] = C({ number: !1, cvv: !1 }), [_, g] = C(null), [q, ae] = C({ number: !1, cvv: !1 }), be = I(null), pe = I(s), ne = I(i), ce = I(l), M = I(u);
|
|
867
|
+
D(() => {
|
|
868
|
+
pe.current = s;
|
|
869
|
+
}, [s]), D(() => {
|
|
870
|
+
ne.current = i;
|
|
871
|
+
}, [i]), D(() => {
|
|
872
|
+
ce.current = l;
|
|
873
|
+
}, [l]), D(() => {
|
|
874
|
+
M.current = u;
|
|
875
875
|
}, [u]);
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
let
|
|
879
|
-
return m("loading"),
|
|
876
|
+
const j = I({ number: !1, cvv: !1 });
|
|
877
|
+
D(() => {
|
|
878
|
+
let P = !1;
|
|
879
|
+
return m("loading"), b(null), y(null), S(null), O({ number: !1, cvv: !1 }), g(null), j.current = { number: !1, cvv: !1 }, (async () => {
|
|
880
880
|
try {
|
|
881
|
-
const [
|
|
882
|
-
|
|
883
|
-
throw new
|
|
881
|
+
const [v, p] = await Promise.all([
|
|
882
|
+
br().catch((R) => {
|
|
883
|
+
throw new lr("tokenization-session", R);
|
|
884
884
|
}),
|
|
885
|
-
it().catch((
|
|
886
|
-
throw new
|
|
885
|
+
it().catch((R) => {
|
|
886
|
+
throw new lr("spreedly-script", R);
|
|
887
887
|
})
|
|
888
888
|
]);
|
|
889
|
-
if (
|
|
890
|
-
|
|
891
|
-
var
|
|
892
|
-
if (!
|
|
889
|
+
if (P) return;
|
|
890
|
+
be.current = p, p.on("ready", () => {
|
|
891
|
+
var R, L, J, ye, Z, se;
|
|
892
|
+
if (!P) {
|
|
893
893
|
m("ready");
|
|
894
894
|
try {
|
|
895
|
-
(
|
|
896
|
-
} catch (
|
|
897
|
-
console.warn("@movmo_app/payments: setFieldType failed",
|
|
895
|
+
(R = p.setFieldType) == null || R.call(p, "number", "tel"), (L = p.setFieldType) == null || L.call(p, "cvv", "tel");
|
|
896
|
+
} catch (X) {
|
|
897
|
+
console.warn("@movmo_app/payments: setFieldType failed", X);
|
|
898
898
|
}
|
|
899
899
|
try {
|
|
900
900
|
typeof p.setNumberFormat == "function" ? p.setNumberFormat("prettyFormat") : console.warn(
|
|
901
901
|
"@movmo_app/payments: Spreedly.setNumberFormat is missing — card-number digits will not be space-grouped."
|
|
902
902
|
);
|
|
903
|
-
} catch (
|
|
904
|
-
console.warn("@movmo_app/payments: setNumberFormat failed",
|
|
903
|
+
} catch (X) {
|
|
904
|
+
console.warn("@movmo_app/payments: setNumberFormat failed", X);
|
|
905
905
|
}
|
|
906
906
|
try {
|
|
907
|
-
(
|
|
908
|
-
const
|
|
909
|
-
(
|
|
910
|
-
} catch (
|
|
911
|
-
console.warn("@movmo_app/payments: setPlaceholder/setStyle failed",
|
|
907
|
+
(J = p.setPlaceholder) == null || J.call(p, "number", "Card number"), (ye = p.setPlaceholder) == null || ye.call(p, "cvv", "CVV");
|
|
908
|
+
const X = 'box-sizing: border-box;width: 100%;height: 100%;margin: 0;padding: 0;border: 0;background: transparent;outline: none;font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;font-size: 14px;font-weight: 400;line-height: 20px;color: rgb(28 25 23);letter-spacing: 0;vertical-align: middle;';
|
|
909
|
+
(Z = p.setStyle) == null || Z.call(p, "number", X), (se = p.setStyle) == null || se.call(p, "cvv", X);
|
|
910
|
+
} catch (X) {
|
|
911
|
+
console.warn("@movmo_app/payments: setPlaceholder/setStyle failed", X);
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
|
-
}), p.on("paymentMethod", (
|
|
915
|
-
var
|
|
916
|
-
(
|
|
917
|
-
}), p.on("errors", (
|
|
918
|
-
var
|
|
919
|
-
(
|
|
920
|
-
}), p.on("fieldEvent", (
|
|
921
|
-
var
|
|
922
|
-
if (
|
|
923
|
-
if (
|
|
924
|
-
|
|
914
|
+
}), p.on("paymentMethod", (R) => {
|
|
915
|
+
var L;
|
|
916
|
+
(L = pe.current) == null || L.call(pe, R);
|
|
917
|
+
}), p.on("errors", (R) => {
|
|
918
|
+
var L;
|
|
919
|
+
(L = ne.current) == null || L.call(ne, R);
|
|
920
|
+
}), p.on("fieldEvent", (R, L, J, ye) => {
|
|
921
|
+
var X;
|
|
922
|
+
if (P) return;
|
|
923
|
+
if (L === "focus") {
|
|
924
|
+
ae((W) => W[R] ? W : { ...W, [R]: !0 });
|
|
925
925
|
return;
|
|
926
926
|
}
|
|
927
|
-
if (
|
|
928
|
-
|
|
927
|
+
if (L === "blur") {
|
|
928
|
+
ae((W) => W[R] ? { ...W, [R]: !1 } : W);
|
|
929
929
|
return;
|
|
930
930
|
}
|
|
931
|
-
if (
|
|
932
|
-
const
|
|
933
|
-
if (
|
|
934
|
-
if (
|
|
935
|
-
|
|
936
|
-
var
|
|
937
|
-
return
|
|
931
|
+
if (L !== "input") return;
|
|
932
|
+
const Z = ye ?? {};
|
|
933
|
+
if (R === "number") {
|
|
934
|
+
if (Z.numberLength === 0)
|
|
935
|
+
g((W) => {
|
|
936
|
+
var ee;
|
|
937
|
+
return W !== null && ((ee = M.current) == null || ee.call(M, null)), null;
|
|
938
938
|
});
|
|
939
|
-
else if (
|
|
940
|
-
const
|
|
941
|
-
|
|
942
|
-
var
|
|
943
|
-
return
|
|
939
|
+
else if (Z.cardType !== void 0) {
|
|
940
|
+
const W = Z.cardType || null;
|
|
941
|
+
g((ee) => {
|
|
942
|
+
var Ce;
|
|
943
|
+
return ee !== W && ((Ce = M.current) == null || Ce.call(M, W)), W;
|
|
944
944
|
});
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
|
-
const
|
|
948
|
-
if (typeof
|
|
949
|
-
const
|
|
950
|
-
(
|
|
947
|
+
const se = R === "number" ? typeof Z.validNumber == "boolean" ? Z.validNumber : void 0 : typeof Z.validCvv == "boolean" ? Z.validCvv : void 0;
|
|
948
|
+
if (typeof se == "boolean") {
|
|
949
|
+
const W = j.current, ee = R === "number" ? { ...W, number: se } : { ...W, cvv: se };
|
|
950
|
+
(ee.number !== W.number || ee.cvv !== W.cvv) && (j.current = ee, O(ee), (X = ce.current) == null || X.call(ce, ee));
|
|
951
951
|
}
|
|
952
|
-
}), p.on("consoleError", (
|
|
953
|
-
var
|
|
954
|
-
const
|
|
955
|
-
(
|
|
956
|
-
}), p.init(
|
|
952
|
+
}), p.on("consoleError", (R) => {
|
|
953
|
+
var J;
|
|
954
|
+
const L = R instanceof Error ? R.message : "An unexpected error occurred while securing your card.";
|
|
955
|
+
(J = ne.current) == null || J.call(ne, [{ message: L }]);
|
|
956
|
+
}), p.init(v.environmentKey, {
|
|
957
957
|
numberEl: t,
|
|
958
958
|
cvvEl: n,
|
|
959
|
-
nonce:
|
|
960
|
-
timestamp: String(
|
|
961
|
-
certificateToken:
|
|
962
|
-
signature:
|
|
959
|
+
nonce: v.nonce,
|
|
960
|
+
timestamp: String(v.timestamp),
|
|
961
|
+
certificateToken: v.certificateToken,
|
|
962
|
+
signature: v.signature
|
|
963
963
|
});
|
|
964
|
-
} catch (
|
|
965
|
-
if (
|
|
966
|
-
const p =
|
|
967
|
-
|
|
964
|
+
} catch (v) {
|
|
965
|
+
if (P) return;
|
|
966
|
+
const p = v instanceof Error ? v.message : "Failed to initialize card form.";
|
|
967
|
+
b(p), y(v instanceof lr ? v.source : "spreedly-script"), S(v instanceof lr ? v.cause : v), m("error");
|
|
968
968
|
}
|
|
969
969
|
})(), () => {
|
|
970
|
-
var
|
|
971
|
-
|
|
970
|
+
var v, p;
|
|
971
|
+
P = !0;
|
|
972
972
|
try {
|
|
973
|
-
(p = (
|
|
974
|
-
} catch (
|
|
975
|
-
console.warn("@movmo_app/payments: removeHandlers failed during cleanup",
|
|
973
|
+
(p = (v = be.current) == null ? void 0 : v.removeHandlers) == null || p.call(v);
|
|
974
|
+
} catch (R) {
|
|
975
|
+
console.warn("@movmo_app/payments: removeHandlers failed during cleanup", R);
|
|
976
976
|
}
|
|
977
|
-
|
|
977
|
+
be.current = null;
|
|
978
978
|
};
|
|
979
979
|
}, [t, n]);
|
|
980
|
-
const
|
|
981
|
-
var
|
|
982
|
-
(
|
|
983
|
-
}, []),
|
|
984
|
-
var
|
|
985
|
-
(p = (
|
|
980
|
+
const he = Y((P) => {
|
|
981
|
+
var v;
|
|
982
|
+
(v = be.current) == null || v.tokenizeCreditCard(dt(P));
|
|
983
|
+
}, []), Ne = Y((P) => {
|
|
984
|
+
var v, p;
|
|
985
|
+
(p = (v = be.current) == null ? void 0 : v.transferFocus) == null || p.call(v, P);
|
|
986
986
|
}, []);
|
|
987
|
-
return { status: x, error:
|
|
988
|
-
},
|
|
987
|
+
return { status: x, error: k, errorSource: f, errorCause: w, tokenize: he, validity: le, brand: _, focused: q, focusField: Ne };
|
|
988
|
+
}, pr = "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]", Cr = "flex h-11 w-full items-center gap-2 rounded-md border bg-white px-3 py-2 transition-shadow", kr = "border-grayWarm-950 shadow-[0_0_0_1px_#1c1917]", Rr = "border-grayWarm-300", mt = (r) => {
|
|
989
989
|
const t = r.trim();
|
|
990
990
|
if (!t) return { firstName: "", lastName: "" };
|
|
991
991
|
const n = t.lastIndexOf(" ");
|
|
@@ -993,7 +993,7 @@ const lt = "movmo-card-number", ct = "movmo-card-cvv", dt = (r) => ({
|
|
|
993
993
|
firstName: t.slice(0, n).trim(),
|
|
994
994
|
lastName: t.slice(n + 1).trim()
|
|
995
995
|
};
|
|
996
|
-
},
|
|
996
|
+
}, Mr = (r) => {
|
|
997
997
|
const t = r.replace(/\D/g, "");
|
|
998
998
|
if (t.length < 4) return { month: "", year: "" };
|
|
999
999
|
const n = t.slice(0, 2), s = t.slice(2), i = s.length === 2 ? `20${s}` : s.slice(0, 4);
|
|
@@ -1001,17 +1001,17 @@ const lt = "movmo-card-number", ct = "movmo-card-cvv", dt = (r) => ({
|
|
|
1001
1001
|
}, ft = (r) => {
|
|
1002
1002
|
const t = r.replace(/\D/g, "").slice(0, 4);
|
|
1003
1003
|
return t.length <= 2 ? t : `${t.slice(0, 2)} / ${t.slice(2)}`;
|
|
1004
|
-
},
|
|
1005
|
-
const { month: t, year: n } =
|
|
1004
|
+
}, hr = (r) => {
|
|
1005
|
+
const { month: t, year: n } = Mr(r);
|
|
1006
1006
|
if (!t || !n) return !1;
|
|
1007
1007
|
const s = parseInt(t, 10), i = parseInt(n, 10);
|
|
1008
1008
|
if (isNaN(s) || s < 1 || s > 12) return !1;
|
|
1009
1009
|
const l = /* @__PURE__ */ new Date();
|
|
1010
1010
|
return !(i < l.getFullYear() || i > l.getFullYear() + 20 || i === l.getFullYear() && s < l.getMonth() + 1);
|
|
1011
|
-
},
|
|
1011
|
+
}, yr = (r) => /^\d{5}(-\d{4})?$/.test(r.trim()), pt = (r) => {
|
|
1012
1012
|
const t = r.replace(/[^\d]/g, "").slice(0, 9);
|
|
1013
1013
|
return t.length <= 5 ? t : `${t.slice(0, 5)}-${t.slice(5)}`;
|
|
1014
|
-
},
|
|
1014
|
+
}, Ar = ({
|
|
1015
1015
|
userId: r,
|
|
1016
1016
|
onSuccess: t,
|
|
1017
1017
|
onError: n,
|
|
@@ -1021,105 +1021,105 @@ const lt = "movmo-card-number", ct = "movmo-card-cvv", dt = (r) => ({
|
|
|
1021
1021
|
defaultCardholderName: u,
|
|
1022
1022
|
defaultCardholderFirstName: x = "",
|
|
1023
1023
|
defaultCardholderLastName: m = "",
|
|
1024
|
-
autoSave:
|
|
1025
|
-
formId:
|
|
1026
|
-
hideInternalSaveButton:
|
|
1027
|
-
onCanSubmitChange:
|
|
1028
|
-
onSavingChange:
|
|
1029
|
-
autoFocus:
|
|
1024
|
+
autoSave: k = !1,
|
|
1025
|
+
formId: b = "movmo-card-form",
|
|
1026
|
+
hideInternalSaveButton: f = !1,
|
|
1027
|
+
onCanSubmitChange: y,
|
|
1028
|
+
onSavingChange: w,
|
|
1029
|
+
autoFocus: S
|
|
1030
1030
|
}) => {
|
|
1031
|
-
const
|
|
1032
|
-
|
|
1033
|
-
|
|
1031
|
+
const le = u ?? [x, m].filter(Boolean).join(" "), [O, _] = C(le), [g, q] = C(""), [ae, be] = C(""), [pe, ne] = C("idle"), ce = I(!1), M = I(s);
|
|
1032
|
+
D(() => {
|
|
1033
|
+
M.current = s;
|
|
1034
1034
|
}, [s]);
|
|
1035
|
-
const
|
|
1036
|
-
async (
|
|
1037
|
-
var
|
|
1038
|
-
|
|
1035
|
+
const j = Y(
|
|
1036
|
+
async (T) => {
|
|
1037
|
+
var A;
|
|
1038
|
+
ne("saving");
|
|
1039
1039
|
try {
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1042
|
-
} catch (
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1040
|
+
const U = await tt(r, T, i);
|
|
1041
|
+
ne("ready"), t(U);
|
|
1042
|
+
} catch (U) {
|
|
1043
|
+
const fe = U instanceof Error ? U.message : "Failed to save payment method.";
|
|
1044
|
+
ne("ready"), ce.current = !1, n(fe), (A = M.current) == null || A.call(M, { source: "save-from-token", message: fe, cause: U });
|
|
1045
1045
|
}
|
|
1046
1046
|
},
|
|
1047
1047
|
[r, i, t, n]
|
|
1048
|
-
),
|
|
1049
|
-
(
|
|
1050
|
-
var
|
|
1051
|
-
const
|
|
1052
|
-
|
|
1048
|
+
), he = Y(
|
|
1049
|
+
(T) => {
|
|
1050
|
+
var U;
|
|
1051
|
+
const A = T.map((fe) => fe.message).filter(Boolean).join("; ") || "Card validation failed.";
|
|
1052
|
+
ne((fe) => fe === "tokenizing" ? "ready" : fe), ce.current = !1, n(A), (U = M.current) == null || U.call(M, { source: "card-tokenize", message: A });
|
|
1053
1053
|
},
|
|
1054
1054
|
[n]
|
|
1055
|
-
),
|
|
1055
|
+
), Ne = Qe(
|
|
1056
1056
|
() => ({
|
|
1057
|
-
onCardTokenized:
|
|
1058
|
-
onFieldErrors:
|
|
1057
|
+
onCardTokenized: j,
|
|
1058
|
+
onFieldErrors: he
|
|
1059
1059
|
}),
|
|
1060
|
-
[
|
|
1060
|
+
[j, he]
|
|
1061
1061
|
), {
|
|
1062
|
-
status:
|
|
1063
|
-
error:
|
|
1062
|
+
status: P,
|
|
1063
|
+
error: v,
|
|
1064
1064
|
errorSource: p,
|
|
1065
|
-
errorCause:
|
|
1066
|
-
tokenize:
|
|
1067
|
-
validity:
|
|
1068
|
-
brand:
|
|
1069
|
-
focused:
|
|
1070
|
-
focusField:
|
|
1071
|
-
} = ut(
|
|
1072
|
-
|
|
1073
|
-
!
|
|
1074
|
-
}, [
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1077
|
-
var
|
|
1078
|
-
|
|
1079
|
-
}, [
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
}, [
|
|
1084
|
-
var
|
|
1085
|
-
(
|
|
1086
|
-
}, [
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
}, [
|
|
1091
|
-
var
|
|
1092
|
-
(
|
|
1093
|
-
}, [
|
|
1094
|
-
const
|
|
1095
|
-
const { firstName:
|
|
1096
|
-
|
|
1097
|
-
}, [
|
|
1098
|
-
|
|
1099
|
-
if (!
|
|
1100
|
-
const
|
|
1101
|
-
|
|
1065
|
+
errorCause: R,
|
|
1066
|
+
tokenize: L,
|
|
1067
|
+
validity: J,
|
|
1068
|
+
brand: ye,
|
|
1069
|
+
focused: Z,
|
|
1070
|
+
focusField: se
|
|
1071
|
+
} = ut(Ne), X = I(!1);
|
|
1072
|
+
D(() => {
|
|
1073
|
+
!S || P !== "ready" || X.current || (X.current = !0, se(S));
|
|
1074
|
+
}, [S, P, se]);
|
|
1075
|
+
const W = O.trim().split(/\s+/).length >= 2, ee = hr(g), Ce = yr(ae), ve = I(!1), xe = I(!1), de = I(!1), oe = I(null), ke = I(null);
|
|
1076
|
+
D(() => {
|
|
1077
|
+
var T;
|
|
1078
|
+
J.cvv ? xe.current || (xe.current = !0, (T = oe.current) == null || T.focus()) : xe.current = !1;
|
|
1079
|
+
}, [J.cvv]);
|
|
1080
|
+
const Oe = !W || !ee || !Ce || !J.number || !J.cvv, ue = pe === "tokenizing" || pe === "saving", Q = P === "ready" && !ue && !Oe, we = I(y);
|
|
1081
|
+
D(() => {
|
|
1082
|
+
we.current = y;
|
|
1083
|
+
}, [y]), D(() => {
|
|
1084
|
+
var T;
|
|
1085
|
+
(T = we.current) == null || T.call(we, Q);
|
|
1086
|
+
}, [Q]);
|
|
1087
|
+
const V = I(w);
|
|
1088
|
+
D(() => {
|
|
1089
|
+
V.current = w;
|
|
1090
|
+
}, [w]), D(() => {
|
|
1091
|
+
var T;
|
|
1092
|
+
(T = V.current) == null || T.call(V, ue);
|
|
1093
|
+
}, [ue]);
|
|
1094
|
+
const je = Y(() => {
|
|
1095
|
+
const { firstName: T, lastName: A } = mt(O), { month: U, year: fe } = Mr(g);
|
|
1096
|
+
ne("tokenizing"), L({ firstName: T, lastName: A, month: U, year: fe, zip: ae.trim() });
|
|
1097
|
+
}, [O, g, ae, L]);
|
|
1098
|
+
D(() => {
|
|
1099
|
+
if (!k || !Q || ce.current) return;
|
|
1100
|
+
const T = setTimeout(() => {
|
|
1101
|
+
ce.current = !0, je();
|
|
1102
1102
|
}, 1200);
|
|
1103
|
-
return () => clearTimeout(
|
|
1104
|
-
}, [
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1107
|
-
},
|
|
1108
|
-
return
|
|
1109
|
-
|
|
1110
|
-
}, [n]),
|
|
1111
|
-
var
|
|
1112
|
-
|
|
1103
|
+
return () => clearTimeout(T);
|
|
1104
|
+
}, [k, Q, je]);
|
|
1105
|
+
const Fe = (T) => {
|
|
1106
|
+
T.preventDefault(), Q && je();
|
|
1107
|
+
}, _e = P !== "ready" || ue, re = I(n);
|
|
1108
|
+
return D(() => {
|
|
1109
|
+
re.current = n;
|
|
1110
|
+
}, [n]), D(() => {
|
|
1111
|
+
var T, A;
|
|
1112
|
+
v && ((T = re.current) == null || T.call(re, v), (A = M.current) == null || A.call(M, {
|
|
1113
1113
|
source: p ?? "spreedly-script",
|
|
1114
|
-
message:
|
|
1115
|
-
cause:
|
|
1114
|
+
message: v,
|
|
1115
|
+
cause: R
|
|
1116
1116
|
}));
|
|
1117
|
-
}, [
|
|
1117
|
+
}, [v, p, R]), /* @__PURE__ */ a.jsxs(
|
|
1118
1118
|
"form",
|
|
1119
1119
|
{
|
|
1120
|
-
id:
|
|
1121
|
-
onSubmit:
|
|
1122
|
-
className:
|
|
1120
|
+
id: b,
|
|
1121
|
+
onSubmit: Fe,
|
|
1122
|
+
className: te("flex w-full flex-col gap-3", l),
|
|
1123
1123
|
"data-testid": "movmo-card-form",
|
|
1124
1124
|
children: [
|
|
1125
1125
|
/* @__PURE__ */ a.jsxs("div", { children: [
|
|
@@ -1127,24 +1127,24 @@ const lt = "movmo-card-number", ct = "movmo-card-cvv", dt = (r) => ({
|
|
|
1127
1127
|
/* @__PURE__ */ a.jsxs(
|
|
1128
1128
|
"div",
|
|
1129
1129
|
{
|
|
1130
|
-
className:
|
|
1131
|
-
|
|
1132
|
-
|
|
1130
|
+
className: te(
|
|
1131
|
+
Cr,
|
|
1132
|
+
Z.number ? kr : Rr
|
|
1133
1133
|
),
|
|
1134
1134
|
children: [
|
|
1135
|
-
/* @__PURE__ */ a.jsx(Se, { brand:
|
|
1135
|
+
/* @__PURE__ */ a.jsx(Se, { brand: ye ?? "", width: 32, className: "flex-shrink-0" }),
|
|
1136
1136
|
/* @__PURE__ */ a.jsxs("div", { className: "relative h-full flex-1", children: [
|
|
1137
1137
|
/* @__PURE__ */ a.jsx(
|
|
1138
1138
|
"div",
|
|
1139
1139
|
{
|
|
1140
1140
|
id: "movmo-card-number",
|
|
1141
1141
|
"aria-labelledby": "movmo-card-number-label",
|
|
1142
|
-
"aria-busy":
|
|
1142
|
+
"aria-busy": P !== "ready",
|
|
1143
1143
|
className: "absolute inset-0",
|
|
1144
1144
|
"data-testid": "movmo-card-number-mount"
|
|
1145
1145
|
}
|
|
1146
1146
|
),
|
|
1147
|
-
|
|
1147
|
+
P !== "ready" ? /* @__PURE__ */ a.jsx(
|
|
1148
1148
|
"div",
|
|
1149
1149
|
{
|
|
1150
1150
|
"aria-hidden": "true",
|
|
@@ -1167,13 +1167,13 @@ const lt = "movmo-card-number", ct = "movmo-card-cvv", dt = (r) => ({
|
|
|
1167
1167
|
inputMode: "numeric",
|
|
1168
1168
|
autoComplete: "cc-exp",
|
|
1169
1169
|
placeholder: "MM / YY",
|
|
1170
|
-
value:
|
|
1171
|
-
onChange: (
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1170
|
+
value: g,
|
|
1171
|
+
onChange: (T) => {
|
|
1172
|
+
const A = ft(T.target.value);
|
|
1173
|
+
q(A), hr(A) && !ve.current ? (ve.current = !0, se("cvv")) : hr(A) || (ve.current = !1);
|
|
1174
1174
|
},
|
|
1175
|
-
className:
|
|
1176
|
-
disabled:
|
|
1175
|
+
className: te(pr, g && !ee && "border-error-500"),
|
|
1176
|
+
disabled: _e,
|
|
1177
1177
|
required: !0,
|
|
1178
1178
|
"data-testid": "movmo-card-expiry-input"
|
|
1179
1179
|
}
|
|
@@ -1184,9 +1184,9 @@ const lt = "movmo-card-number", ct = "movmo-card-cvv", dt = (r) => ({
|
|
|
1184
1184
|
/* @__PURE__ */ a.jsxs(
|
|
1185
1185
|
"div",
|
|
1186
1186
|
{
|
|
1187
|
-
className:
|
|
1188
|
-
|
|
1189
|
-
|
|
1187
|
+
className: te(
|
|
1188
|
+
Cr,
|
|
1189
|
+
Z.cvv ? kr : Rr
|
|
1190
1190
|
),
|
|
1191
1191
|
children: [
|
|
1192
1192
|
/* @__PURE__ */ a.jsxs("div", { className: "relative h-full flex-1", children: [
|
|
@@ -1195,12 +1195,12 @@ const lt = "movmo-card-number", ct = "movmo-card-cvv", dt = (r) => ({
|
|
|
1195
1195
|
{
|
|
1196
1196
|
id: "movmo-card-cvv",
|
|
1197
1197
|
"aria-labelledby": "movmo-card-cvv-label",
|
|
1198
|
-
"aria-busy":
|
|
1198
|
+
"aria-busy": P !== "ready",
|
|
1199
1199
|
className: "absolute inset-0",
|
|
1200
1200
|
"data-testid": "movmo-card-cvv-mount"
|
|
1201
1201
|
}
|
|
1202
1202
|
),
|
|
1203
|
-
|
|
1203
|
+
P !== "ready" ? /* @__PURE__ */ a.jsx(
|
|
1204
1204
|
"div",
|
|
1205
1205
|
{
|
|
1206
1206
|
"aria-hidden": "true",
|
|
@@ -1215,7 +1215,7 @@ const lt = "movmo-card-number", ct = "movmo-card-cvv", dt = (r) => ({
|
|
|
1215
1215
|
"aria-label": "CVV help",
|
|
1216
1216
|
tabIndex: -1,
|
|
1217
1217
|
className: "flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full border border-grayWarm-300 text-xs text-grayWarm-500",
|
|
1218
|
-
title:
|
|
1218
|
+
title: ye === "american_express" ? "The 4 numbers on the front of your card." : "The 3 numbers on the back of your card.",
|
|
1219
1219
|
"data-testid": "movmo-cvv-help",
|
|
1220
1220
|
children: "?"
|
|
1221
1221
|
}
|
|
@@ -1230,19 +1230,19 @@ const lt = "movmo-card-number", ct = "movmo-card-cvv", dt = (r) => ({
|
|
|
1230
1230
|
"input",
|
|
1231
1231
|
{
|
|
1232
1232
|
id: "movmo-card-zip",
|
|
1233
|
-
ref:
|
|
1233
|
+
ref: oe,
|
|
1234
1234
|
type: "text",
|
|
1235
1235
|
inputMode: "numeric",
|
|
1236
1236
|
autoComplete: "postal-code",
|
|
1237
1237
|
placeholder: "ZIP code",
|
|
1238
|
-
value:
|
|
1239
|
-
onChange: (
|
|
1240
|
-
var
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1238
|
+
value: ae,
|
|
1239
|
+
onChange: (T) => {
|
|
1240
|
+
var U;
|
|
1241
|
+
const A = pt(T.target.value);
|
|
1242
|
+
be(A), yr(A) && !de.current ? (de.current = !0, (U = ke.current) == null || U.focus()) : yr(A) || (de.current = !1);
|
|
1243
1243
|
},
|
|
1244
|
-
className:
|
|
1245
|
-
disabled:
|
|
1244
|
+
className: te(pr, ae && !Ce && "border-error-500"),
|
|
1245
|
+
disabled: _e,
|
|
1246
1246
|
required: !0,
|
|
1247
1247
|
"data-testid": "movmo-card-zip-input"
|
|
1248
1248
|
}
|
|
@@ -1255,32 +1255,32 @@ const lt = "movmo-card-number", ct = "movmo-card-cvv", dt = (r) => ({
|
|
|
1255
1255
|
"input",
|
|
1256
1256
|
{
|
|
1257
1257
|
id: "movmo-card-cardholder-name",
|
|
1258
|
-
ref:
|
|
1258
|
+
ref: ke,
|
|
1259
1259
|
type: "text",
|
|
1260
1260
|
autoComplete: "cc-name",
|
|
1261
1261
|
placeholder: "Cardholder name",
|
|
1262
|
-
value:
|
|
1263
|
-
onChange: (
|
|
1264
|
-
className:
|
|
1265
|
-
disabled:
|
|
1262
|
+
value: O,
|
|
1263
|
+
onChange: (T) => _(T.target.value),
|
|
1264
|
+
className: pr,
|
|
1265
|
+
disabled: _e,
|
|
1266
1266
|
required: !0,
|
|
1267
1267
|
"data-testid": "movmo-card-cardholder-name-input"
|
|
1268
1268
|
}
|
|
1269
1269
|
)
|
|
1270
1270
|
] }),
|
|
1271
|
-
!
|
|
1271
|
+
!k && !f ? /* @__PURE__ */ a.jsx(
|
|
1272
1272
|
"button",
|
|
1273
1273
|
{
|
|
1274
1274
|
type: "submit",
|
|
1275
|
-
disabled: !
|
|
1276
|
-
className:
|
|
1275
|
+
disabled: !Q,
|
|
1276
|
+
className: te(
|
|
1277
1277
|
"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",
|
|
1278
1278
|
"disabled:cursor-not-allowed disabled:bg-grayWarm-300 disabled:text-grayWarm-500"
|
|
1279
1279
|
),
|
|
1280
1280
|
"data-testid": "movmo-card-save",
|
|
1281
|
-
children:
|
|
1281
|
+
children: ue ? "Saving…" : P === "loading" ? "Loading…" : "Save card"
|
|
1282
1282
|
}
|
|
1283
|
-
) :
|
|
1283
|
+
) : ue && k ? (
|
|
1284
1284
|
// In autoSave mode (empty-state inline form, no Save button at all),
|
|
1285
1285
|
// surface the in-flight state as inline text. The modal flow uses a
|
|
1286
1286
|
// spinner inside the modal-footer Save button instead — see
|
|
@@ -1299,10 +1299,10 @@ const lt = "movmo-card-number", ct = "movmo-card-cvv", dt = (r) => ({
|
|
|
1299
1299
|
}
|
|
1300
1300
|
);
|
|
1301
1301
|
};
|
|
1302
|
-
|
|
1302
|
+
Ar.displayName = "MovmoCardForm";
|
|
1303
1303
|
const ht = (r) => {
|
|
1304
|
-
const [t, n] =
|
|
1305
|
-
return { deletePaymentMethod:
|
|
1304
|
+
const [t, n] = C("idle"), [s, i] = C(null);
|
|
1305
|
+
return { deletePaymentMethod: Y(
|
|
1306
1306
|
async (u) => {
|
|
1307
1307
|
n("pending"), i(null);
|
|
1308
1308
|
try {
|
|
@@ -1315,12 +1315,12 @@ const ht = (r) => {
|
|
|
1315
1315
|
[r]
|
|
1316
1316
|
), status: t, error: s };
|
|
1317
1317
|
}, yt = (r) => {
|
|
1318
|
-
const [t, n] =
|
|
1319
|
-
return { setDefault:
|
|
1318
|
+
const [t, n] = C("idle"), [s, i] = C(null);
|
|
1319
|
+
return { setDefault: Y(
|
|
1320
1320
|
async (u) => {
|
|
1321
1321
|
n("pending"), i(null);
|
|
1322
1322
|
try {
|
|
1323
|
-
await
|
|
1323
|
+
await Dr(r, u, { isDefault: !0 }), n("idle");
|
|
1324
1324
|
} catch (x) {
|
|
1325
1325
|
const m = x instanceof Error ? x.message : "Failed to set default payment method.";
|
|
1326
1326
|
throw i(m), n("error"), x;
|
|
@@ -1329,43 +1329,43 @@ const ht = (r) => {
|
|
|
1329
1329
|
[r]
|
|
1330
1330
|
), status: t, error: s };
|
|
1331
1331
|
}, vt = (r) => {
|
|
1332
|
-
const [t, n] =
|
|
1333
|
-
return { updatePaymentMethod:
|
|
1332
|
+
const [t, n] = C("idle"), [s, i] = C(null);
|
|
1333
|
+
return { updatePaymentMethod: Y(
|
|
1334
1334
|
async (u, x) => {
|
|
1335
1335
|
n("pending"), i(null);
|
|
1336
1336
|
try {
|
|
1337
|
-
await
|
|
1337
|
+
await Dr(r, u, x), n("idle");
|
|
1338
1338
|
} catch (m) {
|
|
1339
|
-
const
|
|
1340
|
-
throw i(
|
|
1339
|
+
const k = m instanceof Error ? m.message : "Failed to update payment method.";
|
|
1340
|
+
throw i(k), n("error"), m;
|
|
1341
1341
|
}
|
|
1342
1342
|
},
|
|
1343
1343
|
[r]
|
|
1344
1344
|
), status: t, error: s };
|
|
1345
1345
|
}, xt = (r) => {
|
|
1346
|
-
const [t, n] =
|
|
1347
|
-
|
|
1348
|
-
var
|
|
1349
|
-
if ((
|
|
1350
|
-
|
|
1346
|
+
const [t, n] = C([]), [s, i] = C("idle"), [l, u] = C(null), [x, m] = C(0), k = I(null);
|
|
1347
|
+
D(() => {
|
|
1348
|
+
var y;
|
|
1349
|
+
if ((y = k.current) == null || y.abort(), !r) {
|
|
1350
|
+
k.current = null, n([]), u(null), i("ready");
|
|
1351
1351
|
return;
|
|
1352
1352
|
}
|
|
1353
|
-
const
|
|
1354
|
-
return
|
|
1355
|
-
|
|
1356
|
-
}).catch((
|
|
1357
|
-
if (
|
|
1358
|
-
const
|
|
1359
|
-
u(
|
|
1353
|
+
const f = new AbortController();
|
|
1354
|
+
return k.current = f, i("loading"), u(null), at(r, f.signal).then((w) => {
|
|
1355
|
+
f.signal.aborted || (n(w), i("ready"));
|
|
1356
|
+
}).catch((w) => {
|
|
1357
|
+
if (f.signal.aborted || w instanceof DOMException && w.name === "AbortError") return;
|
|
1358
|
+
const S = w instanceof Error ? w.message : "Failed to fetch payment methods.";
|
|
1359
|
+
u(S), i("error");
|
|
1360
1360
|
}), () => {
|
|
1361
|
-
|
|
1361
|
+
f.abort();
|
|
1362
1362
|
};
|
|
1363
1363
|
}, [r, x]);
|
|
1364
|
-
const
|
|
1365
|
-
m((
|
|
1364
|
+
const b = Y(() => {
|
|
1365
|
+
m((f) => f + 1);
|
|
1366
1366
|
}, []);
|
|
1367
|
-
return { items: t, status: s, error: l, refetch:
|
|
1368
|
-
},
|
|
1367
|
+
return { items: t, status: s, error: l, refetch: b };
|
|
1368
|
+
}, Ur = ({
|
|
1369
1369
|
open: r,
|
|
1370
1370
|
onClose: t,
|
|
1371
1371
|
title: n,
|
|
@@ -1375,18 +1375,18 @@ const ht = (r) => {
|
|
|
1375
1375
|
saveLabel: u = "Save",
|
|
1376
1376
|
isSaving: x = !1,
|
|
1377
1377
|
testIdPrefix: m = "payment-method",
|
|
1378
|
-
children:
|
|
1379
|
-
}) => (
|
|
1378
|
+
children: k
|
|
1379
|
+
}) => (D(() => {
|
|
1380
1380
|
if (!r) return;
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1381
|
+
const b = (f) => {
|
|
1382
|
+
f.key === "Escape" && t();
|
|
1383
1383
|
};
|
|
1384
|
-
return document.addEventListener("keydown",
|
|
1385
|
-
}, [r, t]),
|
|
1384
|
+
return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
|
|
1385
|
+
}, [r, t]), D(() => {
|
|
1386
1386
|
if (!r) return;
|
|
1387
|
-
const
|
|
1387
|
+
const b = document.body.style.overflow;
|
|
1388
1388
|
return document.body.style.overflow = "hidden", () => {
|
|
1389
|
-
document.body.style.overflow =
|
|
1389
|
+
document.body.style.overflow = b;
|
|
1390
1390
|
};
|
|
1391
1391
|
}, [r]), r ? /* @__PURE__ */ a.jsx(
|
|
1392
1392
|
"div",
|
|
@@ -1395,8 +1395,8 @@ const ht = (r) => {
|
|
|
1395
1395
|
"aria-modal": "true",
|
|
1396
1396
|
"aria-labelledby": s,
|
|
1397
1397
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",
|
|
1398
|
-
onClick: (
|
|
1399
|
-
|
|
1398
|
+
onClick: (b) => {
|
|
1399
|
+
b.target === b.currentTarget && t();
|
|
1400
1400
|
},
|
|
1401
1401
|
"data-testid": `${m}-modal`,
|
|
1402
1402
|
children: /* @__PURE__ */ a.jsxs("div", { className: "flex max-h-full w-full max-w-md flex-col rounded-xl bg-white shadow-2xl", children: [
|
|
@@ -1424,7 +1424,7 @@ const ht = (r) => {
|
|
|
1424
1424
|
/* @__PURE__ */ a.jsx("h2", { id: s, className: "flex-1 text-center text-base font-semibold text-grayWarm-900", children: n }),
|
|
1425
1425
|
/* @__PURE__ */ a.jsx("span", { "aria-hidden": "true", className: "h-9 w-9 flex-shrink-0" })
|
|
1426
1426
|
] }),
|
|
1427
|
-
/* @__PURE__ */ a.jsx("div", { className: "flex-1 overflow-y-auto p-4", children:
|
|
1427
|
+
/* @__PURE__ */ a.jsx("div", { className: "flex-1 overflow-y-auto p-4", children: k }),
|
|
1428
1428
|
/* @__PURE__ */ a.jsxs("div", { className: "flex gap-3 border-t border-grayWarm-200 p-4", children: [
|
|
1429
1429
|
/* @__PURE__ */ a.jsx(
|
|
1430
1430
|
"button",
|
|
@@ -1444,7 +1444,7 @@ const ht = (r) => {
|
|
|
1444
1444
|
disabled: x ? !1 : l,
|
|
1445
1445
|
"aria-disabled": x || l,
|
|
1446
1446
|
"aria-busy": x,
|
|
1447
|
-
className:
|
|
1447
|
+
className: te(
|
|
1448
1448
|
"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",
|
|
1449
1449
|
x ? "cursor-not-allowed opacity-90 pointer-events-none" : "hover:bg-brand-600 disabled:cursor-not-allowed disabled:bg-grayWarm-300 disabled:text-grayWarm-500"
|
|
1450
1450
|
),
|
|
@@ -1497,7 +1497,7 @@ const ht = (r) => {
|
|
|
1497
1497
|
isSaving: l = !1,
|
|
1498
1498
|
children: u
|
|
1499
1499
|
}) => /* @__PURE__ */ a.jsx(
|
|
1500
|
-
|
|
1500
|
+
Ur,
|
|
1501
1501
|
{
|
|
1502
1502
|
open: r,
|
|
1503
1503
|
onClose: t,
|
|
@@ -1522,25 +1522,25 @@ const ht = (r) => {
|
|
|
1522
1522
|
isSaving: i = !1,
|
|
1523
1523
|
error: l = null
|
|
1524
1524
|
}) => {
|
|
1525
|
-
const u = Jr(), [x, m] =
|
|
1526
|
-
if (
|
|
1527
|
-
r && t && (m(t.cardholderName ?? ""),
|
|
1525
|
+
const u = Jr(), [x, m] = C(""), [k, b] = C("");
|
|
1526
|
+
if (D(() => {
|
|
1527
|
+
r && t && (m(t.cardholderName ?? ""), b(t.zip ?? ""));
|
|
1528
1528
|
}, [r, t]), !t) return null;
|
|
1529
|
-
const
|
|
1530
|
-
if (
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1529
|
+
const f = x.trim(), y = k.trim(), w = f !== (t.cardholderName ?? "").trim(), S = y !== (t.zip ?? "").trim(), le = w || S, O = (!w || f.length > 0) && (!S || /^[A-Za-z0-9 -]{3,20}$/.test(y)), _ = !le || !O, g = (q) => {
|
|
1530
|
+
if (q.preventDefault(), _ || i) return;
|
|
1531
|
+
const ae = {};
|
|
1532
|
+
w && (ae.cardholderName = f), S && (ae.zip = y), s(ae).catch(() => {
|
|
1533
1533
|
});
|
|
1534
1534
|
};
|
|
1535
1535
|
return /* @__PURE__ */ a.jsxs(
|
|
1536
|
-
|
|
1536
|
+
Ur,
|
|
1537
1537
|
{
|
|
1538
1538
|
open: r,
|
|
1539
1539
|
onClose: n,
|
|
1540
1540
|
title: "Edit payment method",
|
|
1541
1541
|
titleId: "movmo-edit-payment-title",
|
|
1542
1542
|
formId: u,
|
|
1543
|
-
saveDisabled:
|
|
1543
|
+
saveDisabled: _,
|
|
1544
1544
|
isSaving: i,
|
|
1545
1545
|
testIdPrefix: "edit-payment-method",
|
|
1546
1546
|
children: [
|
|
@@ -1565,7 +1565,7 @@ const ht = (r) => {
|
|
|
1565
1565
|
]
|
|
1566
1566
|
}
|
|
1567
1567
|
),
|
|
1568
|
-
/* @__PURE__ */ a.jsxs("form", { id: u, onSubmit:
|
|
1568
|
+
/* @__PURE__ */ a.jsxs("form", { id: u, onSubmit: g, className: "flex flex-col gap-4", noValidate: !0, children: [
|
|
1569
1569
|
/* @__PURE__ */ a.jsxs("label", { className: "flex flex-col gap-1.5 text-sm font-medium text-grayWarm-700", children: [
|
|
1570
1570
|
"Cardholder name",
|
|
1571
1571
|
/* @__PURE__ */ a.jsx(
|
|
@@ -1574,7 +1574,7 @@ const ht = (r) => {
|
|
|
1574
1574
|
type: "text",
|
|
1575
1575
|
autoComplete: "cc-name",
|
|
1576
1576
|
value: x,
|
|
1577
|
-
onChange: (
|
|
1577
|
+
onChange: (q) => m(q.target.value),
|
|
1578
1578
|
disabled: i,
|
|
1579
1579
|
maxLength: 255,
|
|
1580
1580
|
"data-testid": "edit-payment-method-cardholder",
|
|
@@ -1590,8 +1590,8 @@ const ht = (r) => {
|
|
|
1590
1590
|
type: "text",
|
|
1591
1591
|
inputMode: "numeric",
|
|
1592
1592
|
autoComplete: "postal-code",
|
|
1593
|
-
value:
|
|
1594
|
-
onChange: (
|
|
1593
|
+
value: k,
|
|
1594
|
+
onChange: (q) => b(q.target.value),
|
|
1595
1595
|
disabled: i,
|
|
1596
1596
|
maxLength: 20,
|
|
1597
1597
|
"data-testid": "edit-payment-method-zip",
|
|
@@ -1625,7 +1625,7 @@ const ht = (r) => {
|
|
|
1625
1625
|
}) => /* @__PURE__ */ a.jsxs(
|
|
1626
1626
|
"div",
|
|
1627
1627
|
{
|
|
1628
|
-
className:
|
|
1628
|
+
className: te("flex items-center gap-3", n && "cursor-pointer", i),
|
|
1629
1629
|
onClick: n,
|
|
1630
1630
|
role: n ? "button" : void 0,
|
|
1631
1631
|
tabIndex: n ? 0 : void 0,
|
|
@@ -1639,7 +1639,7 @@ const ht = (r) => {
|
|
|
1639
1639
|
t
|
|
1640
1640
|
]
|
|
1641
1641
|
}
|
|
1642
|
-
), Nt = (r, t, n = /* @__PURE__ */ new Date()) => t < n.getFullYear() || t === n.getFullYear() && r < n.getMonth() + 1,
|
|
1642
|
+
), Nt = (r, t, n = /* @__PURE__ */ new Date()) => t < n.getFullYear() || t === n.getFullYear() && r < n.getMonth() + 1, Pr = (r) => {
|
|
1643
1643
|
if (!r) return "Card";
|
|
1644
1644
|
const t = r.toLowerCase();
|
|
1645
1645
|
return t === "amex" ? "Amex" : t.charAt(0).toUpperCase() + t.slice(1);
|
|
@@ -1653,25 +1653,25 @@ const ht = (r) => {
|
|
|
1653
1653
|
onEdit: u,
|
|
1654
1654
|
disabled: x,
|
|
1655
1655
|
showDefaultBadge: m,
|
|
1656
|
-
hideSetDefaultMenuItem:
|
|
1657
|
-
cardLabelFormat:
|
|
1656
|
+
hideSetDefaultMenuItem: k,
|
|
1657
|
+
cardLabelFormat: b = "branded"
|
|
1658
1658
|
}) => {
|
|
1659
|
-
const [
|
|
1660
|
-
|
|
1661
|
-
if (!
|
|
1662
|
-
const
|
|
1663
|
-
var
|
|
1664
|
-
(
|
|
1659
|
+
const [f, y] = C(!1), w = I(null), S = Nt(r.expMonth, r.expYear);
|
|
1660
|
+
D(() => {
|
|
1661
|
+
if (!f) return;
|
|
1662
|
+
const O = (_) => {
|
|
1663
|
+
var g;
|
|
1664
|
+
(g = w.current) != null && g.contains(_.target) || y(!1);
|
|
1665
1665
|
};
|
|
1666
|
-
return document.addEventListener("mousedown",
|
|
1667
|
-
}, [
|
|
1668
|
-
const
|
|
1666
|
+
return document.addEventListener("mousedown", O), () => document.removeEventListener("mousedown", O);
|
|
1667
|
+
}, [f]);
|
|
1668
|
+
const le = () => {
|
|
1669
1669
|
t && s && !x && s(r);
|
|
1670
1670
|
};
|
|
1671
1671
|
return /* @__PURE__ */ a.jsxs(
|
|
1672
1672
|
"div",
|
|
1673
1673
|
{
|
|
1674
|
-
className:
|
|
1674
|
+
className: te(
|
|
1675
1675
|
// items-start + per-element mt offsets so the radio, brand icon, and
|
|
1676
1676
|
// label all read as one horizontal line, with the Exp text directly
|
|
1677
1677
|
// below the label in the same column. Matches main's flights-ui +
|
|
@@ -1681,7 +1681,7 @@ const ht = (r) => {
|
|
|
1681
1681
|
t && !x && "cursor-pointer",
|
|
1682
1682
|
t && (n ? "border-grayWarm-950 shadow-[0_0_0_1px_#1c1917]" : "border-grayWarm-200 hover:border-grayWarm-300")
|
|
1683
1683
|
),
|
|
1684
|
-
onClick:
|
|
1684
|
+
onClick: le,
|
|
1685
1685
|
"data-testid": `payment-method-row-${r.id}`,
|
|
1686
1686
|
children: [
|
|
1687
1687
|
t ? /* @__PURE__ */ a.jsx(
|
|
@@ -1691,8 +1691,8 @@ const ht = (r) => {
|
|
|
1691
1691
|
name: "movmo-payment-method",
|
|
1692
1692
|
checked: n,
|
|
1693
1693
|
onChange: () => s == null ? void 0 : s(r),
|
|
1694
|
-
onClick: (
|
|
1695
|
-
"aria-label": `Select ${
|
|
1694
|
+
onClick: (O) => O.stopPropagation(),
|
|
1695
|
+
"aria-label": `Select ${Pr(r.brand)} ending ${r.last4}`,
|
|
1696
1696
|
className: "mr-1 h-4 w-4 mt-2 cursor-pointer appearance-none rounded-full border-2 border-grayWarm-300 checked:border-[5px] checked:border-grayWarm-950 bg-white checked:bg-white focus:ring-0 focus:ring-offset-0",
|
|
1697
1697
|
disabled: x
|
|
1698
1698
|
}
|
|
@@ -1700,7 +1700,7 @@ const ht = (r) => {
|
|
|
1700
1700
|
/* @__PURE__ */ a.jsx(Se, { brand: r.brand, className: "flex-shrink-0" }),
|
|
1701
1701
|
/* @__PURE__ */ a.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1702
1702
|
/* @__PURE__ */ a.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1703
|
-
/* @__PURE__ */ a.jsx("span", { className: "text-lg font-semibold text-grayWarm-950", children:
|
|
1703
|
+
/* @__PURE__ */ a.jsx("span", { className: "text-lg font-semibold text-grayWarm-950", children: b === "masked" ? `•••• ${r.last4}` : `${Pr(r.brand)} ${r.last4}` }),
|
|
1704
1704
|
m && r.isDefault ? /* @__PURE__ */ a.jsx(
|
|
1705
1705
|
"span",
|
|
1706
1706
|
{
|
|
@@ -1709,7 +1709,7 @@ const ht = (r) => {
|
|
|
1709
1709
|
children: "Default"
|
|
1710
1710
|
}
|
|
1711
1711
|
) : null,
|
|
1712
|
-
|
|
1712
|
+
S ? /* @__PURE__ */ a.jsx(
|
|
1713
1713
|
"span",
|
|
1714
1714
|
{
|
|
1715
1715
|
className: "inline-flex items-center rounded-full bg-error-50 px-2 py-0.5 text-xs font-semibold text-error-700",
|
|
@@ -1718,33 +1718,33 @@ const ht = (r) => {
|
|
|
1718
1718
|
}
|
|
1719
1719
|
) : null
|
|
1720
1720
|
] }),
|
|
1721
|
-
/* @__PURE__ */ a.jsxs("div", { className:
|
|
1721
|
+
/* @__PURE__ */ a.jsxs("div", { className: te("text-base", S ? "text-grayWarm-400" : "text-grayWarm-600"), children: [
|
|
1722
1722
|
"Exp. ",
|
|
1723
1723
|
Ct(r.expMonth, r.expYear)
|
|
1724
1724
|
] })
|
|
1725
1725
|
] }),
|
|
1726
|
-
/* @__PURE__ */ a.jsxs("div", { className: "relative flex-shrink-0", ref:
|
|
1726
|
+
/* @__PURE__ */ a.jsxs("div", { className: "relative flex-shrink-0", ref: w, children: [
|
|
1727
1727
|
/* @__PURE__ */ a.jsx(
|
|
1728
1728
|
"button",
|
|
1729
1729
|
{
|
|
1730
1730
|
type: "button",
|
|
1731
1731
|
"aria-label": `Open actions for card ending ${r.last4}`,
|
|
1732
1732
|
"aria-haspopup": "menu",
|
|
1733
|
-
"aria-expanded":
|
|
1733
|
+
"aria-expanded": f,
|
|
1734
1734
|
className: "rounded-lg p-2 text-grayWarm-600 transition-colors hover:bg-grayWarm-100 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1735
1735
|
disabled: x,
|
|
1736
|
-
onClick: (
|
|
1737
|
-
|
|
1736
|
+
onClick: (O) => {
|
|
1737
|
+
O.stopPropagation(), y((_) => !_);
|
|
1738
1738
|
},
|
|
1739
1739
|
"data-testid": `menu-trigger-${r.id}`,
|
|
1740
1740
|
children: /* @__PURE__ */ a.jsx("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a.jsx("path", { d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) })
|
|
1741
1741
|
}
|
|
1742
1742
|
),
|
|
1743
|
-
|
|
1743
|
+
f ? /* @__PURE__ */ a.jsxs(
|
|
1744
1744
|
"div",
|
|
1745
1745
|
{
|
|
1746
1746
|
role: "menu",
|
|
1747
|
-
className:
|
|
1747
|
+
className: te(
|
|
1748
1748
|
"absolute z-10 whitespace-nowrap rounded-lg border border-grayWarm-200 bg-white py-1 shadow-lg",
|
|
1749
1749
|
// selectable mode (flights-ui): the row has a thick border that a
|
|
1750
1750
|
// top-aligned dropdown would crash through. Float the menu ABOVE
|
|
@@ -1754,7 +1754,7 @@ const ht = (r) => {
|
|
|
1754
1754
|
// overlap; keep the menu below + right-aligned.
|
|
1755
1755
|
t ? "bottom-full left-1/2 mb-2 -translate-x-1/2" : "right-0 top-full mt-1"
|
|
1756
1756
|
),
|
|
1757
|
-
onClick: (
|
|
1757
|
+
onClick: (O) => O.stopPropagation(),
|
|
1758
1758
|
"data-testid": `menu-${r.id}`,
|
|
1759
1759
|
children: [
|
|
1760
1760
|
t ? (
|
|
@@ -1769,14 +1769,14 @@ const ht = (r) => {
|
|
|
1769
1769
|
}
|
|
1770
1770
|
)
|
|
1771
1771
|
) : null,
|
|
1772
|
-
!r.isDefault && !
|
|
1772
|
+
!r.isDefault && !k ? /* @__PURE__ */ a.jsx(
|
|
1773
1773
|
"button",
|
|
1774
1774
|
{
|
|
1775
1775
|
type: "button",
|
|
1776
1776
|
role: "menuitem",
|
|
1777
1777
|
className: "block w-full px-4 py-1 text-left text-md font-semibold text-grayWarm-950 hover:text-grayWarm-700",
|
|
1778
1778
|
onClick: () => {
|
|
1779
|
-
|
|
1779
|
+
y(!1), i(r);
|
|
1780
1780
|
},
|
|
1781
1781
|
"data-testid": `menu-set-default-${r.id}`,
|
|
1782
1782
|
children: "Set as default"
|
|
@@ -1789,7 +1789,7 @@ const ht = (r) => {
|
|
|
1789
1789
|
role: "menuitem",
|
|
1790
1790
|
className: "block w-full px-4 py-1 text-left text-md font-semibold text-grayWarm-950 hover:text-grayWarm-700",
|
|
1791
1791
|
onClick: () => {
|
|
1792
|
-
|
|
1792
|
+
y(!1), u(r);
|
|
1793
1793
|
},
|
|
1794
1794
|
"data-testid": `menu-edit-${r.id}`,
|
|
1795
1795
|
children: "Edit"
|
|
@@ -1802,7 +1802,7 @@ const ht = (r) => {
|
|
|
1802
1802
|
role: "menuitem",
|
|
1803
1803
|
className: "block w-full px-4 py-1 text-left text-md font-semibold text-error-700 hover:text-error-500",
|
|
1804
1804
|
onClick: () => {
|
|
1805
|
-
|
|
1805
|
+
y(!1), l(r);
|
|
1806
1806
|
},
|
|
1807
1807
|
"data-testid": `menu-remove-${r.id}`,
|
|
1808
1808
|
children: "Delete"
|
|
@@ -1815,7 +1815,7 @@ const ht = (r) => {
|
|
|
1815
1815
|
]
|
|
1816
1816
|
}
|
|
1817
1817
|
);
|
|
1818
|
-
}, Rt = (r) => `${Be().iconCdnBaseUrl}/website/assets/icons/payments/${r}.svg`,
|
|
1818
|
+
}, Rt = (r) => `${Be().iconCdnBaseUrl}/website/assets/icons/payments/${r}.svg`, vr = ({ slug: r, alt: t }) => /* @__PURE__ */ a.jsx(
|
|
1819
1819
|
"img",
|
|
1820
1820
|
{
|
|
1821
1821
|
src: Rt(r),
|
|
@@ -1824,7 +1824,7 @@ const ht = (r) => {
|
|
|
1824
1824
|
loading: "lazy",
|
|
1825
1825
|
style: { height: 20, width: "auto" }
|
|
1826
1826
|
}
|
|
1827
|
-
),
|
|
1827
|
+
), cr = ({
|
|
1828
1828
|
type: r,
|
|
1829
1829
|
label: t,
|
|
1830
1830
|
iconNode: n,
|
|
@@ -1848,7 +1848,7 @@ const ht = (r) => {
|
|
|
1848
1848
|
disabled: s,
|
|
1849
1849
|
onChange: () => {
|
|
1850
1850
|
},
|
|
1851
|
-
className:
|
|
1851
|
+
className: te(
|
|
1852
1852
|
"h-4 w-4 accent-grayWarm-900",
|
|
1853
1853
|
s ? "cursor-not-allowed" : "cursor-pointer"
|
|
1854
1854
|
),
|
|
@@ -1862,7 +1862,7 @@ const ht = (r) => {
|
|
|
1862
1862
|
]
|
|
1863
1863
|
}
|
|
1864
1864
|
)
|
|
1865
|
-
),
|
|
1865
|
+
), Tr = ({
|
|
1866
1866
|
selected: r,
|
|
1867
1867
|
onSelect: t,
|
|
1868
1868
|
creditCardBody: n,
|
|
@@ -1870,11 +1870,11 @@ const ht = (r) => {
|
|
|
1870
1870
|
className: i
|
|
1871
1871
|
}) => {
|
|
1872
1872
|
const l = r === "credit_card";
|
|
1873
|
-
return /* @__PURE__ */ a.jsxs("div", { className:
|
|
1873
|
+
return /* @__PURE__ */ a.jsxs("div", { className: te("flex w-full flex-col gap-3", i), children: [
|
|
1874
1874
|
/* @__PURE__ */ a.jsxs(
|
|
1875
1875
|
"label",
|
|
1876
1876
|
{
|
|
1877
|
-
className:
|
|
1877
|
+
className: te(
|
|
1878
1878
|
"flex cursor-pointer flex-col gap-3 rounded-lg border px-4 py-3 transition-colors",
|
|
1879
1879
|
l ? "border-grayWarm-900 shadow-[0_0_0_1px_#1c1917]" : "border-grayWarm-200"
|
|
1880
1880
|
),
|
|
@@ -1892,7 +1892,7 @@ const ht = (r) => {
|
|
|
1892
1892
|
onChange: () => {
|
|
1893
1893
|
s || t("credit_card");
|
|
1894
1894
|
},
|
|
1895
|
-
className:
|
|
1895
|
+
className: te(
|
|
1896
1896
|
"h-4 w-4 accent-grayWarm-900",
|
|
1897
1897
|
s ? "cursor-not-allowed" : "cursor-pointer"
|
|
1898
1898
|
),
|
|
@@ -1920,34 +1920,34 @@ const ht = (r) => {
|
|
|
1920
1920
|
}
|
|
1921
1921
|
) : null,
|
|
1922
1922
|
/* @__PURE__ */ a.jsx(
|
|
1923
|
-
|
|
1923
|
+
cr,
|
|
1924
1924
|
{
|
|
1925
1925
|
type: "paypal",
|
|
1926
1926
|
label: "PayPal",
|
|
1927
|
-
iconNode: /* @__PURE__ */ a.jsx(
|
|
1927
|
+
iconNode: /* @__PURE__ */ a.jsx(vr, { slug: "paypal", alt: "PayPal" }),
|
|
1928
1928
|
disabled: s
|
|
1929
1929
|
}
|
|
1930
1930
|
),
|
|
1931
1931
|
/* @__PURE__ */ a.jsx(
|
|
1932
|
-
|
|
1932
|
+
cr,
|
|
1933
1933
|
{
|
|
1934
1934
|
type: "googlepay",
|
|
1935
1935
|
label: "GooglePay",
|
|
1936
|
-
iconNode: /* @__PURE__ */ a.jsx(
|
|
1936
|
+
iconNode: /* @__PURE__ */ a.jsx(vr, { slug: "google-pay", alt: "GooglePay" }),
|
|
1937
1937
|
disabled: s
|
|
1938
1938
|
}
|
|
1939
1939
|
),
|
|
1940
1940
|
/* @__PURE__ */ a.jsx(
|
|
1941
|
-
|
|
1941
|
+
cr,
|
|
1942
1942
|
{
|
|
1943
1943
|
type: "klarna",
|
|
1944
1944
|
label: "Klarna",
|
|
1945
|
-
iconNode: /* @__PURE__ */ a.jsx(
|
|
1945
|
+
iconNode: /* @__PURE__ */ a.jsx(vr, { slug: "klarna", alt: "Klarna" }),
|
|
1946
1946
|
disabled: s
|
|
1947
1947
|
}
|
|
1948
1948
|
),
|
|
1949
1949
|
/* @__PURE__ */ a.jsx(
|
|
1950
|
-
|
|
1950
|
+
cr,
|
|
1951
1951
|
{
|
|
1952
1952
|
type: "ach",
|
|
1953
1953
|
label: "Bank account (ACH)",
|
|
@@ -1956,14 +1956,14 @@ const ht = (r) => {
|
|
|
1956
1956
|
}
|
|
1957
1957
|
)
|
|
1958
1958
|
] });
|
|
1959
|
-
},
|
|
1959
|
+
}, Sr = "movmo-add-payment-form", Pt = (r) => {
|
|
1960
1960
|
console.error("@movmo_app/payments: failed to update payment method", r);
|
|
1961
1961
|
const t = r instanceof Error ? r.message.trim() : "";
|
|
1962
1962
|
return /spreedly-backed cards/i.test(t) ? "This card's details can't be edited." : t || "Failed to update payment method.";
|
|
1963
|
-
},
|
|
1963
|
+
}, Fr = (r) => {
|
|
1964
1964
|
const t = r.filter((s) => s.isDefault), n = r.filter((s) => !s.isDefault);
|
|
1965
1965
|
return [...t, ...n];
|
|
1966
|
-
},
|
|
1966
|
+
}, Wr = ({ withDefaultBadge: r = !1 }) => /* @__PURE__ */ a.jsxs("div", { className: "flex items-start justify-between py-4", "data-testid": "payment-method-skeleton", children: [
|
|
1967
1967
|
/* @__PURE__ */ a.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
1968
1968
|
/* @__PURE__ */ a.jsx("div", { className: "h-8 w-[46px] flex-shrink-0 animate-pulse rounded bg-grayWarm-200" }),
|
|
1969
1969
|
/* @__PURE__ */ a.jsxs("div", { className: "space-y-2", children: [
|
|
@@ -1984,187 +1984,206 @@ const ht = (r) => {
|
|
|
1984
1984
|
onSelect: l,
|
|
1985
1985
|
onChange: u,
|
|
1986
1986
|
onError: x,
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1987
|
+
onEvent: m,
|
|
1988
|
+
paymentTypeSelector: k = !0,
|
|
1989
|
+
autoSaveFirstCard: b = !0,
|
|
1990
|
+
selectionSetsDefault: f = !1,
|
|
1991
|
+
showDefaultBadge: y = !0,
|
|
1992
|
+
collapsible: w = !1,
|
|
1993
|
+
cardLabelFormat: S = "branded",
|
|
1994
|
+
className: le
|
|
1994
1995
|
}) => {
|
|
1995
|
-
const { items:
|
|
1996
|
-
|
|
1997
|
-
|
|
1996
|
+
const { items: O, status: _, error: g, refetch: q } = xt(r), { deletePaymentMethod: ae, status: be } = ht(r), { setDefault: pe, status: ne } = yt(r), { updatePaymentMethod: ce, status: M } = vt(r), [j, he] = C([]), Ne = I(j);
|
|
1997
|
+
D(() => {
|
|
1998
|
+
Ne.current = j;
|
|
1999
|
+
}, [j]);
|
|
2000
|
+
const [P, v] = C(null), [p, R] = C(!1), [L, J] = C(null), [ye, Z] = C(!1), [se, X] = C(!1), [W, ee] = C(null), [Ce, ve] = C(null), [xe, de] = C(null), [oe, ke] = C(!1), Oe = I(!1), ue = I(x);
|
|
2001
|
+
D(() => {
|
|
2002
|
+
ue.current = x;
|
|
1998
2003
|
}, [x]);
|
|
1999
|
-
const
|
|
2000
|
-
var
|
|
2001
|
-
(
|
|
2002
|
-
}, []), we =
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
}, [
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2004
|
+
const Q = Y((d) => {
|
|
2005
|
+
var K;
|
|
2006
|
+
(K = ue.current) == null || K.call(ue, d);
|
|
2007
|
+
}, []), we = I(m);
|
|
2008
|
+
D(() => {
|
|
2009
|
+
we.current = m;
|
|
2010
|
+
}, [m]);
|
|
2011
|
+
const V = Y((d, K) => {
|
|
2012
|
+
var z;
|
|
2013
|
+
(z = we.current) == null || z.call(we, d, K);
|
|
2014
|
+
}, []), je = Y(() => {
|
|
2015
|
+
R(!1), J(null), de(null);
|
|
2016
|
+
}, []), Fe = t ?? ([n, s].filter(Boolean).join(" ") || void 0);
|
|
2017
|
+
D(() => {
|
|
2018
|
+
_ === "ready" && he(Fr(O));
|
|
2019
|
+
}, [O, _]);
|
|
2020
|
+
const _e = I(null);
|
|
2021
|
+
D(() => {
|
|
2022
|
+
if (_ === "error" && g) {
|
|
2023
|
+
if (_e.current === g) return;
|
|
2024
|
+
_e.current = g, Q({ source: "list", message: g });
|
|
2025
|
+
} else _ !== "error" && (_e.current = null);
|
|
2026
|
+
}, [_, g, Q]), D(() => {
|
|
2027
|
+
if (!l || Oe.current || _ !== "ready" || j.length === 0 || i) return;
|
|
2028
|
+
Oe.current = !0, V("autoselected", { had_saved_methods: !0 });
|
|
2029
|
+
const d = j.find((K) => K.isDefault) ?? j[0];
|
|
2018
2030
|
l(d);
|
|
2019
|
-
}, [l, _,
|
|
2020
|
-
const
|
|
2031
|
+
}, [l, _, j, i, V]);
|
|
2032
|
+
const re = Y(
|
|
2021
2033
|
(d) => {
|
|
2022
|
-
|
|
2023
|
-
const
|
|
2024
|
-
return queueMicrotask(() => u == null ? void 0 : u(
|
|
2034
|
+
he((K) => {
|
|
2035
|
+
const z = typeof d == "function" ? d(K) : d, B = Fr(z);
|
|
2036
|
+
return queueMicrotask(() => u == null ? void 0 : u(B)), B;
|
|
2025
2037
|
});
|
|
2026
2038
|
},
|
|
2027
2039
|
[u]
|
|
2028
|
-
),
|
|
2040
|
+
), T = be === "pending" || ne === "pending" || M === "pending", A = Y(
|
|
2029
2041
|
async (d) => {
|
|
2030
|
-
const
|
|
2031
|
-
|
|
2042
|
+
const K = j;
|
|
2043
|
+
v(null), re((z) => z.map((B) => ({ ...B, isDefault: B.id === d.id })));
|
|
2032
2044
|
try {
|
|
2033
|
-
await
|
|
2034
|
-
} catch (
|
|
2035
|
-
|
|
2036
|
-
const
|
|
2037
|
-
|
|
2045
|
+
await pe(d.id), q(), V("set_default");
|
|
2046
|
+
} catch (z) {
|
|
2047
|
+
he(K), u == null || u(K);
|
|
2048
|
+
const B = z instanceof Error ? z.message : "Failed to set default payment method.";
|
|
2049
|
+
v(B), Q({ source: "set-default", message: B, cause: z });
|
|
2038
2050
|
}
|
|
2039
2051
|
},
|
|
2040
|
-
[
|
|
2041
|
-
),
|
|
2052
|
+
[j, re, pe, q, u, Q, V]
|
|
2053
|
+
), U = Y(
|
|
2042
2054
|
(d) => {
|
|
2043
|
-
l == null || l(d),
|
|
2055
|
+
l == null || l(d), f && (d.isDefault || A(d));
|
|
2044
2056
|
},
|
|
2045
|
-
[l,
|
|
2046
|
-
),
|
|
2057
|
+
[l, f, A]
|
|
2058
|
+
), fe = Y(
|
|
2059
|
+
(d) => {
|
|
2060
|
+
V("selected", { method_count: j.length }), U(d);
|
|
2061
|
+
},
|
|
2062
|
+
[V, j, U]
|
|
2063
|
+
), dr = Y(
|
|
2047
2064
|
async (d) => {
|
|
2048
|
-
const
|
|
2049
|
-
|
|
2050
|
-
const
|
|
2051
|
-
|
|
2052
|
-
const
|
|
2053
|
-
|
|
2054
|
-
const
|
|
2065
|
+
const K = j;
|
|
2066
|
+
v(null);
|
|
2067
|
+
const z = j.filter((Re) => Re.id !== d.id);
|
|
2068
|
+
re(() => z);
|
|
2069
|
+
const B = d.id === i && l ? z.find((Re) => Re.isDefault) ?? z[0] ?? null : null;
|
|
2070
|
+
B && U(B);
|
|
2071
|
+
const Ee = !!B && f && B !== null && !B.isDefault;
|
|
2055
2072
|
try {
|
|
2056
|
-
await
|
|
2057
|
-
} catch (
|
|
2058
|
-
|
|
2059
|
-
const
|
|
2060
|
-
|
|
2073
|
+
await ae(d.id), Ee || q(), V("deleted", { remaining_count: z.length });
|
|
2074
|
+
} catch (Re) {
|
|
2075
|
+
he(K), u == null || u(K);
|
|
2076
|
+
const Ge = Re instanceof Error ? Re.message : "Failed to delete payment method.";
|
|
2077
|
+
v(Ge), Q({ source: "delete", message: Ge, cause: Re });
|
|
2061
2078
|
}
|
|
2062
2079
|
},
|
|
2063
2080
|
[
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2081
|
+
j,
|
|
2082
|
+
re,
|
|
2083
|
+
ae,
|
|
2084
|
+
q,
|
|
2068
2085
|
u,
|
|
2069
2086
|
i,
|
|
2070
2087
|
l,
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2088
|
+
U,
|
|
2089
|
+
f,
|
|
2090
|
+
Q,
|
|
2091
|
+
V
|
|
2074
2092
|
]
|
|
2075
|
-
),
|
|
2076
|
-
|
|
2077
|
-
}, []),
|
|
2078
|
-
|
|
2079
|
-
}, []),
|
|
2093
|
+
), er = Y((d) => {
|
|
2094
|
+
ve(null), ee(d);
|
|
2095
|
+
}, []), $e = Y(() => {
|
|
2096
|
+
ee(null), ve(null);
|
|
2097
|
+
}, []), rr = Y(
|
|
2080
2098
|
async (d) => {
|
|
2081
|
-
if (!
|
|
2082
|
-
const
|
|
2083
|
-
|
|
2084
|
-
(
|
|
2085
|
-
(
|
|
2086
|
-
...
|
|
2099
|
+
if (!W) return;
|
|
2100
|
+
const K = W, z = j;
|
|
2101
|
+
ve(null), re(
|
|
2102
|
+
(B) => B.map(
|
|
2103
|
+
(Ee) => Ee.id === K.id ? {
|
|
2104
|
+
...Ee,
|
|
2087
2105
|
...d.cardholderName !== void 0 ? { cardholderName: d.cardholderName } : {},
|
|
2088
2106
|
...d.zip !== void 0 ? { zip: d.zip } : {}
|
|
2089
|
-
} :
|
|
2107
|
+
} : Ee
|
|
2090
2108
|
)
|
|
2091
2109
|
);
|
|
2092
2110
|
try {
|
|
2093
|
-
await
|
|
2094
|
-
} catch (
|
|
2095
|
-
|
|
2096
|
-
const
|
|
2097
|
-
|
|
2111
|
+
await ce(K.id, d), $e(), q(), V("edited", { fields: Object.keys(d) });
|
|
2112
|
+
} catch (B) {
|
|
2113
|
+
he(z), u == null || u(z);
|
|
2114
|
+
const Ee = Pt(B);
|
|
2115
|
+
ve(Ee), Q({ source: "update", message: Ee, cause: B });
|
|
2098
2116
|
}
|
|
2099
2117
|
},
|
|
2100
2118
|
[
|
|
2119
|
+
W,
|
|
2120
|
+
j,
|
|
2121
|
+
re,
|
|
2122
|
+
ce,
|
|
2101
2123
|
q,
|
|
2102
|
-
v,
|
|
2103
|
-
Z,
|
|
2104
|
-
H,
|
|
2105
|
-
w,
|
|
2106
2124
|
u,
|
|
2107
|
-
|
|
2108
|
-
|
|
2125
|
+
$e,
|
|
2126
|
+
Q,
|
|
2127
|
+
V
|
|
2109
2128
|
]
|
|
2110
|
-
),
|
|
2129
|
+
), tr = Y(
|
|
2111
2130
|
(d) => {
|
|
2112
|
-
|
|
2131
|
+
J(null), R(!1), de(null), re((z) => [d, ...z.filter((B) => B.id !== d.id)]), U(d), !!l && f && !d.isDefault || q(), V("added", { method_count: Ne.current.length + 1 });
|
|
2113
2132
|
},
|
|
2114
|
-
[
|
|
2115
|
-
),
|
|
2116
|
-
|
|
2117
|
-
}, []),
|
|
2133
|
+
[re, q, U, l, f, V]
|
|
2134
|
+
), Ye = Y((d) => {
|
|
2135
|
+
J(d);
|
|
2136
|
+
}, []), ar = _ === "ready" && j.length === 0, Ve = typeof l == "function", nr = !Ve && !w, sr = j.length === 0, or = b && j.length === 0, De = Y(
|
|
2118
2137
|
(d) => /* @__PURE__ */ a.jsx(
|
|
2119
|
-
|
|
2138
|
+
Ar,
|
|
2120
2139
|
{
|
|
2121
2140
|
userId: r,
|
|
2122
|
-
isDefault:
|
|
2123
|
-
defaultCardholderName:
|
|
2124
|
-
autoSave: !d &&
|
|
2141
|
+
isDefault: sr,
|
|
2142
|
+
defaultCardholderName: Fe,
|
|
2143
|
+
autoSave: !d && or,
|
|
2125
2144
|
hideInternalSaveButton: d,
|
|
2126
|
-
formId: d ?
|
|
2127
|
-
onCanSubmitChange: d ?
|
|
2128
|
-
onSavingChange: d ?
|
|
2145
|
+
formId: d ? Sr : void 0,
|
|
2146
|
+
onCanSubmitChange: d ? Z : void 0,
|
|
2147
|
+
onSavingChange: d ? X : void 0,
|
|
2129
2148
|
autoFocus: d ? "number" : void 0,
|
|
2130
|
-
onSuccess:
|
|
2131
|
-
onError:
|
|
2132
|
-
onErrorDetail:
|
|
2149
|
+
onSuccess: tr,
|
|
2150
|
+
onError: Ye,
|
|
2151
|
+
onErrorDetail: Q
|
|
2133
2152
|
}
|
|
2134
2153
|
),
|
|
2135
2154
|
[
|
|
2136
2155
|
r,
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2156
|
+
sr,
|
|
2157
|
+
Fe,
|
|
2158
|
+
or,
|
|
2159
|
+
tr,
|
|
2160
|
+
Ye,
|
|
2161
|
+
Q
|
|
2143
2162
|
]
|
|
2144
|
-
), Ke =
|
|
2145
|
-
|
|
2163
|
+
), Ke = Qe(() => De(!1), [De]), qe = Qe(() => De(!0), [De]), Pe = !r, ir = Qe(() => k ? /* @__PURE__ */ a.jsx(
|
|
2164
|
+
Tr,
|
|
2146
2165
|
{
|
|
2147
|
-
selected:
|
|
2148
|
-
onSelect: (d) =>
|
|
2166
|
+
selected: xe,
|
|
2167
|
+
onSelect: (d) => de(d),
|
|
2149
2168
|
creditCardBody: Ke,
|
|
2150
|
-
disabled:
|
|
2169
|
+
disabled: Pe
|
|
2151
2170
|
}
|
|
2152
|
-
) : Ke, [
|
|
2153
|
-
|
|
2171
|
+
) : Ke, [k, xe, Ke, Pe]), Te = Qe(() => k ? /* @__PURE__ */ a.jsx(
|
|
2172
|
+
Tr,
|
|
2154
2173
|
{
|
|
2155
|
-
selected:
|
|
2156
|
-
onSelect: (d) =>
|
|
2174
|
+
selected: xe,
|
|
2175
|
+
onSelect: (d) => de(d),
|
|
2157
2176
|
creditCardBody: qe,
|
|
2158
|
-
disabled:
|
|
2177
|
+
disabled: Pe
|
|
2159
2178
|
}
|
|
2160
|
-
) : qe, [
|
|
2179
|
+
) : qe, [k, xe, qe, Pe]);
|
|
2161
2180
|
return /* @__PURE__ */ a.jsxs(
|
|
2162
2181
|
"div",
|
|
2163
2182
|
{
|
|
2164
|
-
className:
|
|
2183
|
+
className: te("flex w-full flex-col gap-4", le),
|
|
2165
2184
|
"data-testid": "payment-methods-manager",
|
|
2166
2185
|
children: [
|
|
2167
|
-
_ === "loading" &&
|
|
2186
|
+
_ === "loading" && j.length === 0 ? (
|
|
2168
2187
|
// Only show the skeleton on first load — during a silent refetch
|
|
2169
2188
|
// (e.g. after set-default or delete optimistic mutations), the user
|
|
2170
2189
|
// already sees the correct optimistic list and a skeleton flash
|
|
@@ -2172,15 +2191,15 @@ const ht = (r) => {
|
|
|
2172
2191
|
/* @__PURE__ */ a.jsxs(
|
|
2173
2192
|
"div",
|
|
2174
2193
|
{
|
|
2175
|
-
className:
|
|
2194
|
+
className: te(
|
|
2176
2195
|
// Match the real-list shell so layout doesn't reflow when data
|
|
2177
2196
|
// arrives. In selection mode the outer card is suppressed too.
|
|
2178
|
-
|
|
2197
|
+
nr ? "flex flex-col divide-y divide-grayWarm-200 rounded-xl border border-grayWarm-200 px-4 md:px-6" : "flex flex-col gap-2"
|
|
2179
2198
|
),
|
|
2180
2199
|
"data-testid": "payment-methods-loading",
|
|
2181
2200
|
children: [
|
|
2182
|
-
/* @__PURE__ */ a.jsx(
|
|
2183
|
-
/* @__PURE__ */ a.jsx(
|
|
2201
|
+
/* @__PURE__ */ a.jsx(Wr, { withDefaultBadge: !0 }),
|
|
2202
|
+
/* @__PURE__ */ a.jsx(Wr, {})
|
|
2184
2203
|
]
|
|
2185
2204
|
}
|
|
2186
2205
|
)
|
|
@@ -2193,12 +2212,12 @@ const ht = (r) => {
|
|
|
2193
2212
|
className: "flex items-center justify-between gap-3 rounded-md bg-error-50 p-3 text-sm text-error-700",
|
|
2194
2213
|
"data-testid": "payment-methods-list-error",
|
|
2195
2214
|
children: [
|
|
2196
|
-
/* @__PURE__ */ a.jsx("span", { children:
|
|
2215
|
+
/* @__PURE__ */ a.jsx("span", { children: g ?? "Failed to load payment methods." }),
|
|
2197
2216
|
/* @__PURE__ */ a.jsx(
|
|
2198
2217
|
"button",
|
|
2199
2218
|
{
|
|
2200
2219
|
type: "button",
|
|
2201
|
-
onClick:
|
|
2220
|
+
onClick: q,
|
|
2202
2221
|
className: "rounded-md border border-error-700 px-3 py-1 text-xs font-semibold text-error-700 hover:bg-error-50",
|
|
2203
2222
|
children: "Retry"
|
|
2204
2223
|
}
|
|
@@ -2206,27 +2225,27 @@ const ht = (r) => {
|
|
|
2206
2225
|
]
|
|
2207
2226
|
}
|
|
2208
2227
|
) : null,
|
|
2209
|
-
|
|
2228
|
+
P ? /* @__PURE__ */ a.jsx(
|
|
2210
2229
|
"div",
|
|
2211
2230
|
{
|
|
2212
2231
|
role: "alert",
|
|
2213
2232
|
"aria-live": "polite",
|
|
2214
2233
|
className: "rounded-md bg-error-50 p-3 text-sm text-error-700",
|
|
2215
2234
|
"data-testid": "payment-methods-mutation-error",
|
|
2216
|
-
children:
|
|
2235
|
+
children: P
|
|
2217
2236
|
}
|
|
2218
2237
|
) : null,
|
|
2219
|
-
|
|
2238
|
+
w && j.length > 0 ? /* @__PURE__ */ a.jsx("div", { className: "border-t border-grayWarm-200 pt-4", children: /* @__PURE__ */ a.jsxs(
|
|
2220
2239
|
"div",
|
|
2221
2240
|
{
|
|
2222
2241
|
className: "flex items-center justify-between",
|
|
2223
|
-
"data-testid":
|
|
2242
|
+
"data-testid": oe ? "payment-methods-drawer-header" : "payment-methods-collapsed-preview",
|
|
2224
2243
|
children: [
|
|
2225
|
-
|
|
2244
|
+
oe ? /* @__PURE__ */ a.jsx("h3", { className: "text-md font-semibold text-grayWarm-950", children: "Payment methods" }) : /* @__PURE__ */ a.jsx(
|
|
2226
2245
|
_t,
|
|
2227
2246
|
{
|
|
2228
|
-
method:
|
|
2229
|
-
cardLabelFormat:
|
|
2247
|
+
method: j.find((d) => d.id === i) ?? j.find((d) => d.isDefault) ?? j[0],
|
|
2248
|
+
cardLabelFormat: S,
|
|
2230
2249
|
className: "flex-1"
|
|
2231
2250
|
}
|
|
2232
2251
|
),
|
|
@@ -2234,15 +2253,15 @@ const ht = (r) => {
|
|
|
2234
2253
|
"button",
|
|
2235
2254
|
{
|
|
2236
2255
|
type: "button",
|
|
2237
|
-
"aria-label":
|
|
2238
|
-
"aria-expanded":
|
|
2256
|
+
"aria-label": oe ? "Collapse payment methods" : "Expand payment methods",
|
|
2257
|
+
"aria-expanded": oe,
|
|
2239
2258
|
className: "bg-grayWarm-100 p-2 rounded-lg hover:bg-grayWarm-200 transition-colors",
|
|
2240
|
-
onClick: () =>
|
|
2241
|
-
"data-testid":
|
|
2259
|
+
onClick: () => ke((d) => !d),
|
|
2260
|
+
"data-testid": oe ? "payment-methods-drawer-close" : "payment-methods-drawer-open",
|
|
2242
2261
|
children: /* @__PURE__ */ a.jsx(
|
|
2243
2262
|
"img",
|
|
2244
2263
|
{
|
|
2245
|
-
src: `${Be().iconCdnBaseUrl}/website/assets/icons/chevron-${
|
|
2264
|
+
src: `${Be().iconCdnBaseUrl}/website/assets/icons/chevron-${oe ? "up" : "down"}-double.svg`,
|
|
2246
2265
|
alt: "",
|
|
2247
2266
|
className: "w-5 h-5"
|
|
2248
2267
|
}
|
|
@@ -2252,40 +2271,40 @@ const ht = (r) => {
|
|
|
2252
2271
|
]
|
|
2253
2272
|
}
|
|
2254
2273
|
) }) : null,
|
|
2255
|
-
|
|
2274
|
+
j.length > 0 && (!w || oe) ? /* @__PURE__ */ a.jsx(
|
|
2256
2275
|
"div",
|
|
2257
2276
|
{
|
|
2258
|
-
className:
|
|
2277
|
+
className: te(
|
|
2259
2278
|
"flex flex-col",
|
|
2260
2279
|
// accounts-ui (non-selectable, non-collapsible): rounded outer card
|
|
2261
2280
|
// with divide-y separators between rows.
|
|
2262
2281
|
// flights-ui (selectable or collapsible): bare space-y-3 gap between
|
|
2263
2282
|
// per-row bordered tiles; no outer card chrome.
|
|
2264
|
-
|
|
2283
|
+
nr ? "rounded-xl border border-grayWarm-200 px-4 md:px-6 divide-y divide-grayWarm-200" : "space-y-3"
|
|
2265
2284
|
),
|
|
2266
|
-
children:
|
|
2285
|
+
children: j.map((d) => /* @__PURE__ */ a.jsx(
|
|
2267
2286
|
kt,
|
|
2268
2287
|
{
|
|
2269
2288
|
method: d,
|
|
2270
|
-
selectable:
|
|
2271
|
-
selected:
|
|
2272
|
-
onSelect:
|
|
2273
|
-
onSetDefault:
|
|
2274
|
-
onRemove:
|
|
2275
|
-
onEdit:
|
|
2276
|
-
disabled:
|
|
2277
|
-
showDefaultBadge:
|
|
2278
|
-
hideSetDefaultMenuItem:
|
|
2279
|
-
cardLabelFormat:
|
|
2289
|
+
selectable: Ve,
|
|
2290
|
+
selected: Ve && d.id === i,
|
|
2291
|
+
onSelect: fe,
|
|
2292
|
+
onSetDefault: A,
|
|
2293
|
+
onRemove: dr,
|
|
2294
|
+
onEdit: er,
|
|
2295
|
+
disabled: T,
|
|
2296
|
+
showDefaultBadge: y,
|
|
2297
|
+
hideSetDefaultMenuItem: f,
|
|
2298
|
+
cardLabelFormat: S
|
|
2280
2299
|
},
|
|
2281
2300
|
d.id
|
|
2282
2301
|
))
|
|
2283
2302
|
}
|
|
2284
2303
|
) : null,
|
|
2285
|
-
|
|
2304
|
+
ar ? (
|
|
2286
2305
|
// Empty state: render the add-card body inline (per Figma 1536-21454).
|
|
2287
|
-
/* @__PURE__ */ a.jsx("div", { "data-testid": "payment-methods-empty", children:
|
|
2288
|
-
) :
|
|
2306
|
+
/* @__PURE__ */ a.jsx("div", { "data-testid": "payment-methods-empty", children: ir })
|
|
2307
|
+
) : j.length > 0 && (!w || oe) ? (
|
|
2289
2308
|
// Keep the Add button visible during silent refetches (status flips
|
|
2290
2309
|
// back to 'loading' transiently after set-default / delete).
|
|
2291
2310
|
// In collapsible mode only show the Add button when the drawer is open.
|
|
@@ -2294,14 +2313,14 @@ const ht = (r) => {
|
|
|
2294
2313
|
{
|
|
2295
2314
|
type: "button",
|
|
2296
2315
|
onClick: () => {
|
|
2297
|
-
|
|
2316
|
+
J(null), de(null), Z(!1), R(!0);
|
|
2298
2317
|
},
|
|
2299
2318
|
onMouseEnter: () => {
|
|
2300
|
-
|
|
2319
|
+
br().catch(() => {
|
|
2301
2320
|
});
|
|
2302
2321
|
},
|
|
2303
2322
|
onFocus: () => {
|
|
2304
|
-
|
|
2323
|
+
br().catch(() => {
|
|
2305
2324
|
});
|
|
2306
2325
|
},
|
|
2307
2326
|
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",
|
|
@@ -2313,14 +2332,14 @@ const ht = (r) => {
|
|
|
2313
2332
|
/* @__PURE__ */ a.jsxs(
|
|
2314
2333
|
gt,
|
|
2315
2334
|
{
|
|
2316
|
-
open:
|
|
2317
|
-
onClose:
|
|
2318
|
-
formId:
|
|
2319
|
-
saveDisabled: !
|
|
2320
|
-
isSaving:
|
|
2335
|
+
open: p,
|
|
2336
|
+
onClose: je,
|
|
2337
|
+
formId: Sr,
|
|
2338
|
+
saveDisabled: !ye,
|
|
2339
|
+
isSaving: se,
|
|
2321
2340
|
children: [
|
|
2322
|
-
|
|
2323
|
-
|
|
2341
|
+
Te,
|
|
2342
|
+
L ? (
|
|
2324
2343
|
// Single source of truth for save-time errors (API failures + hook
|
|
2325
2344
|
// init failures forwarded from MovmoCardForm.onError). MovmoCardForm
|
|
2326
2345
|
// intentionally does NOT render its own banner — two role="alert"
|
|
@@ -2334,7 +2353,7 @@ const ht = (r) => {
|
|
|
2334
2353
|
"aria-live": "polite",
|
|
2335
2354
|
className: "mt-3 rounded-md bg-error-50 px-3 py-2 text-sm text-error-700",
|
|
2336
2355
|
"data-testid": "payment-methods-modal-error",
|
|
2337
|
-
children:
|
|
2356
|
+
children: L
|
|
2338
2357
|
}
|
|
2339
2358
|
)
|
|
2340
2359
|
) : null
|
|
@@ -2344,12 +2363,12 @@ const ht = (r) => {
|
|
|
2344
2363
|
/* @__PURE__ */ a.jsx(
|
|
2345
2364
|
jt,
|
|
2346
2365
|
{
|
|
2347
|
-
open:
|
|
2348
|
-
method:
|
|
2349
|
-
onClose:
|
|
2350
|
-
onSave:
|
|
2351
|
-
isSaving:
|
|
2352
|
-
error:
|
|
2366
|
+
open: W !== null,
|
|
2367
|
+
method: W,
|
|
2368
|
+
onClose: $e,
|
|
2369
|
+
onSave: rr,
|
|
2370
|
+
isSaving: M === "pending",
|
|
2371
|
+
error: Ce
|
|
2353
2372
|
}
|
|
2354
2373
|
)
|
|
2355
2374
|
]
|
|
@@ -2381,57 +2400,57 @@ const St = "/v1/auth/", Ft = "movmo_csrf_token", Wt = (r) => {
|
|
|
2381
2400
|
readCookie: x = Wt
|
|
2382
2401
|
} = r;
|
|
2383
2402
|
let m = null;
|
|
2384
|
-
const
|
|
2403
|
+
const k = () => {
|
|
2385
2404
|
if (m) return m;
|
|
2386
|
-
const
|
|
2405
|
+
const f = (async () => {
|
|
2387
2406
|
await t();
|
|
2388
2407
|
})();
|
|
2389
|
-
return m =
|
|
2390
|
-
m ===
|
|
2408
|
+
return m = f, f.finally(() => {
|
|
2409
|
+
m === f && (m = null);
|
|
2391
2410
|
}).catch(() => {
|
|
2392
|
-
}),
|
|
2393
|
-
},
|
|
2394
|
-
const
|
|
2395
|
-
if (
|
|
2396
|
-
const
|
|
2397
|
-
for (const [
|
|
2398
|
-
|
|
2411
|
+
}), f;
|
|
2412
|
+
}, b = (f, y) => {
|
|
2413
|
+
const w = new Headers(y == null ? void 0 : y.headers), S = x(s);
|
|
2414
|
+
if (S && !w.has("X-CSRF-Token") && w.set("X-CSRF-Token", S), i) {
|
|
2415
|
+
const le = i(f, y);
|
|
2416
|
+
for (const [O, _] of Object.entries(le))
|
|
2417
|
+
w.has(O) || w.set(O, _);
|
|
2399
2418
|
}
|
|
2400
2419
|
return {
|
|
2401
|
-
...
|
|
2402
|
-
headers:
|
|
2403
|
-
credentials: (
|
|
2420
|
+
...y,
|
|
2421
|
+
headers: w,
|
|
2422
|
+
credentials: (y == null ? void 0 : y.credentials) ?? "include"
|
|
2404
2423
|
};
|
|
2405
2424
|
};
|
|
2406
|
-
return async function(
|
|
2407
|
-
const
|
|
2408
|
-
if (Ot(
|
|
2409
|
-
return
|
|
2425
|
+
return async function(y, w) {
|
|
2426
|
+
const S = await u(y, b(y, w));
|
|
2427
|
+
if (Ot(y).includes(l) || S.status !== 401 && S.status !== 403)
|
|
2428
|
+
return S;
|
|
2410
2429
|
try {
|
|
2411
|
-
await
|
|
2412
|
-
} catch (
|
|
2430
|
+
await k();
|
|
2431
|
+
} catch (_) {
|
|
2413
2432
|
try {
|
|
2414
|
-
n(
|
|
2415
|
-
} catch (
|
|
2433
|
+
n(_);
|
|
2434
|
+
} catch (g) {
|
|
2416
2435
|
console.error(
|
|
2417
2436
|
"@movmo_app/payments: onRefreshFailed callback threw — auth retry path is misconfigured",
|
|
2418
|
-
|
|
2437
|
+
g
|
|
2419
2438
|
);
|
|
2420
2439
|
}
|
|
2421
|
-
return
|
|
2440
|
+
return S;
|
|
2422
2441
|
}
|
|
2423
2442
|
try {
|
|
2424
|
-
return await u(
|
|
2425
|
-
} catch (
|
|
2443
|
+
return await u(y, b(y, w));
|
|
2444
|
+
} catch (_) {
|
|
2426
2445
|
return console.error(
|
|
2427
2446
|
"@movmo_app/payments: retry after token refresh failed — returning original response",
|
|
2428
|
-
|
|
2429
|
-
),
|
|
2447
|
+
_
|
|
2448
|
+
), S;
|
|
2430
2449
|
}
|
|
2431
2450
|
};
|
|
2432
2451
|
};
|
|
2433
2452
|
export {
|
|
2434
|
-
|
|
2453
|
+
Ar as MovmoCardForm,
|
|
2435
2454
|
_t as PaymentMethodPreview,
|
|
2436
2455
|
Tt as PaymentMethodsManager,
|
|
2437
2456
|
Ut as createMovmoAuthFetch,
|