@streamlayer/web-os 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +0,0 @@
1
- import { G as f } from "./index2.js";
2
- export {
3
- f as default
4
- };
@@ -1,684 +0,0 @@
1
- import { jsxs as i, jsx as e, Fragment as C } from "react/jsx-runtime";
2
- import { t as j, e as K, f as H, a as D, b as q, s as n, A as Y, i as I, I as f, c as L, R as P, d as O, Q as _, k as h, D as ss, g as x, h as es, u as b, r as B, S as ns, $ as as, j as ls, l as ts, m as is, p as os, n as rs, o as cs } from "./index2.js";
3
- import { useRef as G, useState as Z, useCallback as J, useEffect as g } from "react";
4
- const ds = /* @__PURE__ */ H("CjZzdHJlYW1sYXllci9hbmFseXRpY3MvdjEvaW52aXRhdGlvbnMvaW52aXRhdGlvbnMucHJvdG8SJHN0cmVhbWxheWVyLmFuYWx5dGljcy52MS5pbnZpdGF0aW9ucyLhAgoXVG90YWxJbnZpdGF0aW9uc1JlcXVlc3QSYAoGZmlsdGVyGAEgASgLMlAuc3RyZWFtbGF5ZXIuYW5hbHl0aWNzLnYxLmludml0YXRpb25zLlRvdGFsSW52aXRhdGlvbnNSZXF1ZXN0LlRvdGFsUmVxdWVzdEZpbHRlchrjAQoSVG90YWxSZXF1ZXN0RmlsdGVyEjcKBnBlcmlvZBgBIAEoCzInLnN0cmVhbWxheWVyLmFuYWx5dGljcy52MS5jb21tb24uUGVyaW9kEhEKCWV2ZW50X2lkcxgCIAMoBBJMCgpjYXRlZ29yaWVzGAMgAygOMjguc3RyZWFtbGF5ZXIuYW5hbHl0aWNzLnYxLmludml0YXRpb25zLkludml0YXRpb25DYXRlZ29yeRIzCgRraW5kGAQgASgOMiUuc3RyZWFtbGF5ZXIuYW5hbHl0aWNzLnYxLmNvbW1vbi5LaW5kIrABChhUb3RhbEludml0YXRpb25zUmVzcG9uc2USXgoEZGF0YRgBIAMoCzJQLnN0cmVhbWxheWVy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GlvbkZyb20SGQoVSU5WSVRBVElPTl9GUk9NX1VOU0VUEAASHgoaSU5WSVRBVElPTl9GUk9NX1RJVExFX0NBUkQQARIYChRJTlZJVEFUSU9OX0ZST01fTUVOVRACQrYBCihjb20uc3RyZWFtbGF5ZXIuYW5hbHl0aWNzLmludml0YXRpb25zLnYxQhtTdHJlYW1MYXllckludml0YXRpb25zUHJvdG9QAVpiZ2l0aHViLmNvbS9zdHJlYW1sYXllci9zbC1wcm90b2ZpbGVzLy5idWlsZC9nby9zdHJlYW1sYXllci9hbmFseXRpY3MvdjEvaW52aXRhdGlvbnM7c2xfaW52aXRhdGlvbnOiAgZTTF9BUEliBnByb3RvMw", [D, q]), ps = /* @__PURE__ */ K(ds, 1), Q = /* @__PURE__ */ j(ps), S = /* @__PURE__ */ n("div")({
5
- name: "SDKContentContainer",
6
- class: "s1meqjjv",
7
- propsAsIs: !1
8
- }), ms = () => S, M = /* @__PURE__ */ n(ms())({
9
- name: "SDKWhiteContainer",
10
- class: "s1burm22",
11
- propsAsIs: !0
12
- }), us = () => M, bs = /* @__PURE__ */ n(us())({
13
- name: "SDKSummaryContainer",
14
- class: "sm5r3j5",
15
- propsAsIs: !0
16
- }), hs = /* @__PURE__ */ n("div")({
17
- name: "TabsContainer",
18
- class: "tysxwr6",
19
- propsAsIs: !1
20
- }), As = () => S, vs = /* @__PURE__ */ n(As())({
21
- name: "LeaderboardContainer",
22
- class: "l9er3b1",
23
- propsAsIs: !0
24
- }), Is = () => M, Ws = /* @__PURE__ */ n(Is())({
25
- name: "TabsNavContainer",
26
- class: "t19dtrb3",
27
- propsAsIs: !0
28
- }), gs = /* @__PURE__ */ n("div")({
29
- name: "UserSummaryContainer",
30
- class: "u1552n3j",
31
- propsAsIs: !1
32
- }), Rs = (s, a, l) => {
33
- const r = a >= Y.lg && a < Y.xl ? 75 : 52;
34
- s.current && window.scrollTo({
35
- top: s.current.offsetTop - r,
36
- ...l
37
- });
38
- }, Vs = /* @__PURE__ */ n("div")({
39
- name: "Container",
40
- class: "c1zy8a",
41
- propsAsIs: !1
42
- }), Cs = /* @__PURE__ */ n("div")({
43
- name: "Title",
44
- class: "t1vih9p5",
45
- propsAsIs: !1
46
- }), Gs = /* @__PURE__ */ n("div")({
47
- name: "Indicator",
48
- class: "i1fbnvpb",
49
- propsAsIs: !1
50
- }), E = ({ indicator: s, title: a }) => /* @__PURE__ */ i(Vs, { children: [
51
- /* @__PURE__ */ e(Cs, { children: a }),
52
- /* @__PURE__ */ e(Gs, { children: s })
53
- ] }), Zs = /* @__PURE__ */ n("div")({
54
- name: "Container",
55
- class: "ctmhwyc",
56
- propsAsIs: !1
57
- }), Ss = /* @__PURE__ */ n("div")({
58
- name: "Indicator",
59
- class: "i1jri200",
60
- propsAsIs: !1
61
- }), ys = /* @__PURE__ */ n("div")({
62
- name: "Title",
63
- class: "t8s05oq",
64
- propsAsIs: !1
65
- }), W = ({ indicator: s, title: a }) => /* @__PURE__ */ i(Zs, { children: [
66
- /* @__PURE__ */ e(Ss, { children: s }),
67
- /* @__PURE__ */ e(ys, { children: a })
68
- ] }), Xs = /* @__PURE__ */ n("div")({
69
- name: "Container",
70
- class: "c1yrpn9o",
71
- propsAsIs: !1
72
- }), Ys = /* @__PURE__ */ n("div")({
73
- name: "TopInfo",
74
- class: "t17fwahh",
75
- propsAsIs: !1
76
- }), Es = /* @__PURE__ */ n("div")({
77
- name: "BottomInfo",
78
- class: "by6w7e9",
79
- propsAsIs: !1
80
- }), Ns = /* @__PURE__ */ n("div")({
81
- name: "User",
82
- class: "u1g7arbm",
83
- propsAsIs: !1
84
- }), $s = /* @__PURE__ */ n("img")({
85
- name: "Avatar",
86
- class: "a1ldeata",
87
- propsAsIs: !1
88
- }), ks = /* @__PURE__ */ n("div")({
89
- name: "UserInfo",
90
- class: "u10d4koz",
91
- propsAsIs: !1
92
- }), Fs = /* @__PURE__ */ n("div")({
93
- name: "UserName",
94
- class: "u1q6roj0",
95
- propsAsIs: !1
96
- }), Us = /* @__PURE__ */ n("div")({
97
- name: "UserRating",
98
- class: "ui0m425",
99
- propsAsIs: !1
100
- }), fs = /* @__PURE__ */ n("img")({
101
- name: "TrophyIcon",
102
- class: "t1el3mrn",
103
- propsAsIs: !1
104
- }), Ls = /* @__PURE__ */ n("div")({
105
- name: "RtsContainer",
106
- class: "r2vgnxv",
107
- propsAsIs: !1
108
- }), xs = /* @__PURE__ */ n("div")({
109
- name: "RtsDivider",
110
- class: "roqn06j",
111
- propsAsIs: !1
112
- }), Bs = /* @__PURE__ */ n("div")({
113
- name: "Rts",
114
- class: "r15adx7c",
115
- propsAsIs: !1
116
- }), N = /* @__PURE__ */ n("div")({
117
- name: "RtsIndicator",
118
- class: "rv59lta",
119
- propsAsIs: !1
120
- }), $ = /* @__PURE__ */ n("div")({
121
- name: "RtsLabel",
122
- class: "r55lotb",
123
- propsAsIs: !1
124
- }), Js = /* @__PURE__ */ n("div")({
125
- name: "Divider",
126
- class: "d1knfgqt",
127
- propsAsIs: !1
128
- }), Qs = /* @__PURE__ */ n("div")({
129
- name: "Ranks",
130
- class: "r1mqo824",
131
- propsAsIs: !1
132
- }), Ms = /* @__PURE__ */ n("div")({
133
- name: "Statistics",
134
- class: "sxareh6",
135
- propsAsIs: !1
136
- }), zs = /* @__PURE__ */ n("div")({
137
- name: "AvatarPlaceholder",
138
- class: "amcu48h",
139
- propsAsIs: !1
140
- }), ws = /* @__PURE__ */ n("button")({
141
- name: "UserAccountBtn",
142
- class: "u32nfkp",
143
- propsAsIs: !1
144
- }), Ts = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Trophy'%3e%3cpath%20id='Combined%20Shape'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.69197%204.66662C3.69197%205.99705%203.92914%207.17787%204.4035%208.20912C3.49966%208.02451%202.74487%207.66486%202.1391%207.13014C1.53333%206.59542%201.23046%206.0798%201.23046%205.58328V4.66662H3.69197ZM14.7686%204.66662V5.58328C14.7686%206.0798%2014.4658%206.59542%2013.86%207.13014C13.2542%207.66486%2012.4994%208.02451%2011.5956%208.20912C12.0699%207.17787%2012.3071%205.99705%2012.3071%204.66662H14.7686ZM15.9998%205.58329V4.36108C15.9998%204.10645%2015.9101%203.89002%2015.7306%203.71178C15.5511%203.53354%2015.3332%203.44442%2015.0768%203.44442H12.3076V2.52776C12.3076%202.10763%2012.1569%201.74797%2011.8556%201.44878C11.5544%201.14959%2011.1922%201%2010.7691%201H5.23072C4.80764%201%204.44547%201.14959%204.14419%201.44878C3.84291%201.74797%203.69227%202.10763%203.69227%202.52776V3.44442H0.923068C0.666659%203.44442%200.448714%203.53354%200.269228%203.71178C0.0897418%203.89002%200%204.10645%200%204.36108V5.58329C0%206.03525%200.13301%206.49039%200.399034%206.94872C0.665059%207.40705%201.02403%207.82082%201.47595%208.19003C1.92787%208.55924%202.48234%208.86957%203.13939%209.12101C3.79644%209.37246%204.48713%209.51409%205.21149%209.54592C5.48071%209.88967%205.7852%2010.192%206.12494%2010.453C6.36853%2010.6695%206.53679%2010.9002%206.62974%2011.1453C6.72269%2011.3904%206.76916%2011.6752%206.76916%2011.9999C6.76916%2012.3436%206.67141%2012.6333%206.4759%2012.8688C6.28038%2013.1043%205.96789%2013.2221%205.53841%2013.2221C5.05764%2013.2221%204.62976%2013.3669%204.25476%2013.6566C3.87977%2013.9462%203.69227%2014.3106%203.69227%2014.7499V15.361C3.69227%2015.4501%203.72112%2015.5233%203.77881%2015.5806C3.8365%2015.6379%203.91022%2015.6665%203.99996%2015.6665H11.9999C12.0896%2015.6665%2012.1633%2015.6379%2012.221%2015.5806C12.2787%2015.5233%2012.3076%2015.4501%2012.3076%2015.361V14.7499C12.3076%2014.3106%2012.1201%2013.9462%2011.7451%2013.6566C11.3701%2013.3669%2010.9422%2013.2221%2010.4614%2013.2221C10.0319%2013.2221%209.71945%2013.1043%209.52394%2012.8688C9.32843%2012.6333%209.23068%2012.3436%209.23068%2011.9999C9.23068%2011.6752%209.27715%2011.3904%209.3701%2011.1453C9.46305%2010.9002%209.63131%2010.6695%209.8749%2010.453C10.2146%2010.192%2010.5191%209.88967%2010.7884%209.54592C11.5127%209.51409%2012.2034%209.37246%2012.8604%209.12101C13.5175%208.86957%2014.072%208.55924%2014.5239%208.19003C14.9758%207.82082%2015.3348%207.40705%2015.6008%206.94872C15.8668%206.49039%2015.9998%206.03525%2015.9998%205.58329ZM6.76047%207.1798L8.05109%206.49997L9.3417%207.1798L9.09521%205.73989L10.1393%204.72015L8.69639%204.51007L8.05109%203.2L7.40578%204.51007L5.96283%204.72015L7.00696%205.73989L6.76047%207.1798Z'%20fill='%23F2C94C'/%3e%3c/g%3e%3c/svg%3e", js = ({
145
- loading: s,
146
- hideFriendsRank: a,
147
- avatar: l,
148
- name: r,
149
- points: t,
150
- friendsRank: o,
151
- rank: d,
152
- streak: p,
153
- correct: c,
154
- incorrect: m,
155
- inTop: u,
156
- successRate: R
157
- }) => /* @__PURE__ */ i(Xs, { "data-loading": s, children: [
158
- /* @__PURE__ */ e(Ys, { children: /* @__PURE__ */ e(I, { loading: s, children: /* @__PURE__ */ i(Ns, { children: [
159
- /* @__PURE__ */ i(ws, { children: [
160
- l && /* @__PURE__ */ e($s, { alt: "avatar", src: l }),
161
- !l && /* @__PURE__ */ e(zs, { children: f(r || "") })
162
- ] }),
163
- /* @__PURE__ */ i(ks, { children: [
164
- /* @__PURE__ */ e(Fs, { children: r }),
165
- /* @__PURE__ */ i(Us, { children: [
166
- /* @__PURE__ */ i(Ls, { children: [
167
- /* @__PURE__ */ i(Bs, { children: [
168
- /* @__PURE__ */ e(fs, { alt: "rank-icon", src: Ts }),
169
- /* @__PURE__ */ i(N, { children: [
170
- L(t),
171
- /* @__PURE__ */ e($, { children: "PTS" })
172
- ] })
173
- ] }),
174
- a && /* @__PURE__ */ i(N, { children: [
175
- /* @__PURE__ */ e(xs, {}),
176
- d || 0,
177
- /* @__PURE__ */ e($, { children: "global rank" })
178
- ] })
179
- ] }),
180
- !a && /* @__PURE__ */ i(C, { children: [
181
- /* @__PURE__ */ e(Js, {}),
182
- /* @__PURE__ */ i("div", { children: [
183
- "TOP ",
184
- u || 0,
185
- "%"
186
- ] })
187
- ] })
188
- ] })
189
- ] })
190
- ] }) }) }),
191
- /* @__PURE__ */ i(Es, { children: [
192
- !a && /* @__PURE__ */ i(Qs, { children: [
193
- /* @__PURE__ */ e(I, { loading: s, style: { width: "100%" }, children: /* @__PURE__ */ e(E, { indicator: o || 0, title: "Friends rank" }) }),
194
- /* @__PURE__ */ e(I, { loading: s, style: { width: "100%" }, children: /* @__PURE__ */ e(E, { indicator: d || 0, title: "Global rank" }) })
195
- ] }),
196
- /* @__PURE__ */ e(I, { loading: s, children: /* @__PURE__ */ i(Ms, { children: [
197
- /* @__PURE__ */ e(W, { indicator: p || 0, title: "Win streak" }),
198
- /* @__PURE__ */ e(W, { indicator: c || 0, title: "Correct" }),
199
- /* @__PURE__ */ e(W, { indicator: m || 0, title: "Incorrect" }),
200
- /* @__PURE__ */ e(W, { indicator: `${R || 0}%`, title: "Succ. rate" })
201
- ] }) })
202
- ] })
203
- ] }), Ks = /* @__PURE__ */ n("div")({
204
- name: "Container",
205
- class: "cgn5uen",
206
- propsAsIs: !1
207
- }), k = "c1px8nt6", Hs = /* @__PURE__ */ n("div")({
208
- name: "Content",
209
- class: "c5et2jt",
210
- propsAsIs: !1
211
- }), Ds = /* @__PURE__ */ n("h3")({
212
- name: "Title",
213
- class: "t1i2kpk2",
214
- propsAsIs: !1
215
- }), qs = /* @__PURE__ */ n("div")({
216
- name: "Description",
217
- class: "dd3lh3p",
218
- propsAsIs: !1
219
- }), Ps = /* @__PURE__ */ n("img")({
220
- name: "Image",
221
- class: "i1gfjeu5",
222
- propsAsIs: !1
223
- }), Os = /* @__PURE__ */ n("div")({
224
- name: "ImageContainer",
225
- class: "i58y999",
226
- propsAsIs: !1
227
- }), _s = ({
228
- instantView: s,
229
- isDetail: a,
230
- notification: l,
231
- controlVideo: r
232
- }) => {
233
- const t = s == null ? void 0 : s.heading, o = s == null ? void 0 : s.body, d = t || o, p = l == null ? void 0 : l.title, c = l == null ? void 0 : l.body;
234
- return /* @__PURE__ */ i(Ks, { children: [
235
- (s == null ? void 0 : s.video) && /* @__PURE__ */ e(
236
- P,
237
- {
238
- className: k,
239
- source: s.video.url,
240
- poster: s.video.thumbnailUrl,
241
- controlVideo: r,
242
- autoPlay: a && s.autoPlayVideo === O.ENABLED
243
- }
244
- ),
245
- (s == null ? void 0 : s.image) && !(s != null && s.video) && /* @__PURE__ */ e(
246
- Os,
247
- {
248
- className: k,
249
- "data-rounded": s.imageMode === _.ROUNDED,
250
- children: /* @__PURE__ */ e(Ps, { src: s == null ? void 0 : s.image })
251
- }
252
- ),
253
- /* @__PURE__ */ i(Hs, { children: [
254
- /* @__PURE__ */ e(Ds, { children: a && d ? t : p }),
255
- /* @__PURE__ */ e(qs, { children: a && d ? o : c })
256
- ] })
257
- ] });
258
- }, se = /* @__PURE__ */ n("div")({
259
- name: "Container",
260
- class: "c115qtkr",
261
- propsAsIs: !1
262
- }), ee = /* @__PURE__ */ n("div")({
263
- name: "STabs",
264
- class: "sxnslc8",
265
- propsAsIs: !1
266
- }), ne = /* @__PURE__ */ n("button")({
267
- name: "Button",
268
- class: "b1umzux0",
269
- propsAsIs: !1
270
- }), ae = /* @__PURE__ */ n("span")({
271
- name: "Title",
272
- class: "tspsaas",
273
- propsAsIs: !1
274
- });
275
- var v = /* @__PURE__ */ ((s) => (s.HOME = "home", s.LEADERBOARD = "leaderboard", s))(v || {});
276
- const F = ({ title: s, active: a, onClick: l }) => /* @__PURE__ */ e(ne, { "data-a": "intr", onClick: l, "data-selected": a, children: /* @__PURE__ */ e(ae, { "data-a": "intr", children: s }) }), le = ({ activePage: s = "home", toggleActivePage: a }) => /* @__PURE__ */ e(se, { children: /* @__PURE__ */ i(ee, { "data-position": s === "home" ? "left" : "right", children: [
277
- /* @__PURE__ */ e(F, { title: "Home", active: s === "home", onClick: () => a(
278
- "home"
279
- /* HOME */
280
- ) }),
281
- /* @__PURE__ */ e(
282
- F,
283
- {
284
- title: "Friends",
285
- active: s === "leaderboard",
286
- onClick: () => a(
287
- "leaderboard"
288
- /* LEADERBOARD */
289
- )
290
- }
291
- )
292
- ] }) }), te = /* @__PURE__ */ n("button")({
293
- name: "Container",
294
- class: "cpjnajb",
295
- propsAsIs: !1
296
- }), ie = /* @__PURE__ */ n("div")({
297
- name: "Content",
298
- class: "c4m6kaz",
299
- propsAsIs: !1
300
- }), oe = /* @__PURE__ */ n("span")({
301
- name: "Title",
302
- class: "t1h8t9cc",
303
- propsAsIs: !1
304
- }), re = () => /* @__PURE__ */ e(te, { children: /* @__PURE__ */ i(ie, { children: [
305
- /* @__PURE__ */ e(h, { name: "iconCopySuccess" }),
306
- /* @__PURE__ */ e(oe, { children: "Link Copied to Clipboard" })
307
- ] }) }), z = (s) => {
308
- const a = G(), [l, r] = Z(null), t = J(
309
- async (o) => {
310
- var d;
311
- if (o && (d = navigator == null ? void 0 : navigator.clipboard) != null && d.writeText) {
312
- a.current && (clearTimeout(a.current), r(null));
313
- try {
314
- await navigator.clipboard.writeText(o), s.current && (r(ss.createPortal(/* @__PURE__ */ e(re, {}), s.current)), a.current = setTimeout(() => {
315
- r(null);
316
- }, 1e3));
317
- } catch (p) {
318
- console.error("Unable to copy to clipboard", p);
319
- }
320
- }
321
- },
322
- [s]
323
- );
324
- return g(() => () => {
325
- clearTimeout(a.current);
326
- }, []), [t, l];
327
- }, ce = /* @__PURE__ */ n("div")({
328
- name: "Container",
329
- class: "c1ux29ft",
330
- propsAsIs: !1
331
- }), de = () => h, pe = /* @__PURE__ */ n(de())({
332
- name: "FriendsIcon",
333
- class: "f10ncfg2",
334
- propsAsIs: !0
335
- }), me = /* @__PURE__ */ n("div")({
336
- name: "Content",
337
- class: "c1yc07bd",
338
- propsAsIs: !1
339
- }), ue = /* @__PURE__ */ n("div")({
340
- name: "Title",
341
- class: "tj6cq7w",
342
- propsAsIs: !1
343
- }), be = /* @__PURE__ */ n("div")({
344
- name: "Description",
345
- class: "d1ag78xo",
346
- propsAsIs: !1
347
- }), he = () => h, Ae = /* @__PURE__ */ n(he())({
348
- name: "ArrowInviteIcon",
349
- class: "awohrz6",
350
- propsAsIs: !0
351
- }), ve = ({ title: s, description: a, onClick: l, className: r }) => {
352
- const [t] = x({
353
- type: "invitation",
354
- action: "sent",
355
- payload: {
356
- from: Q.TITLE_CARD
357
- }
358
- });
359
- return /* @__PURE__ */ i(ce, { "data-a": "intr", onClick: t(l), className: r, children: [
360
- /* @__PURE__ */ e(pe, { name: "icon-friends" }),
361
- /* @__PURE__ */ i(me, { children: [
362
- /* @__PURE__ */ e(ue, { children: s }),
363
- /* @__PURE__ */ e(be, { children: a })
364
- ] }),
365
- /* @__PURE__ */ e(Ae, { name: "icon-copy" })
366
- ] });
367
- }, Ie = /* @__PURE__ */ n("div")({
368
- name: "Container",
369
- class: "culdu4a",
370
- propsAsIs: !1
371
- }), We = /* @__PURE__ */ n("div")({
372
- name: "Position",
373
- class: "pwf8e69",
374
- propsAsIs: !1
375
- }), ge = /* @__PURE__ */ n("img")({
376
- name: "Avatar",
377
- class: "atf4yh4",
378
- propsAsIs: !1
379
- }), Re = /* @__PURE__ */ n("div")({
380
- name: "AvatarPlaceholder",
381
- class: "a1dg29ja",
382
- propsAsIs: !1
383
- }), Ve = /* @__PURE__ */ n("div")({
384
- name: "Content",
385
- class: "c10a68rc",
386
- propsAsIs: !1
387
- }), Ce = /* @__PURE__ */ n("div")({
388
- name: "NameContainer",
389
- class: "nc4kck5",
390
- propsAsIs: !1
391
- }), Ge = /* @__PURE__ */ n("span")({
392
- name: "Name",
393
- class: "njsrqgr",
394
- propsAsIs: !1
395
- }), Ze = () => h, Se = /* @__PURE__ */ n(Ze())({
396
- name: "CurrentUserBadge",
397
- class: "c17uc4zr",
398
- propsAsIs: !0
399
- }), ye = ({
400
- friendsRank: s,
401
- avatar: a,
402
- name: l,
403
- userId: r,
404
- points: t,
405
- isCurrentUser: o,
406
- style: d
407
- }) => /* @__PURE__ */ i(Ie, { "data-name": r, style: d, children: [
408
- /* @__PURE__ */ e(We, { children: s || 0 }),
409
- /* @__PURE__ */ i(Ve, { children: [
410
- a ? /* @__PURE__ */ e(ge, { alt: "leaderboard-item-avatar", src: a }) : /* @__PURE__ */ e(Re, { children: f(l || "") }),
411
- /* @__PURE__ */ i(Ce, { children: [
412
- /* @__PURE__ */ e(Ge, { children: l || "" }),
413
- o && /* @__PURE__ */ e(Se, { name: "icon-star" })
414
- ] })
415
- ] }),
416
- /* @__PURE__ */ e("div", { children: L(t) })
417
- ] }), Xe = /* @__PURE__ */ n("div")({
418
- name: "Container",
419
- class: "c16btbfp",
420
- propsAsIs: !1
421
- }), Ye = ({
422
- items: s,
423
- currentUserId: a,
424
- openItemDetail: l,
425
- fetchMore: r,
426
- scrollNode: t,
427
- hasMore: o
428
- }) => {
429
- const d = J((p) => {
430
- const c = p.target.getAttribute("data-name");
431
- c && l(c);
432
- }, [l]);
433
- return /* @__PURE__ */ e(es, {
434
- loadMore: r,
435
- initialLoad: !1,
436
- hasMore: o,
437
- useWindow: !1,
438
- getScrollParent: () => t.current,
439
- children: /* @__PURE__ */ e(Xe, {
440
- "data-a": "intr",
441
- onClick: d,
442
- children: s.map((p) => /* @__PURE__ */ e(ye, {
443
- ...p,
444
- isCurrentUser: !!a && a === p.userId
445
- }, p.userId))
446
- })
447
- });
448
- }, Ee = /* @__PURE__ */ n("div")({
449
- name: "Container",
450
- class: "c1itm4k7",
451
- propsAsIs: !1
452
- }), Ne = /* @__PURE__ */ n("div")({
453
- name: "IconContainer",
454
- class: "i1w4fsni",
455
- propsAsIs: !1
456
- }), $e = () => h, ke = /* @__PURE__ */ n($e())({
457
- name: "InviteGameIcon",
458
- class: "i19m85r1",
459
- propsAsIs: !0
460
- }), Fe = /* @__PURE__ */ n("div")({
461
- name: "Content",
462
- class: "c1mbu204",
463
- propsAsIs: !1
464
- }), Ue = /* @__PURE__ */ n("div")({
465
- name: "Heading",
466
- class: "h1amdqtv",
467
- propsAsIs: !1
468
- }), fe = /* @__PURE__ */ n("div")({
469
- name: "Subtext",
470
- class: "s1lhlj9j",
471
- propsAsIs: !1
472
- }), Le = /* @__PURE__ */ n("div")({
473
- name: "LinkContainer",
474
- class: "l1wot35e",
475
- propsAsIs: !1
476
- }), xe = /* @__PURE__ */ n("div")({
477
- name: "LinkInfo",
478
- class: "l1jdw39q",
479
- propsAsIs: !1
480
- }), Be = /* @__PURE__ */ n("span")({
481
- name: "LinkTitle",
482
- class: "l1cr5mk",
483
- propsAsIs: !1
484
- }), Je = /* @__PURE__ */ n("span")({
485
- name: "LinkAddress",
486
- class: "lvi87q4",
487
- propsAsIs: !1
488
- }), Qe = () => h, Me = /* @__PURE__ */ n(Qe())({
489
- name: "LinkIcon",
490
- class: "l1pqlvw3",
491
- propsAsIs: !0
492
- }), ze = ({
493
- inviteLink: s,
494
- inviteCardTitle: a,
495
- inviteCardSubtext: l,
496
- primaryColor: r,
497
- className: t
498
- }) => {
499
- const o = G(null), [d, p] = z(o), [c] = x({
500
- type: "invitation",
501
- action: "sent",
502
- payload: {
503
- from: Q.MENU
504
- }
505
- });
506
- return /* @__PURE__ */ i(Ee, { className: t, children: [
507
- /* @__PURE__ */ e(Ne, { style: { backgroundColor: r }, children: /* @__PURE__ */ e(ke, { name: "invite-game-icon" }) }),
508
- /* @__PURE__ */ i(Fe, { children: [
509
- /* @__PURE__ */ e(Ue, { children: a || "" }),
510
- /* @__PURE__ */ e(fe, { children: l || "" })
511
- ] }),
512
- s && /* @__PURE__ */ i(Le, { ref: o, "data-a": "intr", onClick: c(() => d(s)), children: [
513
- /* @__PURE__ */ i(xe, { children: [
514
- /* @__PURE__ */ e(Be, { children: "Invite link" }),
515
- /* @__PURE__ */ e(Je, { children: s })
516
- ] }),
517
- /* @__PURE__ */ e(Me, { name: "icon-copy" })
518
- ] }),
519
- p
520
- ] });
521
- }, we = /* @__PURE__ */ n("div")({
522
- name: "InviteFriendsContainer",
523
- class: "i1c9dygq",
524
- propsAsIs: !1
525
- }), Te = ({
526
- deepLink: s
527
- }) => /* @__PURE__ */ e(we, {
528
- children: /* @__PURE__ */ e(ze, {
529
- inviteLink: s,
530
- inviteCardTitle: "It’s More Fun With Friends",
531
- inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
532
- })
533
- }), je = /* @__PURE__ */ n("div")({
534
- name: "InviteLinkContainer",
535
- class: "i1odbhm4",
536
- propsAsIs: !1
537
- }), Ke = ({
538
- gamification: s,
539
- scrollNode: a,
540
- scrollStore: l
541
- }) => {
542
- const r = G(null), {
543
- data: t,
544
- hasMore: o,
545
- loading: d,
546
- key: p
547
- } = b(s.leaderboardList.$store), {
548
- data: c
549
- } = b(s.deepLink.$store), [m, u] = z(r);
550
- return !t.length && !d ? /* @__PURE__ */ e(Te, {
551
- deepLink: c
552
- }) : /* @__PURE__ */ i(C, {
553
- children: [/* @__PURE__ */ e(Ye, {
554
- items: t,
555
- scrollNode: a,
556
- scrollStore: l,
557
- fetchMore: s.leaderboardList.fetchMore,
558
- hasMore: o,
559
- openItemDetail: s.openUser,
560
- currentUserId: s.currentUserId.get()
561
- }, p), c && /* @__PURE__ */ e(je, {
562
- ref: r,
563
- children: /* @__PURE__ */ e(ve, {
564
- "data-a": "intr",
565
- onClick: () => m(c),
566
- title: "Invite Friends",
567
- description: "Challenge them now!"
568
- })
569
- }), u]
570
- });
571
- }, He = () => B, De = /* @__PURE__ */ n(He())({
572
- name: "Container",
573
- class: "cll3md7",
574
- propsAsIs: !0
575
- }), qe = () => ns, Pe = /* @__PURE__ */ n(qe())({
576
- name: "ActionBtn",
577
- class: "a10g1iik",
578
- propsAsIs: !0
579
- }), Oe = ({ questionId: s, ...a }) => /* @__PURE__ */ i(De, { "data-a": "intr", "data-name": s, children: [
580
- /* @__PURE__ */ e(_s, { questionId: s, ...a }),
581
- /* @__PURE__ */ e(Pe, { "data-a": "intr", "data-name": s, children: "View Insight" })
582
- ] }), _e = () => B, sn = /* @__PURE__ */ n(_e())({
583
- name: "Container",
584
- class: "cl56x6b",
585
- propsAsIs: !0
586
- }), en = /* @__PURE__ */ n("button")({
587
- name: "ActionButton",
588
- class: "a11pzf92",
589
- propsAsIs: !1
590
- }), nn = /* @__PURE__ */ n("blockquote")({
591
- name: "Quote",
592
- class: "q1hbaleq",
593
- propsAsIs: !1
594
- }), an = ({ ...s }) => /* @__PURE__ */ i(sn, { "data-a": "intr", "data-name": s.tweetId, children: [
595
- s.title && /* @__PURE__ */ e(nn, { children: s.title }),
596
- /* @__PURE__ */ e(as, { ...s }),
597
- /* @__PURE__ */ e(en, { "data-a": "intr", "data-name": s.tweetId, children: "View Insight" })
598
- ] }), U = /* @__PURE__ */ n("div")({
599
- name: "QuestionsContainer",
600
- class: "qvghv3l",
601
- propsAsIs: !1
602
- }), ln = ({ questions: s, openQuestion: a, controlVideo: l }) => s ? /* @__PURE__ */ e(U, { "data-a": "intr", onClick: (t) => {
603
- const o = t.target.getAttribute("data-name");
604
- o && (is(), a(o, { openedFrom: "list" }));
605
- }, children: s == null ? void 0 : s.map((t) => {
606
- var o, d, p;
607
- if (t.type === "question" && ((o = t.attributes) == null ? void 0 : o.attributes.case) === "question") {
608
- const c = t.attributes.attributes.value;
609
- return /* @__PURE__ */ e(ls, { ...c }, c.questionId);
610
- }
611
- if (t.type === "insight" && ((d = t.attributes) == null ? void 0 : d.attributes.case) === "insight") {
612
- const c = t.attributes.attributes.value;
613
- return /* @__PURE__ */ e(Oe, { controlVideo: l, ...c }, c.questionId);
614
- }
615
- if (t.type === "tweet" && ((p = t.attributes) == null ? void 0 : p.attributes.case) === "tweet") {
616
- const c = t.attributes.attributes.value, m = t.attributes.id;
617
- return /* @__PURE__ */ e(an, { controlVideo: l, ...c, tweetId: m }, m);
618
- }
619
- return null;
620
- }) }) : /* @__PURE__ */ e(U, { children: Array.from({ length: 5 }).map((t, o) => /* @__PURE__ */ e(ts, {}, o)) }), tn = ({ store: s, openQuestion: a }) => {
621
- const { sdk: l } = os(), r = b(s);
622
- return /* @__PURE__ */ e(ln, { openQuestion: a, questions: r.data, controlVideo: l == null ? void 0 : l.controlVideoPlayer });
623
- }, on = ({ userSummary: s }) => {
624
- var a;
625
- const [l, r] = Z(void 0);
626
- return g(() => {
627
- const t = s.$store.subscribe((o) => {
628
- o && r(o);
629
- });
630
- return () => {
631
- t();
632
- };
633
- }, [s]), /* @__PURE__ */ e(js, { loading: !(l != null && l.summary), ...l == null ? void 0 : l.summary, successRate: (a = l == null ? void 0 : l.percentage) == null ? void 0 : a.correct });
634
- }, rn = ({ gamification: s, className: a, scrollStore: l, scrollNode: r, appNode: t, style: o, responsiveStore: d }) => {
635
- const { tabsShown: p } = b(l, { keys: ["tabsShown"] }), c = b(s.friendsTabEnabled), [m, u] = Z(v.HOME), [, R] = rs(), { sdkInDesktopView: y, screen: w } = b(d, { keys: ["sdkInDesktopView"] }), T = (A) => {
636
- R(() => {
637
- var X;
638
- u(A), y === !1 && (((X = t.current) == null ? void 0 : X.getBoundingClientRect().y) || 0) < 0 && Rs(t, w.size, { behavior: "instant" });
639
- });
640
- };
641
- g(() => l.subscribe((A) => {
642
- if (A.scrollPosition === 0) {
643
- l.setKey("tabsShown", !0);
644
- return;
645
- }
646
- d.get().sdkInDesktopView ? l.setKey("tabsShown", A.scrollDirection === "backward") : l.setKey("tabsShown", A.scrollDirection === "forward");
647
- }), [l, d]), g(() => {
648
- c || u(v.HOME);
649
- }, [c]);
650
- let V = "0px";
651
- return y ? V = p ? "0px" : "calc(0px - var(--header-height))" : V = p ? "var(--header-height)" : "0px", /* @__PURE__ */ i(hs, { className: cs(a, "SL-Tabs"), style: o, children: [
652
- c && /* @__PURE__ */ e(
653
- Ws,
654
- {
655
- style: {
656
- top: V
657
- },
658
- children: /* @__PURE__ */ e(le, { activePage: m, toggleActivePage: T })
659
- }
660
- ),
661
- m === v.HOME && /* @__PURE__ */ i(C, { children: [
662
- /* @__PURE__ */ e(bs, { children: /* @__PURE__ */ e(gs, { children: /* @__PURE__ */ e(on, { userSummary: s.userSummary }) }) }),
663
- /* @__PURE__ */ e(S, { style: { flex: 1 }, children: /* @__PURE__ */ e(tn, { openQuestion: s.openQuestion, store: s.feedList.getStore() }) })
664
- ] }),
665
- m === v.LEADERBOARD && /* @__PURE__ */ e(vs, { children: /* @__PURE__ */ e(Ke, { scrollStore: l, scrollNode: r, gamification: s }) })
666
- ] });
667
- }, mn = ({
668
- gamification: s,
669
- scrollStore: a,
670
- className: l,
671
- appNode: r,
672
- scrollNode: t,
673
- responsiveStore: o
674
- }) => /* @__PURE__ */ e(rn, {
675
- appNode: r,
676
- scrollStore: a,
677
- scrollNode: t,
678
- className: l,
679
- gamification: s,
680
- responsiveStore: o
681
- });
682
- export {
683
- mn as default
684
- };