@movmo_app/payments 0.5.1 → 0.6.0

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