@everymatrix/tournament-details-page 0.0.2 → 0.0.5

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 (29) hide show
  1. package/components/{TournamentDetails-upe3WFia.cjs → TournamentDetails-2nXu_Fl0.cjs} +5 -5
  2. package/components/{TournamentDetails-amGR_-Hv.js → TournamentDetails-ByOP8vGa.js} +575 -576
  3. package/components/{TournamentDetails-CJVSWVXD.js → TournamentDetails-DIGjTSwQ.js} +701 -702
  4. package/components/{TournamentDetailsPage-DW00w9RP.js → TournamentDetailsPage-CPVEgDYR.js} +154 -154
  5. package/components/TournamentDetailsPage-CpVOLote.cjs +63 -0
  6. package/components/{TournamentDetailsPage-B21wsWnv.js → TournamentDetailsPage-Dlv02xHw.js} +110 -110
  7. package/components/TournamentGames-0cZY55hS.js +348 -0
  8. package/components/TournamentGames-3vEVB6E0.js +376 -0
  9. package/components/TournamentGames-54X0-O5B.cjs +26 -0
  10. package/components/TournamentLeaderboard-CXLrlJUG.cjs +30 -0
  11. package/components/TournamentLeaderboard-D7ktm7ED.js +788 -0
  12. package/components/TournamentLeaderboard-nb3ySbAn.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/TournamentDetailsPage-BlWvqhbK.js +0 -953
  18. package/components/TournamentDetailsPage-BsjnqhIP.cjs +0 -63
  19. package/components/TournamentDetailsPage-DnknTo0Y.js +0 -976
  20. package/components/TournamentDetailsPage-FO-PGATk.cjs +0 -63
  21. package/components/TournamentGames-B0ap9lHo.cjs +0 -26
  22. package/components/TournamentGames-BqZd-C9h.js +0 -351
  23. package/components/TournamentGames-C0-voJOi.js +0 -324
  24. package/components/TournamentGames-Cb2LP2tF.js +0 -324
  25. package/components/TournamentGames-D5Nyb0Nx.cjs +0 -26
  26. package/components/TournamentGames-DIIgfZ-E.js +0 -351
  27. package/components/TournamentLeaderboard-BjmkrtNX.js +0 -800
  28. package/components/TournamentLeaderboard-C1tIH5FA.js +0 -784
  29. package/components/TournamentLeaderboard-DWYhqHPh.cjs +0 -36
