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