@paynext/sdk 0.0.102 → 0.0.103
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 +187 -187
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -24,14 +24,14 @@ var E = (n, e, t) => new Promise((i, r) => {
|
|
|
24
24
|
var s = (l) => {
|
|
25
25
|
try {
|
|
26
26
|
o(t.next(l));
|
|
27
|
-
} catch (
|
|
28
|
-
r(
|
|
27
|
+
} catch (d) {
|
|
28
|
+
r(d);
|
|
29
29
|
}
|
|
30
30
|
}, a = (l) => {
|
|
31
31
|
try {
|
|
32
32
|
o(t.throw(l));
|
|
33
|
-
} catch (
|
|
34
|
-
r(
|
|
33
|
+
} catch (d) {
|
|
34
|
+
r(d);
|
|
35
35
|
}
|
|
36
36
|
}, o = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(s, a);
|
|
37
37
|
o((t = t.apply(n, e)).next());
|
|
@@ -151,19 +151,19 @@ const Zt = (n = "sandbox") => ({
|
|
|
151
151
|
payment_method_nonce: e.nonce
|
|
152
152
|
};
|
|
153
153
|
}, yn = (n) => {
|
|
154
|
-
var i, r, s, a, o, l,
|
|
154
|
+
var i, r, s, a, o, l, d, u, m, p, h, g, b, v;
|
|
155
155
|
const { applePay: e, googlePay: t } = n;
|
|
156
156
|
if (!(!e && !t))
|
|
157
157
|
return {
|
|
158
158
|
city: ((i = e == null ? void 0 : e.billingContact) == null ? void 0 : i.locality) || ((r = t == null ? void 0 : t.billingAddress) == null ? void 0 : r.locality) || void 0,
|
|
159
159
|
country: ((s = e == null ? void 0 : e.billingContact) == null ? void 0 : s.countryCode) || ((a = t == null ? void 0 : t.billingAddress) == null ? void 0 : a.countryCode) || void 0,
|
|
160
|
-
line1: ((l = (o = e == null ? void 0 : e.billingContact) == null ? void 0 : o.addressLines) == null ? void 0 : l.at(0)) || ((
|
|
161
|
-
line2: ((m = (
|
|
160
|
+
line1: ((l = (o = e == null ? void 0 : e.billingContact) == null ? void 0 : o.addressLines) == null ? void 0 : l.at(0)) || ((d = t == null ? void 0 : t.billingAddress) == null ? void 0 : d.address1) || void 0,
|
|
161
|
+
line2: ((m = (u = e == null ? void 0 : e.billingContact) == null ? void 0 : u.addressLines) == null ? void 0 : m.at(1)) || ((p = t == null ? void 0 : t.billingAddress) == null ? void 0 : p.address2) || void 0,
|
|
162
162
|
postal_code: ((h = e == null ? void 0 : e.billingContact) == null ? void 0 : h.postalCode) || ((g = t == null ? void 0 : t.billingAddress) == null ? void 0 : g.postalCode) || void 0,
|
|
163
163
|
state: ((b = e == null ? void 0 : e.billingContact) == null ? void 0 : b.administrativeArea) || ((v = t == null ? void 0 : t.billingAddress) == null ? void 0 : v.administrativeArea) || void 0
|
|
164
164
|
};
|
|
165
165
|
}, Cn = (n) => {
|
|
166
|
-
var r, s, a, o, l,
|
|
166
|
+
var r, s, a, o, l, d, u, m, p, h, g, b, v, k, V, A, I, L, P;
|
|
167
167
|
const { card: e, googlePay: t, applePay: i } = n;
|
|
168
168
|
if (!(!e && !(t != null && t.card) && !(i != null && i.card)))
|
|
169
169
|
return {
|
|
@@ -171,8 +171,8 @@ const Zt = (n = "sandbox") => ({
|
|
|
171
171
|
bin_data: {
|
|
172
172
|
brand: (e == null ? void 0 : e.cardBrand) || ((r = t == null ? void 0 : t.card) == null ? void 0 : r.brand) || ((s = i == null ? void 0 : i.card) == null ? void 0 : s.brand),
|
|
173
173
|
country: (e == null ? void 0 : e.country) || ((a = t == null ? void 0 : t.card) == null ? void 0 : a.country) || ((o = i == null ? void 0 : i.card) == null ? void 0 : o.country),
|
|
174
|
-
currency_code: (e == null ? void 0 : e.currency) || ((l = t == null ? void 0 : t.card) == null ? void 0 : l.currency) || ((
|
|
175
|
-
funding: (e == null ? void 0 : e.funding) || ((
|
|
174
|
+
currency_code: (e == null ? void 0 : e.currency) || ((l = t == null ? void 0 : t.card) == null ? void 0 : l.currency) || ((d = i == null ? void 0 : i.card) == null ? void 0 : d.currency),
|
|
175
|
+
funding: (e == null ? void 0 : e.funding) || ((u = t == null ? void 0 : t.card) == null ? void 0 : u.funding) || ((m = i == null ? void 0 : i.card) == null ? void 0 : m.funding),
|
|
176
176
|
issuer: (e == null ? void 0 : e.issuer) || ((p = t == null ? void 0 : t.card) == null ? void 0 : p.issuer) || ((h = i == null ? void 0 : i.card) == null ? void 0 : h.issuer),
|
|
177
177
|
type: (e == null ? void 0 : e.type) || ((g = t == null ? void 0 : t.card) == null ? void 0 : g.segment) || ((b = i == null ? void 0 : i.card) == null ? void 0 : b.segment)
|
|
178
178
|
},
|
|
@@ -253,7 +253,7 @@ let Nr = class {
|
|
|
253
253
|
c(this, "onReady");
|
|
254
254
|
this.ev = e;
|
|
255
255
|
}
|
|
256
|
-
init(
|
|
256
|
+
init(u, m) {
|
|
257
257
|
return E(this, arguments, function* ({
|
|
258
258
|
transaction: e,
|
|
259
259
|
locale: t,
|
|
@@ -263,7 +263,7 @@ let Nr = class {
|
|
|
263
263
|
onSuccess: a,
|
|
264
264
|
onCancel: o,
|
|
265
265
|
onPaymentAttempt: l
|
|
266
|
-
},
|
|
266
|
+
}, d) {
|
|
267
267
|
const p = this.ev.transactions.create(e);
|
|
268
268
|
this.apple = this.ev.ui.applePay(p, D(y({
|
|
269
269
|
locale: t,
|
|
@@ -272,7 +272,7 @@ let Nr = class {
|
|
|
272
272
|
width: "100%",
|
|
273
273
|
height: "40px"
|
|
274
274
|
}
|
|
275
|
-
},
|
|
275
|
+
}, d == null ? void 0 : d.styles), {
|
|
276
276
|
allowedCardNetworks: i,
|
|
277
277
|
requestBillingAddress: !0,
|
|
278
278
|
requestPayerDetails: ["name", "email", "phone"],
|
|
@@ -304,7 +304,7 @@ let Nr = class {
|
|
|
304
304
|
c(this, "google", null);
|
|
305
305
|
this.ev = e;
|
|
306
306
|
}
|
|
307
|
-
init(
|
|
307
|
+
init(d, u) {
|
|
308
308
|
return E(this, arguments, function* ({ transaction: e, locale: t, onReady: i, onError: r, onSuccess: s, onCancel: a, onPaymentAttempt: o }, l) {
|
|
309
309
|
const m = this.ev.transactions.create(e);
|
|
310
310
|
this.google = this.ev.ui.googlePay(m, D(y({
|
|
@@ -559,7 +559,7 @@ process.env.NODE_ENV !== "production" && (et = (n, e) => {
|
|
|
559
559
|
const Hr = "easeInOut", Ur = 20;
|
|
560
560
|
function Wr(n, s = {}, i, r) {
|
|
561
561
|
var a = s, { defaultTransition: e = {} } = a, t = se(a, ["defaultTransition"]);
|
|
562
|
-
const o = e.duration || 0.3, l = /* @__PURE__ */ new Map(),
|
|
562
|
+
const o = e.duration || 0.3, l = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), u = {}, m = /* @__PURE__ */ new Map();
|
|
563
563
|
let p = 0, h = 0, g = 0;
|
|
564
564
|
for (let b = 0; b < n.length; b++) {
|
|
565
565
|
const v = n[b];
|
|
@@ -608,20 +608,20 @@ function Wr(n, s = {}, i, r) {
|
|
|
608
608
|
qr(x, $, ne, te, ie, xe), I = Math.max(M + f, I), g = Math.max(xe, g);
|
|
609
609
|
};
|
|
610
610
|
if (J(k)) {
|
|
611
|
-
const P = wn(k,
|
|
611
|
+
const P = wn(k, d);
|
|
612
612
|
L(V, A, xn("default", P));
|
|
613
613
|
} else {
|
|
614
|
-
const P = di(k, V, i,
|
|
614
|
+
const P = di(k, V, i, u), C = P.length;
|
|
615
615
|
for (let x = 0; x < C; x++) {
|
|
616
616
|
V = V, A = A;
|
|
617
|
-
const N = P[x], O = wn(N,
|
|
617
|
+
const N = P[x], O = wn(N, d);
|
|
618
618
|
for (const $ in V)
|
|
619
619
|
L(V[$], Jr(A, $), xn($, O), x, C);
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
622
|
p = h, h += I;
|
|
623
623
|
}
|
|
624
|
-
return
|
|
624
|
+
return d.forEach((b, v) => {
|
|
625
625
|
for (const k in b) {
|
|
626
626
|
const V = b[k];
|
|
627
627
|
V.sort(Yr);
|
|
@@ -703,35 +703,35 @@ function ns(n, e) {
|
|
|
703
703
|
timestamp: 0,
|
|
704
704
|
isProcessing: !1
|
|
705
705
|
};
|
|
706
|
-
function l(
|
|
707
|
-
a.has(
|
|
706
|
+
function l(u) {
|
|
707
|
+
a.has(u) && (d.schedule(u), n()), u(o);
|
|
708
708
|
}
|
|
709
|
-
const
|
|
709
|
+
const d = {
|
|
710
710
|
/**
|
|
711
711
|
* Schedule a process to run on the next frame.
|
|
712
712
|
*/
|
|
713
|
-
schedule: (
|
|
713
|
+
schedule: (u, m = !1, p = !1) => {
|
|
714
714
|
const g = p && r ? t : i;
|
|
715
|
-
return m && a.add(
|
|
715
|
+
return m && a.add(u), g.has(u) || g.add(u), u;
|
|
716
716
|
},
|
|
717
717
|
/**
|
|
718
718
|
* Cancel the provided callback from running on the next frame.
|
|
719
719
|
*/
|
|
720
|
-
cancel: (
|
|
721
|
-
i.delete(
|
|
720
|
+
cancel: (u) => {
|
|
721
|
+
i.delete(u), a.delete(u);
|
|
722
722
|
},
|
|
723
723
|
/**
|
|
724
724
|
* Execute all schedule callbacks.
|
|
725
725
|
*/
|
|
726
|
-
process: (
|
|
727
|
-
if (o =
|
|
726
|
+
process: (u) => {
|
|
727
|
+
if (o = u, r) {
|
|
728
728
|
s = !0;
|
|
729
729
|
return;
|
|
730
730
|
}
|
|
731
|
-
r = !0, [t, i] = [i, t], t.forEach(l), t.clear(), r = !1, s && (s = !1,
|
|
731
|
+
r = !0, [t, i] = [i, t], t.forEach(l), t.clear(), r = !1, s && (s = !1, d.process(u));
|
|
732
732
|
}
|
|
733
733
|
};
|
|
734
|
-
return
|
|
734
|
+
return d;
|
|
735
735
|
}
|
|
736
736
|
const de = {}, is = 40;
|
|
737
737
|
function rs(n, e) {
|
|
@@ -740,9 +740,9 @@ function rs(n, e) {
|
|
|
740
740
|
delta: 0,
|
|
741
741
|
timestamp: 0,
|
|
742
742
|
isProcessing: !1
|
|
743
|
-
}, s = () => t = !0, a = st.reduce((A, I) => (A[I] = ns(s), A), {}), { setup: o, read: l, resolveKeyframes:
|
|
743
|
+
}, s = () => t = !0, a = st.reduce((A, I) => (A[I] = ns(s), A), {}), { setup: o, read: l, resolveKeyframes: d, preUpdate: u, update: m, preRender: p, render: h, postRender: g } = a, b = () => {
|
|
744
744
|
const A = de.useManualTiming ? r.timestamp : performance.now();
|
|
745
|
-
t = !1, de.useManualTiming || (r.delta = i ? 1e3 / 60 : Math.max(Math.min(A - r.timestamp, is), 1)), r.timestamp = A, r.isProcessing = !0, o.process(r), l.process(r),
|
|
745
|
+
t = !1, de.useManualTiming || (r.delta = i ? 1e3 / 60 : Math.max(Math.min(A - r.timestamp, is), 1)), r.timestamp = A, r.isProcessing = !0, o.process(r), l.process(r), d.process(r), u.process(r), m.process(r), p.process(r), h.process(r), g.process(r), r.isProcessing = !1, t && e && (i = !1, n(b));
|
|
746
746
|
}, v = () => {
|
|
747
747
|
t = !0, i = !0, r.isProcessing || n(b);
|
|
748
748
|
};
|
|
@@ -1075,8 +1075,8 @@ const Pe = [
|
|
|
1075
1075
|
duration: 0.3
|
|
1076
1076
|
}, ks = (n, { keyframes: e }) => e.length > 2 ? Cs : De.has(n) ? n.startsWith("scale") ? ys(e[1]) : vs : Es;
|
|
1077
1077
|
function ws(m) {
|
|
1078
|
-
var p = m, { when: n, delay: e, delayChildren: t, staggerChildren: i, staggerDirection: r, repeat: s, repeatType: a, repeatDelay: o, from: l, elapsed:
|
|
1079
|
-
return !!Object.keys(
|
|
1078
|
+
var p = m, { when: n, delay: e, delayChildren: t, staggerChildren: i, staggerDirection: r, repeat: s, repeatType: a, repeatDelay: o, from: l, elapsed: d } = p, u = se(p, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from", "elapsed"]);
|
|
1079
|
+
return !!Object.keys(u).length;
|
|
1080
1080
|
}
|
|
1081
1081
|
function Ei(n, e) {
|
|
1082
1082
|
var t, i;
|
|
@@ -1320,18 +1320,18 @@ function Zs({ duration: n = j.duration, bounce: e = j.bounce, velocity: t = j.ve
|
|
|
1320
1320
|
let r, s;
|
|
1321
1321
|
et(n <= /* @__PURE__ */ ae(j.maxDuration), "Spring duration must be 10 seconds or less");
|
|
1322
1322
|
let a = 1 - e;
|
|
1323
|
-
a = ke(j.minDamping, j.maxDamping, a), n = ke(j.minDuration, j.maxDuration, /* @__PURE__ */ le(n)), a < 1 ? (r = (
|
|
1324
|
-
const
|
|
1323
|
+
a = ke(j.minDamping, j.maxDamping, a), n = ke(j.minDuration, j.maxDuration, /* @__PURE__ */ le(n)), a < 1 ? (r = (d) => {
|
|
1324
|
+
const u = d * a, m = u * n, p = u - t, h = Nt(d, a), g = Math.exp(-m);
|
|
1325
1325
|
return xt - p / h * g;
|
|
1326
|
-
}, s = (
|
|
1327
|
-
const m =
|
|
1328
|
-
return (-r(
|
|
1329
|
-
}) : (r = (
|
|
1330
|
-
const
|
|
1331
|
-
return -xt +
|
|
1332
|
-
}, s = (
|
|
1333
|
-
const
|
|
1334
|
-
return
|
|
1326
|
+
}, s = (d) => {
|
|
1327
|
+
const m = d * a * n, p = m * t + t, h = Math.pow(a, 2) * Math.pow(d, 2) * n, g = Math.exp(-m), b = Nt(Math.pow(d, 2), a);
|
|
1328
|
+
return (-r(d) + xt > 0 ? -1 : 1) * ((p - h) * g) / b;
|
|
1329
|
+
}) : (r = (d) => {
|
|
1330
|
+
const u = Math.exp(-d * n), m = (d - t) * n + 1;
|
|
1331
|
+
return -xt + u * m;
|
|
1332
|
+
}, s = (d) => {
|
|
1333
|
+
const u = Math.exp(-d * n), m = (t - d) * (n * n);
|
|
1334
|
+
return u * m;
|
|
1335
1335
|
});
|
|
1336
1336
|
const o = 5 / n, l = Xs(r, s, o);
|
|
1337
1337
|
if (n = /* @__PURE__ */ ae(n), isNaN(l))
|
|
@@ -1341,10 +1341,10 @@ function Zs({ duration: n = j.duration, bounce: e = j.bounce, velocity: t = j.ve
|
|
|
1341
1341
|
duration: n
|
|
1342
1342
|
};
|
|
1343
1343
|
{
|
|
1344
|
-
const
|
|
1344
|
+
const d = Math.pow(l, 2) * i;
|
|
1345
1345
|
return {
|
|
1346
|
-
stiffness:
|
|
1347
|
-
damping: a * 2 * Math.sqrt(i *
|
|
1346
|
+
stiffness: d,
|
|
1347
|
+
damping: a * 2 * Math.sqrt(i * d),
|
|
1348
1348
|
duration: n
|
|
1349
1349
|
};
|
|
1350
1350
|
}
|
|
@@ -1394,9 +1394,9 @@ function Xe(n = j.visualDuration, e = j.bounce) {
|
|
|
1394
1394
|
bounce: e
|
|
1395
1395
|
} : n;
|
|
1396
1396
|
let { restSpeed: i, restDelta: r } = t;
|
|
1397
|
-
const s = t.keyframes[0], a = t.keyframes[t.keyframes.length - 1], o = { done: !1, value: s }, { stiffness: l, damping:
|
|
1397
|
+
const s = t.keyframes[0], a = t.keyframes[t.keyframes.length - 1], o = { done: !1, value: s }, { stiffness: l, damping: d, mass: u, duration: m, velocity: p, isResolvedFromDuration: h } = ta(D(y({}, t), {
|
|
1398
1398
|
velocity: -/* @__PURE__ */ le(t.velocity || 0)
|
|
1399
|
-
})), g = p || 0, b =
|
|
1399
|
+
})), g = p || 0, b = d / (2 * Math.sqrt(l * u)), v = a - s, k = /* @__PURE__ */ le(Math.sqrt(l / u)), V = Math.abs(v) < 5;
|
|
1400
1400
|
i || (i = V ? j.restSpeed.granular : j.restSpeed.default), r || (r = V ? j.restDelta.granular : j.restDelta.default);
|
|
1401
1401
|
let A;
|
|
1402
1402
|
if (b < 1) {
|
|
@@ -1441,7 +1441,7 @@ Xe.applyToOptions = (n) => {
|
|
|
1441
1441
|
const e = gi(n, 100, Xe);
|
|
1442
1442
|
return n.ease = e.ease, n.duration = /* @__PURE__ */ ae(e.duration), n.type = "keyframes", n;
|
|
1443
1443
|
};
|
|
1444
|
-
function Ot({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 325, bounceDamping: r = 10, bounceStiffness: s = 500, modifyTarget: a, min: o, max: l, restDelta:
|
|
1444
|
+
function Ot({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 325, bounceDamping: r = 10, bounceStiffness: s = 500, modifyTarget: a, min: o, max: l, restDelta: d = 0.5, restSpeed: u }) {
|
|
1445
1445
|
const m = n[0], p = {
|
|
1446
1446
|
done: !1,
|
|
1447
1447
|
value: m
|
|
@@ -1451,7 +1451,7 @@ function Ot({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 3
|
|
|
1451
1451
|
k !== v && (b = k - m);
|
|
1452
1452
|
const V = (x) => -b * Math.exp(-x / i), A = (x) => k + V(x), I = (x) => {
|
|
1453
1453
|
const N = V(x), O = A(x);
|
|
1454
|
-
p.done = Math.abs(N) <=
|
|
1454
|
+
p.done = Math.abs(N) <= d, p.value = p.done ? k : O;
|
|
1455
1455
|
};
|
|
1456
1456
|
let L, P;
|
|
1457
1457
|
const C = (x) => {
|
|
@@ -1461,8 +1461,8 @@ function Ot({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 3
|
|
|
1461
1461
|
// TODO: This should be passing * 1000
|
|
1462
1462
|
damping: r,
|
|
1463
1463
|
stiffness: s,
|
|
1464
|
-
restDelta:
|
|
1465
|
-
restSpeed:
|
|
1464
|
+
restDelta: d,
|
|
1465
|
+
restSpeed: u
|
|
1466
1466
|
}));
|
|
1467
1467
|
};
|
|
1468
1468
|
return C(0), {
|
|
@@ -1493,17 +1493,17 @@ function ia(n, e, { clamp: t = !0, ease: i, mixer: r } = {}) {
|
|
|
1493
1493
|
return () => e[1];
|
|
1494
1494
|
const a = n[0] === n[1];
|
|
1495
1495
|
n[0] > n[s - 1] && (n = [...n].reverse(), e = [...e].reverse());
|
|
1496
|
-
const o = na(e, i, r), l = o.length,
|
|
1497
|
-
if (a &&
|
|
1496
|
+
const o = na(e, i, r), l = o.length, d = (u) => {
|
|
1497
|
+
if (a && u < n[0])
|
|
1498
1498
|
return e[0];
|
|
1499
1499
|
let m = 0;
|
|
1500
1500
|
if (l > 1)
|
|
1501
|
-
for (; m < n.length - 2 && !(
|
|
1501
|
+
for (; m < n.length - 2 && !(u < n[m + 1]); m++)
|
|
1502
1502
|
;
|
|
1503
|
-
const p = /* @__PURE__ */ Xt(n[m], n[m + 1],
|
|
1503
|
+
const p = /* @__PURE__ */ Xt(n[m], n[m + 1], u);
|
|
1504
1504
|
return o[m](p);
|
|
1505
1505
|
};
|
|
1506
|
-
return t ? (
|
|
1506
|
+
return t ? (u) => d(ke(n[0], n[s - 1], u)) : d;
|
|
1507
1507
|
}
|
|
1508
1508
|
function ra(n, e) {
|
|
1509
1509
|
return n.map((t) => t * e);
|
|
@@ -1618,13 +1618,13 @@ class hn extends un {
|
|
|
1618
1618
|
let { keyframes: o } = e;
|
|
1619
1619
|
const l = t || _e;
|
|
1620
1620
|
process.env.NODE_ENV !== "production" && l !== _e && ce(o.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`), l !== _e && typeof o[0] != "number" && (this.mixKeyframes = an(fa, Ii(o[0], o[1])), o = [0, 100]);
|
|
1621
|
-
const
|
|
1621
|
+
const d = l(D(y({}, e), { keyframes: o }));
|
|
1622
1622
|
s === "mirror" && (this.mirroredGenerator = l(D(y({}, e), {
|
|
1623
1623
|
keyframes: [...o].reverse(),
|
|
1624
1624
|
velocity: -a
|
|
1625
|
-
}))),
|
|
1626
|
-
const { calculatedDuration:
|
|
1627
|
-
this.calculatedDuration =
|
|
1625
|
+
}))), d.calculatedDuration === null && (d.calculatedDuration = en(d));
|
|
1626
|
+
const { calculatedDuration: u } = d;
|
|
1627
|
+
this.calculatedDuration = u, this.resolvedDuration = u + r, this.totalDuration = this.resolvedDuration * (i + 1) - r, this.generator = d;
|
|
1628
1628
|
}
|
|
1629
1629
|
updateTime(e) {
|
|
1630
1630
|
const t = Math.round(e - this.startTime) * this.playbackSpeed;
|
|
@@ -1634,9 +1634,9 @@ class hn extends un {
|
|
|
1634
1634
|
const { generator: i, totalDuration: r, mixKeyframes: s, mirroredGenerator: a, resolvedDuration: o, calculatedDuration: l } = this;
|
|
1635
1635
|
if (this.startTime === null)
|
|
1636
1636
|
return i.next(0);
|
|
1637
|
-
const { delay:
|
|
1637
|
+
const { delay: d = 0, keyframes: u, repeat: m, repeatType: p, repeatDelay: h, type: g, onUpdate: b, finalKeyframe: v } = this.options;
|
|
1638
1638
|
this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - r / this.speed, this.startTime)), t ? this.currentTime = e : this.updateTime(e);
|
|
1639
|
-
const k = this.currentTime -
|
|
1639
|
+
const k = this.currentTime - d * (this.playbackSpeed >= 0 ? 1 : -1), V = this.playbackSpeed >= 0 ? k < 0 : k > r;
|
|
1640
1640
|
this.currentTime = Math.max(k, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = r);
|
|
1641
1641
|
let A = this.currentTime, I = i;
|
|
1642
1642
|
if (m) {
|
|
@@ -1644,12 +1644,12 @@ class hn extends un {
|
|
|
1644
1644
|
let N = Math.floor(x), O = x % 1;
|
|
1645
1645
|
!O && x >= 1 && (O = 1), O === 1 && N--, N = Math.min(N, m + 1), !!(N % 2) && (p === "reverse" ? (O = 1 - O, h && (O -= h / o)) : p === "mirror" && (I = a)), A = ke(0, 1, O) * o;
|
|
1646
1646
|
}
|
|
1647
|
-
const L = V ? { done: !1, value:
|
|
1647
|
+
const L = V ? { done: !1, value: u[0] } : I.next(A);
|
|
1648
1648
|
s && (L.value = s(L.value));
|
|
1649
1649
|
let { done: P } = L;
|
|
1650
1650
|
!V && l !== null && (P = this.playbackSpeed >= 0 ? this.currentTime >= r : this.currentTime <= 0);
|
|
1651
1651
|
const C = this.holdTime === null && (this.state === "finished" || this.state === "running" && P);
|
|
1652
|
-
return C && g !== Ot && (L.value = dn(
|
|
1652
|
+
return C && g !== Ot && (L.value = dn(u, this.options, v, this.speed)), b && b(L.value), C && this.finish(), L;
|
|
1653
1653
|
}
|
|
1654
1654
|
/**
|
|
1655
1655
|
* Allows the returned animation to be awaited or promise-chained. Currently
|
|
@@ -1908,13 +1908,13 @@ function Yi(n, e) {
|
|
|
1908
1908
|
if (n)
|
|
1909
1909
|
return typeof n == "function" ? Gi() ? Mi(n, e) : "ease-out" : Bi(n) ? Ge(n) : Array.isArray(n) ? n.map((t) => Yi(t, e) || jn.easeOut) : jn[n];
|
|
1910
1910
|
}
|
|
1911
|
-
function Ia(n, e, t, { delay: i = 0, duration: r = 300, repeat: s = 0, repeatType: a = "loop", ease: o = "easeOut", times: l } = {},
|
|
1912
|
-
const
|
|
1911
|
+
function Ia(n, e, t, { delay: i = 0, duration: r = 300, repeat: s = 0, repeatType: a = "loop", ease: o = "easeOut", times: l } = {}, d = void 0) {
|
|
1912
|
+
const u = {
|
|
1913
1913
|
[e]: t
|
|
1914
1914
|
};
|
|
1915
|
-
l && (
|
|
1915
|
+
l && (u.offset = l);
|
|
1916
1916
|
const m = Yi(o, r);
|
|
1917
|
-
Array.isArray(m) && (
|
|
1917
|
+
Array.isArray(m) && (u.easing = m);
|
|
1918
1918
|
const p = {
|
|
1919
1919
|
delay: i,
|
|
1920
1920
|
duration: r,
|
|
@@ -1923,7 +1923,7 @@ function Ia(n, e, t, { delay: i = 0, duration: r = 300, repeat: s = 0, repeatTyp
|
|
|
1923
1923
|
iterations: s + 1,
|
|
1924
1924
|
direction: a === "reverse" ? "alternate" : "normal"
|
|
1925
1925
|
};
|
|
1926
|
-
return
|
|
1926
|
+
return d && (p.pseudoElement = d), n.animate(u, p);
|
|
1927
1927
|
}
|
|
1928
1928
|
function Ma(t) {
|
|
1929
1929
|
var i = t, { type: n } = i, e = se(i, ["type"]);
|
|
@@ -1936,11 +1936,11 @@ class Pa extends un {
|
|
|
1936
1936
|
return;
|
|
1937
1937
|
const { element: t, name: i, keyframes: r, pseudoElement: s, allowFlatten: a = !1, finalKeyframe: o, onComplete: l } = e;
|
|
1938
1938
|
this.isPseudoElement = !!s, this.allowFlatten = a, this.options = e, ce(typeof e.type != "string", `animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);
|
|
1939
|
-
const
|
|
1940
|
-
this.animation = Ia(t, i, r,
|
|
1939
|
+
const d = Ma(e);
|
|
1940
|
+
this.animation = Ia(t, i, r, d, s), d.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
|
|
1941
1941
|
if (this.finishedTime = this.time, !s) {
|
|
1942
|
-
const
|
|
1943
|
-
this.updateMotionValue ? this.updateMotionValue(
|
|
1942
|
+
const u = dn(r, this.options, o, this.speed);
|
|
1943
|
+
this.updateMotionValue ? this.updateMotionValue(u) : Ta(t, i, u), this.animation.cancel();
|
|
1944
1944
|
}
|
|
1945
1945
|
l == null || l(), this.notifyFinished();
|
|
1946
1946
|
};
|
|
@@ -2047,8 +2047,8 @@ class Na extends Pa {
|
|
|
2047
2047
|
* Motion to calculate velocity for any subsequent animation.
|
|
2048
2048
|
*/
|
|
2049
2049
|
updateMotionValue(e) {
|
|
2050
|
-
var
|
|
2051
|
-
const
|
|
2050
|
+
var u;
|
|
2051
|
+
const d = this.options, { motionValue: t, onUpdate: i, onComplete: r, element: s } = d, a = se(d, ["motionValue", "onUpdate", "onComplete", "element"]);
|
|
2052
2052
|
if (!t)
|
|
2053
2053
|
return;
|
|
2054
2054
|
if (e !== void 0) {
|
|
@@ -2057,7 +2057,7 @@ class Na extends Pa {
|
|
|
2057
2057
|
}
|
|
2058
2058
|
const o = new hn(D(y({}, a), {
|
|
2059
2059
|
autoplay: !1
|
|
2060
|
-
})), l = /* @__PURE__ */ ae((
|
|
2060
|
+
})), l = /* @__PURE__ */ ae((u = this.finishedTime) != null ? u : this.time);
|
|
2061
2061
|
t.setWithVelocity(o.sample(l - zn).value, o.sample(l).value, zn), o.stop();
|
|
2062
2062
|
}
|
|
2063
2063
|
}
|
|
@@ -2096,9 +2096,9 @@ const ja = /* @__PURE__ */ new Set([
|
|
|
2096
2096
|
// "background-color"
|
|
2097
2097
|
]), za = /* @__PURE__ */ mn(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
|
|
2098
2098
|
function Ba(n) {
|
|
2099
|
-
var
|
|
2099
|
+
var d;
|
|
2100
2100
|
const { motionValue: e, name: t, repeatDelay: i, repeatType: r, damping: s, type: a } = n;
|
|
2101
|
-
if (!Fa((
|
|
2101
|
+
if (!Fa((d = e == null ? void 0 : e.owner) == null ? void 0 : d.current))
|
|
2102
2102
|
return !1;
|
|
2103
2103
|
const { onUpdate: o, transformTemplate: l } = e.owner.getProps();
|
|
2104
2104
|
return za() && t && ja.has(t) && (t !== "transform" || !l) && /**
|
|
@@ -2110,7 +2110,7 @@ function Ba(n) {
|
|
|
2110
2110
|
const $a = 40;
|
|
2111
2111
|
class Ka extends un {
|
|
2112
2112
|
constructor(p) {
|
|
2113
|
-
var h = p, { autoplay: e = !0, delay: t = 0, type: i = "keyframes", repeat: r = 0, repeatDelay: s = 0, repeatType: a = "loop", keyframes: o, name: l, motionValue:
|
|
2113
|
+
var h = p, { autoplay: e = !0, delay: t = 0, type: i = "keyframes", repeat: r = 0, repeatDelay: s = 0, repeatType: a = "loop", keyframes: o, name: l, motionValue: d, element: u } = h, m = se(h, ["autoplay", "delay", "type", "repeat", "repeatDelay", "repeatType", "keyframes", "name", "motionValue", "element"]);
|
|
2114
2114
|
var v;
|
|
2115
2115
|
super(), this.stop = () => {
|
|
2116
2116
|
var k, V;
|
|
@@ -2124,21 +2124,21 @@ class Ka extends un {
|
|
|
2124
2124
|
repeatDelay: s,
|
|
2125
2125
|
repeatType: a,
|
|
2126
2126
|
name: l,
|
|
2127
|
-
motionValue:
|
|
2128
|
-
element:
|
|
2129
|
-
}, m), b = (
|
|
2130
|
-
this.keyframeResolver = new b(o, (k, V, A) => this.onKeyframesResolved(k, V, g, !A), l,
|
|
2127
|
+
motionValue: d,
|
|
2128
|
+
element: u
|
|
2129
|
+
}, m), b = (u == null ? void 0 : u.KeyframeResolver) || pn;
|
|
2130
|
+
this.keyframeResolver = new b(o, (k, V, A) => this.onKeyframesResolved(k, V, g, !A), l, d, u), (v = this.keyframeResolver) == null || v.scheduleResolve();
|
|
2131
2131
|
}
|
|
2132
2132
|
onKeyframesResolved(e, t, i, r) {
|
|
2133
2133
|
this.keyframeResolver = void 0;
|
|
2134
|
-
const { name: s, type: a, velocity: o, delay: l, isHandoff:
|
|
2135
|
-
this.resolvedAt = ee.now(), Sa(e, s, a, o) || ((de.instantAnimations || !l) && (
|
|
2134
|
+
const { name: s, type: a, velocity: o, delay: l, isHandoff: d, onUpdate: u } = i;
|
|
2135
|
+
this.resolvedAt = ee.now(), Sa(e, s, a, o) || ((de.instantAnimations || !l) && (u == null || u(dn(e, i, t))), e[0] = e[e.length - 1], i.duration = 0, i.repeat = 0);
|
|
2136
2136
|
const m = r ? this.resolvedAt ? this.resolvedAt - this.createdAt > $a ? this.resolvedAt : this.createdAt : this.createdAt : void 0, p = D(y({
|
|
2137
2137
|
startTime: m,
|
|
2138
2138
|
finalKeyframe: t
|
|
2139
2139
|
}, i), {
|
|
2140
2140
|
keyframes: e
|
|
2141
|
-
}), h = !
|
|
2141
|
+
}), h = !d && Ba(p) ? new Na(D(y({}, p), {
|
|
2142
2142
|
element: p.motionValue.owner.current
|
|
2143
2143
|
})) : new hn(p);
|
|
2144
2144
|
h.finished.then(() => this.notifyFinished()).catch(Me), this.pendingTimeline && (this.stopTimeline = h.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = h;
|
|
@@ -2194,14 +2194,14 @@ class Ka extends un {
|
|
|
2194
2194
|
}
|
|
2195
2195
|
const Wi = (n, e, t, i = {}, r, s) => (a) => {
|
|
2196
2196
|
const o = Ei(i, n) || {}, l = o.delay || i.delay || 0;
|
|
2197
|
-
let { elapsed:
|
|
2198
|
-
|
|
2199
|
-
const
|
|
2197
|
+
let { elapsed: d = 0 } = i;
|
|
2198
|
+
d = d - /* @__PURE__ */ ae(l);
|
|
2199
|
+
const u = D(y({
|
|
2200
2200
|
keyframes: Array.isArray(t) ? t : [null, t],
|
|
2201
2201
|
ease: "easeOut",
|
|
2202
2202
|
velocity: e.getVelocity()
|
|
2203
2203
|
}, o), {
|
|
2204
|
-
delay: -
|
|
2204
|
+
delay: -d,
|
|
2205
2205
|
onUpdate: (p) => {
|
|
2206
2206
|
e.set(p), o.onUpdate && o.onUpdate(p);
|
|
2207
2207
|
},
|
|
@@ -2212,18 +2212,18 @@ const Wi = (n, e, t, i = {}, r, s) => (a) => {
|
|
|
2212
2212
|
motionValue: e,
|
|
2213
2213
|
element: s ? void 0 : r
|
|
2214
2214
|
});
|
|
2215
|
-
ws(o) || Object.assign(
|
|
2215
|
+
ws(o) || Object.assign(u, ks(n, u)), u.duration && (u.duration = /* @__PURE__ */ ae(u.duration)), u.repeatDelay && (u.repeatDelay = /* @__PURE__ */ ae(u.repeatDelay)), u.from !== void 0 && (u.keyframes[0] = u.from);
|
|
2216
2216
|
let m = !1;
|
|
2217
|
-
if ((
|
|
2218
|
-
const p = bs(
|
|
2217
|
+
if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (u.duration = 0, u.delay === 0 && (m = !0)), (de.instantAnimations || de.skipAnimations) && (m = !0, u.duration = 0, u.delay = 0), u.allowFlatten = !o.type && !o.ease, m && !s && e.get() !== void 0) {
|
|
2218
|
+
const p = bs(u.keyframes, o);
|
|
2219
2219
|
if (p !== void 0) {
|
|
2220
2220
|
ue.update(() => {
|
|
2221
|
-
|
|
2221
|
+
u.onUpdate(p), u.onComplete();
|
|
2222
2222
|
});
|
|
2223
2223
|
return;
|
|
2224
2224
|
}
|
|
2225
2225
|
}
|
|
2226
|
-
return o.isSync ? new hn(
|
|
2226
|
+
return o.isSync ? new hn(u) : new Ka(u);
|
|
2227
2227
|
}, Zi = /* @__PURE__ */ new Set([
|
|
2228
2228
|
"width",
|
|
2229
2229
|
"height",
|
|
@@ -2239,12 +2239,12 @@ function qa({ protectedKeys: n, needsAnimating: e }, t) {
|
|
|
2239
2239
|
}
|
|
2240
2240
|
function Ga(n, e, { delay: t = 0, transitionOverride: i, type: r } = {}) {
|
|
2241
2241
|
var m;
|
|
2242
|
-
let
|
|
2242
|
+
let u = e, { transition: s = n.getDefaultTransition(), transitionEnd: a } = u, o = se(u, ["transition", "transitionEnd"]);
|
|
2243
2243
|
i && (s = i);
|
|
2244
|
-
const l = [],
|
|
2244
|
+
const l = [], d = r && n.animationState && n.animationState.getState()[r];
|
|
2245
2245
|
for (const p in o) {
|
|
2246
2246
|
const h = n.getValue(p, (m = n.latestValues[p]) != null ? m : null), g = o[p];
|
|
2247
|
-
if (g === void 0 ||
|
|
2247
|
+
if (g === void 0 || d && qa(d, p))
|
|
2248
2248
|
continue;
|
|
2249
2249
|
const b = y({
|
|
2250
2250
|
delay: t
|
|
@@ -2502,9 +2502,9 @@ class sr {
|
|
|
2502
2502
|
const h = ee.now();
|
|
2503
2503
|
this.renderScheduledAt < h && (this.renderScheduledAt = h, ue.render(this.render, !1, !0));
|
|
2504
2504
|
};
|
|
2505
|
-
const { latestValues: l, renderState:
|
|
2506
|
-
this.latestValues = l, this.baseTarget = y({}, l), this.initialValues = t.initial ? y({}, l) : {}, this.renderState =
|
|
2507
|
-
const p = this.scrapeMotionValuesFromProps(t, {}, this), { willChange:
|
|
2505
|
+
const { latestValues: l, renderState: d } = a;
|
|
2506
|
+
this.latestValues = l, this.baseTarget = y({}, l), this.initialValues = t.initial ? y({}, l) : {}, this.renderState = d, this.parent = e, this.props = t, this.presenceContext = i, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = r, this.options = o, this.blockInitialAnimation = !!s, this.isControllingVariants = Xi(t), this.isVariantNode = to(t), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
2507
|
+
const p = this.scrapeMotionValuesFromProps(t, {}, this), { willChange: u } = p, m = se(p, ["willChange"]);
|
|
2508
2508
|
for (const h in m) {
|
|
2509
2509
|
const g = m[h];
|
|
2510
2510
|
l[h] !== void 0 && J(g) && g.set(l[h], !1);
|
|
@@ -2727,10 +2727,10 @@ class vo extends pn {
|
|
|
2727
2727
|
return;
|
|
2728
2728
|
super.readKeyframes();
|
|
2729
2729
|
for (let l = 0; l < e.length; l++) {
|
|
2730
|
-
let
|
|
2731
|
-
if (typeof
|
|
2732
|
-
const
|
|
2733
|
-
|
|
2730
|
+
let d = e[l];
|
|
2731
|
+
if (typeof d == "string" && (d = d.trim(), nn(d))) {
|
|
2732
|
+
const u = ar(d, t.current);
|
|
2733
|
+
u !== void 0 && (e[l] = u), l === e.length - 1 && (this.finalKeyframe = d);
|
|
2734
2734
|
}
|
|
2735
2735
|
}
|
|
2736
2736
|
if (this.resolveNoneKeyframes(), !Zi.has(i) || e.length !== 2)
|
|
@@ -2739,8 +2739,8 @@ class vo extends pn {
|
|
|
2739
2739
|
if (a !== o)
|
|
2740
2740
|
if (Fn(a) && Fn(o))
|
|
2741
2741
|
for (let l = 0; l < e.length; l++) {
|
|
2742
|
-
const
|
|
2743
|
-
typeof
|
|
2742
|
+
const d = e[l];
|
|
2743
|
+
typeof d == "string" && (e[l] = parseFloat(d));
|
|
2744
2744
|
}
|
|
2745
2745
|
else Ce[i] && (this.needsMeasurement = !0);
|
|
2746
2746
|
}
|
|
@@ -2766,8 +2766,8 @@ class vo extends pn {
|
|
|
2766
2766
|
const r = e.getValue(t);
|
|
2767
2767
|
r && r.jump(this.measuredOrigin, !1);
|
|
2768
2768
|
const s = i.length - 1, a = i[s];
|
|
2769
|
-
i[s] = Ce[t](e.measureViewportBox(), window.getComputedStyle(e.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), (o = this.removedTransforms) != null && o.length && this.removedTransforms.forEach(([l,
|
|
2770
|
-
e.getValue(l).set(
|
|
2769
|
+
i[s] = Ce[t](e.measureViewportBox(), window.getComputedStyle(e.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), (o = this.removedTransforms) != null && o.length && this.removedTransforms.forEach(([l, d]) => {
|
|
2770
|
+
e.getValue(l).set(d);
|
|
2771
2771
|
}), this.resolveNoneKeyframes();
|
|
2772
2772
|
}
|
|
2773
2773
|
}
|
|
@@ -2806,13 +2806,13 @@ function Eo(n, e, t) {
|
|
|
2806
2806
|
continue;
|
|
2807
2807
|
let l = !0;
|
|
2808
2808
|
if (typeof o == "number" ? l = o === (a.startsWith("scale") ? 1 : 0) : l = parseFloat(o) === 0, !l || t) {
|
|
2809
|
-
const
|
|
2809
|
+
const d = lr(o, gn[a]);
|
|
2810
2810
|
if (!l) {
|
|
2811
2811
|
r = !1;
|
|
2812
|
-
const
|
|
2813
|
-
i += `${
|
|
2812
|
+
const u = yo[a] || a;
|
|
2813
|
+
i += `${u}(${d}) `;
|
|
2814
2814
|
}
|
|
2815
|
-
t && (e[a] =
|
|
2815
|
+
t && (e[a] = d);
|
|
2816
2816
|
}
|
|
2817
2817
|
}
|
|
2818
2818
|
return i = i.trim(), t ? i = t(e, r ? "" : i) : r && (i = "none"), i;
|
|
@@ -2821,21 +2821,21 @@ function cr(n, e, t) {
|
|
|
2821
2821
|
const { style: i, vars: r, transformOrigin: s } = n;
|
|
2822
2822
|
let a = !1, o = !1;
|
|
2823
2823
|
for (const l in e) {
|
|
2824
|
-
const
|
|
2824
|
+
const d = e[l];
|
|
2825
2825
|
if (De.has(l)) {
|
|
2826
2826
|
a = !0;
|
|
2827
2827
|
continue;
|
|
2828
2828
|
} else if (wi(l)) {
|
|
2829
|
-
r[l] =
|
|
2829
|
+
r[l] = d;
|
|
2830
2830
|
continue;
|
|
2831
2831
|
} else {
|
|
2832
|
-
const
|
|
2833
|
-
l.startsWith("origin") ? (o = !0, s[l] =
|
|
2832
|
+
const u = lr(d, gn[l]);
|
|
2833
|
+
l.startsWith("origin") ? (o = !0, s[l] = u) : i[l] = u;
|
|
2834
2834
|
}
|
|
2835
2835
|
}
|
|
2836
2836
|
if (e.transform || (a || t ? i.transform = Eo(e, n.transform, t) : i.transform && (i.transform = "none")), o) {
|
|
2837
|
-
const { originX: l = "50%", originY:
|
|
2838
|
-
i.transformOrigin = `${l} ${
|
|
2837
|
+
const { originX: l = "50%", originY: d = "50%", originZ: u = 0 } = s;
|
|
2838
|
+
i.transformOrigin = `${l} ${d} ${u}`;
|
|
2839
2839
|
}
|
|
2840
2840
|
}
|
|
2841
2841
|
function dr(n, { style: e, vars: t }, i, r) {
|
|
@@ -2926,7 +2926,7 @@ function Io(n, e, t = 1, i = 0, r = !0) {
|
|
|
2926
2926
|
const a = _.transform(e), o = _.transform(t);
|
|
2927
2927
|
n[s.array] = `${a} ${o}`;
|
|
2928
2928
|
}
|
|
2929
|
-
function Mo(n, m, l,
|
|
2929
|
+
function Mo(n, m, l, d, u) {
|
|
2930
2930
|
var p = m, {
|
|
2931
2931
|
attrX: e,
|
|
2932
2932
|
attrY: t,
|
|
@@ -2943,13 +2943,13 @@ function Mo(n, m, l, u, d) {
|
|
|
2943
2943
|
"pathOffset"
|
|
2944
2944
|
]);
|
|
2945
2945
|
var b, v;
|
|
2946
|
-
if (cr(n, o,
|
|
2946
|
+
if (cr(n, o, d), l) {
|
|
2947
2947
|
n.style.viewBox && (n.attrs.viewBox = n.style.viewBox);
|
|
2948
2948
|
return;
|
|
2949
2949
|
}
|
|
2950
2950
|
n.attrs = n.style, n.style = {};
|
|
2951
2951
|
const { attrs: h, style: g } = n;
|
|
2952
|
-
h.transform && (g.transform = h.transform, delete h.transform), (g.transform || h.transformOrigin) && (g.transformOrigin = (b = h.transformOrigin) != null ? b : "50% 50%", delete h.transformOrigin), g.transform && (g.transformBox = (v =
|
|
2952
|
+
h.transform && (g.transform = h.transform, delete h.transform), (g.transform || h.transformOrigin) && (g.transformOrigin = (b = h.transformOrigin) != null ? b : "50% 50%", delete h.transformOrigin), g.transform && (g.transformBox = (v = u == null ? void 0 : u.transformBox) != null ? v : "fill-box", delete h.transformBox), e !== void 0 && (h.x = e), t !== void 0 && (h.y = t), i !== void 0 && (h.scale = i), r !== void 0 && Io(h, r, s, a, !1);
|
|
2953
2953
|
}
|
|
2954
2954
|
const hr = /* @__PURE__ */ new Set([
|
|
2955
2955
|
"baseFrequency",
|
|
@@ -3068,10 +3068,10 @@ function mr(n, e, t, i) {
|
|
|
3068
3068
|
const s = di(n, e, i), a = s.length;
|
|
3069
3069
|
ce(!!a, "No valid elements provided.");
|
|
3070
3070
|
for (let o = 0; o < a; o++) {
|
|
3071
|
-
const l = s[o],
|
|
3072
|
-
Ue.has(l) ||
|
|
3073
|
-
const
|
|
3074
|
-
"delay" in m && typeof m.delay == "function" && (m.delay = m.delay(o, a)), r.push(...Ga(
|
|
3071
|
+
const l = s[o], d = l instanceof Element ? So : Fo;
|
|
3072
|
+
Ue.has(l) || d(l);
|
|
3073
|
+
const u = Ue.get(l), m = y({}, t);
|
|
3074
|
+
"delay" in m && typeof m.delay == "function" && (m.delay = m.delay(o, a)), r.push(...Ga(u, D(y({}, e), { transition: m }), {}));
|
|
3075
3075
|
}
|
|
3076
3076
|
}
|
|
3077
3077
|
return r;
|
|
@@ -3457,8 +3457,8 @@ function ml() {
|
|
|
3457
3457
|
for (a = 0; a < r.patterns.length; a++) {
|
|
3458
3458
|
var l = r.patterns[a];
|
|
3459
3459
|
if ((0, e.matches)(i, l)) {
|
|
3460
|
-
var
|
|
3461
|
-
Array.isArray(l) ? o = String(l[0]).length : o = String(l).length, i.length >= o && (
|
|
3460
|
+
var d = (0, n.clone)(r);
|
|
3461
|
+
Array.isArray(l) ? o = String(l[0]).length : o = String(l).length, i.length >= o && (d.matchStrength = o), s.push(d);
|
|
3462
3462
|
break;
|
|
3463
3463
|
}
|
|
3464
3464
|
}
|
|
@@ -3529,18 +3529,18 @@ function bl() {
|
|
|
3529
3529
|
o.MIR,
|
|
3530
3530
|
o.HIPER,
|
|
3531
3531
|
o.HIPERCARD
|
|
3532
|
-
],
|
|
3533
|
-
function
|
|
3532
|
+
], d = (0, s.clone)(l);
|
|
3533
|
+
function u(g) {
|
|
3534
3534
|
return a[g] || e[g];
|
|
3535
3535
|
}
|
|
3536
3536
|
function m() {
|
|
3537
|
-
return
|
|
3538
|
-
return (0, s.clone)(
|
|
3537
|
+
return d.map(function(g) {
|
|
3538
|
+
return (0, s.clone)(u(g));
|
|
3539
3539
|
});
|
|
3540
3540
|
}
|
|
3541
3541
|
function p(g, b) {
|
|
3542
3542
|
b === void 0 && (b = !1);
|
|
3543
|
-
var v =
|
|
3543
|
+
var v = d.indexOf(g);
|
|
3544
3544
|
if (!b && v === -1)
|
|
3545
3545
|
throw new Error('"' + g + '" is not a supported card type.');
|
|
3546
3546
|
return v;
|
|
@@ -3551,21 +3551,21 @@ function bl() {
|
|
|
3551
3551
|
return b;
|
|
3552
3552
|
if (g.length === 0)
|
|
3553
3553
|
return m();
|
|
3554
|
-
|
|
3555
|
-
var V =
|
|
3554
|
+
d.forEach(function(k) {
|
|
3555
|
+
var V = u(k);
|
|
3556
3556
|
(0, t.addMatchingCardsToResults)(g, V, b);
|
|
3557
3557
|
});
|
|
3558
3558
|
var v = (0, r.findBestMatch)(b);
|
|
3559
3559
|
return v ? [v] : b;
|
|
3560
3560
|
}
|
|
3561
3561
|
return h.getTypeInfo = function(g) {
|
|
3562
|
-
return (0, s.clone)(
|
|
3562
|
+
return (0, s.clone)(u(g));
|
|
3563
3563
|
}, h.removeCard = function(g) {
|
|
3564
3564
|
var b = p(g);
|
|
3565
|
-
|
|
3565
|
+
d.splice(b, 1);
|
|
3566
3566
|
}, h.addCard = function(g) {
|
|
3567
3567
|
var b = p(g.type, !0);
|
|
3568
|
-
a[g.type] = g, b === -1 &&
|
|
3568
|
+
a[g.type] = g, b === -1 && d.push(g.type);
|
|
3569
3569
|
}, h.updateCard = function(g, b) {
|
|
3570
3570
|
var v = a[g] || e[g];
|
|
3571
3571
|
if (!v)
|
|
@@ -3576,9 +3576,9 @@ function bl() {
|
|
|
3576
3576
|
k = n(n({}, k), b), a[k.type] = k;
|
|
3577
3577
|
}, h.changeOrder = function(g, b) {
|
|
3578
3578
|
var v = p(g);
|
|
3579
|
-
|
|
3579
|
+
d.splice(v, 1), d.splice(b, 0, g);
|
|
3580
3580
|
}, h.resetModifications = function() {
|
|
3581
|
-
|
|
3581
|
+
d = (0, s.clone)(l), a = {};
|
|
3582
3582
|
}, h.types = o, $e = h, $e;
|
|
3583
3583
|
}
|
|
3584
3584
|
var Ie = bl();
|
|
@@ -3591,8 +3591,8 @@ Ie.updateCard("unionpay", {
|
|
|
3591
3591
|
const vl = (n, e) => {
|
|
3592
3592
|
const t = Ie.getTypeInfo(e), i = n.replace(/\D/g, ""), r = (t == null ? void 0 : t.gaps) || [4, 8, 12], s = t ? Math.max(...t.lengths) + r.length : 19, a = [0].concat(r, i.length), o = [];
|
|
3593
3593
|
for (let l = 0; a[l] < i.length; l++) {
|
|
3594
|
-
const
|
|
3595
|
-
o.push(i.slice(
|
|
3594
|
+
const d = a[l], u = Math.min(a[l + 1], i.length);
|
|
3595
|
+
o.push(i.slice(d, u));
|
|
3596
3596
|
}
|
|
3597
3597
|
return o.join(" ").slice(0, s);
|
|
3598
3598
|
}, yl = (n, e) => {
|
|
@@ -3988,7 +3988,7 @@ function Ml() {
|
|
|
3988
3988
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
3989
3989
|
)), f = this.props.ref, f !== void 0 ? f : null;
|
|
3990
3990
|
}
|
|
3991
|
-
function
|
|
3991
|
+
function d(f, M, S, q, ie, X, xe, Le) {
|
|
3992
3992
|
return S = X.ref, f = {
|
|
3993
3993
|
$$typeof: h,
|
|
3994
3994
|
type: f,
|
|
@@ -4020,7 +4020,7 @@ function Ml() {
|
|
|
4020
4020
|
value: Le
|
|
4021
4021
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
4022
4022
|
}
|
|
4023
|
-
function
|
|
4023
|
+
function u(f, M, S, q, ie, X, xe, Le) {
|
|
4024
4024
|
var z = M.children;
|
|
4025
4025
|
if (z !== void 0)
|
|
4026
4026
|
if (q)
|
|
@@ -4059,7 +4059,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4059
4059
|
return z && o(
|
|
4060
4060
|
S,
|
|
4061
4061
|
typeof f == "function" ? f.displayName || f.name || "Unknown" : f
|
|
4062
|
-
),
|
|
4062
|
+
), d(
|
|
4063
4063
|
f,
|
|
4064
4064
|
z,
|
|
4065
4065
|
X,
|
|
@@ -4087,7 +4087,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4087
4087
|
)(), it = fe(i(s)), ne = {};
|
|
4088
4088
|
qe.Fragment = b, qe.jsx = function(f, M, S, q, ie) {
|
|
4089
4089
|
var X = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
4090
|
-
return
|
|
4090
|
+
return u(
|
|
4091
4091
|
f,
|
|
4092
4092
|
M,
|
|
4093
4093
|
S,
|
|
@@ -4099,7 +4099,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4099
4099
|
);
|
|
4100
4100
|
}, qe.jsxs = function(f, M, S, q, ie) {
|
|
4101
4101
|
var X = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
4102
|
-
return
|
|
4102
|
+
return u(
|
|
4103
4103
|
f,
|
|
4104
4104
|
M,
|
|
4105
4105
|
S,
|
|
@@ -4130,8 +4130,8 @@ const Dl = [
|
|
|
4130
4130
|
var s, a;
|
|
4131
4131
|
const t = Rl(), i = ((a = (s = e == null ? void 0 : e.card) == null ? void 0 : s.status) == null ? void 0 : a.error) || e.status.error, r = (o) => o && t[o] ? t[o] : i;
|
|
4132
4132
|
if (n && typeof n == "object") {
|
|
4133
|
-
const o = n, l = o && typeof o.status_reason == "object" && o.status_reason ? o.status_reason : o,
|
|
4134
|
-
return
|
|
4133
|
+
const o = n, l = o && typeof o.status_reason == "object" && o.status_reason ? o.status_reason : o, d = l && typeof l.decline_code == "string" ? l.decline_code : void 0, u = l && typeof l.message == "string" ? l.message : void 0, m = typeof o.message == "string" ? o.message : void 0;
|
|
4134
|
+
return d ? r(d) : u && t[u] ? t[u] : m && t[m] ? t[m] : i;
|
|
4135
4135
|
}
|
|
4136
4136
|
return n instanceof Error ? r(n.message) : typeof n == "string" ? r(n) : i;
|
|
4137
4137
|
};
|
|
@@ -4157,13 +4157,13 @@ class Nl {
|
|
|
4157
4157
|
return !1;
|
|
4158
4158
|
const s = e ? D(y({}, e), {
|
|
4159
4159
|
onError: (a) => {
|
|
4160
|
-
var l;
|
|
4160
|
+
var l, d;
|
|
4161
4161
|
if (!this.isInitialized) {
|
|
4162
4162
|
console.error("Apple Pay error:", a);
|
|
4163
4163
|
return;
|
|
4164
4164
|
}
|
|
4165
4165
|
const o = this.config.state.translate.messages();
|
|
4166
|
-
ft(a, o), (
|
|
4166
|
+
a != null && a.toLowerCase().includes("cancelled") ? (l = e.onCancel) == null || l.call(e) : (ft(a, o), (d = e.onError) == null || d.call(e, a));
|
|
4167
4167
|
},
|
|
4168
4168
|
onSuccess: (a) => {
|
|
4169
4169
|
var o;
|
|
@@ -4312,20 +4312,20 @@ class $l {
|
|
|
4312
4312
|
}
|
|
4313
4313
|
const s = e ? D(y({}, e), {
|
|
4314
4314
|
onError: (l) => {
|
|
4315
|
-
var
|
|
4315
|
+
var u, m;
|
|
4316
4316
|
if (this.emitAttemptOnce(), !this.isInitialized) {
|
|
4317
4317
|
console.error("PayPal error:", l);
|
|
4318
4318
|
return;
|
|
4319
4319
|
}
|
|
4320
|
-
!this.isUserCancellationError(l) && l ? (
|
|
4320
|
+
!this.isUserCancellationError(l) && l ? (u = e.onError) == null || u.call(e, l) : (m = e.onCancel) == null || m.call(e), this.attemptEmitted = !1;
|
|
4321
4321
|
},
|
|
4322
4322
|
onCancel: () => {
|
|
4323
4323
|
var l;
|
|
4324
4324
|
this.emitAttemptOnce(), (l = e.onCancel) == null || l.call(e), this.attemptEmitted = !1;
|
|
4325
4325
|
},
|
|
4326
4326
|
onSuccess: (l) => {
|
|
4327
|
-
var
|
|
4328
|
-
(
|
|
4327
|
+
var d;
|
|
4328
|
+
(d = e.onSuccess) == null || d.call(e, l), this.attemptEmitted = !1;
|
|
4329
4329
|
}
|
|
4330
4330
|
}) : void 0;
|
|
4331
4331
|
try {
|
|
@@ -4334,9 +4334,9 @@ class $l {
|
|
|
4334
4334
|
onClick: () => {
|
|
4335
4335
|
this.emitAttemptOnce();
|
|
4336
4336
|
},
|
|
4337
|
-
onApprove: (
|
|
4338
|
-
var
|
|
4339
|
-
(
|
|
4337
|
+
onApprove: (d) => E(this, [d], function* ({ billingToken: l }) {
|
|
4338
|
+
var u;
|
|
4339
|
+
(u = s == null ? void 0 : s.onSuccess) == null || u.call(s, l || "");
|
|
4340
4340
|
}),
|
|
4341
4341
|
style: (o = this.customButtonStyles) == null ? void 0 : o.styles,
|
|
4342
4342
|
onCancel: () => {
|
|
@@ -4344,9 +4344,9 @@ class $l {
|
|
|
4344
4344
|
(l = s == null ? void 0 : s.onCancel) == null || l.call(s);
|
|
4345
4345
|
},
|
|
4346
4346
|
onError: (l) => {
|
|
4347
|
-
var
|
|
4348
|
-
const
|
|
4349
|
-
!
|
|
4347
|
+
var u, m;
|
|
4348
|
+
const d = this.isUserCancellationError(l);
|
|
4349
|
+
!d && l ? (u = s == null ? void 0 : s.onError) == null || u.call(s, l) : d && ((m = s == null ? void 0 : s.onCancel) == null || m.call(s));
|
|
4350
4350
|
}
|
|
4351
4351
|
}));
|
|
4352
4352
|
} catch (l) {
|
|
@@ -4638,7 +4638,7 @@ class Ql {
|
|
|
4638
4638
|
try {
|
|
4639
4639
|
if (yield this.applePay.init({
|
|
4640
4640
|
onError: (s) => {
|
|
4641
|
-
this.events.error.emit(s), console.log("Apple Pay error:", s), this.attempted.delete(w.APPLE_PAY);
|
|
4641
|
+
this.events.error.emit(s), console.log("Apple Pay error:", s), e == null || e.remove(), this.attempted.delete(w.APPLE_PAY);
|
|
4642
4642
|
},
|
|
4643
4643
|
onCancel: () => {
|
|
4644
4644
|
this.events.cancel.emit(), this.attempted.delete(w.APPLE_PAY);
|
|
@@ -4937,11 +4937,11 @@ class Ql {
|
|
|
4937
4937
|
}
|
|
4938
4938
|
});
|
|
4939
4939
|
yield Promise.all(l);
|
|
4940
|
-
const
|
|
4940
|
+
const d = performance.now(), u = d - o;
|
|
4941
4941
|
this.performanceMetrics.set("__parallel_total__", {
|
|
4942
4942
|
start: o,
|
|
4943
|
-
end:
|
|
4944
|
-
duration:
|
|
4943
|
+
end: d,
|
|
4944
|
+
duration: u,
|
|
4945
4945
|
status: "Parallel execution"
|
|
4946
4946
|
});
|
|
4947
4947
|
const m = [];
|
|
@@ -5099,13 +5099,13 @@ class Ec {
|
|
|
5099
5099
|
c(this, "events", {
|
|
5100
5100
|
change: new K()
|
|
5101
5101
|
});
|
|
5102
|
-
var r, s, a, o, l,
|
|
5102
|
+
var r, s, a, o, l, d, u, m, p;
|
|
5103
5103
|
const i = e.messages();
|
|
5104
5104
|
if (this.element = document.createElement("div"), this.element.classList.add(B.wrapper), this.inputContainer.classList.add(B.inputContainer), (r = t == null ? void 0 : t.container) != null && r.className && this.inputContainer.classList.add(t.container.className), (s = t == null ? void 0 : t.container) != null && s.styles && Object.assign(this.inputContainer.style, t.container.styles), this.input.setAttribute("id", this.id), this.input.setAttribute("autocomplete", "cc-name"), this.input.setAttribute("placeholder", i.card.name.placeholder), this.input.classList.add(B.input), (a = t == null ? void 0 : t.field) != null && a.className && this.input.classList.add(t.field.className), (o = t == null ? void 0 : t.field) != null && o.styles && Object.assign(this.input.style, t.field.styles), (l = t == null ? void 0 : t.placeholder) != null && l.styles && Object.keys(t.placeholder.styles).length) {
|
|
5105
5105
|
const h = (b) => b.replace(/[A-Z]/g, (v) => "-" + v.toLowerCase()), g = Object.entries(t.placeholder.styles).map(([b, v]) => `${h(b)}:${v};`).join("");
|
|
5106
5106
|
this.placeholderStyle.textContent = `#${this.id}::placeholder{${g}}`, this.element.appendChild(this.placeholderStyle);
|
|
5107
5107
|
}
|
|
5108
|
-
this.endContent.classList.add(B.hidden), this.endContent.appendChild(this.warning.render()), this.inputContainer.append(this.input, this.endContent), this.label.setAttribute("for", this.id), this.label.classList.add(B.label), (
|
|
5108
|
+
this.endContent.classList.add(B.hidden), this.endContent.appendChild(this.warning.render()), this.inputContainer.append(this.input, this.endContent), this.label.setAttribute("for", this.id), this.label.classList.add(B.label), (d = t == null ? void 0 : t.label) != null && d.className && this.label.classList.add(t.label.className), (u = t == null ? void 0 : t.label) != null && u.styles && Object.assign(this.label.style, t.label.styles), this.labelText.textContent = i.card.name.label, this.labelError.textContent = i.card.required, this.labelError.classList.add(B.labelError, B.hidden), (m = t == null ? void 0 : t.error) != null && m.className && this.labelError.classList.add(t.error.className), (p = t == null ? void 0 : t.error) != null && p.styles && Object.assign(this.labelError.style, t.error.styles), this.label.append(this.labelText, this.labelError), this.element.append(this.label, this.inputContainer), this.input.addEventListener("input", () => this.handleChange(this.input.value)), this.input.addEventListener("paste", () => this.handleChange(this.input.value)), this.input.addEventListener("blur", () => this.validate(this.input.value)), e.subscribe(({ messages: h }) => {
|
|
5109
5109
|
this.input.setAttribute("placeholder", h.card.name.placeholder), this.labelText.textContent = h.card.name.label, this.labelError.textContent = h.card.required;
|
|
5110
5110
|
});
|
|
5111
5111
|
}
|
|
@@ -5428,7 +5428,7 @@ class jc {
|
|
|
5428
5428
|
c(this, "events", {
|
|
5429
5429
|
change: new K()
|
|
5430
5430
|
});
|
|
5431
|
-
var r, s, a, o, l,
|
|
5431
|
+
var r, s, a, o, l, d, u, m, p;
|
|
5432
5432
|
this.translate = e;
|
|
5433
5433
|
const i = e.messages();
|
|
5434
5434
|
if (this.element = document.createElement("div"), this.element.classList.add(F.wrapper), this.inputContainer.classList.add(F.inputContainer), (r = t == null ? void 0 : t.container) != null && r.className && this.inputContainer.classList.add(t.container.className), (s = t == null ? void 0 : t.container) != null && s.styles && Object.assign(this.inputContainer.style, t.container.styles), this.input.setAttribute("id", this.id), this.input.setAttribute("autocomplete", "cc-number"), this.input.setAttribute("placeholder", "1234 1234 1234 1234"), this.input.setAttribute("inputmode", "numeric"), this.input.setAttribute("pattern", "[0-9]*"), this.input.setAttribute("enterkeyhint", "done"), this.input.classList.add(F.input), (a = t == null ? void 0 : t.field) != null && a.className && this.input.classList.add(t.field.className), (o = t == null ? void 0 : t.field) != null && o.styles && Object.assign(this.input.style, t.field.styles), (l = t == null ? void 0 : t.placeholder) != null && l.styles && Object.keys(t.placeholder.styles).length) {
|
|
@@ -5440,7 +5440,7 @@ ${b}:-ms-input-placeholder{${g}}
|
|
|
5440
5440
|
${b}::-ms-input-placeholder{${g}}
|
|
5441
5441
|
`, document.head.appendChild(this.placeholderStyle);
|
|
5442
5442
|
}
|
|
5443
|
-
this.endContent.classList.add(F.endContent), this.endContent.append(...this.getCardIcons()), this.inputContainer.append(this.input, this.endContent), this.label.setAttribute("for", this.id), this.label.classList.add(F.label), (
|
|
5443
|
+
this.endContent.classList.add(F.endContent), this.endContent.append(...this.getCardIcons()), this.inputContainer.append(this.input, this.endContent), this.label.setAttribute("for", this.id), this.label.classList.add(F.label), (d = t == null ? void 0 : t.label) != null && d.className && this.label.classList.add(t.label.className), (u = t == null ? void 0 : t.label) != null && u.styles && Object.assign(this.label.style, t.label.styles), this.labelText.textContent = i.card.number.label, this.labelError.textContent = i.card.required, this.labelError.classList.add(F.labelError, F.hidden), (m = t == null ? void 0 : t.error) != null && m.className && this.labelError.classList.add(t.error.className), (p = t == null ? void 0 : t.error) != null && p.styles && Object.assign(this.labelError.style, t.error.styles), this.label.append(this.labelText, this.labelError), this.error.classList.add(F.error, F.hidden), this.element.append(this.label, this.inputContainer, this.error), this.input.addEventListener("keydown", (h) => {
|
|
5444
5444
|
this.isDisabled || ["Backspace", "Delete", "Tab", "ArrowLeft", "ArrowRight", "Home", "End"].includes(h.key) || h.ctrlKey || h.metaKey || /^\d$/.test(h.key) || h.preventDefault();
|
|
5445
5445
|
}), this.input.addEventListener("input", (h) => {
|
|
5446
5446
|
h.stopPropagation();
|
|
@@ -5608,10 +5608,10 @@ class Xc {
|
|
|
5608
5608
|
expiryChange: new K(),
|
|
5609
5609
|
cvcChange: new K()
|
|
5610
5610
|
});
|
|
5611
|
-
var a, o, l,
|
|
5611
|
+
var a, o, l, d, u, m, p, h, g, b, v, k, V, A, I, L, P;
|
|
5612
5612
|
this.translate = e;
|
|
5613
5613
|
const i = e.messages();
|
|
5614
|
-
this.element = document.createElement("div"), this.element.classList.add(T.securityContent), this.expiryInputContainer.classList.add(T.inputContainer), (a = t == null ? void 0 : t.container) != null && a.className && this.expiryInputContainer.classList.add(t.container.className), (o = t == null ? void 0 : t.container) != null && o.styles && Object.assign(this.expiryInputContainer.style, t.container.styles), this.expiryInput.setAttribute("id", this.expiryId), this.expiryInput.setAttribute("autocomplete", "cc-exp"), this.expiryInput.setAttribute("placeholder", i.card.expiry.placeholder), this.expiryInput.setAttribute("inputmode", "numeric"), this.expiryInput.setAttribute("pattern", "[0-9]*"), this.expiryInput.setAttribute("enterkeyhint", "next"), this.expiryInput.classList.add(T.input), (l = t == null ? void 0 : t.field) != null && l.className && this.expiryInput.classList.add(t.field.className), (
|
|
5614
|
+
this.element = document.createElement("div"), this.element.classList.add(T.securityContent), this.expiryInputContainer.classList.add(T.inputContainer), (a = t == null ? void 0 : t.container) != null && a.className && this.expiryInputContainer.classList.add(t.container.className), (o = t == null ? void 0 : t.container) != null && o.styles && Object.assign(this.expiryInputContainer.style, t.container.styles), this.expiryInput.setAttribute("id", this.expiryId), this.expiryInput.setAttribute("autocomplete", "cc-exp"), this.expiryInput.setAttribute("placeholder", i.card.expiry.placeholder), this.expiryInput.setAttribute("inputmode", "numeric"), this.expiryInput.setAttribute("pattern", "[0-9]*"), this.expiryInput.setAttribute("enterkeyhint", "next"), this.expiryInput.classList.add(T.input), (l = t == null ? void 0 : t.field) != null && l.className && this.expiryInput.classList.add(t.field.className), (d = t == null ? void 0 : t.field) != null && d.styles && Object.assign(this.expiryInput.style, t.field.styles), this.expiryEndContent.classList.add(T.endContent), this.expiryEndContent.appendChild(this.expiryWarning.render()), this.expiryInputContainer.append(this.expiryInput, this.expiryEndContent), this.expiryLabel.setAttribute("for", this.expiryId), this.expiryLabel.classList.add(T.label), (u = t == null ? void 0 : t.label) != null && u.className && this.expiryLabel.classList.add(t.label.className), (m = t == null ? void 0 : t.label) != null && m.styles && Object.assign(this.expiryLabel.style, t.label.styles), this.expiryLabelText.contentEditable = "false", this.expiryLabelText.textContent = i.card.expiry.label, this.expiryLabelError.textContent = i.card.required, this.expiryLabelError.classList.add(T.labelError, T.hidden), this.expiryLabel.append(this.expiryLabelText, this.expiryLabelError), this.expiryError.classList.add(T.error, T.hidden), (p = t == null ? void 0 : t.error) != null && p.className && this.expiryError.classList.add(t.error.className), (h = t == null ? void 0 : t.error) != null && h.styles && Object.assign(this.expiryError.style, t.error.styles);
|
|
5615
5615
|
const r = document.createElement("div");
|
|
5616
5616
|
if (r.appendChild(this.expiryError), this.cvcInputContainer.classList.add(T.inputContainer), (g = t == null ? void 0 : t.container) != null && g.className && this.cvcInputContainer.classList.add(t.container.className), (b = t == null ? void 0 : t.container) != null && b.styles && Object.assign(this.cvcInputContainer.style, t.container.styles), this.cvcInput.setAttribute("id", this.cvcId), this.cvcInput.setAttribute("autocomplete", "cc-csc"), this.cvcInput.setAttribute("placeholder", i.card.cvc.placeholder), this.cvcInput.setAttribute("inputmode", "numeric"), this.cvcInput.setAttribute("pattern", "[0-9]*"), this.cvcInput.setAttribute("enterkeyhint", "done"), this.cvcInput.classList.add(T.input), (v = t == null ? void 0 : t.field) != null && v.className && this.cvcInput.classList.add(t.field.className), (k = t == null ? void 0 : t.field) != null && k.styles && Object.assign(this.cvcInput.style, t.field.styles), (V = t == null ? void 0 : t.placeholder) != null && V.styles && Object.keys(t.placeholder.styles).length) {
|
|
5617
5617
|
const C = (N) => N.replace(/[A-Z]/g, (O) => "-" + O.toLowerCase()), x = Object.entries(t.placeholder.styles).map(([N, O]) => `${C(N)}:${O};`).join("");
|
|
@@ -5690,10 +5690,10 @@ class Xc {
|
|
|
5690
5690
|
expiryValidator(e) {
|
|
5691
5691
|
const t = !e, i = e.length < 7, r = /* @__PURE__ */ new Date(), [s, a] = e.split(" / ");
|
|
5692
5692
|
r.setFullYear(2e3 + parseInt(a), parseInt(s) - 1, 31);
|
|
5693
|
-
const o = r.getTime() < Date.now(), l = /* @__PURE__ */ new Date(),
|
|
5694
|
-
|
|
5695
|
-
const
|
|
5696
|
-
return !t && !i && !o && !
|
|
5693
|
+
const o = r.getTime() < Date.now(), l = /* @__PURE__ */ new Date(), d = /* @__PURE__ */ new Date();
|
|
5694
|
+
d.setFullYear(l.getFullYear() + 50);
|
|
5695
|
+
const u = r.getTime() > d.getTime() || r.getFullYear() < l.getFullYear();
|
|
5696
|
+
return !t && !i && !o && !u ? null : t ? Y.Empty : i ? Y.Incomplete : u ? "tooFarInFuture" : r.getFullYear() === (/* @__PURE__ */ new Date()).getFullYear() ? "dateExpired" : "expired";
|
|
5697
5697
|
}
|
|
5698
5698
|
// validate expiry
|
|
5699
5699
|
validateExpiry(e) {
|
|
@@ -5799,16 +5799,16 @@ class Qc {
|
|
|
5799
5799
|
this.name.render(),
|
|
5800
5800
|
this.submit.render()
|
|
5801
5801
|
), requestAnimationFrame(() => {
|
|
5802
|
-
const l = this.submit.render(),
|
|
5803
|
-
this.element.style.setProperty("--input-focus-shadow-color",
|
|
5802
|
+
const l = this.submit.render(), u = window.getComputedStyle(l).backgroundColor || "#5A67D8";
|
|
5803
|
+
this.element.style.setProperty("--input-focus-shadow-color", u);
|
|
5804
5804
|
}), this.back.addEventListener(() => this.events.close.emit()), this.number.addEventListener("change", ({ cardType: l }) => this.cardSecurity.updateCardType(l || null)), this.submit.addEventListener((l) => {
|
|
5805
5805
|
var h;
|
|
5806
5806
|
l.preventDefault();
|
|
5807
|
-
const { cvc:
|
|
5807
|
+
const { cvc: d, expiry: u } = this.cardSecurity.value(), { value: m, cardType: p } = this.number.value();
|
|
5808
5808
|
this.touchSubmit(), this.validate() && ((h = this.onPaymentAttempt) == null || h.call(this, { paymentMethod: w.CARD }), this.events.submit.emit({
|
|
5809
5809
|
number: m,
|
|
5810
|
-
expiry:
|
|
5811
|
-
cvc:
|
|
5810
|
+
expiry: u,
|
|
5811
|
+
cvc: d,
|
|
5812
5812
|
name: this.name.value(),
|
|
5813
5813
|
cardBrand: p
|
|
5814
5814
|
}));
|
|
@@ -6044,14 +6044,14 @@ class ad {
|
|
|
6044
6044
|
).finished) != null ? a : Promise.resolve(), this.checkout.style.height = "auto"), this.isFormOpen = !1;
|
|
6045
6045
|
})), this.form.addEventListener("submit", (e) => E(this, null, function* () {
|
|
6046
6046
|
if (this.isLoading || (this.form.touchSubmit(), this.hideError(), !this.form.validate())) return;
|
|
6047
|
-
const i = e.number.replace(/\D/g, ""), r = this.config.state.checkout.getState(), s = this.config.service.ev.getEv(), [a, o] = yield Promise.all([s.encrypt(i), s.encrypt(e.cvc)]), [l,
|
|
6047
|
+
const i = e.number.replace(/\D/g, ""), r = this.config.state.checkout.getState(), s = this.config.service.ev.getEv(), [a, o] = yield Promise.all([s.encrypt(i), s.encrypt(e.cvc)]), [l, d] = e.expiry.split("/");
|
|
6048
6048
|
yield this.handleSuccess({
|
|
6049
6049
|
clientSession: r.clientToken,
|
|
6050
6050
|
card: {
|
|
6051
6051
|
firstSixDigits: i.slice(0, 6),
|
|
6052
6052
|
lastFourDigits: i.slice(-4),
|
|
6053
6053
|
expMonth: Number(l),
|
|
6054
|
-
expYear: Number(
|
|
6054
|
+
expYear: Number(d),
|
|
6055
6055
|
cardBrand: e.cardBrand || "",
|
|
6056
6056
|
number: a,
|
|
6057
6057
|
cvc: o,
|
|
@@ -6178,8 +6178,8 @@ class od {
|
|
|
6178
6178
|
init() {
|
|
6179
6179
|
return E(this, null, function* () {
|
|
6180
6180
|
const { checkout: e, transaction: t, translate: i, styles: r } = this.config.state, { apiVersion: s } = e.getState();
|
|
6181
|
-
e.subscribe(({ clientToken: a, environment: o, locale: l, translate:
|
|
6182
|
-
l && i.locale() !== l && i.setLocale(l),
|
|
6181
|
+
e.subscribe(({ clientToken: a, environment: o, locale: l, translate: d, styles: u }) => {
|
|
6182
|
+
l && i.locale() !== l && i.setLocale(l), d && i.overrides() !== d && i.setMessages(d), u && r.setState(u), t.updateTransaction(a, o, s).then((m) => {
|
|
6183
6183
|
var p, h;
|
|
6184
6184
|
if (m)
|
|
6185
6185
|
return this.config.service.ev.initEv({
|