@streamlayer/react 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/advertisement.d.ts +2 -0
- package/lib/app/app.d.ts +0 -1
- package/lib/app/masters.d.ts +0 -1
- package/lib/app/provider.d.ts +0 -1
- package/lib/app/useStreamLayerApp.d.ts +0 -1
- package/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/app.js +1 -1
- package/lib/cjs/index2.js +37 -37
- package/lib/cjs/masters2.js +2 -2
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +14 -14
- package/lib/dist/cjs/masters.js +75 -75
- package/lib/dist/es/masters.js +14935 -14661
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +237 -202
- package/lib/es/app.js +323 -311
- package/lib/es/index2.js +2050 -2046
- package/lib/es/masters2.js +11 -11
- package/lib/es/points.js +3 -3
- package/lib/es/useStreamLayerApp2.js +3592 -3329
- package/lib/style.css +1 -1
- package/package.json +28 -28
- package/lib/dist/index.d.ts +0 -2208
package/lib/es/app.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsx as t, jsxs as
|
|
5
|
-
import { a4 as
|
|
6
|
-
import { createContext as es, useContext as z, useRef as
|
|
7
|
-
import { C
|
|
1
|
+
var fe = Object.defineProperty;
|
|
2
|
+
var ke = (e, s, n) => s in e ? fe(e, s, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[s] = n;
|
|
3
|
+
var m = (e, s, n) => ke(e, typeof s != "symbol" ? s + "" : s, n);
|
|
4
|
+
import { jsx as t, jsxs as g, Fragment as D } from "react/jsx-runtime";
|
|
5
|
+
import { a4 as P, u, F as ye, s as h, T as re, i as Ne, p as be, b as Se, N as Ie, k as Ee, M as Ae, g as Ce, h as we, C as $e, j as Le, O as le, m as q, l as De, n as Te, o as Oe, q as de, r as xe, t as Re, v as Ve, w as M, x as Pe, y as ce, z as U, A as qe, B as G, I as O, c as pe, E as _e, G as Fe, H as Qe, e as Ke, J as x, K as H, P as Me, R as Ue, U as ze, a as ue, W as Be, X as We, L as _, $ as Ge, f as F, a0 as He, a1 as je, Y as Xe, Z as Ye, _ as Ze, a5 as Je, a2 as he, a3 as j } from "./index2.js";
|
|
6
|
+
import { createContext as es, useContext as z, useRef as L, useState as E, useEffect as k, useTransition as ss, lazy as ns, useMemo as w, Suspense as ts, forwardRef as os, useLayoutEffect as is, useCallback as V } from "react";
|
|
7
|
+
import { C, c as X, Q as R, S as $ } from "./useStreamLayerApp2.js";
|
|
8
8
|
window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));
|
|
9
|
-
function
|
|
9
|
+
function as(e) {
|
|
10
10
|
return e instanceof DOMException && // everything except Firefox
|
|
11
11
|
(e.code === 22 || // Firefox
|
|
12
12
|
e.code === 1014 || // test name field too, because code might not be present
|
|
@@ -14,100 +14,100 @@ function rs(e) {
|
|
|
14
14
|
e.name === "QuotaExceededError" || // Firefox
|
|
15
15
|
e.name === "NS_ERROR_DOM_QUOTA_REACHED");
|
|
16
16
|
}
|
|
17
|
-
class
|
|
17
|
+
class rs {
|
|
18
18
|
constructor(s = "main", n = window.localStorage) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
m(this, "delimiter", ":");
|
|
20
|
+
m(this, "prefix");
|
|
21
|
+
m(this, "storage");
|
|
22
|
+
m(this, "clear", () => {
|
|
23
23
|
for (const s in window.localStorage)
|
|
24
24
|
s.startsWith(this.prefix) && this.storage.removeItem(s);
|
|
25
25
|
});
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
m(this, "generateKey", (s) => `${this.prefix}${this.delimiter}${s.join(this.delimiter)}`);
|
|
27
|
+
m(this, "write", (...s) => {
|
|
28
28
|
const n = s.pop() || "", o = this.generateKey(s);
|
|
29
29
|
try {
|
|
30
30
|
this.storage.setItem(o, n);
|
|
31
|
-
} catch (
|
|
32
|
-
|
|
31
|
+
} catch (a) {
|
|
32
|
+
as(a) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(o, n));
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
|
|
35
|
+
m(this, "read", (...s) => {
|
|
36
36
|
const n = this.storage.getItem(this.generateKey(s));
|
|
37
37
|
return n === null ? void 0 : n;
|
|
38
38
|
});
|
|
39
|
-
|
|
39
|
+
m(this, "remove", (...s) => {
|
|
40
40
|
this.storage.removeItem(this.generateKey(s));
|
|
41
41
|
});
|
|
42
42
|
this.prefix = `sl-sdk${this.delimiter}${s}`, this.storage = n;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
var
|
|
45
|
+
var Y;
|
|
46
46
|
(function(e) {
|
|
47
47
|
e.Init = "init", e.Ready = "ready", e.Connecting = "connecting", e.Connected = "connected", e.Disconnected = "disconnected", e.Failed = "failed", e.Reconnect = "reconnect", e.Reconnecting = "reconnecting";
|
|
48
|
-
})(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
})(Y || (Y = {}));
|
|
49
|
+
C.Unknown, C.Internal, C.DeadlineExceeded, C.ResourceExhausted, C.FailedPrecondition, C.Unavailable, C.DataLoss;
|
|
50
|
+
P("grpc:retry");
|
|
51
|
+
X(10, { description: "Number of attempts to retry" }), X(3e4, { description: "Max delay between retries in milliseconds" });
|
|
52
52
|
var I;
|
|
53
53
|
(function(e) {
|
|
54
54
|
e.SCHEMA = "schema", e.EXTERNAL_TOKEN = "eToken", e.TOKEN = "token";
|
|
55
55
|
})(I || (I = {}));
|
|
56
|
-
class ls extends
|
|
56
|
+
class ls extends rs {
|
|
57
57
|
constructor() {
|
|
58
58
|
super("user");
|
|
59
59
|
// Schema
|
|
60
|
-
|
|
60
|
+
m(this, "setSchema", (n) => {
|
|
61
61
|
this.write(I.SCHEMA, n);
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
m(this, "getSchema", () => this.read(I.SCHEMA));
|
|
64
64
|
// Token
|
|
65
|
-
|
|
65
|
+
m(this, "setToken", (n) => {
|
|
66
66
|
this.write(I.TOKEN, n);
|
|
67
67
|
});
|
|
68
|
-
|
|
68
|
+
m(this, "getToken", () => this.read(I.TOKEN));
|
|
69
69
|
// External Token
|
|
70
|
-
|
|
70
|
+
m(this, "setExternalToken", (n) => {
|
|
71
71
|
this.write(I.EXTERNAL_TOKEN, n);
|
|
72
72
|
});
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
m(this, "getExternalToken", () => this.read(I.EXTERNAL_TOKEN));
|
|
74
|
+
m(this, "removeToken", () => {
|
|
75
75
|
this.remove(I.TOKEN);
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
var Y;
|
|
80
|
-
(function(e) {
|
|
81
|
-
e.DISABLED = "disabled", e.INITIALIZATION = "initialization", e.READY = "ready", e.FAILED = "failed", e.SUSPENDED = "suspended";
|
|
82
|
-
})(Y || (Y = {}));
|
|
83
|
-
V("deep_link");
|
|
84
|
-
V("bypass");
|
|
85
|
-
new ls();
|
|
86
|
-
V("video_player");
|
|
87
79
|
var Z;
|
|
88
80
|
(function(e) {
|
|
89
|
-
e.
|
|
81
|
+
e.DISABLED = "disabled", e.INITIALIZATION = "initialization", e.READY = "ready", e.FAILED = "failed", e.SUSPENDED = "suspended";
|
|
90
82
|
})(Z || (Z = {}));
|
|
83
|
+
P("deep_link");
|
|
84
|
+
P("bypass");
|
|
85
|
+
new ls();
|
|
86
|
+
P("video_player");
|
|
91
87
|
var J;
|
|
92
88
|
(function(e) {
|
|
93
|
-
e.
|
|
89
|
+
e.SHOWED = "showed";
|
|
94
90
|
})(J || (J = {}));
|
|
95
91
|
var ee;
|
|
96
92
|
(function(e) {
|
|
97
|
-
e.
|
|
93
|
+
e.ALLOWED = "allowed", e.DISALLOWED = "disallowed";
|
|
98
94
|
})(ee || (ee = {}));
|
|
99
95
|
var se;
|
|
100
96
|
(function(e) {
|
|
101
|
-
e.
|
|
97
|
+
e.UNKNOWN = "unknown", e.ALREADY_VOTED = "already_voted";
|
|
102
98
|
})(se || (se = {}));
|
|
103
99
|
var ne;
|
|
104
100
|
(function(e) {
|
|
105
|
-
e.
|
|
101
|
+
e.ONBOARDING = "onboarding", e.ONBOARDING_IO = "onboarding_io";
|
|
106
102
|
})(ne || (ne = {}));
|
|
107
|
-
|
|
103
|
+
var te;
|
|
104
|
+
(function(e) {
|
|
105
|
+
e.Unset = "unset", e.Required = "required", e.Optional = "optional", e.Completed = "completed", e.Disabled = "disabled", e.Unavailable = "unavailable";
|
|
106
|
+
})(te || (te = {}));
|
|
107
|
+
R.POLL, R.PREDICTION, R.TRIVIA;
|
|
108
108
|
const ds = {
|
|
109
|
-
[
|
|
110
|
-
},
|
|
109
|
+
[$.GAMES]: !0
|
|
110
|
+
}, Q = /* @__PURE__ */ h("div")({
|
|
111
111
|
name: "LoadingContainer",
|
|
112
112
|
class: "lclc0ej",
|
|
113
113
|
propsAsIs: !1
|
|
@@ -116,30 +116,30 @@ const ds = {
|
|
|
116
116
|
sdk: s,
|
|
117
117
|
children: n,
|
|
118
118
|
className: o,
|
|
119
|
-
noWait:
|
|
119
|
+
noWait: a
|
|
120
120
|
}) => {
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
121
|
+
const r = u(e.status), l = u(s.sdkStore.slStreamId);
|
|
122
|
+
if (!a) {
|
|
123
123
|
if (l != null && l.loading && !l.data)
|
|
124
|
-
return /* @__PURE__ */ t(
|
|
124
|
+
return /* @__PURE__ */ t(Q, {
|
|
125
125
|
className: o,
|
|
126
126
|
children: "Event is loading..."
|
|
127
127
|
});
|
|
128
128
|
if (!(l != null && l.data))
|
|
129
|
-
return /* @__PURE__ */ t(
|
|
129
|
+
return /* @__PURE__ */ t(Q, {
|
|
130
130
|
className: o,
|
|
131
131
|
children: "Event is forbidden..."
|
|
132
132
|
});
|
|
133
|
-
if (
|
|
134
|
-
return /* @__PURE__ */ t(
|
|
133
|
+
if (r !== ye.Ready)
|
|
134
|
+
return /* @__PURE__ */ t(Q, {
|
|
135
135
|
className: o,
|
|
136
136
|
children: "Wait feature..."
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
return n;
|
|
140
|
-
},
|
|
140
|
+
}, ve = es({
|
|
141
141
|
sdk: null
|
|
142
|
-
}), B = () => z(
|
|
142
|
+
}), B = () => z(ve), ps = /* @__PURE__ */ h("div")({
|
|
143
143
|
name: "QuestionContainer",
|
|
144
144
|
class: "q14ckf9e",
|
|
145
145
|
propsAsIs: !1
|
|
@@ -150,10 +150,10 @@ const ds = {
|
|
|
150
150
|
const {
|
|
151
151
|
sdk: o
|
|
152
152
|
} = B();
|
|
153
|
-
return ((s = e == null ? void 0 : e.attributes) == null ? void 0 : s.attributes.case) === "insight" ? /* @__PURE__ */ t(
|
|
153
|
+
return ((s = e == null ? void 0 : e.attributes) == null ? void 0 : s.attributes.case) === "insight" ? /* @__PURE__ */ t(be, {
|
|
154
154
|
...e.attributes.attributes.value,
|
|
155
155
|
controlVideo: o == null ? void 0 : o.controlVideoPlayer
|
|
156
|
-
}) : ((n = e == null ? void 0 : e.attributes) == null ? void 0 : n.attributes.case) === "tweet" ? /* @__PURE__ */ t(
|
|
156
|
+
}) : ((n = e == null ? void 0 : e.attributes) == null ? void 0 : n.attributes.case) === "tweet" ? /* @__PURE__ */ t(Se, {
|
|
157
157
|
...e.attributes.attributes.value,
|
|
158
158
|
controlVideo: o == null ? void 0 : o.controlVideoPlayer
|
|
159
159
|
}) : null;
|
|
@@ -164,44 +164,48 @@ const ds = {
|
|
|
164
164
|
}) => {
|
|
165
165
|
const {
|
|
166
166
|
loading: o,
|
|
167
|
-
data:
|
|
167
|
+
data: a
|
|
168
168
|
} = e;
|
|
169
|
-
return
|
|
169
|
+
return a ? /* @__PURE__ */ t(Ie, {
|
|
170
170
|
vote: s,
|
|
171
171
|
close: n,
|
|
172
|
-
openedQuestion:
|
|
172
|
+
openedQuestion: a,
|
|
173
173
|
isLoading: !!o
|
|
174
|
-
}) : /* @__PURE__ */ t(
|
|
174
|
+
}) : /* @__PURE__ */ t(Ee, {});
|
|
175
175
|
}, vs = ({
|
|
176
|
-
gamification: e
|
|
176
|
+
gamification: e,
|
|
177
|
+
hideSponsor: s,
|
|
178
|
+
className: n,
|
|
179
|
+
hideHeader: o
|
|
177
180
|
}) => {
|
|
178
|
-
var
|
|
179
|
-
const
|
|
180
|
-
if (!
|
|
181
|
+
var a, r, l;
|
|
182
|
+
const d = u(e.openedQuestion.$store), i = u(e.openedQuestion.$extendedStore);
|
|
183
|
+
if (!d)
|
|
181
184
|
return null;
|
|
182
|
-
const
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
|
|
185
|
+
const c = d.type;
|
|
186
|
+
return /* @__PURE__ */ g(ps, {
|
|
187
|
+
className: n,
|
|
188
|
+
children: [!o && /* @__PURE__ */ t(re, {
|
|
185
189
|
close: e.closeQuestion,
|
|
186
|
-
type: ((
|
|
187
|
-
}),
|
|
190
|
+
type: ((a = d.attributes) == null ? void 0 : a.type) || R.UNSET
|
|
191
|
+
}), c === "question" && /* @__PURE__ */ t(hs, {
|
|
188
192
|
vote: e.submitAnswer,
|
|
189
193
|
close: e.closeQuestion,
|
|
190
|
-
extendedQuestion:
|
|
191
|
-
}),
|
|
192
|
-
openedQuestion:
|
|
193
|
-
}), /* @__PURE__ */ t(
|
|
194
|
-
sponsorLogo: (
|
|
194
|
+
extendedQuestion: i
|
|
195
|
+
}), c !== "question" && /* @__PURE__ */ t(us, {
|
|
196
|
+
openedQuestion: d
|
|
197
|
+
}), !s && /* @__PURE__ */ t(Ne, {
|
|
198
|
+
sponsorLogo: (l = (r = i.data) == null ? void 0 : r.sponsorship) == null ? void 0 : l.logo
|
|
195
199
|
})]
|
|
196
200
|
});
|
|
197
|
-
},
|
|
201
|
+
}, ms = /* @__PURE__ */ h("div")({
|
|
198
202
|
name: "InviteFriendsContainer",
|
|
199
203
|
class: "i1c9dygq",
|
|
200
204
|
propsAsIs: !1
|
|
201
|
-
}),
|
|
205
|
+
}), gs = ({
|
|
202
206
|
deepLink: e
|
|
203
|
-
}) => /* @__PURE__ */ t(
|
|
204
|
-
children: /* @__PURE__ */ t(
|
|
207
|
+
}) => /* @__PURE__ */ t(ms, {
|
|
208
|
+
children: /* @__PURE__ */ t(Ae, {
|
|
205
209
|
inviteLink: e,
|
|
206
210
|
inviteCardTitle: "It’s More Fun With Friends",
|
|
207
211
|
inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
|
|
@@ -215,53 +219,53 @@ const ds = {
|
|
|
215
219
|
scrollNode: s,
|
|
216
220
|
scrollStore: n
|
|
217
221
|
}) => {
|
|
218
|
-
const o =
|
|
219
|
-
data:
|
|
220
|
-
hasMore:
|
|
222
|
+
const o = L(null), {
|
|
223
|
+
data: a,
|
|
224
|
+
hasMore: r,
|
|
221
225
|
loading: l,
|
|
222
226
|
key: d
|
|
223
227
|
} = u(e.leaderboardList.$store), {
|
|
224
|
-
data:
|
|
225
|
-
} = u(e.deepLink.$store), [
|
|
226
|
-
return !
|
|
227
|
-
deepLink:
|
|
228
|
-
}) : /* @__PURE__ */
|
|
229
|
-
children: [/* @__PURE__ */ t(
|
|
230
|
-
items:
|
|
228
|
+
data: i
|
|
229
|
+
} = u(e.deepLink.$store), [c, p] = Ce(o);
|
|
230
|
+
return !a.length && !l ? /* @__PURE__ */ t(gs, {
|
|
231
|
+
deepLink: i
|
|
232
|
+
}) : /* @__PURE__ */ g(D, {
|
|
233
|
+
children: [/* @__PURE__ */ t(we, {
|
|
234
|
+
items: a,
|
|
231
235
|
scrollNode: s,
|
|
232
236
|
scrollStore: n,
|
|
233
237
|
fetchMore: e.leaderboardList.fetchMore,
|
|
234
|
-
hasMore:
|
|
238
|
+
hasMore: r,
|
|
235
239
|
openItemDetail: e.openUser,
|
|
236
240
|
currentUserId: e.currentUserId.get()
|
|
237
|
-
}, d),
|
|
241
|
+
}, d), i && /* @__PURE__ */ t(fs, {
|
|
238
242
|
ref: o,
|
|
239
|
-
children: /* @__PURE__ */ t(
|
|
240
|
-
onClick: () =>
|
|
243
|
+
children: /* @__PURE__ */ t($e, {
|
|
244
|
+
onClick: () => c(i),
|
|
241
245
|
title: "Invite Friends",
|
|
242
246
|
description: "Challenge them now!"
|
|
243
247
|
})
|
|
244
|
-
}),
|
|
248
|
+
}), p]
|
|
245
249
|
});
|
|
246
250
|
}, ys = ({ store: e, openQuestion: s }) => {
|
|
247
251
|
const { sdk: n } = B(), o = u(e);
|
|
248
|
-
return /* @__PURE__ */ t(
|
|
252
|
+
return /* @__PURE__ */ t(Le, { openQuestion: s, questions: o.data, controlVideo: n == null ? void 0 : n.controlVideoPlayer });
|
|
249
253
|
}, Ns = ({ userSummary: e }) => {
|
|
250
254
|
var s;
|
|
251
255
|
const [n, o] = E(void 0);
|
|
252
256
|
return k(() => {
|
|
253
|
-
const
|
|
254
|
-
|
|
257
|
+
const a = e.$store.subscribe((r) => {
|
|
258
|
+
r && o(r);
|
|
255
259
|
});
|
|
256
260
|
return () => {
|
|
257
|
-
|
|
261
|
+
a();
|
|
258
262
|
};
|
|
259
|
-
}, [e]), /* @__PURE__ */ t(
|
|
260
|
-
}, bs = ({ gamification: e, className: s, scrollStore: n, scrollNode: o, appNode:
|
|
261
|
-
const { tabsShown: d } = u(n, { keys: ["tabsShown"] }), [
|
|
262
|
-
|
|
263
|
+
}, [e]), /* @__PURE__ */ t(le, { loading: !(n != null && n.summary), ...n == null ? void 0 : n.summary, successRate: (s = n == null ? void 0 : n.percentage) == null ? void 0 : s.correct });
|
|
264
|
+
}, bs = ({ gamification: e, className: s, scrollStore: n, scrollNode: o, appNode: a, style: r, responsiveStore: l }) => {
|
|
265
|
+
const { tabsShown: d } = u(n, { keys: ["tabsShown"] }), [i, c] = E(q.HOME), [, p] = ss(), { sdkInDesktopView: v, screen: f } = u(l, { keys: ["sdkInDesktopView"] }), N = (S) => {
|
|
266
|
+
p(() => {
|
|
263
267
|
var y;
|
|
264
|
-
|
|
268
|
+
c(S), v === !1 && (((y = a.current) == null ? void 0 : y.getBoundingClientRect().y) || 0) < 0 && M(a, f.size, { behavior: "instant" });
|
|
265
269
|
});
|
|
266
270
|
};
|
|
267
271
|
k(() => n.subscribe((S) => {
|
|
@@ -272,23 +276,23 @@ const ds = {
|
|
|
272
276
|
l.get().sdkInDesktopView ? n.setKey("tabsShown", S.scrollDirection === "backward") : n.setKey("tabsShown", S.scrollDirection === "forward");
|
|
273
277
|
}), [n, l]);
|
|
274
278
|
let b = "0px";
|
|
275
|
-
return v ? b = d ? "0px" : "calc(8px - var(--header-height) - var(--header-offset))" : b = d ? "calc(var(--header-height) + var(--header-offset) - 2px)" : "0px", /* @__PURE__ */
|
|
279
|
+
return v ? b = d ? "0px" : "calc(8px - var(--header-height) - var(--header-offset))" : b = d ? "calc(var(--header-height) + var(--header-offset) - 2px)" : "0px", /* @__PURE__ */ g(De, { className: s, style: r, children: [
|
|
276
280
|
/* @__PURE__ */ t(
|
|
277
|
-
|
|
281
|
+
Te,
|
|
278
282
|
{
|
|
279
283
|
style: {
|
|
280
284
|
top: b
|
|
281
285
|
},
|
|
282
|
-
children: /* @__PURE__ */ t(
|
|
286
|
+
children: /* @__PURE__ */ t(Oe, { activePage: i, toggleActivePage: N })
|
|
283
287
|
}
|
|
284
288
|
),
|
|
285
|
-
|
|
286
|
-
/* @__PURE__ */ t(
|
|
287
|
-
/* @__PURE__ */ t(
|
|
289
|
+
i === q.HOME && /* @__PURE__ */ g(D, { children: [
|
|
290
|
+
/* @__PURE__ */ t(de, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ t(xe, { children: /* @__PURE__ */ t(Ns, { userSummary: e.userSummary }) }) }),
|
|
291
|
+
/* @__PURE__ */ t(Re, { style: { flex: 1 }, children: /* @__PURE__ */ t(ys, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) })
|
|
288
292
|
] }),
|
|
289
|
-
|
|
293
|
+
i === q.LEADERBOARD && /* @__PURE__ */ t(Ve, { children: /* @__PURE__ */ t(ks, { scrollStore: n, scrollNode: o, gamification: e }) })
|
|
290
294
|
] });
|
|
291
|
-
}, Ss = () => U,
|
|
295
|
+
}, Ss = () => U, oe = /* @__PURE__ */ h(Ss())({
|
|
292
296
|
name: "OpenedContainer",
|
|
293
297
|
class: "ouvguos",
|
|
294
298
|
propsAsIs: !0
|
|
@@ -302,76 +306,76 @@ const ds = {
|
|
|
302
306
|
}) => {
|
|
303
307
|
const n = e + s;
|
|
304
308
|
return n === 0 ? 0 : Math.round(e / n * 100);
|
|
305
|
-
},
|
|
309
|
+
}, gn = ({
|
|
306
310
|
gamification: e,
|
|
307
311
|
scrollStore: s,
|
|
308
312
|
className: n,
|
|
309
313
|
appNode: o,
|
|
310
|
-
scrollNode:
|
|
311
|
-
responsiveStore:
|
|
314
|
+
scrollNode: a,
|
|
315
|
+
responsiveStore: r
|
|
312
316
|
}) => /* @__PURE__ */ t(bs, {
|
|
313
317
|
appNode: o,
|
|
314
318
|
scrollStore: s,
|
|
315
|
-
scrollNode:
|
|
319
|
+
scrollNode: a,
|
|
316
320
|
className: n,
|
|
317
321
|
gamification: e,
|
|
318
|
-
responsiveStore:
|
|
322
|
+
responsiveStore: r
|
|
319
323
|
}), As = ({
|
|
320
324
|
gamification: e,
|
|
321
325
|
className: s,
|
|
322
326
|
appNode: n,
|
|
323
327
|
responsiveStore: o
|
|
324
328
|
}) => {
|
|
325
|
-
const
|
|
329
|
+
const a = u(e.openedQuestion.$store), r = u(e.openedUser), {
|
|
326
330
|
sdkInDesktopView: l
|
|
327
331
|
} = u(o, {
|
|
328
332
|
keys: ["sdkInDesktopView"]
|
|
329
333
|
}), {
|
|
330
334
|
hiding: d,
|
|
331
|
-
onAnimationEnd:
|
|
332
|
-
} =
|
|
333
|
-
if (!n.current || !
|
|
335
|
+
onAnimationEnd: i
|
|
336
|
+
} = Pe();
|
|
337
|
+
if (!n.current || !a && !r)
|
|
334
338
|
return null;
|
|
335
|
-
const
|
|
339
|
+
const c = a ? /* @__PURE__ */ t(oe, {
|
|
336
340
|
className: s,
|
|
337
341
|
hiding: d,
|
|
338
|
-
onAnimationEnd:
|
|
342
|
+
onAnimationEnd: i,
|
|
339
343
|
children: /* @__PURE__ */ t(vs, {
|
|
340
344
|
gamification: e
|
|
341
345
|
})
|
|
342
|
-
}) :
|
|
346
|
+
}) : r ? /* @__PURE__ */ t(oe, {
|
|
343
347
|
className: s,
|
|
344
348
|
hiding: d,
|
|
345
|
-
onAnimationEnd:
|
|
346
|
-
children: /* @__PURE__ */
|
|
349
|
+
onAnimationEnd: i,
|
|
350
|
+
children: /* @__PURE__ */ g(Is, {
|
|
347
351
|
children: [/* @__PURE__ */ t(re, {
|
|
348
352
|
label: "Friend's Rank",
|
|
349
353
|
close: e.closeUser
|
|
350
|
-
}), /* @__PURE__ */ t(
|
|
351
|
-
children: /* @__PURE__ */ t(
|
|
352
|
-
...
|
|
353
|
-
successRate: Es(
|
|
354
|
+
}), /* @__PURE__ */ t(de, {
|
|
355
|
+
children: /* @__PURE__ */ t(le, {
|
|
356
|
+
...r,
|
|
357
|
+
successRate: Es(r)
|
|
354
358
|
})
|
|
355
359
|
})]
|
|
356
360
|
})
|
|
357
361
|
}) : null;
|
|
358
|
-
return /* @__PURE__ */ t(
|
|
362
|
+
return /* @__PURE__ */ t(ce, {
|
|
359
363
|
container: n,
|
|
360
364
|
useContainer: !l,
|
|
361
|
-
children:
|
|
365
|
+
children: c
|
|
362
366
|
});
|
|
363
|
-
},
|
|
364
|
-
const d =
|
|
365
|
-
|
|
367
|
+
}, Cs = ns(() => import("./gamification-feature.js")), ws = ({ sdk: e, feature: s, className: n, scrollStore: o, appNode: a, scrollNode: r, responsiveStore: l }) => {
|
|
368
|
+
const d = w(() => s && s.featureConfig.get().type === $.GAMES ? /* @__PURE__ */ t(cs, { className: n, sdk: e, feature: s, children: /* @__PURE__ */ t(
|
|
369
|
+
Cs,
|
|
366
370
|
{
|
|
367
|
-
appNode:
|
|
371
|
+
appNode: a,
|
|
368
372
|
scrollStore: o,
|
|
369
|
-
scrollNode:
|
|
373
|
+
scrollNode: r,
|
|
370
374
|
className: n,
|
|
371
375
|
responsiveStore: l,
|
|
372
376
|
gamification: s
|
|
373
377
|
}
|
|
374
|
-
) }) : null, [e, s, n, l, o,
|
|
378
|
+
) }) : null, [e, s, n, l, o, r, a]);
|
|
375
379
|
return /* @__PURE__ */ t(
|
|
376
380
|
ts,
|
|
377
381
|
{
|
|
@@ -379,7 +383,7 @@ const ds = {
|
|
|
379
383
|
children: d
|
|
380
384
|
}
|
|
381
385
|
);
|
|
382
|
-
}, $s = ({ feature: e, className: s, appNode: n, responsiveStore: o }) => e && e.featureConfig.get().type ===
|
|
386
|
+
}, $s = ({ feature: e, className: s, appNode: n, responsiveStore: o }) => e && e.featureConfig.get().type === $.GAMES ? /* @__PURE__ */ t(
|
|
383
387
|
As,
|
|
384
388
|
{
|
|
385
389
|
className: s,
|
|
@@ -387,7 +391,7 @@ const ds = {
|
|
|
387
391
|
responsiveStore: o,
|
|
388
392
|
gamification: e
|
|
389
393
|
}
|
|
390
|
-
) : null, Ls = () =>
|
|
394
|
+
) : null, Ls = () => pe, Ds = /* @__PURE__ */ h(Ls())({
|
|
391
395
|
name: "ButtonIcon",
|
|
392
396
|
class: "b11wpe79",
|
|
393
397
|
propsAsIs: !0
|
|
@@ -395,58 +399,66 @@ const ds = {
|
|
|
395
399
|
sdk: e,
|
|
396
400
|
className: s
|
|
397
401
|
}, n) => {
|
|
398
|
-
const o = u(e.sdkStore.organizationSettings),
|
|
399
|
-
const
|
|
400
|
-
return
|
|
401
|
-
}, [o,
|
|
402
|
-
enableSdkButton:
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
402
|
+
const o = u(e.sdkStore.organizationSettings), a = u(e.sdkStore.streamSettings), r = u(e.getActiveFeature()), l = w(() => {
|
|
403
|
+
const i = (a == null ? void 0 : a.data) || (o == null ? void 0 : o.data);
|
|
404
|
+
return i != null && i.overlays ? i.overlays : [];
|
|
405
|
+
}, [o, a]), d = w(() => [...l.filter(({
|
|
406
|
+
enableSdkButton: i,
|
|
407
|
+
type: c
|
|
408
|
+
}) => c === $.GAMES || i).map((i) => ({
|
|
409
|
+
id: i.type,
|
|
410
|
+
onClick: () => e.openFeature(i.type),
|
|
411
|
+
disabled: !(i.type in ds),
|
|
412
|
+
label: i.name,
|
|
408
413
|
icon: /* @__PURE__ */ t("img", {
|
|
409
|
-
src:
|
|
414
|
+
src: i.icon,
|
|
410
415
|
alt: ""
|
|
411
416
|
}),
|
|
412
417
|
/** multiplied by 10 to add the ability to insert custom buttons between our buttons */
|
|
413
|
-
position:
|
|
414
|
-
}))].sort((
|
|
415
|
-
return /* @__PURE__ */
|
|
418
|
+
position: i.position * 10
|
|
419
|
+
}))].sort((i, c) => i.position - c.position), [l, e]);
|
|
420
|
+
return /* @__PURE__ */ g(qe, {
|
|
416
421
|
className: s,
|
|
417
|
-
children: [/* @__PURE__ */ t(
|
|
418
|
-
children: [/* @__PURE__ */ t(
|
|
422
|
+
children: [d.length !== 0 && /* @__PURE__ */ t(G, {
|
|
423
|
+
children: [/* @__PURE__ */ t(O, {
|
|
419
424
|
id: "Channels",
|
|
420
425
|
onClick: () => e.closeFeature(),
|
|
421
426
|
label: "Channels",
|
|
422
|
-
active:
|
|
423
|
-
}, "Channels"), ...d.map((
|
|
424
|
-
...
|
|
425
|
-
active:
|
|
427
|
+
active: r === 0
|
|
428
|
+
}, "Channels"), ...d.map((i) => i.id === $.GAMES ? /* @__PURE__ */ t(O, {
|
|
429
|
+
...i,
|
|
430
|
+
active: i.id === r,
|
|
426
431
|
label: "StreamLayer +",
|
|
427
432
|
id: "featuredGroups",
|
|
428
433
|
icon: /* @__PURE__ */ t(Ds, {
|
|
429
434
|
name: "icon-btn-feature-groups",
|
|
430
|
-
"data-selected":
|
|
435
|
+
"data-selected": i.id === r
|
|
431
436
|
})
|
|
432
|
-
},
|
|
433
|
-
...
|
|
437
|
+
}, i.id) : /* @__PURE__ */ t(O, {
|
|
438
|
+
...i,
|
|
434
439
|
icon: void 0,
|
|
435
|
-
active:
|
|
436
|
-
},
|
|
440
|
+
active: i.id === r
|
|
441
|
+
}, i.id))]
|
|
442
|
+
}), !d.length && /* @__PURE__ */ t(G, {
|
|
443
|
+
children: [/* @__PURE__ */ t(O, {
|
|
444
|
+
id: "empty",
|
|
445
|
+
label: "No Features...",
|
|
446
|
+
active: !1,
|
|
447
|
+
disabled: !0
|
|
448
|
+
}, "empty")]
|
|
437
449
|
}), /* @__PURE__ */ t("div", {
|
|
438
450
|
ref: n
|
|
439
451
|
})]
|
|
440
452
|
});
|
|
441
|
-
}),
|
|
453
|
+
}), Os = /* @__PURE__ */ h("div")({
|
|
442
454
|
name: "Container",
|
|
443
455
|
class: "c1qjj4d4",
|
|
444
456
|
propsAsIs: !1
|
|
445
|
-
}),
|
|
457
|
+
}), xs = /* @__PURE__ */ h("div")({
|
|
446
458
|
name: "CloseIconWrap",
|
|
447
459
|
class: "c1lg6b8a",
|
|
448
460
|
propsAsIs: !1
|
|
449
|
-
}), Rs = () =>
|
|
461
|
+
}), Rs = () => pe, Vs = /* @__PURE__ */ h(Rs())({
|
|
450
462
|
name: "CloseIcon",
|
|
451
463
|
class: "c159el66",
|
|
452
464
|
propsAsIs: !0
|
|
@@ -454,7 +466,7 @@ const ds = {
|
|
|
454
466
|
name: "Title",
|
|
455
467
|
class: "t16xmufv",
|
|
456
468
|
propsAsIs: !1
|
|
457
|
-
}),
|
|
469
|
+
}), qs = /* @__PURE__ */ h("img")({
|
|
458
470
|
name: "SponsorLogo",
|
|
459
471
|
class: "s83lc21",
|
|
460
472
|
propsAsIs: !1
|
|
@@ -462,11 +474,11 @@ const ds = {
|
|
|
462
474
|
name: "PresentsTitle",
|
|
463
475
|
class: "p1p7igia",
|
|
464
476
|
propsAsIs: !1
|
|
465
|
-
}),
|
|
477
|
+
}), Fs = /* @__PURE__ */ h("div")({
|
|
466
478
|
name: "Subtitle",
|
|
467
479
|
class: "s1eftsbu",
|
|
468
480
|
propsAsIs: !1
|
|
469
|
-
}),
|
|
481
|
+
}), Qs = /* @__PURE__ */ h("div")({
|
|
470
482
|
name: "Description",
|
|
471
483
|
class: "d8uezec",
|
|
472
484
|
propsAsIs: !1
|
|
@@ -474,22 +486,22 @@ const ds = {
|
|
|
474
486
|
name: "ActionButton",
|
|
475
487
|
class: "a1h1bk90",
|
|
476
488
|
propsAsIs: !1
|
|
477
|
-
}),
|
|
478
|
-
var o,
|
|
479
|
-
return /* @__PURE__ */
|
|
480
|
-
/* @__PURE__ */ t(
|
|
481
|
-
((
|
|
482
|
-
/* @__PURE__ */ t(
|
|
489
|
+
}), ie = ({ close: e, action: s, onboarding: n }) => {
|
|
490
|
+
var o, a, r, l, d, i, c, p;
|
|
491
|
+
return /* @__PURE__ */ g(Os, { children: [
|
|
492
|
+
/* @__PURE__ */ t(xs, { onClick: e, children: /* @__PURE__ */ t(Vs, { name: "icon-cross" }) }),
|
|
493
|
+
((a = (o = n == null ? void 0 : n.titleCard) == null ? void 0 : o.media) == null ? void 0 : a.sponsorLogo) && /* @__PURE__ */ g(Ps, { children: [
|
|
494
|
+
/* @__PURE__ */ t(qs, { alt: "sponsor-logo", src: (l = (r = n == null ? void 0 : n.titleCard) == null ? void 0 : r.media) == null ? void 0 : l.sponsorLogo }),
|
|
483
495
|
/* @__PURE__ */ t(_s, { children: "PRESENTS" })
|
|
484
496
|
] }),
|
|
485
|
-
((d = n == null ? void 0 : n.titleCard) == null ? void 0 : d.title) && /* @__PURE__ */ t(
|
|
486
|
-
((
|
|
497
|
+
((d = n == null ? void 0 : n.titleCard) == null ? void 0 : d.title) && /* @__PURE__ */ t(Fs, { children: (i = n == null ? void 0 : n.titleCard) == null ? void 0 : i.title }),
|
|
498
|
+
((c = n == null ? void 0 : n.titleCard) == null ? void 0 : c.subtitle) && /* @__PURE__ */ t(Qs, { children: (p = n == null ? void 0 : n.titleCard) == null ? void 0 : p.subtitle }),
|
|
487
499
|
/* @__PURE__ */ t(Ks, { onClick: s, children: "Play Now" })
|
|
488
500
|
] });
|
|
489
501
|
}, K = [{
|
|
490
502
|
graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_0.png",
|
|
491
503
|
tagline: "",
|
|
492
|
-
headline: /* @__PURE__ */
|
|
504
|
+
headline: /* @__PURE__ */ g(D, {
|
|
493
505
|
children: ["Welcome to ", /* @__PURE__ */ t("br", {}), " StreamLayer +"]
|
|
494
506
|
})
|
|
495
507
|
}, {
|
|
@@ -512,7 +524,7 @@ const ds = {
|
|
|
512
524
|
name: "OnboardingNotificationContainer",
|
|
513
525
|
class: "o1vnouv7",
|
|
514
526
|
propsAsIs: !0
|
|
515
|
-
}),
|
|
527
|
+
}), ae = /* @__PURE__ */ h("div")({
|
|
516
528
|
name: "InnerContainer",
|
|
517
529
|
class: "i59uefw",
|
|
518
530
|
propsAsIs: !1
|
|
@@ -521,17 +533,17 @@ const ds = {
|
|
|
521
533
|
onboardingOpts: s,
|
|
522
534
|
notification: n,
|
|
523
535
|
gamification: o,
|
|
524
|
-
loading:
|
|
525
|
-
sdk:
|
|
536
|
+
loading: a,
|
|
537
|
+
sdk: r
|
|
526
538
|
}) => {
|
|
527
|
-
var l, d,
|
|
528
|
-
const N = u(o.friends.getStore()), [b, S] = E(void 0), y =
|
|
539
|
+
var l, d, i, c, p, v, f;
|
|
540
|
+
const N = u(o.friends.getStore()), [b, S] = E(void 0), y = w(() => {
|
|
529
541
|
var A, T;
|
|
530
|
-
const W =
|
|
542
|
+
const W = r.getInviter();
|
|
531
543
|
return W ? (T = (A = N.data) == null ? void 0 : A.find(({
|
|
532
|
-
slId:
|
|
533
|
-
}) =>
|
|
534
|
-
}, [N.data,
|
|
544
|
+
slId: ge
|
|
545
|
+
}) => ge === W)) == null ? void 0 : T.name : "";
|
|
546
|
+
}, [N.data, r]);
|
|
535
547
|
return k(() => {
|
|
536
548
|
const A = e.$store.subscribe((T) => {
|
|
537
549
|
T && S(T.data);
|
|
@@ -540,8 +552,8 @@ const ds = {
|
|
|
540
552
|
A();
|
|
541
553
|
};
|
|
542
554
|
}, [e.$store]), /* @__PURE__ */ t(Ms, {
|
|
543
|
-
children: /* @__PURE__ */ t(
|
|
544
|
-
loading:
|
|
555
|
+
children: /* @__PURE__ */ t(Fe, {
|
|
556
|
+
loading: a,
|
|
545
557
|
rules: [{
|
|
546
558
|
label: "Answer as many questions as you like.",
|
|
547
559
|
icon: "icon-btn-feature-groups"
|
|
@@ -555,11 +567,11 @@ const ds = {
|
|
|
555
567
|
rulesBtnLabel: (l = s.rules) == null ? void 0 : l.buttonLabel,
|
|
556
568
|
rulesTitle: (d = s.rules) == null ? void 0 : d.heading,
|
|
557
569
|
termsTitle: "Terms and Conditions",
|
|
558
|
-
termsText: (
|
|
570
|
+
termsText: (i = s.rules) == null ? void 0 : i.terms,
|
|
559
571
|
steps: K,
|
|
560
|
-
primaryColor: (
|
|
572
|
+
primaryColor: (c = s.inviteCard) == null ? void 0 : c.iconColor,
|
|
561
573
|
inviteLink: b,
|
|
562
|
-
inviteCardTitle: (
|
|
574
|
+
inviteCardTitle: (p = s.inviteCard) == null ? void 0 : p.heading,
|
|
563
575
|
inviteCardSubtext: (v = s.inviteCard) == null ? void 0 : v.subtext,
|
|
564
576
|
inviteCardBtnLabel: (f = s.inviteCard) == null ? void 0 : f.buttonLabel,
|
|
565
577
|
onClose: () => {
|
|
@@ -567,7 +579,7 @@ const ds = {
|
|
|
567
579
|
(A = n.close) == null || A.call(n);
|
|
568
580
|
},
|
|
569
581
|
gamification: o,
|
|
570
|
-
sdk:
|
|
582
|
+
sdk: r,
|
|
571
583
|
inviterName: y
|
|
572
584
|
})
|
|
573
585
|
});
|
|
@@ -576,11 +588,11 @@ const ds = {
|
|
|
576
588
|
notification: s,
|
|
577
589
|
saveHeight: n,
|
|
578
590
|
style: o,
|
|
579
|
-
appNode:
|
|
580
|
-
sdkInDesktopView:
|
|
591
|
+
appNode: a,
|
|
592
|
+
sdkInDesktopView: r,
|
|
581
593
|
responsiveStore: l
|
|
582
594
|
}) => {
|
|
583
|
-
const d =
|
|
595
|
+
const d = L(null), i = s.data.onboarding, [c, p] = E(i == null ? void 0 : i.instantOpen), v = e.getFeature($.GAMES), f = w(() => K == null ? void 0 : K.map(({
|
|
584
596
|
graphicSrc: y
|
|
585
597
|
}) => y), []), {
|
|
586
598
|
screen: N
|
|
@@ -594,47 +606,47 @@ const ds = {
|
|
|
594
606
|
const {
|
|
595
607
|
loading: b,
|
|
596
608
|
throttled: S
|
|
597
|
-
} =
|
|
598
|
-
return
|
|
599
|
-
container:
|
|
600
|
-
useContainer: !
|
|
609
|
+
} = _e(f);
|
|
610
|
+
return c && v && i && a.current && !S ? /* @__PURE__ */ t(ce, {
|
|
611
|
+
container: a,
|
|
612
|
+
useContainer: !r,
|
|
601
613
|
children: /* @__PURE__ */ t(Bs, {
|
|
602
614
|
notification: s,
|
|
603
|
-
setOpened:
|
|
615
|
+
setOpened: p,
|
|
604
616
|
gamification: v,
|
|
605
|
-
onboardingOpts:
|
|
617
|
+
onboardingOpts: i,
|
|
606
618
|
deepLink: v.deepLink,
|
|
607
619
|
loading: b,
|
|
608
|
-
renderToNode:
|
|
620
|
+
renderToNode: a,
|
|
609
621
|
sdk: e
|
|
610
622
|
})
|
|
611
|
-
}) : /* @__PURE__ */
|
|
612
|
-
children: [/* @__PURE__ */ t(
|
|
623
|
+
}) : /* @__PURE__ */ g(D, {
|
|
624
|
+
children: [/* @__PURE__ */ t(ae, {
|
|
613
625
|
ref: d,
|
|
614
626
|
style: {
|
|
615
627
|
position: "absolute",
|
|
616
628
|
visibility: "hidden"
|
|
617
629
|
},
|
|
618
|
-
children: /* @__PURE__ */ t(
|
|
630
|
+
children: /* @__PURE__ */ t(ie, {
|
|
619
631
|
close: () => {
|
|
620
632
|
},
|
|
621
633
|
action: () => {
|
|
622
634
|
},
|
|
623
|
-
onboarding:
|
|
635
|
+
onboarding: i
|
|
624
636
|
})
|
|
625
637
|
}), /* @__PURE__ */ t(zs, {
|
|
626
638
|
style: o,
|
|
627
639
|
hiding: s.hiding,
|
|
628
|
-
children: /* @__PURE__ */ t(
|
|
629
|
-
children: /* @__PURE__ */ t(
|
|
640
|
+
children: /* @__PURE__ */ t(ae, {
|
|
641
|
+
children: /* @__PURE__ */ t(ie, {
|
|
630
642
|
close: s.close,
|
|
631
643
|
action: () => {
|
|
632
644
|
var y;
|
|
633
|
-
|
|
645
|
+
p(!0), (((y = a.current) == null ? void 0 : y.getBoundingClientRect().y) || 0) < 0 && M(a, N.size, {
|
|
634
646
|
behavior: "smooth"
|
|
635
647
|
});
|
|
636
648
|
},
|
|
637
|
-
onboarding:
|
|
649
|
+
onboarding: i
|
|
638
650
|
})
|
|
639
651
|
})
|
|
640
652
|
})]
|
|
@@ -643,11 +655,11 @@ const ds = {
|
|
|
643
655
|
name: "Container",
|
|
644
656
|
class: "c8ol1ve",
|
|
645
657
|
propsAsIs: !0
|
|
646
|
-
}),
|
|
658
|
+
}), me = /* @__PURE__ */ h("div")({
|
|
647
659
|
name: "InnerContainer",
|
|
648
660
|
class: "iqfywam",
|
|
649
661
|
propsAsIs: !1
|
|
650
|
-
}), js = () =>
|
|
662
|
+
}), js = () => me, Xs = /* @__PURE__ */ h(js())({
|
|
651
663
|
name: "HiddenContainer",
|
|
652
664
|
class: "hokmtod",
|
|
653
665
|
propsAsIs: !0
|
|
@@ -655,12 +667,12 @@ const ds = {
|
|
|
655
667
|
name: "NotificationRefreshing",
|
|
656
668
|
class: "n192d1q8",
|
|
657
669
|
propsAsIs: !1
|
|
658
|
-
}), Zs = () =>
|
|
670
|
+
}), Zs = () => Qe, Js = /* @__PURE__ */ h(Zs())({
|
|
659
671
|
name: "Pill",
|
|
660
672
|
class: "p1lha68t",
|
|
661
673
|
propsAsIs: !0
|
|
662
674
|
}), en = (e) => {
|
|
663
|
-
const [s, n] = E(0), o =
|
|
675
|
+
const [s, n] = E(0), o = L(null), a = V((l) => {
|
|
664
676
|
o.current = l;
|
|
665
677
|
}, []);
|
|
666
678
|
k(() => {
|
|
@@ -668,58 +680,58 @@ const ds = {
|
|
|
668
680
|
const d = (l = o.current) == null ? void 0 : l.getBoundingClientRect();
|
|
669
681
|
d && n(d.height);
|
|
670
682
|
}, [e]);
|
|
671
|
-
const
|
|
683
|
+
const r = V((l) => {
|
|
672
684
|
n(l);
|
|
673
685
|
}, []);
|
|
674
|
-
return [
|
|
686
|
+
return [a, s, r];
|
|
675
687
|
}, sn = ({
|
|
676
688
|
sdk: e,
|
|
677
689
|
notification: s,
|
|
678
690
|
appNode: n,
|
|
679
691
|
responsiveStore: o
|
|
680
692
|
}) => {
|
|
681
|
-
var
|
|
693
|
+
var a, r;
|
|
682
694
|
const {
|
|
683
695
|
sdkInDesktopView: l
|
|
684
696
|
} = u(o, {
|
|
685
697
|
keys: ["sdkInDesktopView"]
|
|
686
698
|
}), {
|
|
687
699
|
sdk: d
|
|
688
|
-
} = B(), [
|
|
689
|
-
return s.type === x.QUESTION ? /* @__PURE__ */
|
|
700
|
+
} = B(), [i, c, p] = en(s.id);
|
|
701
|
+
return s.type === x.QUESTION ? /* @__PURE__ */ g(D, {
|
|
690
702
|
children: [/* @__PURE__ */ t(Xs, {
|
|
691
|
-
ref:
|
|
692
|
-
children: /* @__PURE__ */ t(
|
|
703
|
+
ref: i,
|
|
704
|
+
children: /* @__PURE__ */ t(H, {
|
|
693
705
|
...s
|
|
694
706
|
})
|
|
695
|
-
}), /* @__PURE__ */
|
|
707
|
+
}), /* @__PURE__ */ g(Hs, {
|
|
696
708
|
style: {
|
|
697
|
-
height: s.hiding ? 0 :
|
|
709
|
+
height: s.hiding ? 0 : c
|
|
698
710
|
},
|
|
699
711
|
hiding: s.hiding,
|
|
700
|
-
children: [/* @__PURE__ */ t(
|
|
712
|
+
children: [/* @__PURE__ */ t(me, {
|
|
701
713
|
style: {
|
|
702
714
|
height: "100%"
|
|
703
715
|
},
|
|
704
|
-
children: /* @__PURE__ */ t(
|
|
716
|
+
children: /* @__PURE__ */ t(H, {
|
|
705
717
|
...s,
|
|
706
718
|
controlVideo: d == null ? void 0 : d.controlVideoPlayer
|
|
707
719
|
})
|
|
708
720
|
}), /* @__PURE__ */ t(Ys, {}, s.id)]
|
|
709
721
|
})]
|
|
710
|
-
}) : s.type === x.QUESTION_RESOLVED && (
|
|
722
|
+
}) : s.type === x.QUESTION_RESOLVED && (r = (a = s.data) == null ? void 0 : a.question) != null && r.predictionResult ? /* @__PURE__ */ t(Me, {
|
|
711
723
|
style: {
|
|
712
|
-
height: s.hiding ? 0 :
|
|
724
|
+
height: s.hiding ? 0 : c
|
|
713
725
|
},
|
|
714
|
-
saveHeight:
|
|
726
|
+
saveHeight: p,
|
|
715
727
|
close: s.close,
|
|
716
728
|
hiding: s.hiding,
|
|
717
729
|
...s.data.question
|
|
718
730
|
}) : s.type === x.ONBOARDING ? /* @__PURE__ */ t(Ws, {
|
|
719
731
|
style: {
|
|
720
|
-
height: s.hiding ? 0 :
|
|
732
|
+
height: s.hiding ? 0 : c
|
|
721
733
|
},
|
|
722
|
-
saveHeight:
|
|
734
|
+
saveHeight: p,
|
|
723
735
|
sdk: e,
|
|
724
736
|
notification: s,
|
|
725
737
|
sdkInDesktopView: l,
|
|
@@ -731,86 +743,86 @@ const ds = {
|
|
|
731
743
|
setPill: s,
|
|
732
744
|
appNode: n,
|
|
733
745
|
headerNode: o,
|
|
734
|
-
scrollNode:
|
|
735
|
-
responsiveStore:
|
|
746
|
+
scrollNode: a,
|
|
747
|
+
responsiveStore: r,
|
|
736
748
|
scrollStore: l
|
|
737
749
|
}) => {
|
|
738
|
-
var d,
|
|
750
|
+
var d, i;
|
|
739
751
|
const {
|
|
740
|
-
screen:
|
|
741
|
-
} = u(
|
|
752
|
+
screen: c
|
|
753
|
+
} = u(r, {
|
|
742
754
|
keys: ["screen"]
|
|
743
755
|
}), {
|
|
744
|
-
tabsShown:
|
|
756
|
+
tabsShown: p,
|
|
745
757
|
scrollPosition: v
|
|
746
758
|
} = u(l, {
|
|
747
759
|
keys: ["tabsShown", "scrollPosition"]
|
|
748
760
|
});
|
|
749
761
|
k(() => {
|
|
750
|
-
|
|
751
|
-
}, [v,
|
|
752
|
-
const f =
|
|
753
|
-
return !e || !f.current ? null :
|
|
754
|
-
title: e.type === x.QUESTION_RESOLVED ? "Prediction result" : `New ${((
|
|
762
|
+
r.get().sdkInDesktopView ? v < 50 && s(null) : v > -50 && s(null);
|
|
763
|
+
}, [v, r, s]);
|
|
764
|
+
const f = r.get().sdkInDesktopView ? n : o;
|
|
765
|
+
return !e || !f.current ? null : Ue.createPortal(/* @__PURE__ */ t(Js, {
|
|
766
|
+
title: e.type === x.QUESTION_RESOLVED ? "Prediction result" : `New ${((i = ze[(d = e.data) == null ? void 0 : d.questionType]) == null ? void 0 : i.label) || "notification"}`,
|
|
755
767
|
onClick: () => {
|
|
756
768
|
var N;
|
|
757
|
-
|
|
769
|
+
r.get().sdkInDesktopView ? (N = a.current) == null || N.scrollTo({
|
|
758
770
|
top: 0,
|
|
759
771
|
behavior: "smooth"
|
|
760
|
-
}) : M(n,
|
|
772
|
+
}) : M(n, c.size, {
|
|
761
773
|
behavior: "smooth"
|
|
762
774
|
}), s(null);
|
|
763
775
|
},
|
|
764
|
-
className:
|
|
776
|
+
className: ue(p && nn, "sl-pill-button")
|
|
765
777
|
}), f.current);
|
|
766
778
|
}, on = ({
|
|
767
779
|
sdk: e,
|
|
768
780
|
headerNode: s,
|
|
769
781
|
scrollNode: n,
|
|
770
782
|
responsiveStore: o,
|
|
771
|
-
appNode:
|
|
772
|
-
scrollStore:
|
|
783
|
+
appNode: a,
|
|
784
|
+
scrollStore: r
|
|
773
785
|
}) => {
|
|
774
|
-
const [l] = E(e.getNotificationsStore()), d = u(l), [
|
|
786
|
+
const [l] = E(e.getNotificationsStore()), d = u(l), [i, c] = E(null), p = w(() => e.getActiveNotification(), [e, d]);
|
|
775
787
|
return k(() => {
|
|
776
|
-
|
|
788
|
+
p && Ke.emit("notification", {
|
|
777
789
|
action: "rendered",
|
|
778
790
|
payload: {
|
|
779
|
-
questionId:
|
|
780
|
-
questionType:
|
|
791
|
+
questionId: p.data.questionId,
|
|
792
|
+
questionType: p.data.questionType
|
|
781
793
|
}
|
|
782
794
|
});
|
|
783
|
-
}, [
|
|
784
|
-
|
|
785
|
-
|
|
795
|
+
}, [p]), k(() => {
|
|
796
|
+
p && (o.get().sdkInDesktopView || o.get().sdkInView) && (!o.get().sdkInDesktopView && o.get().sdkInView && c(p), o.get().sdkInDesktopView && window.requestAnimationFrame(() => {
|
|
797
|
+
r.get().scrollPosition !== 0 && c(p);
|
|
786
798
|
}));
|
|
787
|
-
}, [
|
|
788
|
-
|
|
789
|
-
}, [
|
|
790
|
-
children: [!
|
|
799
|
+
}, [p]), k(() => {
|
|
800
|
+
p || c(null);
|
|
801
|
+
}, [p]), /* @__PURE__ */ g(D, {
|
|
802
|
+
children: [!i && p && /* @__PURE__ */ t(sn, {
|
|
791
803
|
headerNode: s,
|
|
792
|
-
appNode:
|
|
804
|
+
appNode: a,
|
|
793
805
|
sdk: e,
|
|
794
|
-
notification:
|
|
806
|
+
notification: p,
|
|
795
807
|
responsiveStore: o
|
|
796
|
-
}),
|
|
797
|
-
pill:
|
|
798
|
-
setPill:
|
|
799
|
-
appNode:
|
|
800
|
-
notification:
|
|
808
|
+
}), i && /* @__PURE__ */ t(tn, {
|
|
809
|
+
pill: i,
|
|
810
|
+
setPill: c,
|
|
811
|
+
appNode: a,
|
|
812
|
+
notification: p,
|
|
801
813
|
headerNode: s,
|
|
802
814
|
scrollNode: n,
|
|
803
|
-
scrollStore:
|
|
815
|
+
scrollStore: r,
|
|
804
816
|
responsiveStore: o
|
|
805
817
|
})]
|
|
806
818
|
});
|
|
807
|
-
},
|
|
808
|
-
const s =
|
|
819
|
+
}, an = (e) => {
|
|
820
|
+
const s = L(""), [n, o] = E(!1), a = u(e.status), r = u(e.sdkStore.slStreamId), l = u(e.userId()), d = u(e.getActiveFeature()), i = a === "ready" && !!r.data;
|
|
809
821
|
k(() => {
|
|
810
|
-
const v = e.getFeature(
|
|
822
|
+
const v = e.getFeature($.GAMES);
|
|
811
823
|
v && (v.closeQuestion(), v.closeUser());
|
|
812
824
|
}, [d, e]);
|
|
813
|
-
const
|
|
825
|
+
const c = V(
|
|
814
826
|
(v) => {
|
|
815
827
|
s.current = v, o(!0), e.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: f, err: N }) => {
|
|
816
828
|
if (!N && f) {
|
|
@@ -822,12 +834,12 @@ const ds = {
|
|
|
822
834
|
});
|
|
823
835
|
},
|
|
824
836
|
[e]
|
|
825
|
-
),
|
|
837
|
+
), p = V(() => {
|
|
826
838
|
o(!1), e.disableApp();
|
|
827
839
|
}, [e]);
|
|
828
840
|
return k(() => {
|
|
829
841
|
if (!l) {
|
|
830
|
-
|
|
842
|
+
i && e.disableApp();
|
|
831
843
|
return;
|
|
832
844
|
}
|
|
833
845
|
if (l && s.current && n) {
|
|
@@ -840,29 +852,29 @@ const ds = {
|
|
|
840
852
|
o(!1), e.disableApp();
|
|
841
853
|
}, [o, e]), {
|
|
842
854
|
sdkEnabled: n,
|
|
843
|
-
sdkReady:
|
|
844
|
-
activateEventWithId:
|
|
845
|
-
deactivate:
|
|
855
|
+
sdkReady: i,
|
|
856
|
+
activateEventWithId: c,
|
|
857
|
+
deactivate: p,
|
|
846
858
|
isLogged: !!l
|
|
847
859
|
};
|
|
848
|
-
},
|
|
860
|
+
}, rn = ({ sdk: e, className: s, scrollStore: n, appNode: o, scrollNode: a, responsiveStore: r }) => {
|
|
849
861
|
const [, l] = je(e);
|
|
850
862
|
return /* @__PURE__ */ t(
|
|
851
|
-
|
|
863
|
+
ws,
|
|
852
864
|
{
|
|
853
865
|
className: s,
|
|
854
|
-
scrollNode:
|
|
866
|
+
scrollNode: a,
|
|
855
867
|
appNode: o,
|
|
856
868
|
scrollStore: n,
|
|
857
869
|
feature: l,
|
|
858
|
-
responsiveStore:
|
|
870
|
+
responsiveStore: r,
|
|
859
871
|
sdk: e
|
|
860
872
|
}
|
|
861
873
|
);
|
|
862
874
|
}, ln = ({ sdk: e, className: s, appNode: n, responsiveStore: o }) => {
|
|
863
|
-
const
|
|
864
|
-
return
|
|
865
|
-
const l = e.getFeature(
|
|
875
|
+
const a = u(e.featuresList.getStore());
|
|
876
|
+
return a ? Array.from(a, (r) => {
|
|
877
|
+
const l = e.getFeature(r);
|
|
866
878
|
return l ? /* @__PURE__ */ t(
|
|
867
879
|
$s,
|
|
868
880
|
{
|
|
@@ -872,53 +884,53 @@ const ds = {
|
|
|
872
884
|
responsiveStore: o,
|
|
873
885
|
sdk: e
|
|
874
886
|
},
|
|
875
|
-
|
|
887
|
+
r
|
|
876
888
|
) : null;
|
|
877
889
|
}) : null;
|
|
878
890
|
}, dn = ({ sdk: e, event: s }) => {
|
|
879
|
-
const n =
|
|
891
|
+
const n = L(null), o = L(null), [a] = Be(n), [r, l] = We(n, a), { sdkEnabled: d, sdkReady: i, activateEventWithId: c, deactivate: p, isLogged: v } = an(e);
|
|
880
892
|
k(() => {
|
|
881
|
-
s ? (e.createEventSession(s),
|
|
882
|
-
}, [s,
|
|
893
|
+
s ? (e.createEventSession(s), c(s)) : p();
|
|
894
|
+
}, [s, c, p, e]), _(n, { enabled: d, event: "click", listener: Xe }), _(r, {
|
|
883
895
|
enabled: d,
|
|
884
896
|
event: "scrollend",
|
|
885
897
|
listener: Ye,
|
|
886
898
|
useDomNode: !0
|
|
887
|
-
}), _(
|
|
899
|
+
}), _(r, {
|
|
888
900
|
enabled: d,
|
|
889
901
|
event: "click",
|
|
890
902
|
listener: Ze,
|
|
891
903
|
useDomNode: !0
|
|
892
904
|
});
|
|
893
|
-
const f =
|
|
905
|
+
const f = w(() => ({ sdk: e }), [e]);
|
|
894
906
|
return k(() => {
|
|
895
907
|
import("./gamification-feature.js");
|
|
896
|
-
}, []), /* @__PURE__ */ t(
|
|
897
|
-
d && /* @__PURE__ */ t(Ts, { className:
|
|
898
|
-
/* @__PURE__ */
|
|
899
|
-
|
|
908
|
+
}, []), /* @__PURE__ */ t(ve.Provider, { value: f, children: /* @__PURE__ */ g(Ge, { ref: n, children: [
|
|
909
|
+
d && /* @__PURE__ */ t(Ts, { className: F, sdk: e, ref: o }),
|
|
910
|
+
/* @__PURE__ */ g(He, { className: "sl-hide-on-modal", ref: r, "data-nav": d.toString(), children: [
|
|
911
|
+
i && /* @__PURE__ */ t(
|
|
900
912
|
on,
|
|
901
913
|
{
|
|
902
914
|
sdk: e,
|
|
903
|
-
scrollNode:
|
|
915
|
+
scrollNode: r,
|
|
904
916
|
headerNode: o,
|
|
905
917
|
appNode: n,
|
|
906
918
|
scrollStore: l,
|
|
907
|
-
responsiveStore:
|
|
919
|
+
responsiveStore: a
|
|
908
920
|
}
|
|
909
921
|
),
|
|
910
|
-
|
|
911
|
-
|
|
922
|
+
i && /* @__PURE__ */ t(
|
|
923
|
+
rn,
|
|
912
924
|
{
|
|
913
925
|
scrollStore: l,
|
|
914
|
-
responsiveStore:
|
|
915
|
-
scrollNode:
|
|
926
|
+
responsiveStore: a,
|
|
927
|
+
scrollNode: r,
|
|
916
928
|
appNode: n,
|
|
917
|
-
className:
|
|
929
|
+
className: F,
|
|
918
930
|
sdk: e
|
|
919
931
|
}
|
|
920
932
|
),
|
|
921
|
-
|
|
933
|
+
i && /* @__PURE__ */ t(ln, { responsiveStore: a, appNode: n, className: F, sdk: e })
|
|
922
934
|
] }),
|
|
923
935
|
d && !v && /* @__PURE__ */ t(
|
|
924
936
|
"div",
|
|
@@ -928,19 +940,19 @@ const ds = {
|
|
|
928
940
|
}
|
|
929
941
|
)
|
|
930
942
|
] }) });
|
|
931
|
-
}, cn = ({ children: e,
|
|
932
|
-
const { sdk: e } = z(
|
|
943
|
+
}, cn = ({ children: e, customTheme: s, style: n }) => /* @__PURE__ */ t("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ t("div", { className: ue(Je, s), style: n, children: e }) }), fn = () => {
|
|
944
|
+
const { sdk: e } = z(he);
|
|
933
945
|
return e;
|
|
934
946
|
}, kn = ({ event: e }) => {
|
|
935
|
-
const { sdk: s, status: n } = z(
|
|
936
|
-
if (n ===
|
|
947
|
+
const { sdk: s, status: n } = z(he);
|
|
948
|
+
if (n === j.UNSET)
|
|
937
949
|
throw new Error("Wrap app in `StreamLayerProvider`");
|
|
938
|
-
return n ===
|
|
950
|
+
return n === j.CONNECTED ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: "wait" }) : s === null ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: "sdk not initialized" }) : /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(cn, { children: /* @__PURE__ */ t(dn, { sdk: s, event: e }) }) });
|
|
939
951
|
};
|
|
940
952
|
export {
|
|
941
|
-
|
|
942
|
-
|
|
953
|
+
gn as E,
|
|
954
|
+
an as F,
|
|
943
955
|
kn as S,
|
|
944
|
-
cn as
|
|
956
|
+
cn as d,
|
|
945
957
|
fn as u
|
|
946
958
|
};
|