@getopenpay/openpay-js-react 0.0.6 → 0.0.7
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.d.ts +1 -1
- package/dist/index.js +67 -66
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare type ElementsFormProps = {
|
|
|
45
45
|
onLoadError?: (message: string) => void;
|
|
46
46
|
onValidationError?: (field: AllFieldNames, errors: string[], elementId?: string) => void;
|
|
47
47
|
onCheckoutStarted?: () => void;
|
|
48
|
-
onCheckoutSuccess?: (invoiceUrls: string[], subscriptionIds: string[]) => void;
|
|
48
|
+
onCheckoutSuccess?: (invoiceUrls: string[], subscriptionIds: string[], customerId: string) => void;
|
|
49
49
|
onCheckoutError?: (message: string) => void;
|
|
50
50
|
baseUrl?: string;
|
|
51
51
|
};
|
package/dist/index.js
CHANGED
|
@@ -16,8 +16,8 @@ const wt = tr({
|
|
|
16
16
|
return r;
|
|
17
17
|
};
|
|
18
18
|
var T = [];
|
|
19
|
-
for (var
|
|
20
|
-
T.push((
|
|
19
|
+
for (var rt = 0; rt < 256; ++rt)
|
|
20
|
+
T.push((rt + 256).toString(16).slice(1));
|
|
21
21
|
function sr(r, e = 0) {
|
|
22
22
|
return (T[r[e + 0]] + T[r[e + 1]] + T[r[e + 2]] + T[r[e + 3]] + "-" + T[r[e + 4]] + T[r[e + 5]] + "-" + T[r[e + 6]] + T[r[e + 7]] + "-" + T[r[e + 8]] + T[r[e + 9]] + "-" + T[r[e + 10]] + T[r[e + 11]] + T[r[e + 12]] + T[r[e + 13]] + T[r[e + 14]] + T[r[e + 15]]).toLowerCase();
|
|
23
23
|
}
|
|
@@ -74,14 +74,14 @@ var x;
|
|
|
74
74
|
}
|
|
75
75
|
r.joinValues = n, r.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
76
76
|
})(x || (x = {}));
|
|
77
|
-
var
|
|
77
|
+
var st;
|
|
78
78
|
(function(r) {
|
|
79
79
|
r.mergeShapes = (e, t) => ({
|
|
80
80
|
...e,
|
|
81
81
|
...t
|
|
82
82
|
// second overwrites first
|
|
83
83
|
});
|
|
84
|
-
})(
|
|
84
|
+
})(st || (st = {}));
|
|
85
85
|
const f = x.arrayToEnum([
|
|
86
86
|
"string",
|
|
87
87
|
"nan",
|
|
@@ -344,7 +344,7 @@ class S {
|
|
|
344
344
|
}
|
|
345
345
|
const y = Object.freeze({
|
|
346
346
|
status: "aborted"
|
|
347
|
-
}), de = (r) => ({ status: "dirty", value: r }),
|
|
347
|
+
}), de = (r) => ({ status: "dirty", value: r }), O = (r) => ({ status: "valid", value: r }), at = (r) => r.status === "aborted", it = (r) => r.status === "dirty", ge = (r) => r.status === "valid", _e = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
348
348
|
function ze(r, e, t, n) {
|
|
349
349
|
if (typeof e == "function" ? r !== e || !n : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
350
350
|
return e.get(r);
|
|
@@ -541,7 +541,7 @@ class g {
|
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
543
|
brand() {
|
|
544
|
-
return new
|
|
544
|
+
return new ct({
|
|
545
545
|
typeName: m.ZodBranded,
|
|
546
546
|
type: this,
|
|
547
547
|
...v(this._def)
|
|
@@ -577,7 +577,7 @@ class g {
|
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
const lr = /^c[^\s-]{8,}$/i, fr = /^[0-9a-z]+$/, hr = /^[0-9A-HJKMNP-TV-Z]{26}$/, pr = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, mr = /^[a-z0-9_-]{21}$/i, yr = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, vr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, gr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
580
|
-
let
|
|
580
|
+
let nt;
|
|
581
581
|
const _r = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, xr = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, br = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ct = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", kr = new RegExp(`^${Ct}$`);
|
|
582
582
|
function Rt(r) {
|
|
583
583
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
@@ -649,7 +649,7 @@ class j extends g {
|
|
|
649
649
|
message: a.message
|
|
650
650
|
}), n.dirty());
|
|
651
651
|
else if (a.kind === "emoji")
|
|
652
|
-
|
|
652
|
+
nt || (nt = new RegExp(gr, "u")), nt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
653
653
|
validation: "emoji",
|
|
654
654
|
code: c.invalid_string,
|
|
655
655
|
message: a.message
|
|
@@ -1266,7 +1266,7 @@ class xe extends g {
|
|
|
1266
1266
|
received: n.parsedType
|
|
1267
1267
|
}), y;
|
|
1268
1268
|
}
|
|
1269
|
-
return
|
|
1269
|
+
return O(e.data);
|
|
1270
1270
|
}
|
|
1271
1271
|
}
|
|
1272
1272
|
xe.create = (r) => new xe({
|
|
@@ -1362,7 +1362,7 @@ class Be extends g {
|
|
|
1362
1362
|
received: n.parsedType
|
|
1363
1363
|
}), y;
|
|
1364
1364
|
}
|
|
1365
|
-
return
|
|
1365
|
+
return O(e.data);
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
1368
|
Be.create = (r) => new Be({
|
|
@@ -1379,7 +1379,7 @@ class be extends g {
|
|
|
1379
1379
|
received: n.parsedType
|
|
1380
1380
|
}), y;
|
|
1381
1381
|
}
|
|
1382
|
-
return
|
|
1382
|
+
return O(e.data);
|
|
1383
1383
|
}
|
|
1384
1384
|
}
|
|
1385
1385
|
be.create = (r) => new be({
|
|
@@ -1396,7 +1396,7 @@ class ke extends g {
|
|
|
1396
1396
|
received: n.parsedType
|
|
1397
1397
|
}), y;
|
|
1398
1398
|
}
|
|
1399
|
-
return
|
|
1399
|
+
return O(e.data);
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
1402
1402
|
ke.create = (r) => new ke({
|
|
@@ -1408,7 +1408,7 @@ class fe extends g {
|
|
|
1408
1408
|
super(...arguments), this._any = !0;
|
|
1409
1409
|
}
|
|
1410
1410
|
_parse(e) {
|
|
1411
|
-
return
|
|
1411
|
+
return O(e.data);
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
1414
|
fe.create = (r) => new fe({
|
|
@@ -1420,7 +1420,7 @@ class Q extends g {
|
|
|
1420
1420
|
super(...arguments), this._unknown = !0;
|
|
1421
1421
|
}
|
|
1422
1422
|
_parse(e) {
|
|
1423
|
-
return
|
|
1423
|
+
return O(e.data);
|
|
1424
1424
|
}
|
|
1425
1425
|
}
|
|
1426
1426
|
Q.create = (r) => new Q({
|
|
@@ -1451,7 +1451,7 @@ class qe extends g {
|
|
|
1451
1451
|
received: n.parsedType
|
|
1452
1452
|
}), y;
|
|
1453
1453
|
}
|
|
1454
|
-
return
|
|
1454
|
+
return O(e.data);
|
|
1455
1455
|
}
|
|
1456
1456
|
}
|
|
1457
1457
|
qe.create = (r) => new qe({
|
|
@@ -1907,7 +1907,7 @@ we.create = (r, e) => new we({
|
|
|
1907
1907
|
typeName: m.ZodUnion,
|
|
1908
1908
|
...v(e)
|
|
1909
1909
|
});
|
|
1910
|
-
const V = (r) => r instanceof Se ? V(r.schema) : r instanceof D ? V(r.innerType()) : r instanceof Ce ? [r.value] : r instanceof Y ? r.options : r instanceof Re ? x.objectValues(r.enum) : r instanceof Oe ? V(r._def.innerType) : r instanceof be ? [void 0] : r instanceof ke ? [null] : r instanceof U ? [void 0, ...V(r.unwrap())] : r instanceof G ? [null, ...V(r.unwrap())] : r instanceof
|
|
1910
|
+
const V = (r) => r instanceof Se ? V(r.schema) : r instanceof D ? V(r.innerType()) : r instanceof Ce ? [r.value] : r instanceof Y ? r.options : r instanceof Re ? x.objectValues(r.enum) : r instanceof Oe ? V(r._def.innerType) : r instanceof be ? [void 0] : r instanceof ke ? [null] : r instanceof U ? [void 0, ...V(r.unwrap())] : r instanceof G ? [null, ...V(r.unwrap())] : r instanceof ct || r instanceof Ze ? V(r.unwrap()) : r instanceof Ie ? V(r._def.innerType) : [];
|
|
1911
1911
|
class We extends g {
|
|
1912
1912
|
_parse(e) {
|
|
1913
1913
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -1970,14 +1970,14 @@ class We extends g {
|
|
|
1970
1970
|
});
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
1973
|
-
function
|
|
1973
|
+
function ot(r, e) {
|
|
1974
1974
|
const t = H(r), n = H(e);
|
|
1975
1975
|
if (r === e)
|
|
1976
1976
|
return { valid: !0, data: r };
|
|
1977
1977
|
if (t === f.object && n === f.object) {
|
|
1978
1978
|
const s = x.objectKeys(e), a = x.objectKeys(r).filter((o) => s.indexOf(o) !== -1), i = { ...r, ...e };
|
|
1979
1979
|
for (const o of a) {
|
|
1980
|
-
const u =
|
|
1980
|
+
const u = ot(r[o], e[o]);
|
|
1981
1981
|
if (!u.valid)
|
|
1982
1982
|
return { valid: !1 };
|
|
1983
1983
|
i[o] = u.data;
|
|
@@ -1988,7 +1988,7 @@ function it(r, e) {
|
|
|
1988
1988
|
return { valid: !1 };
|
|
1989
1989
|
const s = [];
|
|
1990
1990
|
for (let a = 0; a < r.length; a++) {
|
|
1991
|
-
const i = r[a], o = e[a], u =
|
|
1991
|
+
const i = r[a], o = e[a], u = ot(i, o);
|
|
1992
1992
|
if (!u.valid)
|
|
1993
1993
|
return { valid: !1 };
|
|
1994
1994
|
s.push(u.data);
|
|
@@ -1999,10 +1999,10 @@ function it(r, e) {
|
|
|
1999
1999
|
class Te extends g {
|
|
2000
2000
|
_parse(e) {
|
|
2001
2001
|
const { status: t, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
2002
|
-
if (
|
|
2002
|
+
if (at(a) || at(i))
|
|
2003
2003
|
return y;
|
|
2004
|
-
const o =
|
|
2005
|
-
return o.valid ? ((
|
|
2004
|
+
const o = ot(a.value, i.value);
|
|
2005
|
+
return o.valid ? ((it(a) || it(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(n, {
|
|
2006
2006
|
code: c.invalid_intersection_types
|
|
2007
2007
|
}), y);
|
|
2008
2008
|
};
|
|
@@ -2284,7 +2284,7 @@ class ue extends g {
|
|
|
2284
2284
|
const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
|
|
2285
2285
|
if (this._def.returns instanceof he) {
|
|
2286
2286
|
const o = this;
|
|
2287
|
-
return
|
|
2287
|
+
return O(async function(...u) {
|
|
2288
2288
|
const d = new Z([]), p = await o._def.args.parseAsync(u, a).catch((F) => {
|
|
2289
2289
|
throw d.addIssue(n(u, F)), d;
|
|
2290
2290
|
}), w = await Reflect.apply(i, this, p);
|
|
@@ -2294,7 +2294,7 @@ class ue extends g {
|
|
|
2294
2294
|
});
|
|
2295
2295
|
} else {
|
|
2296
2296
|
const o = this;
|
|
2297
|
-
return
|
|
2297
|
+
return O(function(...u) {
|
|
2298
2298
|
const d = o._def.args.safeParse(u, a);
|
|
2299
2299
|
if (!d.success)
|
|
2300
2300
|
throw new Z([n(u, d.error)]);
|
|
@@ -2401,7 +2401,7 @@ class Y extends g {
|
|
|
2401
2401
|
options: n
|
|
2402
2402
|
}), y;
|
|
2403
2403
|
}
|
|
2404
|
-
return
|
|
2404
|
+
return O(e.data);
|
|
2405
2405
|
}
|
|
2406
2406
|
get options() {
|
|
2407
2407
|
return this._def.values;
|
|
@@ -2461,7 +2461,7 @@ class Re extends g {
|
|
|
2461
2461
|
options: s
|
|
2462
2462
|
}), y;
|
|
2463
2463
|
}
|
|
2464
|
-
return
|
|
2464
|
+
return O(e.data);
|
|
2465
2465
|
}
|
|
2466
2466
|
get enum() {
|
|
2467
2467
|
return this._def.values;
|
|
@@ -2486,7 +2486,7 @@ class he extends g {
|
|
|
2486
2486
|
received: t.parsedType
|
|
2487
2487
|
}), y;
|
|
2488
2488
|
const n = t.parsedType === f.promise ? t.data : Promise.resolve(t.data);
|
|
2489
|
-
return
|
|
2489
|
+
return O(n.then((s) => this._def.type.parseAsync(s, {
|
|
2490
2490
|
path: t.path,
|
|
2491
2491
|
errorMap: t.common.contextualErrorMap
|
|
2492
2492
|
})));
|
|
@@ -2588,7 +2588,7 @@ D.createWithPreprocess = (r, e, t) => new D({
|
|
|
2588
2588
|
});
|
|
2589
2589
|
class U extends g {
|
|
2590
2590
|
_parse(e) {
|
|
2591
|
-
return this._getType(e) === f.undefined ?
|
|
2591
|
+
return this._getType(e) === f.undefined ? O(void 0) : this._def.innerType._parse(e);
|
|
2592
2592
|
}
|
|
2593
2593
|
unwrap() {
|
|
2594
2594
|
return this._def.innerType;
|
|
@@ -2601,7 +2601,7 @@ U.create = (r, e) => new U({
|
|
|
2601
2601
|
});
|
|
2602
2602
|
class G extends g {
|
|
2603
2603
|
_parse(e) {
|
|
2604
|
-
return this._getType(e) === f.null ?
|
|
2604
|
+
return this._getType(e) === f.null ? O(null) : this._def.innerType._parse(e);
|
|
2605
2605
|
}
|
|
2606
2606
|
unwrap() {
|
|
2607
2607
|
return this._def.innerType;
|
|
@@ -2693,7 +2693,7 @@ Ke.create = (r) => new Ke({
|
|
|
2693
2693
|
...v(r)
|
|
2694
2694
|
});
|
|
2695
2695
|
const Sr = Symbol("zod_brand");
|
|
2696
|
-
class
|
|
2696
|
+
class ct extends g {
|
|
2697
2697
|
_parse(e) {
|
|
2698
2698
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2699
2699
|
return this._def.type._parse({
|
|
@@ -2799,16 +2799,16 @@ var _ = /* @__PURE__ */ Object.freeze({
|
|
|
2799
2799
|
ParseStatus: S,
|
|
2800
2800
|
INVALID: y,
|
|
2801
2801
|
DIRTY: de,
|
|
2802
|
-
OK:
|
|
2803
|
-
isAborted:
|
|
2804
|
-
isDirty:
|
|
2802
|
+
OK: O,
|
|
2803
|
+
isAborted: at,
|
|
2804
|
+
isDirty: it,
|
|
2805
2805
|
isValid: ge,
|
|
2806
2806
|
isAsync: _e,
|
|
2807
2807
|
get util() {
|
|
2808
2808
|
return x;
|
|
2809
2809
|
},
|
|
2810
2810
|
get objectUtil() {
|
|
2811
|
-
return
|
|
2811
|
+
return st;
|
|
2812
2812
|
},
|
|
2813
2813
|
ZodParsedType: f,
|
|
2814
2814
|
getParsedType: H,
|
|
@@ -2849,7 +2849,7 @@ var _ = /* @__PURE__ */ Object.freeze({
|
|
|
2849
2849
|
ZodCatch: Ie,
|
|
2850
2850
|
ZodNaN: Ke,
|
|
2851
2851
|
BRAND: Sr,
|
|
2852
|
-
ZodBranded:
|
|
2852
|
+
ZodBranded: ct,
|
|
2853
2853
|
ZodPipeline: Ne,
|
|
2854
2854
|
ZodReadonly: Ze,
|
|
2855
2855
|
custom: Zt,
|
|
@@ -2966,7 +2966,8 @@ const k = _.enum([
|
|
|
2966
2966
|
}), wn = _.object({
|
|
2967
2967
|
type: _.literal(k.enum.CHECKOUT_SUCCESS),
|
|
2968
2968
|
invoiceUrls: _.array(_.string()),
|
|
2969
|
-
subscriptionIds: _.array(_.string())
|
|
2969
|
+
subscriptionIds: _.array(_.string()),
|
|
2970
|
+
customerId: _.string()
|
|
2970
2971
|
}), Tn = _.discriminatedUnion("type", [
|
|
2971
2972
|
hn,
|
|
2972
2973
|
mn,
|
|
@@ -3100,14 +3101,14 @@ const Sn = (r) => {
|
|
|
3100
3101
|
onCheckoutSuccess: w,
|
|
3101
3102
|
onCheckoutError: $,
|
|
3102
3103
|
baseUrl: F
|
|
3103
|
-
} = r, B = F ?? On, [X, $t] = E(void 0), [
|
|
3104
|
-
(
|
|
3105
|
-
if (
|
|
3106
|
-
const ie =
|
|
3107
|
-
if (C.formId !== ae || !De || C.nonce in
|
|
3104
|
+
} = r, B = F ?? On, [X, $t] = E(void 0), [dt, Vt] = E([]), [zt, Bt] = E("1px"), [ut, qt] = E(!1), [Ye, lt] = E(void 0), [ft, Ae] = E(!1), [re, Ht] = E([]), [ne, Kt] = E({}), [ht, pt] = E(0), [mt, Ge] = E(!1), [se, Wt] = E(void 0), [Fe, Jt] = E(void 0), [je, Yt] = E(void 0), [Pe, Gt] = E(null), Ft = Dn(Pe == null ? void 0 : Pe.stripePubKey, je, Fe), ae = Me(() => `opjs-form-${Tt()}`, []), pe = kt(null), Xe = Ue(
|
|
3105
|
+
(I) => {
|
|
3106
|
+
if (I.origin !== B || !I.source) return;
|
|
3107
|
+
const ie = I.source, C = Rn(JSON.parse(I.data)), De = C.elementId;
|
|
3108
|
+
if (C.formId !== ae || !De || C.nonce in dt)
|
|
3108
3109
|
return;
|
|
3109
3110
|
Vt((oe) => [...oe, C.nonce]);
|
|
3110
|
-
const
|
|
3111
|
+
const R = C.payload, A = R.type;
|
|
3111
3112
|
if (A === k.enum.FOCUS && s)
|
|
3112
3113
|
s(C.elementId);
|
|
3113
3114
|
else if (A === k.enum.BLUR && a)
|
|
@@ -3115,28 +3116,28 @@ const Sn = (r) => {
|
|
|
3115
3116
|
else if (A === k.enum.CHANGE && i)
|
|
3116
3117
|
i(C.elementId);
|
|
3117
3118
|
else if (A === k.enum.LOADED) {
|
|
3118
|
-
const oe = re.find((
|
|
3119
|
+
const oe = re.find((tt) => tt.contentWindow === ie);
|
|
3119
3120
|
if (Ae(!1), !oe)
|
|
3120
3121
|
return;
|
|
3121
|
-
Kt((
|
|
3122
|
-
const
|
|
3123
|
-
Bt(
|
|
3122
|
+
Kt((tt) => ({ ...tt, [De]: ie }));
|
|
3123
|
+
const et = R.height ? `${R.height}px` : "100%";
|
|
3124
|
+
Bt(et), Yt(R.totalAmountAtoms), Jt(R.currency), Gt(Zn(R)), se || Wt(R.sessionId);
|
|
3124
3125
|
} else if (A === k.enum.TOKENIZE_STARTED)
|
|
3125
3126
|
Ae(!0), p && p();
|
|
3126
3127
|
else if (A === k.enum.TOKENIZE_SUCCESS && Ye) {
|
|
3127
|
-
const oe =
|
|
3128
|
-
!
|
|
3129
|
-
} else A === k.enum.CHECKOUT_SUCCESS ? (Ae(!1),
|
|
3128
|
+
const oe = ht + 1, et = oe === Object.keys(ne).length;
|
|
3129
|
+
!mt && (et || R.isReadyForCheckout) ? (_t(ie, ae, De, Ye, B), Ge(!0), lt(void 0)) : pt(oe);
|
|
3130
|
+
} else A === k.enum.CHECKOUT_SUCCESS ? (Ae(!1), pt(0), Ge(!1), w && w(R.invoiceUrls, R.subscriptionIds, R.customerId)) : A === k.enum.LOAD_ERROR ? u && u(R.message) : A === k.enum.VALIDATION_ERROR ? d && d(R.elementType, R.errors, De) : (A === k.enum.TOKENIZE_ERROR || A === k.enum.CHECKOUT_ERROR) && (Ae(!1), Ge(!1), $ && $(R.message));
|
|
3130
3131
|
},
|
|
3131
3132
|
[
|
|
3132
3133
|
ae,
|
|
3133
3134
|
se,
|
|
3134
|
-
|
|
3135
|
+
dt,
|
|
3135
3136
|
Ye,
|
|
3136
3137
|
re,
|
|
3137
3138
|
ne,
|
|
3138
|
-
|
|
3139
|
-
|
|
3139
|
+
ht,
|
|
3140
|
+
mt,
|
|
3140
3141
|
a,
|
|
3141
3142
|
i,
|
|
3142
3143
|
s,
|
|
@@ -3149,26 +3150,26 @@ const Sn = (r) => {
|
|
|
3149
3150
|
]
|
|
3150
3151
|
), Xt = Ue(() => {
|
|
3151
3152
|
if (!pe.current || !d || !se) return;
|
|
3152
|
-
const
|
|
3153
|
-
if (
|
|
3153
|
+
const I = Cn(se, pe.current, d);
|
|
3154
|
+
if (I) {
|
|
3154
3155
|
for (const [ie, C] of Object.entries(ne))
|
|
3155
|
-
C && _t(C, ae, ie,
|
|
3156
|
-
|
|
3156
|
+
C && _t(C, ae, ie, I, B);
|
|
3157
|
+
I.type = k.enum.CHECKOUT, lt(I);
|
|
3157
3158
|
}
|
|
3158
|
-
}, [pe, ne, ae, d, se, B]),
|
|
3159
|
-
(
|
|
3160
|
-
|
|
3159
|
+
}, [pe, ne, ae, d, se, B]), Qe = Ue(
|
|
3160
|
+
(I) => {
|
|
3161
|
+
ft && I.preventDefault();
|
|
3161
3162
|
},
|
|
3162
|
-
[
|
|
3163
|
+
[ft]
|
|
3163
3164
|
);
|
|
3164
3165
|
ve(() => {
|
|
3165
|
-
|
|
3166
|
-
}, [re, ne,
|
|
3167
|
-
window.removeEventListener("beforeunload",
|
|
3168
|
-
}), [se,
|
|
3166
|
+
ut || !pe.current || !je || re.length === Object.keys(ne).length && (qt(!0), o && o(je, Fe));
|
|
3167
|
+
}, [re, ne, ut, o, je, Fe]), ve(() => ($t(window.location.origin), window.addEventListener("message", Xe), window.addEventListener("beforeunload", Qe), () => {
|
|
3168
|
+
window.removeEventListener("beforeunload", Qe), window.removeEventListener("message", Xe);
|
|
3169
|
+
}), [se, Xe, Qe]);
|
|
3169
3170
|
const Qt = Ue(
|
|
3170
|
-
(
|
|
3171
|
-
re.find((C) => C.contentWindow ===
|
|
3171
|
+
(I) => {
|
|
3172
|
+
re.find((C) => C.contentWindow === I.contentWindow) || Ht((C) => [...C, I]);
|
|
3172
3173
|
},
|
|
3173
3174
|
[re]
|
|
3174
3175
|
), er = {
|
package/package.json
CHANGED