@streamlayer/react 1.21.4 → 1.22.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.
Files changed (168) hide show
  1. package/lib/app/masters.d.ts +2 -5
  2. package/lib/app/pause-ad.d.ts +1 -10
  3. package/lib/app/useStreamLayerApp.d.ts +1 -23
  4. package/lib/cjs/Question.js +1 -0
  5. package/lib/cjs/advertisement.js +40 -40
  6. package/lib/cjs/analytics.js +1 -0
  7. package/lib/cjs/auth.js +1 -1
  8. package/lib/cjs/bet-pack.js +1 -1
  9. package/lib/cjs/gamification-feature.js +1 -1
  10. package/lib/cjs/hooks-B0Qttldg.js +1 -0
  11. package/lib/cjs/index-DSi8Qgfs.js +1 -0
  12. package/lib/cjs/index.js +1 -1
  13. package/lib/cjs/index10.js +1 -0
  14. package/lib/cjs/index11.js +4 -0
  15. package/lib/cjs/index12.js +1 -0
  16. package/lib/cjs/index13.js +1 -0
  17. package/lib/cjs/index14.js +1 -0
  18. package/lib/cjs/index15.js +1 -0
  19. package/lib/cjs/index16.js +5 -0
  20. package/lib/cjs/index2.js +1 -5
  21. package/lib/cjs/index3.js +1 -0
  22. package/lib/cjs/index4.js +5 -0
  23. package/lib/cjs/index5.js +1 -0
  24. package/lib/cjs/index6.js +1 -0
  25. package/lib/cjs/index7.js +5 -0
  26. package/lib/cjs/index8.js +1 -0
  27. package/lib/cjs/index9.js +1 -0
  28. package/lib/cjs/insight.js +1 -1
  29. package/lib/cjs/masters.js +1 -1
  30. package/lib/cjs/masters2.js +6 -6
  31. package/lib/cjs/notification.js +1 -1
  32. package/lib/cjs/pause-ad.js +1 -1
  33. package/lib/cjs/points.js +1 -1
  34. package/lib/cjs/sl-types.js +15 -0
  35. package/lib/cjs/storage.js +1 -0
  36. package/lib/cjs/theme.js +17 -0
  37. package/lib/cjs/useStreamLayerApp.js +1 -1
  38. package/lib/cjs/useStreamLayerApp2.js +9 -9
  39. package/lib/cjs/utils.js +47 -0
  40. package/lib/cjs/vast-client.min.js +1 -0
  41. package/lib/classic/app/masters.d.ts +2 -5
  42. package/lib/classic/app/pause-ad.d.ts +1 -10
  43. package/lib/classic/app/useStreamLayerApp.d.ts +1 -23
  44. package/lib/classic/cjs/Question.js +1 -0
  45. package/lib/classic/cjs/advertisement.js +40 -40
  46. package/lib/classic/cjs/analytics.js +1 -0
  47. package/lib/classic/cjs/auth.js +1 -1
  48. package/lib/classic/cjs/bet-pack.js +4 -4
  49. package/lib/classic/cjs/gamification-feature.js +1 -1
  50. package/lib/classic/cjs/hooks-B0Qttldg.js +1 -0
  51. package/lib/classic/cjs/index-DSi8Qgfs.js +1 -0
  52. package/lib/classic/cjs/index.js +1 -1
  53. package/lib/classic/cjs/index10.js +1 -0
  54. package/lib/classic/cjs/index11.js +1 -0
  55. package/lib/classic/cjs/index12.js +1 -0
  56. package/lib/classic/cjs/index13.js +4 -0
  57. package/lib/classic/cjs/index2.js +5 -0
  58. package/lib/classic/cjs/index3.js +1 -0
  59. package/lib/classic/cjs/index4.js +1 -0
  60. package/lib/classic/cjs/index5.js +1 -0
  61. package/lib/classic/cjs/index6.js +5 -0
  62. package/lib/classic/cjs/index7.js +1 -0
  63. package/lib/classic/cjs/index8.js +1 -0
  64. package/lib/classic/cjs/index9.js +1 -0
  65. package/lib/classic/cjs/insight.js +1 -1
  66. package/lib/classic/cjs/notification.js +1 -1
  67. package/lib/classic/cjs/notification2.js +1 -0
  68. package/lib/classic/cjs/pause-ad.js +1 -1
  69. package/lib/classic/cjs/points.js +1 -1
  70. package/lib/classic/cjs/sl-types.js +15 -0
  71. package/lib/classic/cjs/useStreamLayerApp.js +1 -1
  72. package/lib/classic/cjs/useStreamLayerApp2.js +9 -9
  73. package/lib/classic/cjs/utils.js +47 -0
  74. package/lib/classic/cjs/vast-client.min.js +1 -0
  75. package/lib/classic/es/Question.js +392 -0
  76. package/lib/classic/es/advertisement.js +10375 -10374
  77. package/lib/classic/es/analytics.js +28 -0
  78. package/lib/classic/es/auth.js +4 -4
  79. package/lib/classic/es/bet-pack.js +56 -51
  80. package/lib/classic/es/gamification-feature.js +1 -1
  81. package/lib/classic/es/hooks-B0Qttldg.js +98 -0
  82. package/lib/classic/es/index-DSi8Qgfs.js +65 -0
  83. package/lib/classic/es/index.js +14 -15
  84. package/lib/classic/es/index10.js +87 -0
  85. package/lib/classic/es/index11.js +2361 -0
  86. package/lib/classic/es/index12.js +183 -0
  87. package/lib/classic/es/index13.js +835 -0
  88. package/lib/classic/es/index2.js +2621 -0
  89. package/lib/classic/es/index3.js +64 -0
  90. package/lib/classic/es/index4.js +19 -0
  91. package/lib/classic/es/index5.js +285 -0
  92. package/lib/classic/es/{index-l-eyvmpL.js → index6.js} +937 -937
  93. package/lib/classic/es/index7.js +7 -0
  94. package/lib/classic/es/index8.js +11 -0
  95. package/lib/classic/es/index9.js +319 -0
  96. package/lib/classic/es/insight.js +31 -32
  97. package/lib/classic/es/notification.js +7 -1006
  98. package/lib/classic/es/notification2.js +1117 -0
  99. package/lib/classic/es/pause-ad.js +139 -138
  100. package/lib/classic/es/points.js +39 -38
  101. package/lib/classic/es/sl-types.js +258 -0
  102. package/lib/classic/es/useStreamLayerApp.js +1 -2
  103. package/lib/classic/es/useStreamLayerApp2.js +2400 -2283
  104. package/lib/classic/es/utils.js +76 -0
  105. package/lib/{es/vast-client.min-B0NUra1B.js → classic/es/vast-client.min.js} +338 -338
  106. package/lib/classic/index.d.ts +5 -13
  107. package/lib/classic/masters.d.ts +1 -1
  108. package/lib/dist/cjs/index.js +1 -1
  109. package/lib/dist/cjs/masters.js +30 -30
  110. package/lib/dist/es/index.js +2 -2
  111. package/lib/dist/es/masters.js +5813 -6063
  112. package/lib/dist/index.d.ts +1332 -0
  113. package/lib/dist/style.css +1 -1
  114. package/lib/es/Question.js +136 -0
  115. package/lib/es/advertisement.js +10375 -10374
  116. package/lib/es/analytics.js +28 -0
  117. package/lib/es/auth.js +4 -4
  118. package/lib/es/bet-pack.js +7 -6
  119. package/lib/es/gamification-feature.js +1 -1
  120. package/lib/es/hooks-B0Qttldg.js +98 -0
  121. package/lib/es/index-DSi8Qgfs.js +65 -0
  122. package/lib/es/index.js +13 -14
  123. package/lib/es/index10.js +267 -0
  124. package/lib/es/index11.js +835 -0
  125. package/lib/es/index12.js +183 -0
  126. package/lib/es/index13.js +319 -0
  127. package/lib/es/index14.js +87 -0
  128. package/lib/es/index15.js +2355 -0
  129. package/lib/es/index16.js +1254 -0
  130. package/lib/es/index2.js +1349 -3363
  131. package/lib/es/index3.js +64 -0
  132. package/lib/es/index4.js +3418 -0
  133. package/lib/es/index5.js +19 -0
  134. package/lib/es/index6.js +285 -0
  135. package/lib/es/{index-l-eyvmpL.js → index7.js} +937 -937
  136. package/lib/es/index8.js +7 -0
  137. package/lib/es/index9.js +11 -0
  138. package/lib/es/insight.js +31 -32
  139. package/lib/es/masters.js +6 -5
  140. package/lib/es/masters2.js +189 -176
  141. package/lib/es/notification.js +124 -119
  142. package/lib/es/pause-ad.js +140 -139
  143. package/lib/es/points.js +40 -38
  144. package/lib/es/sl-types.js +277 -0
  145. package/lib/es/storage.js +113 -0
  146. package/lib/es/theme.js +47 -0
  147. package/lib/es/useStreamLayerApp.js +1 -2
  148. package/lib/es/useStreamLayerApp2.js +2399 -2282
  149. package/lib/es/utils.js +76 -0
  150. package/lib/{classic/es/vast-client.min-B0NUra1B.js → es/vast-client.min.js} +338 -338
  151. package/lib/index.d.ts +5 -13
  152. package/lib/masters.d.ts +1 -1
  153. package/lib/style.css +1 -1
  154. package/package.json +13 -48
  155. package/lib/app/event.d.ts +0 -6
  156. package/lib/app/provider.d.ts +0 -49
  157. package/lib/cjs/index-l-eyvmpL.js +0 -5
  158. package/lib/cjs/provider.js +0 -84
  159. package/lib/cjs/vast-client.min-B0NUra1B.js +0 -1
  160. package/lib/classic/app/event.d.ts +0 -6
  161. package/lib/classic/app/provider.d.ts +0 -49
  162. package/lib/classic/cjs/index-l-eyvmpL.js +0 -5
  163. package/lib/classic/cjs/provider.js +0 -68
  164. package/lib/classic/cjs/vast-client.min-B0NUra1B.js +0 -1
  165. package/lib/classic/es/provider.js +0 -7617
  166. package/lib/dist/cjs/gamification-feature2.js +0 -1
  167. package/lib/dist/es/gamification-feature2.js +0 -285
  168. package/lib/es/provider.js +0 -7693
