@paynext/sdk 0.0.119 → 0.0.121
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.es.js +419 -411
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +20 -20
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var xr = Object.defineProperty, wr = Object.defineProperties;
|
|
2
|
+
var Tr = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var ot = Object.getOwnPropertySymbols;
|
|
4
4
|
var yn = Object.prototype.hasOwnProperty, Cn = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var xt = (n, e, t) => e in n ?
|
|
5
|
+
var xt = (n, e, t) => e in n ? xr(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, v = (n, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
7
|
yn.call(e, t) && xt(n, t, e[t]);
|
|
8
8
|
if (ot)
|
|
9
9
|
for (var t of ot(e))
|
|
10
10
|
Cn.call(e, t) && xt(n, t, e[t]);
|
|
11
11
|
return n;
|
|
12
|
-
}, I = (n, e) =>
|
|
12
|
+
}, I = (n, e) => wr(n, Tr(e));
|
|
13
13
|
var ae = (n, e) => {
|
|
14
14
|
var t = {};
|
|
15
15
|
for (var i in n)
|
|
@@ -20,7 +20,7 @@ var ae = (n, e) => {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
var c = (n, e, t) => xt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
23
|
-
var
|
|
23
|
+
var E = (n, e, t) => new Promise((i, r) => {
|
|
24
24
|
var a = (l) => {
|
|
25
25
|
try {
|
|
26
26
|
o(t.next(l));
|
|
@@ -36,7 +36,7 @@ var k = (n, e, t) => new Promise((i, r) => {
|
|
|
36
36
|
}, o = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(a, s);
|
|
37
37
|
o((t = t.apply(n, e)).next());
|
|
38
38
|
});
|
|
39
|
-
import
|
|
39
|
+
import Ar from "react";
|
|
40
40
|
class iu {
|
|
41
41
|
constructor(e) {
|
|
42
42
|
c(this, "parent");
|
|
@@ -44,7 +44,7 @@ class iu {
|
|
|
44
44
|
typeof window != "undefined" && (this.parent = e);
|
|
45
45
|
}
|
|
46
46
|
mount(e) {
|
|
47
|
-
return
|
|
47
|
+
return E(this, null, function* () {
|
|
48
48
|
if (!this.parent)
|
|
49
49
|
return;
|
|
50
50
|
if (!this.core) {
|
|
@@ -62,13 +62,13 @@ class iu {
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
unmount() {
|
|
65
|
-
return
|
|
65
|
+
return E(this, null, function* () {
|
|
66
66
|
!this.parent || !this.core || (this.parent.innerHTML = "", this.core.clearState());
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
var x = /* @__PURE__ */ ((n) => (n.PAYPAL = "PAYPAL", n.APPLE_PAY = "APPLEPAY", n.GOOGLE_PAY = "GPAY", n.CARD = "CARD", n.VENMO = "VENMO", n))(x || {}), Pt = /* @__PURE__ */ ((n) => (n.PENDING = "PENDING", n.FAILED = "FAILED", n.AUTHORIZED = "AUTHORIZED", n.SETTLING = "SETTLING", n.SETTLED = "SETTLED", n.DECLINED = "DECLINED", n.CANCELLED = "CANCELLED", n))(Pt || {}), Dt = /* @__PURE__ */ ((n) => (n.INSUFFICIENT_FUNDS = "insufficient_funds", n.AUTHENTICATION_REQUIRED = "authentication_required", n.CARD_ISSUER_DECLINE = "card_issuer_decline", n.GENERIC_DECLINE = "generic_decline", n.WITHDRAWAL_LIMIT_EXCEEDED = "withdrawal_limit_exceeded", n.DO_NOT_HONOR = "do_not_honor", n.EXPIRED_CARD = "expired_card", n.SUSPECTED_FRAUD = "suspected_fraud", n.INCORRECT_CVC = "incorrect_cvc", n.INVALID_CARD_NUMBER = "invalid_card_number", n.ISSUER_UNAVAILABLE = "issuer_unavailable", n.CARD_LOST_OR_STOLEN = "card_lost_or_stolen", n.CARD_DECLINED = "card_declined", n))(Dt || {});
|
|
71
|
-
const
|
|
71
|
+
const En = {
|
|
72
72
|
appIds: {
|
|
73
73
|
develop: "app_00b96c0c3011",
|
|
74
74
|
staging: "app_00396c84ac2b",
|
|
@@ -81,7 +81,7 @@ const kn = {
|
|
|
81
81
|
staging: "https://staging-api.paynext.com",
|
|
82
82
|
sandbox: "https://sandbox-api.paynext.com",
|
|
83
83
|
production: "https://api.paynext.com"
|
|
84
|
-
})[n],
|
|
84
|
+
})[n], _r = [
|
|
85
85
|
{
|
|
86
86
|
type: x.PAYPAL,
|
|
87
87
|
order: 1,
|
|
@@ -102,7 +102,7 @@ const kn = {
|
|
|
102
102
|
order: 4,
|
|
103
103
|
is_active: !0
|
|
104
104
|
}
|
|
105
|
-
],
|
|
105
|
+
], Lr = (n) => n.googlePay ? x.GOOGLE_PAY : n.applePay ? x.APPLE_PAY : n.paypal ? x.PAYPAL : n.braintree ? x.VENMO : x.CARD, Vr = (n) => {
|
|
106
106
|
const e = n.card;
|
|
107
107
|
if (e)
|
|
108
108
|
return {
|
|
@@ -121,14 +121,14 @@ const kn = {
|
|
|
121
121
|
last4: e.lastFourDigits,
|
|
122
122
|
number: e.number
|
|
123
123
|
};
|
|
124
|
-
},
|
|
124
|
+
}, Ir = (n) => {
|
|
125
125
|
var t;
|
|
126
126
|
const e = n.paypal;
|
|
127
127
|
if ((t = e == null ? void 0 : e.billing_agreement_token) != null && t.paypalId)
|
|
128
128
|
return {
|
|
129
129
|
billing_agreement_token: e.billing_agreement_token.paypalId
|
|
130
130
|
};
|
|
131
|
-
},
|
|
131
|
+
}, Mr = (n) => {
|
|
132
132
|
var t, i;
|
|
133
133
|
const e = n.googlePay;
|
|
134
134
|
if (e != null && e.token)
|
|
@@ -140,7 +140,7 @@ const kn = {
|
|
|
140
140
|
token: e.token.number,
|
|
141
141
|
token_service_provider: e.token.tokenServiceProvider
|
|
142
142
|
};
|
|
143
|
-
},
|
|
143
|
+
}, Pr = (n) => {
|
|
144
144
|
var t, i, r, a, s, o;
|
|
145
145
|
const e = n.applePay;
|
|
146
146
|
if (e)
|
|
@@ -152,13 +152,13 @@ const kn = {
|
|
|
152
152
|
token: (s = e.networkToken) == null ? void 0 : s.number,
|
|
153
153
|
token_service_provider: (o = e.networkToken) == null ? void 0 : o.tokenServiceProvider
|
|
154
154
|
};
|
|
155
|
-
},
|
|
155
|
+
}, Dr = (n) => {
|
|
156
156
|
const e = n.braintree;
|
|
157
157
|
if (e)
|
|
158
158
|
return {
|
|
159
159
|
payment_method_nonce: e.nonce
|
|
160
160
|
};
|
|
161
|
-
},
|
|
161
|
+
}, kn = (n) => {
|
|
162
162
|
var i, r, a, s, o, l, u, d, h, m, p, g, b, y;
|
|
163
163
|
const { applePay: e, googlePay: t } = n;
|
|
164
164
|
if (!(!e && !t))
|
|
@@ -171,7 +171,7 @@ const kn = {
|
|
|
171
171
|
state: ((b = e == null ? void 0 : e.billingContact) == null ? void 0 : b.administrativeArea) || ((y = t == null ? void 0 : t.billingAddress) == null ? void 0 : y.administrativeArea) || void 0
|
|
172
172
|
};
|
|
173
173
|
}, xn = (n) => {
|
|
174
|
-
var r, a, s, o, l, u, d, h, m, p, g, b, y,
|
|
174
|
+
var r, a, s, o, l, u, d, h, m, p, g, b, y, k, V, _, M, T, D;
|
|
175
175
|
const { card: e, googlePay: t, applePay: i } = n;
|
|
176
176
|
if (!(!e && !(t != null && t.card) && !(i != null && i.card)))
|
|
177
177
|
return {
|
|
@@ -185,7 +185,7 @@ const kn = {
|
|
|
185
185
|
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)
|
|
186
186
|
},
|
|
187
187
|
cvc: e == null ? void 0 : e.cvc,
|
|
188
|
-
exp_month: e != null && e.expMonth || (y = t == null ? void 0 : t.card) != null && y.expiry.month ? Number((e == null ? void 0 : e.expMonth) || ((
|
|
188
|
+
exp_month: e != null && e.expMonth || (y = t == null ? void 0 : t.card) != null && y.expiry.month ? Number((e == null ? void 0 : e.expMonth) || ((k = t == null ? void 0 : t.card) == null ? void 0 : k.expiry.month)) : void 0,
|
|
189
189
|
exp_year: e != null && e.expYear || (V = t == null ? void 0 : t.card) != null && V.expiry.year ? Number((e == null ? void 0 : e.expYear) || ((_ = t == null ? void 0 : t.card) == null ? void 0 : _.expiry.year)) : void 0,
|
|
190
190
|
last4: (e == null ? void 0 : e.lastFourDigits) || ((M = t == null ? void 0 : t.card) == null ? void 0 : M.lastFour) || ((T = i == null ? void 0 : i.card) == null ? void 0 : T.lastFour),
|
|
191
191
|
number: (e == null ? void 0 : e.number) || ((D = t == null ? void 0 : t.card) == null ? void 0 : D.number)
|
|
@@ -194,9 +194,9 @@ const kn = {
|
|
|
194
194
|
var i, r;
|
|
195
195
|
const { applePay: e, card: t } = n;
|
|
196
196
|
return (i = e == null ? void 0 : e.billingContact) != null && i.givenName ? `${e.billingContact.givenName} ${e.billingContact.familyName || ""}`.trim() : (r = t == null ? void 0 : t.metadata) == null ? void 0 : r.name;
|
|
197
|
-
},
|
|
197
|
+
}, Rr = (n) => {
|
|
198
198
|
var i, r, a, s, o, l, u, d;
|
|
199
|
-
const e =
|
|
199
|
+
const e = Lr(n), t = {
|
|
200
200
|
client_session: n.clientSession,
|
|
201
201
|
three_ds_session_id: n.threeDsSessionId,
|
|
202
202
|
type: e
|
|
@@ -205,58 +205,58 @@ const kn = {
|
|
|
205
205
|
case x.CARD:
|
|
206
206
|
return I(v({}, t), {
|
|
207
207
|
name: wn(n),
|
|
208
|
-
card:
|
|
208
|
+
card: Vr(n)
|
|
209
209
|
});
|
|
210
210
|
case x.PAYPAL:
|
|
211
211
|
return I(v({}, t), {
|
|
212
|
-
paypal:
|
|
212
|
+
paypal: Ir(n)
|
|
213
213
|
});
|
|
214
214
|
case x.GOOGLE_PAY:
|
|
215
215
|
return I(v({}, t), {
|
|
216
216
|
name: (r = (i = n.googlePay) == null ? void 0 : i.billingAddress) == null ? void 0 : r.name,
|
|
217
217
|
phone: (l = (o = (s = (a = n.googlePay) == null ? void 0 : a.billingAddress) == null ? void 0 : s.phoneNumber) == null ? void 0 : o.replace(/ /g, "")) == null ? void 0 : l.replace(/-/g, ""),
|
|
218
218
|
card: xn(n),
|
|
219
|
-
google_pay:
|
|
220
|
-
billing_address:
|
|
219
|
+
google_pay: Mr(n),
|
|
220
|
+
billing_address: kn(n)
|
|
221
221
|
});
|
|
222
222
|
case x.APPLE_PAY:
|
|
223
223
|
return I(v({}, t), {
|
|
224
224
|
name: wn(n),
|
|
225
225
|
card: xn(n),
|
|
226
|
-
apple_pay:
|
|
226
|
+
apple_pay: Pr(n),
|
|
227
227
|
phone: (d = (u = n.applePay) == null ? void 0 : u.shippingContact) == null ? void 0 : d.phoneNumber,
|
|
228
|
-
billing_address:
|
|
228
|
+
billing_address: kn(n)
|
|
229
229
|
});
|
|
230
230
|
case x.VENMO:
|
|
231
231
|
return I(v({}, t), {
|
|
232
|
-
venmo:
|
|
232
|
+
venmo: Dr(n)
|
|
233
233
|
});
|
|
234
234
|
default:
|
|
235
235
|
throw new Error(`Unsupported payment method: ${e}`);
|
|
236
236
|
}
|
|
237
|
-
},
|
|
237
|
+
}, Or = (n, e, t) => E(void 0, null, function* () {
|
|
238
238
|
const i = `${Xt(e)}/payments/create`, r = new Headers();
|
|
239
239
|
r.append("Content-Type", "application/json"), r.append("X-API-Version", t);
|
|
240
|
-
const a =
|
|
240
|
+
const a = Rr(n);
|
|
241
241
|
return yield (yield fetch(i, {
|
|
242
242
|
method: "POST",
|
|
243
243
|
headers: r,
|
|
244
244
|
body: JSON.stringify(a)
|
|
245
245
|
})).json();
|
|
246
|
-
}),
|
|
246
|
+
}), Nr = (n, e, t) => E(void 0, null, function* () {
|
|
247
247
|
const i = `${Xt(e)}/payments/create/billing/agreement`, r = new Headers();
|
|
248
248
|
return r.append("Content-Type", "application/json"), r.append("X-API-Version", t), (yield (yield fetch(i, {
|
|
249
249
|
method: "POST",
|
|
250
250
|
headers: r,
|
|
251
251
|
body: JSON.stringify({ client_session: n })
|
|
252
252
|
})).json()).paypal_agreement_token_response.token_id || "";
|
|
253
|
-
}),
|
|
253
|
+
}), Sr = (n, e, t) => E(void 0, null, function* () {
|
|
254
254
|
const i = new Headers();
|
|
255
255
|
i.append("X-API-Version", t);
|
|
256
256
|
const r = `${Xt(e)}/payments/config?client_session_id=${n}`, s = yield (yield fetch(r, { headers: i })).json();
|
|
257
|
-
return s.checkout_config || (s.checkout_config =
|
|
257
|
+
return s.checkout_config || (s.checkout_config = _r), s;
|
|
258
258
|
});
|
|
259
|
-
let
|
|
259
|
+
let Tn = class {
|
|
260
260
|
constructor(e) {
|
|
261
261
|
c(this, "apple", null);
|
|
262
262
|
c(this, "isAvailable", !1);
|
|
@@ -264,7 +264,7 @@ let Nr = class {
|
|
|
264
264
|
this.ev = e;
|
|
265
265
|
}
|
|
266
266
|
init(u, d) {
|
|
267
|
-
return
|
|
267
|
+
return E(this, arguments, function* ({
|
|
268
268
|
transaction: e,
|
|
269
269
|
locale: t,
|
|
270
270
|
// supportedCardTypes,
|
|
@@ -288,14 +288,14 @@ let Nr = class {
|
|
|
288
288
|
allowedCardNetworks: ["visa", "masterCard"],
|
|
289
289
|
requestBillingAddress: !0,
|
|
290
290
|
requestPayerDetails: ["name", "email", "phone"],
|
|
291
|
-
process: (b, y) =>
|
|
291
|
+
process: (b, y) => E(this, [b, y], function* (p, { fail: g }) {
|
|
292
292
|
o == null || o({
|
|
293
293
|
paymentMethod: x.GOOGLE_PAY
|
|
294
294
|
});
|
|
295
295
|
try {
|
|
296
296
|
a == null || a(p);
|
|
297
|
-
} catch (
|
|
298
|
-
console.error(
|
|
297
|
+
} catch (k) {
|
|
298
|
+
console.error(k), g({
|
|
299
299
|
message: "Cannot pay with payment credentials"
|
|
300
300
|
});
|
|
301
301
|
}
|
|
@@ -306,18 +306,18 @@ let Nr = class {
|
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
render(e) {
|
|
309
|
-
return
|
|
309
|
+
return E(this, null, function* () {
|
|
310
310
|
var t;
|
|
311
311
|
!this.apple || !this.isAvailable || (e.innerHTML = "", yield this.apple.mount(e), (t = this.onReady) == null || t.call(this));
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
},
|
|
314
|
+
}, An = class {
|
|
315
315
|
constructor(e) {
|
|
316
316
|
c(this, "google", null);
|
|
317
317
|
this.ev = e;
|
|
318
318
|
}
|
|
319
319
|
init(u, d) {
|
|
320
|
-
return
|
|
320
|
+
return E(this, arguments, function* ({ transaction: e, locale: t, onReady: i, onError: r, onSuccess: a, onCancel: s, onPaymentAttempt: o }, l) {
|
|
321
321
|
const h = this.ev.transactions.create(e);
|
|
322
322
|
this.google = this.ev.ui.googlePay(h, I(v({
|
|
323
323
|
locale: t,
|
|
@@ -334,7 +334,7 @@ let Nr = class {
|
|
|
334
334
|
allowedAuthMethods: ["PAN_ONLY", "CRYPTOGRAM_3DS"],
|
|
335
335
|
// ToDo: Temporary we have only Visa and Master card
|
|
336
336
|
allowedCardNetworks: ["VISA", "MASTERCARD"],
|
|
337
|
-
process: (g, b) =>
|
|
337
|
+
process: (g, b) => E(this, [g, b], function* (m, { fail: p }) {
|
|
338
338
|
o == null || o({
|
|
339
339
|
paymentMethod: x.GOOGLE_PAY
|
|
340
340
|
});
|
|
@@ -350,7 +350,7 @@ let Nr = class {
|
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
352
|
render(e) {
|
|
353
|
-
return
|
|
353
|
+
return E(this, null, function* () {
|
|
354
354
|
this.google && (e.innerHTML = "", this.google.mount(e));
|
|
355
355
|
});
|
|
356
356
|
}
|
|
@@ -379,12 +379,12 @@ class Fr {
|
|
|
379
379
|
this.ev = e;
|
|
380
380
|
}
|
|
381
381
|
init(a) {
|
|
382
|
-
return
|
|
382
|
+
return E(this, arguments, function* ({ threeDsId: e, onReady: t, onSuccess: i, onError: r }) {
|
|
383
383
|
this.threeDs = this.ev.ui.threeDSecure(e), this.threeDs.on("ready", () => t == null ? void 0 : t()), this.threeDs.on("success", () => i == null ? void 0 : i()), this.threeDs.on("failure", () => r == null ? void 0 : r()), this.threeDs.on("error", () => r == null ? void 0 : r());
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
386
|
render(e) {
|
|
387
|
-
return
|
|
387
|
+
return E(this, null, function* () {
|
|
388
388
|
this.threeDs && this.threeDs.mount(e);
|
|
389
389
|
});
|
|
390
390
|
}
|
|
@@ -407,38 +407,46 @@ class jr {
|
|
|
407
407
|
}
|
|
408
408
|
// preload evervault
|
|
409
409
|
preloadEvervault(e) {
|
|
410
|
-
return
|
|
410
|
+
return E(this, null, function* () {
|
|
411
411
|
if (!this.isShouldLoad(e)) return;
|
|
412
412
|
if (typeof window == "undefined")
|
|
413
413
|
throw new Error("Evervault can only be initialized in browser environment");
|
|
414
414
|
this.isReady = !1;
|
|
415
415
|
const { loadEvervault: t } = yield import("./evervault-js-37KtqVz5.js");
|
|
416
|
-
this.ev = yield t(e.teamId, e.appId), this.apple = new
|
|
416
|
+
this.ev = yield t(e.teamId, e.appId), this.apple = new Tn(this.ev), this.google = new An(this.ev);
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
419
|
// init ev
|
|
420
420
|
initEv(e) {
|
|
421
|
-
return
|
|
421
|
+
return E(this, null, function* () {
|
|
422
|
+
if (!this.ev) {
|
|
423
|
+
if (!this.isShouldLoad(e)) return;
|
|
424
|
+
if (typeof window == "undefined")
|
|
425
|
+
throw new Error("Evervault can only be initialized in browser environment");
|
|
426
|
+
this.isReady = !1;
|
|
427
|
+
const { loadEvervault: t } = yield import("./evervault-js-37KtqVz5.js");
|
|
428
|
+
this.ev = yield t(e.teamId, e.appId), this.apple = new Tn(this.ev), this.google = new An(this.ev);
|
|
429
|
+
}
|
|
422
430
|
this.events.ready.emit(), this.isReady = !0;
|
|
423
431
|
});
|
|
424
432
|
}
|
|
425
433
|
// init three ds
|
|
426
434
|
initThreeDs(e) {
|
|
427
|
-
return
|
|
435
|
+
return E(this, null, function* () {
|
|
428
436
|
if (!this.ev) throw new Error("Evervault should be init before using Three DS Secure");
|
|
429
437
|
this.threeDs = new Fr(this.ev), yield this.threeDs.init(e), yield this.threeDs.render();
|
|
430
438
|
});
|
|
431
439
|
}
|
|
432
440
|
// init apple
|
|
433
441
|
initApple(e, t) {
|
|
434
|
-
return
|
|
442
|
+
return E(this, null, function* () {
|
|
435
443
|
if (!this.apple) throw new Error("Evervault should be init before using Apple Pay");
|
|
436
444
|
yield this.apple.init(e, t);
|
|
437
445
|
});
|
|
438
446
|
}
|
|
439
447
|
// init google
|
|
440
448
|
initGoogle(e, t) {
|
|
441
|
-
return
|
|
449
|
+
return E(this, null, function* () {
|
|
442
450
|
if (!this.google) throw new Error("Evervault should be init before using Google Pay");
|
|
443
451
|
yield this.google.init(e, t);
|
|
444
452
|
});
|
|
@@ -454,14 +462,14 @@ class jr {
|
|
|
454
462
|
}
|
|
455
463
|
// render apple
|
|
456
464
|
renderApple(e) {
|
|
457
|
-
return
|
|
465
|
+
return E(this, null, function* () {
|
|
458
466
|
var t;
|
|
459
467
|
return (t = this.apple) == null ? void 0 : t.render(e);
|
|
460
468
|
});
|
|
461
469
|
}
|
|
462
470
|
// render google
|
|
463
471
|
renderGoogle(e) {
|
|
464
|
-
return
|
|
472
|
+
return E(this, null, function* () {
|
|
465
473
|
var t;
|
|
466
474
|
return (t = this.google) == null ? void 0 : t.render(e);
|
|
467
475
|
});
|
|
@@ -487,34 +495,34 @@ function Br(n, e, t) {
|
|
|
487
495
|
}
|
|
488
496
|
return Array.from(n);
|
|
489
497
|
}
|
|
490
|
-
function
|
|
498
|
+
function fi(n, e, t, i) {
|
|
491
499
|
return typeof n == "string" && Qt(e) ? Br(n, t, i) : n instanceof NodeList ? Array.from(n) : Array.isArray(n) ? n : [n];
|
|
492
500
|
}
|
|
493
501
|
function zr(n, e, t) {
|
|
494
502
|
return n * (e + 1);
|
|
495
503
|
}
|
|
496
|
-
function
|
|
504
|
+
function _n(n, e, t, i) {
|
|
497
505
|
var r;
|
|
498
506
|
return typeof e == "number" ? e : e.startsWith("-") || e.startsWith("+") ? Math.max(0, n + parseFloat(e)) : e === "<" ? t : (r = i.get(e)) != null ? r : n;
|
|
499
507
|
}
|
|
500
508
|
const nt = (n, e, t) => n + (e - n) * t, $r = (n, e, t) => {
|
|
501
509
|
const i = e - n;
|
|
502
510
|
return ((t - n) % i + i) % i + n;
|
|
503
|
-
},
|
|
504
|
-
function
|
|
505
|
-
return
|
|
511
|
+
}, gi = (n) => Array.isArray(n) && typeof n[0] != "number";
|
|
512
|
+
function bi(n, e) {
|
|
513
|
+
return gi(n) ? n[$r(0, n.length, e)] : n;
|
|
506
514
|
}
|
|
507
515
|
function Kr(n, e) {
|
|
508
516
|
n.indexOf(e) === -1 && n.push(e);
|
|
509
517
|
}
|
|
510
|
-
function
|
|
518
|
+
function vi(n, e) {
|
|
511
519
|
const t = n.indexOf(e);
|
|
512
520
|
t > -1 && n.splice(t, 1);
|
|
513
521
|
}
|
|
514
522
|
function qr(n, e, t) {
|
|
515
523
|
for (let i = 0; i < n.length; i++) {
|
|
516
524
|
const r = n[i];
|
|
517
|
-
r.at > e && r.at < t && (
|
|
525
|
+
r.at > e && r.at < t && (vi(n, r), i--);
|
|
518
526
|
}
|
|
519
527
|
}
|
|
520
528
|
function Gr(n, e, t, i, r, a) {
|
|
@@ -523,7 +531,7 @@ function Gr(n, e, t, i, r, a) {
|
|
|
523
531
|
n.push({
|
|
524
532
|
value: e[s],
|
|
525
533
|
at: nt(r, a, i[s]),
|
|
526
|
-
easing:
|
|
534
|
+
easing: bi(t, s)
|
|
527
535
|
});
|
|
528
536
|
}
|
|
529
537
|
function Hr(n, e) {
|
|
@@ -537,16 +545,16 @@ const J = (n) => !!(n && n.getVelocity), en = /* @__NO_SIDE_EFFECTS__ */ (n, e,
|
|
|
537
545
|
const i = e - n;
|
|
538
546
|
return i === 0 ? 1 : (t - n) / i;
|
|
539
547
|
};
|
|
540
|
-
function
|
|
548
|
+
function yi(n, e) {
|
|
541
549
|
const t = n[n.length - 1];
|
|
542
550
|
for (let i = 1; i <= e; i++) {
|
|
543
551
|
const r = /* @__PURE__ */ en(0, e, i);
|
|
544
552
|
n.push(nt(t, 1, r));
|
|
545
553
|
}
|
|
546
554
|
}
|
|
547
|
-
function
|
|
555
|
+
function Ci(n) {
|
|
548
556
|
const e = [0];
|
|
549
|
-
return
|
|
557
|
+
return yi(e, n.length - 1), e;
|
|
550
558
|
}
|
|
551
559
|
function tn(n) {
|
|
552
560
|
return typeof n == "function" && "applyToOptions" in n;
|
|
@@ -561,7 +569,7 @@ function nn(n) {
|
|
|
561
569
|
return e >= mt ? 1 / 0 : e;
|
|
562
570
|
}
|
|
563
571
|
const se = /* @__NO_SIDE_EFFECTS__ */ (n) => n * 1e3, le = /* @__NO_SIDE_EFFECTS__ */ (n) => n / 1e3;
|
|
564
|
-
function
|
|
572
|
+
function Ei(n, e = 100, t) {
|
|
565
573
|
const i = t(I(v({}, n), { keyframes: [0, e] })), r = Math.min(nn(i), mt);
|
|
566
574
|
return {
|
|
567
575
|
type: "keyframes",
|
|
@@ -589,14 +597,14 @@ function Zr(n, a = {}, i, r) {
|
|
|
589
597
|
h.set(y, p);
|
|
590
598
|
continue;
|
|
591
599
|
} else if (!Array.isArray(y)) {
|
|
592
|
-
h.set(y.name,
|
|
600
|
+
h.set(y.name, _n(p, y.at, m, h));
|
|
593
601
|
continue;
|
|
594
602
|
}
|
|
595
|
-
let [
|
|
596
|
-
_.at !== void 0 && (p =
|
|
603
|
+
let [k, V, _ = {}] = y;
|
|
604
|
+
_.at !== void 0 && (p = _n(p, _.at, m, h));
|
|
597
605
|
let M = 0;
|
|
598
606
|
const T = (D, C, w, R = 0, O = 0) => {
|
|
599
|
-
const q = Jr(D), _e = C, { delay: Te = 0, times: te =
|
|
607
|
+
const q = Jr(D), _e = C, { delay: Te = 0, times: te = Ci(q), type: fe = "keyframes", repeat: he, repeatType: Et, repeatDelay: kt = 0 } = _e, st = ae(_e, ["delay", "times", "type", "repeat", "repeatType", "repeatDelay"]);
|
|
600
608
|
let { ease: ne = e.ease || "easeOut", duration: f } = C;
|
|
601
609
|
const P = typeof Te == "function" ? Te(R, O) : Te, N = q.length, G = tn(fe) ? fe : r == null ? void 0 : r[fe];
|
|
602
610
|
if (N <= 2 && G) {
|
|
@@ -607,14 +615,14 @@ function Zr(n, a = {}, i, r) {
|
|
|
607
615
|
}
|
|
608
616
|
const re = v({}, st);
|
|
609
617
|
f !== void 0 && (re.duration = /* @__PURE__ */ se(f));
|
|
610
|
-
const pe =
|
|
618
|
+
const pe = Ei(re, z, G);
|
|
611
619
|
ne = pe.ease, f = pe.duration;
|
|
612
620
|
}
|
|
613
621
|
f != null || (f = o);
|
|
614
622
|
const ie = p + P;
|
|
615
623
|
te.length === 1 && te[0] === 0 && (te[1] = 1);
|
|
616
624
|
const X = te.length - q.length;
|
|
617
|
-
if (X > 0 &&
|
|
625
|
+
if (X > 0 && yi(te, X), q.length === 1 && q.unshift(null), he) {
|
|
618
626
|
ce(he < Wr, "Repeat count too high, must be less than 20"), f = zr(f, he);
|
|
619
627
|
const z = [...q], re = [...te];
|
|
620
628
|
ne = Array.isArray(ne) ? [...ne] : [ne];
|
|
@@ -622,30 +630,30 @@ function Zr(n, a = {}, i, r) {
|
|
|
622
630
|
for (let ge = 0; ge < he; ge++) {
|
|
623
631
|
q.push(...z);
|
|
624
632
|
for (let je = 0; je < z.length; je++)
|
|
625
|
-
te.push(re[je] + (ge + 1)), ne.push(je === 0 ? "linear" :
|
|
633
|
+
te.push(re[je] + (ge + 1)), ne.push(je === 0 ? "linear" : bi(pe, je - 1));
|
|
626
634
|
}
|
|
627
635
|
Hr(te, he);
|
|
628
636
|
}
|
|
629
637
|
const Ae = ie + f;
|
|
630
638
|
Gr(w, q, ne, te, ie, Ae), M = Math.max(P + f, M), g = Math.max(Ae, g);
|
|
631
639
|
};
|
|
632
|
-
if (J(
|
|
633
|
-
const D =
|
|
634
|
-
T(V, _,
|
|
640
|
+
if (J(k)) {
|
|
641
|
+
const D = Ln(k, u);
|
|
642
|
+
T(V, _, Vn("default", D));
|
|
635
643
|
} else {
|
|
636
|
-
const D =
|
|
644
|
+
const D = fi(k, V, i, d), C = D.length;
|
|
637
645
|
for (let w = 0; w < C; w++) {
|
|
638
646
|
V = V, _ = _;
|
|
639
|
-
const R = D[w], O =
|
|
647
|
+
const R = D[w], O = Ln(R, u);
|
|
640
648
|
for (const q in V)
|
|
641
|
-
T(V[q], Xr(_, q),
|
|
649
|
+
T(V[q], Xr(_, q), Vn(q, O), w, C);
|
|
642
650
|
}
|
|
643
651
|
}
|
|
644
652
|
m = p, p += M;
|
|
645
653
|
}
|
|
646
654
|
return u.forEach((b, y) => {
|
|
647
|
-
for (const
|
|
648
|
-
const V = b[
|
|
655
|
+
for (const k in b) {
|
|
656
|
+
const V = b[k];
|
|
649
657
|
V.sort(Yr);
|
|
650
658
|
const _ = [], M = [], T = [];
|
|
651
659
|
for (let C = 0; C < V.length; C++) {
|
|
@@ -657,7 +665,7 @@ function Zr(n, a = {}, i, r) {
|
|
|
657
665
|
transition: {}
|
|
658
666
|
});
|
|
659
667
|
const D = l.get(y);
|
|
660
|
-
D.keyframes[
|
|
668
|
+
D.keyframes[k] = _, D.transition[k] = v(I(v({}, e), {
|
|
661
669
|
duration: g,
|
|
662
670
|
ease: T,
|
|
663
671
|
times: M
|
|
@@ -665,10 +673,10 @@ function Zr(n, a = {}, i, r) {
|
|
|
665
673
|
}
|
|
666
674
|
}), l;
|
|
667
675
|
}
|
|
668
|
-
function
|
|
676
|
+
function Ln(n, e) {
|
|
669
677
|
return !e.has(n) && e.set(n, {}), e.get(n);
|
|
670
678
|
}
|
|
671
|
-
function
|
|
679
|
+
function Vn(n, e) {
|
|
672
680
|
return e[n] || (e[n] = []), e[n];
|
|
673
681
|
}
|
|
674
682
|
function Jr(n) {
|
|
@@ -678,26 +686,26 @@ function Xr(n, e) {
|
|
|
678
686
|
return n && n[e] ? v(v({}, n), n[e]) : v({}, n);
|
|
679
687
|
}
|
|
680
688
|
const Qr = (n) => typeof n == "number", ea = (n) => n.every(Qr), Je = /* @__PURE__ */ new WeakMap(), ta = (n) => Array.isArray(n);
|
|
681
|
-
function
|
|
689
|
+
function In(n) {
|
|
682
690
|
const e = [{}, {}];
|
|
683
691
|
return n == null || n.values.forEach((t, i) => {
|
|
684
692
|
e[0][i] = t.get(), e[1][i] = t.getVelocity();
|
|
685
693
|
}), e;
|
|
686
694
|
}
|
|
687
|
-
function
|
|
695
|
+
function ki(n, e, t, i) {
|
|
688
696
|
if (typeof e == "function") {
|
|
689
|
-
const [r, a] =
|
|
697
|
+
const [r, a] = In(i);
|
|
690
698
|
e = e(t !== void 0 ? t : n.custom, r, a);
|
|
691
699
|
}
|
|
692
700
|
if (typeof e == "string" && (e = n.variants && n.variants[e]), typeof e == "function") {
|
|
693
|
-
const [r, a] =
|
|
701
|
+
const [r, a] = In(i);
|
|
694
702
|
e = e(t !== void 0 ? t : n.custom, r, a);
|
|
695
703
|
}
|
|
696
704
|
return e;
|
|
697
705
|
}
|
|
698
706
|
function na(n, e, t) {
|
|
699
707
|
const i = n.getProps();
|
|
700
|
-
return
|
|
708
|
+
return ki(i, e, i.custom, n);
|
|
701
709
|
}
|
|
702
710
|
const lt = [
|
|
703
711
|
"setup",
|
|
@@ -786,16 +794,16 @@ const ee = {
|
|
|
786
794
|
set: (n) => {
|
|
787
795
|
pt = n, queueMicrotask(sa);
|
|
788
796
|
}
|
|
789
|
-
},
|
|
790
|
-
function
|
|
791
|
-
n ||
|
|
797
|
+
}, Mn = /* @__PURE__ */ new Set();
|
|
798
|
+
function xi(n, e, t) {
|
|
799
|
+
n || Mn.has(e) || (console.warn(e), Mn.add(e));
|
|
792
800
|
}
|
|
793
|
-
class
|
|
801
|
+
class wi {
|
|
794
802
|
constructor() {
|
|
795
803
|
this.subscriptions = [];
|
|
796
804
|
}
|
|
797
805
|
add(e) {
|
|
798
|
-
return Kr(this.subscriptions, e), () =>
|
|
806
|
+
return Kr(this.subscriptions, e), () => vi(this.subscriptions, e);
|
|
799
807
|
}
|
|
800
808
|
notify(e, t, i) {
|
|
801
809
|
const r = this.subscriptions.length;
|
|
@@ -815,10 +823,10 @@ class Ei {
|
|
|
815
823
|
this.subscriptions.length = 0;
|
|
816
824
|
}
|
|
817
825
|
}
|
|
818
|
-
function
|
|
826
|
+
function Ti(n, e) {
|
|
819
827
|
return e ? n * (1e3 / e) : 0;
|
|
820
828
|
}
|
|
821
|
-
const
|
|
829
|
+
const Pn = 30, oa = (n) => !isNaN(parseFloat(n));
|
|
822
830
|
class la {
|
|
823
831
|
/**
|
|
824
832
|
* @param init - The initiating value
|
|
@@ -883,10 +891,10 @@ class la {
|
|
|
883
891
|
* @deprecated
|
|
884
892
|
*/
|
|
885
893
|
onChange(e) {
|
|
886
|
-
return process.env.NODE_ENV !== "production" &&
|
|
894
|
+
return process.env.NODE_ENV !== "production" && xi(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e);
|
|
887
895
|
}
|
|
888
896
|
on(e, t) {
|
|
889
|
-
this.events[e] || (this.events[e] = new
|
|
897
|
+
this.events[e] || (this.events[e] = new wi());
|
|
890
898
|
const i = this.events[e].add(t);
|
|
891
899
|
return e === "change" ? () => {
|
|
892
900
|
i(), ue.read(() => {
|
|
@@ -967,10 +975,10 @@ class la {
|
|
|
967
975
|
*/
|
|
968
976
|
getVelocity() {
|
|
969
977
|
const e = ee.now();
|
|
970
|
-
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt >
|
|
978
|
+
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Pn)
|
|
971
979
|
return 0;
|
|
972
|
-
const t = Math.min(this.updatedAt - this.prevUpdatedAt,
|
|
973
|
-
return
|
|
980
|
+
const t = Math.min(this.updatedAt - this.prevUpdatedAt, Pn);
|
|
981
|
+
return Ti(parseFloat(this.current) - parseFloat(this.prevFrameValue), t);
|
|
974
982
|
}
|
|
975
983
|
/**
|
|
976
984
|
* Registers a new animation to control this `MotionValue`. Only one
|
|
@@ -1088,23 +1096,23 @@ const Re = [
|
|
|
1088
1096
|
stiffness: 550,
|
|
1089
1097
|
damping: n === 0 ? 2 * Math.sqrt(550) : 30,
|
|
1090
1098
|
restSpeed: 10
|
|
1091
|
-
}),
|
|
1099
|
+
}), Ea = {
|
|
1092
1100
|
type: "keyframes",
|
|
1093
1101
|
duration: 0.8
|
|
1094
|
-
},
|
|
1102
|
+
}, ka = {
|
|
1095
1103
|
type: "keyframes",
|
|
1096
1104
|
ease: [0.25, 0.1, 0.35, 1],
|
|
1097
1105
|
duration: 0.3
|
|
1098
|
-
}, xa = (n, { keyframes: e }) => e.length > 2 ?
|
|
1106
|
+
}, xa = (n, { keyframes: e }) => e.length > 2 ? Ea : Oe.has(n) ? n.startsWith("scale") ? Ca(e[1]) : ya : ka;
|
|
1099
1107
|
function wa(h) {
|
|
1100
1108
|
var m = h, { when: n, delay: e, delayChildren: t, staggerChildren: i, staggerDirection: r, repeat: a, repeatType: s, repeatDelay: o, from: l, elapsed: u } = m, d = ae(m, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from", "elapsed"]);
|
|
1101
1109
|
return !!Object.keys(d).length;
|
|
1102
1110
|
}
|
|
1103
|
-
function
|
|
1111
|
+
function Ai(n, e) {
|
|
1104
1112
|
var t, i;
|
|
1105
1113
|
return (i = (t = n == null ? void 0 : n[e]) != null ? t : n == null ? void 0 : n.default) != null ? i : n;
|
|
1106
1114
|
}
|
|
1107
|
-
const
|
|
1115
|
+
const _i = (n) => (e) => typeof e == "string" && e.startsWith(n), Li = /* @__PURE__ */ _i("--"), Ta = /* @__PURE__ */ _i("var(--"), an = (n) => Ta(n) ? Aa.test(n.split("/*")[0].trim()) : !1, Aa = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, xe = (n, e, t) => t > e ? e : t < n ? n : t, Ne = {
|
|
1108
1116
|
test: (n) => typeof n == "number",
|
|
1109
1117
|
parse: parseFloat,
|
|
1110
1118
|
transform: (n) => n
|
|
@@ -1116,7 +1124,7 @@ const Ti = (n) => (e) => typeof e == "string" && e.startsWith(n), Ai = /* @__PUR
|
|
|
1116
1124
|
function _a(n) {
|
|
1117
1125
|
return n == null;
|
|
1118
1126
|
}
|
|
1119
|
-
const La = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, on = (n, e) => (t) => !!(typeof t == "string" && La.test(t) && t.startsWith(n) || e && !_a(t) && Object.prototype.hasOwnProperty.call(t, e)),
|
|
1127
|
+
const La = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, on = (n, e) => (t) => !!(typeof t == "string" && La.test(t) && t.startsWith(n) || e && !_a(t) && Object.prototype.hasOwnProperty.call(t, e)), Vi = (n, e, t) => (i) => {
|
|
1120
1128
|
if (typeof i != "string")
|
|
1121
1129
|
return i;
|
|
1122
1130
|
const [r, a, s, o] = i.match(sn);
|
|
@@ -1130,7 +1138,7 @@ const La = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s
|
|
|
1130
1138
|
transform: (n) => Math.round(Va(n))
|
|
1131
1139
|
}), ye = {
|
|
1132
1140
|
test: /* @__PURE__ */ on("rgb", "red"),
|
|
1133
|
-
parse: /* @__PURE__ */
|
|
1141
|
+
parse: /* @__PURE__ */ Vi("red", "green", "blue"),
|
|
1134
1142
|
transform: ({ red: n, green: e, blue: t, alpha: i = 1 }) => "rgba(" + wt.transform(n) + ", " + wt.transform(e) + ", " + wt.transform(t) + ", " + We(Qe.transform(i)) + ")"
|
|
1135
1143
|
};
|
|
1136
1144
|
function Ia(n) {
|
|
@@ -1150,12 +1158,12 @@ const Ot = {
|
|
|
1150
1158
|
test: (e) => typeof e == "string" && e.endsWith(n) && e.split(" ").length === 1,
|
|
1151
1159
|
parse: parseFloat,
|
|
1152
1160
|
transform: (e) => `${e}${n}`
|
|
1153
|
-
}), me = /* @__PURE__ */ rt("deg"), Me = /* @__PURE__ */ rt("%"), L = /* @__PURE__ */ rt("px"), Ma = /* @__PURE__ */ rt("vh"), Pa = /* @__PURE__ */ rt("vw"),
|
|
1161
|
+
}), me = /* @__PURE__ */ rt("deg"), Me = /* @__PURE__ */ rt("%"), L = /* @__PURE__ */ rt("px"), Ma = /* @__PURE__ */ rt("vh"), Pa = /* @__PURE__ */ rt("vw"), Dn = I(v({}, Me), {
|
|
1154
1162
|
parse: (n) => Me.parse(n) / 100,
|
|
1155
1163
|
transform: (n) => Me.transform(n * 100)
|
|
1156
1164
|
}), Ve = {
|
|
1157
1165
|
test: /* @__PURE__ */ on("hsl", "hue"),
|
|
1158
|
-
parse: /* @__PURE__ */
|
|
1166
|
+
parse: /* @__PURE__ */ Vi("hue", "saturation", "lightness"),
|
|
1159
1167
|
transform: ({ hue: n, saturation: e, lightness: t, alpha: i = 1 }) => "hsla(" + Math.round(n) + ", " + Me.transform(We(e)) + ", " + Me.transform(We(t)) + ", " + We(Qe.transform(i)) + ")"
|
|
1160
1168
|
}, U = {
|
|
1161
1169
|
test: (n) => ye.test(n) || Ot.test(n) || Ve.test(n),
|
|
@@ -1166,7 +1174,7 @@ function Ra(n) {
|
|
|
1166
1174
|
var e, t;
|
|
1167
1175
|
return isNaN(n) && typeof n == "string" && (((e = n.match(sn)) == null ? void 0 : e.length) || 0) + (((t = n.match(Da)) == null ? void 0 : t.length) || 0) > 0;
|
|
1168
1176
|
}
|
|
1169
|
-
const
|
|
1177
|
+
const Ii = "number", Mi = "color", Oa = "var", Na = "var(", Rn = "${}", Sa = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
|
|
1170
1178
|
function et(n) {
|
|
1171
1179
|
const e = n.toString(), t = [], i = {
|
|
1172
1180
|
color: [],
|
|
@@ -1174,33 +1182,33 @@ function et(n) {
|
|
|
1174
1182
|
var: []
|
|
1175
1183
|
}, r = [];
|
|
1176
1184
|
let a = 0;
|
|
1177
|
-
const o = e.replace(Sa, (l) => (U.test(l) ? (i.color.push(a), r.push(
|
|
1185
|
+
const o = e.replace(Sa, (l) => (U.test(l) ? (i.color.push(a), r.push(Mi), t.push(U.parse(l))) : l.startsWith(Na) ? (i.var.push(a), r.push(Oa), t.push(l)) : (i.number.push(a), r.push(Ii), t.push(parseFloat(l))), ++a, Rn)).split(Rn);
|
|
1178
1186
|
return { values: t, split: o, indexes: i, types: r };
|
|
1179
1187
|
}
|
|
1180
|
-
function
|
|
1188
|
+
function Pi(n) {
|
|
1181
1189
|
return et(n).values;
|
|
1182
1190
|
}
|
|
1183
|
-
function
|
|
1191
|
+
function Di(n) {
|
|
1184
1192
|
const { split: e, types: t } = et(n), i = e.length;
|
|
1185
1193
|
return (r) => {
|
|
1186
1194
|
let a = "";
|
|
1187
1195
|
for (let s = 0; s < i; s++)
|
|
1188
1196
|
if (a += e[s], r[s] !== void 0) {
|
|
1189
1197
|
const o = t[s];
|
|
1190
|
-
o ===
|
|
1198
|
+
o === Ii ? a += We(r[s]) : o === Mi ? a += U.transform(r[s]) : a += r[s];
|
|
1191
1199
|
}
|
|
1192
1200
|
return a;
|
|
1193
1201
|
};
|
|
1194
1202
|
}
|
|
1195
1203
|
const Fa = (n) => typeof n == "number" ? 0 : n;
|
|
1196
1204
|
function ja(n) {
|
|
1197
|
-
const e =
|
|
1198
|
-
return
|
|
1205
|
+
const e = Pi(n);
|
|
1206
|
+
return Di(n)(e.map(Fa));
|
|
1199
1207
|
}
|
|
1200
1208
|
const Se = {
|
|
1201
1209
|
test: Ra,
|
|
1202
|
-
parse:
|
|
1203
|
-
createTransformer:
|
|
1210
|
+
parse: Pi,
|
|
1211
|
+
createTransformer: Di,
|
|
1204
1212
|
getAnimatableNone: ja
|
|
1205
1213
|
};
|
|
1206
1214
|
function Tt(n, e, t) {
|
|
@@ -1229,15 +1237,15 @@ const At = (n, e, t) => {
|
|
|
1229
1237
|
const i = n * n, r = t * (e * e - i) + i;
|
|
1230
1238
|
return r < 0 ? 0 : Math.sqrt(r);
|
|
1231
1239
|
}, za = [Ot, ye, Ve], $a = (n) => za.find((e) => e.test(n));
|
|
1232
|
-
function
|
|
1240
|
+
function On(n) {
|
|
1233
1241
|
const e = $a(n);
|
|
1234
1242
|
if (it(!!e, `'${n}' is not an animatable color. Use the equivalent color code instead.`), !e)
|
|
1235
1243
|
return !1;
|
|
1236
1244
|
let t = e.parse(n);
|
|
1237
1245
|
return e === Ve && (t = Ba(t)), t;
|
|
1238
1246
|
}
|
|
1239
|
-
const
|
|
1240
|
-
const t =
|
|
1247
|
+
const Nn = (n, e) => {
|
|
1248
|
+
const t = On(n), i = On(e);
|
|
1241
1249
|
if (!t || !i)
|
|
1242
1250
|
return gt(n, e);
|
|
1243
1251
|
const r = v({}, t);
|
|
@@ -1251,9 +1259,9 @@ function Ga(n, e) {
|
|
|
1251
1259
|
return (t) => nt(n, e, t);
|
|
1252
1260
|
}
|
|
1253
1261
|
function cn(n) {
|
|
1254
|
-
return typeof n == "number" ? Ga : typeof n == "string" ? an(n) ? gt : U.test(n) ?
|
|
1262
|
+
return typeof n == "number" ? Ga : typeof n == "string" ? an(n) ? gt : U.test(n) ? Nn : Ua : Array.isArray(n) ? Ri : typeof n == "object" ? U.test(n) ? Nn : Ha : gt;
|
|
1255
1263
|
}
|
|
1256
|
-
function
|
|
1264
|
+
function Ri(n, e) {
|
|
1257
1265
|
const t = [...n], i = t.length, r = n.map((a, s) => cn(a)(a, e[s]));
|
|
1258
1266
|
return (a) => {
|
|
1259
1267
|
for (let s = 0; s < i; s++)
|
|
@@ -1282,9 +1290,9 @@ function Ya(n, e) {
|
|
|
1282
1290
|
}
|
|
1283
1291
|
const Ua = (n, e) => {
|
|
1284
1292
|
const t = Se.createTransformer(e), i = et(n), r = et(e);
|
|
1285
|
-
return i.indexes.var.length === r.indexes.var.length && i.indexes.color.length === r.indexes.color.length && i.indexes.number.length >= r.indexes.number.length ? Nt.has(n) && !r.values.length || Nt.has(e) && !i.values.length ? Ka(n, e) : ln(
|
|
1293
|
+
return i.indexes.var.length === r.indexes.var.length && i.indexes.color.length === r.indexes.color.length && i.indexes.number.length >= r.indexes.number.length ? Nt.has(n) && !r.values.length || Nt.has(e) && !i.values.length ? Ka(n, e) : ln(Ri(Ya(i, r), r.values), t) : (it(!0, `Complex values '${n}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), gt(n, e));
|
|
1286
1294
|
};
|
|
1287
|
-
function
|
|
1295
|
+
function Oi(n, e, t) {
|
|
1288
1296
|
return typeof n == "number" && typeof e == "number" && typeof t == "number" ? nt(n, e, t) : cn(n)(n, e);
|
|
1289
1297
|
}
|
|
1290
1298
|
const Wa = (n) => {
|
|
@@ -1298,16 +1306,16 @@ const Wa = (n) => {
|
|
|
1298
1306
|
*/
|
|
1299
1307
|
now: () => ft.isProcessing ? ft.timestamp : ee.now()
|
|
1300
1308
|
};
|
|
1301
|
-
},
|
|
1309
|
+
}, Ni = (n, e, t = 10) => {
|
|
1302
1310
|
let i = "";
|
|
1303
1311
|
const r = Math.max(Math.round(e / t), 2);
|
|
1304
1312
|
for (let a = 0; a < r; a++)
|
|
1305
1313
|
i += n(a / (r - 1)) + ", ";
|
|
1306
1314
|
return `linear(${i.substring(0, i.length - 2)})`;
|
|
1307
1315
|
}, Za = 5;
|
|
1308
|
-
function
|
|
1316
|
+
function Si(n, e, t) {
|
|
1309
1317
|
const i = Math.max(e - Za, 0);
|
|
1310
|
-
return
|
|
1318
|
+
return Ti(t - n(i), e - i);
|
|
1311
1319
|
}
|
|
1312
1320
|
const B = {
|
|
1313
1321
|
// Default spring physics
|
|
@@ -1382,7 +1390,7 @@ function St(n, e) {
|
|
|
1382
1390
|
return n * Math.sqrt(1 - e * e);
|
|
1383
1391
|
}
|
|
1384
1392
|
const es = ["duration", "bounce"], ts = ["stiffness", "damping", "mass"];
|
|
1385
|
-
function
|
|
1393
|
+
function Sn(n, e) {
|
|
1386
1394
|
return e.some((t) => n[t] !== void 0);
|
|
1387
1395
|
}
|
|
1388
1396
|
function ns(n) {
|
|
@@ -1393,7 +1401,7 @@ function ns(n) {
|
|
|
1393
1401
|
mass: B.mass,
|
|
1394
1402
|
isResolvedFromDuration: !1
|
|
1395
1403
|
}, n);
|
|
1396
|
-
if (!
|
|
1404
|
+
if (!Sn(n, ts) && Sn(n, es))
|
|
1397
1405
|
if (n.visualDuration) {
|
|
1398
1406
|
const t = n.visualDuration, i = 2 * Math.PI / (t * 1.2), r = i * i, a = 2 * xe(0.05, 1, 1 - (n.bounce || 0)) * Math.sqrt(r);
|
|
1399
1407
|
e = I(v({}, e), {
|
|
@@ -1418,22 +1426,22 @@ function tt(n = B.visualDuration, e = B.bounce) {
|
|
|
1418
1426
|
let { restSpeed: i, restDelta: r } = t;
|
|
1419
1427
|
const a = t.keyframes[0], s = t.keyframes[t.keyframes.length - 1], o = { done: !1, value: a }, { stiffness: l, damping: u, mass: d, duration: h, velocity: m, isResolvedFromDuration: p } = ns(I(v({}, t), {
|
|
1420
1428
|
velocity: -/* @__PURE__ */ le(t.velocity || 0)
|
|
1421
|
-
})), g = m || 0, b = u / (2 * Math.sqrt(l * d)), y = s - a,
|
|
1429
|
+
})), g = m || 0, b = u / (2 * Math.sqrt(l * d)), y = s - a, k = /* @__PURE__ */ le(Math.sqrt(l / d)), V = Math.abs(y) < 5;
|
|
1422
1430
|
i || (i = V ? B.restSpeed.granular : B.restSpeed.default), r || (r = V ? B.restDelta.granular : B.restDelta.default);
|
|
1423
1431
|
let _;
|
|
1424
1432
|
if (b < 1) {
|
|
1425
|
-
const T = St(
|
|
1433
|
+
const T = St(k, b);
|
|
1426
1434
|
_ = (D) => {
|
|
1427
|
-
const C = Math.exp(-b *
|
|
1428
|
-
return s - C * ((g + b *
|
|
1435
|
+
const C = Math.exp(-b * k * D);
|
|
1436
|
+
return s - C * ((g + b * k * y) / T * Math.sin(T * D) + y * Math.cos(T * D));
|
|
1429
1437
|
};
|
|
1430
1438
|
} else if (b === 1)
|
|
1431
|
-
_ = (T) => s - Math.exp(-
|
|
1439
|
+
_ = (T) => s - Math.exp(-k * T) * (y + (g + k * y) * T);
|
|
1432
1440
|
else {
|
|
1433
|
-
const T =
|
|
1441
|
+
const T = k * Math.sqrt(b * b - 1);
|
|
1434
1442
|
_ = (D) => {
|
|
1435
|
-
const C = Math.exp(-b *
|
|
1436
|
-
return s - C * ((g + b *
|
|
1443
|
+
const C = Math.exp(-b * k * D), w = Math.min(T * D, 300);
|
|
1444
|
+
return s - C * ((g + b * k * y) * Math.sinh(w) + T * y * Math.cosh(w)) / T;
|
|
1437
1445
|
};
|
|
1438
1446
|
}
|
|
1439
1447
|
const M = {
|
|
@@ -1444,14 +1452,14 @@ function tt(n = B.visualDuration, e = B.bounce) {
|
|
|
1444
1452
|
o.done = T >= h;
|
|
1445
1453
|
else {
|
|
1446
1454
|
let C = T === 0 ? g : 0;
|
|
1447
|
-
b < 1 && (C = T === 0 ? /* @__PURE__ */ se(g) :
|
|
1455
|
+
b < 1 && (C = T === 0 ? /* @__PURE__ */ se(g) : Si(_, T, D));
|
|
1448
1456
|
const w = Math.abs(C) <= i, R = Math.abs(s - D) <= r;
|
|
1449
1457
|
o.done = w && R;
|
|
1450
1458
|
}
|
|
1451
1459
|
return o.value = o.done ? s : D, o;
|
|
1452
1460
|
},
|
|
1453
1461
|
toString: () => {
|
|
1454
|
-
const T = Math.min(nn(M), mt), D =
|
|
1462
|
+
const T = Math.min(nn(M), mt), D = Ni((C) => M.next(T * C).value, T, 30);
|
|
1455
1463
|
return T + "ms " + D;
|
|
1456
1464
|
},
|
|
1457
1465
|
toTransition: () => {
|
|
@@ -1460,7 +1468,7 @@ function tt(n = B.visualDuration, e = B.bounce) {
|
|
|
1460
1468
|
return M;
|
|
1461
1469
|
}
|
|
1462
1470
|
tt.applyToOptions = (n) => {
|
|
1463
|
-
const e =
|
|
1471
|
+
const e = Ei(n, 100, tt);
|
|
1464
1472
|
return n.ease = e.ease, n.duration = /* @__PURE__ */ se(e.duration), n.type = "keyframes", n;
|
|
1465
1473
|
};
|
|
1466
1474
|
function Ft({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 325, bounceDamping: r = 10, bounceStiffness: a = 500, modifyTarget: s, min: o, max: l, restDelta: u = 0.5, restSpeed: d }) {
|
|
@@ -1469,17 +1477,17 @@ function Ft({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 3
|
|
|
1469
1477
|
value: h
|
|
1470
1478
|
}, p = (w) => o !== void 0 && w < o || l !== void 0 && w > l, g = (w) => o === void 0 ? l : l === void 0 || Math.abs(o - w) < Math.abs(l - w) ? o : l;
|
|
1471
1479
|
let b = t * e;
|
|
1472
|
-
const y = h + b,
|
|
1473
|
-
|
|
1474
|
-
const V = (w) => -b * Math.exp(-w / i), _ = (w) =>
|
|
1480
|
+
const y = h + b, k = s === void 0 ? y : s(y);
|
|
1481
|
+
k !== y && (b = k - h);
|
|
1482
|
+
const V = (w) => -b * Math.exp(-w / i), _ = (w) => k + V(w), M = (w) => {
|
|
1475
1483
|
const R = V(w), O = _(w);
|
|
1476
|
-
m.done = Math.abs(R) <= u, m.value = m.done ?
|
|
1484
|
+
m.done = Math.abs(R) <= u, m.value = m.done ? k : O;
|
|
1477
1485
|
};
|
|
1478
1486
|
let T, D;
|
|
1479
1487
|
const C = (w) => {
|
|
1480
1488
|
p(m.value) && (T = w, D = tt({
|
|
1481
1489
|
keyframes: [m.value, g(m.value)],
|
|
1482
|
-
velocity:
|
|
1490
|
+
velocity: Si(_, w, m.value),
|
|
1483
1491
|
// TODO: This should be passing * 1000
|
|
1484
1492
|
damping: r,
|
|
1485
1493
|
stiffness: a,
|
|
@@ -1496,7 +1504,7 @@ function Ft({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 3
|
|
|
1496
1504
|
};
|
|
1497
1505
|
}
|
|
1498
1506
|
function is(n, e, t) {
|
|
1499
|
-
const i = [], r = t || de.mix ||
|
|
1507
|
+
const i = [], r = t || de.mix || Oi, a = n.length - 1;
|
|
1500
1508
|
for (let s = 0; s < a; s++) {
|
|
1501
1509
|
let o = r(n[s], n[s + 1]);
|
|
1502
1510
|
if (e) {
|
|
@@ -1530,11 +1538,11 @@ function rs(n, e, { clamp: t = !0, ease: i, mixer: r } = {}) {
|
|
|
1530
1538
|
function as(n, e) {
|
|
1531
1539
|
return n.map((t) => t * e);
|
|
1532
1540
|
}
|
|
1533
|
-
const
|
|
1541
|
+
const Fi = (n, e, t) => (((1 - 3 * t + 3 * e) * n + (3 * t - 6 * e)) * n + 3 * e) * n, ss = 1e-7, os = 12;
|
|
1534
1542
|
function ls(n, e, t, i, r) {
|
|
1535
1543
|
let a, s, o = 0;
|
|
1536
1544
|
do
|
|
1537
|
-
s = e + (t - e) / 2, a =
|
|
1545
|
+
s = e + (t - e) / 2, a = Fi(s, i, r) - n, a > 0 ? t = s : e = s;
|
|
1538
1546
|
while (Math.abs(a) > ss && ++o < os);
|
|
1539
1547
|
return s;
|
|
1540
1548
|
}
|
|
@@ -1542,40 +1550,40 @@ function at(n, e, t, i) {
|
|
|
1542
1550
|
if (n === e && t === i)
|
|
1543
1551
|
return De;
|
|
1544
1552
|
const r = (a) => ls(a, 0, 1, n, t);
|
|
1545
|
-
return (a) => a === 0 || a === 1 ? a :
|
|
1553
|
+
return (a) => a === 0 || a === 1 ? a : Fi(r(a), e, i);
|
|
1546
1554
|
}
|
|
1547
|
-
const cs = /* @__PURE__ */ at(0.42, 0, 1, 1), ds = /* @__PURE__ */ at(0, 0, 0.58, 1),
|
|
1555
|
+
const cs = /* @__PURE__ */ at(0.42, 0, 1, 1), ds = /* @__PURE__ */ at(0, 0, 0.58, 1), ji = /* @__PURE__ */ at(0.42, 0, 0.58, 1), Bi = (n) => (e) => e <= 0.5 ? n(2 * e) / 2 : (2 - n(2 * (1 - e))) / 2, zi = (n) => (e) => 1 - n(1 - e), $i = /* @__PURE__ */ at(0.33, 1.53, 0.69, 0.99), dn = /* @__PURE__ */ zi($i), Ki = /* @__PURE__ */ Bi(dn), qi = (n) => (n *= 2) < 1 ? 0.5 * dn(n) : 0.5 * (2 - Math.pow(2, -10 * (n - 1))), un = (n) => 1 - Math.sin(Math.acos(n)), us = zi(un), Gi = Bi(un), Hi = (n) => Array.isArray(n) && typeof n[0] == "number", Fn = {
|
|
1548
1556
|
linear: De,
|
|
1549
1557
|
easeIn: cs,
|
|
1550
|
-
easeInOut:
|
|
1558
|
+
easeInOut: ji,
|
|
1551
1559
|
easeOut: ds,
|
|
1552
1560
|
circIn: un,
|
|
1553
|
-
circInOut:
|
|
1561
|
+
circInOut: Gi,
|
|
1554
1562
|
circOut: us,
|
|
1555
1563
|
backIn: dn,
|
|
1556
|
-
backInOut:
|
|
1557
|
-
backOut:
|
|
1558
|
-
anticipate:
|
|
1559
|
-
}, hs = (n) => typeof n == "string",
|
|
1560
|
-
if (
|
|
1564
|
+
backInOut: Ki,
|
|
1565
|
+
backOut: $i,
|
|
1566
|
+
anticipate: qi
|
|
1567
|
+
}, hs = (n) => typeof n == "string", jn = (n) => {
|
|
1568
|
+
if (Hi(n)) {
|
|
1561
1569
|
ce(n.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
1562
1570
|
const [e, t, i, r] = n;
|
|
1563
1571
|
return at(e, t, i, r);
|
|
1564
1572
|
} else if (hs(n))
|
|
1565
|
-
return ce(
|
|
1573
|
+
return ce(Fn[n] !== void 0, `Invalid easing type '${n}'`), Fn[n];
|
|
1566
1574
|
return n;
|
|
1567
1575
|
};
|
|
1568
1576
|
function ps(n, e) {
|
|
1569
|
-
return n.map(() => e ||
|
|
1577
|
+
return n.map(() => e || ji).splice(0, n.length - 1);
|
|
1570
1578
|
}
|
|
1571
1579
|
function Ie({ duration: n = 300, keyframes: e, times: t, ease: i = "easeInOut" }) {
|
|
1572
|
-
const r =
|
|
1580
|
+
const r = gi(i) ? i.map(jn) : jn(i), a = {
|
|
1573
1581
|
done: !1,
|
|
1574
1582
|
value: e[0]
|
|
1575
1583
|
}, s = as(
|
|
1576
1584
|
// Only use the provided offsets if they're the correct length
|
|
1577
1585
|
// TODO Maybe we should warn here if there's a length mismatch
|
|
1578
|
-
t && t.length === e.length ? t :
|
|
1586
|
+
t && t.length === e.length ? t : Ci(e),
|
|
1579
1587
|
n
|
|
1580
1588
|
), o = rs(s, e, {
|
|
1581
1589
|
ease: Array.isArray(r) ? r : ps(e, r)
|
|
@@ -1597,7 +1605,7 @@ const fs = {
|
|
|
1597
1605
|
keyframes: Ie,
|
|
1598
1606
|
spring: tt
|
|
1599
1607
|
};
|
|
1600
|
-
function
|
|
1608
|
+
function Yi(n) {
|
|
1601
1609
|
typeof n.type == "string" && (n.type = fs[n.type]);
|
|
1602
1610
|
}
|
|
1603
1611
|
class pn {
|
|
@@ -1635,11 +1643,11 @@ class mn extends pn {
|
|
|
1635
1643
|
}
|
|
1636
1644
|
initAnimation() {
|
|
1637
1645
|
const { options: e } = this;
|
|
1638
|
-
|
|
1646
|
+
Yi(e);
|
|
1639
1647
|
const { type: t = Ie, repeat: i = 0, repeatDelay: r = 0, repeatType: a, velocity: s = 0 } = e;
|
|
1640
1648
|
let { keyframes: o } = e;
|
|
1641
1649
|
const l = t || Ie;
|
|
1642
|
-
process.env.NODE_ENV !== "production" && l !== Ie && ce(o.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`), l !== Ie && typeof o[0] != "number" && (this.mixKeyframes = ln(gs,
|
|
1650
|
+
process.env.NODE_ENV !== "production" && l !== Ie && ce(o.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`), l !== Ie && typeof o[0] != "number" && (this.mixKeyframes = ln(gs, Oi(o[0], o[1])), o = [0, 100]);
|
|
1643
1651
|
const u = l(I(v({}, e), { keyframes: o }));
|
|
1644
1652
|
a === "mirror" && (this.mirroredGenerator = l(I(v({}, e), {
|
|
1645
1653
|
keyframes: [...o].reverse(),
|
|
@@ -1658,8 +1666,8 @@ class mn extends pn {
|
|
|
1658
1666
|
return i.next(0);
|
|
1659
1667
|
const { delay: u = 0, keyframes: d, repeat: h, repeatType: m, repeatDelay: p, type: g, onUpdate: b, finalKeyframe: y } = this.options;
|
|
1660
1668
|
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);
|
|
1661
|
-
const
|
|
1662
|
-
this.currentTime = Math.max(
|
|
1669
|
+
const k = this.currentTime - u * (this.playbackSpeed >= 0 ? 1 : -1), V = this.playbackSpeed >= 0 ? k < 0 : k > r;
|
|
1670
|
+
this.currentTime = Math.max(k, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = r);
|
|
1663
1671
|
let _ = this.currentTime, M = i;
|
|
1664
1672
|
if (h) {
|
|
1665
1673
|
const w = Math.min(this.currentTime, r) / o;
|
|
@@ -1757,20 +1765,20 @@ const Ce = (n) => n * 180 / Math.PI, jt = (n) => {
|
|
|
1757
1765
|
skewX: (n) => Ce(Math.atan(n[1])),
|
|
1758
1766
|
skewY: (n) => Ce(Math.atan(n[2])),
|
|
1759
1767
|
skew: (n) => (Math.abs(n[1]) + Math.abs(n[2])) / 2
|
|
1760
|
-
}, Bt = (n) => (n = n % 360, n < 0 && (n += 360), n),
|
|
1768
|
+
}, Bt = (n) => (n = n % 360, n < 0 && (n += 360), n), Bn = jt, zn = (n) => Math.sqrt(n[0] * n[0] + n[1] * n[1]), $n = (n) => Math.sqrt(n[4] * n[4] + n[5] * n[5]), ys = {
|
|
1761
1769
|
x: 12,
|
|
1762
1770
|
y: 13,
|
|
1763
1771
|
z: 14,
|
|
1764
1772
|
translateX: 12,
|
|
1765
1773
|
translateY: 13,
|
|
1766
1774
|
translateZ: 14,
|
|
1767
|
-
scaleX:
|
|
1768
|
-
scaleY:
|
|
1769
|
-
scale: (n) => (
|
|
1775
|
+
scaleX: zn,
|
|
1776
|
+
scaleY: $n,
|
|
1777
|
+
scale: (n) => (zn(n) + $n(n)) / 2,
|
|
1770
1778
|
rotateX: (n) => Bt(Ce(Math.atan2(n[6], n[5]))),
|
|
1771
1779
|
rotateY: (n) => Bt(Ce(Math.atan2(-n[2], n[0]))),
|
|
1772
|
-
rotateZ:
|
|
1773
|
-
rotate:
|
|
1780
|
+
rotateZ: Bn,
|
|
1781
|
+
rotate: Bn,
|
|
1774
1782
|
skewX: (n) => Ce(Math.atan(n[4])),
|
|
1775
1783
|
skewY: (n) => Ce(Math.atan(n[1])),
|
|
1776
1784
|
skew: (n) => (Math.abs(n[1]) + Math.abs(n[4])) / 2
|
|
@@ -1791,17 +1799,17 @@ function $t(n, e) {
|
|
|
1791
1799
|
}
|
|
1792
1800
|
if (!r)
|
|
1793
1801
|
return zt(e);
|
|
1794
|
-
const a = i[e], s = r[1].split(",").map(
|
|
1802
|
+
const a = i[e], s = r[1].split(",").map(Es);
|
|
1795
1803
|
return typeof a == "function" ? a(s) : s[a];
|
|
1796
1804
|
}
|
|
1797
1805
|
const Cs = (n, e) => {
|
|
1798
1806
|
const { transform: t = "none" } = getComputedStyle(n);
|
|
1799
1807
|
return $t(t, e);
|
|
1800
1808
|
};
|
|
1801
|
-
function
|
|
1809
|
+
function Es(n) {
|
|
1802
1810
|
return parseFloat(n.trim());
|
|
1803
1811
|
}
|
|
1804
|
-
const
|
|
1812
|
+
const Kn = (n) => n === Ne || n === L, ks = /* @__PURE__ */ new Set(["x", "y", "z"]), xs = Re.filter((n) => !ks.has(n));
|
|
1805
1813
|
function ws(n) {
|
|
1806
1814
|
const e = [];
|
|
1807
1815
|
return xs.forEach((t) => {
|
|
@@ -1809,7 +1817,7 @@ function ws(n) {
|
|
|
1809
1817
|
i !== void 0 && (e.push([t, i.get()]), i.set(t.startsWith("scale") ? 1 : 0));
|
|
1810
1818
|
}), e;
|
|
1811
1819
|
}
|
|
1812
|
-
const
|
|
1820
|
+
const Ee = {
|
|
1813
1821
|
// Dimensions
|
|
1814
1822
|
width: ({ x: n }, { paddingLeft: e = "0", paddingRight: t = "0" }) => n.max - n.min - parseFloat(e) - parseFloat(t),
|
|
1815
1823
|
height: ({ y: n }, { paddingTop: e = "0", paddingBottom: t = "0" }) => n.max - n.min - parseFloat(e) - parseFloat(t),
|
|
@@ -1821,13 +1829,13 @@ const ke = {
|
|
|
1821
1829
|
x: (n, { transform: e }) => $t(e, "x"),
|
|
1822
1830
|
y: (n, { transform: e }) => $t(e, "y")
|
|
1823
1831
|
};
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
const
|
|
1832
|
+
Ee.translateX = Ee.x;
|
|
1833
|
+
Ee.translateY = Ee.y;
|
|
1834
|
+
const ke = /* @__PURE__ */ new Set();
|
|
1827
1835
|
let Kt = !1, qt = !1, Gt = !1;
|
|
1828
|
-
function
|
|
1836
|
+
function Ui() {
|
|
1829
1837
|
if (qt) {
|
|
1830
|
-
const n = Array.from(
|
|
1838
|
+
const n = Array.from(ke).filter((i) => i.needsMeasurement), e = new Set(n.map((i) => i.element)), t = /* @__PURE__ */ new Map();
|
|
1831
1839
|
e.forEach((i) => {
|
|
1832
1840
|
const r = ws(i);
|
|
1833
1841
|
r.length && (t.set(i, r), i.render());
|
|
@@ -1842,22 +1850,22 @@ function Hi() {
|
|
|
1842
1850
|
i.suspendedScrollY !== void 0 && window.scrollTo(0, i.suspendedScrollY);
|
|
1843
1851
|
});
|
|
1844
1852
|
}
|
|
1845
|
-
qt = !1, Kt = !1,
|
|
1853
|
+
qt = !1, Kt = !1, ke.forEach((n) => n.complete(Gt)), ke.clear();
|
|
1846
1854
|
}
|
|
1847
|
-
function
|
|
1848
|
-
|
|
1855
|
+
function Wi() {
|
|
1856
|
+
ke.forEach((n) => {
|
|
1849
1857
|
n.readKeyframes(), n.needsMeasurement && (qt = !0);
|
|
1850
1858
|
});
|
|
1851
1859
|
}
|
|
1852
1860
|
function Ts() {
|
|
1853
|
-
Gt = !0,
|
|
1861
|
+
Gt = !0, Wi(), Ui(), Gt = !1;
|
|
1854
1862
|
}
|
|
1855
1863
|
class fn {
|
|
1856
1864
|
constructor(e, t, i, r, a, s = !1) {
|
|
1857
1865
|
this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...e], this.onComplete = t, this.name = i, this.motionValue = r, this.element = a, this.isAsync = s;
|
|
1858
1866
|
}
|
|
1859
1867
|
scheduleResolve() {
|
|
1860
|
-
this.state = "scheduled", this.isAsync ? (
|
|
1868
|
+
this.state = "scheduled", this.isAsync ? (ke.add(this), Kt || (Kt = !0, ue.read(Wi), ue.resolveKeyframes(Ui))) : (this.readKeyframes(), this.complete());
|
|
1861
1869
|
}
|
|
1862
1870
|
readKeyframes() {
|
|
1863
1871
|
const { unresolvedKeyframes: e, name: t, element: i, motionValue: r } = this;
|
|
@@ -1882,10 +1890,10 @@ class fn {
|
|
|
1882
1890
|
measureEndState() {
|
|
1883
1891
|
}
|
|
1884
1892
|
complete(e = !1) {
|
|
1885
|
-
this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e),
|
|
1893
|
+
this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e), ke.delete(this);
|
|
1886
1894
|
}
|
|
1887
1895
|
cancel() {
|
|
1888
|
-
this.state === "scheduled" && (
|
|
1896
|
+
this.state === "scheduled" && (ke.delete(this), this.state = "pending");
|
|
1889
1897
|
}
|
|
1890
1898
|
resume() {
|
|
1891
1899
|
this.state === "pending" && this.scheduleResolve();
|
|
@@ -1908,14 +1916,14 @@ function Is(n, e) {
|
|
|
1908
1916
|
return (i = Vs[e]) != null ? i : t();
|
|
1909
1917
|
};
|
|
1910
1918
|
}
|
|
1911
|
-
const
|
|
1919
|
+
const Zi = /* @__PURE__ */ Is(() => {
|
|
1912
1920
|
try {
|
|
1913
1921
|
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
1914
1922
|
} catch (n) {
|
|
1915
1923
|
return !1;
|
|
1916
1924
|
}
|
|
1917
1925
|
return !0;
|
|
1918
|
-
}, "linearEasing"), Ue = ([n, e, t, i]) => `cubic-bezier(${n}, ${e}, ${t}, ${i})`,
|
|
1926
|
+
}, "linearEasing"), Ue = ([n, e, t, i]) => `cubic-bezier(${n}, ${e}, ${t}, ${i})`, qn = {
|
|
1919
1927
|
linear: "linear",
|
|
1920
1928
|
ease: "ease",
|
|
1921
1929
|
easeIn: "ease-in",
|
|
@@ -1926,16 +1934,16 @@ const Ui = /* @__PURE__ */ Is(() => {
|
|
|
1926
1934
|
backIn: /* @__PURE__ */ Ue([0.31, 0.01, 0.66, -0.59]),
|
|
1927
1935
|
backOut: /* @__PURE__ */ Ue([0.33, 1.53, 0.69, 0.99])
|
|
1928
1936
|
};
|
|
1929
|
-
function
|
|
1937
|
+
function Ji(n, e) {
|
|
1930
1938
|
if (n)
|
|
1931
|
-
return typeof n == "function" ?
|
|
1939
|
+
return typeof n == "function" ? Zi() ? Ni(n, e) : "ease-out" : Hi(n) ? Ue(n) : Array.isArray(n) ? n.map((t) => Ji(t, e) || qn.easeOut) : qn[n];
|
|
1932
1940
|
}
|
|
1933
1941
|
function Ms(n, e, t, { delay: i = 0, duration: r = 300, repeat: a = 0, repeatType: s = "loop", ease: o = "easeOut", times: l } = {}, u = void 0) {
|
|
1934
1942
|
const d = {
|
|
1935
1943
|
[e]: t
|
|
1936
1944
|
};
|
|
1937
1945
|
l && (d.offset = l);
|
|
1938
|
-
const h =
|
|
1946
|
+
const h = Ji(o, r);
|
|
1939
1947
|
Array.isArray(h) && (d.easing = h);
|
|
1940
1948
|
const m = {
|
|
1941
1949
|
delay: i,
|
|
@@ -1950,7 +1958,7 @@ function Ms(n, e, t, { delay: i = 0, duration: r = 300, repeat: a = 0, repeatTyp
|
|
|
1950
1958
|
function Ps(t) {
|
|
1951
1959
|
var i = t, { type: n } = i, e = ae(i, ["type"]);
|
|
1952
1960
|
var r, a;
|
|
1953
|
-
return tn(n) &&
|
|
1961
|
+
return tn(n) && Zi() ? n.applyToOptions(e) : ((r = e.duration) != null || (e.duration = 300), (a = e.ease) != null || (e.ease = "easeOut"), e);
|
|
1954
1962
|
}
|
|
1955
1963
|
class Ds extends pn {
|
|
1956
1964
|
constructor(e) {
|
|
@@ -2044,21 +2052,21 @@ class Ds extends pn {
|
|
|
2044
2052
|
return this.allowFlatten && ((i = this.animation.effect) == null || i.updateTiming({ easing: "linear" })), this.animation.onfinish = null, e && Ls() ? (this.animation.timeline = e, De) : t(this);
|
|
2045
2053
|
}
|
|
2046
2054
|
}
|
|
2047
|
-
const
|
|
2048
|
-
anticipate:
|
|
2049
|
-
backInOut:
|
|
2050
|
-
circInOut:
|
|
2055
|
+
const Xi = {
|
|
2056
|
+
anticipate: qi,
|
|
2057
|
+
backInOut: Ki,
|
|
2058
|
+
circInOut: Gi
|
|
2051
2059
|
};
|
|
2052
2060
|
function Rs(n) {
|
|
2053
|
-
return n in
|
|
2061
|
+
return n in Xi;
|
|
2054
2062
|
}
|
|
2055
2063
|
function Os(n) {
|
|
2056
|
-
typeof n.ease == "string" && Rs(n.ease) && (n.ease =
|
|
2064
|
+
typeof n.ease == "string" && Rs(n.ease) && (n.ease = Xi[n.ease]);
|
|
2057
2065
|
}
|
|
2058
|
-
const
|
|
2066
|
+
const Gn = 10;
|
|
2059
2067
|
class Ns extends Ds {
|
|
2060
2068
|
constructor(e) {
|
|
2061
|
-
Os(e),
|
|
2069
|
+
Os(e), Yi(e), super(e), e.startTime && (this.startTime = e.startTime), this.options = e;
|
|
2062
2070
|
}
|
|
2063
2071
|
/**
|
|
2064
2072
|
* WAAPI doesn't natively have any interruption capabilities.
|
|
@@ -2080,10 +2088,10 @@ class Ns extends Ds {
|
|
|
2080
2088
|
const o = new mn(I(v({}, s), {
|
|
2081
2089
|
autoplay: !1
|
|
2082
2090
|
})), l = /* @__PURE__ */ se((d = this.finishedTime) != null ? d : this.time);
|
|
2083
|
-
t.setWithVelocity(o.sample(l -
|
|
2091
|
+
t.setWithVelocity(o.sample(l - Gn).value, o.sample(l).value, Gn), o.stop();
|
|
2084
2092
|
}
|
|
2085
2093
|
}
|
|
2086
|
-
const
|
|
2094
|
+
const Hn = (n, e) => e === "zIndex" ? !1 : !!(typeof n == "number" || Array.isArray(n) || typeof n == "string" && // It's animatable if we have a string
|
|
2087
2095
|
(Se.test(n) || n === "0") && // And it contains numbers and/or colors
|
|
2088
2096
|
!n.startsWith("url("));
|
|
2089
2097
|
function Ss(n) {
|
|
@@ -2100,14 +2108,14 @@ function Fs(n, e, t, i) {
|
|
|
2100
2108
|
return !1;
|
|
2101
2109
|
if (e === "display" || e === "visibility")
|
|
2102
2110
|
return !0;
|
|
2103
|
-
const a = n[n.length - 1], s =
|
|
2111
|
+
const a = n[n.length - 1], s = Hn(r, e), o = Hn(a, e);
|
|
2104
2112
|
return it(s === o, `You are trying to animate ${e} from "${r}" to "${a}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${a} via the \`style\` property.`), !s || !o ? !1 : Ss(n) || (t === "spring" || tn(t)) && i;
|
|
2105
2113
|
}
|
|
2106
|
-
function
|
|
2114
|
+
function Qi(n) {
|
|
2107
2115
|
return typeof n == "object" && n !== null;
|
|
2108
2116
|
}
|
|
2109
2117
|
function js(n) {
|
|
2110
|
-
return
|
|
2118
|
+
return Qi(n) && "offsetHeight" in n;
|
|
2111
2119
|
}
|
|
2112
2120
|
const Bs = /* @__PURE__ */ new Set([
|
|
2113
2121
|
"opacity",
|
|
@@ -2135,8 +2143,8 @@ class qs extends pn {
|
|
|
2135
2143
|
var p = m, { autoplay: e = !0, delay: t = 0, type: i = "keyframes", repeat: r = 0, repeatDelay: a = 0, repeatType: s = "loop", keyframes: o, name: l, motionValue: u, element: d } = p, h = ae(p, ["autoplay", "delay", "type", "repeat", "repeatDelay", "repeatType", "keyframes", "name", "motionValue", "element"]);
|
|
2136
2144
|
var y;
|
|
2137
2145
|
super(), this.stop = () => {
|
|
2138
|
-
var
|
|
2139
|
-
this._animation && (this._animation.stop(), (
|
|
2146
|
+
var k, V;
|
|
2147
|
+
this._animation && (this._animation.stop(), (k = this.stopTimeline) == null || k.call(this)), (V = this.keyframeResolver) == null || V.cancel();
|
|
2140
2148
|
}, this.createdAt = ee.now();
|
|
2141
2149
|
const g = v({
|
|
2142
2150
|
autoplay: e,
|
|
@@ -2149,7 +2157,7 @@ class qs extends pn {
|
|
|
2149
2157
|
motionValue: u,
|
|
2150
2158
|
element: d
|
|
2151
2159
|
}, h), b = (d == null ? void 0 : d.KeyframeResolver) || fn;
|
|
2152
|
-
this.keyframeResolver = new b(o, (
|
|
2160
|
+
this.keyframeResolver = new b(o, (k, V, _) => this.onKeyframesResolved(k, V, g, !_), l, u, d), (y = this.keyframeResolver) == null || y.scheduleResolve();
|
|
2153
2161
|
}
|
|
2154
2162
|
onKeyframesResolved(e, t, i, r) {
|
|
2155
2163
|
this.keyframeResolver = void 0;
|
|
@@ -2214,8 +2222,8 @@ class qs extends pn {
|
|
|
2214
2222
|
this._animation && this.animation.cancel(), (e = this.keyframeResolver) == null || e.cancel();
|
|
2215
2223
|
}
|
|
2216
2224
|
}
|
|
2217
|
-
const
|
|
2218
|
-
const o =
|
|
2225
|
+
const er = (n, e, t, i = {}, r, a) => (s) => {
|
|
2226
|
+
const o = Ai(i, n) || {}, l = o.delay || i.delay || 0;
|
|
2219
2227
|
let { elapsed: u = 0 } = i;
|
|
2220
2228
|
u = u - /* @__PURE__ */ se(l);
|
|
2221
2229
|
const d = I(v({
|
|
@@ -2246,7 +2254,7 @@ const Xi = (n, e, t, i = {}, r, a) => (s) => {
|
|
|
2246
2254
|
}
|
|
2247
2255
|
}
|
|
2248
2256
|
return o.isSync ? new mn(d) : new qs(d);
|
|
2249
|
-
},
|
|
2257
|
+
}, tr = /* @__PURE__ */ new Set([
|
|
2250
2258
|
"width",
|
|
2251
2259
|
"height",
|
|
2252
2260
|
"top",
|
|
@@ -2270,18 +2278,18 @@ function Hs(n, e, { delay: t = 0, transitionOverride: i, type: r } = {}) {
|
|
|
2270
2278
|
continue;
|
|
2271
2279
|
const b = v({
|
|
2272
2280
|
delay: t
|
|
2273
|
-
},
|
|
2281
|
+
}, Ai(a || {}, m)), y = p.get();
|
|
2274
2282
|
if (y !== void 0 && !p.isAnimating && !Array.isArray(g) && g === y && !b.velocity)
|
|
2275
2283
|
continue;
|
|
2276
|
-
let
|
|
2284
|
+
let k = !1;
|
|
2277
2285
|
if (window.MotionHandoffAnimation) {
|
|
2278
2286
|
const _ = ga(n);
|
|
2279
2287
|
if (_) {
|
|
2280
2288
|
const M = window.MotionHandoffAnimation(_, m, ue);
|
|
2281
|
-
M !== null && (b.startTime = M,
|
|
2289
|
+
M !== null && (b.startTime = M, k = !0);
|
|
2282
2290
|
}
|
|
2283
2291
|
}
|
|
2284
|
-
pa(n, m), p.start(
|
|
2292
|
+
pa(n, m), p.start(er(m, p, g, n.shouldReduceMotion && tr.has(m) ? { type: !1 } : b, n, k));
|
|
2285
2293
|
const V = p.animation;
|
|
2286
2294
|
V && l.push(V);
|
|
2287
2295
|
}
|
|
@@ -2311,7 +2319,7 @@ function Us(n, e) {
|
|
|
2311
2319
|
function Ws(n, e) {
|
|
2312
2320
|
return Ys(Us(n.getBoundingClientRect(), e));
|
|
2313
2321
|
}
|
|
2314
|
-
const
|
|
2322
|
+
const Yn = {
|
|
2315
2323
|
animation: [
|
|
2316
2324
|
"animate",
|
|
2317
2325
|
"variants",
|
|
@@ -2331,16 +2339,16 @@ const Gn = {
|
|
|
2331
2339
|
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
2332
2340
|
layout: ["layout", "layoutId"]
|
|
2333
2341
|
}, Ht = {};
|
|
2334
|
-
for (const n in
|
|
2342
|
+
for (const n in Yn)
|
|
2335
2343
|
Ht[n] = {
|
|
2336
|
-
isEnabled: (e) =>
|
|
2344
|
+
isEnabled: (e) => Yn[n].some((t) => !!e[t])
|
|
2337
2345
|
};
|
|
2338
|
-
const
|
|
2339
|
-
x:
|
|
2340
|
-
y:
|
|
2341
|
-
}), Zs = typeof window != "undefined", Yt = { current: null },
|
|
2346
|
+
const Un = () => ({ min: 0, max: 0 }), bn = () => ({
|
|
2347
|
+
x: Un(),
|
|
2348
|
+
y: Un()
|
|
2349
|
+
}), Zs = typeof window != "undefined", Yt = { current: null }, nr = { current: !1 };
|
|
2342
2350
|
function Js() {
|
|
2343
|
-
if (
|
|
2351
|
+
if (nr.current = !0, !!Zs)
|
|
2344
2352
|
if (window.matchMedia) {
|
|
2345
2353
|
const n = window.matchMedia("(prefers-reduced-motion)"), e = () => Yt.current = n.matches;
|
|
2346
2354
|
n.addListener(e), e();
|
|
@@ -2362,11 +2370,11 @@ const eo = [
|
|
|
2362
2370
|
"whileDrag",
|
|
2363
2371
|
"exit"
|
|
2364
2372
|
], to = ["initial", ...eo];
|
|
2365
|
-
function
|
|
2373
|
+
function ir(n) {
|
|
2366
2374
|
return Xs(n.animate) || to.some((e) => Qs(n[e]));
|
|
2367
2375
|
}
|
|
2368
2376
|
function no(n) {
|
|
2369
|
-
return !!(
|
|
2377
|
+
return !!(ir(n) || n.variants);
|
|
2370
2378
|
}
|
|
2371
2379
|
function io(n, e, t) {
|
|
2372
2380
|
for (const i in e) {
|
|
@@ -2388,10 +2396,10 @@ function io(n, e, t) {
|
|
|
2388
2396
|
e[i] === void 0 && n.removeValue(i);
|
|
2389
2397
|
return e;
|
|
2390
2398
|
}
|
|
2391
|
-
const
|
|
2399
|
+
const rr = (n) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n), ar = (n) => /^0[^.\s]+$/u.test(n), ro = {
|
|
2392
2400
|
test: (n) => n === "auto",
|
|
2393
2401
|
parse: (n) => n
|
|
2394
|
-
},
|
|
2402
|
+
}, sr = (n) => (e) => e.test(n), or = [Ne, L, Me, me, Pa, Ma, ro], Wn = (n) => or.find(sr(n)), ao = [...or, U, Se], so = (n) => ao.find(sr(n)), oo = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
2395
2403
|
function lo(n) {
|
|
2396
2404
|
const [e, t] = n.slice(0, -1).split("(");
|
|
2397
2405
|
if (e === "drop-shadow")
|
|
@@ -2408,7 +2416,7 @@ const co = /\b([a-z-]*)\(.*?\)/gu, Ut = I(v({}, Se), {
|
|
|
2408
2416
|
const e = n.match(co);
|
|
2409
2417
|
return e ? e.map(lo).join(" ") : n;
|
|
2410
2418
|
}
|
|
2411
|
-
}),
|
|
2419
|
+
}), Zn = I(v({}, Ne), {
|
|
2412
2420
|
transform: Math.round
|
|
2413
2421
|
}), uo = {
|
|
2414
2422
|
rotate: me,
|
|
@@ -2432,8 +2440,8 @@ const co = /\b([a-z-]*)\(.*?\)/gu, Ut = I(v({}, Se), {
|
|
|
2432
2440
|
perspective: L,
|
|
2433
2441
|
transformPerspective: L,
|
|
2434
2442
|
opacity: Qe,
|
|
2435
|
-
originX:
|
|
2436
|
-
originY:
|
|
2443
|
+
originX: Dn,
|
|
2444
|
+
originY: Dn,
|
|
2437
2445
|
originZ: L
|
|
2438
2446
|
}, vn = I(v({
|
|
2439
2447
|
// Border props
|
|
@@ -2472,11 +2480,11 @@ const co = /\b([a-z-]*)\(.*?\)/gu, Ut = I(v({}, Se), {
|
|
|
2472
2480
|
backgroundPositionX: L,
|
|
2473
2481
|
backgroundPositionY: L
|
|
2474
2482
|
}, uo), {
|
|
2475
|
-
zIndex:
|
|
2483
|
+
zIndex: Zn,
|
|
2476
2484
|
// SVG
|
|
2477
2485
|
fillOpacity: Qe,
|
|
2478
2486
|
strokeOpacity: Qe,
|
|
2479
|
-
numOctaves:
|
|
2487
|
+
numOctaves: Zn
|
|
2480
2488
|
}), ho = I(v({}, vn), {
|
|
2481
2489
|
// Color props
|
|
2482
2490
|
color: U,
|
|
@@ -2492,12 +2500,12 @@ const co = /\b([a-z-]*)\(.*?\)/gu, Ut = I(v({}, Se), {
|
|
|
2492
2500
|
borderLeftColor: U,
|
|
2493
2501
|
filter: Ut,
|
|
2494
2502
|
WebkitFilter: Ut
|
|
2495
|
-
}),
|
|
2496
|
-
function
|
|
2497
|
-
let t =
|
|
2503
|
+
}), lr = (n) => ho[n];
|
|
2504
|
+
function cr(n, e) {
|
|
2505
|
+
let t = lr(n);
|
|
2498
2506
|
return t !== Ut && (t = Se), t.getAnimatableNone ? t.getAnimatableNone(e) : void 0;
|
|
2499
2507
|
}
|
|
2500
|
-
const
|
|
2508
|
+
const Jn = [
|
|
2501
2509
|
"AnimationStart",
|
|
2502
2510
|
"AnimationComplete",
|
|
2503
2511
|
"Update",
|
|
@@ -2506,7 +2514,7 @@ const Wn = [
|
|
|
2506
2514
|
"LayoutAnimationStart",
|
|
2507
2515
|
"LayoutAnimationComplete"
|
|
2508
2516
|
];
|
|
2509
|
-
class
|
|
2517
|
+
class dr {
|
|
2510
2518
|
/**
|
|
2511
2519
|
* This method takes React props and returns found MotionValues. For example, HTML
|
|
2512
2520
|
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
@@ -2525,7 +2533,7 @@ class lr {
|
|
|
2525
2533
|
this.renderScheduledAt < p && (this.renderScheduledAt = p, ue.render(this.render, !1, !0));
|
|
2526
2534
|
};
|
|
2527
2535
|
const { latestValues: l, renderState: u } = s;
|
|
2528
|
-
this.latestValues = l, this.baseTarget = v({}, l), this.initialValues = t.initial ? v({}, l) : {}, this.renderState = u, this.parent = e, this.props = t, this.presenceContext = i, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = r, this.options = o, this.blockInitialAnimation = !!a, this.isControllingVariants =
|
|
2536
|
+
this.latestValues = l, this.baseTarget = v({}, l), this.initialValues = t.initial ? v({}, l) : {}, this.renderState = u, this.parent = e, this.props = t, this.presenceContext = i, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = r, this.options = o, this.blockInitialAnimation = !!a, this.isControllingVariants = ir(t), this.isVariantNode = no(t), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
2529
2537
|
const m = this.scrapeMotionValuesFromProps(t, {}, this), { willChange: d } = m, h = ae(m, ["willChange"]);
|
|
2530
2538
|
for (const p in h) {
|
|
2531
2539
|
const g = h[p];
|
|
@@ -2533,7 +2541,7 @@ class lr {
|
|
|
2533
2541
|
}
|
|
2534
2542
|
}
|
|
2535
2543
|
mount(e) {
|
|
2536
|
-
this.current = e, Je.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((t, i) => this.bindToMotionValue(i, t)),
|
|
2544
|
+
this.current = e, Je.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((t, i) => this.bindToMotionValue(i, t)), nr.current || Js(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : Yt.current, process.env.NODE_ENV !== "production" && xi(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
2537
2545
|
}
|
|
2538
2546
|
unmount() {
|
|
2539
2547
|
this.projection && this.projection.unmount(), Rt(this.notifyUpdate), Rt(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
|
|
@@ -2596,8 +2604,8 @@ class lr {
|
|
|
2596
2604
|
*/
|
|
2597
2605
|
update(e, t) {
|
|
2598
2606
|
(e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = t;
|
|
2599
|
-
for (let i = 0; i <
|
|
2600
|
-
const r =
|
|
2607
|
+
for (let i = 0; i < Jn.length; i++) {
|
|
2608
|
+
const r = Jn[i];
|
|
2601
2609
|
this.propEventSubscriptions[r] && (this.propEventSubscriptions[r](), delete this.propEventSubscriptions[r]);
|
|
2602
2610
|
const a = "on" + r, s = e[a];
|
|
2603
2611
|
s && (this.propEventSubscriptions[r] = this.on(r, s));
|
|
@@ -2668,7 +2676,7 @@ class lr {
|
|
|
2668
2676
|
readValue(e, t) {
|
|
2669
2677
|
var r;
|
|
2670
2678
|
let i = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : (r = this.getBaseTargetFromProps(this.props, e)) != null ? r : this.readValueFromInstance(this.current, e, this.options);
|
|
2671
|
-
return i != null && (typeof i == "string" && (
|
|
2679
|
+
return i != null && (typeof i == "string" && (rr(i) || ar(i)) ? i = parseFloat(i) : !so(i) && Se.test(t) && (i = cr(e, t)), this.setBaseTarget(e, J(i) ? i.get() : i)), J(i) ? i.get() : i;
|
|
2672
2680
|
}
|
|
2673
2681
|
/**
|
|
2674
2682
|
* Set the base target to later animate back to. This is currently
|
|
@@ -2686,7 +2694,7 @@ class lr {
|
|
|
2686
2694
|
const { initial: t } = this.props;
|
|
2687
2695
|
let i;
|
|
2688
2696
|
if (typeof t == "string" || typeof t == "object") {
|
|
2689
|
-
const s =
|
|
2697
|
+
const s = ki(this.props, t, (a = this.presenceContext) == null ? void 0 : a.custom);
|
|
2690
2698
|
s && (i = s[e]);
|
|
2691
2699
|
}
|
|
2692
2700
|
if (t && i !== void 0)
|
|
@@ -2695,7 +2703,7 @@ class lr {
|
|
|
2695
2703
|
return r !== void 0 && !J(r) ? r : this.initialValues[e] !== void 0 && i === void 0 ? void 0 : this.baseTarget[e];
|
|
2696
2704
|
}
|
|
2697
2705
|
on(e, t) {
|
|
2698
|
-
return this.events[e] || (this.events[e] = new
|
|
2706
|
+
return this.events[e] || (this.events[e] = new wi()), this.events[e].add(t);
|
|
2699
2707
|
}
|
|
2700
2708
|
notify(e, ...t) {
|
|
2701
2709
|
this.events[e] && this.events[e].notify(...t);
|
|
@@ -2713,7 +2721,7 @@ function mo(n) {
|
|
|
2713
2721
|
return [`--${t != null ? t : i}`, r];
|
|
2714
2722
|
}
|
|
2715
2723
|
const fo = 4;
|
|
2716
|
-
function
|
|
2724
|
+
function ur(n, e, t = 1) {
|
|
2717
2725
|
ce(t <= fo, `Max CSS variable fallback depth detected in property "${n}". This may indicate a circular fallback dependency.`);
|
|
2718
2726
|
const [i, r] = mo(n);
|
|
2719
2727
|
if (!i)
|
|
@@ -2721,12 +2729,12 @@ function cr(n, e, t = 1) {
|
|
|
2721
2729
|
const a = window.getComputedStyle(e).getPropertyValue(i);
|
|
2722
2730
|
if (a) {
|
|
2723
2731
|
const s = a.trim();
|
|
2724
|
-
return
|
|
2732
|
+
return rr(s) ? parseFloat(s) : s;
|
|
2725
2733
|
}
|
|
2726
|
-
return an(r) ?
|
|
2734
|
+
return an(r) ? ur(r, e, t + 1) : r;
|
|
2727
2735
|
}
|
|
2728
2736
|
function go(n) {
|
|
2729
|
-
return typeof n == "number" ? n === 0 : n !== null ? n === "none" || n === "0" ||
|
|
2737
|
+
return typeof n == "number" ? n === 0 : n !== null ? n === "none" || n === "0" || ar(n) : !0;
|
|
2730
2738
|
}
|
|
2731
2739
|
const bo = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
2732
2740
|
function vo(n, e, t) {
|
|
@@ -2737,7 +2745,7 @@ function vo(n, e, t) {
|
|
|
2737
2745
|
}
|
|
2738
2746
|
if (r && t)
|
|
2739
2747
|
for (const a of e)
|
|
2740
|
-
n[a] =
|
|
2748
|
+
n[a] = cr(t, r);
|
|
2741
2749
|
}
|
|
2742
2750
|
class yo extends fn {
|
|
2743
2751
|
constructor(e, t, i, r, a) {
|
|
@@ -2751,20 +2759,20 @@ class yo extends fn {
|
|
|
2751
2759
|
for (let l = 0; l < e.length; l++) {
|
|
2752
2760
|
let u = e[l];
|
|
2753
2761
|
if (typeof u == "string" && (u = u.trim(), an(u))) {
|
|
2754
|
-
const d =
|
|
2762
|
+
const d = ur(u, t.current);
|
|
2755
2763
|
d !== void 0 && (e[l] = d), l === e.length - 1 && (this.finalKeyframe = u);
|
|
2756
2764
|
}
|
|
2757
2765
|
}
|
|
2758
|
-
if (this.resolveNoneKeyframes(), !
|
|
2766
|
+
if (this.resolveNoneKeyframes(), !tr.has(i) || e.length !== 2)
|
|
2759
2767
|
return;
|
|
2760
|
-
const [r, a] = e, s =
|
|
2768
|
+
const [r, a] = e, s = Wn(r), o = Wn(a);
|
|
2761
2769
|
if (s !== o)
|
|
2762
|
-
if (
|
|
2770
|
+
if (Kn(s) && Kn(o))
|
|
2763
2771
|
for (let l = 0; l < e.length; l++) {
|
|
2764
2772
|
const u = e[l];
|
|
2765
2773
|
typeof u == "string" && (e[l] = parseFloat(u));
|
|
2766
2774
|
}
|
|
2767
|
-
else
|
|
2775
|
+
else Ee[i] && (this.needsMeasurement = !0);
|
|
2768
2776
|
}
|
|
2769
2777
|
resolveNoneKeyframes() {
|
|
2770
2778
|
const { unresolvedKeyframes: e, name: t } = this, i = [];
|
|
@@ -2776,7 +2784,7 @@ class yo extends fn {
|
|
|
2776
2784
|
const { element: e, unresolvedKeyframes: t, name: i } = this;
|
|
2777
2785
|
if (!e || !e.current)
|
|
2778
2786
|
return;
|
|
2779
|
-
i === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin =
|
|
2787
|
+
i === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = Ee[i](e.measureViewportBox(), window.getComputedStyle(e.current)), t[0] = this.measuredOrigin;
|
|
2780
2788
|
const r = t[t.length - 1];
|
|
2781
2789
|
r !== void 0 && e.getValue(i, r).jump(r, !1);
|
|
2782
2790
|
}
|
|
@@ -2788,12 +2796,12 @@ class yo extends fn {
|
|
|
2788
2796
|
const r = e.getValue(t);
|
|
2789
2797
|
r && r.jump(this.measuredOrigin, !1);
|
|
2790
2798
|
const a = i.length - 1, s = i[a];
|
|
2791
|
-
i[a] =
|
|
2799
|
+
i[a] = Ee[t](e.measureViewportBox(), window.getComputedStyle(e.current)), s !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = s), (o = this.removedTransforms) != null && o.length && this.removedTransforms.forEach(([l, u]) => {
|
|
2792
2800
|
e.getValue(l).set(u);
|
|
2793
2801
|
}), this.resolveNoneKeyframes();
|
|
2794
2802
|
}
|
|
2795
2803
|
}
|
|
2796
|
-
class
|
|
2804
|
+
class hr extends dr {
|
|
2797
2805
|
constructor() {
|
|
2798
2806
|
super(...arguments), this.KeyframeResolver = yo;
|
|
2799
2807
|
}
|
|
@@ -2814,21 +2822,21 @@ class dr extends lr {
|
|
|
2814
2822
|
}));
|
|
2815
2823
|
}
|
|
2816
2824
|
}
|
|
2817
|
-
const
|
|
2825
|
+
const pr = (n, e) => e && typeof n == "number" ? e.transform(n) : n, Co = {
|
|
2818
2826
|
x: "translateX",
|
|
2819
2827
|
y: "translateY",
|
|
2820
2828
|
z: "translateZ",
|
|
2821
2829
|
transformPerspective: "perspective"
|
|
2822
|
-
},
|
|
2823
|
-
function
|
|
2830
|
+
}, Eo = Re.length;
|
|
2831
|
+
function ko(n, e, t) {
|
|
2824
2832
|
let i = "", r = !0;
|
|
2825
|
-
for (let a = 0; a <
|
|
2833
|
+
for (let a = 0; a < Eo; a++) {
|
|
2826
2834
|
const s = Re[a], o = n[s];
|
|
2827
2835
|
if (o === void 0)
|
|
2828
2836
|
continue;
|
|
2829
2837
|
let l = !0;
|
|
2830
2838
|
if (typeof o == "number" ? l = o === (s.startsWith("scale") ? 1 : 0) : l = parseFloat(o) === 0, !l || t) {
|
|
2831
|
-
const u =
|
|
2839
|
+
const u = pr(o, vn[s]);
|
|
2832
2840
|
if (!l) {
|
|
2833
2841
|
r = !1;
|
|
2834
2842
|
const d = Co[s] || s;
|
|
@@ -2839,7 +2847,7 @@ function Eo(n, e, t) {
|
|
|
2839
2847
|
}
|
|
2840
2848
|
return i = i.trim(), t ? i = t(e, r ? "" : i) : r && (i = "none"), i;
|
|
2841
2849
|
}
|
|
2842
|
-
function
|
|
2850
|
+
function mr(n, e, t) {
|
|
2843
2851
|
const { style: i, vars: r, transformOrigin: a } = n;
|
|
2844
2852
|
let s = !1, o = !1;
|
|
2845
2853
|
for (const l in e) {
|
|
@@ -2847,20 +2855,20 @@ function hr(n, e, t) {
|
|
|
2847
2855
|
if (Oe.has(l)) {
|
|
2848
2856
|
s = !0;
|
|
2849
2857
|
continue;
|
|
2850
|
-
} else if (
|
|
2858
|
+
} else if (Li(l)) {
|
|
2851
2859
|
r[l] = u;
|
|
2852
2860
|
continue;
|
|
2853
2861
|
} else {
|
|
2854
|
-
const d =
|
|
2862
|
+
const d = pr(u, vn[l]);
|
|
2855
2863
|
l.startsWith("origin") ? (o = !0, a[l] = d) : i[l] = d;
|
|
2856
2864
|
}
|
|
2857
2865
|
}
|
|
2858
|
-
if (e.transform || (s || t ? i.transform =
|
|
2866
|
+
if (e.transform || (s || t ? i.transform = ko(e, n.transform, t) : i.transform && (i.transform = "none")), o) {
|
|
2859
2867
|
const { originX: l = "50%", originY: u = "50%", originZ: d = 0 } = a;
|
|
2860
2868
|
i.transformOrigin = `${l} ${u} ${d}`;
|
|
2861
2869
|
}
|
|
2862
2870
|
}
|
|
2863
|
-
function
|
|
2871
|
+
function fr(n, { style: e, vars: t }, i, r) {
|
|
2864
2872
|
Object.assign(n.style, e, r && r.getProjectionStyles(i));
|
|
2865
2873
|
for (const a in t)
|
|
2866
2874
|
n.style.setProperty(a, t[a]);
|
|
@@ -2869,7 +2877,7 @@ const xo = {};
|
|
|
2869
2877
|
function wo(n, { layout: e, layoutId: t }) {
|
|
2870
2878
|
return Oe.has(n) || n.startsWith("origin") || (e || t !== void 0) && (!!xo[n] || n === "opacity");
|
|
2871
2879
|
}
|
|
2872
|
-
function
|
|
2880
|
+
function gr(n, e, t) {
|
|
2873
2881
|
var a;
|
|
2874
2882
|
const { style: i } = n, r = {};
|
|
2875
2883
|
for (const s in i)
|
|
@@ -2879,16 +2887,16 @@ function mr(n, e, t) {
|
|
|
2879
2887
|
function To(n) {
|
|
2880
2888
|
return window.getComputedStyle(n);
|
|
2881
2889
|
}
|
|
2882
|
-
class Ao extends
|
|
2890
|
+
class Ao extends hr {
|
|
2883
2891
|
constructor() {
|
|
2884
|
-
super(...arguments), this.type = "html", this.renderInstance =
|
|
2892
|
+
super(...arguments), this.type = "html", this.renderInstance = fr;
|
|
2885
2893
|
}
|
|
2886
2894
|
readValueFromInstance(e, t) {
|
|
2887
2895
|
var i;
|
|
2888
2896
|
if (Oe.has(t))
|
|
2889
2897
|
return (i = this.projection) != null && i.isProjecting ? zt(t) : Cs(e, t);
|
|
2890
2898
|
{
|
|
2891
|
-
const r = To(e), a = (
|
|
2899
|
+
const r = To(e), a = (Li(t) ? r.getPropertyValue(t) : r[t]) || 0;
|
|
2892
2900
|
return typeof a == "string" ? a.trim() : a;
|
|
2893
2901
|
}
|
|
2894
2902
|
}
|
|
@@ -2896,16 +2904,16 @@ class Ao extends dr {
|
|
|
2896
2904
|
return Ws(e, t);
|
|
2897
2905
|
}
|
|
2898
2906
|
build(e, t, i) {
|
|
2899
|
-
|
|
2907
|
+
mr(e, t, i.transformTemplate);
|
|
2900
2908
|
}
|
|
2901
2909
|
scrapeMotionValuesFromProps(e, t, i) {
|
|
2902
|
-
return
|
|
2910
|
+
return gr(e, t, i);
|
|
2903
2911
|
}
|
|
2904
2912
|
}
|
|
2905
2913
|
function _o(n, e) {
|
|
2906
2914
|
return n in e;
|
|
2907
2915
|
}
|
|
2908
|
-
class Lo extends
|
|
2916
|
+
class Lo extends dr {
|
|
2909
2917
|
constructor() {
|
|
2910
2918
|
super(...arguments), this.type = "object";
|
|
2911
2919
|
}
|
|
@@ -2965,7 +2973,7 @@ function Po(n, h, l, u, d) {
|
|
|
2965
2973
|
"pathOffset"
|
|
2966
2974
|
]);
|
|
2967
2975
|
var b, y;
|
|
2968
|
-
if (
|
|
2976
|
+
if (mr(n, o, u), l) {
|
|
2969
2977
|
n.style.viewBox && (n.attrs.viewBox = n.style.viewBox);
|
|
2970
2978
|
return;
|
|
2971
2979
|
}
|
|
@@ -2973,7 +2981,7 @@ function Po(n, h, l, u, d) {
|
|
|
2973
2981
|
const { attrs: p, style: g } = n;
|
|
2974
2982
|
p.transform && (g.transform = p.transform, delete p.transform), (g.transform || p.transformOrigin) && (g.transformOrigin = (b = p.transformOrigin) != null ? b : "50% 50%", delete p.transformOrigin), g.transform && (g.transformBox = (y = d == null ? void 0 : d.transformBox) != null ? y : "fill-box", delete p.transformBox), e !== void 0 && (p.x = e), t !== void 0 && (p.y = t), i !== void 0 && (p.scale = i), r !== void 0 && Mo(p, r, a, s, !1);
|
|
2975
2983
|
}
|
|
2976
|
-
const
|
|
2984
|
+
const br = /* @__PURE__ */ new Set([
|
|
2977
2985
|
"baseFrequency",
|
|
2978
2986
|
"diffuseConstant",
|
|
2979
2987
|
"kernelMatrix",
|
|
@@ -2999,12 +3007,12 @@ const fr = /* @__PURE__ */ new Set([
|
|
|
2999
3007
|
"lengthAdjust"
|
|
3000
3008
|
]), Do = (n) => typeof n == "string" && n.toLowerCase() === "svg";
|
|
3001
3009
|
function Ro(n, e, t, i) {
|
|
3002
|
-
|
|
3010
|
+
fr(n, e, void 0, i);
|
|
3003
3011
|
for (const r in e.attrs)
|
|
3004
|
-
n.setAttribute(
|
|
3012
|
+
n.setAttribute(br.has(r) ? r : rn(r), e.attrs[r]);
|
|
3005
3013
|
}
|
|
3006
3014
|
function Oo(n, e, t) {
|
|
3007
|
-
const i =
|
|
3015
|
+
const i = gr(n, e, t);
|
|
3008
3016
|
for (const r in n)
|
|
3009
3017
|
if (J(n[r]) || J(e[r])) {
|
|
3010
3018
|
const a = Re.indexOf(r) !== -1 ? "attr" + r.charAt(0).toUpperCase() + r.substring(1) : r;
|
|
@@ -3012,7 +3020,7 @@ function Oo(n, e, t) {
|
|
|
3012
3020
|
}
|
|
3013
3021
|
return i;
|
|
3014
3022
|
}
|
|
3015
|
-
class No extends
|
|
3023
|
+
class No extends hr {
|
|
3016
3024
|
constructor() {
|
|
3017
3025
|
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = bn;
|
|
3018
3026
|
}
|
|
@@ -3021,10 +3029,10 @@ class No extends dr {
|
|
|
3021
3029
|
}
|
|
3022
3030
|
readValueFromInstance(e, t) {
|
|
3023
3031
|
if (Oe.has(t)) {
|
|
3024
|
-
const i =
|
|
3032
|
+
const i = lr(t);
|
|
3025
3033
|
return i && i.default || 0;
|
|
3026
3034
|
}
|
|
3027
|
-
return t =
|
|
3035
|
+
return t = br.has(t) ? t : rn(t), e.getAttribute(t);
|
|
3028
3036
|
}
|
|
3029
3037
|
scrapeMotionValuesFromProps(e, t, i) {
|
|
3030
3038
|
return Oo(e, t, i);
|
|
@@ -3039,11 +3047,11 @@ class No extends dr {
|
|
|
3039
3047
|
this.isSVGTag = Do(e.tagName), super.mount(e);
|
|
3040
3048
|
}
|
|
3041
3049
|
}
|
|
3042
|
-
function
|
|
3043
|
-
return
|
|
3050
|
+
function vr(n) {
|
|
3051
|
+
return Qi(n) && "ownerSVGElement" in n;
|
|
3044
3052
|
}
|
|
3045
3053
|
function So(n) {
|
|
3046
|
-
return
|
|
3054
|
+
return vr(n) && n.tagName === "svg";
|
|
3047
3055
|
}
|
|
3048
3056
|
function Fo(n) {
|
|
3049
3057
|
const e = {
|
|
@@ -3059,7 +3067,7 @@ function Fo(n) {
|
|
|
3059
3067
|
},
|
|
3060
3068
|
latestValues: {}
|
|
3061
3069
|
}
|
|
3062
|
-
}, t =
|
|
3070
|
+
}, t = vr(n) && !So(n) ? new No(e) : new Ao(e);
|
|
3063
3071
|
t.mount(n), Je.set(n, t);
|
|
3064
3072
|
}
|
|
3065
3073
|
function jo(n) {
|
|
@@ -3077,17 +3085,17 @@ function jo(n) {
|
|
|
3077
3085
|
}
|
|
3078
3086
|
function Bo(n, e, t) {
|
|
3079
3087
|
const i = J(n) ? n : Xe(n);
|
|
3080
|
-
return i.start(
|
|
3088
|
+
return i.start(er("", i, e, t)), i.animation;
|
|
3081
3089
|
}
|
|
3082
3090
|
function zo(n, e) {
|
|
3083
3091
|
return J(n) || typeof n == "number" || typeof n == "string" && !Qt(e);
|
|
3084
3092
|
}
|
|
3085
|
-
function
|
|
3093
|
+
function yr(n, e, t, i) {
|
|
3086
3094
|
const r = [];
|
|
3087
3095
|
if (zo(n, e))
|
|
3088
3096
|
r.push(Bo(n, Qt(e) && e.default || e, t && (t.default || t)));
|
|
3089
3097
|
else {
|
|
3090
|
-
const a =
|
|
3098
|
+
const a = fi(n, e, i), s = a.length;
|
|
3091
3099
|
ce(!!s, "No valid elements provided.");
|
|
3092
3100
|
for (let o = 0; o < s; o++) {
|
|
3093
3101
|
const l = a[o], u = l instanceof Element ? Fo : jo;
|
|
@@ -3101,7 +3109,7 @@ function br(n, e, t, i) {
|
|
|
3101
3109
|
function $o(n, e, t) {
|
|
3102
3110
|
const i = [];
|
|
3103
3111
|
return Zr(n, e, t, { spring: tt }).forEach(({ keyframes: a, transition: s }, o) => {
|
|
3104
|
-
i.push(...
|
|
3112
|
+
i.push(...yr(o, a, s));
|
|
3105
3113
|
}), i;
|
|
3106
3114
|
}
|
|
3107
3115
|
class Ko {
|
|
@@ -3181,7 +3189,7 @@ function Go(n) {
|
|
|
3181
3189
|
function Ho(n) {
|
|
3182
3190
|
function e(t, i, r) {
|
|
3183
3191
|
let a = [];
|
|
3184
|
-
return Go(t) ? a = $o(t, i, n) : a =
|
|
3192
|
+
return Go(t) ? a = $o(t, i, n) : a = yr(t, i, r, n), new qo(a);
|
|
3185
3193
|
}
|
|
3186
3194
|
return e;
|
|
3187
3195
|
}
|
|
@@ -3202,7 +3210,7 @@ function F(n, e) {
|
|
|
3202
3210
|
const t = e.trim().split(/\s+/).filter((i) => i.length > 0);
|
|
3203
3211
|
n.classList.add(...t);
|
|
3204
3212
|
}
|
|
3205
|
-
class
|
|
3213
|
+
class Cr {
|
|
3206
3214
|
constructor() {
|
|
3207
3215
|
c(this, "template", `
|
|
3208
3216
|
<svg class="${S.spinner}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 215 215" fill="none">
|
|
@@ -3224,16 +3232,16 @@ class vr {
|
|
|
3224
3232
|
return this.spinner;
|
|
3225
3233
|
}
|
|
3226
3234
|
}
|
|
3227
|
-
const il = "_loader_nwq3e_1",
|
|
3235
|
+
const il = "_loader_nwq3e_1", Xn = {
|
|
3228
3236
|
loader: il
|
|
3229
3237
|
};
|
|
3230
3238
|
class rl {
|
|
3231
3239
|
constructor() {
|
|
3232
3240
|
c(this, "loader");
|
|
3233
|
-
this.loader = document.createElement("div"), this.loader.classList.add(
|
|
3241
|
+
this.loader = document.createElement("div"), this.loader.classList.add(Xn.loader), this.loader.appendChild(new Cr().render());
|
|
3234
3242
|
}
|
|
3235
3243
|
setClassName(e) {
|
|
3236
|
-
e ? F(this.loader, e) : this.loader.className =
|
|
3244
|
+
e ? F(this.loader, e) : this.loader.className = Xn.loader;
|
|
3237
3245
|
}
|
|
3238
3246
|
render() {
|
|
3239
3247
|
return this.loader;
|
|
@@ -3252,10 +3260,10 @@ const al = "_checkout_mcuv2_1", sl = "_hidden_mcuv2_8", ol = "_formInitial_mcuv2
|
|
|
3252
3260
|
applePay: hl,
|
|
3253
3261
|
hidden: pl
|
|
3254
3262
|
};
|
|
3255
|
-
var Vt,
|
|
3263
|
+
var Vt, Qn;
|
|
3256
3264
|
function ml() {
|
|
3257
|
-
if (
|
|
3258
|
-
|
|
3265
|
+
if (Qn) return Vt;
|
|
3266
|
+
Qn = 1;
|
|
3259
3267
|
var n = {
|
|
3260
3268
|
visa: {
|
|
3261
3269
|
niceType: "Visa",
|
|
@@ -3450,19 +3458,19 @@ function ml() {
|
|
|
3450
3458
|
};
|
|
3451
3459
|
return Vt = n, Vt;
|
|
3452
3460
|
}
|
|
3453
|
-
var Be = {}, ze = {},
|
|
3454
|
-
function
|
|
3455
|
-
if (
|
|
3456
|
-
|
|
3461
|
+
var Be = {}, ze = {}, ei;
|
|
3462
|
+
function Er() {
|
|
3463
|
+
if (ei) return ze;
|
|
3464
|
+
ei = 1, Object.defineProperty(ze, "__esModule", { value: !0 }), ze.clone = void 0;
|
|
3457
3465
|
function n(e) {
|
|
3458
3466
|
return e ? JSON.parse(JSON.stringify(e)) : null;
|
|
3459
3467
|
}
|
|
3460
3468
|
return ze.clone = n, ze;
|
|
3461
3469
|
}
|
|
3462
|
-
var $e = {},
|
|
3470
|
+
var $e = {}, ti;
|
|
3463
3471
|
function fl() {
|
|
3464
|
-
if (
|
|
3465
|
-
|
|
3472
|
+
if (ti) return $e;
|
|
3473
|
+
ti = 1, Object.defineProperty($e, "__esModule", { value: !0 }), $e.matches = void 0;
|
|
3466
3474
|
function n(i, r, a) {
|
|
3467
3475
|
var s = String(r).length, o = i.substr(0, s), l = parseInt(o, 10);
|
|
3468
3476
|
return r = parseInt(String(r).substr(0, o.length), 10), a = parseInt(String(a).substr(0, o.length), 10), l >= r && l <= a;
|
|
@@ -3475,11 +3483,11 @@ function fl() {
|
|
|
3475
3483
|
}
|
|
3476
3484
|
return $e.matches = t, $e;
|
|
3477
3485
|
}
|
|
3478
|
-
var
|
|
3486
|
+
var ni;
|
|
3479
3487
|
function gl() {
|
|
3480
|
-
if (
|
|
3481
|
-
|
|
3482
|
-
var n =
|
|
3488
|
+
if (ni) return Be;
|
|
3489
|
+
ni = 1, Object.defineProperty(Be, "__esModule", { value: !0 }), Be.addMatchingCardsToResults = void 0;
|
|
3490
|
+
var n = Er(), e = fl();
|
|
3483
3491
|
function t(i, r, a) {
|
|
3484
3492
|
var s, o;
|
|
3485
3493
|
for (s = 0; s < r.patterns.length; s++) {
|
|
@@ -3493,19 +3501,19 @@ function gl() {
|
|
|
3493
3501
|
}
|
|
3494
3502
|
return Be.addMatchingCardsToResults = t, Be;
|
|
3495
3503
|
}
|
|
3496
|
-
var Ke = {},
|
|
3504
|
+
var Ke = {}, ii;
|
|
3497
3505
|
function bl() {
|
|
3498
|
-
if (
|
|
3499
|
-
|
|
3506
|
+
if (ii) return Ke;
|
|
3507
|
+
ii = 1, Object.defineProperty(Ke, "__esModule", { value: !0 }), Ke.isValidInputType = void 0;
|
|
3500
3508
|
function n(e) {
|
|
3501
3509
|
return typeof e == "string" || e instanceof String;
|
|
3502
3510
|
}
|
|
3503
3511
|
return Ke.isValidInputType = n, Ke;
|
|
3504
3512
|
}
|
|
3505
|
-
var qe = {},
|
|
3513
|
+
var qe = {}, ri;
|
|
3506
3514
|
function vl() {
|
|
3507
|
-
if (
|
|
3508
|
-
|
|
3515
|
+
if (ri) return qe;
|
|
3516
|
+
ri = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.findBestMatch = void 0;
|
|
3509
3517
|
function n(t) {
|
|
3510
3518
|
var i = t.filter(function(r) {
|
|
3511
3519
|
return r.matchStrength;
|
|
@@ -3519,19 +3527,19 @@ function vl() {
|
|
|
3519
3527
|
}
|
|
3520
3528
|
return qe.findBestMatch = e, qe;
|
|
3521
3529
|
}
|
|
3522
|
-
var Ge,
|
|
3530
|
+
var Ge, ai;
|
|
3523
3531
|
function yl() {
|
|
3524
|
-
if (
|
|
3525
|
-
|
|
3532
|
+
if (ai) return Ge;
|
|
3533
|
+
ai = 1;
|
|
3526
3534
|
var n = Ge && Ge.__assign || function() {
|
|
3527
3535
|
return n = Object.assign || function(g) {
|
|
3528
|
-
for (var b, y = 1,
|
|
3536
|
+
for (var b, y = 1, k = arguments.length; y < k; y++) {
|
|
3529
3537
|
b = arguments[y];
|
|
3530
3538
|
for (var V in b) Object.prototype.hasOwnProperty.call(b, V) && (g[V] = b[V]);
|
|
3531
3539
|
}
|
|
3532
3540
|
return g;
|
|
3533
3541
|
}, n.apply(this, arguments);
|
|
3534
|
-
}, e = ml(), t = gl(), i = bl(), r = vl(), a =
|
|
3542
|
+
}, e = ml(), t = gl(), i = bl(), r = vl(), a = Er(), s = {}, o = {
|
|
3535
3543
|
VISA: "visa",
|
|
3536
3544
|
MASTERCARD: "mastercard",
|
|
3537
3545
|
AMERICAN_EXPRESS: "american-express",
|
|
@@ -3579,8 +3587,8 @@ function yl() {
|
|
|
3579
3587
|
return b;
|
|
3580
3588
|
if (g.length === 0)
|
|
3581
3589
|
return h();
|
|
3582
|
-
u.forEach(function(
|
|
3583
|
-
var V = d(
|
|
3590
|
+
u.forEach(function(k) {
|
|
3591
|
+
var V = d(k);
|
|
3584
3592
|
(0, t.addMatchingCardsToResults)(g, V, b);
|
|
3585
3593
|
});
|
|
3586
3594
|
var y = (0, r.findBestMatch)(b);
|
|
@@ -3600,8 +3608,8 @@ function yl() {
|
|
|
3600
3608
|
throw new Error('"'.concat(g, "\" is not a recognized type. Use `addCard` instead.'"));
|
|
3601
3609
|
if (b.type && y.type !== b.type)
|
|
3602
3610
|
throw new Error("Cannot overwrite type parameter.");
|
|
3603
|
-
var
|
|
3604
|
-
|
|
3611
|
+
var k = (0, a.clone)(y);
|
|
3612
|
+
k = n(n({}, k), b), s[k.type] = k;
|
|
3605
3613
|
}, p.changeOrder = function(g, b) {
|
|
3606
3614
|
var y = m(g);
|
|
3607
3615
|
u.splice(y, 1), u.splice(b, 0, g);
|
|
@@ -3623,10 +3631,10 @@ const Cl = (n, e) => {
|
|
|
3623
3631
|
o.push(i.slice(u, d));
|
|
3624
3632
|
}
|
|
3625
3633
|
return o.join(" ").slice(0, a);
|
|
3626
|
-
},
|
|
3634
|
+
}, El = (n, e) => {
|
|
3627
3635
|
const t = Pe.getTypeInfo(e), i = (t == null ? void 0 : t.code.size) || 4;
|
|
3628
3636
|
return n.replace(/\D/g, "").slice(0, i);
|
|
3629
|
-
},
|
|
3637
|
+
}, kl = (n) => {
|
|
3630
3638
|
const e = n.replace(/\D/g, "");
|
|
3631
3639
|
let t = e.slice(0, 2);
|
|
3632
3640
|
if (!t) return "";
|
|
@@ -3713,14 +3721,14 @@ const bt = [
|
|
|
3713
3721
|
}, Ll = (n) => {
|
|
3714
3722
|
var e, t;
|
|
3715
3723
|
return (t = (e = Fe.find((i) => i.name === "Maestro")) == null ? void 0 : e.pattern.test(n)) != null ? t : !1;
|
|
3716
|
-
},
|
|
3724
|
+
}, kr = (n) => bt.find((e) => e.pattern.test(n)) || null, si = (n) => bt.filter((e) => e.pattern.test(n)), Vl = (n) => {
|
|
3717
3725
|
let e = 0, t = !1;
|
|
3718
3726
|
for (let i = n.length - 1; i >= 0; i--) {
|
|
3719
3727
|
let r = parseInt(n[i]);
|
|
3720
3728
|
t && (r *= 2, r > 9 && (r -= 9)), e += r, t = !t;
|
|
3721
3729
|
}
|
|
3722
3730
|
return e % 10 === 0;
|
|
3723
|
-
},
|
|
3731
|
+
}, oi = (n, e) => {
|
|
3724
3732
|
const t = n.replace(/\D/g, "");
|
|
3725
3733
|
if (!t)
|
|
3726
3734
|
return { isValid: !1, cardType: null, error: Y.Empty };
|
|
@@ -3728,7 +3736,7 @@ const bt = [
|
|
|
3728
3736
|
return { isValid: !1, cardType: null, error: Y.Invalid };
|
|
3729
3737
|
if (xl(t) || wl(t) || Tl(t) || Al(t) || _l(t) || Ll(t))
|
|
3730
3738
|
return { isValid: !1, cardType: null, error: Y.Unsupported };
|
|
3731
|
-
const i =
|
|
3739
|
+
const i = kr(t);
|
|
3732
3740
|
if (i) {
|
|
3733
3741
|
if (t.length < i.minLength || t.length > i.maxLength)
|
|
3734
3742
|
return {
|
|
@@ -3895,10 +3903,10 @@ var dt = { exports: {} }, He = {};
|
|
|
3895
3903
|
* This source code is licensed under the MIT license found in the
|
|
3896
3904
|
* LICENSE file in the root directory of this source tree.
|
|
3897
3905
|
*/
|
|
3898
|
-
var
|
|
3906
|
+
var li;
|
|
3899
3907
|
function Nl() {
|
|
3900
|
-
if (
|
|
3901
|
-
|
|
3908
|
+
if (li) return He;
|
|
3909
|
+
li = 1;
|
|
3902
3910
|
var n = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
3903
3911
|
function t(i, r, a) {
|
|
3904
3912
|
var s = null;
|
|
@@ -3927,9 +3935,9 @@ var Ye = {};
|
|
|
3927
3935
|
* This source code is licensed under the MIT license found in the
|
|
3928
3936
|
* LICENSE file in the root directory of this source tree.
|
|
3929
3937
|
*/
|
|
3930
|
-
var
|
|
3938
|
+
var ci;
|
|
3931
3939
|
function Sl() {
|
|
3932
|
-
return
|
|
3940
|
+
return ci || (ci = 1, process.env.NODE_ENV !== "production" && function() {
|
|
3933
3941
|
function n(f) {
|
|
3934
3942
|
if (f == null) return null;
|
|
3935
3943
|
if (typeof f == "function")
|
|
@@ -3938,7 +3946,7 @@ function Sl() {
|
|
|
3938
3946
|
switch (f) {
|
|
3939
3947
|
case b:
|
|
3940
3948
|
return "Fragment";
|
|
3941
|
-
case
|
|
3949
|
+
case k:
|
|
3942
3950
|
return "Profiler";
|
|
3943
3951
|
case y:
|
|
3944
3952
|
return "StrictMode";
|
|
@@ -4032,7 +4040,7 @@ function Sl() {
|
|
|
4032
4040
|
}
|
|
4033
4041
|
function l() {
|
|
4034
4042
|
var f = n(this.type);
|
|
4035
|
-
return
|
|
4043
|
+
return Et[f] || (Et[f] = !0, console.error(
|
|
4036
4044
|
"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."
|
|
4037
4045
|
)), f = this.props.ref, f !== void 0 ? f : null;
|
|
4038
4046
|
}
|
|
@@ -4121,7 +4129,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4121
4129
|
function h(f) {
|
|
4122
4130
|
typeof f == "object" && f !== null && f.$$typeof === p && f._store && (f._store.validated = 1);
|
|
4123
4131
|
}
|
|
4124
|
-
var m =
|
|
4132
|
+
var m = Ar, p = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), V = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), R = Symbol.for("react.activity"), O = Symbol.for("react.client.reference"), q = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Te = Object.prototype.hasOwnProperty, te = Array.isArray, fe = console.createTask ? console.createTask : function() {
|
|
4125
4133
|
return null;
|
|
4126
4134
|
};
|
|
4127
4135
|
m = {
|
|
@@ -4129,7 +4137,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4129
4137
|
return f();
|
|
4130
4138
|
}
|
|
4131
4139
|
};
|
|
4132
|
-
var he,
|
|
4140
|
+
var he, Et = {}, kt = m.react_stack_bottom_frame.bind(
|
|
4133
4141
|
m,
|
|
4134
4142
|
a
|
|
4135
4143
|
)(), st = fe(i(a)), ne = {};
|
|
@@ -4142,7 +4150,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4142
4150
|
!1,
|
|
4143
4151
|
G,
|
|
4144
4152
|
ie,
|
|
4145
|
-
X ? Error("react-stack-top-frame") :
|
|
4153
|
+
X ? Error("react-stack-top-frame") : kt,
|
|
4146
4154
|
X ? fe(i(f)) : st
|
|
4147
4155
|
);
|
|
4148
4156
|
}, Ye.jsxs = function(f, P, N, G, ie) {
|
|
@@ -4154,15 +4162,15 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4154
4162
|
!0,
|
|
4155
4163
|
G,
|
|
4156
4164
|
ie,
|
|
4157
|
-
X ? Error("react-stack-top-frame") :
|
|
4165
|
+
X ? Error("react-stack-top-frame") : kt,
|
|
4158
4166
|
X ? fe(i(f)) : st
|
|
4159
4167
|
);
|
|
4160
4168
|
};
|
|
4161
4169
|
}()), Ye;
|
|
4162
4170
|
}
|
|
4163
|
-
var
|
|
4171
|
+
var di;
|
|
4164
4172
|
function Fl() {
|
|
4165
|
-
return
|
|
4173
|
+
return di || (di = 1, process.env.NODE_ENV === "production" ? dt.exports = Nl() : dt.exports = Sl()), dt.exports;
|
|
4166
4174
|
}
|
|
4167
4175
|
Fl();
|
|
4168
4176
|
const jl = [
|
|
@@ -4190,7 +4198,7 @@ class Bl {
|
|
|
4190
4198
|
this.onPaymentAttempt = this.config.state.checkout.getState().onCheckoutAttempt, this.ev = this.config.service.ev, this.customButtonStyles = t, this.element = document.createElement("div"), this.element.classList.add(Lt.applePay, Lt.hidden);
|
|
4191
4199
|
}
|
|
4192
4200
|
init(e) {
|
|
4193
|
-
return
|
|
4201
|
+
return E(this, null, function* () {
|
|
4194
4202
|
if (!this.config) return !1;
|
|
4195
4203
|
const t = this.config.state.transaction.getState(), i = this.config.state.translate.locale(), r = Ml(t);
|
|
4196
4204
|
if (!r)
|
|
@@ -4267,7 +4275,7 @@ class ql {
|
|
|
4267
4275
|
this.config = e, this.ev = this.config.service.ev, this.customButtonStyles = this.config.state.styles.getState().GooglePayButton, this.onPaymentAttempt = this.config.state.checkout.getState().onCheckoutAttempt, this.element = document.createElement("div"), this.element.classList.add(It.googlePay, It.hidden);
|
|
4268
4276
|
}
|
|
4269
4277
|
init(e) {
|
|
4270
|
-
return
|
|
4278
|
+
return E(this, null, function* () {
|
|
4271
4279
|
if (!this.config) return !1;
|
|
4272
4280
|
const t = this.config.state.transaction.getState(), i = this.config.state.translate.locale(), r = Il(t);
|
|
4273
4281
|
if (!r)
|
|
@@ -4323,13 +4331,13 @@ class Yl {
|
|
|
4323
4331
|
}
|
|
4324
4332
|
// init
|
|
4325
4333
|
init(e) {
|
|
4326
|
-
return
|
|
4334
|
+
return E(this, null, function* () {
|
|
4327
4335
|
var s, o;
|
|
4328
4336
|
if (!this.config)
|
|
4329
4337
|
return !1;
|
|
4330
|
-
const t = this.config.state.transaction.getState(), i = this.config.state.checkout.getState(), r = () =>
|
|
4338
|
+
const t = this.config.state.transaction.getState(), i = this.config.state.checkout.getState(), r = () => E(this, null, function* () {
|
|
4331
4339
|
try {
|
|
4332
|
-
return yield
|
|
4340
|
+
return yield Nr(i.clientToken, i.environment, i.apiVersion);
|
|
4333
4341
|
} catch (l) {
|
|
4334
4342
|
throw l;
|
|
4335
4343
|
}
|
|
@@ -4374,7 +4382,7 @@ class Yl {
|
|
|
4374
4382
|
onClick: () => {
|
|
4375
4383
|
this.emitAttemptOnce();
|
|
4376
4384
|
},
|
|
4377
|
-
onApprove: (u) =>
|
|
4385
|
+
onApprove: (u) => E(this, [u], function* ({ billingToken: l }) {
|
|
4378
4386
|
var d;
|
|
4379
4387
|
(d = a == null ? void 0 : a.onSuccess) == null || d.call(a, l || "");
|
|
4380
4388
|
}),
|
|
@@ -4464,7 +4472,7 @@ class Ul {
|
|
|
4464
4472
|
return this.element;
|
|
4465
4473
|
}
|
|
4466
4474
|
}
|
|
4467
|
-
const Wl = "_button_1trim_1",
|
|
4475
|
+
const Wl = "_button_1trim_1", ui = {
|
|
4468
4476
|
button: Wl
|
|
4469
4477
|
};
|
|
4470
4478
|
class Zl {
|
|
@@ -4473,7 +4481,7 @@ class Zl {
|
|
|
4473
4481
|
c(this, "icon", new Ul());
|
|
4474
4482
|
this.config = e;
|
|
4475
4483
|
const t = this.config.state.styles.getState().WalletButton, i = this.config.state.translate;
|
|
4476
|
-
this.element = document.createElement("button"), this.element.classList.add(
|
|
4484
|
+
this.element = document.createElement("button"), this.element.classList.add(ui.button, ui.press), t != null && t.className && F(this.element, t.className), t != null && t.styles && Object.assign(this.element.style, t.styles);
|
|
4477
4485
|
const r = document.createElement("span");
|
|
4478
4486
|
r.textContent = i.getState().messages.card.compact.button, this.element.append(this.icon.render(), r), i.subscribe(({ messages: a }) => {
|
|
4479
4487
|
r.textContent = a.card.compact.button;
|
|
@@ -4515,7 +4523,7 @@ class ic {
|
|
|
4515
4523
|
}
|
|
4516
4524
|
// init
|
|
4517
4525
|
init(e) {
|
|
4518
|
-
return
|
|
4526
|
+
return E(this, null, function* () {
|
|
4519
4527
|
var i;
|
|
4520
4528
|
if (!this.config) return !1;
|
|
4521
4529
|
const t = this.config.state.transaction.getState();
|
|
@@ -4535,7 +4543,7 @@ class ic {
|
|
|
4535
4543
|
}
|
|
4536
4544
|
// display venmo button
|
|
4537
4545
|
displayVenmoButton(e) {
|
|
4538
|
-
Object.assign(this.venmoButton.style, tc), this.venmoButton.addEventListener("click", () =>
|
|
4546
|
+
Object.assign(this.venmoButton.style, tc), this.venmoButton.addEventListener("click", () => E(this, null, function* () {
|
|
4539
4547
|
if (this.events.onPaymentAttempt.emit(x.VENMO), !this.isProcessing) {
|
|
4540
4548
|
this.isProcessing = !0, this.venmoButton.disabled = !0;
|
|
4541
4549
|
try {
|
|
@@ -4551,7 +4559,7 @@ class ic {
|
|
|
4551
4559
|
}
|
|
4552
4560
|
// handle existing tokenization results
|
|
4553
4561
|
handleExistingTokenization(e) {
|
|
4554
|
-
return
|
|
4562
|
+
return E(this, null, function* () {
|
|
4555
4563
|
try {
|
|
4556
4564
|
const t = yield this.braintree.tokenize();
|
|
4557
4565
|
this.handleVenmoSuccess(t, e);
|
|
@@ -4601,7 +4609,7 @@ class rc {
|
|
|
4601
4609
|
}
|
|
4602
4610
|
// init
|
|
4603
4611
|
init() {
|
|
4604
|
-
return
|
|
4612
|
+
return E(this, null, function* () {
|
|
4605
4613
|
this.config.state.transaction.subscribe(() => {
|
|
4606
4614
|
this.config.service.ev.isReady && this.initPaymentMethods().catch(console.error);
|
|
4607
4615
|
}), this.config.state.checkout.subscribe(() => {
|
|
@@ -4613,7 +4621,7 @@ class rc {
|
|
|
4613
4621
|
}
|
|
4614
4622
|
// init apple
|
|
4615
4623
|
initApple(e) {
|
|
4616
|
-
return
|
|
4624
|
+
return E(this, null, function* () {
|
|
4617
4625
|
if (!this.applePay) {
|
|
4618
4626
|
e == null || e.remove();
|
|
4619
4627
|
return;
|
|
@@ -4652,7 +4660,7 @@ class rc {
|
|
|
4652
4660
|
}
|
|
4653
4661
|
// init google
|
|
4654
4662
|
initGoogle(e) {
|
|
4655
|
-
return
|
|
4663
|
+
return E(this, null, function* () {
|
|
4656
4664
|
if (!this.googlePay) {
|
|
4657
4665
|
e == null || e.remove();
|
|
4658
4666
|
return;
|
|
@@ -4691,7 +4699,7 @@ class rc {
|
|
|
4691
4699
|
}
|
|
4692
4700
|
// init paypal
|
|
4693
4701
|
initPayPal(e) {
|
|
4694
|
-
return
|
|
4702
|
+
return E(this, null, function* () {
|
|
4695
4703
|
if (!this.paypal) {
|
|
4696
4704
|
e == null || e.remove();
|
|
4697
4705
|
return;
|
|
@@ -4717,7 +4725,7 @@ class rc {
|
|
|
4717
4725
|
}
|
|
4718
4726
|
// init braintree
|
|
4719
4727
|
initBraintreeVenmo(e) {
|
|
4720
|
-
return
|
|
4728
|
+
return E(this, null, function* () {
|
|
4721
4729
|
if (!this.braintree) {
|
|
4722
4730
|
e == null || e.remove();
|
|
4723
4731
|
return;
|
|
@@ -4744,7 +4752,7 @@ class rc {
|
|
|
4744
4752
|
}
|
|
4745
4753
|
// init card
|
|
4746
4754
|
initCard(e) {
|
|
4747
|
-
return
|
|
4755
|
+
return E(this, null, function* () {
|
|
4748
4756
|
if (!this.card) {
|
|
4749
4757
|
e == null || e.remove();
|
|
4750
4758
|
return;
|
|
@@ -4754,7 +4762,7 @@ class rc {
|
|
|
4754
4762
|
}
|
|
4755
4763
|
// init payment methods
|
|
4756
4764
|
initPaymentMethods() {
|
|
4757
|
-
return
|
|
4765
|
+
return E(this, null, function* () {
|
|
4758
4766
|
const e = this.config.state.transaction.getState(), t = Jl(zl, (e == null ? void 0 : e.checkout_config) || [], (s, o) => s.type === o.type), i = this.config.state.checkout.getState();
|
|
4759
4767
|
let r = t.filter(({ is_active: s }) => s);
|
|
4760
4768
|
(i == null ? void 0 : i.variant) === "default" && (r = r.filter(({ type: s }) => s !== x.CARD));
|
|
@@ -4862,7 +4870,7 @@ const cc = "_button_1d7ly_1", dc = "_disabled_1d7ly_18", uc = "_hidden_1d7ly_28"
|
|
|
4862
4870
|
class pc {
|
|
4863
4871
|
constructor(e, t) {
|
|
4864
4872
|
c(this, "element");
|
|
4865
|
-
c(this, "spinner", new
|
|
4873
|
+
c(this, "spinner", new Cr());
|
|
4866
4874
|
c(this, "message", document.createElement("span"));
|
|
4867
4875
|
c(this, "iconElement");
|
|
4868
4876
|
this.element = document.createElement("button"), this.element.setAttribute("type", "button"), this.element.classList.add(oe.button, oe.press), t != null && t.className && F(this.element, t.className), t != null && t.styles && Object.assign(this.element.style, t.styles), t != null && t.iconSvg && (this.iconElement = document.createElement("div"), this.iconElement.classList.add(S.card), this.iconElement.innerHTML = t.iconSvg), this.spinner.addClass(oe.spinner), this.spinner.addClass(oe.hidden), this.message.textContent = e.messages().card.pay.button, this.element.append(this.spinner.render()), this.iconElement && this.element.append(this.iconElement), this.element.append(this.message), e.subscribe((i) => {
|
|
@@ -4883,13 +4891,13 @@ const mc = "_cardForm_1uc4x_1", fc = "_hidden_1uc4x_6", gc = "_topOffset_1uc4x_1
|
|
|
4883
4891
|
cardForm: mc,
|
|
4884
4892
|
hidden: fc,
|
|
4885
4893
|
topOffset: gc
|
|
4886
|
-
}, bc = "_wrapper_1xw0g_1", vc = "_inputContainer_1xw0g_5", yc = "_disabled_1xw0g_23", Cc = "_input_1xw0g_5",
|
|
4894
|
+
}, bc = "_wrapper_1xw0g_1", vc = "_inputContainer_1xw0g_5", yc = "_disabled_1xw0g_23", Cc = "_input_1xw0g_5", Ec = "_errorInput_1xw0g_18", kc = "_label_1xw0g_56", xc = "_labelError_1xw0g_67", wc = "_disabledInput_1xw0g_75", Tc = "_hidden_1xw0g_82", $ = {
|
|
4887
4895
|
wrapper: bc,
|
|
4888
4896
|
inputContainer: vc,
|
|
4889
4897
|
disabled: yc,
|
|
4890
4898
|
input: Cc,
|
|
4891
|
-
errorInput:
|
|
4892
|
-
label:
|
|
4899
|
+
errorInput: Ec,
|
|
4900
|
+
label: kc,
|
|
4893
4901
|
labelError: xc,
|
|
4894
4902
|
disabledInput: wc,
|
|
4895
4903
|
hidden: Tc
|
|
@@ -4959,7 +4967,7 @@ class Ac {
|
|
|
4959
4967
|
}), this.render();
|
|
4960
4968
|
}
|
|
4961
4969
|
toggleLabelError(e) {
|
|
4962
|
-
return
|
|
4970
|
+
return E(this, null, function* () {
|
|
4963
4971
|
if (e) {
|
|
4964
4972
|
this.inputContainer.classList.add($.errorInput), this.endContent.classList.remove($.hidden), this.labelError.classList.remove($.hidden), yield H(this.labelError, W.open, W.transition);
|
|
4965
4973
|
return;
|
|
@@ -5143,7 +5151,7 @@ class zc {
|
|
|
5143
5151
|
this.translate = e;
|
|
5144
5152
|
const i = e.messages();
|
|
5145
5153
|
if (this.element = document.createElement("div"), this.element.classList.add(j.wrapper), this.inputContainer.classList.add(j.inputContainer), (r = t == null ? void 0 : t.container) != null && r.className && F(this.inputContainer, t.container.className), (a = t == null ? void 0 : t.container) != null && a.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(j.input), (s = t == null ? void 0 : t.field) != null && s.className && F(this.input, 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) {
|
|
5146
|
-
const p = (y) => y.replace(/[A-Z]/g, (
|
|
5154
|
+
const p = (y) => y.replace(/[A-Z]/g, (k) => "-" + k.toLowerCase()), g = Object.entries(t.placeholder.styles).map(([y, k]) => `${p(y)}:${k} !important;`).join(""), b = `#${this.id}`;
|
|
5147
5155
|
this.placeholderStyle.textContent = `${b}::placeholder{${g}}
|
|
5148
5156
|
${b}::-webkit-input-placeholder{${g}}
|
|
5149
5157
|
${b}::-moz-placeholder{${g}}
|
|
@@ -5169,16 +5177,16 @@ ${b}::-ms-input-placeholder{${g}}
|
|
|
5169
5177
|
handleChange(e) {
|
|
5170
5178
|
if (this.isDisabled) return;
|
|
5171
5179
|
this.isRequired = !1, this.errorMessage = "", this.isChanged || (this.isChanged = !0);
|
|
5172
|
-
const t =
|
|
5180
|
+
const t = si(e).map((a) => a.type), i = kr(e), r = Cl(e, (i == null ? void 0 : i.type) || "");
|
|
5173
5181
|
this.supportedCardTypes = t.length ? t : this.initialCardTypes, r.replace(/\D/g, "").length === ((i == null ? void 0 : i.maxLength) || 16) && this.validate(r), this.input.value = r, this.events.change.emit({
|
|
5174
5182
|
card: r,
|
|
5175
5183
|
cardType: i == null ? void 0 : i.type,
|
|
5176
5184
|
cardTypes: t,
|
|
5177
|
-
isValid:
|
|
5185
|
+
isValid: oi(e, this.supportedCardTypes).isValid
|
|
5178
5186
|
}), this.render();
|
|
5179
5187
|
}
|
|
5180
5188
|
toggleLabelError(e) {
|
|
5181
|
-
return
|
|
5189
|
+
return E(this, null, function* () {
|
|
5182
5190
|
if (e) {
|
|
5183
5191
|
this.inputContainer.classList.add(j.errorInput), this.labelError.classList.remove(j.hidden), yield H(this.labelError, W.open, W.transition);
|
|
5184
5192
|
return;
|
|
@@ -5187,7 +5195,7 @@ ${b}::-ms-input-placeholder{${g}}
|
|
|
5187
5195
|
});
|
|
5188
5196
|
}
|
|
5189
5197
|
toggleErrorMessage(e) {
|
|
5190
|
-
return
|
|
5198
|
+
return E(this, null, function* () {
|
|
5191
5199
|
if (e) {
|
|
5192
5200
|
this.inputContainer.classList.add(j.errorInput), this.error.textContent = this.errorMessage, this.error.classList.remove(j.hidden), yield H(this.error, Q.open, Q.transition);
|
|
5193
5201
|
return;
|
|
@@ -5219,11 +5227,11 @@ ${b}::-ms-input-placeholder{${g}}
|
|
|
5219
5227
|
var e;
|
|
5220
5228
|
return {
|
|
5221
5229
|
value: this.input.value,
|
|
5222
|
-
cardType: ((e =
|
|
5230
|
+
cardType: ((e = si(this.input.value)[0]) == null ? void 0 : e.type) || ""
|
|
5223
5231
|
};
|
|
5224
5232
|
}
|
|
5225
5233
|
validate(e) {
|
|
5226
|
-
const t = this.translate.messages(), { isValid: i, error: r } =
|
|
5234
|
+
const t = this.translate.messages(), { isValid: i, error: r } = oi(e, this.supportedCardTypes);
|
|
5227
5235
|
return i ? (this.isRequired = !1, this.errorMessage = "", this.render(), i) : (r === Y.Empty ? (this.errorMessage = "", this.isRequired = !0) : r === Y.Unsupported ? (this.errorMessage = t.card.number.error.unsupported, this.isRequired = !1) : (this.errorMessage = r === Y.Incomplete ? t.card.number.error.incomplete : t.card.number.error.invalid, this.isRequired = !1), this.render(), i);
|
|
5228
5236
|
}
|
|
5229
5237
|
render() {
|
|
@@ -5309,12 +5317,12 @@ class ed {
|
|
|
5309
5317
|
expiryChange: new K(),
|
|
5310
5318
|
cvcChange: new K()
|
|
5311
5319
|
});
|
|
5312
|
-
var s, o, l, u, d, h, m, p, g, b, y,
|
|
5320
|
+
var s, o, l, u, d, h, m, p, g, b, y, k, V, _, M, T, D;
|
|
5313
5321
|
this.translate = e;
|
|
5314
5322
|
const i = e.messages();
|
|
5315
5323
|
this.element = document.createElement("div"), this.element.classList.add(A.securityContent), this.expiryInputContainer.classList.add(A.inputContainer), (s = t == null ? void 0 : t.container) != null && s.className && F(this.expiryInputContainer, 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(A.input), (l = t == null ? void 0 : t.field) != null && l.className && F(this.expiryInput, t.field.className), (u = t == null ? void 0 : t.field) != null && u.styles && Object.assign(this.expiryInput.style, t.field.styles), this.expiryEndContent.classList.add(A.endContent), this.expiryEndContent.appendChild(this.expiryWarning.render()), this.expiryInputContainer.append(this.expiryInput, this.expiryEndContent), this.expiryLabel.setAttribute("for", this.expiryId), this.expiryLabel.classList.add(A.label), (d = t == null ? void 0 : t.label) != null && d.className && F(this.expiryLabel, t.label.className), (h = t == null ? void 0 : t.label) != null && h.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(A.labelError, A.hidden), this.expiryLabel.append(this.expiryLabelText, this.expiryLabelError), this.expiryError.classList.add(A.error, A.hidden), (m = t == null ? void 0 : t.error) != null && m.className && F(this.expiryError, t.error.className), (p = t == null ? void 0 : t.error) != null && p.styles && Object.assign(this.expiryError.style, t.error.styles);
|
|
5316
5324
|
const r = document.createElement("div");
|
|
5317
|
-
if (r.appendChild(this.expiryError), this.cvcInputContainer.classList.add(A.inputContainer), (g = t == null ? void 0 : t.container) != null && g.className && F(this.cvcInputContainer, 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(A.input), (y = t == null ? void 0 : t.field) != null && y.className && F(this.cvcInput, t.field.className), (
|
|
5325
|
+
if (r.appendChild(this.expiryError), this.cvcInputContainer.classList.add(A.inputContainer), (g = t == null ? void 0 : t.container) != null && g.className && F(this.cvcInputContainer, 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(A.input), (y = t == null ? void 0 : t.field) != null && y.className && F(this.cvcInput, 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) {
|
|
5318
5326
|
const C = (R) => R.replace(/[A-Z]/g, (O) => "-" + O.toLowerCase()), w = Object.entries(t.placeholder.styles).map(([R, O]) => `${C(R)}:${O};`).join("");
|
|
5319
5327
|
this.placeholderStyle.textContent = `#${this.expiryId}::placeholder{${w}}#${this.cvcId}::placeholder{${w}}`, this.element.appendChild(this.placeholderStyle);
|
|
5320
5328
|
}
|
|
@@ -5364,14 +5372,14 @@ class ed {
|
|
|
5364
5372
|
handleCvcChange(e) {
|
|
5365
5373
|
if (this.isDisabled) return;
|
|
5366
5374
|
this.isCvcRequired = !1, this.cvcErrorMessage = "", this.isCvcChanged || (this.isCvcChanged = !0);
|
|
5367
|
-
const t =
|
|
5375
|
+
const t = El(e, this.cardType || ""), i = Pe.getTypeInfo(this.cardType || "");
|
|
5368
5376
|
t.length === (i == null ? void 0 : i.code.size) && this.validateCvc(t), this.events.cvcChange.emit({
|
|
5369
5377
|
value: t,
|
|
5370
5378
|
isValid: this.cvcValidator(t) === null
|
|
5371
5379
|
}), this.cvcInput.value = t, this.render();
|
|
5372
5380
|
}
|
|
5373
5381
|
toggleCvcLabelError(e) {
|
|
5374
|
-
return
|
|
5382
|
+
return E(this, null, function* () {
|
|
5375
5383
|
if (e) {
|
|
5376
5384
|
this.cvcInputContainer.classList.add(A.errorInput), this.cvcLabelError.classList.remove(A.hidden), yield H(this.cvcLabelError, W.open, W.transition);
|
|
5377
5385
|
return;
|
|
@@ -5380,7 +5388,7 @@ class ed {
|
|
|
5380
5388
|
});
|
|
5381
5389
|
}
|
|
5382
5390
|
toggleCvcErrorMessage(e) {
|
|
5383
|
-
return
|
|
5391
|
+
return E(this, null, function* () {
|
|
5384
5392
|
if (e) {
|
|
5385
5393
|
this.cvcInputContainer.classList.add(A.errorInput), this.cvcError.textContent = this.cvcErrorMessage, this.cvcError.classList.remove(A.hidden), yield H(this.cvcError, Q.open, Q.transition);
|
|
5386
5394
|
return;
|
|
@@ -5414,7 +5422,7 @@ class ed {
|
|
|
5414
5422
|
handleExpiryChange(e) {
|
|
5415
5423
|
if (this.isDisabled) return;
|
|
5416
5424
|
this.isExpiryRequired = !1, this.expiryErrorMessage = "", this.isExpiryChanged || (this.isExpiryChanged = !0);
|
|
5417
|
-
const t =
|
|
5425
|
+
const t = kl(e);
|
|
5418
5426
|
t.length === 7 && this.validateExpiry(t), this.events.expiryChange.emit({
|
|
5419
5427
|
value: t,
|
|
5420
5428
|
isValid: this.expiryValidator(t) === null
|
|
@@ -5422,7 +5430,7 @@ class ed {
|
|
|
5422
5430
|
}
|
|
5423
5431
|
// toggle expiry label error
|
|
5424
5432
|
toggleExpiryLabelError(e) {
|
|
5425
|
-
return
|
|
5433
|
+
return E(this, null, function* () {
|
|
5426
5434
|
if (e) {
|
|
5427
5435
|
this.expiryInputContainer.classList.add(A.errorInput), this.expiryLabelError.classList.remove(A.hidden), yield H(this.expiryLabelError, W.open, W.transition);
|
|
5428
5436
|
return;
|
|
@@ -5432,7 +5440,7 @@ class ed {
|
|
|
5432
5440
|
}
|
|
5433
5441
|
// toggle expiry error message
|
|
5434
5442
|
toggleExpiryErrorMessage(e) {
|
|
5435
|
-
return
|
|
5443
|
+
return E(this, null, function* () {
|
|
5436
5444
|
if (e) {
|
|
5437
5445
|
this.expiryInputContainer.classList.add(A.errorInput), this.expiryError.textContent = this.expiryErrorMessage, this.expiryError.classList.remove(A.hidden), yield H(this.expiryError, Q.open, Q.transition);
|
|
5438
5446
|
return;
|
|
@@ -5569,7 +5577,7 @@ class nd {
|
|
|
5569
5577
|
return this.element;
|
|
5570
5578
|
}
|
|
5571
5579
|
}
|
|
5572
|
-
const id = "_container_79xkl_1", rd = "_title_79xkl_5",
|
|
5580
|
+
const id = "_container_79xkl_1", rd = "_title_79xkl_5", hi = {
|
|
5573
5581
|
container: id,
|
|
5574
5582
|
title: rd
|
|
5575
5583
|
};
|
|
@@ -5578,7 +5586,7 @@ class ad {
|
|
|
5578
5586
|
c(this, "element");
|
|
5579
5587
|
c(this, "message", document.createElement("p"));
|
|
5580
5588
|
c(this, "icon", new nd());
|
|
5581
|
-
this.element = document.createElement("div"), this.element.classList.add(
|
|
5589
|
+
this.element = document.createElement("div"), this.element.classList.add(hi.container), this.message.classList.add(hi.title), this.element.append(this.icon.render(), this.message);
|
|
5582
5590
|
}
|
|
5583
5591
|
addClassName(e) {
|
|
5584
5592
|
F(this.element, e);
|
|
@@ -5590,7 +5598,7 @@ class ad {
|
|
|
5590
5598
|
return this.element;
|
|
5591
5599
|
}
|
|
5592
5600
|
}
|
|
5593
|
-
const sd = "_container_g3abj_1", od = "_title_g3abj_12",
|
|
5601
|
+
const sd = "_container_g3abj_1", od = "_title_g3abj_12", pi = {
|
|
5594
5602
|
container: sd,
|
|
5595
5603
|
title: od
|
|
5596
5604
|
}, Ze = class Ze {
|
|
@@ -5600,7 +5608,7 @@ const sd = "_container_g3abj_1", od = "_title_g3abj_12", ui = {
|
|
|
5600
5608
|
c(this, "icon", new yt());
|
|
5601
5609
|
c(this, "hasCustomMessage", !1);
|
|
5602
5610
|
c(this, "hasConfigMessage", !1);
|
|
5603
|
-
this.translate = e, this.element = document.createElement("div"), this.element.classList.add(
|
|
5611
|
+
this.translate = e, this.element = document.createElement("div"), this.element.classList.add(pi.container), this.message.classList.add(pi.title), t ? (this.message.textContent = t, this.hasCustomMessage = !0, this.hasConfigMessage = !0) : this.message.textContent = e.messages().status.error, this.element.append(this.icon.render(), this.message), this.translate.subscribe(({ messages: i }) => {
|
|
5604
5612
|
this.hasCustomMessage || (this.message.textContent = i.status.error);
|
|
5605
5613
|
}), Ze.instances.add(this);
|
|
5606
5614
|
}
|
|
@@ -5664,7 +5672,7 @@ class ld {
|
|
|
5664
5672
|
}
|
|
5665
5673
|
// init
|
|
5666
5674
|
init() {
|
|
5667
|
-
return
|
|
5675
|
+
return E(this, null, function* () {
|
|
5668
5676
|
this.buttons.addEventListener("onPaymentAttempt", (e) => {
|
|
5669
5677
|
var i;
|
|
5670
5678
|
const t = this.config.state.checkout.getState();
|
|
@@ -5672,7 +5680,7 @@ class ld {
|
|
|
5672
5680
|
}), this.buttons.addEventListener("onFormLoaded", () => {
|
|
5673
5681
|
const { onCheckoutLoaded: e } = this.config.state.checkout.getState();
|
|
5674
5682
|
!this.hasLoadedOnce && e && (this.hasLoadedOnce = !0, e({ success: !0 }));
|
|
5675
|
-
}), this.buttons.addEventListener("ready", () =>
|
|
5683
|
+
}), this.buttons.addEventListener("ready", () => E(this, null, function* () {
|
|
5676
5684
|
var t;
|
|
5677
5685
|
this.loader.setClassName(Z.hidden);
|
|
5678
5686
|
const { variant: e } = this.config.state.checkout.getState();
|
|
@@ -5683,7 +5691,7 @@ class ld {
|
|
|
5683
5691
|
{ duration: 250, easing: "ease-out", fill: "forwards" }
|
|
5684
5692
|
).finished) != null ? t : Promise.resolve(), this.checkout.style.height = ""), this.isFormOpen = !0;
|
|
5685
5693
|
}
|
|
5686
|
-
})), this.buttons.addEventListener("open", () =>
|
|
5694
|
+
})), this.buttons.addEventListener("open", () => E(this, null, function* () {
|
|
5687
5695
|
var r;
|
|
5688
5696
|
if (this.isLoading) return;
|
|
5689
5697
|
this.hideError();
|
|
@@ -5725,7 +5733,7 @@ class ld {
|
|
|
5725
5733
|
case "venmo":
|
|
5726
5734
|
return this.handleSuccess({ clientSession: t, braintree: { nonce: e } });
|
|
5727
5735
|
}
|
|
5728
|
-
}), this.form.addEventListener("close", () =>
|
|
5736
|
+
}), this.form.addEventListener("close", () => E(this, null, function* () {
|
|
5729
5737
|
var a, s;
|
|
5730
5738
|
if (this.isLoading) return;
|
|
5731
5739
|
this.hideError();
|
|
@@ -5745,7 +5753,7 @@ class ld {
|
|
|
5745
5753
|
{ minHeight: [`${e}px`, `${this.closedHeight}px`] },
|
|
5746
5754
|
{ duration: 250, easing: "ease-out", fill: "forwards" }
|
|
5747
5755
|
).finished) != null ? s : Promise.resolve(), this.checkout.style.height = "auto"), this.isFormOpen = !1;
|
|
5748
|
-
})), this.form.addEventListener("submit", (e) =>
|
|
5756
|
+
})), this.form.addEventListener("submit", (e) => E(this, null, function* () {
|
|
5749
5757
|
if (this.isLoading || (this.form.touchSubmit(), this.hideError(), !this.form.validate())) return;
|
|
5750
5758
|
const i = e.number.replace(/\D/g, ""), r = this.config.state.checkout.getState(), a = this.config.service.ev.getEv(), [s, o] = yield Promise.all([a.encrypt(i), a.encrypt(e.cvc)]), [l, u] = e.expiry.split("/");
|
|
5751
5759
|
yield this.handleSuccess({
|
|
@@ -5776,14 +5784,14 @@ class ld {
|
|
|
5776
5784
|
}
|
|
5777
5785
|
// handle success
|
|
5778
5786
|
handleSuccess(e) {
|
|
5779
|
-
return
|
|
5787
|
+
return E(this, null, function* () {
|
|
5780
5788
|
var a, s;
|
|
5781
5789
|
if (this.isLoading) return;
|
|
5782
5790
|
this.hideError(), this.setLoading(!0);
|
|
5783
5791
|
const t = this.config.state.checkout.getState(), i = this.config.state.translate.messages();
|
|
5784
5792
|
let r;
|
|
5785
5793
|
try {
|
|
5786
|
-
if (r = yield
|
|
5794
|
+
if (r = yield Or(e, t.environment, t.apiVersion), r.error)
|
|
5787
5795
|
throw new Error(((a = r.error) == null ? void 0 : a.message) || i.status.error);
|
|
5788
5796
|
if (r.three_ds_session_id) {
|
|
5789
5797
|
yield this.config.service.ev.initThreeDs({
|
|
@@ -5817,7 +5825,7 @@ class ld {
|
|
|
5817
5825
|
}
|
|
5818
5826
|
// show success
|
|
5819
5827
|
showSuccess() {
|
|
5820
|
-
return
|
|
5828
|
+
return E(this, null, function* () {
|
|
5821
5829
|
this.container.classList.add(Z.hidden), this.success.removeClassName(Z.hidden), yield H(this.success.element, Le.open, Le.transition);
|
|
5822
5830
|
});
|
|
5823
5831
|
}
|
|
@@ -5868,10 +5876,10 @@ class cd {
|
|
|
5868
5876
|
}
|
|
5869
5877
|
// init
|
|
5870
5878
|
init() {
|
|
5871
|
-
return
|
|
5879
|
+
return E(this, null, function* () {
|
|
5872
5880
|
const { checkout: e, transaction: t, translate: i, styles: r } = this.config.state, { apiVersion: a } = e.getState();
|
|
5873
5881
|
e.subscribe(({ clientToken: s, environment: o, locale: l, translate: u, styles: d }) => {
|
|
5874
|
-
const h =
|
|
5882
|
+
const h = En.teamId, m = En.appIds[o];
|
|
5875
5883
|
this.config.service.ev.preloadEvervault({ teamId: h, appId: m }).finally(), l && i.locale() !== l && i.setLocale(l), u && i.overrides() !== u && i.setMessages(u), d && r.setState(d), t.updateTransaction(s, o, a).then((p) => {
|
|
5876
5884
|
if (!p)
|
|
5877
5885
|
throw new Error("Payment config not found");
|
|
@@ -5887,7 +5895,7 @@ class cd {
|
|
|
5887
5895
|
}
|
|
5888
5896
|
// mount
|
|
5889
5897
|
mount() {
|
|
5890
|
-
return
|
|
5898
|
+
return E(this, null, function* () {
|
|
5891
5899
|
return this.component || (this.component = new ld(this.config)), yield this.init(), yield this.component.init(), this.component.render();
|
|
5892
5900
|
});
|
|
5893
5901
|
}
|
|
@@ -5936,11 +5944,11 @@ class md extends Ct {
|
|
|
5936
5944
|
}
|
|
5937
5945
|
// update transaction
|
|
5938
5946
|
updateTransaction(t, i, r) {
|
|
5939
|
-
return
|
|
5947
|
+
return E(this, null, function* () {
|
|
5940
5948
|
if (this.clientToken === t) return this.getState();
|
|
5941
5949
|
this.clientToken = t;
|
|
5942
5950
|
try {
|
|
5943
|
-
const a = yield
|
|
5951
|
+
const a = yield Sr(t, i, r);
|
|
5944
5952
|
return this.setState(a), a;
|
|
5945
5953
|
} catch (a) {
|
|
5946
5954
|
console.error("Failed to update transaction:", a);
|
|
@@ -6208,7 +6216,7 @@ const fd = {
|
|
|
6208
6216
|
error: "Η μέθοδος πληρωμής σας απορρίφθηκε. Αυτό μπορεί να οφείλεται σε ανεπαρκή κεφάλαια, ληγμένα στοιχεία πληρωμής ή περιορισμούς ασφαλείας. Παρακαλούμε ελέγξτε τα στοιχεία πληρωμής σας ή δοκιμάστε μια διαφορετική μέθοδο πληρωμής.",
|
|
6209
6217
|
invalidSession: "Η συνεδρία πληρωμής σας έχει λήξει. Παρακαλούμε ανανεώστε τη σελίδα για να συνεχίσετε."
|
|
6210
6218
|
}
|
|
6211
|
-
},
|
|
6219
|
+
}, Ed = {
|
|
6212
6220
|
card: {
|
|
6213
6221
|
required: "REQUIRED",
|
|
6214
6222
|
number: {
|
|
@@ -6251,7 +6259,7 @@ const fd = {
|
|
|
6251
6259
|
error: "Your payment method was declined. This could be due to insufficient funds, expired payment details, or security restrictions. Please check your payment details or try a different payment method.",
|
|
6252
6260
|
invalidSession: "Your payment session has expired. Please refresh the page to continue."
|
|
6253
6261
|
}
|
|
6254
|
-
},
|
|
6262
|
+
}, kd = {
|
|
6255
6263
|
card: {
|
|
6256
6264
|
required: "OBLIGATORIO",
|
|
6257
6265
|
number: {
|
|
@@ -7500,13 +7508,13 @@ const fd = {
|
|
|
7500
7508
|
}
|
|
7501
7509
|
}, Zt = {
|
|
7502
7510
|
ar: fd,
|
|
7503
|
-
en:
|
|
7511
|
+
en: Ed,
|
|
7504
7512
|
bg: gd,
|
|
7505
7513
|
cs: bd,
|
|
7506
7514
|
da: vd,
|
|
7507
7515
|
de: yd,
|
|
7508
7516
|
el: Cd,
|
|
7509
|
-
es:
|
|
7517
|
+
es: kd,
|
|
7510
7518
|
et: xd,
|
|
7511
7519
|
fi: wd,
|
|
7512
7520
|
fil: Td,
|
|
@@ -7538,7 +7546,7 @@ const fd = {
|
|
|
7538
7546
|
}, Jt = () => {
|
|
7539
7547
|
const n = navigator == null ? void 0 : navigator.language.split("-")[0];
|
|
7540
7548
|
return Zt[n] || Zt.en;
|
|
7541
|
-
},
|
|
7549
|
+
}, mi = (n, e = {}) => {
|
|
7542
7550
|
var r, a;
|
|
7543
7551
|
if (!n) return Jt();
|
|
7544
7552
|
const t = Zt[n] || Jt();
|
|
@@ -7572,11 +7580,11 @@ class Jd extends Ct {
|
|
|
7572
7580
|
});
|
|
7573
7581
|
}
|
|
7574
7582
|
setMessages(e) {
|
|
7575
|
-
const t = this.locale(), i =
|
|
7583
|
+
const t = this.locale(), i = mi(t, e);
|
|
7576
7584
|
this.setState({ locale: t, messages: i, overrides: e });
|
|
7577
7585
|
}
|
|
7578
7586
|
setLocale(e) {
|
|
7579
|
-
const t = this.overrides(), i =
|
|
7587
|
+
const t = this.overrides(), i = mi(e, t);
|
|
7580
7588
|
this.setState({ locale: e, messages: i, overrides: t });
|
|
7581
7589
|
}
|
|
7582
7590
|
overrides() {
|
|
@@ -7607,7 +7615,7 @@ class Qd {
|
|
|
7607
7615
|
}
|
|
7608
7616
|
// init
|
|
7609
7617
|
init(e) {
|
|
7610
|
-
return
|
|
7618
|
+
return E(this, null, function* () {
|
|
7611
7619
|
if (typeof window == "undefined")
|
|
7612
7620
|
throw new Error("PayPal can only be initialized in browser environment");
|
|
7613
7621
|
try {
|
|
@@ -7624,7 +7632,7 @@ class Qd {
|
|
|
7624
7632
|
}
|
|
7625
7633
|
// render
|
|
7626
7634
|
render(e, t) {
|
|
7627
|
-
return
|
|
7635
|
+
return E(this, null, function* () {
|
|
7628
7636
|
var i, r;
|
|
7629
7637
|
if (!e.isConnected)
|
|
7630
7638
|
throw new Error("PayPal parent element must be connected to DOM before render()");
|
|
@@ -7649,7 +7657,7 @@ class eu {
|
|
|
7649
7657
|
}
|
|
7650
7658
|
// init
|
|
7651
7659
|
init(e) {
|
|
7652
|
-
return
|
|
7660
|
+
return E(this, null, function* () {
|
|
7653
7661
|
if (typeof window == "undefined")
|
|
7654
7662
|
throw new Error("Braintree can only be initialized in browser environment");
|
|
7655
7663
|
try {
|
|
@@ -7671,7 +7679,7 @@ class eu {
|
|
|
7671
7679
|
}
|
|
7672
7680
|
// create venmo instance
|
|
7673
7681
|
createVenmo(e) {
|
|
7674
|
-
return
|
|
7682
|
+
return E(this, null, function* () {
|
|
7675
7683
|
if (!this.client)
|
|
7676
7684
|
throw new Error("Braintree client must be initialized before creating Venmo instance");
|
|
7677
7685
|
try {
|
|
@@ -7700,7 +7708,7 @@ class eu {
|
|
|
7700
7708
|
}
|
|
7701
7709
|
// tokenize venmo payment
|
|
7702
7710
|
tokenize() {
|
|
7703
|
-
return
|
|
7711
|
+
return E(this, null, function* () {
|
|
7704
7712
|
if (!this.venmoInstance)
|
|
7705
7713
|
throw new Error("Venmo instance not initialized");
|
|
7706
7714
|
return new Promise((e, t) => {
|