fansunited-frontend-components 0.0.52 → 0.0.53
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/Betslip.js +1 -1
- package/Predictor.js +1 -1
- package/README.md +37 -4
- package/chunks/{main-DDb9jezz.js → main-C7QFqjXA.js} +240 -220
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +33 -27
- package/package.json +1 -1
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
var ut = Object.defineProperty;
|
|
2
2
|
var ht = (t, e, n) => e in t ? ut(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
-
var
|
|
4
|
-
import { jsx as i, jsxs as
|
|
5
|
-
import
|
|
6
|
-
import { f as R, i as xt, a as St, c as wt, y as vt, e as
|
|
3
|
+
var B = (t, e, n) => ht(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { jsx as i, jsxs as u, Fragment as j } from "react/jsx-runtime";
|
|
5
|
+
import Y, { useState as k, useRef as gt, useEffect as T, createContext as bt, useMemo as J, useCallback as M, useContext as yt } from "react";
|
|
6
|
+
import { f as R, i as xt, a as St, c as wt, y as vt, e as L, b as E, d as W, a8 as A, H as U, a9 as at, a7 as st } from "./PrizeCard-DgHyperX.js";
|
|
7
7
|
import { P as Ct } from "./Portal-BQilulgu.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
import { y as Rt } from "./index-5MPtbA_r.js";
|
|
10
|
-
import { a as
|
|
11
|
-
class
|
|
10
|
+
import { a as _t, K as kt } from "./KeyboardArrowDown-BeaYH92n.js";
|
|
11
|
+
class Lt {
|
|
12
12
|
constructor() {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
B(this, "handler", null);
|
|
14
|
+
B(this, "queue", []);
|
|
15
|
+
B(this, "listeners", /* @__PURE__ */ new Set());
|
|
16
|
+
B(this, "lastState", { selections: [], stake: 0, totalOdds: 0 });
|
|
15
17
|
}
|
|
16
18
|
/** Called by BetslipShell on mount. Replays any queued pre-mount calls. */
|
|
17
19
|
_mount(e) {
|
|
@@ -21,6 +23,10 @@ class kt {
|
|
|
21
23
|
_unmount() {
|
|
22
24
|
this.handler = null;
|
|
23
25
|
}
|
|
26
|
+
/** Called by BetslipStateBridge whenever context state changes. */
|
|
27
|
+
_notify(e) {
|
|
28
|
+
this.lastState = e, this.listeners.forEach((n) => n(e));
|
|
29
|
+
}
|
|
24
30
|
setSelection(e) {
|
|
25
31
|
this.handler ? this.handler.setSelection(e) : this.queue.push(() => this.setSelection(e));
|
|
26
32
|
}
|
|
@@ -28,25 +34,31 @@ class kt {
|
|
|
28
34
|
var n;
|
|
29
35
|
(n = this.handler) == null || n.removeSelection(e);
|
|
30
36
|
}
|
|
37
|
+
getState() {
|
|
38
|
+
return this.lastState;
|
|
39
|
+
}
|
|
40
|
+
subscribe(e) {
|
|
41
|
+
return this.listeners.add(e), () => this.listeners.delete(e);
|
|
42
|
+
}
|
|
31
43
|
}
|
|
32
|
-
const
|
|
44
|
+
const N = new Lt();
|
|
33
45
|
function $t(t) {
|
|
34
46
|
const e = {}, n = /* @__PURE__ */ new Set();
|
|
35
47
|
return t.forEach((o) => {
|
|
36
|
-
const
|
|
37
|
-
e[
|
|
48
|
+
const a = `${o.eventId}::${o.marketId}`;
|
|
49
|
+
e[a] ? (n.add(e[a]), n.add(o.id)) : e[a] = o.id;
|
|
38
50
|
}), n;
|
|
39
51
|
}
|
|
40
52
|
function lt(t) {
|
|
41
53
|
return t.filter((e) => e.status === "active" || !e.status).reduce((e, n) => e * n.odds, 1);
|
|
42
54
|
}
|
|
43
|
-
function Tt(t, e, n, o,
|
|
44
|
-
const l = o ?? "Away",
|
|
55
|
+
function Tt(t, e, n, o, a, r) {
|
|
56
|
+
const l = o ?? "Away", s = e.toLowerCase(), p = (r == null ? void 0 : r.draw) || a("betslip.outcomes.draw"), c = (r == null ? void 0 : r.yes) || a("betslip.outcomes.yes"), h = (r == null ? void 0 : r.no) || a("betslip.outcomes.no"), m = (r == null ? void 0 : r.over) || a("betslip.outcomes.over"), d = (r == null ? void 0 : r.under) || a("betslip.outcomes.under"), b = (r == null ? void 0 : r.noGoal) || a("betslip.outcomes.noGoal"), f = (r == null ? void 0 : r.nobody) || a("betslip.outcomes.nobody"), g = (r == null ? void 0 : r.or) || a("betslip.outcomes.or");
|
|
45
57
|
switch (t) {
|
|
46
58
|
case "FT_1X2":
|
|
47
59
|
case "HT_1X2":
|
|
48
60
|
if (e === "1") return n;
|
|
49
|
-
if (
|
|
61
|
+
if (s === "x") return p;
|
|
50
62
|
if (e === "2") return l;
|
|
51
63
|
break;
|
|
52
64
|
case "DOUBLE_CHANCE": {
|
|
@@ -59,8 +71,8 @@ function Tt(t, e, n, o, s, r) {
|
|
|
59
71
|
case "BOTH_TEAMS_SCORE":
|
|
60
72
|
case "RED_CARD_MATCH":
|
|
61
73
|
case "PENALTY_MATCH":
|
|
62
|
-
if (
|
|
63
|
-
if (
|
|
74
|
+
if (s === "yes") return c;
|
|
75
|
+
if (s === "no") return h;
|
|
64
76
|
break;
|
|
65
77
|
case "CORRECT_SCORE":
|
|
66
78
|
case "CORRECT_SCORE_ADVANCED":
|
|
@@ -80,7 +92,7 @@ function Tt(t, e, n, o, s, r) {
|
|
|
80
92
|
case "LAST_TEAM_TO_SCORE":
|
|
81
93
|
if (e === "1") return n;
|
|
82
94
|
if (e === "2") return l;
|
|
83
|
-
if (
|
|
95
|
+
if (s === "none" || s === "no goal") return b;
|
|
84
96
|
break;
|
|
85
97
|
case "PLAYER_SCORE_FIRST_GOAL":
|
|
86
98
|
case "PLAYER_SCORE":
|
|
@@ -88,11 +100,11 @@ function Tt(t, e, n, o, s, r) {
|
|
|
88
100
|
case "PLAYER_SCORE_HATTRICK":
|
|
89
101
|
case "PLAYER_RED_CARD":
|
|
90
102
|
case "PLAYER_YELLOW_CARD":
|
|
91
|
-
return
|
|
103
|
+
return s === "none" || s === "no goal" || s === "nobody" ? f : e;
|
|
92
104
|
}
|
|
93
105
|
const y = t.match(/^(OVER|UNDER)_(GOALS|CORNERS)_(\d+)_(\d+)$/i);
|
|
94
106
|
if (y) {
|
|
95
|
-
const S = y[1].toUpperCase() === "OVER" !== (
|
|
107
|
+
const S = y[1].toUpperCase() === "OVER" !== (s === "no" || s === "under") ? m : d, w = `${y[3]}.${y[4]}`;
|
|
96
108
|
return `${S} ${w}`;
|
|
97
109
|
}
|
|
98
110
|
return e;
|
|
@@ -105,9 +117,9 @@ function It(t) {
|
|
|
105
117
|
const e = (n = t.participantTwo) == null ? void 0 : n.name;
|
|
106
118
|
return e ? `${t.participantOne.name} vs ${e}` : t.participantOne.name;
|
|
107
119
|
}
|
|
108
|
-
function
|
|
120
|
+
function Ot(t, e, n) {
|
|
109
121
|
return t.map((o) => {
|
|
110
|
-
var
|
|
122
|
+
var a, r, l;
|
|
111
123
|
return {
|
|
112
124
|
id: Et(o),
|
|
113
125
|
eventId: o.eventId,
|
|
@@ -118,7 +130,7 @@ function zt(t, e, n) {
|
|
|
118
130
|
o.market,
|
|
119
131
|
o.outcome,
|
|
120
132
|
o.participantOne.name,
|
|
121
|
-
(
|
|
133
|
+
(a = o.participantTwo) == null ? void 0 : a.name,
|
|
122
134
|
e,
|
|
123
135
|
n
|
|
124
136
|
),
|
|
@@ -136,7 +148,7 @@ function zt(t, e, n) {
|
|
|
136
148
|
};
|
|
137
149
|
});
|
|
138
150
|
}
|
|
139
|
-
const
|
|
151
|
+
const zt = {
|
|
140
152
|
HT_FT: ["first_half_and_final_result", "htft", "ht_ft"],
|
|
141
153
|
BOTH_TEAMS_SCORE: ["both_to_score", "btts", "gg"],
|
|
142
154
|
DOUBLE_CHANCE: ["double_chance", "dc"],
|
|
@@ -153,7 +165,7 @@ const ct = /^(OVER|UNDER)_(GOALS|CORNERS)_(\d+)_(\d+)$/i;
|
|
|
153
165
|
function Bt(t, e) {
|
|
154
166
|
const n = t.toLowerCase();
|
|
155
167
|
if (n === At(e)) return !0;
|
|
156
|
-
const o =
|
|
168
|
+
const o = zt[e];
|
|
157
169
|
return !!(o !== void 0 && o.includes(n) || ct.test(e) && n === "over_under");
|
|
158
170
|
}
|
|
159
171
|
function Dt(t) {
|
|
@@ -162,17 +174,17 @@ function Dt(t) {
|
|
|
162
174
|
}
|
|
163
175
|
function Wt(t, e) {
|
|
164
176
|
return t.map((n) => {
|
|
165
|
-
var
|
|
166
|
-
const
|
|
167
|
-
if (!
|
|
168
|
-
const r = Dt(n.id), l = n.marketId.match(ct),
|
|
169
|
-
for (const v of
|
|
170
|
-
if (Bt(((
|
|
177
|
+
var h, m, d, b, f, g, y, x;
|
|
178
|
+
const a = (e.get(n.eventId) ?? [])[0];
|
|
179
|
+
if (!a) return n;
|
|
180
|
+
const r = Dt(n.id), l = n.marketId.match(ct), s = l !== null, p = s ? r.toLowerCase() === "no" ? "under" : r.toLowerCase() === "yes" ? "over" : r.toLowerCase() : null, c = s ? `${l[3]}.${l[4]}` : null;
|
|
181
|
+
for (const v of a.markets ?? [])
|
|
182
|
+
if (Bt(((h = v == null ? void 0 : v.type) == null ? void 0 : h.code) ?? "", n.marketId))
|
|
171
183
|
for (const S of v.selections ?? []) {
|
|
172
184
|
let w;
|
|
173
|
-
if (
|
|
174
|
-
const
|
|
175
|
-
w =
|
|
185
|
+
if (s) {
|
|
186
|
+
const I = ((m = S.code) == null ? void 0 : m.toLowerCase()) === p || ((d = S.name) == null ? void 0 : d.toLowerCase()) === p, O = c === null || ((b = S.value) == null ? void 0 : b.toString()) === c;
|
|
187
|
+
w = I && O;
|
|
176
188
|
} else
|
|
177
189
|
w = ((f = S.code) == null ? void 0 : f.toLowerCase()) === r.toLowerCase() || ((g = S.name) == null ? void 0 : g.toLowerCase()) === r.toLowerCase();
|
|
178
190
|
if (w)
|
|
@@ -188,28 +200,28 @@ function Wt(t, e) {
|
|
|
188
200
|
});
|
|
189
201
|
}
|
|
190
202
|
function Ut(t, e, n) {
|
|
191
|
-
const [o,
|
|
203
|
+
const [o, a] = k(null), [r, l] = k(!1), s = gt(null), p = async (c) => {
|
|
192
204
|
if (!t || c.length === 0) return;
|
|
193
|
-
const
|
|
205
|
+
const h = [...new Set(c.map((b) => b.eventId))], m = [
|
|
194
206
|
...new Set(c.map((b) => b.market))
|
|
195
207
|
], d = new Rt({ marketTypes: m });
|
|
196
208
|
l(!0);
|
|
197
209
|
try {
|
|
198
|
-
const b = await t.odds.getByMatchIds(
|
|
199
|
-
|
|
210
|
+
const b = await t.odds.getByMatchIds(h, d);
|
|
211
|
+
a(b);
|
|
200
212
|
} catch {
|
|
201
213
|
} finally {
|
|
202
214
|
l(!1);
|
|
203
215
|
}
|
|
204
216
|
};
|
|
205
|
-
return
|
|
206
|
-
|
|
217
|
+
return T(() => (p(e), s.current && clearInterval(s.current), t && n > 0 && e.length > 0 && (s.current = setInterval(() => p(e), n)), () => {
|
|
218
|
+
s.current && clearInterval(s.current);
|
|
207
219
|
}), [JSON.stringify(e), n]), { oddsMap: o, oddsLoading: r };
|
|
208
220
|
}
|
|
209
221
|
function Ft(t) {
|
|
210
222
|
var e, n, o;
|
|
211
|
-
for (const
|
|
212
|
-
const r =
|
|
223
|
+
for (const a of t.values()) {
|
|
224
|
+
const r = a[0];
|
|
213
225
|
if (!r) continue;
|
|
214
226
|
const l = (o = (n = (e = r.bookmaker) == null ? void 0 : e.assets) == null ? void 0 : n[0]) == null ? void 0 : o.transparentBackgroundUrl;
|
|
215
227
|
if (l) return l;
|
|
@@ -218,19 +230,19 @@ function Ft(t) {
|
|
|
218
230
|
function Ht(t, e) {
|
|
219
231
|
var o;
|
|
220
232
|
const n = e ? "mobile" : "desktop";
|
|
221
|
-
for (const
|
|
222
|
-
const r =
|
|
233
|
+
for (const a of t.values()) {
|
|
234
|
+
const r = a[0];
|
|
223
235
|
if (!r) continue;
|
|
224
|
-
const l = ((o = r.bookmaker) == null ? void 0 : o.links) ?? [],
|
|
225
|
-
if (
|
|
236
|
+
const l = ((o = r.bookmaker) == null ? void 0 : o.links) ?? [], s = l.find((p) => p.appType === n) ?? l[0];
|
|
237
|
+
if (s != null && s.homepageUrl) return s.homepageUrl;
|
|
226
238
|
}
|
|
227
239
|
}
|
|
228
240
|
function Pt(t) {
|
|
229
|
-
var e, n, o,
|
|
241
|
+
var e, n, o, a, r;
|
|
230
242
|
for (const l of t.values()) {
|
|
231
|
-
const
|
|
232
|
-
if (!
|
|
233
|
-
const p = ((n = (e =
|
|
243
|
+
const s = l[0];
|
|
244
|
+
if (!s) continue;
|
|
245
|
+
const p = ((n = (e = s.bookmaker) == null ? void 0 : e.branding) == null ? void 0 : n.backgroundColor) ?? ((r = (a = (o = s.bookmaker) == null ? void 0 : o.assets) == null ? void 0 : a[0]) == null ? void 0 : r.backgroundColor);
|
|
234
246
|
if (p) return p;
|
|
235
247
|
}
|
|
236
248
|
}
|
|
@@ -239,27 +251,27 @@ const dt = bt(null), Nt = ({
|
|
|
239
251
|
initialSelections: e = [],
|
|
240
252
|
maxSelections: n,
|
|
241
253
|
currency: o = "€",
|
|
242
|
-
stakePresets:
|
|
254
|
+
stakePresets: a = [5, 10, 20],
|
|
243
255
|
ctaUrlTemplate: r,
|
|
244
256
|
onExternalRemove: l,
|
|
245
|
-
sharedOddsMap:
|
|
257
|
+
sharedOddsMap: s,
|
|
246
258
|
children: p
|
|
247
259
|
}) => {
|
|
248
|
-
const { t: c } = R(), [
|
|
249
|
-
|
|
260
|
+
const { t: c } = R(), [h, m] = k(e), [d, b] = k(""), [f, g] = k(!0), y = xt();
|
|
261
|
+
T(() => {
|
|
250
262
|
m(e);
|
|
251
263
|
}, [JSON.stringify(e)]);
|
|
252
|
-
const x =
|
|
253
|
-
if (!
|
|
254
|
-
const C =
|
|
264
|
+
const x = J(() => {
|
|
265
|
+
if (!s) return !1;
|
|
266
|
+
const C = s.values().next().value;
|
|
255
267
|
return Array.isArray(C) && C[0] !== void 0;
|
|
256
|
-
}, [
|
|
257
|
-
const C =
|
|
258
|
-
return
|
|
259
|
-
}, [
|
|
268
|
+
}, [s]), v = J(() => {
|
|
269
|
+
const C = Ot(h, c, t.outcomeLabels);
|
|
270
|
+
return s ? Wt(C, s) : C;
|
|
271
|
+
}, [h, s, c, t.outcomeLabels]), S = $t(v), w = s ? Ft(s) : void 0, I = s ? Ht(s, y) : void 0, O = s ? Pt(s) : void 0, F = M(
|
|
260
272
|
(C) => {
|
|
261
273
|
m(
|
|
262
|
-
(
|
|
274
|
+
(H) => H.filter((z) => `${z.eventId}:${z.market}:${z.outcome}` !== C)
|
|
263
275
|
), l == null || l(C);
|
|
264
276
|
},
|
|
265
277
|
[l]
|
|
@@ -269,7 +281,7 @@ const dt = bt(null), Nt = ({
|
|
|
269
281
|
{
|
|
270
282
|
value: {
|
|
271
283
|
labels: t,
|
|
272
|
-
selectionInputs:
|
|
284
|
+
selectionInputs: h,
|
|
273
285
|
selections: v,
|
|
274
286
|
combStake: d,
|
|
275
287
|
open: f,
|
|
@@ -277,32 +289,32 @@ const dt = bt(null), Nt = ({
|
|
|
277
289
|
oddsReady: x,
|
|
278
290
|
conflictIds: S,
|
|
279
291
|
currency: o,
|
|
280
|
-
stakePresets:
|
|
292
|
+
stakePresets: a,
|
|
281
293
|
ctaUrlTemplate: r,
|
|
282
294
|
maxSelections: n,
|
|
283
295
|
bookmakerLogoUrl: w,
|
|
284
|
-
bookmakerHomepageUrl:
|
|
285
|
-
bookmakerBackgroundColor:
|
|
286
|
-
onRemove:
|
|
296
|
+
bookmakerHomepageUrl: I,
|
|
297
|
+
bookmakerBackgroundColor: O,
|
|
298
|
+
onRemove: F,
|
|
287
299
|
setCombStake: b,
|
|
288
300
|
setOpen: g
|
|
289
301
|
},
|
|
290
302
|
children: p
|
|
291
303
|
}
|
|
292
304
|
);
|
|
293
|
-
},
|
|
305
|
+
}, _ = () => {
|
|
294
306
|
const t = yt(dt);
|
|
295
307
|
if (!t) throw new Error("useBetslip must be used within BetslipProvider");
|
|
296
308
|
return t;
|
|
297
309
|
};
|
|
298
310
|
function jt(t) {
|
|
299
|
-
const e = St(), n = wt(),
|
|
311
|
+
const e = St(), n = wt(), a = vt() === "light";
|
|
300
312
|
return {
|
|
301
313
|
primary: t || e.palette.primary.plainColor,
|
|
302
314
|
primaryHover: e.palette.primary.primaryContainer || t || e.palette.primary.plainColor,
|
|
303
315
|
s1: e.surface,
|
|
304
316
|
s2: e.onSurface,
|
|
305
|
-
s3:
|
|
317
|
+
s3: a ? e.surfaceVariant : e.onSurface,
|
|
306
318
|
bdr: e.outlineEnabledBorder,
|
|
307
319
|
t1: e.textPrimary,
|
|
308
320
|
t2: e.textSecondary,
|
|
@@ -321,7 +333,7 @@ const Q = ({
|
|
|
321
333
|
position: n,
|
|
322
334
|
brandingLogoUrl: o
|
|
323
335
|
}) => {
|
|
324
|
-
const { labels:
|
|
336
|
+
const { labels: a, selections: r, open: l, setOpen: s, maxSelections: p, bookmakerLogoUrl: c } = _(), { t: h } = R(), m = L(), d = E(), g = e ? "0" : n === "bottom-right" || n === "bottom-left" ? `${d.md} ${d.md} 0 0` : n === "top-right" || n === "top-left" ? `0 0 ${d.md} ${d.md}` : "0", y = o || c, x = {
|
|
325
337
|
background: "none",
|
|
326
338
|
border: "none",
|
|
327
339
|
cursor: "pointer",
|
|
@@ -335,7 +347,7 @@ const Q = ({
|
|
|
335
347
|
justifyContent: "center",
|
|
336
348
|
transition: "background .15s"
|
|
337
349
|
};
|
|
338
|
-
return /* @__PURE__ */
|
|
350
|
+
return /* @__PURE__ */ u(
|
|
339
351
|
"div",
|
|
340
352
|
{
|
|
341
353
|
style: {
|
|
@@ -353,7 +365,7 @@ const Q = ({
|
|
|
353
365
|
fontFamily: t.font
|
|
354
366
|
},
|
|
355
367
|
children: [
|
|
356
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
357
369
|
y ? /* @__PURE__ */ i(
|
|
358
370
|
"img",
|
|
359
371
|
{
|
|
@@ -379,10 +391,10 @@ const Q = ({
|
|
|
379
391
|
letterSpacing: "-0.5px",
|
|
380
392
|
color: "#fff"
|
|
381
393
|
},
|
|
382
|
-
children:
|
|
394
|
+
children: a.title || h("betslip.title")
|
|
383
395
|
}
|
|
384
396
|
),
|
|
385
|
-
r.length > 0 && p != null && /* @__PURE__ */
|
|
397
|
+
r.length > 0 && p != null && /* @__PURE__ */ u(
|
|
386
398
|
"span",
|
|
387
399
|
{
|
|
388
400
|
style: {
|
|
@@ -403,19 +415,19 @@ const Q = ({
|
|
|
403
415
|
"button",
|
|
404
416
|
{
|
|
405
417
|
style: x,
|
|
406
|
-
onClick: () =>
|
|
418
|
+
onClick: () => s(!l),
|
|
407
419
|
title: l ? "Collapse" : "Expand",
|
|
408
420
|
onMouseEnter: (v) => v.currentTarget.style.background = "rgba(255,255,255,.18)",
|
|
409
421
|
onMouseLeave: (v) => v.currentTarget.style.background = "none",
|
|
410
|
-
children: l ? /* @__PURE__ */ i(
|
|
422
|
+
children: l ? /* @__PURE__ */ i(_t, { sx: { fontSize: "1.125em", color: "inherit" } }) : /* @__PURE__ */ i(kt, { sx: { fontSize: "1.125em", color: "inherit" } })
|
|
411
423
|
}
|
|
412
424
|
)
|
|
413
425
|
]
|
|
414
426
|
}
|
|
415
427
|
);
|
|
416
428
|
}, Z = ({ tokens: t }) => {
|
|
417
|
-
const { t: e } = R(), n =
|
|
418
|
-
return /* @__PURE__ */
|
|
429
|
+
const { t: e } = R(), n = L(), o = W();
|
|
430
|
+
return /* @__PURE__ */ u(
|
|
419
431
|
"div",
|
|
420
432
|
{
|
|
421
433
|
style: {
|
|
@@ -454,12 +466,12 @@ const Q = ({
|
|
|
454
466
|
);
|
|
455
467
|
};
|
|
456
468
|
function Mt(t, e, n) {
|
|
457
|
-
const o = e.map((
|
|
469
|
+
const o = e.map((s) => s.selectionId).filter(Boolean).join(","), a = e[0], r = encodeURIComponent(
|
|
458
470
|
typeof window < "u" ? window.location.href : ""
|
|
459
471
|
), l = String(n);
|
|
460
|
-
return t.replace(/\{selectionIds\}/g, encodeURIComponent(o)).replace(/\{currentUrl\}/g, r).replace(/\{stake\}/g, l).replace(/\{eventId\}/g, (
|
|
472
|
+
return t.replace(/\{selectionIds\}/g, encodeURIComponent(o)).replace(/\{currentUrl\}/g, r).replace(/\{stake\}/g, l).replace(/\{eventId\}/g, (a == null ? void 0 : a.eventId) ?? "").replace(/\{oddsDecimal\}/g, a ? String(a.odds) : "").replace(/\{market\}/g, (a == null ? void 0 : a.marketId) ?? "").replace(/\{outcome\}/g, (a == null ? void 0 : a.name) ?? "");
|
|
461
473
|
}
|
|
462
|
-
const Yt =
|
|
474
|
+
const Yt = A.a`
|
|
463
475
|
display: flex;
|
|
464
476
|
align-items: center;
|
|
465
477
|
justify-content: center;
|
|
@@ -483,21 +495,21 @@ const Yt = O.a`
|
|
|
483
495
|
}) => {
|
|
484
496
|
const {
|
|
485
497
|
labels: o,
|
|
486
|
-
ctaUrlTemplate:
|
|
498
|
+
ctaUrlTemplate: a,
|
|
487
499
|
selections: r,
|
|
488
500
|
combStake: l,
|
|
489
|
-
bookmakerLogoUrl:
|
|
501
|
+
bookmakerLogoUrl: s,
|
|
490
502
|
bookmakerHomepageUrl: p
|
|
491
|
-
} =
|
|
492
|
-
if (
|
|
503
|
+
} = _(), { t: c } = R(), h = e || s, m = L(), d = E(), b = o.continueLabel || c("betslip.continueLabel"), f = (() => {
|
|
504
|
+
if (a)
|
|
493
505
|
return Mt(
|
|
494
|
-
|
|
506
|
+
a,
|
|
495
507
|
r,
|
|
496
508
|
parseFloat(l) || 0
|
|
497
509
|
);
|
|
498
510
|
if (p) return p;
|
|
499
511
|
})(), g = n || !f;
|
|
500
|
-
return /* @__PURE__ */ i("div", { children: /* @__PURE__ */
|
|
512
|
+
return /* @__PURE__ */ i("div", { children: /* @__PURE__ */ u(
|
|
501
513
|
Yt,
|
|
502
514
|
{
|
|
503
515
|
href: g ? void 0 : f,
|
|
@@ -514,10 +526,10 @@ const Yt = O.a`
|
|
|
514
526
|
},
|
|
515
527
|
children: [
|
|
516
528
|
/* @__PURE__ */ i("span", { children: b }),
|
|
517
|
-
|
|
529
|
+
h && /* @__PURE__ */ i(
|
|
518
530
|
"img",
|
|
519
531
|
{
|
|
520
|
-
src:
|
|
532
|
+
src: h,
|
|
521
533
|
alt: "",
|
|
522
534
|
style: {
|
|
523
535
|
height: "20px",
|
|
@@ -534,21 +546,21 @@ const Yt = O.a`
|
|
|
534
546
|
}
|
|
535
547
|
) });
|
|
536
548
|
}, tt = ({ color: t }) => {
|
|
537
|
-
const e =
|
|
549
|
+
const e = W();
|
|
538
550
|
return /* @__PURE__ */ i("div", { style: { borderBottom: `${e.size} solid ${t}` } });
|
|
539
551
|
}, Vt = ({
|
|
540
552
|
tokens: t,
|
|
541
553
|
brandingLogoUrl: e
|
|
542
554
|
}) => {
|
|
543
|
-
const { labels: n, selections: o, combStake:
|
|
555
|
+
const { labels: n, selections: o, combStake: a, conflictIds: r, currency: l } = _(), { t: s } = R(), p = L(), c = o.filter(
|
|
544
556
|
(g) => g.status === "active" || !g.status
|
|
545
|
-
),
|
|
557
|
+
), h = lt(c), m = parseFloat(a) || 0, d = m * h, b = r.size > 0, f = {
|
|
546
558
|
display: "flex",
|
|
547
559
|
justifyContent: "space-between",
|
|
548
560
|
alignItems: "center",
|
|
549
561
|
padding: "6px 0"
|
|
550
562
|
};
|
|
551
|
-
return /* @__PURE__ */
|
|
563
|
+
return /* @__PURE__ */ u(
|
|
552
564
|
"div",
|
|
553
565
|
{
|
|
554
566
|
style: {
|
|
@@ -557,9 +569,9 @@ const Yt = O.a`
|
|
|
557
569
|
fontFamily: t.font
|
|
558
570
|
},
|
|
559
571
|
children: [
|
|
560
|
-
/* @__PURE__ */
|
|
561
|
-
/* @__PURE__ */ i("span", { style: { fontSize: "0.6875em", color: t.t3 }, children: n.combinedOddsLabel ||
|
|
562
|
-
/* @__PURE__ */
|
|
572
|
+
/* @__PURE__ */ u("div", { style: f, children: [
|
|
573
|
+
/* @__PURE__ */ i("span", { style: { fontSize: "0.6875em", color: t.t3 }, children: n.combinedOddsLabel || s("betslip.combinedOddsLabel") }),
|
|
574
|
+
/* @__PURE__ */ u(
|
|
563
575
|
"span",
|
|
564
576
|
{
|
|
565
577
|
style: {
|
|
@@ -572,19 +584,19 @@ const Yt = O.a`
|
|
|
572
584
|
},
|
|
573
585
|
children: [
|
|
574
586
|
/* @__PURE__ */ i("span", { style: { fontSize: "0.5em", color: t.ok }, children: "▲" }),
|
|
575
|
-
|
|
587
|
+
h.toFixed(2)
|
|
576
588
|
]
|
|
577
589
|
}
|
|
578
590
|
)
|
|
579
591
|
] }),
|
|
580
592
|
/* @__PURE__ */ i(tt, { color: t.bdr }),
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */ i("span", { style: { fontSize: "0.8125em", fontWeight: 700, color: t.t1 }, children: n.totalStakeLabel ||
|
|
593
|
+
/* @__PURE__ */ u("div", { style: f, children: [
|
|
594
|
+
/* @__PURE__ */ i("span", { style: { fontSize: "0.8125em", fontWeight: 700, color: t.t1 }, children: n.totalStakeLabel || s("betslip.totalStakeLabel") }),
|
|
583
595
|
/* @__PURE__ */ i("span", { style: { fontSize: "0.8125em", fontWeight: 700, color: t.t1 }, children: m > 0 ? `${m.toFixed(2)}${l}` : "—" })
|
|
584
596
|
] }),
|
|
585
597
|
/* @__PURE__ */ i(tt, { color: t.bdr }),
|
|
586
|
-
/* @__PURE__ */
|
|
587
|
-
/* @__PURE__ */ i("span", { style: { fontSize: "0.8125em", fontWeight: 700, color: t.t1 }, children: n.potentialWinLabel ||
|
|
598
|
+
/* @__PURE__ */ u("div", { style: { ...f, borderBottom: "none", marginBottom: 10 }, children: [
|
|
599
|
+
/* @__PURE__ */ i("span", { style: { fontSize: "0.8125em", fontWeight: 700, color: t.t1 }, children: n.potentialWinLabel || s("betslip.potentialWinLabel") }),
|
|
588
600
|
/* @__PURE__ */ i(
|
|
589
601
|
"span",
|
|
590
602
|
{
|
|
@@ -611,22 +623,22 @@ const Yt = O.a`
|
|
|
611
623
|
};
|
|
612
624
|
function Gt(t, e, n) {
|
|
613
625
|
if (n != null && n[t]) return n[t];
|
|
614
|
-
const o = `betslip.markets.${t}`,
|
|
615
|
-
if (
|
|
626
|
+
const o = `betslip.markets.${t}`, a = e(o);
|
|
627
|
+
if (a !== o) return a;
|
|
616
628
|
const r = t.match(/^(OVER|UNDER)_(GOALS|CORNERS)_(\d+)_(\d+)$/i);
|
|
617
629
|
if (r) {
|
|
618
|
-
const l = r[2].charAt(0) + r[2].slice(1).toLowerCase(),
|
|
619
|
-
if (c !==
|
|
630
|
+
const l = r[2].charAt(0) + r[2].slice(1).toLowerCase(), s = `betslip.markets.${r[1].toUpperCase() === "OVER" ? "over" : "under"}${l}`, p = `${r[3]}.${r[4]}`, c = e(s, { line: p });
|
|
631
|
+
if (c !== s) return c;
|
|
620
632
|
}
|
|
621
633
|
return t.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (l) => l.toUpperCase());
|
|
622
634
|
}
|
|
623
|
-
const Xt =
|
|
635
|
+
const Xt = U`
|
|
624
636
|
from { opacity: 0; transform: translateX(8px); }
|
|
625
637
|
to { opacity: 1; transform: translateX(0); }
|
|
626
|
-
`, Kt =
|
|
638
|
+
`, Kt = U`
|
|
627
639
|
from { transform: rotate(0deg); }
|
|
628
640
|
to { transform: rotate(360deg); }
|
|
629
|
-
`, qt =
|
|
641
|
+
`, qt = A.div`
|
|
630
642
|
width: 12px;
|
|
631
643
|
height: 12px;
|
|
632
644
|
border-radius: 50%;
|
|
@@ -634,12 +646,12 @@ const Xt = W`
|
|
|
634
646
|
border-top-color: ${({ color: t }) => t};
|
|
635
647
|
animation: ${Kt} 0.7s linear infinite;
|
|
636
648
|
flex-shrink: 0;
|
|
637
|
-
`, Jt = () => /* @__PURE__ */ i("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ i("path", { d: "M7 4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1h3a1 1 0 1 1 0 2h-1l-1.4 13.2A2 2 0 0 1 16.6 22H7.4a2 2 0 0 1-2-1.8L4 7H3a1 1 0 1 1 0-2h3V4zm2 0v1h6V4H9zm-3 3 1.4 12h9.2L18 7H6zm4 2a1 1 0 0 1 1 1v7a1 1 0 1 1-2 0v-7a1 1 0 0 1 1-1zm4 0a1 1 0 0 1 1 1v7a1 1 0 1 1-2 0v-7a1 1 0 0 1 1-1z" }) }), Qt =
|
|
649
|
+
`, Jt = () => /* @__PURE__ */ i("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ i("path", { d: "M7 4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1h3a1 1 0 1 1 0 2h-1l-1.4 13.2A2 2 0 0 1 16.6 22H7.4a2 2 0 0 1-2-1.8L4 7H3a1 1 0 1 1 0-2h3V4zm2 0v1h6V4H9zm-3 3 1.4 12h9.2L18 7H6zm4 2a1 1 0 0 1 1 1v7a1 1 0 1 1-2 0v-7a1 1 0 0 1 1-1zm4 0a1 1 0 0 1 1 1v7a1 1 0 1 1-2 0v-7a1 1 0 0 1 1-1z" }) }), Qt = A.div`
|
|
638
650
|
animation: ${Xt} 0.18s ease;
|
|
639
|
-
`, Zt =
|
|
651
|
+
`, Zt = U`
|
|
640
652
|
0%, 100% { opacity: 1; }
|
|
641
653
|
50% { opacity: 0.2; }
|
|
642
|
-
`, te =
|
|
654
|
+
`, te = A.span`
|
|
643
655
|
width: 5px;
|
|
644
656
|
height: 5px;
|
|
645
657
|
border-radius: 50%;
|
|
@@ -651,11 +663,11 @@ function ee(t, e, n) {
|
|
|
651
663
|
if (!t) return "";
|
|
652
664
|
const o = new Date(t);
|
|
653
665
|
if (isNaN(o.getTime())) return "";
|
|
654
|
-
const
|
|
666
|
+
const a = /* @__PURE__ */ new Date(), r = a.toDateString(), l = new Date(a.getTime() + 864e5).toDateString(), s = o.toLocaleTimeString(e, {
|
|
655
667
|
hour: "2-digit",
|
|
656
668
|
minute: "2-digit"
|
|
657
669
|
});
|
|
658
|
-
return o.toDateString() === r ? `${n("betslip.today")} ${
|
|
670
|
+
return o.toDateString() === r ? `${n("betslip.today")} ${s}` : o.toDateString() === l ? `${n("betslip.tomorrow")} ${s}` : `${o.toLocaleDateString(e, { month: "short", day: "numeric" })} ${s}`;
|
|
659
671
|
}
|
|
660
672
|
const et = ({
|
|
661
673
|
logo: t,
|
|
@@ -712,8 +724,8 @@ const et = ({
|
|
|
712
724
|
) : /* @__PURE__ */ i("span", { style: { color: n.t2 }, children: e.charAt(0) })
|
|
713
725
|
}
|
|
714
726
|
), oe = ({ name: t, logo: e, tokens: n }) => {
|
|
715
|
-
const o =
|
|
716
|
-
return e ? /* @__PURE__ */
|
|
727
|
+
const o = L(), a = E(), [r, l] = Y.useState(!1);
|
|
728
|
+
return e ? /* @__PURE__ */ u(
|
|
717
729
|
"div",
|
|
718
730
|
{
|
|
719
731
|
style: { position: "relative", display: "inline-flex" },
|
|
@@ -753,7 +765,7 @@ const et = ({
|
|
|
753
765
|
fontSize: "0.6875em",
|
|
754
766
|
fontWeight: 500,
|
|
755
767
|
padding: `${o["2xs"]} ${o.xs}`,
|
|
756
|
-
borderRadius:
|
|
768
|
+
borderRadius: a.xs,
|
|
757
769
|
whiteSpace: "nowrap",
|
|
758
770
|
zIndex: 10,
|
|
759
771
|
pointerEvents: "none",
|
|
@@ -775,7 +787,7 @@ const et = ({
|
|
|
775
787
|
score: t,
|
|
776
788
|
tokens: e
|
|
777
789
|
}) => {
|
|
778
|
-
const n =
|
|
790
|
+
const n = L(), o = E();
|
|
779
791
|
return /* @__PURE__ */ i(
|
|
780
792
|
"span",
|
|
781
793
|
{
|
|
@@ -800,36 +812,36 @@ const et = ({
|
|
|
800
812
|
sel: t,
|
|
801
813
|
tokens: e
|
|
802
814
|
}) => {
|
|
803
|
-
const { labels: n, oddsLoading: o } =
|
|
804
|
-
return r === "settled_won" ? /* @__PURE__ */
|
|
815
|
+
const { labels: n, oddsLoading: o } = _(), { t: a } = R(), { status: r, odds: l, movement: s } = t;
|
|
816
|
+
return r === "settled_won" ? /* @__PURE__ */ u("span", { style: { color: e.ok, fontSize: "0.8125em", fontWeight: 700 }, children: [
|
|
805
817
|
"✓ ",
|
|
806
|
-
|
|
807
|
-
] }) : r === "settled_lost" ? /* @__PURE__ */
|
|
818
|
+
a("betslip.settledWon")
|
|
819
|
+
] }) : r === "settled_lost" ? /* @__PURE__ */ u(
|
|
808
820
|
"span",
|
|
809
821
|
{
|
|
810
822
|
style: { color: e.bad, fontSize: "0.8125em", fontWeight: 700 },
|
|
811
823
|
children: [
|
|
812
824
|
"✗ ",
|
|
813
|
-
|
|
825
|
+
a("betslip.settledLost")
|
|
814
826
|
]
|
|
815
827
|
}
|
|
816
|
-
) : r === "settled_void" ? /* @__PURE__ */ i("span", { style: { fontSize: "0.8125em", fontWeight: 700, color: e.t3 }, children:
|
|
817
|
-
|
|
828
|
+
) : r === "settled_void" ? /* @__PURE__ */ i("span", { style: { fontSize: "0.8125em", fontWeight: 700, color: e.t3 }, children: a("betslip.settledVoid") }) : r === "suspended" ? /* @__PURE__ */ i("span", { style: { fontSize: "0.75em", fontWeight: 600, color: e.warn }, children: n.suspendedLabel || a("betslip.suspendedLabel") }) : o ? /* @__PURE__ */ i(qt, { color: e.t3 }) : l === 0 ? /* @__PURE__ */ i("span", { style: { fontSize: "0.8125em", fontWeight: 600, color: e.t3 }, children: n.oddsUnavailableLabel || a("betslip.oddsUnavailableLabel") }) : /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 3 }, children: [
|
|
829
|
+
s && /* @__PURE__ */ i(
|
|
818
830
|
"span",
|
|
819
831
|
{
|
|
820
832
|
style: {
|
|
821
833
|
fontSize: "0.5625em",
|
|
822
|
-
color:
|
|
834
|
+
color: s === "UP" ? e.ok : e.bad,
|
|
823
835
|
lineHeight: 1
|
|
824
836
|
},
|
|
825
|
-
children:
|
|
837
|
+
children: s === "UP" ? "▲" : "▼"
|
|
826
838
|
}
|
|
827
839
|
),
|
|
828
840
|
/* @__PURE__ */ i("span", { style: { fontSize: "0.875em", fontWeight: 700, color: e.t1 }, children: l.toFixed(2) })
|
|
829
841
|
] });
|
|
830
842
|
}, re = ({ sel: t, tokens: e, isConflict: n }) => {
|
|
831
|
-
const { onRemove: o, labels:
|
|
832
|
-
return /* @__PURE__ */
|
|
843
|
+
const { onRemove: o, labels: a } = _(), { t: r, i18n: l } = R(), s = L(), p = E(), c = W(), [h, m] = Y.useState(!1), d = ee(t.startAt, l.language, r), b = t.marketId === "CORRECT_SCORE" || t.marketId === "CORRECT_SCORE_ADVANCED" || t.marketId === "CORRECT_SCORE_HT", f = b && t.outcome ? t.outcome.split(/[-:]/) : null, g = f == null ? void 0 : f[0], y = f == null ? void 0 : f[1];
|
|
844
|
+
return /* @__PURE__ */ u(
|
|
833
845
|
Qt,
|
|
834
846
|
{
|
|
835
847
|
style: {
|
|
@@ -846,19 +858,19 @@ const et = ({
|
|
|
846
858
|
}
|
|
847
859
|
},
|
|
848
860
|
children: [
|
|
849
|
-
/* @__PURE__ */
|
|
861
|
+
/* @__PURE__ */ u(
|
|
850
862
|
"div",
|
|
851
863
|
{
|
|
852
864
|
style: {
|
|
853
865
|
display: "flex",
|
|
854
866
|
justifyContent: "space-between",
|
|
855
867
|
alignItems: "flex-start",
|
|
856
|
-
gap:
|
|
857
|
-
marginBottom:
|
|
858
|
-
...n && { paddingLeft:
|
|
868
|
+
gap: s.xs,
|
|
869
|
+
marginBottom: s["3xs"],
|
|
870
|
+
...n && { paddingLeft: s.xs }
|
|
859
871
|
},
|
|
860
872
|
children: [
|
|
861
|
-
/* @__PURE__ */
|
|
873
|
+
/* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
862
874
|
t.athlete && /* @__PURE__ */ i(
|
|
863
875
|
ne,
|
|
864
876
|
{
|
|
@@ -879,7 +891,7 @@ const et = ({
|
|
|
879
891
|
}
|
|
880
892
|
)
|
|
881
893
|
] }),
|
|
882
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ u(
|
|
883
895
|
"div",
|
|
884
896
|
{
|
|
885
897
|
style: {
|
|
@@ -898,10 +910,10 @@ const et = ({
|
|
|
898
910
|
onMouseLeave: () => m(!1),
|
|
899
911
|
title: "Remove",
|
|
900
912
|
style: {
|
|
901
|
-
background:
|
|
913
|
+
background: h ? "rgba(239,68,68,.08)" : "none",
|
|
902
914
|
border: "none",
|
|
903
915
|
cursor: "pointer",
|
|
904
|
-
color:
|
|
916
|
+
color: h ? e.bad : e.t2,
|
|
905
917
|
fontSize: "0.8125em",
|
|
906
918
|
padding: "3px 5px",
|
|
907
919
|
borderRadius: p.xs,
|
|
@@ -928,7 +940,7 @@ const et = ({
|
|
|
928
940
|
marginBottom: 6,
|
|
929
941
|
...n && { paddingLeft: 8 }
|
|
930
942
|
},
|
|
931
|
-
children: Gt(t.market, r,
|
|
943
|
+
children: Gt(t.market, r, a.marketLabels)
|
|
932
944
|
}
|
|
933
945
|
),
|
|
934
946
|
/* @__PURE__ */ i(
|
|
@@ -940,14 +952,14 @@ const et = ({
|
|
|
940
952
|
padding: "7px 10px",
|
|
941
953
|
marginTop: 6
|
|
942
954
|
},
|
|
943
|
-
children: /* @__PURE__ */
|
|
955
|
+
children: /* @__PURE__ */ u(
|
|
944
956
|
"div",
|
|
945
957
|
{
|
|
946
958
|
style: {
|
|
947
959
|
display: "flex",
|
|
948
960
|
alignItems: "stretch",
|
|
949
961
|
gap: 10,
|
|
950
|
-
padding: n ? `0 ${
|
|
962
|
+
padding: n ? `0 ${s.sm}` : 0
|
|
951
963
|
},
|
|
952
964
|
children: [
|
|
953
965
|
/* @__PURE__ */ i(
|
|
@@ -959,14 +971,14 @@ const et = ({
|
|
|
959
971
|
display: "flex",
|
|
960
972
|
alignItems: "center"
|
|
961
973
|
},
|
|
962
|
-
children: /* @__PURE__ */
|
|
974
|
+
children: /* @__PURE__ */ u(
|
|
963
975
|
"div",
|
|
964
976
|
{
|
|
965
977
|
style: {
|
|
966
978
|
display: "grid",
|
|
967
979
|
gridTemplateColumns: b ? "auto minmax(0, auto) auto" : "auto minmax(0, auto)",
|
|
968
980
|
columnGap: 6,
|
|
969
|
-
rowGap:
|
|
981
|
+
rowGap: s["2xs"],
|
|
970
982
|
alignItems: "center"
|
|
971
983
|
},
|
|
972
984
|
children: [
|
|
@@ -1019,7 +1031,7 @@ const et = ({
|
|
|
1019
1031
|
)
|
|
1020
1032
|
}
|
|
1021
1033
|
),
|
|
1022
|
-
(t.matchStatus === "inprogress" || d || t.competition) && /* @__PURE__ */
|
|
1034
|
+
(t.matchStatus === "inprogress" || d || t.competition) && /* @__PURE__ */ u(
|
|
1023
1035
|
"div",
|
|
1024
1036
|
{
|
|
1025
1037
|
style: {
|
|
@@ -1031,7 +1043,7 @@ const et = ({
|
|
|
1031
1043
|
alignItems: "flex-end"
|
|
1032
1044
|
},
|
|
1033
1045
|
children: [
|
|
1034
|
-
t.matchStatus === "inprogress" ? /* @__PURE__ */
|
|
1046
|
+
t.matchStatus === "inprogress" ? /* @__PURE__ */ u(
|
|
1035
1047
|
"span",
|
|
1036
1048
|
{
|
|
1037
1049
|
style: {
|
|
@@ -1088,8 +1100,8 @@ const et = ({
|
|
|
1088
1100
|
tokens: t,
|
|
1089
1101
|
isSide: e
|
|
1090
1102
|
}) => {
|
|
1091
|
-
const { labels: n, selections: o, conflictIds:
|
|
1092
|
-
return /* @__PURE__ */
|
|
1103
|
+
const { labels: n, selections: o, conflictIds: a } = _(), { t: r } = R();
|
|
1104
|
+
return /* @__PURE__ */ u(j, { children: [
|
|
1093
1105
|
/* @__PURE__ */ i(
|
|
1094
1106
|
at,
|
|
1095
1107
|
{
|
|
@@ -1121,7 +1133,7 @@ const et = ({
|
|
|
1121
1133
|
maxHeight: e ? "none" : 300,
|
|
1122
1134
|
background: t.s1
|
|
1123
1135
|
},
|
|
1124
|
-
children: o.length === 0 ? /* @__PURE__ */
|
|
1136
|
+
children: o.length === 0 ? /* @__PURE__ */ u(
|
|
1125
1137
|
"div",
|
|
1126
1138
|
{
|
|
1127
1139
|
style: {
|
|
@@ -1151,14 +1163,14 @@ const et = ({
|
|
|
1151
1163
|
{
|
|
1152
1164
|
sel: l,
|
|
1153
1165
|
tokens: t,
|
|
1154
|
-
isConflict:
|
|
1166
|
+
isConflict: a.has(l.id)
|
|
1155
1167
|
},
|
|
1156
1168
|
l.id
|
|
1157
1169
|
))
|
|
1158
1170
|
}
|
|
1159
1171
|
)
|
|
1160
1172
|
] });
|
|
1161
|
-
}, ae =
|
|
1173
|
+
}, ae = A.button`
|
|
1162
1174
|
background: ${({ primary: t }) => t};
|
|
1163
1175
|
color: #fff;
|
|
1164
1176
|
border: none;
|
|
@@ -1173,17 +1185,17 @@ const et = ({
|
|
|
1173
1185
|
const {
|
|
1174
1186
|
labels: n,
|
|
1175
1187
|
selections: o,
|
|
1176
|
-
combStake:
|
|
1188
|
+
combStake: a,
|
|
1177
1189
|
setCombStake: r,
|
|
1178
1190
|
conflictIds: l,
|
|
1179
|
-
currency:
|
|
1191
|
+
currency: s,
|
|
1180
1192
|
stakePresets: p
|
|
1181
|
-
} =
|
|
1193
|
+
} = _(), { t: c } = R(), h = L(), m = E(), d = W(), b = o.filter(
|
|
1182
1194
|
(w) => w.status === "active" || !w.status
|
|
1183
|
-
), f = lt(b), g = parseFloat(
|
|
1195
|
+
), f = lt(b), g = parseFloat(a) || 0, y = g * f, x = l.size > 0, v = (w) => {
|
|
1184
1196
|
r(String(w));
|
|
1185
|
-
}, S =
|
|
1186
|
-
return /* @__PURE__ */
|
|
1197
|
+
}, S = Y.useRef(null);
|
|
1198
|
+
return /* @__PURE__ */ u(j, { children: [
|
|
1187
1199
|
/* @__PURE__ */ i(
|
|
1188
1200
|
at,
|
|
1189
1201
|
{
|
|
@@ -1203,14 +1215,14 @@ const et = ({
|
|
|
1203
1215
|
"div",
|
|
1204
1216
|
{
|
|
1205
1217
|
style: {
|
|
1206
|
-
padding: `${
|
|
1218
|
+
padding: `${h.sm} 14px`,
|
|
1207
1219
|
flexShrink: 0,
|
|
1208
1220
|
borderTop: `${d.size} solid ${t.bdr}`,
|
|
1209
1221
|
background: t.s3,
|
|
1210
1222
|
fontFamily: t.font
|
|
1211
1223
|
},
|
|
1212
|
-
children: /* @__PURE__ */
|
|
1213
|
-
b.length > 0 && /* @__PURE__ */
|
|
1224
|
+
children: /* @__PURE__ */ u(j, { children: [
|
|
1225
|
+
b.length > 0 && /* @__PURE__ */ u(
|
|
1214
1226
|
"div",
|
|
1215
1227
|
{
|
|
1216
1228
|
style: {
|
|
@@ -1219,17 +1231,17 @@ const et = ({
|
|
|
1219
1231
|
fontSize: "0.75em",
|
|
1220
1232
|
color: t.t2,
|
|
1221
1233
|
padding: "3px 0",
|
|
1222
|
-
paddingBottom:
|
|
1234
|
+
paddingBottom: h.xs
|
|
1223
1235
|
},
|
|
1224
1236
|
children: [
|
|
1225
1237
|
/* @__PURE__ */ i("span", { children: n.combinedOddsLabel || c("betslip.combinedOddsLabel") }),
|
|
1226
|
-
/* @__PURE__ */
|
|
1238
|
+
/* @__PURE__ */ u(
|
|
1227
1239
|
"span",
|
|
1228
1240
|
{
|
|
1229
1241
|
style: {
|
|
1230
1242
|
display: "flex",
|
|
1231
1243
|
alignItems: "center",
|
|
1232
|
-
gap:
|
|
1244
|
+
gap: h["2xs"],
|
|
1233
1245
|
fontSize: "0.8125em",
|
|
1234
1246
|
fontWeight: 600,
|
|
1235
1247
|
color: t.t1
|
|
@@ -1243,7 +1255,7 @@ const et = ({
|
|
|
1243
1255
|
]
|
|
1244
1256
|
}
|
|
1245
1257
|
),
|
|
1246
|
-
/* @__PURE__ */
|
|
1258
|
+
/* @__PURE__ */ u(
|
|
1247
1259
|
"div",
|
|
1248
1260
|
{
|
|
1249
1261
|
style: {
|
|
@@ -1268,7 +1280,7 @@ const et = ({
|
|
|
1268
1280
|
type: "number",
|
|
1269
1281
|
min: "0",
|
|
1270
1282
|
step: "1",
|
|
1271
|
-
value:
|
|
1283
|
+
value: a,
|
|
1272
1284
|
onChange: (w) => r(w.target.value),
|
|
1273
1285
|
placeholder: "0",
|
|
1274
1286
|
onFocus: (w) => w.currentTarget.style.borderColor = t.primary,
|
|
@@ -1308,8 +1320,8 @@ const et = ({
|
|
|
1308
1320
|
]
|
|
1309
1321
|
}
|
|
1310
1322
|
),
|
|
1311
|
-
/* @__PURE__ */
|
|
1312
|
-
/* @__PURE__ */
|
|
1323
|
+
/* @__PURE__ */ u("div", { style: { marginBottom: 10 }, children: [
|
|
1324
|
+
/* @__PURE__ */ u(
|
|
1313
1325
|
"div",
|
|
1314
1326
|
{
|
|
1315
1327
|
style: {
|
|
@@ -1322,11 +1334,11 @@ const et = ({
|
|
|
1322
1334
|
},
|
|
1323
1335
|
children: [
|
|
1324
1336
|
/* @__PURE__ */ i("span", { children: n.totalStakeLabel || c("betslip.totalStakeLabel") }),
|
|
1325
|
-
/* @__PURE__ */ i("span", { children: g > 0 ? `${g.toFixed(2)}${
|
|
1337
|
+
/* @__PURE__ */ i("span", { children: g > 0 ? `${g.toFixed(2)}${s}` : "—" })
|
|
1326
1338
|
]
|
|
1327
1339
|
}
|
|
1328
1340
|
),
|
|
1329
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ u(
|
|
1330
1342
|
"div",
|
|
1331
1343
|
{
|
|
1332
1344
|
style: {
|
|
@@ -1368,9 +1380,9 @@ const et = ({
|
|
|
1368
1380
|
fontSize: "0.625em",
|
|
1369
1381
|
color: t.t3,
|
|
1370
1382
|
textAlign: "center",
|
|
1371
|
-
marginTop:
|
|
1383
|
+
marginTop: h.xs,
|
|
1372
1384
|
lineHeight: 1.5,
|
|
1373
|
-
padding: `0 ${
|
|
1385
|
+
padding: `0 ${h["3xs"]}`
|
|
1374
1386
|
},
|
|
1375
1387
|
children: n.disclaimer
|
|
1376
1388
|
}
|
|
@@ -1381,20 +1393,20 @@ const et = ({
|
|
|
1381
1393
|
] });
|
|
1382
1394
|
};
|
|
1383
1395
|
function se(t, e) {
|
|
1384
|
-
const [n, o] =
|
|
1385
|
-
return
|
|
1396
|
+
const [n, o] = k([]), [a, r] = k((e == null ? void 0 : e.length) > 0);
|
|
1397
|
+
return T(() => {
|
|
1386
1398
|
if (!(e != null && e.length)) {
|
|
1387
1399
|
o([]), r(!1);
|
|
1388
1400
|
return;
|
|
1389
1401
|
}
|
|
1390
1402
|
const l = e.map((p) => {
|
|
1391
|
-
const c = p.split(":"),
|
|
1392
|
-
return { eventId: c.slice(0, c.length - 2).join(":"), market: m, outcome:
|
|
1393
|
-
}),
|
|
1394
|
-
r(!0), t.football.getMatches({ matchIds:
|
|
1403
|
+
const c = p.split(":"), h = c[c.length - 1], m = c[c.length - 2];
|
|
1404
|
+
return { eventId: c.slice(0, c.length - 2).join(":"), market: m, outcome: h };
|
|
1405
|
+
}), s = [...new Set(l.map((p) => p.eventId))];
|
|
1406
|
+
r(!0), t.football.getMatches({ matchIds: s }).then((p) => {
|
|
1395
1407
|
const c = new Map(
|
|
1396
1408
|
p.data.map((m) => [m.id, m])
|
|
1397
|
-
),
|
|
1409
|
+
), h = l.flatMap(
|
|
1398
1410
|
({ eventId: m, market: d, outcome: b }) => {
|
|
1399
1411
|
var g, y, x, v, S;
|
|
1400
1412
|
const f = c.get(m);
|
|
@@ -1421,52 +1433,57 @@ function se(t, e) {
|
|
|
1421
1433
|
] : [];
|
|
1422
1434
|
}
|
|
1423
1435
|
);
|
|
1424
|
-
o(
|
|
1436
|
+
o(h);
|
|
1425
1437
|
}).catch(() => o([])).finally(() => r(!1));
|
|
1426
|
-
}, [JSON.stringify(e)]), { selectionInputs: n, loading:
|
|
1438
|
+
}, [JSON.stringify(e)]), { selectionInputs: n, loading: a };
|
|
1427
1439
|
}
|
|
1428
|
-
const le =
|
|
1440
|
+
const le = U`
|
|
1429
1441
|
from { transform: translateY(100%); opacity: 0; }
|
|
1430
1442
|
to { transform: translateY(0); opacity: 1; }
|
|
1431
|
-
`, ce =
|
|
1443
|
+
`, ce = U`
|
|
1432
1444
|
from { transform: translateY(-100%); opacity: 0; }
|
|
1433
1445
|
to { transform: translateY(0); opacity: 1; }
|
|
1434
1446
|
`;
|
|
1435
1447
|
function de(t) {
|
|
1436
1448
|
return t.startsWith("top") ? ce : le;
|
|
1437
1449
|
}
|
|
1438
|
-
const pe =
|
|
1450
|
+
const pe = A.div`
|
|
1439
1451
|
position: fixed;
|
|
1440
1452
|
z-index: 999;
|
|
1441
1453
|
animation: ${({ pos: t }) => de(t)} 0.22s ease;
|
|
1442
|
-
`,
|
|
1454
|
+
`, D = 320, rt = 340;
|
|
1443
1455
|
function me(t) {
|
|
1444
|
-
return t === "bottom-right" ? { bottom: 16, right: 16, width:
|
|
1456
|
+
return t === "bottom-right" ? { bottom: 16, right: 16, width: D } : t === "bottom-left" ? { bottom: 16, left: 16, width: D } : t === "top-right" ? { top: 16, right: 16, width: D } : t === "top-left" ? { top: 16, left: 16, width: D } : { bottom: 16, right: 16, width: D };
|
|
1445
1457
|
}
|
|
1446
|
-
const fe = (
|
|
1447
|
-
|
|
1458
|
+
const fe = () => {
|
|
1459
|
+
const { selectionInputs: t, combStake: e, selections: n } = _(), o = parseFloat(e) || 0, a = n.length ? n.reduce((r, l) => r * l.odds, 1) : 0;
|
|
1460
|
+
return T(() => {
|
|
1461
|
+
N._notify({ selections: t, stake: o, totalOdds: a });
|
|
1462
|
+
}, [t, o, a]), T(() => () => N._notify({ selections: [], stake: 0, totalOdds: 0 }), []), null;
|
|
1463
|
+
}, ue = ({ props: t }) => {
|
|
1464
|
+
var I, O, F, C, H, z, V, G, X, K;
|
|
1448
1465
|
const { position: e = "bottom-right", brandingLogoUrl: n } = t, {
|
|
1449
1466
|
open: o,
|
|
1450
|
-
setOpen:
|
|
1467
|
+
setOpen: a,
|
|
1451
1468
|
conflictIds: r,
|
|
1452
1469
|
selections: l,
|
|
1453
|
-
maxSelections:
|
|
1470
|
+
maxSelections: s,
|
|
1454
1471
|
bookmakerLogoUrl: p,
|
|
1455
1472
|
bookmakerBackgroundColor: c,
|
|
1456
|
-
oddsReady:
|
|
1457
|
-
} =
|
|
1473
|
+
oddsReady: h
|
|
1474
|
+
} = _(), m = ((H = (C = (F = (O = (I = t.themeOptions) == null ? void 0 : I.colorSchemes) == null ? void 0 : O.light) == null ? void 0 : F.palette) == null ? void 0 : C.primary) == null ? void 0 : H.plainColor) != null || ((K = (X = (G = (V = (z = t.themeOptions) == null ? void 0 : z.colorSchemes) == null ? void 0 : V.dark) == null ? void 0 : G.palette) == null ? void 0 : X.primary) == null ? void 0 : K.plainColor) != null, d = jt(
|
|
1458
1475
|
m ? void 0 : c
|
|
1459
|
-
), b =
|
|
1460
|
-
if (!
|
|
1476
|
+
), b = E(), f = W(), g = e.startsWith("side"), y = e === "top-right" || e === "top-left", x = r.size > 0, { t: v } = R();
|
|
1477
|
+
if (!h) return null;
|
|
1461
1478
|
if (g) {
|
|
1462
|
-
const $ = e === "side-right",
|
|
1463
|
-
return /* @__PURE__ */
|
|
1479
|
+
const $ = e === "side-right", P = $ ? "right" : "left", q = n || p, mt = o ? rt : 0, ft = o ? "translateX(0)" : `translateX(${$ ? "100%" : "-100%"})`;
|
|
1480
|
+
return /* @__PURE__ */ u(
|
|
1464
1481
|
"div",
|
|
1465
1482
|
{
|
|
1466
1483
|
style: {
|
|
1467
1484
|
position: "fixed",
|
|
1468
1485
|
top: 0,
|
|
1469
|
-
[
|
|
1486
|
+
[P]: 0,
|
|
1470
1487
|
zIndex: 999,
|
|
1471
1488
|
height: "100vh",
|
|
1472
1489
|
width: 0,
|
|
@@ -1474,16 +1491,16 @@ const fe = ({ props: t }) => {
|
|
|
1474
1491
|
overflow: "visible"
|
|
1475
1492
|
},
|
|
1476
1493
|
children: [
|
|
1477
|
-
/* @__PURE__ */
|
|
1494
|
+
/* @__PURE__ */ u(
|
|
1478
1495
|
"div",
|
|
1479
1496
|
{
|
|
1480
1497
|
style: {
|
|
1481
1498
|
position: "absolute",
|
|
1482
|
-
[
|
|
1499
|
+
[P]: mt,
|
|
1483
1500
|
top: "33%",
|
|
1484
1501
|
transform: "translateY(-50%)",
|
|
1485
1502
|
pointerEvents: "all",
|
|
1486
|
-
transition: `${
|
|
1503
|
+
transition: `${P} 0.3s ease`,
|
|
1487
1504
|
display: "flex",
|
|
1488
1505
|
flexDirection: "column",
|
|
1489
1506
|
alignItems: "center",
|
|
@@ -1493,7 +1510,7 @@ const fe = ({ props: t }) => {
|
|
|
1493
1510
|
/* @__PURE__ */ i(
|
|
1494
1511
|
"button",
|
|
1495
1512
|
{
|
|
1496
|
-
onClick: () =>
|
|
1513
|
+
onClick: () => a(!o),
|
|
1497
1514
|
title: v(o ? "betslip.hide" : "betslip.show"),
|
|
1498
1515
|
style: {
|
|
1499
1516
|
position: "relative",
|
|
@@ -1510,10 +1527,10 @@ const fe = ({ props: t }) => {
|
|
|
1510
1527
|
overflow: "hidden",
|
|
1511
1528
|
padding: 0
|
|
1512
1529
|
},
|
|
1513
|
-
children:
|
|
1530
|
+
children: q ? /* @__PURE__ */ i(
|
|
1514
1531
|
"img",
|
|
1515
1532
|
{
|
|
1516
|
-
src:
|
|
1533
|
+
src: q,
|
|
1517
1534
|
alt: "brand",
|
|
1518
1535
|
style: {
|
|
1519
1536
|
position: "absolute",
|
|
@@ -1525,7 +1542,7 @@ const fe = ({ props: t }) => {
|
|
|
1525
1542
|
transform: `translate(-50%, -50%) rotate(${$ ? "-90" : "90"}deg)`
|
|
1526
1543
|
}
|
|
1527
1544
|
}
|
|
1528
|
-
) : /* @__PURE__ */
|
|
1545
|
+
) : /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
1529
1546
|
/* @__PURE__ */ i(
|
|
1530
1547
|
"div",
|
|
1531
1548
|
{
|
|
@@ -1562,7 +1579,7 @@ const fe = ({ props: t }) => {
|
|
|
1562
1579
|
] })
|
|
1563
1580
|
}
|
|
1564
1581
|
),
|
|
1565
|
-
!o &&
|
|
1582
|
+
!o && s != null && /* @__PURE__ */ u(
|
|
1566
1583
|
"div",
|
|
1567
1584
|
{
|
|
1568
1585
|
style: {
|
|
@@ -1579,20 +1596,20 @@ const fe = ({ props: t }) => {
|
|
|
1579
1596
|
children: [
|
|
1580
1597
|
l.length,
|
|
1581
1598
|
"/",
|
|
1582
|
-
|
|
1599
|
+
s
|
|
1583
1600
|
]
|
|
1584
1601
|
}
|
|
1585
1602
|
)
|
|
1586
1603
|
]
|
|
1587
1604
|
}
|
|
1588
1605
|
),
|
|
1589
|
-
/* @__PURE__ */
|
|
1606
|
+
/* @__PURE__ */ u(
|
|
1590
1607
|
"div",
|
|
1591
1608
|
{
|
|
1592
1609
|
style: {
|
|
1593
1610
|
position: "absolute",
|
|
1594
1611
|
top: 0,
|
|
1595
|
-
[
|
|
1612
|
+
[P]: 0,
|
|
1596
1613
|
width: rt,
|
|
1597
1614
|
height: "100%",
|
|
1598
1615
|
transform: ft,
|
|
@@ -1615,7 +1632,7 @@ const fe = ({ props: t }) => {
|
|
|
1615
1632
|
}
|
|
1616
1633
|
),
|
|
1617
1634
|
x && /* @__PURE__ */ i(Z, { tokens: d }),
|
|
1618
|
-
/* @__PURE__ */
|
|
1635
|
+
/* @__PURE__ */ u(
|
|
1619
1636
|
"div",
|
|
1620
1637
|
{
|
|
1621
1638
|
style: {
|
|
@@ -1651,7 +1668,7 @@ const fe = ({ props: t }) => {
|
|
|
1651
1668
|
outline: `${f.size} solid ${d.primary}`,
|
|
1652
1669
|
...w
|
|
1653
1670
|
},
|
|
1654
|
-
children: /* @__PURE__ */
|
|
1671
|
+
children: /* @__PURE__ */ u(
|
|
1655
1672
|
"div",
|
|
1656
1673
|
{
|
|
1657
1674
|
style: {
|
|
@@ -1678,7 +1695,7 @@ const fe = ({ props: t }) => {
|
|
|
1678
1695
|
brandingLogoUrl: n
|
|
1679
1696
|
}
|
|
1680
1697
|
),
|
|
1681
|
-
o && /* @__PURE__ */
|
|
1698
|
+
o && /* @__PURE__ */ u(
|
|
1682
1699
|
"div",
|
|
1683
1700
|
{
|
|
1684
1701
|
style: {
|
|
@@ -1699,8 +1716,8 @@ const fe = ({ props: t }) => {
|
|
|
1699
1716
|
)
|
|
1700
1717
|
}
|
|
1701
1718
|
);
|
|
1702
|
-
},
|
|
1703
|
-
const [e, n] =
|
|
1719
|
+
}, he = (t) => {
|
|
1720
|
+
const [e, n] = k([]), { selectionInputs: o, loading: a } = se(
|
|
1704
1721
|
t.sdk,
|
|
1705
1722
|
e
|
|
1706
1723
|
), r = o.filter(
|
|
@@ -1709,8 +1726,8 @@ const fe = ({ props: t }) => {
|
|
|
1709
1726
|
t.sdk,
|
|
1710
1727
|
r,
|
|
1711
1728
|
t.oddsPollingInterval || 3e4
|
|
1712
|
-
),
|
|
1713
|
-
const
|
|
1729
|
+
), s = M((c) => {
|
|
1730
|
+
const h = c.split(":"), m = h[h.length - 2], d = h.slice(0, h.length - 2).join(":");
|
|
1714
1731
|
n((b) => {
|
|
1715
1732
|
const f = b.findIndex((g) => {
|
|
1716
1733
|
const y = g.split(":");
|
|
@@ -1722,12 +1739,12 @@ const fe = ({ props: t }) => {
|
|
|
1722
1739
|
}
|
|
1723
1740
|
return [...b, c];
|
|
1724
1741
|
});
|
|
1725
|
-
}, []), p =
|
|
1726
|
-
n((
|
|
1742
|
+
}, []), p = M((c) => {
|
|
1743
|
+
n((h) => h.filter((m) => m !== c));
|
|
1727
1744
|
}, []);
|
|
1728
|
-
return
|
|
1745
|
+
return T(() => {
|
|
1729
1746
|
o.filter((c) => c.matchStatus === "finished").forEach((c) => p(`${c.eventId}:${c.market}:${c.outcome}`));
|
|
1730
|
-
}, [o, p]),
|
|
1747
|
+
}, [o, p]), T(() => (N._mount({ setSelection: s, removeSelection: p }), () => N._unmount()), [s, p]), !e.length || !r.length && a ? null : /* @__PURE__ */ u(
|
|
1731
1748
|
Nt,
|
|
1732
1749
|
{
|
|
1733
1750
|
labels: t.labels,
|
|
@@ -1738,10 +1755,13 @@ const fe = ({ props: t }) => {
|
|
|
1738
1755
|
ctaUrlTemplate: t.ctaUrlTemplate,
|
|
1739
1756
|
onExternalRemove: p,
|
|
1740
1757
|
sharedOddsMap: l,
|
|
1741
|
-
children:
|
|
1758
|
+
children: [
|
|
1759
|
+
/* @__PURE__ */ i(fe, {}),
|
|
1760
|
+
/* @__PURE__ */ i(ue, { props: t })
|
|
1761
|
+
]
|
|
1742
1762
|
}
|
|
1743
1763
|
);
|
|
1744
|
-
},
|
|
1764
|
+
}, Re = (t) => /* @__PURE__ */ i(
|
|
1745
1765
|
Ct,
|
|
1746
1766
|
{
|
|
1747
1767
|
packageName: "betslip",
|
|
@@ -1749,10 +1769,10 @@ const fe = ({ props: t }) => {
|
|
|
1749
1769
|
themeOptions: t.themeOptions,
|
|
1750
1770
|
sdk: t.sdk,
|
|
1751
1771
|
entityId: "",
|
|
1752
|
-
children: /* @__PURE__ */ i(
|
|
1772
|
+
children: /* @__PURE__ */ i(he, { ...t })
|
|
1753
1773
|
}
|
|
1754
1774
|
);
|
|
1755
1775
|
export {
|
|
1756
|
-
|
|
1757
|
-
|
|
1776
|
+
Re as M,
|
|
1777
|
+
N as b
|
|
1758
1778
|
};
|