@@ -0,0 +1,376 @@
1
+ var ce = (T, d, p) => new Promise((V, I) => {
2
+ var M = (f) => {
3
+ try {
4
+ k(p.next(f));
5
+ } catch (G) {
6
+ I(G);
7
+ }
8
+ }, W = (f) => {
9
+ try {
10
+ k(p.throw(f));
11
+ } catch (G) {
12
+ I(G);
13
+ }
14
+ }, k = (f) => f.done ? V(f.value) : Promise.resolve(f.value).then(M, W);
15
+ k((p = p.apply(T, d)).next());
16
+ });
17
+ import { a as Fe, $ as He, m as Xe, e as Ue, p as P, u as de, s as z, f as Je, g as _, r as x, q as i, i as D, n as a, y as A, C as qe, E as w, A as O, h as c, j as Ke, k as Qe, F as Ve, w as y, l as S, J, K as q, I as K, x as Q, L as oe, t as Ye, v as Ze, B as r, D as fe } from "./TournamentDetails-DIGjTSwQ.js";
18
+ import { g as $e } from "./TournamentDetailsPage-Dlv02xHw.js";
19
+ function et(T, d) {
20
+ Fe(T, d);
21
+ }
22
+ function tt(T) {
23
+ He.set(T);
24
+ }
25
+ const ue = {
26
+ en: {
27
+ previousButton: "Previous",
28
+ nextButton: "Next",
29
+ casinoTab: "Casino",
30
+ sportsbookTab: "Sportsbook",
31
+ gamesDescriptionTitle: "Participating games",
32
+ gamesDescriptionSubtitle: "Discover the games",
33
+ sportsRulesParseError: "Error parsing tournament rules",
34
+ noAvailableGames: "No games have been configured yet!"
35
+ },
36
+ tr: {
37
+ previousButton: "Previous",
38
+ nextButton: "Next",
39
+ casinoTab: "Casino",
40
+ sportsbookTab: "Sportsbook"
41
+ }
42
+ }, at = () => typeof window == "undefined";
43
+ var nt = _('<div class="TournamentGamesTabs svelte-p7mf8l"><button> </button> <button> </button></div>'), ot = _('<p class="svelte-p7mf8l"> </p>'), st = _("<div></div>"), rt = _('<div class="TournamentGameThumbnailSkeleton svelte-p7mf8l"></div>'), lt = _('<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>'), it = _('<span class="PaginationButton Elipsis svelte-p7mf8l">...</span>'), pt = _("<button> </button>"), mt = _('<div><button class="PaginationButton svelte-p7mf8l"> </button> <div class="PageNumberWrapper svelte-p7mf8l"></div> <button class="PaginationButton svelte-p7mf8l"> </button></div>'), vt = _('<p class="NoGamesAvailable svelte-p7mf8l"> </p>'), ct = _('<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>'), dt = _('<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>');
44
+ const ft = {
45
+ hash: "svelte-p7mf8l",
46
+ code: `.svelte-p7mf8l,
47
+ .svelte-p7mf8l::before,
48
+ .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(
49
+ to top,
50
+ var(--emw-color-primary, #FF1D4E),
51
+ transparent
52
+ );background-size:100% 200%;
53
+ 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:40px;border-radius:6px;background-color:var(--emw-color-bg-elements, #4A4A4A);overflow:hidden;position:relative;}.PaginationNumberSkeleton.svelte-p7mf8l {width:40px;height:40px;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(
54
+ 90deg,
55
+ transparent 0%,
56
+ var(--emw-color-skeleton, #333232) 50%,
57
+ transparent 100%
58
+ );
59
+ animation: svelte-p7mf8l-loading 1.5s infinite;transform:translateX(-100%);}
60
+
61
+ @keyframes svelte-p7mf8l-loading {
62
+ 0% {
63
+ transform: translateX(-100%);
64
+ }
65
+ 100% {
66
+ transform: translateX(100%);
67
+ }
68
+ }
69
+
70
+ @media (min-width: 750px) {.TournamentGamesTabs.svelte-p7mf8l {width:fit-content;}.PaginationWrapper.svelte-p7mf8l {justify-content:end;gap:10px;}.PaginationButton.svelte-p7mf8l {width:auto;min-width:75px;}
71
+ }.Hidden.svelte-p7mf8l {display:none;}`
72
+ };
73
+ function ut(T, d) {
74
+ var me;
75
+ Xe(d, !0), Ue(T, ft);
76
+ const p = () => qe(Ve, "$_", V), [V, I] = Qe(), M = P(d, "initialGames"), W = P(d, "endpoint"), k = P(d, "language", 7, "en"), f = P(d, "session"), G = P(d, "tournamentid"), g = P(d, "gamesLimit", 7, 6), C = P(d, "totalGames"), Y = P(d, "platformProp", 7, null), j = P(d, "tournamentMetadata");
77
+ Object.keys(ue).forEach((e) => {
78
+ et(e, ue[e]);
79
+ });
80
+ const ge = () => {
81
+ tt(k());
82
+ };
83
+ de(() => {
84
+ ge();
85
+ });
86
+ let R = z(Je(M() || [])), E = z(!1), u = z(0), F = z(void 0);
87
+ const be = at() ? (me = Y()) != null ? me : "dk" : $e(window.navigator.userAgent), Z = () => ce(this, null, function* () {
88
+ if ($.has(a(H)))
89
+ return;
90
+ y(E, !0);
91
+ const e = new URL(`${W()}/v1/tournaments/${G()}`), t = new Headers();
92
+ f() && t.append("X-SessionId", f());
93
+ const n = { method: "GET", headers: t };
94
+ e.searchParams.append("filter", `id=${G()}`), e.searchParams.append("language", k()), e.searchParams.append("expand", "games"), e.searchParams.append("pagination", `games(limit=${g()},offset=${a(u)})`), e.searchParams.append("platform", be), fetch(e, n).then((s) => s.json()).then((s) => {
95
+ var l, o;
96
+ y(R, (o = (l = s == null ? void 0 : s.item) == null ? void 0 : l.games) == null ? void 0 : o.items, !0), $.set(a(H), a(R));
97
+ }).catch((s) => console.log(s)).finally(() => y(E, !1));
98
+ }), he = () => {
99
+ const e = Math.ceil(C() / g()), t = Math.floor(a(u) / g()) + 1;
100
+ if (e <= 5)
101
+ return Array.from({ length: e }, (s, l) => l + 1);
102
+ const n = [];
103
+ 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;
104
+ }, _e = () => {
105
+ a(u) < C() && (y(u, a(u) + g()), Z());
106
+ }, xe = () => {
107
+ a(u) !== 0 && (y(u, a(u) - g()), Z());
108
+ }, we = (e) => {
109
+ y(u, (e - 1) * g()), Z();
110
+ }, ye = oe(he), H = oe(() => Math.floor(a(u) / g()) + 1);
111
+ let $ = /* @__PURE__ */ new Map([[1, M()]]), ke = oe(() => {
112
+ var e;
113
+ return (e = $.get(a(H))) != null ? e : [];
114
+ }), B = z("casino");
115
+ const Pe = () => {
116
+ var n;
117
+ if (!j()) return;
118
+ const e = (n = j().sports) == null ? void 0 : n.rules;
119
+ let t;
120
+ if (e)
121
+ try {
122
+ t = JSON.parse(e), y(F, t[k()] || t["*"], !0);
123
+ } catch (s) {
124
+ console.log(s), y(F, `${p()("sportsRulesParseError")}`);
125
+ }
126
+ }, Se = (e) => {
127
+ window.postMessage(
128
+ {
129
+ type: "Tournaments:PlayGame",
130
+ launchUrl: e.launchUrl,
131
+ id: e.gameId,
132
+ platform: e.platform,
133
+ thumbnail: e.thumbnail,
134
+ name: e.name
135
+ },
136
+ window.location.href
137
+ );
138
+ };
139
+ de(() => {
140
+ Object.keys(j()).length !== 0 && Pe();
141
+ });
142
+ var Te = {
143
+ get initialGames() {
144
+ return M();
145
+ },
146
+ set initialGames(e) {
147
+ M(e), S();
148
+ },
149
+ get endpoint() {
150
+ return W();
151
+ },
152
+ set endpoint(e) {
153
+ W(e), S();
154
+ },
155
+ get language() {
156
+ return k();
157
+ },
158
+ set language(e = "en") {
159
+ k(e), S();
160
+ },
161
+ get session() {
162
+ return f();
163
+ },
164
+ set session(e) {
165
+ f(e), S();
166
+ },
167
+ get tournamentid() {
168
+ return G();
169
+ },
170
+ set tournamentid(e) {
171
+ G(e), S();
172
+ },
173
+ get gamesLimit() {
174
+ return g();
175
+ },
176
+ set gamesLimit(e = 6) {
177
+ g(e), S();
178
+ },
179
+ get totalGames() {
180
+ return C();
181
+ },
182
+ set totalGames(e) {
183
+ C(e), S();
184
+ },
185
+ get platformProp() {
186
+ return Y();
187
+ },
188
+ set platformProp(e = null) {
189
+ Y(e), S();
190
+ },
191
+ get tournamentMetadata() {
192
+ return j();
193
+ },
194
+ set tournamentMetadata(e) {
195
+ j(e), S();
196
+ }
197
+ }, ee = dt(), te = i(ee), ae = i(te), Ge = i(ae, !0);
198
+ r(ae);
199
+ var se = x(ae, 2), Ae = i(se, !0);
200
+ r(se), r(te);
201
+ var re = x(te, 2);
202
+ {
203
+ var Be = (e) => {
204
+ var t = nt(), n = i(t);
205
+ let s;
206
+ n.__click = () => y(B, "casino");
207
+ var l = i(n, !0);
208
+ r(n);
209
+ var o = x(n, 2);
210
+ let m;
211
+ o.__click = () => y(B, "sports");
212
+ var v = i(o, !0);
213
+ r(o), r(t), A(
214
+ (b, h) => {
215
+ s = O(n, 1, "Tab svelte-p7mf8l", null, s, { Active: a(B) === "casino" }), w(l, b), m = O(o, 1, "Tab svelte-p7mf8l", null, m, { Active: a(B) === "sports" }), w(v, h);
216
+ },
217
+ [() => p()("casinoTab"), () => p()("sportsbookTab")]
218
+ ), c(e, t);
219
+ };
220
+ D(re, (e) => {
221
+ Object.keys(j()).length !== 0 && e(Be);
222
+ });
223
+ }
224
+ var le = x(re, 2);
225
+ {
226
+ var Ne = (e) => {
227
+ var t = st();
228
+ let n;
229
+ J(t, 21, () => a(F), q, (s, l) => {
230
+ var o = ot(), m = i(o);
231
+ r(o), A((v) => {
232
+ var b;
233
+ return w(m, `${(b = a(l).rule) != null ? b : ""} ${v != null ? v : ""}`);
234
+ }, [() => p()("contribution")]), c(s, o);
235
+ }), r(t), A(() => n = O(t, 1, "TournamentRulesWrapper svelte-p7mf8l", null, n, { Hidden: a(B) === "casino" })), c(e, t);
236
+ };
237
+ D(le, (e) => {
238
+ a(F) && e(Ne);
239
+ });
240
+ }
241
+ var X = x(le, 2);
242
+ let ie;
243
+ var De = i(X);
244
+ {
245
+ var Me = (e) => {
246
+ var t = K(), n = Q(t);
247
+ J(n, 17, () => Array(g()), q, (s, l, o, m) => {
248
+ var v = rt();
249
+ c(s, v);
250
+ }), c(e, t);
251
+ }, je = (e) => {
252
+ var t = K(), n = Q(t);
253
+ J(n, 17, () => a(ke), q, (s, l) => {
254
+ var o = lt();
255
+ o.__click = () => Se(a(l));
256
+ var m = i(o), v = i(m), b = x(v, 2), h = i(b), U = i(h, !0);
257
+ r(h), r(b), r(m), r(o), A(
258
+ (ne) => {
259
+ fe(v, "src", `https:${a(l).thumbnail}`), fe(v, "alt", a(l).name), w(U, ne);
260
+ },
261
+ [() => p()("play")]
262
+ ), c(s, o);
263
+ }), c(e, t);
264
+ };
265
+ D(De, (e) => {
266
+ var t;
267
+ a(E) || ((t = a(R)) == null ? void 0 : t.length) === 0 ? e(Me) : e(je, !1);
268
+ });
269
+ }
270
+ r(X);
271
+ var pe = x(X, 2);
272
+ {
273
+ var Ee = (e) => {
274
+ var t = mt();
275
+ let n;
276
+ var s = i(t);
277
+ s.__click = xe;
278
+ var l = i(s, !0);
279
+ r(s);
280
+ var o = x(s, 2);
281
+ J(o, 21, () => a(ye), q, (b, h) => {
282
+ var U = K(), ne = Q(U);
283
+ {
284
+ var Re = (L) => {
285
+ var N = it();
286
+ c(L, N);
287
+ }, ze = (L) => {
288
+ var N = pt();
289
+ let ve;
290
+ N.__click = () => we(a(h));
291
+ var Ie = i(N, !0);
292
+ r(N), A(() => {
293
+ ve = O(N, 1, "PaginationButton Number svelte-p7mf8l", null, ve, { Active: a(h) === a(H) }), w(Ie, a(h));
294
+ }), c(L, N);
295
+ };
296
+ D(ne, (L) => {
297
+ typeof a(h) != "number" ? L(Re) : L(ze, !1);
298
+ });
299
+ }
300
+ c(b, U);
301
+ }), r(o);
302
+ var m = x(o, 2);
303
+ m.__click = _e;
304
+ var v = i(m, !0);
305
+ r(m), r(t), A(
306
+ (b, h) => {
307
+ n = O(t, 1, "PaginationWrapper svelte-p7mf8l", null, n, { Hidden: a(B) === "sports" }), s.disabled = a(u) === 0, w(l, b), m.disabled = a(u) >= C() - g(), w(v, h);
308
+ },
309
+ [() => p()("previousButton"), () => p()("nextButton")]
310
+ ), c(e, t);
311
+ }, Le = (e) => {
312
+ var t = K(), n = Q(t);
313
+ {
314
+ var s = (l) => {
315
+ var o = vt(), m = i(o, !0);
316
+ r(o), A((v) => w(m, v), [() => p()("noAvailableGames")]), c(l, o);
317
+ };
318
+ D(
319
+ n,
320
+ (l) => {
321
+ var o;
322
+ !a(E) && ((o = a(R)) == null ? void 0 : o.length) === 0 && l(s);
323
+ },
324
+ !0
325
+ );
326
+ }
327
+ c(e, t);
328
+ };
329
+ D(pe, (e) => {
330
+ var t;
331
+ !a(E) && ((t = a(R)) == null ? void 0 : t.length) > 0 ? e(Ee) : e(Le, !1);
332
+ });
333
+ }
334
+ var Oe = x(pe, 2);
335
+ {
336
+ var We = (e) => {
337
+ var t = ct();
338
+ c(e, t);
339
+ };
340
+ D(Oe, (e) => {
341
+ a(E) && e(We);
342
+ });
343
+ }
344
+ r(ee), A(
345
+ (e, t) => {
346
+ w(Ge, e), w(Ae, t), ie = O(X, 1, "TournamentGamesContainer svelte-p7mf8l", null, ie, { Hidden: a(B) === "sports" });
347
+ },
348
+ [
349
+ () => p()("gamesDescriptionTitle"),
350
+ () => p()("gamesDescriptionSubtitle")
351
+ ]
352
+ ), c(T, ee);
353
+ var Ce = Ke(Te);
354
+ return I(), Ce;
355
+ }
356
+ Ye(["click"]);
357
+ customElements.define("tournament-games", Ze(
358
+ ut,
359
+ {
360
+ initialGames: {},
361
+ endpoint: {},
362
+ language: {},
363
+ session: {},
364
+ tournamentid: {},
365
+ gamesLimit: {},
366
+ totalGames: {},
367
+ platformProp: {},
368
+ tournamentMetadata: {}
369
+ },
370
+ [],
371
+ [],
372
+ !1
373
+ ));
374
+ export {
375
+ ut as default
376
+ };
@@ -0,0 +1,26 @@
1
+ "use strict";var K=(h,m,l)=>new Promise((j,A)=>{var y=c=>{try{g(l.next(c))}catch(b){A(b)}},S=c=>{try{g(l.throw(c))}catch(b){A(b)}},g=c=>c.done?j(c.value):Promise.resolve(c.value).then(y,S);g((l=l.apply(h,m)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TournamentDetails-2nXu_Fl0.cjs"),ke=require("./TournamentDetailsPage-CpVOLote.cjs");function Pe(h,m){e.addMessages(h,m)}function Se(h){e.$locale.set(h)}const Q={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 class="NoGamesAvailable svelte-p7mf8l"> </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:40px;border-radius:6px;background-color:var(--emw-color-bg-elements, #4A4A4A);overflow:hidden;position:relative;}.PaginationNumberSkeleton.svelte-p7mf8l {width:40px;height:40px;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 {justify-content:end;gap:10px;}.PaginationButton.svelte-p7mf8l {width:auto;min-width:75px;}
26
+ }.Hidden.svelte-p7mf8l {display:none;}`};function V(h,m){var q;e.push(m,!0),e.append_styles(h,Re);const l=()=>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"),c=e.prop(m,"session"),b=e.prop(m,"tournamentid"),f=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(Q).forEach(t=>{Pe(t,Q[t])});const Y=()=>{Se(g())};e.user_effect(()=>{Y()});let G=e.state(e.proxy(y()||[])),k=e.state(!1),d=e.state(0),N=e.state(void 0);const Z=Te()?(q=E())!=null?q:"dk":ke.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;c()&&a.append("X-SessionId",c());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=${f()},offset=${e.get(d)})`),t.searchParams.append("platform",Z),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))}),$=()=>{const t=Math.ceil(T()/f()),a=Math.floor(e.get(d)/f())+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},ee=()=>{e.get(d)<T()&&(e.set(d,e.get(d)+f()),L())},te=()=>{e.get(d)!==0&&(e.set(d,e.get(d)-f()),L())},ae=t=>{e.set(d,(t-1)*f()),L()},ne=e.user_derived($),B=e.user_derived(()=>Math.floor(e.get(d)/f())+1);let O=new Map([[1,y()]]),se=e.user_derived(()=>{var t;return(t=O.get(e.get(B)))!=null?t:[]}),_=e.state("casino");const re=()=>{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,`${l()("sportsRulesParseError")}`)}},oe=t=>{window.postMessage({type:"Tournaments:PlayGame",launchUrl:t.launchUrl,id:t.gameId,platform:t.platform,thumbnail:t.thumbnail,name:t.name},window.location.href)};e.user_effect(()=>{Object.keys(w()).length!==0&&re()});var le={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 c()},set session(t){c(t),e.flushSync()},get tournamentid(){return b()},set tournamentid(t){b(t),e.flushSync()},get gamesLimit(){return f()},set gamesLimit(t=6){f(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),ie=e.child(z,!0);e.reset(z);var H=e.sibling(z,2),pe=e.child(H,!0);e.reset(H),e.reset(R);var I=e.sibling(R,2);{var me=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 i;s.__click=()=>e.set(_,"sports");var p=e.child(s,!0);e.reset(s),e.reset(a),e.template_effect((v,u)=>{r=e.set_class(n,1,"Tab svelte-p7mf8l",null,r,{Active:e.get(_)==="casino"}),e.set_text(o,v),i=e.set_class(s,1,"Tab svelte-p7mf8l",null,i,{Active:e.get(_)==="sports"}),e.set_text(p,u)},[()=>l()("casinoTab"),()=>l()("sportsbookTab")]),e.append(t,a)};e.if_block(I,t=>{Object.keys(w()).length!==0&&t(me)})}var F=e.sibling(I,2);{var ce=t=>{var a=Ne();let n;e.each(a,21,()=>e.get(N),e.index,(r,o)=>{var s=Ae(),i=e.child(s);e.reset(s),e.template_effect(p=>{var v;return e.set_text(i,`${(v=e.get(o).rule)!=null?v:""} ${p!=null?p:""}`)},[()=>l()("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(ce)})}var D=e.sibling(F,2);let X;var de=e.child(D);{var fe=t=>{var a=e.comment(),n=e.first_child(a);e.each(n,17,()=>Array(f()),e.index,(r,o,s,i)=>{var p=Be();e.append(r,p)}),e.append(t,a)},ve=t=>{var a=e.comment(),n=e.first_child(a);e.each(n,17,()=>e.get(se),e.index,(r,o)=>{var s=De();s.__click=()=>oe(e.get(o));var i=e.child(s),p=e.child(i),v=e.sibling(p,2),u=e.child(v),M=e.child(u,!0);e.reset(u),e.reset(v),e.reset(i),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)},[()=>l()("play")]),e.append(r,s)}),e.append(t,a)};e.if_block(de,t=>{var a;e.get(k)||((a=e.get(G))==null?void 0:a.length)===0?t(fe):t(ve,!1)})}e.reset(D);var U=e.sibling(D,2);{var ue=t=>{var a=Ee();let n;var r=e.child(a);r.__click=te;var o=e.child(r,!0);e.reset(r);var s=e.sibling(r,2);e.each(s,21,()=>e.get(ne),e.index,(v,u)=>{var M=e.comment(),C=e.first_child(M);{var xe=P=>{var x=Me();e.append(P,x)},ye=P=>{var x=je();let J;x.__click=()=>ae(e.get(u));var we=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(we,e.get(u))}),e.append(P,x)};e.if_block(C,P=>{typeof e.get(u)!="number"?P(xe):P(ye,!1)})}e.append(v,M)}),e.reset(s);var i=e.sibling(s,2);i.__click=ee;var p=e.child(i,!0);e.reset(i),e.reset(a),e.template_effect((v,u)=>{n=e.set_class(a,1,"PaginationWrapper svelte-p7mf8l",null,n,{Hidden:e.get(_)==="sports"}),r.disabled=e.get(d)===0,e.set_text(o,v),i.disabled=e.get(d)>=T()-f(),e.set_text(p,u)},[()=>l()("previousButton"),()=>l()("nextButton")]),e.append(t,a)},ge=t=>{var a=e.comment(),n=e.first_child(a);{var r=o=>{var s=Le(),i=e.child(s,!0);e.reset(s),e.template_effect(p=>e.set_text(i,p),[()=>l()("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(ue):t(ge,!1)})}var he=e.sibling(U,2);{var be=t=>{var a=Oe();e.append(t,a)};e.if_block(he,t=>{e.get(k)&&t(be)})}e.reset(W),e.template_effect((t,a)=>{e.set_text(ie,t),e.set_text(pe,a),X=e.set_class(D,1,"TournamentGamesContainer svelte-p7mf8l",null,X,{Hidden:e.get(_)==="sports"})},[()=>l()("gamesDescriptionTitle"),()=>l()("gamesDescriptionSubtitle")]),e.append(h,W);var _e=e.pop(le);return A(),_e}e.delegate(["click"]);customElements.define("tournament-games",e.create_custom_element(V,{initialGames:{},endpoint:{},language:{},session:{},tournamentid:{},gamesLimit:{},totalGames:{},platformProp:{},tournamentMetadata:{}},[],[],!1));exports.default=V;
@@ -0,0 +1,30 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TournamentDetails-2nXu_Fl0.cjs");function ze(ee,M){e.addMessages(ee,M)}function Ue(ee){e.$locale.set(ee)}const He={en:{rank:"Rank",user:"User",points:"Points",prize:"Prize",notEnrolledRank:"You are currently not enrolled in this torunament",myRanking:"My Ranking",showMore:"Show More",showLess:"Show Less",emptyLeaderboard:"Currently there are no players enrolled in this tournament",joinButton:"Join",previousButton:"Previous",nextButton:"Next"},tr:{rank:"Sıralama",user:"Kullanıcı",points:"Puanlar",prize:"Ödül",notEnrolledRank:"Şu anda bu turnuvaya kayıtlı değilsiniz",myRanking:"Sıralamam",showMore:"Daha Fazla Göster",showLess:"Daha Az Göster",emptyLeaderboard:"Currently there are no players enrolled in this tournament",joinButton:"Join",previousButton:"Previous",nextButton:"Next"}};var Ie={exports:{}};/** @license
2
+ * eventsource.js
3
+ * Available under MIT License (MIT)
4
+ * https://github.com/Yaffle/EventSource/
5
+ */(function(ee,M){(function(y){var z=y.setTimeout,te=y.clearTimeout,j=y.XMLHttpRequest,K=y.XDomainRequest,U=y.ActiveXObject,X=y.EventSource,C=y.document,Ne=y.Promise,A=y.fetch,oe=y.Response,q=y.TextDecoder,fe=y.TextEncoder,W=y.AbortController;if(typeof window!="undefined"&&typeof C!="undefined"&&!("readyState"in C)&&C.body==null&&(C.readyState="loading",window.addEventListener("load",function(t){C.readyState="complete"},!1)),j==null&&U!=null&&(j=function(){return new U("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(t){function o(){}return o.prototype=t,new o}),Date.now||(Date.now=function(){return new Date().getTime()}),W==null){var O=A;A=function(t,o){var i=o.signal;return O(t,{headers:o.headers,credentials:o.credentials,cache:o.cache}).then(function(a){var h=a.body.getReader();return i._reader=h,i._aborted&&i._reader.cancel(),{status:a.status,statusText:a.statusText,headers:a.headers,body:{getReader:function(){return h}}}})},W=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function N(){this.bitsNeeded=0,this.codePoint=0}N.prototype.decode=function(t){function o(c,f,s){if(s===1)return c>=128>>f&&c<<f<=2047;if(s===2)return c>=2048>>f&&c<<f<=55295||c>=57344>>f&&c<<f<=65535;if(s===3)return c>=65536>>f&&c<<f<=1114111;throw new Error}function i(c,f){if(c===6*1)return f>>6>15?3:f>31?2:1;if(c===6*2)return f>15?3:2;if(c===6*3)return 3;throw new Error}for(var a=65533,h="",d=this.bitsNeeded,r=this.codePoint,l=0;l<t.length;l+=1){var n=t[l];d!==0&&(n<128||n>191||!o(r<<6|n&63,d-6,i(d,r)))&&(d=0,r=a,h+=String.fromCharCode(r)),d===0?(n>=0&&n<=127?(d=0,r=n):n>=192&&n<=223?(d=6*1,r=n&31):n>=224&&n<=239?(d=6*2,r=n&15):n>=240&&n<=247?(d=6*3,r=n&7):(d=0,r=a),d!==0&&!o(r,d,i(d,r))&&(d=0,r=a)):(d-=6,r=r<<6|n&63),d===0&&(r<=65535?h+=String.fromCharCode(r):(h+=String.fromCharCode(55296+(r-65535-1>>10)),h+=String.fromCharCode(56320+(r-65535-1&1023))))}return this.bitsNeeded=d,this.codePoint=r,h};var se=function(){try{return new q().decode(new fe().encode("test"),{stream:!0})==="test"}catch(t){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+t)}return!1};(q==null||fe==null||!se())&&(q=N);var R=function(){};function B(t){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=R,this.onload=R,this.onerror=R,this.onreadystatechange=R,this._contentType="",this._xhr=t,this._sendTimeout=0,this._abort=R}B.prototype.open=function(t,o){this._abort(!0);var i=this,a=this._xhr,h=1,d=0;this._abort=function(s){i._sendTimeout!==0&&(te(i._sendTimeout),i._sendTimeout=0),(h===1||h===2||h===3)&&(h=4,a.onload=R,a.onerror=R,a.onabort=R,a.onprogress=R,a.onreadystatechange=R,a.abort(),d!==0&&(te(d),d=0),s||(i.readyState=4,i.onabort(null),i.onreadystatechange())),h=0};var r=function(){if(h===1){var s=0,v="",m=void 0;if("contentType"in a)s=200,v="OK",m=a.contentType;else try{s=a.status,v=a.statusText,m=a.getResponseHeader("Content-Type")}catch(w){s=0,v="",m=void 0}s!==0&&(h=2,i.readyState=2,i.status=s,i.statusText=v,i._contentType=m,i.onreadystatechange())}},l=function(){if(r(),h===2||h===3){h=3;var s="";try{s=a.responseText}catch(v){}i.readyState=3,i.responseText=s,i.onprogress()}},n=function(s,v){if((v==null||v.preventDefault==null)&&(v={preventDefault:R}),l(),h===1||h===2||h===3){if(h=4,d!==0&&(te(d),d=0),i.readyState=4,s==="load")i.onload(v);else if(s==="error")i.onerror(v);else if(s==="abort")i.onabort(v);else throw new TypeError;i.onreadystatechange()}},c=function(s){a!=null&&(a.readyState===4?(!("onload"in a)||!("onerror"in a)||!("onabort"in a))&&n(a.responseText===""?"error":"load",s):a.readyState===3?"onprogress"in a||l():a.readyState===2&&r())},f=function(){d=z(function(){f()},500),a.readyState===3&&l()};"onload"in a&&(a.onload=function(s){n("load",s)}),"onerror"in a&&(a.onerror=function(s){n("error",s)}),"onabort"in a&&(a.onabort=function(s){n("abort",s)}),"onprogress"in a&&(a.onprogress=l),"onreadystatechange"in a&&(a.onreadystatechange=function(s){c(s)}),("contentType"in a||!("ontimeout"in j.prototype))&&(o+=(o.indexOf("?")===-1?"?":"&")+"padding=true"),a.open(t,o,!0),"readyState"in a&&(d=z(function(){f()},0))},B.prototype.abort=function(){this._abort(!1)},B.prototype.getResponseHeader=function(t){return this._contentType},B.prototype.setRequestHeader=function(t,o){var i=this._xhr;"setRequestHeader"in i&&i.setRequestHeader(t,o)},B.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},B.prototype.send=function(){if((!("ontimeout"in j.prototype)||!("sendAsBinary"in j.prototype)&&!("mozAnon"in j.prototype))&&C!=null&&C.readyState!=null&&C.readyState!=="complete"){var t=this;t._sendTimeout=z(function(){t._sendTimeout=0,t.send()},4);return}var o=this._xhr;"withCredentials"in o&&(o.withCredentials=this.withCredentials);try{o.send(void 0)}catch(i){throw i}};function Se(t){return t.replace(/[A-Z]/g,function(o){return String.fromCharCode(o.charCodeAt(0)+32)})}function ie(t){for(var o=Object.create(null),i=t.split(`\r
6
+ `),a=0;a<i.length;a+=1){var h=i[a],d=h.split(": "),r=d.shift(),l=d.join(": ");o[Se(r)]=l}this._map=o}ie.prototype.get=function(t){return this._map[Se(t)]},j!=null&&j.HEADERS_RECEIVED==null&&(j.HEADERS_RECEIVED=2);function ke(){}ke.prototype.open=function(t,o,i,a,h,d,r){t.open("GET",h);var l=0;t.onprogress=function(){var c=t.responseText,f=c.slice(l);l+=f.length,i(f)},t.onerror=function(c){c.preventDefault(),a(new Error("NetworkError"))},t.onload=function(){a(null)},t.onabort=function(){a(null)},t.onreadystatechange=function(){if(t.readyState===j.HEADERS_RECEIVED){var c=t.status,f=t.statusText,s=t.getResponseHeader("Content-Type"),v=t.getAllResponseHeaders();o(c,f,s,new ie(v))}},t.withCredentials=d;for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.setRequestHeader(n,r[n]);return t.send(),t};function Ee(t){this._headers=t}Ee.prototype.get=function(t){return this._headers.get(t)};function Pe(){}Pe.prototype.open=function(t,o,i,a,h,d,r){var l=null,n=new W,c=n.signal,f=new q;return A(h,{headers:r,credentials:d?"include":"same-origin",signal:c,cache:"no-store"}).then(function(s){return l=s.body.getReader(),o(s.status,s.statusText,s.headers.get("Content-Type"),new Ee(s.headers)),new Ne(function(v,m){var w=function(){l.read().then(function(u){if(u.done)v(void 0);else{var p=f.decode(u.value,{stream:!0});i(p),w()}}).catch(function(u){m(u)})};w()})}).catch(function(s){if(s.name!=="AbortError")return s}).then(function(s){a(s)}),{abort:function(){l!=null&&l.cancel(),n.abort()}}};function le(){this._listeners=Object.create(null)}function Re(t){z(function(){throw t},0)}le.prototype.dispatchEvent=function(t){t.target=this;var o=this._listeners[t.type];if(o!=null)for(var i=o.length,a=0;a<i;a+=1){var h=o[a];try{typeof h.handleEvent=="function"?h.handleEvent(t):h.call(this,t)}catch(d){Re(d)}}},le.prototype.addEventListener=function(t,o){t=String(t);var i=this._listeners,a=i[t];a==null&&(a=[],i[t]=a);for(var h=!1,d=0;d<a.length;d+=1)a[d]===o&&(h=!0);h||a.push(o)},le.prototype.removeEventListener=function(t,o){t=String(t);var i=this._listeners,a=i[t];if(a!=null){for(var h=[],d=0;d<a.length;d+=1)a[d]!==o&&h.push(a[d]);h.length===0?delete i[t]:i[t]=h}};function re(t){this.type=t,this.target=void 0}function de(t,o){re.call(this,t),this.data=o.data,this.lastEventId=o.lastEventId}de.prototype=Object.create(re.prototype);function ce(t,o){re.call(this,t),this.status=o.status,this.statusText=o.statusText,this.headers=o.headers}ce.prototype=Object.create(re.prototype);function Te(t,o){re.call(this,t),this.error=o.error}Te.prototype=Object.create(re.prototype);var me=-1,G=0,$=1,ne=2,ye=-1,V=0,he=1,ue=2,Ce=3,be=/^text\/event\-stream(;.*)?$/i,De=1e3,_e=18e6,we=function(t,o){var i=t==null?o:parseInt(t,10);return i!==i&&(i=o),ve(i)},ve=function(t){return Math.min(Math.max(t,De),_e)},ae=function(t,o,i){try{typeof o=="function"&&o.call(t,i)}catch(a){Re(a)}};function L(t,o){le.call(this),o=o||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,Oe(this,t,o)}function Fe(){return j!=null&&"withCredentials"in j.prototype||K==null?new j:new K}var Ae=A!=null&&oe!=null&&"body"in oe.prototype;function Oe(t,o,i){o=String(o);var a=!!i.withCredentials,h=i.lastEventIdQueryParameterName||"lastEventId",d=ve(1e3),r=we(i.heartbeatTimeout,45e3),l="",n=d,c=!1,f=0,s=i.headers||{},v=i.Transport,m=Ae&&v==null?void 0:new B(v!=null?new v:Fe()),w=v!=null&&typeof v!="string"?new v:m==null?new Pe:new ke,u=void 0,p=0,x=me,I="",b="",g="",S="",_=V,J=0,H=0,Q=function(E,k,D,F){if(x===G)if(E===200&&D!=null&&be.test(D)){x=$,c=Date.now(),n=d,t.readyState=$;var T=new ce("open",{status:E,statusText:k,headers:F});t.dispatchEvent(T),ae(t,t.onopen,T)}else{var P="";E!==200?(k&&(k=k.replace(/\s+/g," ")),P="EventSource's response has a status "+E+" "+k+" that is not 200. Aborting the connection."):P="EventSource's response has a Content-Type specifying an unsupported type: "+(D==null?"-":D.replace(/\s+/g," "))+". Aborting the connection.",Be();var T=new ce("error",{status:E,statusText:k,headers:F});t.dispatchEvent(T),ae(t,t.onerror,T),console.error(P)}},pe=function(E){if(x===$){for(var k=-1,D=0;D<E.length;D+=1){var F=E.charCodeAt(D);(F===10||F===13)&&(k=D)}var T=(k!==-1?S:"")+E.slice(0,k+1);S=(k===-1?S:"")+E.slice(k+1),E!==""&&(c=Date.now(),f+=E.length);for(var P=0;P<T.length;P+=1){var F=T.charCodeAt(P);if(_===ye&&F===10)_=V;else if(_===ye&&(_=V),F===13||F===10){if(_!==V){_===he&&(H=P+1);var Y=T.slice(J,H-1),Z=T.slice(H+(H<P&&T.charCodeAt(H)===32?1:0),P);Y==="data"?(I+=`
7
+ `,I+=Z):Y==="id"?b=Z:Y==="event"?g=Z:Y==="retry"?(d=we(Z,d),n=d):Y==="heartbeatTimeout"&&(r=we(Z,r),p!==0&&(te(p),p=z(function(){je()},r)))}if(_===V){if(I!==""){l=b,g===""&&(g="message");var ge=new de(g,{data:I.slice(1),lastEventId:b});if(t.dispatchEvent(ge),g==="open"?ae(t,t.onopen,ge):g==="message"?ae(t,t.onmessage,ge):g==="error"&&ae(t,t.onerror,ge),x===ne)return}I="",g=""}_=F===13?ye:V}else _===V&&(J=P,_=he),_===he?F===58&&(H=P+1,_=ue):_===ue&&(_=Ce)}}},xe=function(E){if(x===$||x===G){x=me,p!==0&&(te(p),p=0),p=z(function(){je()},n),n=ve(Math.min(d*16,n*2)),t.readyState=G;var k=new Te("error",{error:E});t.dispatchEvent(k),ae(t,t.onerror,k),E!=null&&console.error(E)}},Be=function(){x=ne,u!=null&&(u.abort(),u=void 0),p!==0&&(te(p),p=0),t.readyState=ne},je=function(){if(p=0,x!==me){if(!c&&u!=null)xe(new Error("No activity within "+r+" milliseconds. "+(x===G?"No response received.":f+" chars received.")+" Reconnecting.")),u!=null&&(u.abort(),u=void 0);else{var E=Math.max((c||Date.now())+r-Date.now(),1);c=!1,p=z(function(){je()},E)}return}c=!1,f=0,p=z(function(){je()},r),x=G,I="",g="",b=l,S="",J=0,H=0,_=V;var k=o;if(o.slice(0,5)!=="data:"&&o.slice(0,5)!=="blob:"&&l!==""){var D=o.indexOf("?");k=D===-1?o:o.slice(0,D+1)+o.slice(D+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(Z,ge){return ge===h?"":Z}),k+=(o.indexOf("?")===-1?"?":"&")+h+"="+encodeURIComponent(l)}var F=t.withCredentials,T={};T.Accept="text/event-stream";var P=t.headers;if(P!=null)for(var Y in P)Object.prototype.hasOwnProperty.call(P,Y)&&(T[Y]=P[Y]);try{u=w.open(m,Q,pe,xe,k,F,T)}catch(Z){throw Be(),Z}};t.url=o,t.readyState=G,t.withCredentials=a,t.headers=s,t._close=Be,je()}L.prototype=Object.create(le.prototype),L.prototype.CONNECTING=G,L.prototype.OPEN=$,L.prototype.CLOSED=ne,L.prototype.close=function(){this._close()},L.CONNECTING=G,L.OPEN=$,L.CLOSED=ne,L.prototype.withCredentials=void 0;var Le=X;j!=null&&(X==null||!("withCredentials"in X.prototype))&&(Le=L),function(t){{var o=t(M);o!==void 0&&(ee.exports=o)}}(function(t){t.EventSourcePolyfill=L,t.NativeEventSource=X,t.EventSource=Le})})(typeof globalThis=="undefined"?typeof window!="undefined"?window:typeof self!="undefined"?self:e.commonjsGlobal:globalThis)})(Ie,Ie.exports);var Xe=Ie.exports,qe=e.from_html('<span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span>',1),We=e.from_html('<p class="svelte-75jgrh"> </p>'),Ge=e.from_html('<div class="PlayerRankWrapper svelte-75jgrh"><div class="PlayerRankLabels svelte-75jgrh"><span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span></div> <div class="PlayerRankData svelte-75jgrh"><!></div></div>'),$e=e.from_html('<div class="PlayerRankSkeletonWrapper svelte-75jgrh"><div class="PlayerRankSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PlayerRankSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div></div>'),Ve=e.from_html('<tr class="SkeletonRow svelte-75jgrh"><td colspan="4" class="SkeletonShimmer svelte-75jgrh"><div class="svelte-75jgrh"></div></td></tr>'),Je=e.from_html('<tr><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td></tr>'),Ke=e.from_html('<tr class="svelte-75jgrh"><td colspan="4" class="svelte-75jgrh"><div class="EmptyLeaderboard svelte-75jgrh"><p class="svelte-75jgrh"> </p></div></td></tr>'),Qe=e.from_html('<span class="PaginationButton Elipsis svelte-75jgrh">...</span>'),Ye=e.from_html("<button> </button>"),Ze=e.from_html('<div class="PaginationWrapper svelte-75jgrh"><button class="PaginationButton svelte-75jgrh"> </button> <div class="PageNumberWrapper svelte-75jgrh"></div> <button class="PaginationButton svelte-75jgrh"> </button></div>'),et=e.from_html('<div class="PaginationSkeleton svelte-75jgrh"><div class="PaginationSkeletonButton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationSkeletonButton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div></div>'),tt=e.from_html('<div class="LeaderboardWrapper svelte-75jgrh"><!> <table class="LeaderboardTable svelte-75jgrh"><thead class="LeaderboardTableHeader svelte-75jgrh"><tr class="svelte-75jgrh"><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th></tr></thead><tbody class="LeaderboardTableBody svelte-75jgrh"><!></tbody></table> <!> <!></div>');const rt={hash:"svelte-75jgrh",code:`.svelte-75jgrh,
8
+ .svelte-75jgrh::before,
9
+ .svelte-75jgrh::after {margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit;}.LeaderboardWrapper.svelte-75jgrh {background-color:var(--emw-color-bg-secondary, #333232);border-radius:6px;padding:16px;overflow:hidden;}.PlayerRankWrapper.svelte-75jgrh {display:flex;flex-direction:column;gap:5px;margin-top:20px;.PlayerRankLabels:where(.svelte-75jgrh), .PlayerRankData:where(.svelte-75jgrh) {display:grid;grid-template-columns:1fr 1fr 2fr;padding:6px;color:var(--emw-color-typography-secondary, #bdbdbd);font-size:14px;font-weight:400;& > span:where(.svelte-75jgrh):last-child{justify-self:end;}p:where(.svelte-75jgrh) {width:max-content;}}.PlayerRankData:where(.svelte-75jgrh) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography, #ffffff);border-radius:6px;padding:12px;}}.PaginationWrapper.svelte-75jgrh {display:flex;justify-content:space-between;.PageNumberWrapper:where(.svelte-75jgrh) {display:flex;gap:6px;}.PaginationButton:where(.svelte-75jgrh) {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;}}}.LeaderboardTable.svelte-75jgrh {border-collapse:separate;border-spacing:0 12px;width:100%;table-layout:fixed;overflow:hidden;.PlayerRow:where(.svelte-75jgrh) {color:#F9C408;}thead:where(.svelte-75jgrh) th:where(.svelte-75jgrh) {background:transparent;padding:6px 16px;text-align:center;font-weight:400;color:var(--emw-color-typography-secondary, #bdbdbd);font-size:14px;}tbody:where(.svelte-75jgrh) tr:where(.svelte-75jgrh) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography-secondary, #bdbdbd);font-size:14px;font-weight:500;&:last-child{justify-self:end;}}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh) {padding:12px;background-color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):first-child {border-top-left-radius:8px;border-bottom-left-radius:8px;width:15%;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):nth-child(2) {width:35%;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):nth-child(3) {width:20%;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):last-child {border-top-right-radius:8px;border-bottom-right-radius:8px;width:30%;}th:where(.svelte-75jgrh), td:where(.svelte-75jgrh) {text-align:center;vertical-align:middle;}tbody:where(.svelte-75jgrh) tr.Gold:where(.svelte-75jgrh){background:linear-gradient(to right, #a2851a, color-mix(in srgb, #a2851a 50%, var(--emw-color-bg-secondary, #434343) 50%), var(--emw-color-bg-secondary, #434343));}tbody:where(.svelte-75jgrh) tr.Silver:where(.svelte-75jgrh) {background:linear-gradient(to right, #b0aeae, color-mix(in srgb, #b0aeae, var(--emw-color-bg-secondary, #434343)), var(--emw-color-bg-secondary, #434343));}tbody:where(.svelte-75jgrh) tr.Bronze:where(.svelte-75jgrh) {background:linear-gradient(to right, #ac763c, color-mix(in srgb, #ac763c, var(--emw-color-bg-secondary, #434343)), var(--emw-color-bg-secondary, #434343));}}.EmptyLeaderboard.svelte-75jgrh {background-color:var(--emw-color-bg-secondary, #333232);color:var(--emw-color-typography-secondary, #bdbdbd);width:100%;border-radius:8px;margin:10px 0;text-align:center;padding:10px 0;}.SkeletonRow.svelte-75jgrh {height:41px;overflow:hidden;}.PlayerRankSkeletonWrapper.svelte-75jgrh {display:flex;justify-content:space-between;width:100%;gap:6px;flex-direction:column;.PlayerRankSkeleton:where(.svelte-75jgrh) {width:100%;height:40px;border-radius:6px;background-color:var(--emw-color-bg-secondary, #333232);border-radius:6px;}}.PaginationSkeleton.svelte-75jgrh {display:flex;justify-content:space-between;gap:6px;.PaginationSkeletonButton:where(.svelte-75jgrh) {width:80px;height:40px;border-radius:6px;background-color:var(--emw-color-skeleton, #333232);overflow:hidden;position:relative;}.PaginationNumberSkeleton:where(.svelte-75jgrh) {width:40px;height:40px;border-radius:6px;background-color:var(--emw-color-skeleton, #333232);overflow:hidden;position:relative;}}.SkeletonShimmer.svelte-75jgrh {width:100%;height:100%;background:linear-gradient(
10
+ 90deg,
11
+ transparent 0%,
12
+ var(--emw-color-skeleton, #333232) 50%,
13
+ transparent 100%
14
+ );
15
+ animation: svelte-75jgrh-loading 1.5s infinite;transform:translateX(-100%);}
16
+
17
+ @keyframes svelte-75jgrh-loading {
18
+ 0% {
19
+ transform: translateX(-100%);
20
+ }
21
+ 100% {
22
+ transform: translateX(100%);
23
+ }
24
+ }
25
+
26
+ @media (min-width: 1000px) {.ShowPlayersButton.svelte-75jgrh {display:block;width:300px;margin:auto;background-color:var(--emw-color-bg-primary, #212121);}
27
+ }
28
+
29
+ @media (min-width: 750px) {.PaginationWrapper.svelte-75jgrh, .PaginationSkeleton.svelte-75jgrh {justify-content:end;gap:10px;}.PaginationButton.svelte-75jgrh {min-width:75px;}
30
+ }`};function Me(ee,M){e.push(M,!0),e.append_styles(ee,rt);const y=()=>e.store_get(e.$format,"$_",z),[z,te]=e.setup_stores(),j=e.prop(M,"endpoint"),K=e.prop(M,"language",7,"en"),U=e.prop(M,"session"),X=e.prop(M,"tournamentid"),C=e.prop(M,"platform");Object.keys(He).forEach(r=>{ze(r,He[r])});const Ne=()=>{Ue(K())};e.user_effect(()=>{Ne()});let A=null,oe=e.state(void 0),q=e.state(!1),fe=e.state(!1),W=e.state(void 0),O=e.state(0),N=e.state(10),se=e.state(void 0),R=e.state(void 0);const B=()=>{if(ce.has(e.get(de)))return;e.set(q,!0);const r=new URL(`${j()}/v1/tournaments/${X()}/leaderboard`),l=new Headers;U()&&l.append("X-SessionId",U()),r.searchParams.append("language",K()),r.searchParams.append("platform",C()),r.searchParams.append("pagination",`offset=${e.get(O)},limit=${e.get(N)}`),fetch(r).then(n=>n.json()).then(n=>{e.set(oe,n==null?void 0:n.items,!0),e.set(se,n==null?void 0:n.pages,!0),e.set(R,n==null?void 0:n.total,!0),ce.set(e.get(de),e.get(oe))}).catch(n=>console.log(n)).finally(()=>e.set(q,!1))},Se=r=>{const l=JSON.parse(r.data);l&&l.messageType==="LeaderBoardUpdate"&&e.set(oe,l==null?void 0:l.items,!0)},ie=()=>{A&&(A.close(),A=null);const r=new URL(`${j()}/v1/tournaments/${X()}/leaderboard/updates`);r.searchParams.append("HeartBeat","false"),r.searchParams.append("language",K()),r.searchParams.append("filter","includeUnqualifiedPlayer=true"),r.searchParams.append("pagination",`offset=${e.get(O)},limit=${e.get(N)}`),r.searchParams.append("platform",C()),A=new Xe.EventSourcePolyfill(r,{headers:{accept:"text/event-stream","X-SessionId":U()}}),A.onmessage=Se},ke=()=>{e.set(fe,!0);const r=new URL(`${j()}/v1/tournaments/leaderboard/player`),l=new Headers;r.searchParams.append("language",K()),r.searchParams.append("platform",C()),r.searchParams.append("filter","includeUnqualifiedPlayer=false"),U()&&l.append("X-SessionId",U()),fetch(r,{method:"GET",headers:l}).then(c=>c.json()).then(c=>{var s;const f=(s=c==null?void 0:c.items)==null?void 0:s.find(v=>{var m;return((m=v==null?void 0:v.tournament)==null?void 0:m.id)===X()});e.set(W,f==null?void 0:f.leaderBoard,!0)}).catch(c=>{console.log(c)}).finally(()=>e.set(fe,!1))},Ee=()=>{var r;(r=e.get(se))!=null&&r.next&&(e.set(O,e.get(O)+e.get(N)),B(),ie())},Pe=()=>{var r;(r=e.get(se))!=null&&r.previous&&e.get(O)!==0&&(e.set(O,e.get(O)-e.get(N)),B(),ie())},le=r=>{e.set(O,(r-1)*e.get(N)),B(),ie()},Re=()=>{const r=Math.ceil(e.get(R)/e.get(N)),l=Math.floor(e.get(O)/e.get(N))+1;if(r<=5)return Array.from({length:r},(c,f)=>f+1);const n=[];return n.push(1),l<=3?(n.push(2,3),n.push("..."),n.push(r)):l>=r-2?(n.push("..."),n.push(r-2,r-1,r)):(n.push("..."),n.push(l-1,l,l+1),n.push("..."),n.push(r)),n},re=e.user_derived(Re),de=e.user_derived(()=>Math.floor(e.get(O)/e.get(N))+1);let ce=new Map,Te=e.user_derived(()=>{var r;return(r=ce.get(e.get(de)))!=null?r:[]});const me=(r,l)=>{const n=[];return l&&n.push("PlayerRow"),r===1&&n.push("Gold"),r===2&&n.push("Silver"),r===3&&n.push("Bronze"),n.join(" ")};e.onMount(()=>(B(),ke(),ie(),()=>{A==null||A.close(),A=null}));var G={get endpoint(){return j()},set endpoint(r){j(r),e.flushSync()},get language(){return K()},set language(r="en"){K(r),e.flushSync()},get session(){return U()},set session(r){U(r),e.flushSync()},get tournamentid(){return X()},set tournamentid(r){X(r),e.flushSync()},get platform(){return C()},set platform(r){C(r),e.flushSync()}},$=tt(),ne=e.child($);{var ye=r=>{var l=Ge(),n=e.child(l),c=e.child(n),f=e.child(c,!0);e.reset(c);var s=e.sibling(c,2),v=e.child(s,!0);e.reset(s);var m=e.sibling(s,2),w=e.child(m,!0);e.reset(m),e.reset(n);var u=e.sibling(n,2),p=e.child(u);{var x=b=>{var g=qe(),S=e.first_child(g),_=e.child(S);e.reset(S);var J=e.sibling(S,2),H=e.child(J,!0);e.reset(J);var Q=e.sibling(J,2),pe=e.child(Q,!0);e.reset(Q),e.template_effect(()=>{var xe;e.set_text(_,`${(xe=e.get(W).rank)!=null?xe:""}.`),e.set_text(H,e.get(W).score),e.set_text(pe,e.get(W).prizeName||"-")}),e.append(b,g)},I=b=>{var g=We(),S=e.child(g,!0);e.reset(g),e.template_effect(_=>e.set_text(S,_),[()=>y()("notEnrolledRank")]),e.append(b,g)};e.if_block(p,b=>{e.get(W)?b(x):b(I,!1)})}e.reset(u),e.reset(l),e.template_effect((b,g,S)=>{e.set_text(f,b),e.set_text(v,g),e.set_text(w,S)},[()=>y()("myRanking"),()=>y()("points"),()=>y()("prize")]),e.append(r,l)},V=r=>{var l=$e();e.append(r,l)};e.if_block(ne,r=>{e.get(fe)?r(V,!1):r(ye)})}var he=e.sibling(ne,2),ue=e.child(he),Ce=e.child(ue),be=e.child(Ce),De=e.child(be,!0);e.reset(be);var _e=e.sibling(be),we=e.child(_e,!0);e.reset(_e);var ve=e.sibling(_e),ae=e.child(ve,!0);e.reset(ve);var L=e.sibling(ve),Fe=e.child(L,!0);e.reset(L),e.reset(Ce),e.reset(ue);var Ae=e.sibling(ue),Oe=e.child(Ae);{var Le=r=>{var l=e.comment(),n=e.first_child(l);e.each(n,17,()=>Array(e.get(N)),e.index,(c,f,s,v)=>{var m=Ve();e.append(c,m)}),e.append(r,l)},t=r=>{var l=e.comment(),n=e.first_child(l);{var c=s=>{var v=e.comment(),m=e.first_child(v);e.each(m,17,()=>e.get(Te),w=>w.rank,(w,u)=>{var p=Je(),x=e.child(p),I=e.child(x);e.reset(x);var b=e.sibling(x),g=e.child(b,!0);e.reset(b);var S=e.sibling(b),_=e.child(S,!0);e.reset(S);var J=e.sibling(S),H=e.child(J,!0);e.reset(J),e.reset(p),e.template_effect(Q=>{var pe;e.set_class(p,1,Q,"svelte-75jgrh"),e.set_text(I,`${(pe=e.get(u).rank)!=null?pe:""}.`),e.set_text(g,e.get(u).shortName||"-"),e.set_text(_,e.get(u).score||"-"),e.set_text(H,e.get(u).prizeName||"-")},[()=>{var Q;return e.clsx(me(e.get(u).rank,e.get(u).rank===((Q=e.get(W))==null?void 0:Q.rank)))}]),e.append(w,p)}),e.append(s,v)},f=s=>{var v=Ke(),m=e.child(v),w=e.child(m),u=e.child(w),p=e.child(u,!0);e.reset(u),e.reset(w),e.reset(m),e.reset(v),e.template_effect(x=>e.set_text(p,x),[()=>y()("emptyLeaderboard")]),e.append(s,v)};e.if_block(n,s=>{var v;((v=e.get(oe))==null?void 0:v.length)>0?s(c):s(f,!1)},!0)}e.append(r,l)};e.if_block(Oe,r=>{e.get(q)?r(Le):r(t,!1)})}e.reset(Ae),e.reset(he);var o=e.sibling(he,2);{var i=r=>{var l=Ze(),n=e.child(l);n.__click=Pe;var c=e.child(n,!0);e.reset(n);var f=e.sibling(n,2);e.each(f,21,()=>e.get(re),e.index,(m,w)=>{var u=e.comment(),p=e.first_child(u);{var x=b=>{var g=Qe();e.append(b,g)},I=b=>{var g=Ye();let S;g.__click=()=>le(e.get(w));var _=e.child(g,!0);e.reset(g),e.template_effect(()=>{S=e.set_class(g,1,"PaginationButton Number svelte-75jgrh",null,S,{Active:e.get(w)===e.get(de)}),e.set_text(_,e.get(w))}),e.append(b,g)};e.if_block(p,b=>{typeof e.get(w)!="number"?b(x):b(I,!1)})}e.append(m,u)}),e.reset(f);var s=e.sibling(f,2);s.__click=Ee;var v=e.child(s,!0);e.reset(s),e.reset(l),e.template_effect((m,w)=>{var u,p;n.disabled=!((u=e.get(se))!=null&&u.previous),e.set_text(c,m),s.disabled=!((p=e.get(se))!=null&&p.next),e.set_text(v,w)},[()=>y()("previousButton"),()=>y()("nextButton")]),e.append(r,l)};e.if_block(o,r=>{!e.get(q)&&e.get(R)>e.get(N)&&r(i)})}var a=e.sibling(o,2);{var h=r=>{var l=et();e.append(r,l)};e.if_block(a,r=>{e.get(q)&&r(h)})}e.reset($),e.template_effect((r,l,n,c)=>{e.set_text(De,r),e.set_text(we,l),e.set_text(ae,n),e.set_text(Fe,c)},[()=>y()("rank"),()=>y()("user"),()=>y()("points"),()=>y()("prize")]),e.append(ee,$);var d=e.pop(G);return te(),d}e.delegate(["click"]);customElements.define("tournament-leaderboard",e.create_custom_element(Me,{endpoint:{},language:{},session:{},tournamentid:{},platform:{}},[],[],!1));exports.default=Me;