@odus/checkout 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/checkout.es.js +527 -304
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/checkout.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
class
|
|
1
|
+
const N = (n) => n === "test" ? "https://sandbox-api.odus.com" : n === "live" ? "https://api.odus.com" : "http://localhost:3000";
|
|
2
|
+
class O {
|
|
3
3
|
apiKey;
|
|
4
4
|
baseUrl;
|
|
5
5
|
browserInfo;
|
|
6
6
|
constructor(e, t, i) {
|
|
7
|
-
this.apiKey = e, this.baseUrl =
|
|
7
|
+
this.apiKey = e, this.baseUrl = N(t), this.browserInfo = i || { userAgent: navigator.userAgent };
|
|
8
8
|
}
|
|
9
9
|
async fetchApi({
|
|
10
10
|
endpoint: e,
|
|
@@ -24,17 +24,17 @@ class H {
|
|
|
24
24
|
body: i ? JSON.stringify(i) : void 0
|
|
25
25
|
});
|
|
26
26
|
if (!s.ok) {
|
|
27
|
-
let
|
|
27
|
+
let o;
|
|
28
28
|
try {
|
|
29
|
-
|
|
29
|
+
o = await s.json();
|
|
30
30
|
} catch (c) {
|
|
31
31
|
console.log("error", c);
|
|
32
32
|
}
|
|
33
33
|
throw {
|
|
34
|
-
message:
|
|
34
|
+
message: o?.message[0] || `API request failed: ${s.status} ${s.statusText}`,
|
|
35
35
|
status: s.status,
|
|
36
36
|
statusText: s.statusText,
|
|
37
|
-
details:
|
|
37
|
+
details: o
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
return s.json();
|
|
@@ -57,7 +57,7 @@ class H {
|
|
|
57
57
|
}) {
|
|
58
58
|
let s = {};
|
|
59
59
|
if (a && i) {
|
|
60
|
-
const
|
|
60
|
+
const o = i.cardExpiry.replace(/\s+/g, "").split("/"), l = o[0], c = o[1];
|
|
61
61
|
s = {
|
|
62
62
|
paymentMethodData: {
|
|
63
63
|
type: "card",
|
|
@@ -96,12 +96,12 @@ class H {
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
const
|
|
100
|
-
id:
|
|
99
|
+
const q = async ({
|
|
100
|
+
id: n,
|
|
101
101
|
apiKey: e,
|
|
102
102
|
environment: t
|
|
103
103
|
}) => {
|
|
104
|
-
const i =
|
|
104
|
+
const i = N(t), a = await fetch(`${i}/checkout-profiles/${n}`, {
|
|
105
105
|
method: "GET",
|
|
106
106
|
headers: {
|
|
107
107
|
"Content-Type": "application/json",
|
|
@@ -112,7 +112,7 @@ const K = async ({
|
|
|
112
112
|
throw new Error(`HTTP error! Status: ${a.status}`);
|
|
113
113
|
return await a.json();
|
|
114
114
|
};
|
|
115
|
-
class
|
|
115
|
+
class K {
|
|
116
116
|
events = /* @__PURE__ */ new Map();
|
|
117
117
|
/**
|
|
118
118
|
* Subscribe to an event
|
|
@@ -150,13 +150,13 @@ class j {
|
|
|
150
150
|
return this.events.get(e)?.size || 0;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
const
|
|
154
|
-
class
|
|
153
|
+
const j = new K();
|
|
154
|
+
class U {
|
|
155
155
|
state;
|
|
156
156
|
initialState;
|
|
157
157
|
eventBus;
|
|
158
158
|
stateChangedEvent = "state-changed";
|
|
159
|
-
constructor(e, t =
|
|
159
|
+
constructor(e, t = j) {
|
|
160
160
|
this.initialState = { ...e }, this.state = { ...e }, this.eventBus = t;
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
@@ -196,11 +196,11 @@ class q {
|
|
|
196
196
|
return this.state[e];
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
function k(
|
|
200
|
-
return new
|
|
199
|
+
function k(n) {
|
|
200
|
+
return new U(n);
|
|
201
201
|
}
|
|
202
202
|
function _({
|
|
203
|
-
apiKey:
|
|
203
|
+
apiKey: n,
|
|
204
204
|
profileId: e,
|
|
205
205
|
environment: t
|
|
206
206
|
}) {
|
|
@@ -211,8 +211,8 @@ function _({
|
|
|
211
211
|
}), a = async () => {
|
|
212
212
|
try {
|
|
213
213
|
i.setState({ isLoading: !0 });
|
|
214
|
-
const r = await
|
|
215
|
-
apiKey:
|
|
214
|
+
const r = await q({
|
|
215
|
+
apiKey: n,
|
|
216
216
|
id: e,
|
|
217
217
|
environment: t
|
|
218
218
|
});
|
|
@@ -234,13 +234,13 @@ function _({
|
|
|
234
234
|
reload: a
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
const
|
|
238
|
-
cardNumber: (
|
|
239
|
-
cardExpiry: (
|
|
240
|
-
const t =
|
|
237
|
+
const V = {
|
|
238
|
+
cardNumber: (n) => (n.replace(/\s/g, "").match(/.{1,4}/g) || []).join(" "),
|
|
239
|
+
cardExpiry: (n) => {
|
|
240
|
+
const t = n.replace(/\D/g, "").slice(0, 4);
|
|
241
241
|
return t.length > 2 ? `${t.slice(0, 2)} / ${t.slice(2, 4)}` : t;
|
|
242
242
|
}
|
|
243
|
-
},
|
|
243
|
+
}, R = {
|
|
244
244
|
"gmail.com": [
|
|
245
245
|
"gmal.com",
|
|
246
246
|
"gmil.com",
|
|
@@ -312,63 +312,63 @@ const N = {
|
|
|
312
312
|
"comcast.net": ["comcast.com", "comcat.net", "comcst.net", "comcastnet", "comcast.nt", "comcas.net"],
|
|
313
313
|
"verizon.net": ["verizon.com", "verizon.nt", "verizonnet", "verizn.net", "verizon.ne", "verzon.net"],
|
|
314
314
|
"att.net": ["att.com", "at.net", "att.nt", "attnet", "att.ne", "attt.net"]
|
|
315
|
-
}, G = (
|
|
316
|
-
if (!
|
|
315
|
+
}, G = (n) => {
|
|
316
|
+
if (!n || n.includes("."))
|
|
317
317
|
return null;
|
|
318
318
|
const e = ["com", "net", "org", "edu", "gov", "io", "co"];
|
|
319
319
|
for (const t of e) {
|
|
320
|
-
if (
|
|
320
|
+
if (n === "companycok" && t === "co")
|
|
321
321
|
return "company.co";
|
|
322
|
-
if (
|
|
323
|
-
const i =
|
|
324
|
-
return `${
|
|
322
|
+
if (n.endsWith(t) && !n.includes(".")) {
|
|
323
|
+
const i = n.length - t.length;
|
|
324
|
+
return `${n.substring(0, i)}.${t}`;
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
return null;
|
|
328
|
-
}, Y = (
|
|
329
|
-
if (
|
|
330
|
-
if (e.length === 0) return
|
|
331
|
-
const t = e.length + 1, i =
|
|
328
|
+
}, Y = (n, e) => {
|
|
329
|
+
if (n.length === 0) return e.length;
|
|
330
|
+
if (e.length === 0) return n.length;
|
|
331
|
+
const t = e.length + 1, i = n.length + 1, a = Array.from(
|
|
332
332
|
{ length: t },
|
|
333
|
-
(r, s) => Array.from({ length: i }, (
|
|
333
|
+
(r, s) => Array.from({ length: i }, (o, l) => s === 0 ? l : l === 0 ? s : 0)
|
|
334
334
|
);
|
|
335
335
|
for (let r = 1; r < t; r++)
|
|
336
336
|
for (let s = 1; s < i; s++) {
|
|
337
|
-
const
|
|
337
|
+
const o = n[s - 1] === e[r - 1] ? 0 : 1;
|
|
338
338
|
a[r][s] = Math.min(
|
|
339
339
|
a[r - 1][s] + 1,
|
|
340
340
|
// deletion
|
|
341
341
|
a[r][s - 1] + 1,
|
|
342
342
|
// insertion
|
|
343
|
-
a[r - 1][s - 1] +
|
|
343
|
+
a[r - 1][s - 1] + o
|
|
344
344
|
// substitution
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
|
-
return a[e.length][
|
|
348
|
-
}, Z = (
|
|
347
|
+
return a[e.length][n.length];
|
|
348
|
+
}, Z = (n) => {
|
|
349
349
|
let t = null, i = 3;
|
|
350
|
-
const a =
|
|
351
|
-
for (const r of Object.keys(
|
|
350
|
+
const a = n.toLowerCase();
|
|
351
|
+
for (const r of Object.keys(R)) {
|
|
352
352
|
const s = Y(a, r);
|
|
353
353
|
s <= 2 && s < i && (i = s, t = r);
|
|
354
354
|
}
|
|
355
355
|
return t;
|
|
356
356
|
}, J = () => {
|
|
357
|
-
const { t:
|
|
357
|
+
const { t: n } = z();
|
|
358
358
|
return {
|
|
359
359
|
validateEmail: (t) => {
|
|
360
360
|
const i = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
361
361
|
if (!t)
|
|
362
362
|
return {
|
|
363
363
|
isValid: !1,
|
|
364
|
-
message:
|
|
364
|
+
message: n("validation.emailInvalid"),
|
|
365
365
|
suggestion: null
|
|
366
366
|
};
|
|
367
367
|
const a = t.indexOf("@");
|
|
368
368
|
if (a === -1)
|
|
369
369
|
return {
|
|
370
370
|
isValid: !1,
|
|
371
|
-
message:
|
|
371
|
+
message: n("validation.emailInvalid"),
|
|
372
372
|
suggestion: null
|
|
373
373
|
};
|
|
374
374
|
const r = t.substring(0, a), s = t.substring(a + 1);
|
|
@@ -377,16 +377,16 @@ const N = {
|
|
|
377
377
|
if (l)
|
|
378
378
|
return {
|
|
379
379
|
isValid: !1,
|
|
380
|
-
message:
|
|
380
|
+
message: n("validation.emailSuggestion", {
|
|
381
381
|
email: `${r}@${l}`
|
|
382
382
|
}),
|
|
383
383
|
suggestion: `${r}@${l}`
|
|
384
384
|
};
|
|
385
|
-
for (const c of Object.keys(
|
|
385
|
+
for (const c of Object.keys(R))
|
|
386
386
|
if (c.replace(/\./g, "") === s)
|
|
387
387
|
return {
|
|
388
388
|
isValid: !1,
|
|
389
|
-
message:
|
|
389
|
+
message: n("validation.emailSuggestion", {
|
|
390
390
|
email: `${r}@${c}`
|
|
391
391
|
}),
|
|
392
392
|
suggestion: `${r}@${c}`
|
|
@@ -395,15 +395,15 @@ const N = {
|
|
|
395
395
|
if (!i.test(t))
|
|
396
396
|
return {
|
|
397
397
|
isValid: !1,
|
|
398
|
-
message:
|
|
398
|
+
message: n("validation.emailInvalid"),
|
|
399
399
|
suggestion: null
|
|
400
400
|
};
|
|
401
|
-
const
|
|
402
|
-
if (
|
|
403
|
-
const l = `${r}@${
|
|
401
|
+
const o = Z(s);
|
|
402
|
+
if (o && o !== s) {
|
|
403
|
+
const l = `${r}@${o}`;
|
|
404
404
|
return {
|
|
405
405
|
isValid: !1,
|
|
406
|
-
message:
|
|
406
|
+
message: n("validation.emailSuggestion", { email: l }),
|
|
407
407
|
suggestion: l
|
|
408
408
|
};
|
|
409
409
|
}
|
|
@@ -415,7 +415,7 @@ const N = {
|
|
|
415
415
|
}
|
|
416
416
|
};
|
|
417
417
|
}, W = () => {
|
|
418
|
-
const { t:
|
|
418
|
+
const { t: n } = z(), { validateEmail: e } = J();
|
|
419
419
|
return {
|
|
420
420
|
email: (t) => {
|
|
421
421
|
const i = e(t);
|
|
@@ -423,21 +423,21 @@ const N = {
|
|
|
423
423
|
},
|
|
424
424
|
name: (t) => {
|
|
425
425
|
if (!t.trim())
|
|
426
|
-
return
|
|
426
|
+
return n("validation.nameRequired");
|
|
427
427
|
},
|
|
428
428
|
cardExpiry: (t) => {
|
|
429
429
|
const i = t.replace(/\s/g, ""), [a, r] = i.split("/").map((u) => u.trim());
|
|
430
430
|
if (!a || !r || a.length !== 2 || r.length !== 2)
|
|
431
|
-
return
|
|
432
|
-
const s = /* @__PURE__ */ new Date(),
|
|
431
|
+
return n("validation.cardExpiryFormat");
|
|
432
|
+
const s = /* @__PURE__ */ new Date(), o = s.getFullYear() % 100, l = s.getMonth() + 1, c = parseInt(a, 10), d = parseInt(r, 10);
|
|
433
433
|
if (c < 1 || c > 12)
|
|
434
|
-
return
|
|
435
|
-
if (d <
|
|
436
|
-
return
|
|
434
|
+
return n("validation.cardExpiryFormat");
|
|
435
|
+
if (d < o || d === o && c < l)
|
|
436
|
+
return n("validation.cardExpiryInvalid");
|
|
437
437
|
}
|
|
438
438
|
};
|
|
439
439
|
}, X = () => {
|
|
440
|
-
const
|
|
440
|
+
const n = W(), e = k({
|
|
441
441
|
formData: {
|
|
442
442
|
name: "",
|
|
443
443
|
email: "",
|
|
@@ -451,7 +451,7 @@ const N = {
|
|
|
451
451
|
},
|
|
452
452
|
isValid: !1
|
|
453
453
|
}), t = (l, c) => {
|
|
454
|
-
const d =
|
|
454
|
+
const d = n[l];
|
|
455
455
|
return d?.(c);
|
|
456
456
|
}, i = (l) => {
|
|
457
457
|
const c = {};
|
|
@@ -465,30 +465,30 @@ const N = {
|
|
|
465
465
|
}, r = (l, c) => {
|
|
466
466
|
const d = e.getState();
|
|
467
467
|
let u = c;
|
|
468
|
-
l in
|
|
469
|
-
const
|
|
468
|
+
l in V && (u = V[l](c));
|
|
469
|
+
const f = {
|
|
470
470
|
...d.formData,
|
|
471
471
|
[l]: u
|
|
472
472
|
}, g = { ...d.errors };
|
|
473
473
|
if (d.touched[l]) {
|
|
474
|
-
const
|
|
475
|
-
|
|
474
|
+
const S = t(l, u);
|
|
475
|
+
S ? g[l] = S : delete g[l];
|
|
476
476
|
}
|
|
477
477
|
e.setState({
|
|
478
|
-
formData:
|
|
478
|
+
formData: f,
|
|
479
479
|
errors: g,
|
|
480
|
-
isValid: a(
|
|
480
|
+
isValid: a(f)
|
|
481
481
|
});
|
|
482
482
|
}, s = (l, c) => {
|
|
483
483
|
const d = e.getState(), u = {
|
|
484
484
|
...d.touched,
|
|
485
485
|
[l]: !0
|
|
486
|
-
},
|
|
487
|
-
|
|
486
|
+
}, f = t(l, c), g = { ...d.errors };
|
|
487
|
+
f ? g[l] = f : delete g[l], e.setState({
|
|
488
488
|
touched: u,
|
|
489
489
|
errors: g
|
|
490
490
|
});
|
|
491
|
-
},
|
|
491
|
+
}, o = (l) => {
|
|
492
492
|
const d = {
|
|
493
493
|
...e.getState().formData,
|
|
494
494
|
...l
|
|
@@ -503,28 +503,28 @@ const N = {
|
|
|
503
503
|
subscribe: e.subscribe.bind(e),
|
|
504
504
|
handleChange: r,
|
|
505
505
|
handleBlur: s,
|
|
506
|
-
setFormData:
|
|
506
|
+
setFormData: o,
|
|
507
507
|
reset: e.resetState.bind(e)
|
|
508
508
|
};
|
|
509
509
|
}, Q = async ({
|
|
510
|
-
props:
|
|
510
|
+
props: n,
|
|
511
511
|
apiKey: e,
|
|
512
512
|
environment: t
|
|
513
513
|
}) => {
|
|
514
|
-
const i =
|
|
514
|
+
const i = N(t), a = await fetch(`${i}/checkout/init`, {
|
|
515
515
|
method: "POST",
|
|
516
516
|
headers: {
|
|
517
517
|
"Content-Type": "application/json",
|
|
518
518
|
Authorization: `Bearer ${e}`
|
|
519
519
|
},
|
|
520
|
-
body: JSON.stringify(
|
|
520
|
+
body: JSON.stringify(n)
|
|
521
521
|
});
|
|
522
522
|
if (!a.ok)
|
|
523
523
|
throw new Error(`HTTP error! Status: ${a.status}`);
|
|
524
524
|
return await a.json();
|
|
525
525
|
};
|
|
526
526
|
function ee({
|
|
527
|
-
apiKey:
|
|
527
|
+
apiKey: n,
|
|
528
528
|
checkoutProfile: e,
|
|
529
529
|
inputStyles: t,
|
|
530
530
|
setFormData: i,
|
|
@@ -540,7 +540,7 @@ function ee({
|
|
|
540
540
|
isCvvFocused: !1,
|
|
541
541
|
possibleCardType: "unknown"
|
|
542
542
|
});
|
|
543
|
-
let
|
|
543
|
+
let o = null;
|
|
544
544
|
const l = async () => {
|
|
545
545
|
try {
|
|
546
546
|
console.log("[IframeConfig] Generating iframe configuration...");
|
|
@@ -548,7 +548,7 @@ function ee({
|
|
|
548
548
|
props: {
|
|
549
549
|
payment: r
|
|
550
550
|
},
|
|
551
|
-
apiKey:
|
|
551
|
+
apiKey: n,
|
|
552
552
|
environment: a
|
|
553
553
|
});
|
|
554
554
|
m && (console.log("[IframeConfig] Iframe config generated successfully."), s.setState({
|
|
@@ -568,10 +568,10 @@ function ee({
|
|
|
568
568
|
);
|
|
569
569
|
return;
|
|
570
570
|
}
|
|
571
|
-
const b = document.getElementById("card-element"),
|
|
572
|
-
if (!b || !
|
|
571
|
+
const b = document.getElementById("card-element"), M = document.getElementById("card-cvv-element");
|
|
572
|
+
if (!b || !M)
|
|
573
573
|
throw new Error("Card elements not found in DOM");
|
|
574
|
-
console.log("[IframeConfig] Creating TokenEx.Iframe instance."),
|
|
574
|
+
console.log("[IframeConfig] Creating TokenEx.Iframe instance."), o = new globalThis.TokenEx.Iframe("card-element", {
|
|
575
575
|
...m.iframeConfig,
|
|
576
576
|
placeholder: "1234 1234 1234 1234",
|
|
577
577
|
cvvPlaceholder: "CVC",
|
|
@@ -595,36 +595,36 @@ function ee({
|
|
|
595
595
|
base: `${t.base}; border-radius: 0px 0px ${e.styles.borderRadius}px 0px`
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
}),
|
|
598
|
+
}), o.on("load", () => {
|
|
599
599
|
console.log("[IframeConfig] Iframe loaded event received."), s.setState({ loadingIframe: !1 });
|
|
600
|
-
}),
|
|
601
|
-
const { nameOnCard:
|
|
600
|
+
}), o.on("autoCompleteValues", function(y) {
|
|
601
|
+
const { nameOnCard: F, cardExp: C } = y;
|
|
602
602
|
i({
|
|
603
|
-
name:
|
|
604
|
-
cardExpiry:
|
|
603
|
+
name: F,
|
|
604
|
+
cardExpiry: C
|
|
605
605
|
});
|
|
606
|
-
}),
|
|
607
|
-
const { isValid:
|
|
606
|
+
}), o.on("validate", function(y) {
|
|
607
|
+
const { isValid: F, isCvvValid: C } = y;
|
|
608
608
|
console.log(
|
|
609
|
-
`[IframeConfig] Validation event: isCardValid=${
|
|
609
|
+
`[IframeConfig] Validation event: isCardValid=${F}, isCvvValid=${C}`
|
|
610
610
|
), s.setState({
|
|
611
|
-
isCcValid:
|
|
612
|
-
isCvvValid:
|
|
611
|
+
isCcValid: F,
|
|
612
|
+
isCvvValid: C
|
|
613
613
|
});
|
|
614
|
-
}),
|
|
614
|
+
}), o.on("focus", function() {
|
|
615
615
|
s.setState({ isFocused: !0 });
|
|
616
|
-
}),
|
|
616
|
+
}), o.on("blur", function() {
|
|
617
617
|
s.setState({ isFocused: !1 });
|
|
618
|
-
}),
|
|
618
|
+
}), o.on("cvvFocus", function() {
|
|
619
619
|
s.setState({ isCvvFocused: !0 });
|
|
620
|
-
}),
|
|
620
|
+
}), o.on("cvvBlur", function() {
|
|
621
621
|
s.setState({ isCvvFocused: !1 });
|
|
622
|
-
}),
|
|
622
|
+
}), o.on(
|
|
623
623
|
"cardTypeChange",
|
|
624
|
-
function({ possibleCardType:
|
|
625
|
-
s.setState({ possibleCardType:
|
|
624
|
+
function({ possibleCardType: y }) {
|
|
625
|
+
s.setState({ possibleCardType: y });
|
|
626
626
|
}
|
|
627
|
-
),
|
|
627
|
+
), o.load();
|
|
628
628
|
}, d = () => {
|
|
629
629
|
const m = s.getState();
|
|
630
630
|
if (console.log("[IframeConfig] initializeIframe started."), !m.iframeConfig || !e) {
|
|
@@ -643,20 +643,36 @@ function ee({
|
|
|
643
643
|
console.error("Failed to create TokenEx iframe:", b);
|
|
644
644
|
}
|
|
645
645
|
}, u = async () => {
|
|
646
|
-
|
|
647
|
-
},
|
|
648
|
-
|
|
646
|
+
n && (console.log("[IframeConfig] Manual initialization triggered."), await l());
|
|
647
|
+
}, f = () => {
|
|
648
|
+
o && (o.remove(), o = null);
|
|
649
649
|
}, g = async (m) => {
|
|
650
|
-
|
|
650
|
+
o && (o.on("tokenize", async function(b) {
|
|
651
651
|
await m(b);
|
|
652
|
-
}),
|
|
652
|
+
}), o.tokenize());
|
|
653
|
+
}, S = () => {
|
|
654
|
+
if (o)
|
|
655
|
+
try {
|
|
656
|
+
o.focus();
|
|
657
|
+
} catch (m) {
|
|
658
|
+
console.error("Failed to focus card number iframe:", m);
|
|
659
|
+
}
|
|
660
|
+
}, I = () => {
|
|
661
|
+
if (o)
|
|
662
|
+
try {
|
|
663
|
+
o.cvvFocus();
|
|
664
|
+
} catch (m) {
|
|
665
|
+
console.error("Failed to focus CVV iframe:", m);
|
|
666
|
+
}
|
|
653
667
|
};
|
|
654
668
|
return {
|
|
655
669
|
getState: s.getState.bind(s),
|
|
656
670
|
subscribe: s.subscribe.bind(s),
|
|
657
671
|
tokenize: g,
|
|
658
|
-
cleanup:
|
|
659
|
-
initialize: u
|
|
672
|
+
cleanup: f,
|
|
673
|
+
initialize: u,
|
|
674
|
+
focusCardNumber: S,
|
|
675
|
+
focusCvv: I
|
|
660
676
|
};
|
|
661
677
|
}
|
|
662
678
|
const te = "E-Mail", ie = "Name des/der Karteninhaber/in", ae = "Kartendaten", re = "Vollständiger Name", se = "MM / JJ", oe = "Das Fenster nicht schließen", ne = { pay: "ZAHLEN", submit: "ABSENDEN", getPlan: "MEINEN PLAN ERHALTEN", donate: "spenden", book: "jetzt buchen", order: "jetzt bestellen" }, le = { emailSuggestion: "Meinten Sie {{email}}?", emailInvalid: "Ihre E-Mail-Adresse ist nicht korrekt", cardExpiryInvalid: "Das Ablaufdatum Ihrer Karte liegt in der Vergangenheit", cardExpiryFormat: "Das Ablaufdatum Ihrer Karte ist unvollständig", cardSecurityFormat: "Der Sicherheitscode Ihrer Karte ist unvollständig", nameRequired: "Gib deinen Namen genau so ein, wie er auf deiner Karte steht", cardNumberInvalid: "Die Kartennummer ist unvollständig" }, ce = {
|
|
@@ -668,16 +684,16 @@ const te = "E-Mail", ie = "Name des/der Karteninhaber/in", ae = "Kartendaten", r
|
|
|
668
684
|
loading: oe,
|
|
669
685
|
buttonTexts: ne,
|
|
670
686
|
validation: le
|
|
671
|
-
}, de = "Email", he = "Cardholder name", me = "Card information", ue = "Full name on card", pe = "MM / YY",
|
|
687
|
+
}, de = "Email", he = "Cardholder name", me = "Card information", ue = "Full name on card", pe = "MM / YY", fe = "Do not close the window", ge = { pay: "PAY", submit: "SUBMIT", getPlan: "GET MY PLAN", donate: "DONATE", book: "BOOK NOW", order: "ORDER NOW" }, ye = { emailSuggestion: "Did you mean {{email}}?", emailInvalid: "Your email is not correct", cardExpiryInvalid: "Your card's expiration date is in the past", cardExpiryFormat: "Your card’s expiration date is incomplete", cardSecurityFormat: "Your card’s security code is incomplete", nameRequired: "Please enter the name as it appears on your card", cardNumberInvalid: "Your card number is invalid" }, ve = {
|
|
672
688
|
email: de,
|
|
673
689
|
cardholderNameLabel: he,
|
|
674
690
|
cardInformation: me,
|
|
675
691
|
cardholderNamePlaceholder: ue,
|
|
676
692
|
cardExpiry: pe,
|
|
677
|
-
loading:
|
|
678
|
-
buttonTexts:
|
|
693
|
+
loading: fe,
|
|
694
|
+
buttonTexts: ge,
|
|
679
695
|
validation: ye
|
|
680
|
-
}, Ee = "Correo electrónico", Ce = "Nombre del titular de la tarjeta", be = "Información de la tarjeta", xe = "Nombre completo en la tarjeta", Se = "MM / AA", Fe = "Por favor, no cierre esta ventana", we = { pay: "PAGAR", submit: "ENVIAR", getPlan: "OBTENER MI PLAN", donate: "DONAR", book: "RESERVAR AHORA", order: "ORDENAR AHORA" },
|
|
696
|
+
}, Ee = "Correo electrónico", Ce = "Nombre del titular de la tarjeta", be = "Información de la tarjeta", xe = "Nombre completo en la tarjeta", Se = "MM / AA", Fe = "Por favor, no cierre esta ventana", we = { pay: "PAGAR", submit: "ENVIAR", getPlan: "OBTENER MI PLAN", donate: "DONAR", book: "RESERVAR AHORA", order: "ORDENAR AHORA" }, Me = { emailSuggestion: "¿Quisiste decir {{email}}?", emailInvalid: "Su correo electrónico no es válido", cardExpiryInvalid: "La fecha de vencimiento de la tarjeta ya pasó", cardExpiryFormat: "La fecha de vencimiento de su tarjeta está incompleta", cardSecurityFormat: "El código de seguridad de su tarjeta está incompleto", nameRequired: "Por favor, ingrese el nombre tal como aparece en su tarjeta", cardNumberInvalid: "Su número de tarjeta no es válido" }, Le = {
|
|
681
697
|
email: Ee,
|
|
682
698
|
cardholderNameLabel: Ce,
|
|
683
699
|
cardInformation: be,
|
|
@@ -685,25 +701,25 @@ const te = "E-Mail", ie = "Name des/der Karteninhaber/in", ae = "Kartendaten", r
|
|
|
685
701
|
cardExpiry: Se,
|
|
686
702
|
loading: Fe,
|
|
687
703
|
buttonTexts: we,
|
|
688
|
-
validation:
|
|
689
|
-
},
|
|
690
|
-
email:
|
|
691
|
-
cardholderNameLabel:
|
|
704
|
+
validation: Me
|
|
705
|
+
}, Te = "E-mail", ke = "Nom du titulaire de la carte", Ie = "Informations de la carte", Ne = "Nom complet figurant sur la carte", ze = "MM / AA", Pe = "Veuillez ne pas fermer cette fenêtre", Ve = { pay: "PAYER", submit: "ENVOYER", getPlan: "OBTENIR MON PLAN", donate: "FAIRE UN DON", book: "RÉSERVER MAINTENANT", order: "COMMANDER MAINTENANT" }, Ae = { emailSuggestion: "Vouliez-vous dire {{email}}?", emailInvalid: "Votre adresse e-mail n’est pas valide", cardExpiryInvalid: "La date d'expiration de votre carte est dans le passé", cardExpiryFormat: "La date d’expiration de votre carte est incomplète", cardSecurityFormat: "Le code de sécurité de votre carte est incomplet", nameRequired: "Veuillez saisir le nom tel qu’il figure sur votre carte", cardNumberInvalid: "Votre numéro de carte est invalide" }, De = {
|
|
706
|
+
email: Te,
|
|
707
|
+
cardholderNameLabel: ke,
|
|
692
708
|
cardInformation: Ie,
|
|
693
|
-
cardholderNamePlaceholder:
|
|
694
|
-
cardExpiry:
|
|
695
|
-
loading:
|
|
696
|
-
buttonTexts:
|
|
697
|
-
validation:
|
|
698
|
-
}, $e = "Email", Re = "Nome del titolare della carta", Be = "Informazioni sulla carta",
|
|
709
|
+
cardholderNamePlaceholder: Ne,
|
|
710
|
+
cardExpiry: ze,
|
|
711
|
+
loading: Pe,
|
|
712
|
+
buttonTexts: Ve,
|
|
713
|
+
validation: Ae
|
|
714
|
+
}, $e = "Email", Re = "Nome del titolare della carta", Be = "Informazioni sulla carta", He = "Nome completo sulla carta", Oe = "MM / AA", qe = "Non chiudere la finestra", Ke = { pay: "PAGA", submit: "INVIA", getPlan: "OTTIENI IL MIO PIANO", donate: "DONARE", book: "PRENOTA ORA", order: "ORDINA ORA" }, je = { emailSuggestion: "Intendevi {{email}}?", emailInvalid: "La tua email non è corretta", cardExpiryInvalid: "La data di scadenza della tua carta è nel passato", cardExpiryFormat: "La data di scadenza della tua carta è incompleta", cardSecurityFormat: "Il codice di sicurezza della tua carta è incompleto", nameRequired: "Inserisci il nome come appare sulla tua carta", cardNumberInvalid: "Il numero della tua carta non è valido" }, Ue = {
|
|
699
715
|
email: $e,
|
|
700
716
|
cardholderNameLabel: Re,
|
|
701
717
|
cardInformation: Be,
|
|
702
|
-
cardholderNamePlaceholder:
|
|
703
|
-
cardExpiry:
|
|
704
|
-
loading:
|
|
705
|
-
buttonTexts:
|
|
706
|
-
validation:
|
|
718
|
+
cardholderNamePlaceholder: He,
|
|
719
|
+
cardExpiry: Oe,
|
|
720
|
+
loading: qe,
|
|
721
|
+
buttonTexts: Ke,
|
|
722
|
+
validation: je
|
|
707
723
|
}, _e = "Adres e-mail", Ge = "Imię i nazwisko posiadacza karty", Ye = "Informacje o karcie", Ze = "Imię i nazwisko na karcie", Je = "MM / RR", We = "Proszę nie zamykać tego okna", Xe = { pay: "ZAPŁAĆ", submit: "WYŚLIJ", getPlan: "POBIERZ MÓJ PLAN", donate: "PRZEKAŻ DAROWIZNĘ", book: "ZAREZERWUJ TERAZ", order: "ZAMÓW TERAZ" }, Qe = { emailSuggestion: "Czy chodziło Ci o {{email}}?", emailInvalid: "Państwa adres e-mail jest nieprawidłowy", cardExpiryInvalid: "Data ważności Państwa karty jest w przeszłości", cardExpiryFormat: "Data ważności Państwa karty jest niekompletna", cardSecurityFormat: "Kod zabezpieczający Państwa karty jest niekompletny", nameRequired: "Proszę wpisać imię i nazwisko tak, jak widnieje na karcie", cardNumberInvalid: "Numer Państwa karty jest nieprawidłowy" }, et = {
|
|
708
724
|
email: _e,
|
|
709
725
|
cardholderNameLabel: Ge,
|
|
@@ -722,24 +738,24 @@ const te = "E-Mail", ie = "Name des/der Karteninhaber/in", ae = "Kartendaten", r
|
|
|
722
738
|
loading: ot,
|
|
723
739
|
buttonTexts: nt,
|
|
724
740
|
validation: lt
|
|
725
|
-
}, dt = "E-posta", ht = "Kart sahibinin adı", mt = "Kart bilgileri", ut = "Kart üzerindeki tam ad", pt = "AA / YY",
|
|
741
|
+
}, dt = "E-posta", ht = "Kart sahibinin adı", mt = "Kart bilgileri", ut = "Kart üzerindeki tam ad", pt = "AA / YY", ft = "Lütfen pencereyi kapatmayın", gt = { pay: "ÖDE", submit: "GÖNDER", getPlan: "PLANIMI AL", donate: "BAĞIŞ YAP", book: "ŞİMDİ REZERVASYON YAP", order: "ŞİMDİ SİPARİŞ VER" }, yt = { emailSuggestion: "{{email}} demek mi istediniz?", emailInvalid: "E-posta adresiniz geçerli değil", cardExpiryInvalid: "Kartınızın son kullanma tarihi geçmiş", cardExpiryFormat: "Kartınızın son kullanma tarihi eksik", cardSecurityFormat: "Kartınızın güvenlik kodu eksik", nameRequired: "Lütfen kart üzerindeki ismi girin", cardNumberInvalid: "Kart numaranız geçersiz" }, vt = {
|
|
726
742
|
email: dt,
|
|
727
743
|
cardholderNameLabel: ht,
|
|
728
744
|
cardInformation: mt,
|
|
729
745
|
cardholderNamePlaceholder: ut,
|
|
730
746
|
cardExpiry: pt,
|
|
731
|
-
loading:
|
|
732
|
-
buttonTexts:
|
|
747
|
+
loading: ft,
|
|
748
|
+
buttonTexts: gt,
|
|
733
749
|
validation: yt
|
|
734
750
|
}, A = {
|
|
735
751
|
en: ve,
|
|
736
752
|
de: ce,
|
|
737
|
-
es:
|
|
738
|
-
fr:
|
|
753
|
+
es: Le,
|
|
754
|
+
fr: De,
|
|
739
755
|
pl: et,
|
|
740
756
|
pt: ct,
|
|
741
757
|
tr: vt,
|
|
742
|
-
it:
|
|
758
|
+
it: Ue
|
|
743
759
|
// Add other locales here
|
|
744
760
|
};
|
|
745
761
|
class Et {
|
|
@@ -790,10 +806,10 @@ const D = [
|
|
|
790
806
|
"it",
|
|
791
807
|
"tr"
|
|
792
808
|
], Ct = "en";
|
|
793
|
-
function bt(
|
|
809
|
+
function bt(n) {
|
|
794
810
|
const e = new Et(), i = (() => {
|
|
795
|
-
const
|
|
796
|
-
return D.includes(
|
|
811
|
+
const o = navigator?.language?.split("-")[0]?.toLowerCase();
|
|
812
|
+
return D.includes(o) ? o : Ct;
|
|
797
813
|
})();
|
|
798
814
|
e.setLocale(i);
|
|
799
815
|
const a = k({
|
|
@@ -802,58 +818,58 @@ function bt(o) {
|
|
|
802
818
|
});
|
|
803
819
|
return {
|
|
804
820
|
store: a,
|
|
805
|
-
translate: (
|
|
806
|
-
setLocale: (
|
|
807
|
-
D.includes(
|
|
821
|
+
translate: (o, l) => a.getState().translationService.translate(o, l),
|
|
822
|
+
setLocale: (o) => {
|
|
823
|
+
D.includes(o) && (a.getState().translationService.setLocale(o), a.setState({ locale: o }));
|
|
808
824
|
},
|
|
809
825
|
getLocale: () => a.getValue("locale"),
|
|
810
826
|
subscribe: a.subscribe.bind(a)
|
|
811
827
|
};
|
|
812
828
|
}
|
|
813
829
|
const xt = bt(), z = () => {
|
|
814
|
-
const { translate:
|
|
830
|
+
const { translate: n, getLocale: e, setLocale: t, subscribe: i } = xt;
|
|
815
831
|
return {
|
|
816
|
-
t:
|
|
817
|
-
translate:
|
|
832
|
+
t: n,
|
|
833
|
+
translate: n,
|
|
818
834
|
locale: e(),
|
|
819
835
|
setLocale: t,
|
|
820
836
|
subscribe: i
|
|
821
837
|
};
|
|
822
|
-
}, St = ({ fontFamily:
|
|
823
|
-
if (!
|
|
838
|
+
}, St = ({ fontFamily: n }) => {
|
|
839
|
+
if (!n)
|
|
824
840
|
return { cleanup: () => {
|
|
825
841
|
} };
|
|
826
|
-
const e =
|
|
827
|
-
(
|
|
842
|
+
const e = n.replace(/\s+/g, "+"), t = `https://fonts.googleapis.com/css2?family=${e}:wght@400;700&display=swap`, i = [...document.head.querySelectorAll("link")].filter(
|
|
843
|
+
(o) => o.href.includes("fonts.googleapis.com/css2") && o.rel === "stylesheet"
|
|
828
844
|
), a = document.createElement("link");
|
|
829
845
|
a.rel = "stylesheet", a.href = t;
|
|
830
846
|
const r = i.find(
|
|
831
|
-
(
|
|
847
|
+
(o) => o.href.includes(`family=${e}`)
|
|
832
848
|
);
|
|
833
849
|
if (r)
|
|
834
850
|
r.href = t;
|
|
835
851
|
else if (i.length > 0) {
|
|
836
|
-
const
|
|
852
|
+
const o = i.at(
|
|
837
853
|
-1
|
|
838
854
|
);
|
|
839
|
-
|
|
855
|
+
o?.nextSibling ? document.head.insertBefore(a, o.nextSibling) : document.head.appendChild(a);
|
|
840
856
|
} else
|
|
841
857
|
document.head.appendChild(a);
|
|
842
858
|
return { cleanup: () => {
|
|
843
859
|
document.head.contains(a) && document.head.removeChild(a);
|
|
844
860
|
} };
|
|
845
861
|
}, Ft = ({
|
|
846
|
-
scriptSrc:
|
|
862
|
+
scriptSrc: n,
|
|
847
863
|
async: e = !0
|
|
848
864
|
}) => {
|
|
849
|
-
if (!
|
|
865
|
+
if (!n)
|
|
850
866
|
return {
|
|
851
867
|
cleanup: () => {
|
|
852
868
|
},
|
|
853
869
|
isLoaded: Promise.resolve(!1)
|
|
854
870
|
};
|
|
855
871
|
if ([...document.head.querySelectorAll("script")].filter(
|
|
856
|
-
(s) => s.src ===
|
|
872
|
+
(s) => s.src === n
|
|
857
873
|
).length > 0)
|
|
858
874
|
return {
|
|
859
875
|
cleanup: () => {
|
|
@@ -861,10 +877,10 @@ const xt = bt(), z = () => {
|
|
|
861
877
|
isLoaded: Promise.resolve(!0)
|
|
862
878
|
};
|
|
863
879
|
const i = document.createElement("script");
|
|
864
|
-
i.src =
|
|
865
|
-
const a = new Promise((s,
|
|
880
|
+
i.src = n, i.async = e;
|
|
881
|
+
const a = new Promise((s, o) => {
|
|
866
882
|
i.onload = () => s(!0), i.onerror = () => {
|
|
867
|
-
console.error(`Failed to load script: ${
|
|
883
|
+
console.error(`Failed to load script: ${n}`), o(new Error(`Failed to load script: ${n}`));
|
|
868
884
|
};
|
|
869
885
|
});
|
|
870
886
|
return document.head.appendChild(i), {
|
|
@@ -873,12 +889,118 @@ const xt = bt(), z = () => {
|
|
|
873
889
|
},
|
|
874
890
|
isLoaded: a
|
|
875
891
|
};
|
|
876
|
-
}
|
|
892
|
+
};
|
|
893
|
+
class wt {
|
|
894
|
+
// The sequence of fields to focus in order
|
|
895
|
+
focusSequence = [
|
|
896
|
+
"email",
|
|
897
|
+
"cardNumber",
|
|
898
|
+
"cardExpiry",
|
|
899
|
+
"cardCvv",
|
|
900
|
+
"name"
|
|
901
|
+
];
|
|
902
|
+
// Track the current focus index
|
|
903
|
+
currentFocusIndex = 0;
|
|
904
|
+
// Map of field names to their focus functions
|
|
905
|
+
fields = {
|
|
906
|
+
email: null,
|
|
907
|
+
cardNumber: null,
|
|
908
|
+
cardExpiry: null,
|
|
909
|
+
cardCvv: null,
|
|
910
|
+
name: null
|
|
911
|
+
};
|
|
912
|
+
// Track the validation state of each field
|
|
913
|
+
fieldValidState = {
|
|
914
|
+
email: !1,
|
|
915
|
+
cardNumber: !1,
|
|
916
|
+
cardExpiry: !1,
|
|
917
|
+
cardCvv: !1,
|
|
918
|
+
name: !1
|
|
919
|
+
};
|
|
920
|
+
// Track if field was previously valid (to detect transitions)
|
|
921
|
+
previousFieldValidState = {
|
|
922
|
+
email: !1,
|
|
923
|
+
cardNumber: !1,
|
|
924
|
+
cardExpiry: !1,
|
|
925
|
+
cardCvv: !1,
|
|
926
|
+
name: !1
|
|
927
|
+
};
|
|
928
|
+
/**
|
|
929
|
+
* Register a field with the focus manager
|
|
930
|
+
*/
|
|
931
|
+
registerField(e, t) {
|
|
932
|
+
this.fields[e] = t;
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* Handle field focus events
|
|
936
|
+
*/
|
|
937
|
+
handleFieldFocus(e) {
|
|
938
|
+
const t = this.focusSequence.findIndex(
|
|
939
|
+
(i) => i === e
|
|
940
|
+
);
|
|
941
|
+
t >= 0 && (this.currentFocusIndex = t);
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* Update the validation state of fields based on form and iframe state
|
|
945
|
+
*/
|
|
946
|
+
handleStateUpdate(e, t, i, a) {
|
|
947
|
+
Object.assign(this.previousFieldValidState, this.fieldValidState);
|
|
948
|
+
const r = !!e.email && !t.email && !!i.email;
|
|
949
|
+
this.fieldValidState.email = r;
|
|
950
|
+
const s = !!a.isCcValid;
|
|
951
|
+
this.fieldValidState.cardNumber = s;
|
|
952
|
+
const o = !!e.cardExpiry && !t.cardExpiry && !!i.cardExpiry;
|
|
953
|
+
this.fieldValidState.cardExpiry = o;
|
|
954
|
+
const l = !!a.isCvvValid;
|
|
955
|
+
this.fieldValidState.cardCvv = l;
|
|
956
|
+
const c = !!e.name && !t.name && !!i.name;
|
|
957
|
+
this.fieldValidState.name = c, this.checkForValidTransitions();
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* Check if any fields have transitioned from invalid to valid and progress focus if needed
|
|
961
|
+
*/
|
|
962
|
+
checkForValidTransitions() {
|
|
963
|
+
const e = this.focusSequence[this.currentFocusIndex];
|
|
964
|
+
e && this.fieldValidState[e] && !this.previousFieldValidState[e] && this.focusNextField();
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* Focus the next field in sequence
|
|
968
|
+
*/
|
|
969
|
+
focusNextField() {
|
|
970
|
+
this.currentFocusIndex = Math.min(
|
|
971
|
+
this.currentFocusIndex + 1,
|
|
972
|
+
this.focusSequence.length - 1
|
|
973
|
+
), this.applyFocusToCurrentField();
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* Focus a specific field by its index in the sequence
|
|
977
|
+
*/
|
|
978
|
+
focusFieldByIndex(e) {
|
|
979
|
+
e >= 0 && e < this.focusSequence.length && (this.currentFocusIndex = e, this.applyFocusToCurrentField());
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Apply focus to the current field based on focus index
|
|
983
|
+
*/
|
|
984
|
+
applyFocusToCurrentField() {
|
|
985
|
+
const e = this.focusSequence[this.currentFocusIndex], t = this.fields[e];
|
|
986
|
+
t && setTimeout(() => {
|
|
987
|
+
t.focus();
|
|
988
|
+
}, 0);
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* Focus the email field (first field)
|
|
992
|
+
* Used for setting initial focus on page load
|
|
993
|
+
*/
|
|
994
|
+
focusEmailField() {
|
|
995
|
+
this.currentFocusIndex = 0, this.applyFocusToCurrentField();
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
const T = (n) => Object.entries(n).map(([e, t]) => {
|
|
877
999
|
const i = e.replace(/([A-Z])/g, "-$1").toLowerCase(), a = typeof t == "number" ? `${t}px` : t;
|
|
878
1000
|
return `${i}: ${a}`;
|
|
879
1001
|
}).join("; ");
|
|
880
|
-
function
|
|
881
|
-
if (!
|
|
1002
|
+
function Mt(n) {
|
|
1003
|
+
if (!n)
|
|
882
1004
|
return {
|
|
883
1005
|
formContainerStyle: {},
|
|
884
1006
|
baseStyles: {},
|
|
@@ -898,28 +1020,28 @@ function wt(o) {
|
|
|
898
1020
|
display: "block",
|
|
899
1021
|
border: "none",
|
|
900
1022
|
outline: "none",
|
|
901
|
-
fontSize: `${
|
|
1023
|
+
fontSize: `${n.styles.fontSize}px`,
|
|
902
1024
|
lineHeight: 30,
|
|
903
1025
|
boxSizing: "border-box",
|
|
904
1026
|
padding: "0px 12px",
|
|
905
1027
|
height: 36,
|
|
906
1028
|
width: "100%",
|
|
907
|
-
fontFamily: `${
|
|
1029
|
+
fontFamily: `${n.styles.fontFamily}, sans-serif`
|
|
908
1030
|
}, t = {
|
|
909
1031
|
color: "#717173",
|
|
910
1032
|
opacity: "0.3",
|
|
911
|
-
fontFamily: `${
|
|
1033
|
+
fontFamily: `${n.styles.fontFamily}, sans-serif`
|
|
912
1034
|
}, i = {
|
|
913
1035
|
color: "#dc2727"
|
|
914
1036
|
}, a = {
|
|
915
1037
|
outline: "none"
|
|
916
1038
|
}, r = {
|
|
917
|
-
fontFamily: `${
|
|
1039
|
+
fontFamily: `${n.styles.fontFamily}, sans-serif`
|
|
918
1040
|
}, s = {
|
|
919
|
-
base:
|
|
920
|
-
error:
|
|
921
|
-
focus:
|
|
922
|
-
placeholder:
|
|
1041
|
+
base: T(e),
|
|
1042
|
+
error: T(i),
|
|
1043
|
+
focus: T(a),
|
|
1044
|
+
placeholder: T(t)
|
|
923
1045
|
};
|
|
924
1046
|
return {
|
|
925
1047
|
formContainerStyle: r,
|
|
@@ -1027,7 +1149,7 @@ class h {
|
|
|
1027
1149
|
}), this.eventListeners = [], this.children.forEach((e) => e.destroy()), this.children = [], this.element.parentNode && this.element.parentNode.removeChild(this.element);
|
|
1028
1150
|
}
|
|
1029
1151
|
}
|
|
1030
|
-
class
|
|
1152
|
+
class w {
|
|
1031
1153
|
/**
|
|
1032
1154
|
* Create a div element
|
|
1033
1155
|
*/
|
|
@@ -1100,14 +1222,14 @@ class Lt extends h {
|
|
|
1100
1222
|
messageComponent;
|
|
1101
1223
|
constructor(e) {
|
|
1102
1224
|
super("div", []);
|
|
1103
|
-
const t =
|
|
1225
|
+
const t = w.createDiv(["error-alert"], {
|
|
1104
1226
|
role: "alert",
|
|
1105
1227
|
"aria-live": "polite"
|
|
1106
|
-
}), i =
|
|
1228
|
+
}), i = w.createDiv(["error-alert-content"]), a = w.createDiv([
|
|
1107
1229
|
"error-alert-icon-container"
|
|
1108
1230
|
]);
|
|
1109
1231
|
a.getElement().innerHTML = this.createAlertCircleSVG();
|
|
1110
|
-
const r =
|
|
1232
|
+
const r = w.createDiv([
|
|
1111
1233
|
"error-alert-text-container"
|
|
1112
1234
|
]), s = new h("h4", [
|
|
1113
1235
|
"error-alert-title"
|
|
@@ -1139,11 +1261,11 @@ class Lt extends h {
|
|
|
1139
1261
|
return this.messageComponent.setText(e), this;
|
|
1140
1262
|
}
|
|
1141
1263
|
}
|
|
1142
|
-
class
|
|
1264
|
+
class $ extends h {
|
|
1143
1265
|
titleElement;
|
|
1144
1266
|
constructor(e = {}) {
|
|
1145
1267
|
super("div", ["blur-bg"]);
|
|
1146
|
-
const t =
|
|
1268
|
+
const t = w.createDiv(["loader"]);
|
|
1147
1269
|
this.titleElement = new h("h3", ["title"]), this.titleElement.setText(e.text || ""), this.appendChild(t), this.appendChild(this.titleElement);
|
|
1148
1270
|
}
|
|
1149
1271
|
setText(e) {
|
|
@@ -1168,7 +1290,7 @@ class E extends h {
|
|
|
1168
1290
|
return this.span && this.span.classList.add("form-helper-text-hidden"), this;
|
|
1169
1291
|
}
|
|
1170
1292
|
}
|
|
1171
|
-
class
|
|
1293
|
+
class Tt extends h {
|
|
1172
1294
|
constructor(e) {
|
|
1173
1295
|
super("label", ["input-label"], {
|
|
1174
1296
|
for: e.id
|
|
@@ -1182,7 +1304,7 @@ class P extends h {
|
|
|
1182
1304
|
helperText = null;
|
|
1183
1305
|
constructor(e) {
|
|
1184
1306
|
if (super("div", ["input-wrapper"]), e.label && e.styles) {
|
|
1185
|
-
const i = new
|
|
1307
|
+
const i = new Tt({
|
|
1186
1308
|
styles: {
|
|
1187
1309
|
color: e.styles.color,
|
|
1188
1310
|
fontSize: e.styles.fontSize
|
|
@@ -1197,7 +1319,7 @@ class P extends h {
|
|
|
1197
1319
|
name: e.name,
|
|
1198
1320
|
class: `form-input ${e.error ? "form-input-error" : ""}`
|
|
1199
1321
|
};
|
|
1200
|
-
if (e.placeholder && (t.placeholder = e.placeholder), e.value && (t.value = e.value), e.required && (t.required = String(e.required)), e.disabled && (t.disabled = String(e.disabled)), e.autocomplete && (t.autocomplete = e.autocomplete), this.inputElement =
|
|
1322
|
+
if (e.placeholder && (t.placeholder = e.placeholder), e.value && (t.value = e.value), e.required && (t.required = String(e.required)), e.disabled && (t.disabled = String(e.disabled)), e.autocomplete && (t.autocomplete = e.autocomplete), this.inputElement = w.createInput(
|
|
1201
1323
|
e.type || "text",
|
|
1202
1324
|
[],
|
|
1203
1325
|
t
|
|
@@ -1223,6 +1345,12 @@ class P extends h {
|
|
|
1223
1345
|
addEventListener(e, t, i) {
|
|
1224
1346
|
return this.inputElement.getElement().addEventListener(e, t, i), this;
|
|
1225
1347
|
}
|
|
1348
|
+
/**
|
|
1349
|
+
* Focus the input element
|
|
1350
|
+
*/
|
|
1351
|
+
focus() {
|
|
1352
|
+
this.inputElement.getElement().focus();
|
|
1353
|
+
}
|
|
1226
1354
|
}
|
|
1227
1355
|
class kt {
|
|
1228
1356
|
input;
|
|
@@ -1233,29 +1361,30 @@ class kt {
|
|
|
1233
1361
|
onBlur: a,
|
|
1234
1362
|
error: r,
|
|
1235
1363
|
errorMsg: s,
|
|
1236
|
-
checkoutProfile:
|
|
1364
|
+
checkoutProfile: o,
|
|
1237
1365
|
translationFunc: l,
|
|
1238
1366
|
autocomplete: c = "cc-name"
|
|
1239
1367
|
} = e;
|
|
1240
1368
|
this.input = new P({
|
|
1241
1369
|
name: "name",
|
|
1242
1370
|
label: l("cardholderNameLabel"),
|
|
1243
|
-
error
|
|
1371
|
+
// Always hide error initially - we'll show it only on blur if needed
|
|
1372
|
+
error: !1,
|
|
1244
1373
|
errorMsg: s,
|
|
1245
1374
|
styles: {
|
|
1246
|
-
color:
|
|
1247
|
-
borderRadius: `${
|
|
1248
|
-
fontSize:
|
|
1249
|
-
fontFamily:
|
|
1375
|
+
color: o.styles.textColor,
|
|
1376
|
+
borderRadius: `${o.styles.borderRadius}px`,
|
|
1377
|
+
fontSize: o.styles.fontSize,
|
|
1378
|
+
fontFamily: o.styles.fontFamily
|
|
1250
1379
|
},
|
|
1251
1380
|
placeholder: l("cardholderNamePlaceholder"),
|
|
1252
1381
|
value: t,
|
|
1253
1382
|
autocomplete: c,
|
|
1254
1383
|
onChange: (d) => {
|
|
1255
|
-
this.trim(), i(d);
|
|
1384
|
+
this.input.setError(!1), this.trim(), i(d);
|
|
1256
1385
|
}
|
|
1257
1386
|
}), this.input.addEventListener("blur", (d) => {
|
|
1258
|
-
a(d);
|
|
1387
|
+
r && this.input.setError(r, s), a(d);
|
|
1259
1388
|
});
|
|
1260
1389
|
}
|
|
1261
1390
|
getValue() {
|
|
@@ -1269,7 +1398,7 @@ class kt {
|
|
|
1269
1398
|
return this.setValue(e), this;
|
|
1270
1399
|
}
|
|
1271
1400
|
setError(e, t) {
|
|
1272
|
-
return this.input.setError(e, t), this;
|
|
1401
|
+
return document.activeElement !== this.input.getElement().querySelector("input") ? this.input.setError(e, t) : this.input.setError(!1), this;
|
|
1273
1402
|
}
|
|
1274
1403
|
getElement() {
|
|
1275
1404
|
return this.input.getElement();
|
|
@@ -1277,8 +1406,11 @@ class kt {
|
|
|
1277
1406
|
appendTo(e) {
|
|
1278
1407
|
return this.input.appendTo(e), this;
|
|
1279
1408
|
}
|
|
1409
|
+
focus() {
|
|
1410
|
+
this.input.focus();
|
|
1411
|
+
}
|
|
1280
1412
|
}
|
|
1281
|
-
class
|
|
1413
|
+
class It extends h {
|
|
1282
1414
|
constructor(e) {
|
|
1283
1415
|
super("div", []);
|
|
1284
1416
|
const t = document.createElement("div");
|
|
@@ -1295,10 +1427,10 @@ class Tt extends h {
|
|
|
1295
1427
|
return t && (e ? t.classList.add("loading") : t.classList.remove("loading")), this;
|
|
1296
1428
|
}
|
|
1297
1429
|
}
|
|
1298
|
-
const It = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%23306FC5;'%20d='M512,402.281c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.997,0,402.281V109.717%20c0-16.715,13.55-30.266,30.265-30.266h451.47c16.716,0,30.265,13.551,30.265,30.266V402.281L512,402.281z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.281V109.717%20c0-16.715,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.001,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.997,21.517,402.281z'/%3e%3cg%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='74.59,220.748%2089.888,220.748%2082.241,201.278%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='155.946,286.107%20155.946,295.148%20181.675,295.148%20181.675,304.885%20155.946,304.885%20155.946,315.318%20184.455,315.318%20197.666,300.712%20185.151,286.107%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='356.898,201.278%20348.553,220.748%20364.548,220.748%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='230.348,320.875%20230.348,281.241%20212.268,300.712%20'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M264.42,292.368c-0.696-4.172-3.48-6.261-7.654-6.261h-14.599v12.516h15.299%20C261.637,298.624,264.42,296.539,264.42,292.368z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M313.09,297.236c1.391-0.697,2.089-2.785,2.089-4.867c0.696-2.779-0.698-4.172-2.089-4.868%20c-1.387-0.696-3.476-0.696-5.559-0.696h-13.91v11.127h13.909C309.613,297.932,311.702,297.932,313.09,297.236z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M413.217,183.198v8.344l-4.169-8.344H376.37v8.344l-4.174-8.344h-44.502%20c-7.648,0-13.909,1.392-19.469,4.173v-4.173h-31.289v0.696v3.477c-3.476-2.78-7.648-4.173-13.211-4.173h-111.95l-7.652,17.384%20l-7.647-17.384h-25.031h-10.431v8.344l-3.477-8.344h-0.696H66.942l-13.909,32.68L37.042,251.34l-0.294,0.697h0.294h35.463h0.444%20l0.252-0.697l4.174-10.428h9.039l4.172,11.125h40.326v-0.697v-7.647l3.479,8.343h20.163l3.475-8.343v7.647v0.697h15.993h79.965%20h0.696v-18.08h1.394c1.389,0,1.389,0,1.389,2.087v15.297h50.065v-4.172c4.172,2.089,10.426,4.172,18.771,4.172h20.863l4.172-11.123%20h9.732l4.172,11.123h40.328v-6.952v-3.476l6.261,10.428h1.387h0.698h30.595v-68.143h-31.291l0,0H413.217z%20M177.501,241.609h-6.955%20h-4.171v-4.169v-34.076l-0.696,1.595v-0.019l-16.176,36.669h-0.512h-3.719h-6.017l-16.687-38.245v38.245h-23.64l-4.867-10.43%20H70.417l-4.868,10.43H53.326l20.57-48.675h17.382l19.469,46.587v-46.587h4.171h14.251l0.328,0.697h0.024l8.773,19.094l6.3,14.306%20l0.223-0.721l13.906-33.375H177.5v48.674H177.501L177.501,241.609z%20M225.481,203.364h-27.119v9.039h26.423v9.734h-26.423v9.738%20h27.119v10.427h-38.939v-49.367h38.939V203.364L225.481,203.364z%20M275.076,221.294c0.018,0.016,0.041,0.027,0.063,0.042%20c0.263,0.278,0.488,0.557,0.68,0.824c1.332,1.746,2.409,4.343,2.463,8.151c0.004,0.066,0.007,0.131,0.011,0.197%20c0,0.038,0.007,0.071,0.007,0.11c0,0.022-0.002,0.039-0.002,0.06c0.016,0.383,0.026,0.774,0.026,1.197v9.735h-10.428v-5.565%20c0-2.781,0-6.954-2.089-9.735c-0.657-0.657-1.322-1.09-2.046-1.398c-1.042-0.675-3.017-0.686-6.295-0.686h-12.52v17.384h-11.818%20v-48.675h26.425c6.254,0,10.428,0,13.906,2.086c3.407,2.046,5.465,5.439,5.543,10.812c-0.161,7.4-4.911,11.46-8.326,12.829%20C270.676,218.662,272.996,219.129,275.076,221.294z%20M298.491,241.609h-11.822v-48.675h11.822V241.609z%20M434.083,241.609h-15.3%20l-22.25-36.855v30.595l-0.073-0.072v6.362h-11.747v-0.029h-11.822l-4.172-10.43H344.38l-4.172,11.123h-13.211%20c-5.559,0-12.517-1.389-16.687-5.561c-4.172-4.172-6.256-9.735-6.256-18.773c0-6.953,1.389-13.911,6.256-19.472%20c3.474-4.175,9.735-5.562,17.382-5.562h11.128v10.429h-11.128c-4.172,0-6.254,0.693-9.041,2.783%20c-2.082,2.085-3.474,6.256-3.474,11.123c0,5.564,0.696,9.04,3.474,11.821c2.091,2.089,4.87,2.785,8.346,2.785h4.867l15.991-38.243%20h6.957h10.428l19.472,46.587v-2.376v-15.705v-1.389v-27.116h17.382l20.161,34.07v-34.07h11.826v47.977h0.002L434.083,241.609%20L434.083,241.609z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M265.161,213.207c0.203-0.217,0.387-0.463,0.543-0.745c0.63-0.997,1.352-2.793,0.963-5.244%20c-0.016-0.225-0.057-0.433-0.105-0.634c-0.013-0.056-0.011-0.105-0.026-0.161l-0.007,0.001c-0.346-1.191-1.229-1.923-2.11-2.367%20c-1.394-0.693-3.48-0.693-5.565-0.693h-13.909v11.127h13.909c2.085,0,4.172,0,5.565-0.697c0.209-0.106,0.395-0.25,0.574-0.413%20l0.002,0.009C264.996,213.389,265.067,213.315,265.161,213.207z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M475.105,311.144c0-4.867-1.389-9.736-3.474-13.212v-31.289h-0.032v-2.089c0,0-29.145,0-33.483,0%20c-4.336,0-9.598,4.171-9.598,4.171v-4.171h-31.984c-4.87,0-11.124,1.392-13.909,4.171v-4.171h-57.016v2.089v2.081%20c-4.169-3.474-11.824-4.171-15.298-4.171h-37.549v2.089v2.081c-3.476-3.474-11.824-4.171-15.998-4.171H215.05l-9.737,10.431%20l-9.04-10.431h-2.911h-4.737h-54.93v2.089v5.493v62.651h61.19l10.054-10.057l8.715,10.057h0.698h35.258h1.598h0.696h0.692v-6.953%20v-9.039h3.479c4.863,0,11.124,0,15.991-2.089v17.382v1.394h31.291v-1.394V317.4h1.387c2.089,0,2.089,0,2.089,2.086v14.6v1.394%20h94.563c6.263,0,12.517-1.394,15.993-4.175v2.781v1.394h29.902c6.254,0,12.517-0.695,16.689-3.478%20c6.402-3.841,10.437-10.64,11.037-18.749c0.028-0.24,0.063-0.48,0.085-0.721l-0.041-0.039%20C475.087,312.043,475.105,311.598,475.105,311.144z%20M256.076,306.973h-13.91v2.081v4.174v4.173v7.649h-22.855l-13.302-15.299%20l-0.046,0.051l-0.65-0.748l-15.297,15.996h-44.501v-48.673h45.197l12.348,13.525l2.596,2.832l0.352-0.365l14.604-15.991h36.852%20c7.152,0,15.161,1.765,18.196,9.042c0.365,1.441,0.577,3.043,0.577,4.863C276.237,304.189,266.502,306.973,256.076,306.973z%20M325.609,306.276c1.389,2.081,2.085,4.867,2.085,9.041v9.732h-11.819v-6.256c0-2.786,0-7.65-2.089-9.739%20c-1.387-2.081-4.172-2.081-8.341-2.081H292.93v18.077h-11.82v-49.369h26.421c5.559,0,10.426,0,13.909,2.084%20c3.474,2.088,6.254,5.565,6.254,11.128c0,7.647-4.865,11.819-8.343,13.212C322.829,303.49,324.914,304.885,325.609,306.276z%20M373.589,286.107h-27.122v9.04h26.424v9.737h-26.424v9.736h27.122v10.429H334.65V275.68h38.939V286.107z%20M402.791,325.05h-22.252%20v-10.429h22.252c2.082,0,3.476,0,4.87-1.392c0.696-0.697,1.387-2.085,1.387-3.477c0-1.394-0.691-2.778-1.387-3.475%20c-0.698-0.695-2.091-1.391-4.176-1.391c-11.126-0.696-24.337,0-24.337-15.296c0-6.954,4.172-14.604,16.689-14.604h22.945v11.819%20h-21.554c-2.085,0-3.478,0-4.87,0.696c-1.387,0.697-1.387,2.089-1.387,3.478c0,2.087,1.387,2.783,2.778,3.473%20c1.394,0.697,2.783,0.697,4.172,0.697h6.259c6.259,0,10.43,1.391,13.211,4.173c2.087,2.087,3.478,5.564,3.478,10.43%20C420.869,320.179,414.611,325.05,402.791,325.05z%20M462.59,320.179c-2.778,2.785-7.648,4.871-14.604,4.871H425.74v-10.429h22.245%20c2.087,0,3.481,0,4.87-1.392c0.693-0.697,1.391-2.085,1.391-3.477c0-1.394-0.698-2.778-1.391-3.475%20c-0.696-0.695-2.085-1.391-4.172-1.391c-11.122-0.696-24.337,0-24.337-15.295c0-6.609,3.781-12.579,13.106-14.352%20c1.115-0.154,2.293-0.253,3.583-0.253h22.948v11.819h-15.3h-5.561h-0.696c-2.087,0-3.476,0-4.865,0.696%20c-0.7,0.697-1.396,2.089-1.396,3.478c0,2.087,0.696,2.783,2.785,3.473c1.389,0.697,2.78,0.697,4.172,0.697h0.691h5.565%20c3.039,0,5.337,0.375,7.44,1.114c1.926,0.697,8.302,3.549,9.728,10.994c0.124,0.78,0.215,1.594,0.215,2.495%20C466.761,313.925,465.37,317.401,462.59,320.179z'/%3e%3c/g%3e%3c/svg%3e", zt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%2334495E;'%20d='M512,402.282c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.996,0,402.282V109.717%20c0-16.716,13.55-30.266,30.265-30.266h451.469c16.716,0,30.265,13.551,30.265,30.266L512,402.282L512,402.282z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.282V109.717%20c0-16.716,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.003,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.996,21.517,402.282z'/%3e%3cpath%20style='fill:%23F26E21;'%20d='M309.389,255.801c0.041-9.636-3.572-19.286-10.843-26.558c-7.287-7.287-16.961-10.897-26.617-10.839%20c-0.046,0-0.091-0.003-0.139-0.003c-20.968,0-37.6,16.628-37.6,37.602c0,20.767,16.837,37.599,37.6,37.599%20c20.974,0,37.604-16.631,37.604-37.599C309.394,255.934,309.389,255.869,309.389,255.801z'/%3e%3cg%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M227.198,271.909c-5.62,5.626-10.807,7.824-16.394,7.943c-13.611-0.122-23.618-10.202-23.618-24.573%20c0-7.234,2.739-13.163,7.078-18.228l0,0c4.069-3.863,9.311-6.359,15.339-6.359c6.507,0,11.571,2.169,17.352,7.954v-16.631%20c-5.78-2.891-10.846-4.338-17.352-4.338c-9.192,0.657-17.859,4.371-24.507,10.203l0,0c-1.916,1.724-3.752,3.627-5.309,5.805%20c-4.856,6.294-7.791,14.001-7.791,22.32c0,20.967,16.637,36.875,37.606,36.875c0.102,0,0.203-0.009,0.302-0.01%20c0.141,0.002,0.28,0.01,0.42,0.01c5.784,0,10.85-1.443,17.357-4.336L227.198,271.909c-0.244,0.244,0.242,0.471,0,0.702V271.909z'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='356.863,228.033%20356.863,228.033%20340.487,268.295%20321.685,220.566%20306.502,220.566%20336.148,293.601%20344.102,293.601%20375.196,220.566%20360.013,220.566%20'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='380.983,252.384%20380.983,291.435%20420.033,291.435%20420.753,291.435%20420.753,279.861%20408.461,279.861%20395.445,279.861%20395.445,266.848%20395.445,260.342%20420.033,260.342%20420.033,248.045%20395.445,248.045%20395.445,232.861%20420.753,232.861%20420.753,220.566%20380.983,220.566%20'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M54.135,220.566H33.884v70.869h20.25c10.845,0,18.798-2.895,25.306-7.957%20c7.953-6.508,13.017-16.629,13.017-27.474C92.458,235.028,77.27,220.566,54.135,220.566z%20M70.765,274.08%20c-4.339,3.614-10.124,5.781-18.802,5.781h-4.339V232.86h3.615c8.678,0,14.463,1.446,18.803,5.783%20c5.061,4.336,7.955,10.848,7.955,17.358C78.72,262.509,75.828,269.737,70.765,274.08z'/%3e%3crect%20x='98.97'%20y='220.56'%20style='fill:%23E7E8E3;'%20width='13.739'%20height='70.867'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M147.415,248.045c-8.676-2.892-10.848-5.063-10.848-8.677c0-4.339,4.339-7.954,10.124-7.954%20c4.339,0,7.954,1.447,11.57,5.786l7.233-9.4c-5.787-5.064-13.015-7.953-20.97-7.953c-12.296,0-22.42,8.678-22.42,20.244%20c0,10.126,4.343,14.464,17.357,19.526c5.785,2.166,7.955,2.892,9.404,4.338c2.887,1.444,4.336,4.339,4.336,7.228%20c0,5.786-4.336,10.126-10.848,10.126c-6.514,0-12.294-3.615-15.187-9.401l-8.678,8.678c6.511,9.4,14.465,13.738,24.589,13.738%20c14.461,0,24.58-9.4,24.58-23.141C167.659,258.893,163.324,253.831,147.415,248.045z'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M459.804,261.783c10.843-2.166,16.63-9.4,16.63-20.244c0-13.014-9.402-20.973-25.308-20.973h-20.972%20v70.869h13.739V263.23h2.172l19.519,28.205h16.634L459.804,261.783z%20M448.23,253.105h-4.336v-21.691h4.336%20c8.678,0,13.742,3.614,13.742,10.85C461.972,249.492,456.909,253.105,448.23,253.105z'/%3e%3c/g%3e%3c/svg%3e", Pt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20291.791%20291.791'%20xml:space='preserve'%3e%3cg%3e%3cpath%20style='fill:%23E2574C;'%20d='M182.298,145.895c0,50.366-40.801,91.176-91.149,91.176S0,196.252,0,145.895%20s40.811-91.176,91.149-91.176S182.298,95.538,182.298,145.895z'/%3e%3cpath%20style='fill:%23F4B459;'%20d='M200.616,54.719c-20.442,0-39.261,6.811-54.469,18.181l0.073,0.009%20c2.991,2.89,6.291,4.924,8.835,8.251l-18.965,0.301c-2.972,3-5.68,6.264-8.233,9.656H161.3c2.544,3.054,4.896,5.708,7.03,9.081%20h-46.536c-1.705,2.936-3.282,5.954-4.659,9.09h56.493c1.477,3.127,2.799,5.489,3.921,8.799h-63.76%20c-1.012,3.146-1.878,6.364-2.535,9.646h68.966c0.675,3.155,1.194,6.072,1.55,9.045h-71.884c-0.301,3-0.456,6.045-0.456,9.118%20h72.859c0,3.228-0.228,6.218-0.556,9.118h-71.847c0.31,3.091,0.766,6.127,1.368,9.118h68.856c-0.711,2.954-1.532,5.926-2.562,9.008%20h-63.969c0.966,3.118,2.143,6.145,3.428,9.099h56.621c-1.568,3.319-3.346,5.972-5.306,9.081h-46.691%20c1.842,3.191,3.875,6.236,6.081,9.154l33.589,0.501c-2.863,3.437-6.537,5.507-9.884,8.516c0.182,0.146-5.352-0.018-16.248-0.191%20c16.576,17.105,39.744,27.772,65.446,27.772c50.357,0,91.176-40.82,91.176-91.176S250.981,54.719,200.616,54.719z'/%3e%3c/g%3e%3c/svg%3e", Nt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%20-140%20780%20780'%20enable-background='new%200%200%20780%20500'%20version='1.1'%20xml:space='preserve'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M40,0h700c22.092,0,40,17.909,40,40v420c0,22.092-17.908,40-40,40H40c-22.091,0-40-17.908-40-40V40%20C0,17.909,17.909,0,40,0z'%20fill='%230E4595'/%3e%3cpath%20d='m293.2%20348.73l33.361-195.76h53.36l-33.385%20195.76h-53.336zm246.11-191.54c-10.57-3.966-27.137-8.222-47.822-8.222-52.725%200-89.865%2026.55-90.18%2064.603-0.299%2028.13%2026.514%2043.822%2046.752%2053.186%2020.771%209.595%2027.752%2015.714%2027.654%2024.283-0.131%2013.121-16.586%2019.116-31.922%2019.116-21.357%200-32.703-2.967-50.227-10.276l-6.876-3.11-7.489%2043.823c12.463%205.464%2035.51%2010.198%2059.438%2010.443%2056.09%200%2092.5-26.246%2092.916-66.882%200.199-22.269-14.016-39.216-44.801-53.188-18.65-9.055-30.072-15.099-29.951-24.268%200-8.137%209.668-16.839%2030.557-16.839%2017.449-0.27%2030.09%203.535%2039.938%207.5l4.781%202.26%207.232-42.429m137.31-4.223h-41.232c-12.773%200-22.332%203.487-27.941%2016.234l-79.244%20179.4h56.031s9.16-24.123%2011.232-29.418c6.125%200%2060.555%200.084%2068.338%200.084%201.596%206.853%206.49%2029.334%206.49%2029.334h49.514l-43.188-195.64zm-65.418%20126.41c4.412-11.279%2021.26-54.723%2021.26-54.723-0.316%200.522%204.379-11.334%207.074-18.684l3.605%2016.879s10.219%2046.729%2012.354%2056.528h-44.293zm-363.3-126.41l-52.24%20133.5-5.567-27.13c-9.725-31.273-40.025-65.155-73.898-82.118l47.766%20171.2%2056.456-0.064%2084.004-195.39h-56.521'%20fill='%23ffffff'/%3e%3cpath%20d='m146.92%20152.96h-86.041l-0.681%204.073c66.938%2016.204%20111.23%2055.363%20129.62%20102.41l-18.71-89.96c-3.23-12.395-12.597-16.094-24.186-16.527'%20fill='%23F2AE14'/%3e%3c/svg%3e", w = [
|
|
1430
|
+
const Nt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%23306FC5;'%20d='M512,402.281c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.997,0,402.281V109.717%20c0-16.715,13.55-30.266,30.265-30.266h451.47c16.716,0,30.265,13.551,30.265,30.266V402.281L512,402.281z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.281V109.717%20c0-16.715,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.001,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.997,21.517,402.281z'/%3e%3cg%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='74.59,220.748%2089.888,220.748%2082.241,201.278%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='155.946,286.107%20155.946,295.148%20181.675,295.148%20181.675,304.885%20155.946,304.885%20155.946,315.318%20184.455,315.318%20197.666,300.712%20185.151,286.107%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='356.898,201.278%20348.553,220.748%20364.548,220.748%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='230.348,320.875%20230.348,281.241%20212.268,300.712%20'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M264.42,292.368c-0.696-4.172-3.48-6.261-7.654-6.261h-14.599v12.516h15.299%20C261.637,298.624,264.42,296.539,264.42,292.368z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M313.09,297.236c1.391-0.697,2.089-2.785,2.089-4.867c0.696-2.779-0.698-4.172-2.089-4.868%20c-1.387-0.696-3.476-0.696-5.559-0.696h-13.91v11.127h13.909C309.613,297.932,311.702,297.932,313.09,297.236z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M413.217,183.198v8.344l-4.169-8.344H376.37v8.344l-4.174-8.344h-44.502%20c-7.648,0-13.909,1.392-19.469,4.173v-4.173h-31.289v0.696v3.477c-3.476-2.78-7.648-4.173-13.211-4.173h-111.95l-7.652,17.384%20l-7.647-17.384h-25.031h-10.431v8.344l-3.477-8.344h-0.696H66.942l-13.909,32.68L37.042,251.34l-0.294,0.697h0.294h35.463h0.444%20l0.252-0.697l4.174-10.428h9.039l4.172,11.125h40.326v-0.697v-7.647l3.479,8.343h20.163l3.475-8.343v7.647v0.697h15.993h79.965%20h0.696v-18.08h1.394c1.389,0,1.389,0,1.389,2.087v15.297h50.065v-4.172c4.172,2.089,10.426,4.172,18.771,4.172h20.863l4.172-11.123%20h9.732l4.172,11.123h40.328v-6.952v-3.476l6.261,10.428h1.387h0.698h30.595v-68.143h-31.291l0,0H413.217z%20M177.501,241.609h-6.955%20h-4.171v-4.169v-34.076l-0.696,1.595v-0.019l-16.176,36.669h-0.512h-3.719h-6.017l-16.687-38.245v38.245h-23.64l-4.867-10.43%20H70.417l-4.868,10.43H53.326l20.57-48.675h17.382l19.469,46.587v-46.587h4.171h14.251l0.328,0.697h0.024l8.773,19.094l6.3,14.306%20l0.223-0.721l13.906-33.375H177.5v48.674H177.501L177.501,241.609z%20M225.481,203.364h-27.119v9.039h26.423v9.734h-26.423v9.738%20h27.119v10.427h-38.939v-49.367h38.939V203.364L225.481,203.364z%20M275.076,221.294c0.018,0.016,0.041,0.027,0.063,0.042%20c0.263,0.278,0.488,0.557,0.68,0.824c1.332,1.746,2.409,4.343,2.463,8.151c0.004,0.066,0.007,0.131,0.011,0.197%20c0,0.038,0.007,0.071,0.007,0.11c0,0.022-0.002,0.039-0.002,0.06c0.016,0.383,0.026,0.774,0.026,1.197v9.735h-10.428v-5.565%20c0-2.781,0-6.954-2.089-9.735c-0.657-0.657-1.322-1.09-2.046-1.398c-1.042-0.675-3.017-0.686-6.295-0.686h-12.52v17.384h-11.818%20v-48.675h26.425c6.254,0,10.428,0,13.906,2.086c3.407,2.046,5.465,5.439,5.543,10.812c-0.161,7.4-4.911,11.46-8.326,12.829%20C270.676,218.662,272.996,219.129,275.076,221.294z%20M298.491,241.609h-11.822v-48.675h11.822V241.609z%20M434.083,241.609h-15.3%20l-22.25-36.855v30.595l-0.073-0.072v6.362h-11.747v-0.029h-11.822l-4.172-10.43H344.38l-4.172,11.123h-13.211%20c-5.559,0-12.517-1.389-16.687-5.561c-4.172-4.172-6.256-9.735-6.256-18.773c0-6.953,1.389-13.911,6.256-19.472%20c3.474-4.175,9.735-5.562,17.382-5.562h11.128v10.429h-11.128c-4.172,0-6.254,0.693-9.041,2.783%20c-2.082,2.085-3.474,6.256-3.474,11.123c0,5.564,0.696,9.04,3.474,11.821c2.091,2.089,4.87,2.785,8.346,2.785h4.867l15.991-38.243%20h6.957h10.428l19.472,46.587v-2.376v-15.705v-1.389v-27.116h17.382l20.161,34.07v-34.07h11.826v47.977h0.002L434.083,241.609%20L434.083,241.609z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M265.161,213.207c0.203-0.217,0.387-0.463,0.543-0.745c0.63-0.997,1.352-2.793,0.963-5.244%20c-0.016-0.225-0.057-0.433-0.105-0.634c-0.013-0.056-0.011-0.105-0.026-0.161l-0.007,0.001c-0.346-1.191-1.229-1.923-2.11-2.367%20c-1.394-0.693-3.48-0.693-5.565-0.693h-13.909v11.127h13.909c2.085,0,4.172,0,5.565-0.697c0.209-0.106,0.395-0.25,0.574-0.413%20l0.002,0.009C264.996,213.389,265.067,213.315,265.161,213.207z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M475.105,311.144c0-4.867-1.389-9.736-3.474-13.212v-31.289h-0.032v-2.089c0,0-29.145,0-33.483,0%20c-4.336,0-9.598,4.171-9.598,4.171v-4.171h-31.984c-4.87,0-11.124,1.392-13.909,4.171v-4.171h-57.016v2.089v2.081%20c-4.169-3.474-11.824-4.171-15.298-4.171h-37.549v2.089v2.081c-3.476-3.474-11.824-4.171-15.998-4.171H215.05l-9.737,10.431%20l-9.04-10.431h-2.911h-4.737h-54.93v2.089v5.493v62.651h61.19l10.054-10.057l8.715,10.057h0.698h35.258h1.598h0.696h0.692v-6.953%20v-9.039h3.479c4.863,0,11.124,0,15.991-2.089v17.382v1.394h31.291v-1.394V317.4h1.387c2.089,0,2.089,0,2.089,2.086v14.6v1.394%20h94.563c6.263,0,12.517-1.394,15.993-4.175v2.781v1.394h29.902c6.254,0,12.517-0.695,16.689-3.478%20c6.402-3.841,10.437-10.64,11.037-18.749c0.028-0.24,0.063-0.48,0.085-0.721l-0.041-0.039%20C475.087,312.043,475.105,311.598,475.105,311.144z%20M256.076,306.973h-13.91v2.081v4.174v4.173v7.649h-22.855l-13.302-15.299%20l-0.046,0.051l-0.65-0.748l-15.297,15.996h-44.501v-48.673h45.197l12.348,13.525l2.596,2.832l0.352-0.365l14.604-15.991h36.852%20c7.152,0,15.161,1.765,18.196,9.042c0.365,1.441,0.577,3.043,0.577,4.863C276.237,304.189,266.502,306.973,256.076,306.973z%20M325.609,306.276c1.389,2.081,2.085,4.867,2.085,9.041v9.732h-11.819v-6.256c0-2.786,0-7.65-2.089-9.739%20c-1.387-2.081-4.172-2.081-8.341-2.081H292.93v18.077h-11.82v-49.369h26.421c5.559,0,10.426,0,13.909,2.084%20c3.474,2.088,6.254,5.565,6.254,11.128c0,7.647-4.865,11.819-8.343,13.212C322.829,303.49,324.914,304.885,325.609,306.276z%20M373.589,286.107h-27.122v9.04h26.424v9.737h-26.424v9.736h27.122v10.429H334.65V275.68h38.939V286.107z%20M402.791,325.05h-22.252%20v-10.429h22.252c2.082,0,3.476,0,4.87-1.392c0.696-0.697,1.387-2.085,1.387-3.477c0-1.394-0.691-2.778-1.387-3.475%20c-0.698-0.695-2.091-1.391-4.176-1.391c-11.126-0.696-24.337,0-24.337-15.296c0-6.954,4.172-14.604,16.689-14.604h22.945v11.819%20h-21.554c-2.085,0-3.478,0-4.87,0.696c-1.387,0.697-1.387,2.089-1.387,3.478c0,2.087,1.387,2.783,2.778,3.473%20c1.394,0.697,2.783,0.697,4.172,0.697h6.259c6.259,0,10.43,1.391,13.211,4.173c2.087,2.087,3.478,5.564,3.478,10.43%20C420.869,320.179,414.611,325.05,402.791,325.05z%20M462.59,320.179c-2.778,2.785-7.648,4.871-14.604,4.871H425.74v-10.429h22.245%20c2.087,0,3.481,0,4.87-1.392c0.693-0.697,1.391-2.085,1.391-3.477c0-1.394-0.698-2.778-1.391-3.475%20c-0.696-0.695-2.085-1.391-4.172-1.391c-11.122-0.696-24.337,0-24.337-15.295c0-6.609,3.781-12.579,13.106-14.352%20c1.115-0.154,2.293-0.253,3.583-0.253h22.948v11.819h-15.3h-5.561h-0.696c-2.087,0-3.476,0-4.865,0.696%20c-0.7,0.697-1.396,2.089-1.396,3.478c0,2.087,0.696,2.783,2.785,3.473c1.389,0.697,2.78,0.697,4.172,0.697h0.691h5.565%20c3.039,0,5.337,0.375,7.44,1.114c1.926,0.697,8.302,3.549,9.728,10.994c0.124,0.78,0.215,1.594,0.215,2.495%20C466.761,313.925,465.37,317.401,462.59,320.179z'/%3e%3c/g%3e%3c/svg%3e", zt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%2334495E;'%20d='M512,402.282c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.996,0,402.282V109.717%20c0-16.716,13.55-30.266,30.265-30.266h451.469c16.716,0,30.265,13.551,30.265,30.266L512,402.282L512,402.282z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.282V109.717%20c0-16.716,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.003,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.996,21.517,402.282z'/%3e%3cpath%20style='fill:%23F26E21;'%20d='M309.389,255.801c0.041-9.636-3.572-19.286-10.843-26.558c-7.287-7.287-16.961-10.897-26.617-10.839%20c-0.046,0-0.091-0.003-0.139-0.003c-20.968,0-37.6,16.628-37.6,37.602c0,20.767,16.837,37.599,37.6,37.599%20c20.974,0,37.604-16.631,37.604-37.599C309.394,255.934,309.389,255.869,309.389,255.801z'/%3e%3cg%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M227.198,271.909c-5.62,5.626-10.807,7.824-16.394,7.943c-13.611-0.122-23.618-10.202-23.618-24.573%20c0-7.234,2.739-13.163,7.078-18.228l0,0c4.069-3.863,9.311-6.359,15.339-6.359c6.507,0,11.571,2.169,17.352,7.954v-16.631%20c-5.78-2.891-10.846-4.338-17.352-4.338c-9.192,0.657-17.859,4.371-24.507,10.203l0,0c-1.916,1.724-3.752,3.627-5.309,5.805%20c-4.856,6.294-7.791,14.001-7.791,22.32c0,20.967,16.637,36.875,37.606,36.875c0.102,0,0.203-0.009,0.302-0.01%20c0.141,0.002,0.28,0.01,0.42,0.01c5.784,0,10.85-1.443,17.357-4.336L227.198,271.909c-0.244,0.244,0.242,0.471,0,0.702V271.909z'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='356.863,228.033%20356.863,228.033%20340.487,268.295%20321.685,220.566%20306.502,220.566%20336.148,293.601%20344.102,293.601%20375.196,220.566%20360.013,220.566%20'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='380.983,252.384%20380.983,291.435%20420.033,291.435%20420.753,291.435%20420.753,279.861%20408.461,279.861%20395.445,279.861%20395.445,266.848%20395.445,260.342%20420.033,260.342%20420.033,248.045%20395.445,248.045%20395.445,232.861%20420.753,232.861%20420.753,220.566%20380.983,220.566%20'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M54.135,220.566H33.884v70.869h20.25c10.845,0,18.798-2.895,25.306-7.957%20c7.953-6.508,13.017-16.629,13.017-27.474C92.458,235.028,77.27,220.566,54.135,220.566z%20M70.765,274.08%20c-4.339,3.614-10.124,5.781-18.802,5.781h-4.339V232.86h3.615c8.678,0,14.463,1.446,18.803,5.783%20c5.061,4.336,7.955,10.848,7.955,17.358C78.72,262.509,75.828,269.737,70.765,274.08z'/%3e%3crect%20x='98.97'%20y='220.56'%20style='fill:%23E7E8E3;'%20width='13.739'%20height='70.867'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M147.415,248.045c-8.676-2.892-10.848-5.063-10.848-8.677c0-4.339,4.339-7.954,10.124-7.954%20c4.339,0,7.954,1.447,11.57,5.786l7.233-9.4c-5.787-5.064-13.015-7.953-20.97-7.953c-12.296,0-22.42,8.678-22.42,20.244%20c0,10.126,4.343,14.464,17.357,19.526c5.785,2.166,7.955,2.892,9.404,4.338c2.887,1.444,4.336,4.339,4.336,7.228%20c0,5.786-4.336,10.126-10.848,10.126c-6.514,0-12.294-3.615-15.187-9.401l-8.678,8.678c6.511,9.4,14.465,13.738,24.589,13.738%20c14.461,0,24.58-9.4,24.58-23.141C167.659,258.893,163.324,253.831,147.415,248.045z'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M459.804,261.783c10.843-2.166,16.63-9.4,16.63-20.244c0-13.014-9.402-20.973-25.308-20.973h-20.972%20v70.869h13.739V263.23h2.172l19.519,28.205h16.634L459.804,261.783z%20M448.23,253.105h-4.336v-21.691h4.336%20c8.678,0,13.742,3.614,13.742,10.85C461.972,249.492,456.909,253.105,448.23,253.105z'/%3e%3c/g%3e%3c/svg%3e", Pt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20291.791%20291.791'%20xml:space='preserve'%3e%3cg%3e%3cpath%20style='fill:%23E2574C;'%20d='M182.298,145.895c0,50.366-40.801,91.176-91.149,91.176S0,196.252,0,145.895%20s40.811-91.176,91.149-91.176S182.298,95.538,182.298,145.895z'/%3e%3cpath%20style='fill:%23F4B459;'%20d='M200.616,54.719c-20.442,0-39.261,6.811-54.469,18.181l0.073,0.009%20c2.991,2.89,6.291,4.924,8.835,8.251l-18.965,0.301c-2.972,3-5.68,6.264-8.233,9.656H161.3c2.544,3.054,4.896,5.708,7.03,9.081%20h-46.536c-1.705,2.936-3.282,5.954-4.659,9.09h56.493c1.477,3.127,2.799,5.489,3.921,8.799h-63.76%20c-1.012,3.146-1.878,6.364-2.535,9.646h68.966c0.675,3.155,1.194,6.072,1.55,9.045h-71.884c-0.301,3-0.456,6.045-0.456,9.118%20h72.859c0,3.228-0.228,6.218-0.556,9.118h-71.847c0.31,3.091,0.766,6.127,1.368,9.118h68.856c-0.711,2.954-1.532,5.926-2.562,9.008%20h-63.969c0.966,3.118,2.143,6.145,3.428,9.099h56.621c-1.568,3.319-3.346,5.972-5.306,9.081h-46.691%20c1.842,3.191,3.875,6.236,6.081,9.154l33.589,0.501c-2.863,3.437-6.537,5.507-9.884,8.516c0.182,0.146-5.352-0.018-16.248-0.191%20c16.576,17.105,39.744,27.772,65.446,27.772c50.357,0,91.176-40.82,91.176-91.176S250.981,54.719,200.616,54.719z'/%3e%3c/g%3e%3c/svg%3e", Vt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%20-140%20780%20780'%20enable-background='new%200%200%20780%20500'%20version='1.1'%20xml:space='preserve'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M40,0h700c22.092,0,40,17.909,40,40v420c0,22.092-17.908,40-40,40H40c-22.091,0-40-17.908-40-40V40%20C0,17.909,17.909,0,40,0z'%20fill='%230E4595'/%3e%3cpath%20d='m293.2%20348.73l33.361-195.76h53.36l-33.385%20195.76h-53.336zm246.11-191.54c-10.57-3.966-27.137-8.222-47.822-8.222-52.725%200-89.865%2026.55-90.18%2064.603-0.299%2028.13%2026.514%2043.822%2046.752%2053.186%2020.771%209.595%2027.752%2015.714%2027.654%2024.283-0.131%2013.121-16.586%2019.116-31.922%2019.116-21.357%200-32.703-2.967-50.227-10.276l-6.876-3.11-7.489%2043.823c12.463%205.464%2035.51%2010.198%2059.438%2010.443%2056.09%200%2092.5-26.246%2092.916-66.882%200.199-22.269-14.016-39.216-44.801-53.188-18.65-9.055-30.072-15.099-29.951-24.268%200-8.137%209.668-16.839%2030.557-16.839%2017.449-0.27%2030.09%203.535%2039.938%207.5l4.781%202.26%207.232-42.429m137.31-4.223h-41.232c-12.773%200-22.332%203.487-27.941%2016.234l-79.244%20179.4h56.031s9.16-24.123%2011.232-29.418c6.125%200%2060.555%200.084%2068.338%200.084%201.596%206.853%206.49%2029.334%206.49%2029.334h49.514l-43.188-195.64zm-65.418%20126.41c4.412-11.279%2021.26-54.723%2021.26-54.723-0.316%200.522%204.379-11.334%207.074-18.684l3.605%2016.879s10.219%2046.729%2012.354%2056.528h-44.293zm-363.3-126.41l-52.24%20133.5-5.567-27.13c-9.725-31.273-40.025-65.155-73.898-82.118l47.766%20171.2%2056.456-0.064%2084.004-195.39h-56.521'%20fill='%23ffffff'/%3e%3cpath%20d='m146.92%20152.96h-86.041l-0.681%204.073c66.938%2016.204%20111.23%2055.363%20129.62%20102.41l-18.71-89.96c-3.23-12.395-12.597-16.094-24.186-16.527'%20fill='%23F2AE14'/%3e%3c/svg%3e", L = [
|
|
1299
1431
|
{
|
|
1300
1432
|
type: "visa",
|
|
1301
|
-
imgSrc:
|
|
1433
|
+
imgSrc: Vt
|
|
1302
1434
|
},
|
|
1303
1435
|
{
|
|
1304
1436
|
type: "masterCard",
|
|
@@ -1306,7 +1438,7 @@ const It = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%
|
|
|
1306
1438
|
},
|
|
1307
1439
|
{
|
|
1308
1440
|
type: "americanExpress",
|
|
1309
|
-
imgSrc:
|
|
1441
|
+
imgSrc: Nt
|
|
1310
1442
|
},
|
|
1311
1443
|
{
|
|
1312
1444
|
type: "discover",
|
|
@@ -1325,11 +1457,11 @@ class At extends h {
|
|
|
1325
1457
|
a.id = "card-element", a.className = `card-element ${e.isFocused ? "card-element-focus" : ""}`, a.style.zIndex = e.isFocused ? "2" : "0";
|
|
1326
1458
|
const r = document.createElement("div");
|
|
1327
1459
|
if (r.className = "cards-position", e.cardType === "unknown")
|
|
1328
|
-
|
|
1460
|
+
L.forEach((s) => {
|
|
1329
1461
|
r.appendChild(this.createCardIcon(s));
|
|
1330
1462
|
});
|
|
1331
1463
|
else {
|
|
1332
|
-
const s =
|
|
1464
|
+
const s = L.find((o) => o.type === e.cardType);
|
|
1333
1465
|
s && r.appendChild(this.createCardIcon(s));
|
|
1334
1466
|
}
|
|
1335
1467
|
a.appendChild(r), i.appendChild(a), this.getElement().appendChild(i);
|
|
@@ -1360,12 +1492,12 @@ class At extends h {
|
|
|
1360
1492
|
const i = this.getElement().querySelector(".cards-position");
|
|
1361
1493
|
if (i)
|
|
1362
1494
|
if (i.innerHTML = "", this.cardType === "unknown")
|
|
1363
|
-
|
|
1495
|
+
L.forEach((a) => {
|
|
1364
1496
|
i.appendChild(this.createCardIcon(a));
|
|
1365
1497
|
});
|
|
1366
1498
|
else {
|
|
1367
|
-
const a =
|
|
1368
|
-
a ? i.appendChild(this.createCardIcon(a)) :
|
|
1499
|
+
const a = L.find((r) => r.type === this.cardType);
|
|
1500
|
+
a ? i.appendChild(this.createCardIcon(a)) : L.forEach((r) => {
|
|
1369
1501
|
i.appendChild(this.createCardIcon(r));
|
|
1370
1502
|
});
|
|
1371
1503
|
}
|
|
@@ -1385,40 +1517,43 @@ class Dt extends h {
|
|
|
1385
1517
|
isFocused: a,
|
|
1386
1518
|
isCvvFocused: r,
|
|
1387
1519
|
isCcValid: s,
|
|
1388
|
-
isCvvValid:
|
|
1520
|
+
isCvvValid: o,
|
|
1389
1521
|
isCcTouched: l,
|
|
1390
1522
|
isCvvTouched: c,
|
|
1391
1523
|
cardType: d,
|
|
1392
1524
|
cardExpiry: u,
|
|
1393
|
-
cardExpiryError:
|
|
1525
|
+
cardExpiryError: f,
|
|
1394
1526
|
cardExpiryTouched: g,
|
|
1395
|
-
onChange:
|
|
1396
|
-
onBlur:
|
|
1397
|
-
translationFunc:
|
|
1398
|
-
cardExpiryAutocomplete:
|
|
1399
|
-
} = e,
|
|
1527
|
+
onChange: S,
|
|
1528
|
+
onBlur: I,
|
|
1529
|
+
translationFunc: m,
|
|
1530
|
+
cardExpiryAutocomplete: b = "cc-exp"
|
|
1531
|
+
} = e, M = document.createElement("div");
|
|
1400
1532
|
this.cardNumber = new At({
|
|
1401
1533
|
styles: {
|
|
1402
1534
|
color: t.styles.textColor,
|
|
1403
1535
|
fontSize: t.styles.fontSize,
|
|
1404
1536
|
borderRadius: t.styles.borderRadius
|
|
1405
1537
|
},
|
|
1406
|
-
label:
|
|
1538
|
+
label: m("cardInformation"),
|
|
1407
1539
|
isLoading: i,
|
|
1408
1540
|
isFocused: a,
|
|
1409
1541
|
cardType: d
|
|
1410
|
-
}),
|
|
1411
|
-
const
|
|
1412
|
-
|
|
1542
|
+
}), M.appendChild(this.cardNumber.getElement());
|
|
1543
|
+
const y = document.createElement("div");
|
|
1544
|
+
y.className = "card-details", this.cardExpiry = new P({
|
|
1413
1545
|
name: "cardExpiry",
|
|
1414
1546
|
type: "tel",
|
|
1415
|
-
placeholder:
|
|
1416
|
-
|
|
1417
|
-
|
|
1547
|
+
placeholder: m("cardExpiry"),
|
|
1548
|
+
// Always hide error initially
|
|
1549
|
+
error: !1,
|
|
1550
|
+
errorMsg: f,
|
|
1418
1551
|
value: u,
|
|
1419
|
-
autocomplete:
|
|
1420
|
-
onChange: (
|
|
1421
|
-
this.
|
|
1552
|
+
autocomplete: b,
|
|
1553
|
+
onChange: (p) => {
|
|
1554
|
+
this.cardExpiry.setError(!1);
|
|
1555
|
+
const x = this.validationMessages.get("cardExpiry");
|
|
1556
|
+
x && (x.getElement().remove(), this.validationMessages.delete("cardExpiry"), this.updateErrorContainerHeight()), this.trimCardExpiry(), S(p);
|
|
1422
1557
|
},
|
|
1423
1558
|
styles: {
|
|
1424
1559
|
color: t.styles.textColor,
|
|
@@ -1426,44 +1561,46 @@ class Dt extends h {
|
|
|
1426
1561
|
fontSize: t.styles.fontSize,
|
|
1427
1562
|
fontFamily: t.styles.fontFamily
|
|
1428
1563
|
}
|
|
1429
|
-
}), this.cardExpiry.addEventListener("blur",
|
|
1430
|
-
|
|
1564
|
+
}), this.cardExpiry.addEventListener("blur", (p) => {
|
|
1565
|
+
f && g && this.cardExpiry.setError(!0, f), I(p);
|
|
1566
|
+
}), this.cardExpiry.addEventListener("keydown", (p) => {
|
|
1567
|
+
const x = p, B = [
|
|
1431
1568
|
"Backspace",
|
|
1432
1569
|
"Delete",
|
|
1433
1570
|
"ArrowLeft",
|
|
1434
1571
|
"ArrowRight",
|
|
1435
1572
|
"Tab"
|
|
1436
|
-
],
|
|
1437
|
-
B.includes(
|
|
1573
|
+
], H = this.cardExpiry.getValue().replace(/\D/g, "");
|
|
1574
|
+
B.includes(x.key) || (!/^\d$/.test(x.key) || H.length >= 4 && !x.isComposing) && x.preventDefault();
|
|
1438
1575
|
});
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1441
|
-
const
|
|
1442
|
-
|
|
1576
|
+
const F = this.cardExpiry.getElement();
|
|
1577
|
+
F.style.height = "38.5px";
|
|
1578
|
+
const C = document.createElement("div");
|
|
1579
|
+
C.className = "input-wrapper", this.cardCvv = new It({
|
|
1443
1580
|
styles: {
|
|
1444
1581
|
borderRadius: typeof t.styles.borderRadius == "number" ? t.styles.borderRadius : 0
|
|
1445
1582
|
},
|
|
1446
1583
|
isLoading: i,
|
|
1447
1584
|
isFocused: r
|
|
1448
|
-
}),
|
|
1449
|
-
const
|
|
1450
|
-
if (
|
|
1451
|
-
const
|
|
1452
|
-
text:
|
|
1585
|
+
}), C.appendChild(this.cardCvv.getElement()), y.appendChild(this.cardExpiry.getElement()), y.appendChild(C), M.appendChild(y);
|
|
1586
|
+
const v = document.createElement("div");
|
|
1587
|
+
if (v.className = "error-messages-container", v.style.width = "100%", v.style.transition = "height 0.3s ease-in-out, opacity 0.3s ease-in-out", v.style.overflow = "hidden", v.style.height = "0px", v.style.opacity = "0", this.getElement().appendChild(M), this.getElement().appendChild(v), (a || l) && !s) {
|
|
1588
|
+
const p = new E({
|
|
1589
|
+
text: m("validation.cardNumberInvalid")
|
|
1453
1590
|
});
|
|
1454
|
-
this.validationMessages.set("cardNumber",
|
|
1591
|
+
this.validationMessages.set("cardNumber", p), v.appendChild(p.getElement());
|
|
1455
1592
|
}
|
|
1456
|
-
if ((r || c) && !
|
|
1457
|
-
const
|
|
1458
|
-
text:
|
|
1593
|
+
if ((r || c) && !o) {
|
|
1594
|
+
const p = new E({
|
|
1595
|
+
text: m("validation.cardSecurityFormat")
|
|
1459
1596
|
});
|
|
1460
|
-
this.validationMessages.set("cardCvv",
|
|
1597
|
+
this.validationMessages.set("cardCvv", p), v.appendChild(p.getElement());
|
|
1461
1598
|
}
|
|
1462
|
-
if (
|
|
1463
|
-
const
|
|
1464
|
-
text:
|
|
1599
|
+
if (f && g) {
|
|
1600
|
+
const p = new E({
|
|
1601
|
+
text: f
|
|
1465
1602
|
});
|
|
1466
|
-
this.validationMessages.set("cardExpiry",
|
|
1603
|
+
this.validationMessages.set("cardExpiry", p), v.appendChild(p.getElement());
|
|
1467
1604
|
}
|
|
1468
1605
|
setTimeout(() => this.updateErrorContainerHeight(), 0);
|
|
1469
1606
|
}
|
|
@@ -1474,20 +1611,22 @@ class Dt extends h {
|
|
|
1474
1611
|
this.cardExpiry.setValue(e);
|
|
1475
1612
|
const a = this.getElement().querySelector(
|
|
1476
1613
|
".error-messages-container"
|
|
1477
|
-
);
|
|
1478
|
-
if (t && i)
|
|
1614
|
+
), r = this.cardExpiry.getElement().querySelector("input"), s = document.activeElement === r;
|
|
1615
|
+
if (t && i && !s)
|
|
1479
1616
|
if (this.cardExpiry.setError(!1), this.validationMessages.has("cardExpiry"))
|
|
1480
1617
|
this.validationMessages.get("cardExpiry")?.setText(t);
|
|
1481
1618
|
else {
|
|
1482
|
-
const
|
|
1619
|
+
const l = new E({
|
|
1483
1620
|
text: t
|
|
1484
1621
|
});
|
|
1485
|
-
this.validationMessages.set("cardExpiry",
|
|
1622
|
+
this.validationMessages.set("cardExpiry", l), a.appendChild(l.getElement()), setTimeout(() => this.updateErrorContainerHeight(), 0);
|
|
1486
1623
|
}
|
|
1487
|
-
else {
|
|
1488
|
-
this.
|
|
1489
|
-
|
|
1490
|
-
|
|
1624
|
+
else if (this.cardExpiry.setError(!1), s) {
|
|
1625
|
+
const l = this.validationMessages.get("cardExpiry");
|
|
1626
|
+
l && (l.getElement().remove(), this.validationMessages.delete("cardExpiry"), this.updateErrorContainerHeight());
|
|
1627
|
+
} else if (!t) {
|
|
1628
|
+
const l = this.validationMessages.get("cardExpiry");
|
|
1629
|
+
l && (l.getElement().remove(), this.validationMessages.delete("cardExpiry"), this.updateErrorContainerHeight());
|
|
1491
1630
|
}
|
|
1492
1631
|
return this;
|
|
1493
1632
|
}
|
|
@@ -1502,17 +1641,21 @@ class Dt extends h {
|
|
|
1502
1641
|
this.cardNumber.setFocused(e);
|
|
1503
1642
|
const r = this.getElement().querySelector(
|
|
1504
1643
|
".error-messages-container"
|
|
1505
|
-
);
|
|
1506
|
-
if (
|
|
1644
|
+
), s = t !== !1;
|
|
1645
|
+
if (e) {
|
|
1646
|
+
const o = this.validationMessages.get("cardNumber");
|
|
1647
|
+
return o && (o.getElement().remove(), this.validationMessages.delete("cardNumber"), this.updateErrorContainerHeight()), this;
|
|
1648
|
+
}
|
|
1649
|
+
if (!e && a && !s) {
|
|
1507
1650
|
if (!this.validationMessages.has("cardNumber")) {
|
|
1508
|
-
const
|
|
1651
|
+
const o = new E({
|
|
1509
1652
|
text: i("validation.cardNumberInvalid")
|
|
1510
1653
|
});
|
|
1511
|
-
this.validationMessages.set("cardNumber",
|
|
1654
|
+
this.validationMessages.set("cardNumber", o), r.appendChild(o.getElement()), setTimeout(() => this.updateErrorContainerHeight(), 0);
|
|
1512
1655
|
}
|
|
1513
1656
|
} else {
|
|
1514
|
-
const
|
|
1515
|
-
|
|
1657
|
+
const o = this.validationMessages.get("cardNumber");
|
|
1658
|
+
o && (o.getElement().remove(), this.validationMessages.delete("cardNumber"), this.updateErrorContainerHeight());
|
|
1516
1659
|
}
|
|
1517
1660
|
return this;
|
|
1518
1661
|
}
|
|
@@ -1523,14 +1666,14 @@ class Dt extends h {
|
|
|
1523
1666
|
);
|
|
1524
1667
|
if (!e && a && !(t !== !1)) {
|
|
1525
1668
|
if (!this.validationMessages.has("cardCvv")) {
|
|
1526
|
-
const
|
|
1669
|
+
const o = new E({
|
|
1527
1670
|
text: i("validation.cardSecurityFormat")
|
|
1528
1671
|
});
|
|
1529
|
-
this.validationMessages.set("cardCvv",
|
|
1672
|
+
this.validationMessages.set("cardCvv", o), r.appendChild(o.getElement()), setTimeout(() => this.updateErrorContainerHeight(), 0);
|
|
1530
1673
|
}
|
|
1531
1674
|
} else {
|
|
1532
|
-
const
|
|
1533
|
-
|
|
1675
|
+
const o = this.validationMessages.get("cardCvv");
|
|
1676
|
+
o && (o.getElement().remove(), this.validationMessages.delete("cardCvv"), this.updateErrorContainerHeight());
|
|
1534
1677
|
}
|
|
1535
1678
|
return this;
|
|
1536
1679
|
}
|
|
@@ -1555,8 +1698,26 @@ class Dt extends h {
|
|
|
1555
1698
|
e.style.overflow = i, e.style.height = t, e.offsetHeight, e.style.height = a + 4 + "px", e.style.opacity = "1";
|
|
1556
1699
|
}
|
|
1557
1700
|
}
|
|
1701
|
+
/**
|
|
1702
|
+
* Focus a specific field in the card section
|
|
1703
|
+
* @param field The field to focus: 'cardNumber', 'cardExpiry', or 'cardCvv'
|
|
1704
|
+
*/
|
|
1705
|
+
focusField(e) {
|
|
1706
|
+
switch (e) {
|
|
1707
|
+
case "cardExpiry":
|
|
1708
|
+
this.cardExpiry.focus();
|
|
1709
|
+
break;
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
/**
|
|
1713
|
+
* Focus implementation for the Focusable interface
|
|
1714
|
+
* By default, focus on the card expiry field since it's a regular input we can directly control
|
|
1715
|
+
*/
|
|
1716
|
+
focus() {
|
|
1717
|
+
this.focusField("cardExpiry");
|
|
1718
|
+
}
|
|
1558
1719
|
}
|
|
1559
|
-
class
|
|
1720
|
+
class $t {
|
|
1560
1721
|
input;
|
|
1561
1722
|
constructor(e) {
|
|
1562
1723
|
const {
|
|
@@ -1565,30 +1726,33 @@ class Vt {
|
|
|
1565
1726
|
onBlur: a,
|
|
1566
1727
|
error: r,
|
|
1567
1728
|
errorMsg: s,
|
|
1568
|
-
checkoutProfile:
|
|
1729
|
+
checkoutProfile: o,
|
|
1569
1730
|
translationFunc: l,
|
|
1570
1731
|
autocomplete: c = "email"
|
|
1571
1732
|
} = e;
|
|
1572
1733
|
this.input = new P({
|
|
1573
1734
|
name: "email",
|
|
1574
1735
|
label: l("email"),
|
|
1575
|
-
error
|
|
1736
|
+
// Always hide error initially - we'll show it only on blur if needed
|
|
1737
|
+
error: !1,
|
|
1576
1738
|
errorMsg: s,
|
|
1577
1739
|
styles: {
|
|
1578
|
-
color:
|
|
1579
|
-
borderRadius: `${
|
|
1580
|
-
fontSize:
|
|
1581
|
-
fontFamily:
|
|
1740
|
+
color: o.styles.textColor,
|
|
1741
|
+
borderRadius: `${o.styles.borderRadius}px`,
|
|
1742
|
+
fontSize: o.styles.fontSize,
|
|
1743
|
+
fontFamily: o.styles.fontFamily
|
|
1582
1744
|
},
|
|
1583
1745
|
placeholder: l("email"),
|
|
1584
1746
|
type: "email",
|
|
1585
1747
|
value: t,
|
|
1586
1748
|
autocomplete: c,
|
|
1587
|
-
// Wrap the original onChange to apply trim
|
|
1749
|
+
// Wrap the original onChange to apply trim and hide errors during typing
|
|
1588
1750
|
onChange: (d) => {
|
|
1589
|
-
this.trim(), i(d);
|
|
1751
|
+
this.input.setError(!1), this.trim(), i(d);
|
|
1590
1752
|
}
|
|
1591
|
-
}), this.input.addEventListener("blur",
|
|
1753
|
+
}), this.input.addEventListener("blur", (d) => {
|
|
1754
|
+
r && this.input.setError(r, s), a(d);
|
|
1755
|
+
});
|
|
1592
1756
|
}
|
|
1593
1757
|
getValue() {
|
|
1594
1758
|
return this.input.getValue();
|
|
@@ -1601,7 +1765,7 @@ class Vt {
|
|
|
1601
1765
|
return this.setValue(e), this;
|
|
1602
1766
|
}
|
|
1603
1767
|
setError(e, t) {
|
|
1604
|
-
return this.input.setError(e, t), this;
|
|
1768
|
+
return document.activeElement !== this.input.getElement().querySelector("input") ? this.input.setError(e, t) : this.input.setError(!1), this;
|
|
1605
1769
|
}
|
|
1606
1770
|
getElement() {
|
|
1607
1771
|
return this.input.getElement();
|
|
@@ -1609,9 +1773,12 @@ class Vt {
|
|
|
1609
1773
|
appendTo(e) {
|
|
1610
1774
|
return this.input.appendTo(e), this;
|
|
1611
1775
|
}
|
|
1776
|
+
focus() {
|
|
1777
|
+
this.input.focus();
|
|
1778
|
+
}
|
|
1612
1779
|
}
|
|
1613
|
-
const
|
|
1614
|
-
class
|
|
1780
|
+
const Rt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='101px'%20height='32'%20viewBox='0%200%20101%2032'%20preserveAspectRatio='xMinYMin%20meet'%3e%3cpath%20fill='%23003087'%20d='M%2012.237%202.8%20L%204.437%202.8%20C%203.937%202.8%203.437%203.2%203.337%203.7%20L%200.237%2023.7%20C%200.137%2024.1%200.437%2024.4%200.837%2024.4%20L%204.537%2024.4%20C%205.037%2024.4%205.537%2024%205.637%2023.5%20L%206.437%2018.1%20C%206.537%2017.6%206.937%2017.2%207.537%2017.2%20L%2010.037%2017.2%20C%2015.137%2017.2%2018.137%2014.7%2018.937%209.8%20C%2019.237%207.7%2018.937%206%2017.937%204.8%20C%2016.837%203.5%2014.837%202.8%2012.237%202.8%20Z%20M%2013.137%2010.1%20C%2012.737%2012.9%2010.537%2012.9%208.537%2012.9%20L%207.337%2012.9%20L%208.137%207.7%20C%208.137%207.4%208.437%207.2%208.737%207.2%20L%209.237%207.2%20C%2010.637%207.2%2011.937%207.2%2012.637%208%20C%2013.137%208.4%2013.337%209.1%2013.137%2010.1%20Z'/%3e%3cpath%20fill='%23003087'%20d='M%2035.437%2010%20L%2031.737%2010%20C%2031.437%2010%2031.137%2010.2%2031.137%2010.5%20L%2030.937%2011.5%20L%2030.637%2011.1%20C%2029.837%209.9%2028.037%209.5%2026.237%209.5%20C%2022.137%209.5%2018.637%2012.6%2017.937%2017%20C%2017.537%2019.2%2018.037%2021.3%2019.337%2022.7%20C%2020.437%2024%2022.137%2024.6%2024.037%2024.6%20C%2027.337%2024.6%2029.237%2022.5%2029.237%2022.5%20L%2029.037%2023.5%20C%2028.937%2023.9%2029.237%2024.3%2029.637%2024.3%20L%2033.037%2024.3%20C%2033.537%2024.3%2034.037%2023.9%2034.137%2023.4%20L%2036.137%2010.6%20C%2036.237%2010.4%2035.837%2010%2035.437%2010%20Z%20M%2030.337%2017.2%20C%2029.937%2019.3%2028.337%2020.8%2026.137%2020.8%20C%2025.037%2020.8%2024.237%2020.5%2023.637%2019.8%20C%2023.037%2019.1%2022.837%2018.2%2023.037%2017.2%20C%2023.337%2015.1%2025.137%2013.6%2027.237%2013.6%20C%2028.337%2013.6%2029.137%2014%2029.737%2014.6%20C%2030.237%2015.3%2030.437%2016.2%2030.337%2017.2%20Z'/%3e%3cpath%20fill='%23003087'%20d='M%2055.337%2010%20L%2051.637%2010%20C%2051.237%2010%2050.937%2010.2%2050.737%2010.5%20L%2045.537%2018.1%20L%2043.337%2010.8%20C%2043.237%2010.3%2042.737%2010%2042.337%2010%20L%2038.637%2010%20C%2038.237%2010%2037.837%2010.4%2038.037%2010.9%20L%2042.137%2023%20L%2038.237%2028.4%20C%2037.937%2028.8%2038.237%2029.4%2038.737%2029.4%20L%2042.437%2029.4%20C%2042.837%2029.4%2043.137%2029.2%2043.337%2028.9%20L%2055.837%2010.9%20C%2056.137%2010.6%2055.837%2010%2055.337%2010%20Z'/%3e%3cpath%20fill='%23009cde'%20d='M%2067.737%202.8%20L%2059.937%202.8%20C%2059.437%202.8%2058.937%203.2%2058.837%203.7%20L%2055.737%2023.6%20C%2055.637%2024%2055.937%2024.3%2056.337%2024.3%20L%2060.337%2024.3%20C%2060.737%2024.3%2061.037%2024%2061.037%2023.7%20L%2061.937%2018%20C%2062.037%2017.5%2062.437%2017.1%2063.037%2017.1%20L%2065.537%2017.1%20C%2070.637%2017.1%2073.637%2014.6%2074.437%209.7%20C%2074.737%207.6%2074.437%205.9%2073.437%204.7%20C%2072.237%203.5%2070.337%202.8%2067.737%202.8%20Z%20M%2068.637%2010.1%20C%2068.237%2012.9%2066.037%2012.9%2064.037%2012.9%20L%2062.837%2012.9%20L%2063.637%207.7%20C%2063.637%207.4%2063.937%207.2%2064.237%207.2%20L%2064.737%207.2%20C%2066.137%207.2%2067.437%207.2%2068.137%208%20C%2068.637%208.4%2068.737%209.1%2068.637%2010.1%20Z'/%3e%3cpath%20fill='%23009cde'%20d='M%2090.937%2010%20L%2087.237%2010%20C%2086.937%2010%2086.637%2010.2%2086.637%2010.5%20L%2086.437%2011.5%20L%2086.137%2011.1%20C%2085.337%209.9%2083.537%209.5%2081.737%209.5%20C%2077.637%209.5%2074.137%2012.6%2073.437%2017%20C%2073.037%2019.2%2073.537%2021.3%2074.837%2022.7%20C%2075.937%2024%2077.637%2024.6%2079.537%2024.6%20C%2082.837%2024.6%2084.737%2022.5%2084.737%2022.5%20L%2084.537%2023.5%20C%2084.437%2023.9%2084.737%2024.3%2085.137%2024.3%20L%2088.537%2024.3%20C%2089.037%2024.3%2089.537%2023.9%2089.637%2023.4%20L%2091.637%2010.6%20C%2091.637%2010.4%2091.337%2010%2090.937%2010%20Z%20M%2085.737%2017.2%20C%2085.337%2019.3%2083.737%2020.8%2081.537%2020.8%20C%2080.437%2020.8%2079.637%2020.5%2079.037%2019.8%20C%2078.437%2019.1%2078.237%2018.2%2078.437%2017.2%20C%2078.737%2015.1%2080.537%2013.6%2082.637%2013.6%20C%2083.737%2013.6%2084.537%2014%2085.137%2014.6%20C%2085.737%2015.3%2085.937%2016.2%2085.737%2017.2%20Z'/%3e%3cpath%20fill='%23009cde'%20d='M%2095.337%203.3%20L%2092.137%2023.6%20C%2092.037%2024%2092.337%2024.3%2092.737%2024.3%20L%2095.937%2024.3%20C%2096.437%2024.3%2096.937%2023.9%2097.037%2023.4%20L%20100.237%203.5%20C%20100.337%203.1%20100.037%202.8%2099.637%202.8%20L%2096.037%202.8%20C%2095.637%202.8%2095.437%203%2095.337%203.3%20Z'/%3e%3c/svg%3e";
|
|
1781
|
+
class Bt extends h {
|
|
1615
1782
|
formData;
|
|
1616
1783
|
onSubmit;
|
|
1617
1784
|
isSubmitting = !1;
|
|
@@ -1622,7 +1789,7 @@ class Rt extends h {
|
|
|
1622
1789
|
const a = document.createElement("div");
|
|
1623
1790
|
a.className = "paypal-icon-container";
|
|
1624
1791
|
const r = document.createElement("img");
|
|
1625
|
-
r.src =
|
|
1792
|
+
r.src = Rt, r.style.width = "69px", r.style.height = "22px", r.style.maxWidth = "100%", r.style.display = "block", r.style.height = "auto", a.appendChild(r), this.getElement().appendChild(a), i && this.getElement().addEventListener("click", () => this.handleSubmit());
|
|
1626
1793
|
}
|
|
1627
1794
|
async handleSubmit() {
|
|
1628
1795
|
if (!(!this.onSubmit || this.isSubmitting)) {
|
|
@@ -1643,7 +1810,7 @@ class Rt extends h {
|
|
|
1643
1810
|
return this.isSubmitting = e, this.getElement().style.opacity = e ? "0.7" : "1", this;
|
|
1644
1811
|
}
|
|
1645
1812
|
}
|
|
1646
|
-
class
|
|
1813
|
+
class Ht extends h {
|
|
1647
1814
|
paymentMethods;
|
|
1648
1815
|
constructor(e) {
|
|
1649
1816
|
const {
|
|
@@ -1664,19 +1831,19 @@ class Bt extends h {
|
|
|
1664
1831
|
}
|
|
1665
1832
|
const s = Object.entries(
|
|
1666
1833
|
t.additionalPaymentMethods
|
|
1667
|
-
).filter(([
|
|
1668
|
-
const c = l.enabled, d = r ? r[
|
|
1834
|
+
).filter(([o, l]) => {
|
|
1835
|
+
const c = l.enabled, d = r ? r[o] === !0 : !0;
|
|
1669
1836
|
return c && d;
|
|
1670
|
-
}).sort((
|
|
1837
|
+
}).sort((o, l) => o[1].order - l[1].order);
|
|
1671
1838
|
if (s.length === 0) {
|
|
1672
1839
|
this.getElement().style.display = "none";
|
|
1673
1840
|
return;
|
|
1674
1841
|
}
|
|
1675
|
-
for (const [
|
|
1676
|
-
switch (
|
|
1842
|
+
for (const [o] of s)
|
|
1843
|
+
switch (o) {
|
|
1677
1844
|
case "paypal": {
|
|
1678
1845
|
if (a) {
|
|
1679
|
-
const l = new
|
|
1846
|
+
const l = new Bt({
|
|
1680
1847
|
checkoutProfile: t,
|
|
1681
1848
|
formData: i,
|
|
1682
1849
|
onSubmit: a
|
|
@@ -1698,7 +1865,7 @@ class Bt extends h {
|
|
|
1698
1865
|
// break;
|
|
1699
1866
|
default:
|
|
1700
1867
|
console.warn(
|
|
1701
|
-
`[PaymentMethods] Unsupported payment method: ${
|
|
1868
|
+
`[PaymentMethods] Unsupported payment method: ${o}`
|
|
1702
1869
|
);
|
|
1703
1870
|
break;
|
|
1704
1871
|
}
|
|
@@ -1712,7 +1879,7 @@ class Bt extends h {
|
|
|
1712
1879
|
}
|
|
1713
1880
|
}
|
|
1714
1881
|
const Ot = 17;
|
|
1715
|
-
class
|
|
1882
|
+
class qt extends h {
|
|
1716
1883
|
styles;
|
|
1717
1884
|
isHovered = !1;
|
|
1718
1885
|
constructor(e) {
|
|
@@ -1739,7 +1906,7 @@ class Kt {
|
|
|
1739
1906
|
button;
|
|
1740
1907
|
constructor(e) {
|
|
1741
1908
|
const { disabled: t, checkoutProfile: i, translationFunc: a } = e;
|
|
1742
|
-
this.button = new
|
|
1909
|
+
this.button = new qt({
|
|
1743
1910
|
text: a(
|
|
1744
1911
|
`buttonTexts.${i?.layout.actionButton.translationKey}`
|
|
1745
1912
|
),
|
|
@@ -1767,7 +1934,7 @@ class Kt {
|
|
|
1767
1934
|
}
|
|
1768
1935
|
}
|
|
1769
1936
|
const jt = "https://test-htp.tokenex.com/Iframe/Iframe-v3.min.js", Ut = "https://htp.tokenex.com/iframe/iframe-v3.min.js";
|
|
1770
|
-
class
|
|
1937
|
+
class _t extends h {
|
|
1771
1938
|
options;
|
|
1772
1939
|
isSubmitting = !1;
|
|
1773
1940
|
scriptCleanup;
|
|
@@ -1781,6 +1948,12 @@ class qt extends h {
|
|
|
1781
1948
|
paymentMethods;
|
|
1782
1949
|
spinner;
|
|
1783
1950
|
alert;
|
|
1951
|
+
// Focus management
|
|
1952
|
+
focusManager = new wt();
|
|
1953
|
+
// Event handler references
|
|
1954
|
+
emailFocusHandler;
|
|
1955
|
+
cardExpiryFocusHandler;
|
|
1956
|
+
nameFocusHandler;
|
|
1784
1957
|
// factories
|
|
1785
1958
|
formManager = X();
|
|
1786
1959
|
checkoutProfile;
|
|
@@ -1791,7 +1964,7 @@ class qt extends h {
|
|
|
1791
1964
|
apiKey: e.apiKey,
|
|
1792
1965
|
profileId: e.profileId,
|
|
1793
1966
|
environment: e.environment
|
|
1794
|
-
}), e.locale && this.translation.setLocale(e.locale), this.getElement().addEventListener("submit", this.handleSubmit), this.getElement().addEventListener("keydown", this.handleKeyDown), this.formManager.subscribe(this.handleFormStateChange), this.checkoutProfile.subscribe(this.handleProfileStateChange), this.initializeForm(), this.appendTo(e.container);
|
|
1967
|
+
}), e.locale && this.translation.setLocale(e.locale), this.localTouchedFields = /* @__PURE__ */ new Set(), this.getElement().addEventListener("submit", this.handleSubmit), this.getElement().addEventListener("keydown", this.handleKeyDown), this.formManager.subscribe(this.handleFormStateChange), this.checkoutProfile.subscribe(this.handleProfileStateChange), this.initializeForm(), this.appendTo(e.container);
|
|
1795
1968
|
}
|
|
1796
1969
|
_getFormStateData() {
|
|
1797
1970
|
const e = this.formManager.getFormState();
|
|
@@ -1806,7 +1979,10 @@ class qt extends h {
|
|
|
1806
1979
|
};
|
|
1807
1980
|
}
|
|
1808
1981
|
handleFormStateChange = () => {
|
|
1809
|
-
this.
|
|
1982
|
+
const { formData: e, errors: t, touched: i } = this.formManager.getFormState(), a = this.iframeHook?.getState() || {};
|
|
1983
|
+
Object.keys(i).forEach((r) => {
|
|
1984
|
+
i[r] && this.localTouchedFields.add(r);
|
|
1985
|
+
}), this.focusManager.handleStateUpdate(e, t, i, a), this.updateFormUI();
|
|
1810
1986
|
};
|
|
1811
1987
|
handleProfileStateChange = (e) => {
|
|
1812
1988
|
if (!e.isLoading)
|
|
@@ -1851,7 +2027,7 @@ class qt extends h {
|
|
|
1851
2027
|
);
|
|
1852
2028
|
return;
|
|
1853
2029
|
}
|
|
1854
|
-
const { inputStyles: t, formContainerStyle: i } =
|
|
2030
|
+
const { inputStyles: t, formContainerStyle: i } = Mt(
|
|
1855
2031
|
e.checkoutProfile
|
|
1856
2032
|
);
|
|
1857
2033
|
this.applyFormContainerStyles(i);
|
|
@@ -1881,10 +2057,10 @@ class qt extends h {
|
|
|
1881
2057
|
isCvvTouched = !1;
|
|
1882
2058
|
handleIframeStateChange = (e) => {
|
|
1883
2059
|
if (e.iframeConfig?.supportedPaymentMethods && this.paymentMethods) {
|
|
1884
|
-
const
|
|
1885
|
-
|
|
2060
|
+
const r = this.checkoutProfile.getState();
|
|
2061
|
+
r.checkoutProfile && (this.element.removeChild(this.paymentMethods.getElement()), this.createPaymentMethods(r.checkoutProfile, !0));
|
|
1886
2062
|
}
|
|
1887
|
-
this.cardSection && (e.isFocused && (this.isCcTouched = !0), e.isCvvFocused && (this.isCvvTouched = !0), this.cardSection.updateCardNumberValidation(
|
|
2063
|
+
this.cardSection && (e.isFocused && (this.isCcTouched = !0, this.handleFieldFocus("cardNumber")), e.isCvvFocused && (this.isCvvTouched = !0, this.handleFieldFocus("cardCvv")), this.cardSection.updateCardNumberValidation(
|
|
1888
2064
|
e.isFocused,
|
|
1889
2065
|
e.isCcValid,
|
|
1890
2066
|
this.translation.t,
|
|
@@ -1895,6 +2071,8 @@ class qt extends h {
|
|
|
1895
2071
|
this.translation.t,
|
|
1896
2072
|
this.isCvvTouched
|
|
1897
2073
|
), this.cardSection.updateCardType(e.possibleCardType), this.cardSection.setLoading(e.loadingIframe)), e.loadingIframe || this.setLoadingState(!1), this.submitButton && this.submitButton.setDisabled(this.isFormDisabled());
|
|
2074
|
+
const { formData: t, errors: i, touched: a } = this.formManager.getFormState();
|
|
2075
|
+
this.focusManager.handleStateUpdate(t, i, a, e);
|
|
1898
2076
|
};
|
|
1899
2077
|
createCardSection = (e) => {
|
|
1900
2078
|
if (!this.cardSection)
|
|
@@ -1926,6 +2104,17 @@ class qt extends h {
|
|
|
1926
2104
|
onChange: this.handleChange,
|
|
1927
2105
|
onBlur: this.handleBlur,
|
|
1928
2106
|
translationFunc: this.translation.t
|
|
2107
|
+
});
|
|
2108
|
+
const s = this.cardSection.getElement().querySelector('input[name="cardExpiry"]');
|
|
2109
|
+
s && (this.cardExpiryFocusHandler = () => this.handleFieldFocus("cardExpiry"), s.addEventListener(
|
|
2110
|
+
"focus",
|
|
2111
|
+
this.cardExpiryFocusHandler
|
|
2112
|
+
)), this.focusManager.registerField("cardExpiry", {
|
|
2113
|
+
focus: () => this.cardSection?.focusField("cardExpiry")
|
|
2114
|
+
}), this.focusManager.registerField("cardNumber", {
|
|
2115
|
+
focus: () => this.iframeHook?.focusCardNumber()
|
|
2116
|
+
}), this.focusManager.registerField("cardCvv", {
|
|
2117
|
+
focus: () => this.iframeHook?.focusCvv()
|
|
1929
2118
|
}), this.element.appendChild(this.cardSection.getElement());
|
|
1930
2119
|
} catch (t) {
|
|
1931
2120
|
console.error("Error creating card section:", t), this.setErrorMessage("Card section temporarily unavailable");
|
|
@@ -1987,7 +2176,7 @@ class qt extends h {
|
|
|
1987
2176
|
if (!e?.additionalPaymentMethods)
|
|
1988
2177
|
return;
|
|
1989
2178
|
const i = this.iframeHook?.getState().iframeConfig?.supportedPaymentMethods, { formData: a } = this._getFormStateData();
|
|
1990
|
-
this.paymentMethods = new
|
|
2179
|
+
this.paymentMethods = new Ht({
|
|
1991
2180
|
checkoutProfile: e,
|
|
1992
2181
|
formData: a,
|
|
1993
2182
|
supportedPaymentMethods: i,
|
|
@@ -2005,7 +2194,7 @@ class qt extends h {
|
|
|
2005
2194
|
createEmailField(e) {
|
|
2006
2195
|
try {
|
|
2007
2196
|
const { formData: t, errors: i, touched: a } = this._getFormStateData();
|
|
2008
|
-
this.emailField = new
|
|
2197
|
+
this.emailField = new $t({
|
|
2009
2198
|
value: t.email,
|
|
2010
2199
|
onChange: this.handleChange,
|
|
2011
2200
|
onBlur: this.handleBlur,
|
|
@@ -2013,7 +2202,7 @@ class qt extends h {
|
|
|
2013
2202
|
errorMsg: i.email,
|
|
2014
2203
|
checkoutProfile: e,
|
|
2015
2204
|
translationFunc: this.translation.t
|
|
2016
|
-
}), this.element.appendChild(this.emailField.getElement());
|
|
2205
|
+
}), this.emailFocusHandler = () => this.handleFieldFocus("email"), this.emailField.getElement().addEventListener("focus", this.emailFocusHandler, !0), this.focusManager.registerField("email", this.emailField), this.element.appendChild(this.emailField.getElement());
|
|
2017
2206
|
} catch (t) {
|
|
2018
2207
|
throw console.error("Error creating email field:", t), t;
|
|
2019
2208
|
}
|
|
@@ -2029,7 +2218,9 @@ class qt extends h {
|
|
|
2029
2218
|
errorMsg: i.name,
|
|
2030
2219
|
checkoutProfile: e,
|
|
2031
2220
|
translationFunc: this.translation.t
|
|
2032
|
-
})
|
|
2221
|
+
});
|
|
2222
|
+
const r = this.cardholderSection.getElement().querySelector('input[name="name"]');
|
|
2223
|
+
r && (this.nameFocusHandler = () => this.handleFieldFocus("name"), r.addEventListener("focus", this.nameFocusHandler)), this.focusManager.registerField("name", this.cardholderSection), this.element.appendChild(this.cardholderSection.getElement());
|
|
2033
2224
|
} catch (t) {
|
|
2034
2225
|
throw console.error("Error creating cardholder section:", t), t;
|
|
2035
2226
|
}
|
|
@@ -2045,13 +2236,24 @@ class qt extends h {
|
|
|
2045
2236
|
throw console.error("Error creating submit button:", t), t;
|
|
2046
2237
|
}
|
|
2047
2238
|
}
|
|
2239
|
+
// Track locally touched fields to avoid redundant state checks
|
|
2240
|
+
localTouchedFields = /* @__PURE__ */ new Set();
|
|
2048
2241
|
handleChange = (e) => {
|
|
2049
|
-
const t = e.target, { name: i, value: a } = t;
|
|
2050
|
-
this.formManager.handleChange(
|
|
2242
|
+
const t = e.target, { name: i, value: a } = t, r = i;
|
|
2243
|
+
this.formManager.handleChange(r, a), this.localTouchedFields.has(r) || (this.localTouchedFields.add(r), this.formManager.handleBlur(r, a));
|
|
2244
|
+
const { formData: s, errors: o, touched: l } = this.formManager.getFormState(), c = this.iframeHook?.getState() || {};
|
|
2245
|
+
this.focusManager.handleStateUpdate(s, o, l, c);
|
|
2051
2246
|
};
|
|
2052
2247
|
handleBlur = (e) => {
|
|
2053
|
-
const t = e.target, { name: i, value: a } = t;
|
|
2054
|
-
this.formManager.handleBlur(
|
|
2248
|
+
const t = e.target, { name: i, value: a } = t, r = i;
|
|
2249
|
+
this.localTouchedFields.add(r), this.formManager.handleBlur(r, a);
|
|
2250
|
+
const { formData: s, errors: o, touched: l } = this.formManager.getFormState(), c = this.iframeHook?.getState() || {};
|
|
2251
|
+
l[r] || this.focusManager.handleStateUpdate(
|
|
2252
|
+
s,
|
|
2253
|
+
o,
|
|
2254
|
+
l,
|
|
2255
|
+
c
|
|
2256
|
+
);
|
|
2055
2257
|
};
|
|
2056
2258
|
updateFormUI() {
|
|
2057
2259
|
const e = this.formManager.getFormState();
|
|
@@ -2086,10 +2288,10 @@ class qt extends h {
|
|
|
2086
2288
|
this.options.onLoadingStateChange(e);
|
|
2087
2289
|
return;
|
|
2088
2290
|
}
|
|
2089
|
-
e ? (this.hideSpinner(), this.spinner = new
|
|
2291
|
+
e ? (this.hideSpinner(), this.spinner = new $(), this.element.appendChild(this.spinner.getElement())) : this.hideSpinner();
|
|
2090
2292
|
}
|
|
2091
2293
|
showSpinner(e) {
|
|
2092
|
-
this.hideSpinner(), this.spinner = new
|
|
2294
|
+
this.hideSpinner(), this.spinner = new $({ text: e }), this.element.appendChild(this.spinner.getElement());
|
|
2093
2295
|
}
|
|
2094
2296
|
hideSpinner() {
|
|
2095
2297
|
this.spinner && (this.spinner.getElement().remove(), this.spinner = void 0);
|
|
@@ -2143,13 +2345,34 @@ class qt extends h {
|
|
|
2143
2345
|
* Clean up resources when the form is destroyed
|
|
2144
2346
|
*/
|
|
2145
2347
|
destroy() {
|
|
2146
|
-
this.scriptCleanup && (this.scriptCleanup(), this.scriptCleanup = void 0), this.fontCleanup && (this.fontCleanup(), this.fontCleanup = void 0), this.iframeHook && this.iframeHook.cleanup(), this.getElement().removeEventListener("submit", this.handleSubmit), this.getElement().removeEventListener("keydown", this.handleKeyDown), this.getElement().removeEventListener("keydown", this.handleKeyDown), this.emailField
|
|
2348
|
+
if (this.scriptCleanup && (this.scriptCleanup(), this.scriptCleanup = void 0), this.fontCleanup && (this.fontCleanup(), this.fontCleanup = void 0), this.iframeHook && this.iframeHook.cleanup(), this.localTouchedFields.clear(), this.getElement().removeEventListener("submit", this.handleSubmit), this.getElement().removeEventListener("keydown", this.handleKeyDown), this.getElement().removeEventListener("keydown", this.handleKeyDown), this.emailField) {
|
|
2349
|
+
const e = this.emailField.getElement().querySelector('input[name="email"]');
|
|
2350
|
+
e && this.emailFocusHandler && e.removeEventListener("focus", this.emailFocusHandler), this.emailField.getElement().remove(), this.emailField = void 0;
|
|
2351
|
+
}
|
|
2352
|
+
if (this.cardSection) {
|
|
2353
|
+
const e = this.cardSection.getElement().querySelector('input[name="cardExpiry"]');
|
|
2354
|
+
e && this.cardExpiryFocusHandler && e.removeEventListener(
|
|
2355
|
+
"focus",
|
|
2356
|
+
this.cardExpiryFocusHandler
|
|
2357
|
+
), this.cardSection.getElement().remove(), this.cardSection = void 0;
|
|
2358
|
+
}
|
|
2359
|
+
if (this.cardholderSection) {
|
|
2360
|
+
const e = this.cardholderSection.getElement().querySelector('input[name="name"]');
|
|
2361
|
+
e && this.nameFocusHandler && e.removeEventListener("focus", this.nameFocusHandler), this.cardholderSection.getElement().remove(), this.cardholderSection = void 0;
|
|
2362
|
+
}
|
|
2363
|
+
this.submitButton && (this.submitButton.getElement().remove(), this.submitButton = void 0), this.paymentMethods && (this.paymentMethods.getElement().remove(), this.paymentMethods = void 0), this.spinner && (this.spinner.getElement().remove(), this.spinner = void 0), this.alert && (this.alert.getElement().remove(), this.alert = void 0), this.getElement().remove();
|
|
2147
2364
|
}
|
|
2148
2365
|
handleKeyDown = (e) => {
|
|
2149
2366
|
e.key === "Enter" && !this.isFormDisabled() && (e.target instanceof HTMLTextAreaElement || (e.preventDefault(), this.handleSubmit(e)));
|
|
2150
2367
|
};
|
|
2368
|
+
/**
|
|
2369
|
+
* Handle focus events on form fields and update focus manager
|
|
2370
|
+
*/
|
|
2371
|
+
handleFieldFocus = (e) => {
|
|
2372
|
+
this.focusManager.handleFieldFocus(e);
|
|
2373
|
+
};
|
|
2151
2374
|
}
|
|
2152
|
-
class
|
|
2375
|
+
class Gt {
|
|
2153
2376
|
container = null;
|
|
2154
2377
|
options;
|
|
2155
2378
|
onSubmit;
|
|
@@ -2164,7 +2387,7 @@ class _t {
|
|
|
2164
2387
|
this.container && this.form && (this.form && e.errorMsg && !this.options.disableErrorMessages ? this.form.setErrorMessage(e.errorMsg) : this.renderForm(e.errorMsg));
|
|
2165
2388
|
}
|
|
2166
2389
|
renderForm(e) {
|
|
2167
|
-
this.container && (this.form && (this.form.destroy(), this.form = null), this.form = new
|
|
2390
|
+
this.container && (this.form && (this.form.destroy(), this.form = null), this.form = new _t({
|
|
2168
2391
|
apiKey: this.options.apiKey,
|
|
2169
2392
|
onSubmit: this.onSubmit,
|
|
2170
2393
|
locale: this.options.locale,
|
|
@@ -2180,7 +2403,7 @@ class _t {
|
|
|
2180
2403
|
this.form && (this.form.destroy(), this.form = null);
|
|
2181
2404
|
}
|
|
2182
2405
|
}
|
|
2183
|
-
class
|
|
2406
|
+
class Yt {
|
|
2184
2407
|
state;
|
|
2185
2408
|
listeners = /* @__PURE__ */ new Set();
|
|
2186
2409
|
constructor(e) {
|
|
@@ -2202,20 +2425,20 @@ class Gt {
|
|
|
2202
2425
|
this.listeners.forEach((t) => t(e));
|
|
2203
2426
|
}
|
|
2204
2427
|
}
|
|
2205
|
-
const
|
|
2206
|
-
class
|
|
2428
|
+
const Zt = "en";
|
|
2429
|
+
class Jt {
|
|
2207
2430
|
config;
|
|
2208
2431
|
apiService;
|
|
2209
2432
|
formManager;
|
|
2210
2433
|
stateManager;
|
|
2211
2434
|
constructor(e) {
|
|
2212
|
-
this.config = this.validateConfig(e), this.apiService = new
|
|
2435
|
+
this.config = this.validateConfig(e), this.apiService = new O(
|
|
2213
2436
|
this.config.apiKey,
|
|
2214
2437
|
this.config.environment
|
|
2215
|
-
), this.stateManager = new
|
|
2438
|
+
), this.stateManager = new Yt({
|
|
2216
2439
|
mounted: !1,
|
|
2217
2440
|
form: null
|
|
2218
|
-
}), this.formManager = new
|
|
2441
|
+
}), this.formManager = new Gt(
|
|
2219
2442
|
{
|
|
2220
2443
|
locale: this.config.locale,
|
|
2221
2444
|
apiKey: this.config.apiKey,
|
|
@@ -2240,7 +2463,7 @@ class Zt {
|
|
|
2240
2463
|
paymentId: e.paymentId,
|
|
2241
2464
|
returnUrl: e.returnUrl,
|
|
2242
2465
|
environment: e.environment,
|
|
2243
|
-
locale: e.locale ||
|
|
2466
|
+
locale: e.locale || Zt,
|
|
2244
2467
|
disableErrorMessages: e.disableErrorMessages ?? !1,
|
|
2245
2468
|
manualActionHandling: e.manualActionHandling ?? !1,
|
|
2246
2469
|
callbacks: {
|
|
@@ -2303,14 +2526,14 @@ class Zt {
|
|
|
2303
2526
|
t && this.formManager.update({ errorMsg: e.details?.message });
|
|
2304
2527
|
}
|
|
2305
2528
|
}
|
|
2306
|
-
typeof globalThis < "u" && (globalThis.OdusCheckout =
|
|
2529
|
+
typeof globalThis < "u" && (globalThis.OdusCheckout = Jt);
|
|
2307
2530
|
export {
|
|
2308
|
-
|
|
2531
|
+
Jt as OdusCheckout,
|
|
2309
2532
|
ce as deLocale,
|
|
2310
2533
|
ve as enLocale,
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2534
|
+
Le as esLocale,
|
|
2535
|
+
De as frLocale,
|
|
2536
|
+
Ue as itLocale,
|
|
2314
2537
|
et as plLocale,
|
|
2315
2538
|
ct as ptLocale,
|
|
2316
2539
|
vt as trLocale
|