@everymatrix/tournament-details-page 0.0.4 → 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.
@@ -1,23 +1,23 @@
1
- var ce = (T, m, i) => new Promise((K, z) => {
2
- var D = (f) => {
1
+ var ce = (T, d, p) => new Promise((V, I) => {
2
+ var M = (f) => {
3
3
  try {
4
- k(i.next(f));
4
+ k(p.next(f));
5
5
  } catch (G) {
6
- z(G);
6
+ I(G);
7
7
  }
8
- }, O = (f) => {
8
+ }, W = (f) => {
9
9
  try {
10
- k(i.throw(f));
10
+ k(p.throw(f));
11
11
  } catch (G) {
12
- z(G);
12
+ I(G);
13
13
  }
14
- }, k = (f) => f.done ? K(f.value) : Promise.resolve(f.value).then(D, O);
15
- k((i = i.apply(T, m)).next());
14
+ }, k = (f) => f.done ? V(f.value) : Promise.resolve(f.value).then(M, W);
15
+ k((p = p.apply(T, d)).next());
16
16
  });
17
- import { a as Fe, $ as He, m as Xe, e as Ue, p as P, u as de, s as R, f as Je, g as _, r as x, q as l, i as E, n as a, y as A, C as qe, E as w, A as L, h as v, j as Ke, k as Qe, F as Ve, w as y, l as S, J, K as q, I as ae, x as ne, L as oe, t as Ye, v as Ze, B as r, D as fe } from "./TournamentDetails-CIK1Vnx8.js";
18
- import { g as $e } from "./TournamentDetailsPage-D6daHDII.js";
19
- function et(T, m) {
20
- Fe(T, m);
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
21
  }
22
22
  function tt(T) {
23
23
  He.set(T);
@@ -50,7 +50,7 @@ const ft = {
50
50
  var(--emw-color-primary, #FF1D4E),
51
51
  transparent
52
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-skeleton, #333232);overflow:hidden;position:relative;}.PaginationNumberSkeleton.svelte-p7mf8l {width:40px;height:40px;border-radius:6px;background-color:var(--emw-color-skeleton, #333232);overflow:hidden;position:relative;}.SkeletonShimmer.svelte-p7mf8l {width:100%;height:100%;background:linear-gradient(
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
54
  90deg,
55
55
  transparent 0%,
56
56
  var(--emw-color-skeleton, #333232) 50%,
@@ -70,10 +70,10 @@ const ft = {
70
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
71
  }.Hidden.svelte-p7mf8l {display:none;}`
72
72
  };
73
- function ut(T, m) {
73
+ function ut(T, d) {
74
74
  var me;
75
- Xe(m, !0), Ue(T, ft);
76
- const i = () => qe(Ve, "$_", K), [K, z] = Qe(), D = P(m, "initialGames"), O = P(m, "endpoint"), k = P(m, "language", 7, "en"), f = P(m, "session"), G = P(m, "tournamentid"), g = P(m, "gamesLimit", 7, 6), W = P(m, "totalGames"), Q = P(m, "platformProp", 7, null), M = P(m, "tournamentMetadata");
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
77
  Object.keys(ue).forEach((e) => {
78
78
  et(e, ue[e]);
79
79
  });
@@ -83,45 +83,45 @@ function ut(T, m) {
83
83
  de(() => {
84
84
  ge();
85
85
  });
86
- let I = R(Je(D() || [])), C = R(!1), u = R(0), F = R(void 0);
87
- const be = at() ? (me = Q()) != null ? me : "dk" : $e(window.navigator.userAgent), V = () => ce(this, null, function* () {
88
- if (Y.has(a(H)))
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
89
  return;
90
- y(C, !0);
91
- const e = new URL(`${O()}/v1/tournaments/${G()}`), t = new Headers();
90
+ y(E, !0);
91
+ const e = new URL(`${W()}/v1/tournaments/${G()}`), t = new Headers();
92
92
  f() && t.append("X-SessionId", f());
93
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((o) => o.json()).then((o) => {
95
- var p, s;
96
- y(I, (s = (p = o == null ? void 0 : o.item) == null ? void 0 : p.games) == null ? void 0 : s.items, !0), Y.set(a(H), a(I));
97
- }).catch((o) => console.log(o)).finally(() => y(C, !1));
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
98
  }), he = () => {
99
- const e = Math.ceil(W() / g()), t = Math.floor(a(u) / g()) + 1;
99
+ const e = Math.ceil(C() / g()), t = Math.floor(a(u) / g()) + 1;
100
100
  if (e <= 5)
101
- return Array.from({ length: e }, (o, p) => p + 1);
101
+ return Array.from({ length: e }, (s, l) => l + 1);
102
102
  const n = [];
103
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
104
  }, _e = () => {
105
- a(u) < W() && (y(u, a(u) + g()), V());
105
+ a(u) < C() && (y(u, a(u) + g()), Z());
106
106
  }, xe = () => {
107
- a(u) !== 0 && (y(u, a(u) - g()), V());
107
+ a(u) !== 0 && (y(u, a(u) - g()), Z());
108
108
  }, we = (e) => {
109
- y(u, (e - 1) * g()), V();
109
+ y(u, (e - 1) * g()), Z();
110
110
  }, ye = oe(he), H = oe(() => Math.floor(a(u) / g()) + 1);
111
- let Y = /* @__PURE__ */ new Map([[1, D()]]), ke = oe(() => {
111
+ let $ = /* @__PURE__ */ new Map([[1, M()]]), ke = oe(() => {
112
112
  var e;
113
- return (e = Y.get(a(H))) != null ? e : [];
114
- }), B = R("casino");
113
+ return (e = $.get(a(H))) != null ? e : [];
114
+ }), B = z("casino");
115
115
  const Pe = () => {
116
116
  var n;
117
- if (!M()) return;
118
- const e = (n = M().sports) == null ? void 0 : n.rules;
117
+ if (!j()) return;
118
+ const e = (n = j().sports) == null ? void 0 : n.rules;
119
119
  let t;
120
120
  if (e)
121
121
  try {
122
122
  t = JSON.parse(e), y(F, t[k()] || t["*"], !0);
123
- } catch (o) {
124
- console.log(o), y(F, `${i()("sportsRulesParseError")}`);
123
+ } catch (s) {
124
+ console.log(s), y(F, `${p()("sportsRulesParseError")}`);
125
125
  }
126
126
  }, Se = (e) => {
127
127
  window.postMessage(
@@ -137,20 +137,20 @@ function ut(T, m) {
137
137
  );
138
138
  };
139
139
  de(() => {
140
- Object.keys(M()).length !== 0 && Pe();
140
+ Object.keys(j()).length !== 0 && Pe();
141
141
  });
142
142
  var Te = {
143
143
  get initialGames() {
144
- return D();
144
+ return M();
145
145
  },
146
146
  set initialGames(e) {
147
- D(e), S();
147
+ M(e), S();
148
148
  },
149
149
  get endpoint() {
150
- return O();
150
+ return W();
151
151
  },
152
152
  set endpoint(e) {
153
- O(e), S();
153
+ W(e), S();
154
154
  },
155
155
  get language() {
156
156
  return k();
@@ -177,48 +177,48 @@ function ut(T, m) {
177
177
  g(e), S();
178
178
  },
179
179
  get totalGames() {
180
- return W();
180
+ return C();
181
181
  },
182
182
  set totalGames(e) {
183
- W(e), S();
183
+ C(e), S();
184
184
  },
185
185
  get platformProp() {
186
- return Q();
186
+ return Y();
187
187
  },
188
188
  set platformProp(e = null) {
189
- Q(e), S();
189
+ Y(e), S();
190
190
  },
191
191
  get tournamentMetadata() {
192
- return M();
192
+ return j();
193
193
  },
194
194
  set tournamentMetadata(e) {
195
- M(e), S();
195
+ j(e), S();
196
196
  }
197
- }, Z = dt(), $ = l(Z), ee = l($), Ge = l(ee, !0);
198
- r(ee);
199
- var se = x(ee, 2), Ae = l(se, !0);
200
- r(se), r($);
201
- var re = x($, 2);
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
202
  {
203
203
  var Be = (e) => {
204
- var t = nt(), n = l(t);
205
- let o;
204
+ var t = nt(), n = i(t);
205
+ let s;
206
206
  n.__click = () => y(B, "casino");
207
- var p = l(n, !0);
207
+ var l = i(n, !0);
208
208
  r(n);
209
- var s = x(n, 2);
210
- let c;
211
- s.__click = () => y(B, "sports");
212
- var d = l(s, !0);
213
- r(s), r(t), A(
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
214
  (b, h) => {
215
- o = L(n, 1, "Tab svelte-p7mf8l", null, o, { Active: a(B) === "casino" }), w(p, b), c = L(s, 1, "Tab svelte-p7mf8l", null, c, { Active: a(B) === "sports" }), w(d, 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
216
  },
217
- [() => i()("casinoTab"), () => i()("sportsbookTab")]
218
- ), v(e, t);
217
+ [() => p()("casinoTab"), () => p()("sportsbookTab")]
218
+ ), c(e, t);
219
219
  };
220
- E(re, (e) => {
221
- Object.keys(M()).length !== 0 && e(Be);
220
+ D(re, (e) => {
221
+ Object.keys(j()).length !== 0 && e(Be);
222
222
  });
223
223
  }
224
224
  var le = x(re, 2);
@@ -226,45 +226,45 @@ function ut(T, m) {
226
226
  var Ne = (e) => {
227
227
  var t = st();
228
228
  let n;
229
- J(t, 21, () => a(F), q, (o, p) => {
230
- var s = ot(), c = l(s);
231
- r(s), A((d) => {
229
+ J(t, 21, () => a(F), q, (s, l) => {
230
+ var o = ot(), m = i(o);
231
+ r(o), A((v) => {
232
232
  var b;
233
- return w(c, `${(b = a(p).rule) != null ? b : ""} ${d != null ? d : ""}`);
234
- }, [() => i()("contribution")]), v(o, s);
235
- }), r(t), A(() => n = L(t, 1, "TournamentRulesWrapper svelte-p7mf8l", null, n, { Hidden: a(B) === "casino" })), v(e, t);
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
236
  };
237
- E(le, (e) => {
237
+ D(le, (e) => {
238
238
  a(F) && e(Ne);
239
239
  });
240
240
  }
241
241
  var X = x(le, 2);
242
242
  let ie;
243
- var De = l(X);
243
+ var De = i(X);
244
244
  {
245
245
  var Me = (e) => {
246
- var t = ae(), n = ne(t);
247
- J(n, 17, () => Array(g()), q, (o, p, s, c) => {
248
- var d = rt();
249
- v(o, d);
250
- }), v(e, t);
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
251
  }, je = (e) => {
252
- var t = ae(), n = ne(t);
253
- J(n, 17, () => a(ke), q, (o, p) => {
254
- var s = lt();
255
- s.__click = () => Se(a(p));
256
- var c = l(s), d = l(c), b = x(d, 2), h = l(b), U = l(h, !0);
257
- r(h), r(b), r(c), r(s), A(
258
- (te) => {
259
- fe(d, "src", `https:${a(p).thumbnail}`), fe(d, "alt", a(p).name), w(U, te);
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
260
  },
261
- [() => i()("play")]
262
- ), v(o, s);
263
- }), v(e, t);
261
+ [() => p()("play")]
262
+ ), c(s, o);
263
+ }), c(e, t);
264
264
  };
265
- E(De, (e) => {
265
+ D(De, (e) => {
266
266
  var t;
267
- a(C) && ((t = a(I)) == null ? void 0 : t.length) === 0 ? e(Me) : e(je, !1);
267
+ a(E) || ((t = a(R)) == null ? void 0 : t.length) === 0 ? e(Me) : e(je, !1);
268
268
  });
269
269
  }
270
270
  r(X);
@@ -273,71 +273,85 @@ function ut(T, m) {
273
273
  var Ee = (e) => {
274
274
  var t = mt();
275
275
  let n;
276
- var o = l(t);
277
- o.__click = xe;
278
- var p = l(o, !0);
279
- r(o);
280
- var s = x(o, 2);
281
- J(s, 21, () => a(ye), q, (b, h) => {
282
- var U = ae(), te = ne(U);
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
283
  {
284
- var Re = (j) => {
284
+ var Re = (L) => {
285
285
  var N = it();
286
- v(j, N);
287
- }, ze = (j) => {
286
+ c(L, N);
287
+ }, ze = (L) => {
288
288
  var N = pt();
289
289
  let ve;
290
290
  N.__click = () => we(a(h));
291
- var Ie = l(N, !0);
291
+ var Ie = i(N, !0);
292
292
  r(N), A(() => {
293
- ve = L(N, 1, "PaginationButton Number svelte-p7mf8l", null, ve, { Active: a(h) === a(H) }), w(Ie, a(h));
294
- }), v(j, N);
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
295
  };
296
- E(te, (j) => {
297
- typeof a(h) != "number" ? j(Re) : j(ze, !1);
296
+ D(ne, (L) => {
297
+ typeof a(h) != "number" ? L(Re) : L(ze, !1);
298
298
  });
299
299
  }
300
- v(b, U);
301
- }), r(s);
302
- var c = x(s, 2);
303
- c.__click = _e;
304
- var d = l(c, !0);
305
- r(c), r(t), A(
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
306
  (b, h) => {
307
- n = L(t, 1, "PaginationWrapper svelte-p7mf8l", null, n, { Hidden: a(B) === "sports" }), o.disabled = a(u) === 0, w(p, b), c.disabled = a(u) >= W() - g(), w(d, 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
308
  },
309
- [() => i()("previousButton"), () => i()("nextButton")]
310
- ), v(e, t);
309
+ [() => p()("previousButton"), () => p()("nextButton")]
310
+ ), c(e, t);
311
311
  }, Le = (e) => {
312
- var t = vt(), n = l(t, !0);
313
- r(t), A((o) => w(n, o), [() => i()("noAvailableGames")]), v(e, t);
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);
314
328
  };
315
- E(pe, (e) => {
329
+ D(pe, (e) => {
316
330
  var t;
317
- !a(C) && ((t = a(I)) == null ? void 0 : t.length) > 0 ? e(Ee) : e(Le, !1);
331
+ !a(E) && ((t = a(R)) == null ? void 0 : t.length) > 0 ? e(Ee) : e(Le, !1);
318
332
  });
319
333
  }
320
334
  var Oe = x(pe, 2);
321
335
  {
322
336
  var We = (e) => {
323
337
  var t = ct();
324
- v(e, t);
338
+ c(e, t);
325
339
  };
326
- E(Oe, (e) => {
327
- a(C) && e(We);
340
+ D(Oe, (e) => {
341
+ a(E) && e(We);
328
342
  });
329
343
  }
330
- r(Z), A(
344
+ r(ee), A(
331
345
  (e, t) => {
332
- w(Ge, e), w(Ae, t), ie = L(X, 1, "TournamentGamesContainer svelte-p7mf8l", null, ie, { Hidden: a(B) === "sports" });
346
+ w(Ge, e), w(Ae, t), ie = O(X, 1, "TournamentGamesContainer svelte-p7mf8l", null, ie, { Hidden: a(B) === "sports" });
333
347
  },
334
348
  [
335
- () => i()("gamesDescriptionTitle"),
336
- () => i()("gamesDescriptionSubtitle")
349
+ () => p()("gamesDescriptionTitle"),
350
+ () => p()("gamesDescriptionSubtitle")
337
351
  ]
338
- ), v(T, Z);
352
+ ), c(T, ee);
339
353
  var Ce = Ke(Te);
340
- return z(), Ce;
354
+ return I(), Ce;
341
355
  }
342
356
  Ye(["click"]);
343
357
  customElements.define("tournament-games", Ze(
@@ -1,11 +1,11 @@
1
- "use strict";var K=(h,i,o)=>new Promise((j,G)=>{var y=c=>{try{g(o.next(c))}catch(b){G(b)}},P=c=>{try{g(o.throw(c))}catch(b){G(b)}},g=c=>c.done?j(c.value):Promise.resolve(c.value).then(y,P);g((o=o.apply(h,i)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TournamentDetails-AYkmST0l.cjs"),ke=require("./TournamentDetailsPage-85B_WTCl.cjs");function Pe(h,i){e.addMessages(h,i)}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,
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
2
  .svelte-p7mf8l::before,
3
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
4
  to top,
5
5
  var(--emw-color-primary, #FF1D4E),
6
6
  transparent
7
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-skeleton, #333232);overflow:hidden;position:relative;}.PaginationNumberSkeleton.svelte-p7mf8l {width:40px;height:40px;border-radius:6px;background-color:var(--emw-color-skeleton, #333232);overflow:hidden;position:relative;}.SkeletonShimmer.svelte-p7mf8l {width:100%;height:100%;background:linear-gradient(
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
9
  90deg,
10
10
  transparent 0%,
11
11
  var(--emw-color-skeleton, #333232) 50%,
@@ -23,4 +23,4 @@
23
23
  }
24
24
 
25
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,i){var q;e.push(i,!0),e.append_styles(h,Re);const o=()=>e.store_get(e.$format,"$_",j),[j,G]=e.setup_stores(),y=e.prop(i,"initialGames"),P=e.prop(i,"endpoint"),g=e.prop(i,"language",7,"en"),c=e.prop(i,"session"),b=e.prop(i,"tournamentid"),f=e.prop(i,"gamesLimit",7,6),S=e.prop(i,"totalGames"),E=e.prop(i,"platformProp",7,null),w=e.prop(i,"tournamentMetadata");Object.keys(Q).forEach(t=>{Pe(t,Q[t])});const Y=()=>{Se(g())};e.user_effect(()=>{Y()});let A=e.state(e.proxy(y()||[])),T=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(T,!0);const t=new URL(`${P()}/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(s=>s.json()).then(s=>{var l,r;e.set(A,(r=(l=s==null?void 0:s.item)==null?void 0:l.games)==null?void 0:r.items,!0),O.set(e.get(B),e.get(A))}).catch(s=>console.log(s)).finally(()=>e.set(T,!1))}),$=()=>{const t=Math.ceil(S()/f()),a=Math.floor(e.get(d)/f())+1;if(t<=5)return Array.from({length:t},(s,l)=>l+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)<S()&&(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(s){console.log(s),e.set(N,`${o()("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 P()},set endpoint(t){P(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 S()},set totalGames(t){S(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 s;n.__click=()=>e.set(_,"casino");var l=e.child(n,!0);e.reset(n);var r=e.sibling(n,2);let p;r.__click=()=>e.set(_,"sports");var m=e.child(r,!0);e.reset(r),e.reset(a),e.template_effect((v,u)=>{s=e.set_class(n,1,"Tab svelte-p7mf8l",null,s,{Active:e.get(_)==="casino"}),e.set_text(l,v),p=e.set_class(r,1,"Tab svelte-p7mf8l",null,p,{Active:e.get(_)==="sports"}),e.set_text(m,u)},[()=>o()("casinoTab"),()=>o()("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,(s,l)=>{var r=Ae(),p=e.child(r);e.reset(r),e.template_effect(m=>{var v;return e.set_text(p,`${(v=e.get(l).rule)!=null?v:""} ${m!=null?m:""}`)},[()=>o()("contribution")]),e.append(s,r)}),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,(s,l,r,p)=>{var m=Be();e.append(s,m)}),e.append(t,a)},ve=t=>{var a=e.comment(),n=e.first_child(a);e.each(n,17,()=>e.get(se),e.index,(s,l)=>{var r=De();r.__click=()=>oe(e.get(l));var p=e.child(r),m=e.child(p),v=e.sibling(m,2),u=e.child(v),M=e.child(u,!0);e.reset(u),e.reset(v),e.reset(p),e.reset(r),e.template_effect(C=>{e.set_attribute(m,"src",`https:${e.get(l).thumbnail}`),e.set_attribute(m,"alt",e.get(l).name),e.set_text(M,C)},[()=>o()("play")]),e.append(s,r)}),e.append(t,a)};e.if_block(de,t=>{var a;e.get(T)&&((a=e.get(A))==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 s=e.child(a);s.__click=te;var l=e.child(s,!0);e.reset(s);var r=e.sibling(s,2);e.each(r,21,()=>e.get(ne),e.index,(v,u)=>{var M=e.comment(),C=e.first_child(M);{var xe=k=>{var x=Me();e.append(k,x)},ye=k=>{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(k,x)};e.if_block(C,k=>{typeof e.get(u)!="number"?k(xe):k(ye,!1)})}e.append(v,M)}),e.reset(r);var p=e.sibling(r,2);p.__click=ee;var m=e.child(p,!0);e.reset(p),e.reset(a),e.template_effect((v,u)=>{n=e.set_class(a,1,"PaginationWrapper svelte-p7mf8l",null,n,{Hidden:e.get(_)==="sports"}),s.disabled=e.get(d)===0,e.set_text(l,v),p.disabled=e.get(d)>=S()-f(),e.set_text(m,u)},[()=>o()("previousButton"),()=>o()("nextButton")]),e.append(t,a)},ge=t=>{var a=Le(),n=e.child(a,!0);e.reset(a),e.template_effect(s=>e.set_text(n,s),[()=>o()("noAvailableGames")]),e.append(t,a)};e.if_block(U,t=>{var a;!e.get(T)&&((a=e.get(A))==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(T)&&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"})},[()=>o()("gamesDescriptionTitle"),()=>o()("gamesDescriptionSubtitle")]),e.append(h,W);var _e=e.pop(le);return G(),_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;
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;