fansunited-data-layer 0.10.0 → 0.11.1
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/api/fansunited/football/index.d.ts +1 -1
- package/api/fansunited/football/index.d.ts.map +1 -1
- package/api/fansunited/football/matches/index.d.ts +36 -0
- package/api/fansunited/football/matches/index.d.ts.map +1 -1
- package/api/fansunited/football/matches/transformer.d.ts.map +1 -1
- package/api/fansunited/football/matches/types.d.ts +1 -0
- package/api/fansunited/football/matches/types.d.ts.map +1 -1
- package/api/fansunited/index.d.ts +1 -1
- package/api/fansunited/index.d.ts.map +1 -1
- package/api/sportal365-sports/basketball/games/transformers/game.d.ts.map +1 -1
- package/api/sportal365-sports/football/matches/transformers/match.d.ts.map +1 -1
- package/api/sportal365-sports/tennis/matches/transformers/match.d.ts.map +1 -1
- package/client.cjs +1 -1
- package/client.js +2 -2
- package/fansunited-data-layer.cjs +1 -1
- package/fansunited-data-layer.js +446 -396
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/matches-CINPI4_G.cjs +1 -0
- package/{matches-dKvggZia.js → matches-CIPlUJky.js} +2 -0
- package/package.json +1 -1
- package/types/canonical/match.types.d.ts +1 -0
- package/types/canonical/match.types.d.ts.map +1 -1
- package/matches-D5jlWsqr.cjs +0 -1
package/fansunited-data-layer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { l as
|
|
1
|
+
import { t as b, g as E, f as Vt, c as ot, S as Kt, a as Pt, b as Xt, d as Jt, e as Zt, h as wt, i as st, j as te, k as ee } from "./matches-CIPlUJky.js";
|
|
2
|
+
import { l as ts, m as es, n as ns, o as os, p as ss, q as is, r as rs, s as as, u as cs, v as ls, w as ds, x as us, y as fs, z as hs, A as ms, B as gs, C as ps, D as ys, E as Ts, F as _s, G as vs } from "./matches-CIPlUJky.js";
|
|
3
3
|
import { useMemo as j } from "react";
|
|
4
4
|
function ne(t) {
|
|
5
5
|
return {
|
|
@@ -15,12 +15,12 @@ function ne(t) {
|
|
|
15
15
|
name: t.country.name,
|
|
16
16
|
code: void 0,
|
|
17
17
|
flag: t.country.url_flag ?? void 0,
|
|
18
|
-
providerRef:
|
|
18
|
+
providerRef: b(t.country.uuid)
|
|
19
19
|
},
|
|
20
20
|
assets: t.url_logo ? {
|
|
21
21
|
logo: t.url_logo
|
|
22
22
|
} : void 0,
|
|
23
|
-
providerRef:
|
|
23
|
+
providerRef: b(t.uuid)
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
function oe(t) {
|
|
@@ -37,12 +37,12 @@ function oe(t) {
|
|
|
37
37
|
name: t.country.name,
|
|
38
38
|
code: void 0,
|
|
39
39
|
flag: t.country.url_flag ?? void 0,
|
|
40
|
-
providerRef:
|
|
40
|
+
providerRef: b(t.country.uuid)
|
|
41
41
|
},
|
|
42
42
|
assets: t.url_thumb ? {
|
|
43
43
|
photo: t.url_thumb
|
|
44
44
|
} : void 0,
|
|
45
|
-
providerRef:
|
|
45
|
+
providerRef: b(t.uuid)
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
function se(t) {
|
|
@@ -60,12 +60,12 @@ function se(t) {
|
|
|
60
60
|
name: t.country.name,
|
|
61
61
|
code: void 0,
|
|
62
62
|
flag: t.country.url_flag ?? void 0,
|
|
63
|
-
providerRef:
|
|
63
|
+
providerRef: b(t.country.uuid)
|
|
64
64
|
},
|
|
65
65
|
assets: t.url_logo ? {
|
|
66
66
|
logo: t.url_logo
|
|
67
67
|
} : void 0,
|
|
68
|
-
providerRef:
|
|
68
|
+
providerRef: b(t.uuid)
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
function ie(t) {
|
|
@@ -80,12 +80,12 @@ function ie(t) {
|
|
|
80
80
|
name: t.country.name,
|
|
81
81
|
code: void 0,
|
|
82
82
|
flag: t.country.url_flag ?? void 0,
|
|
83
|
-
providerRef:
|
|
83
|
+
providerRef: b(t.country.uuid)
|
|
84
84
|
},
|
|
85
85
|
assets: t.url_thumb ? {
|
|
86
86
|
photo: t.url_thumb
|
|
87
87
|
} : void 0,
|
|
88
|
-
providerRef:
|
|
88
|
+
providerRef: b(t.uuid)
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
function re(t) {
|
|
@@ -102,16 +102,16 @@ function re(t) {
|
|
|
102
102
|
name: t.city.country.name,
|
|
103
103
|
code: void 0,
|
|
104
104
|
flag: t.city.country.url_flag ?? void 0,
|
|
105
|
-
providerRef:
|
|
105
|
+
providerRef: b(t.city.country.uuid)
|
|
106
106
|
},
|
|
107
|
-
providerRef:
|
|
107
|
+
providerRef: b(t.city.uuid)
|
|
108
108
|
},
|
|
109
109
|
country: {
|
|
110
110
|
id: t.country.id.toString(),
|
|
111
111
|
name: t.country.name,
|
|
112
112
|
code: void 0,
|
|
113
113
|
flag: t.country.url_flag ?? void 0,
|
|
114
|
-
providerRef:
|
|
114
|
+
providerRef: b(t.country.uuid)
|
|
115
115
|
},
|
|
116
116
|
profile: {
|
|
117
117
|
latitude: t.profile.lat,
|
|
@@ -121,7 +121,7 @@ function re(t) {
|
|
|
121
121
|
assets: t.url_thumb ? {
|
|
122
122
|
image: t.url_thumb
|
|
123
123
|
} : void 0,
|
|
124
|
-
providerRef:
|
|
124
|
+
providerRef: b(t.uuid)
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
function ae(t) {
|
|
@@ -136,12 +136,12 @@ function ae(t) {
|
|
|
136
136
|
name: t.country.name,
|
|
137
137
|
code: void 0,
|
|
138
138
|
flag: t.country.url_flag ?? void 0,
|
|
139
|
-
providerRef:
|
|
139
|
+
providerRef: b(t.country.uuid)
|
|
140
140
|
},
|
|
141
141
|
assets: t.url_thumb ? {
|
|
142
142
|
photo: t.url_thumb
|
|
143
143
|
} : void 0,
|
|
144
|
-
providerRef:
|
|
144
|
+
providerRef: b(t.uuid)
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
147
|
function ce(t) {
|
|
@@ -168,7 +168,7 @@ async function zn(t, e) {
|
|
|
168
168
|
results: [],
|
|
169
169
|
query: t.query || ""
|
|
170
170
|
};
|
|
171
|
-
const n = e ||
|
|
171
|
+
const n = e || E(), { sportal365Sports: o } = n, s = t.entityTypes && t.entityTypes.length > 0 ? t.entityTypes : ["tournament", "player", "team", "president", "venue", "coach"], i = await Vt.get({
|
|
172
172
|
path: "/search",
|
|
173
173
|
params: {
|
|
174
174
|
query: t.query.trim(),
|
|
@@ -189,7 +189,7 @@ async function zn(t, e) {
|
|
|
189
189
|
query: t.query
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
-
const le = ot(
|
|
192
|
+
const le = ot(Kt);
|
|
193
193
|
function de(t) {
|
|
194
194
|
const e = {
|
|
195
195
|
FINISHED: "finished",
|
|
@@ -207,7 +207,7 @@ function de(t) {
|
|
|
207
207
|
type: n
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Et(t) {
|
|
211
211
|
return {
|
|
212
212
|
id: t.id,
|
|
213
213
|
name: t.name,
|
|
@@ -290,22 +290,23 @@ function pe(t) {
|
|
|
290
290
|
return {
|
|
291
291
|
id: t.id,
|
|
292
292
|
slug: t.slug,
|
|
293
|
+
sport: "basketball",
|
|
293
294
|
status: de(t.status),
|
|
294
295
|
timing: ue(t),
|
|
295
|
-
competitorOne:
|
|
296
|
-
competitorTwo:
|
|
296
|
+
competitorOne: Et(t.home_team),
|
|
297
|
+
competitorTwo: Et(t.away_team),
|
|
297
298
|
competition: fe(t),
|
|
298
299
|
round: t.round ? {
|
|
299
300
|
id: t.round.id,
|
|
300
301
|
key: t.round.uuid,
|
|
301
302
|
name: t.round.name,
|
|
302
303
|
type: "REGULAR",
|
|
303
|
-
providerRef:
|
|
304
|
+
providerRef: b(t.round.uuid)
|
|
304
305
|
} : void 0,
|
|
305
306
|
venue: he(t.arena),
|
|
306
307
|
score: me(t.score),
|
|
307
308
|
winner: ge(t),
|
|
308
|
-
odds: t.odds ?
|
|
309
|
+
odds: t.odds ? Pt(t.odds) : void 0,
|
|
309
310
|
coverage: t.coverage === "NOT_LIVE" ? "UNKNOWN" : t.coverage,
|
|
310
311
|
providerRef: [
|
|
311
312
|
{
|
|
@@ -316,7 +317,7 @@ function pe(t) {
|
|
|
316
317
|
};
|
|
317
318
|
}
|
|
318
319
|
async function Yn(t, e) {
|
|
319
|
-
const n = e ||
|
|
320
|
+
const n = e || E(), { sportal365Sports: o } = n;
|
|
320
321
|
return (await le.get({
|
|
321
322
|
path: "/games",
|
|
322
323
|
params: {
|
|
@@ -338,7 +339,7 @@ async function Yn(t, e) {
|
|
|
338
339
|
config: n
|
|
339
340
|
})).games.map(pe);
|
|
340
341
|
}
|
|
341
|
-
const ye = ot(
|
|
342
|
+
const ye = ot(Xt);
|
|
342
343
|
function Te(t) {
|
|
343
344
|
const e = {
|
|
344
345
|
FINISHED: "finished",
|
|
@@ -355,7 +356,7 @@ function Te(t) {
|
|
|
355
356
|
type: n
|
|
356
357
|
};
|
|
357
358
|
}
|
|
358
|
-
function
|
|
359
|
+
function Ft(t) {
|
|
359
360
|
if (t.type === "PLAYER")
|
|
360
361
|
return {
|
|
361
362
|
id: t.id,
|
|
@@ -477,21 +478,22 @@ function Ce(t) {
|
|
|
477
478
|
return {
|
|
478
479
|
id: t.id,
|
|
479
480
|
slug: t.slug,
|
|
481
|
+
sport: "tennis",
|
|
480
482
|
status: Te(t.status),
|
|
481
483
|
timing: _e(t),
|
|
482
|
-
competitorOne:
|
|
483
|
-
competitorTwo:
|
|
484
|
+
competitorOne: Ft(e[0]),
|
|
485
|
+
competitorTwo: Ft(e[1]),
|
|
484
486
|
competition: ve(t),
|
|
485
487
|
round: t.round ? {
|
|
486
488
|
id: t.round.id,
|
|
487
489
|
key: t.round.uuid,
|
|
488
490
|
name: t.round.name,
|
|
489
491
|
type: "REGULAR",
|
|
490
|
-
providerRef:
|
|
492
|
+
providerRef: b(t.round.uuid)
|
|
491
493
|
} : void 0,
|
|
492
494
|
score: Se(t),
|
|
493
495
|
winner: Ae(t),
|
|
494
|
-
odds: t.odds ?
|
|
496
|
+
odds: t.odds ? Pt(t.odds) : void 0,
|
|
495
497
|
coverage: t.coverage?.type === "NOT_LIVE" ? "UNKNOWN" : t.coverage?.type,
|
|
496
498
|
metadata: {
|
|
497
499
|
matchType: t.type,
|
|
@@ -508,7 +510,7 @@ function Ce(t) {
|
|
|
508
510
|
};
|
|
509
511
|
}
|
|
510
512
|
async function jn(t, e) {
|
|
511
|
-
const n = e ||
|
|
513
|
+
const n = e || E(), { sportal365Sports: o } = n;
|
|
512
514
|
return (await ye.get({
|
|
513
515
|
path: "/matches/livescore",
|
|
514
516
|
params: {
|
|
@@ -532,8 +534,8 @@ async function jn(t, e) {
|
|
|
532
534
|
config: n
|
|
533
535
|
})).matches.map(Ce);
|
|
534
536
|
}
|
|
535
|
-
const Oe = ot(
|
|
536
|
-
function
|
|
537
|
+
const Oe = ot(Jt);
|
|
538
|
+
function x(t) {
|
|
537
539
|
return {
|
|
538
540
|
language: t.language,
|
|
539
541
|
name: t.name,
|
|
@@ -555,13 +557,13 @@ function z(t) {
|
|
|
555
557
|
name: t.name,
|
|
556
558
|
shortName: t.short_name ?? void 0,
|
|
557
559
|
threeLetterCode: t.three_letter_code ?? void 0,
|
|
558
|
-
translations: t.translations.map(
|
|
560
|
+
translations: t.translations.map(x),
|
|
559
561
|
displayAsset: U(t.display_asset),
|
|
560
562
|
slug: t.slug,
|
|
561
563
|
providerRef: t.id
|
|
562
564
|
};
|
|
563
565
|
}
|
|
564
|
-
function
|
|
566
|
+
function Tt(t) {
|
|
565
567
|
return {
|
|
566
568
|
entityType: "team",
|
|
567
569
|
id: t.id,
|
|
@@ -569,7 +571,7 @@ function yt(t) {
|
|
|
569
571
|
name: t.name,
|
|
570
572
|
shortName: t.short_name ?? void 0,
|
|
571
573
|
threeLetterCode: t.three_letter_code ?? void 0,
|
|
572
|
-
translations: t.translations.map(
|
|
574
|
+
translations: t.translations.map(x),
|
|
573
575
|
displayAsset: U(t.display_asset),
|
|
574
576
|
slug: t.slug,
|
|
575
577
|
tagScore: t.tag_score ?? void 0,
|
|
@@ -583,7 +585,7 @@ function yt(t) {
|
|
|
583
585
|
providerRef: t.id
|
|
584
586
|
};
|
|
585
587
|
}
|
|
586
|
-
function
|
|
588
|
+
function Mt(t) {
|
|
587
589
|
return {
|
|
588
590
|
entityType: "city",
|
|
589
591
|
id: t.id,
|
|
@@ -591,7 +593,7 @@ function Pt(t) {
|
|
|
591
593
|
name: t.name,
|
|
592
594
|
shortName: t.short_name ?? void 0,
|
|
593
595
|
threeLetterCode: t.three_letter_code ?? void 0,
|
|
594
|
-
translations: t.translations.map(
|
|
596
|
+
translations: t.translations.map(x),
|
|
595
597
|
displayAsset: U(t.display_asset),
|
|
596
598
|
slug: t.slug,
|
|
597
599
|
tagScore: t.tag_score ?? void 0,
|
|
@@ -608,7 +610,7 @@ function Ee(t) {
|
|
|
608
610
|
name: t.name,
|
|
609
611
|
shortName: t.short_name ?? void 0,
|
|
610
612
|
threeLetterCode: t.three_letter_code ?? void 0,
|
|
611
|
-
translations: t.translations.map(
|
|
613
|
+
translations: t.translations.map(x),
|
|
612
614
|
displayAsset: U(t.display_asset),
|
|
613
615
|
slug: t.slug,
|
|
614
616
|
tagScore: t.tag_score ?? void 0,
|
|
@@ -626,7 +628,7 @@ function Fe(t) {
|
|
|
626
628
|
name: t.name,
|
|
627
629
|
shortName: t.short_name ?? void 0,
|
|
628
630
|
threeLetterCode: t.three_letter_code ?? void 0,
|
|
629
|
-
translations: t.translations.map(
|
|
631
|
+
translations: t.translations.map(x),
|
|
630
632
|
displayAsset: U(t.display_asset),
|
|
631
633
|
slug: t.slug,
|
|
632
634
|
tagScore: t.tag_score ?? void 0,
|
|
@@ -646,7 +648,7 @@ function Le(t) {
|
|
|
646
648
|
name: t.name,
|
|
647
649
|
shortName: t.short_name ?? void 0,
|
|
648
650
|
threeLetterCode: t.three_letter_code ?? void 0,
|
|
649
|
-
translations: t.translations.map(
|
|
651
|
+
translations: t.translations.map(x),
|
|
650
652
|
displayAsset: U(t.display_asset),
|
|
651
653
|
slug: t.slug,
|
|
652
654
|
tagScore: t.tag_score ?? void 0,
|
|
@@ -665,7 +667,7 @@ function be(t) {
|
|
|
665
667
|
name: t.name,
|
|
666
668
|
shortName: t.short_name ?? void 0,
|
|
667
669
|
threeLetterCode: t.three_letter_code ?? void 0,
|
|
668
|
-
translations: t.translations.map(
|
|
670
|
+
translations: t.translations.map(x),
|
|
669
671
|
displayAsset: U(t.display_asset),
|
|
670
672
|
slug: t.slug,
|
|
671
673
|
tagScore: t.tag_score ?? void 0,
|
|
@@ -684,13 +686,13 @@ function Ne(t) {
|
|
|
684
686
|
name: t.name,
|
|
685
687
|
shortName: t.short_name ?? void 0,
|
|
686
688
|
threeLetterCode: t.three_letter_code ?? void 0,
|
|
687
|
-
translations: t.translations.map(
|
|
689
|
+
translations: t.translations.map(x),
|
|
688
690
|
displayAsset: U(t.display_asset),
|
|
689
691
|
slug: t.slug,
|
|
690
692
|
tagScore: t.tag_score ?? void 0,
|
|
691
693
|
sport: t.sport,
|
|
692
694
|
country: z(t.country),
|
|
693
|
-
city: t.city ?
|
|
695
|
+
city: t.city ? Mt(t.city) : void 0,
|
|
694
696
|
providerRef: t.id
|
|
695
697
|
};
|
|
696
698
|
}
|
|
@@ -702,7 +704,7 @@ function Re(t) {
|
|
|
702
704
|
name: t.name,
|
|
703
705
|
shortName: t.short_name ?? void 0,
|
|
704
706
|
threeLetterCode: t.three_letter_code ?? void 0,
|
|
705
|
-
translations: t.translations.map(
|
|
707
|
+
translations: t.translations.map(x),
|
|
706
708
|
displayAsset: U(t.display_asset),
|
|
707
709
|
slug: t.slug,
|
|
708
710
|
tagScore: t.tag_score ?? void 0,
|
|
@@ -722,15 +724,15 @@ function Ie(t) {
|
|
|
722
724
|
name: t.name,
|
|
723
725
|
shortName: t.short_name ?? void 0,
|
|
724
726
|
threeLetterCode: t.three_letter_code ?? void 0,
|
|
725
|
-
translations: t.translations.map(
|
|
727
|
+
translations: t.translations.map(x),
|
|
726
728
|
displayAsset: U(t.display_asset),
|
|
727
729
|
slug: t.slug,
|
|
728
730
|
tagScore: t.tag_score ?? void 0,
|
|
729
731
|
sport: t.sport,
|
|
730
732
|
competitionId: t.competition_id ?? void 0,
|
|
731
733
|
startTime: t.start_time ?? void 0,
|
|
732
|
-
homeTeam: t.home_team ?
|
|
733
|
-
awayTeam: t.away_team ?
|
|
734
|
+
homeTeam: t.home_team ? Tt(t.home_team) : void 0,
|
|
735
|
+
awayTeam: t.away_team ? Tt(t.away_team) : void 0,
|
|
734
736
|
providerRef: t.id
|
|
735
737
|
};
|
|
736
738
|
}
|
|
@@ -742,7 +744,7 @@ function Pe(t) {
|
|
|
742
744
|
name: t.name,
|
|
743
745
|
shortName: t.short_name ?? void 0,
|
|
744
746
|
threeLetterCode: t.three_letter_code ?? void 0,
|
|
745
|
-
translations: t.translations.map(
|
|
747
|
+
translations: t.translations.map(x),
|
|
746
748
|
displayAsset: U(t.display_asset),
|
|
747
749
|
slug: t.slug,
|
|
748
750
|
tagScore: t.tag_score ?? void 0,
|
|
@@ -753,9 +755,9 @@ function Pe(t) {
|
|
|
753
755
|
function Me(t) {
|
|
754
756
|
switch (t.entity_type) {
|
|
755
757
|
case "team":
|
|
756
|
-
return
|
|
758
|
+
return Tt(t);
|
|
757
759
|
case "city":
|
|
758
|
-
return
|
|
760
|
+
return Mt(t);
|
|
759
761
|
case "horse":
|
|
760
762
|
return Ee(t);
|
|
761
763
|
case "player":
|
|
@@ -780,7 +782,7 @@ function Me(t) {
|
|
|
780
782
|
}
|
|
781
783
|
}
|
|
782
784
|
async function qn(t = {}, e) {
|
|
783
|
-
const n = e ??
|
|
785
|
+
const n = e ?? E(), o = {};
|
|
784
786
|
t.name && (o.name = t.name), t.entityTypes && t.entityTypes.length > 0 && (o.entity_type = t.entityTypes.join(",")), t.sports && t.sports.length > 0 && (o.sport = t.sports.join(",")), t.eventStartTime && (o.event_start_time = t.eventStartTime), t.ids && t.ids.length > 0 && (o.ids = t.ids.join(",")), t.competitionIds && t.competitionIds.length > 0 && (o.competition_ids = t.competitionIds.join(",")), t.domain && (o.domain = t.domain), t.inputLanguage && (o.input_language = t.inputLanguage), t.translationLanguage && (o.translation_language = t.translationLanguage), t.limit !== void 0 && (o.limit = t.limit.toString()), t.offset !== void 0 && (o.offset = t.offset.toString());
|
|
785
787
|
const s = await Oe.get({
|
|
786
788
|
path: "/suggest",
|
|
@@ -796,7 +798,7 @@ async function qn(t = {}, e) {
|
|
|
796
798
|
query: t.name
|
|
797
799
|
};
|
|
798
800
|
}
|
|
799
|
-
const Ge = ot(
|
|
801
|
+
const Ge = ot(Zt);
|
|
800
802
|
function De(t) {
|
|
801
803
|
const e = {
|
|
802
804
|
RANK: null,
|
|
@@ -811,7 +813,7 @@ function De(t) {
|
|
|
811
813
|
};
|
|
812
814
|
return t in e ? e[t] : t.toLowerCase().replace(/_/g, "");
|
|
813
815
|
}
|
|
814
|
-
function
|
|
816
|
+
function Gt(t) {
|
|
815
817
|
return {
|
|
816
818
|
CHAMPIONS_LEAGUE: "championsLeague",
|
|
817
819
|
CHAMPIONS_LEAGUE_QUAL: "championsLeagueQual",
|
|
@@ -854,10 +856,10 @@ function Mt(t) {
|
|
|
854
856
|
WORLD_CUP: "worldCup"
|
|
855
857
|
}[t] ?? t.toLowerCase().replace(/_/g, "");
|
|
856
858
|
}
|
|
857
|
-
function
|
|
859
|
+
function xe(t) {
|
|
858
860
|
return t === "RELEGATION" || t === "RELEGATION_PLAYOFF" ? "BOTTOM" : t.includes("PLAYOFF") ? "MIDDLE" : "TOP";
|
|
859
861
|
}
|
|
860
|
-
function
|
|
862
|
+
function Ue(t, e) {
|
|
861
863
|
if (!e || e.length === 0) return;
|
|
862
864
|
const n = {
|
|
863
865
|
win: "W",
|
|
@@ -901,7 +903,7 @@ function ke(t) {
|
|
|
901
903
|
return e ? Number(e.value) : 0;
|
|
902
904
|
}
|
|
903
905
|
function $e(t) {
|
|
904
|
-
const e = t.rules?.length > 0 ? t.rules.map((n) =>
|
|
906
|
+
const e = t.rules?.length > 0 ? t.rules.map((n) => Gt(n.standing_api_rule_type)) : void 0;
|
|
905
907
|
return {
|
|
906
908
|
rank: ke(t.columns),
|
|
907
909
|
competitor: {
|
|
@@ -912,7 +914,7 @@ function $e(t) {
|
|
|
912
914
|
// Standings API doesn't include logo in team object
|
|
913
915
|
},
|
|
914
916
|
stats: He(t.columns),
|
|
915
|
-
form:
|
|
917
|
+
form: Ue(t.team.id, t.form ?? []),
|
|
916
918
|
rules: e
|
|
917
919
|
};
|
|
918
920
|
}
|
|
@@ -921,11 +923,11 @@ function Be(t) {
|
|
|
921
923
|
for (const n of t)
|
|
922
924
|
if (n.rules)
|
|
923
925
|
for (const o of n.rules) {
|
|
924
|
-
const s =
|
|
926
|
+
const s = Gt(o.standing_api_rule_type);
|
|
925
927
|
e.has(s) || e.set(s, {
|
|
926
928
|
key: s,
|
|
927
929
|
name: o.name,
|
|
928
|
-
position:
|
|
930
|
+
position: xe(o.type)
|
|
929
931
|
});
|
|
930
932
|
}
|
|
931
933
|
return Array.from(e.values());
|
|
@@ -957,7 +959,7 @@ function Ye(t) {
|
|
|
957
959
|
return !t?.data || t.data.length === 0 ? [] : t.data.flatMap(ze);
|
|
958
960
|
}
|
|
959
961
|
async function Qn(t, e) {
|
|
960
|
-
const n = e ||
|
|
962
|
+
const n = e || E(), { sportal365Sports: o } = n, s = {
|
|
961
963
|
season_id: t.seasonId,
|
|
962
964
|
stage_id: t.stageId,
|
|
963
965
|
group_id: t.groupId,
|
|
@@ -975,7 +977,7 @@ async function Qn(t, e) {
|
|
|
975
977
|
});
|
|
976
978
|
return Ye(i);
|
|
977
979
|
}
|
|
978
|
-
const je = ot(
|
|
980
|
+
const je = ot(wt);
|
|
979
981
|
function qe(t, e) {
|
|
980
982
|
return {
|
|
981
983
|
teamId: t.id,
|
|
@@ -989,7 +991,7 @@ function qe(t, e) {
|
|
|
989
991
|
};
|
|
990
992
|
}
|
|
991
993
|
async function Vn(t, e) {
|
|
992
|
-
const n = e ||
|
|
994
|
+
const n = e || E(), o = t.next ?? { revalidate: 600 }, s = await je.get({
|
|
993
995
|
path: "/statistics/aggregate",
|
|
994
996
|
params: {
|
|
995
997
|
participant_ids: t.teamId,
|
|
@@ -1003,14 +1005,14 @@ async function Vn(t, e) {
|
|
|
1003
1005
|
throw new Error(`No statistics found for team ${t.teamId} in season ${t.seasonId}`);
|
|
1004
1006
|
return qe(s.data[0], t.seasonId);
|
|
1005
1007
|
}
|
|
1006
|
-
function
|
|
1008
|
+
function Dt(t) {
|
|
1007
1009
|
const e = t.replace(/\/$/, "");
|
|
1008
1010
|
function n(o) {
|
|
1009
1011
|
return `${e}${o}`;
|
|
1010
1012
|
}
|
|
1011
1013
|
return {
|
|
1012
1014
|
async get(o) {
|
|
1013
|
-
const s = o.config ||
|
|
1015
|
+
const s = o.config || E(), { fansUnited: i } = s;
|
|
1014
1016
|
if (!i)
|
|
1015
1017
|
throw new Error(
|
|
1016
1018
|
"Fans United configuration is missing. Add 'fansUnited' with 'apiKey' and 'clientId' to your config."
|
|
@@ -1053,7 +1055,7 @@ function Gt(t) {
|
|
|
1053
1055
|
}
|
|
1054
1056
|
};
|
|
1055
1057
|
}
|
|
1056
|
-
const Qe = "https://football.fansunitedapi.com",
|
|
1058
|
+
const Qe = "https://football.fansunitedapi.com", R = Dt(Qe);
|
|
1057
1059
|
function Ve(t) {
|
|
1058
1060
|
return {
|
|
1059
1061
|
id: String(t.id),
|
|
@@ -1108,7 +1110,7 @@ function Xe(t) {
|
|
|
1108
1110
|
async function Kn(t, e) {
|
|
1109
1111
|
const n = {};
|
|
1110
1112
|
t?.lang ? n.lang = t.lang : n.lang = "EN", t?.sortField && (n.sort_field = t.sortField), t?.sortOrder && (n.sort_order = t.sortOrder), t?.page !== void 0 && (n.page = String(t.page)), t?.perPage !== void 0 && (n.per_page = String(t.perPage)), t?.countryId !== void 0 && (n.country_id = String(t.countryId)), t?.active !== void 0 && (n.active = t.active ? "1" : "0");
|
|
1111
|
-
const o = await
|
|
1113
|
+
const o = await R.get({
|
|
1112
1114
|
path: "/v1/competitions",
|
|
1113
1115
|
params: n,
|
|
1114
1116
|
config: e,
|
|
@@ -1156,9 +1158,9 @@ function we(t) {
|
|
|
1156
1158
|
return Ze(t.data);
|
|
1157
1159
|
}
|
|
1158
1160
|
async function Xn(t, e, n) {
|
|
1159
|
-
const o = n ||
|
|
1161
|
+
const o = n || E(), s = {};
|
|
1160
1162
|
e?.lang && (s.lang = e.lang);
|
|
1161
|
-
const i = await
|
|
1163
|
+
const i = await R.get({
|
|
1162
1164
|
path: `/v1/competitions/${t}`,
|
|
1163
1165
|
params: s,
|
|
1164
1166
|
next: e?.next,
|
|
@@ -1180,7 +1182,7 @@ function tn(t) {
|
|
|
1180
1182
|
]
|
|
1181
1183
|
};
|
|
1182
1184
|
}
|
|
1183
|
-
function
|
|
1185
|
+
function xt(t) {
|
|
1184
1186
|
return {
|
|
1185
1187
|
id: t.id,
|
|
1186
1188
|
name: t.name,
|
|
@@ -1209,15 +1211,15 @@ function Dt(t) {
|
|
|
1209
1211
|
};
|
|
1210
1212
|
}
|
|
1211
1213
|
function en(t) {
|
|
1212
|
-
return
|
|
1214
|
+
return xt(t.data);
|
|
1213
1215
|
}
|
|
1214
1216
|
function nn(t) {
|
|
1215
|
-
return t.data.map(
|
|
1217
|
+
return t.data.map(xt);
|
|
1216
1218
|
}
|
|
1217
1219
|
async function Jn(t, e, n) {
|
|
1218
|
-
const o = n ||
|
|
1220
|
+
const o = n || E(), s = {};
|
|
1219
1221
|
e?.lang && (s.lang = e.lang);
|
|
1220
|
-
const i = await
|
|
1222
|
+
const i = await R.get({
|
|
1221
1223
|
path: `/v1/teams/${t}`,
|
|
1222
1224
|
params: s,
|
|
1223
1225
|
next: e?.next,
|
|
@@ -1226,9 +1228,9 @@ async function Jn(t, e, n) {
|
|
|
1226
1228
|
return en(i);
|
|
1227
1229
|
}
|
|
1228
1230
|
async function Zn(t, e) {
|
|
1229
|
-
const n = e ||
|
|
1231
|
+
const n = e || E(), o = {};
|
|
1230
1232
|
t?.lang && (o.lang = t.lang), t?.teamIds && (o.team_ids = t.teamIds), t?.countryId && (o.country_id = t.countryId), t?.name && (o.name = t.name), t?.scope && (o.scope = t.scope), t?.national !== void 0 && (o.national = String(t.national)), t?.gender && (o.gender = t.gender), t?.limit !== void 0 && (o.limit = String(t.limit)), t?.page !== void 0 && (o.page = String(t.page)), t?.sortField && (o.sort_field = t.sortField), t?.sortOrder && (o.sort_order = t.sortOrder);
|
|
1231
|
-
const s = await
|
|
1233
|
+
const s = await R.get({
|
|
1232
1234
|
path: "/v1/teams",
|
|
1233
1235
|
params: o,
|
|
1234
1236
|
next: t?.next,
|
|
@@ -1236,7 +1238,7 @@ async function Zn(t, e) {
|
|
|
1236
1238
|
});
|
|
1237
1239
|
return nn(s);
|
|
1238
1240
|
}
|
|
1239
|
-
function
|
|
1241
|
+
function St(t) {
|
|
1240
1242
|
return {
|
|
1241
1243
|
id: t.id,
|
|
1242
1244
|
name: t.name,
|
|
@@ -1259,7 +1261,7 @@ function on(t) {
|
|
|
1259
1261
|
threeLetterCode: t.code,
|
|
1260
1262
|
type: t.national ? "national" : "club",
|
|
1261
1263
|
gender: t.gender?.toUpperCase(),
|
|
1262
|
-
country: t.country ?
|
|
1264
|
+
country: t.country ? St(t.country) : void 0,
|
|
1263
1265
|
assets: t.assets?.logo ? {
|
|
1264
1266
|
logo: t.assets.logo
|
|
1265
1267
|
} : void 0,
|
|
@@ -1277,7 +1279,7 @@ function sn(t) {
|
|
|
1277
1279
|
name: t.name,
|
|
1278
1280
|
type: t.type?.toUpperCase() || "LEAGUE",
|
|
1279
1281
|
gender: t.gender?.toUpperCase(),
|
|
1280
|
-
country: t.country ?
|
|
1282
|
+
country: t.country ? St(t.country) : void 0,
|
|
1281
1283
|
assets: t.assets?.logo ? {
|
|
1282
1284
|
logo: t.assets.logo
|
|
1283
1285
|
} : void 0,
|
|
@@ -1296,7 +1298,7 @@ function Ut(t) {
|
|
|
1296
1298
|
name: t.name,
|
|
1297
1299
|
position: t.position,
|
|
1298
1300
|
birthdate: t.birth_date,
|
|
1299
|
-
country: t.country ?
|
|
1301
|
+
country: t.country ? St(t.country) : void 0,
|
|
1300
1302
|
assets: t.assets?.headshot ? {
|
|
1301
1303
|
photo: t.assets.headshot
|
|
1302
1304
|
} : void 0,
|
|
@@ -1317,9 +1319,9 @@ function an(t) {
|
|
|
1317
1319
|
return t.data.map(Ut);
|
|
1318
1320
|
}
|
|
1319
1321
|
async function wn(t, e, n) {
|
|
1320
|
-
const o = n ||
|
|
1322
|
+
const o = n || E(), s = {};
|
|
1321
1323
|
e?.lang && (s.lang = e.lang);
|
|
1322
|
-
const i = await
|
|
1324
|
+
const i = await R.get({
|
|
1323
1325
|
path: `/v1/players/${t}`,
|
|
1324
1326
|
params: s,
|
|
1325
1327
|
next: e?.next,
|
|
@@ -1328,9 +1330,9 @@ async function wn(t, e, n) {
|
|
|
1328
1330
|
return rn(i);
|
|
1329
1331
|
}
|
|
1330
1332
|
async function to(t, e) {
|
|
1331
|
-
const n = e ||
|
|
1333
|
+
const n = e || E(), o = {};
|
|
1332
1334
|
t?.lang && (o.lang = t.lang), t?.playerIds && (o.player_ids = t.playerIds), t?.countryId && (o.country_id = t.countryId), t?.name && (o.name = t.name), t?.scope && (o.scope = t.scope), t?.limit !== void 0 && (o.limit = String(t.limit)), t?.page !== void 0 && (o.page = String(t.page)), t?.sortField && (o.sort_field = t.sortField), t?.sortOrder && (o.sort_order = t.sortOrder);
|
|
1333
|
-
const s = await
|
|
1335
|
+
const s = await R.get({
|
|
1334
1336
|
path: "/v1/players",
|
|
1335
1337
|
params: o,
|
|
1336
1338
|
next: t?.next,
|
|
@@ -1339,20 +1341,20 @@ async function to(t, e) {
|
|
|
1339
1341
|
return an(s);
|
|
1340
1342
|
}
|
|
1341
1343
|
async function eo(t, e, n) {
|
|
1342
|
-
const o = n ||
|
|
1344
|
+
const o = n || E(), s = {};
|
|
1343
1345
|
e?.lang && (s.lang = e.lang);
|
|
1344
|
-
const i = await
|
|
1346
|
+
const i = await R.get({
|
|
1345
1347
|
path: `/v1/matches/${t}`,
|
|
1346
1348
|
params: s,
|
|
1347
1349
|
next: e?.next,
|
|
1348
1350
|
config: o
|
|
1349
1351
|
});
|
|
1350
|
-
return
|
|
1352
|
+
return st(i);
|
|
1351
1353
|
}
|
|
1352
1354
|
async function no(t, e) {
|
|
1353
|
-
const n = e ||
|
|
1355
|
+
const n = e || E(), o = {};
|
|
1354
1356
|
t?.lang && (o.lang = t.lang), t?.competitions && (o.competitions = t.competitions), t?.countries && (o.countries = t.countries), t?.fromDate && (o.from_date = t.fromDate), t?.toDate && (o.to_date = t.toDate), t?.matches && (o.matches = t.matches), t?.teams && (o.teams = t.teams), t?.status && (o.status = t.status), t?.limit !== void 0 && (o.limit = String(t.limit)), t?.page !== void 0 && (o.page = String(t.page)), t?.sortField && (o.sort_field = t.sortField), t?.sortOrder && (o.sort_order = t.sortOrder), t?.showDeleted !== void 0 && (o.show_deleted = t.showDeleted ? "true" : "false");
|
|
1355
|
-
const s = await
|
|
1357
|
+
const s = await R.get({
|
|
1356
1358
|
path: "/v1/matches",
|
|
1357
1359
|
params: o,
|
|
1358
1360
|
next: t?.next,
|
|
@@ -1360,7 +1362,51 @@ async function no(t, e) {
|
|
|
1360
1362
|
});
|
|
1361
1363
|
return te(s);
|
|
1362
1364
|
}
|
|
1363
|
-
function
|
|
1365
|
+
async function oo(t, e, n) {
|
|
1366
|
+
const o = n || E(), s = {};
|
|
1367
|
+
e?.lang && (s.lang = e.lang);
|
|
1368
|
+
const i = await R.get({
|
|
1369
|
+
path: `/v1/teams/${t}/next-match`,
|
|
1370
|
+
params: s,
|
|
1371
|
+
next: e?.next,
|
|
1372
|
+
config: o
|
|
1373
|
+
});
|
|
1374
|
+
return st(i);
|
|
1375
|
+
}
|
|
1376
|
+
async function so(t, e, n) {
|
|
1377
|
+
const o = n || E(), s = {};
|
|
1378
|
+
e?.lang && (s.lang = e.lang);
|
|
1379
|
+
const i = await R.get({
|
|
1380
|
+
path: `/v1/teams/${t}/previous-match`,
|
|
1381
|
+
params: s,
|
|
1382
|
+
next: e?.next,
|
|
1383
|
+
config: o
|
|
1384
|
+
});
|
|
1385
|
+
return st(i);
|
|
1386
|
+
}
|
|
1387
|
+
async function io(t, e, n) {
|
|
1388
|
+
const o = n || E(), s = {};
|
|
1389
|
+
e?.lang && (s.lang = e.lang);
|
|
1390
|
+
const i = await R.get({
|
|
1391
|
+
path: `/v1/players/${t}/next-match`,
|
|
1392
|
+
params: s,
|
|
1393
|
+
next: e?.next,
|
|
1394
|
+
config: o
|
|
1395
|
+
});
|
|
1396
|
+
return st(i);
|
|
1397
|
+
}
|
|
1398
|
+
async function ro(t, e, n) {
|
|
1399
|
+
const o = n || E(), s = {};
|
|
1400
|
+
e?.lang && (s.lang = e.lang);
|
|
1401
|
+
const i = await R.get({
|
|
1402
|
+
path: `/v1/players/${t}/previous-match`,
|
|
1403
|
+
params: s,
|
|
1404
|
+
next: e?.next,
|
|
1405
|
+
config: o
|
|
1406
|
+
});
|
|
1407
|
+
return st(i);
|
|
1408
|
+
}
|
|
1409
|
+
function At(t) {
|
|
1364
1410
|
return {
|
|
1365
1411
|
id: t.id,
|
|
1366
1412
|
name: t.name,
|
|
@@ -1382,7 +1428,7 @@ function cn(t) {
|
|
|
1382
1428
|
type: t.type || "LEAGUE",
|
|
1383
1429
|
region: t.region,
|
|
1384
1430
|
gender: t.gender?.toUpperCase(),
|
|
1385
|
-
country: t.country ?
|
|
1431
|
+
country: t.country ? At(t.country) : void 0,
|
|
1386
1432
|
assets: t.assets?.logo ? {
|
|
1387
1433
|
logo: t.assets.logo
|
|
1388
1434
|
} : void 0,
|
|
@@ -1402,7 +1448,7 @@ function ln(t) {
|
|
|
1402
1448
|
position: t.position || void 0,
|
|
1403
1449
|
gender: t.gender?.toUpperCase(),
|
|
1404
1450
|
birthdate: t.birth_date || void 0,
|
|
1405
|
-
country: t.country ?
|
|
1451
|
+
country: t.country ? At(t.country) : void 0,
|
|
1406
1452
|
assets: t.assets?.headshot ? {
|
|
1407
1453
|
photo: t.assets.headshot
|
|
1408
1454
|
} : void 0,
|
|
@@ -1422,7 +1468,7 @@ function dn(t) {
|
|
|
1422
1468
|
shortName: t.short_name || void 0,
|
|
1423
1469
|
threeLetterCode: t.code || void 0,
|
|
1424
1470
|
gender: t.gender?.toUpperCase(),
|
|
1425
|
-
country: t.country ?
|
|
1471
|
+
country: t.country ? At(t.country) : void 0,
|
|
1426
1472
|
assets: t.assets?.logo ? {
|
|
1427
1473
|
logo: t.assets.logo
|
|
1428
1474
|
} : void 0,
|
|
@@ -1434,7 +1480,7 @@ function dn(t) {
|
|
|
1434
1480
|
]
|
|
1435
1481
|
};
|
|
1436
1482
|
}
|
|
1437
|
-
function
|
|
1483
|
+
function pt(t) {
|
|
1438
1484
|
switch (t.entity_type) {
|
|
1439
1485
|
case "competition": {
|
|
1440
1486
|
const e = cn(t);
|
|
@@ -1470,10 +1516,10 @@ function gt(t) {
|
|
|
1470
1516
|
throw new Error(`Unknown entity type: ${t.entity_type}`);
|
|
1471
1517
|
}
|
|
1472
1518
|
}
|
|
1473
|
-
async function
|
|
1519
|
+
async function ao(t, e) {
|
|
1474
1520
|
if (!t.query || t.query.trim() === "")
|
|
1475
1521
|
return [];
|
|
1476
|
-
const n = e ||
|
|
1522
|
+
const n = e || E(), o = {
|
|
1477
1523
|
q: t.query.trim()
|
|
1478
1524
|
}, i = (t.entityTypes && t.entityTypes.length > 0 ? t.entityTypes : ["competition", "team", "player"]).map((c) => {
|
|
1479
1525
|
switch (c) {
|
|
@@ -1488,29 +1534,29 @@ async function oo(t, e) {
|
|
|
1488
1534
|
}
|
|
1489
1535
|
});
|
|
1490
1536
|
o.entities = i.join(","), t.lang && (o.lang = t.lang), t.limit && (o.limit = String(t.limit));
|
|
1491
|
-
const r = await
|
|
1537
|
+
const r = await R.get({
|
|
1492
1538
|
path: "/v1/search",
|
|
1493
1539
|
params: o,
|
|
1494
1540
|
next: t.next,
|
|
1495
1541
|
config: n
|
|
1496
1542
|
}), a = [];
|
|
1497
1543
|
return r.data && (r.data.competitions && r.data.competitions.forEach((c) => {
|
|
1498
|
-
const d =
|
|
1544
|
+
const d = pt({ ...c, entity_type: "competition" });
|
|
1499
1545
|
d && a.push(d);
|
|
1500
1546
|
}), r.data.teams && r.data.teams.forEach((c) => {
|
|
1501
|
-
const d =
|
|
1547
|
+
const d = pt({ ...c, entity_type: "team" });
|
|
1502
1548
|
d && a.push(d);
|
|
1503
1549
|
}), r.data.players && r.data.players.forEach((c) => {
|
|
1504
|
-
const d =
|
|
1550
|
+
const d = pt({ ...c, entity_type: "player" });
|
|
1505
1551
|
d && a.push(d);
|
|
1506
1552
|
})), a;
|
|
1507
1553
|
}
|
|
1508
|
-
const un = "https://search.fansunitedapi.com", B =
|
|
1509
|
-
var fn = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date,
|
|
1510
|
-
typeof
|
|
1511
|
-
},
|
|
1512
|
-
if (typeof
|
|
1513
|
-
|
|
1554
|
+
const un = "https://search.fansunitedapi.com", B = Dt(un);
|
|
1555
|
+
var fn = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, Ht = /* @__PURE__ */ new Set(), _t = typeof process == "object" && process ? process : {}, kt = (t, e, n, o) => {
|
|
1556
|
+
typeof _t.emitWarning == "function" ? _t.emitWarning(t, e, n, o) : console.error(`[${n}] ${e}: ${t}`);
|
|
1557
|
+
}, ft = globalThis.AbortController, Lt = globalThis.AbortSignal;
|
|
1558
|
+
if (typeof ft > "u") {
|
|
1559
|
+
Lt = class {
|
|
1514
1560
|
onabort;
|
|
1515
1561
|
_onabort = [];
|
|
1516
1562
|
reason;
|
|
@@ -1518,11 +1564,11 @@ if (typeof ut > "u") {
|
|
|
1518
1564
|
addEventListener(n, o) {
|
|
1519
1565
|
this._onabort.push(o);
|
|
1520
1566
|
}
|
|
1521
|
-
},
|
|
1567
|
+
}, ft = class {
|
|
1522
1568
|
constructor() {
|
|
1523
1569
|
e();
|
|
1524
1570
|
}
|
|
1525
|
-
signal = new
|
|
1571
|
+
signal = new Lt();
|
|
1526
1572
|
abort(n) {
|
|
1527
1573
|
if (!this.signal.aborted) {
|
|
1528
1574
|
this.signal.reason = n, this.signal.aborted = !0;
|
|
@@ -1531,11 +1577,11 @@ if (typeof ut > "u") {
|
|
|
1531
1577
|
}
|
|
1532
1578
|
}
|
|
1533
1579
|
};
|
|
1534
|
-
let t =
|
|
1535
|
-
t && (t = !1,
|
|
1580
|
+
let t = _t.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", e = () => {
|
|
1581
|
+
t && (t = !1, kt("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", e));
|
|
1536
1582
|
};
|
|
1537
1583
|
}
|
|
1538
|
-
var hn = (t) => !
|
|
1584
|
+
var hn = (t) => !Ht.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFinite(t), $t = (t) => W(t) ? t <= Math.pow(2, 8) ? Uint8Array : t <= Math.pow(2, 16) ? Uint16Array : t <= Math.pow(2, 32) ? Uint32Array : t <= Number.MAX_SAFE_INTEGER ? ut : null : null, ut = class extends Array {
|
|
1539
1585
|
constructor(t) {
|
|
1540
1586
|
super(t), this.fill(0);
|
|
1541
1587
|
}
|
|
@@ -1544,7 +1590,7 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1544
1590
|
length;
|
|
1545
1591
|
static #a = !1;
|
|
1546
1592
|
static create(e) {
|
|
1547
|
-
let n =
|
|
1593
|
+
let n = $t(e);
|
|
1548
1594
|
if (!n) return [];
|
|
1549
1595
|
et.#a = !0;
|
|
1550
1596
|
let o = new et(e, n);
|
|
@@ -1560,7 +1606,7 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1560
1606
|
pop() {
|
|
1561
1607
|
return this.heap[--this.length];
|
|
1562
1608
|
}
|
|
1563
|
-
}, gn = class
|
|
1609
|
+
}, gn = class Bt {
|
|
1564
1610
|
#a;
|
|
1565
1611
|
#u;
|
|
1566
1612
|
#p;
|
|
@@ -1641,10 +1687,10 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1641
1687
|
return this.#y;
|
|
1642
1688
|
}
|
|
1643
1689
|
constructor(e) {
|
|
1644
|
-
let { max: n = 0, ttl: o, ttlResolution: s = 1, ttlAutopurge: i, updateAgeOnGet: r, updateAgeOnHas: a, allowStale: c, dispose: d, onInsert: f, disposeAfter: l, noDisposeOnSet: u, noUpdateTTL: h, maxSize: p = 0, maxEntrySize: y = 0, sizeCalculation: S, fetchMethod: g, memoMethod: T, noDeleteOnFetchRejection: A, noDeleteOnStaleGet: C, allowStaleOnFetchRejection: v, allowStaleOnFetchAbort:
|
|
1645
|
-
if (
|
|
1646
|
-
if (this.#T =
|
|
1647
|
-
let m = n ?
|
|
1690
|
+
let { max: n = 0, ttl: o, ttlResolution: s = 1, ttlAutopurge: i, updateAgeOnGet: r, updateAgeOnHas: a, allowStale: c, dispose: d, onInsert: f, disposeAfter: l, noDisposeOnSet: u, noUpdateTTL: h, maxSize: p = 0, maxEntrySize: y = 0, sizeCalculation: S, fetchMethod: g, memoMethod: T, noDeleteOnFetchRejection: A, noDeleteOnStaleGet: C, allowStaleOnFetchRejection: v, allowStaleOnFetchAbort: I, ignoreFetchAbort: M, perf: G } = e;
|
|
1691
|
+
if (G !== void 0 && typeof G?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
1692
|
+
if (this.#T = G ?? fn, n !== 0 && !W(n)) throw new TypeError("max option must be a nonnegative integer");
|
|
1693
|
+
let m = n ? $t(n) : Array;
|
|
1648
1694
|
if (!m) throw new Error("invalid max value: " + n);
|
|
1649
1695
|
if (this.#a = n, this.#u = p, this.maxEntrySize = y || this.#u, this.sizeCalculation = S, this.sizeCalculation) {
|
|
1650
1696
|
if (!this.#u && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
@@ -1652,7 +1698,7 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1652
1698
|
}
|
|
1653
1699
|
if (T !== void 0 && typeof T != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
1654
1700
|
if (this.#G = T, g !== void 0 && typeof g != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
1655
|
-
if (this.#M = g, this.#b = !!g, this.#o = /* @__PURE__ */ new Map(), this.#n = new Array(n).fill(void 0), this.#t = new Array(n).fill(void 0), this.#l = new m(n), this.#f = new m(n), this.#c = 0, this.#i = 0, this.#v = mn.create(n), this.#s = 0, this.#_ = 0, typeof d == "function" && (this.#p = d), typeof f == "function" && (this.#N = f), typeof l == "function" ? (this.#y = l, this.#r = []) : (this.#y = void 0, this.#r = void 0), this.#C = !!this.#p, this.#D = !!this.#N, this.#d = !!this.#y, this.noDisposeOnSet = !!u, this.noUpdateTTL = !!h, this.noDeleteOnFetchRejection = !!A, this.allowStaleOnFetchRejection = !!v, this.allowStaleOnFetchAbort = !!
|
|
1701
|
+
if (this.#M = g, this.#b = !!g, this.#o = /* @__PURE__ */ new Map(), this.#n = new Array(n).fill(void 0), this.#t = new Array(n).fill(void 0), this.#l = new m(n), this.#f = new m(n), this.#c = 0, this.#i = 0, this.#v = mn.create(n), this.#s = 0, this.#_ = 0, typeof d == "function" && (this.#p = d), typeof f == "function" && (this.#N = f), typeof l == "function" ? (this.#y = l, this.#r = []) : (this.#y = void 0, this.#r = void 0), this.#C = !!this.#p, this.#D = !!this.#N, this.#d = !!this.#y, this.noDisposeOnSet = !!u, this.noUpdateTTL = !!h, this.noDeleteOnFetchRejection = !!A, this.allowStaleOnFetchRejection = !!v, this.allowStaleOnFetchAbort = !!I, this.ignoreFetchAbort = !!M, this.maxEntrySize !== 0) {
|
|
1656
1702
|
if (this.#u !== 0 && !W(this.#u)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
1657
1703
|
if (!W(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
1658
1704
|
this.#j();
|
|
@@ -1664,14 +1710,14 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1664
1710
|
if (this.#a === 0 && this.ttl === 0 && this.#u === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
1665
1711
|
if (!this.ttlAutopurge && !this.#a && !this.#u) {
|
|
1666
1712
|
let O = "LRU_CACHE_UNBOUNDED";
|
|
1667
|
-
hn(O) && (
|
|
1713
|
+
hn(O) && (Ht.add(O), kt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", O, Bt));
|
|
1668
1714
|
}
|
|
1669
1715
|
}
|
|
1670
1716
|
getRemainingTTL(e) {
|
|
1671
1717
|
return this.#o.has(e) ? 1 / 0 : 0;
|
|
1672
1718
|
}
|
|
1673
1719
|
#k() {
|
|
1674
|
-
let e = new
|
|
1720
|
+
let e = new ut(this.#a), n = new ut(this.#a);
|
|
1675
1721
|
this.#h = e, this.#A = n;
|
|
1676
1722
|
let o = this.ttlAutopurge ? new Array(this.#a) : void 0;
|
|
1677
1723
|
this.#m = o, this.#$ = (r, a, c = this.#T.now()) => {
|
|
@@ -1721,7 +1767,7 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1721
1767
|
};
|
|
1722
1768
|
#g = () => !1;
|
|
1723
1769
|
#j() {
|
|
1724
|
-
let e = new
|
|
1770
|
+
let e = new ut(this.#a);
|
|
1725
1771
|
this.#_ = 0, this.#S = e, this.#I = (n) => {
|
|
1726
1772
|
this.#_ -= e[n], e[n] = 0;
|
|
1727
1773
|
}, this.#B = (n, o, s, i) => {
|
|
@@ -1731,17 +1777,17 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1731
1777
|
if (s = i(o, n), !W(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
1732
1778
|
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
1733
1779
|
return s;
|
|
1734
|
-
}, this.#
|
|
1780
|
+
}, this.#x = (n, o, s) => {
|
|
1735
1781
|
if (e[n] = o, this.#u) {
|
|
1736
1782
|
let i = this.#u - e[n];
|
|
1737
|
-
for (; this.#_ > i; ) this.#
|
|
1783
|
+
for (; this.#_ > i; ) this.#U(!0);
|
|
1738
1784
|
}
|
|
1739
1785
|
this.#_ += e[n], s && (s.entrySize = o, s.totalCalculatedSize = this.#_);
|
|
1740
1786
|
};
|
|
1741
1787
|
}
|
|
1742
1788
|
#I = (e) => {
|
|
1743
1789
|
};
|
|
1744
|
-
#
|
|
1790
|
+
#x = (e, n, o) => {
|
|
1745
1791
|
};
|
|
1746
1792
|
#B = (e, n, o, s) => {
|
|
1747
1793
|
if (o || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
@@ -1852,7 +1898,7 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1852
1898
|
let { ttl: s = this.ttl, start: i, noDisposeOnSet: r = this.noDisposeOnSet, sizeCalculation: a = this.sizeCalculation, status: c } = o, { noUpdateTTL: d = this.noUpdateTTL } = o, f = this.#B(e, n, o.size || 0, a);
|
|
1853
1899
|
if (this.maxEntrySize && f > this.maxEntrySize) return c && (c.set = "miss", c.maxEntrySizeExceeded = !0), this.#F(e, "set"), this;
|
|
1854
1900
|
let l = this.#s === 0 ? void 0 : this.#o.get(e);
|
|
1855
|
-
if (l === void 0) l = this.#s === 0 ? this.#i : this.#v.length !== 0 ? this.#v.pop() : this.#s === this.#a ? this.#
|
|
1901
|
+
if (l === void 0) l = this.#s === 0 ? this.#i : this.#v.length !== 0 ? this.#v.pop() : this.#s === this.#a ? this.#U(!1) : this.#s, this.#n[l] = e, this.#t[l] = n, this.#o.set(e, l), this.#l[this.#i] = l, this.#f[l] = this.#i, this.#i = l, this.#s++, this.#x(l, f, c), c && (c.set = "add"), d = !1, this.#D && this.#N?.(n, e, "add");
|
|
1856
1902
|
else {
|
|
1857
1903
|
this.#P(l);
|
|
1858
1904
|
let u = this.#t[l];
|
|
@@ -1862,7 +1908,7 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1862
1908
|
let { __staleWhileFetching: h } = u;
|
|
1863
1909
|
h !== void 0 && !r && (this.#C && this.#p?.(h, e, "set"), this.#d && this.#r?.push([h, e, "set"]));
|
|
1864
1910
|
} else r || (this.#C && this.#p?.(u, e, "set"), this.#d && this.#r?.push([u, e, "set"]));
|
|
1865
|
-
if (this.#I(l), this.#
|
|
1911
|
+
if (this.#I(l), this.#x(l, f, c), this.#t[l] = n, c) {
|
|
1866
1912
|
c.set = "replace";
|
|
1867
1913
|
let h = u && this.#e(u) ? u.__staleWhileFetching : u;
|
|
1868
1914
|
h !== void 0 && (c.oldValue = h);
|
|
@@ -1880,7 +1926,7 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1880
1926
|
try {
|
|
1881
1927
|
for (; this.#s; ) {
|
|
1882
1928
|
let e = this.#t[this.#c];
|
|
1883
|
-
if (this.#
|
|
1929
|
+
if (this.#U(!0), this.#e(e)) {
|
|
1884
1930
|
if (e.__staleWhileFetching) return e.__staleWhileFetching;
|
|
1885
1931
|
} else if (e !== void 0) return e;
|
|
1886
1932
|
}
|
|
@@ -1891,7 +1937,7 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1891
1937
|
}
|
|
1892
1938
|
}
|
|
1893
1939
|
}
|
|
1894
|
-
#
|
|
1940
|
+
#U(e) {
|
|
1895
1941
|
let n = this.#c, o = this.#n[n], s = this.#t[n];
|
|
1896
1942
|
return this.#b && this.#e(s) ? s.__abortController.abort(new Error("evicted")) : (this.#C || this.#d) && (this.#C && this.#p?.(s, o, "evict"), this.#d && this.#r?.push([s, o, "evict"])), this.#I(n), this.#m?.[n] && (clearTimeout(this.#m[n]), this.#m[n] = void 0), e && (this.#n[n] = void 0, this.#t[n] = void 0, this.#v.push(n)), this.#s === 1 ? (this.#c = this.#i = 0, this.#v.length = 0) : this.#c = this.#l[n], this.#o.delete(o), this.#s--, n;
|
|
1897
1943
|
}
|
|
@@ -1914,7 +1960,7 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1914
1960
|
#H(e, n, o, s) {
|
|
1915
1961
|
let i = n === void 0 ? void 0 : this.#t[n];
|
|
1916
1962
|
if (this.#e(i)) return i;
|
|
1917
|
-
let r = new
|
|
1963
|
+
let r = new ft(), { signal: a } = o;
|
|
1918
1964
|
a?.addEventListener("abort", () => r.abort(a.reason), { signal: r.signal });
|
|
1919
1965
|
let c = { signal: r.signal, options: o, context: s }, d = (y, S = !1) => {
|
|
1920
1966
|
let { aborted: g } = r.signal, T = o.ignoreFetchAbort && y !== void 0, A = o.ignoreFetchAbort || !!(o.allowStaleOnFetchAbort && y !== void 0);
|
|
@@ -1938,7 +1984,7 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1938
1984
|
#e(e) {
|
|
1939
1985
|
if (!this.#b) return !1;
|
|
1940
1986
|
let n = e;
|
|
1941
|
-
return !!n && n instanceof Promise && n.hasOwnProperty("__staleWhileFetching") && n.__abortController instanceof
|
|
1987
|
+
return !!n && n instanceof Promise && n.hasOwnProperty("__staleWhileFetching") && n.__abortController instanceof ft;
|
|
1942
1988
|
}
|
|
1943
1989
|
async fetch(e, n = {}) {
|
|
1944
1990
|
let { allowStale: o = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: i = this.noDeleteOnStaleGet, ttl: r = this.ttl, noDisposeOnSet: a = this.noDisposeOnSet, size: c = 0, sizeCalculation: d = this.sizeCalculation, noUpdateTTL: f = this.noUpdateTTL, noDeleteOnFetchRejection: l = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: u = this.allowStaleOnFetchRejection, ignoreFetchAbort: h = this.ignoreFetchAbort, allowStaleOnFetchAbort: p = this.allowStaleOnFetchAbort, context: y, forceRefresh: S = !1, status: g, signal: T } = n;
|
|
@@ -1954,10 +2000,10 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
1954
2000
|
let m = o && v.__staleWhileFetching !== void 0;
|
|
1955
2001
|
return g && (g.fetch = "inflight", m && (g.returnedStale = !0)), m ? v.__staleWhileFetching : v.__returned = v;
|
|
1956
2002
|
}
|
|
1957
|
-
let
|
|
1958
|
-
if (!S && !
|
|
1959
|
-
let
|
|
1960
|
-
return g && (g.fetch =
|
|
2003
|
+
let I = this.#g(C);
|
|
2004
|
+
if (!S && !I) return g && (g.fetch = "hit"), this.#P(C), s && this.#R(C), g && this.#L(g, C), v;
|
|
2005
|
+
let M = this.#H(e, C, A, y), G = M.__staleWhileFetching !== void 0 && o;
|
|
2006
|
+
return g && (g.fetch = I ? "stale" : "refresh", G && I && (g.returnedStale = !0)), G ? M.__staleWhileFetching : M.__returned = M;
|
|
1961
2007
|
}
|
|
1962
2008
|
}
|
|
1963
2009
|
async forceFetch(e, n = {}) {
|
|
@@ -2040,7 +2086,7 @@ var hn = (t) => !xt.has(t), W = (t) => t && t === Math.floor(t) && t > 0 && isFi
|
|
|
2040
2086
|
const pn = 50 * 1024 * 1024, tt = new gn({
|
|
2041
2087
|
maxSize: pn,
|
|
2042
2088
|
sizeCalculation: (t) => JSON.stringify(t.data).length
|
|
2043
|
-
}),
|
|
2089
|
+
}), L = {
|
|
2044
2090
|
get(t) {
|
|
2045
2091
|
return tt.get(t);
|
|
2046
2092
|
},
|
|
@@ -2057,9 +2103,9 @@ const pn = 50 * 1024 * 1024, tt = new gn({
|
|
|
2057
2103
|
return tt.size;
|
|
2058
2104
|
}
|
|
2059
2105
|
};
|
|
2060
|
-
let
|
|
2061
|
-
function
|
|
2062
|
-
|
|
2106
|
+
let D = null;
|
|
2107
|
+
function co(t) {
|
|
2108
|
+
D = t;
|
|
2063
2109
|
}
|
|
2064
2110
|
const yn = {
|
|
2065
2111
|
competitions: { staleTTL: 24 * 3600, maxTTL: 72 * 3600 },
|
|
@@ -2069,57 +2115,57 @@ const yn = {
|
|
|
2069
2115
|
countries: { staleTTL: 96 * 3600, maxTTL: 168 * 3600 },
|
|
2070
2116
|
coaches: { staleTTL: 24 * 3600, maxTTL: 48 * 3600 },
|
|
2071
2117
|
search: { staleTTL: 300, maxTTL: 1800 }
|
|
2072
|
-
},
|
|
2073
|
-
function
|
|
2118
|
+
}, yt = /* @__PURE__ */ new Set();
|
|
2119
|
+
function Wt(t) {
|
|
2074
2120
|
const e = yn[t];
|
|
2075
2121
|
if (!e)
|
|
2076
2122
|
throw new Error(`Unknown entity type: ${t}`);
|
|
2077
2123
|
return e;
|
|
2078
2124
|
}
|
|
2079
|
-
function
|
|
2125
|
+
function ht(t, e) {
|
|
2080
2126
|
return Date.now() - t.storedAt < e * 1e3;
|
|
2081
2127
|
}
|
|
2082
|
-
function
|
|
2128
|
+
function mt(t, e) {
|
|
2083
2129
|
return Date.now() - t.storedAt >= e * 1e3;
|
|
2084
2130
|
}
|
|
2085
|
-
function
|
|
2086
|
-
|
|
2087
|
-
|
|
2131
|
+
function gt(t, e, n) {
|
|
2132
|
+
yt.has(t) || (yt.add(t), n().then((o) => {
|
|
2133
|
+
L.set(t, o), D?.isInitialized && D.set(t, e, o);
|
|
2088
2134
|
}).catch((o) => {
|
|
2089
2135
|
console.error(`[cache] Background refresh failed for ${t}:`, o);
|
|
2090
2136
|
}).finally(() => {
|
|
2091
|
-
|
|
2137
|
+
yt.delete(t);
|
|
2092
2138
|
}));
|
|
2093
2139
|
}
|
|
2094
2140
|
async function q(t, e, n) {
|
|
2095
|
-
const { staleTTL: o, maxTTL: s } =
|
|
2141
|
+
const { staleTTL: o, maxTTL: s } = Wt(e), i = L.get(t);
|
|
2096
2142
|
if (i) {
|
|
2097
|
-
if (
|
|
2143
|
+
if (ht(i, o))
|
|
2098
2144
|
return i.data;
|
|
2099
|
-
if (!
|
|
2100
|
-
return
|
|
2145
|
+
if (!mt(i, s))
|
|
2146
|
+
return gt(t, e, n), i.data;
|
|
2101
2147
|
}
|
|
2102
|
-
if (
|
|
2103
|
-
const a =
|
|
2104
|
-
if (a && !
|
|
2105
|
-
return
|
|
2148
|
+
if (D?.isInitialized) {
|
|
2149
|
+
const a = D.get(t);
|
|
2150
|
+
if (a && !mt(a, s))
|
|
2151
|
+
return L.set(t, a.data), ht(a, o) || gt(t, e, n), a.data;
|
|
2106
2152
|
}
|
|
2107
2153
|
const r = await n();
|
|
2108
|
-
return
|
|
2154
|
+
return L.set(t, r), D?.isInitialized && D.set(t, e, r), r;
|
|
2109
2155
|
}
|
|
2110
2156
|
async function Tn(t, e, n, o) {
|
|
2111
|
-
const { staleTTL: s, maxTTL: i } =
|
|
2157
|
+
const { staleTTL: s, maxTTL: i } = Wt(e), r = /* @__PURE__ */ new Map(), a = [];
|
|
2112
2158
|
for (const c of t) {
|
|
2113
2159
|
const d = o(c);
|
|
2114
2160
|
let f = !1;
|
|
2115
|
-
const l =
|
|
2116
|
-
if (l && !
|
|
2161
|
+
const l = L.get(d);
|
|
2162
|
+
if (l && !mt(l, i) && (r.set(c, l.data), ht(l, s) || gt(d, e, async () => {
|
|
2117
2163
|
const h = (await n([c])).get(c);
|
|
2118
2164
|
if (!h) throw new Error(`Batch fetcher did not return ID: ${c}`);
|
|
2119
2165
|
return h;
|
|
2120
|
-
}), f = !0), !f &&
|
|
2121
|
-
const u =
|
|
2122
|
-
u && !
|
|
2166
|
+
}), f = !0), !f && D?.isInitialized) {
|
|
2167
|
+
const u = D.get(d);
|
|
2168
|
+
u && !mt(u, i) && (L.set(d, u.data), r.set(c, u.data), ht(u, s) || gt(d, e, async () => {
|
|
2123
2169
|
const p = (await n([c])).get(c);
|
|
2124
2170
|
if (!p) throw new Error(`Batch fetcher did not return ID: ${c}`);
|
|
2125
2171
|
return p;
|
|
@@ -2131,15 +2177,15 @@ async function Tn(t, e, n, o) {
|
|
|
2131
2177
|
const c = await n(a);
|
|
2132
2178
|
for (const [d, f] of c) {
|
|
2133
2179
|
const l = o(d);
|
|
2134
|
-
|
|
2180
|
+
L.set(l, f), D?.isInitialized && D.set(l, e, f), r.set(d, f);
|
|
2135
2181
|
}
|
|
2136
2182
|
}
|
|
2137
2183
|
return r;
|
|
2138
2184
|
}
|
|
2139
|
-
function
|
|
2140
|
-
|
|
2185
|
+
function lo(t) {
|
|
2186
|
+
L.delete(t);
|
|
2141
2187
|
}
|
|
2142
|
-
function
|
|
2188
|
+
function H(t, e, n, o) {
|
|
2143
2189
|
const s = e.toUpperCase(), i = t.find((r) => r.language.toUpperCase() === s);
|
|
2144
2190
|
if (i)
|
|
2145
2191
|
return {
|
|
@@ -2176,18 +2222,18 @@ function X(t) {
|
|
|
2176
2222
|
function _n(t, e) {
|
|
2177
2223
|
return t.filter((n) => n.relationship === e).map((n) => n.related_id);
|
|
2178
2224
|
}
|
|
2179
|
-
function
|
|
2225
|
+
function k(t, e, n) {
|
|
2180
2226
|
const o = t || _n(e, "COUNTRY")[0];
|
|
2181
2227
|
if (!o) return;
|
|
2182
|
-
const s =
|
|
2228
|
+
const s = L.get(o) ?? L.get(`entity:${o}`);
|
|
2183
2229
|
if (s?.data) {
|
|
2184
2230
|
const i = s.data;
|
|
2185
|
-
return
|
|
2231
|
+
return it(i, n);
|
|
2186
2232
|
}
|
|
2187
2233
|
return { id: o, name: o };
|
|
2188
2234
|
}
|
|
2189
|
-
function
|
|
2190
|
-
const { name: n, shortName: o } =
|
|
2235
|
+
function it(t, e) {
|
|
2236
|
+
const { name: n, shortName: o } = H(t.translations ?? [], e, t.name, t.short_name), s = Q(t.assets ?? []);
|
|
2191
2237
|
return {
|
|
2192
2238
|
id: t.id,
|
|
2193
2239
|
name: n,
|
|
@@ -2196,8 +2242,8 @@ function st(t, e) {
|
|
|
2196
2242
|
...o ? { shortName: o } : {}
|
|
2197
2243
|
};
|
|
2198
2244
|
}
|
|
2199
|
-
function
|
|
2200
|
-
const { name: n, shortName: o } =
|
|
2245
|
+
function Ct(t, e) {
|
|
2246
|
+
const { name: n, shortName: o } = H(t.translations ?? [], e, t.name, t.short_name), s = Q(t.assets ?? []), i = K(t.branding), r = k(null, t.related ?? [], e);
|
|
2201
2247
|
return {
|
|
2202
2248
|
id: t.id,
|
|
2203
2249
|
name: n,
|
|
@@ -2210,7 +2256,7 @@ function At(t, e) {
|
|
|
2210
2256
|
};
|
|
2211
2257
|
}
|
|
2212
2258
|
function nt(t, e) {
|
|
2213
|
-
const { name: n, shortName: o } =
|
|
2259
|
+
const { name: n, shortName: o } = H(t.translations ?? [], e, t.name, t.short_name), s = Q(t.assets ?? []), i = K(t.metadata?.branding), r = k(t.country_id, t.related ?? [], e);
|
|
2214
2260
|
return {
|
|
2215
2261
|
id: t.id,
|
|
2216
2262
|
name: n,
|
|
@@ -2225,8 +2271,8 @@ function nt(t, e) {
|
|
|
2225
2271
|
...i ? { metadata: { branding: i } } : {}
|
|
2226
2272
|
};
|
|
2227
2273
|
}
|
|
2228
|
-
function
|
|
2229
|
-
const { name: n, shortName: o } =
|
|
2274
|
+
function zt(t, e) {
|
|
2275
|
+
const { name: n, shortName: o } = H(t.translations ?? [], e, t.name, t.short_name), s = Q(t.assets ?? []), i = K(t.metadata?.branding), r = k(t.country_id, t.related ?? [], e);
|
|
2230
2276
|
return {
|
|
2231
2277
|
id: t.id,
|
|
2232
2278
|
name: n,
|
|
@@ -2242,8 +2288,8 @@ function Wt(t, e) {
|
|
|
2242
2288
|
...i ? { metadata: { branding: i } } : {}
|
|
2243
2289
|
};
|
|
2244
2290
|
}
|
|
2245
|
-
function
|
|
2246
|
-
const { name: n } =
|
|
2291
|
+
function Yt(t, e) {
|
|
2292
|
+
const { name: n } = H(t.translations ?? [], e, t.name, t.short_name), o = k(t.country_id, t.related ?? [], e), s = t.capacity != null || t.latitude != null || t.longitude != null;
|
|
2247
2293
|
return {
|
|
2248
2294
|
id: t.id,
|
|
2249
2295
|
name: n,
|
|
@@ -2259,7 +2305,7 @@ function zt(t, e) {
|
|
|
2259
2305
|
};
|
|
2260
2306
|
}
|
|
2261
2307
|
function vn(t, e) {
|
|
2262
|
-
const { name: n } =
|
|
2308
|
+
const { name: n } = H(t.translations ?? [], e, t.name, t.short_name), o = k(t.country_id, t.related ?? [], e);
|
|
2263
2309
|
return {
|
|
2264
2310
|
id: t.id,
|
|
2265
2311
|
name: n,
|
|
@@ -2269,23 +2315,23 @@ function vn(t, e) {
|
|
|
2269
2315
|
};
|
|
2270
2316
|
}
|
|
2271
2317
|
function Sn(t, e, n) {
|
|
2272
|
-
const o =
|
|
2318
|
+
const o = L.get(t) ?? L.get(`entity:${t}`);
|
|
2273
2319
|
if (!o?.data) return;
|
|
2274
2320
|
const s = o.data;
|
|
2275
2321
|
switch (e) {
|
|
2276
2322
|
case "COMPETITION":
|
|
2277
|
-
return
|
|
2323
|
+
return Ct(s, n);
|
|
2278
2324
|
case "TEAM":
|
|
2279
2325
|
return nt(s, n);
|
|
2280
2326
|
case "ATHLETE":
|
|
2281
|
-
return
|
|
2327
|
+
return zt(s, n);
|
|
2282
2328
|
case "COUNTRY":
|
|
2283
|
-
return
|
|
2329
|
+
return it(s, n);
|
|
2284
2330
|
default:
|
|
2285
2331
|
return;
|
|
2286
2332
|
}
|
|
2287
2333
|
}
|
|
2288
|
-
function
|
|
2334
|
+
function rt(t, e) {
|
|
2289
2335
|
if (!t || t.length === 0) return;
|
|
2290
2336
|
const n = {};
|
|
2291
2337
|
for (const o of t) {
|
|
@@ -2309,7 +2355,7 @@ function it(t, e) {
|
|
|
2309
2355
|
return Object.keys(n).length > 0 ? n : void 0;
|
|
2310
2356
|
}
|
|
2311
2357
|
function An(t, e) {
|
|
2312
|
-
const { name: n, shortName: o } =
|
|
2358
|
+
const { name: n, shortName: o } = H(t.translations ?? [], e, t.name, t.short_name), s = Q(t.assets ?? []), i = K(t.branding), r = k(null, t.related ?? [], e), a = rt(t.related ?? [], e);
|
|
2313
2359
|
return {
|
|
2314
2360
|
id: t.id,
|
|
2315
2361
|
name: n,
|
|
@@ -2324,8 +2370,8 @@ function An(t, e) {
|
|
|
2324
2370
|
...a ? { related: a } : {}
|
|
2325
2371
|
};
|
|
2326
2372
|
}
|
|
2327
|
-
function
|
|
2328
|
-
const { name: n, shortName: o } =
|
|
2373
|
+
function bt(t, e) {
|
|
2374
|
+
const { name: n, shortName: o } = H(t.translations ?? [], e, t.name, t.short_name), s = Q(t.assets ?? []), i = K(t.metadata?.branding), r = k(t.country_id, t.related ?? [], e), a = rt(t.related ?? [], e);
|
|
2329
2375
|
return {
|
|
2330
2376
|
id: t.id,
|
|
2331
2377
|
name: n,
|
|
@@ -2343,7 +2389,7 @@ function Lt(t, e) {
|
|
|
2343
2389
|
};
|
|
2344
2390
|
}
|
|
2345
2391
|
function Cn(t, e) {
|
|
2346
|
-
const { name: n, shortName: o } =
|
|
2392
|
+
const { name: n, shortName: o } = H(t.translations ?? [], e, t.name, t.short_name), s = Q(t.assets ?? []), i = K(t.metadata?.branding), r = k(t.country_id, t.related ?? [], e), a = rt(t.related ?? [], e);
|
|
2347
2393
|
return {
|
|
2348
2394
|
id: t.id,
|
|
2349
2395
|
name: n,
|
|
@@ -2363,13 +2409,13 @@ function Cn(t, e) {
|
|
|
2363
2409
|
}
|
|
2364
2410
|
function On(t, e) {
|
|
2365
2411
|
return {
|
|
2366
|
-
...
|
|
2412
|
+
...it(t, e),
|
|
2367
2413
|
sport: t.sport,
|
|
2368
2414
|
...t.provider_ref?.length ? { providerRef: X(t.provider_ref) } : {}
|
|
2369
2415
|
};
|
|
2370
2416
|
}
|
|
2371
2417
|
function En(t, e) {
|
|
2372
|
-
const { name: n } =
|
|
2418
|
+
const { name: n } = H(t.translations ?? [], e, t.name, t.short_name), o = k(t.country_id, t.related ?? [], e), s = rt(t.related ?? [], e), i = t.capacity != null || t.latitude != null || t.longitude != null;
|
|
2373
2419
|
return {
|
|
2374
2420
|
id: t.id,
|
|
2375
2421
|
name: n,
|
|
@@ -2387,7 +2433,7 @@ function En(t, e) {
|
|
|
2387
2433
|
};
|
|
2388
2434
|
}
|
|
2389
2435
|
function Fn(t, e) {
|
|
2390
|
-
const { name: n } =
|
|
2436
|
+
const { name: n } = H(t.translations ?? [], e, t.name, t.short_name), o = k(t.country_id, t.related ?? [], e), s = rt(t.related ?? [], e);
|
|
2391
2437
|
return {
|
|
2392
2438
|
id: t.id,
|
|
2393
2439
|
name: n,
|
|
@@ -2398,13 +2444,13 @@ function Fn(t, e) {
|
|
|
2398
2444
|
...s ? { related: s } : {}
|
|
2399
2445
|
};
|
|
2400
2446
|
}
|
|
2401
|
-
function
|
|
2447
|
+
function jt(t, e) {
|
|
2402
2448
|
const n = t.content_type?.toUpperCase?.(), o = t.type?.toUpperCase?.(), s = t.entityType?.toLowerCase?.();
|
|
2403
|
-
return n === "COMPETITION" || s === "competition" ? { ...An(t, e), entityType: "competition" } : s === "country" || t.country_code !== void 0 ? { ...On(t, e), entityType: "country" } : s === "venue" || t.capacity !== void 0 && !s ? { ...En(t, e), entityType: "venue" } : s === "coach" || o === "COACH" ? { ...Fn(t, e), entityType: "coach" } : s === "athlete" || o === "PLAYER" || t.position !== void 0 || t.shirt_number !== void 0 ? { ...Cn(t, e), entityType: "athlete" } : s === "team" || o === "TEAM" || t.three_letter_code !== void 0 ? { ...
|
|
2449
|
+
return n === "COMPETITION" || s === "competition" ? { ...An(t, e), entityType: "competition" } : s === "country" || t.country_code !== void 0 ? { ...On(t, e), entityType: "country" } : s === "venue" || t.capacity !== void 0 && !s ? { ...En(t, e), entityType: "venue" } : s === "coach" || o === "COACH" ? { ...Fn(t, e), entityType: "coach" } : s === "athlete" || o === "PLAYER" || t.position !== void 0 || t.shirt_number !== void 0 ? { ...Cn(t, e), entityType: "athlete" } : s === "team" || o === "TEAM" || t.three_letter_code !== void 0 ? { ...bt(t, e), entityType: "team" } : { ...bt(t, e), entityType: "team" };
|
|
2404
2450
|
}
|
|
2405
2451
|
function Ln(t, e) {
|
|
2406
2452
|
const n = t.content_type?.toUpperCase?.(), o = t.type?.toUpperCase?.(), s = t.entityType?.toLowerCase?.();
|
|
2407
|
-
return n === "COMPETITION" || s === "competition" ? { ...
|
|
2453
|
+
return n === "COMPETITION" || s === "competition" ? { ...Ct(t, e), entityType: "competition" } : s === "country" || t.country_code !== void 0 ? { ...it(t, e), entityType: "country" } : s === "venue" || t.capacity !== void 0 && !s ? { ...Yt(t, e), entityType: "venue" } : s === "coach" || o === "COACH" ? { ...vn(t, e), entityType: "coach" } : s === "athlete" || o === "PLAYER" || t.position !== void 0 || t.shirt_number !== void 0 ? { ...zt(t, e), entityType: "athlete" } : s === "team" || o === "TEAM" || t.three_letter_code !== void 0 ? { ...nt(t, e), entityType: "team" } : { ...nt(t, e), entityType: "team" };
|
|
2408
2454
|
}
|
|
2409
2455
|
function J(t) {
|
|
2410
2456
|
const e = Object.entries(t).filter(([, o]) => o !== void 0).sort(([o], [s]) => o.localeCompare(s)).map(([o, s]) => `${o}=${Array.isArray(s) ? s.join(",") : s}`).join("&");
|
|
@@ -2415,30 +2461,30 @@ function J(t) {
|
|
|
2415
2461
|
}
|
|
2416
2462
|
function V(t) {
|
|
2417
2463
|
for (const e of t)
|
|
2418
|
-
e.id &&
|
|
2464
|
+
e.id && L.set(`entity:${e.id}`, e);
|
|
2419
2465
|
}
|
|
2420
2466
|
function Y(t) {
|
|
2421
2467
|
if (t?.lang) return t.lang;
|
|
2422
2468
|
if (ee()) {
|
|
2423
|
-
const e =
|
|
2469
|
+
const e = E();
|
|
2424
2470
|
if (e.fansUnited && "lang" in e.fansUnited && e.fansUnited.lang)
|
|
2425
2471
|
return e.fansUnited.lang;
|
|
2426
2472
|
}
|
|
2427
2473
|
return "EN";
|
|
2428
2474
|
}
|
|
2429
|
-
function
|
|
2475
|
+
function Nt(t) {
|
|
2430
2476
|
const e = /* @__PURE__ */ new Set();
|
|
2431
2477
|
for (const n of t) {
|
|
2432
2478
|
const o = n, s = o.related;
|
|
2433
2479
|
if (s)
|
|
2434
2480
|
for (const r of s)
|
|
2435
|
-
|
|
2481
|
+
L.get(`entity:${r.related_id}`) || e.add(r.related_id);
|
|
2436
2482
|
const i = o.country_id;
|
|
2437
|
-
i && !
|
|
2483
|
+
i && !L.get(`entity:${i}`) && e.add(i);
|
|
2438
2484
|
}
|
|
2439
2485
|
return e;
|
|
2440
2486
|
}
|
|
2441
|
-
async function
|
|
2487
|
+
async function vt(t, e) {
|
|
2442
2488
|
if (t.size === 0) return [];
|
|
2443
2489
|
const n = await B.get({
|
|
2444
2490
|
path: "/v1/entities/search",
|
|
@@ -2448,32 +2494,32 @@ async function _t(t, e) {
|
|
|
2448
2494
|
});
|
|
2449
2495
|
return V(n.data), n.data;
|
|
2450
2496
|
}
|
|
2451
|
-
async function
|
|
2452
|
-
const n =
|
|
2497
|
+
async function qt(t, e) {
|
|
2498
|
+
const n = Nt(t);
|
|
2453
2499
|
if (n.size !== 0)
|
|
2454
2500
|
try {
|
|
2455
|
-
const o = await
|
|
2456
|
-
s.size > 0 && await
|
|
2501
|
+
const o = await vt(n, e), s = Nt(o);
|
|
2502
|
+
s.size > 0 && await vt(s, e);
|
|
2457
2503
|
} catch {
|
|
2458
2504
|
}
|
|
2459
2505
|
}
|
|
2460
|
-
async function
|
|
2506
|
+
async function at(t, e) {
|
|
2461
2507
|
const n = /* @__PURE__ */ new Set();
|
|
2462
2508
|
for (const o of t) {
|
|
2463
2509
|
const s = o, i = s.country_id;
|
|
2464
|
-
i && !
|
|
2510
|
+
i && !L.get(`entity:${i}`) && n.add(i);
|
|
2465
2511
|
const r = s.related;
|
|
2466
2512
|
if (r)
|
|
2467
2513
|
for (const a of r)
|
|
2468
|
-
a.relationship === "COUNTRY" && !
|
|
2514
|
+
a.relationship === "COUNTRY" && !L.get(`entity:${a.related_id}`) && n.add(a.related_id);
|
|
2469
2515
|
}
|
|
2470
2516
|
if (n.size !== 0)
|
|
2471
2517
|
try {
|
|
2472
|
-
await
|
|
2518
|
+
await vt(n, e);
|
|
2473
2519
|
} catch {
|
|
2474
2520
|
}
|
|
2475
2521
|
}
|
|
2476
|
-
async function
|
|
2522
|
+
async function uo(t = {}, e) {
|
|
2477
2523
|
const n = Y(t), o = {
|
|
2478
2524
|
query: t.query,
|
|
2479
2525
|
content_type: t.contentType,
|
|
@@ -2494,11 +2540,11 @@ async function ro(t = {}, e) {
|
|
|
2494
2540
|
config: t.config
|
|
2495
2541
|
})
|
|
2496
2542
|
);
|
|
2497
|
-
return V(i.data), await
|
|
2543
|
+
return V(i.data), await at(i.data, { next: t.next || e?.next, config: t.config }), { data: i.data.map(
|
|
2498
2544
|
(a) => Ln(a, n)
|
|
2499
2545
|
), pagination: i.meta.pagination };
|
|
2500
2546
|
}
|
|
2501
|
-
async function
|
|
2547
|
+
async function fo(t, e) {
|
|
2502
2548
|
const n = Y(e), o = `entity:${t}`, s = await q(o, "search", async () => {
|
|
2503
2549
|
const i = await B.get({
|
|
2504
2550
|
path: "/v1/entities/search",
|
|
@@ -2510,9 +2556,9 @@ async function ao(t, e) {
|
|
|
2510
2556
|
throw new Error(`Entity not found: ${t}`);
|
|
2511
2557
|
return i.data[0];
|
|
2512
2558
|
});
|
|
2513
|
-
return await
|
|
2559
|
+
return await qt([s], { next: e?.next, config: e?.config }), jt(s, n);
|
|
2514
2560
|
}
|
|
2515
|
-
async function
|
|
2561
|
+
async function ho(t, e) {
|
|
2516
2562
|
if (t.length === 0) return [];
|
|
2517
2563
|
const n = Y(e), o = await Tn(
|
|
2518
2564
|
t,
|
|
@@ -2530,9 +2576,9 @@ async function co(t, e) {
|
|
|
2530
2576
|
},
|
|
2531
2577
|
(i) => `entity:${i}`
|
|
2532
2578
|
), s = t.map((i) => o.get(i)).filter((i) => i !== void 0);
|
|
2533
|
-
return await
|
|
2579
|
+
return await qt(s, { next: e?.next, config: e?.config }), s.map((i) => jt(i, n));
|
|
2534
2580
|
}
|
|
2535
|
-
async function
|
|
2581
|
+
async function mo(t = {}) {
|
|
2536
2582
|
const e = Y(t), n = {
|
|
2537
2583
|
content_type: "competition",
|
|
2538
2584
|
query: t.query,
|
|
@@ -2549,9 +2595,9 @@ async function lo(t = {}) {
|
|
|
2549
2595
|
config: t.config
|
|
2550
2596
|
})
|
|
2551
2597
|
);
|
|
2552
|
-
return V(s.data), await
|
|
2598
|
+
return V(s.data), await at(s.data, { next: t.next, config: t.config }), { data: s.data.map((r) => Ct(r, e)), pagination: s.meta.pagination };
|
|
2553
2599
|
}
|
|
2554
|
-
async function
|
|
2600
|
+
async function go(t, e = {}) {
|
|
2555
2601
|
const n = Y(e), o = {
|
|
2556
2602
|
content_type: "team",
|
|
2557
2603
|
relationship: "COUNTRY",
|
|
@@ -2570,9 +2616,9 @@ async function uo(t, e = {}) {
|
|
|
2570
2616
|
config: e.config
|
|
2571
2617
|
})
|
|
2572
2618
|
);
|
|
2573
|
-
return V(i.data), await
|
|
2619
|
+
return V(i.data), await at(i.data, { next: e.next, config: e.config }), { data: i.data.map((a) => nt(a, n)), pagination: i.meta.pagination };
|
|
2574
2620
|
}
|
|
2575
|
-
async function
|
|
2621
|
+
async function po(t, e = {}) {
|
|
2576
2622
|
const n = Y(e), o = {
|
|
2577
2623
|
content_type: "team",
|
|
2578
2624
|
relationship: "COMPETITION",
|
|
@@ -2591,9 +2637,9 @@ async function fo(t, e = {}) {
|
|
|
2591
2637
|
config: e.config
|
|
2592
2638
|
})
|
|
2593
2639
|
);
|
|
2594
|
-
return V(i.data), await
|
|
2640
|
+
return V(i.data), await at(i.data, { next: e.next, config: e.config }), { data: i.data.map((a) => nt(a, n)), pagination: i.meta.pagination };
|
|
2595
2641
|
}
|
|
2596
|
-
async function
|
|
2642
|
+
async function yo(t = {}) {
|
|
2597
2643
|
const e = Y(t), n = {
|
|
2598
2644
|
content_type: "country",
|
|
2599
2645
|
query: t.query,
|
|
@@ -2610,9 +2656,9 @@ async function ho(t = {}) {
|
|
|
2610
2656
|
config: t.config
|
|
2611
2657
|
})
|
|
2612
2658
|
);
|
|
2613
|
-
return V(s.data), { data: s.data.map((r) =>
|
|
2659
|
+
return V(s.data), { data: s.data.map((r) => it(r, e)), pagination: s.meta.pagination };
|
|
2614
2660
|
}
|
|
2615
|
-
async function
|
|
2661
|
+
async function To(t = {}) {
|
|
2616
2662
|
const e = Y(t), n = {
|
|
2617
2663
|
content_type: "venue",
|
|
2618
2664
|
query: t.query,
|
|
@@ -2629,26 +2675,26 @@ async function mo(t = {}) {
|
|
|
2629
2675
|
config: t.config
|
|
2630
2676
|
})
|
|
2631
2677
|
);
|
|
2632
|
-
return V(s.data), await
|
|
2678
|
+
return V(s.data), await at(s.data, { next: t.next, config: t.config }), { data: s.data.map((r) => Yt(r, e)), pagination: s.meta.pagination };
|
|
2633
2679
|
}
|
|
2634
|
-
function
|
|
2680
|
+
function _o(t) {
|
|
2635
2681
|
return !t.seasons || t.seasons.length === 0 ? void 0 : t.seasons.find((n) => n.active) ?? t.seasons[0];
|
|
2636
2682
|
}
|
|
2637
|
-
function
|
|
2683
|
+
function vo(t, e) {
|
|
2638
2684
|
const n = /* @__PURE__ */ new Date(), o = e.filter((s) => {
|
|
2639
2685
|
const i = s.competitorOne.id === t || s.competitorTwo.id === t, r = s.status.type === "NOT_STARTED", a = new Date(s.timing.kickoffTime) >= n;
|
|
2640
2686
|
return i && r && a;
|
|
2641
2687
|
});
|
|
2642
2688
|
return o.sort((s, i) => new Date(s.timing.kickoffTime).getTime() - new Date(i.timing.kickoffTime).getTime()), o[0];
|
|
2643
2689
|
}
|
|
2644
|
-
function
|
|
2690
|
+
function So(t, e) {
|
|
2645
2691
|
const n = /* @__PURE__ */ new Date(), o = e.filter((s) => {
|
|
2646
2692
|
const i = s.competitorOne.id === t || s.competitorTwo.id === t, r = s.status.type === "FINISHED", a = new Date(s.timing.kickoffTime) <= n;
|
|
2647
2693
|
return i && r && a;
|
|
2648
2694
|
});
|
|
2649
2695
|
return o.sort((s, i) => new Date(i.timing.kickoffTime).getTime() - new Date(s.timing.kickoffTime).getTime()), o[0];
|
|
2650
2696
|
}
|
|
2651
|
-
function
|
|
2697
|
+
function Ao(t, e) {
|
|
2652
2698
|
const n = /* @__PURE__ */ new Date();
|
|
2653
2699
|
return e.filter((s) => {
|
|
2654
2700
|
const i = s.competitorOne.id === t || s.competitorTwo.id === t, r = s.status.type === "NOT_STARTED" || s.status.type === "LIVE", a = new Date(s.timing.kickoffTime) >= n || s.status.type === "LIVE";
|
|
@@ -2657,7 +2703,7 @@ function To(t, e) {
|
|
|
2657
2703
|
(s, i) => new Date(s.timing.kickoffTime).getTime() - new Date(i.timing.kickoffTime).getTime()
|
|
2658
2704
|
);
|
|
2659
2705
|
}
|
|
2660
|
-
function
|
|
2706
|
+
function Co(t, e) {
|
|
2661
2707
|
const n = /* @__PURE__ */ new Date();
|
|
2662
2708
|
return e.filter((s) => {
|
|
2663
2709
|
const i = s.competitorOne.id === t || s.competitorTwo.id === t, r = s.status.type === "FINISHED", a = new Date(s.timing.kickoffTime) <= n;
|
|
@@ -2666,7 +2712,7 @@ function _o(t, e) {
|
|
|
2666
2712
|
(s, i) => new Date(i.timing.kickoffTime).getTime() - new Date(s.timing.kickoffTime).getTime()
|
|
2667
2713
|
);
|
|
2668
2714
|
}
|
|
2669
|
-
function
|
|
2715
|
+
function Oo(t, e, n) {
|
|
2670
2716
|
const o = n.filter((r) => r.status.type === "FINISHED"), s = n.filter(
|
|
2671
2717
|
(r) => r.status.type === "NOT_STARTED" || r.status.type === "POSTPONED"
|
|
2672
2718
|
), i = e.entries.map((r) => {
|
|
@@ -2716,7 +2762,7 @@ function vo(t, e, n) {
|
|
|
2716
2762
|
rows: i
|
|
2717
2763
|
};
|
|
2718
2764
|
}
|
|
2719
|
-
function
|
|
2765
|
+
function Eo(t, e = 10) {
|
|
2720
2766
|
return t.players.filter((n) => (n.seasonStatistics?.goals ?? 0) > 0).sort((n, o) => {
|
|
2721
2767
|
const s = n.seasonStatistics?.goals ?? 0, i = o.seasonStatistics?.goals ?? 0;
|
|
2722
2768
|
if (i !== s)
|
|
@@ -2725,7 +2771,7 @@ function So(t, e = 10) {
|
|
|
2725
2771
|
return (o.seasonStatistics?.assists ?? 0) - r;
|
|
2726
2772
|
}).slice(0, e);
|
|
2727
2773
|
}
|
|
2728
|
-
function
|
|
2774
|
+
function Fo(t, e = 10) {
|
|
2729
2775
|
return t.players.filter((n) => (n.seasonStatistics?.assists ?? 0) > 0).sort((n, o) => {
|
|
2730
2776
|
const s = n.seasonStatistics?.assists ?? 0, i = o.seasonStatistics?.assists ?? 0;
|
|
2731
2777
|
if (i !== s)
|
|
@@ -2734,7 +2780,7 @@ function Ao(t, e = 10) {
|
|
|
2734
2780
|
return (o.seasonStatistics?.goals ?? 0) - r;
|
|
2735
2781
|
}).slice(0, e);
|
|
2736
2782
|
}
|
|
2737
|
-
function
|
|
2783
|
+
function Lo(t, e = 10) {
|
|
2738
2784
|
return t.players.filter((n) => (n.seasonStatistics?.appearances ?? 0) > 0).sort((n, o) => {
|
|
2739
2785
|
const s = n.seasonStatistics?.appearances ?? 0, i = o.seasonStatistics?.appearances ?? 0;
|
|
2740
2786
|
if (i !== s)
|
|
@@ -2743,7 +2789,7 @@ function Co(t, e = 10) {
|
|
|
2743
2789
|
return (o.seasonStatistics?.minutes ?? 0) - r;
|
|
2744
2790
|
}).slice(0, e);
|
|
2745
2791
|
}
|
|
2746
|
-
function
|
|
2792
|
+
function bo(t, e = 10) {
|
|
2747
2793
|
return t.players.filter((n) => (n.seasonStatistics?.minutes ?? 0) > 0).sort((n, o) => {
|
|
2748
2794
|
const s = n.seasonStatistics?.minutes ?? 0, i = o.seasonStatistics?.minutes ?? 0;
|
|
2749
2795
|
if (i !== s)
|
|
@@ -2752,7 +2798,7 @@ function Oo(t, e = 10) {
|
|
|
2752
2798
|
return (o.seasonStatistics?.appearances ?? 0) - r;
|
|
2753
2799
|
}).slice(0, e);
|
|
2754
2800
|
}
|
|
2755
|
-
function
|
|
2801
|
+
function No(t, e = 10) {
|
|
2756
2802
|
return t.players.filter((n) => (n.seasonStatistics?.cleansheets ?? 0) > 0).sort((n, o) => {
|
|
2757
2803
|
const s = n.seasonStatistics?.cleansheets ?? 0, i = o.seasonStatistics?.cleansheets ?? 0;
|
|
2758
2804
|
if (i !== s)
|
|
@@ -2761,7 +2807,7 @@ function Eo(t, e = 10) {
|
|
|
2761
2807
|
return (o.seasonStatistics?.appearances ?? 0) - r;
|
|
2762
2808
|
}).slice(0, e);
|
|
2763
2809
|
}
|
|
2764
|
-
function
|
|
2810
|
+
function Ro(t, e = 10) {
|
|
2765
2811
|
return t.players.filter((n) => {
|
|
2766
2812
|
const o = n.seasonStatistics?.yellowCards ?? 0, s = n.seasonStatistics?.redCards ?? 0;
|
|
2767
2813
|
return o + s > 0;
|
|
@@ -2814,7 +2860,7 @@ function Z(t) {
|
|
|
2814
2860
|
i && i.appearances !== void 0 && (i.appearances = o.size);
|
|
2815
2861
|
}), e;
|
|
2816
2862
|
}
|
|
2817
|
-
function
|
|
2863
|
+
function ct(t) {
|
|
2818
2864
|
return Array.from(t.values()).map((e) => ({
|
|
2819
2865
|
...e,
|
|
2820
2866
|
totalCards: (e.yellowCards ?? 0) + (e.redCards ?? 0)
|
|
@@ -2822,7 +2868,7 @@ function at(t) {
|
|
|
2822
2868
|
}
|
|
2823
2869
|
function bn(t, e = 10) {
|
|
2824
2870
|
const n = Z(t);
|
|
2825
|
-
return
|
|
2871
|
+
return ct(n).filter((s) => (s.goals ?? 0) > 0).sort((s, i) => {
|
|
2826
2872
|
const r = s.goals ?? 0, a = i.goals ?? 0;
|
|
2827
2873
|
if (a !== r)
|
|
2828
2874
|
return a - r;
|
|
@@ -2832,7 +2878,7 @@ function bn(t, e = 10) {
|
|
|
2832
2878
|
}
|
|
2833
2879
|
function Nn(t, e = 10) {
|
|
2834
2880
|
const n = Z(t);
|
|
2835
|
-
return
|
|
2881
|
+
return ct(n).filter((s) => (s.assists ?? 0) > 0).sort((s, i) => {
|
|
2836
2882
|
const r = s.assists ?? 0, a = i.assists ?? 0;
|
|
2837
2883
|
if (a !== r)
|
|
2838
2884
|
return a - r;
|
|
@@ -2842,7 +2888,7 @@ function Nn(t, e = 10) {
|
|
|
2842
2888
|
}
|
|
2843
2889
|
function Rn(t, e = 10) {
|
|
2844
2890
|
const n = Z(t);
|
|
2845
|
-
return
|
|
2891
|
+
return ct(n).filter((s) => (s.totalCards ?? 0) > 0).sort((s, i) => {
|
|
2846
2892
|
const r = (s.yellowCards ?? 0) + (s.redCards ?? 0) * 3, a = (i.yellowCards ?? 0) + (i.redCards ?? 0) * 3;
|
|
2847
2893
|
if (a !== r)
|
|
2848
2894
|
return a - r;
|
|
@@ -2855,7 +2901,7 @@ function Rn(t, e = 10) {
|
|
|
2855
2901
|
}
|
|
2856
2902
|
function In(t, e = 10) {
|
|
2857
2903
|
const n = Z(t);
|
|
2858
|
-
return
|
|
2904
|
+
return ct(n).filter((s) => (s.goals ?? 0) + (s.assists ?? 0) > 0).sort((s, i) => {
|
|
2859
2905
|
const r = (s.goals ?? 0) + (s.assists ?? 0), a = (i.goals ?? 0) + (i.assists ?? 0);
|
|
2860
2906
|
if (a !== r)
|
|
2861
2907
|
return a - r;
|
|
@@ -2868,7 +2914,7 @@ function In(t, e = 10) {
|
|
|
2868
2914
|
}
|
|
2869
2915
|
function Pn(t) {
|
|
2870
2916
|
const e = Z(t);
|
|
2871
|
-
return
|
|
2917
|
+
return ct(e).sort((o, s) => {
|
|
2872
2918
|
const i = o.appearances ?? 0, r = s.appearances ?? 0;
|
|
2873
2919
|
if (r !== i)
|
|
2874
2920
|
return r - i;
|
|
@@ -2876,49 +2922,49 @@ function Pn(t) {
|
|
|
2876
2922
|
return (s.goals ?? 0) + (s.assists ?? 0) - a;
|
|
2877
2923
|
});
|
|
2878
2924
|
}
|
|
2879
|
-
function
|
|
2925
|
+
function Io(t, e = 10) {
|
|
2880
2926
|
return j(() => bn(t, e), [t, e]);
|
|
2881
2927
|
}
|
|
2882
|
-
function
|
|
2928
|
+
function Po(t, e = 10) {
|
|
2883
2929
|
return j(() => Nn(t, e), [t, e]);
|
|
2884
2930
|
}
|
|
2885
|
-
function
|
|
2931
|
+
function Mo(t, e = 10) {
|
|
2886
2932
|
return j(() => Rn(t, e), [t, e]);
|
|
2887
2933
|
}
|
|
2888
|
-
function
|
|
2934
|
+
function Go(t, e = 10) {
|
|
2889
2935
|
return j(() => In(t, e), [t, e]);
|
|
2890
2936
|
}
|
|
2891
|
-
function
|
|
2937
|
+
function Do(t) {
|
|
2892
2938
|
return j(() => Pn(t), [t]);
|
|
2893
2939
|
}
|
|
2894
2940
|
function Mn(t) {
|
|
2895
2941
|
return j(() => Z(t), [t]);
|
|
2896
2942
|
}
|
|
2897
|
-
function
|
|
2943
|
+
function xo(t, e) {
|
|
2898
2944
|
const n = Mn(t);
|
|
2899
2945
|
return j(() => n.get(e), [n, e]);
|
|
2900
2946
|
}
|
|
2901
2947
|
const Gn = ["GOAL", "PENALTY_GOAL", "OWN_GOAL"];
|
|
2902
|
-
function
|
|
2948
|
+
function P(t, e) {
|
|
2903
2949
|
return e > 0 ? t / e * 100 : 0;
|
|
2904
2950
|
}
|
|
2905
|
-
function
|
|
2951
|
+
function lt(t, e) {
|
|
2906
2952
|
return e > 0 ? t / e : 0;
|
|
2907
2953
|
}
|
|
2908
|
-
function
|
|
2954
|
+
function Uo(t, e = !1, n = 2) {
|
|
2909
2955
|
return e ? `${Math.round(t)}%` : Number.isInteger(t) ? t.toString() : t.toFixed(n);
|
|
2910
2956
|
}
|
|
2911
|
-
function
|
|
2957
|
+
function Ho(t, e) {
|
|
2912
2958
|
const n = typeof t == "string" ? parseFloat(t) : t;
|
|
2913
2959
|
if (isNaN(n) || e === 0) return "0";
|
|
2914
2960
|
const o = (n / e).toFixed(1);
|
|
2915
2961
|
return `${n} (${o} avg)`;
|
|
2916
2962
|
}
|
|
2917
|
-
function
|
|
2963
|
+
function ko(t, e) {
|
|
2918
2964
|
const n = typeof t == "string" ? parseFloat(t) : t;
|
|
2919
2965
|
return isNaN(n) || e === 0 ? "0.0" : (n / e).toFixed(1);
|
|
2920
2966
|
}
|
|
2921
|
-
function
|
|
2967
|
+
function $o(t) {
|
|
2922
2968
|
const e = parseFloat(t);
|
|
2923
2969
|
return isNaN(e) ? "0%" : `${Math.round(e)}%`;
|
|
2924
2970
|
}
|
|
@@ -2949,27 +2995,27 @@ function Dn(t, e, n) {
|
|
|
2949
2995
|
isLoss: i < r
|
|
2950
2996
|
};
|
|
2951
2997
|
}
|
|
2952
|
-
function
|
|
2998
|
+
function Ot(t, e) {
|
|
2953
2999
|
return t.competitorOne.id === e;
|
|
2954
3000
|
}
|
|
2955
|
-
function
|
|
3001
|
+
function xn(t, e) {
|
|
2956
3002
|
return t.competitorTwo.id === e;
|
|
2957
3003
|
}
|
|
2958
|
-
function
|
|
2959
|
-
return
|
|
3004
|
+
function Bo(t, e) {
|
|
3005
|
+
return Ot(t, e) || xn(t, e);
|
|
2960
3006
|
}
|
|
2961
|
-
function
|
|
3007
|
+
function Wo(t) {
|
|
2962
3008
|
return t.status?.type === "FINISHED";
|
|
2963
3009
|
}
|
|
2964
|
-
function
|
|
2965
|
-
const n =
|
|
3010
|
+
function zo(t, e) {
|
|
3011
|
+
const n = Ot(t, e);
|
|
2966
3012
|
return parseInt(n ? t.score?.competitorOne || "0" : t.score?.competitorTwo || "0");
|
|
2967
3013
|
}
|
|
2968
|
-
function
|
|
2969
|
-
const n =
|
|
3014
|
+
function Yo(t, e) {
|
|
3015
|
+
const n = Ot(t, e);
|
|
2970
3016
|
return parseInt(n ? t.score?.competitorTwo || "0" : t.score?.competitorOne || "0");
|
|
2971
3017
|
}
|
|
2972
|
-
function
|
|
3018
|
+
function jo(t, e, n) {
|
|
2973
3019
|
const o = t.filter((f) => {
|
|
2974
3020
|
if (f.status?.type !== "FINISHED" || !f.score) return !1;
|
|
2975
3021
|
const l = f.competitorOne.id === e || f.competitorTwo.id === e, u = f.competitorOne.id === n || f.competitorTwo.id === n;
|
|
@@ -2995,7 +3041,7 @@ function Bo(t, e, n) {
|
|
|
2995
3041
|
awayTeamAvgGoals: d > 0 ? c / d : 0
|
|
2996
3042
|
};
|
|
2997
3043
|
}
|
|
2998
|
-
function
|
|
3044
|
+
function qo(t, e, n, o = 5) {
|
|
2999
3045
|
return t.filter((i) => {
|
|
3000
3046
|
if (i.status?.type !== "FINISHED" || !i.score) return !1;
|
|
3001
3047
|
const r = i.competitorOne.id === e || i.competitorTwo.id === e, a = i.competitorOne.id === n || i.competitorTwo.id === n;
|
|
@@ -3021,7 +3067,7 @@ function Wo(t, e, n, o = 5) {
|
|
|
3021
3067
|
};
|
|
3022
3068
|
});
|
|
3023
3069
|
}
|
|
3024
|
-
function
|
|
3070
|
+
function Un(t, e, n) {
|
|
3025
3071
|
return t.filter((o) => {
|
|
3026
3072
|
const s = o.competitorOne.id === e, i = o.competitorTwo.id === e;
|
|
3027
3073
|
return !s && !i ? !1 : n === "home" ? s : i;
|
|
@@ -3030,7 +3076,7 @@ function xn(t, e, n) {
|
|
|
3030
3076
|
return Dn(o, e, s);
|
|
3031
3077
|
}).filter((o) => o !== null);
|
|
3032
3078
|
}
|
|
3033
|
-
function
|
|
3079
|
+
function Rt(t, e, n, o) {
|
|
3034
3080
|
let s = 0;
|
|
3035
3081
|
for (const i of t) {
|
|
3036
3082
|
const r = i.competitorOne.id === e, a = i.competitorTwo.id === e;
|
|
@@ -3058,8 +3104,8 @@ function Hn(t, e, n) {
|
|
|
3058
3104
|
}
|
|
3059
3105
|
return o;
|
|
3060
3106
|
}
|
|
3061
|
-
function
|
|
3062
|
-
const o =
|
|
3107
|
+
function Qo(t, e, n) {
|
|
3108
|
+
const o = Un(t, e, n), s = o.length;
|
|
3063
3109
|
if (s === 0)
|
|
3064
3110
|
return {
|
|
3065
3111
|
played: 0,
|
|
@@ -3083,28 +3129,28 @@ function zo(t, e, n) {
|
|
|
3083
3129
|
const i = o.reduce((m, O) => m + O.goalsFor, 0), r = o.reduce((m, O) => m + O.goalsAgainst, 0), a = o.filter((m) => m.goalsAgainst === 0).length, c = o.filter((m) => m.isWin && m.goalsAgainst === 0).length, d = o.filter((m) => m.goalsFor > 0).length, f = o.filter((m) => m.goalsFor === 0).length, l = o.filter((m) => m.isLoss && m.goalsFor === 0).length, u = o.filter((m) => m.goalsAgainst > 0).length, h = o.filter((m) => m.halfTimeGoalsFor !== null), p = h.length, y = h.filter((m) => {
|
|
3084
3130
|
const O = m.halfTimeGoalsFor, w = m.goalsFor - O;
|
|
3085
3131
|
return O > 0 && w > 0;
|
|
3086
|
-
}).length, S =
|
|
3132
|
+
}).length, S = Rt(t, e, n, "scored"), g = Hn(t, e, n), T = h.filter((m) => m.halfTimeGoalsFor > m.halfTimeGoalsAgainst).length, A = h.filter((m) => {
|
|
3087
3133
|
const O = m.halfTimeGoalsAgainst, w = m.goalsAgainst - O;
|
|
3088
3134
|
return O > 0 && w > 0;
|
|
3089
|
-
}).length, C =
|
|
3135
|
+
}).length, C = Rt(t, e, n, "conceded"), v = h.filter((m) => m.halfTimeGoalsAgainst > m.halfTimeGoalsFor).length, I = o.filter((m) => m.cornersFor !== null), M = I.reduce((m, O) => m + (O.cornersFor || 0), 0), G = I.reduce((m, O) => m + (O.cornersAgainst || 0), 0);
|
|
3090
3136
|
return {
|
|
3091
3137
|
played: s,
|
|
3092
|
-
goalsForPerMatch:
|
|
3093
|
-
cleanSheets:
|
|
3094
|
-
wonToNil:
|
|
3095
|
-
scoringRate:
|
|
3096
|
-
scoredInBothHalves:
|
|
3097
|
-
scoredFirst:
|
|
3098
|
-
leadingAtHalfTime:
|
|
3099
|
-
goalsAgainstPerMatch:
|
|
3100
|
-
failedToScore:
|
|
3101
|
-
lostToNil:
|
|
3102
|
-
concedingRate:
|
|
3103
|
-
concededInBothHalves:
|
|
3104
|
-
concededFirst:
|
|
3105
|
-
losingAtHalfTime:
|
|
3106
|
-
avgCornersFor:
|
|
3107
|
-
avgCornersAgainst:
|
|
3138
|
+
goalsForPerMatch: lt(i, s),
|
|
3139
|
+
cleanSheets: P(a, s),
|
|
3140
|
+
wonToNil: P(c, s),
|
|
3141
|
+
scoringRate: P(d, s),
|
|
3142
|
+
scoredInBothHalves: P(y, p),
|
|
3143
|
+
scoredFirst: P(S, g),
|
|
3144
|
+
leadingAtHalfTime: P(T, p),
|
|
3145
|
+
goalsAgainstPerMatch: lt(r, s),
|
|
3146
|
+
failedToScore: P(f, s),
|
|
3147
|
+
lostToNil: P(l, s),
|
|
3148
|
+
concedingRate: P(u, s),
|
|
3149
|
+
concededInBothHalves: P(A, p),
|
|
3150
|
+
concededFirst: P(C, g),
|
|
3151
|
+
losingAtHalfTime: P(v, p),
|
|
3152
|
+
avgCornersFor: lt(M, I.length),
|
|
3153
|
+
avgCornersAgainst: lt(G, I.length)
|
|
3108
3154
|
};
|
|
3109
3155
|
}
|
|
3110
3156
|
function kn(t, e) {
|
|
@@ -3126,7 +3172,7 @@ function kn(t, e) {
|
|
|
3126
3172
|
function _(t, e) {
|
|
3127
3173
|
return t.length === 0 ? 0 : t.filter((o) => o > e).length / t.length * 100;
|
|
3128
3174
|
}
|
|
3129
|
-
function
|
|
3175
|
+
function Vo(t, e) {
|
|
3130
3176
|
const n = kn(t, e), o = n.filter((l) => l.isHome), s = n.filter((l) => !l.isHome), i = n.map((l) => l.totalGoals), r = o.map((l) => l.totalGoals), a = s.map((l) => l.totalGoals), c = n.filter((l) => l.halfTimeGoals !== null).map((l) => l.halfTimeGoals), d = o.filter((l) => l.halfTimeGoals !== null).map((l) => l.halfTimeGoals), f = s.filter((l) => l.halfTimeGoals !== null).map((l) => l.halfTimeGoals);
|
|
3131
3177
|
return {
|
|
3132
3178
|
over05: {
|
|
@@ -3186,10 +3232,10 @@ function $n(t, e) {
|
|
|
3186
3232
|
isHome: n
|
|
3187
3233
|
};
|
|
3188
3234
|
}
|
|
3189
|
-
function
|
|
3190
|
-
const r = e?.entries.find((
|
|
3235
|
+
function Ko(t, e, n, o, s, i) {
|
|
3236
|
+
const r = e?.entries.find(($) => $.competitor.id === t), a = n?.entries.find(($) => $.competitor.id === t), c = o?.entries.find(($) => $.competitor.id === t), d = s?.entries.find(($) => $.competitor.id === t), f = i?.entries.find(($) => $.competitor.id === t);
|
|
3191
3237
|
if (!r) return null;
|
|
3192
|
-
const l = a?.stats?.goalsFor ?? 0, u = c?.stats?.goalsFor ?? 0, h = r?.stats?.goalsFor ?? 0, p = d?.stats?.goalsAgainst ?? 0, y = f?.stats?.goalsAgainst ?? 0, S = r?.stats?.goalsAgainst ?? 0, g = a?.stats?.played ?? 0, T = c?.stats?.played ?? 0, A = r?.stats?.played ?? 0, C = A > 0 ? h / A : 0, v = A > 0 ? S / A : 0,
|
|
3238
|
+
const l = a?.stats?.goalsFor ?? 0, u = c?.stats?.goalsFor ?? 0, h = r?.stats?.goalsFor ?? 0, p = d?.stats?.goalsAgainst ?? 0, y = f?.stats?.goalsAgainst ?? 0, S = r?.stats?.goalsAgainst ?? 0, g = a?.stats?.played ?? 0, T = c?.stats?.played ?? 0, A = r?.stats?.played ?? 0, C = A > 0 ? h / A : 0, v = A > 0 ? S / A : 0, I = C + v, M = g > 0 ? l / g : 0, G = T > 0 ? u / T : 0, m = g > 0 ? p / g : 0, O = T > 0 ? y / T : 0, w = M + m, Qt = G + O;
|
|
3193
3239
|
return {
|
|
3194
3240
|
homeGoals: l,
|
|
3195
3241
|
totalGoals: h,
|
|
@@ -3202,13 +3248,13 @@ function jo(t, e, n, o, s, i) {
|
|
|
3202
3248
|
awayGoalsConceded: y,
|
|
3203
3249
|
gfPerMatch: C,
|
|
3204
3250
|
gaPerMatch: v,
|
|
3205
|
-
gfGaPerMatch:
|
|
3206
|
-
homeGfPerMatch:
|
|
3207
|
-
awayGfPerMatch:
|
|
3251
|
+
gfGaPerMatch: I,
|
|
3252
|
+
homeGfPerMatch: M,
|
|
3253
|
+
awayGfPerMatch: G,
|
|
3208
3254
|
homeGaPerMatch: m,
|
|
3209
3255
|
awayGaPerMatch: O,
|
|
3210
3256
|
homeGfGaPerMatch: w,
|
|
3211
|
-
awayGfGaPerMatch:
|
|
3257
|
+
awayGfGaPerMatch: Qt
|
|
3212
3258
|
};
|
|
3213
3259
|
}
|
|
3214
3260
|
function N(t, e, n, o) {
|
|
@@ -3227,7 +3273,7 @@ function N(t, e, n, o) {
|
|
|
3227
3273
|
}
|
|
3228
3274
|
return i > 0 ? i : null;
|
|
3229
3275
|
}
|
|
3230
|
-
const
|
|
3276
|
+
const F = {
|
|
3231
3277
|
win: (t, e, n) => {
|
|
3232
3278
|
const o = parseInt(n ? t.score?.competitorOne || "0" : t.score?.competitorTwo || "0"), s = parseInt(n ? t.score?.competitorTwo || "0" : t.score?.competitorOne || "0");
|
|
3233
3279
|
return o > s;
|
|
@@ -3237,38 +3283,38 @@ const E = {
|
|
|
3237
3283
|
const o = parseInt(n ? t.score?.competitorOne || "0" : t.score?.competitorTwo || "0"), s = parseInt(n ? t.score?.competitorTwo || "0" : t.score?.competitorOne || "0");
|
|
3238
3284
|
return o < s;
|
|
3239
3285
|
},
|
|
3240
|
-
noWin: (t, e, n) => !
|
|
3241
|
-
noDraw: (t) => !
|
|
3242
|
-
noDefeat: (t, e, n) => !
|
|
3286
|
+
noWin: (t, e, n) => !F.win(t, e, n),
|
|
3287
|
+
noDraw: (t) => !F.draw(t),
|
|
3288
|
+
noDefeat: (t, e, n) => !F.loss(t, e, n),
|
|
3243
3289
|
scored: (t, e, n) => parseInt(n ? t.score?.competitorOne || "0" : t.score?.competitorTwo || "0") >= 1,
|
|
3244
3290
|
conceded: (t, e, n) => parseInt(n ? t.score?.competitorTwo || "0" : t.score?.competitorOne || "0") >= 1,
|
|
3245
|
-
noGoalScored: (t, e, n) => !
|
|
3246
|
-
noGoalConceded: (t, e, n) => !
|
|
3291
|
+
noGoalScored: (t, e, n) => !F.scored(t, e, n),
|
|
3292
|
+
noGoalConceded: (t, e, n) => !F.conceded(t, e, n),
|
|
3247
3293
|
over25: (t) => parseInt(t.score?.competitorOne || "0") + parseInt(t.score?.competitorTwo || "0") > 2,
|
|
3248
3294
|
under25: (t) => parseInt(t.score?.competitorOne || "0") + parseInt(t.score?.competitorTwo || "0") < 3,
|
|
3249
3295
|
scoredTwice: (t, e, n) => parseInt(n ? t.score?.competitorOne || "0" : t.score?.competitorTwo || "0") >= 2,
|
|
3250
3296
|
concededTwice: (t, e, n) => parseInt(n ? t.score?.competitorTwo || "0" : t.score?.competitorOne || "0") >= 2
|
|
3251
3297
|
};
|
|
3252
|
-
function
|
|
3253
|
-
return {
|
|
3254
|
-
win: N(t, e,
|
|
3255
|
-
draw: N(t, e,
|
|
3256
|
-
loss: N(t, e,
|
|
3257
|
-
noWin: N(t, e,
|
|
3258
|
-
noDraw: N(t, e,
|
|
3259
|
-
noDefeat: N(t, e,
|
|
3260
|
-
scored: N(t, e,
|
|
3261
|
-
conceded: N(t, e,
|
|
3262
|
-
noGoalScored: N(t, e,
|
|
3263
|
-
noGoalConceded: N(t, e,
|
|
3264
|
-
over25: N(t, e,
|
|
3265
|
-
under25: N(t, e,
|
|
3266
|
-
scoredTwice: N(t, e,
|
|
3267
|
-
concededTwice: N(t, e,
|
|
3268
|
-
};
|
|
3269
|
-
}
|
|
3270
|
-
function
|
|
3271
|
-
const o =
|
|
3298
|
+
function dt(t, e, n) {
|
|
3299
|
+
return {
|
|
3300
|
+
win: N(t, e, F.win, n),
|
|
3301
|
+
draw: N(t, e, F.draw, n),
|
|
3302
|
+
loss: N(t, e, F.loss, n),
|
|
3303
|
+
noWin: N(t, e, F.noWin, n),
|
|
3304
|
+
noDraw: N(t, e, F.noDraw, n),
|
|
3305
|
+
noDefeat: N(t, e, F.noDefeat, n),
|
|
3306
|
+
scored: N(t, e, F.scored, n),
|
|
3307
|
+
conceded: N(t, e, F.conceded, n),
|
|
3308
|
+
noGoalScored: N(t, e, F.noGoalScored, n),
|
|
3309
|
+
noGoalConceded: N(t, e, F.noGoalConceded, n),
|
|
3310
|
+
over25: N(t, e, F.over25, n),
|
|
3311
|
+
under25: N(t, e, F.under25, n),
|
|
3312
|
+
scoredTwice: N(t, e, F.scoredTwice, n),
|
|
3313
|
+
concededTwice: N(t, e, F.concededTwice, n)
|
|
3314
|
+
};
|
|
3315
|
+
}
|
|
3316
|
+
function Xo(t, e, n) {
|
|
3317
|
+
const o = dt(t, e, "home"), s = dt(t, e), i = dt(t, n, "away"), r = dt(t, n);
|
|
3272
3318
|
return [
|
|
3273
3319
|
{
|
|
3274
3320
|
label: "Consecutive wins",
|
|
@@ -3356,7 +3402,7 @@ function qo(t, e, n) {
|
|
|
3356
3402
|
}
|
|
3357
3403
|
];
|
|
3358
3404
|
}
|
|
3359
|
-
function
|
|
3405
|
+
function It(t, e) {
|
|
3360
3406
|
const n = /* @__PURE__ */ new Map();
|
|
3361
3407
|
return t.forEach((o) => {
|
|
3362
3408
|
if (o.status?.type !== "FINISHED") return;
|
|
@@ -3370,8 +3416,8 @@ function Rt(t, e) {
|
|
|
3370
3416
|
s.isHome ? a.homeResult = s.result : a.awayResult = s.result, n.set(i, a);
|
|
3371
3417
|
}), n;
|
|
3372
3418
|
}
|
|
3373
|
-
function
|
|
3374
|
-
const a =
|
|
3419
|
+
function Jo(t, e, n, o, s, i, r) {
|
|
3420
|
+
const a = It(t, e), c = It(t, n), d = /* @__PURE__ */ new Set([
|
|
3375
3421
|
...a.keys(),
|
|
3376
3422
|
...c.keys(),
|
|
3377
3423
|
e,
|
|
@@ -3399,104 +3445,108 @@ function Qo(t, e, n, o, s, i, r) {
|
|
|
3399
3445
|
}
|
|
3400
3446
|
export {
|
|
3401
3447
|
Gn as GOAL_EVENT_TYPES,
|
|
3402
|
-
|
|
3448
|
+
ts as addProviderRef,
|
|
3403
3449
|
Z as aggregatePlayerStatisticsFromMatches,
|
|
3404
3450
|
Dn as analyzeMatch,
|
|
3405
3451
|
q as cached,
|
|
3406
3452
|
Tn as cachedBatch,
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3453
|
+
lt as calcAverage,
|
|
3454
|
+
P as calcPercentage,
|
|
3455
|
+
jo as calculateH2HStats,
|
|
3410
3456
|
N as calculateStreak,
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3457
|
+
ko as formatAsAverage,
|
|
3458
|
+
$o as formatPossessionPercentage,
|
|
3459
|
+
Uo as formatStatValue,
|
|
3460
|
+
Ho as formatWithAverage,
|
|
3461
|
+
_o as getActiveSeason,
|
|
3416
3462
|
Pn as getAllPlayerStatisticsFromMatches,
|
|
3417
3463
|
Yn as getBasketballLivescore,
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3464
|
+
es as getBatchMatchOdds,
|
|
3465
|
+
E as getConfig,
|
|
3466
|
+
mo as getFansUnitedCompetitions,
|
|
3467
|
+
yo as getFansUnitedCountries,
|
|
3468
|
+
ho as getFansUnitedEntitiesByIds,
|
|
3469
|
+
fo as getFansUnitedEntityById,
|
|
3424
3470
|
Xn as getFansUnitedFootballCompetition,
|
|
3425
3471
|
Kn as getFansUnitedFootballCompetitions,
|
|
3426
3472
|
eo as getFansUnitedFootballMatch,
|
|
3427
3473
|
no as getFansUnitedFootballMatches,
|
|
3428
3474
|
wn as getFansUnitedFootballPlayer,
|
|
3475
|
+
io as getFansUnitedFootballPlayerNextMatch,
|
|
3476
|
+
ro as getFansUnitedFootballPlayerPreviousMatch,
|
|
3429
3477
|
to as getFansUnitedFootballPlayers,
|
|
3430
|
-
|
|
3478
|
+
ao as getFansUnitedFootballSearch,
|
|
3431
3479
|
Jn as getFansUnitedFootballTeam,
|
|
3480
|
+
oo as getFansUnitedFootballTeamNextMatch,
|
|
3481
|
+
so as getFansUnitedFootballTeamPreviousMatch,
|
|
3432
3482
|
Zn as getFansUnitedFootballTeams,
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3483
|
+
uo as getFansUnitedSearchEntities,
|
|
3484
|
+
po as getFansUnitedTeamsByCompetition,
|
|
3485
|
+
go as getFansUnitedTeamsByCountry,
|
|
3486
|
+
To as getFansUnitedVenues,
|
|
3487
|
+
ns as getFootballCompetition,
|
|
3488
|
+
os as getFootballLivescore,
|
|
3489
|
+
ss as getFootballMatch,
|
|
3490
|
+
is as getFootballMatchCommentary,
|
|
3491
|
+
rs as getFootballMatchEvents,
|
|
3492
|
+
as as getFootballMatchLineups,
|
|
3493
|
+
cs as getFootballMatchOdds,
|
|
3494
|
+
ls as getFootballMatchStatistics,
|
|
3495
|
+
ds as getFootballMatches,
|
|
3496
|
+
us as getFootballPlayerSeasonStatistics,
|
|
3497
|
+
fs as getFootballSeasonDetails,
|
|
3498
|
+
hs as getFootballStandings,
|
|
3499
|
+
ms as getFootballTeam,
|
|
3500
|
+
gs as getFootballTeamSquad,
|
|
3501
|
+
ps as getLeaderboardMatches,
|
|
3502
|
+
ys as getLeaderboardTeamMatches,
|
|
3503
|
+
Ts as getLeaderboardTemplate,
|
|
3454
3504
|
$n as getMatchResult,
|
|
3455
3505
|
Rn as getMostCardedPlayersFromMatches,
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3506
|
+
Yo as getOpponentScore,
|
|
3507
|
+
_s as getProviderRefId,
|
|
3508
|
+
qo as getRecentH2HMeetings,
|
|
3459
3509
|
Qn as getSportal365Standings,
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3510
|
+
Co as getTeamFinishedMatches,
|
|
3511
|
+
Ko as getTeamGoalStats,
|
|
3512
|
+
Qo as getTeamHomeAwayStats,
|
|
3513
|
+
Ro as getTeamMostDecorated,
|
|
3514
|
+
vo as getTeamNextMatch,
|
|
3515
|
+
Vo as getTeamOverUnderStats,
|
|
3516
|
+
So as getTeamPreviousMatch,
|
|
3517
|
+
Oo as getTeamResultsTable,
|
|
3518
|
+
zo as getTeamScore,
|
|
3469
3519
|
Vn as getTeamSeasonStatistics,
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3520
|
+
dt as getTeamStreaks,
|
|
3521
|
+
Xo as getTeamStreaksComparison,
|
|
3522
|
+
Lo as getTeamTopAppearances,
|
|
3523
|
+
Fo as getTeamTopAssisters,
|
|
3524
|
+
No as getTeamTopCleanSheets,
|
|
3525
|
+
bo as getTeamTopMinutesPlayed,
|
|
3526
|
+
Eo as getTeamTopScorers,
|
|
3527
|
+
Ao as getTeamUpcomingMatches,
|
|
3528
|
+
Jo as getTeamsCommonOpponents,
|
|
3479
3529
|
jn as getTennisLivescore,
|
|
3480
3530
|
Nn as getTopAssistersFromMatches,
|
|
3481
3531
|
In as getTopGoalContributorsFromMatches,
|
|
3482
3532
|
bn as getTopScorersFromMatches,
|
|
3483
|
-
|
|
3484
|
-
|
|
3533
|
+
co as initL2,
|
|
3534
|
+
lo as invalidate,
|
|
3485
3535
|
ee as isConfigured,
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3536
|
+
Wo as isMatchFinished,
|
|
3537
|
+
xn as isTeamAway,
|
|
3538
|
+
Ot as isTeamHome,
|
|
3539
|
+
Bo as isTeamInMatch,
|
|
3490
3540
|
qn as search,
|
|
3491
3541
|
zn as searchFootball,
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3542
|
+
vs as setConfig,
|
|
3543
|
+
F as streakFilters,
|
|
3544
|
+
b as toProviderRefArray,
|
|
3545
|
+
Do as useAllPlayerStatisticsFromMatches,
|
|
3546
|
+
Mo as useMostCardedPlayersFromMatches,
|
|
3547
|
+
xo as usePlayerStatistics,
|
|
3498
3548
|
Mn as usePlayerStatisticsMap,
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3549
|
+
Po as useTopAssistersFromMatches,
|
|
3550
|
+
Go as useTopGoalContributorsFromMatches,
|
|
3551
|
+
Io as useTopScorersFromMatches
|
|
3502
3552
|
};
|