@everymatrix/tournament-details-page 0.1.0 → 0.1.2

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.
@@ -0,0 +1,832 @@
1
+ import { a as it, $ as lt, c as dt, b as ct, p as Se, u as vt, d as tt, o as ut, i as be, t as ve, e as D, f as ht, s as ft, g as J, h as Pe, j as pt, k as O, l as A, m as gt, n as yt, q as V, r as s, v as f, w as mt, x as bt, y as ue, z as Ye, A as u, B as Ue, C as ke, D as Ze, E as rt, F as wt, G as at, H as _t } from "./TournamentDetailsPage-BL5YSX6c.js";
2
+ function nt(he, K) {
3
+ it(he, K);
4
+ }
5
+ function ot(he) {
6
+ lt.set(he);
7
+ }
8
+ const st = {
9
+ en: {
10
+ rank: "Rank",
11
+ user: "User",
12
+ points: "Points",
13
+ prize: "Prize",
14
+ notEnrolledRank: "You are currently not enrolled in this tournament",
15
+ myRanking: "My Ranking",
16
+ showMore: "Show More",
17
+ showLess: "Show Less",
18
+ emptyLeaderboard: "Currently there are no players enrolled in this tournament",
19
+ joinButton: "Join",
20
+ previousButton: "Previous",
21
+ nextButton: "Next"
22
+ },
23
+ tr: {
24
+ rank: "Sıralama",
25
+ user: "Kullanıcı",
26
+ points: "Puan",
27
+ prize: "Ödül",
28
+ notEnrolledRank: "Şu anda bu turnuvaya kayıtlı değilsiniz",
29
+ myRanking: "Sıralamam",
30
+ showMore: "Daha Fazla Göster",
31
+ showLess: "Daha Az Göster",
32
+ emptyLeaderboard: "Şu anda bu turnuvaya kayıtlı oyuncu bulunmuyor",
33
+ joinButton: "Katıl",
34
+ previousButton: "Önceki",
35
+ nextButton: "Sonraki"
36
+ }
37
+ };
38
+ var et = { exports: {} };
39
+ /** @license
40
+ * eventsource.js
41
+ * Available under MIT License (MIT)
42
+ * https://github.com/Yaffle/EventSource/
43
+ */
44
+ (function(he, K) {
45
+ (function(_) {
46
+ var Q = _.setTimeout, fe = _.clearTimeout, R = _.XMLHttpRequest, Y = _.XDomainRequest, Z = _.ActiveXObject, ee = _.EventSource, z = _.document, Re = _.Promise, ie = _.fetch, ze = _.Response, Te = _.TextDecoder, te = _.TextEncoder, pe = _.AbortController;
47
+ if (typeof window < "u" && typeof z < "u" && !("readyState" in z) && z.body == null && (z.readyState = "loading", window.addEventListener("load", function(t) {
48
+ z.readyState = "complete";
49
+ }, !1)), R == null && Z != null && (R = function() {
50
+ return new Z("Microsoft.XMLHTTP");
51
+ }), Object.create == null && (Object.create = function(t) {
52
+ function a() {
53
+ }
54
+ return a.prototype = t, new a();
55
+ }), Date.now || (Date.now = function() {
56
+ return (/* @__PURE__ */ new Date()).getTime();
57
+ }), pe == null) {
58
+ var Ne = ie;
59
+ ie = function(t, a) {
60
+ var o = a.signal;
61
+ return Ne(t, { headers: a.headers, credentials: a.credentials, cache: a.cache }).then(function(r) {
62
+ var d = r.body.getReader();
63
+ return o._reader = d, o._aborted && o._reader.cancel(), {
64
+ status: r.status,
65
+ statusText: r.statusText,
66
+ headers: r.headers,
67
+ body: {
68
+ getReader: function() {
69
+ return d;
70
+ }
71
+ }
72
+ };
73
+ });
74
+ }, pe = function() {
75
+ this.signal = {
76
+ _reader: null,
77
+ _aborted: !1
78
+ }, this.abort = function() {
79
+ this.signal._reader != null && this.signal._reader.cancel(), this.signal._aborted = !0;
80
+ };
81
+ };
82
+ }
83
+ function Ce() {
84
+ this.bitsNeeded = 0, this.codePoint = 0;
85
+ }
86
+ Ce.prototype.decode = function(t) {
87
+ function a(p, y, e) {
88
+ if (e === 1)
89
+ return p >= 128 >> y && p << y <= 2047;
90
+ if (e === 2)
91
+ return p >= 2048 >> y && p << y <= 55295 || p >= 57344 >> y && p << y <= 65535;
92
+ if (e === 3)
93
+ return p >= 65536 >> y && p << y <= 1114111;
94
+ throw new Error();
95
+ }
96
+ function o(p, y) {
97
+ if (p === 6 * 1)
98
+ return y >> 6 > 15 ? 3 : y > 31 ? 2 : 1;
99
+ if (p === 6 * 2)
100
+ return y > 15 ? 3 : 2;
101
+ if (p === 6 * 3)
102
+ return 3;
103
+ throw new Error();
104
+ }
105
+ for (var r = 65533, d = "", l = this.bitsNeeded, c = this.codePoint, j = 0; j < t.length; j += 1) {
106
+ var v = t[j];
107
+ l !== 0 && (v < 128 || v > 191 || !a(c << 6 | v & 63, l - 6, o(l, c))) && (l = 0, c = r, d += String.fromCharCode(c)), l === 0 ? (v >= 0 && v <= 127 ? (l = 0, c = v) : v >= 192 && v <= 223 ? (l = 6 * 1, c = v & 31) : v >= 224 && v <= 239 ? (l = 6 * 2, c = v & 15) : v >= 240 && v <= 247 ? (l = 6 * 3, c = v & 7) : (l = 0, c = r), l !== 0 && !a(c, l, o(l, c)) && (l = 0, c = r)) : (l -= 6, c = c << 6 | v & 63), l === 0 && (c <= 65535 ? d += String.fromCharCode(c) : (d += String.fromCharCode(55296 + (c - 65535 - 1 >> 10)), d += String.fromCharCode(56320 + (c - 65535 - 1 & 1023))));
108
+ }
109
+ return this.bitsNeeded = l, this.codePoint = c, d;
110
+ };
111
+ var ge = function() {
112
+ try {
113
+ return new Te().decode(new te().encode("test"), { stream: !0 }) === "test";
114
+ } catch (t) {
115
+ console.debug("TextDecoder does not support streaming option. Using polyfill instead: " + t);
116
+ }
117
+ return !1;
118
+ };
119
+ (Te == null || te == null || !ge()) && (Te = Ce);
120
+ var I = function() {
121
+ };
122
+ function k(t) {
123
+ this.withCredentials = !1, this.readyState = 0, this.status = 0, this.statusText = "", this.responseText = "", this.onprogress = I, this.onload = I, this.onerror = I, this.onreadystatechange = I, this._contentType = "", this._xhr = t, this._sendTimeout = 0, this._abort = I;
124
+ }
125
+ k.prototype.open = function(t, a) {
126
+ this._abort(!0);
127
+ var o = this, r = this._xhr, d = 1, l = 0;
128
+ this._abort = function(e) {
129
+ o._sendTimeout !== 0 && (fe(o._sendTimeout), o._sendTimeout = 0), (d === 1 || d === 2 || d === 3) && (d = 4, r.onload = I, r.onerror = I, r.onabort = I, r.onprogress = I, r.onreadystatechange = I, r.abort(), l !== 0 && (fe(l), l = 0), e || (o.readyState = 4, o.onabort(null), o.onreadystatechange())), d = 0;
130
+ };
131
+ var c = function() {
132
+ if (d === 1) {
133
+ var e = 0, n = "", i = void 0;
134
+ if ("contentType" in r)
135
+ e = 200, n = "OK", i = r.contentType;
136
+ else
137
+ try {
138
+ e = r.status, n = r.statusText, i = r.getResponseHeader("Content-Type");
139
+ } catch {
140
+ e = 0, n = "", i = void 0;
141
+ }
142
+ e !== 0 && (d = 2, o.readyState = 2, o.status = e, o.statusText = n, o._contentType = i, o.onreadystatechange());
143
+ }
144
+ }, j = function() {
145
+ if (c(), d === 2 || d === 3) {
146
+ d = 3;
147
+ var e = "";
148
+ try {
149
+ e = r.responseText;
150
+ } catch {
151
+ }
152
+ o.readyState = 3, o.responseText = e, o.onprogress();
153
+ }
154
+ }, v = function(e, n) {
155
+ if ((n == null || n.preventDefault == null) && (n = {
156
+ preventDefault: I
157
+ }), j(), d === 1 || d === 2 || d === 3) {
158
+ if (d = 4, l !== 0 && (fe(l), l = 0), o.readyState = 4, e === "load")
159
+ o.onload(n);
160
+ else if (e === "error")
161
+ o.onerror(n);
162
+ else if (e === "abort")
163
+ o.onabort(n);
164
+ else
165
+ throw new TypeError();
166
+ o.onreadystatechange();
167
+ }
168
+ }, p = function(e) {
169
+ r != null && (r.readyState === 4 ? (!("onload" in r) || !("onerror" in r) || !("onabort" in r)) && v(r.responseText === "" ? "error" : "load", e) : r.readyState === 3 ? "onprogress" in r || j() : r.readyState === 2 && c());
170
+ }, y = function() {
171
+ l = Q(function() {
172
+ y();
173
+ }, 500), r.readyState === 3 && j();
174
+ };
175
+ "onload" in r && (r.onload = function(e) {
176
+ v("load", e);
177
+ }), "onerror" in r && (r.onerror = function(e) {
178
+ v("error", e);
179
+ }), "onabort" in r && (r.onabort = function(e) {
180
+ v("abort", e);
181
+ }), "onprogress" in r && (r.onprogress = j), "onreadystatechange" in r && (r.onreadystatechange = function(e) {
182
+ p(e);
183
+ }), ("contentType" in r || !("ontimeout" in R.prototype)) && (a += (a.indexOf("?") === -1 ? "?" : "&") + "padding=true"), r.open(t, a, !0), "readyState" in r && (l = Q(function() {
184
+ y();
185
+ }, 0));
186
+ }, k.prototype.abort = function() {
187
+ this._abort(!1);
188
+ }, k.prototype.getResponseHeader = function(t) {
189
+ return this._contentType;
190
+ }, k.prototype.setRequestHeader = function(t, a) {
191
+ var o = this._xhr;
192
+ "setRequestHeader" in o && o.setRequestHeader(t, a);
193
+ }, k.prototype.getAllResponseHeaders = function() {
194
+ return this._xhr.getAllResponseHeaders != null && this._xhr.getAllResponseHeaders() || "";
195
+ }, k.prototype.send = function() {
196
+ if ((!("ontimeout" in R.prototype) || !("sendAsBinary" in R.prototype) && !("mozAnon" in R.prototype)) && z != null && z.readyState != null && z.readyState !== "complete") {
197
+ var t = this;
198
+ t._sendTimeout = Q(function() {
199
+ t._sendTimeout = 0, t.send();
200
+ }, 4);
201
+ return;
202
+ }
203
+ var a = this._xhr;
204
+ "withCredentials" in a && (a.withCredentials = this.withCredentials);
205
+ try {
206
+ a.send(void 0);
207
+ } catch (o) {
208
+ throw o;
209
+ }
210
+ };
211
+ function q(t) {
212
+ return t.replace(/[A-Z]/g, function(a) {
213
+ return String.fromCharCode(a.charCodeAt(0) + 32);
214
+ });
215
+ }
216
+ function we(t) {
217
+ for (var a = /* @__PURE__ */ Object.create(null), o = t.split(`\r
218
+ `), r = 0; r < o.length; r += 1) {
219
+ var d = o[r], l = d.split(": "), c = l.shift(), j = l.join(": ");
220
+ a[q(c)] = j;
221
+ }
222
+ this._map = a;
223
+ }
224
+ we.prototype.get = function(t) {
225
+ return this._map[q(t)];
226
+ }, R != null && R.HEADERS_RECEIVED == null && (R.HEADERS_RECEIVED = 2);
227
+ function ye() {
228
+ }
229
+ ye.prototype.open = function(t, a, o, r, d, l, c) {
230
+ t.open("GET", d);
231
+ var j = 0;
232
+ t.onprogress = function() {
233
+ var p = t.responseText, y = p.slice(j);
234
+ j += y.length, o(y);
235
+ }, t.onerror = function(p) {
236
+ p.preventDefault(), r(new Error("NetworkError"));
237
+ }, t.onload = function() {
238
+ r(null);
239
+ }, t.onabort = function() {
240
+ r(null);
241
+ }, t.onreadystatechange = function() {
242
+ if (t.readyState === R.HEADERS_RECEIVED) {
243
+ var p = t.status, y = t.statusText, e = t.getResponseHeader("Content-Type"), n = t.getAllResponseHeaders();
244
+ a(p, y, e, new we(n));
245
+ }
246
+ }, t.withCredentials = l;
247
+ for (var v in c)
248
+ Object.prototype.hasOwnProperty.call(c, v) && t.setRequestHeader(v, c[v]);
249
+ return t.send(), t;
250
+ };
251
+ function _e(t) {
252
+ this._headers = t;
253
+ }
254
+ _e.prototype.get = function(t) {
255
+ return this._headers.get(t);
256
+ };
257
+ function qe() {
258
+ }
259
+ qe.prototype.open = function(t, a, o, r, d, l, c) {
260
+ var j = null, v = new pe(), p = v.signal, y = new Te();
261
+ return ie(d, {
262
+ headers: c,
263
+ credentials: l ? "include" : "same-origin",
264
+ signal: p,
265
+ cache: "no-store"
266
+ }).then(function(e) {
267
+ return j = e.body.getReader(), a(e.status, e.statusText, e.headers.get("Content-Type"), new _e(e.headers)), new Re(function(n, i) {
268
+ var S = function() {
269
+ j.read().then(function(m) {
270
+ if (m.done)
271
+ n(void 0);
272
+ else {
273
+ var h = y.decode(m.value, { stream: !0 });
274
+ o(h), S();
275
+ }
276
+ }).catch(function(m) {
277
+ i(m);
278
+ });
279
+ };
280
+ S();
281
+ });
282
+ }).catch(function(e) {
283
+ if (e.name !== "AbortError")
284
+ return e;
285
+ }).then(function(e) {
286
+ r(e);
287
+ }), {
288
+ abort: function() {
289
+ j?.cancel(), v.abort();
290
+ }
291
+ };
292
+ };
293
+ function re() {
294
+ this._listeners = /* @__PURE__ */ Object.create(null);
295
+ }
296
+ function Fe(t) {
297
+ Q(function() {
298
+ throw t;
299
+ }, 0);
300
+ }
301
+ re.prototype.dispatchEvent = function(t) {
302
+ t.target = this;
303
+ var a = this._listeners[t.type];
304
+ if (a != null)
305
+ for (var o = a.length, r = 0; r < o; r += 1) {
306
+ var d = a[r];
307
+ try {
308
+ typeof d.handleEvent == "function" ? d.handleEvent(t) : d.call(this, t);
309
+ } catch (l) {
310
+ Fe(l);
311
+ }
312
+ }
313
+ }, re.prototype.addEventListener = function(t, a) {
314
+ t = String(t);
315
+ var o = this._listeners, r = o[t];
316
+ r == null && (r = [], o[t] = r);
317
+ for (var d = !1, l = 0; l < r.length; l += 1)
318
+ r[l] === a && (d = !0);
319
+ d || r.push(a);
320
+ }, re.prototype.removeEventListener = function(t, a) {
321
+ t = String(t);
322
+ var o = this._listeners, r = o[t];
323
+ if (r != null) {
324
+ for (var d = [], l = 0; l < r.length; l += 1)
325
+ r[l] !== a && d.push(r[l]);
326
+ d.length === 0 ? delete o[t] : o[t] = d;
327
+ }
328
+ };
329
+ function me(t) {
330
+ this.type = t, this.target = void 0;
331
+ }
332
+ function We(t, a) {
333
+ me.call(this, t), this.data = a.data, this.lastEventId = a.lastEventId;
334
+ }
335
+ We.prototype = Object.create(me.prototype);
336
+ function Oe(t, a) {
337
+ me.call(this, t), this.status = a.status, this.statusText = a.statusText, this.headers = a.headers;
338
+ }
339
+ Oe.prototype = Object.create(me.prototype);
340
+ function Je(t, a) {
341
+ me.call(this, t), this.error = a.error;
342
+ }
343
+ Je.prototype = Object.create(me.prototype);
344
+ var Be = -1, W = 0, ae = 1, je = 2, He = -1, ne = 0, xe = 1, Ae = 2, Xe = 3, Ke = /^text\/event\-stream(;.*)?$/i, $e = 1e3, Ge = 18e6, Ee = function(t, a) {
345
+ var o = t == null ? a : parseInt(t, 10);
346
+ return o !== o && (o = a), Le(o);
347
+ }, Le = function(t) {
348
+ return Math.min(Math.max(t, $e), Ge);
349
+ }, oe = function(t, a, o) {
350
+ try {
351
+ typeof a == "function" && a.call(t, o);
352
+ } catch (r) {
353
+ Fe(r);
354
+ }
355
+ };
356
+ function X(t, a) {
357
+ re.call(this), a = a || {}, 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, Me(this, t, a);
358
+ }
359
+ function Ie() {
360
+ return R != null && "withCredentials" in R.prototype || Y == null ? new R() : new Y();
361
+ }
362
+ var Qe = ie != null && ze != null && "body" in ze.prototype;
363
+ function Me(t, a, o) {
364
+ a = String(a);
365
+ var r = !!o.withCredentials, d = o.lastEventIdQueryParameterName || "lastEventId", l = Le(1e3), c = Ee(o.heartbeatTimeout, 45e3), j = "", v = l, p = !1, y = 0, e = o.headers || {}, n = o.Transport, i = Qe && n == null ? void 0 : new k(n != null ? new n() : Ie()), S = n != null && typeof n != "string" ? new n() : i == null ? new qe() : new ye(), m = void 0, h = 0, P = Be, T = "", C = "", x = "", M = "", E = ne, le = 0, b = 0, L = function(g, w, N, G) {
366
+ if (P === W)
367
+ if (g === 200 && N != null && Ke.test(N)) {
368
+ P = ae, p = Date.now(), v = l, t.readyState = ae;
369
+ var U = new Oe("open", {
370
+ status: g,
371
+ statusText: w,
372
+ headers: G
373
+ });
374
+ t.dispatchEvent(U), oe(t, t.onopen, U);
375
+ } else {
376
+ var F = "";
377
+ g !== 200 ? (w && (w = w.replace(/\s+/g, " ")), F = "EventSource's response has a status " + g + " " + w + " that is not 200. Aborting the connection.") : F = "EventSource's response has a Content-Type specifying an unsupported type: " + (N == null ? "-" : N.replace(/\s+/g, " ")) + ". Aborting the connection.", $();
378
+ var U = new Oe("error", {
379
+ status: g,
380
+ statusText: w,
381
+ headers: G
382
+ });
383
+ t.dispatchEvent(U), oe(t, t.onerror, U), console.error(F);
384
+ }
385
+ }, B = function(g) {
386
+ if (P === ae) {
387
+ for (var w = -1, N = 0; N < g.length; N += 1) {
388
+ var G = g.charCodeAt(N);
389
+ (G === 10 || G === 13) && (w = N);
390
+ }
391
+ var U = (w !== -1 ? M : "") + g.slice(0, w + 1);
392
+ M = (w === -1 ? M : "") + g.slice(w + 1), g !== "" && (p = Date.now(), y += g.length);
393
+ for (var F = 0; F < U.length; F += 1) {
394
+ var G = U.charCodeAt(F);
395
+ if (E === He && G === 10)
396
+ E = ne;
397
+ else if (E === He && (E = ne), G === 13 || G === 10) {
398
+ if (E !== ne) {
399
+ E === xe && (b = F + 1);
400
+ var de = U.slice(le, b - 1), ce = U.slice(b + (b < F && U.charCodeAt(b) === 32 ? 1 : 0), F);
401
+ de === "data" ? (T += `
402
+ `, T += ce) : de === "id" ? C = ce : de === "event" ? x = ce : de === "retry" ? (l = Ee(ce, l), v = l) : de === "heartbeatTimeout" && (c = Ee(ce, c), h !== 0 && (fe(h), h = Q(function() {
403
+ H();
404
+ }, c)));
405
+ }
406
+ if (E === ne) {
407
+ if (T !== "") {
408
+ j = C, x === "" && (x = "message");
409
+ var De = new We(x, {
410
+ data: T.slice(1),
411
+ lastEventId: C
412
+ });
413
+ if (t.dispatchEvent(De), x === "open" ? oe(t, t.onopen, De) : x === "message" ? oe(t, t.onmessage, De) : x === "error" && oe(t, t.onerror, De), P === je)
414
+ return;
415
+ }
416
+ T = "", x = "";
417
+ }
418
+ E = G === 13 ? He : ne;
419
+ } else
420
+ E === ne && (le = F, E = xe), E === xe ? G === 58 && (b = F + 1, E = Ae) : E === Ae && (E = Xe);
421
+ }
422
+ }
423
+ }, se = function(g) {
424
+ if (P === ae || P === W) {
425
+ P = Be, h !== 0 && (fe(h), h = 0), h = Q(function() {
426
+ H();
427
+ }, v), v = Le(Math.min(l * 16, v * 2)), t.readyState = W;
428
+ var w = new Je("error", { error: g });
429
+ t.dispatchEvent(w), oe(t, t.onerror, w), g != null && console.error(g);
430
+ }
431
+ }, $ = function() {
432
+ P = je, m != null && (m.abort(), m = void 0), h !== 0 && (fe(h), h = 0), t.readyState = je;
433
+ }, H = function() {
434
+ if (h = 0, P !== Be) {
435
+ if (!p && m != null)
436
+ se(new Error("No activity within " + c + " milliseconds. " + (P === W ? "No response received." : y + " chars received.") + " Reconnecting.")), m != null && (m.abort(), m = void 0);
437
+ else {
438
+ var g = Math.max((p || Date.now()) + c - Date.now(), 1);
439
+ p = !1, h = Q(function() {
440
+ H();
441
+ }, g);
442
+ }
443
+ return;
444
+ }
445
+ p = !1, y = 0, h = Q(function() {
446
+ H();
447
+ }, c), P = W, T = "", x = "", C = j, M = "", le = 0, b = 0, E = ne;
448
+ var w = a;
449
+ if (a.slice(0, 5) !== "data:" && a.slice(0, 5) !== "blob:" && j !== "") {
450
+ var N = a.indexOf("?");
451
+ w = N === -1 ? a : a.slice(0, N + 1) + a.slice(N + 1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g, function(ce, De) {
452
+ return De === d ? "" : ce;
453
+ }), w += (a.indexOf("?") === -1 ? "?" : "&") + d + "=" + encodeURIComponent(j);
454
+ }
455
+ var G = t.withCredentials, U = {};
456
+ U.Accept = "text/event-stream";
457
+ var F = t.headers;
458
+ if (F != null)
459
+ for (var de in F)
460
+ Object.prototype.hasOwnProperty.call(F, de) && (U[de] = F[de]);
461
+ try {
462
+ m = S.open(i, L, B, se, w, G, U);
463
+ } catch (ce) {
464
+ throw $(), ce;
465
+ }
466
+ };
467
+ t.url = a, t.readyState = W, t.withCredentials = r, t.headers = e, t._close = $, H();
468
+ }
469
+ X.prototype = Object.create(re.prototype), X.prototype.CONNECTING = W, X.prototype.OPEN = ae, X.prototype.CLOSED = je, X.prototype.close = function() {
470
+ this._close();
471
+ }, X.CONNECTING = W, X.OPEN = ae, X.CLOSED = je, X.prototype.withCredentials = void 0;
472
+ var Ve = ee;
473
+ R != null && (ee == null || !("withCredentials" in ee.prototype)) && (Ve = X), function(t) {
474
+ {
475
+ var a = t(K);
476
+ a !== void 0 && (he.exports = a);
477
+ }
478
+ }(function(t) {
479
+ t.EventSourcePolyfill = X, t.NativeEventSource = ee, t.EventSource = Ve;
480
+ });
481
+ })(typeof globalThis > "u" ? typeof window < "u" ? window : typeof self < "u" ? self : dt : globalThis);
482
+ })(et, et.exports);
483
+ var jt = et.exports, xt = J('<span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span>', 1), Et = J('<span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh">—</span> <span class="svelte-75jgrh">—</span>', 1), St = J('<p class="svelte-75jgrh"> </p>'), Pt = J('<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>'), kt = J('<div class="PlayerRankSkeletonWrapper svelte-75jgrh"><div class="PlayerRankSkeleton svelte-75jgrh"></div> <div class="PlayerRankSkeleton svelte-75jgrh"></div></div>'), Rt = J('<tr class="SkeletonRow svelte-75jgrh"><td colspan="4" class="svelte-75jgrh"></td></tr>'), Tt = J('<tr><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td></tr>'), Ct = J('<tr class="svelte-75jgrh"><td colspan="4" class="svelte-75jgrh"><div class="EmptyLeaderboard svelte-75jgrh"><p class="svelte-75jgrh"> </p></div></td></tr>'), At = J('<div class="PaginationSkeleton svelte-75jgrh"><div class="PaginationSkeletonButton svelte-75jgrh"></div> <div class="PaginationNumberSkeleton svelte-75jgrh"></div> <div class="PaginationNumberSkeleton svelte-75jgrh"></div> <div class="PaginationNumberSkeleton svelte-75jgrh"></div> <div class="PaginationNumberSkeleton svelte-75jgrh"></div> <div class="PaginationNumberSkeleton svelte-75jgrh"></div> <div class="PaginationSkeletonButton svelte-75jgrh"></div></div>'), Lt = J('<span class="PaginationButton Elipsis svelte-75jgrh">...</span>'), Dt = J("<button> </button>"), Nt = J('<div class="PaginationWrapper svelte-75jgrh"><button class="PaginationButton svelte-75jgrh"> </button> <div class="PageNumberWrapper svelte-75jgrh"></div> <button class="PaginationButton svelte-75jgrh"> </button></div>'), Ft = J('<div class="LeaderboardWrapper svelte-75jgrh"><div class="RankingWrapper 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> <!> <!></div>');
484
+ const Ot = {
485
+ hash: "svelte-75jgrh",
486
+ code: `.svelte-75jgrh,
487
+ .svelte-75jgrh::before,
488
+ .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;display:flex;flex-direction:column;justify-content:space-between;}.PlayerRankWrapper.svelte-75jgrh {display:flex;flex-direction:column;gap:5px;min-height:60px;.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);opacity:70%;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;background-color:var(--emw-color-skeleton, #535353);
489
+ animation: svelte-75jgrh-pulse 1.5s infinite;}.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-skeleton, #535353);border-radius:6px;
490
+ animation: svelte-75jgrh-pulse 1s infinite;}}.PaginationSkeleton.svelte-75jgrh {display:flex;justify-content:space-between;gap:6px;.PaginationSkeletonButton:where(.svelte-75jgrh) {width:60px;height:35px;border-radius:6px;background-color:var(--emw-color-skeleton, #535353);overflow:hidden;position:relative;
491
+ animation: svelte-75jgrh-pulse 1s infinite;}.PaginationNumberSkeleton:where(.svelte-75jgrh) {width:40px;height:35px;border-radius:6px;background-color:var(--emw-color-skeleton, #535353);overflow:hidden;position:relative;
492
+ animation: svelte-75jgrh-pulse 1s infinite;}}
493
+
494
+ @keyframes svelte-75jgrh-pulse {
495
+ 0% {
496
+ opacity: 0;
497
+ }
498
+ 50% {
499
+ opacity: 1;
500
+ }
501
+ 100% {
502
+ opacity: 0;
503
+ }
504
+ }
505
+
506
+ @media (min-width: 1000px) {.ShowPlayersButton.svelte-75jgrh {display:block;width:300px;margin:auto;background-color:var(--emw-color-bg-primary, #212121);}
507
+ }
508
+
509
+ @media (min-width: 750px) {.PaginationWrapper.svelte-75jgrh, .PaginationSkeleton.svelte-75jgrh {justify-content:end;gap:10px;}.PaginationButton.svelte-75jgrh {min-width:75px;}.PaginationSkeleton.svelte-75jgrh {justify-content:end;gap:10px;.PaginationSkeletonButton:where(.svelte-75jgrh) {width:auto;min-width:55px;}.PaginationNumberSkeleton:where(.svelte-75jgrh) {width:25px;}}
510
+ }`
511
+ };
512
+ function Bt(he, K) {
513
+ pt(K, !0), ct(he, Ot);
514
+ const _ = () => mt(bt, "$_", Q), [Q, fe] = ft(), R = Se(K, "endpoint"), Y = Se(K, "language", 7, "en"), Z = Se(K, "session"), ee = Se(K, "tournamentid"), z = Se(K, "platform"), Re = Se(K, "translationurl"), ie = Se(K, "newlyEnrolled"), ze = () => {
515
+ let e = new URL(Re());
516
+ fetch(e.href).then((n) => n.json()).then((n) => {
517
+ Object.keys(n).forEach((i) => {
518
+ nt(i, n[i]);
519
+ });
520
+ }).catch((n) => {
521
+ console.log(n);
522
+ });
523
+ };
524
+ Object.keys(st).forEach((e) => {
525
+ nt(e, st[e]);
526
+ }), ot(Y());
527
+ const Te = () => {
528
+ ot(Y());
529
+ };
530
+ vt(() => {
531
+ Re() && ze();
532
+ }), tt(() => {
533
+ Te();
534
+ });
535
+ let te = null, pe = ue(void 0), Ne = ue(!1), Ce = ue(!1), ge = ue(void 0), I = ue(void 0), k = ue(0), q = ue(10), we = ue(!0), ye = ue(void 0);
536
+ const _e = () => {
537
+ if (ae.has(s(W)))
538
+ return;
539
+ V(Ne, !0);
540
+ const e = new URL(`${R()}/v1/tournaments/${ee()}/leaderboard`), n = new Headers();
541
+ Z() && n.append("X-SessionId", Z()), e.searchParams.append("language", Y()), e.searchParams.append("platform", z()), e.searchParams.append("pagination", `offset=${s(k)},limit=${s(q)}`), fetch(e).then((i) => i.json()).then((i) => {
542
+ V(pe, i?.items, !0), V(ye, i?.total, !0), ae.set(s(W), s(pe)), s(we) || V(we, !0);
543
+ }).catch((i) => console.log(i)).finally(() => V(Ne, !1));
544
+ }, qe = (e) => {
545
+ const n = JSON.parse(e.data);
546
+ n && n.messageType === "LeaderBoardUpdate" && V(pe, n?.items, !0);
547
+ }, re = () => {
548
+ te && (te.close(), te = null);
549
+ const e = new URL(`${R()}/v1/tournaments/${ee()}/leaderboard/updates`);
550
+ e.searchParams.append("HeartBeat", "false"), e.searchParams.append("language", Y()), e.searchParams.append("filter", "includeUnqualifiedPlayer=true"), e.searchParams.append("pagination", `offset=${s(k)},limit=${s(q)}`), e.searchParams.append("platform", z()), te = new jt.EventSourcePolyfill(e, {
551
+ headers: { accept: "text/event-stream", "X-SessionId": Z() }
552
+ }), te.onmessage = qe;
553
+ }, Fe = () => {
554
+ console.log("fetcjhing player rank"), V(Ce, !0);
555
+ const e = new URL(`${R()}/v1/tournaments/leaderboard/player`), n = new Headers();
556
+ e.searchParams.append("language", Y()), e.searchParams.append("platform", z()), e.searchParams.append("filter", "includeUnqualifiedPlayer=false"), Z() && n.append("X-SessionId", Z()), fetch(e, { method: "GET", headers: n }).then((S) => S.json()).then((S) => {
557
+ const m = S?.items?.find((h) => h?.tournament?.id === ee());
558
+ V(ge, m?.leaderBoard, !0), V(I, m?.endRank, !0);
559
+ }).catch((S) => {
560
+ console.log(S);
561
+ }).finally(() => V(Ce, !1));
562
+ }, me = () => {
563
+ s(k) < s(ye) && (V(k, s(k) + s(q)), _e(), re());
564
+ }, We = () => {
565
+ s(k) !== 0 && (V(k, s(k) - s(q)), _e(), re());
566
+ }, Oe = (e) => {
567
+ V(k, (e - 1) * s(q)), _e(), re();
568
+ }, Be = Ye(() => {
569
+ const e = Math.ceil(s(ye) / s(q)), n = Math.floor(s(k) / s(q)) + 1;
570
+ if (e <= 5)
571
+ return Array.from({ length: e }, (S, m) => m + 1);
572
+ const i = [];
573
+ return i.push(1), n <= 3 ? (i.push(2, 3), i.push("..."), i.push(e)) : n >= e - 2 ? (i.push("..."), i.push(e - 2, e - 1, e)) : (i.push("..."), i.push(n - 1, n, n + 1), i.push("..."), i.push(e)), i;
574
+ }), W = Ye(() => Math.floor(s(k) / s(q)) + 1);
575
+ let ae = /* @__PURE__ */ new Map(), je = Ye(() => ae.get(s(W)) ?? []);
576
+ const He = (e, n) => {
577
+ const i = [];
578
+ return n && i.push("PlayerRow"), e === 1 && i.push("Gold"), e === 2 && i.push("Silver"), e === 3 && i.push("Bronze"), i.join(" ");
579
+ };
580
+ tt(() => {
581
+ console.log(ie(), "---- effect reacting to newly enrolled"), ie() && Fe();
582
+ }), ut(() => (_e(), Fe(), re(), () => {
583
+ te?.close(), te = null;
584
+ }));
585
+ var ne = {
586
+ get endpoint() {
587
+ return R();
588
+ },
589
+ set endpoint(e) {
590
+ R(e), Pe();
591
+ },
592
+ get language() {
593
+ return Y();
594
+ },
595
+ set language(e = "en") {
596
+ Y(e), Pe();
597
+ },
598
+ get session() {
599
+ return Z();
600
+ },
601
+ set session(e) {
602
+ Z(e), Pe();
603
+ },
604
+ get tournamentid() {
605
+ return ee();
606
+ },
607
+ set tournamentid(e) {
608
+ ee(e), Pe();
609
+ },
610
+ get platform() {
611
+ return z();
612
+ },
613
+ set platform(e) {
614
+ z(e), Pe();
615
+ },
616
+ get translationurl() {
617
+ return Re();
618
+ },
619
+ set translationurl(e) {
620
+ Re(e), Pe();
621
+ },
622
+ get newlyEnrolled() {
623
+ return ie();
624
+ },
625
+ set newlyEnrolled(e) {
626
+ ie(e), Pe();
627
+ }
628
+ }, xe = Ft(), Ae = f(xe), Xe = f(Ae);
629
+ {
630
+ var Ke = (e) => {
631
+ var n = Pt(), i = f(n), S = f(i), m = f(S, !0);
632
+ u(S);
633
+ var h = O(S, 2), P = f(h, !0);
634
+ u(h);
635
+ var T = O(h, 2), C = f(T, !0);
636
+ u(T), u(i);
637
+ var x = O(i, 2), M = f(x);
638
+ {
639
+ var E = (b) => {
640
+ var L = xt(), B = ke(L), se = f(B);
641
+ u(B);
642
+ var $ = O(B, 2), H = f($, !0);
643
+ u($);
644
+ var g = O($, 2), w = f(g, !0);
645
+ u(g), ve(() => {
646
+ A(se, `${s(ge).rank ?? ""}.`), A(H, s(ge).score), A(w, s(ge).prizeName || "—");
647
+ }), D(b, L);
648
+ }, le = (b) => {
649
+ var L = Ue(), B = ke(L);
650
+ {
651
+ var se = (H) => {
652
+ var g = Et(), w = ke(g), N = f(w);
653
+ u(w), _t(4), ve(() => A(N, `${s(I) ?? ""}.`)), D(H, g);
654
+ }, $ = (H) => {
655
+ var g = St(), w = f(g, !0);
656
+ u(g), ve((N) => A(w, N), [() => _()("notEnrolledRank")]), D(H, g);
657
+ };
658
+ be(
659
+ B,
660
+ (H) => {
661
+ s(I) ? H(se) : H($, !1);
662
+ },
663
+ !0
664
+ );
665
+ }
666
+ D(b, L);
667
+ };
668
+ be(M, (b) => {
669
+ s(ge) ? b(E) : b(le, !1);
670
+ });
671
+ }
672
+ u(x), u(n), ve(
673
+ (b, L, B) => {
674
+ A(m, b), A(P, L), A(C, B);
675
+ },
676
+ [
677
+ () => _()("myRanking"),
678
+ () => _()("points"),
679
+ () => _()("prize")
680
+ ]
681
+ ), D(e, n);
682
+ }, $e = (e) => {
683
+ var n = kt();
684
+ D(e, n);
685
+ };
686
+ be(Xe, (e) => {
687
+ s(Ce) ? e($e, !1) : e(Ke);
688
+ });
689
+ }
690
+ var Ge = O(Xe, 2), Ee = f(Ge), Le = f(Ee), oe = f(Le), X = f(oe, !0);
691
+ u(oe);
692
+ var Ie = O(oe), Qe = f(Ie, !0);
693
+ u(Ie);
694
+ var Me = O(Ie), Ve = f(Me, !0);
695
+ u(Me);
696
+ var t = O(Me), a = f(t, !0);
697
+ u(t), u(Le), u(Ee);
698
+ var o = O(Ee), r = f(o);
699
+ {
700
+ var d = (e) => {
701
+ var n = Ue(), i = ke(n);
702
+ Ze(i, 17, () => Array(s(q)), rt, (S, m, h, P) => {
703
+ var T = Rt();
704
+ D(S, T);
705
+ }), D(e, n);
706
+ }, l = (e) => {
707
+ var n = Ue(), i = ke(n);
708
+ {
709
+ var S = (h) => {
710
+ var P = Ue(), T = ke(P);
711
+ Ze(T, 17, () => s(je), (C) => C.rank, (C, x) => {
712
+ var M = Tt(), E = f(M), le = f(E);
713
+ u(E);
714
+ var b = O(E), L = f(b, !0);
715
+ u(b);
716
+ var B = O(b), se = f(B, !0);
717
+ u(B);
718
+ var $ = O(B), H = f($, !0);
719
+ u($), u(M), ve(
720
+ (g) => {
721
+ at(M, 1, g, "svelte-75jgrh"), A(le, `${s(x).rank ?? ""}.`), A(L, s(x).shortName || "J.D"), A(se, s(x).score || "—"), A(H, s(x).prizeName || "—");
722
+ },
723
+ [
724
+ () => wt(He(s(x).rank, s(x).rank === s(ge)?.rank))
725
+ ]
726
+ ), D(C, M);
727
+ }), D(h, P);
728
+ }, m = (h) => {
729
+ var P = Ct(), T = f(P), C = f(T), x = f(C), M = f(x, !0);
730
+ u(x), u(C), u(T), u(P), ve((E) => A(M, E), [() => _()("emptyLeaderboard")]), D(h, P);
731
+ };
732
+ be(
733
+ i,
734
+ (h) => {
735
+ s(pe)?.length > 0 ? h(S) : h(m, !1);
736
+ },
737
+ !0
738
+ );
739
+ }
740
+ D(e, n);
741
+ };
742
+ be(r, (e) => {
743
+ s(Ne) ? e(d) : e(l, !1);
744
+ });
745
+ }
746
+ u(o), u(Ge), u(Ae);
747
+ var c = O(Ae, 2);
748
+ {
749
+ var j = (e) => {
750
+ var n = At();
751
+ D(e, n);
752
+ };
753
+ be(c, (e) => {
754
+ s(we) || e(j);
755
+ });
756
+ }
757
+ var v = O(c, 2);
758
+ {
759
+ var p = (e) => {
760
+ var n = Nt(), i = f(n);
761
+ i.__click = We;
762
+ var S = f(i, !0);
763
+ u(i);
764
+ var m = O(i, 2);
765
+ Ze(m, 21, () => s(Be), rt, (T, C) => {
766
+ var x = Ue(), M = ke(x);
767
+ {
768
+ var E = (b) => {
769
+ var L = Lt();
770
+ D(b, L);
771
+ }, le = (b) => {
772
+ var L = Dt();
773
+ let B;
774
+ L.__click = () => Oe(s(C));
775
+ var se = f(L, !0);
776
+ u(L), ve(() => {
777
+ B = at(L, 1, "PaginationButton Number svelte-75jgrh", null, B, { Active: s(C) === s(W) }), A(se, s(C));
778
+ }), D(b, L);
779
+ };
780
+ be(M, (b) => {
781
+ typeof s(C) != "number" ? b(E) : b(le, !1);
782
+ });
783
+ }
784
+ D(T, x);
785
+ }), u(m);
786
+ var h = O(m, 2);
787
+ h.__click = me;
788
+ var P = f(h, !0);
789
+ u(h), u(n), ve(
790
+ (T, C) => {
791
+ i.disabled = s(k) === 0, A(S, T), h.disabled = s(k) >= s(ye) - s(q), A(P, C);
792
+ },
793
+ [() => _()("previousButton"), () => _()("nextButton")]
794
+ ), D(e, n);
795
+ };
796
+ be(v, (e) => {
797
+ s(we) && s(ye) > s(q) && e(p);
798
+ });
799
+ }
800
+ u(xe), ve(
801
+ (e, n, i, S) => {
802
+ A(X, e), A(Qe, n), A(Ve, i), A(a, S);
803
+ },
804
+ [
805
+ () => _()("rank"),
806
+ () => _()("user"),
807
+ () => _()("points"),
808
+ () => _()("prize")
809
+ ]
810
+ ), D(he, xe);
811
+ var y = ht(ne);
812
+ return fe(), y;
813
+ }
814
+ gt(["click"]);
815
+ customElements.define("tournament-leaderboard", yt(
816
+ Bt,
817
+ {
818
+ endpoint: {},
819
+ language: {},
820
+ session: {},
821
+ tournamentid: {},
822
+ platform: {},
823
+ translationurl: {},
824
+ newlyEnrolled: {}
825
+ },
826
+ [],
827
+ [],
828
+ !1
829
+ ));
830
+ export {
831
+ Bt as default
832
+ };