@everymatrix/tournament-details-page 0.0.4 → 0.0.6

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.
Files changed (23) hide show
  1. package/components/TournamentDetails-BwBvr-th.cjs +7 -0
  2. package/components/{TournamentDetails-glnpe9gf.js → TournamentDetails-DIfQFrc8.js} +1656 -1655
  3. package/components/{TournamentDetails-CIK1Vnx8.js → TournamentDetails-wSkU01Xy.js} +1921 -1920
  4. package/components/{TournamentDetailsPage-D6daHDII.js → TournamentDetailsPage-9QiBj_5p.js} +176 -176
  5. package/components/{TournamentDetailsPage-85B_WTCl.cjs → TournamentDetailsPage-du8_rjJX.cjs} +6 -6
  6. package/components/{TournamentDetailsPage-DCB9anwm.js → TournamentDetailsPage-rE5SsAXj.js} +128 -128
  7. package/components/TournamentGames-Dxvil6j2.js +383 -0
  8. package/components/TournamentGames-EuHRBJf0.js +355 -0
  9. package/components/TournamentGames-o7mTC32n.cjs +27 -0
  10. package/components/TournamentLeaderboard-BgywP9Jb.js +788 -0
  11. package/components/TournamentLeaderboard-m4CZolTW.cjs +30 -0
  12. package/components/TournamentLeaderboard-ncHvraaw.js +804 -0
  13. package/es2015/tournament-details-page.cjs +1 -1
  14. package/es2015/tournament-details-page.js +1 -1
  15. package/esnext/tournament-details-page.js +1 -1
  16. package/package.json +1 -1
  17. package/components/TournamentDetails-AYkmST0l.cjs +0 -7
  18. package/components/TournamentGames-0RUJ48Xu.js +0 -362
  19. package/components/TournamentGames-3qu_5rFn.cjs +0 -26
  20. package/components/TournamentGames-CDfNoeoq.js +0 -335
  21. package/components/TournamentLeaderboard-5oGHOpP6.js +0 -794
  22. package/components/TournamentLeaderboard-BUiKtCk5.cjs +0 -36
  23. package/components/TournamentLeaderboard-CF-QWN1C.js +0 -810