package/lib/es/index2.js CHANGED
@@ -1,3414 +1,1400 @@
1
- import { jsx as P, jsxs as F } from "react/jsx-runtime";
2
- import { s as _, B as te, o as ft, p as ht, f as Se, j as gt, n as Ee } from "./provider.js";
3
- import $, { forwardRef as Ae, useState as W, useRef as D, useEffect as X, useLayoutEffect as vt, createContext as Ve, useMemo as He, useCallback as Re, memo as wt } from "react";
4
- import bt from "lodash.throttle";
5
- import { C as yt, a as St, S as qe } from "./useStreamLayerApp2.js";
6
- function _e(t) {
7
- return t !== null && typeof t == "object" && "constructor" in t && t.constructor === Object;
8
- }
9
- function Oe(t, e) {
10
- t === void 0 && (t = {}), e === void 0 && (e = {});
11
- const s = ["__proto__", "constructor", "prototype"];
12
- Object.keys(e).filter((r) => s.indexOf(r) < 0).forEach((r) => {
13
- typeof t[r] > "u" ? t[r] = e[r] : _e(e[r]) && _e(t[r]) && Object.keys(e[r]).length > 0 && Oe(t[r], e[r]);
14
- });
15
- }
16
- const We = {
17
- body: {},
18
- addEventListener() {
19
- },
20
- removeEventListener() {
21
- },
22
- activeElement: {
23
- blur() {
24
- },
25
- nodeName: ""
26
- },
27
- querySelector() {
28
- return null;
29
- },
30
- querySelectorAll() {
31
- return [];
32
- },
33
- getElementById() {
34
- return null;
35
- },
36
- createEvent() {
37
- return {
38
- initEvent() {
39
- }
40
- };
41
- },
42
- createElement() {
43
- return {
44
- children: [],
45
- childNodes: [],
46
- style: {},
47
- setAttribute() {
48
- },
49
- getElementsByTagName() {
50
- return [];
51
- }
52
- };
53
- },
54
- createElementNS() {
55
- return {};
56
- },
57
- importNode() {
58
- return null;
59
- },
60
- location: {
61
- hash: "",
62
- host: "",
63
- hostname: "",
64
- href: "",
65
- origin: "",
66
- pathname: "",
67
- protocol: "",
68
- search: ""
69
- }
70
- };
71
- function K() {
72
- const t = typeof document < "u" ? document : {};
73
- return Oe(t, We), t;
74
- }
75
- const Et = {
76
- document: We,
77
- navigator: {
78
- userAgent: ""
79
- },
80
- location: {
81
- hash: "",
82
- host: "",
83
- hostname: "",
84
- href: "",
85
- origin: "",
86
- pathname: "",
87
- protocol: "",
88
- search: ""
89
- },
90
- history: {
91
- replaceState() {
92
- },
93
- pushState() {
94
- },
95
- go() {
96
- },
97
- back() {
98
- }
99
- },
100
- CustomEvent: function() {
101
- return this;
102
- },
103
- addEventListener() {
104
- },
105
- removeEventListener() {
106
- },
107
- getComputedStyle() {
108
- return {
109
- getPropertyValue() {
110
- return "";
111
- }
112
- };
113
- },
114
- Image() {
115
- },
116
- Date() {
117
- },
118
- screen: {},
119
- setTimeout() {
120
- },
121
- clearTimeout() {
122
- },
123
- matchMedia() {
124
- return {};
125
- },
126
- requestAnimationFrame(t) {
127
- return typeof setTimeout > "u" ? (t(), null) : setTimeout(t, 0);
128
- },
129
- cancelAnimationFrame(t) {
130
- typeof setTimeout > "u" || clearTimeout(t);
131
- }
132
- };
133
- function N() {
134
- const t = typeof window < "u" ? window : {};
135
- return Oe(t, Et), t;
136
- }
137
- function xt(t) {
138
- return t === void 0 && (t = ""), t.trim().split(" ").filter((e) => !!e.trim());
139
- }
140
- function Tt(t) {
141
- const e = t;
142
- Object.keys(e).forEach((s) => {
143
- try {
144
- e[s] = null;
145
- } catch {
146
- }
147
- try {
148
- delete e[s];
149
- } catch {
150
- }
151
- });
152
- }
153
- function xe(t, e) {
154
- return e === void 0 && (e = 0), setTimeout(t, e);
155
- }
156
- function le() {
157
- return Date.now();
158
- }
159
- function Ct(t) {
160
- const e = N();
161
- let s;
162
- return e.getComputedStyle && (s = e.getComputedStyle(t, null)), !s && t.currentStyle && (s = t.currentStyle), s || (s = t.style), s;
163
- }
164
- function Pt(t, e) {
165
- e === void 0 && (e = "x");
166
- const s = N();
167
- let r, n, i;
168
- const l = Ct(t);
169
- return s.WebKitCSSMatrix ? (n = l.transform || l.webkitTransform, n.split(",").length > 6 && (n = n.split(", ").map((a) => a.replace(",", ".")).join(", ")), i = new s.WebKitCSSMatrix(n === "none" ? "" : n)) : (i = l.MozTransform || l.OTransform || l.MsTransform || l.msTransform || l.transform || l.getPropertyValue("transform").replace("translate(", "matrix(1, 0, 0, 1,"), r = i.toString().split(",")), e === "x" && (s.WebKitCSSMatrix ? n = i.m41 : r.length === 16 ? n = parseFloat(r[12]) : n = parseFloat(r[4])), e === "y" && (s.WebKitCSSMatrix ? n = i.m42 : r.length === 16 ? n = parseFloat(r[13]) : n = parseFloat(r[5])), n || 0;
170
- }
171
- function se(t) {
172
- return typeof t == "object" && t !== null && t.constructor && Object.prototype.toString.call(t).slice(8, -1) === "Object";
173
- }
174
- function Mt(t) {
175
- return typeof window < "u" && typeof window.HTMLElement < "u" ? t instanceof HTMLElement : t && (t.nodeType === 1 || t.nodeType === 11);
176
- }
177
- function B() {
178
- const t = Object(arguments.length <= 0 ? void 0 : arguments[0]), e = ["__proto__", "constructor", "prototype"];
179
- for (let s = 1; s < arguments.length; s += 1) {
180
- const r = s < 0 || arguments.length <= s ? void 0 : arguments[s];
181
- if (r != null && !Mt(r)) {
182
- const n = Object.keys(Object(r)).filter((i) => e.indexOf(i) < 0);
183
- for (let i = 0, l = n.length; i < l; i += 1) {
184
- const a = n[i], o = Object.getOwnPropertyDescriptor(r, a);
185
- o !== void 0 && o.enumerable && (se(t[a]) && se(r[a]) ? r[a].__swiper__ ? t[a] = r[a] : B(t[a], r[a]) : !se(t[a]) && se(r[a]) ? (t[a] = {}, r[a].__swiper__ ? t[a] = r[a] : B(t[a], r[a])) : t[a] = r[a]);
186
- }
187
- }
188
- }
189
- return t;
190
- }
191
- function re(t, e, s) {
192
- t.style.setProperty(e, s);
193
- }
194
- function Ye(t) {
195
- let {
196
- swiper: e,
197
- targetPosition: s,
198
- side: r
199
- } = t;
200
- const n = N(), i = -e.translate;
201
- let l = null, a;
202
- const o = e.params.speed;
203
- e.wrapperEl.style.scrollSnapType = "none", n.cancelAnimationFrame(e.cssModeFrameID);
204
- const c = s > i ? "next" : "prev", d = (f, g) => c === "next" && f >= g || c === "prev" && f <= g, u = () => {
205
- a = (/* @__PURE__ */ new Date()).getTime(), l === null && (l = a);
206
- const f = Math.max(Math.min((a - l) / o, 1), 0), g = 0.5 - Math.cos(f * Math.PI) / 2;
207
- let h = i + g * (s - i);
208
- if (d(h, s) && (h = s), e.wrapperEl.scrollTo({
209
- [r]: h
210
- }), d(h, s)) {
211
- e.wrapperEl.style.overflow = "hidden", e.wrapperEl.style.scrollSnapType = "", setTimeout(() => {
212
- e.wrapperEl.style.overflow = "", e.wrapperEl.scrollTo({
213
- [r]: h
214
- });
215
- }), n.cancelAnimationFrame(e.cssModeFrameID);
216
- return;
217
- }
218
- e.cssModeFrameID = n.requestAnimationFrame(u);
219
- };
220
- u();
221
- }
222
- function H(t, e) {
223
- e === void 0 && (e = "");
224
- const s = N(), r = [...t.children];
225
- return s.HTMLSlotElement && t instanceof HTMLSlotElement && r.push(...t.assignedElements()), e ? r.filter((n) => n.matches(e)) : r;
226
- }
227
- function kt(t, e) {
228
- const s = [e];
229
- for (; s.length > 0; ) {
230
- const r = s.shift();
231
- if (t === r)
232
- return !0;
233
- s.push(...r.children, ...r.shadowRoot ? r.shadowRoot.children : [], ...r.assignedElements ? r.assignedElements() : []);
234
- }
235
- }
236
- function It(t, e) {
237
- const s = N();
238
- let r = e.contains(t);
239
- return !r && s.HTMLSlotElement && e instanceof HTMLSlotElement && (r = [...e.assignedElements()].includes(t), r || (r = kt(t, e))), r;
240
- }
241
- function oe(t) {
242
- try {
243
- console.warn(t);
244
- return;
245
- } catch {
246
- }
247
- }
248
- function de(t, e) {
249
- e === void 0 && (e = []);
250
- const s = document.createElement(t);
251
- return s.classList.add(...Array.isArray(e) ? e : xt(e)), s;
252
- }
253
- function Lt(t, e) {
254
- const s = [];
255
- for (; t.previousElementSibling; ) {
256
- const r = t.previousElementSibling;
257
- e ? r.matches(e) && s.push(r) : s.push(r), t = r;
258
- }
259
- return s;
260
- }
261
- function At(t, e) {
262
- const s = [];
263
- for (; t.nextElementSibling; ) {
264
- const r = t.nextElementSibling;
265
- e ? r.matches(e) && s.push(r) : s.push(r), t = r;
266
- }
267
- return s;
268
- }
269
- function Y(t, e) {
270
- return N().getComputedStyle(t, null).getPropertyValue(e);
271
- }
272
- function ce(t) {
273
- let e = t, s;
274
- if (e) {
275
- for (s = 0; (e = e.previousSibling) !== null; )
276
- e.nodeType === 1 && (s += 1);
277
- return s;
278
- }
279
- }
280
- function Xe(t, e) {
281
- const s = [];
282
- let r = t.parentElement;
283
- for (; r; )
284
- e ? r.matches(e) && s.push(r) : s.push(r), r = r.parentElement;
285
- return s;
286
- }
287
- function Te(t, e, s) {
288
- const r = N();
289
- return t[e === "width" ? "offsetWidth" : "offsetHeight"] + parseFloat(r.getComputedStyle(t, null).getPropertyValue(e === "width" ? "margin-right" : "margin-top")) + parseFloat(r.getComputedStyle(t, null).getPropertyValue(e === "width" ? "margin-left" : "margin-bottom"));
290
- }
291
- function R(t) {
292
- return (Array.isArray(t) ? t : [t]).filter((e) => !!e);
293
- }
294
- let fe;
295
- function Ot() {
296
- const t = N(), e = K();
297
- return {
298
- smoothScroll: e.documentElement && e.documentElement.style && "scrollBehavior" in e.documentElement.style,
299
- touch: !!("ontouchstart" in t || t.DocumentTouch && e instanceof t.DocumentTouch)
300
- };
301
- }
302
- function Ue() {
303
- return fe || (fe = Ot()), fe;
304
- }
305
- let he;
306
- function zt(t) {
307
- let {
308
- userAgent: e
309
- } = t === void 0 ? {} : t;
310
- const s = Ue(), r = N(), n = r.navigator.platform, i = e || r.navigator.userAgent, l = {
311
- ios: !1,
312
- android: !1
313
- }, a = r.screen.width, o = r.screen.height, c = i.match(/(Android);?[\s\/]+([\d.]+)?/);
314
- let d = i.match(/(iPad).*OS\s([\d_]+)/);
315
- const u = i.match(/(iPod)(.*OS\s([\d_]+))?/), f = !d && i.match(/(iPhone\sOS|iOS)\s([\d_]+)/), g = n === "Win32";
316
- let h = n === "MacIntel";
317
- const b = ["1024x1366", "1366x1024", "834x1194", "1194x834", "834x1112", "1112x834", "768x1024", "1024x768", "820x1180", "1180x820", "810x1080", "1080x810"];
318
- return !d && h && s.touch && b.indexOf(`${a}x${o}`) >= 0 && (d = i.match(/(Version)\/([\d.]+)/), d || (d = [0, 1, "13_0_0"]), h = !1), c && !g && (l.os = "android", l.android = !0), (d || f || u) && (l.os = "ios", l.ios = !0), l;
319
- }
320
- function Qe(t) {
321
- return t === void 0 && (t = {}), he || (he = zt(t)), he;
322
- }
323
- let ge;
324
- function _t() {
325
- const t = N(), e = Qe();
326
- let s = !1;
327
- function r() {
328
- const a = t.navigator.userAgent.toLowerCase();
329
- return a.indexOf("safari") >= 0 && a.indexOf("chrome") < 0 && a.indexOf("android") < 0;
330
- }
331
- if (r()) {
332
- const a = String(t.navigator.userAgent);
333
- if (a.includes("Version/")) {
334
- const [o, c] = a.split("Version/")[1].split(" ")[0].split(".").map((d) => Number(d));
335
- s = o < 16 || o === 16 && c < 2;
336
- }
337
- }
338
- const n = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(t.navigator.userAgent), i = r(), l = i || n && e.ios;
339
- return {
340
- isSafari: s || i,
341
- needPerspectiveFix: s,
342
- need3dFix: l,
343
- isWebView: n
344
- };
345
- }
346
- function Ke() {
347
- return ge || (ge = _t()), ge;
348
- }
349
- function $t(t) {
350
- let {
351
- swiper: e,
352
- on: s,
353
- emit: r
354
- } = t;
355
- const n = N();
356
- let i = null, l = null;
357
- const a = () => {
358
- !e || e.destroyed || !e.initialized || (r("beforeResize"), r("resize"));
359
- }, o = () => {
360
- !e || e.destroyed || !e.initialized || (i = new ResizeObserver((u) => {
361
- l = n.requestAnimationFrame(() => {
362
- const {
363
- width: f,
364
- height: g
365
- } = e;
366
- let h = f, b = g;
367
- u.forEach((M) => {
368
- let {
369
- contentBoxSize: w,
370
- contentRect: p,
371
- target: m
372
- } = M;
373
- m && m !== e.el || (h = p ? p.width : (w[0] || w).inlineSize, b = p ? p.height : (w[0] || w).blockSize);
374
- }), (h !== f || b !== g) && a();
375
- });
376
- }), i.observe(e.el));
377
- }, c = () => {
378
- l && n.cancelAnimationFrame(l), i && i.unobserve && e.el && (i.unobserve(e.el), i = null);
379
- }, d = () => {
380
- !e || e.destroyed || !e.initialized || r("orientationchange");
381
- };
382
- s("init", () => {
383
- if (e.params.resizeObserver && typeof n.ResizeObserver < "u") {
384
- o();
385
- return;
386
- }
387
- n.addEventListener("resize", a), n.addEventListener("orientationchange", d);
388
- }), s("destroy", () => {
389
- c(), n.removeEventListener("resize", a), n.removeEventListener("orientationchange", d);
390
- });
391
- }
392
- function Gt(t) {
393
- let {
394
- swiper: e,
395
- extendParams: s,
396
- on: r,
397
- emit: n
398
- } = t;
399
- const i = [], l = N(), a = function(d, u) {
400
- u === void 0 && (u = {});
401
- const f = l.MutationObserver || l.WebkitMutationObserver, g = new f((h) => {
402
- if (e.__preventObserver__) return;
403
- if (h.length === 1) {
404
- n("observerUpdate", h[0]);
405
- return;
406
- }
407
- const b = function() {
408
- n("observerUpdate", h[0]);
409
- };
410
- l.requestAnimationFrame ? l.requestAnimationFrame(b) : l.setTimeout(b, 0);
411
- });
412
- g.observe(d, {
413
- attributes: typeof u.attributes > "u" ? !0 : u.attributes,
414
- childList: e.isElement || (typeof u.childList > "u" ? !0 : u).childList,
415
- characterData: typeof u.characterData > "u" ? !0 : u.characterData
416
- }), i.push(g);
417
- }, o = () => {
418
- if (e.params.observer) {
419
- if (e.params.observeParents) {
420
- const d = Xe(e.hostEl);
421
- for (let u = 0; u < d.length; u += 1)
422
- a(d[u]);
423
- }
424
- a(e.hostEl, {
425
- childList: e.params.observeSlideChildren
426
- }), a(e.wrapperEl, {
427
- attributes: !1
428
- });
429
- }
430
- }, c = () => {
431
- i.forEach((d) => {
432
- d.disconnect();
433
- }), i.splice(0, i.length);
434
- };
435
- s({
436
- observer: !1,
437
- observeParents: !1,
438
- observeSlideChildren: !1
439
- }), r("init", o), r("destroy", c);
440
- }
441
- var Nt = {
442
- on(t, e, s) {
443
- const r = this;
444
- if (!r.eventsListeners || r.destroyed || typeof e != "function") return r;
445
- const n = s ? "unshift" : "push";
446
- return t.split(" ").forEach((i) => {
447
- r.eventsListeners[i] || (r.eventsListeners[i] = []), r.eventsListeners[i][n](e);
448
- }), r;
449
- },
450
- once(t, e, s) {
451
- const r = this;
452
- if (!r.eventsListeners || r.destroyed || typeof e != "function") return r;
453
- function n() {
454
- r.off(t, n), n.__emitterProxy && delete n.__emitterProxy;
455
- for (var i = arguments.length, l = new Array(i), a = 0; a < i; a++)
456
- l[a] = arguments[a];
457
- e.apply(r, l);
458
- }
459
- return n.__emitterProxy = e, r.on(t, n, s);
460
- },
461
- onAny(t, e) {
462
- const s = this;
463
- if (!s.eventsListeners || s.destroyed || typeof t != "function") return s;
464
- const r = e ? "unshift" : "push";
465
- return s.eventsAnyListeners.indexOf(t) < 0 && s.eventsAnyListeners[r](t), s;
466
- },
467
- offAny(t) {
468
- const e = this;
469
- if (!e.eventsListeners || e.destroyed || !e.eventsAnyListeners) return e;
470
- const s = e.eventsAnyListeners.indexOf(t);
471
- return s >= 0 && e.eventsAnyListeners.splice(s, 1), e;
472
- },
473
- off(t, e) {
474
- const s = this;
475
- return !s.eventsListeners || s.destroyed || !s.eventsListeners || t.split(" ").forEach((r) => {
476
- typeof e > "u" ? s.eventsListeners[r] = [] : s.eventsListeners[r] && s.eventsListeners[r].forEach((n, i) => {
477
- (n === e || n.__emitterProxy && n.__emitterProxy === e) && s.eventsListeners[r].splice(i, 1);
478
- });
479
- }), s;
480
- },
481
- emit() {
482
- const t = this;
483
- if (!t.eventsListeners || t.destroyed || !t.eventsListeners) return t;
484
- let e, s, r;
485
- for (var n = arguments.length, i = new Array(n), l = 0; l < n; l++)
486
- i[l] = arguments[l];
487
- return typeof i[0] == "string" || Array.isArray(i[0]) ? (e = i[0], s = i.slice(1, i.length), r = t) : (e = i[0].events, s = i[0].data, r = i[0].context || t), s.unshift(r), (Array.isArray(e) ? e : e.split(" ")).forEach((a) => {
488
- t.eventsAnyListeners && t.eventsAnyListeners.length && t.eventsAnyListeners.forEach((o) => {
489
- o.apply(r, [a, ...s]);
490
- }), t.eventsListeners && t.eventsListeners[a] && t.eventsListeners[a].forEach((o) => {
491
- o.apply(r, s);
492
- });
493
- }), t;
494
- }
495
- };
496
- function Bt() {
497
- const t = this;
498
- let e, s;
499
- const r = t.el;
500
- typeof t.params.width < "u" && t.params.width !== null ? e = t.params.width : e = r.clientWidth, typeof t.params.height < "u" && t.params.height !== null ? s = t.params.height : s = r.clientHeight, !(e === 0 && t.isHorizontal() || s === 0 && t.isVertical()) && (e = e - parseInt(Y(r, "padding-left") || 0, 10) - parseInt(Y(r, "padding-right") || 0, 10), s = s - parseInt(Y(r, "padding-top") || 0, 10) - parseInt(Y(r, "padding-bottom") || 0, 10), Number.isNaN(e) && (e = 0), Number.isNaN(s) && (s = 0), Object.assign(t, {
501
- width: e,
502
- height: s,
503
- size: t.isHorizontal() ? e : s
504
- }));
505
- }
506
- function Dt() {
507
- const t = this;
508
- function e(E, x) {
509
- return parseFloat(E.getPropertyValue(t.getDirectionLabel(x)) || 0);
510
- }
511
- const s = t.params, {
512
- wrapperEl: r,
513
- slidesEl: n,
514
- size: i,
515
- rtlTranslate: l,
516
- wrongRTL: a
517
- } = t, o = t.virtual && s.virtual.enabled, c = o ? t.virtual.slides.length : t.slides.length, d = H(n, `.${t.params.slideClass}, swiper-slide`), u = o ? t.virtual.slides.length : d.length;
518
- let f = [];
519
- const g = [], h = [];
520
- let b = s.slidesOffsetBefore;
521
- typeof b == "function" && (b = s.slidesOffsetBefore.call(t));
522
- let M = s.slidesOffsetAfter;
523
- typeof M == "function" && (M = s.slidesOffsetAfter.call(t));
524
- const w = t.snapGrid.length, p = t.slidesGrid.length;
525
- let m = s.spaceBetween, v = -b, y = 0, T = 0;
526
- if (typeof i > "u")
527
- return;
528
- typeof m == "string" && m.indexOf("%") >= 0 ? m = parseFloat(m.replace("%", "")) / 100 * i : typeof m == "string" && (m = parseFloat(m)), t.virtualSize = -m, d.forEach((E) => {
529
- l ? E.style.marginLeft = "" : E.style.marginRight = "", E.style.marginBottom = "", E.style.marginTop = "";
530
- }), s.centeredSlides && s.cssMode && (re(r, "--swiper-centered-offset-before", ""), re(r, "--swiper-centered-offset-after", ""));
531
- const A = s.grid && s.grid.rows > 1 && t.grid;
532
- A ? t.grid.initSlides(d) : t.grid && t.grid.unsetSlides();
533
- let I;
534
- const S = s.slidesPerView === "auto" && s.breakpoints && Object.keys(s.breakpoints).filter((E) => typeof s.breakpoints[E].slidesPerView < "u").length > 0;
535
- for (let E = 0; E < u; E += 1) {
536
- I = 0;
537
- let x;
538
- if (d[E] && (x = d[E]), A && t.grid.updateSlide(E, x, d), !(d[E] && Y(x, "display") === "none")) {
539
- if (s.slidesPerView === "auto") {
540
- S && (d[E].style[t.getDirectionLabel("width")] = "");
541
- const k = getComputedStyle(x), L = x.style.transform, O = x.style.webkitTransform;
542
- if (L && (x.style.transform = "none"), O && (x.style.webkitTransform = "none"), s.roundLengths)
543
- I = t.isHorizontal() ? Te(x, "width") : Te(x, "height");
544
- else {
545
- const C = e(k, "width"), z = e(k, "padding-left"), U = e(k, "padding-right"), j = e(k, "margin-left"), G = e(k, "margin-right"), V = k.getPropertyValue("box-sizing");
546
- if (V && V === "border-box")
547
- I = C + j + G;
548
- else {
549
- const {
550
- clientWidth: ut,
551
- offsetWidth: mt
552
- } = x;
553
- I = C + z + U + j + G + (mt - ut);
554
- }
555
- }
556
- L && (x.style.transform = L), O && (x.style.webkitTransform = O), s.roundLengths && (I = Math.floor(I));
557
- } else
558
- I = (i - (s.slidesPerView - 1) * m) / s.slidesPerView, s.roundLengths && (I = Math.floor(I)), d[E] && (d[E].style[t.getDirectionLabel("width")] = `${I}px`);
559
- d[E] && (d[E].swiperSlideSize = I), h.push(I), s.centeredSlides ? (v = v + I / 2 + y / 2 + m, y === 0 && E !== 0 && (v = v - i / 2 - m), E === 0 && (v = v - i / 2 - m), Math.abs(v) < 1 / 1e3 && (v = 0), s.roundLengths && (v = Math.floor(v)), T % s.slidesPerGroup === 0 && f.push(v), g.push(v)) : (s.roundLengths && (v = Math.floor(v)), (T - Math.min(t.params.slidesPerGroupSkip, T)) % t.params.slidesPerGroup === 0 && f.push(v), g.push(v), v = v + I + m), t.virtualSize += I + m, y = I, T += 1;
560
- }
561
- }
562
- if (t.virtualSize = Math.max(t.virtualSize, i) + M, l && a && (s.effect === "slide" || s.effect === "coverflow") && (r.style.width = `${t.virtualSize + m}px`), s.setWrapperSize && (r.style[t.getDirectionLabel("width")] = `${t.virtualSize + m}px`), A && t.grid.updateWrapperSize(I, f), !s.centeredSlides) {
563
- const E = [];
564
- for (let x = 0; x < f.length; x += 1) {
565
- let k = f[x];
566
- s.roundLengths && (k = Math.floor(k)), f[x] <= t.virtualSize - i && E.push(k);
567
- }
568
- f = E, Math.floor(t.virtualSize - i) - Math.floor(f[f.length - 1]) > 1 && f.push(t.virtualSize - i);
569
- }
570
- if (o && s.loop) {
571
- const E = h[0] + m;
572
- if (s.slidesPerGroup > 1) {
573
- const x = Math.ceil((t.virtual.slidesBefore + t.virtual.slidesAfter) / s.slidesPerGroup), k = E * s.slidesPerGroup;
574
- for (let L = 0; L < x; L += 1)
575
- f.push(f[f.length - 1] + k);
576
- }
577
- for (let x = 0; x < t.virtual.slidesBefore + t.virtual.slidesAfter; x += 1)
578
- s.slidesPerGroup === 1 && f.push(f[f.length - 1] + E), g.push(g[g.length - 1] + E), t.virtualSize += E;
579
- }
580
- if (f.length === 0 && (f = [0]), m !== 0) {
581
- const E = t.isHorizontal() && l ? "marginLeft" : t.getDirectionLabel("marginRight");
582
- d.filter((x, k) => !s.cssMode || s.loop ? !0 : k !== d.length - 1).forEach((x) => {
583
- x.style[E] = `${m}px`;
584
- });
585
- }
586
- if (s.centeredSlides && s.centeredSlidesBounds) {
587
- let E = 0;
588
- h.forEach((k) => {
589
- E += k + (m || 0);
590
- }), E -= m;
591
- const x = E > i ? E - i : 0;
592
- f = f.map((k) => k <= 0 ? -b : k > x ? x + M : k);
593
- }
594
- if (s.centerInsufficientSlides) {
595
- let E = 0;
596
- h.forEach((k) => {
597
- E += k + (m || 0);
598
- }), E -= m;
599
- const x = (s.slidesOffsetBefore || 0) + (s.slidesOffsetAfter || 0);
600
- if (E + x < i) {
601
- const k = (i - E - x) / 2;
602
- f.forEach((L, O) => {
603
- f[O] = L - k;
604
- }), g.forEach((L, O) => {
605
- g[O] = L + k;
606
- });
607
- }
608
- }
609
- if (Object.assign(t, {
610
- slides: d,
611
- snapGrid: f,
612
- slidesGrid: g,
613
- slidesSizesGrid: h
614
- }), s.centeredSlides && s.cssMode && !s.centeredSlidesBounds) {
615
- re(r, "--swiper-centered-offset-before", `${-f[0]}px`), re(r, "--swiper-centered-offset-after", `${t.size / 2 - h[h.length - 1] / 2}px`);
616
- const E = -t.snapGrid[0], x = -t.slidesGrid[0];
617
- t.snapGrid = t.snapGrid.map((k) => k + E), t.slidesGrid = t.slidesGrid.map((k) => k + x);
618
- }
619
- if (u !== c && t.emit("slidesLengthChange"), f.length !== w && (t.params.watchOverflow && t.checkOverflow(), t.emit("snapGridLengthChange")), g.length !== p && t.emit("slidesGridLengthChange"), s.watchSlidesProgress && t.updateSlidesOffset(), t.emit("slidesUpdated"), !o && !s.cssMode && (s.effect === "slide" || s.effect === "fade")) {
620
- const E = `${s.containerModifierClass}backface-hidden`, x = t.el.classList.contains(E);
621
- u <= s.maxBackfaceHiddenSlides ? x || t.el.classList.add(E) : x && t.el.classList.remove(E);
622
- }
623
- }
624
- function Ft(t) {
625
- const e = this, s = [], r = e.virtual && e.params.virtual.enabled;
626
- let n = 0, i;
627
- typeof t == "number" ? e.setTransition(t) : t === !0 && e.setTransition(e.params.speed);
628
- const l = (a) => r ? e.slides[e.getSlideIndexByData(a)] : e.slides[a];
629
- if (e.params.slidesPerView !== "auto" && e.params.slidesPerView > 1)
630
- if (e.params.centeredSlides)
631
- (e.visibleSlides || []).forEach((a) => {
632
- s.push(a);
633
- });
634
- else
635
- for (i = 0; i < Math.ceil(e.params.slidesPerView); i += 1) {
636
- const a = e.activeIndex + i;
637
- if (a > e.slides.length && !r) break;
638
- s.push(l(a));
639
- }
640
- else
641
- s.push(l(e.activeIndex));
642
- for (i = 0; i < s.length; i += 1)
643
- if (typeof s[i] < "u") {
644
- const a = s[i].offsetHeight;
645
- n = a > n ? a : n;
646
- }
647
- (n || n === 0) && (e.wrapperEl.style.height = `${n}px`);
648
- }
649
- function jt() {
650
- const t = this, e = t.slides, s = t.isElement ? t.isHorizontal() ? t.wrapperEl.offsetLeft : t.wrapperEl.offsetTop : 0;
651
- for (let r = 0; r < e.length; r += 1)
652
- e[r].swiperSlideOffset = (t.isHorizontal() ? e[r].offsetLeft : e[r].offsetTop) - s - t.cssOverflowAdjustment();
653
- }
654
- const $e = (t, e, s) => {
655
- e && !t.classList.contains(s) ? t.classList.add(s) : !e && t.classList.contains(s) && t.classList.remove(s);
656
- };
657
- function Vt(t) {
658
- t === void 0 && (t = this && this.translate || 0);
659
- const e = this, s = e.params, {
660
- slides: r,
661
- rtlTranslate: n,
662
- snapGrid: i
663
- } = e;
664
- if (r.length === 0) return;
665
- typeof r[0].swiperSlideOffset > "u" && e.updateSlidesOffset();
666
- let l = -t;
667
- n && (l = t), e.visibleSlidesIndexes = [], e.visibleSlides = [];
668
- let a = s.spaceBetween;
669
- typeof a == "string" && a.indexOf("%") >= 0 ? a = parseFloat(a.replace("%", "")) / 100 * e.size : typeof a == "string" && (a = parseFloat(a));
670
- for (let o = 0; o < r.length; o += 1) {
671
- const c = r[o];
672
- let d = c.swiperSlideOffset;
673
- s.cssMode && s.centeredSlides && (d -= r[0].swiperSlideOffset);
674
- const u = (l + (s.centeredSlides ? e.minTranslate() : 0) - d) / (c.swiperSlideSize + a), f = (l - i[0] + (s.centeredSlides ? e.minTranslate() : 0) - d) / (c.swiperSlideSize + a), g = -(l - d), h = g + e.slidesSizesGrid[o], b = g >= 0 && g <= e.size - e.slidesSizesGrid[o], M = g >= 0 && g < e.size - 1 || h > 1 && h <= e.size || g <= 0 && h >= e.size;
675
- M && (e.visibleSlides.push(c), e.visibleSlidesIndexes.push(o)), $e(c, M, s.slideVisibleClass), $e(c, b, s.slideFullyVisibleClass), c.progress = n ? -u : u, c.originalProgress = n ? -f : f;
676
- }
677
- }
678
- function Ht(t) {
679
- const e = this;
680
- if (typeof t > "u") {
681
- const d = e.rtlTranslate ? -1 : 1;
682
- t = e && e.translate && e.translate * d || 0;
683
- }
684
- const s = e.params, r = e.maxTranslate() - e.minTranslate();
685
- let {
686
- progress: n,
687
- isBeginning: i,
688
- isEnd: l,
689
- progressLoop: a
690
- } = e;
691
- const o = i, c = l;
692
- if (r === 0)
693
- n = 0, i = !0, l = !0;
694
- else {
695
- n = (t - e.minTranslate()) / r;
696
- const d = Math.abs(t - e.minTranslate()) < 1, u = Math.abs(t - e.maxTranslate()) < 1;
697
- i = d || n <= 0, l = u || n >= 1, d && (n = 0), u && (n = 1);
698
- }
699
- if (s.loop) {
700
- const d = e.getSlideIndexByData(0), u = e.getSlideIndexByData(e.slides.length - 1), f = e.slidesGrid[d], g = e.slidesGrid[u], h = e.slidesGrid[e.slidesGrid.length - 1], b = Math.abs(t);
701
- b >= f ? a = (b - f) / h : a = (b + h - g) / h, a > 1 && (a -= 1);
702
- }
703
- Object.assign(e, {
704
- progress: n,
705
- progressLoop: a,
706
- isBeginning: i,
707
- isEnd: l
708
- }), (s.watchSlidesProgress || s.centeredSlides && s.autoHeight) && e.updateSlidesProgress(t), i && !o && e.emit("reachBeginning toEdge"), l && !c && e.emit("reachEnd toEdge"), (o && !i || c && !l) && e.emit("fromEdge"), e.emit("progress", n);
709
- }
710
- const ve = (t, e, s) => {
711
- e && !t.classList.contains(s) ? t.classList.add(s) : !e && t.classList.contains(s) && t.classList.remove(s);
712
- };
713
- function Rt() {
714
- const t = this, {
715
- slides: e,
716
- params: s,
717
- slidesEl: r,
718
- activeIndex: n
719
- } = t, i = t.virtual && s.virtual.enabled, l = t.grid && s.grid && s.grid.rows > 1, a = (u) => H(r, `.${s.slideClass}${u}, swiper-slide${u}`)[0];
720
- let o, c, d;
721
- if (i)
722
- if (s.loop) {
723
- let u = n - t.virtual.slidesBefore;
724
- u < 0 && (u = t.virtual.slides.length + u), u >= t.virtual.slides.length && (u -= t.virtual.slides.length), o = a(`[data-swiper-slide-index="${u}"]`);
725
- } else
726
- o = a(`[data-swiper-slide-index="${n}"]`);
727
- else
728
- l ? (o = e.find((u) => u.column === n), d = e.find((u) => u.column === n + 1), c = e.find((u) => u.column === n - 1)) : o = e[n];
729
- o && (l || (d = At(o, `.${s.slideClass}, swiper-slide`)[0], s.loop && !d && (d = e[0]), c = Lt(o, `.${s.slideClass}, swiper-slide`)[0], s.loop && !c === 0 && (c = e[e.length - 1]))), e.forEach((u) => {
730
- ve(u, u === o, s.slideActiveClass), ve(u, u === d, s.slideNextClass), ve(u, u === c, s.slidePrevClass);
731
- }), t.emitSlidesClasses();
732
- }
733
- const ne = (t, e) => {
734
- if (!t || t.destroyed || !t.params) return;
735
- const s = () => t.isElement ? "swiper-slide" : `.${t.params.slideClass}`, r = e.closest(s());
736
- if (r) {
737
- let n = r.querySelector(`.${t.params.lazyPreloaderClass}`);
738
- !n && t.isElement && (r.shadowRoot ? n = r.shadowRoot.querySelector(`.${t.params.lazyPreloaderClass}`) : requestAnimationFrame(() => {
739
- r.shadowRoot && (n = r.shadowRoot.querySelector(`.${t.params.lazyPreloaderClass}`), n && n.remove());
740
- })), n && n.remove();
741
- }
742
- }, we = (t, e) => {
743
- if (!t.slides[e]) return;
744
- const s = t.slides[e].querySelector('[loading="lazy"]');
745
- s && s.removeAttribute("loading");
746
- }, Ce = (t) => {
747
- if (!t || t.destroyed || !t.params) return;
748
- let e = t.params.lazyPreloadPrevNext;
749
- const s = t.slides.length;
750
- if (!s || !e || e < 0) return;
751
- e = Math.min(e, s);
752
- const r = t.params.slidesPerView === "auto" ? t.slidesPerViewDynamic() : Math.ceil(t.params.slidesPerView), n = t.activeIndex;
753
- if (t.params.grid && t.params.grid.rows > 1) {
754
- const l = n, a = [l - e];
755
- a.push(...Array.from({
756
- length: e
757
- }).map((o, c) => l + r + c)), t.slides.forEach((o, c) => {
758
- a.includes(o.column) && we(t, c);
759
- });
760
- return;
761
- }
762
- const i = n + r - 1;
763
- if (t.params.rewind || t.params.loop)
764
- for (let l = n - e; l <= i + e; l += 1) {
765
- const a = (l % s + s) % s;
766
- (a < n || a > i) && we(t, a);
767
- }
768
- else
769
- for (let l = Math.max(n - e, 0); l <= Math.min(i + e, s - 1); l += 1)
770
- l !== n && (l > i || l < n) && we(t, l);
771
- };
772
- function qt(t) {
773
- const {
774
- slidesGrid: e,
775
- params: s
776
- } = t, r = t.rtlTranslate ? t.translate : -t.translate;
777
- let n;
778
- for (let i = 0; i < e.length; i += 1)
779
- typeof e[i + 1] < "u" ? r >= e[i] && r < e[i + 1] - (e[i + 1] - e[i]) / 2 ? n = i : r >= e[i] && r < e[i + 1] && (n = i + 1) : r >= e[i] && (n = i);
780
- return s.normalizeSlideIndex && (n < 0 || typeof n > "u") && (n = 0), n;
781
- }
782
- function Wt(t) {
783
- const e = this, s = e.rtlTranslate ? e.translate : -e.translate, {
784
- snapGrid: r,
785
- params: n,
786
- activeIndex: i,
787
- realIndex: l,
788
- snapIndex: a
789
- } = e;
790
- let o = t, c;
791
- const d = (g) => {
792
- let h = g - e.virtual.slidesBefore;
793
- return h < 0 && (h = e.virtual.slides.length + h), h >= e.virtual.slides.length && (h -= e.virtual.slides.length), h;
794
- };
795
- if (typeof o > "u" && (o = qt(e)), r.indexOf(s) >= 0)
796
- c = r.indexOf(s);
797
- else {
798
- const g = Math.min(n.slidesPerGroupSkip, o);
799
- c = g + Math.floor((o - g) / n.slidesPerGroup);
800
- }
801
- if (c >= r.length && (c = r.length - 1), o === i && !e.params.loop) {
802
- c !== a && (e.snapIndex = c, e.emit("snapIndexChange"));
803
- return;
804
- }
805
- if (o === i && e.params.loop && e.virtual && e.params.virtual.enabled) {
806
- e.realIndex = d(o);
807
- return;
808
- }
809
- const u = e.grid && n.grid && n.grid.rows > 1;
810
- let f;
811
- if (e.virtual && n.virtual.enabled && n.loop)
812
- f = d(o);
813
- else if (u) {
814
- const g = e.slides.find((b) => b.column === o);
815
- let h = parseInt(g.getAttribute("data-swiper-slide-index"), 10);
816
- Number.isNaN(h) && (h = Math.max(e.slides.indexOf(g), 0)), f = Math.floor(h / n.grid.rows);
817
- } else if (e.slides[o]) {
818
- const g = e.slides[o].getAttribute("data-swiper-slide-index");
819
- g ? f = parseInt(g, 10) : f = o;
820
- } else
821
- f = o;
822
- Object.assign(e, {
823
- previousSnapIndex: a,
824
- snapIndex: c,
825
- previousRealIndex: l,
826
- realIndex: f,
827
- previousIndex: i,
828
- activeIndex: o
829
- }), e.initialized && Ce(e), e.emit("activeIndexChange"), e.emit("snapIndexChange"), (e.initialized || e.params.runCallbacksOnInit) && (l !== f && e.emit("realIndexChange"), e.emit("slideChange"));
830
- }
831
- function Yt(t, e) {
832
- const s = this, r = s.params;
833
- let n = t.closest(`.${r.slideClass}, swiper-slide`);
834
- !n && s.isElement && e && e.length > 1 && e.includes(t) && [...e.slice(e.indexOf(t) + 1, e.length)].forEach((a) => {
835
- !n && a.matches && a.matches(`.${r.slideClass}, swiper-slide`) && (n = a);
836
- });
837
- let i = !1, l;
838
- if (n) {
839
- for (let a = 0; a < s.slides.length; a += 1)
840
- if (s.slides[a] === n) {
841
- i = !0, l = a;
842
- break;
843
- }
844
- }
845
- if (n && i)
846
- s.clickedSlide = n, s.virtual && s.params.virtual.enabled ? s.clickedIndex = parseInt(n.getAttribute("data-swiper-slide-index"), 10) : s.clickedIndex = l;
847
- else {
848
- s.clickedSlide = void 0, s.clickedIndex = void 0;
849
- return;
850
- }
851
- r.slideToClickedSlide && s.clickedIndex !== void 0 && s.clickedIndex !== s.activeIndex && s.slideToClickedSlide();
852
- }
853
- var Xt = {
854
- updateSize: Bt,
855
- updateSlides: Dt,
856
- updateAutoHeight: Ft,
857
- updateSlidesOffset: jt,
858
- updateSlidesProgress: Vt,
859
- updateProgress: Ht,
860
- updateSlidesClasses: Rt,
861
- updateActiveIndex: Wt,
862
- updateClickedSlide: Yt
863
- };
864
- function Ut(t) {
865
- t === void 0 && (t = this.isHorizontal() ? "x" : "y");
866
- const e = this, {
867
- params: s,
868
- rtlTranslate: r,
869
- translate: n,
870
- wrapperEl: i
871
- } = e;
872
- if (s.virtualTranslate)
873
- return r ? -n : n;
874
- if (s.cssMode)
875
- return n;
876
- let l = Pt(i, t);
877
- return l += e.cssOverflowAdjustment(), r && (l = -l), l || 0;
878
- }
879
- function Qt(t, e) {
880
- const s = this, {
881
- rtlTranslate: r,
882
- params: n,
883
- wrapperEl: i,
884
- progress: l
885
- } = s;
886
- let a = 0, o = 0;
887
- const c = 0;
888
- s.isHorizontal() ? a = r ? -t : t : o = t, n.roundLengths && (a = Math.floor(a), o = Math.floor(o)), s.previousTranslate = s.translate, s.translate = s.isHorizontal() ? a : o, n.cssMode ? i[s.isHorizontal() ? "scrollLeft" : "scrollTop"] = s.isHorizontal() ? -a : -o : n.virtualTranslate || (s.isHorizontal() ? a -= s.cssOverflowAdjustment() : o -= s.cssOverflowAdjustment(), i.style.transform = `translate3d(${a}px, ${o}px, ${c}px)`);
889
- let d;
890
- const u = s.maxTranslate() - s.minTranslate();
891
- u === 0 ? d = 0 : d = (t - s.minTranslate()) / u, d !== l && s.updateProgress(t), s.emit("setTranslate", s.translate, e);
892
- }
893
- function Kt() {
894
- return -this.snapGrid[0];
895
- }
896
- function Jt() {
897
- return -this.snapGrid[this.snapGrid.length - 1];
898
- }
899
- function Zt(t, e, s, r, n) {
900
- t === void 0 && (t = 0), e === void 0 && (e = this.params.speed), s === void 0 && (s = !0), r === void 0 && (r = !0);
901
- const i = this, {
902
- params: l,
903
- wrapperEl: a
904
- } = i;
905
- if (i.animating && l.preventInteractionOnTransition)
906
- return !1;
907
- const o = i.minTranslate(), c = i.maxTranslate();
908
- let d;
909
- if (r && t > o ? d = o : r && t < c ? d = c : d = t, i.updateProgress(d), l.cssMode) {
910
- const u = i.isHorizontal();
911
- if (e === 0)
912
- a[u ? "scrollLeft" : "scrollTop"] = -d;
913
- else {
914
- if (!i.support.smoothScroll)
915
- return Ye({
916
- swiper: i,
917
- targetPosition: -d,
918
- side: u ? "left" : "top"
919
- }), !0;
920
- a.scrollTo({
921
- [u ? "left" : "top"]: -d,
922
- behavior: "smooth"
923
- });
924
- }
925
- return !0;
926
- }
927
- return e === 0 ? (i.setTransition(0), i.setTranslate(d), s && (i.emit("beforeTransitionStart", e, n), i.emit("transitionEnd"))) : (i.setTransition(e), i.setTranslate(d), s && (i.emit("beforeTransitionStart", e, n), i.emit("transitionStart")), i.animating || (i.animating = !0, i.onTranslateToWrapperTransitionEnd || (i.onTranslateToWrapperTransitionEnd = function(u) {
928
- !i || i.destroyed || u.target === this && (i.wrapperEl.removeEventListener("transitionend", i.onTranslateToWrapperTransitionEnd), i.onTranslateToWrapperTransitionEnd = null, delete i.onTranslateToWrapperTransitionEnd, i.animating = !1, s && i.emit("transitionEnd"));
929
- }), i.wrapperEl.addEventListener("transitionend", i.onTranslateToWrapperTransitionEnd))), !0;
930
- }
931
- var es = {
932
- getTranslate: Ut,
933
- setTranslate: Qt,
934
- minTranslate: Kt,
935
- maxTranslate: Jt,
936
- translateTo: Zt
937
- };
938
- function ts(t, e) {
939
- const s = this;
940
- s.params.cssMode || (s.wrapperEl.style.transitionDuration = `${t}ms`, s.wrapperEl.style.transitionDelay = t === 0 ? "0ms" : ""), s.emit("setTransition", t, e);
941
- }
942
- function Je(t) {
943
- let {
944
- swiper: e,
945
- runCallbacks: s,
946
- direction: r,
947
- step: n
948
- } = t;
949
- const {
950
- activeIndex: i,
951
- previousIndex: l
952
- } = e;
953
- let a = r;
954
- if (a || (i > l ? a = "next" : i < l ? a = "prev" : a = "reset"), e.emit(`transition${n}`), s && i !== l) {
955
- if (a === "reset") {
956
- e.emit(`slideResetTransition${n}`);
957
- return;
958
- }
959
- e.emit(`slideChangeTransition${n}`), a === "next" ? e.emit(`slideNextTransition${n}`) : e.emit(`slidePrevTransition${n}`);
960
- }
961
- }
962
- function ss(t, e) {
963
- t === void 0 && (t = !0);
964
- const s = this, {
965
- params: r
966
- } = s;
967
- r.cssMode || (r.autoHeight && s.updateAutoHeight(), Je({
968
- swiper: s,
969
- runCallbacks: t,
970
- direction: e,
971
- step: "Start"
972
- }));
973
- }
974
- function rs(t, e) {
975
- t === void 0 && (t = !0);
976
- const s = this, {
977
- params: r
978
- } = s;
979
- s.animating = !1, !r.cssMode && (s.setTransition(0), Je({
980
- swiper: s,
981
- runCallbacks: t,
982
- direction: e,
983
- step: "End"
984
- }));
985
- }
986
- var is = {
987
- setTransition: ts,
988
- transitionStart: ss,
989
- transitionEnd: rs
990
- };
991
- function ns(t, e, s, r, n) {
992
- t === void 0 && (t = 0), s === void 0 && (s = !0), typeof t == "string" && (t = parseInt(t, 10));
993
- const i = this;
994
- let l = t;
995
- l < 0 && (l = 0);
996
- const {
997
- params: a,
998
- snapGrid: o,
999
- slidesGrid: c,
1000
- previousIndex: d,
1001
- activeIndex: u,
1002
- rtlTranslate: f,
1003
- wrapperEl: g,
1004
- enabled: h
1005
- } = i;
1006
- if (!h && !r && !n || i.destroyed || i.animating && a.preventInteractionOnTransition)
1007
- return !1;
1008
- typeof e > "u" && (e = i.params.speed);
1009
- const b = Math.min(i.params.slidesPerGroupSkip, l);
1010
- let M = b + Math.floor((l - b) / i.params.slidesPerGroup);
1011
- M >= o.length && (M = o.length - 1);
1012
- const w = -o[M];
1013
- if (a.normalizeSlideIndex)
1014
- for (let y = 0; y < c.length; y += 1) {
1015
- const T = -Math.floor(w * 100), A = Math.floor(c[y] * 100), I = Math.floor(c[y + 1] * 100);
1016
- typeof c[y + 1] < "u" ? T >= A && T < I - (I - A) / 2 ? l = y : T >= A && T < I && (l = y + 1) : T >= A && (l = y);
1017
- }
1018
- if (i.initialized && l !== u && (!i.allowSlideNext && (f ? w > i.translate && w > i.minTranslate() : w < i.translate && w < i.minTranslate()) || !i.allowSlidePrev && w > i.translate && w > i.maxTranslate() && (u || 0) !== l))
1019
- return !1;
1020
- l !== (d || 0) && s && i.emit("beforeSlideChangeStart"), i.updateProgress(w);
1021
- let p;
1022
- l > u ? p = "next" : l < u ? p = "prev" : p = "reset";
1023
- const m = i.virtual && i.params.virtual.enabled;
1024
- if (!(m && n) && (f && -w === i.translate || !f && w === i.translate))
1025
- return i.updateActiveIndex(l), a.autoHeight && i.updateAutoHeight(), i.updateSlidesClasses(), a.effect !== "slide" && i.setTranslate(w), p !== "reset" && (i.transitionStart(s, p), i.transitionEnd(s, p)), !1;
1026
- if (a.cssMode) {
1027
- const y = i.isHorizontal(), T = f ? w : -w;
1028
- if (e === 0)
1029
- m && (i.wrapperEl.style.scrollSnapType = "none", i._immediateVirtual = !0), m && !i._cssModeVirtualInitialSet && i.params.initialSlide > 0 ? (i._cssModeVirtualInitialSet = !0, requestAnimationFrame(() => {
1030
- g[y ? "scrollLeft" : "scrollTop"] = T;
1031
- })) : g[y ? "scrollLeft" : "scrollTop"] = T, m && requestAnimationFrame(() => {
1032
- i.wrapperEl.style.scrollSnapType = "", i._immediateVirtual = !1;
1033
- });
1034
- else {
1035
- if (!i.support.smoothScroll)
1036
- return Ye({
1037
- swiper: i,
1038
- targetPosition: T,
1039
- side: y ? "left" : "top"
1040
- }), !0;
1041
- g.scrollTo({
1042
- [y ? "left" : "top"]: T,
1043
- behavior: "smooth"
1044
- });
1045
- }
1046
- return !0;
1047
- }
1048
- const v = Ke().isSafari;
1049
- return m && !n && v && i.isElement && i.virtual.update(!1, !1, l), i.setTransition(e), i.setTranslate(w), i.updateActiveIndex(l), i.updateSlidesClasses(), i.emit("beforeTransitionStart", e, r), i.transitionStart(s, p), e === 0 ? i.transitionEnd(s, p) : i.animating || (i.animating = !0, i.onSlideToWrapperTransitionEnd || (i.onSlideToWrapperTransitionEnd = function(y) {
1050
- !i || i.destroyed || y.target === this && (i.wrapperEl.removeEventListener("transitionend", i.onSlideToWrapperTransitionEnd), i.onSlideToWrapperTransitionEnd = null, delete i.onSlideToWrapperTransitionEnd, i.transitionEnd(s, p));
1051
- }), i.wrapperEl.addEventListener("transitionend", i.onSlideToWrapperTransitionEnd)), !0;
1052
- }
1053
- function as(t, e, s, r) {
1054
- t === void 0 && (t = 0), s === void 0 && (s = !0), typeof t == "string" && (t = parseInt(t, 10));
1055
- const n = this;
1056
- if (n.destroyed) return;
1057
- typeof e > "u" && (e = n.params.speed);
1058
- const i = n.grid && n.params.grid && n.params.grid.rows > 1;
1059
- let l = t;
1060
- if (n.params.loop)
1061
- if (n.virtual && n.params.virtual.enabled)
1062
- l = l + n.virtual.slidesBefore;
1063
- else {
1064
- let a;
1065
- if (i) {
1066
- const f = l * n.params.grid.rows;
1067
- a = n.slides.find((g) => g.getAttribute("data-swiper-slide-index") * 1 === f).column;
1068
- } else
1069
- a = n.getSlideIndexByData(l);
1070
- const o = i ? Math.ceil(n.slides.length / n.params.grid.rows) : n.slides.length, {
1071
- centeredSlides: c
1072
- } = n.params;
1073
- let d = n.params.slidesPerView;
1074
- d === "auto" ? d = n.slidesPerViewDynamic() : (d = Math.ceil(parseFloat(n.params.slidesPerView, 10)), c && d % 2 === 0 && (d = d + 1));
1075
- let u = o - a < d;
1076
- if (c && (u = u || a < Math.ceil(d / 2)), r && c && n.params.slidesPerView !== "auto" && !i && (u = !1), u) {
1077
- const f = c ? a < n.activeIndex ? "prev" : "next" : a - n.activeIndex - 1 < n.params.slidesPerView ? "next" : "prev";
1078
- n.loopFix({
1079
- direction: f,
1080
- slideTo: !0,
1081
- activeSlideIndex: f === "next" ? a + 1 : a - o + 1,
1082
- slideRealIndex: f === "next" ? n.realIndex : void 0
1083
- });
1084
- }
1085
- if (i) {
1086
- const f = l * n.params.grid.rows;
1087
- l = n.slides.find((g) => g.getAttribute("data-swiper-slide-index") * 1 === f).column;
1088
- } else
1089
- l = n.getSlideIndexByData(l);
1090
- }
1091
- return requestAnimationFrame(() => {
1092
- n.slideTo(l, e, s, r);
1093
- }), n;
1094
- }
1095
- function ls(t, e, s) {
1096
- e === void 0 && (e = !0);
1097
- const r = this, {
1098
- enabled: n,
1099
- params: i,
1100
- animating: l
1101
- } = r;
1102
- if (!n || r.destroyed) return r;
1103
- typeof t > "u" && (t = r.params.speed);
1104
- let a = i.slidesPerGroup;
1105
- i.slidesPerView === "auto" && i.slidesPerGroup === 1 && i.slidesPerGroupAuto && (a = Math.max(r.slidesPerViewDynamic("current", !0), 1));
1106
- const o = r.activeIndex < i.slidesPerGroupSkip ? 1 : a, c = r.virtual && i.virtual.enabled;
1107
- if (i.loop) {
1108
- if (l && !c && i.loopPreventsSliding) return !1;
1109
- if (r.loopFix({
1110
- direction: "next"
1111
- }), r._clientLeft = r.wrapperEl.clientLeft, r.activeIndex === r.slides.length - 1 && i.cssMode)
1112
- return requestAnimationFrame(() => {
1113
- r.slideTo(r.activeIndex + o, t, e, s);
1114
- }), !0;
1115
- }
1116
- return i.rewind && r.isEnd ? r.slideTo(0, t, e, s) : r.slideTo(r.activeIndex + o, t, e, s);
1117
- }
1118
- function os(t, e, s) {
1119
- e === void 0 && (e = !0);
1120
- const r = this, {
1121
- params: n,
1122
- snapGrid: i,
1123
- slidesGrid: l,
1124
- rtlTranslate: a,
1125
- enabled: o,
1126
- animating: c
1127
- } = r;
1128
- if (!o || r.destroyed) return r;
1129
- typeof t > "u" && (t = r.params.speed);
1130
- const d = r.virtual && n.virtual.enabled;
1131
- if (n.loop) {
1132
- if (c && !d && n.loopPreventsSliding) return !1;
1133
- r.loopFix({
1134
- direction: "prev"
1135
- }), r._clientLeft = r.wrapperEl.clientLeft;
1136
- }
1137
- const u = a ? r.translate : -r.translate;
1138
- function f(p) {
1139
- return p < 0 ? -Math.floor(Math.abs(p)) : Math.floor(p);
1140
- }
1141
- const g = f(u), h = i.map((p) => f(p)), b = n.freeMode && n.freeMode.enabled;
1142
- let M = i[h.indexOf(g) - 1];
1143
- if (typeof M > "u" && (n.cssMode || b)) {
1144
- let p;
1145
- i.forEach((m, v) => {
1146
- g >= m && (p = v);
1147
- }), typeof p < "u" && (M = b ? i[p] : i[p > 0 ? p - 1 : p]);
1148
- }
1149
- let w = 0;
1150
- if (typeof M < "u" && (w = l.indexOf(M), w < 0 && (w = r.activeIndex - 1), n.slidesPerView === "auto" && n.slidesPerGroup === 1 && n.slidesPerGroupAuto && (w = w - r.slidesPerViewDynamic("previous", !0) + 1, w = Math.max(w, 0))), n.rewind && r.isBeginning) {
1151
- const p = r.params.virtual && r.params.virtual.enabled && r.virtual ? r.virtual.slides.length - 1 : r.slides.length - 1;
1152
- return r.slideTo(p, t, e, s);
1153
- } else if (n.loop && r.activeIndex === 0 && n.cssMode)
1154
- return requestAnimationFrame(() => {
1155
- r.slideTo(w, t, e, s);
1156
- }), !0;
1157
- return r.slideTo(w, t, e, s);
1158
- }
1159
- function ds(t, e, s) {
1160
- e === void 0 && (e = !0);
1161
- const r = this;
1162
- if (!r.destroyed)
1163
- return typeof t > "u" && (t = r.params.speed), r.slideTo(r.activeIndex, t, e, s);
1164
- }
1165
- function cs(t, e, s, r) {
1166
- e === void 0 && (e = !0), r === void 0 && (r = 0.5);
1167
- const n = this;
1168
- if (n.destroyed) return;
1169
- typeof t > "u" && (t = n.params.speed);
1170
- let i = n.activeIndex;
1171
- const l = Math.min(n.params.slidesPerGroupSkip, i), a = l + Math.floor((i - l) / n.params.slidesPerGroup), o = n.rtlTranslate ? n.translate : -n.translate;
1172
- if (o >= n.snapGrid[a]) {
1173
- const c = n.snapGrid[a], d = n.snapGrid[a + 1];
1174
- o - c > (d - c) * r && (i += n.params.slidesPerGroup);
1175
- } else {
1176
- const c = n.snapGrid[a - 1], d = n.snapGrid[a];
1177
- o - c <= (d - c) * r && (i -= n.params.slidesPerGroup);
1178
- }
1179
- return i = Math.max(i, 0), i = Math.min(i, n.slidesGrid.length - 1), n.slideTo(i, t, e, s);
1180
- }
1181
- function ps() {
1182
- const t = this;
1183
- if (t.destroyed) return;
1184
- const {
1185
- params: e,
1186
- slidesEl: s
1187
- } = t, r = e.slidesPerView === "auto" ? t.slidesPerViewDynamic() : e.slidesPerView;
1188
- let n = t.clickedIndex, i;
1189
- const l = t.isElement ? "swiper-slide" : `.${e.slideClass}`;
1190
- if (e.loop) {
1191
- if (t.animating) return;
1192
- i = parseInt(t.clickedSlide.getAttribute("data-swiper-slide-index"), 10), e.centeredSlides ? n < t.loopedSlides - r / 2 || n > t.slides.length - t.loopedSlides + r / 2 ? (t.loopFix(), n = t.getSlideIndex(H(s, `${l}[data-swiper-slide-index="${i}"]`)[0]), xe(() => {
1193
- t.slideTo(n);
1194
- })) : t.slideTo(n) : n > t.slides.length - r ? (t.loopFix(), n = t.getSlideIndex(H(s, `${l}[data-swiper-slide-index="${i}"]`)[0]), xe(() => {
1195
- t.slideTo(n);
1196
- })) : t.slideTo(n);
1197
- } else
1198
- t.slideTo(n);
1199
- }
1200
- var us = {
1201
- slideTo: ns,
1202
- slideToLoop: as,
1203
- slideNext: ls,
1204
- slidePrev: os,
1205
- slideReset: ds,
1206
- slideToClosest: cs,
1207
- slideToClickedSlide: ps
1208
- };
1209
- function ms(t, e) {
1210
- const s = this, {
1211
- params: r,
1212
- slidesEl: n
1213
- } = s;
1214
- if (!r.loop || s.virtual && s.params.virtual.enabled) return;
1215
- const i = () => {
1216
- H(n, `.${r.slideClass}, swiper-slide`).forEach((u, f) => {
1217
- u.setAttribute("data-swiper-slide-index", f);
1218
- });
1219
- }, l = s.grid && r.grid && r.grid.rows > 1, a = r.slidesPerGroup * (l ? r.grid.rows : 1), o = s.slides.length % a !== 0, c = l && s.slides.length % r.grid.rows !== 0, d = (u) => {
1220
- for (let f = 0; f < u; f += 1) {
1221
- const g = s.isElement ? de("swiper-slide", [r.slideBlankClass]) : de("div", [r.slideClass, r.slideBlankClass]);
1222
- s.slidesEl.append(g);
1223
- }
1224
- };
1225
- if (o) {
1226
- if (r.loopAddBlankSlides) {
1227
- const u = a - s.slides.length % a;
1228
- d(u), s.recalcSlides(), s.updateSlides();
1229
- } else
1230
- oe("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");
1231
- i();
1232
- } else if (c) {
1233
- if (r.loopAddBlankSlides) {
1234
- const u = r.grid.rows - s.slides.length % r.grid.rows;
1235
- d(u), s.recalcSlides(), s.updateSlides();
1236
- } else
1237
- oe("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");
1238
- i();
1239
- } else
1240
- i();
1241
- s.loopFix({
1242
- slideRealIndex: t,
1243
- direction: r.centeredSlides ? void 0 : "next",
1244
- initial: e
1245
- });
1246
- }
1247
- function fs(t) {
1248
- let {
1249
- slideRealIndex: e,
1250
- slideTo: s = !0,
1251
- direction: r,
1252
- setTranslate: n,
1253
- activeSlideIndex: i,
1254
- initial: l,
1255
- byController: a,
1256
- byMousewheel: o
1257
- } = t === void 0 ? {} : t;
1258
- const c = this;
1259
- if (!c.params.loop) return;
1260
- c.emit("beforeLoopFix");
1261
- const {
1262
- slides: d,
1263
- allowSlidePrev: u,
1264
- allowSlideNext: f,
1265
- slidesEl: g,
1266
- params: h
1267
- } = c, {
1268
- centeredSlides: b,
1269
- initialSlide: M
1270
- } = h;
1271
- if (c.allowSlidePrev = !0, c.allowSlideNext = !0, c.virtual && h.virtual.enabled) {
1272
- s && (!h.centeredSlides && c.snapIndex === 0 ? c.slideTo(c.virtual.slides.length, 0, !1, !0) : h.centeredSlides && c.snapIndex < h.slidesPerView ? c.slideTo(c.virtual.slides.length + c.snapIndex, 0, !1, !0) : c.snapIndex === c.snapGrid.length - 1 && c.slideTo(c.virtual.slidesBefore, 0, !1, !0)), c.allowSlidePrev = u, c.allowSlideNext = f, c.emit("loopFix");
1273
- return;
1274
- }
1275
- let w = h.slidesPerView;
1276
- w === "auto" ? w = c.slidesPerViewDynamic() : (w = Math.ceil(parseFloat(h.slidesPerView, 10)), b && w % 2 === 0 && (w = w + 1));
1277
- const p = h.slidesPerGroupAuto ? w : h.slidesPerGroup;
1278
- let m = p;
1279
- m % p !== 0 && (m += p - m % p), m += h.loopAdditionalSlides, c.loopedSlides = m;
1280
- const v = c.grid && h.grid && h.grid.rows > 1;
1281
- d.length < w + m || c.params.effect === "cards" && d.length < w + m * 2 ? oe("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters") : v && h.grid.fill === "row" && oe("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");
1282
- const y = [], T = [], A = v ? Math.ceil(d.length / h.grid.rows) : d.length, I = l && A - M < w && !b;
1283
- let S = I ? M : c.activeIndex;
1284
- typeof i > "u" ? i = c.getSlideIndex(d.find((C) => C.classList.contains(h.slideActiveClass))) : S = i;
1285
- const E = r === "next" || !r, x = r === "prev" || !r;
1286
- let k = 0, L = 0;
1287
- const O = (v ? d[i].column : i) + (b && typeof n > "u" ? -w / 2 + 0.5 : 0);
1288
- if (O < m) {
1289
- k = Math.max(m - O, p);
1290
- for (let C = 0; C < m - O; C += 1) {
1291
- const z = C - Math.floor(C / A) * A;
1292
- if (v) {
1293
- const U = A - z - 1;
1294
- for (let j = d.length - 1; j >= 0; j -= 1)
1295
- d[j].column === U && y.push(j);
1296
- } else
1297
- y.push(A - z - 1);
1298
- }
1299
- } else if (O + w > A - m) {
1300
- L = Math.max(O - (A - m * 2), p), I && (L = Math.max(L, w - A + M + 1));
1301
- for (let C = 0; C < L; C += 1) {
1302
- const z = C - Math.floor(C / A) * A;
1303
- v ? d.forEach((U, j) => {
1304
- U.column === z && T.push(j);
1305
- }) : T.push(z);
1306
- }
1307
- }
1308
- if (c.__preventObserver__ = !0, requestAnimationFrame(() => {
1309
- c.__preventObserver__ = !1;
1310
- }), c.params.effect === "cards" && d.length < w + m * 2 && (T.includes(i) && T.splice(T.indexOf(i), 1), y.includes(i) && y.splice(y.indexOf(i), 1)), x && y.forEach((C) => {
1311
- d[C].swiperLoopMoveDOM = !0, g.prepend(d[C]), d[C].swiperLoopMoveDOM = !1;
1312
- }), E && T.forEach((C) => {
1313
- d[C].swiperLoopMoveDOM = !0, g.append(d[C]), d[C].swiperLoopMoveDOM = !1;
1314
- }), c.recalcSlides(), h.slidesPerView === "auto" ? c.updateSlides() : v && (y.length > 0 && x || T.length > 0 && E) && c.slides.forEach((C, z) => {
1315
- c.grid.updateSlide(z, C, c.slides);
1316
- }), h.watchSlidesProgress && c.updateSlidesOffset(), s) {
1317
- if (y.length > 0 && x) {
1318
- if (typeof e > "u") {
1319
- const C = c.slidesGrid[S], z = c.slidesGrid[S + k] - C;
1320
- o ? c.setTranslate(c.translate - z) : (c.slideTo(S + Math.ceil(k), 0, !1, !0), n && (c.touchEventsData.startTranslate = c.touchEventsData.startTranslate - z, c.touchEventsData.currentTranslate = c.touchEventsData.currentTranslate - z));
1321
- } else if (n) {
1322
- const C = v ? y.length / h.grid.rows : y.length;
1323
- c.slideTo(c.activeIndex + C, 0, !1, !0), c.touchEventsData.currentTranslate = c.translate;
1324
- }
1325
- } else if (T.length > 0 && E)
1326
- if (typeof e > "u") {
1327
- const C = c.slidesGrid[S], z = c.slidesGrid[S - L] - C;
1328
- o ? c.setTranslate(c.translate - z) : (c.slideTo(S - L, 0, !1, !0), n && (c.touchEventsData.startTranslate = c.touchEventsData.startTranslate - z, c.touchEventsData.currentTranslate = c.touchEventsData.currentTranslate - z));
1329
- } else {
1330
- const C = v ? T.length / h.grid.rows : T.length;
1331
- c.slideTo(c.activeIndex - C, 0, !1, !0);
1332
- }
1333
- }
1334
- if (c.allowSlidePrev = u, c.allowSlideNext = f, c.controller && c.controller.control && !a) {
1335
- const C = {
1336
- slideRealIndex: e,
1337
- direction: r,
1338
- setTranslate: n,
1339
- activeSlideIndex: i,
1340
- byController: !0
1341
- };
1342
- Array.isArray(c.controller.control) ? c.controller.control.forEach((z) => {
1343
- !z.destroyed && z.params.loop && z.loopFix({
1344
- ...C,
1345
- slideTo: z.params.slidesPerView === h.slidesPerView ? s : !1
1346
- });
1347
- }) : c.controller.control instanceof c.constructor && c.controller.control.params.loop && c.controller.control.loopFix({
1348
- ...C,
1349
- slideTo: c.controller.control.params.slidesPerView === h.slidesPerView ? s : !1
1350
- });
1351
- }
1352
- c.emit("loopFix");
1353
- }
1354
- function hs() {
1355
- const t = this, {
1356
- params: e,
1357
- slidesEl: s
1358
- } = t;
1359
- if (!e.loop || !s || t.virtual && t.params.virtual.enabled) return;
1360
- t.recalcSlides();
1361
- const r = [];
1362
- t.slides.forEach((n) => {
1363
- const i = typeof n.swiperSlideIndex > "u" ? n.getAttribute("data-swiper-slide-index") * 1 : n.swiperSlideIndex;
1364
- r[i] = n;
1365
- }), t.slides.forEach((n) => {
1366
- n.removeAttribute("data-swiper-slide-index");
1367
- }), r.forEach((n) => {
1368
- s.append(n);
1369
- }), t.recalcSlides(), t.slideTo(t.realIndex, 0);
1370
- }
1371
- var gs = {
1372
- loopCreate: ms,
1373
- loopFix: fs,
1374
- loopDestroy: hs
1375
- };
1376
- function vs(t) {
1377
- const e = this;
1378
- if (!e.params.simulateTouch || e.params.watchOverflow && e.isLocked || e.params.cssMode) return;
1379
- const s = e.params.touchEventsTarget === "container" ? e.el : e.wrapperEl;
1380
- e.isElement && (e.__preventObserver__ = !0), s.style.cursor = "move", s.style.cursor = t ? "grabbing" : "grab", e.isElement && requestAnimationFrame(() => {
1381
- e.__preventObserver__ = !1;
1382
- });
1383
- }
1384
- function ws() {
1385
- const t = this;
1386
- t.params.watchOverflow && t.isLocked || t.params.cssMode || (t.isElement && (t.__preventObserver__ = !0), t[t.params.touchEventsTarget === "container" ? "el" : "wrapperEl"].style.cursor = "", t.isElement && requestAnimationFrame(() => {
1387
- t.__preventObserver__ = !1;
1388
- }));
1389
- }
1390
- var bs = {
1391
- setGrabCursor: vs,
1392
- unsetGrabCursor: ws
1393
- };
1394
- function ys(t, e) {
1395
- e === void 0 && (e = this);
1396
- function s(r) {
1397
- if (!r || r === K() || r === N()) return null;
1398
- r.assignedSlot && (r = r.assignedSlot);
1399
- const n = r.closest(t);
1400
- return !n && !r.getRootNode ? null : n || s(r.getRootNode().host);
1401
- }
1402
- return s(e);
1403
- }
1404
- function Ge(t, e, s) {
1405
- const r = N(), {
1406
- params: n
1407
- } = t, i = n.edgeSwipeDetection, l = n.edgeSwipeThreshold;
1408
- return i && (s <= l || s >= r.innerWidth - l) ? i === "prevent" ? (e.preventDefault(), !0) : !1 : !0;
1409
- }
1410
- function Ss(t) {
1411
- const e = this, s = K();
1412
- let r = t;
1413
- r.originalEvent && (r = r.originalEvent);
1414
- const n = e.touchEventsData;
1415
- if (r.type === "pointerdown") {
1416
- if (n.pointerId !== null && n.pointerId !== r.pointerId)
1417
- return;
1418
- n.pointerId = r.pointerId;
1419
- } else r.type === "touchstart" && r.targetTouches.length === 1 && (n.touchId = r.targetTouches[0].identifier);
1420
- if (r.type === "touchstart") {
1421
- Ge(e, r, r.targetTouches[0].pageX);
1422
- return;
1423
- }
1424
- const {
1425
- params: i,
1426
- touches: l,
1427
- enabled: a
1428
- } = e;
1429
- if (!a || !i.simulateTouch && r.pointerType === "mouse" || e.animating && i.preventInteractionOnTransition)
1430
- return;
1431
- !e.animating && i.cssMode && i.loop && e.loopFix();
1432
- let o = r.target;
1433
- if (i.touchEventsTarget === "wrapper" && !It(o, e.wrapperEl) || "which" in r && r.which === 3 || "button" in r && r.button > 0 || n.isTouched && n.isMoved) return;
1434
- const c = !!i.noSwipingClass && i.noSwipingClass !== "", d = r.composedPath ? r.composedPath() : r.path;
1435
- c && r.target && r.target.shadowRoot && d && (o = d[0]);
1436
- const u = i.noSwipingSelector ? i.noSwipingSelector : `.${i.noSwipingClass}`, f = !!(r.target && r.target.shadowRoot);
1437
- if (i.noSwiping && (f ? ys(u, o) : o.closest(u))) {
1438
- e.allowClick = !0;
1439
- return;
1440
- }
1441
- if (i.swipeHandler && !o.closest(i.swipeHandler))
1442
- return;
1443
- l.currentX = r.pageX, l.currentY = r.pageY;
1444
- const g = l.currentX, h = l.currentY;
1445
- if (!Ge(e, r, g))
1446
- return;
1447
- Object.assign(n, {
1448
- isTouched: !0,
1449
- isMoved: !1,
1450
- allowTouchCallbacks: !0,
1451
- isScrolling: void 0,
1452
- startMoving: void 0
1453
- }), l.startX = g, l.startY = h, n.touchStartTime = le(), e.allowClick = !0, e.updateSize(), e.swipeDirection = void 0, i.threshold > 0 && (n.allowThresholdMove = !1);
1454
- let b = !0;
1455
- o.matches(n.focusableElements) && (b = !1, o.nodeName === "SELECT" && (n.isTouched = !1)), s.activeElement && s.activeElement.matches(n.focusableElements) && s.activeElement !== o && (r.pointerType === "mouse" || r.pointerType !== "mouse" && !o.matches(n.focusableElements)) && s.activeElement.blur();
1456
- const M = b && e.allowTouchMove && i.touchStartPreventDefault;
1457
- (i.touchStartForcePreventDefault || M) && !o.isContentEditable && r.preventDefault(), i.freeMode && i.freeMode.enabled && e.freeMode && e.animating && !i.cssMode && e.freeMode.onTouchStart(), e.emit("touchStart", r);
1458
- }
1459
- function Es(t) {
1460
- const e = K(), s = this, r = s.touchEventsData, {
1461
- params: n,
1462
- touches: i,
1463
- rtlTranslate: l,
1464
- enabled: a
1465
- } = s;
1466
- if (!a || !n.simulateTouch && t.pointerType === "mouse") return;
1467
- let o = t;
1468
- if (o.originalEvent && (o = o.originalEvent), o.type === "pointermove" && (r.touchId !== null || o.pointerId !== r.pointerId))
1469
- return;
1470
- let c;
1471
- if (o.type === "touchmove") {
1472
- if (c = [...o.changedTouches].find((T) => T.identifier === r.touchId), !c || c.identifier !== r.touchId) return;
1473
- } else
1474
- c = o;
1475
- if (!r.isTouched) {
1476
- r.startMoving && r.isScrolling && s.emit("touchMoveOpposite", o);
1477
- return;
1478
- }
1479
- const d = c.pageX, u = c.pageY;
1480
- if (o.preventedByNestedSwiper) {
1481
- i.startX = d, i.startY = u;
1482
- return;
1483
- }
1484
- if (!s.allowTouchMove) {
1485
- o.target.matches(r.focusableElements) || (s.allowClick = !1), r.isTouched && (Object.assign(i, {
1486
- startX: d,
1487
- startY: u,
1488
- currentX: d,
1489
- currentY: u
1490
- }), r.touchStartTime = le());
1491
- return;
1492
- }
1493
- if (n.touchReleaseOnEdges && !n.loop) {
1494
- if (s.isVertical()) {
1495
- if (u < i.startY && s.translate <= s.maxTranslate() || u > i.startY && s.translate >= s.minTranslate()) {
1496
- r.isTouched = !1, r.isMoved = !1;
1497
- return;
1498
- }
1499
- } else if (l && (d > i.startX && -s.translate <= s.maxTranslate() || d < i.startX && -s.translate >= s.minTranslate()) || !l && (d < i.startX && s.translate <= s.maxTranslate() || d > i.startX && s.translate >= s.minTranslate()))
1500
- return;
1501
- }
1502
- if (e.activeElement && e.activeElement.matches(r.focusableElements) && e.activeElement !== o.target && o.pointerType !== "mouse" && e.activeElement.blur(), e.activeElement && o.target === e.activeElement && o.target.matches(r.focusableElements)) {
1503
- r.isMoved = !0, s.allowClick = !1;
1504
- return;
1505
- }
1506
- r.allowTouchCallbacks && s.emit("touchMove", o), i.previousX = i.currentX, i.previousY = i.currentY, i.currentX = d, i.currentY = u;
1507
- const f = i.currentX - i.startX, g = i.currentY - i.startY;
1508
- if (s.params.threshold && Math.sqrt(f ** 2 + g ** 2) < s.params.threshold) return;
1509
- if (typeof r.isScrolling > "u") {
1510
- let T;
1511
- s.isHorizontal() && i.currentY === i.startY || s.isVertical() && i.currentX === i.startX ? r.isScrolling = !1 : f * f + g * g >= 25 && (T = Math.atan2(Math.abs(g), Math.abs(f)) * 180 / Math.PI, r.isScrolling = s.isHorizontal() ? T > n.touchAngle : 90 - T > n.touchAngle);
1512
- }
1513
- if (r.isScrolling && s.emit("touchMoveOpposite", o), typeof r.startMoving > "u" && (i.currentX !== i.startX || i.currentY !== i.startY) && (r.startMoving = !0), r.isScrolling || o.type === "touchmove" && r.preventTouchMoveFromPointerMove) {
1514
- r.isTouched = !1;
1515
- return;
1516
- }
1517
- if (!r.startMoving)
1518
- return;
1519
- s.allowClick = !1, !n.cssMode && o.cancelable && o.preventDefault(), n.touchMoveStopPropagation && !n.nested && o.stopPropagation();
1520
- let h = s.isHorizontal() ? f : g, b = s.isHorizontal() ? i.currentX - i.previousX : i.currentY - i.previousY;
1521
- n.oneWayMovement && (h = Math.abs(h) * (l ? 1 : -1), b = Math.abs(b) * (l ? 1 : -1)), i.diff = h, h *= n.touchRatio, l && (h = -h, b = -b);
1522
- const M = s.touchesDirection;
1523
- s.swipeDirection = h > 0 ? "prev" : "next", s.touchesDirection = b > 0 ? "prev" : "next";
1524
- const w = s.params.loop && !n.cssMode, p = s.touchesDirection === "next" && s.allowSlideNext || s.touchesDirection === "prev" && s.allowSlidePrev;
1525
- if (!r.isMoved) {
1526
- if (w && p && s.loopFix({
1527
- direction: s.swipeDirection
1528
- }), r.startTranslate = s.getTranslate(), s.setTransition(0), s.animating) {
1529
- const T = new window.CustomEvent("transitionend", {
1530
- bubbles: !0,
1531
- cancelable: !0,
1532
- detail: {
1533
- bySwiperTouchMove: !0
1534
- }
1535
- });
1536
- s.wrapperEl.dispatchEvent(T);
1537
- }
1538
- r.allowMomentumBounce = !1, n.grabCursor && (s.allowSlideNext === !0 || s.allowSlidePrev === !0) && s.setGrabCursor(!0), s.emit("sliderFirstMove", o);
1539
- }
1540
- let m;
1541
- if ((/* @__PURE__ */ new Date()).getTime(), n._loopSwapReset !== !1 && r.isMoved && r.allowThresholdMove && M !== s.touchesDirection && w && p && Math.abs(h) >= 1) {
1542
- Object.assign(i, {
1543
- startX: d,
1544
- startY: u,
1545
- currentX: d,
1546
- currentY: u,
1547
- startTranslate: r.currentTranslate
1548
- }), r.loopSwapReset = !0, r.startTranslate = r.currentTranslate;
1549
- return;
1550
- }
1551
- s.emit("sliderMove", o), r.isMoved = !0, r.currentTranslate = h + r.startTranslate;
1552
- let v = !0, y = n.resistanceRatio;
1553
- if (n.touchReleaseOnEdges && (y = 0), h > 0 ? (w && p && !m && r.allowThresholdMove && r.currentTranslate > (n.centeredSlides ? s.minTranslate() - s.slidesSizesGrid[s.activeIndex + 1] - (n.slidesPerView !== "auto" && s.slides.length - n.slidesPerView >= 2 ? s.slidesSizesGrid[s.activeIndex + 1] + s.params.spaceBetween : 0) - s.params.spaceBetween : s.minTranslate()) && s.loopFix({
1554
- direction: "prev",
1555
- setTranslate: !0,
1556
- activeSlideIndex: 0
1557
- }), r.currentTranslate > s.minTranslate() && (v = !1, n.resistance && (r.currentTranslate = s.minTranslate() - 1 + (-s.minTranslate() + r.startTranslate + h) ** y))) : h < 0 && (w && p && !m && r.allowThresholdMove && r.currentTranslate < (n.centeredSlides ? s.maxTranslate() + s.slidesSizesGrid[s.slidesSizesGrid.length - 1] + s.params.spaceBetween + (n.slidesPerView !== "auto" && s.slides.length - n.slidesPerView >= 2 ? s.slidesSizesGrid[s.slidesSizesGrid.length - 1] + s.params.spaceBetween : 0) : s.maxTranslate()) && s.loopFix({
1558
- direction: "next",
1559
- setTranslate: !0,
1560
- activeSlideIndex: s.slides.length - (n.slidesPerView === "auto" ? s.slidesPerViewDynamic() : Math.ceil(parseFloat(n.slidesPerView, 10)))
1561
- }), r.currentTranslate < s.maxTranslate() && (v = !1, n.resistance && (r.currentTranslate = s.maxTranslate() + 1 - (s.maxTranslate() - r.startTranslate - h) ** y))), v && (o.preventedByNestedSwiper = !0), !s.allowSlideNext && s.swipeDirection === "next" && r.currentTranslate < r.startTranslate && (r.currentTranslate = r.startTranslate), !s.allowSlidePrev && s.swipeDirection === "prev" && r.currentTranslate > r.startTranslate && (r.currentTranslate = r.startTranslate), !s.allowSlidePrev && !s.allowSlideNext && (r.currentTranslate = r.startTranslate), n.threshold > 0)
1562
- if (Math.abs(h) > n.threshold || r.allowThresholdMove) {
1563
- if (!r.allowThresholdMove) {
1564
- r.allowThresholdMove = !0, i.startX = i.currentX, i.startY = i.currentY, r.currentTranslate = r.startTranslate, i.diff = s.isHorizontal() ? i.currentX - i.startX : i.currentY - i.startY;
1565
- return;
1566
- }
1567
- } else {
1568
- r.currentTranslate = r.startTranslate;
1569
- return;
1570
- }
1571
- !n.followFinger || n.cssMode || ((n.freeMode && n.freeMode.enabled && s.freeMode || n.watchSlidesProgress) && (s.updateActiveIndex(), s.updateSlidesClasses()), n.freeMode && n.freeMode.enabled && s.freeMode && s.freeMode.onTouchMove(), s.updateProgress(r.currentTranslate), s.setTranslate(r.currentTranslate));
1572
- }
1573
- function xs(t) {
1574
- const e = this, s = e.touchEventsData;
1575
- let r = t;
1576
- r.originalEvent && (r = r.originalEvent);
1577
- let n;
1578
- if (r.type === "touchend" || r.type === "touchcancel") {
1579
- if (n = [...r.changedTouches].find((v) => v.identifier === s.touchId), !n || n.identifier !== s.touchId) return;
1580
- } else {
1581
- if (s.touchId !== null || r.pointerId !== s.pointerId) return;
1582
- n = r;
1583
- }
1584
- if (["pointercancel", "pointerout", "pointerleave", "contextmenu"].includes(r.type) && !(["pointercancel", "contextmenu"].includes(r.type) && (e.browser.isSafari || e.browser.isWebView)))
1585
- return;
1586
- s.pointerId = null, s.touchId = null;
1587
- const {
1588
- params: i,
1589
- touches: l,
1590
- rtlTranslate: a,
1591
- slidesGrid: o,
1592
- enabled: c
1593
- } = e;
1594
- if (!c || !i.simulateTouch && r.pointerType === "mouse") return;
1595
- if (s.allowTouchCallbacks && e.emit("touchEnd", r), s.allowTouchCallbacks = !1, !s.isTouched) {
1596
- s.isMoved && i.grabCursor && e.setGrabCursor(!1), s.isMoved = !1, s.startMoving = !1;
1597
- return;
1598
- }
1599
- i.grabCursor && s.isMoved && s.isTouched && (e.allowSlideNext === !0 || e.allowSlidePrev === !0) && e.setGrabCursor(!1);
1600
- const d = le(), u = d - s.touchStartTime;
1601
- if (e.allowClick) {
1602
- const v = r.path || r.composedPath && r.composedPath();
1603
- e.updateClickedSlide(v && v[0] || r.target, v), e.emit("tap click", r), u < 300 && d - s.lastClickTime < 300 && e.emit("doubleTap doubleClick", r);
1604
- }
1605
- if (s.lastClickTime = le(), xe(() => {
1606
- e.destroyed || (e.allowClick = !0);
1607
- }), !s.isTouched || !s.isMoved || !e.swipeDirection || l.diff === 0 && !s.loopSwapReset || s.currentTranslate === s.startTranslate && !s.loopSwapReset) {
1608
- s.isTouched = !1, s.isMoved = !1, s.startMoving = !1;
1609
- return;
1610
- }
1611
- s.isTouched = !1, s.isMoved = !1, s.startMoving = !1;
1612
- let f;
1613
- if (i.followFinger ? f = a ? e.translate : -e.translate : f = -s.currentTranslate, i.cssMode)
1614
- return;
1615
- if (i.freeMode && i.freeMode.enabled) {
1616
- e.freeMode.onTouchEnd({
1617
- currentPos: f
1618
- });
1619
- return;
1620
- }
1621
- const g = f >= -e.maxTranslate() && !e.params.loop;
1622
- let h = 0, b = e.slidesSizesGrid[0];
1623
- for (let v = 0; v < o.length; v += v < i.slidesPerGroupSkip ? 1 : i.slidesPerGroup) {
1624
- const y = v < i.slidesPerGroupSkip - 1 ? 1 : i.slidesPerGroup;
1625
- typeof o[v + y] < "u" ? (g || f >= o[v] && f < o[v + y]) && (h = v, b = o[v + y] - o[v]) : (g || f >= o[v]) && (h = v, b = o[o.length - 1] - o[o.length - 2]);
1626
- }
1627
- let M = null, w = null;
1628
- i.rewind && (e.isBeginning ? w = i.virtual && i.virtual.enabled && e.virtual ? e.virtual.slides.length - 1 : e.slides.length - 1 : e.isEnd && (M = 0));
1629
- const p = (f - o[h]) / b, m = h < i.slidesPerGroupSkip - 1 ? 1 : i.slidesPerGroup;
1630
- if (u > i.longSwipesMs) {
1631
- if (!i.longSwipes) {
1632
- e.slideTo(e.activeIndex);
1633
- return;
1634
- }
1635
- e.swipeDirection === "next" && (p >= i.longSwipesRatio ? e.slideTo(i.rewind && e.isEnd ? M : h + m) : e.slideTo(h)), e.swipeDirection === "prev" && (p > 1 - i.longSwipesRatio ? e.slideTo(h + m) : w !== null && p < 0 && Math.abs(p) > i.longSwipesRatio ? e.slideTo(w) : e.slideTo(h));
1636
- } else {
1637
- if (!i.shortSwipes) {
1638
- e.slideTo(e.activeIndex);
1639
- return;
1640
- }
1641
- e.navigation && (r.target === e.navigation.nextEl || r.target === e.navigation.prevEl) ? r.target === e.navigation.nextEl ? e.slideTo(h + m) : e.slideTo(h) : (e.swipeDirection === "next" && e.slideTo(M !== null ? M : h + m), e.swipeDirection === "prev" && e.slideTo(w !== null ? w : h));
1642
- }
1643
- }
1644
- function Ne() {
1645
- const t = this, {
1646
- params: e,
1647
- el: s
1648
- } = t;
1649
- if (s && s.offsetWidth === 0) return;
1650
- e.breakpoints && t.setBreakpoint();
1651
- const {
1652
- allowSlideNext: r,
1653
- allowSlidePrev: n,
1654
- snapGrid: i
1655
- } = t, l = t.virtual && t.params.virtual.enabled;
1656
- t.allowSlideNext = !0, t.allowSlidePrev = !0, t.updateSize(), t.updateSlides(), t.updateSlidesClasses();
1657
- const a = l && e.loop;
1658
- (e.slidesPerView === "auto" || e.slidesPerView > 1) && t.isEnd && !t.isBeginning && !t.params.centeredSlides && !a ? t.slideTo(t.slides.length - 1, 0, !1, !0) : t.params.loop && !l ? t.slideToLoop(t.realIndex, 0, !1, !0) : t.slideTo(t.activeIndex, 0, !1, !0), t.autoplay && t.autoplay.running && t.autoplay.paused && (clearTimeout(t.autoplay.resizeTimeout), t.autoplay.resizeTimeout = setTimeout(() => {
1659
- t.autoplay && t.autoplay.running && t.autoplay.paused && t.autoplay.resume();
1660
- }, 500)), t.allowSlidePrev = n, t.allowSlideNext = r, t.params.watchOverflow && i !== t.snapGrid && t.checkOverflow();
1661
- }
1662
- function Ts(t) {
1663
- const e = this;
1664
- e.enabled && (e.allowClick || (e.params.preventClicks && t.preventDefault(), e.params.preventClicksPropagation && e.animating && (t.stopPropagation(), t.stopImmediatePropagation())));
1665
- }
1666
- function Cs() {
1667
- const t = this, {
1668
- wrapperEl: e,
1669
- rtlTranslate: s,
1670
- enabled: r
1671
- } = t;
1672
- if (!r) return;
1673
- t.previousTranslate = t.translate, t.isHorizontal() ? t.translate = -e.scrollLeft : t.translate = -e.scrollTop, t.translate === 0 && (t.translate = 0), t.updateActiveIndex(), t.updateSlidesClasses();
1674
- let n;
1675
- const i = t.maxTranslate() - t.minTranslate();
1676
- i === 0 ? n = 0 : n = (t.translate - t.minTranslate()) / i, n !== t.progress && t.updateProgress(s ? -t.translate : t.translate), t.emit("setTranslate", t.translate, !1);
1677
- }
1678
- function Ps(t) {
1679
- const e = this;
1680
- ne(e, t.target), !(e.params.cssMode || e.params.slidesPerView !== "auto" && !e.params.autoHeight) && e.update();
1681
- }
1682
- function Ms() {
1683
- const t = this;
1684
- t.documentTouchHandlerProceeded || (t.documentTouchHandlerProceeded = !0, t.params.touchReleaseOnEdges && (t.el.style.touchAction = "auto"));
1685
- }
1686
- const Ze = (t, e) => {
1687
- const s = K(), {
1688
- params: r,
1689
- el: n,
1690
- wrapperEl: i,
1691
- device: l
1692
- } = t, a = !!r.nested, o = e === "on" ? "addEventListener" : "removeEventListener", c = e;
1693
- !n || typeof n == "string" || (s[o]("touchstart", t.onDocumentTouchStart, {
1694
- passive: !1,
1695
- capture: a
1696
- }), n[o]("touchstart", t.onTouchStart, {
1697
- passive: !1
1698
- }), n[o]("pointerdown", t.onTouchStart, {
1699
- passive: !1
1700
- }), s[o]("touchmove", t.onTouchMove, {
1701
- passive: !1,
1702
- capture: a
1703
- }), s[o]("pointermove", t.onTouchMove, {
1704
- passive: !1,
1705
- capture: a
1706
- }), s[o]("touchend", t.onTouchEnd, {
1707
- passive: !0
1708
- }), s[o]("pointerup", t.onTouchEnd, {
1709
- passive: !0
1710
- }), s[o]("pointercancel", t.onTouchEnd, {
1711
- passive: !0
1712
- }), s[o]("touchcancel", t.onTouchEnd, {
1713
- passive: !0
1714
- }), s[o]("pointerout", t.onTouchEnd, {
1715
- passive: !0
1716
- }), s[o]("pointerleave", t.onTouchEnd, {
1717
- passive: !0
1718
- }), s[o]("contextmenu", t.onTouchEnd, {
1719
- passive: !0
1720
- }), (r.preventClicks || r.preventClicksPropagation) && n[o]("click", t.onClick, !0), r.cssMode && i[o]("scroll", t.onScroll), r.updateOnWindowResize ? t[c](l.ios || l.android ? "resize orientationchange observerUpdate" : "resize observerUpdate", Ne, !0) : t[c]("observerUpdate", Ne, !0), n[o]("load", t.onLoad, {
1721
- capture: !0
1722
- }));
1723
- };
1724
- function ks() {
1725
- const t = this, {
1726
- params: e
1727
- } = t;
1728
- t.onTouchStart = Ss.bind(t), t.onTouchMove = Es.bind(t), t.onTouchEnd = xs.bind(t), t.onDocumentTouchStart = Ms.bind(t), e.cssMode && (t.onScroll = Cs.bind(t)), t.onClick = Ts.bind(t), t.onLoad = Ps.bind(t), Ze(t, "on");
1729
- }
1730
- function Is() {
1731
- Ze(this, "off");
1732
- }
1733
- var Ls = {
1734
- attachEvents: ks,
1735
- detachEvents: Is
1736
- };
1737
- const Be = (t, e) => t.grid && e.grid && e.grid.rows > 1;
1738
- function As() {
1739
- const t = this, {
1740
- realIndex: e,
1741
- initialized: s,
1742
- params: r,
1743
- el: n
1744
- } = t, i = r.breakpoints;
1745
- if (!i || i && Object.keys(i).length === 0) return;
1746
- const l = K(), a = r.breakpointsBase === "window" || !r.breakpointsBase ? r.breakpointsBase : "container", o = ["window", "container"].includes(r.breakpointsBase) || !r.breakpointsBase ? t.el : l.querySelector(r.breakpointsBase), c = t.getBreakpoint(i, a, o);
1747
- if (!c || t.currentBreakpoint === c) return;
1748
- const d = (c in i ? i[c] : void 0) || t.originalParams, u = Be(t, r), f = Be(t, d), g = t.params.grabCursor, h = d.grabCursor, b = r.enabled;
1749
- u && !f ? (n.classList.remove(`${r.containerModifierClass}grid`, `${r.containerModifierClass}grid-column`), t.emitContainerClasses()) : !u && f && (n.classList.add(`${r.containerModifierClass}grid`), (d.grid.fill && d.grid.fill === "column" || !d.grid.fill && r.grid.fill === "column") && n.classList.add(`${r.containerModifierClass}grid-column`), t.emitContainerClasses()), g && !h ? t.unsetGrabCursor() : !g && h && t.setGrabCursor(), ["navigation", "pagination", "scrollbar"].forEach((y) => {
1750
- if (typeof d[y] > "u") return;
1751
- const T = r[y] && r[y].enabled, A = d[y] && d[y].enabled;
1752
- T && !A && t[y].disable(), !T && A && t[y].enable();
1753
- });
1754
- const M = d.direction && d.direction !== r.direction, w = r.loop && (d.slidesPerView !== r.slidesPerView || M), p = r.loop;
1755
- M && s && t.changeDirection(), B(t.params, d);
1756
- const m = t.params.enabled, v = t.params.loop;
1757
- Object.assign(t, {
1758
- allowTouchMove: t.params.allowTouchMove,
1759
- allowSlideNext: t.params.allowSlideNext,
1760
- allowSlidePrev: t.params.allowSlidePrev
1761
- }), b && !m ? t.disable() : !b && m && t.enable(), t.currentBreakpoint = c, t.emit("_beforeBreakpoint", d), s && (w ? (t.loopDestroy(), t.loopCreate(e), t.updateSlides()) : !p && v ? (t.loopCreate(e), t.updateSlides()) : p && !v && t.loopDestroy()), t.emit("breakpoint", d);
1762
- }
1763
- function Os(t, e, s) {
1764
- if (e === void 0 && (e = "window"), !t || e === "container" && !s) return;
1765
- let r = !1;
1766
- const n = N(), i = e === "window" ? n.innerHeight : s.clientHeight, l = Object.keys(t).map((a) => {
1767
- if (typeof a == "string" && a.indexOf("@") === 0) {
1768
- const o = parseFloat(a.substr(1));
1769
- return {
1770
- value: i * o,
1771
- point: a
1772
- };
1773
- }
1774
- return {
1775
- value: a,
1776
- point: a
1777
- };
1778
- });
1779
- l.sort((a, o) => parseInt(a.value, 10) - parseInt(o.value, 10));
1780
- for (let a = 0; a < l.length; a += 1) {
1781
- const {
1782
- point: o,
1783
- value: c
1784
- } = l[a];
1785
- e === "window" ? n.matchMedia(`(min-width: ${c}px)`).matches && (r = o) : c <= s.clientWidth && (r = o);
1786
- }
1787
- return r || "max";
1788
- }
1789
- var zs = {
1790
- setBreakpoint: As,
1791
- getBreakpoint: Os
1792
- };
1793
- function _s(t, e) {
1794
- const s = [];
1795
- return t.forEach((r) => {
1796
- typeof r == "object" ? Object.keys(r).forEach((n) => {
1797
- r[n] && s.push(e + n);
1798
- }) : typeof r == "string" && s.push(e + r);
1799
- }), s;
1800
- }
1801
- function $s() {
1802
- const t = this, {
1803
- classNames: e,
1804
- params: s,
1805
- rtl: r,
1806
- el: n,
1807
- device: i
1808
- } = t, l = _s(["initialized", s.direction, {
1809
- "free-mode": t.params.freeMode && s.freeMode.enabled
1810
- }, {
1811
- autoheight: s.autoHeight
1812
- }, {
1813
- rtl: r
1814
- }, {
1815
- grid: s.grid && s.grid.rows > 1
1816
- }, {
1817
- "grid-column": s.grid && s.grid.rows > 1 && s.grid.fill === "column"
1818
- }, {
1819
- android: i.android
1820
- }, {
1821
- ios: i.ios
1822
- }, {
1823
- "css-mode": s.cssMode
1824
- }, {
1825
- centered: s.cssMode && s.centeredSlides
1826
- }, {
1827
- "watch-progress": s.watchSlidesProgress
1828
- }], s.containerModifierClass);
1829
- e.push(...l), n.classList.add(...e), t.emitContainerClasses();
1830
- }
1831
- function Gs() {
1832
- const t = this, {
1833
- el: e,
1834
- classNames: s
1835
- } = t;
1836
- !e || typeof e == "string" || (e.classList.remove(...s), t.emitContainerClasses());
1837
- }
1838
- var Ns = {
1839
- addClasses: $s,
1840
- removeClasses: Gs
1841
- };
1842
- function Bs() {
1843
- const t = this, {
1844
- isLocked: e,
1845
- params: s
1846
- } = t, {
1847
- slidesOffsetBefore: r
1848
- } = s;
1849
- if (r) {
1850
- const n = t.slides.length - 1, i = t.slidesGrid[n] + t.slidesSizesGrid[n] + r * 2;
1851
- t.isLocked = t.size > i;
1852
- } else
1853
- t.isLocked = t.snapGrid.length === 1;
1854
- s.allowSlideNext === !0 && (t.allowSlideNext = !t.isLocked), s.allowSlidePrev === !0 && (t.allowSlidePrev = !t.isLocked), e && e !== t.isLocked && (t.isEnd = !1), e !== t.isLocked && t.emit(t.isLocked ? "lock" : "unlock");
1855
- }
1856
- var Ds = {
1857
- checkOverflow: Bs
1858
- }, Pe = {
1859
- init: !0,
1860
- direction: "horizontal",
1861
- oneWayMovement: !1,
1862
- swiperElementNodeName: "SWIPER-CONTAINER",
1863
- touchEventsTarget: "wrapper",
1864
- initialSlide: 0,
1865
- speed: 300,
1866
- cssMode: !1,
1867
- updateOnWindowResize: !0,
1868
- resizeObserver: !0,
1869
- nested: !1,
1870
- createElements: !1,
1871
- eventsPrefix: "swiper",
1872
- enabled: !0,
1873
- focusableElements: "input, select, option, textarea, button, video, label",
1874
- // Overrides
1875
- width: null,
1876
- height: null,
1877
- //
1878
- preventInteractionOnTransition: !1,
1879
- // ssr
1880
- userAgent: null,
1881
- url: null,
1882
- // To support iOS's swipe-to-go-back gesture (when being used in-app).
1883
- edgeSwipeDetection: !1,
1884
- edgeSwipeThreshold: 20,
1885
- // Autoheight
1886
- autoHeight: !1,
1887
- // Set wrapper width
1888
- setWrapperSize: !1,
1889
- // Virtual Translate
1890
- virtualTranslate: !1,
1891
- // Effects
1892
- effect: "slide",
1893
- // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
1894
- // Breakpoints
1895
- breakpoints: void 0,
1896
- breakpointsBase: "window",
1897
- // Slides grid
1898
- spaceBetween: 0,
1899
- slidesPerView: 1,
1900
- slidesPerGroup: 1,
1901
- slidesPerGroupSkip: 0,
1902
- slidesPerGroupAuto: !1,
1903
- centeredSlides: !1,
1904
- centeredSlidesBounds: !1,
1905
- slidesOffsetBefore: 0,
1906
- // in px
1907
- slidesOffsetAfter: 0,
1908
- // in px
1909
- normalizeSlideIndex: !0,
1910
- centerInsufficientSlides: !1,
1911
- // Disable swiper and hide navigation when container not overflow
1912
- watchOverflow: !0,
1913
- // Round length
1914
- roundLengths: !1,
1915
- // Touches
1916
- touchRatio: 1,
1917
- touchAngle: 45,
1918
- simulateTouch: !0,
1919
- shortSwipes: !0,
1920
- longSwipes: !0,
1921
- longSwipesRatio: 0.5,
1922
- longSwipesMs: 300,
1923
- followFinger: !0,
1924
- allowTouchMove: !0,
1925
- threshold: 5,
1926
- touchMoveStopPropagation: !1,
1927
- touchStartPreventDefault: !0,
1928
- touchStartForcePreventDefault: !1,
1929
- touchReleaseOnEdges: !1,
1930
- // Unique Navigation Elements
1931
- uniqueNavElements: !0,
1932
- // Resistance
1933
- resistance: !0,
1934
- resistanceRatio: 0.85,
1935
- // Progress
1936
- watchSlidesProgress: !1,
1937
- // Cursor
1938
- grabCursor: !1,
1939
- // Clicks
1940
- preventClicks: !0,
1941
- preventClicksPropagation: !0,
1942
- slideToClickedSlide: !1,
1943
- // loop
1944
- loop: !1,
1945
- loopAddBlankSlides: !0,
1946
- loopAdditionalSlides: 0,
1947
- loopPreventsSliding: !0,
1948
- // rewind
1949
- rewind: !1,
1950
- // Swiping/no swiping
1951
- allowSlidePrev: !0,
1952
- allowSlideNext: !0,
1953
- swipeHandler: null,
1954
- // '.swipe-handler',
1955
- noSwiping: !0,
1956
- noSwipingClass: "swiper-no-swiping",
1957
- noSwipingSelector: null,
1958
- // Passive Listeners
1959
- passiveListeners: !0,
1960
- maxBackfaceHiddenSlides: 10,
1961
- // NS
1962
- containerModifierClass: "swiper-",
1963
- // NEW
1964
- slideClass: "swiper-slide",
1965
- slideBlankClass: "swiper-slide-blank",
1966
- slideActiveClass: "swiper-slide-active",
1967
- slideVisibleClass: "swiper-slide-visible",
1968
- slideFullyVisibleClass: "swiper-slide-fully-visible",
1969
- slideNextClass: "swiper-slide-next",
1970
- slidePrevClass: "swiper-slide-prev",
1971
- wrapperClass: "swiper-wrapper",
1972
- lazyPreloaderClass: "swiper-lazy-preloader",
1973
- lazyPreloadPrevNext: 0,
1974
- // Callbacks
1975
- runCallbacksOnInit: !0,
1976
- // Internals
1977
- _emitClasses: !1
1978
- };
1979
- function Fs(t, e) {
1980
- return function(s) {
1981
- s === void 0 && (s = {});
1982
- const r = Object.keys(s)[0], n = s[r];
1983
- if (typeof n != "object" || n === null) {
1984
- B(e, s);
1985
- return;
1986
- }
1987
- if (t[r] === !0 && (t[r] = {
1988
- enabled: !0
1989
- }), r === "navigation" && t[r] && t[r].enabled && !t[r].prevEl && !t[r].nextEl && (t[r].auto = !0), ["pagination", "scrollbar"].indexOf(r) >= 0 && t[r] && t[r].enabled && !t[r].el && (t[r].auto = !0), !(r in t && "enabled" in n)) {
1990
- B(e, s);
1991
- return;
1992
- }
1993
- typeof t[r] == "object" && !("enabled" in t[r]) && (t[r].enabled = !0), t[r] || (t[r] = {
1994
- enabled: !1
1995
- }), B(e, s);
1996
- };
1997
- }
1998
- const be = {
1999
- eventsEmitter: Nt,
2000
- update: Xt,
2001
- translate: es,
2002
- transition: is,
2003
- slide: us,
2004
- loop: gs,
2005
- grabCursor: bs,
2006
- events: Ls,
2007
- breakpoints: zs,
2008
- checkOverflow: Ds,
2009
- classes: Ns
2010
- }, ye = {};
2011
- let ze = class q {
2012
- constructor() {
2013
- let e, s;
2014
- for (var r = arguments.length, n = new Array(r), i = 0; i < r; i++)
2015
- n[i] = arguments[i];
2016
- n.length === 1 && n[0].constructor && Object.prototype.toString.call(n[0]).slice(8, -1) === "Object" ? s = n[0] : [e, s] = n, s || (s = {}), s = B({}, s), e && !s.el && (s.el = e);
2017
- const l = K();
2018
- if (s.el && typeof s.el == "string" && l.querySelectorAll(s.el).length > 1) {
2019
- const d = [];
2020
- return l.querySelectorAll(s.el).forEach((u) => {
2021
- const f = B({}, s, {
2022
- el: u
2023
- });
2024
- d.push(new q(f));
2025
- }), d;
1
+ var Ce = Object.defineProperty;
2
+ var Ee = (e, t, n) => t in e ? Ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var k = (e, t, n) => Ee(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { useState as S, useEffect as y, useRef as L, PureComponent as Re, useCallback as j, lazy as xe, useMemo as C, Suspense as Le, forwardRef as be, useLayoutEffect as Te, useContext as Y } from "react";
5
+ import { c as Z, F as De, z as Oe, Y as X } from "./hooks-B0Qttldg.js";
6
+ import { jsx as i, jsxs as f, Fragment as T } from "react/jsx-runtime";
7
+ import { I as _e, S as N, f as x, h as ee, Q as w } from "./useStreamLayerApp2.js";
8
+ import { h as Me } from "./index8.js";
9
+ import { A as O, u as v, s as u, b as Ue, c as E, a as P } from "./sl-types.js";
10
+ import { l as Be, a as Fe, m as ze, d as Pe, n as Ve, C as qe, S as je, b as Ke, f as W, p as Qe, c as We } from "./index11.js";
11
+ import { M as Ge, a as He, k as Je, z as ke, c as ye, T as Ne, I as Ye, t as Ze, f as Xe, w as te, D as et, p as tt } from "./index16.js";
12
+ import K from "lodash.throttle";
13
+ import { i as Se } from "./index-DSi8Qgfs.js";
14
+ import { f as nt, b as st, A as ot } from "./analytics.js";
15
+ import { m as F } from "./theme.js";
16
+ import { F as it, c as U, e as at } from "./index3.js";
17
+ import "nanostores";
18
+ import { p as G, h as rt, e as lt } from "./Question.js";
19
+ import { y as dt } from "./index10.js";
20
+ import { B as D } from "./index6.js";
21
+ import ct from "react-infinite-scroller";
22
+ import { I as pt, s as ut, e as mt } from "./index12.js";
23
+ import "uuid";
24
+ import "@nanostores/query";
25
+ import "./storage.js";
26
+ import { createPortal as ht } from "react-dom";
27
+ import "./notification.js";
28
+ const ne = Object.keys(O), se = () => {
29
+ const e = window.innerWidth;
30
+ let t = "sm";
31
+ for (let n = ne.length - 1; n > 0; n--) {
32
+ const o = ne[n];
33
+ if (!(e < O[o]) && e >= O[o]) {
34
+ t = o;
35
+ break;
2026
36
  }
2027
- const a = this;
2028
- a.__swiper__ = !0, a.support = Ue(), a.device = Qe({
2029
- userAgent: s.userAgent
2030
- }), a.browser = Ke(), a.eventsListeners = {}, a.eventsAnyListeners = [], a.modules = [...a.__modules__], s.modules && Array.isArray(s.modules) && a.modules.push(...s.modules);
2031
- const o = {};
2032
- a.modules.forEach((d) => {
2033
- d({
2034
- params: s,
2035
- swiper: a,
2036
- extendParams: Fs(s, o),
2037
- on: a.on.bind(a),
2038
- once: a.once.bind(a),
2039
- off: a.off.bind(a),
2040
- emit: a.emit.bind(a)
2041
- });
2042
- });
2043
- const c = B({}, Pe, o);
2044
- return a.params = B({}, c, ye, s), a.originalParams = B({}, a.params), a.passedParams = B({}, s), a.params && a.params.on && Object.keys(a.params.on).forEach((d) => {
2045
- a.on(d, a.params.on[d]);
2046
- }), a.params && a.params.onAny && a.onAny(a.params.onAny), Object.assign(a, {
2047
- enabled: a.params.enabled,
2048
- el: e,
2049
- // Classes
2050
- classNames: [],
2051
- // Slides
2052
- slides: [],
2053
- slidesGrid: [],
2054
- snapGrid: [],
2055
- slidesSizesGrid: [],
2056
- // isDirection
2057
- isHorizontal() {
2058
- return a.params.direction === "horizontal";
2059
- },
2060
- isVertical() {
2061
- return a.params.direction === "vertical";
2062
- },
2063
- // Indexes
2064
- activeIndex: 0,
2065
- realIndex: 0,
2066
- //
2067
- isBeginning: !0,
2068
- isEnd: !1,
2069
- // Props
2070
- translate: 0,
2071
- previousTranslate: 0,
2072
- progress: 0,
2073
- velocity: 0,
2074
- animating: !1,
2075
- cssOverflowAdjustment() {
2076
- return Math.trunc(this.translate / 2 ** 23) * 2 ** 23;
2077
- },
2078
- // Locks
2079
- allowSlideNext: a.params.allowSlideNext,
2080
- allowSlidePrev: a.params.allowSlidePrev,
2081
- // Touch Events
2082
- touchEventsData: {
2083
- isTouched: void 0,
2084
- isMoved: void 0,
2085
- allowTouchCallbacks: void 0,
2086
- touchStartTime: void 0,
2087
- isScrolling: void 0,
2088
- currentTranslate: void 0,
2089
- startTranslate: void 0,
2090
- allowThresholdMove: void 0,
2091
- // Form elements to match
2092
- focusableElements: a.params.focusableElements,
2093
- // Last click time
2094
- lastClickTime: 0,
2095
- clickTimeout: void 0,
2096
- // Velocities
2097
- velocities: [],
2098
- allowMomentumBounce: void 0,
2099
- startMoving: void 0,
2100
- pointerId: null,
2101
- touchId: null
2102
- },
2103
- // Clicks
2104
- allowClick: !0,
2105
- // Touches
2106
- allowTouchMove: a.params.allowTouchMove,
2107
- touches: {
2108
- startX: 0,
2109
- startY: 0,
2110
- currentX: 0,
2111
- currentY: 0,
2112
- diff: 0
2113
- },
2114
- // Images
2115
- imagesToLoad: [],
2116
- imagesLoaded: 0
2117
- }), a.emit("_swiper"), a.params.init && a.init(), a;
2118
- }
2119
- getDirectionLabel(e) {
2120
- return this.isHorizontal() ? e : {
2121
- width: "height",
2122
- "margin-top": "margin-left",
2123
- "margin-bottom ": "margin-right",
2124
- "margin-left": "margin-top",
2125
- "margin-right": "margin-bottom",
2126
- "padding-left": "padding-top",
2127
- "padding-right": "padding-bottom",
2128
- marginRight: "marginBottom"
2129
- }[e];
2130
- }
2131
- getSlideIndex(e) {
2132
- const {
2133
- slidesEl: s,
2134
- params: r
2135
- } = this, n = H(s, `.${r.slideClass}, swiper-slide`), i = ce(n[0]);
2136
- return ce(e) - i;
2137
- }
2138
- getSlideIndexByData(e) {
2139
- return this.getSlideIndex(this.slides.find((s) => s.getAttribute("data-swiper-slide-index") * 1 === e));
2140
- }
2141
- recalcSlides() {
2142
- const e = this, {
2143
- slidesEl: s,
2144
- params: r
2145
- } = e;
2146
- e.slides = H(s, `.${r.slideClass}, swiper-slide`);
2147
- }
2148
- enable() {
2149
- const e = this;
2150
- e.enabled || (e.enabled = !0, e.params.grabCursor && e.setGrabCursor(), e.emit("enable"));
2151
- }
2152
- disable() {
2153
- const e = this;
2154
- e.enabled && (e.enabled = !1, e.params.grabCursor && e.unsetGrabCursor(), e.emit("disable"));
2155
- }
2156
- setProgress(e, s) {
2157
- const r = this;
2158
- e = Math.min(Math.max(e, 0), 1);
2159
- const n = r.minTranslate(), i = (r.maxTranslate() - n) * e + n;
2160
- r.translateTo(i, typeof s > "u" ? 0 : s), r.updateActiveIndex(), r.updateSlidesClasses();
2161
- }
2162
- emitContainerClasses() {
2163
- const e = this;
2164
- if (!e.params._emitClasses || !e.el) return;
2165
- const s = e.el.className.split(" ").filter((r) => r.indexOf("swiper") === 0 || r.indexOf(e.params.containerModifierClass) === 0);
2166
- e.emit("_containerClasses", s.join(" "));
2167
- }
2168
- getSlideClasses(e) {
2169
- const s = this;
2170
- return s.destroyed ? "" : e.className.split(" ").filter((r) => r.indexOf("swiper-slide") === 0 || r.indexOf(s.params.slideClass) === 0).join(" ");
2171
37
  }
2172
- emitSlidesClasses() {
2173
- const e = this;
2174
- if (!e.params._emitClasses || !e.el) return;
2175
- const s = [];
2176
- e.slides.forEach((r) => {
2177
- const n = e.getSlideClasses(r);
2178
- s.push({
2179
- slideEl: r,
2180
- classNames: n
2181
- }), e.emit("_slideClass", r, n);
2182
- }), e.emit("_slideClasses", s);
2183
- }
2184
- slidesPerViewDynamic(e, s) {
2185
- e === void 0 && (e = "current"), s === void 0 && (s = !1);
2186
- const r = this, {
2187
- params: n,
2188
- slides: i,
2189
- slidesGrid: l,
2190
- slidesSizesGrid: a,
2191
- size: o,
2192
- activeIndex: c
2193
- } = r;
2194
- let d = 1;
2195
- if (typeof n.slidesPerView == "number") return n.slidesPerView;
2196
- if (n.centeredSlides) {
2197
- let u = i[c] ? Math.ceil(i[c].swiperSlideSize) : 0, f;
2198
- for (let g = c + 1; g < i.length; g += 1)
2199
- i[g] && !f && (u += Math.ceil(i[g].swiperSlideSize), d += 1, u > o && (f = !0));
2200
- for (let g = c - 1; g >= 0; g -= 1)
2201
- i[g] && !f && (u += i[g].swiperSlideSize, d += 1, u > o && (f = !0));
2202
- } else if (e === "current")
2203
- for (let u = c + 1; u < i.length; u += 1)
2204
- (s ? l[u] + a[u] - l[c] < o : l[u] - l[c] < o) && (d += 1);
2205
- else
2206
- for (let u = c - 1; u >= 0; u -= 1)
2207
- l[c] - l[u] < o && (d += 1);
2208
- return d;
2209
- }
2210
- update() {
2211
- const e = this;
2212
- if (!e || e.destroyed) return;
2213
- const {
2214
- snapGrid: s,
2215
- params: r
2216
- } = e;
2217
- r.breakpoints && e.setBreakpoint(), [...e.el.querySelectorAll('[loading="lazy"]')].forEach((l) => {
2218
- l.complete && ne(e, l);
2219
- }), e.updateSize(), e.updateSlides(), e.updateProgress(), e.updateSlidesClasses();
2220
- function n() {
2221
- const l = e.rtlTranslate ? e.translate * -1 : e.translate, a = Math.min(Math.max(l, e.maxTranslate()), e.minTranslate());
2222
- e.setTranslate(a), e.updateActiveIndex(), e.updateSlidesClasses();
2223
- }
2224
- let i;
2225
- if (r.freeMode && r.freeMode.enabled && !r.cssMode)
2226
- n(), r.autoHeight && e.updateAutoHeight();
2227
- else {
2228
- if ((r.slidesPerView === "auto" || r.slidesPerView > 1) && e.isEnd && !r.centeredSlides) {
2229
- const l = e.virtual && r.virtual.enabled ? e.virtual.slides : e.slides;
2230
- i = e.slideTo(l.length - 1, 0, !1, !0);
2231
- } else
2232
- i = e.slideTo(e.activeIndex, 0, !1, !0);
2233
- i || n();
2234
- }
2235
- r.watchOverflow && s !== e.snapGrid && e.checkOverflow(), e.emit("update");
2236
- }
2237
- changeDirection(e, s) {
2238
- s === void 0 && (s = !0);
2239
- const r = this, n = r.params.direction;
2240
- return e || (e = n === "horizontal" ? "vertical" : "horizontal"), e === n || e !== "horizontal" && e !== "vertical" || (r.el.classList.remove(`${r.params.containerModifierClass}${n}`), r.el.classList.add(`${r.params.containerModifierClass}${e}`), r.emitContainerClasses(), r.params.direction = e, r.slides.forEach((i) => {
2241
- e === "vertical" ? i.style.width = "" : i.style.height = "";
2242
- }), r.emit("changeDirection"), s && r.update()), r;
2243
- }
2244
- changeLanguageDirection(e) {
2245
- const s = this;
2246
- s.rtl && e === "rtl" || !s.rtl && e === "ltr" || (s.rtl = e === "rtl", s.rtlTranslate = s.params.direction === "horizontal" && s.rtl, s.rtl ? (s.el.classList.add(`${s.params.containerModifierClass}rtl`), s.el.dir = "rtl") : (s.el.classList.remove(`${s.params.containerModifierClass}rtl`), s.el.dir = "ltr"), s.update());
2247
- }
2248
- mount(e) {
2249
- const s = this;
2250
- if (s.mounted) return !0;
2251
- let r = e || s.params.el;
2252
- if (typeof r == "string" && (r = document.querySelector(r)), !r)
2253
- return !1;
2254
- r.swiper = s, r.parentNode && r.parentNode.host && r.parentNode.host.nodeName === s.params.swiperElementNodeName.toUpperCase() && (s.isElement = !0);
2255
- const n = () => `.${(s.params.wrapperClass || "").trim().split(" ").join(".")}`;
2256
- let i = r && r.shadowRoot && r.shadowRoot.querySelector ? r.shadowRoot.querySelector(n()) : H(r, n())[0];
2257
- return !i && s.params.createElements && (i = de("div", s.params.wrapperClass), r.append(i), H(r, `.${s.params.slideClass}`).forEach((l) => {
2258
- i.append(l);
2259
- })), Object.assign(s, {
2260
- el: r,
2261
- wrapperEl: i,
2262
- slidesEl: s.isElement && !r.parentNode.host.slideSlots ? r.parentNode.host : i,
2263
- hostEl: s.isElement ? r.parentNode.host : r,
2264
- mounted: !0,
2265
- // RTL
2266
- rtl: r.dir.toLowerCase() === "rtl" || Y(r, "direction") === "rtl",
2267
- rtlTranslate: s.params.direction === "horizontal" && (r.dir.toLowerCase() === "rtl" || Y(r, "direction") === "rtl"),
2268
- wrongRTL: Y(i, "display") === "-webkit-box"
2269
- }), !0;
2270
- }
2271
- init(e) {
2272
- const s = this;
2273
- if (s.initialized || s.mount(e) === !1) return s;
2274
- s.emit("beforeInit"), s.params.breakpoints && s.setBreakpoint(), s.addClasses(), s.updateSize(), s.updateSlides(), s.params.watchOverflow && s.checkOverflow(), s.params.grabCursor && s.enabled && s.setGrabCursor(), s.params.loop && s.virtual && s.params.virtual.enabled ? s.slideTo(s.params.initialSlide + s.virtual.slidesBefore, 0, s.params.runCallbacksOnInit, !1, !0) : s.slideTo(s.params.initialSlide, 0, s.params.runCallbacksOnInit, !1, !0), s.params.loop && s.loopCreate(void 0, !0), s.attachEvents();
2275
- const r = [...s.el.querySelectorAll('[loading="lazy"]')];
2276
- return s.isElement && r.push(...s.hostEl.querySelectorAll('[loading="lazy"]')), r.forEach((n) => {
2277
- n.complete ? ne(s, n) : n.addEventListener("load", (i) => {
2278
- ne(s, i.target);
2279
- });
2280
- }), Ce(s), s.initialized = !0, Ce(s), s.emit("init"), s.emit("afterInit"), s;
2281
- }
2282
- destroy(e, s) {
2283
- e === void 0 && (e = !0), s === void 0 && (s = !0);
2284
- const r = this, {
2285
- params: n,
2286
- el: i,
2287
- wrapperEl: l,
2288
- slides: a
2289
- } = r;
2290
- return typeof r.params > "u" || r.destroyed || (r.emit("beforeDestroy"), r.initialized = !1, r.detachEvents(), n.loop && r.loopDestroy(), s && (r.removeClasses(), i && typeof i != "string" && i.removeAttribute("style"), l && l.removeAttribute("style"), a && a.length && a.forEach((o) => {
2291
- o.classList.remove(n.slideVisibleClass, n.slideFullyVisibleClass, n.slideActiveClass, n.slideNextClass, n.slidePrevClass), o.removeAttribute("style"), o.removeAttribute("data-swiper-slide-index");
2292
- })), r.emit("destroy"), Object.keys(r.eventsListeners).forEach((o) => {
2293
- r.off(o);
2294
- }), e !== !1 && (r.el && typeof r.el != "string" && (r.el.swiper = null), Tt(r)), r.destroyed = !0), null;
2295
- }
2296
- static extendDefaults(e) {
2297
- B(ye, e);
2298
- }
2299
- static get extendedDefaults() {
2300
- return ye;
2301
- }
2302
- static get defaults() {
2303
- return Pe;
2304
- }
2305
- static installModule(e) {
2306
- q.prototype.__modules__ || (q.prototype.__modules__ = []);
2307
- const s = q.prototype.__modules__;
2308
- typeof e == "function" && s.indexOf(e) < 0 && s.push(e);
2309
- }
2310
- static use(e) {
2311
- return Array.isArray(e) ? (e.forEach((s) => q.installModule(s)), q) : (q.installModule(e), q);
2312
- }
2313
- };
2314
- Object.keys(be).forEach((t) => {
2315
- Object.keys(be[t]).forEach((e) => {
2316
- ze.prototype[e] = be[t][e];
2317
- });
2318
- });
2319
- ze.use([$t, Gt]);
2320
- const et = [
2321
- "eventsPrefix",
2322
- "injectStyles",
2323
- "injectStylesUrls",
2324
- "modules",
2325
- "init",
2326
- "_direction",
2327
- "oneWayMovement",
2328
- "swiperElementNodeName",
2329
- "touchEventsTarget",
2330
- "initialSlide",
2331
- "_speed",
2332
- "cssMode",
2333
- "updateOnWindowResize",
2334
- "resizeObserver",
2335
- "nested",
2336
- "focusableElements",
2337
- "_enabled",
2338
- "_width",
2339
- "_height",
2340
- "preventInteractionOnTransition",
2341
- "userAgent",
2342
- "url",
2343
- "_edgeSwipeDetection",
2344
- "_edgeSwipeThreshold",
2345
- "_freeMode",
2346
- "_autoHeight",
2347
- "setWrapperSize",
2348
- "virtualTranslate",
2349
- "_effect",
2350
- "breakpoints",
2351
- "breakpointsBase",
2352
- "_spaceBetween",
2353
- "_slidesPerView",
2354
- "maxBackfaceHiddenSlides",
2355
- "_grid",
2356
- "_slidesPerGroup",
2357
- "_slidesPerGroupSkip",
2358
- "_slidesPerGroupAuto",
2359
- "_centeredSlides",
2360
- "_centeredSlidesBounds",
2361
- "_slidesOffsetBefore",
2362
- "_slidesOffsetAfter",
2363
- "normalizeSlideIndex",
2364
- "_centerInsufficientSlides",
2365
- "_watchOverflow",
2366
- "roundLengths",
2367
- "touchRatio",
2368
- "touchAngle",
2369
- "simulateTouch",
2370
- "_shortSwipes",
2371
- "_longSwipes",
2372
- "longSwipesRatio",
2373
- "longSwipesMs",
2374
- "_followFinger",
2375
- "allowTouchMove",
2376
- "_threshold",
2377
- "touchMoveStopPropagation",
2378
- "touchStartPreventDefault",
2379
- "touchStartForcePreventDefault",
2380
- "touchReleaseOnEdges",
2381
- "uniqueNavElements",
2382
- "_resistance",
2383
- "_resistanceRatio",
2384
- "_watchSlidesProgress",
2385
- "_grabCursor",
2386
- "preventClicks",
2387
- "preventClicksPropagation",
2388
- "_slideToClickedSlide",
2389
- "_loop",
2390
- "loopAdditionalSlides",
2391
- "loopAddBlankSlides",
2392
- "loopPreventsSliding",
2393
- "_rewind",
2394
- "_allowSlidePrev",
2395
- "_allowSlideNext",
2396
- "_swipeHandler",
2397
- "_noSwiping",
2398
- "noSwipingClass",
2399
- "noSwipingSelector",
2400
- "passiveListeners",
2401
- "containerModifierClass",
2402
- "slideClass",
2403
- "slideActiveClass",
2404
- "slideVisibleClass",
2405
- "slideFullyVisibleClass",
2406
- "slideNextClass",
2407
- "slidePrevClass",
2408
- "slideBlankClass",
2409
- "wrapperClass",
2410
- "lazyPreloaderClass",
2411
- "lazyPreloadPrevNext",
2412
- "runCallbacksOnInit",
2413
- "observer",
2414
- "observeParents",
2415
- "observeSlideChildren",
2416
- // modules
2417
- "a11y",
2418
- "_autoplay",
2419
- "_controller",
2420
- "coverflowEffect",
2421
- "cubeEffect",
2422
- "fadeEffect",
2423
- "flipEffect",
2424
- "creativeEffect",
2425
- "cardsEffect",
2426
- "hashNavigation",
2427
- "history",
2428
- "keyboard",
2429
- "mousewheel",
2430
- "_navigation",
2431
- "_pagination",
2432
- "parallax",
2433
- "_scrollbar",
2434
- "_thumbs",
2435
- "virtual",
2436
- "zoom",
2437
- "control"
2438
- ];
2439
- function Q(t) {
2440
- return typeof t == "object" && t !== null && t.constructor && Object.prototype.toString.call(t).slice(8, -1) === "Object" && !t.__swiper__;
2441
- }
2442
- function J(t, e) {
2443
- const s = ["__proto__", "constructor", "prototype"];
2444
- Object.keys(e).filter((r) => s.indexOf(r) < 0).forEach((r) => {
2445
- typeof t[r] > "u" ? t[r] = e[r] : Q(e[r]) && Q(t[r]) && Object.keys(e[r]).length > 0 ? e[r].__swiper__ ? t[r] = e[r] : J(t[r], e[r]) : t[r] = e[r];
2446
- });
2447
- }
2448
- function tt(t) {
2449
- return t === void 0 && (t = {}), t.navigation && typeof t.navigation.nextEl > "u" && typeof t.navigation.prevEl > "u";
2450
- }
2451
- function st(t) {
2452
- return t === void 0 && (t = {}), t.pagination && typeof t.pagination.el > "u";
2453
- }
2454
- function rt(t) {
2455
- return t === void 0 && (t = {}), t.scrollbar && typeof t.scrollbar.el > "u";
2456
- }
2457
- function it(t) {
2458
- t === void 0 && (t = "");
2459
- const e = t.split(" ").map((r) => r.trim()).filter((r) => !!r), s = [];
2460
- return e.forEach((r) => {
2461
- s.indexOf(r) < 0 && s.push(r);
2462
- }), s.join(" ");
2463
- }
2464
- function js(t) {
2465
- return t === void 0 && (t = ""), t ? t.includes("swiper-wrapper") ? t : `swiper-wrapper ${t}` : "swiper-wrapper";
2466
- }
2467
- function Vs(t) {
2468
- let {
2469
- swiper: e,
2470
- slides: s,
2471
- passedParams: r,
2472
- changedParams: n,
2473
- nextEl: i,
2474
- prevEl: l,
2475
- scrollbarEl: a,
2476
- paginationEl: o
2477
- } = t;
2478
- const c = n.filter((S) => S !== "children" && S !== "direction" && S !== "wrapperClass"), {
2479
- params: d,
2480
- pagination: u,
2481
- navigation: f,
2482
- scrollbar: g,
2483
- virtual: h,
2484
- thumbs: b
2485
- } = e;
2486
- let M, w, p, m, v, y, T, A;
2487
- n.includes("thumbs") && r.thumbs && r.thumbs.swiper && !r.thumbs.swiper.destroyed && d.thumbs && (!d.thumbs.swiper || d.thumbs.swiper.destroyed) && (M = !0), n.includes("controller") && r.controller && r.controller.control && d.controller && !d.controller.control && (w = !0), n.includes("pagination") && r.pagination && (r.pagination.el || o) && (d.pagination || d.pagination === !1) && u && !u.el && (p = !0), n.includes("scrollbar") && r.scrollbar && (r.scrollbar.el || a) && (d.scrollbar || d.scrollbar === !1) && g && !g.el && (m = !0), n.includes("navigation") && r.navigation && (r.navigation.prevEl || l) && (r.navigation.nextEl || i) && (d.navigation || d.navigation === !1) && f && !f.prevEl && !f.nextEl && (v = !0);
2488
- const I = (S) => {
2489
- e[S] && (e[S].destroy(), S === "navigation" ? (e.isElement && (e[S].prevEl.remove(), e[S].nextEl.remove()), d[S].prevEl = void 0, d[S].nextEl = void 0, e[S].prevEl = void 0, e[S].nextEl = void 0) : (e.isElement && e[S].el.remove(), d[S].el = void 0, e[S].el = void 0));
2490
- };
2491
- n.includes("loop") && e.isElement && (d.loop && !r.loop ? y = !0 : !d.loop && r.loop ? T = !0 : A = !0), c.forEach((S) => {
2492
- if (Q(d[S]) && Q(r[S]))
2493
- Object.assign(d[S], r[S]), (S === "navigation" || S === "pagination" || S === "scrollbar") && "enabled" in r[S] && !r[S].enabled && I(S);
2494
- else {
2495
- const E = r[S];
2496
- (E === !0 || E === !1) && (S === "navigation" || S === "pagination" || S === "scrollbar") ? E === !1 && I(S) : d[S] = r[S];
2497
- }
2498
- }), c.includes("controller") && !w && e.controller && e.controller.control && d.controller && d.controller.control && (e.controller.control = d.controller.control), n.includes("children") && s && h && d.virtual.enabled ? (h.slides = s, h.update(!0)) : n.includes("virtual") && h && d.virtual.enabled && (s && (h.slides = s), h.update(!0)), n.includes("children") && s && d.loop && (A = !0), M && b.init() && b.update(!0), w && (e.controller.control = d.controller.control), p && (e.isElement && (!o || typeof o == "string") && (o = document.createElement("div"), o.classList.add("swiper-pagination"), o.part.add("pagination"), e.el.appendChild(o)), o && (d.pagination.el = o), u.init(), u.render(), u.update()), m && (e.isElement && (!a || typeof a == "string") && (a = document.createElement("div"), a.classList.add("swiper-scrollbar"), a.part.add("scrollbar"), e.el.appendChild(a)), a && (d.scrollbar.el = a), g.init(), g.updateSize(), g.setTranslate()), v && (e.isElement && ((!i || typeof i == "string") && (i = document.createElement("div"), i.classList.add("swiper-button-next"), i.innerHTML = e.hostEl.constructor.nextButtonSvg, i.part.add("button-next"), e.el.appendChild(i)), (!l || typeof l == "string") && (l = document.createElement("div"), l.classList.add("swiper-button-prev"), l.innerHTML = e.hostEl.constructor.prevButtonSvg, l.part.add("button-prev"), e.el.appendChild(l))), i && (d.navigation.nextEl = i), l && (d.navigation.prevEl = l), f.init(), f.update()), n.includes("allowSlideNext") && (e.allowSlideNext = r.allowSlideNext), n.includes("allowSlidePrev") && (e.allowSlidePrev = r.allowSlidePrev), n.includes("direction") && e.changeDirection(r.direction, !1), (y || A) && e.loopDestroy(), (T || A) && e.loopCreate(), e.update();
2499
- }
2500
- function Hs(t, e) {
2501
- t === void 0 && (t = {}), e === void 0 && (e = !0);
2502
- const s = {
2503
- on: {}
2504
- }, r = {}, n = {};
2505
- J(s, Pe), s._emitClasses = !0, s.init = !1;
2506
- const i = {}, l = et.map((o) => o.replace(/_/, "")), a = Object.assign({}, t);
2507
- return Object.keys(a).forEach((o) => {
2508
- typeof t[o] > "u" || (l.indexOf(o) >= 0 ? Q(t[o]) ? (s[o] = {}, n[o] = {}, J(s[o], t[o]), J(n[o], t[o])) : (s[o] = t[o], n[o] = t[o]) : o.search(/on[A-Z]/) === 0 && typeof t[o] == "function" ? e ? r[`${o[2].toLowerCase()}${o.substr(3)}`] = t[o] : s.on[`${o[2].toLowerCase()}${o.substr(3)}`] = t[o] : i[o] = t[o]);
2509
- }), ["navigation", "pagination", "scrollbar"].forEach((o) => {
2510
- s[o] === !0 && (s[o] = {}), s[o] === !1 && delete s[o];
2511
- }), {
2512
- params: s,
2513
- passedParams: n,
2514
- rest: i,
2515
- events: r
2516
- };
2517
- }
2518
- function Rs(t, e) {
2519
- let {
2520
- el: s,
2521
- nextEl: r,
2522
- prevEl: n,
2523
- paginationEl: i,
2524
- scrollbarEl: l,
2525
- swiper: a
2526
- } = t;
2527
- tt(e) && r && n && (a.params.navigation.nextEl = r, a.originalParams.navigation.nextEl = r, a.params.navigation.prevEl = n, a.originalParams.navigation.prevEl = n), st(e) && i && (a.params.pagination.el = i, a.originalParams.pagination.el = i), rt(e) && l && (a.params.scrollbar.el = l, a.originalParams.scrollbar.el = l), a.init(s);
2528
- }
2529
- function qs(t, e, s, r, n) {
2530
- const i = [];
2531
- if (!e) return i;
2532
- const l = (a) => {
2533
- i.indexOf(a) < 0 && i.push(a);
2534
- };
2535
- if (s && r) {
2536
- const a = r.map(n), o = s.map(n);
2537
- a.join("") !== o.join("") && l("children"), r.length !== s.length && l("children");
2538
- }
2539
- return et.filter((a) => a[0] === "_").map((a) => a.replace(/_/, "")).forEach((a) => {
2540
- if (a in t && a in e)
2541
- if (Q(t[a]) && Q(e[a])) {
2542
- const o = Object.keys(t[a]), c = Object.keys(e[a]);
2543
- o.length !== c.length ? l(a) : (o.forEach((d) => {
2544
- t[a][d] !== e[a][d] && l(a);
2545
- }), c.forEach((d) => {
2546
- t[a][d] !== e[a][d] && l(a);
2547
- }));
2548
- } else t[a] !== e[a] && l(a);
2549
- }), i;
2550
- }
2551
- const Ws = (t) => {
2552
- !t || t.destroyed || !t.params.virtual || t.params.virtual && !t.params.virtual.enabled || (t.updateSlides(), t.updateProgress(), t.updateSlidesClasses(), t.parallax && t.params.parallax && t.params.parallax.enabled && t.parallax.setTranslate());
2553
- };
2554
- function pe() {
2555
- return pe = Object.assign ? Object.assign.bind() : function(t) {
2556
- for (var e = 1; e < arguments.length; e++) {
2557
- var s = arguments[e];
2558
- for (var r in s)
2559
- Object.prototype.hasOwnProperty.call(s, r) && (t[r] = s[r]);
2560
- }
2561
- return t;
2562
- }, pe.apply(this, arguments);
2563
- }
2564
- function nt(t) {
2565
- return t.type && t.type.displayName && t.type.displayName.includes("SwiperSlide");
2566
- }
2567
- function at(t) {
2568
- const e = [];
2569
- return $.Children.toArray(t).forEach((s) => {
2570
- nt(s) ? e.push(s) : s.props && s.props.children && at(s.props.children).forEach((r) => e.push(r));
2571
- }), e;
2572
- }
2573
- function Ys(t) {
2574
- const e = [], s = {
2575
- "container-start": [],
2576
- "container-end": [],
2577
- "wrapper-start": [],
2578
- "wrapper-end": []
2579
- };
2580
- return $.Children.toArray(t).forEach((r) => {
2581
- if (nt(r))
2582
- e.push(r);
2583
- else if (r.props && r.props.slot && s[r.props.slot])
2584
- s[r.props.slot].push(r);
2585
- else if (r.props && r.props.children) {
2586
- const n = at(r.props.children);
2587
- n.length > 0 ? n.forEach((i) => e.push(i)) : s["container-end"].push(r);
2588
- } else
2589
- s["container-end"].push(r);
2590
- }), {
2591
- slides: e,
2592
- slots: s
38
+ return {
39
+ name: t,
40
+ size: O[t]
2593
41
  };
2594
- }
2595
- function Xs(t, e, s) {
2596
- if (!s) return null;
2597
- const r = (d) => {
2598
- let u = d;
2599
- return d < 0 ? u = e.length + d : u >= e.length && (u = u - e.length), u;
2600
- }, n = t.isHorizontal() ? {
2601
- [t.rtlTranslate ? "right" : "left"]: `${s.offset}px`
2602
- } : {
2603
- top: `${s.offset}px`
2604
- }, {
2605
- from: i,
2606
- to: l
2607
- } = s, a = t.params.loop ? -e.length : 0, o = t.params.loop ? e.length * 2 : e.length, c = [];
2608
- for (let d = a; d < o; d += 1)
2609
- d >= i && d <= l && c.push(e[r(d)]);
2610
- return c.map((d, u) => /* @__PURE__ */ $.cloneElement(d, {
2611
- swiper: t,
2612
- style: n,
2613
- key: d.props.virtualIndex || d.key || `slide-${u}`
42
+ }, oe = (e) => {
43
+ var t;
44
+ return (((t = e.current) == null ? void 0 : t.getBoundingClientRect().y) || 0) < -68;
45
+ }, V = () => window.matchMedia("(orientation: landscape)").matches, vt = (e) => {
46
+ const [t] = S(() => Se({
47
+ screen: se(),
48
+ sdkInView: oe(e),
49
+ sdkInDesktopView: V()
2614
50
  }));
2615
- }
2616
- function ee(t, e) {
2617
- return typeof window > "u" ? X(t, e) : vt(t, e);
2618
- }
2619
- const De = /* @__PURE__ */ Ve(null), Us = /* @__PURE__ */ Ve(null), lt = /* @__PURE__ */ Ae(function(t, e) {
2620
- let {
2621
- className: s,
2622
- tag: r = "div",
2623
- wrapperTag: n = "div",
2624
- children: i,
2625
- onSwiper: l,
2626
- ...a
2627
- } = t === void 0 ? {} : t, o = !1;
2628
- const [c, d] = W("swiper"), [u, f] = W(null), [g, h] = W(!1), b = D(!1), M = D(null), w = D(null), p = D(null), m = D(null), v = D(null), y = D(null), T = D(null), A = D(null), {
2629
- params: I,
2630
- passedParams: S,
2631
- rest: E,
2632
- events: x
2633
- } = Hs(a), {
2634
- slides: k,
2635
- slots: L
2636
- } = Ys(i), O = () => {
2637
- h(!g);
2638
- };
2639
- Object.assign(I.on, {
2640
- _containerClasses(G, V) {
2641
- d(V);
2642
- }
2643
- });
2644
- const C = () => {
2645
- Object.assign(I.on, x), o = !0;
2646
- const G = {
2647
- ...I
51
+ return y(() => {
52
+ const n = K(() => {
53
+ t.setKey("sdkInView", oe(e));
54
+ }, 200), o = K(() => {
55
+ const s = se();
56
+ t.setKey("screen", s), t.setKey("sdkInDesktopView", V());
57
+ }, 200);
58
+ return window.addEventListener("scroll", n), window.addEventListener("resize", o), () => {
59
+ window.removeEventListener("scroll", n), window.removeEventListener("resize", o);
2648
60
  };
2649
- if (delete G.wrapperClass, w.current = new ze(G), w.current.virtual && w.current.params.virtual.enabled) {
2650
- w.current.virtual.slides = k;
2651
- const V = {
2652
- cache: !1,
2653
- slides: k,
2654
- renderExternal: f,
2655
- renderExternalUpdate: !1
2656
- };
2657
- J(w.current.params.virtual, V), J(w.current.originalParams.virtual, V);
2658
- }
2659
- };
2660
- M.current || C(), w.current && w.current.on("_beforeBreakpoint", O);
2661
- const z = () => {
2662
- o || !x || !w.current || Object.keys(x).forEach((G) => {
2663
- w.current.on(G, x[G]);
2664
- });
2665
- }, U = () => {
2666
- !x || !w.current || Object.keys(x).forEach((G) => {
2667
- w.current.off(G, x[G]);
2668
- });
2669
- };
2670
- X(() => () => {
2671
- w.current && w.current.off("_beforeBreakpoint", O);
2672
- }), X(() => {
2673
- !b.current && w.current && (w.current.emitSlidesClasses(), b.current = !0);
2674
- }), ee(() => {
2675
- if (e && (e.current = M.current), !!M.current)
2676
- return w.current.destroyed && C(), Rs({
2677
- el: M.current,
2678
- nextEl: v.current,
2679
- prevEl: y.current,
2680
- paginationEl: T.current,
2681
- scrollbarEl: A.current,
2682
- swiper: w.current
2683
- }, I), l && !w.current.destroyed && l(w.current), () => {
2684
- w.current && !w.current.destroyed && w.current.destroy(!0, !1);
61
+ }, [t, e]), [t];
62
+ }, H = (e, t, n) => {
63
+ const o = t >= O.lg && t < O.xl ? 75 : 52;
64
+ e.current && window.scrollTo({
65
+ top: e.current.offsetTop - o,
66
+ ...n
67
+ });
68
+ }, ft = 15, gt = (e, t) => {
69
+ const n = L(null), o = L(0), [s] = S(
70
+ Se({
71
+ scrollPosition: 0,
72
+ tabsShown: !0,
73
+ scrollDirection: "forward"
74
+ })
75
+ ), r = v(t);
76
+ return y(() => {
77
+ const l = V() ? n.current : window;
78
+ if (!l)
79
+ return () => {
2685
80
  };
2686
- }, []), ee(() => {
2687
- z();
2688
- const G = qs(S, p.current, k, m.current, (V) => V.key);
2689
- return p.current = S, m.current = k, G.length && w.current && !w.current.destroyed && Vs({
2690
- swiper: w.current,
2691
- slides: k,
2692
- passedParams: S,
2693
- changedParams: G,
2694
- nextEl: v.current,
2695
- prevEl: y.current,
2696
- scrollbarEl: A.current,
2697
- paginationEl: T.current
2698
- }), () => {
2699
- U();
81
+ const d = K((a) => {
82
+ var c;
83
+ const m = a.target;
84
+ if (!m)
85
+ return;
86
+ let p = 0;
87
+ V() ? p = m.scrollTop : p = ((c = e.current) == null ? void 0 : c.getBoundingClientRect().y) || 0;
88
+ const h = o.current - p;
89
+ if (ft > Math.abs(h))
90
+ return;
91
+ const g = o.current < p ? "forward" : "backward";
92
+ o.current = p, s.set({
93
+ scrollPosition: Math.round(p),
94
+ scrollDirection: g,
95
+ tabsShown: s.get().tabsShown
96
+ });
97
+ }, 200);
98
+ return l.addEventListener("scroll", d), () => {
99
+ l.removeEventListener("scroll", d);
2700
100
  };
2701
- }), ee(() => {
2702
- Ws(w.current);
2703
- }, [u]);
2704
- function j() {
2705
- return I.virtual ? Xs(w.current, k, u) : k.map((G, V) => /* @__PURE__ */ $.cloneElement(G, {
2706
- swiper: w.current,
2707
- swiperSlideIndex: V
2708
- }));
101
+ }, [s, e, r.screen]), [n, s];
102
+ }, q = /* @__PURE__ */ u("div")({
103
+ name: "LoadingContainer",
104
+ class: "lclc0ej",
105
+ propsAsIs: !1
106
+ }), It = ({
107
+ feature: e,
108
+ sdk: t,
109
+ children: n,
110
+ className: o,
111
+ noWait: s
112
+ }) => {
113
+ const r = v(e.status), l = v(t.sdkStore.slStreamId);
114
+ if (!s) {
115
+ if (l != null && l.loading && !l.data)
116
+ return /* @__PURE__ */ i(q, {
117
+ className: o,
118
+ children: "Event is loading..."
119
+ });
120
+ if (!(l != null && l.data))
121
+ return /* @__PURE__ */ i(q, {
122
+ className: o,
123
+ children: "Event is forbidden..."
124
+ });
125
+ if (r !== it.Ready)
126
+ return /* @__PURE__ */ i(q, {
127
+ className: o,
128
+ children: "Wait feature..."
129
+ });
2709
130
  }
2710
- return /* @__PURE__ */ $.createElement(r, pe({
2711
- ref: M,
2712
- className: it(`${c}${s ? ` ${s}` : ""}`)
2713
- }, E), /* @__PURE__ */ $.createElement(Us.Provider, {
2714
- value: w.current
2715
- }, L["container-start"], /* @__PURE__ */ $.createElement(n, {
2716
- className: js(I.wrapperClass)
2717
- }, L["wrapper-start"], j(), L["wrapper-end"]), tt(I) && /* @__PURE__ */ $.createElement($.Fragment, null, /* @__PURE__ */ $.createElement("div", {
2718
- ref: y,
2719
- className: "swiper-button-prev"
2720
- }), /* @__PURE__ */ $.createElement("div", {
2721
- ref: v,
2722
- className: "swiper-button-next"
2723
- })), rt(I) && /* @__PURE__ */ $.createElement("div", {
2724
- ref: A,
2725
- className: "swiper-scrollbar"
2726
- }), st(I) && /* @__PURE__ */ $.createElement("div", {
2727
- ref: T,
2728
- className: "swiper-pagination"
2729
- }), L["container-end"]));
131
+ return n;
132
+ }, bt = /* @__PURE__ */ u("div")({
133
+ name: "Container",
134
+ class: "c115qtkr",
135
+ propsAsIs: !1
136
+ }), kt = /* @__PURE__ */ u("div")({
137
+ name: "STabs",
138
+ class: "sxnslc8",
139
+ propsAsIs: !1
140
+ }), yt = /* @__PURE__ */ u("button")({
141
+ name: "Button",
142
+ class: "b1umzux0",
143
+ propsAsIs: !1
144
+ }), Nt = /* @__PURE__ */ u("span")({
145
+ name: "Title",
146
+ class: "tspsaas",
147
+ propsAsIs: !1
2730
148
  });
2731
- lt.displayName = "Swiper";
2732
- const ae = /* @__PURE__ */ Ae(function(t, e) {
2733
- let {
2734
- tag: s = "div",
2735
- children: r,
2736
- className: n = "",
2737
- swiper: i,
2738
- zoom: l,
2739
- lazy: a,
2740
- virtualIndex: o,
2741
- swiperSlideIndex: c,
2742
- ...d
2743
- } = t === void 0 ? {} : t;
2744
- const u = D(null), [f, g] = W("swiper-slide"), [h, b] = W(!1);
2745
- function M(v, y, T) {
2746
- y === u.current && g(T);
2747
- }
2748
- ee(() => {
2749
- if (typeof c < "u" && (u.current.swiperSlideIndex = c), e && (e.current = u.current), !(!u.current || !i)) {
2750
- if (i.destroyed) {
2751
- f !== "swiper-slide" && g("swiper-slide");
2752
- return;
2753
- }
2754
- return i.on("_slideClass", M), () => {
2755
- i && i.off("_slideClass", M);
2756
- };
149
+ var M = /* @__PURE__ */ ((e) => (e.HOME = "home", e.LEADERBOARD = "leaderboard", e))(M || {});
150
+ const ie = ({ title: e, active: t, onClick: n }) => /* @__PURE__ */ i(yt, { "data-a": "intr", onClick: n, "data-selected": t, children: /* @__PURE__ */ i(Nt, { "data-a": "intr", children: e }) }), St = ({ activePage: e = "home", toggleActivePage: t }) => /* @__PURE__ */ i(bt, { children: /* @__PURE__ */ f(kt, { "data-position": e === "home" ? "left" : "right", children: [
151
+ /* @__PURE__ */ i(ie, { title: "Home", active: e === "home", onClick: () => t(
152
+ "home"
153
+ /* HOME */
154
+ ) }),
155
+ /* @__PURE__ */ i(
156
+ ie,
157
+ {
158
+ title: "Friends",
159
+ active: e === "leaderboard",
160
+ onClick: () => t(
161
+ "leaderboard"
162
+ /* LEADERBOARD */
163
+ )
2757
164
  }
2758
- }), ee(() => {
2759
- i && u.current && !i.destroyed && g(i.getSlideClasses(u.current));
2760
- }, [i]);
2761
- const w = {
2762
- isActive: f.indexOf("swiper-slide-active") >= 0,
2763
- isVisible: f.indexOf("swiper-slide-visible") >= 0,
2764
- isPrev: f.indexOf("swiper-slide-prev") >= 0,
2765
- isNext: f.indexOf("swiper-slide-next") >= 0
2766
- }, p = () => typeof r == "function" ? r(w) : r, m = () => {
2767
- b(!0);
2768
- };
2769
- return /* @__PURE__ */ $.createElement(s, pe({
2770
- ref: u,
2771
- className: it(`${f}${n ? ` ${n}` : ""}`),
2772
- "data-swiper-slide-index": o,
2773
- onLoad: m
2774
- }, d), l && /* @__PURE__ */ $.createElement(De.Provider, {
2775
- value: w
2776
- }, /* @__PURE__ */ $.createElement("div", {
2777
- className: "swiper-zoom-container",
2778
- "data-swiper-zoom": typeof l == "number" ? l : void 0
2779
- }, p(), a && !h && /* @__PURE__ */ $.createElement("div", {
2780
- className: "swiper-lazy-preloader"
2781
- }))), !l && /* @__PURE__ */ $.createElement(De.Provider, {
2782
- value: w
2783
- }, p(), a && !h && /* @__PURE__ */ $.createElement("div", {
2784
- className: "swiper-lazy-preloader"
2785
- })));
2786
- });
2787
- ae.displayName = "SwiperSlide";
2788
- const Qs = () => lt, Ks = /* @__PURE__ */ _(Qs())({
2789
- name: "Carousel",
2790
- class: "c1f9jjsn",
2791
- propsAsIs: !0
2792
- }), Me = /* @__PURE__ */ _("div")({
2793
- name: "ScreenWrap",
2794
- class: "s25r51y",
165
+ )
166
+ ] }) }), $t = /* @__PURE__ */ u("div")({
167
+ name: "Container",
168
+ class: "c1ux29ft",
2795
169
  propsAsIs: !1
2796
- }), Js = () => te, Zs = /* @__PURE__ */ _(Js())({
2797
- name: "SponsorIconI",
2798
- class: "s1lvrmx8",
170
+ }), At = () => D, wt = /* @__PURE__ */ u(At())({
171
+ name: "FriendsIcon",
172
+ class: "f10ncfg2",
2799
173
  propsAsIs: !0
2800
- }), ot = ({
2801
- style: t,
2802
- className: e
2803
- }) => /* @__PURE__ */ P(Zs, {
2804
- className: e,
2805
- style: t,
2806
- name: "icon-masters-logo"
2807
- }), dt = /* @__PURE__ */ _("div")({
2808
- name: "ScreenTextBlock",
2809
- class: "s11xps29",
174
+ }), Ct = /* @__PURE__ */ u("div")({
175
+ name: "Content",
176
+ class: "c1yc07bd",
177
+ propsAsIs: !1
178
+ }), Et = /* @__PURE__ */ u("div")({
179
+ name: "Title",
180
+ class: "tj6cq7w",
2810
181
  propsAsIs: !1
2811
- }), ct = /* @__PURE__ */ _("div")({
2812
- name: "ScreenTitle",
2813
- class: "s14qstuv",
182
+ }), Rt = /* @__PURE__ */ u("div")({
183
+ name: "Description",
184
+ class: "d1ag78xo",
2814
185
  propsAsIs: !1
2815
- }), ke = /* @__PURE__ */ _("div")({
2816
- name: "ScreenDescription",
2817
- class: "s14mdh2e",
186
+ }), xt = () => D, Lt = /* @__PURE__ */ u(xt())({
187
+ name: "ArrowInviteIcon",
188
+ class: "awohrz6",
189
+ propsAsIs: !0
190
+ }), Tt = ({ title: e, description: t, onClick: n, className: o }) => {
191
+ const [s] = nt({
192
+ type: "invitation",
193
+ action: "sent",
194
+ payload: {
195
+ from: _e.TITLE_CARD
196
+ }
197
+ });
198
+ return /* @__PURE__ */ f($t, { "data-a": "intr", onClick: s(n), className: o, children: [
199
+ /* @__PURE__ */ i(wt, { name: "icon-friends" }),
200
+ /* @__PURE__ */ f(Ct, { children: [
201
+ /* @__PURE__ */ i(Et, { children: e }),
202
+ /* @__PURE__ */ i(Rt, { children: t })
203
+ ] }),
204
+ /* @__PURE__ */ i(Lt, { name: "icon-copy" })
205
+ ] });
206
+ };
207
+ function Dt(e) {
208
+ var t = e.lastRenderedStartIndex, n = e.lastRenderedStopIndex, o = e.startIndex, s = e.stopIndex;
209
+ return !(o > n || s < t);
210
+ }
211
+ function Ot(e) {
212
+ for (var t = e.isItemLoaded, n = e.itemCount, o = e.minimumBatchSize, s = e.startIndex, r = e.stopIndex, l = [], d = null, a = null, c = s; c <= r; c++) {
213
+ var m = t(c);
214
+ m ? a !== null && (l.push(d, a), d = a = null) : (a = c, d === null && (d = c));
215
+ }
216
+ if (a !== null) {
217
+ for (var p = Math.min(Math.max(a, d + o - 1), n - 1), h = a + 1; h <= p && !t(h); h++)
218
+ a = h;
219
+ l.push(d, a);
220
+ }
221
+ if (l.length)
222
+ for (; l[1] - l[0] + 1 < o && l[0] > 0; ) {
223
+ var g = l[0] - 1;
224
+ if (!t(g))
225
+ l[0] = g;
226
+ else
227
+ break;
228
+ }
229
+ return l;
230
+ }
231
+ var _t = function(e, t) {
232
+ if (!(e instanceof t))
233
+ throw new TypeError("Cannot call a class as a function");
234
+ }, Mt = /* @__PURE__ */ function() {
235
+ function e(t, n) {
236
+ for (var o = 0; o < n.length; o++) {
237
+ var s = n[o];
238
+ s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(t, s.key, s);
239
+ }
240
+ }
241
+ return function(t, n, o) {
242
+ return n && e(t.prototype, n), o && e(t, o), t;
243
+ };
244
+ }(), Ut = function(e, t) {
245
+ if (typeof t != "function" && t !== null)
246
+ throw new TypeError("Super expression must either be null or a function, not " + typeof t);
247
+ e.prototype = Object.create(t && t.prototype, {
248
+ constructor: {
249
+ value: e,
250
+ enumerable: !1,
251
+ writable: !0,
252
+ configurable: !0
253
+ }
254
+ }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
255
+ }, ae = function(e, t) {
256
+ if (!e)
257
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
258
+ return t && (typeof t == "object" || typeof t == "function") ? t : e;
259
+ };
260
+ (function(e) {
261
+ Ut(t, e);
262
+ function t() {
263
+ var n, o, s, r;
264
+ _t(this, t);
265
+ for (var l = arguments.length, d = Array(l), a = 0; a < l; a++)
266
+ d[a] = arguments[a];
267
+ return r = (o = (s = ae(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(d))), s), s._lastRenderedStartIndex = -1, s._lastRenderedStopIndex = -1, s._memoizedUnloadedRanges = [], s._onItemsRendered = function(c) {
268
+ var m = c.visibleStartIndex, p = c.visibleStopIndex;
269
+ s._lastRenderedStartIndex = m, s._lastRenderedStopIndex = p, s._ensureRowsLoaded(m, p);
270
+ }, s._setRef = function(c) {
271
+ s._listRef = c;
272
+ }, o), ae(s, r);
273
+ }
274
+ return Mt(t, [{
275
+ key: "resetloadMoreItemsCache",
276
+ value: function() {
277
+ var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
278
+ this._memoizedUnloadedRanges = [], o && this._ensureRowsLoaded(this._lastRenderedStartIndex, this._lastRenderedStopIndex);
279
+ }
280
+ }, {
281
+ key: "componentDidMount",
282
+ value: function() {
283
+ }
284
+ }, {
285
+ key: "render",
286
+ value: function() {
287
+ var o = this.props.children;
288
+ return o({
289
+ onItemsRendered: this._onItemsRendered,
290
+ ref: this._setRef
291
+ });
292
+ }
293
+ }, {
294
+ key: "_ensureRowsLoaded",
295
+ value: function(o, s) {
296
+ var r = this.props, l = r.isItemLoaded, d = r.itemCount, a = r.minimumBatchSize, c = a === void 0 ? 10 : a, m = r.threshold, p = m === void 0 ? 15 : m, h = Ot({
297
+ isItemLoaded: l,
298
+ itemCount: d,
299
+ minimumBatchSize: c,
300
+ startIndex: Math.max(0, o - p),
301
+ stopIndex: Math.min(d - 1, s + p)
302
+ });
303
+ (this._memoizedUnloadedRanges.length !== h.length || this._memoizedUnloadedRanges.some(function(g, b) {
304
+ return h[b] !== g;
305
+ })) && (this._memoizedUnloadedRanges = h, this._loadUnloadedRanges(h));
306
+ }
307
+ }, {
308
+ key: "_loadUnloadedRanges",
309
+ value: function(o) {
310
+ for (var s = this, r = this.props.loadMoreItems || this.props.loadMoreRows, l = function(c) {
311
+ var m = o[c], p = o[c + 1], h = r(m, p);
312
+ h != null && h.then(function() {
313
+ if (Dt({
314
+ lastRenderedStartIndex: s._lastRenderedStartIndex,
315
+ lastRenderedStopIndex: s._lastRenderedStopIndex,
316
+ startIndex: m,
317
+ stopIndex: p
318
+ })) {
319
+ if (s._listRef == null)
320
+ return;
321
+ typeof s._listRef.resetAfterIndex == "function" ? s._listRef.resetAfterIndex(m, !0) : (typeof s._listRef._getItemStyleCache == "function" && s._listRef._getItemStyleCache(-1), s._listRef.forceUpdate());
322
+ }
323
+ });
324
+ }, d = 0; d < o.length; d += 2)
325
+ l(d);
326
+ }
327
+ }]), t;
328
+ })(Re);
329
+ const Bt = /* @__PURE__ */ u("div")({
330
+ name: "Container",
331
+ class: "culdu4a",
2818
332
  propsAsIs: !1
2819
- }), ue = /* @__PURE__ */ _("button")({
2820
- name: "ScreenButton",
2821
- class: "sqtjig9",
333
+ }), Ft = /* @__PURE__ */ u("div")({
334
+ name: "Position",
335
+ class: "pwf8e69",
2822
336
  propsAsIs: !1
2823
- }), er = /* @__PURE__ */ _("div")({
2824
- name: "EmergencyContainer",
2825
- class: "e1f9mu2m",
337
+ }), zt = /* @__PURE__ */ u("img")({
338
+ name: "Avatar",
339
+ class: "atf4yh4",
2826
340
  propsAsIs: !1
2827
- }), tr = /* @__PURE__ */ _("div")({
2828
- name: "EmergencyScreenTitle",
2829
- class: "e1n10yo1",
341
+ }), Pt = /* @__PURE__ */ u("div")({
342
+ name: "AvatarPlaceholder",
343
+ class: "a1dg29ja",
2830
344
  propsAsIs: !1
2831
- }), sr = /* @__PURE__ */ _("div")({
2832
- name: "EmergencyScreenDescription",
2833
- class: "e1xecypc",
345
+ }), Vt = /* @__PURE__ */ u("div")({
346
+ name: "Content",
347
+ class: "c10a68rc",
2834
348
  propsAsIs: !1
2835
- }), rr = () => ue, ir = /* @__PURE__ */ _(rr())({
2836
- name: "EmergencyScreenButton",
2837
- class: "e1k6zoyu",
2838
- propsAsIs: !0
2839
- }), Ie = ({ actionFn: t, description: e, className: s, onEvent: r }) => (X(() => {
2840
- r({ type: "slBetPackReady" });
2841
- }, [r]), /* @__PURE__ */ F(er, { className: s, children: [
2842
- /* @__PURE__ */ P(tr, { children: "Something went wrong." }),
2843
- /* @__PURE__ */ P(sr, { children: e }),
2844
- /* @__PURE__ */ P(ir, { onClick: t, children: "Try again" })
2845
- ] })), nr = /* @__PURE__ */ _("div")({
2846
- name: "ScreenContainerBox",
2847
- class: "s28ooi9",
349
+ }), qt = /* @__PURE__ */ u("div")({
350
+ name: "NameContainer",
351
+ class: "nc4kck5",
2848
352
  propsAsIs: !1
2849
- }), me = ({ children: t }) => /* @__PURE__ */ P(nr, { className: "ScreenContainer", children: /* @__PURE__ */ P("div", { children: t }) }), ar = /* @__PURE__ */ _("img")({
2850
- name: "EndScreenMedia",
2851
- class: "e8s3kc9",
353
+ }), jt = /* @__PURE__ */ u("span")({
354
+ name: "Name",
355
+ class: "njsrqgr",
2852
356
  propsAsIs: !1
2853
- }), lr = () => ot, or = /* @__PURE__ */ _(lr())({
2854
- name: "EndScreenSponsorIcon",
2855
- class: "e1uswib2",
357
+ }), Kt = () => D, Qt = /* @__PURE__ */ u(Kt())({
358
+ name: "CurrentUserBadge",
359
+ class: "c17uc4zr",
2856
360
  propsAsIs: !0
2857
- }), dr = ({ onEvent: t, height: e }) => {
2858
- const [s, r] = W(
2859
- 0
2860
- /* FIRST */
2861
- );
2862
- return s === 0 ? /* @__PURE__ */ P(me, { height: e, children: /* @__PURE__ */ F(Me, { children: [
2863
- /* @__PURE__ */ P(or, {}),
2864
- /* @__PURE__ */ F(dt, { children: [
2865
- /* @__PURE__ */ P(ct, { children: "Great picks!" }),
2866
- /* @__PURE__ */ P(ke, { children: "Stay in the Enhanced Stream for live results, predictions, trivia, polls, and match insights." })
2867
- ] }),
2868
- /* @__PURE__ */ P(
2869
- ue,
2870
- {
2871
- "data-a": "intr",
2872
- onClick: () => {
2873
- r(
2874
- 1
2875
- /* LAST */
2876
- );
2877
- },
2878
- style: { marginTop: "auto " },
2879
- children: "Continue"
2880
- }
2881
- )
2882
- ] }) }, "end") : /* @__PURE__ */ P(me, { height: e, children: /* @__PURE__ */ F(Me, { children: [
2883
- /* @__PURE__ */ P(ar, { src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/bet_pack_end_screen.png" }),
2884
- /* @__PURE__ */ P(ke, { children: "Look for more live match insights, predictions and more." }),
2885
- /* @__PURE__ */ P(ue, { "data-a": "intr", onClick: () => t({ type: "slOpenGameCenter" }), children: "Open Game Center" })
2886
- ] }) }, "end");
2887
- }, cr = /* @__PURE__ */ _("div")({
361
+ }), Wt = ({
362
+ friendsRank: e,
363
+ avatar: t,
364
+ name: n,
365
+ userId: o,
366
+ points: s,
367
+ isCurrentUser: r,
368
+ style: l
369
+ }) => /* @__PURE__ */ f(Bt, { "data-name": o, style: l, children: [
370
+ /* @__PURE__ */ i(Ft, { children: e || 0 }),
371
+ /* @__PURE__ */ f(Vt, { children: [
372
+ t ? /* @__PURE__ */ i(zt, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ i(Pt, { children: pt(n || "") }),
373
+ /* @__PURE__ */ f(qt, { children: [
374
+ /* @__PURE__ */ i(jt, { children: n || "" }),
375
+ r && /* @__PURE__ */ i(Qt, { name: "icon-star" })
376
+ ] })
377
+ ] }),
378
+ /* @__PURE__ */ i("div", { children: ut(s) })
379
+ ] }), Gt = /* @__PURE__ */ u("div")({
2888
380
  name: "Container",
2889
- class: "cv31tt7",
2890
- propsAsIs: !1
2891
- }), Le = ({
2892
- className: t
2893
- }) => /* @__PURE__ */ P(cr, {
2894
- className: t,
2895
- children: /* @__PURE__ */ P(ft, {})
2896
- }), pr = ({ question: t, vote: e }) => t ? /* @__PURE__ */ P(ht, { close: () => {
2897
- }, openedQuestion: t, vote: e, isLoading: !1, isEarlyPrediction: !0 }) : null, ur = /* @__PURE__ */ _("span")({
2898
- name: "NextButton",
2899
- class: "n991vvm",
381
+ class: "c16btbfp",
2900
382
  propsAsIs: !1
2901
- }), mr = () => te, fr = /* @__PURE__ */ _(mr())({
2902
- name: "IconArrowRight",
2903
- class: "inbj36g",
2904
- propsAsIs: !0
2905
- }), hr = /* @__PURE__ */ _("div")({
2906
- name: "StartScreenSponsor",
2907
- class: "szrvgt",
383
+ }), Ht = ({
384
+ items: e,
385
+ currentUserId: t,
386
+ openItemDetail: n,
387
+ fetchMore: o,
388
+ scrollNode: s,
389
+ hasMore: r
390
+ }) => {
391
+ const l = j((d) => {
392
+ const a = d.target.getAttribute("data-name");
393
+ a && n(a);
394
+ }, [n]);
395
+ return /* @__PURE__ */ i(ct, {
396
+ loadMore: o,
397
+ initialLoad: !1,
398
+ hasMore: r,
399
+ useWindow: !1,
400
+ getScrollParent: () => s.current,
401
+ children: /* @__PURE__ */ i(Gt, {
402
+ "data-a": "intr",
403
+ onClick: l,
404
+ children: e.map((d) => /* @__PURE__ */ i(Wt, {
405
+ ...d,
406
+ isCurrentUser: !!t && t === d.userId
407
+ }, d.userId))
408
+ })
409
+ });
410
+ }, Jt = /* @__PURE__ */ u("div")({
411
+ name: "InviteFriendsContainer",
412
+ class: "i1c9dygq",
2908
413
  propsAsIs: !1
2909
- }), gr = /* @__PURE__ */ _("div")({
2910
- name: "StartScreenNote",
2911
- class: "swqs2ju",
414
+ }), Yt = ({
415
+ deepLink: e
416
+ }) => /* @__PURE__ */ i(Jt, {
417
+ children: /* @__PURE__ */ i(Ge, {
418
+ inviteLink: e,
419
+ inviteCardTitle: "It’s More Fun With Friends",
420
+ inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
421
+ })
422
+ }), Zt = /* @__PURE__ */ u("div")({
423
+ name: "InviteLinkContainer",
424
+ class: "i1odbhm4",
2912
425
  propsAsIs: !1
2913
- }), vr = ({ countQuestionsAvailable: t, sliderRef: e }) => /* @__PURE__ */ P(me, { children: /* @__PURE__ */ F(Me, { children: [
2914
- /* @__PURE__ */ P(ot, {}),
2915
- /* @__PURE__ */ F(dt, { children: [
2916
- /* @__PURE__ */ P(hr, { children: "FEATURED GROUPS+" }),
2917
- /* @__PURE__ */ P(ct, { children: "The First Five" })
2918
- ] }),
2919
- /* @__PURE__ */ P(ke, { children: "Tee off with these five initial predictions for today’s play." }),
2920
- /* @__PURE__ */ F(
2921
- ue,
2922
- {
2923
- "data-a": "intr",
2924
- onClick: () => {
2925
- var s;
2926
- (s = e.current) == null || s.slideNext();
2927
- },
2928
- children: [
2929
- t ? `${t} questions available` : "See all questions",
2930
- /* @__PURE__ */ P(ur, { children: /* @__PURE__ */ P(fr, { name: "iconArrowRight" }) })
2931
- ]
2932
- }
2933
- ),
2934
- /* @__PURE__ */ P(gr, { children: "Note: Some questions may have been resolved as a result of today’s play." })
2935
- ] }) }, "start");
2936
- function wr(t, e, s, r) {
2937
- return t.params.createElements && Object.keys(r).forEach((n) => {
2938
- if (!s[n] && s.auto === !0) {
2939
- let i = H(t.el, `.${r[n]}`)[0];
2940
- i || (i = de("div", r[n]), i.className = r[n], t.el.append(i)), s[n] = i, e[n] = i;
2941
- }
2942
- }), s;
2943
- }
2944
- function Z(t) {
2945
- return t === void 0 && (t = ""), `.${t.trim().replace(/([\.:!+\/])/g, "\\$1").replace(/ /g, ".")}`;
2946
- }
2947
- function br(t) {
2948
- let {
2949
- swiper: e,
2950
- extendParams: s,
2951
- on: r,
2952
- emit: n
2953
- } = t;
2954
- const i = "swiper-pagination";
2955
- s({
2956
- pagination: {
2957
- el: null,
2958
- bulletElement: "span",
2959
- clickable: !1,
2960
- hideOnClick: !1,
2961
- renderBullet: null,
2962
- renderProgressbar: null,
2963
- renderFraction: null,
2964
- renderCustom: null,
2965
- progressbarOpposite: !1,
2966
- type: "bullets",
2967
- // 'bullets' or 'progressbar' or 'fraction' or 'custom'
2968
- dynamicBullets: !1,
2969
- dynamicMainBullets: 1,
2970
- formatFractionCurrent: (p) => p,
2971
- formatFractionTotal: (p) => p,
2972
- bulletClass: `${i}-bullet`,
2973
- bulletActiveClass: `${i}-bullet-active`,
2974
- modifierClass: `${i}-`,
2975
- currentClass: `${i}-current`,
2976
- totalClass: `${i}-total`,
2977
- hiddenClass: `${i}-hidden`,
2978
- progressbarFillClass: `${i}-progressbar-fill`,
2979
- progressbarOppositeClass: `${i}-progressbar-opposite`,
2980
- clickableClass: `${i}-clickable`,
2981
- lockClass: `${i}-lock`,
2982
- horizontalClass: `${i}-horizontal`,
2983
- verticalClass: `${i}-vertical`,
2984
- paginationDisabledClass: `${i}-disabled`
2985
- }
2986
- }), e.pagination = {
2987
- el: null,
2988
- bullets: []
2989
- };
2990
- let l, a = 0;
2991
- function o() {
2992
- return !e.params.pagination.el || !e.pagination.el || Array.isArray(e.pagination.el) && e.pagination.el.length === 0;
2993
- }
2994
- function c(p, m) {
2995
- const {
2996
- bulletActiveClass: v
2997
- } = e.params.pagination;
2998
- p && (p = p[`${m === "prev" ? "previous" : "next"}ElementSibling`], p && (p.classList.add(`${v}-${m}`), p = p[`${m === "prev" ? "previous" : "next"}ElementSibling`], p && p.classList.add(`${v}-${m}-${m}`)));
2999
- }
3000
- function d(p, m, v) {
3001
- if (p = p % v, m = m % v, m === p + 1)
3002
- return "next";
3003
- if (m === p - 1)
3004
- return "previous";
3005
- }
3006
- function u(p) {
3007
- const m = p.target.closest(Z(e.params.pagination.bulletClass));
3008
- if (!m)
3009
- return;
3010
- p.preventDefault();
3011
- const v = ce(m) * e.params.slidesPerGroup;
3012
- if (e.params.loop) {
3013
- if (e.realIndex === v) return;
3014
- const y = d(e.realIndex, v, e.slides.length);
3015
- y === "next" ? e.slideNext() : y === "previous" ? e.slidePrev() : e.slideToLoop(v);
3016
- } else
3017
- e.slideTo(v);
3018
- }
3019
- function f() {
3020
- const p = e.rtl, m = e.params.pagination;
3021
- if (o()) return;
3022
- let v = e.pagination.el;
3023
- v = R(v);
3024
- let y, T;
3025
- const A = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.slides.length, I = e.params.loop ? Math.ceil(A / e.params.slidesPerGroup) : e.snapGrid.length;
3026
- if (e.params.loop ? (T = e.previousRealIndex || 0, y = e.params.slidesPerGroup > 1 ? Math.floor(e.realIndex / e.params.slidesPerGroup) : e.realIndex) : typeof e.snapIndex < "u" ? (y = e.snapIndex, T = e.previousSnapIndex) : (T = e.previousIndex || 0, y = e.activeIndex || 0), m.type === "bullets" && e.pagination.bullets && e.pagination.bullets.length > 0) {
3027
- const S = e.pagination.bullets;
3028
- let E, x, k;
3029
- if (m.dynamicBullets && (l = Te(S[0], e.isHorizontal() ? "width" : "height"), v.forEach((L) => {
3030
- L.style[e.isHorizontal() ? "width" : "height"] = `${l * (m.dynamicMainBullets + 4)}px`;
3031
- }), m.dynamicMainBullets > 1 && T !== void 0 && (a += y - (T || 0), a > m.dynamicMainBullets - 1 ? a = m.dynamicMainBullets - 1 : a < 0 && (a = 0)), E = Math.max(y - a, 0), x = E + (Math.min(S.length, m.dynamicMainBullets) - 1), k = (x + E) / 2), S.forEach((L) => {
3032
- const O = [...["", "-next", "-next-next", "-prev", "-prev-prev", "-main"].map((C) => `${m.bulletActiveClass}${C}`)].map((C) => typeof C == "string" && C.includes(" ") ? C.split(" ") : C).flat();
3033
- L.classList.remove(...O);
3034
- }), v.length > 1)
3035
- S.forEach((L) => {
3036
- const O = ce(L);
3037
- O === y ? L.classList.add(...m.bulletActiveClass.split(" ")) : e.isElement && L.setAttribute("part", "bullet"), m.dynamicBullets && (O >= E && O <= x && L.classList.add(...`${m.bulletActiveClass}-main`.split(" ")), O === E && c(L, "prev"), O === x && c(L, "next"));
3038
- });
3039
- else {
3040
- const L = S[y];
3041
- if (L && L.classList.add(...m.bulletActiveClass.split(" ")), e.isElement && S.forEach((O, C) => {
3042
- O.setAttribute("part", C === y ? "bullet-active" : "bullet");
3043
- }), m.dynamicBullets) {
3044
- const O = S[E], C = S[x];
3045
- for (let z = E; z <= x; z += 1)
3046
- S[z] && S[z].classList.add(...`${m.bulletActiveClass}-main`.split(" "));
3047
- c(O, "prev"), c(C, "next");
3048
- }
3049
- }
3050
- if (m.dynamicBullets) {
3051
- const L = Math.min(S.length, m.dynamicMainBullets + 4), O = (l * L - l) / 2 - k * l, C = p ? "right" : "left";
3052
- S.forEach((z) => {
3053
- z.style[e.isHorizontal() ? C : "top"] = `${O}px`;
3054
- });
3055
- }
3056
- }
3057
- v.forEach((S, E) => {
3058
- if (m.type === "fraction" && (S.querySelectorAll(Z(m.currentClass)).forEach((x) => {
3059
- x.textContent = m.formatFractionCurrent(y + 1);
3060
- }), S.querySelectorAll(Z(m.totalClass)).forEach((x) => {
3061
- x.textContent = m.formatFractionTotal(I);
3062
- })), m.type === "progressbar") {
3063
- let x;
3064
- m.progressbarOpposite ? x = e.isHorizontal() ? "vertical" : "horizontal" : x = e.isHorizontal() ? "horizontal" : "vertical";
3065
- const k = (y + 1) / I;
3066
- let L = 1, O = 1;
3067
- x === "horizontal" ? L = k : O = k, S.querySelectorAll(Z(m.progressbarFillClass)).forEach((C) => {
3068
- C.style.transform = `translate3d(0,0,0) scaleX(${L}) scaleY(${O})`, C.style.transitionDuration = `${e.params.speed}ms`;
3069
- });
3070
- }
3071
- m.type === "custom" && m.renderCustom ? (S.innerHTML = m.renderCustom(e, y + 1, I), E === 0 && n("paginationRender", S)) : (E === 0 && n("paginationRender", S), n("paginationUpdate", S)), e.params.watchOverflow && e.enabled && S.classList[e.isLocked ? "add" : "remove"](m.lockClass);
3072
- });
3073
- }
3074
- function g() {
3075
- const p = e.params.pagination;
3076
- if (o()) return;
3077
- const m = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.grid && e.params.grid.rows > 1 ? e.slides.length / Math.ceil(e.params.grid.rows) : e.slides.length;
3078
- let v = e.pagination.el;
3079
- v = R(v);
3080
- let y = "";
3081
- if (p.type === "bullets") {
3082
- let T = e.params.loop ? Math.ceil(m / e.params.slidesPerGroup) : e.snapGrid.length;
3083
- e.params.freeMode && e.params.freeMode.enabled && T > m && (T = m);
3084
- for (let A = 0; A < T; A += 1)
3085
- p.renderBullet ? y += p.renderBullet.call(e, A, p.bulletClass) : y += `<${p.bulletElement} ${e.isElement ? 'part="bullet"' : ""} class="${p.bulletClass}"></${p.bulletElement}>`;
3086
- }
3087
- p.type === "fraction" && (p.renderFraction ? y = p.renderFraction.call(e, p.currentClass, p.totalClass) : y = `<span class="${p.currentClass}"></span> / <span class="${p.totalClass}"></span>`), p.type === "progressbar" && (p.renderProgressbar ? y = p.renderProgressbar.call(e, p.progressbarFillClass) : y = `<span class="${p.progressbarFillClass}"></span>`), e.pagination.bullets = [], v.forEach((T) => {
3088
- p.type !== "custom" && (T.innerHTML = y || ""), p.type === "bullets" && e.pagination.bullets.push(...T.querySelectorAll(Z(p.bulletClass)));
3089
- }), p.type !== "custom" && n("paginationRender", v[0]);
3090
- }
3091
- function h() {
3092
- e.params.pagination = wr(e, e.originalParams.pagination, e.params.pagination, {
3093
- el: "swiper-pagination"
426
+ }), Xt = ({
427
+ gamification: e,
428
+ scrollNode: t,
429
+ scrollStore: n,
430
+ leaderboardList: o
431
+ }) => {
432
+ const s = L(null), {
433
+ data: r,
434
+ hasMore: l,
435
+ loading: d,
436
+ key: a
437
+ } = v(o.$store), {
438
+ data: c
439
+ } = v(e.deepLink.$store), [m, p] = He(s);
440
+ return !r.length && !d ? /* @__PURE__ */ i(Yt, {
441
+ deepLink: c
442
+ }) : /* @__PURE__ */ f(T, {
443
+ children: [/* @__PURE__ */ i(Ht, {
444
+ items: r,
445
+ scrollNode: t,
446
+ scrollStore: n,
447
+ fetchMore: o.fetchMore,
448
+ hasMore: l,
449
+ openItemDetail: e.openUser,
450
+ currentUserId: e.currentUserId.get()
451
+ }, a), c && /* @__PURE__ */ i(Zt, {
452
+ ref: s,
453
+ children: /* @__PURE__ */ i(Tt, {
454
+ "data-a": "intr",
455
+ onClick: () => m(c),
456
+ title: "Invite Friends",
457
+ description: "Challenge them now!"
458
+ })
459
+ }), p]
460
+ });
461
+ }, en = ({
462
+ gamification: e,
463
+ scrollNode: t,
464
+ scrollStore: n
465
+ }) => e.leaderboardList ? /* @__PURE__ */ i(Xt, {
466
+ leaderboardList: e.leaderboardList,
467
+ gamification: e,
468
+ scrollNode: t,
469
+ scrollStore: n
470
+ }) : null, tn = ({ store: e, openQuestion: t }) => {
471
+ const { sdk: n } = G(), o = v(e);
472
+ return /* @__PURE__ */ i(Je, { openQuestion: t, questions: o.data, controlVideo: n == null ? void 0 : n.controlVideoPlayer });
473
+ }, nn = ({ userSummary: e }) => {
474
+ var t;
475
+ const [n, o] = S(void 0);
476
+ return y(() => {
477
+ const s = e.$store.subscribe((r) => {
478
+ r && o(r);
3094
479
  });
3095
- const p = e.params.pagination;
3096
- if (!p.el) return;
3097
- let m;
3098
- typeof p.el == "string" && e.isElement && (m = e.el.querySelector(p.el)), !m && typeof p.el == "string" && (m = [...document.querySelectorAll(p.el)]), m || (m = p.el), !(!m || m.length === 0) && (e.params.uniqueNavElements && typeof p.el == "string" && Array.isArray(m) && m.length > 1 && (m = [...e.el.querySelectorAll(p.el)], m.length > 1 && (m = m.find((v) => Xe(v, ".swiper")[0] === e.el))), Array.isArray(m) && m.length === 1 && (m = m[0]), Object.assign(e.pagination, {
3099
- el: m
3100
- }), m = R(m), m.forEach((v) => {
3101
- p.type === "bullets" && p.clickable && v.classList.add(...(p.clickableClass || "").split(" ")), v.classList.add(p.modifierClass + p.type), v.classList.add(e.isHorizontal() ? p.horizontalClass : p.verticalClass), p.type === "bullets" && p.dynamicBullets && (v.classList.add(`${p.modifierClass}${p.type}-dynamic`), a = 0, p.dynamicMainBullets < 1 && (p.dynamicMainBullets = 1)), p.type === "progressbar" && p.progressbarOpposite && v.classList.add(p.progressbarOppositeClass), p.clickable && v.addEventListener("click", u), e.enabled || v.classList.add(p.lockClass);
3102
- }));
3103
- }
3104
- function b() {
3105
- const p = e.params.pagination;
3106
- if (o()) return;
3107
- let m = e.pagination.el;
3108
- m && (m = R(m), m.forEach((v) => {
3109
- v.classList.remove(p.hiddenClass), v.classList.remove(p.modifierClass + p.type), v.classList.remove(e.isHorizontal() ? p.horizontalClass : p.verticalClass), p.clickable && (v.classList.remove(...(p.clickableClass || "").split(" ")), v.removeEventListener("click", u));
3110
- })), e.pagination.bullets && e.pagination.bullets.forEach((v) => v.classList.remove(...p.bulletActiveClass.split(" ")));
3111
- }
3112
- r("changeDirection", () => {
3113
- if (!e.pagination || !e.pagination.el) return;
3114
- const p = e.params.pagination;
3115
- let {
3116
- el: m
3117
- } = e.pagination;
3118
- m = R(m), m.forEach((v) => {
3119
- v.classList.remove(p.horizontalClass, p.verticalClass), v.classList.add(e.isHorizontal() ? p.horizontalClass : p.verticalClass);
480
+ return () => {
481
+ s();
482
+ };
483
+ }, [e]), /* @__PURE__ */ i(ke, { loading: !(n != null && n.summary), ...n == null ? void 0 : n.summary, successRate: (t = n == null ? void 0 : n.percentage) == null ? void 0 : t.correct });
484
+ }, sn = ({ gamification: e, className: t, scrollStore: n, scrollNode: o, appNode: s, style: r, responsiveStore: l }) => {
485
+ const { tabsShown: d } = v(n, { keys: ["tabsShown"] }), a = v(e.friendsTabEnabled), [c, m] = S(M.HOME), [, p] = Ue(), { sdkInDesktopView: h, screen: g } = v(l, { keys: ["sdkInDesktopView"] }), b = (I) => {
486
+ p(() => {
487
+ var B;
488
+ m(I), h === !1 && (((B = s.current) == null ? void 0 : B.getBoundingClientRect().y) || 0) < 0 && H(s, g.size, { behavior: "instant" });
3120
489
  });
3121
- }), r("init", () => {
3122
- e.params.pagination.enabled === !1 ? w() : (h(), g(), f());
3123
- }), r("activeIndexChange", () => {
3124
- typeof e.snapIndex > "u" && f();
3125
- }), r("snapIndexChange", () => {
3126
- f();
3127
- }), r("snapGridLengthChange", () => {
3128
- g(), f();
3129
- }), r("destroy", () => {
3130
- b();
3131
- }), r("enable disable", () => {
3132
- let {
3133
- el: p
3134
- } = e.pagination;
3135
- p && (p = R(p), p.forEach((m) => m.classList[e.enabled ? "remove" : "add"](e.params.pagination.lockClass)));
3136
- }), r("lock unlock", () => {
3137
- f();
3138
- }), r("click", (p, m) => {
3139
- const v = m.target, y = R(e.pagination.el);
3140
- if (e.params.pagination.el && e.params.pagination.hideOnClick && y && y.length > 0 && !v.classList.contains(e.params.pagination.bulletClass)) {
3141
- if (e.navigation && (e.navigation.nextEl && v === e.navigation.nextEl || e.navigation.prevEl && v === e.navigation.prevEl)) return;
3142
- const T = y[0].classList.contains(e.params.pagination.hiddenClass);
3143
- n(T === !0 ? "paginationShow" : "paginationHide"), y.forEach((A) => A.classList.toggle(e.params.pagination.hiddenClass));
3144
- }
3145
- });
3146
- const M = () => {
3147
- e.el.classList.remove(e.params.pagination.paginationDisabledClass);
3148
- let {
3149
- el: p
3150
- } = e.pagination;
3151
- p && (p = R(p), p.forEach((m) => m.classList.remove(e.params.pagination.paginationDisabledClass))), h(), g(), f();
3152
- }, w = () => {
3153
- e.el.classList.add(e.params.pagination.paginationDisabledClass);
3154
- let {
3155
- el: p
3156
- } = e.pagination;
3157
- p && (p = R(p), p.forEach((m) => m.classList.add(e.params.pagination.paginationDisabledClass))), b();
3158
490
  };
3159
- Object.assign(e.pagination, {
3160
- enable: M,
3161
- disable: w,
3162
- render: g,
3163
- update: f,
3164
- init: h,
3165
- destroy: b
3166
- });
3167
- }
3168
- const yr = ({ data: t, gamification: e, onEvent: s, swipeable: r, autoplay: n }) => {
3169
- const i = D(), l = D(), { listOfQuestions: a, countQuestionsAvailable: o } = He(() => {
3170
- const g = t ? Object.values(t) : [];
3171
- return {
3172
- listOfQuestions: g,
3173
- countQuestionsAvailable: g.filter(({ marketClosed: h }) => !h).length
3174
- };
3175
- }, [t]), c = Re(
3176
- async (g, h) => {
3177
- try {
3178
- await e.betPackVote(g, h), s({
3179
- type: "slVoted",
3180
- payload: {
3181
- questionId: g,
3182
- answerId: h
3183
- }
3184
- });
3185
- } finally {
3186
- i.current && clearTimeout(i.current), n && (i.current = setTimeout(() => {
3187
- var b;
3188
- (b = l.current) == null || b.slideNext();
3189
- }, 2e3));
3190
- }
3191
- },
3192
- [e, s, n]
3193
- );
3194
- X(() => (s({
3195
- type: "slBetPackReady",
3196
- payload: {
3197
- next: () => {
3198
- var g;
3199
- return (g = l.current) == null ? void 0 : g.slideNext();
3200
- },
3201
- prev: () => {
3202
- var g;
3203
- return (g = l.current) == null ? void 0 : g.slidePrev();
3204
- },
3205
- current: 0,
3206
- canNext: !0,
3207
- canPrev: !1
3208
- }
3209
- }), () => {
3210
- i.current && clearTimeout(i.current);
3211
- }), [s]);
3212
- const d = (g) => {
3213
- var h;
3214
- const b = g.realIndex;
3215
- if (s({
3216
- type: "slBetPackChangeCard",
3217
- payload: {
3218
- current: b,
3219
- canNext: b < Object.keys(t).length + 1,
3220
- canPrev: b >= 1
3221
- }
3222
- }), b !== 0 && b !== Object.keys(t).length + 1 && (h = a[b - 1]) != null && h.id) {
3223
- e.openQuestion(a[b - 1].id, {
3224
- openedFrom: "bet-pack",
3225
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3226
- // @ts-expect-error
3227
- attributes: {
3228
- id: a[b - 1].id,
3229
- type: a[b - 1].type,
3230
- status: a[b - 1].status,
3231
- attributes: {
3232
- case: void 0
3233
- }
3234
- }
3235
- });
491
+ y(() => n.subscribe((I) => {
492
+ if (I.scrollPosition === 0) {
493
+ n.setKey("tabsShown", !0);
3236
494
  return;
3237
495
  }
3238
- e.closeQuestion();
3239
- }, [u, f] = W(1.1);
3240
- return X(() => {
3241
- const g = bt(() => {
3242
- var h;
3243
- const b = (h = l.current) == null ? void 0 : h.size;
3244
- if (!b)
3245
- return;
3246
- const M = 1 + 30 / (b / 100) / 100 * 2;
3247
- f(Math.ceil(M * 1e3) / 1e3);
3248
- }, 200);
3249
- return window.addEventListener("resize", g), g(), () => {
3250
- window.removeEventListener("resize", g);
3251
- };
3252
- }, []), /* @__PURE__ */ F(
3253
- Ks,
3254
- {
3255
- slidesPerView: u,
3256
- spaceBetween: 12,
3257
- centeredSlides: !0,
3258
- centerInsufficientSlides: !0,
3259
- allowTouchMove: r,
3260
- pagination: {
3261
- clickable: !0
3262
- },
3263
- modules: [br],
3264
- onSlideChange: d,
3265
- onBeforeSlideChangeStart: () => {
3266
- i.current && clearTimeout(i.current);
3267
- },
3268
- onSwiper: (g) => {
3269
- l.current = g;
3270
- },
3271
- children: [
3272
- /* @__PURE__ */ P(ae, { children: /* @__PURE__ */ P(vr, { sliderRef: l, countQuestionsAvailable: o }) }),
3273
- a.map((g) => g ? /* @__PURE__ */ P(ae, { children: /* @__PURE__ */ P(me, { children: /* @__PURE__ */ P(pr, { question: g, vote: c }) }, g.id) }) : null),
3274
- /* @__PURE__ */ P(ae, { children: /* @__PURE__ */ P(dr, { onEvent: s }) })
3275
- ]
3276
- }
3277
- );
3278
- }, Sr = ({ gamification: t, autoplay: e, overlay: s, swipeable: r, onEvent: n }) => {
3279
- const i = Se(t.betPack.getStore()), { error: l, loading: a, data: o } = i;
3280
- return a || !Object.hasOwn(i, "data") ? /* @__PURE__ */ P(Le, {}) : l ? /* @__PURE__ */ P(
3281
- Ie,
3282
- {
3283
- onEvent: n,
3284
- actionFn: () => n({ type: "slHardRefresh" }),
3285
- description: l instanceof yt && l.code !== St.InvalidArgument ? `The event ID was not
3286
- specified or is invalid.` : `The server is unable to
3287
- handle this request.`
3288
- }
3289
- ) : !o || !o.timestamp || !o.data || !Object.keys(o.data).length ? /* @__PURE__ */ P(
3290
- Ie,
496
+ l.get().sdkInDesktopView ? n.setKey("tabsShown", I.scrollDirection === "backward") : n.setKey("tabsShown", I.scrollDirection === "forward");
497
+ }), [n, l]), y(() => {
498
+ a || m(M.HOME);
499
+ }, [a]);
500
+ let $ = "0px";
501
+ return h ? $ = d ? "0px" : "calc(0px - var(--header-height))" : $ = d ? "var(--header-height)" : "0px", /* @__PURE__ */ f(Be, { className: E(t, "SL-Tabs", "sl-hide-on-modal"), style: r, children: [
502
+ a && /* @__PURE__ */ i(
503
+ Fe,
504
+ {
505
+ style: {
506
+ top: $
507
+ },
508
+ children: /* @__PURE__ */ i(St, { activePage: c, toggleActivePage: b })
509
+ }
510
+ ),
511
+ c === M.HOME && /* @__PURE__ */ f(T, { children: [
512
+ /* @__PURE__ */ i(ze, { children: /* @__PURE__ */ i(Pe, { children: /* @__PURE__ */ i(nn, { userSummary: e.userSummary }) }) }),
513
+ /* @__PURE__ */ i(Ve, { style: { flex: 1 }, children: /* @__PURE__ */ i(tn, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) })
514
+ ] }),
515
+ c === M.LEADERBOARD && /* @__PURE__ */ i(qe, { children: /* @__PURE__ */ i(en, { scrollStore: n, scrollNode: o, gamification: e }) })
516
+ ] });
517
+ }, on = () => W, re = /* @__PURE__ */ u(on())({
518
+ name: "OpenedContainer",
519
+ class: "ouvguos",
520
+ propsAsIs: !0
521
+ }), le = "t1eu4lbg", an = /* @__PURE__ */ u("div")({
522
+ name: "UserContainer",
523
+ class: "uuv2xqo",
524
+ propsAsIs: !1
525
+ }), rn = ({
526
+ correct: e,
527
+ incorrect: t
528
+ }) => {
529
+ const n = e + t;
530
+ return n === 0 ? 0 : Math.round(e / n * 100);
531
+ }, zs = ({
532
+ gamification: e,
533
+ scrollStore: t,
534
+ className: n,
535
+ appNode: o,
536
+ scrollNode: s,
537
+ responsiveStore: r
538
+ }) => /* @__PURE__ */ i(sn, {
539
+ appNode: o,
540
+ scrollStore: t,
541
+ scrollNode: s,
542
+ className: n,
543
+ gamification: e,
544
+ responsiveStore: r
545
+ }), ln = ({
546
+ gamification: e,
547
+ muted: t,
548
+ sdk: n,
549
+ className: o,
550
+ appNode: s,
551
+ responsiveStore: r
552
+ }) => {
553
+ const {
554
+ topNavigation: l
555
+ } = G(), d = v(e.openedQuestionId), a = v(e.openedQuestion.$store), c = v(e.openedUser || ye(void 0)), {
556
+ sdkInDesktopView: m
557
+ } = v(r, {
558
+ keys: ["sdkInDesktopView"]
559
+ }), {
560
+ hiding: p,
561
+ onAnimationEnd: h
562
+ } = je();
563
+ if (!d && !c)
564
+ return null;
565
+ const g = a ? /* @__PURE__ */ i(re, {
566
+ className: E(o, !l && le),
567
+ hiding: p,
568
+ onAnimationEnd: h,
569
+ children: /* @__PURE__ */ i(rt, {
570
+ muted: t,
571
+ sdk: n,
572
+ gamification: e
573
+ })
574
+ }) : c ? /* @__PURE__ */ i(re, {
575
+ className: E(o, !l && le),
576
+ hiding: p,
577
+ onAnimationEnd: h,
578
+ children: /* @__PURE__ */ f(an, {
579
+ children: [/* @__PURE__ */ i(dt, {
580
+ label: "Friend's Rank",
581
+ close: e.closeUser
582
+ }), /* @__PURE__ */ i(Ke, {
583
+ children: /* @__PURE__ */ i(ke, {
584
+ ...c,
585
+ successRate: rn(c)
586
+ })
587
+ })]
588
+ })
589
+ }) : null;
590
+ return /* @__PURE__ */ i(Ne, {
591
+ container: s,
592
+ useContainer: !m,
593
+ children: g
594
+ });
595
+ }, dn = xe(() => import("./gamification-feature.js")), cn = ({ sdk: e, feature: t, className: n, scrollStore: o, appNode: s, scrollNode: r, responsiveStore: l }) => {
596
+ const d = C(() => t && t.featureConfig.get().type === N.GAMES ? /* @__PURE__ */ i(It, { className: n, sdk: e, feature: t, children: /* @__PURE__ */ i(
597
+ dn,
3291
598
  {
3292
- onEvent: n,
3293
- actionFn: () => n({ type: "slHardRefresh" }),
3294
- description: `It looks like we couldn't
3295
- load the questions.`
599
+ appNode: s,
600
+ scrollStore: o,
601
+ scrollNode: r,
602
+ className: n,
603
+ responsiveStore: l,
604
+ gamification: t
3296
605
  }
3297
- ) : /* @__PURE__ */ P(
3298
- yr,
606
+ ) }) : null, [e, t, n, l, o, r, s]);
607
+ return /* @__PURE__ */ i(
608
+ Le,
3299
609
  {
3300
- data: o.data,
3301
- gamification: t,
3302
- onEvent: n,
3303
- swipeable: r,
3304
- autoplay: e,
3305
- overlay: s
610
+ fallback: /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "page loading..." }),
611
+ children: d
3306
612
  }
3307
613
  );
3308
- }, Er = /* @__PURE__ */ _("div")({
3309
- name: "BetPackContainer",
3310
- class: "b18vssq2",
614
+ }, pn = ({ feature: e, sdk: t, muted: n, className: o, appNode: s, responsiveStore: r }) => e && e.featureConfig.get().type === N.GAMES ? /* @__PURE__ */ i(
615
+ ln,
616
+ {
617
+ className: o,
618
+ appNode: s,
619
+ muted: n,
620
+ sdk: t,
621
+ responsiveStore: r,
622
+ gamification: e
623
+ }
624
+ ) : null;
625
+ window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));
626
+ function un(e) {
627
+ return e instanceof DOMException && // everything except Firefox
628
+ (e.code === 22 || // Firefox
629
+ e.code === 1014 || // test name field too, because code might not be present
630
+ // everything except Firefox
631
+ e.name === "QuotaExceededError" || // Firefox
632
+ e.name === "NS_ERROR_DOM_QUOTA_REACHED");
633
+ }
634
+ class mn {
635
+ constructor(t = "main", n = window.localStorage) {
636
+ k(this, "delimiter", ":");
637
+ k(this, "prefix");
638
+ k(this, "storage");
639
+ k(this, "clear", () => {
640
+ for (const t in window.localStorage)
641
+ t.startsWith(this.prefix) && this.storage.removeItem(t);
642
+ });
643
+ k(this, "generateKey", (t) => `${this.prefix}${this.delimiter}${t.join(this.delimiter)}`);
644
+ k(this, "write", (...t) => {
645
+ const n = t.pop() || "", o = this.generateKey(t);
646
+ try {
647
+ this.storage.setItem(o, n);
648
+ } catch (s) {
649
+ un(s) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(o, n));
650
+ }
651
+ });
652
+ k(this, "read", (...t) => {
653
+ const n = this.storage.getItem(this.generateKey(t));
654
+ return n === null ? void 0 : n;
655
+ });
656
+ k(this, "remove", (...t) => {
657
+ this.storage.removeItem(this.generateKey(t));
658
+ });
659
+ this.prefix = `sl-sdk${this.delimiter}${t}`, this.storage = n;
660
+ }
661
+ }
662
+ var de;
663
+ (function(e) {
664
+ e.Init = "init", e.Ready = "ready", e.Connecting = "connecting", e.Connected = "connected", e.Disconnected = "disconnected", e.Failed = "failed", e.Reconnect = "reconnect", e.Reconnecting = "reconnecting";
665
+ })(de || (de = {}));
666
+ U("grpc:stream");
667
+ x.Unknown, x.Internal, x.DeadlineExceeded, x.ResourceExhausted, x.FailedPrecondition, x.Unavailable, x.DataLoss;
668
+ U("grpc:retry");
669
+ ee(10, { description: "Number of attempts to retry" }), ee(3e4, { description: "Max delay between retries in milliseconds" });
670
+ var A;
671
+ (function(e) {
672
+ e.SCHEMA = "schema", e.EXTERNAL_TOKEN = "eToken", e.TOKEN = "token";
673
+ })(A || (A = {}));
674
+ class hn extends mn {
675
+ constructor() {
676
+ super("user");
677
+ // Schema
678
+ k(this, "setSchema", (n) => {
679
+ this.write(A.SCHEMA, n);
680
+ });
681
+ k(this, "getSchema", () => this.read(A.SCHEMA));
682
+ // Token
683
+ k(this, "setToken", (n) => {
684
+ this.write(A.TOKEN, n);
685
+ });
686
+ k(this, "getToken", () => this.read(A.TOKEN));
687
+ // External Token
688
+ k(this, "setExternalToken", (n) => {
689
+ this.write(A.EXTERNAL_TOKEN, n);
690
+ });
691
+ k(this, "getExternalToken", () => this.read(A.EXTERNAL_TOKEN));
692
+ k(this, "removeToken", () => {
693
+ this.remove(A.TOKEN);
694
+ });
695
+ }
696
+ }
697
+ var ce;
698
+ (function(e) {
699
+ e.DISABLED = "disabled", e.INITIALIZATION = "initialization", e.READY = "ready", e.FAILED = "failed", e.SUSPENDED = "suspended";
700
+ })(ce || (ce = {}));
701
+ var pe;
702
+ (function(e) {
703
+ e.SHOWED = "showed", e.EVENT = "ev";
704
+ })(pe || (pe = {}));
705
+ var ue;
706
+ (function(e) {
707
+ e.ONBOARDING = "onboarding", e.ONBOARDING_IO = "onboarding_io", e.QUESTION_RECEIVED = "q-received", e.QUESTION_OPENED = "q-opened";
708
+ })(ue || (ue = {}));
709
+ var me;
710
+ (function(e) {
711
+ e.ALLOWED = "allowed", e.DISALLOWED = "disallowed";
712
+ })(me || (me = {}));
713
+ var he;
714
+ (function(e) {
715
+ e.UNKNOWN = "unknown", e.ALREADY_VOTED = "already_voted";
716
+ })(he || (he = {}));
717
+ U("deep_link");
718
+ U("bypass");
719
+ new hn();
720
+ U("video_player");
721
+ w.FACTOID + "", w.POLL + "", w.TRIVIA + "", w.PREDICTION + "", w.TWEET + "";
722
+ var ve;
723
+ (function(e) {
724
+ e.Unset = "unset", e.Required = "required", e.Optional = "optional", e.Completed = "completed", e.Disabled = "disabled", e.Unavailable = "unavailable";
725
+ })(ve || (ve = {}));
726
+ w.POLL, w.PREDICTION, w.TRIVIA;
727
+ const vn = {
728
+ [N.GAMES]: !0
729
+ }, fn = /* @__PURE__ */ u("div")({
730
+ name: "Buttons",
731
+ class: "b5o8qbl",
732
+ propsAsIs: !1
733
+ }), gn = ({
734
+ children: e,
735
+ className: t
736
+ }) => /* @__PURE__ */ i(fn, {
737
+ className: t,
738
+ children: e
739
+ }), $e = /* @__PURE__ */ u("div")({
740
+ name: "Navigation",
741
+ class: "n6tbwuy",
742
+ propsAsIs: !1
743
+ }), In = () => gn, fe = /* @__PURE__ */ u(In())({
744
+ name: "NavigationItems",
745
+ class: "n1up4z7v",
746
+ propsAsIs: !0
747
+ }), bn = /* @__PURE__ */ u("button")({
748
+ name: "SButton",
749
+ class: "sxxa0c",
3311
750
  propsAsIs: !1
3312
- }), ie = "slBetPackCb", xr = gt("betPack-ui"), Tr = (t, e = {}) => {
3313
- var s, r;
3314
- const { questionId: n, answerId: i } = e, l = { questionId: n, answerId: i };
3315
- xr.debug({ id: ie, type: t, ...l }), (s = window.top) == null || s.postMessage({ id: ie, type: t, ...l }, "*"), window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers[ie] && window.webkit.messageHandlers[ie].postMessage({ type: t, ...l }), (r = window.slBetPackCb) != null && r.postMessage && window.slBetPackCb.postMessage(JSON.stringify({ type: t, ...l, from: "base" }));
3316
- }, Cr = (t) => {
3317
- Tr(t.type, t.payload);
3318
- }, Pr = /* @__PURE__ */ _("div")({
751
+ }), kn = /* @__PURE__ */ u("span")({
752
+ name: "ButtonIcon",
753
+ class: "b193dcyu",
754
+ propsAsIs: !1
755
+ }), yn = /* @__PURE__ */ u("span")({
756
+ name: "ButtonLabel",
757
+ class: "b40tuix",
758
+ propsAsIs: !1
759
+ }), Nn = "s14xk0af", Sn = "ha3mg7c", $n = "h103yr45", z = ({ disabled: e, active: t, onClick: n, label: o, icon: s, id: r }) => /* @__PURE__ */ i(
760
+ bn,
761
+ {
762
+ onClick: n,
763
+ "data-a": "intr",
764
+ disabled: e,
765
+ className: E(
766
+ t && Nn,
767
+ !t && (r === "channels" || r === "featuredGroups") && Sn,
768
+ !t && r === "leaderboard" && $n
769
+ ),
770
+ children: /* @__PURE__ */ f(T, { children: [
771
+ s && /* @__PURE__ */ i(kn, { children: s }),
772
+ /* @__PURE__ */ i(yn, { children: o })
773
+ ] })
774
+ }
775
+ ), An = () => D, wn = /* @__PURE__ */ u(An())({
776
+ name: "ButtonIcon",
777
+ class: "b11wpe79",
778
+ propsAsIs: !0
779
+ }), Cn = /* @__PURE__ */ u("div")({
3319
780
  name: "Container",
3320
- class: "c1mj28sn",
781
+ class: "calnblm",
3321
782
  propsAsIs: !1
3322
- }), Mr = /* @__PURE__ */ _("button")({
3323
- name: "CloseButton",
3324
- class: "coc9f01",
783
+ }), En = /* @__PURE__ */ u("div")({
784
+ name: "Title",
785
+ class: "t1438p52",
3325
786
  propsAsIs: !1
3326
- }), Fe = "b590k5k", kr = () => te, pt = /* @__PURE__ */ _(kr())({
3327
- name: "IconArrowPrev",
3328
- class: "i1tkem14",
787
+ }), Rn = /* @__PURE__ */ u("div")({
788
+ name: "CloseIconWrap",
789
+ class: "c17srj38",
790
+ propsAsIs: !1
791
+ }), xn = () => D, Ln = /* @__PURE__ */ u(xn())({
792
+ name: "CloseIcon",
793
+ class: "clqia8k",
3329
794
  propsAsIs: !0
3330
- }), Ir = () => pt, Lr = /* @__PURE__ */ _(Ir())({
3331
- name: "IconArrowNext",
3332
- class: "i175qlj5",
795
+ }), Tn = () => D, Dn = /* @__PURE__ */ u(Tn())({
796
+ name: "DashboardIcon",
797
+ class: "df5w958",
3333
798
  propsAsIs: !0
3334
- }), Ar = /* @__PURE__ */ _("div")({
3335
- name: "Header",
3336
- class: "h1foi3kz",
799
+ }), On = "h12x6aiv", _n = be(({
800
+ sdk: e,
801
+ className: t
802
+ }, n) => {
803
+ const o = () => {
804
+ e.closeFeature();
805
+ };
806
+ return /* @__PURE__ */ f($e, {
807
+ className: E(t, On),
808
+ children: [/* @__PURE__ */ f(Cn, {
809
+ children: [/* @__PURE__ */ f(En, {
810
+ children: [/* @__PURE__ */ i(Dn, {
811
+ name: "dashboard"
812
+ }), "Dashboard"]
813
+ }), /* @__PURE__ */ i(Rn, {
814
+ "data-a": "intr",
815
+ onClick: o,
816
+ children: /* @__PURE__ */ i(Ln, {
817
+ name: "icon-cross"
818
+ })
819
+ })]
820
+ }), /* @__PURE__ */ i("div", {
821
+ ref: n
822
+ })]
823
+ });
824
+ }), Mn = be(({
825
+ sdk: e,
826
+ className: t
827
+ }, n) => {
828
+ const o = v(e.sdkStore.organizationSettings), s = v(e.sdkStore.streamSettings), r = v(e.getActiveFeature()), l = C(() => {
829
+ const a = (s == null ? void 0 : s.data) || (o == null ? void 0 : o.data);
830
+ return a != null && a.overlays ? a.overlays : [];
831
+ }, [o, s]), d = C(() => [...l.filter(({
832
+ enableSdkButton: a,
833
+ type: c
834
+ }) => c === N.GAMES || a).map((a) => ({
835
+ id: a.type,
836
+ onClick: () => e.openFeature(a.type),
837
+ disabled: !(a.type in vn),
838
+ label: a.name,
839
+ icon: /* @__PURE__ */ i("img", {
840
+ src: a.icon,
841
+ alt: ""
842
+ }),
843
+ /** multiplied by 10 to add the ability to insert custom buttons between our buttons */
844
+ position: a.position * 10
845
+ }))].sort((a, c) => a.position - c.position), [l, e]);
846
+ return /* @__PURE__ */ f($e, {
847
+ className: t,
848
+ children: [d.length !== 0 && /* @__PURE__ */ i(fe, {
849
+ children: [/* @__PURE__ */ i(z, {
850
+ id: "Channels",
851
+ onClick: () => e.closeFeature(),
852
+ label: "Channels",
853
+ active: r === 0
854
+ }, "Channels"), ...d.map((a) => a.id === N.GAMES ? /* @__PURE__ */ i(z, {
855
+ ...a,
856
+ active: a.id === r,
857
+ label: "StreamLayer +",
858
+ id: "featuredGroups",
859
+ icon: /* @__PURE__ */ i(wn, {
860
+ name: "icon-btn-feature-groups",
861
+ "data-selected": a.id === r
862
+ })
863
+ }, a.id) : /* @__PURE__ */ i(z, {
864
+ ...a,
865
+ icon: void 0,
866
+ active: a.id === r
867
+ }, a.id))]
868
+ }), !d.length && /* @__PURE__ */ i(fe, {
869
+ children: [/* @__PURE__ */ i(z, {
870
+ id: "empty",
871
+ label: "No Features...",
872
+ active: !1,
873
+ disabled: !0
874
+ }, "empty")]
875
+ }), /* @__PURE__ */ i("div", {
876
+ ref: n
877
+ })]
878
+ });
879
+ }), Un = /* @__PURE__ */ u("div")({
880
+ name: "Container",
881
+ class: "c1qjj4d4",
3337
882
  propsAsIs: !1
3338
- }), Or = /* @__PURE__ */ _("div")({
3339
- name: "HeaderTitle",
3340
- class: "hc2d48a",
883
+ }), Bn = /* @__PURE__ */ u("div")({
884
+ name: "CloseIconWrap",
885
+ class: "c1lg6b8a",
3341
886
  propsAsIs: !1
3342
- }), zr = /* @__PURE__ */ _("div")({
3343
- name: "Main",
3344
- class: "mgfyjlp",
887
+ }), Fn = () => D, zn = /* @__PURE__ */ u(Fn())({
888
+ name: "CloseIcon",
889
+ class: "c159el66",
890
+ propsAsIs: !0
891
+ }), Pn = /* @__PURE__ */ u("div")({
892
+ name: "Title",
893
+ class: "t16xmufv",
3345
894
  propsAsIs: !1
3346
- }), _r = /* @__PURE__ */ _("div")({
3347
- name: "Footer",
3348
- class: "f1vakhu9",
895
+ }), Vn = /* @__PURE__ */ u("img")({
896
+ name: "SponsorLogo",
897
+ class: "s83lc21",
3349
898
  propsAsIs: !1
3350
- }), je = /* @__PURE__ */ _("button")({
3351
- name: "SlideSwitchButton",
3352
- class: "spp13y7",
899
+ }), qn = /* @__PURE__ */ u("div")({
900
+ name: "PresentsTitle",
901
+ class: "p1p7igia",
3353
902
  propsAsIs: !1
3354
- }), Vr = Ae(({ sdk: t, onEvent: e, close: s }, r) => {
3355
- const [n, i] = W(), [l, a] = W(), o = Re(
3356
- (c) => {
3357
- if (c.type === "slBetPackReady") {
3358
- const { next: d, prev: u, current: f, canNext: g, canPrev: h } = c.payload || {};
3359
- i({ next: d, prev: u }), a((b) => ({
3360
- current: b != null && b.current ? b == null ? void 0 : b.current : f,
3361
- canPrev: b != null && b.current ? b == null ? void 0 : b.canPrev : h,
3362
- canNext: g
3363
- }));
3364
- }
3365
- if (c.type === "slBetPackChangeCard") {
3366
- const { current: d, canNext: u, canPrev: f } = c.payload || {};
3367
- a({ current: d, canNext: u, canPrev: f });
3368
- }
3369
- e == null || e(c);
3370
- },
3371
- [e]
3372
- );
3373
- return X(() => () => {
3374
- var c;
3375
- const d = t.getFeature(qe.GAMES);
3376
- d && ((c = d.betPack) == null || c.off());
3377
- }, [t]), /* @__PURE__ */ F(Pr, { ref: r, children: [
3378
- /* @__PURE__ */ F(Ar, { children: [
3379
- /* @__PURE__ */ F(Or, { children: [
3380
- /* @__PURE__ */ P(te, { name: "fgIcon" }),
3381
- "Featured Groups+"
3382
- ] }),
3383
- /* @__PURE__ */ P(Mr, { "data-a": "intr", onClick: s, children: /* @__PURE__ */ P(te, { name: "icon-close-btn-gray" }) })
903
+ }), jn = /* @__PURE__ */ u("div")({
904
+ name: "Subtitle",
905
+ class: "s1eftsbu",
906
+ propsAsIs: !1
907
+ }), Kn = /* @__PURE__ */ u("div")({
908
+ name: "Description",
909
+ class: "d8uezec",
910
+ propsAsIs: !1
911
+ }), Qn = /* @__PURE__ */ u("button")({
912
+ name: "ActionButton",
913
+ class: "a1h1bk90",
914
+ propsAsIs: !1
915
+ }), ge = ({ close: e, action: t, onboarding: n }) => {
916
+ var o, s, r, l, d, a, c, m;
917
+ return /* @__PURE__ */ f(Un, { children: [
918
+ /* @__PURE__ */ i(Bn, { "data-a": "intr", onClick: e, children: /* @__PURE__ */ i(zn, { name: "icon-cross" }) }),
919
+ ((s = (o = n == null ? void 0 : n.titleCard) == null ? void 0 : o.media) == null ? void 0 : s.sponsorLogo) && /* @__PURE__ */ f(Pn, { children: [
920
+ /* @__PURE__ */ i(Vn, { alt: "sponsor-logo", src: (l = (r = n == null ? void 0 : n.titleCard) == null ? void 0 : r.media) == null ? void 0 : l.sponsorLogo }),
921
+ /* @__PURE__ */ i(qn, { children: "PRESENTS" })
3384
922
  ] }),
3385
- /* @__PURE__ */ P(zr, { children: /* @__PURE__ */ P(Gr, { sdk: t, onEvent: o, overlay: !0 }) }),
3386
- /* @__PURE__ */ F(_r, { children: [
3387
- /* @__PURE__ */ P(je, { "data-a": "intr", onClick: n == null ? void 0 : n.prev, disabled: !(l != null && l.canPrev), children: /* @__PURE__ */ P(pt, { "data-a": "intr", name: "iconArrowPrev", className: Ee((l == null ? void 0 : l.canPrev) && Fe) }) }),
3388
- /* @__PURE__ */ P(je, { "data-a": "intr", onClick: n == null ? void 0 : n.next, disabled: !(l != null && l.canNext), children: /* @__PURE__ */ P(Lr, { "data-a": "intr", name: "iconArrowPrev", className: Ee((l == null ? void 0 : l.canNext) && Fe) }) })
3389
- ] })
923
+ ((d = n == null ? void 0 : n.titleCard) == null ? void 0 : d.title) && /* @__PURE__ */ i(jn, { children: (a = n == null ? void 0 : n.titleCard) == null ? void 0 : a.title }),
924
+ ((c = n == null ? void 0 : n.titleCard) == null ? void 0 : c.subtitle) && /* @__PURE__ */ i(Kn, { children: (m = n == null ? void 0 : n.titleCard) == null ? void 0 : m.subtitle }),
925
+ /* @__PURE__ */ i(Qn, { "data-a": "intr", onClick: t, children: "Play Now" })
3390
926
  ] });
3391
- }), $r = ({ user: t, gamification: e, overlay: s, swipeable: r, onEvent: n }) => t.data ? e ? /* @__PURE__ */ P(Sr, { overlay: s, gamification: e, onEvent: n, swipeable: r }) : /* @__PURE__ */ P(Le, {}) : t.error && !t.loading ? /* @__PURE__ */ P(
3392
- Ie,
3393
- {
3394
- onEvent: n,
3395
- actionFn: () => n({ type: "slHardRefresh" }),
3396
- description: `You are not authorized to
3397
- view this resource.`
3398
- }
3399
- ) : /* @__PURE__ */ P(Le, {}), Gr = wt(({ sdk: t, swipeable: e = !0, onEvent: s = Cr, overlay: r }) => {
3400
- const n = Se(t.featuresList.getStore()), i = He(() => t.getFeature(qe.GAMES), [n]), l = Se(t.getUserStore());
3401
- return X(() => (t.writeOverlaySessionId(), () => {
3402
- t.writeOverlaySessionId("");
3403
- }), []), /* @__PURE__ */ P(
3404
- Er,
3405
- {
3406
- className: Ee("SL-BetPack", r && "SL-BetPack--overlay", !r && "SL-BetPack--standalone"),
3407
- children: /* @__PURE__ */ P($r, { overlay: r, user: l, gamification: i, onEvent: s, swipeable: e })
3408
- }
3409
- );
3410
- });
927
+ }, Q = [{
928
+ graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/dark/step_1.png",
929
+ tagline: "",
930
+ headline: /* @__PURE__ */ f(T, {
931
+ children: ["Welcome to ", /* @__PURE__ */ i("br", {}), " Live Challenge"]
932
+ })
933
+ }, {
934
+ graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/dark/step_2.png",
935
+ headline: "Live insights, polls, trivia and predictions."
936
+ }, {
937
+ graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/dark/step_3.png",
938
+ headline: "Win points and play against friends."
939
+ }], Wn = /* @__PURE__ */ u("div")({
940
+ name: "OnboardingContainer",
941
+ class: "o1xni1kr",
942
+ propsAsIs: !1
943
+ }), Gn = () => W, Hn = /* @__PURE__ */ u(Gn())({
944
+ name: "OnboardingNotificationContainer",
945
+ class: "o1vnouv7",
946
+ propsAsIs: !0
947
+ }), Ie = /* @__PURE__ */ u("div")({
948
+ name: "InnerContainer",
949
+ class: "i59uefw",
950
+ propsAsIs: !1
951
+ }), Jn = /* @__PURE__ */ u("div")({
952
+ name: "OnboardingOverlap",
953
+ class: "ovnr8ov",
954
+ propsAsIs: !1
955
+ }), Yn = ({
956
+ deepLink: e,
957
+ onboardingOpts: t,
958
+ notification: n,
959
+ gamification: o,
960
+ loading: s,
961
+ sdk: r,
962
+ throttled: l
963
+ }) => {
964
+ var d, a, c, m, p, h, g;
965
+ const b = v(o.friends ? o.friends.getStore() : ye({
966
+ data: []
967
+ })), [$, I] = S(void 0), B = C(() => {
968
+ var R, _;
969
+ const J = r.getInviter();
970
+ return J ? (_ = (R = b.data) == null ? void 0 : R.find(({
971
+ slId: we
972
+ }) => we === J)) == null ? void 0 : _.name : "";
973
+ }, [b.data, r]);
974
+ return y(() => {
975
+ const R = e.$store.subscribe((_) => {
976
+ _ && I(_.data);
977
+ });
978
+ return () => {
979
+ R();
980
+ };
981
+ }, [e.$store]), /* @__PURE__ */ f(Wn, {
982
+ children: [/* @__PURE__ */ i(Ze, {
983
+ loading: s,
984
+ rules: [{
985
+ label: "Answer as many questions as you like.",
986
+ icon: "icon-btn-feature-groups"
987
+ }, {
988
+ label: "Win points for each correct trivia or prediction answer.",
989
+ icon: "icon-thumb-up"
990
+ }, {
991
+ label: "Top the leader board and best your friends.",
992
+ icon: "icon-trophy"
993
+ }],
994
+ rulesBtnLabel: (d = t.rules) == null ? void 0 : d.buttonLabel,
995
+ rulesTitle: (a = t.rules) == null ? void 0 : a.heading,
996
+ termsTitle: "Terms and Conditions",
997
+ termsText: (c = t.rules) == null ? void 0 : c.terms,
998
+ steps: Q,
999
+ primaryColor: (m = t.inviteCard) == null ? void 0 : m.iconColor,
1000
+ inviteLink: $,
1001
+ inviteCardTitle: (p = t.inviteCard) == null ? void 0 : p.heading,
1002
+ inviteCardSubtext: (h = t.inviteCard) == null ? void 0 : h.subtext,
1003
+ inviteCardBtnLabel: (g = t.inviteCard) == null ? void 0 : g.buttonLabel,
1004
+ onClose: () => {
1005
+ var R;
1006
+ (R = n.close) == null || R.call(n);
1007
+ },
1008
+ gamification: o,
1009
+ sdk: r,
1010
+ inviterName: B
1011
+ }), l && /* @__PURE__ */ i(Jn, {})]
1012
+ });
1013
+ }, Zn = ({
1014
+ sdk: e,
1015
+ notification: t,
1016
+ saveHeight: n,
1017
+ style: o,
1018
+ appNode: s,
1019
+ sdkInDesktopView: r,
1020
+ responsiveStore: l
1021
+ }) => {
1022
+ const d = L(null), a = t.data.onboarding, [c, m] = S(a == null ? void 0 : a.instantOpen), p = e.getFeature(N.GAMES), h = C(() => Q == null ? void 0 : Q.map(({
1023
+ graphicSrc: I
1024
+ }) => I), []), {
1025
+ screen: g
1026
+ } = v(l, {
1027
+ keys: ["screen"]
1028
+ });
1029
+ Te(() => {
1030
+ var I;
1031
+ n(((I = d.current) == null ? void 0 : I.getBoundingClientRect().height) || 0);
1032
+ }, [n]);
1033
+ const {
1034
+ loading: b,
1035
+ throttled: $
1036
+ } = Ye(h);
1037
+ return c && p && a && s.current ? /* @__PURE__ */ i(Ne, {
1038
+ container: s,
1039
+ useContainer: !r,
1040
+ children: /* @__PURE__ */ i(Yn, {
1041
+ throttled: $,
1042
+ notification: t,
1043
+ setOpened: m,
1044
+ gamification: p,
1045
+ onboardingOpts: a,
1046
+ deepLink: p.deepLink,
1047
+ loading: b,
1048
+ renderToNode: s,
1049
+ sdk: e
1050
+ })
1051
+ }) : /* @__PURE__ */ f(T, {
1052
+ children: [/* @__PURE__ */ i(Ie, {
1053
+ ref: d,
1054
+ style: {
1055
+ position: "absolute",
1056
+ visibility: "hidden"
1057
+ },
1058
+ children: /* @__PURE__ */ i(ge, {
1059
+ close: () => {
1060
+ },
1061
+ action: () => {
1062
+ },
1063
+ onboarding: a
1064
+ })
1065
+ }), /* @__PURE__ */ i(Hn, {
1066
+ style: o,
1067
+ hiding: t.hiding,
1068
+ children: /* @__PURE__ */ i(Ie, {
1069
+ children: /* @__PURE__ */ i(ge, {
1070
+ close: t.close,
1071
+ action: () => {
1072
+ var I;
1073
+ m(!0), (((I = s.current) == null ? void 0 : I.getBoundingClientRect().y) || 0) < 0 && H(s, g.size, {
1074
+ behavior: "smooth"
1075
+ });
1076
+ },
1077
+ onboarding: a
1078
+ })
1079
+ })
1080
+ })]
1081
+ });
1082
+ }, Xn = () => W, es = /* @__PURE__ */ u(Xn())({
1083
+ name: "Container",
1084
+ class: "c8ol1ve",
1085
+ propsAsIs: !0
1086
+ }), Ae = /* @__PURE__ */ u("div")({
1087
+ name: "InnerContainer",
1088
+ class: "iqfywam",
1089
+ propsAsIs: !1
1090
+ }), ts = () => Ae, ns = /* @__PURE__ */ u(ts())({
1091
+ name: "HiddenContainer",
1092
+ class: "hokmtod",
1093
+ propsAsIs: !0
1094
+ }), ss = /* @__PURE__ */ u("div")({
1095
+ name: "NotificationRefreshing",
1096
+ class: "n192d1q8",
1097
+ propsAsIs: !1
1098
+ }), os = () => Xe, is = /* @__PURE__ */ u(os())({
1099
+ name: "Pill",
1100
+ class: "p1lha68t",
1101
+ propsAsIs: !0
1102
+ }), as = (e) => {
1103
+ const [t, n] = S(0), o = L(null), s = C(() => new ResizeObserver((d) => {
1104
+ window.requestAnimationFrame(() => {
1105
+ var a;
1106
+ if (Array.isArray(d)) {
1107
+ for (const c of d)
1108
+ if (c.contentBoxSize) {
1109
+ const m = (a = o.current) == null ? void 0 : a.getBoundingClientRect();
1110
+ m && n(m.height);
1111
+ }
1112
+ }
1113
+ });
1114
+ }), []), r = j((d) => {
1115
+ o.current = d;
1116
+ }, []), l = j((d) => {
1117
+ n(d);
1118
+ }, []);
1119
+ return y(() => {
1120
+ const d = o.current;
1121
+ return d ? (s.observe(d), () => {
1122
+ s.unobserve(d);
1123
+ }) : () => {
1124
+ };
1125
+ }, [e]), y(() => () => {
1126
+ s.disconnect();
1127
+ }), [r, t, l];
1128
+ }, rs = ({
1129
+ sdk: e,
1130
+ notification: t,
1131
+ appNode: n,
1132
+ responsiveStore: o,
1133
+ hasActiveFeature: s
1134
+ }) => {
1135
+ var r, l;
1136
+ const {
1137
+ sdkInDesktopView: d
1138
+ } = v(o, {
1139
+ keys: ["sdkInDesktopView"]
1140
+ }), {
1141
+ sdk: a
1142
+ } = G(), [c, m, p] = as(t.id);
1143
+ let h = m;
1144
+ return s || (h = "auto"), t.type === P.QUESTION ? /* @__PURE__ */ f(T, {
1145
+ children: [/* @__PURE__ */ i(ns, {
1146
+ ref: c,
1147
+ children: /* @__PURE__ */ i(te, {
1148
+ ...t
1149
+ })
1150
+ }), /* @__PURE__ */ f(es, {
1151
+ style: {
1152
+ height: t.hiding ? 0 : h
1153
+ },
1154
+ hiding: t.hiding,
1155
+ children: [/* @__PURE__ */ i(Ae, {
1156
+ style: {
1157
+ height: "100%"
1158
+ },
1159
+ children: /* @__PURE__ */ i(te, {
1160
+ ...t,
1161
+ controlVideo: a == null ? void 0 : a.controlVideoPlayer
1162
+ })
1163
+ }), /* @__PURE__ */ i(ss, {}, t.id)]
1164
+ })]
1165
+ }) : t.type === P.QUESTION_RESOLVED && (l = (r = t.data) == null ? void 0 : r.question) != null && l.predictionResult ? /* @__PURE__ */ i(et, {
1166
+ style: {
1167
+ height: t.hiding ? 0 : m
1168
+ },
1169
+ saveHeight: p,
1170
+ close: t.close,
1171
+ hiding: t.hiding,
1172
+ ...t.data.question
1173
+ }) : t.type === P.ONBOARDING ? /* @__PURE__ */ i(Zn, {
1174
+ style: {
1175
+ height: t.hiding ? 0 : h
1176
+ },
1177
+ saveHeight: p,
1178
+ sdk: e,
1179
+ notification: t,
1180
+ sdkInDesktopView: d,
1181
+ appNode: n,
1182
+ responsiveStore: o
1183
+ }) : null;
1184
+ }, ls = "p7vfi6t", ds = ({
1185
+ pill: e,
1186
+ setPill: t,
1187
+ appNode: n,
1188
+ headerNode: o,
1189
+ scrollNode: s,
1190
+ responsiveStore: r,
1191
+ scrollStore: l
1192
+ }) => {
1193
+ var d, a;
1194
+ const {
1195
+ screen: c
1196
+ } = v(r, {
1197
+ keys: ["screen"]
1198
+ }), {
1199
+ tabsShown: m,
1200
+ scrollPosition: p
1201
+ } = v(l, {
1202
+ keys: ["tabsShown", "scrollPosition"]
1203
+ });
1204
+ y(() => {
1205
+ r.get().sdkInDesktopView ? p < 50 && t(null) : p > -50 && t(null);
1206
+ }, [p, r, t]);
1207
+ const h = r.get().sdkInDesktopView ? n : o;
1208
+ return !e || !h.current ? null : ht(/* @__PURE__ */ i(is, {
1209
+ title: e.type === P.QUESTION_RESOLVED ? "Prediction result" : `New ${((a = mt[(d = e.data) == null ? void 0 : d.questionType]) == null ? void 0 : a.label) || "notification"}`,
1210
+ "data-a": "intr",
1211
+ onClick: () => {
1212
+ var g;
1213
+ r.get().sdkInDesktopView ? (g = s.current) == null || g.scrollTo({
1214
+ top: 0,
1215
+ behavior: "smooth"
1216
+ }) : H(n, c.size, {
1217
+ behavior: "smooth"
1218
+ }), t(null);
1219
+ },
1220
+ className: E(m && ls, "sl-pill-button")
1221
+ }), h.current);
1222
+ }, cs = ({
1223
+ sdk: e,
1224
+ headerNode: t,
1225
+ scrollNode: n,
1226
+ responsiveStore: o,
1227
+ appNode: s,
1228
+ scrollStore: r,
1229
+ hasActiveFeature: l
1230
+ }) => {
1231
+ const [d] = S(e.getNotificationsStore()), a = v(d), [c, m] = S(null), p = C(() => e.getActiveNotification(), [e, a]);
1232
+ return y(() => {
1233
+ p && at.emit("notification", {
1234
+ action: "rendered",
1235
+ payload: {
1236
+ questionId: p.data.questionId,
1237
+ questionType: p.data.questionType
1238
+ }
1239
+ });
1240
+ }, [p]), y(() => {
1241
+ const {
1242
+ sdkInDesktopView: h,
1243
+ sdkInView: g
1244
+ } = o.get();
1245
+ p && (h || g) && (!h && g && m(p), h && window.requestAnimationFrame(() => {
1246
+ r.get().scrollPosition !== 0 && m(p);
1247
+ }));
1248
+ }, [p]), y(() => {
1249
+ p || m(null);
1250
+ }, [p]), /* @__PURE__ */ f(T, {
1251
+ children: [!c && p && /* @__PURE__ */ i(rs, {
1252
+ appNode: s,
1253
+ sdk: e,
1254
+ hasActiveFeature: l,
1255
+ notification: p,
1256
+ responsiveStore: o
1257
+ }), c && /* @__PURE__ */ i(ds, {
1258
+ pill: c,
1259
+ setPill: m,
1260
+ appNode: s,
1261
+ notification: p,
1262
+ headerNode: t,
1263
+ scrollNode: n,
1264
+ scrollStore: r,
1265
+ responsiveStore: o
1266
+ })]
1267
+ });
1268
+ }, ps = (e) => {
1269
+ const t = v(e.status), n = v(e.sdkStore.slStreamId), o = v(e.userId()), s = v(e.getActiveFeature()), r = t === "ready" && !!n.data;
1270
+ return y(() => {
1271
+ const l = e.getFeature(N.GAMES);
1272
+ l && s !== N.GAMES && (l.closeQuestion(), l.closeUser()), l == null || l.openedQuestionId.subscribe((d) => {
1273
+ d && s !== N.GAMES && e.openFeature(N.GAMES);
1274
+ });
1275
+ }, [s, e]), {
1276
+ sdkReady: r,
1277
+ activeFeature: s,
1278
+ isLogged: !!o
1279
+ };
1280
+ }, us = ({
1281
+ sdk: e,
1282
+ className: t,
1283
+ scrollStore: n,
1284
+ appNode: o,
1285
+ scrollNode: s,
1286
+ responsiveStore: r
1287
+ }) => {
1288
+ const [, l] = tt(e);
1289
+ return /* @__PURE__ */ i(cn, {
1290
+ className: t,
1291
+ scrollNode: s,
1292
+ appNode: o,
1293
+ scrollStore: n,
1294
+ feature: l,
1295
+ responsiveStore: r,
1296
+ sdk: e
1297
+ });
1298
+ }, ms = ({
1299
+ sdk: e,
1300
+ muted: t,
1301
+ className: n,
1302
+ appNode: o,
1303
+ responsiveStore: s
1304
+ }) => {
1305
+ const r = v(e.featuresList.getStore());
1306
+ return r ? Array.from(r, (l) => {
1307
+ const d = e.getFeature(l);
1308
+ return d ? /* @__PURE__ */ i(pn, {
1309
+ className: n,
1310
+ muted: t,
1311
+ appNode: o,
1312
+ feature: d,
1313
+ responsiveStore: s,
1314
+ sdk: e
1315
+ }, l) : null;
1316
+ }) : null;
1317
+ }, hs = ({
1318
+ sdk: e,
1319
+ muted: t,
1320
+ topNavigation: n
1321
+ }) => {
1322
+ const [o, s] = S(!0), r = L(null), l = v(e.uiState), d = L(null), [a] = vt(r), [c, m] = gt(r, a), {
1323
+ sdkReady: p,
1324
+ activeFeature: h,
1325
+ isLogged: g
1326
+ } = ps(e), b = !!p;
1327
+ st(r, {
1328
+ enabled: b,
1329
+ event: "click",
1330
+ listener: ot
1331
+ });
1332
+ const $ = C(() => ({
1333
+ sdk: e,
1334
+ topNavigation: n
1335
+ }), [e, n]);
1336
+ return y(() => {
1337
+ import("./gamification-feature.js");
1338
+ }, []), /* @__PURE__ */ i(lt.Provider, {
1339
+ value: $,
1340
+ children: /* @__PURE__ */ f(Qe, {
1341
+ ref: (I) => {
1342
+ r.current = I, s(!!I);
1343
+ },
1344
+ className: n ? "" : "c10llmat",
1345
+ children: [b && n && l.app && /* @__PURE__ */ i(Mn, {
1346
+ className: E(F, "sl-hide-on-modal"),
1347
+ sdk: e,
1348
+ ref: d
1349
+ }), b && !n && !!h && l.app && /* @__PURE__ */ i(_n, {
1350
+ className: E(F, "sl-hide-on-modal"),
1351
+ sdk: e,
1352
+ ref: d
1353
+ }), /* @__PURE__ */ f(We, {
1354
+ className: "sl-hide-on-modal",
1355
+ ref: c,
1356
+ "data-nav": (!!h && b).toString(),
1357
+ children: [b && l.app && /* @__PURE__ */ i(cs, {
1358
+ sdk: e,
1359
+ scrollNode: c,
1360
+ headerNode: d,
1361
+ appNode: r,
1362
+ scrollStore: m,
1363
+ responsiveStore: a,
1364
+ hasActiveFeature: !!h
1365
+ }), b && l.app && /* @__PURE__ */ i(us, {
1366
+ scrollStore: m,
1367
+ responsiveStore: a,
1368
+ scrollNode: c,
1369
+ appNode: r,
1370
+ className: F,
1371
+ sdk: e
1372
+ }), b && o && /* @__PURE__ */ i(ms, {
1373
+ muted: t,
1374
+ responsiveStore: a,
1375
+ appNode: r,
1376
+ className: F,
1377
+ sdk: e
1378
+ })]
1379
+ }), b && !g && o && l.app && /* @__PURE__ */ i("div", {
1380
+ style: {
1381
+ display: "flex",
1382
+ alignItems: "center",
1383
+ justifyContent: "center",
1384
+ width: "100%",
1385
+ height: "100%"
1386
+ },
1387
+ children: "You are not logged in."
1388
+ })]
1389
+ })
1390
+ });
1391
+ }, Ps = ({ event: e, topNavigation: t, theme: n, muted: o, withSidebarNotification: s = !0 }) => {
1392
+ const { sdk: r, status: l } = Y(Z), d = De(), a = Oe(), { event: c } = Y(Z);
1393
+ if (l === X.UNSET)
1394
+ throw new Error("Wrap app in `StreamLayerProvider`");
1395
+ return l === X.CONNECTED ? /* @__PURE__ */ i("div", { className: "StreamLayerSDK", children: "wait" }) : r === null ? /* @__PURE__ */ i("div", { className: "StreamLayerSDK", children: "sdk not initialized" }) : !d.app && !d.appNotification && !d.appSidebar || !d.app && !d.appSidebar && d.appNotification && !s ? null : /* @__PURE__ */ i("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ i(Me, { customTheme: n ?? a.theme, themeMode: a.themeMode, children: /* @__PURE__ */ i(hs, { sdk: r, muted: o, event: (c == null ? void 0 : c.current) || e, topNavigation: t }) }) });
1396
+ };
3411
1397
  export {
3412
- Gr as Q,
3413
- Vr as n
1398
+ zs as B,
1399
+ Ps as b
3414
1400
  };