@@ -0,0 +1,355 @@
1
+ import { b as He, $ as Ie, p as Fe, g as Xe, h as y, u as pe, s as O, i as Ue, j as g, l as _, m as l, k as G, z as S, C as Je, E as x, B as A, w as a, n as m, q as qe, r as Ke, F as Qe, t as w, v as k, e as Ve, f as Ye, x as r, J as X, K as U, I as J, y as q, L as ae, D as me } from "./TournamentDetails-DIfQFrc8.js";
2
+ import { g as Ze } from "./TournamentDetailsPage-rE5SsAXj.js";
3
+ function $e(B, d) {
4
+ He(B, d);
5
+ }
6
+ function ve(B) {
7
+ Ie.set(B);
8
+ }
9
+ const de = {
10
+ en: {
11
+ previousButton: "Previous",
12
+ nextButton: "Next",
13
+ casinoTab: "Casino",
14
+ sportsbookTab: "Sportsbook",
15
+ gamesDescriptionTitle: "Participating games",
16
+ gamesDescriptionSubtitle: "Discover the games",
17
+ sportsRulesParseError: "Error parsing tournament rules",
18
+ noAvailableGames: "No games have been configured yet!"
19
+ },
20
+ tr: {
21
+ previousButton: "Previous",
22
+ nextButton: "Next",
23
+ casinoTab: "Casino",
24
+ sportsbookTab: "Sportsbook"
25
+ }
26
+ }, et = () => typeof window > "u";
27
+ var tt = g('<div class="TournamentGamesTabs svelte-p7mf8l"><button> </button> <button> </button></div>'), at = g('<p class="svelte-p7mf8l"> </p>'), nt = g("<div></div>"), ot = g('<div class="TournamentGameThumbnailSkeleton svelte-p7mf8l"></div>'), st = g('<div class="TournamentGameThumbnail svelte-p7mf8l"><div class="ImageContainer svelte-p7mf8l"><img class="svelte-p7mf8l"/> <div class="PlayButtonOverlay svelte-p7mf8l"><button class="PlayGameButton svelte-p7mf8l"> </button></div></div></div>'), rt = g('<span class="PaginationButton Elipsis svelte-p7mf8l">...</span>'), lt = g("<button> </button>"), it = g('<div><button class="PaginationButton svelte-p7mf8l"> </button> <div class="PageNumberWrapper svelte-p7mf8l"></div> <button class="PaginationButton svelte-p7mf8l"> </button></div>'), pt = g("<p> </p>"), mt = g('<div class="PaginationSkeleton svelte-p7mf8l"><div class="PaginationSkeletonButton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div> <div class="PaginationSkeletonButton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div></div>'), vt = g('<div class="TournamentGamesWrapper svelte-p7mf8l"><div class="GamesDescription svelte-p7mf8l"><p class="GamesDescriptionTitle svelte-p7mf8l"> </p> <p class="GamesDescriptionSubTitle svelte-p7mf8l"> </p></div> <!> <!> <div><!></div> <!> <!></div>');
28
+ const dt = {
29
+ hash: "svelte-p7mf8l",
30
+ code: `.svelte-p7mf8l,
31
+ .svelte-p7mf8l::before,
32
+ .svelte-p7mf8l::after {margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit;}.GamesDescription.svelte-p7mf8l {display:flex;flex-direction:column;gap:6px;margin:10px 0;.GamesDescriptionTitle:where(.svelte-p7mf8l) {color:var(--emw-color-typography, #ffffff);font-size:16px;font-weight:600;}.GamesDescriptionSubTitle:where(.svelte-p7mf8l) {color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:200;}}.TournamentGamesTabs.svelte-p7mf8l {display:flex;border-radius:50px;background-color:var(--emw-color-bg-section, #434343);padding:6px;margin-bottom:6px;width:100%;justify-content:center;.Tab:where(.svelte-p7mf8l) {padding:5px 20px;color:var(--emw-color-typography, #ffffff);width:100%;border-radius:50px;background-color:transparent;border:none;cursor:pointer;}.Active:where(.svelte-p7mf8l) {background-color:var(--emw-color-bg-elements, #4A4A4A);border:none;}}.TournamentRulesWrapper.svelte-p7mf8l {display:flex;flex-direction:column;color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:400;margin:10px 0;}.TournamentGamesWrapper.svelte-p7mf8l {display:flex;flex-direction:column;gap:10px;background-color:var(--emw-color-bg-secondary, #333232);padding:10px;border-radius:6px;}.TournamentGamesContainer.svelte-p7mf8l {display:grid;gap:12px;grid-template-columns:repeat(auto-fit, minmax(min(150px, 100%), 1fr));.TournamentGameThumbnailSkeleton:where(.svelte-p7mf8l) {position:relative;width:100%;aspect-ratio:4 / 3;overflow:hidden;border-radius:6px;background:linear-gradient(
33
+ to top,
34
+ var(--emw-color-primary, #FF1D4E),
35
+ transparent
36
+ );background-size:100% 200%;
37
+ animation: pulse 1.5s ease-in-out infinite;}.ImageContainer:where(.svelte-p7mf8l) {position:relative;width:100%;aspect-ratio:4 / 3;overflow:hidden;border-radius:6px;}img:where(.svelte-p7mf8l) {position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;border-radius:6px;}.PlayButtonOverlay:where(.svelte-p7mf8l) {position:absolute;top:0;left:0;bottom:0;right:0;background-color:rgba(0, 0, 0, 0.6);display:flex;justify-content:center;align-items:center;opacity:0;&:hover {opacity:1;transition:opacity 0.5s;}.PlayGameButton:where(.svelte-p7mf8l) {background-color:var(--emw-color-primary, #FF1D4E);border-radius:6px;color:var(--emw-color-typography, #ffffff);padding:10px;border:none;outline:none;min-width:50%;cursor:pointer;&:hover {background-color:var(--emw-color-primary-hover, #ff3a65);cursor:pointer;}&:active {transform:scale(0.9);}}}}.PaginationWrapper.svelte-p7mf8l {display:flex;justify-content:space-between;.PageNumberWrapper:where(.svelte-p7mf8l) {display:flex;gap:3px;}.PaginationButton:where(.svelte-p7mf8l) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography, #ffffff);border-radius:6px;border:none;outline:none;padding:10px;width:auto;cursor:pointer;&.Number {background-color:transparent;min-width:0;padding:0 10px;}&:hover {background-color:var(--emw-color-bg-elements, #4A4A4A);cursor:pointer;}&:active {transform:scale(0.9);}&:disabled {opacity:60%;pointer-events:none;}&.Active {background-color:var(--emw-color-bg-elements, #4A4A4A);}&.Elipsis {pointer-events:none;background-color:transparent;min-width:0;padding:0;align-self:center;}}}.NoGamesAvailable.svelte-p7mf8l {color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:300;}.PaginationSkeleton.svelte-p7mf8l {display:flex;justify-content:space-between;gap:6px;}.PaginationSkeletonButton.svelte-p7mf8l {width:80px;height:35px;border-radius:6px;background-color:var(--emw-color-bg-elements, #4A4A4A);overflow:hidden;position:relative;}.PaginationNumberSkeleton.svelte-p7mf8l {width:40px;height:35px;border-radius:6px;background-color:var(--emw-color-bg-elements, #4A4A4A);overflow:hidden;position:relative;}.SkeletonShimmer.svelte-p7mf8l {width:100%;height:100%;background:linear-gradient(
38
+ 90deg,
39
+ transparent 0%,
40
+ var(--emw-color-skeleton, #333232) 50%,
41
+ transparent 100%
42
+ );
43
+ animation: svelte-p7mf8l-loading 1.5s infinite;transform:translateX(-100%);}
44
+
45
+ @keyframes svelte-p7mf8l-loading {
46
+ 0% {
47
+ transform: translateX(-100%);
48
+ }
49
+ 100% {
50
+ transform: translateX(100%);
51
+ }
52
+ }
53
+
54
+ @media (min-width: 750px) {.TournamentGamesTabs.svelte-p7mf8l {width:fit-content;}.PaginationWrapper.svelte-p7mf8l, .PaginationSkeleton.svelte-p7mf8l {justify-content:end;gap:10px;}.PaginationButton.svelte-p7mf8l {min-width:75px;}.PaginationSkeleton.svelte-p7mf8l {justify-content:end;gap:10px;.PaginationSkeletonButton:where(.svelte-p7mf8l) {width:auto;min-width:55px;}.PaginationNumberSkeleton:where(.svelte-p7mf8l) {width:35px;}}
55
+
56
+ }.Hidden.svelte-p7mf8l {display:none;}`
57
+ };
58
+ function ct(B, d) {
59
+ Fe(d, !0), Xe(B, dt);
60
+ const b = () => Je(Qe, "$_", ce), [ce, fe] = Ke(), W = y(d, "initialGames"), K = y(d, "endpoint"), N = y(d, "language", 7, "en"), z = y(d, "session"), C = y(d, "tournamentid"), f = y(d, "gamesLimit", 7, 6), E = y(d, "totalGames"), Q = y(d, "platformProp", 7, null), D = y(d, "tournamentMetadata");
61
+ Object.keys(de).forEach((e) => {
62
+ $e(e, de[e]);
63
+ }), ve(N());
64
+ const ue = () => {
65
+ ve(N());
66
+ };
67
+ pe(() => {
68
+ ue();
69
+ });
70
+ let L = O(Ue(W() || [])), M = O(!1), c = O(0), R = O(void 0);
71
+ const ge = et() ? Q() ?? "dk" : Ze(window.navigator.userAgent), V = async () => {
72
+ if (Y.has(a(H)))
73
+ return;
74
+ w(M, !0);
75
+ const e = new URL(`${K()}/v1/tournaments/${C()}`), t = new Headers();
76
+ z() && t.append("X-SessionId", z());
77
+ const n = { method: "GET", headers: t };
78
+ e.searchParams.append("filter", `id=${C()}`), e.searchParams.append("language", N()), e.searchParams.append("expand", "games"), e.searchParams.append("pagination", `games(limit=${f()},offset=${a(c)})`), e.searchParams.append("platform", ge), fetch(e, n).then((o) => o.json()).then((o) => {
79
+ w(L, o?.item?.games?.items, !0), Y.set(a(H), a(L));
80
+ }).catch((o) => console.log(o)).finally(() => w(M, !1));
81
+ }, be = () => {
82
+ const e = Math.ceil(E() / f()), t = Math.floor(a(c) / f()) + 1;
83
+ if (e <= 5)
84
+ return Array.from({ length: e }, (o, i) => i + 1);
85
+ const n = [];
86
+ return n.push(1), t <= 3 ? (n.push(2, 3), n.push("..."), n.push(e)) : t >= e - 2 ? (n.push("..."), n.push(e - 2, e - 1, e)) : (n.push("..."), n.push(t - 1, t, t + 1), n.push("..."), n.push(e)), n;
87
+ }, he = () => {
88
+ a(c) < E() && (w(c, a(c) + f()), V());
89
+ }, _e = () => {
90
+ a(c) !== 0 && (w(c, a(c) - f()), V());
91
+ }, xe = (e) => {
92
+ w(c, (e - 1) * f()), V();
93
+ }, we = ae(be), H = ae(() => Math.floor(a(c) / f()) + 1);
94
+ let Y = /* @__PURE__ */ new Map([[1, W()]]), ye = ae(() => Y.get(a(H)) ?? []), P = O("casino");
95
+ const ke = () => {
96
+ if (!D()) return;
97
+ const e = D().sports?.rules;
98
+ let t;
99
+ if (e)
100
+ try {
101
+ t = JSON.parse(e), w(R, t[N()] || t["*"], !0);
102
+ } catch (n) {
103
+ console.log(n), w(R, `${b()("sportsRulesParseError")}`);
104
+ }
105
+ }, Pe = (e) => {
106
+ window.postMessage(
107
+ {
108
+ type: "Tournaments:PlayGame",
109
+ launchUrl: e.launchUrl,
110
+ id: e.gameId,
111
+ thumbnail: e.thumbnail,
112
+ name: e.name
113
+ },
114
+ window.location.href
115
+ );
116
+ };
117
+ pe(() => {
118
+ Object.keys(D()).length !== 0 && ke();
119
+ });
120
+ var Se = {
121
+ get initialGames() {
122
+ return W();
123
+ },
124
+ set initialGames(e) {
125
+ W(e), k();
126
+ },
127
+ get endpoint() {
128
+ return K();
129
+ },
130
+ set endpoint(e) {
131
+ K(e), k();
132
+ },
133
+ get language() {
134
+ return N();
135
+ },
136
+ set language(e = "en") {
137
+ N(e), k();
138
+ },
139
+ get session() {
140
+ return z();
141
+ },
142
+ set session(e) {
143
+ z(e), k();
144
+ },
145
+ get tournamentid() {
146
+ return C();
147
+ },
148
+ set tournamentid(e) {
149
+ C(e), k();
150
+ },
151
+ get gamesLimit() {
152
+ return f();
153
+ },
154
+ set gamesLimit(e = 6) {
155
+ f(e), k();
156
+ },
157
+ get totalGames() {
158
+ return E();
159
+ },
160
+ set totalGames(e) {
161
+ E(e), k();
162
+ },
163
+ get platformProp() {
164
+ return Q();
165
+ },
166
+ set platformProp(e = null) {
167
+ Q(e), k();
168
+ },
169
+ get tournamentMetadata() {
170
+ return D();
171
+ },
172
+ set tournamentMetadata(e) {
173
+ D(e), k();
174
+ }
175
+ }, Z = vt(), $ = l(Z), ee = l($), Te = l(ee, !0);
176
+ r(ee);
177
+ var ne = _(ee, 2), Ge = l(ne, !0);
178
+ r(ne), r($);
179
+ var oe = _($, 2);
180
+ {
181
+ var Ae = (e) => {
182
+ var t = tt(), n = l(t);
183
+ let o;
184
+ n.__click = () => w(P, "casino");
185
+ var i = l(n, !0);
186
+ r(n);
187
+ var s = _(n, 2);
188
+ let p;
189
+ s.__click = () => w(P, "sports");
190
+ var v = l(s, !0);
191
+ r(s), r(t), S(
192
+ (h, u) => {
193
+ o = A(n, 1, "Tab svelte-p7mf8l", null, o, { Active: a(P) === "casino" }), x(i, h), p = A(s, 1, "Tab svelte-p7mf8l", null, p, { Active: a(P) === "sports" }), x(v, u);
194
+ },
195
+ [() => b()("casinoTab"), () => b()("sportsbookTab")]
196
+ ), m(e, t);
197
+ };
198
+ G(oe, (e) => {
199
+ Object.keys(D()).length !== 0 && e(Ae);
200
+ });
201
+ }
202
+ var se = _(oe, 2);
203
+ {
204
+ var Be = (e) => {
205
+ var t = nt();
206
+ let n;
207
+ X(t, 21, () => a(R), U, (o, i) => {
208
+ var s = at(), p = l(s);
209
+ r(s), S((v) => x(p, `${a(i).rule ?? ""} ${v ?? ""}`), [() => b()("contribution")]), m(o, s);
210
+ }), r(t), S(() => n = A(t, 1, "TournamentRulesWrapper svelte-p7mf8l", null, n, { Hidden: a(P) === "casino" })), m(e, t);
211
+ };
212
+ G(se, (e) => {
213
+ a(R) && e(Be);
214
+ });
215
+ }
216
+ var I = _(se, 2);
217
+ let re;
218
+ var Ne = l(I);
219
+ {
220
+ var De = (e) => {
221
+ var t = J(), n = q(t);
222
+ X(n, 17, () => Array(f()), U, (o, i, s, p) => {
223
+ var v = ot();
224
+ m(o, v);
225
+ }), m(e, t);
226
+ }, Me = (e) => {
227
+ var t = J(), n = q(t);
228
+ X(n, 17, () => a(ye), U, (o, i) => {
229
+ var s = st();
230
+ s.__click = () => Pe(a(i));
231
+ var p = l(s), v = l(p), h = _(v, 2), u = l(h), F = l(u, !0);
232
+ r(u), r(h), r(p), r(s), S(
233
+ (te) => {
234
+ me(v, "src", `https:${a(i).thumbnail}`), me(v, "alt", a(i).name), x(F, te);
235
+ },
236
+ [() => b()("play")]
237
+ ), m(o, s);
238
+ }), m(e, t);
239
+ };
240
+ G(Ne, (e) => {
241
+ a(M) || a(L)?.length === 0 ? e(De) : e(Me, !1);
242
+ });
243
+ }
244
+ r(I);
245
+ var le = _(I, 2);
246
+ {
247
+ var je = (e) => {
248
+ var t = it();
249
+ let n;
250
+ var o = l(t);
251
+ o.__click = _e;
252
+ var i = l(o, !0);
253
+ r(o);
254
+ var s = _(o, 2);
255
+ X(s, 21, () => a(we), U, (h, u) => {
256
+ var F = J(), te = q(F);
257
+ {
258
+ var ze = (j) => {
259
+ var T = rt();
260
+ m(j, T);
261
+ }, Ce = (j) => {
262
+ var T = lt();
263
+ let ie;
264
+ T.__click = () => xe(a(u));
265
+ var Re = l(T, !0);
266
+ r(T), S(() => {
267
+ ie = A(T, 1, "PaginationButton Number svelte-p7mf8l", null, ie, { Active: a(u) === a(H) }), x(Re, a(u));
268
+ }), m(j, T);
269
+ };
270
+ G(te, (j) => {
271
+ typeof a(u) != "number" ? j(ze) : j(Ce, !1);
272
+ });
273
+ }
274
+ m(h, F);
275
+ }), r(s);
276
+ var p = _(s, 2);
277
+ p.__click = he;
278
+ var v = l(p, !0);
279
+ r(p), r(t), S(
280
+ (h, u) => {
281
+ n = A(t, 1, "PaginationWrapper svelte-p7mf8l", null, n, { Hidden: a(P) === "sports" }), o.disabled = a(c) === 0, x(i, h), p.disabled = a(c) >= E() - f(), x(v, u);
282
+ },
283
+ [() => b()("previousButton"), () => b()("nextButton")]
284
+ ), m(e, t);
285
+ }, Ee = (e) => {
286
+ var t = J(), n = q(t);
287
+ {
288
+ var o = (i) => {
289
+ var s = pt();
290
+ let p;
291
+ var v = l(s, !0);
292
+ r(s), S(
293
+ (h) => {
294
+ p = A(s, 1, "NoGamesAvailable svelte-p7mf8l", null, p, { Hidden: a(P) === "sports" }), x(v, h);
295
+ },
296
+ [() => b()("noAvailableGames")]
297
+ ), m(i, s);
298
+ };
299
+ G(
300
+ n,
301
+ (i) => {
302
+ !a(M) && a(L)?.length === 0 && i(o);
303
+ },
304
+ !0
305
+ );
306
+ }
307
+ m(e, t);
308
+ };
309
+ G(le, (e) => {
310
+ !a(M) && a(L)?.length > 0 ? e(je) : e(Ee, !1);
311
+ });
312
+ }
313
+ var Le = _(le, 2);
314
+ {
315
+ var Oe = (e) => {
316
+ var t = mt();
317
+ m(e, t);
318
+ };
319
+ G(Le, (e) => {
320
+ a(M) && e(Oe);
321
+ });
322
+ }
323
+ r(Z), S(
324
+ (e, t) => {
325
+ x(Te, e), x(Ge, t), re = A(I, 1, "TournamentGamesContainer svelte-p7mf8l", null, re, { Hidden: a(P) === "sports" });
326
+ },
327
+ [
328
+ () => b()("gamesDescriptionTitle"),
329
+ () => b()("gamesDescriptionSubtitle")
330
+ ]
331
+ ), m(B, Z);
332
+ var We = qe(Se);
333
+ return fe(), We;
334
+ }
335
+ Ve(["click"]);
336
+ customElements.define("tournament-games", Ye(
337
+ ct,
338
+ {
339
+ initialGames: {},
340
+ endpoint: {},
341
+ language: {},
342
+ session: {},
343
+ tournamentid: {},
344
+ gamesLimit: {},
345
+ totalGames: {},
346
+ platformProp: {},
347
+ tournamentMetadata: {}
348
+ },
349
+ [],
350
+ [],
351
+ !1
352
+ ));
353
+ export {
354
+ ct as default
355
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";var K=(h,m,i)=>new Promise((j,A)=>{var y=d=>{try{g(i.next(d))}catch(b){A(b)}},S=d=>{try{g(i.throw(d))}catch(b){A(b)}},g=d=>d.done?j(d.value):Promise.resolve(d.value).then(y,S);g((i=i.apply(h,m)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TournamentDetails-BwBvr-th.cjs"),Pe=require("./TournamentDetailsPage-du8_rjJX.cjs");function Se(h,m){e.addMessages(h,m)}function Q(h){e.$locale.set(h)}const V={en:{previousButton:"Previous",nextButton:"Next",casinoTab:"Casino",sportsbookTab:"Sportsbook",gamesDescriptionTitle:"Participating games",gamesDescriptionSubtitle:"Discover the games",sportsRulesParseError:"Error parsing tournament rules",noAvailableGames:"No games have been configured yet!"},tr:{previousButton:"Previous",nextButton:"Next",casinoTab:"Casino",sportsbookTab:"Sportsbook"}},Te=()=>typeof window=="undefined";var Ge=e.from_html('<div class="TournamentGamesTabs svelte-p7mf8l"><button> </button> <button> </button></div>'),Ae=e.from_html('<p class="svelte-p7mf8l"> </p>'),Ne=e.from_html("<div></div>"),Be=e.from_html('<div class="TournamentGameThumbnailSkeleton svelte-p7mf8l"></div>'),De=e.from_html('<div class="TournamentGameThumbnail svelte-p7mf8l"><div class="ImageContainer svelte-p7mf8l"><img class="svelte-p7mf8l"/> <div class="PlayButtonOverlay svelte-p7mf8l"><button class="PlayGameButton svelte-p7mf8l"> </button></div></div></div>'),Me=e.from_html('<span class="PaginationButton Elipsis svelte-p7mf8l">...</span>'),je=e.from_html("<button> </button>"),Ee=e.from_html('<div><button class="PaginationButton svelte-p7mf8l"> </button> <div class="PageNumberWrapper svelte-p7mf8l"></div> <button class="PaginationButton svelte-p7mf8l"> </button></div>'),Le=e.from_html("<p> </p>"),Oe=e.from_html('<div class="PaginationSkeleton svelte-p7mf8l"><div class="PaginationSkeletonButton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div> <div class="PaginationSkeletonButton svelte-p7mf8l"><div class="SkeletonShimmer svelte-p7mf8l"></div></div></div>'),We=e.from_html('<div class="TournamentGamesWrapper svelte-p7mf8l"><div class="GamesDescription svelte-p7mf8l"><p class="GamesDescriptionTitle svelte-p7mf8l"> </p> <p class="GamesDescriptionSubTitle svelte-p7mf8l"> </p></div> <!> <!> <div><!></div> <!> <!></div>');const Re={hash:"svelte-p7mf8l",code:`.svelte-p7mf8l,
2
+ .svelte-p7mf8l::before,
3
+ .svelte-p7mf8l::after {margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit;}.GamesDescription.svelte-p7mf8l {display:flex;flex-direction:column;gap:6px;margin:10px 0;.GamesDescriptionTitle:where(.svelte-p7mf8l) {color:var(--emw-color-typography, #ffffff);font-size:16px;font-weight:600;}.GamesDescriptionSubTitle:where(.svelte-p7mf8l) {color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:200;}}.TournamentGamesTabs.svelte-p7mf8l {display:flex;border-radius:50px;background-color:var(--emw-color-bg-section, #434343);padding:6px;margin-bottom:6px;width:100%;justify-content:center;.Tab:where(.svelte-p7mf8l) {padding:5px 20px;color:var(--emw-color-typography, #ffffff);width:100%;border-radius:50px;background-color:transparent;border:none;cursor:pointer;}.Active:where(.svelte-p7mf8l) {background-color:var(--emw-color-bg-elements, #4A4A4A);border:none;}}.TournamentRulesWrapper.svelte-p7mf8l {display:flex;flex-direction:column;color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:400;margin:10px 0;}.TournamentGamesWrapper.svelte-p7mf8l {display:flex;flex-direction:column;gap:10px;background-color:var(--emw-color-bg-secondary, #333232);padding:10px;border-radius:6px;}.TournamentGamesContainer.svelte-p7mf8l {display:grid;gap:12px;grid-template-columns:repeat(auto-fit, minmax(min(150px, 100%), 1fr));.TournamentGameThumbnailSkeleton:where(.svelte-p7mf8l) {position:relative;width:100%;aspect-ratio:4 / 3;overflow:hidden;border-radius:6px;background:linear-gradient(
4
+ to top,
5
+ var(--emw-color-primary, #FF1D4E),
6
+ transparent
7
+ );background-size:100% 200%;
8
+ animation: pulse 1.5s ease-in-out infinite;}.ImageContainer:where(.svelte-p7mf8l) {position:relative;width:100%;aspect-ratio:4 / 3;overflow:hidden;border-radius:6px;}img:where(.svelte-p7mf8l) {position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;border-radius:6px;}.PlayButtonOverlay:where(.svelte-p7mf8l) {position:absolute;top:0;left:0;bottom:0;right:0;background-color:rgba(0, 0, 0, 0.6);display:flex;justify-content:center;align-items:center;opacity:0;&:hover {opacity:1;transition:opacity 0.5s;}.PlayGameButton:where(.svelte-p7mf8l) {background-color:var(--emw-color-primary, #FF1D4E);border-radius:6px;color:var(--emw-color-typography, #ffffff);padding:10px;border:none;outline:none;min-width:50%;cursor:pointer;&:hover {background-color:var(--emw-color-primary-hover, #ff3a65);cursor:pointer;}&:active {transform:scale(0.9);}}}}.PaginationWrapper.svelte-p7mf8l {display:flex;justify-content:space-between;.PageNumberWrapper:where(.svelte-p7mf8l) {display:flex;gap:3px;}.PaginationButton:where(.svelte-p7mf8l) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography, #ffffff);border-radius:6px;border:none;outline:none;padding:10px;width:auto;cursor:pointer;&.Number {background-color:transparent;min-width:0;padding:0 10px;}&:hover {background-color:var(--emw-color-bg-elements, #4A4A4A);cursor:pointer;}&:active {transform:scale(0.9);}&:disabled {opacity:60%;pointer-events:none;}&.Active {background-color:var(--emw-color-bg-elements, #4A4A4A);}&.Elipsis {pointer-events:none;background-color:transparent;min-width:0;padding:0;align-self:center;}}}.NoGamesAvailable.svelte-p7mf8l {color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:300;}.PaginationSkeleton.svelte-p7mf8l {display:flex;justify-content:space-between;gap:6px;}.PaginationSkeletonButton.svelte-p7mf8l {width:80px;height:35px;border-radius:6px;background-color:var(--emw-color-bg-elements, #4A4A4A);overflow:hidden;position:relative;}.PaginationNumberSkeleton.svelte-p7mf8l {width:40px;height:35px;border-radius:6px;background-color:var(--emw-color-bg-elements, #4A4A4A);overflow:hidden;position:relative;}.SkeletonShimmer.svelte-p7mf8l {width:100%;height:100%;background:linear-gradient(
9
+ 90deg,
10
+ transparent 0%,
11
+ var(--emw-color-skeleton, #333232) 50%,
12
+ transparent 100%
13
+ );
14
+ animation: svelte-p7mf8l-loading 1.5s infinite;transform:translateX(-100%);}
15
+
16
+ @keyframes svelte-p7mf8l-loading {
17
+ 0% {
18
+ transform: translateX(-100%);
19
+ }
20
+ 100% {
21
+ transform: translateX(100%);
22
+ }
23
+ }
24
+
25
+ @media (min-width: 750px) {.TournamentGamesTabs.svelte-p7mf8l {width:fit-content;}.PaginationWrapper.svelte-p7mf8l, .PaginationSkeleton.svelte-p7mf8l {justify-content:end;gap:10px;}.PaginationButton.svelte-p7mf8l {min-width:75px;}.PaginationSkeleton.svelte-p7mf8l {justify-content:end;gap:10px;.PaginationSkeletonButton:where(.svelte-p7mf8l) {width:auto;min-width:55px;}.PaginationNumberSkeleton:where(.svelte-p7mf8l) {width:35px;}}
26
+
27
+ }.Hidden.svelte-p7mf8l {display:none;}`};function Y(h,m){var q;e.push(m,!0),e.append_styles(h,Re);const i=()=>e.store_get(e.$format,"$_",j),[j,A]=e.setup_stores(),y=e.prop(m,"initialGames"),S=e.prop(m,"endpoint"),g=e.prop(m,"language",7,"en"),d=e.prop(m,"session"),b=e.prop(m,"tournamentid"),v=e.prop(m,"gamesLimit",7,6),T=e.prop(m,"totalGames"),E=e.prop(m,"platformProp",7,null),w=e.prop(m,"tournamentMetadata");Object.keys(V).forEach(t=>{Se(t,V[t])}),Q(g());const Z=()=>{Q(g())};e.user_effect(()=>{Z()});let G=e.state(e.proxy(y()||[])),k=e.state(!1),f=e.state(0),N=e.state(void 0);const $=Te()?(q=E())!=null?q:"dk":Pe.getDevice(window.navigator.userAgent),L=()=>K(this,null,function*(){if(O.has(e.get(B)))return;e.set(k,!0);const t=new URL(`${S()}/v1/tournaments/${b()}`),a=new Headers;d()&&a.append("X-SessionId",d());const n={method:"GET",headers:a};t.searchParams.append("filter",`id=${b()}`),t.searchParams.append("language",g()),t.searchParams.append("expand","games"),t.searchParams.append("pagination",`games(limit=${v()},offset=${e.get(f)})`),t.searchParams.append("platform",$),fetch(t,n).then(r=>r.json()).then(r=>{var o,s;e.set(G,(s=(o=r==null?void 0:r.item)==null?void 0:o.games)==null?void 0:s.items,!0),O.set(e.get(B),e.get(G))}).catch(r=>console.log(r)).finally(()=>e.set(k,!1))}),ee=()=>{const t=Math.ceil(T()/v()),a=Math.floor(e.get(f)/v())+1;if(t<=5)return Array.from({length:t},(r,o)=>o+1);const n=[];return n.push(1),a<=3?(n.push(2,3),n.push("..."),n.push(t)):a>=t-2?(n.push("..."),n.push(t-2,t-1,t)):(n.push("..."),n.push(a-1,a,a+1),n.push("..."),n.push(t)),n},te=()=>{e.get(f)<T()&&(e.set(f,e.get(f)+v()),L())},ae=()=>{e.get(f)!==0&&(e.set(f,e.get(f)-v()),L())},ne=t=>{e.set(f,(t-1)*v()),L()},se=e.user_derived(ee),B=e.user_derived(()=>Math.floor(e.get(f)/v())+1);let O=new Map([[1,y()]]),re=e.user_derived(()=>{var t;return(t=O.get(e.get(B)))!=null?t:[]}),_=e.state("casino");const oe=()=>{var n;if(!w())return;const t=(n=w().sports)==null?void 0:n.rules;let a;if(t)try{a=JSON.parse(t),e.set(N,a[g()]||a["*"],!0)}catch(r){console.log(r),e.set(N,`${i()("sportsRulesParseError")}`)}},le=t=>{window.postMessage({type:"Tournaments:PlayGame",launchUrl:t.launchUrl,id:t.gameId,thumbnail:t.thumbnail,name:t.name},window.location.href)};e.user_effect(()=>{Object.keys(w()).length!==0&&oe()});var ie={get initialGames(){return y()},set initialGames(t){y(t),e.flushSync()},get endpoint(){return S()},set endpoint(t){S(t),e.flushSync()},get language(){return g()},set language(t="en"){g(t),e.flushSync()},get session(){return d()},set session(t){d(t),e.flushSync()},get tournamentid(){return b()},set tournamentid(t){b(t),e.flushSync()},get gamesLimit(){return v()},set gamesLimit(t=6){v(t),e.flushSync()},get totalGames(){return T()},set totalGames(t){T(t),e.flushSync()},get platformProp(){return E()},set platformProp(t=null){E(t),e.flushSync()},get tournamentMetadata(){return w()},set tournamentMetadata(t){w(t),e.flushSync()}},W=We(),R=e.child(W),z=e.child(R),pe=e.child(z,!0);e.reset(z);var H=e.sibling(z,2),me=e.child(H,!0);e.reset(H),e.reset(R);var I=e.sibling(R,2);{var ce=t=>{var a=Ge(),n=e.child(a);let r;n.__click=()=>e.set(_,"casino");var o=e.child(n,!0);e.reset(n);var s=e.sibling(n,2);let l;s.__click=()=>e.set(_,"sports");var p=e.child(s,!0);e.reset(s),e.reset(a),e.template_effect((c,u)=>{r=e.set_class(n,1,"Tab svelte-p7mf8l",null,r,{Active:e.get(_)==="casino"}),e.set_text(o,c),l=e.set_class(s,1,"Tab svelte-p7mf8l",null,l,{Active:e.get(_)==="sports"}),e.set_text(p,u)},[()=>i()("casinoTab"),()=>i()("sportsbookTab")]),e.append(t,a)};e.if_block(I,t=>{Object.keys(w()).length!==0&&t(ce)})}var F=e.sibling(I,2);{var de=t=>{var a=Ne();let n;e.each(a,21,()=>e.get(N),e.index,(r,o)=>{var s=Ae(),l=e.child(s);e.reset(s),e.template_effect(p=>{var c;return e.set_text(l,`${(c=e.get(o).rule)!=null?c:""} ${p!=null?p:""}`)},[()=>i()("contribution")]),e.append(r,s)}),e.reset(a),e.template_effect(()=>n=e.set_class(a,1,"TournamentRulesWrapper svelte-p7mf8l",null,n,{Hidden:e.get(_)==="casino"})),e.append(t,a)};e.if_block(F,t=>{e.get(N)&&t(de)})}var D=e.sibling(F,2);let X;var fe=e.child(D);{var ve=t=>{var a=e.comment(),n=e.first_child(a);e.each(n,17,()=>Array(v()),e.index,(r,o,s,l)=>{var p=Be();e.append(r,p)}),e.append(t,a)},ue=t=>{var a=e.comment(),n=e.first_child(a);e.each(n,17,()=>e.get(re),e.index,(r,o)=>{var s=De();s.__click=()=>le(e.get(o));var l=e.child(s),p=e.child(l),c=e.sibling(p,2),u=e.child(c),M=e.child(u,!0);e.reset(u),e.reset(c),e.reset(l),e.reset(s),e.template_effect(C=>{e.set_attribute(p,"src",`https:${e.get(o).thumbnail}`),e.set_attribute(p,"alt",e.get(o).name),e.set_text(M,C)},[()=>i()("play")]),e.append(r,s)}),e.append(t,a)};e.if_block(fe,t=>{var a;e.get(k)||((a=e.get(G))==null?void 0:a.length)===0?t(ve):t(ue,!1)})}e.reset(D);var U=e.sibling(D,2);{var ge=t=>{var a=Ee();let n;var r=e.child(a);r.__click=ae;var o=e.child(r,!0);e.reset(r);var s=e.sibling(r,2);e.each(s,21,()=>e.get(se),e.index,(c,u)=>{var M=e.comment(),C=e.first_child(M);{var ye=P=>{var x=Me();e.append(P,x)},we=P=>{var x=je();let J;x.__click=()=>ne(e.get(u));var ke=e.child(x,!0);e.reset(x),e.template_effect(()=>{J=e.set_class(x,1,"PaginationButton Number svelte-p7mf8l",null,J,{Active:e.get(u)===e.get(B)}),e.set_text(ke,e.get(u))}),e.append(P,x)};e.if_block(C,P=>{typeof e.get(u)!="number"?P(ye):P(we,!1)})}e.append(c,M)}),e.reset(s);var l=e.sibling(s,2);l.__click=te;var p=e.child(l,!0);e.reset(l),e.reset(a),e.template_effect((c,u)=>{n=e.set_class(a,1,"PaginationWrapper svelte-p7mf8l",null,n,{Hidden:e.get(_)==="sports"}),r.disabled=e.get(f)===0,e.set_text(o,c),l.disabled=e.get(f)>=T()-v(),e.set_text(p,u)},[()=>i()("previousButton"),()=>i()("nextButton")]),e.append(t,a)},he=t=>{var a=e.comment(),n=e.first_child(a);{var r=o=>{var s=Le();let l;var p=e.child(s,!0);e.reset(s),e.template_effect(c=>{l=e.set_class(s,1,"NoGamesAvailable svelte-p7mf8l",null,l,{Hidden:e.get(_)==="sports"}),e.set_text(p,c)},[()=>i()("noAvailableGames")]),e.append(o,s)};e.if_block(n,o=>{var s;!e.get(k)&&((s=e.get(G))==null?void 0:s.length)===0&&o(r)},!0)}e.append(t,a)};e.if_block(U,t=>{var a;!e.get(k)&&((a=e.get(G))==null?void 0:a.length)>0?t(ge):t(he,!1)})}var be=e.sibling(U,2);{var _e=t=>{var a=Oe();e.append(t,a)};e.if_block(be,t=>{e.get(k)&&t(_e)})}e.reset(W),e.template_effect((t,a)=>{e.set_text(pe,t),e.set_text(me,a),X=e.set_class(D,1,"TournamentGamesContainer svelte-p7mf8l",null,X,{Hidden:e.get(_)==="sports"})},[()=>i()("gamesDescriptionTitle"),()=>i()("gamesDescriptionSubtitle")]),e.append(h,W);var xe=e.pop(ie);return A(),xe}e.delegate(["click"]);customElements.define("tournament-games",e.create_custom_element(Y,{initialGames:{},endpoint:{},language:{},session:{},tournamentid:{},gamesLimit:{},totalGames:{},platformProp:{},tournamentMetadata:{}},[],[],!1));exports.default=Y;